From 11eaf6138c4391a61f06783f618fa35c61603d25 Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 4 Jul 2023 14:16:24 +0100 Subject: [PATCH 001/156] added staging and deploy previews workflows --- .github/workflows/deploy.yaml | 25 +++++++++++++++++++++++++ .github/workflows/staging.yaml | 20 ++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/deploy.yaml create mode 100644 .github/workflows/staging.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 000000000..aa471a268 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,25 @@ +name: Deploy PR review + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed +concurrency: preview-${{ github.ref }} +jobs: + dev: + runs-on: ubuntu-latest + environment: dev + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install and Build + run: printf "would build and install here :)\n" + + - name: Deploy Preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./output/ diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml new file mode 100644 index 000000000..b6620e6e4 --- /dev/null +++ b/.github/workflows/staging.yaml @@ -0,0 +1,20 @@ +name: deploy to staging environment + +on: + workflow_dispatch: +jobs: + staging: + concurrency: ci-${{ github.ref }} + runs-on: ubuntu-latest + environment: staging + if: github.ref == 'refs/heads/main' + + steps: + - name: checkout + uses: actions/checkout@v3 + - name: Install and Build + run: printf "would build and install here :)\n" + - name: Deploy Staging + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: ./output/ From 52686f64d5fe0800c94a549938806f6d5ec20ebf Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 4 Jul 2023 14:44:03 +0100 Subject: [PATCH 002/156] added build process in workflows --- .github/workflows/deploy.yaml | 11 +++++++++-- .github/workflows/staging.yaml | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index aa471a268..0a50b94d4 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -16,8 +16,15 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Install and Build - run: printf "would build and install here :)\n" + - name: Set up ruby + uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 + with: + ruby-version: "2.6.5" + - name: Install dependencies + run: bundle install + - name: build website + run: | + rake - name: Deploy Preview uses: rossjrw/pr-preview-action@v1 diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index b6620e6e4..05bd22034 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -12,8 +12,19 @@ jobs: steps: - name: checkout uses: actions/checkout@v3 - - name: Install and Build - run: printf "would build and install here :)\n" + + - name: Set up ruby + uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 + with: + ruby-version: "2.6.5" + + - name: Install dependencies + run: bundle install + + - name: Build website + run: | + rake + - name: Deploy Staging uses: JamesIves/github-pages-deploy-action@v4 with: From 8096ebb077488d45d32b530815fa1a71d64954e7 Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 4 Jul 2023 14:51:31 +0100 Subject: [PATCH 003/156] added build process in workflows --- .github/workflows/staging.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index 05bd22034..27f83e476 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -23,6 +23,7 @@ jobs: - name: Build website run: | + pwd rake - name: Deploy Staging From 9eb7f9e40a04119235b039f83cc5223f6391f30e Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 4 Jul 2023 14:56:16 +0100 Subject: [PATCH 004/156] testing --- .github/workflows/staging.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index 27f83e476..13a9d62c1 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -19,7 +19,9 @@ jobs: ruby-version: "2.6.5" - name: Install dependencies - run: bundle install + run: | + gem install bundler + bundle install - name: Build website run: | From c11c155547416d99ded45f1032d91ccf9c8132d8 Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 4 Jul 2023 14:59:44 +0100 Subject: [PATCH 005/156] testing --- .github/workflows/deploy.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 0a50b94d4..f7985d891 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -22,9 +22,11 @@ jobs: ruby-version: "2.6.5" - name: Install dependencies run: bundle install + - name: build website run: | - rake + gem install bundler + bundle install - name: Deploy Preview uses: rossjrw/pr-preview-action@v1 From ae7a0f33b0f73cb58d55a47dfdc2fae464bb6550 Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 4 Jul 2023 15:02:14 +0100 Subject: [PATCH 006/156] testing --- .github/workflows/deploy.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index f7985d891..5f3a6bd4e 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -20,14 +20,17 @@ jobs: uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 with: ruby-version: "2.6.5" - - name: Install dependencies - run: bundle install - - name: build website + - name: Install dependencies run: | gem install bundler bundle install + - name: build website + run: | + pwd + rake + - name: Deploy Preview uses: rossjrw/pr-preview-action@v1 with: From cbcc5243dc197706074cbdb4519a0b030c8cfd35 Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 4 Jul 2023 15:42:54 +0100 Subject: [PATCH 007/156] testing --- .github/workflows/{deploy.yaml => pr_deploy.yaml} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename .github/workflows/{deploy.yaml => pr_deploy.yaml} (92%) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/pr_deploy.yaml similarity index 92% rename from .github/workflows/deploy.yaml rename to .github/workflows/pr_deploy.yaml index 5f3a6bd4e..e5302dcca 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -1,4 +1,4 @@ -name: Deploy PR review +name: Pr Preview on: pull_request: @@ -30,6 +30,8 @@ jobs: run: | pwd rake + cd output + ls -la - name: Deploy Preview uses: rossjrw/pr-preview-action@v1 From be00000c5896b0fcf14fdfeb890a31efa05c58cc Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 4 Jul 2023 16:17:35 +0100 Subject: [PATCH 008/156] testing --- .github/workflows/pr_deploy.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index e5302dcca..701632d0e 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -37,3 +37,4 @@ jobs: uses: rossjrw/pr-preview-action@v1 with: source-dir: ./output/ + custom-url: https://nearform.github.io/bioconductor.org/pr-preview/pr-1/output/ From 6b3466250bef395f82db980fc915b6eb895a4c2a Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 4 Jul 2023 16:21:53 +0100 Subject: [PATCH 009/156] testing --- .github/workflows/pr_deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 701632d0e..caf8434ef 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -37,4 +37,4 @@ jobs: uses: rossjrw/pr-preview-action@v1 with: source-dir: ./output/ - custom-url: https://nearform.github.io/bioconductor.org/pr-preview/pr-1/output/ + custom-url: https://nearform.github.io/bioconductor.org/pr-preview/pr-1/output From 90cc47a96a61b2e811ad1dc77c12e6b2291cf9fa Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 12:40:48 +0100 Subject: [PATCH 010/156] testing pr s3 bucket --- .github/workflows/pr_close.yaml | 18 ++++++++++++++++++ .github/workflows/pr_deploy.yaml | 30 ++++++++++++------------------ 2 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/pr_close.yaml diff --git a/.github/workflows/pr_close.yaml b/.github/workflows/pr_close.yaml new file mode 100644 index 000000000..a836e9973 --- /dev/null +++ b/.github/workflows/pr_close.yaml @@ -0,0 +1,18 @@ +name: PR - Closed +on: + pull_request: + types: [closed] + +jobs: + dev-pr-close-s3: + runs-on: ubuntu-latest + environment: dev + steps: + - name: Delete Website Bucket + uses: danburtenshaw/s3-website-pr-action@v2 + with: + bucket-prefix: "PR-preview-bioconductor" + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index caf8434ef..5e8ed8a0e 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -1,15 +1,9 @@ -name: Pr Preview - +name: Pr - Preview on: pull_request: - types: - - opened - - reopened - - synchronize - - closed -concurrency: preview-${{ github.ref }} + types: [opened, reopened, synchronize] jobs: - dev: + dev-pr-create-s3: runs-on: ubuntu-latest environment: dev steps: @@ -27,14 +21,14 @@ jobs: bundle install - name: build website - run: | - pwd - rake - cd output - ls -la + run: rake - - name: Deploy Preview - uses: rossjrw/pr-preview-action@v1 + - name: Deploy S3 Website + uses: danburtenshaw/s3-website-pr-action@v2 with: - source-dir: ./output/ - custom-url: https://nearform.github.io/bioconductor.org/pr-preview/pr-1/output + bucket-prefix: "PR-preview-bioconductor" + folder-to-copy: "./output" + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8d02230e78e01f2cb5feab495f48414787ed53cc Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 12:49:00 +0100 Subject: [PATCH 011/156] testing-aws-s3-pr --- .github/workflows/pr_close.yaml | 2 +- .github/workflows/pr_deploy.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_close.yaml b/.github/workflows/pr_close.yaml index a836e9973..2dbba1d06 100644 --- a/.github/workflows/pr_close.yaml +++ b/.github/workflows/pr_close.yaml @@ -9,7 +9,7 @@ jobs: environment: dev steps: - name: Delete Website Bucket - uses: danburtenshaw/s3-website-pr-action@v2 + uses: danburtenshaw/s3-website-pr-action@v2.0.1 with: bucket-prefix: "PR-preview-bioconductor" env: diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 5e8ed8a0e..c18dc0fbf 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -24,7 +24,7 @@ jobs: run: rake - name: Deploy S3 Website - uses: danburtenshaw/s3-website-pr-action@v2 + uses: danburtenshaw/s3-website-pr-action@v2.0.1 with: bucket-prefix: "PR-preview-bioconductor" folder-to-copy: "./output" From 8d1c1408cff1af4ad4afbf98d5d0ffa8498fadaf Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 13:13:33 +0100 Subject: [PATCH 012/156] testing-aws-s3-pr --- .github/workflows/pr_deploy.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index c18dc0fbf..69e107ce9 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -19,6 +19,7 @@ jobs: run: | gem install bundler bundle install + pwd - name: build website run: rake From 5535884c3b79b2c27b580065d08826bef488a4ea Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 13:18:32 +0100 Subject: [PATCH 013/156] testing-aws-s3-pr --- .github/workflows/pr_deploy.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 69e107ce9..c18dc0fbf 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -19,7 +19,6 @@ jobs: run: | gem install bundler bundle install - pwd - name: build website run: rake From ee3ff04e55764bc640d08b11a25257ccc9fcd085 Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 13:25:26 +0100 Subject: [PATCH 014/156] testing-aws-s3-pr --- .github/workflows/pr_close.yaml | 2 +- .github/workflows/pr_deploy.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_close.yaml b/.github/workflows/pr_close.yaml index 2dbba1d06..4b3d517db 100644 --- a/.github/workflows/pr_close.yaml +++ b/.github/workflows/pr_close.yaml @@ -11,7 +11,7 @@ jobs: - name: Delete Website Bucket uses: danburtenshaw/s3-website-pr-action@v2.0.1 with: - bucket-prefix: "PR-preview-bioconductor" + bucket-prefix: "pr-preview-bioconductor" env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index c18dc0fbf..8306a18d3 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -26,7 +26,7 @@ jobs: - name: Deploy S3 Website uses: danburtenshaw/s3-website-pr-action@v2.0.1 with: - bucket-prefix: "PR-preview-bioconductor" + bucket-prefix: "pr-preview-bioconductor" folder-to-copy: "./output" env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 2e65d9c845678f6d994eaaadb840be8c3ad2445f Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 15:17:45 +0100 Subject: [PATCH 015/156] testing-aws-s3-pr --- .github/workflows/pr_deploy.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 8306a18d3..2b4d42bed 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -23,6 +23,21 @@ jobs: - name: build website run: rake + - name: Create Bucket + run: | + if aws s3api head-bucket --bucket pr-preview-bioconductor${{github.event.number}} 2>/dev/null; then + echo "Bucket already exists" + else + aws s3 mb s3://${{github.event.number}} + aws s3api delete-public-access-block --bucket pr-preview-bioconductor${{github.event.number}} + aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor${{github.event.number}} + aws s3api put-bucket-website --bucket pr-preview-bioconductor${{github.event.number}} \ + --website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}' + fi + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Deploy S3 Website uses: danburtenshaw/s3-website-pr-action@v2.0.1 with: From 28ef2b5ef2b2e8dca2741d976ef2e36220f054ca Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 15:22:19 +0100 Subject: [PATCH 016/156] testing-aws-s3-pr --- .github/workflows/pr_deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 2b4d42bed..d5f0f7016 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -28,7 +28,7 @@ jobs: if aws s3api head-bucket --bucket pr-preview-bioconductor${{github.event.number}} 2>/dev/null; then echo "Bucket already exists" else - aws s3 mb s3://${{github.event.number}} + aws s3 mb s3://pr-preview-bioconductor${{github.event.number}} aws s3api delete-public-access-block --bucket pr-preview-bioconductor${{github.event.number}} aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor${{github.event.number}} aws s3api put-bucket-website --bucket pr-preview-bioconductor${{github.event.number}} \ From 18b3e60bc8d01f4bbc61b363f91c7be1628039f8 Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 16:02:01 +0100 Subject: [PATCH 017/156] testing-aws-s3-pr --- .github/workflows/pr_deploy.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index d5f0f7016..fd266311f 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -25,13 +25,13 @@ jobs: - name: Create Bucket run: | - if aws s3api head-bucket --bucket pr-preview-bioconductor${{github.event.number}} 2>/dev/null; then + if aws s3api head-bucket --bucket pr-preview-bioconductor-pr${{github.event.number}} 2>/dev/null; then echo "Bucket already exists" else - aws s3 mb s3://pr-preview-bioconductor${{github.event.number}} - aws s3api delete-public-access-block --bucket pr-preview-bioconductor${{github.event.number}} - aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor${{github.event.number}} - aws s3api put-bucket-website --bucket pr-preview-bioconductor${{github.event.number}} \ + aws s3 mb s3://pr-preview-bioconductor-pr${{github.event.number}} + aws s3api delete-public-access-block --bucket pr-preview-bioconductor-pr${{github.event.number}} + aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor-pr${{github.event.number}} + aws s3api put-bucket-website --bucket pr-preview-bioconductor-pr${{github.event.number}} \ --website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}' fi env: From f06117c289c02987199020c1afa6afca7fd8a392 Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 16:05:21 +0100 Subject: [PATCH 018/156] testing-aws-s3-pr --- .github/workflows/pr_deploy.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index fd266311f..427c32ef0 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -25,19 +25,19 @@ jobs: - name: Create Bucket run: | - if aws s3api head-bucket --bucket pr-preview-bioconductor-pr${{github.event.number}} 2>/dev/null; then + if aws s3api head-bucket --bucket pr-preview-bioconductor${{github.event.number}} 2>/dev/null; then echo "Bucket already exists" else - aws s3 mb s3://pr-preview-bioconductor-pr${{github.event.number}} - aws s3api delete-public-access-block --bucket pr-preview-bioconductor-pr${{github.event.number}} - aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor-pr${{github.event.number}} - aws s3api put-bucket-website --bucket pr-preview-bioconductor-pr${{github.event.number}} \ + aws s3 mb s3://pr-preview-bioconductor${{github.event.number}} + aws s3api delete-public-access-block --bucket pr-preview-bioconductor${{github.event.number}} + aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor${{github.event.number}} + aws s3api put-bucket-website --bucket pr-preview-bioconductor${{github.event.number}} \ --website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}' fi env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: "us-east-1" - name: Deploy S3 Website uses: danburtenshaw/s3-website-pr-action@v2.0.1 with: From b0ff4a6a32600596c0bf9a1c21fe42f43a1463b5 Mon Sep 17 00:00:00 2001 From: mariam Date: Thu, 6 Jul 2023 17:14:34 +0100 Subject: [PATCH 019/156] added a dash after the bucket names --- .github/workflows/pr_deploy.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 427c32ef0..efc129e85 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -28,10 +28,10 @@ jobs: if aws s3api head-bucket --bucket pr-preview-bioconductor${{github.event.number}} 2>/dev/null; then echo "Bucket already exists" else - aws s3 mb s3://pr-preview-bioconductor${{github.event.number}} - aws s3api delete-public-access-block --bucket pr-preview-bioconductor${{github.event.number}} - aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor${{github.event.number}} - aws s3api put-bucket-website --bucket pr-preview-bioconductor${{github.event.number}} \ + aws s3 mb s3://pr-preview-bioconductor-${{github.event.number}} + aws s3api delete-public-access-block --bucket pr-preview-bioconductor-${{github.event.number}} + aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor-${{github.event.number}} + aws s3api put-bucket-website --bucket pr-preview-bioconductor-${{github.event.number}} \ --website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}' fi env: From 441c36c790f999d7200961be43afc28a14595a03 Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 17:17:22 +0100 Subject: [PATCH 020/156] testing pr s3 bucket --- .github/workflows/pr_deploy.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 427c32ef0..b4d85ea61 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -25,13 +25,13 @@ jobs: - name: Create Bucket run: | - if aws s3api head-bucket --bucket pr-preview-bioconductor${{github.event.number}} 2>/dev/null; then + if aws s3api head-bucket --bucket pr-preview-bioconductor-${{github.event.number}} 2>/dev/null; then echo "Bucket already exists" else - aws s3 mb s3://pr-preview-bioconductor${{github.event.number}} - aws s3api delete-public-access-block --bucket pr-preview-bioconductor${{github.event.number}} - aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor${{github.event.number}} - aws s3api put-bucket-website --bucket pr-preview-bioconductor${{github.event.number}} \ + aws s3 mb s3://pr-preview-bioconductor-${{github.event.number}} + aws s3api delete-public-access-block --bucket pr-preview-bioconductor-${{github.event.number}} + aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor-${{github.event.number}} + aws s3api put-bucket-website --bucket pr-preview-bioconductor-${{github.event.number}} \ --website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}' fi env: From 2b0baedac017302a07af60a443cf0f2823b71bf6 Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 17:35:38 +0100 Subject: [PATCH 021/156] testing pr s3 bucket revert --- .github/workflows/pr_deploy.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index b4d85ea61..9ec22481d 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -25,19 +25,20 @@ jobs: - name: Create Bucket run: | - if aws s3api head-bucket --bucket pr-preview-bioconductor-${{github.event.number}} 2>/dev/null; then + if aws s3api head-bucket --bucket pr-preview-bioconductor-pr${{github.event.number}} 2>/dev/null; then echo "Bucket already exists" else - aws s3 mb s3://pr-preview-bioconductor-${{github.event.number}} - aws s3api delete-public-access-block --bucket pr-preview-bioconductor-${{github.event.number}} - aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor-${{github.event.number}} - aws s3api put-bucket-website --bucket pr-preview-bioconductor-${{github.event.number}} \ + aws s3 mb s3://pr-preview-bioconductor-pr${{github.event.number}} + aws s3api delete-public-access-block --bucket pr-preview-bioconductor-pr${{github.event.number}} + aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor-pr${{github.event.number}} + aws s3api put-bucket-website --bucket pr-preview-bioconductor-pr${{github.event.number}} \ + --website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}' fi env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: "us-east-1" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Deploy S3 Website uses: danburtenshaw/s3-website-pr-action@v2.0.1 with: From 1b41fdf232151eac75ec0f18d2a5f7bc881fbef2 Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 17:36:28 +0100 Subject: [PATCH 022/156] testing pr s3 bucket revert --- .github/workflows/pr_deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 9ec22481d..993730884 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -38,7 +38,7 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_REGION: "us-east-1" - name: Deploy S3 Website uses: danburtenshaw/s3-website-pr-action@v2.0.1 with: From 1de10d98d88fd13976af8a1c7b34637dfedce32f Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 17:42:08 +0100 Subject: [PATCH 023/156] testing pr s3 bucket with dashes --- .github/workflows/pr_deploy.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 993730884..59d22867d 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -22,17 +22,15 @@ jobs: - name: build website run: rake - - name: Create Bucket run: | - if aws s3api head-bucket --bucket pr-preview-bioconductor-pr${{github.event.number}} 2>/dev/null; then + if aws s3api head-bucket --bucket pr-preview-bioconductor-${{github.event.number}} 2>/dev/null; then echo "Bucket already exists" else - aws s3 mb s3://pr-preview-bioconductor-pr${{github.event.number}} - aws s3api delete-public-access-block --bucket pr-preview-bioconductor-pr${{github.event.number}} - aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor-pr${{github.event.number}} - aws s3api put-bucket-website --bucket pr-preview-bioconductor-pr${{github.event.number}} \ - + aws s3 mb s3://pr-preview-bioconductor-${{github.event.number}} + aws s3api delete-public-access-block --bucket pr-preview-bioconductor-${{github.event.number}} + aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor-${{github.event.number}} + aws s3api put-bucket-website --bucket pr-preview-bioconductor-${{github.event.number}} \ --website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}' fi env: From 10f6e4ad426e079d9a332f86851dc134df1bd1a4 Mon Sep 17 00:00:00 2001 From: bp289 Date: Thu, 6 Jul 2023 17:49:44 +0100 Subject: [PATCH 024/156] testing pr s3 bucket with dashes --- .github/workflows/pr_deploy.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 59d22867d..f6331e620 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -24,13 +24,13 @@ jobs: run: rake - name: Create Bucket run: | - if aws s3api head-bucket --bucket pr-preview-bioconductor-${{github.event.number}} 2>/dev/null; then + if aws s3api head-bucket --bucket pr-preview-bioconductor-pr${{github.event.number}} 2>/dev/null; then echo "Bucket already exists" else - aws s3 mb s3://pr-preview-bioconductor-${{github.event.number}} - aws s3api delete-public-access-block --bucket pr-preview-bioconductor-${{github.event.number}} - aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor-${{github.event.number}} - aws s3api put-bucket-website --bucket pr-preview-bioconductor-${{github.event.number}} \ + aws s3 mb s3://pr-preview-bioconductor-pr${{github.event.number}} + aws s3api delete-public-access-block --bucket pr-preview-bioconductor-pr${{github.event.number}} + aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor-pr${{github.event.number}} + aws s3api put-bucket-website --bucket pr-preview-bioconductor-pr${{github.event.number}} \ --website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}' fi env: From 16698533b13e3dfdca7a0dd65705feb1c3f3b424 Mon Sep 17 00:00:00 2001 From: bp289 Date: Fri, 7 Jul 2023 11:01:07 +0100 Subject: [PATCH 025/156] testing pr s3 bucket with dashes --- test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 000000000..68a4528a6 --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +this is a test file \ No newline at end of file From 0288a4d4b5e303eba1f868dbfabcd12df84c34f8 Mon Sep 17 00:00:00 2001 From: bp289 Date: Fri, 7 Jul 2023 11:12:32 +0100 Subject: [PATCH 026/156] testing pr s3 bucket with dashes --- .github/workflows/pr_close.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pr_close.yaml b/.github/workflows/pr_close.yaml index 4b3d517db..115ed7973 100644 --- a/.github/workflows/pr_close.yaml +++ b/.github/workflows/pr_close.yaml @@ -8,6 +8,12 @@ jobs: runs-on: ubuntu-latest environment: dev steps: + - name: Empty Website Bucket + run: aws s3 rm s3://pr-preview-bioconductor-pr${{github.event.number}} --recursive + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: "us-east-1" - name: Delete Website Bucket uses: danburtenshaw/s3-website-pr-action@v2.0.1 with: From 2725037c905ec94bc3a4a40c963c0c65376358df Mon Sep 17 00:00:00 2001 From: mariam Date: Mon, 10 Jul 2023 12:49:04 +0100 Subject: [PATCH 027/156] made changes to the dockerfile --- Dockerfile | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 570977fd3..e4ce53619 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,33 @@ FROM ruby:2.6.5 ## System dependencies - -RUN apt-get update && apt install -y \ - rsync \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y \ + rsync \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* ## Install gems - COPY Gemfile /tmp COPY Gemfile.lock /tmp -WORKDIR /tmp -## RUN bundle lock + +## Set the working directory to /tmp/bioconductor.org +WORKDIR /tmp/bioconductor.org + +## Copy the remaining files from bioconductor.org/ to /tmp/bioconductor.org +COPY . . + +## Install bundle and dependencies +RUN gem install bundler RUN bundle install --jobs=4 && bundle clean --force ## Set up web server - EXPOSE 3000 ## Create startup script - -RUN echo '#! /bin/bash \n\ - cd /bioconductor.org \n\ - rake \n\ - cd output \n\ - adsf\n' > .startup.sh \\ +RUN echo '#! /bin/bash' > .startup.sh \ + && echo 'rake' >> .startup.sh \ + && echo 'cd output' >> .startup.sh \ + && echo 'adsf' >> .startup.sh \ && chmod +x .startup.sh CMD ["./.startup.sh"] From 51c3dc6e6454ed340c2576293e2a89bff4e06f4a Mon Sep 17 00:00:00 2001 From: bp289 Date: Mon, 10 Jul 2023 13:35:48 +0100 Subject: [PATCH 028/156] testing pr s3 bucket with dashes --- .github/workflows/staging.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index 13a9d62c1..7724af31a 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -7,7 +7,7 @@ jobs: concurrency: ci-${{ github.ref }} runs-on: ubuntu-latest environment: staging - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/redesign2023' steps: - name: checkout @@ -25,10 +25,13 @@ jobs: - name: Build website run: | - pwd rake - - - name: Deploy Staging - uses: JamesIves/github-pages-deploy-action@v4 + - name: Deploy website to staging s3 + uses: Reggionick/s3-deploy@v4.0.0 with: - folder: ./output/ + folder: output + bucket: ${{secrets.S3_BUCKET}} + bucket-region: us-east-1 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 4cd3a086622168f985d83b7b359667eb659e40e0 Mon Sep 17 00:00:00 2001 From: bp289 Date: Mon, 10 Jul 2023 13:36:17 +0100 Subject: [PATCH 029/156] added staging yaml, with secrets set up --- .github/workflows/staging.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index 7724af31a..4798fb379 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -32,6 +32,7 @@ jobs: folder: output bucket: ${{secrets.S3_BUCKET}} bucket-region: us-east-1 + delete-removed: true env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From b416054329f3b2ee085827b749d9ddea9b89e09c Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 11 Jul 2023 10:14:24 +0100 Subject: [PATCH 030/156] added ability to only run pr preview on certian branches --- .github/workflows/pr_deploy.yaml | 3 +++ .github/workflows/staging.yaml | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index f6331e620..cb5ce532b 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -2,6 +2,9 @@ name: Pr - Preview on: pull_request: types: [opened, reopened, synchronize] + branches: + - "bugfix/**" + - "feature/**" jobs: dev-pr-create-s3: runs-on: ubuntu-latest diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index 4798fb379..8ed5e6d9b 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -1,13 +1,14 @@ name: deploy to staging environment on: - workflow_dispatch: + push: + branches: + - redesign2023 jobs: staging: concurrency: ci-${{ github.ref }} runs-on: ubuntu-latest environment: staging - if: github.ref == 'refs/heads/redesign2023' steps: - name: checkout From ae914c48702649cbcd3c9281d4851eadc3e05ba8 Mon Sep 17 00:00:00 2001 From: mariam Date: Tue, 11 Jul 2023 12:10:23 +0100 Subject: [PATCH 031/156] modified dockerfile further --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e4ce53619..660672a65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,13 +7,13 @@ RUN apt-get update && apt-get install -y \ && rm -rf /var/lib/apt/lists/* ## Install gems -COPY Gemfile /tmp -COPY Gemfile.lock /tmp +COPY Gemfile /opt +COPY Gemfile.lock /opt ## Set the working directory to /tmp/bioconductor.org -WORKDIR /tmp/bioconductor.org +WORKDIR /opt/bioconductor.org -## Copy the remaining files from bioconductor.org/ to /tmp/bioconductor.org +## Copy the remaining files from bioconductor.org/ to /opt/bioconductor.org COPY . . ## Install bundle and dependencies @@ -25,9 +25,10 @@ EXPOSE 3000 ## Create startup script RUN echo '#! /bin/bash' > .startup.sh \ + && echo 'cd /opt/bioconductor.org' >> .startup.sh \ && echo 'rake' >> .startup.sh \ && echo 'cd output' >> .startup.sh \ && echo 'adsf' >> .startup.sh \ && chmod +x .startup.sh -CMD ["./.startup.sh"] +CMD ["/opt/bioconductor.org/.startup.sh"] From 5d0a25ddea7a57e30dafe4caa892fe70a1ab2ea9 Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Tue, 11 Jul 2023 12:22:53 +0100 Subject: [PATCH 032/156] Update .github/workflows/pr_deploy.yaml Co-authored-by: Mariam Mohamed <104569563+Mariam-mohamed110@users.noreply.github.com> --- .github/workflows/pr_deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index cb5ce532b..3ca53b6dc 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -4,7 +4,7 @@ on: types: [opened, reopened, synchronize] branches: - "bugfix/**" - - "feature/**" + - "feat/**" jobs: dev-pr-create-s3: runs-on: ubuntu-latest From be4c0682e335712c6b65f60f09c1ef88e55a4ce9 Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Tue, 11 Jul 2023 12:23:06 +0100 Subject: [PATCH 033/156] Update .github/workflows/pr_deploy.yaml Co-authored-by: Mariam Mohamed <104569563+Mariam-mohamed110@users.noreply.github.com> --- .github/workflows/pr_deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 3ca53b6dc..e98687189 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -3,7 +3,7 @@ on: pull_request: types: [opened, reopened, synchronize] branches: - - "bugfix/**" + - "fix/**" - "feat/**" jobs: dev-pr-create-s3: From 563aa10d882c12b50898528889b5179a95b14cd9 Mon Sep 17 00:00:00 2001 From: mariam Date: Tue, 11 Jul 2023 12:27:40 +0100 Subject: [PATCH 034/156] pulled from redesign branch --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 660672a65..2028a06b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y \ COPY Gemfile /opt COPY Gemfile.lock /opt -## Set the working directory to /tmp/bioconductor.org +## Set the working directory to /opt/bioconductor.org WORKDIR /opt/bioconductor.org ## Copy the remaining files from bioconductor.org/ to /opt/bioconductor.org From 207305ef9fe40b926ee4648fadd845c71858aadf Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 11 Jul 2023 12:51:45 +0100 Subject: [PATCH 035/156] added ability to run only if it is not on draft pr --- .github/workflows/linter.yaml | 27 + .github/workflows/pr_deploy.yaml | 1 + .stylelintrc.json | 1 + node_modules/.bin/cssesc | 1 + node_modules/.bin/js-yaml | 1 + node_modules/.bin/nanoid | 1 + node_modules/.bin/rimraf | 1 + node_modules/.bin/semver | 1 + node_modules/.bin/stylelint | 1 + node_modules/.bin/which | 1 + node_modules/.package-lock.json | 2063 ++++ node_modules/@babel/code-frame/LICENSE | 22 + node_modules/@babel/code-frame/README.md | 19 + node_modules/@babel/code-frame/lib/index.js | 142 + .../@babel/code-frame/lib/index.js.map | 1 + node_modules/@babel/code-frame/package.json | 28 + .../helper-validator-identifier/LICENSE | 22 + .../helper-validator-identifier/README.md | 19 + .../lib/identifier.js | 70 + .../lib/identifier.js.map | 1 + .../helper-validator-identifier/lib/index.js | 57 + .../lib/index.js.map | 1 + .../lib/keyword.js | 35 + .../lib/keyword.js.map | 1 + .../helper-validator-identifier/package.json | 28 + .../scripts/generate-identifier-regex.js | 75 + node_modules/@babel/highlight/LICENSE | 22 + node_modules/@babel/highlight/README.md | 19 + node_modules/@babel/highlight/lib/index.js | 96 + .../@babel/highlight/lib/index.js.map | 1 + node_modules/@babel/highlight/package.json | 30 + .../css-parser-algorithms/CHANGELOG.md | 53 + .../css-parser-algorithms/LICENSE.md | 20 + .../@csstools/css-parser-algorithms/README.md | 115 + .../consume-component-block-function.d.ts | 118 + .../css-parser-algorithms/dist/index.cjs | 1 + .../css-parser-algorithms/dist/index.d.ts | 10 + .../css-parser-algorithms/dist/index.mjs | 1 + .../dist/interfaces/context.d.ts | 4 + ...ma-separated-list-of-component-values.d.ts | 5 + .../dist/parse/parse-component-value.d.ts | 4 + .../parse/parse-list-of-component-values.d.ts | 5 + .../dist/util/component-value-type.d.ts | 7 + .../dist/util/node-ancestry.d.ts | 7 + .../dist/util/replace-component-values.d.ts | 2 + .../dist/util/source-indices.d.ts | 9 + .../dist/util/stringify.d.ts | 2 + .../dist/util/type-predicates.d.ts | 6 + .../css-parser-algorithms/package.json | 72 + .../@csstools/css-tokenizer/CHANGELOG.md | 28 + .../@csstools/css-tokenizer/LICENSE.md | 20 + .../@csstools/css-tokenizer/README.md | 108 + .../four-code-points-would-start-cdo.d.ts | 3 + .../dist/checks/matches-url-ident.d.ts | 2 + .../three-code-points-would-start-cdc.d.ts | 3 + ...ode-points-would-start-ident-sequence.d.ts | 3 + .../three-code-points-would-start-number.d.ts | 3 + .../two-code-points-are-valid-escape.d.ts | 3 + .../checks/two-code-points-start-comment.d.ts | 3 + .../dist/code-points/code-points.d.ts | 78 + .../dist/code-points/ranges.d.ts | 12 + .../css-tokenizer/dist/consume/bad-url.d.ts | 3 + .../css-tokenizer/dist/consume/comment.d.ts | 4 + .../dist/consume/escaped-code-point.d.ts | 3 + .../dist/consume/hash-token.d.ts | 4 + .../dist/consume/ident-like-token.d.ts | 4 + .../dist/consume/ident-sequence.d.ts | 3 + .../css-tokenizer/dist/consume/number.d.ts | 4 + .../dist/consume/numeric-token.d.ts | 4 + .../dist/consume/string-token.d.ts | 4 + .../css-tokenizer/dist/consume/url-token.d.ts | 4 + .../dist/consume/whitespace-token.d.ts | 4 + .../@csstools/css-tokenizer/dist/index.cjs | 1 + .../@csstools/css-tokenizer/dist/index.d.ts | 9 + .../@csstools/css-tokenizer/dist/index.mjs | 1 + .../dist/interfaces/code-point-reader.d.ts | 10 + .../dist/interfaces/context.d.ts | 4 + .../css-tokenizer/dist/interfaces/error.d.ts | 9 + .../css-tokenizer/dist/interfaces/token.d.ts | 128 + .../@csstools/css-tokenizer/dist/reader.d.ts | 13 + .../css-tokenizer/dist/stringify.d.ts | 2 + .../css-tokenizer/dist/tokenizer.d.ts | 19 + .../css-tokenizer/dist/util/clone-tokens.d.ts | 2 + .../css-tokenizer/dist/util/mutations.d.ts | 2 + .../@csstools/css-tokenizer/package.json | 67 + .../media-query-list-parser/CHANGELOG.md | 64 + .../media-query-list-parser/LICENSE.md | 20 + .../media-query-list-parser/README.md | 61 + .../media-query-list-parser/dist/index.cjs | 1 + .../media-query-list-parser/dist/index.d.ts | 23 + .../media-query-list-parser/dist/index.mjs | 1 + .../dist/nodes/custom-media.d.ts | 44 + .../dist/nodes/general-enclosed.d.ts | 25 + .../dist/nodes/media-and.d.ts | 23 + .../dist/nodes/media-condition-list.d.ts | 50 + .../dist/nodes/media-condition.d.ts | 24 + .../dist/nodes/media-feature-boolean.d.ts | 27 + .../dist/nodes/media-feature-comparison.d.ts | 17 + .../dist/nodes/media-feature-name.d.ts | 24 + .../dist/nodes/media-feature-plain.d.ts | 42 + .../dist/nodes/media-feature-range.d.ts | 124 + .../dist/nodes/media-feature-value.d.ts | 31 + .../dist/nodes/media-feature.d.ts | 45 + .../dist/nodes/media-in-parens.d.ts | 41 + .../dist/nodes/media-not.d.ts | 32 + .../dist/nodes/media-or.d.ts | 32 + .../dist/nodes/media-query-modifier.d.ts | 6 + .../dist/nodes/media-query.d.ts | 83 + .../dist/nodes/media-type.d.ts | 24 + .../dist/parser/parse-custom-media.d.ts | 8 + .../dist/parser/parse-media-query.d.ts | 24 + .../dist/parser/parse.d.ts | 8 + .../dist/util/clone-media-query.d.ts | 2 + .../dist/util/component-value-is.d.ts | 5 + .../dist/util/node-type.d.ts | 22 + .../dist/util/to-lower-case-a-z.d.ts | 1 + .../dist/util/type-predicates.d.ts | 37 + .../media-query-list-parser/package.json | 74 + .../selector-specificity/CHANGELOG.md | 63 + .../@csstools/selector-specificity/LICENSE.md | 18 + .../@csstools/selector-specificity/README.md | 57 + .../selector-specificity/dist/index.cjs | 1 + .../selector-specificity/dist/index.d.ts | 8 + .../selector-specificity/dist/index.mjs | 1 + .../dist/to-lower-case-a-z.d.ts | 1 + .../selector-specificity/package.json | 75 + node_modules/@nodelib/fs.scandir/LICENSE | 21 + node_modules/@nodelib/fs.scandir/README.md | 171 + .../@nodelib/fs.scandir/out/adapters/fs.d.ts | 20 + .../@nodelib/fs.scandir/out/adapters/fs.js | 19 + .../@nodelib/fs.scandir/out/constants.d.ts | 4 + .../@nodelib/fs.scandir/out/constants.js | 17 + .../@nodelib/fs.scandir/out/index.d.ts | 12 + node_modules/@nodelib/fs.scandir/out/index.js | 26 + .../fs.scandir/out/providers/async.d.ts | 7 + .../fs.scandir/out/providers/async.js | 104 + .../fs.scandir/out/providers/common.d.ts | 1 + .../fs.scandir/out/providers/common.js | 13 + .../fs.scandir/out/providers/sync.d.ts | 5 + .../@nodelib/fs.scandir/out/providers/sync.js | 54 + .../@nodelib/fs.scandir/out/settings.d.ts | 20 + .../@nodelib/fs.scandir/out/settings.js | 24 + .../@nodelib/fs.scandir/out/types/index.d.ts | 20 + .../@nodelib/fs.scandir/out/types/index.js | 2 + .../@nodelib/fs.scandir/out/utils/fs.d.ts | 2 + .../@nodelib/fs.scandir/out/utils/fs.js | 19 + .../@nodelib/fs.scandir/out/utils/index.d.ts | 2 + .../@nodelib/fs.scandir/out/utils/index.js | 5 + node_modules/@nodelib/fs.scandir/package.json | 44 + node_modules/@nodelib/fs.stat/LICENSE | 21 + node_modules/@nodelib/fs.stat/README.md | 126 + .../@nodelib/fs.stat/out/adapters/fs.d.ts | 13 + .../@nodelib/fs.stat/out/adapters/fs.js | 17 + node_modules/@nodelib/fs.stat/out/index.d.ts | 12 + node_modules/@nodelib/fs.stat/out/index.js | 26 + .../@nodelib/fs.stat/out/providers/async.d.ts | 4 + .../@nodelib/fs.stat/out/providers/async.js | 36 + .../@nodelib/fs.stat/out/providers/sync.d.ts | 3 + .../@nodelib/fs.stat/out/providers/sync.js | 23 + .../@nodelib/fs.stat/out/settings.d.ts | 16 + node_modules/@nodelib/fs.stat/out/settings.js | 16 + .../@nodelib/fs.stat/out/types/index.d.ts | 4 + .../@nodelib/fs.stat/out/types/index.js | 2 + node_modules/@nodelib/fs.stat/package.json | 37 + node_modules/@nodelib/fs.walk/LICENSE | 21 + node_modules/@nodelib/fs.walk/README.md | 215 + node_modules/@nodelib/fs.walk/out/index.d.ts | 14 + node_modules/@nodelib/fs.walk/out/index.js | 34 + .../@nodelib/fs.walk/out/providers/async.d.ts | 12 + .../@nodelib/fs.walk/out/providers/async.js | 30 + .../@nodelib/fs.walk/out/providers/index.d.ts | 4 + .../@nodelib/fs.walk/out/providers/index.js | 9 + .../fs.walk/out/providers/stream.d.ts | 12 + .../@nodelib/fs.walk/out/providers/stream.js | 34 + .../@nodelib/fs.walk/out/providers/sync.d.ts | 10 + .../@nodelib/fs.walk/out/providers/sync.js | 14 + .../@nodelib/fs.walk/out/readers/async.d.ts | 30 + .../@nodelib/fs.walk/out/readers/async.js | 97 + .../@nodelib/fs.walk/out/readers/common.d.ts | 7 + .../@nodelib/fs.walk/out/readers/common.js | 31 + .../@nodelib/fs.walk/out/readers/reader.d.ts | 6 + .../@nodelib/fs.walk/out/readers/reader.js | 11 + .../@nodelib/fs.walk/out/readers/sync.d.ts | 15 + .../@nodelib/fs.walk/out/readers/sync.js | 59 + .../@nodelib/fs.walk/out/settings.d.ts | 30 + node_modules/@nodelib/fs.walk/out/settings.js | 26 + .../@nodelib/fs.walk/out/types/index.d.ts | 8 + .../@nodelib/fs.walk/out/types/index.js | 2 + node_modules/@nodelib/fs.walk/package.json | 44 + node_modules/@types/minimist/LICENSE | 21 + node_modules/@types/minimist/README.md | 16 + node_modules/@types/minimist/index.d.ts | 95 + node_modules/@types/minimist/package.json | 40 + .../@types/normalize-package-data/LICENSE | 21 + .../@types/normalize-package-data/README.md | 66 + .../@types/normalize-package-data/index.d.ts | 46 + .../normalize-package-data/package.json | 25 + node_modules/ajv/.runkit_example.js | 23 + node_modules/ajv/LICENSE | 22 + node_modules/ajv/README.md | 207 + node_modules/ajv/dist/2019.d.ts | 19 + node_modules/ajv/dist/2019.js | 59 + node_modules/ajv/dist/2019.js.map | 1 + node_modules/ajv/dist/2020.d.ts | 19 + node_modules/ajv/dist/2020.js | 53 + node_modules/ajv/dist/2020.js.map | 1 + node_modules/ajv/dist/ajv.d.ts | 18 + node_modules/ajv/dist/ajv.js | 48 + node_modules/ajv/dist/ajv.js.map | 1 + .../ajv/dist/compile/codegen/code.d.ts | 40 + node_modules/ajv/dist/compile/codegen/code.js | 155 + .../ajv/dist/compile/codegen/code.js.map | 1 + .../ajv/dist/compile/codegen/index.d.ts | 79 + .../ajv/dist/compile/codegen/index.js | 697 ++ .../ajv/dist/compile/codegen/index.js.map | 1 + .../ajv/dist/compile/codegen/scope.d.ts | 79 + .../ajv/dist/compile/codegen/scope.js | 143 + .../ajv/dist/compile/codegen/scope.js.map | 1 + node_modules/ajv/dist/compile/errors.d.ts | 13 + node_modules/ajv/dist/compile/errors.js | 123 + node_modules/ajv/dist/compile/errors.js.map | 1 + node_modules/ajv/dist/compile/index.d.ts | 80 + node_modules/ajv/dist/compile/index.js | 242 + node_modules/ajv/dist/compile/index.js.map | 1 + node_modules/ajv/dist/compile/jtd/parse.d.ts | 4 + node_modules/ajv/dist/compile/jtd/parse.js | 350 + .../ajv/dist/compile/jtd/parse.js.map | 1 + .../ajv/dist/compile/jtd/serialize.d.ts | 4 + .../ajv/dist/compile/jtd/serialize.js | 229 + .../ajv/dist/compile/jtd/serialize.js.map | 1 + node_modules/ajv/dist/compile/jtd/types.d.ts | 6 + node_modules/ajv/dist/compile/jtd/types.js | 14 + .../ajv/dist/compile/jtd/types.js.map | 1 + node_modules/ajv/dist/compile/names.d.ts | 20 + node_modules/ajv/dist/compile/names.js | 28 + node_modules/ajv/dist/compile/names.js.map | 1 + node_modules/ajv/dist/compile/ref_error.d.ts | 6 + node_modules/ajv/dist/compile/ref_error.js | 12 + .../ajv/dist/compile/ref_error.js.map | 1 + node_modules/ajv/dist/compile/resolve.d.ts | 12 + node_modules/ajv/dist/compile/resolve.js | 155 + node_modules/ajv/dist/compile/resolve.js.map | 1 + node_modules/ajv/dist/compile/rules.d.ts | 28 + node_modules/ajv/dist/compile/rules.js | 26 + node_modules/ajv/dist/compile/rules.js.map | 1 + node_modules/ajv/dist/compile/util.d.ts | 40 + node_modules/ajv/dist/compile/util.js | 178 + node_modules/ajv/dist/compile/util.js.map | 1 + .../dist/compile/validate/applicability.d.ts | 6 + .../dist/compile/validate/applicability.js | 19 + .../compile/validate/applicability.js.map | 1 + .../ajv/dist/compile/validate/boolSchema.d.ts | 4 + .../ajv/dist/compile/validate/boolSchema.js | 50 + .../dist/compile/validate/boolSchema.js.map | 1 + .../ajv/dist/compile/validate/dataType.d.ts | 17 + .../ajv/dist/compile/validate/dataType.js | 202 + .../ajv/dist/compile/validate/dataType.js.map | 1 + .../ajv/dist/compile/validate/defaults.d.ts | 2 + .../ajv/dist/compile/validate/defaults.js | 35 + .../ajv/dist/compile/validate/defaults.js.map | 1 + .../ajv/dist/compile/validate/index.d.ts | 42 + .../ajv/dist/compile/validate/index.js | 520 + .../ajv/dist/compile/validate/index.js.map | 1 + .../ajv/dist/compile/validate/keyword.d.ts | 8 + .../ajv/dist/compile/validate/keyword.js | 124 + .../ajv/dist/compile/validate/keyword.js.map | 1 + .../ajv/dist/compile/validate/subschema.d.ts | 47 + .../ajv/dist/compile/validate/subschema.js | 81 + .../dist/compile/validate/subschema.js.map | 1 + node_modules/ajv/dist/core.d.ts | 173 + node_modules/ajv/dist/core.js | 617 ++ node_modules/ajv/dist/core.js.map | 1 + node_modules/ajv/dist/jtd.d.ts | 47 + node_modules/ajv/dist/jtd.js | 70 + node_modules/ajv/dist/jtd.js.map | 1 + node_modules/ajv/dist/refs/data.json | 13 + .../dist/refs/json-schema-2019-09/index.d.ts | 2 + .../dist/refs/json-schema-2019-09/index.js | 28 + .../refs/json-schema-2019-09/index.js.map | 1 + .../json-schema-2019-09/meta/applicator.json | 53 + .../json-schema-2019-09/meta/content.json | 17 + .../refs/json-schema-2019-09/meta/core.json | 57 + .../refs/json-schema-2019-09/meta/format.json | 14 + .../json-schema-2019-09/meta/meta-data.json | 37 + .../json-schema-2019-09/meta/validation.json | 90 + .../dist/refs/json-schema-2019-09/schema.json | 39 + .../dist/refs/json-schema-2020-12/index.d.ts | 2 + .../dist/refs/json-schema-2020-12/index.js | 30 + .../refs/json-schema-2020-12/index.js.map | 1 + .../json-schema-2020-12/meta/applicator.json | 48 + .../json-schema-2020-12/meta/content.json | 17 + .../refs/json-schema-2020-12/meta/core.json | 51 + .../meta/format-annotation.json | 14 + .../json-schema-2020-12/meta/meta-data.json | 37 + .../json-schema-2020-12/meta/unevaluated.json | 15 + .../json-schema-2020-12/meta/validation.json | 90 + .../dist/refs/json-schema-2020-12/schema.json | 55 + .../ajv/dist/refs/json-schema-draft-06.json | 137 + .../ajv/dist/refs/json-schema-draft-07.json | 151 + .../ajv/dist/refs/json-schema-secure.json | 88 + node_modules/ajv/dist/refs/jtd-schema.d.ts | 3 + node_modules/ajv/dist/refs/jtd-schema.js | 118 + node_modules/ajv/dist/refs/jtd-schema.js.map | 1 + node_modules/ajv/dist/runtime/equal.d.ts | 6 + node_modules/ajv/dist/runtime/equal.js | 7 + node_modules/ajv/dist/runtime/equal.js.map | 1 + node_modules/ajv/dist/runtime/parseJson.d.ts | 18 + node_modules/ajv/dist/runtime/parseJson.js | 184 + .../ajv/dist/runtime/parseJson.js.map | 1 + node_modules/ajv/dist/runtime/quote.d.ts | 5 + node_modules/ajv/dist/runtime/quote.js | 30 + node_modules/ajv/dist/runtime/quote.js.map | 1 + node_modules/ajv/dist/runtime/re2.d.ts | 6 + node_modules/ajv/dist/runtime/re2.js | 6 + node_modules/ajv/dist/runtime/re2.js.map | 1 + node_modules/ajv/dist/runtime/timestamp.d.ts | 5 + node_modules/ajv/dist/runtime/timestamp.js | 42 + .../ajv/dist/runtime/timestamp.js.map | 1 + node_modules/ajv/dist/runtime/ucs2length.d.ts | 5 + node_modules/ajv/dist/runtime/ucs2length.js | 24 + .../ajv/dist/runtime/ucs2length.js.map | 1 + node_modules/ajv/dist/runtime/uri.d.ts | 6 + node_modules/ajv/dist/runtime/uri.js | 6 + node_modules/ajv/dist/runtime/uri.js.map | 1 + .../ajv/dist/runtime/validation_error.d.ts | 7 + .../ajv/dist/runtime/validation_error.js | 11 + .../ajv/dist/runtime/validation_error.js.map | 1 + node_modules/ajv/dist/standalone/index.d.ts | 6 + node_modules/ajv/dist/standalone/index.js | 90 + node_modules/ajv/dist/standalone/index.js.map | 1 + .../ajv/dist/standalone/instance.d.ts | 12 + node_modules/ajv/dist/standalone/instance.js | 35 + .../ajv/dist/standalone/instance.js.map | 1 + node_modules/ajv/dist/types/index.d.ts | 183 + node_modules/ajv/dist/types/index.js | 3 + node_modules/ajv/dist/types/index.js.map | 1 + node_modules/ajv/dist/types/json-schema.d.ts | 125 + node_modules/ajv/dist/types/json-schema.js | 3 + .../ajv/dist/types/json-schema.js.map | 1 + node_modules/ajv/dist/types/jtd-schema.d.ts | 174 + node_modules/ajv/dist/types/jtd-schema.js | 3 + node_modules/ajv/dist/types/jtd-schema.js.map | 1 + .../applicator/additionalItems.d.ts | 8 + .../applicator/additionalItems.js | 49 + .../applicator/additionalItems.js.map | 1 + .../applicator/additionalProperties.d.ts | 6 + .../applicator/additionalProperties.js | 106 + .../applicator/additionalProperties.js.map | 1 + .../dist/vocabularies/applicator/allOf.d.ts | 3 + .../ajv/dist/vocabularies/applicator/allOf.js | 23 + .../dist/vocabularies/applicator/allOf.js.map | 1 + .../dist/vocabularies/applicator/anyOf.d.ts | 4 + .../ajv/dist/vocabularies/applicator/anyOf.js | 12 + .../dist/vocabularies/applicator/anyOf.js.map | 1 + .../vocabularies/applicator/contains.d.ts | 7 + .../dist/vocabularies/applicator/contains.js | 95 + .../vocabularies/applicator/contains.js.map | 1 + .../vocabularies/applicator/dependencies.d.ts | 21 + .../vocabularies/applicator/dependencies.js | 85 + .../applicator/dependencies.js.map | 1 + .../applicator/dependentSchemas.d.ts | 3 + .../applicator/dependentSchemas.js | 11 + .../applicator/dependentSchemas.js.map | 1 + .../ajv/dist/vocabularies/applicator/if.d.ts | 6 + .../ajv/dist/vocabularies/applicator/if.js | 66 + .../dist/vocabularies/applicator/if.js.map | 1 + .../dist/vocabularies/applicator/index.d.ts | 13 + .../ajv/dist/vocabularies/applicator/index.js | 44 + .../dist/vocabularies/applicator/index.js.map | 1 + .../dist/vocabularies/applicator/items.d.ts | 5 + .../ajv/dist/vocabularies/applicator/items.js | 52 + .../dist/vocabularies/applicator/items.js.map | 1 + .../vocabularies/applicator/items2020.d.ts | 6 + .../dist/vocabularies/applicator/items2020.js | 30 + .../vocabularies/applicator/items2020.js.map | 1 + .../ajv/dist/vocabularies/applicator/not.d.ts | 4 + .../ajv/dist/vocabularies/applicator/not.js | 26 + .../dist/vocabularies/applicator/not.js.map | 1 + .../dist/vocabularies/applicator/oneOf.d.ts | 6 + .../ajv/dist/vocabularies/applicator/oneOf.js | 60 + .../dist/vocabularies/applicator/oneOf.js.map | 1 + .../applicator/patternProperties.d.ts | 3 + .../applicator/patternProperties.js | 75 + .../applicator/patternProperties.js.map | 1 + .../vocabularies/applicator/prefixItems.d.ts | 3 + .../vocabularies/applicator/prefixItems.js | 12 + .../applicator/prefixItems.js.map | 1 + .../vocabularies/applicator/properties.d.ts | 3 + .../vocabularies/applicator/properties.js | 54 + .../vocabularies/applicator/properties.js.map | 1 + .../applicator/propertyNames.d.ts | 6 + .../vocabularies/applicator/propertyNames.js | 38 + .../applicator/propertyNames.js.map | 1 + .../vocabularies/applicator/thenElse.d.ts | 3 + .../dist/vocabularies/applicator/thenElse.js | 13 + .../vocabularies/applicator/thenElse.js.map | 1 + node_modules/ajv/dist/vocabularies/code.d.ts | 17 + node_modules/ajv/dist/vocabularies/code.js | 131 + .../ajv/dist/vocabularies/code.js.map | 1 + .../ajv/dist/vocabularies/core/id.d.ts | 3 + node_modules/ajv/dist/vocabularies/core/id.js | 10 + .../ajv/dist/vocabularies/core/id.js.map | 1 + .../ajv/dist/vocabularies/core/index.d.ts | 3 + .../ajv/dist/vocabularies/core/index.js | 16 + .../ajv/dist/vocabularies/core/index.js.map | 1 + .../ajv/dist/vocabularies/core/ref.d.ts | 8 + .../ajv/dist/vocabularies/core/ref.js | 122 + .../ajv/dist/vocabularies/core/ref.js.map | 1 + .../vocabularies/discriminator/index.d.ts | 5 + .../dist/vocabularies/discriminator/index.js | 100 + .../vocabularies/discriminator/index.js.map | 1 + .../vocabularies/discriminator/types.d.ts | 10 + .../dist/vocabularies/discriminator/types.js | 9 + .../vocabularies/discriminator/types.js.map | 1 + .../ajv/dist/vocabularies/draft2020.d.ts | 3 + .../ajv/dist/vocabularies/draft2020.js | 23 + .../ajv/dist/vocabularies/draft2020.js.map | 1 + .../ajv/dist/vocabularies/draft7.d.ts | 3 + node_modules/ajv/dist/vocabularies/draft7.js | 17 + .../ajv/dist/vocabularies/draft7.js.map | 1 + .../vocabularies/dynamic/dynamicAnchor.d.ts | 5 + .../vocabularies/dynamic/dynamicAnchor.js | 30 + .../vocabularies/dynamic/dynamicAnchor.js.map | 1 + .../dist/vocabularies/dynamic/dynamicRef.d.ts | 5 + .../dist/vocabularies/dynamic/dynamicRef.js | 51 + .../vocabularies/dynamic/dynamicRef.js.map | 1 + .../ajv/dist/vocabularies/dynamic/index.d.ts | 3 + .../ajv/dist/vocabularies/dynamic/index.js | 9 + .../dist/vocabularies/dynamic/index.js.map | 1 + .../vocabularies/dynamic/recursiveAnchor.d.ts | 3 + .../vocabularies/dynamic/recursiveAnchor.js | 16 + .../dynamic/recursiveAnchor.js.map | 1 + .../vocabularies/dynamic/recursiveRef.d.ts | 3 + .../dist/vocabularies/dynamic/recursiveRef.js | 10 + .../vocabularies/dynamic/recursiveRef.js.map | 1 + .../ajv/dist/vocabularies/errors.d.ts | 9 + node_modules/ajv/dist/vocabularies/errors.js | 3 + .../ajv/dist/vocabularies/errors.js.map | 1 + .../ajv/dist/vocabularies/format/format.d.ts | 8 + .../ajv/dist/vocabularies/format/format.js | 92 + .../dist/vocabularies/format/format.js.map | 1 + .../ajv/dist/vocabularies/format/index.d.ts | 3 + .../ajv/dist/vocabularies/format/index.js | 6 + .../ajv/dist/vocabularies/format/index.js.map | 1 + .../dist/vocabularies/jtd/discriminator.d.ts | 6 + .../dist/vocabularies/jtd/discriminator.js | 71 + .../vocabularies/jtd/discriminator.js.map | 1 + .../ajv/dist/vocabularies/jtd/elements.d.ts | 5 + .../ajv/dist/vocabularies/jtd/elements.js | 24 + .../ajv/dist/vocabularies/jtd/elements.js.map | 1 + .../ajv/dist/vocabularies/jtd/enum.d.ts | 6 + .../ajv/dist/vocabularies/jtd/enum.js | 43 + .../ajv/dist/vocabularies/jtd/enum.js.map | 1 + .../ajv/dist/vocabularies/jtd/error.d.ts | 9 + .../ajv/dist/vocabularies/jtd/error.js | 20 + .../ajv/dist/vocabularies/jtd/error.js.map | 1 + .../ajv/dist/vocabularies/jtd/index.d.ts | 10 + .../ajv/dist/vocabularies/jtd/index.js | 29 + .../ajv/dist/vocabularies/jtd/index.js.map | 1 + .../ajv/dist/vocabularies/jtd/metadata.d.ts | 5 + .../ajv/dist/vocabularies/jtd/metadata.js | 25 + .../ajv/dist/vocabularies/jtd/metadata.js.map | 1 + .../ajv/dist/vocabularies/jtd/nullable.d.ts | 4 + .../ajv/dist/vocabularies/jtd/nullable.js | 22 + .../ajv/dist/vocabularies/jtd/nullable.js.map | 1 + .../vocabularies/jtd/optionalProperties.d.ts | 3 + .../vocabularies/jtd/optionalProperties.js | 15 + .../jtd/optionalProperties.js.map | 1 + .../ajv/dist/vocabularies/jtd/properties.d.ts | 22 + .../ajv/dist/vocabularies/jtd/properties.js | 149 + .../dist/vocabularies/jtd/properties.js.map | 1 + .../ajv/dist/vocabularies/jtd/ref.d.ts | 4 + node_modules/ajv/dist/vocabularies/jtd/ref.js | 67 + .../ajv/dist/vocabularies/jtd/ref.js.map | 1 + .../ajv/dist/vocabularies/jtd/type.d.ts | 10 + .../ajv/dist/vocabularies/jtd/type.js | 69 + .../ajv/dist/vocabularies/jtd/type.js.map | 1 + .../ajv/dist/vocabularies/jtd/union.d.ts | 3 + .../ajv/dist/vocabularies/jtd/union.js | 12 + .../ajv/dist/vocabularies/jtd/union.js.map | 1 + .../ajv/dist/vocabularies/jtd/values.d.ts | 5 + .../ajv/dist/vocabularies/jtd/values.js | 51 + .../ajv/dist/vocabularies/jtd/values.js.map | 1 + .../ajv/dist/vocabularies/metadata.d.ts | 3 + .../ajv/dist/vocabularies/metadata.js | 18 + .../ajv/dist/vocabularies/metadata.js.map | 1 + node_modules/ajv/dist/vocabularies/next.d.ts | 3 + node_modules/ajv/dist/vocabularies/next.js | 8 + .../ajv/dist/vocabularies/next.js.map | 1 + .../dist/vocabularies/unevaluated/index.d.ts | 3 + .../dist/vocabularies/unevaluated/index.js | 7 + .../vocabularies/unevaluated/index.js.map | 1 + .../unevaluated/unevaluatedItems.d.ts | 6 + .../unevaluated/unevaluatedItems.js | 40 + .../unevaluated/unevaluatedItems.js.map | 1 + .../unevaluated/unevaluatedProperties.d.ts | 6 + .../unevaluated/unevaluatedProperties.js | 65 + .../unevaluated/unevaluatedProperties.js.map | 1 + .../dist/vocabularies/validation/const.d.ts | 6 + .../ajv/dist/vocabularies/validation/const.js | 25 + .../dist/vocabularies/validation/const.js.map | 1 + .../validation/dependentRequired.d.ts | 5 + .../validation/dependentRequired.js | 12 + .../validation/dependentRequired.js.map | 1 + .../dist/vocabularies/validation/enum.d.ts | 8 + .../ajv/dist/vocabularies/validation/enum.js | 48 + .../dist/vocabularies/validation/enum.js.map | 1 + .../dist/vocabularies/validation/index.d.ts | 16 + .../ajv/dist/vocabularies/validation/index.js | 33 + .../dist/vocabularies/validation/index.js.map | 1 + .../validation/limitContains.d.ts | 3 + .../vocabularies/validation/limitContains.js | 15 + .../validation/limitContains.js.map | 1 + .../vocabularies/validation/limitItems.d.ts | 3 + .../vocabularies/validation/limitItems.js | 24 + .../vocabularies/validation/limitItems.js.map | 1 + .../vocabularies/validation/limitLength.d.ts | 3 + .../vocabularies/validation/limitLength.js | 27 + .../validation/limitLength.js.map | 1 + .../vocabularies/validation/limitNumber.d.ts | 11 + .../vocabularies/validation/limitNumber.js | 27 + .../validation/limitNumber.js.map | 1 + .../validation/limitProperties.d.ts | 3 + .../validation/limitProperties.js | 24 + .../validation/limitProperties.js.map | 1 + .../vocabularies/validation/multipleOf.d.ts | 8 + .../vocabularies/validation/multipleOf.js | 26 + .../vocabularies/validation/multipleOf.js.map | 1 + .../dist/vocabularies/validation/pattern.d.ts | 8 + .../dist/vocabularies/validation/pattern.js | 24 + .../vocabularies/validation/pattern.js.map | 1 + .../vocabularies/validation/required.d.ts | 8 + .../dist/vocabularies/validation/required.js | 79 + .../vocabularies/validation/required.js.map | 1 + .../vocabularies/validation/uniqueItems.d.ts | 9 + .../vocabularies/validation/uniqueItems.js | 64 + .../validation/uniqueItems.js.map | 1 + node_modules/ajv/lib/2019.ts | 80 + node_modules/ajv/lib/2020.ts | 74 + node_modules/ajv/lib/ajv.ts | 69 + node_modules/ajv/lib/compile/codegen/code.ts | 168 + node_modules/ajv/lib/compile/codegen/index.ts | 832 ++ node_modules/ajv/lib/compile/codegen/scope.ts | 215 + node_modules/ajv/lib/compile/errors.ts | 184 + node_modules/ajv/lib/compile/index.ts | 324 + node_modules/ajv/lib/compile/jtd/parse.ts | 411 + node_modules/ajv/lib/compile/jtd/serialize.ts | 266 + node_modules/ajv/lib/compile/jtd/types.ts | 16 + node_modules/ajv/lib/compile/names.ts | 27 + node_modules/ajv/lib/compile/ref_error.ts | 13 + node_modules/ajv/lib/compile/resolve.ts | 149 + node_modules/ajv/lib/compile/rules.ts | 50 + node_modules/ajv/lib/compile/util.ts | 213 + .../ajv/lib/compile/validate/applicability.ts | 22 + .../ajv/lib/compile/validate/boolSchema.ts | 47 + .../ajv/lib/compile/validate/dataType.ts | 229 + .../ajv/lib/compile/validate/defaults.ts | 32 + .../ajv/lib/compile/validate/index.ts | 582 + .../ajv/lib/compile/validate/keyword.ts | 171 + .../ajv/lib/compile/validate/subschema.ts | 135 + node_modules/ajv/lib/core.ts | 887 ++ node_modules/ajv/lib/jtd.ts | 131 + node_modules/ajv/lib/refs/data.json | 13 + .../ajv/lib/refs/json-schema-2019-09/index.ts | 28 + .../json-schema-2019-09/meta/applicator.json | 53 + .../json-schema-2019-09/meta/content.json | 17 + .../refs/json-schema-2019-09/meta/core.json | 57 + .../refs/json-schema-2019-09/meta/format.json | 14 + .../json-schema-2019-09/meta/meta-data.json | 37 + .../json-schema-2019-09/meta/validation.json | 90 + .../lib/refs/json-schema-2019-09/schema.json | 39 + .../ajv/lib/refs/json-schema-2020-12/index.ts | 30 + .../json-schema-2020-12/meta/applicator.json | 48 + .../json-schema-2020-12/meta/content.json | 17 + .../refs/json-schema-2020-12/meta/core.json | 51 + .../meta/format-annotation.json | 14 + .../json-schema-2020-12/meta/meta-data.json | 37 + .../json-schema-2020-12/meta/unevaluated.json | 15 + .../json-schema-2020-12/meta/validation.json | 90 + .../lib/refs/json-schema-2020-12/schema.json | 55 + .../ajv/lib/refs/json-schema-draft-06.json | 137 + .../ajv/lib/refs/json-schema-draft-07.json | 151 + .../ajv/lib/refs/json-schema-secure.json | 88 + node_modules/ajv/lib/refs/jtd-schema.ts | 130 + node_modules/ajv/lib/runtime/equal.ts | 7 + node_modules/ajv/lib/runtime/parseJson.ts | 176 + node_modules/ajv/lib/runtime/quote.ts | 31 + node_modules/ajv/lib/runtime/re2.ts | 6 + node_modules/ajv/lib/runtime/timestamp.ts | 46 + node_modules/ajv/lib/runtime/ucs2length.ts | 20 + node_modules/ajv/lib/runtime/uri.ts | 6 + .../ajv/lib/runtime/validation_error.ts | 13 + node_modules/ajv/lib/standalone/index.ts | 100 + node_modules/ajv/lib/standalone/instance.ts | 36 + node_modules/ajv/lib/types/index.ts | 240 + node_modules/ajv/lib/types/json-schema.ts | 187 + node_modules/ajv/lib/types/jtd-schema.ts | 273 + .../applicator/additionalItems.ts | 56 + .../applicator/additionalProperties.ts | 118 + .../ajv/lib/vocabularies/applicator/allOf.ts | 22 + .../ajv/lib/vocabularies/applicator/anyOf.ts | 14 + .../lib/vocabularies/applicator/contains.ts | 109 + .../vocabularies/applicator/dependencies.ts | 112 + .../applicator/dependentSchemas.ts | 11 + .../ajv/lib/vocabularies/applicator/if.ts | 80 + .../ajv/lib/vocabularies/applicator/index.ts | 53 + .../ajv/lib/vocabularies/applicator/items.ts | 59 + .../lib/vocabularies/applicator/items2020.ts | 36 + .../ajv/lib/vocabularies/applicator/not.ts | 38 + .../ajv/lib/vocabularies/applicator/oneOf.ts | 82 + .../applicator/patternProperties.ts | 91 + .../vocabularies/applicator/prefixItems.ts | 12 + .../lib/vocabularies/applicator/properties.ts | 57 + .../vocabularies/applicator/propertyNames.ts | 50 + .../lib/vocabularies/applicator/thenElse.ts | 13 + node_modules/ajv/lib/vocabularies/code.ts | 168 + node_modules/ajv/lib/vocabularies/core/id.ts | 10 + .../ajv/lib/vocabularies/core/index.ts | 16 + node_modules/ajv/lib/vocabularies/core/ref.ts | 129 + .../lib/vocabularies/discriminator/index.ts | 110 + .../lib/vocabularies/discriminator/types.ts | 12 + .../ajv/lib/vocabularies/draft2020.ts | 23 + node_modules/ajv/lib/vocabularies/draft7.ts | 17 + .../lib/vocabularies/dynamic/dynamicAnchor.ts | 31 + .../lib/vocabularies/dynamic/dynamicRef.ts | 51 + .../ajv/lib/vocabularies/dynamic/index.ts | 9 + .../vocabularies/dynamic/recursiveAnchor.ts | 14 + .../lib/vocabularies/dynamic/recursiveRef.ts | 10 + node_modules/ajv/lib/vocabularies/errors.ts | 18 + .../ajv/lib/vocabularies/format/format.ts | 120 + .../ajv/lib/vocabularies/format/index.ts | 6 + .../ajv/lib/vocabularies/jtd/discriminator.ts | 89 + .../ajv/lib/vocabularies/jtd/elements.ts | 32 + node_modules/ajv/lib/vocabularies/jtd/enum.ts | 45 + .../ajv/lib/vocabularies/jtd/error.ts | 23 + .../ajv/lib/vocabularies/jtd/index.ts | 37 + .../ajv/lib/vocabularies/jtd/metadata.ts | 24 + .../ajv/lib/vocabularies/jtd/nullable.ts | 21 + .../vocabularies/jtd/optionalProperties.ts | 15 + .../ajv/lib/vocabularies/jtd/properties.ts | 184 + node_modules/ajv/lib/vocabularies/jtd/ref.ts | 76 + node_modules/ajv/lib/vocabularies/jtd/type.ts | 75 + .../ajv/lib/vocabularies/jtd/union.ts | 12 + .../ajv/lib/vocabularies/jtd/values.ts | 58 + node_modules/ajv/lib/vocabularies/metadata.ts | 17 + node_modules/ajv/lib/vocabularies/next.ts | 8 + .../ajv/lib/vocabularies/unevaluated/index.ts | 7 + .../unevaluated/unevaluatedItems.ts | 47 + .../unevaluated/unevaluatedProperties.ts | 85 + .../ajv/lib/vocabularies/validation/const.ts | 28 + .../validation/dependentRequired.ts | 23 + .../ajv/lib/vocabularies/validation/enum.ts | 54 + .../ajv/lib/vocabularies/validation/index.ts | 49 + .../vocabularies/validation/limitContains.ts | 16 + .../lib/vocabularies/validation/limitItems.ts | 26 + .../vocabularies/validation/limitLength.ts | 30 + .../vocabularies/validation/limitNumber.ts | 42 + .../validation/limitProperties.ts | 26 + .../lib/vocabularies/validation/multipleOf.ts | 34 + .../lib/vocabularies/validation/pattern.ts | 28 + .../lib/vocabularies/validation/required.ts | 98 + .../vocabularies/validation/uniqueItems.ts | 79 + node_modules/ajv/package.json | 126 + node_modules/ansi-regex/index.d.ts | 37 + node_modules/ansi-regex/index.js | 10 + node_modules/ansi-regex/license | 9 + node_modules/ansi-regex/package.json | 55 + node_modules/ansi-regex/readme.md | 78 + node_modules/ansi-styles/index.js | 165 + node_modules/ansi-styles/license | 9 + node_modules/ansi-styles/package.json | 56 + node_modules/ansi-styles/readme.md | 147 + node_modules/argparse/CHANGELOG.md | 216 + node_modules/argparse/LICENSE | 254 + node_modules/argparse/README.md | 84 + node_modules/argparse/argparse.js | 3707 +++++++ node_modules/argparse/lib/sub.js | 67 + node_modules/argparse/lib/textwrap.js | 440 + node_modules/argparse/package.json | 31 + node_modules/array-union/index.d.ts | 25 + node_modules/array-union/index.js | 5 + node_modules/array-union/license | 9 + node_modules/array-union/package.json | 38 + node_modules/array-union/readme.md | 34 + node_modules/arrify/index.js | 8 + node_modules/arrify/license | 21 + node_modules/arrify/package.json | 33 + node_modules/arrify/readme.md | 36 + node_modules/astral-regex/index.d.ts | 28 + node_modules/astral-regex/index.js | 6 + node_modules/astral-regex/license | 9 + node_modules/astral-regex/package.json | 33 + node_modules/astral-regex/readme.md | 46 + .../balanced-match/.github/FUNDING.yml | 2 + node_modules/balanced-match/LICENSE.md | 21 + node_modules/balanced-match/README.md | 97 + node_modules/balanced-match/index.js | 64 + node_modules/balanced-match/package.json | 52 + node_modules/brace-expansion/LICENSE | 21 + node_modules/brace-expansion/README.md | 129 + node_modules/brace-expansion/index.js | 201 + .../balanced-match/.github/FUNDING.yml | 2 + .../node_modules/balanced-match/LICENSE.md | 21 + .../node_modules/balanced-match/README.md | 97 + .../node_modules/balanced-match/index.js | 62 + .../node_modules/balanced-match/package.json | 48 + node_modules/brace-expansion/package.json | 47 + node_modules/braces/CHANGELOG.md | 184 + node_modules/braces/LICENSE | 21 + node_modules/braces/README.md | 593 + node_modules/braces/index.js | 170 + node_modules/braces/lib/compile.js | 57 + node_modules/braces/lib/constants.js | 57 + node_modules/braces/lib/expand.js | 113 + node_modules/braces/lib/parse.js | 333 + node_modules/braces/lib/stringify.js | 32 + node_modules/braces/lib/utils.js | 112 + node_modules/braces/package.json | 77 + node_modules/callsites/index.d.ts | 96 + node_modules/callsites/index.js | 13 + node_modules/callsites/license | 9 + node_modules/callsites/package.json | 39 + node_modules/callsites/readme.md | 48 + node_modules/camelcase-keys/index.d.ts | 192 + node_modules/camelcase-keys/index.js | 77 + node_modules/camelcase-keys/license | 9 + node_modules/camelcase-keys/package.json | 75 + node_modules/camelcase-keys/readme.md | 125 + node_modules/camelcase/index.d.ts | 103 + node_modules/camelcase/index.js | 113 + node_modules/camelcase/license | 9 + node_modules/camelcase/package.json | 44 + node_modules/camelcase/readme.md | 144 + node_modules/chalk/index.js | 228 + node_modules/chalk/index.js.flow | 93 + node_modules/chalk/license | 9 + node_modules/chalk/package.json | 71 + node_modules/chalk/readme.md | 314 + node_modules/chalk/templates.js | 128 + node_modules/chalk/types/index.d.ts | 97 + node_modules/color-convert/CHANGELOG.md | 54 + node_modules/color-convert/LICENSE | 21 + node_modules/color-convert/README.md | 68 + node_modules/color-convert/conversions.js | 868 ++ node_modules/color-convert/index.js | 78 + node_modules/color-convert/package.json | 46 + node_modules/color-convert/route.js | 97 + node_modules/color-name/.eslintrc.json | 43 + node_modules/color-name/.npmignore | 107 + node_modules/color-name/LICENSE | 8 + node_modules/color-name/README.md | 11 + node_modules/color-name/index.js | 152 + node_modules/color-name/package.json | 25 + node_modules/color-name/test.js | 7 + node_modules/colord/CHANGELOG.md | 188 + node_modules/colord/LICENSE.md | 21 + node_modules/colord/README.md | 1053 ++ node_modules/colord/colord.d.ts | 103 + node_modules/colord/constants.d.ts | 10 + node_modules/colord/extend.d.ts | 4 + node_modules/colord/helpers.d.ts | 20 + node_modules/colord/index.d.ts | 5 + node_modules/colord/index.js | 1 + node_modules/colord/index.mjs | 1 + node_modules/colord/package.json | 210 + node_modules/colord/parse.d.ts | 8 + node_modules/colord/plugins/a11y.d.ts | 38 + node_modules/colord/plugins/a11y.js | 1 + node_modules/colord/plugins/a11y.mjs | 1 + node_modules/colord/plugins/cmyk.d.ts | 24 + node_modules/colord/plugins/cmyk.js | 1 + node_modules/colord/plugins/cmyk.mjs | 1 + node_modules/colord/plugins/harmonies.d.ts | 16 + node_modules/colord/plugins/harmonies.js | 1 + node_modules/colord/plugins/harmonies.mjs | 1 + node_modules/colord/plugins/hwb.d.ts | 23 + node_modules/colord/plugins/hwb.js | 1 + node_modules/colord/plugins/hwb.mjs | 1 + node_modules/colord/plugins/lab.d.ts | 23 + node_modules/colord/plugins/lab.js | 1 + node_modules/colord/plugins/lab.mjs | 1 + node_modules/colord/plugins/lch.d.ts | 24 + node_modules/colord/plugins/lch.js | 1 + node_modules/colord/plugins/lch.mjs | 1 + node_modules/colord/plugins/minify.d.ts | 20 + node_modules/colord/plugins/minify.js | 1 + node_modules/colord/plugins/minify.mjs | 1 + node_modules/colord/plugins/mix.d.ts | 27 + node_modules/colord/plugins/mix.js | 1 + node_modules/colord/plugins/mix.mjs | 1 + node_modules/colord/plugins/names.d.ts | 19 + node_modules/colord/plugins/names.js | 1 + node_modules/colord/plugins/names.mjs | 1 + node_modules/colord/plugins/xyz.d.ts | 14 + node_modules/colord/plugins/xyz.js | 1 + node_modules/colord/plugins/xyz.mjs | 1 + node_modules/colord/random.d.ts | 2 + node_modules/colord/types.d.ts | 67 + node_modules/concat-map/.travis.yml | 4 + node_modules/concat-map/LICENSE | 18 + node_modules/concat-map/README.markdown | 62 + node_modules/concat-map/example/map.js | 6 + node_modules/concat-map/index.js | 13 + node_modules/concat-map/package.json | 43 + node_modules/concat-map/test/map.js | 39 + node_modules/cosmiconfig/LICENSE | 22 + node_modules/cosmiconfig/README.md | 688 ++ node_modules/cosmiconfig/dist/Explorer.d.ts | 15 + .../cosmiconfig/dist/Explorer.d.ts.map | 1 + node_modules/cosmiconfig/dist/Explorer.js | 129 + node_modules/cosmiconfig/dist/Explorer.js.map | 1 + .../cosmiconfig/dist/ExplorerBase.d.ts | 21 + .../cosmiconfig/dist/ExplorerBase.d.ts.map | 1 + node_modules/cosmiconfig/dist/ExplorerBase.js | 152 + .../cosmiconfig/dist/ExplorerBase.js.map | 1 + .../cosmiconfig/dist/ExplorerSync.d.ts | 15 + .../cosmiconfig/dist/ExplorerSync.d.ts.map | 1 + node_modules/cosmiconfig/dist/ExplorerSync.js | 129 + .../cosmiconfig/dist/ExplorerSync.js.map | 1 + .../cosmiconfig/dist/cacheWrapper.d.ts | 5 + .../cosmiconfig/dist/cacheWrapper.d.ts.map | 1 + node_modules/cosmiconfig/dist/cacheWrapper.js | 32 + .../cosmiconfig/dist/cacheWrapper.js.map | 1 + .../cosmiconfig/dist/canUseDynamicImport.d.ts | 3 + .../dist/canUseDynamicImport.d.ts.map | 1 + .../cosmiconfig/dist/canUseDynamicImport.js | 23 + .../dist/canUseDynamicImport.js.map | 1 + .../cosmiconfig/dist/getDirectory.d.ts | 4 + .../cosmiconfig/dist/getDirectory.d.ts.map | 1 + node_modules/cosmiconfig/dist/getDirectory.js | 38 + .../cosmiconfig/dist/getDirectory.js.map | 1 + .../cosmiconfig/dist/getPropertyByPath.d.ts | 5 + .../dist/getPropertyByPath.d.ts.map | 1 + .../cosmiconfig/dist/getPropertyByPath.js | 28 + .../cosmiconfig/dist/getPropertyByPath.js.map | 1 + node_modules/cosmiconfig/dist/index.d.ts | 56 + node_modules/cosmiconfig/dist/index.d.ts.map | 1 + node_modules/cosmiconfig/dist/index.js | 157 + node_modules/cosmiconfig/dist/index.js.map | 1 + node_modules/cosmiconfig/dist/loaders.d.ts | 4 + .../cosmiconfig/dist/loaders.d.ts.map | 1 + node_modules/cosmiconfig/dist/loaders.js | 72 + node_modules/cosmiconfig/dist/loaders.js.map | 1 + node_modules/cosmiconfig/dist/readFile.d.ts | 7 + .../cosmiconfig/dist/readFile.d.ts.map | 1 + node_modules/cosmiconfig/dist/readFile.js | 56 + node_modules/cosmiconfig/dist/readFile.js.map | 1 + node_modules/cosmiconfig/dist/types.d.ts | 24 + node_modules/cosmiconfig/dist/types.d.ts.map | 1 + node_modules/cosmiconfig/dist/types.js | 6 + node_modules/cosmiconfig/dist/types.js.map | 1 + node_modules/cosmiconfig/package.json | 130 + node_modules/css-functions-list/CHANGELOG.md | 53 + node_modules/css-functions-list/LICENSE.md | 18 + node_modules/css-functions-list/README.md | 64 + .../css-functions-list/cjs/index.d.ts | 6 + .../css-functions-list/cjs/index.d.ts.map | 1 + node_modules/css-functions-list/cjs/index.js | 11 + .../css-functions-list/cjs/index.js.map | 1 + .../css-functions-list/cjs/index.json | 622 ++ .../css-functions-list/cjs/package.json | 1 + .../css-functions-list/esm/index.d.ts | 6 + .../css-functions-list/esm/index.d.ts.map | 1 + node_modules/css-functions-list/esm/index.js | 9 + .../css-functions-list/esm/index.js.map | 1 + .../css-functions-list/esm/index.json | 622 ++ .../css-functions-list/esm/package.json | 1 + node_modules/css-functions-list/package.json | 88 + node_modules/css-tree/LICENSE | 19 + node_modules/css-tree/README.md | 193 + .../css-tree/cjs/convertor/create.cjs | 32 + node_modules/css-tree/cjs/convertor/index.cjs | 8 + node_modules/css-tree/cjs/data-patch.cjs | 7 + node_modules/css-tree/cjs/data.cjs | 99 + .../cjs/definition-syntax/SyntaxError.cjs | 16 + .../cjs/definition-syntax/generate.cjs | 135 + .../css-tree/cjs/definition-syntax/index.cjs | 13 + .../css-tree/cjs/definition-syntax/parse.cjs | 588 + .../cjs/definition-syntax/tokenizer.cjs | 56 + .../css-tree/cjs/definition-syntax/walk.cjs | 56 + .../css-tree/cjs/generator/create.cjs | 103 + node_modules/css-tree/cjs/generator/index.cjs | 8 + .../css-tree/cjs/generator/sourceMap.cjs | 96 + .../css-tree/cjs/generator/token-before.cjs | 170 + node_modules/css-tree/cjs/index.cjs | 63 + node_modules/css-tree/cjs/lexer/Lexer.cjs | 470 + node_modules/css-tree/cjs/lexer/error.cjs | 128 + .../css-tree/cjs/lexer/generic-an-plus-b.cjs | 235 + .../css-tree/cjs/lexer/generic-const.cjs | 12 + .../css-tree/cjs/lexer/generic-urange.cjs | 149 + node_modules/css-tree/cjs/lexer/generic.cjs | 573 + node_modules/css-tree/cjs/lexer/index.cjs | 7 + .../css-tree/cjs/lexer/match-graph.cjs | 459 + node_modules/css-tree/cjs/lexer/match.cjs | 632 ++ .../css-tree/cjs/lexer/prepare-tokens.cjs | 54 + node_modules/css-tree/cjs/lexer/search.cjs | 65 + node_modules/css-tree/cjs/lexer/structure.cjs | 168 + node_modules/css-tree/cjs/lexer/trace.cjs | 73 + node_modules/css-tree/cjs/lexer/units.cjs | 38 + .../css-tree/cjs/parser/SyntaxError.cjs | 69 + node_modules/css-tree/cjs/parser/create.cjs | 336 + node_modules/css-tree/cjs/parser/index.cjs | 8 + .../css-tree/cjs/parser/parse-selector.cjs | 8 + node_modules/css-tree/cjs/parser/sequence.cjs | 47 + .../css-tree/cjs/syntax/atrule/font-face.cjs | 12 + .../css-tree/cjs/syntax/atrule/import.cjs | 37 + .../css-tree/cjs/syntax/atrule/index.cjs | 19 + .../css-tree/cjs/syntax/atrule/media.cjs | 16 + .../css-tree/cjs/syntax/atrule/nest.cjs | 16 + .../css-tree/cjs/syntax/atrule/page.cjs | 16 + .../css-tree/cjs/syntax/atrule/supports.cjs | 77 + .../css-tree/cjs/syntax/config/generator.cjs | 9 + .../css-tree/cjs/syntax/config/lexer.cjs | 12 + .../css-tree/cjs/syntax/config/mix.cjs | 119 + .../cjs/syntax/config/parser-selector.cjs | 19 + .../css-tree/cjs/syntax/config/parser.cjs | 34 + .../css-tree/cjs/syntax/config/walker.cjs | 9 + node_modules/css-tree/cjs/syntax/create.cjs | 57 + .../cjs/syntax/function/expression.cjs | 11 + .../css-tree/cjs/syntax/function/var.cjs | 43 + node_modules/css-tree/cjs/syntax/index.cjs | 14 + .../css-tree/cjs/syntax/node/AnPlusB.cjs | 293 + .../css-tree/cjs/syntax/node/Atrule.cjs | 103 + .../cjs/syntax/node/AtrulePrelude.cjs | 52 + .../cjs/syntax/node/AttributeSelector.cjs | 148 + .../css-tree/cjs/syntax/node/Block.cjs | 96 + .../css-tree/cjs/syntax/node/Brackets.cjs | 38 + node_modules/css-tree/cjs/syntax/node/CDC.cjs | 26 + node_modules/css-tree/cjs/syntax/node/CDO.cjs | 26 + .../cjs/syntax/node/ClassSelector.cjs | 31 + .../css-tree/cjs/syntax/node/Combinator.cjs | 61 + .../css-tree/cjs/syntax/node/Comment.cjs | 40 + .../css-tree/cjs/syntax/node/Condition.cjs | 127 + .../css-tree/cjs/syntax/node/Declaration.cjs | 166 + .../cjs/syntax/node/DeclarationList.cjs | 62 + .../css-tree/cjs/syntax/node/Dimension.cjs | 30 + .../css-tree/cjs/syntax/node/Feature.cjs | 78 + .../css-tree/cjs/syntax/node/FeatureRange.cjs | 114 + .../css-tree/cjs/syntax/node/Function.cjs | 45 + .../cjs/syntax/node/GeneralEnclosed.cjs | 51 + .../css-tree/cjs/syntax/node/Hash.cjs | 30 + .../css-tree/cjs/syntax/node/IdSelector.cjs | 33 + .../css-tree/cjs/syntax/node/Identifier.cjs | 25 + .../cjs/syntax/node/MediaCondition.cjs | 70 + .../css-tree/cjs/syntax/node/MediaFeature.cjs | 76 + .../cjs/syntax/node/MediaFeatureRange.cjs | 11 + .../css-tree/cjs/syntax/node/MediaQuery.cjs | 61 + .../cjs/syntax/node/MediaQueryList.cjs | 41 + .../cjs/syntax/node/NestingSelector.cjs | 29 + node_modules/css-tree/cjs/syntax/node/Nth.cjs | 54 + .../css-tree/cjs/syntax/node/Number.cjs | 25 + .../css-tree/cjs/syntax/node/Operator.cjs | 28 + .../css-tree/cjs/syntax/node/Parentheses.cjs | 38 + .../css-tree/cjs/syntax/node/Percentage.cjs | 25 + .../cjs/syntax/node/PseudoClassSelector.cjs | 65 + .../cjs/syntax/node/PseudoElementSelector.cjs | 67 + .../css-tree/cjs/syntax/node/Ratio.cjs | 67 + node_modules/css-tree/cjs/syntax/node/Raw.cjs | 48 + .../css-tree/cjs/syntax/node/Rule.cjs | 58 + .../css-tree/cjs/syntax/node/Selector.cjs | 39 + .../css-tree/cjs/syntax/node/SelectorList.cjs | 43 + .../css-tree/cjs/syntax/node/String.cjs | 26 + .../css-tree/cjs/syntax/node/StyleSheet.cjs | 83 + .../css-tree/cjs/syntax/node/TypeSelector.cjs | 59 + .../css-tree/cjs/syntax/node/UnicodeRange.cjs | 158 + node_modules/css-tree/cjs/syntax/node/Url.cjs | 54 + .../css-tree/cjs/syntax/node/Value.cjs | 26 + .../css-tree/cjs/syntax/node/WhiteSpace.cjs | 34 + .../cjs/syntax/node/common/feature-range.cjs | 112 + .../cjs/syntax/node/common/feature.cjs | 76 + .../cjs/syntax/node/index-generate.cjs | 87 + .../cjs/syntax/node/index-parse-selector.cjs | 37 + .../css-tree/cjs/syntax/node/index-parse.cjs | 87 + .../css-tree/cjs/syntax/node/index.cjs | 87 + .../css-tree/cjs/syntax/pseudo/index.cjs | 54 + .../cjs/syntax/scope/atrulePrelude.cjs | 9 + .../css-tree/cjs/syntax/scope/default.cjs | 76 + .../css-tree/cjs/syntax/scope/index.cjs | 11 + .../css-tree/cjs/syntax/scope/selector.cjs | 88 + .../css-tree/cjs/syntax/scope/value.cjs | 29 + .../cjs/tokenizer/OffsetToLocation.cjs | 91 + .../css-tree/cjs/tokenizer/TokenStream.cjs | 264 + .../css-tree/cjs/tokenizer/adopt-buffer.cjs | 13 + .../cjs/tokenizer/char-code-definitions.cjs | 231 + node_modules/css-tree/cjs/tokenizer/index.cjs | 554 + node_modules/css-tree/cjs/tokenizer/names.cjs | 31 + node_modules/css-tree/cjs/tokenizer/types.cjs | 57 + node_modules/css-tree/cjs/tokenizer/utils.cjs | 261 + node_modules/css-tree/cjs/utils/List.cjs | 473 + node_modules/css-tree/cjs/utils/clone.cjs | 25 + .../cjs/utils/create-custom-error.cjs | 18 + node_modules/css-tree/cjs/utils/ident.cjs | 102 + node_modules/css-tree/cjs/utils/index.cjs | 20 + node_modules/css-tree/cjs/utils/names.cjs | 113 + node_modules/css-tree/cjs/utils/string.cjs | 99 + node_modules/css-tree/cjs/utils/url.cjs | 108 + node_modules/css-tree/cjs/version.cjs | 5 + node_modules/css-tree/cjs/walker/create.cjs | 291 + node_modules/css-tree/cjs/walker/index.cjs | 8 + node_modules/css-tree/data/patch.json | 725 ++ node_modules/css-tree/dist/csstree.esm.js | 11 + node_modules/css-tree/dist/csstree.js | 11 + node_modules/css-tree/dist/data.cjs | 1145 ++ node_modules/css-tree/dist/data.js | 1145 ++ node_modules/css-tree/dist/version.cjs | 1 + node_modules/css-tree/dist/version.js | 1 + node_modules/css-tree/lib/convertor/create.js | 28 + node_modules/css-tree/lib/convertor/index.js | 4 + node_modules/css-tree/lib/data-patch.js | 6 + node_modules/css-tree/lib/data.js | 97 + .../lib/definition-syntax/SyntaxError.js | 12 + .../lib/definition-syntax/generate.js | 131 + .../css-tree/lib/definition-syntax/index.js | 4 + .../css-tree/lib/definition-syntax/parse.js | 584 + .../lib/definition-syntax/tokenizer.js | 52 + .../css-tree/lib/definition-syntax/walk.js | 52 + node_modules/css-tree/lib/generator/create.js | 98 + node_modules/css-tree/lib/generator/index.js | 4 + .../css-tree/lib/generator/sourceMap.js | 92 + .../css-tree/lib/generator/token-before.js | 182 + node_modules/css-tree/lib/index.js | 30 + node_modules/css-tree/lib/lexer/Lexer.js | 464 + node_modules/css-tree/lib/lexer/error.js | 123 + .../css-tree/lib/lexer/generic-an-plus-b.js | 238 + .../css-tree/lib/lexer/generic-const.js | 8 + .../css-tree/lib/lexer/generic-urange.js | 151 + node_modules/css-tree/lib/lexer/generic.js | 606 ++ node_modules/css-tree/lib/lexer/index.js | 1 + .../css-tree/lib/lexer/match-graph.js | 456 + node_modules/css-tree/lib/lexer/match.js | 630 ++ .../css-tree/lib/lexer/prepare-tokens.js | 50 + node_modules/css-tree/lib/lexer/search.js | 61 + node_modules/css-tree/lib/lexer/structure.js | 164 + node_modules/css-tree/lib/lexer/trace.js | 66 + node_modules/css-tree/lib/lexer/units.js | 27 + .../css-tree/lib/parser/SyntaxError.js | 65 + node_modules/css-tree/lib/parser/create.js | 346 + node_modules/css-tree/lib/parser/index.js | 4 + .../css-tree/lib/parser/parse-selector.js | 4 + node_modules/css-tree/lib/parser/sequence.js | 43 + .../css-tree/lib/syntax/atrule/font-face.js | 8 + .../css-tree/lib/syntax/atrule/import.js | 39 + .../css-tree/lib/syntax/atrule/index.js | 15 + .../css-tree/lib/syntax/atrule/media.js | 12 + .../css-tree/lib/syntax/atrule/nest.js | 12 + .../css-tree/lib/syntax/atrule/page.js | 12 + .../css-tree/lib/syntax/atrule/supports.js | 80 + .../css-tree/lib/syntax/config/generator.js | 5 + .../css-tree/lib/syntax/config/lexer.js | 8 + .../css-tree/lib/syntax/config/mix.js | 115 + .../lib/syntax/config/parser-selector.js | 15 + .../css-tree/lib/syntax/config/parser.js | 30 + .../css-tree/lib/syntax/config/walker.js | 5 + node_modules/css-tree/lib/syntax/create.js | 54 + .../lib/syntax/function/expression.js | 7 + .../css-tree/lib/syntax/function/var.js | 39 + node_modules/css-tree/lib/syntax/index.js | 10 + .../css-tree/lib/syntax/node/AnPlusB.js | 292 + .../css-tree/lib/syntax/node/Atrule.js | 100 + .../css-tree/lib/syntax/node/AtrulePrelude.js | 47 + .../lib/syntax/node/AttributeSelector.js | 147 + .../css-tree/lib/syntax/node/Block.js | 95 + .../css-tree/lib/syntax/node/Brackets.js | 35 + node_modules/css-tree/lib/syntax/node/CDC.js | 19 + node_modules/css-tree/lib/syntax/node/CDO.js | 19 + .../css-tree/lib/syntax/node/ClassSelector.js | 24 + .../css-tree/lib/syntax/node/Combinator.js | 54 + .../css-tree/lib/syntax/node/Comment.js | 33 + .../css-tree/lib/syntax/node/Declaration.js | 165 + .../lib/syntax/node/DeclarationList.js | 62 + .../css-tree/lib/syntax/node/Dimension.js | 23 + .../css-tree/lib/syntax/node/Function.js | 41 + node_modules/css-tree/lib/syntax/node/Hash.js | 23 + .../css-tree/lib/syntax/node/IdSelector.js | 26 + .../css-tree/lib/syntax/node/Identifier.js | 18 + .../css-tree/lib/syntax/node/MediaFeature.js | 77 + .../css-tree/lib/syntax/node/MediaQuery.js | 60 + .../lib/syntax/node/MediaQueryList.js | 34 + .../lib/syntax/node/NestingSelector.js | 22 + node_modules/css-tree/lib/syntax/node/Nth.js | 47 + .../css-tree/lib/syntax/node/Number.js | 18 + .../css-tree/lib/syntax/node/Operator.js | 21 + .../css-tree/lib/syntax/node/Parentheses.js | 34 + .../css-tree/lib/syntax/node/Percentage.js | 18 + .../lib/syntax/node/PseudoClassSelector.js | 63 + .../lib/syntax/node/PseudoElementSelector.js | 64 + .../css-tree/lib/syntax/node/Ratio.js | 59 + node_modules/css-tree/lib/syntax/node/Raw.js | 41 + node_modules/css-tree/lib/syntax/node/Rule.js | 51 + .../css-tree/lib/syntax/node/Selector.js | 32 + .../css-tree/lib/syntax/node/SelectorList.js | 35 + .../css-tree/lib/syntax/node/String.js | 19 + .../css-tree/lib/syntax/node/StyleSheet.js | 82 + .../css-tree/lib/syntax/node/TypeSelector.js | 52 + .../css-tree/lib/syntax/node/UnicodeRange.js | 156 + node_modules/css-tree/lib/syntax/node/Url.js | 52 + .../css-tree/lib/syntax/node/Value.js | 19 + .../css-tree/lib/syntax/node/WhiteSpace.js | 27 + .../lib/syntax/node/index-generate.js | 41 + .../lib/syntax/node/index-parse-selector.js | 16 + .../css-tree/lib/syntax/node/index-parse.js | 41 + .../css-tree/lib/syntax/node/index.js | 41 + .../css-tree/lib/syntax/pseudo/index.js | 50 + .../lib/syntax/scope/atrulePrelude.js | 5 + .../css-tree/lib/syntax/scope/default.js | 85 + .../css-tree/lib/syntax/scope/index.js | 3 + .../css-tree/lib/syntax/scope/selector.js | 94 + .../css-tree/lib/syntax/scope/value.js | 25 + .../lib/tokenizer/OffsetToLocation.js | 87 + .../css-tree/lib/tokenizer/TokenStream.js | 272 + .../css-tree/lib/tokenizer/adopt-buffer.js | 9 + .../lib/tokenizer/char-code-definitions.js | 207 + node_modules/css-tree/lib/tokenizer/index.js | 513 + node_modules/css-tree/lib/tokenizer/names.js | 27 + node_modules/css-tree/lib/tokenizer/types.js | 28 + node_modules/css-tree/lib/tokenizer/utils.js | 254 + node_modules/css-tree/lib/utils/List.js | 469 + node_modules/css-tree/lib/utils/clone.js | 21 + .../css-tree/lib/utils/create-custom-error.js | 14 + node_modules/css-tree/lib/utils/ident.js | 101 + node_modules/css-tree/lib/utils/index.js | 6 + node_modules/css-tree/lib/utils/names.js | 106 + node_modules/css-tree/lib/utils/string.js | 99 + node_modules/css-tree/lib/utils/url.js | 108 + node_modules/css-tree/lib/version.js | 5 + node_modules/css-tree/lib/walker/create.js | 287 + node_modules/css-tree/lib/walker/index.js | 4 + node_modules/css-tree/package.json | 126 + node_modules/cssesc/LICENSE-MIT.txt | 20 + node_modules/cssesc/README.md | 201 + node_modules/cssesc/bin/cssesc | 116 + node_modules/cssesc/cssesc.js | 110 + node_modules/cssesc/man/cssesc.1 | 70 + node_modules/cssesc/package.json | 51 + node_modules/debug/LICENSE | 20 + node_modules/debug/README.md | 481 + node_modules/debug/package.json | 59 + node_modules/debug/src/browser.js | 269 + node_modules/debug/src/common.js | 274 + node_modules/debug/src/index.js | 10 + node_modules/debug/src/node.js | 263 + node_modules/decamelize-keys/index.js | 19 + node_modules/decamelize-keys/license | 21 + .../node_modules/decamelize/index.js | 13 + .../node_modules/decamelize/license | 21 + .../node_modules/decamelize/package.json | 38 + .../node_modules/decamelize/readme.md | 48 + .../node_modules/map-obj/index.js | 13 + .../node_modules/map-obj/license | 21 + .../node_modules/map-obj/package.json | 36 + .../node_modules/map-obj/readme.md | 29 + node_modules/decamelize-keys/package.json | 63 + node_modules/decamelize-keys/readme.md | 69 + node_modules/decamelize/index.d.ts | 59 + node_modules/decamelize/index.js | 65 + node_modules/decamelize/license | 9 + node_modules/decamelize/package.json | 40 + node_modules/decamelize/readme.md | 92 + node_modules/dir-glob/index.js | 75 + node_modules/dir-glob/license | 9 + node_modules/dir-glob/package.json | 38 + node_modules/dir-glob/readme.md | 76 + node_modules/emoji-regex/LICENSE-MIT.txt | 20 + node_modules/emoji-regex/README.md | 73 + node_modules/emoji-regex/es2015/index.js | 6 + node_modules/emoji-regex/es2015/text.js | 6 + node_modules/emoji-regex/index.d.ts | 23 + node_modules/emoji-regex/index.js | 6 + node_modules/emoji-regex/package.json | 50 + node_modules/emoji-regex/text.js | 6 + node_modules/error-ex/LICENSE | 21 + node_modules/error-ex/README.md | 144 + node_modules/error-ex/index.js | 141 + node_modules/error-ex/package.json | 46 + node_modules/escape-string-regexp/index.js | 11 + node_modules/escape-string-regexp/license | 21 + .../escape-string-regexp/package.json | 41 + node_modules/escape-string-regexp/readme.md | 27 + node_modules/fast-deep-equal/LICENSE | 21 + node_modules/fast-deep-equal/README.md | 96 + node_modules/fast-deep-equal/es6/index.d.ts | 2 + node_modules/fast-deep-equal/es6/index.js | 72 + node_modules/fast-deep-equal/es6/react.d.ts | 2 + node_modules/fast-deep-equal/es6/react.js | 79 + node_modules/fast-deep-equal/index.d.ts | 4 + node_modules/fast-deep-equal/index.js | 46 + node_modules/fast-deep-equal/package.json | 61 + node_modules/fast-deep-equal/react.d.ts | 2 + node_modules/fast-deep-equal/react.js | 53 + node_modules/fast-glob/LICENSE | 21 + node_modules/fast-glob/README.md | 859 ++ node_modules/fast-glob/out/index.d.ts | 40 + node_modules/fast-glob/out/index.js | 102 + .../fast-glob/out/managers/tasks.d.ts | 22 + node_modules/fast-glob/out/managers/tasks.js | 110 + .../fast-glob/out/providers/async.d.ts | 9 + node_modules/fast-glob/out/providers/async.js | 23 + .../fast-glob/out/providers/filters/deep.d.ts | 16 + .../fast-glob/out/providers/filters/deep.js | 62 + .../out/providers/filters/entry.d.ts | 16 + .../fast-glob/out/providers/filters/entry.js | 63 + .../out/providers/filters/error.d.ts | 8 + .../fast-glob/out/providers/filters/error.js | 15 + .../out/providers/matchers/matcher.d.ts | 33 + .../out/providers/matchers/matcher.js | 45 + .../out/providers/matchers/partial.d.ts | 4 + .../out/providers/matchers/partial.js | 38 + .../fast-glob/out/providers/provider.d.ts | 19 + .../fast-glob/out/providers/provider.js | 48 + .../fast-glob/out/providers/stream.d.ts | 11 + .../fast-glob/out/providers/stream.js | 31 + .../fast-glob/out/providers/sync.d.ts | 9 + node_modules/fast-glob/out/providers/sync.js | 23 + .../out/providers/transformers/entry.d.ts | 8 + .../out/providers/transformers/entry.js | 26 + node_modules/fast-glob/out/readers/async.d.ts | 10 + node_modules/fast-glob/out/readers/async.js | 35 + .../fast-glob/out/readers/reader.d.ts | 15 + node_modules/fast-glob/out/readers/reader.js | 33 + .../fast-glob/out/readers/stream.d.ts | 14 + node_modules/fast-glob/out/readers/stream.js | 55 + node_modules/fast-glob/out/readers/sync.d.ts | 12 + node_modules/fast-glob/out/readers/sync.js | 43 + node_modules/fast-glob/out/settings.d.ts | 164 + node_modules/fast-glob/out/settings.js | 57 + node_modules/fast-glob/out/types/index.d.ts | 31 + node_modules/fast-glob/out/types/index.js | 2 + node_modules/fast-glob/out/utils/array.d.ts | 2 + node_modules/fast-glob/out/utils/array.js | 22 + node_modules/fast-glob/out/utils/errno.d.ts | 2 + node_modules/fast-glob/out/utils/errno.js | 7 + node_modules/fast-glob/out/utils/fs.d.ts | 4 + node_modules/fast-glob/out/utils/fs.js | 19 + node_modules/fast-glob/out/utils/index.d.ts | 8 + node_modules/fast-glob/out/utils/index.js | 17 + node_modules/fast-glob/out/utils/path.d.ts | 13 + node_modules/fast-glob/out/utils/path.js | 68 + node_modules/fast-glob/out/utils/pattern.d.ts | 47 + node_modules/fast-glob/out/utils/pattern.js | 188 + node_modules/fast-glob/out/utils/stream.d.ts | 4 + node_modules/fast-glob/out/utils/stream.js | 17 + node_modules/fast-glob/out/utils/string.d.ts | 2 + node_modules/fast-glob/out/utils/string.js | 11 + node_modules/fast-glob/package.json | 81 + .../fastest-levenshtein/.eslintrc.json | 30 + node_modules/fastest-levenshtein/.prettierrc | 4 + node_modules/fastest-levenshtein/.travis.yml | 21 + node_modules/fastest-levenshtein/LICENSE.md | 21 + node_modules/fastest-levenshtein/README.md | 57 + node_modules/fastest-levenshtein/bench.js | 96 + node_modules/fastest-levenshtein/esm/mod.d.ts | 4 + .../fastest-levenshtein/esm/mod.d.ts.map | 1 + node_modules/fastest-levenshtein/esm/mod.js | 138 + node_modules/fastest-levenshtein/mod.d.ts | 3 + node_modules/fastest-levenshtein/mod.js | 142 + node_modules/fastest-levenshtein/package.json | 72 + node_modules/fastest-levenshtein/test.js | 55 + node_modules/fastest-levenshtein/test.ts | 67 + node_modules/fastq/.github/dependabot.yml | 11 + node_modules/fastq/.github/workflows/ci.yml | 50 + node_modules/fastq/LICENSE | 13 + node_modules/fastq/README.md | 309 + node_modules/fastq/bench.js | 66 + node_modules/fastq/example.js | 14 + node_modules/fastq/example.mjs | 11 + node_modules/fastq/index.d.ts | 37 + node_modules/fastq/package.json | 52 + node_modules/fastq/queue.js | 289 + node_modules/fastq/test/example.ts | 81 + node_modules/fastq/test/promise.js | 248 + node_modules/fastq/test/test.js | 566 + node_modules/fastq/test/tsconfig.json | 11 + node_modules/file-entry-cache/LICENSE | 22 + node_modules/file-entry-cache/README.md | 112 + node_modules/file-entry-cache/cache.js | 291 + node_modules/file-entry-cache/changelog.md | 163 + node_modules/file-entry-cache/package.json | 80 + node_modules/fill-range/LICENSE | 21 + node_modules/fill-range/README.md | 237 + node_modules/fill-range/index.js | 249 + node_modules/fill-range/package.json | 69 + node_modules/find-up/index.d.ts | 138 + node_modules/find-up/index.js | 89 + node_modules/find-up/license | 9 + node_modules/find-up/package.json | 54 + node_modules/find-up/readme.md | 151 + node_modules/flat-cache/LICENSE | 22 + node_modules/flat-cache/README.md | 73 + node_modules/flat-cache/changelog.md | 328 + node_modules/flat-cache/package.json | 84 + node_modules/flat-cache/src/cache.js | 197 + node_modules/flat-cache/src/del.js | 13 + node_modules/flat-cache/src/utils.js | 44 + node_modules/flatted/LICENSE | 15 + node_modules/flatted/README.md | 111 + node_modules/flatted/cjs/index.js | 99 + node_modules/flatted/cjs/package.json | 1 + node_modules/flatted/es.js | 2 + node_modules/flatted/esm.js | 2 + node_modules/flatted/esm/index.js | 94 + node_modules/flatted/index.js | 135 + node_modules/flatted/min.js | 2 + node_modules/flatted/package.json | 63 + node_modules/flatted/php/flatted.php | 156 + node_modules/flatted/types.d.ts | 62 + node_modules/fs.realpath/LICENSE | 43 + node_modules/fs.realpath/README.md | 33 + node_modules/fs.realpath/index.js | 66 + node_modules/fs.realpath/old.js | 303 + node_modules/fs.realpath/package.json | 26 + node_modules/function-bind/.editorconfig | 20 + node_modules/function-bind/.eslintrc | 15 + node_modules/function-bind/.jscs.json | 176 + node_modules/function-bind/.npmignore | 22 + node_modules/function-bind/.travis.yml | 168 + node_modules/function-bind/LICENSE | 20 + node_modules/function-bind/README.md | 48 + node_modules/function-bind/implementation.js | 52 + node_modules/function-bind/index.js | 5 + node_modules/function-bind/package.json | 63 + node_modules/function-bind/test/.eslintrc | 9 + node_modules/function-bind/test/index.js | 252 + node_modules/glob-parent/CHANGELOG.md | 110 + node_modules/glob-parent/LICENSE | 15 + node_modules/glob-parent/README.md | 137 + node_modules/glob-parent/index.js | 42 + node_modules/glob-parent/package.json | 48 + node_modules/glob/LICENSE | 21 + node_modules/glob/README.md | 378 + node_modules/glob/common.js | 238 + node_modules/glob/glob.js | 790 ++ node_modules/glob/package.json | 55 + node_modules/glob/sync.js | 486 + node_modules/global-modules/LICENSE | 21 + node_modules/global-modules/README.md | 87 + node_modules/global-modules/index.js | 29 + node_modules/global-modules/package.json | 66 + node_modules/global-prefix/LICENSE | 21 + node_modules/global-prefix/README.md | 92 + node_modules/global-prefix/index.js | 85 + node_modules/global-prefix/package.json | 50 + node_modules/globby/gitignore.js | 120 + node_modules/globby/index.d.ts | 186 + node_modules/globby/index.js | 181 + node_modules/globby/license | 9 + node_modules/globby/package.json | 82 + node_modules/globby/readme.md | 170 + node_modules/globby/stream-utils.js | 46 + node_modules/globjoin/CHANGELOG.md | 14 + node_modules/globjoin/LICENSE | 22 + node_modules/globjoin/README.md | 54 + node_modules/globjoin/index.js | 43 + node_modules/globjoin/package.json | 37 + node_modules/hard-rejection/index.d.ts | 15 + node_modules/hard-rejection/index.js | 25 + node_modules/hard-rejection/license | 9 + node_modules/hard-rejection/package.json | 47 + node_modules/hard-rejection/readme.md | 77 + node_modules/hard-rejection/register.js | 2 + node_modules/has-flag/index.js | 8 + node_modules/has-flag/license | 9 + node_modules/has-flag/package.json | 44 + node_modules/has-flag/readme.md | 70 + node_modules/has/LICENSE-MIT | 22 + node_modules/has/README.md | 18 + node_modules/has/package.json | 48 + node_modules/has/src/index.js | 5 + node_modules/has/test/index.js | 10 + node_modules/hosted-git-info/LICENSE | 13 + node_modules/hosted-git-info/README.md | 133 + node_modules/hosted-git-info/git-host-info.js | 184 + node_modules/hosted-git-info/git-host.js | 110 + node_modules/hosted-git-info/index.js | 237 + node_modules/hosted-git-info/package.json | 51 + node_modules/html-tags/html-tags-void.json | 17 + node_modules/html-tags/html-tags.json | 120 + node_modules/html-tags/index.d.ts | 136 + node_modules/html-tags/index.js | 2 + node_modules/html-tags/license | 9 + node_modules/html-tags/package.json | 48 + node_modules/html-tags/readme.md | 35 + node_modules/html-tags/void.d.ts | 33 + node_modules/html-tags/void.js | 2 + node_modules/ignore/LICENSE-MIT | 21 + node_modules/ignore/README.md | 412 + node_modules/ignore/index.d.ts | 61 + node_modules/ignore/index.js | 618 ++ node_modules/ignore/legacy.js | 539 + node_modules/ignore/package.json | 73 + node_modules/import-fresh/index.d.ts | 30 + node_modules/import-fresh/index.js | 33 + node_modules/import-fresh/license | 9 + .../node_modules/resolve-from/index.js | 47 + .../node_modules/resolve-from/license | 9 + .../node_modules/resolve-from/package.json | 34 + .../node_modules/resolve-from/readme.md | 72 + node_modules/import-fresh/package.json | 43 + node_modules/import-fresh/readme.md | 48 + node_modules/import-lazy/index.d.ts | 26 + node_modules/import-lazy/index.js | 27 + node_modules/import-lazy/license | 9 + node_modules/import-lazy/package.json | 40 + node_modules/import-lazy/readme.md | 57 + node_modules/imurmurhash/README.md | 122 + node_modules/imurmurhash/imurmurhash.js | 138 + node_modules/imurmurhash/imurmurhash.min.js | 12 + node_modules/imurmurhash/package.json | 40 + node_modules/indent-string/index.d.ts | 38 + node_modules/indent-string/index.js | 38 + node_modules/indent-string/license | 9 + node_modules/indent-string/package.json | 40 + node_modules/indent-string/readme.md | 73 + node_modules/inflight/LICENSE | 15 + node_modules/inflight/README.md | 37 + node_modules/inflight/inflight.js | 54 + node_modules/inflight/package.json | 29 + node_modules/inherits/LICENSE | 16 + node_modules/inherits/README.md | 42 + node_modules/inherits/inherits.js | 9 + node_modules/inherits/inherits_browser.js | 27 + node_modules/inherits/package.json | 29 + node_modules/ini/LICENSE | 15 + node_modules/ini/README.md | 102 + node_modules/ini/ini.js | 206 + node_modules/ini/package.json | 33 + node_modules/is-arrayish/.editorconfig | 18 + node_modules/is-arrayish/.istanbul.yml | 4 + node_modules/is-arrayish/.npmignore | 5 + node_modules/is-arrayish/.travis.yml | 17 + node_modules/is-arrayish/LICENSE | 21 + node_modules/is-arrayish/README.md | 16 + node_modules/is-arrayish/index.js | 10 + node_modules/is-arrayish/package.json | 34 + node_modules/is-core-module/.eslintrc | 18 + node_modules/is-core-module/.nycrc | 9 + node_modules/is-core-module/CHANGELOG.md | 166 + node_modules/is-core-module/LICENSE | 20 + node_modules/is-core-module/README.md | 40 + node_modules/is-core-module/core.json | 158 + node_modules/is-core-module/index.js | 69 + node_modules/is-core-module/package.json | 73 + node_modules/is-core-module/test/index.js | 133 + node_modules/is-extglob/LICENSE | 21 + node_modules/is-extglob/README.md | 107 + node_modules/is-extglob/index.js | 20 + node_modules/is-extglob/package.json | 69 + .../is-fullwidth-code-point/index.d.ts | 17 + node_modules/is-fullwidth-code-point/index.js | 50 + node_modules/is-fullwidth-code-point/license | 9 + .../is-fullwidth-code-point/package.json | 42 + .../is-fullwidth-code-point/readme.md | 39 + node_modules/is-glob/LICENSE | 21 + node_modules/is-glob/README.md | 206 + node_modules/is-glob/index.js | 150 + node_modules/is-glob/package.json | 81 + node_modules/is-number/LICENSE | 21 + node_modules/is-number/README.md | 187 + node_modules/is-number/index.js | 18 + node_modules/is-number/package.json | 82 + node_modules/is-plain-obj/index.js | 7 + node_modules/is-plain-obj/license | 21 + node_modules/is-plain-obj/package.json | 36 + node_modules/is-plain-obj/readme.md | 35 + node_modules/is-plain-object/LICENSE | 21 + node_modules/is-plain-object/README.md | 125 + .../is-plain-object/dist/is-plain-object.js | 38 + .../is-plain-object/dist/is-plain-object.mjs | 34 + .../is-plain-object/is-plain-object.d.ts | 1 + node_modules/is-plain-object/package.json | 85 + node_modules/isexe/.npmignore | 2 + node_modules/isexe/LICENSE | 15 + node_modules/isexe/README.md | 51 + node_modules/isexe/index.js | 57 + node_modules/isexe/mode.js | 41 + node_modules/isexe/package.json | 31 + node_modules/isexe/test/basic.js | 221 + node_modules/isexe/windows.js | 42 + node_modules/js-tokens/CHANGELOG.md | 151 + node_modules/js-tokens/LICENSE | 21 + node_modules/js-tokens/README.md | 240 + node_modules/js-tokens/index.js | 23 + node_modules/js-tokens/package.json | 30 + node_modules/js-yaml/CHANGELOG.md | 616 ++ node_modules/js-yaml/LICENSE | 21 + node_modules/js-yaml/README.md | 246 + node_modules/js-yaml/bin/js-yaml.js | 126 + node_modules/js-yaml/dist/js-yaml.js | 3874 +++++++ node_modules/js-yaml/dist/js-yaml.min.js | 2 + node_modules/js-yaml/dist/js-yaml.mjs | 3851 +++++++ node_modules/js-yaml/index.js | 47 + node_modules/js-yaml/lib/common.js | 59 + node_modules/js-yaml/lib/dumper.js | 965 ++ node_modules/js-yaml/lib/exception.js | 55 + node_modules/js-yaml/lib/loader.js | 1727 +++ node_modules/js-yaml/lib/schema.js | 121 + node_modules/js-yaml/lib/schema/core.js | 11 + node_modules/js-yaml/lib/schema/default.js | 22 + node_modules/js-yaml/lib/schema/failsafe.js | 17 + node_modules/js-yaml/lib/schema/json.js | 19 + node_modules/js-yaml/lib/snippet.js | 101 + node_modules/js-yaml/lib/type.js | 66 + node_modules/js-yaml/lib/type/binary.js | 125 + node_modules/js-yaml/lib/type/bool.js | 35 + node_modules/js-yaml/lib/type/float.js | 97 + node_modules/js-yaml/lib/type/int.js | 156 + node_modules/js-yaml/lib/type/map.js | 8 + node_modules/js-yaml/lib/type/merge.js | 12 + node_modules/js-yaml/lib/type/null.js | 35 + node_modules/js-yaml/lib/type/omap.js | 44 + node_modules/js-yaml/lib/type/pairs.js | 53 + node_modules/js-yaml/lib/type/seq.js | 8 + node_modules/js-yaml/lib/type/set.js | 29 + node_modules/js-yaml/lib/type/str.js | 8 + node_modules/js-yaml/lib/type/timestamp.js | 88 + node_modules/js-yaml/package.json | 66 + .../CHANGELOG.md | 50 + .../json-parse-even-better-errors/LICENSE.md | 25 + .../json-parse-even-better-errors/README.md | 96 + .../json-parse-even-better-errors/index.js | 121 + .../package.json | 33 + .../json-schema-traverse/.eslintrc.yml | 27 + .../json-schema-traverse/.github/FUNDING.yml | 2 + .../.github/workflows/build.yml | 28 + .../.github/workflows/publish.yml | 27 + node_modules/json-schema-traverse/LICENSE | 21 + node_modules/json-schema-traverse/README.md | 95 + node_modules/json-schema-traverse/index.d.ts | 40 + node_modules/json-schema-traverse/index.js | 93 + .../json-schema-traverse/package.json | 43 + .../json-schema-traverse/spec/.eslintrc.yml | 6 + .../spec/fixtures/schema.js | 125 + .../json-schema-traverse/spec/index.spec.js | 171 + node_modules/kind-of/CHANGELOG.md | 160 + node_modules/kind-of/LICENSE | 21 + node_modules/kind-of/README.md | 367 + node_modules/kind-of/index.js | 129 + node_modules/kind-of/package.json | 88 + node_modules/known-css-properties/LICENSE | 21 + node_modules/known-css-properties/README.md | 48 + .../known-css-properties/data/all.json | 1219 +++ node_modules/known-css-properties/index.d.ts | 3 + node_modules/known-css-properties/index.js | 1 + .../known-css-properties/package.json | 56 + node_modules/lines-and-columns/LICENSE | 21 + node_modules/lines-and-columns/README.md | 33 + .../lines-and-columns/build/index.d.ts | 13 + node_modules/lines-and-columns/build/index.js | 62 + node_modules/lines-and-columns/package.json | 49 + node_modules/locate-path/index.d.ts | 83 + node_modules/locate-path/index.js | 68 + node_modules/locate-path/license | 9 + node_modules/locate-path/package.json | 46 + node_modules/locate-path/readme.md | 125 + node_modules/lodash.truncate/LICENSE | 47 + node_modules/lodash.truncate/README.md | 18 + node_modules/lodash.truncate/index.js | 632 ++ node_modules/lodash.truncate/package.json | 17 + node_modules/lru-cache/LICENSE | 15 + node_modules/lru-cache/README.md | 166 + node_modules/lru-cache/index.js | 334 + node_modules/lru-cache/package.json | 34 + node_modules/map-obj/index.d.ts | 151 + node_modules/map-obj/index.js | 68 + node_modules/map-obj/license | 9 + node_modules/map-obj/package.json | 43 + node_modules/map-obj/readme.md | 105 + node_modules/mathml-tag-names/index.json | 204 + node_modules/mathml-tag-names/license | 22 + node_modules/mathml-tag-names/package.json | 74 + node_modules/mathml-tag-names/readme.md | 103 + node_modules/mdn-data/CHANGELOG.md | 66 + node_modules/mdn-data/LICENSE | 116 + node_modules/mdn-data/README.md | 62 + node_modules/mdn-data/api/index.js | 3 + node_modules/mdn-data/api/inheritance.json | 2681 +++++ .../mdn-data/api/inheritance.schema.json | 31 + node_modules/mdn-data/css/at-rules.json | 620 ++ .../mdn-data/css/at-rules.schema.json | 131 + node_modules/mdn-data/css/definitions.json | 78 + node_modules/mdn-data/css/index.js | 8 + node_modules/mdn-data/css/properties.json | 9626 +++++++++++++++++ .../mdn-data/css/properties.schema.json | 412 + node_modules/mdn-data/css/readme.md | 32 + node_modules/mdn-data/css/selectors.json | 1044 ++ .../mdn-data/css/selectors.schema.json | 36 + node_modules/mdn-data/css/syntaxes.json | 866 ++ .../mdn-data/css/syntaxes.schema.json | 15 + node_modules/mdn-data/css/types.json | 265 + node_modules/mdn-data/css/types.schema.json | 32 + node_modules/mdn-data/css/units.json | 213 + node_modules/mdn-data/css/units.schema.json | 28 + node_modules/mdn-data/index.js | 5 + node_modules/mdn-data/l10n/css.json | 1714 +++ node_modules/mdn-data/l10n/index.js | 3 + node_modules/mdn-data/package.json | 38 + node_modules/meow/index.d.ts | 317 + node_modules/meow/index.js | 247 + node_modules/meow/license | 9 + node_modules/meow/package.json | 76 + node_modules/meow/readme.md | 321 + node_modules/merge2/LICENSE | 21 + node_modules/merge2/README.md | 144 + node_modules/merge2/index.js | 144 + node_modules/merge2/package.json | 43 + node_modules/micromatch/LICENSE | 21 + node_modules/micromatch/README.md | 1011 ++ node_modules/micromatch/index.js | 467 + node_modules/micromatch/package.json | 119 + node_modules/min-indent/index.js | 10 + node_modules/min-indent/license | 22 + node_modules/min-indent/package.json | 38 + node_modules/min-indent/readme.md | 41 + node_modules/minimatch/LICENSE | 15 + node_modules/minimatch/README.md | 230 + node_modules/minimatch/minimatch.js | 947 ++ node_modules/minimatch/package.json | 33 + node_modules/minimist-options/index.d.ts | 55 + node_modules/minimist-options/index.js | 117 + node_modules/minimist-options/license | 21 + node_modules/minimist-options/package.json | 34 + node_modules/minimist-options/readme.md | 112 + node_modules/ms/index.js | 162 + node_modules/ms/license.md | 21 + node_modules/ms/package.json | 37 + node_modules/ms/readme.md | 60 + node_modules/nanoid/LICENSE | 20 + node_modules/nanoid/README.md | 39 + node_modules/nanoid/async/index.browser.cjs | 34 + node_modules/nanoid/async/index.browser.js | 34 + node_modules/nanoid/async/index.cjs | 35 + node_modules/nanoid/async/index.d.ts | 56 + node_modules/nanoid/async/index.js | 35 + node_modules/nanoid/async/index.native.js | 26 + node_modules/nanoid/async/package.json | 12 + node_modules/nanoid/bin/nanoid.cjs | 55 + node_modules/nanoid/index.browser.cjs | 34 + node_modules/nanoid/index.browser.js | 34 + node_modules/nanoid/index.cjs | 45 + node_modules/nanoid/index.d.ts | 91 + node_modules/nanoid/index.js | 45 + node_modules/nanoid/nanoid.js | 1 + node_modules/nanoid/non-secure/index.cjs | 21 + node_modules/nanoid/non-secure/index.d.ts | 33 + node_modules/nanoid/non-secure/index.js | 21 + node_modules/nanoid/non-secure/package.json | 6 + node_modules/nanoid/package.json | 66 + node_modules/nanoid/url-alphabet/index.cjs | 3 + node_modules/nanoid/url-alphabet/index.js | 3 + node_modules/nanoid/url-alphabet/package.json | 6 + node_modules/normalize-package-data/AUTHORS | 4 + node_modules/normalize-package-data/LICENSE | 15 + node_modules/normalize-package-data/README.md | 108 + .../lib/extract_description.js | 22 + .../normalize-package-data/lib/fixer.js | 474 + .../lib/make_warning.js | 22 + .../normalize-package-data/lib/normalize.js | 48 + .../normalize-package-data/lib/safe_format.js | 11 + .../normalize-package-data/lib/typos.json | 25 + .../lib/warning_messages.json | 30 + .../normalize-package-data/package.json | 41 + node_modules/normalize-path/LICENSE | 21 + node_modules/normalize-path/README.md | 127 + node_modules/normalize-path/index.js | 35 + node_modules/normalize-path/package.json | 77 + node_modules/once/LICENSE | 15 + node_modules/once/README.md | 79 + node_modules/once/once.js | 42 + node_modules/once/package.json | 33 + node_modules/p-limit/index.d.ts | 42 + node_modules/p-limit/index.js | 71 + node_modules/p-limit/license | 9 + node_modules/p-limit/package.json | 52 + node_modules/p-limit/readme.md | 101 + node_modules/p-locate/index.d.ts | 53 + node_modules/p-locate/index.js | 50 + node_modules/p-locate/license | 9 + node_modules/p-locate/package.json | 54 + node_modules/p-locate/readme.md | 93 + node_modules/parent-module/index.js | 37 + node_modules/parent-module/license | 9 + node_modules/parent-module/package.json | 46 + node_modules/parent-module/readme.md | 67 + node_modules/parse-json/index.js | 54 + node_modules/parse-json/license | 9 + node_modules/parse-json/package.json | 45 + node_modules/parse-json/readme.md | 119 + node_modules/path-exists/index.d.ts | 28 + node_modules/path-exists/index.js | 23 + node_modules/path-exists/license | 9 + node_modules/path-exists/package.json | 39 + node_modules/path-exists/readme.md | 52 + node_modules/path-is-absolute/index.js | 20 + node_modules/path-is-absolute/license | 21 + node_modules/path-is-absolute/package.json | 43 + node_modules/path-is-absolute/readme.md | 59 + node_modules/path-type/index.d.ts | 51 + node_modules/path-type/index.js | 43 + node_modules/path-type/license | 9 + node_modules/path-type/package.json | 45 + node_modules/path-type/readme.md | 72 + node_modules/picocolors/LICENSE | 15 + node_modules/picocolors/README.md | 21 + node_modules/picocolors/package.json | 25 + node_modules/picocolors/picocolors.browser.js | 4 + node_modules/picocolors/picocolors.d.ts | 5 + node_modules/picocolors/picocolors.js | 58 + node_modules/picocolors/types.ts | 30 + node_modules/picomatch/CHANGELOG.md | 136 + node_modules/picomatch/LICENSE | 21 + node_modules/picomatch/README.md | 708 ++ node_modules/picomatch/index.js | 3 + node_modules/picomatch/lib/constants.js | 179 + node_modules/picomatch/lib/parse.js | 1091 ++ node_modules/picomatch/lib/picomatch.js | 342 + node_modules/picomatch/lib/scan.js | 391 + node_modules/picomatch/lib/utils.js | 64 + node_modules/picomatch/package.json | 81 + .../postcss-media-query-parser/CHANGELOG.md | 20 + .../postcss-media-query-parser/README.md | 173 + .../postcss-media-query-parser/dist/index.js | 43 + .../dist/nodes/Container.js | 94 + .../dist/nodes/Node.js | 18 + .../dist/parsers.js | 367 + .../postcss-media-query-parser/package.json | 60 + .../postcss-resolve-nested-selector/LICENSE | 21 + .../postcss-resolve-nested-selector/README.md | 65 + .../postcss-resolve-nested-selector/index.js | 25 + .../package.json | 20 + node_modules/postcss-safe-parser/LICENSE | 20 + node_modules/postcss-safe-parser/README.md | 34 + .../postcss-safe-parser/lib/safe-parse.js | 12 + .../postcss-safe-parser/lib/safe-parser.js | 99 + node_modules/postcss-safe-parser/package.json | 26 + node_modules/postcss-scss/LICENSE | 20 + node_modules/postcss-scss/README.md | 23 + .../postcss-scss/lib/nested-declaration.js | 12 + node_modules/postcss-scss/lib/scss-parse.js | 12 + node_modules/postcss-scss/lib/scss-parser.js | 201 + .../postcss-scss/lib/scss-stringifier.js | 51 + .../postcss-scss/lib/scss-stringify.js | 6 + .../postcss-scss/lib/scss-syntax.d.ts | 4 + node_modules/postcss-scss/lib/scss-syntax.js | 4 + node_modules/postcss-scss/lib/scss-syntax.mjs | 6 + .../postcss-scss/lib/scss-tokenize.js | 335 + node_modules/postcss-scss/package.json | 47 + node_modules/postcss-selector-parser/API.md | 872 ++ .../postcss-selector-parser/CHANGELOG.md | 525 + .../postcss-selector-parser/LICENSE-MIT | 22 + .../postcss-selector-parser/README.md | 49 + .../postcss-selector-parser/dist/index.js | 17 + .../postcss-selector-parser/dist/parser.js | 1012 ++ .../postcss-selector-parser/dist/processor.js | 170 + .../dist/selectors/attribute.js | 448 + .../dist/selectors/className.js | 50 + .../dist/selectors/combinator.js | 21 + .../dist/selectors/comment.js | 21 + .../dist/selectors/constructors.js | 65 + .../dist/selectors/container.js | 308 + .../dist/selectors/guards.js | 58 + .../dist/selectors/id.js | 25 + .../dist/selectors/index.js | 21 + .../dist/selectors/namespace.js | 80 + .../dist/selectors/nesting.js | 22 + .../dist/selectors/node.js | 192 + .../dist/selectors/pseudo.js | 26 + .../dist/selectors/root.js | 44 + .../dist/selectors/selector.js | 21 + .../dist/selectors/string.js | 21 + .../dist/selectors/tag.js | 21 + .../dist/selectors/types.js | 28 + .../dist/selectors/universal.js | 22 + .../dist/sortAscending.js | 11 + .../dist/tokenTypes.js | 70 + .../postcss-selector-parser/dist/tokenize.js | 239 + .../dist/util/ensureObject.js | 17 + .../dist/util/getProp.js | 18 + .../dist/util/index.js | 13 + .../dist/util/stripComments.js | 21 + .../dist/util/unesc.js | 76 + .../postcss-selector-parser/package.json | 79 + .../postcss-selector-parser.d.ts | 555 + node_modules/postcss-value-parser/LICENSE | 22 + node_modules/postcss-value-parser/README.md | 263 + .../postcss-value-parser/lib/index.d.ts | 177 + .../postcss-value-parser/lib/index.js | 28 + .../postcss-value-parser/lib/parse.js | 321 + .../postcss-value-parser/lib/stringify.js | 48 + node_modules/postcss-value-parser/lib/unit.js | 120 + node_modules/postcss-value-parser/lib/walk.js | 22 + .../postcss-value-parser/package.json | 58 + node_modules/postcss/LICENSE | 20 + node_modules/postcss/README.md | 44 + node_modules/postcss/lib/at-rule.d.ts | 115 + node_modules/postcss/lib/at-rule.js | 25 + node_modules/postcss/lib/comment.d.ts | 67 + node_modules/postcss/lib/comment.js | 13 + node_modules/postcss/lib/container.d.ts | 451 + node_modules/postcss/lib/container.js | 439 + .../postcss/lib/css-syntax-error.d.ts | 248 + node_modules/postcss/lib/css-syntax-error.js | 100 + node_modules/postcss/lib/declaration.d.ts | 146 + node_modules/postcss/lib/declaration.js | 24 + node_modules/postcss/lib/document.d.ts | 63 + node_modules/postcss/lib/document.js | 33 + node_modules/postcss/lib/fromJSON.d.ts | 9 + node_modules/postcss/lib/fromJSON.js | 54 + node_modules/postcss/lib/input.d.ts | 194 + node_modules/postcss/lib/input.js | 248 + node_modules/postcss/lib/lazy-result.d.ts | 185 + node_modules/postcss/lib/lazy-result.js | 550 + node_modules/postcss/lib/list.d.ts | 57 + node_modules/postcss/lib/list.js | 58 + node_modules/postcss/lib/map-generator.js | 338 + node_modules/postcss/lib/no-work-result.d.ts | 46 + node_modules/postcss/lib/no-work-result.js | 135 + node_modules/postcss/lib/node.d.ts | 536 + node_modules/postcss/lib/node.js | 381 + node_modules/postcss/lib/parse.d.ts | 9 + node_modules/postcss/lib/parse.js | 42 + node_modules/postcss/lib/parser.js | 603 ++ node_modules/postcss/lib/postcss.d.mts | 72 + node_modules/postcss/lib/postcss.d.ts | 441 + node_modules/postcss/lib/postcss.js | 101 + node_modules/postcss/lib/postcss.mjs | 30 + node_modules/postcss/lib/previous-map.d.ts | 81 + node_modules/postcss/lib/previous-map.js | 142 + node_modules/postcss/lib/processor.d.ts | 111 + node_modules/postcss/lib/processor.js | 67 + node_modules/postcss/lib/result.d.ts | 206 + node_modules/postcss/lib/result.js | 42 + node_modules/postcss/lib/root.d.ts | 82 + node_modules/postcss/lib/root.js | 61 + node_modules/postcss/lib/rule.d.ts | 113 + node_modules/postcss/lib/rule.js | 27 + node_modules/postcss/lib/stringifier.d.ts | 46 + node_modules/postcss/lib/stringifier.js | 353 + node_modules/postcss/lib/stringify.d.ts | 9 + node_modules/postcss/lib/stringify.js | 11 + node_modules/postcss/lib/symbols.js | 5 + .../postcss/lib/terminal-highlight.js | 70 + node_modules/postcss/lib/tokenize.js | 266 + node_modules/postcss/lib/warn-once.js | 13 + node_modules/postcss/lib/warning.d.ts | 147 + node_modules/postcss/lib/warning.js | 37 + node_modules/postcss/package.json | 88 + node_modules/punycode/LICENSE-MIT.txt | 20 + node_modules/punycode/README.md | 126 + node_modules/punycode/package.json | 58 + node_modules/punycode/punycode.es6.js | 444 + node_modules/punycode/punycode.js | 443 + node_modules/queue-microtask/LICENSE | 20 + node_modules/queue-microtask/README.md | 90 + node_modules/queue-microtask/index.d.ts | 2 + node_modules/queue-microtask/index.js | 9 + node_modules/queue-microtask/package.json | 55 + node_modules/quick-lru/index.d.ts | 97 + node_modules/quick-lru/index.js | 123 + node_modules/quick-lru/license | 9 + node_modules/quick-lru/package.json | 43 + node_modules/quick-lru/readme.md | 111 + node_modules/read-pkg-up/index.d.ts | 77 + node_modules/read-pkg-up/index.js | 27 + node_modules/read-pkg-up/license | 9 + node_modules/read-pkg-up/package.json | 61 + node_modules/read-pkg-up/readme.md | 74 + node_modules/read-pkg/index.d.ts | 59 + node_modules/read-pkg/index.js | 26 + node_modules/read-pkg/license | 9 + node_modules/read-pkg/package.json | 52 + node_modules/read-pkg/readme.md | 72 + node_modules/redent/index.d.ts | 23 + node_modules/redent/index.js | 6 + node_modules/redent/license | 9 + node_modules/redent/package.json | 47 + node_modules/redent/readme.md | 65 + node_modules/require-from-string/index.js | 34 + node_modules/require-from-string/license | 21 + node_modules/require-from-string/package.json | 28 + node_modules/require-from-string/readme.md | 56 + node_modules/resolve-from/index.d.ts | 31 + node_modules/resolve-from/index.js | 47 + node_modules/resolve-from/license | 9 + node_modules/resolve-from/package.json | 36 + node_modules/resolve-from/readme.md | 72 + node_modules/reusify/.coveralls.yml | 1 + node_modules/reusify/.travis.yml | 28 + node_modules/reusify/LICENSE | 22 + node_modules/reusify/README.md | 145 + .../benchmarks/createNoCodeFunction.js | 30 + node_modules/reusify/benchmarks/fib.js | 13 + .../reusify/benchmarks/reuseNoCodeFunction.js | 38 + node_modules/reusify/package.json | 45 + node_modules/reusify/reusify.js | 33 + node_modules/reusify/test.js | 66 + node_modules/rimraf/CHANGELOG.md | 65 + node_modules/rimraf/LICENSE | 15 + node_modules/rimraf/README.md | 101 + node_modules/rimraf/bin.js | 68 + node_modules/rimraf/package.json | 32 + node_modules/rimraf/rimraf.js | 360 + node_modules/run-parallel/LICENSE | 20 + node_modules/run-parallel/README.md | 85 + node_modules/run-parallel/index.js | 51 + node_modules/run-parallel/package.json | 58 + node_modules/semver/LICENSE | 15 + node_modules/semver/README.md | 637 ++ node_modules/semver/bin/semver.js | 197 + node_modules/semver/classes/comparator.js | 141 + node_modules/semver/classes/index.js | 5 + node_modules/semver/classes/range.js | 539 + node_modules/semver/classes/semver.js | 302 + node_modules/semver/functions/clean.js | 6 + node_modules/semver/functions/cmp.js | 52 + node_modules/semver/functions/coerce.js | 52 + .../semver/functions/compare-build.js | 7 + .../semver/functions/compare-loose.js | 3 + node_modules/semver/functions/compare.js | 5 + node_modules/semver/functions/diff.js | 65 + node_modules/semver/functions/eq.js | 3 + node_modules/semver/functions/gt.js | 3 + node_modules/semver/functions/gte.js | 3 + node_modules/semver/functions/inc.js | 19 + node_modules/semver/functions/lt.js | 3 + node_modules/semver/functions/lte.js | 3 + node_modules/semver/functions/major.js | 3 + node_modules/semver/functions/minor.js | 3 + node_modules/semver/functions/neq.js | 3 + node_modules/semver/functions/parse.js | 16 + node_modules/semver/functions/patch.js | 3 + node_modules/semver/functions/prerelease.js | 6 + node_modules/semver/functions/rcompare.js | 3 + node_modules/semver/functions/rsort.js | 3 + node_modules/semver/functions/satisfies.js | 10 + node_modules/semver/functions/sort.js | 3 + node_modules/semver/functions/valid.js | 6 + node_modules/semver/index.js | 89 + node_modules/semver/internal/constants.js | 35 + node_modules/semver/internal/debug.js | 9 + node_modules/semver/internal/identifiers.js | 23 + node_modules/semver/internal/parse-options.js | 15 + node_modules/semver/internal/re.js | 212 + node_modules/semver/package.json | 87 + node_modules/semver/preload.js | 2 + node_modules/semver/range.bnf | 16 + node_modules/semver/ranges/gtr.js | 4 + node_modules/semver/ranges/intersects.js | 7 + node_modules/semver/ranges/ltr.js | 4 + node_modules/semver/ranges/max-satisfying.js | 25 + node_modules/semver/ranges/min-satisfying.js | 24 + node_modules/semver/ranges/min-version.js | 61 + node_modules/semver/ranges/outside.js | 80 + node_modules/semver/ranges/simplify.js | 47 + node_modules/semver/ranges/subset.js | 247 + node_modules/semver/ranges/to-comparators.js | 8 + node_modules/semver/ranges/valid.js | 11 + node_modules/signal-exit/LICENSE.txt | 16 + node_modules/signal-exit/README.md | 51 + .../signal-exit/dist/cjs/browser.d.ts | 12 + .../signal-exit/dist/cjs/browser.d.ts.map | 1 + node_modules/signal-exit/dist/cjs/browser.js | 10 + .../signal-exit/dist/cjs/browser.js.map | 1 + node_modules/signal-exit/dist/cjs/index.d.ts | 37 + .../signal-exit/dist/cjs/index.d.ts.map | 1 + node_modules/signal-exit/dist/cjs/index.js | 272 + .../signal-exit/dist/cjs/index.js.map | 1 + .../signal-exit/dist/cjs/package.json | 3 + .../signal-exit/dist/cjs/signals.d.ts | 29 + .../signal-exit/dist/cjs/signals.d.ts.map | 1 + node_modules/signal-exit/dist/cjs/signals.js | 42 + .../signal-exit/dist/cjs/signals.js.map | 1 + .../signal-exit/dist/mjs/browser.d.ts | 12 + .../signal-exit/dist/mjs/browser.d.ts.map | 1 + node_modules/signal-exit/dist/mjs/browser.js | 4 + .../signal-exit/dist/mjs/browser.js.map | 1 + node_modules/signal-exit/dist/mjs/index.d.ts | 37 + .../signal-exit/dist/mjs/index.d.ts.map | 1 + node_modules/signal-exit/dist/mjs/index.js | 268 + .../signal-exit/dist/mjs/index.js.map | 1 + .../signal-exit/dist/mjs/package.json | 3 + .../signal-exit/dist/mjs/signals.d.ts | 29 + .../signal-exit/dist/mjs/signals.d.ts.map | 1 + node_modules/signal-exit/dist/mjs/signals.js | 39 + .../signal-exit/dist/mjs/signals.js.map | 1 + node_modules/signal-exit/package.json | 106 + node_modules/slash/index.d.ts | 25 + node_modules/slash/index.js | 11 + node_modules/slash/license | 9 + node_modules/slash/package.json | 35 + node_modules/slash/readme.md | 44 + node_modules/slice-ansi/index.js | 103 + node_modules/slice-ansi/license | 10 + .../node_modules/ansi-styles/index.d.ts | 345 + .../node_modules/ansi-styles/index.js | 163 + .../node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 56 + .../node_modules/ansi-styles/readme.md | 152 + .../node_modules/color-convert/CHANGELOG.md | 54 + .../node_modules/color-convert/LICENSE | 21 + .../node_modules/color-convert/README.md | 68 + .../node_modules/color-convert/conversions.js | 839 ++ .../node_modules/color-convert/index.js | 81 + .../node_modules/color-convert/package.json | 48 + .../node_modules/color-convert/route.js | 97 + .../node_modules/color-name/LICENSE | 8 + .../node_modules/color-name/README.md | 11 + .../node_modules/color-name/index.js | 152 + .../node_modules/color-name/package.json | 28 + node_modules/slice-ansi/package.json | 52 + node_modules/slice-ansi/readme.md | 66 + node_modules/source-map-js/CHANGELOG.md | 320 + node_modules/source-map-js/LICENSE | 28 + node_modules/source-map-js/README.md | 758 ++ node_modules/source-map-js/lib/array-set.js | 121 + node_modules/source-map-js/lib/base64-vlq.js | 140 + node_modules/source-map-js/lib/base64.js | 67 + .../source-map-js/lib/binary-search.js | 111 + .../source-map-js/lib/mapping-list.js | 79 + node_modules/source-map-js/lib/quick-sort.js | 132 + .../source-map-js/lib/source-map-consumer.js | 1184 ++ .../source-map-js/lib/source-map-generator.js | 425 + node_modules/source-map-js/lib/source-node.js | 413 + node_modules/source-map-js/lib/util.js | 594 + node_modules/source-map-js/package.json | 71 + node_modules/source-map-js/source-map.d.ts | 115 + node_modules/source-map-js/source-map.js | 8 + node_modules/spdx-correct/LICENSE | 202 + node_modules/spdx-correct/README.md | 22 + node_modules/spdx-correct/index.js | 386 + node_modules/spdx-correct/package.json | 32 + node_modules/spdx-exceptions/README.md | 36 + node_modules/spdx-exceptions/index.json | 40 + node_modules/spdx-exceptions/package.json | 17 + node_modules/spdx-expression-parse/AUTHORS | 4 + node_modules/spdx-expression-parse/LICENSE | 22 + node_modules/spdx-expression-parse/README.md | 91 + node_modules/spdx-expression-parse/index.js | 8 + .../spdx-expression-parse/package.json | 39 + node_modules/spdx-expression-parse/parse.js | 138 + node_modules/spdx-expression-parse/scan.js | 131 + node_modules/spdx-license-ids/README.md | 52 + node_modules/spdx-license-ids/deprecated.json | 27 + node_modules/spdx-license-ids/index.json | 507 + node_modules/spdx-license-ids/package.json | 39 + node_modules/string-width/index.d.ts | 29 + node_modules/string-width/index.js | 47 + node_modules/string-width/license | 9 + node_modules/string-width/package.json | 56 + node_modules/string-width/readme.md | 50 + node_modules/strip-ansi/index.d.ts | 17 + node_modules/strip-ansi/index.js | 4 + node_modules/strip-ansi/license | 9 + node_modules/strip-ansi/package.json | 54 + node_modules/strip-ansi/readme.md | 46 + node_modules/strip-indent/index.d.ts | 19 + node_modules/strip-indent/index.js | 13 + node_modules/strip-indent/license | 9 + node_modules/strip-indent/package.json | 45 + node_modules/strip-indent/readme.md | 48 + node_modules/style-search/.npmignore | 1 + node_modules/style-search/CHANGELOG.md | 5 + node_modules/style-search/LICENSE | 13 + node_modules/style-search/README.md | 96 + node_modules/style-search/circle.yml | 5 + node_modules/style-search/index.js | 203 + node_modules/style-search/package.json | 27 + node_modules/style-search/test.js | 467 + .../stylelint-config-recommended-scss/LICENSE | 21 + .../README.md | 53 + .../index.js | 36 + .../stylelint-config-recommended/LICENSE | 21 + .../stylelint-config-recommended/README.md | 51 + .../stylelint-config-recommended/index.js | 48 + .../stylelint-config-recommended/package.json | 67 + .../package.json | 55 + .../stylelint-config-recommended/LICENSE | 21 + .../stylelint-config-recommended/README.md | 51 + .../stylelint-config-recommended/index.js | 49 + .../stylelint-config-recommended/package.json | 70 + .../stylelint-config-standard-scss/LICENSE | 21 + .../stylelint-config-standard-scss/README.md | 50 + .../stylelint-config-standard-scss/index.js | 67 + .../stylelint-config-recommended/LICENSE | 21 + .../stylelint-config-recommended/README.md | 51 + .../stylelint-config-recommended/index.js | 48 + .../stylelint-config-recommended/package.json | 67 + .../stylelint-config-standard/LICENSE | 20 + .../stylelint-config-standard/README.md | 128 + .../stylelint-config-standard/index.js | 120 + .../stylelint-config-standard/package.json | 70 + .../package.json | 54 + .../stylelint-config-standard/LICENSE | 20 + .../stylelint-config-standard/README.md | 128 + .../stylelint-config-standard/index.js | 120 + .../stylelint-config-standard/package.json | 73 + node_modules/stylelint-scss/LICENSE | 21 + node_modules/stylelint-scss/README.md | 359 + node_modules/stylelint-scss/package.json | 59 + node_modules/stylelint-scss/src/index.js | 11 + .../at-each-key-value-single-line/README.md | 105 + .../at-each-key-value-single-line/index.js | 128 + .../README.md | 74 + .../index.js | 62 + .../README.md | 131 + .../index.js | 48 + .../rules/at-else-empty-line-before/README.md | 69 + .../rules/at-else-empty-line-before/index.js | 61 + .../README.md | 58 + .../index.js | 60 + .../README.md | 47 + .../at-extend-no-missing-placeholder/index.js | 46 + .../at-function-named-arguments/README.md | 131 + .../at-function-named-arguments/index.js | 131 + .../README.md | 50 + .../index.js | 57 + .../src/rules/at-function-pattern/README.md | 29 + .../src/rules/at-function-pattern/index.js | 62 + .../README.md | 60 + .../index.js | 134 + .../at-if-closing-brace-space-after/README.md | 100 + .../at-if-closing-brace-space-after/index.js | 108 + .../src/rules/at-if-no-null/README.md | 44 + .../src/rules/at-if-no-null/index.js | 62 + .../README.md | 59 + .../index.js | 67 + .../README.md | 70 + .../index.js | 85 + .../README.md | 78 + .../index.js | 89 + .../at-import-partial-extension/README.md | 118 + .../at-import-partial-extension/index.js | 107 + .../README.md | 47 + .../index.js | 68 + .../rules/at-mixin-named-arguments/README.md | 102 + .../rules/at-mixin-named-arguments/index.js | 125 + .../README.md | 58 + .../index.js | 57 + .../src/rules/at-mixin-pattern/README.md | 29 + .../src/rules/at-mixin-pattern/index.js | 62 + .../README.md | 43 + .../index.js | 82 + .../src/rules/at-rule-no-unknown/README.md | 76 + .../src/rules/at-rule-no-unknown/index.js | 102 + .../rules/at-use-no-unnamespaced/README.md | 25 + .../src/rules/at-use-no-unnamespaced/index.js | 42 + .../src/rules/comment-no-empty/README.md | 67 + .../src/rules/comment-no-empty/index.js | 53 + .../src/rules/comment-no-loud/README.md | 33 + .../src/rules/comment-no-loud/index.js | 53 + .../README.md | 68 + .../index.js | 80 + .../declaration-nested-properties/README.md | 153 + .../declaration-nested-properties/index.js | 168 + .../dimension-no-non-numeric-values/README.md | 93 + .../dimension-no-non-numeric-values/index.js | 150 + .../README.md | 85 + .../index.js | 123 + .../README.md | 139 + .../index.js | 120 + .../README.md | 73 + .../index.js | 51 + .../rules/dollar-variable-default/README.md | 25 + .../rules/dollar-variable-default/index.js | 71 + .../README.md | 185 + .../dollar-variable-empty-line-after/index.js | 251 + .../README.md | 229 + .../index.js | 176 + .../dollar-variable-first-in-block/README.md | 202 + .../dollar-variable-first-in-block/index.js | 125 + .../README.md | 111 + .../index.js | 148 + .../README.md | 24 + .../index.js | 44 + .../rules/dollar-variable-pattern/README.md | 73 + .../rules/dollar-variable-pattern/index.js | 77 + .../README.md | 203 + .../index.js | 151 + .../double-slash-comment-inline/README.md | 110 + .../double-slash-comment-inline/index.js | 97 + .../README.md | 60 + .../index.js | 80 + .../rules/function-color-relative/README.md | 83 + .../rules/function-color-relative/index.js | 82 + .../src/rules/function-no-unknown/README.md | 64 + .../src/rules/function-no-unknown/index.js | 133 + .../README.md | 46 + .../index.js | 84 + .../README.md | 46 + .../index.js | 88 + .../stylelint-scss/src/rules/index.js | 65 + .../src/rules/map-keys-quotes/README.md | 26 + .../src/rules/map-keys-quotes/index.js | 101 + .../README.md | 104 + .../index.js | 109 + .../src/rules/no-dollar-variables/README.md | 38 + .../src/rules/no-dollar-variables/index.js | 46 + .../no-duplicate-dollar-variables/README.md | 212 + .../no-duplicate-dollar-variables/index.js | 194 + .../src/rules/no-duplicate-mixins/README.md | 83 + .../src/rules/no-duplicate-mixins/index.js | 57 + .../rules/no-global-function-names/README.md | 31 + .../rules/no-global-function-names/index.js | 203 + .../rules/operator-no-newline-after/README.md | 54 + .../rules/operator-no-newline-after/index.js | 82 + .../operator-no-newline-before/README.md | 55 + .../rules/operator-no-newline-before/index.js | 82 + .../src/rules/operator-no-unspaced/README.md | 100 + .../src/rules/operator-no-unspaced/index.js | 308 + .../src/rules/partial-no-import/README.md | 69 + .../src/rules/partial-no-import/index.js | 89 + .../percent-placeholder-pattern/README.md | 57 + .../percent-placeholder-pattern/index.js | 101 + .../rules/selector-nest-combinators/README.md | 221 + .../rules/selector-nest-combinators/index.js | 165 + .../README.md | 115 + .../index.js | 92 + .../selector-no-union-class-name/README.md | 46 + .../selector-no-union-class-name/index.js | 103 + .../src/utils/addEmptyLineBefore.js | 15 + .../src/utils/atRuleBaseName.js | 11 + .../src/utils/atRuleParamIndex.js | 18 + .../src/utils/beforeBlockString.js | 39 + .../stylelint-scss/src/utils/blockString.js | 22 + .../src/utils/configurationError.js | 15 + .../src/utils/declarationValueIndex.js | 15 + .../stylelint-scss/src/utils/eachRoot.js | 18 + .../src/utils/findCommentsInRaws.js | 241 + .../stylelint-scss/src/utils/functions.js | 257 + .../stylelint-scss/src/utils/hasBlock.js | 11 + .../stylelint-scss/src/utils/hasEmptyLine.js | 11 + .../src/utils/hasInterpolatingAmpersand.js | 32 + .../src/utils/hasInterpolation.js | 22 + .../src/utils/hasLessInterpolation.js | 11 + .../src/utils/hasNestedSibling.js | 13 + .../src/utils/hasPsvInterpolation.js | 10 + .../src/utils/hasScssInterpolation.js | 10 + .../src/utils/hasTplInterpolation.js | 11 + .../src/utils/isCustomPropertySet.js | 19 + .../src/utils/isInlineComment.js | 20 + .../src/utils/isNativeCssFunction.js | 94 + .../src/utils/isSingleLineString.js | 12 + .../src/utils/isStandardRule.js | 65 + .../src/utils/isStandardSelector.js | 23 + .../src/utils/isStandardSyntaxProperty.js | 33 + .../src/utils/isStandardSyntaxSelector.js | 38 + .../stylelint-scss/src/utils/isType.js | 12 + .../stylelint-scss/src/utils/isWhitespace.js | 11 + .../src/utils/matchesStringOrRegExp.js | 94 + .../src/utils/moduleNamespace.js | 62 + .../stylelint-scss/src/utils/namespace.js | 7 + .../src/utils/optionsHaveException.js | 14 + .../src/utils/optionsHaveIgnored.js | 14 + .../src/utils/optionsMatches.js | 22 + .../src/utils/parseFunctionArguments.js | 79 + .../src/utils/parseNestedPropRoot.js | 96 + .../stylelint-scss/src/utils/parseSelector.js | 11 + .../stylelint-scss/src/utils/rawNodeString.js | 19 + .../src/utils/removeEmptyLinesBefore.js | 11 + .../stylelint-scss/src/utils/ruleUrl.js | 17 + .../src/utils/sassValueParser/index.js | 1021 ++ .../stylelint-scss/src/utils/validateTypes.js | 44 + .../src/utils/whitespaceChecker.js | 338 + node_modules/stylelint/LICENSE | 20 + node_modules/stylelint/README.md | 103 + node_modules/stylelint/bin/stylelint.mjs | 5 + .../stylelint/lib/assignDisabledRanges.js | 417 + node_modules/stylelint/lib/augmentConfig.js | 440 + node_modules/stylelint/lib/cli.mjs | 639 ++ node_modules/stylelint/lib/constants.js | 25 + .../lib/createPartialStylelintResult.js | 109 + node_modules/stylelint/lib/createPlugin.js | 11 + node_modules/stylelint/lib/createStylelint.js | 35 + .../stylelint/lib/descriptionlessDisables.js | 61 + .../lib/formatters/calcSeverityCounts.js | 21 + .../lib/formatters/compactFormatter.js | 23 + .../lib/formatters/githubFormatter.js | 51 + .../stylelint/lib/formatters/index.js | 16 + .../stylelint/lib/formatters/jsonFormatter.js | 20 + .../lib/formatters/preprocessWarnings.js | 74 + .../lib/formatters/stringFormatter.js | 276 + .../stylelint/lib/formatters/tapFormatter.js | 52 + .../stylelint/lib/formatters/terminalLink.js | 23 + .../stylelint/lib/formatters/unixFormatter.js | 34 + .../lib/formatters/verboseFormatter.js | 149 + .../stylelint/lib/getConfigForFile.js | 75 + .../stylelint/lib/getPostcssResult.js | 142 + node_modules/stylelint/lib/index.js | 35 + .../stylelint/lib/invalidScopeDisables.js | 47 + node_modules/stylelint/lib/isPathIgnored.js | 44 + .../stylelint/lib/lintPostcssResult.js | 151 + node_modules/stylelint/lib/lintSource.js | 146 + .../stylelint/lib/needlessDisables.js | 101 + .../stylelint/lib/normalizeAllRuleSettings.js | 33 + .../stylelint/lib/normalizeRuleSettings.js | 58 + node_modules/stylelint/lib/postcssPlugin.js | 45 + .../stylelint/lib/prepareReturnValue.js | 75 + node_modules/stylelint/lib/printConfig.js | 42 + .../stylelint/lib/reference/atKeywords.js | 57 + .../stylelint/lib/reference/functions.js | 59 + .../stylelint/lib/reference/keywords.js | 505 + .../stylelint/lib/reference/mediaFeatures.js | 115 + .../stylelint/lib/reference/prefixes.js | 5 + .../stylelint/lib/reference/properties.js | 399 + .../stylelint/lib/reference/selectors.js | 320 + node_modules/stylelint/lib/reference/units.js | 87 + node_modules/stylelint/lib/reportDisables.js | 64 + .../stylelint/lib/reportUnknownRuleNames.js | 76 + node_modules/stylelint/lib/resolveConfig.js | 39 + .../stylelint/lib/resolveCustomFormatter.js | 16 + .../lib/rules/alpha-value-notation/index.js | 227 + .../lib/rules/annotation-no-unknown/index.js | 90 + .../lib/rules/at-rule-allowed-list/index.js | 62 + .../rules/at-rule-disallowed-list/index.js | 62 + .../rules/at-rule-empty-line-before/index.js | 173 + .../lib/rules/at-rule-name-case/index.js | 67 + .../rules/at-rule-name-newline-after/index.js | 45 + .../rules/at-rule-name-space-after/index.js | 53 + .../lib/rules/at-rule-no-unknown/index.js | 75 + .../rules/at-rule-no-vendor-prefix/index.js | 65 + .../at-rule-property-required-list/index.js | 86 + .../at-rule-semicolon-newline-after/index.js | 84 + .../at-rule-semicolon-space-before/index.js | 68 + .../lib/rules/atRuleNameSpaceChecker.js | 55 + .../index.js | 129 + .../index.js | 152 + .../index.js | 132 + .../block-closing-brace-space-after/index.js | 96 + .../block-closing-brace-space-before/index.js | 109 + .../lib/rules/block-no-empty/index.js | 117 + .../index.js | 182 + .../index.js | 120 + .../block-opening-brace-space-after/index.js | 116 + .../block-opening-brace-space-before/index.js | 139 + .../rules/color-function-notation/index.js | 163 + .../lib/rules/color-hex-alpha/index.js | 89 + .../lib/rules/color-hex-case/index.js | 97 + .../lib/rules/color-hex-length/index.js | 148 + .../lib/rules/color-named/colordUtils.js | 108 + .../stylelint/lib/rules/color-named/index.js | 184 + .../stylelint/lib/rules/color-no-hex/index.js | 78 + .../lib/rules/color-no-invalid-hex/index.js | 74 + .../rules/comment-empty-line-before/index.js | 133 + .../lib/rules/comment-no-empty/index.js | 51 + .../lib/rules/comment-pattern/index.js | 53 + .../rules/comment-whitespace-inside/index.js | 141 + .../comment-word-disallowed-list/index.js | 65 + .../lib/rules/custom-media-pattern/index.js | 66 + .../index.js | 143 + .../index.js | 88 + .../rules/custom-property-pattern/index.js | 99 + .../declaration-bang-space-after/index.js | 91 + .../declaration-bang-space-before/index.js | 92 + .../index.js | 84 + .../index.js | 277 + .../index.js | 294 + .../index.js | 72 + .../index.js | 107 + .../index.js | 74 + .../index.js | 97 + .../index.js | 104 + .../index.js | 64 + .../index.js | 146 + .../declaration-colon-newline-after/index.js | 97 + .../declaration-colon-space-after/index.js | 73 + .../declaration-colon-space-before/index.js | 72 + .../declaration-empty-line-before/index.js | 155 + .../rules/declaration-no-important/index.js | 52 + .../declaration-property-max-values/index.js | 78 + .../index.js | 113 + .../index.js | 95 + .../index.js | 70 + .../index.js | 70 + .../index.js | 166 + .../lib/rules/declarationBangSpaceChecker.js | 60 + .../lib/rules/declarationColonSpaceChecker.js | 57 + .../stylelint/lib/rules/findMediaOperator.js | 30 + .../rules/font-family-name-quotes/index.js | 269 + .../font-family-no-duplicate-names/index.js | 122 + .../index.js | 120 + .../lib/rules/font-weight-notation/index.js | 214 + .../lib/rules/function-allowed-list/index.js | 71 + .../index.js | 381 + .../function-comma-newline-after/index.js | 60 + .../function-comma-newline-before/index.js | 60 + .../rules/function-comma-space-after/index.js | 61 + .../function-comma-space-before/index.js | 61 + .../rules/function-disallowed-list/index.js | 71 + .../index.js | 140 + .../rules/function-max-empty-lines/index.js | 113 + .../lib/rules/function-name-case/index.js | 120 + .../lib/rules/function-no-unknown/index.js | 110 + .../index.js | 276 + .../index.js | 175 + .../function-url-no-scheme-relative/index.js | 52 + .../lib/rules/function-url-quotes/index.js | 195 + .../function-url-scheme-allowed-list/index.js | 72 + .../index.js | 72 + .../rules/function-whitespace-after/index.js | 194 + .../lib/rules/functionCommaSpaceChecker.js | 123 + .../lib/rules/functionCommaSpaceFix.js | 49 + .../lib/rules/hue-degree-notation/index.js | 151 + .../lib/rules/import-notation/index.js | 126 + .../stylelint/lib/rules/indentation/index.js | 733 ++ node_modules/stylelint/lib/rules/index.js | 378 + .../index.js | 65 + .../index.js | 54 + .../rules/keyframe-selector-notation/index.js | 164 + .../lib/rules/keyframes-name-pattern/index.js | 64 + .../lib/rules/length-zero-no-unit/index.js | 227 + .../stylelint/lib/rules/linebreaks/index.js | 132 + .../lib/rules/max-empty-lines/index.js | 219 + .../lib/rules/max-line-length/index.js | 203 + .../lib/rules/max-nesting-depth/index.js | 166 + .../media-feature-colon-space-after/index.js | 87 + .../media-feature-colon-space-before/index.js | 87 + .../media-feature-name-allowed-list/index.js | 68 + .../rules/media-feature-name-case/index.js | 93 + .../index.js | 68 + .../media-feature-name-no-unknown/index.js | 80 + .../index.js | 63 + .../index.js | 108 + .../index.js | 104 + .../index.js | 277 + .../index.js | 112 + .../media-feature-range-notation/index.js | 129 + .../index.js | 104 + .../index.js | 104 + .../index.js | 93 + .../index.js | 47 + .../index.js | 89 + .../index.js | 89 + .../lib/rules/media-query-no-invalid/index.js | 139 + .../rules/mediaFeatureColonSpaceChecker.js | 51 + .../mediaQueryListCommaWhitespaceChecker.js | 71 + .../named-grid-areas-no-invalid/index.js | 112 + .../utils/findNotContiguousOrRectangular.js | 64 + .../rules/no-descending-specificity/index.js | 168 + .../no-duplicate-at-import-rules/index.js | 155 + .../lib/rules/no-duplicate-selectors/index.js | 178 + .../lib/rules/no-empty-first-line/index.js | 64 + .../lib/rules/no-empty-source/index.js | 44 + .../lib/rules/no-eol-whitespace/index.js | 297 + .../lib/rules/no-extra-semicolons/index.js | 244 + .../no-invalid-double-slash-comments/index.js | 57 + .../index.js | 77 + .../rules/no-irregular-whitespace/index.js | 111 + .../no-missing-end-of-source-newline/index.js | 63 + .../lib/rules/no-unknown-animations/index.js | 72 + .../no-unknown-custom-properties/index.js | 72 + .../lib/rules/number-leading-zero/index.js | 197 + .../lib/rules/number-max-precision/index.js | 214 + .../rules/number-no-trailing-zeros/index.js | 140 + .../lib/rules/property-allowed-list/index.js | 67 + .../lib/rules/property-case/index.js | 96 + .../rules/property-disallowed-list/index.js | 67 + .../lib/rules/property-no-unknown/index.js | 120 + .../rules/property-no-vendor-prefix/index.js | 83 + .../lib/rules/rule-empty-line-before/index.js | 162 + .../index.js | 75 + .../selector-anb-no-unmatchable/index.js | 111 + .../index.js | 209 + .../index.js | 73 + .../index.js | 76 + .../index.js | 76 + .../index.js | 110 + .../index.js | 86 + .../rules/selector-attribute-quotes/index.js | 118 + .../lib/rules/selector-class-pattern/index.js | 154 + .../selector-combinator-allowed-list/index.js | 84 + .../index.js | 84 + .../selector-combinator-space-after/index.js | 65 + .../selector-combinator-space-before/index.js | 65 + .../index.js | 95 + .../rules/selector-disallowed-list/index.js | 100 + .../lib/rules/selector-id-pattern/index.js | 64 + .../index.js | 122 + .../index.js | 96 + .../selector-list-comma-space-after/index.js | 88 + .../selector-list-comma-space-before/index.js | 88 + .../lib/rules/selector-max-attribute/index.js | 109 + .../lib/rules/selector-max-class/index.js | 84 + .../rules/selector-max-combinators/index.js | 85 + .../selector-max-compound-selectors/index.js | 95 + .../rules/selector-max-empty-lines/index.js | 71 + .../lib/rules/selector-max-id/index.js | 112 + .../rules/selector-max-pseudo-class/index.js | 96 + .../rules/selector-max-specificity/index.js | 231 + .../lib/rules/selector-max-type/index.js | 231 + .../lib/rules/selector-max-universal/index.js | 118 + .../rules/selector-nested-pattern/index.js | 77 + .../selector-no-qualifying-type/index.js | 157 + .../rules/selector-no-vendor-prefix/index.js | 88 + .../lib/rules/selector-not-notation/index.js | 213 + .../index.js | 79 + .../rules/selector-pseudo-class-case/index.js | 103 + .../index.js | 79 + .../selector-pseudo-class-no-unknown/index.js | 179 + .../index.js | 156 + .../index.js | 80 + .../selector-pseudo-element-case/index.js | 90 + .../index.js | 98 + .../index.js | 80 + .../index.js | 98 + .../lib/rules/selector-type-case/index.js | 132 + .../rules/selector-type-no-unknown/index.js | 122 + .../selectorAttributeOperatorSpaceChecker.js | 92 + .../rules/selectorCombinatorSpaceChecker.js | 105 + .../selectorListCommaWhitespaceChecker.js | 61 + .../index.js | 185 + .../lib/rules/string-no-newline/index.js | 134 + .../lib/rules/string-quotes/index.js | 250 + .../lib/rules/time-min-milliseconds/index.js | 163 + .../stylelint/lib/rules/unicode-bom/index.js | 68 + .../lib/rules/unit-allowed-list/index.js | 113 + .../stylelint/lib/rules/unit-case/index.js | 134 + .../lib/rules/unit-disallowed-list/index.js | 226 + .../lib/rules/unit-no-unknown/index.js | 214 + .../lib/rules/value-keyword-case/index.js | 248 + .../value-list-comma-newline-after/index.js | 104 + .../value-list-comma-newline-before/index.js | 47 + .../value-list-comma-space-after/index.js | 91 + .../value-list-comma-space-before/index.js | 91 + .../rules/value-list-max-empty-lines/index.js | 66 + .../lib/rules/value-no-vendor-prefix/index.js | 95 + .../rules/valueListCommaWhitespaceChecker.js | 71 + node_modules/stylelint/lib/standalone.js | 325 + node_modules/stylelint/lib/utils/FileCache.js | 92 + .../stylelint/lib/utils/addEmptyLineAfter.js | 28 + .../stylelint/lib/utils/addEmptyLineBefore.js | 23 + .../lib/utils/allFilesIgnoredError.js | 11 + .../stylelint/lib/utils/arrayEqual.js | 16 + .../stylelint/lib/utils/atRuleParamIndex.js | 16 + .../stylelint/lib/utils/beforeBlockString.js | 29 + .../stylelint/lib/utils/blockString.js | 21 + .../stylelint/lib/utils/blurInterpolation.js | 10 + .../stylelint/lib/utils/checkAgainstRule.js | 57 + .../lib/utils/checkInvalidCLIOptions.js | 104 + .../lib/utils/configurationComment.js | 73 + .../stylelint/lib/utils/configurationError.js | 17 + .../stylelint/lib/utils/containsString.js | 54 + .../stylelint/lib/utils/createMapWithSet.js | 21 + .../lib/utils/declarationValueIndex.js | 28 + .../lib/utils/eachDeclarationBlock.js | 61 + .../stylelint/lib/utils/filterFilePaths.js | 19 + .../stylelint/lib/utils/findAnimationName.js | 75 + .../stylelint/lib/utils/findAtRuleContext.js | 29 + .../stylelint/lib/utils/findFontFamily.js | 130 + .../lib/utils/findMediaFeatureNames.js | 144 + .../lib/utils/functionArgumentsSearch.js | 43 + .../stylelint/lib/utils/getAtRuleParams.js | 9 + .../stylelint/lib/utils/getCacheFile.js | 52 + .../lib/utils/getDeclarationValue.js | 11 + .../stylelint/lib/utils/getDimension.js | 63 + .../stylelint/lib/utils/getFileIgnorer.js | 43 + .../lib/utils/getFormatterOptionsText.js | 14 + .../lib/utils/getImportantPosition.js | 17 + .../stylelint/lib/utils/getModulePath.js | 34 + .../utils/getNextNonSharedLineCommentNode.js | 36 + node_modules/stylelint/lib/utils/getOsEol.js | 11 + .../getPreviousNonSharedLineCommentNode.js | 38 + .../stylelint/lib/utils/getRuleSelector.js | 11 + .../stylelint/lib/utils/getSchemeFromUrl.js | 39 + .../stylelint/lib/utils/getStylelintRule.js | 10 + .../utils/hasANPlusBNotationPseudoClasses.js | 22 + node_modules/stylelint/lib/utils/hasBlock.js | 11 + .../stylelint/lib/utils/hasColorFunction.js | 15 + .../stylelint/lib/utils/hasDimension.js | 13 + .../stylelint/lib/utils/hasEmptyBlock.js | 13 + .../stylelint/lib/utils/hasEmptyLine.js | 15 + .../stylelint/lib/utils/hasInterpolation.js | 26 + .../lib/utils/hasLessInterpolation.js | 13 + .../stylelint/lib/utils/hasNamedColor.js | 17 + node_modules/stylelint/lib/utils/hasPrefix.js | 15 + .../lib/utils/hasPsvInterpolation.js | 12 + .../lib/utils/hasScssInterpolation.js | 12 + .../lib/utils/hasTplInterpolation.js | 13 + .../stylelint/lib/utils/hasValidHex.js | 13 + node_modules/stylelint/lib/utils/hash.js | 12 + .../stylelint/lib/utils/isAfterComment.js | 16 + .../lib/utils/isAfterSingleLineComment.js | 22 + .../isAfterStandardPropertyDeclaration.js | 20 + .../stylelint/lib/utils/isAutoprefixable.js | 339 + .../isBlocklessAtRuleAfterBlocklessAtRule.js | 23 + ...klessAtRuleAfterSameNameBlocklessAtRule.js | 23 + .../utils/isContextFunctionalPseudoClass.js | 26 + .../isCounterIncrementCustomIdentValue.js | 21 + .../utils/isCounterResetCustomIdentValue.js | 21 + .../stylelint/lib/utils/isCustomElement.js | 41 + .../stylelint/lib/utils/isCustomFunction.js | 11 + .../stylelint/lib/utils/isCustomMediaQuery.js | 10 + .../stylelint/lib/utils/isCustomProperty.js | 10 + .../stylelint/lib/utils/isCustomSelector.js | 11 + .../stylelint/lib/utils/isFirstNested.js | 85 + .../stylelint/lib/utils/isFirstNodeOfRoot.js | 19 + .../stylelint/lib/utils/isKeyframeRule.js | 19 + .../stylelint/lib/utils/isKeyframeSelector.js | 22 + .../stylelint/lib/utils/isMathFunction.js | 13 + .../lib/utils/isNonNegativeInteger.js | 8 + node_modules/stylelint/lib/utils/isNumbery.js | 11 + .../stylelint/lib/utils/isOnlyWhitespace.js | 19 + .../lib/utils/isPathNotFoundError.js | 11 + .../stylelint/lib/utils/isScssVariable.js | 21 + .../lib/utils/isSharedLineComment.js | 56 + .../stylelint/lib/utils/isSingleLineString.js | 12 + .../lib/utils/isStandardSyntaxAtRule.js | 29 + .../utils/isStandardSyntaxColorFunction.js | 26 + .../lib/utils/isStandardSyntaxCombinator.js | 34 + .../lib/utils/isStandardSyntaxComment.js | 15 + .../lib/utils/isStandardSyntaxDeclaration.js | 58 + .../lib/utils/isStandardSyntaxFunction.js | 30 + .../lib/utils/isStandardSyntaxHexColor.js | 16 + .../utils/isStandardSyntaxKeyframesName.js | 17 + .../lib/utils/isStandardSyntaxMathFunction.js | 21 + .../lib/utils/isStandardSyntaxMediaFeature.js | 26 + .../utils/isStandardSyntaxMediaFeatureName.js | 16 + .../lib/utils/isStandardSyntaxProperty.js | 34 + .../lib/utils/isStandardSyntaxRule.js | 26 + .../lib/utils/isStandardSyntaxSelector.js | 58 + .../lib/utils/isStandardSyntaxTypeSelector.js | 58 + .../lib/utils/isStandardSyntaxUrl.js | 51 + .../lib/utils/isStandardSyntaxValue.js | 52 + .../lib/utils/isUnicodeRangeDescriptor.js | 26 + .../stylelint/lib/utils/isValidFontSize.js | 39 + .../stylelint/lib/utils/isValidHex.js | 13 + .../stylelint/lib/utils/isValidIdentifier.js | 41 + .../stylelint/lib/utils/isVariable.js | 11 + .../stylelint/lib/utils/isWhitespace.js | 11 + .../lib/utils/matchesStringOrRegExp.js | 89 + .../stylelint/lib/utils/nextNonCommentNode.js | 20 + .../stylelint/lib/utils/noFilesFoundError.js | 20 + .../stylelint/lib/utils/nodeContextLookup.js | 43 + .../stylelint/lib/utils/optionsMatches.js | 22 + .../stylelint/lib/utils/parseMediaQuery.js | 16 + .../stylelint/lib/utils/parseSelector.js | 20 + node_modules/stylelint/lib/utils/pluralize.js | 12 + .../stylelint/lib/utils/putIfAbsent.js | 22 + .../stylelint/lib/utils/rawNodeString.js | 20 + .../lib/utils/removeEmptyLinesAfter.js | 15 + .../lib/utils/removeEmptyLinesBefore.js | 15 + node_modules/stylelint/lib/utils/report.js | 146 + .../stylelint/lib/utils/ruleMessages.js | 20 + .../stylelint/lib/utils/setAtRuleParams.js | 20 + .../lib/utils/setDeclarationValue.js | 20 + .../stylelint/lib/utils/transformSelector.js | 19 + .../stylelint/lib/utils/typeGuards.js | 68 + node_modules/stylelint/lib/utils/uniteSets.js | 8 + .../lib/utils/validateObjectWithArrayProps.js | 31 + .../lib/utils/validateObjectWithProps.js | 28 + .../stylelint/lib/utils/validateOptions.js | 174 + .../stylelint/lib/utils/validateTypes.js | 138 + node_modules/stylelint/lib/utils/vendor.js | 45 + .../stylelint/lib/utils/whitespaceChecker.js | 340 + .../stylelint/lib/validateDisableSettings.js | 79 + node_modules/stylelint/lib/writeOutputFile.js | 17 + node_modules/stylelint/package.json | 224 + .../stylelint/types/stylelint/index.d.ts | 639 ++ node_modules/supports-color/browser.js | 5 + node_modules/supports-color/index.js | 131 + node_modules/supports-color/license | 9 + node_modules/supports-color/package.json | 53 + node_modules/supports-color/readme.md | 66 + node_modules/supports-hyperlinks/browser.js | 8 + node_modules/supports-hyperlinks/index.d.ts | 5 + node_modules/supports-hyperlinks/index.js | 117 + node_modules/supports-hyperlinks/license | 9 + .../node_modules/has-flag/index.d.ts | 39 + .../node_modules/has-flag/index.js | 8 + .../node_modules/has-flag/license | 9 + .../node_modules/has-flag/package.json | 46 + .../node_modules/has-flag/readme.md | 89 + .../node_modules/supports-color/browser.js | 5 + .../node_modules/supports-color/index.js | 135 + .../node_modules/supports-color/license | 9 + .../node_modules/supports-color/package.json | 53 + .../node_modules/supports-color/readme.md | 76 + node_modules/supports-hyperlinks/package.json | 51 + node_modules/supports-hyperlinks/readme.md | 48 + node_modules/svg-tags/LICENSE | 21 + node_modules/svg-tags/README.md | 99 + node_modules/svg-tags/lib/index.js | 1 + node_modules/svg-tags/lib/svg-tags.json | 82 + node_modules/svg-tags/package.json | 46 + node_modules/table/LICENSE | 24 + node_modules/table/README.md | 837 ++ .../table/dist/src/alignSpanningCell.d.ts | 7 + .../table/dist/src/alignSpanningCell.js | 48 + .../table/dist/src/alignSpanningCell.js.map | 1 + node_modules/table/dist/src/alignString.d.ts | 6 + node_modules/table/dist/src/alignString.js | 60 + .../table/dist/src/alignString.js.map | 1 + .../table/dist/src/alignTableData.d.ts | 2 + node_modules/table/dist/src/alignTableData.js | 20 + .../table/dist/src/alignTableData.js.map | 1 + .../table/dist/src/calculateCellHeight.d.ts | 4 + .../table/dist/src/calculateCellHeight.js | 12 + .../table/dist/src/calculateCellHeight.js.map | 1 + .../src/calculateMaximumColumnWidths.d.ts | 7 + .../dist/src/calculateMaximumColumnWidths.js | 36 + .../src/calculateMaximumColumnWidths.js.map | 1 + .../dist/src/calculateOutputColumnWidths.d.ts | 2 + .../dist/src/calculateOutputColumnWidths.js | 10 + .../src/calculateOutputColumnWidths.js.map | 1 + .../table/dist/src/calculateRowHeights.d.ts | 5 + .../table/dist/src/calculateRowHeights.js | 42 + .../table/dist/src/calculateRowHeights.js.map | 1 + .../dist/src/calculateSpanningCellWidth.d.ts | 3 + .../dist/src/calculateSpanningCellWidth.js | 26 + .../src/calculateSpanningCellWidth.js.map | 1 + node_modules/table/dist/src/createStream.d.ts | 2 + node_modules/table/dist/src/createStream.js | 74 + .../table/dist/src/createStream.js.map | 1 + node_modules/table/dist/src/drawBorder.d.ts | 34 + node_modules/table/dist/src/drawBorder.js | 202 + node_modules/table/dist/src/drawBorder.js.map | 1 + node_modules/table/dist/src/drawContent.d.ts | 14 + node_modules/table/dist/src/drawContent.js | 51 + .../table/dist/src/drawContent.js.map | 1 + node_modules/table/dist/src/drawRow.d.ts | 10 + node_modules/table/dist/src/drawRow.js | 25 + node_modules/table/dist/src/drawRow.js.map | 1 + node_modules/table/dist/src/drawTable.d.ts | 2 + node_modules/table/dist/src/drawTable.js | 31 + node_modules/table/dist/src/drawTable.js.map | 1 + .../table/dist/src/generated/validators.d.ts | 13 + .../table/dist/src/generated/validators.js | 2694 +++++ .../dist/src/generated/validators.js.map | 1 + .../table/dist/src/getBorderCharacters.d.ts | 2 + .../table/dist/src/getBorderCharacters.js | 105 + .../table/dist/src/getBorderCharacters.js.map | 1 + node_modules/table/dist/src/index.d.ts | 5 + node_modules/table/dist/src/index.js | 21 + node_modules/table/dist/src/index.js.map | 1 + .../table/dist/src/injectHeaderConfig.d.ts | 3 + .../table/dist/src/injectHeaderConfig.js | 29 + .../table/dist/src/injectHeaderConfig.js.map | 1 + .../table/dist/src/makeRangeConfig.d.ts | 3 + .../table/dist/src/makeRangeConfig.js | 18 + .../table/dist/src/makeRangeConfig.js.map | 1 + .../table/dist/src/makeStreamConfig.d.ts | 7 + .../table/dist/src/makeStreamConfig.js | 43 + .../table/dist/src/makeStreamConfig.js.map | 1 + .../table/dist/src/makeTableConfig.d.ts | 7 + .../table/dist/src/makeTableConfig.js | 62 + .../table/dist/src/makeTableConfig.js.map | 1 + .../dist/src/mapDataUsingRowHeights.d.ts | 4 + .../table/dist/src/mapDataUsingRowHeights.js | 52 + .../dist/src/mapDataUsingRowHeights.js.map | 1 + node_modules/table/dist/src/padTableData.d.ts | 3 + node_modules/table/dist/src/padTableData.js | 23 + .../table/dist/src/padTableData.js.map | 1 + .../table/dist/src/schemas/config.json | 95 + .../table/dist/src/schemas/shared.json | 139 + .../table/dist/src/schemas/streamConfig.json | 25 + .../table/dist/src/spanningCellManager.d.ts | 21 + .../table/dist/src/spanningCellManager.js | 86 + .../table/dist/src/spanningCellManager.js.map | 1 + .../table/dist/src/stringifyTableData.d.ts | 2 + .../table/dist/src/stringifyTableData.js | 13 + .../table/dist/src/stringifyTableData.js.map | 1 + node_modules/table/dist/src/table.d.ts | 2 + node_modules/table/dist/src/table.js | 31 + node_modules/table/dist/src/table.js.map | 1 + .../table/dist/src/truncateTableData.d.ts | 6 + .../table/dist/src/truncateTableData.js | 24 + .../table/dist/src/truncateTableData.js.map | 1 + node_modules/table/dist/src/types/api.d.ts | 130 + node_modules/table/dist/src/types/api.js | 3 + node_modules/table/dist/src/types/api.js.map | 1 + .../table/dist/src/types/internal.d.ts | 1 + node_modules/table/dist/src/types/internal.js | 3 + .../table/dist/src/types/internal.js.map | 1 + node_modules/table/dist/src/utils.d.ts | 10 + node_modules/table/dist/src/utils.js | 143 + node_modules/table/dist/src/utils.js.map | 1 + .../table/dist/src/validateConfig.d.ts | 2 + node_modules/table/dist/src/validateConfig.js | 27 + .../table/dist/src/validateConfig.js.map | 1 + .../dist/src/validateSpanningCellConfig.d.ts | 3 + .../dist/src/validateSpanningCellConfig.js | 46 + .../src/validateSpanningCellConfig.js.map | 1 + .../table/dist/src/validateTableData.d.ts | 1 + .../table/dist/src/validateTableData.js | 32 + .../table/dist/src/validateTableData.js.map | 1 + node_modules/table/dist/src/wrapCell.d.ts | 8 + node_modules/table/dist/src/wrapCell.js | 33 + node_modules/table/dist/src/wrapCell.js.map | 1 + node_modules/table/dist/src/wrapString.d.ts | 9 + node_modules/table/dist/src/wrapString.js | 27 + node_modules/table/dist/src/wrapString.js.map | 1 + node_modules/table/dist/src/wrapWord.d.ts | 1 + node_modules/table/dist/src/wrapWord.js | 42 + node_modules/table/dist/src/wrapWord.js.map | 1 + node_modules/table/package.json | 77 + node_modules/to-regex-range/LICENSE | 21 + node_modules/to-regex-range/README.md | 305 + node_modules/to-regex-range/index.js | 288 + node_modules/to-regex-range/package.json | 88 + node_modules/trim-newlines/index.d.ts | 42 + node_modules/trim-newlines/index.js | 35 + node_modules/trim-newlines/license | 9 + node_modules/trim-newlines/package.json | 46 + node_modules/trim-newlines/readme.md | 55 + node_modules/type-fest/base.d.ts | 42 + node_modules/type-fest/index.d.ts | 2 + node_modules/type-fest/license | 9 + node_modules/type-fest/package.json | 58 + node_modules/type-fest/readme.md | 794 ++ .../type-fest/source/async-return-type.d.ts | 25 + node_modules/type-fest/source/asyncify.d.ts | 33 + node_modules/type-fest/source/basic.d.ts | 32 + .../type-fest/source/conditional-except.d.ts | 45 + .../type-fest/source/conditional-keys.d.ts | 45 + .../type-fest/source/conditional-pick.d.ts | 44 + node_modules/type-fest/source/entries.d.ts | 59 + node_modules/type-fest/source/entry.d.ts | 62 + node_modules/type-fest/source/except.d.ts | 24 + .../type-fest/source/fixed-length-array.d.ts | 40 + .../type-fest/source/iterable-element.d.ts | 48 + .../type-fest/source/literal-union.d.ts | 35 + .../type-fest/source/merge-exclusive.d.ts | 41 + node_modules/type-fest/source/merge.d.ts | 27 + node_modules/type-fest/source/mutable.d.ts | 40 + .../type-fest/source/observable-like.d.ts | 15 + node_modules/type-fest/source/opaque.d.ts | 67 + .../type-fest/source/package-json.d.ts | 645 ++ .../type-fest/source/partial-deep.d.ts | 74 + node_modules/type-fest/source/primitive.d.ts | 13 + node_modules/type-fest/source/promisable.d.ts | 25 + .../type-fest/source/promise-value.d.ts | 29 + .../type-fest/source/readonly-deep.d.ts | 61 + .../source/require-at-least-one.d.ts | 35 + .../type-fest/source/require-exactly-one.d.ts | 37 + .../type-fest/source/set-optional.d.ts | 35 + .../type-fest/source/set-required.d.ts | 35 + .../type-fest/source/set-return-type.d.ts | 31 + node_modules/type-fest/source/simplify.d.ts | 24 + .../type-fest/source/stringified.d.ts | 23 + .../type-fest/source/tsconfig-json.d.ts | 1095 ++ .../type-fest/source/typed-array.d.ts | 19 + .../source/union-to-intersection.d.ts | 60 + node_modules/type-fest/source/utilities.d.ts | 5 + node_modules/type-fest/source/value-of.d.ts | 42 + node_modules/type-fest/ts41/camel-case.d.ts | 72 + .../ts41/camel-cased-properties-deep.d.ts | 50 + .../ts41/camel-cased-properties.d.ts | 32 + .../type-fest/ts41/delimiter-case.d.ts | 88 + .../ts41/delimiter-cased-properties-deep.d.ts | 56 + .../ts41/delimiter-cased-properties.d.ts | 33 + node_modules/type-fest/ts41/get.d.ts | 135 + node_modules/type-fest/ts41/includes.d.ts | 31 + node_modules/type-fest/ts41/index.d.ts | 25 + node_modules/type-fest/ts41/kebab-case.d.ts | 37 + .../ts41/kebab-cased-properties-deep.d.ts | 43 + .../ts41/kebab-cased-properties.d.ts | 26 + .../type-fest/ts41/last-array-element.d.ts | 25 + node_modules/type-fest/ts41/pascal-case.d.ts | 37 + .../ts41/pascal-cased-properties-deep.d.ts | 50 + .../ts41/pascal-cased-properties.d.ts | 30 + .../type-fest/ts41/screaming-snake-case.d.ts | 32 + node_modules/type-fest/ts41/snake-case.d.ts | 37 + .../ts41/snake-cased-properties-deep.d.ts | 43 + .../ts41/snake-cased-properties.d.ts | 26 + node_modules/type-fest/ts41/split.d.ts | 28 + node_modules/type-fest/ts41/trim.d.ts | 24 + node_modules/type-fest/ts41/utilities.d.ts | 8 + node_modules/uri-js/LICENSE | 11 + node_modules/uri-js/README.md | 203 + node_modules/uri-js/dist/es5/uri.all.d.ts | 59 + node_modules/uri-js/dist/es5/uri.all.js | 1443 +++ node_modules/uri-js/dist/es5/uri.all.js.map | 1 + node_modules/uri-js/dist/es5/uri.all.min.d.ts | 59 + node_modules/uri-js/dist/es5/uri.all.min.js | 3 + .../uri-js/dist/es5/uri.all.min.js.map | 1 + node_modules/uri-js/dist/esnext/index.d.ts | 1 + node_modules/uri-js/dist/esnext/index.js | 17 + node_modules/uri-js/dist/esnext/index.js.map | 1 + .../uri-js/dist/esnext/regexps-iri.d.ts | 3 + .../uri-js/dist/esnext/regexps-iri.js | 3 + .../uri-js/dist/esnext/regexps-iri.js.map | 1 + .../uri-js/dist/esnext/regexps-uri.d.ts | 4 + .../uri-js/dist/esnext/regexps-uri.js | 42 + .../uri-js/dist/esnext/regexps-uri.js.map | 1 + .../uri-js/dist/esnext/schemes/http.d.ts | 3 + .../uri-js/dist/esnext/schemes/http.js | 28 + .../uri-js/dist/esnext/schemes/http.js.map | 1 + .../uri-js/dist/esnext/schemes/https.d.ts | 3 + .../uri-js/dist/esnext/schemes/https.js | 9 + .../uri-js/dist/esnext/schemes/https.js.map | 1 + .../uri-js/dist/esnext/schemes/mailto.d.ts | 12 + .../uri-js/dist/esnext/schemes/mailto.js | 148 + .../uri-js/dist/esnext/schemes/mailto.js.map | 1 + .../uri-js/dist/esnext/schemes/urn-uuid.d.ts | 7 + .../uri-js/dist/esnext/schemes/urn-uuid.js | 23 + .../dist/esnext/schemes/urn-uuid.js.map | 1 + .../uri-js/dist/esnext/schemes/urn.d.ts | 10 + .../uri-js/dist/esnext/schemes/urn.js | 49 + .../uri-js/dist/esnext/schemes/urn.js.map | 1 + .../uri-js/dist/esnext/schemes/ws.d.ts | 7 + node_modules/uri-js/dist/esnext/schemes/ws.js | 41 + .../uri-js/dist/esnext/schemes/ws.js.map | 1 + .../uri-js/dist/esnext/schemes/wss.d.ts | 3 + .../uri-js/dist/esnext/schemes/wss.js | 9 + .../uri-js/dist/esnext/schemes/wss.js.map | 1 + node_modules/uri-js/dist/esnext/uri.d.ts | 59 + node_modules/uri-js/dist/esnext/uri.js | 480 + node_modules/uri-js/dist/esnext/uri.js.map | 1 + node_modules/uri-js/dist/esnext/util.d.ts | 6 + node_modules/uri-js/dist/esnext/util.js | 36 + node_modules/uri-js/dist/esnext/util.js.map | 1 + node_modules/uri-js/package.json | 77 + node_modules/uri-js/yarn.lock | 2558 +++++ node_modules/util-deprecate/History.md | 16 + node_modules/util-deprecate/LICENSE | 24 + node_modules/util-deprecate/README.md | 53 + node_modules/util-deprecate/browser.js | 67 + node_modules/util-deprecate/node.js | 6 + node_modules/util-deprecate/package.json | 27 + .../validate-npm-package-license/LICENSE | 202 + .../validate-npm-package-license/README.md | 113 + .../validate-npm-package-license/index.js | 86 + .../validate-npm-package-license/package.json | 28 + node_modules/which/CHANGELOG.md | 152 + node_modules/which/LICENSE | 15 + node_modules/which/README.md | 51 + node_modules/which/bin/which | 52 + node_modules/which/package.json | 30 + node_modules/which/which.js | 135 + node_modules/wrappy/LICENSE | 15 + node_modules/wrappy/README.md | 36 + node_modules/wrappy/package.json | 29 + node_modules/wrappy/wrappy.js | 33 + node_modules/write-file-atomic/LICENSE.md | 6 + node_modules/write-file-atomic/README.md | 91 + node_modules/write-file-atomic/lib/index.js | 267 + node_modules/write-file-atomic/package.json | 57 + node_modules/yallist/LICENSE | 15 + node_modules/yallist/README.md | 204 + node_modules/yallist/iterator.js | 8 + node_modules/yallist/package.json | 29 + node_modules/yallist/yallist.js | 426 + node_modules/yargs-parser/CHANGELOG.md | 263 + node_modules/yargs-parser/LICENSE.txt | 14 + node_modules/yargs-parser/README.md | 518 + node_modules/yargs-parser/browser.js | 29 + node_modules/yargs-parser/build/index.cjs | 1042 ++ node_modules/yargs-parser/build/lib/index.js | 59 + .../yargs-parser/build/lib/string-utils.js | 65 + .../build/lib/tokenize-arg-string.js | 40 + .../build/lib/yargs-parser-types.js | 12 + .../yargs-parser/build/lib/yargs-parser.js | 1037 ++ node_modules/yargs-parser/package.json | 87 + node_modules/yocto-queue/index.d.ts | 56 + node_modules/yocto-queue/index.js | 68 + node_modules/yocto-queue/license | 9 + node_modules/yocto-queue/package.json | 43 + node_modules/yocto-queue/readme.md | 64 + package-lock.json | 2073 ++++ package.json | 19 + 2957 files changed, 258416 insertions(+) create mode 100644 .github/workflows/linter.yaml create mode 100644 .stylelintrc.json create mode 120000 node_modules/.bin/cssesc create mode 120000 node_modules/.bin/js-yaml create mode 120000 node_modules/.bin/nanoid create mode 120000 node_modules/.bin/rimraf create mode 120000 node_modules/.bin/semver create mode 120000 node_modules/.bin/stylelint create mode 120000 node_modules/.bin/which create mode 100644 node_modules/.package-lock.json create mode 100644 node_modules/@babel/code-frame/LICENSE create mode 100644 node_modules/@babel/code-frame/README.md create mode 100644 node_modules/@babel/code-frame/lib/index.js create mode 100644 node_modules/@babel/code-frame/lib/index.js.map create mode 100644 node_modules/@babel/code-frame/package.json create mode 100644 node_modules/@babel/helper-validator-identifier/LICENSE create mode 100644 node_modules/@babel/helper-validator-identifier/README.md create mode 100644 node_modules/@babel/helper-validator-identifier/lib/identifier.js create mode 100644 node_modules/@babel/helper-validator-identifier/lib/identifier.js.map create mode 100644 node_modules/@babel/helper-validator-identifier/lib/index.js create mode 100644 node_modules/@babel/helper-validator-identifier/lib/index.js.map create mode 100644 node_modules/@babel/helper-validator-identifier/lib/keyword.js create mode 100644 node_modules/@babel/helper-validator-identifier/lib/keyword.js.map create mode 100644 node_modules/@babel/helper-validator-identifier/package.json create mode 100644 node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js create mode 100644 node_modules/@babel/highlight/LICENSE create mode 100644 node_modules/@babel/highlight/README.md create mode 100644 node_modules/@babel/highlight/lib/index.js create mode 100644 node_modules/@babel/highlight/lib/index.js.map create mode 100644 node_modules/@babel/highlight/package.json create mode 100644 node_modules/@csstools/css-parser-algorithms/CHANGELOG.md create mode 100644 node_modules/@csstools/css-parser-algorithms/LICENSE.md create mode 100644 node_modules/@csstools/css-parser-algorithms/README.md create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/index.cjs create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/index.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/index.mjs create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/interfaces/context.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/parse/parse-component-value.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/component-value-type.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/node-ancestry.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/replace-component-values.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/source-indices.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/stringify.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/type-predicates.d.ts create mode 100644 node_modules/@csstools/css-parser-algorithms/package.json create mode 100644 node_modules/@csstools/css-tokenizer/CHANGELOG.md create mode 100644 node_modules/@csstools/css-tokenizer/LICENSE.md create mode 100644 node_modules/@csstools/css-tokenizer/README.md create mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/matches-url-ident.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/code-points/code-points.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/code-points/ranges.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/bad-url.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/comment.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/escaped-code-point.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/hash-token.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/ident-like-token.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/ident-sequence.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/number.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/numeric-token.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/string-token.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/url-token.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/whitespace-token.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/index.cjs create mode 100644 node_modules/@csstools/css-tokenizer/dist/index.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/index.mjs create mode 100644 node_modules/@csstools/css-tokenizer/dist/interfaces/code-point-reader.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/interfaces/context.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/interfaces/error.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/interfaces/token.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/reader.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/stringify.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/tokenizer.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/util/clone-tokens.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/dist/util/mutations.d.ts create mode 100644 node_modules/@csstools/css-tokenizer/package.json create mode 100644 node_modules/@csstools/media-query-list-parser/CHANGELOG.md create mode 100644 node_modules/@csstools/media-query-list-parser/LICENSE.md create mode 100644 node_modules/@csstools/media-query-list-parser/README.md create mode 100644 node_modules/@csstools/media-query-list-parser/dist/index.cjs create mode 100644 node_modules/@csstools/media-query-list-parser/dist/index.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/index.mjs create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/custom-media.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts create mode 100644 node_modules/@csstools/media-query-list-parser/package.json create mode 100644 node_modules/@csstools/selector-specificity/CHANGELOG.md create mode 100644 node_modules/@csstools/selector-specificity/LICENSE.md create mode 100644 node_modules/@csstools/selector-specificity/README.md create mode 100644 node_modules/@csstools/selector-specificity/dist/index.cjs create mode 100644 node_modules/@csstools/selector-specificity/dist/index.d.ts create mode 100644 node_modules/@csstools/selector-specificity/dist/index.mjs create mode 100644 node_modules/@csstools/selector-specificity/dist/to-lower-case-a-z.d.ts create mode 100644 node_modules/@csstools/selector-specificity/package.json create mode 100644 node_modules/@nodelib/fs.scandir/LICENSE create mode 100644 node_modules/@nodelib/fs.scandir/README.md create mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.js create mode 100644 node_modules/@nodelib/fs.scandir/out/constants.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/constants.js create mode 100644 node_modules/@nodelib/fs.scandir/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/index.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.js create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.scandir/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/settings.js create mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.js create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.js create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.d.ts create mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.js create mode 100644 node_modules/@nodelib/fs.scandir/package.json create mode 100644 node_modules/@nodelib/fs.stat/LICENSE create mode 100644 node_modules/@nodelib/fs.stat/README.md create mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.js create mode 100644 node_modules/@nodelib/fs.stat/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/index.js create mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.stat/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/settings.js create mode 100644 node_modules/@nodelib/fs.stat/out/types/index.d.ts create mode 100644 node_modules/@nodelib/fs.stat/out/types/index.js create mode 100644 node_modules/@nodelib/fs.stat/package.json create mode 100644 node_modules/@nodelib/fs.walk/LICENSE create mode 100644 node_modules/@nodelib/fs.walk/README.md create mode 100644 node_modules/@nodelib/fs.walk/out/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/index.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.js create mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.js create mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.js create mode 100644 node_modules/@nodelib/fs.walk/out/settings.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/settings.js create mode 100644 node_modules/@nodelib/fs.walk/out/types/index.d.ts create mode 100644 node_modules/@nodelib/fs.walk/out/types/index.js create mode 100644 node_modules/@nodelib/fs.walk/package.json create mode 100755 node_modules/@types/minimist/LICENSE create mode 100755 node_modules/@types/minimist/README.md create mode 100755 node_modules/@types/minimist/index.d.ts create mode 100755 node_modules/@types/minimist/package.json create mode 100755 node_modules/@types/normalize-package-data/LICENSE create mode 100755 node_modules/@types/normalize-package-data/README.md create mode 100755 node_modules/@types/normalize-package-data/index.d.ts create mode 100755 node_modules/@types/normalize-package-data/package.json create mode 100644 node_modules/ajv/.runkit_example.js create mode 100644 node_modules/ajv/LICENSE create mode 100644 node_modules/ajv/README.md create mode 100644 node_modules/ajv/dist/2019.d.ts create mode 100644 node_modules/ajv/dist/2019.js create mode 100644 node_modules/ajv/dist/2019.js.map create mode 100644 node_modules/ajv/dist/2020.d.ts create mode 100644 node_modules/ajv/dist/2020.js create mode 100644 node_modules/ajv/dist/2020.js.map create mode 100644 node_modules/ajv/dist/ajv.d.ts create mode 100644 node_modules/ajv/dist/ajv.js create mode 100644 node_modules/ajv/dist/ajv.js.map create mode 100644 node_modules/ajv/dist/compile/codegen/code.d.ts create mode 100644 node_modules/ajv/dist/compile/codegen/code.js create mode 100644 node_modules/ajv/dist/compile/codegen/code.js.map create mode 100644 node_modules/ajv/dist/compile/codegen/index.d.ts create mode 100644 node_modules/ajv/dist/compile/codegen/index.js create mode 100644 node_modules/ajv/dist/compile/codegen/index.js.map create mode 100644 node_modules/ajv/dist/compile/codegen/scope.d.ts create mode 100644 node_modules/ajv/dist/compile/codegen/scope.js create mode 100644 node_modules/ajv/dist/compile/codegen/scope.js.map create mode 100644 node_modules/ajv/dist/compile/errors.d.ts create mode 100644 node_modules/ajv/dist/compile/errors.js create mode 100644 node_modules/ajv/dist/compile/errors.js.map create mode 100644 node_modules/ajv/dist/compile/index.d.ts create mode 100644 node_modules/ajv/dist/compile/index.js create mode 100644 node_modules/ajv/dist/compile/index.js.map create mode 100644 node_modules/ajv/dist/compile/jtd/parse.d.ts create mode 100644 node_modules/ajv/dist/compile/jtd/parse.js create mode 100644 node_modules/ajv/dist/compile/jtd/parse.js.map create mode 100644 node_modules/ajv/dist/compile/jtd/serialize.d.ts create mode 100644 node_modules/ajv/dist/compile/jtd/serialize.js create mode 100644 node_modules/ajv/dist/compile/jtd/serialize.js.map create mode 100644 node_modules/ajv/dist/compile/jtd/types.d.ts create mode 100644 node_modules/ajv/dist/compile/jtd/types.js create mode 100644 node_modules/ajv/dist/compile/jtd/types.js.map create mode 100644 node_modules/ajv/dist/compile/names.d.ts create mode 100644 node_modules/ajv/dist/compile/names.js create mode 100644 node_modules/ajv/dist/compile/names.js.map create mode 100644 node_modules/ajv/dist/compile/ref_error.d.ts create mode 100644 node_modules/ajv/dist/compile/ref_error.js create mode 100644 node_modules/ajv/dist/compile/ref_error.js.map create mode 100644 node_modules/ajv/dist/compile/resolve.d.ts create mode 100644 node_modules/ajv/dist/compile/resolve.js create mode 100644 node_modules/ajv/dist/compile/resolve.js.map create mode 100644 node_modules/ajv/dist/compile/rules.d.ts create mode 100644 node_modules/ajv/dist/compile/rules.js create mode 100644 node_modules/ajv/dist/compile/rules.js.map create mode 100644 node_modules/ajv/dist/compile/util.d.ts create mode 100644 node_modules/ajv/dist/compile/util.js create mode 100644 node_modules/ajv/dist/compile/util.js.map create mode 100644 node_modules/ajv/dist/compile/validate/applicability.d.ts create mode 100644 node_modules/ajv/dist/compile/validate/applicability.js create mode 100644 node_modules/ajv/dist/compile/validate/applicability.js.map create mode 100644 node_modules/ajv/dist/compile/validate/boolSchema.d.ts create mode 100644 node_modules/ajv/dist/compile/validate/boolSchema.js create mode 100644 node_modules/ajv/dist/compile/validate/boolSchema.js.map create mode 100644 node_modules/ajv/dist/compile/validate/dataType.d.ts create mode 100644 node_modules/ajv/dist/compile/validate/dataType.js create mode 100644 node_modules/ajv/dist/compile/validate/dataType.js.map create mode 100644 node_modules/ajv/dist/compile/validate/defaults.d.ts create mode 100644 node_modules/ajv/dist/compile/validate/defaults.js create mode 100644 node_modules/ajv/dist/compile/validate/defaults.js.map create mode 100644 node_modules/ajv/dist/compile/validate/index.d.ts create mode 100644 node_modules/ajv/dist/compile/validate/index.js create mode 100644 node_modules/ajv/dist/compile/validate/index.js.map create mode 100644 node_modules/ajv/dist/compile/validate/keyword.d.ts create mode 100644 node_modules/ajv/dist/compile/validate/keyword.js create mode 100644 node_modules/ajv/dist/compile/validate/keyword.js.map create mode 100644 node_modules/ajv/dist/compile/validate/subschema.d.ts create mode 100644 node_modules/ajv/dist/compile/validate/subschema.js create mode 100644 node_modules/ajv/dist/compile/validate/subschema.js.map create mode 100644 node_modules/ajv/dist/core.d.ts create mode 100644 node_modules/ajv/dist/core.js create mode 100644 node_modules/ajv/dist/core.js.map create mode 100644 node_modules/ajv/dist/jtd.d.ts create mode 100644 node_modules/ajv/dist/jtd.js create mode 100644 node_modules/ajv/dist/jtd.js.map create mode 100644 node_modules/ajv/dist/refs/data.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts create mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/index.js create mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map create mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/schema.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts create mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/index.js create mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map create mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json create mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/schema.json create mode 100644 node_modules/ajv/dist/refs/json-schema-draft-06.json create mode 100644 node_modules/ajv/dist/refs/json-schema-draft-07.json create mode 100644 node_modules/ajv/dist/refs/json-schema-secure.json create mode 100644 node_modules/ajv/dist/refs/jtd-schema.d.ts create mode 100644 node_modules/ajv/dist/refs/jtd-schema.js create mode 100644 node_modules/ajv/dist/refs/jtd-schema.js.map create mode 100644 node_modules/ajv/dist/runtime/equal.d.ts create mode 100644 node_modules/ajv/dist/runtime/equal.js create mode 100644 node_modules/ajv/dist/runtime/equal.js.map create mode 100644 node_modules/ajv/dist/runtime/parseJson.d.ts create mode 100644 node_modules/ajv/dist/runtime/parseJson.js create mode 100644 node_modules/ajv/dist/runtime/parseJson.js.map create mode 100644 node_modules/ajv/dist/runtime/quote.d.ts create mode 100644 node_modules/ajv/dist/runtime/quote.js create mode 100644 node_modules/ajv/dist/runtime/quote.js.map create mode 100644 node_modules/ajv/dist/runtime/re2.d.ts create mode 100644 node_modules/ajv/dist/runtime/re2.js create mode 100644 node_modules/ajv/dist/runtime/re2.js.map create mode 100644 node_modules/ajv/dist/runtime/timestamp.d.ts create mode 100644 node_modules/ajv/dist/runtime/timestamp.js create mode 100644 node_modules/ajv/dist/runtime/timestamp.js.map create mode 100644 node_modules/ajv/dist/runtime/ucs2length.d.ts create mode 100644 node_modules/ajv/dist/runtime/ucs2length.js create mode 100644 node_modules/ajv/dist/runtime/ucs2length.js.map create mode 100644 node_modules/ajv/dist/runtime/uri.d.ts create mode 100644 node_modules/ajv/dist/runtime/uri.js create mode 100644 node_modules/ajv/dist/runtime/uri.js.map create mode 100644 node_modules/ajv/dist/runtime/validation_error.d.ts create mode 100644 node_modules/ajv/dist/runtime/validation_error.js create mode 100644 node_modules/ajv/dist/runtime/validation_error.js.map create mode 100644 node_modules/ajv/dist/standalone/index.d.ts create mode 100644 node_modules/ajv/dist/standalone/index.js create mode 100644 node_modules/ajv/dist/standalone/index.js.map create mode 100644 node_modules/ajv/dist/standalone/instance.d.ts create mode 100644 node_modules/ajv/dist/standalone/instance.js create mode 100644 node_modules/ajv/dist/standalone/instance.js.map create mode 100644 node_modules/ajv/dist/types/index.d.ts create mode 100644 node_modules/ajv/dist/types/index.js create mode 100644 node_modules/ajv/dist/types/index.js.map create mode 100644 node_modules/ajv/dist/types/json-schema.d.ts create mode 100644 node_modules/ajv/dist/types/json-schema.js create mode 100644 node_modules/ajv/dist/types/json-schema.js.map create mode 100644 node_modules/ajv/dist/types/jtd-schema.d.ts create mode 100644 node_modules/ajv/dist/types/jtd-schema.js create mode 100644 node_modules/ajv/dist/types/jtd-schema.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/additionalItems.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/allOf.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/allOf.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/anyOf.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/contains.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/contains.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/contains.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/dependencies.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/if.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/if.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/if.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/index.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/index.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/index.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/items.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/items.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/items.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/items2020.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/items2020.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/not.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/not.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/not.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/oneOf.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/patternProperties.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/prefixItems.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/properties.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/properties.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/properties.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/propertyNames.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map create mode 100644 node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/applicator/thenElse.js create mode 100644 node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map create mode 100644 node_modules/ajv/dist/vocabularies/code.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/code.js create mode 100644 node_modules/ajv/dist/vocabularies/code.js.map create mode 100644 node_modules/ajv/dist/vocabularies/core/id.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/core/id.js create mode 100644 node_modules/ajv/dist/vocabularies/core/id.js.map create mode 100644 node_modules/ajv/dist/vocabularies/core/index.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/core/index.js create mode 100644 node_modules/ajv/dist/vocabularies/core/index.js.map create mode 100644 node_modules/ajv/dist/vocabularies/core/ref.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/core/ref.js create mode 100644 node_modules/ajv/dist/vocabularies/core/ref.js.map create mode 100644 node_modules/ajv/dist/vocabularies/discriminator/index.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/discriminator/index.js create mode 100644 node_modules/ajv/dist/vocabularies/discriminator/index.js.map create mode 100644 node_modules/ajv/dist/vocabularies/discriminator/types.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/discriminator/types.js create mode 100644 node_modules/ajv/dist/vocabularies/discriminator/types.js.map create mode 100644 node_modules/ajv/dist/vocabularies/draft2020.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/draft2020.js create mode 100644 node_modules/ajv/dist/vocabularies/draft2020.js.map create mode 100644 node_modules/ajv/dist/vocabularies/draft7.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/draft7.js create mode 100644 node_modules/ajv/dist/vocabularies/draft7.js.map create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/index.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/index.js create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/index.js.map create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js create mode 100644 node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map create mode 100644 node_modules/ajv/dist/vocabularies/errors.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/errors.js create mode 100644 node_modules/ajv/dist/vocabularies/errors.js.map create mode 100644 node_modules/ajv/dist/vocabularies/format/format.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/format/format.js create mode 100644 node_modules/ajv/dist/vocabularies/format/format.js.map create mode 100644 node_modules/ajv/dist/vocabularies/format/index.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/format/index.js create mode 100644 node_modules/ajv/dist/vocabularies/format/index.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/discriminator.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/elements.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/elements.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/elements.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/enum.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/enum.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/enum.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/error.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/error.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/error.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/index.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/index.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/index.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/metadata.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/metadata.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/nullable.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/nullable.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/properties.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/properties.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/properties.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/ref.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/ref.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/ref.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/type.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/type.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/type.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/union.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/union.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/union.js.map create mode 100644 node_modules/ajv/dist/vocabularies/jtd/values.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/jtd/values.js create mode 100644 node_modules/ajv/dist/vocabularies/jtd/values.js.map create mode 100644 node_modules/ajv/dist/vocabularies/metadata.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/metadata.js create mode 100644 node_modules/ajv/dist/vocabularies/metadata.js.map create mode 100644 node_modules/ajv/dist/vocabularies/next.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/next.js create mode 100644 node_modules/ajv/dist/vocabularies/next.js.map create mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/index.js create mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/index.js.map create mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js create mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map create mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js create mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/const.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/const.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/const.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/dependentRequired.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/enum.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/enum.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/enum.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/index.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/index.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/index.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitContains.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitContains.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitItems.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitItems.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitLength.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitLength.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitNumber.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitProperties.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/multipleOf.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/pattern.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/pattern.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/pattern.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/required.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/required.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/required.js.map create mode 100644 node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts create mode 100644 node_modules/ajv/dist/vocabularies/validation/uniqueItems.js create mode 100644 node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map create mode 100644 node_modules/ajv/lib/2019.ts create mode 100644 node_modules/ajv/lib/2020.ts create mode 100644 node_modules/ajv/lib/ajv.ts create mode 100644 node_modules/ajv/lib/compile/codegen/code.ts create mode 100644 node_modules/ajv/lib/compile/codegen/index.ts create mode 100644 node_modules/ajv/lib/compile/codegen/scope.ts create mode 100644 node_modules/ajv/lib/compile/errors.ts create mode 100644 node_modules/ajv/lib/compile/index.ts create mode 100644 node_modules/ajv/lib/compile/jtd/parse.ts create mode 100644 node_modules/ajv/lib/compile/jtd/serialize.ts create mode 100644 node_modules/ajv/lib/compile/jtd/types.ts create mode 100644 node_modules/ajv/lib/compile/names.ts create mode 100644 node_modules/ajv/lib/compile/ref_error.ts create mode 100644 node_modules/ajv/lib/compile/resolve.ts create mode 100644 node_modules/ajv/lib/compile/rules.ts create mode 100644 node_modules/ajv/lib/compile/util.ts create mode 100644 node_modules/ajv/lib/compile/validate/applicability.ts create mode 100644 node_modules/ajv/lib/compile/validate/boolSchema.ts create mode 100644 node_modules/ajv/lib/compile/validate/dataType.ts create mode 100644 node_modules/ajv/lib/compile/validate/defaults.ts create mode 100644 node_modules/ajv/lib/compile/validate/index.ts create mode 100644 node_modules/ajv/lib/compile/validate/keyword.ts create mode 100644 node_modules/ajv/lib/compile/validate/subschema.ts create mode 100644 node_modules/ajv/lib/core.ts create mode 100644 node_modules/ajv/lib/jtd.ts create mode 100644 node_modules/ajv/lib/refs/data.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/index.ts create mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/schema.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/index.ts create mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json create mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/schema.json create mode 100644 node_modules/ajv/lib/refs/json-schema-draft-06.json create mode 100644 node_modules/ajv/lib/refs/json-schema-draft-07.json create mode 100644 node_modules/ajv/lib/refs/json-schema-secure.json create mode 100644 node_modules/ajv/lib/refs/jtd-schema.ts create mode 100644 node_modules/ajv/lib/runtime/equal.ts create mode 100644 node_modules/ajv/lib/runtime/parseJson.ts create mode 100644 node_modules/ajv/lib/runtime/quote.ts create mode 100644 node_modules/ajv/lib/runtime/re2.ts create mode 100644 node_modules/ajv/lib/runtime/timestamp.ts create mode 100644 node_modules/ajv/lib/runtime/ucs2length.ts create mode 100644 node_modules/ajv/lib/runtime/uri.ts create mode 100644 node_modules/ajv/lib/runtime/validation_error.ts create mode 100644 node_modules/ajv/lib/standalone/index.ts create mode 100644 node_modules/ajv/lib/standalone/instance.ts create mode 100644 node_modules/ajv/lib/types/index.ts create mode 100644 node_modules/ajv/lib/types/json-schema.ts create mode 100644 node_modules/ajv/lib/types/jtd-schema.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/allOf.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/anyOf.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/contains.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/dependencies.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/if.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/index.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/items.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/items2020.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/not.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/oneOf.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/properties.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts create mode 100644 node_modules/ajv/lib/vocabularies/applicator/thenElse.ts create mode 100644 node_modules/ajv/lib/vocabularies/code.ts create mode 100644 node_modules/ajv/lib/vocabularies/core/id.ts create mode 100644 node_modules/ajv/lib/vocabularies/core/index.ts create mode 100644 node_modules/ajv/lib/vocabularies/core/ref.ts create mode 100644 node_modules/ajv/lib/vocabularies/discriminator/index.ts create mode 100644 node_modules/ajv/lib/vocabularies/discriminator/types.ts create mode 100644 node_modules/ajv/lib/vocabularies/draft2020.ts create mode 100644 node_modules/ajv/lib/vocabularies/draft7.ts create mode 100644 node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts create mode 100644 node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts create mode 100644 node_modules/ajv/lib/vocabularies/dynamic/index.ts create mode 100644 node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts create mode 100644 node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts create mode 100644 node_modules/ajv/lib/vocabularies/errors.ts create mode 100644 node_modules/ajv/lib/vocabularies/format/format.ts create mode 100644 node_modules/ajv/lib/vocabularies/format/index.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/discriminator.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/elements.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/enum.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/error.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/index.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/metadata.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/nullable.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/properties.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/ref.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/type.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/union.ts create mode 100644 node_modules/ajv/lib/vocabularies/jtd/values.ts create mode 100644 node_modules/ajv/lib/vocabularies/metadata.ts create mode 100644 node_modules/ajv/lib/vocabularies/next.ts create mode 100644 node_modules/ajv/lib/vocabularies/unevaluated/index.ts create mode 100644 node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts create mode 100644 node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/const.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/enum.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/index.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/limitContains.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/limitItems.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/limitLength.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/limitNumber.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/limitProperties.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/multipleOf.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/pattern.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/required.ts create mode 100644 node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts create mode 100644 node_modules/ajv/package.json create mode 100644 node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/ansi-regex/index.js create mode 100644 node_modules/ansi-regex/license create mode 100644 node_modules/ansi-regex/package.json create mode 100644 node_modules/ansi-regex/readme.md create mode 100644 node_modules/ansi-styles/index.js create mode 100644 node_modules/ansi-styles/license create mode 100644 node_modules/ansi-styles/package.json create mode 100644 node_modules/ansi-styles/readme.md create mode 100644 node_modules/argparse/CHANGELOG.md create mode 100644 node_modules/argparse/LICENSE create mode 100644 node_modules/argparse/README.md create mode 100644 node_modules/argparse/argparse.js create mode 100644 node_modules/argparse/lib/sub.js create mode 100644 node_modules/argparse/lib/textwrap.js create mode 100644 node_modules/argparse/package.json create mode 100644 node_modules/array-union/index.d.ts create mode 100644 node_modules/array-union/index.js create mode 100644 node_modules/array-union/license create mode 100644 node_modules/array-union/package.json create mode 100644 node_modules/array-union/readme.md create mode 100644 node_modules/arrify/index.js create mode 100644 node_modules/arrify/license create mode 100644 node_modules/arrify/package.json create mode 100644 node_modules/arrify/readme.md create mode 100644 node_modules/astral-regex/index.d.ts create mode 100644 node_modules/astral-regex/index.js create mode 100644 node_modules/astral-regex/license create mode 100644 node_modules/astral-regex/package.json create mode 100644 node_modules/astral-regex/readme.md create mode 100644 node_modules/balanced-match/.github/FUNDING.yml create mode 100644 node_modules/balanced-match/LICENSE.md create mode 100644 node_modules/balanced-match/README.md create mode 100644 node_modules/balanced-match/index.js create mode 100644 node_modules/balanced-match/package.json create mode 100644 node_modules/brace-expansion/LICENSE create mode 100644 node_modules/brace-expansion/README.md create mode 100644 node_modules/brace-expansion/index.js create mode 100644 node_modules/brace-expansion/node_modules/balanced-match/.github/FUNDING.yml create mode 100644 node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md create mode 100644 node_modules/brace-expansion/node_modules/balanced-match/README.md create mode 100644 node_modules/brace-expansion/node_modules/balanced-match/index.js create mode 100644 node_modules/brace-expansion/node_modules/balanced-match/package.json create mode 100644 node_modules/brace-expansion/package.json create mode 100644 node_modules/braces/CHANGELOG.md create mode 100644 node_modules/braces/LICENSE create mode 100644 node_modules/braces/README.md create mode 100644 node_modules/braces/index.js create mode 100644 node_modules/braces/lib/compile.js create mode 100644 node_modules/braces/lib/constants.js create mode 100644 node_modules/braces/lib/expand.js create mode 100644 node_modules/braces/lib/parse.js create mode 100644 node_modules/braces/lib/stringify.js create mode 100644 node_modules/braces/lib/utils.js create mode 100644 node_modules/braces/package.json create mode 100644 node_modules/callsites/index.d.ts create mode 100644 node_modules/callsites/index.js create mode 100644 node_modules/callsites/license create mode 100644 node_modules/callsites/package.json create mode 100644 node_modules/callsites/readme.md create mode 100644 node_modules/camelcase-keys/index.d.ts create mode 100644 node_modules/camelcase-keys/index.js create mode 100644 node_modules/camelcase-keys/license create mode 100644 node_modules/camelcase-keys/package.json create mode 100644 node_modules/camelcase-keys/readme.md create mode 100644 node_modules/camelcase/index.d.ts create mode 100644 node_modules/camelcase/index.js create mode 100644 node_modules/camelcase/license create mode 100644 node_modules/camelcase/package.json create mode 100644 node_modules/camelcase/readme.md create mode 100644 node_modules/chalk/index.js create mode 100644 node_modules/chalk/index.js.flow create mode 100644 node_modules/chalk/license create mode 100644 node_modules/chalk/package.json create mode 100644 node_modules/chalk/readme.md create mode 100644 node_modules/chalk/templates.js create mode 100644 node_modules/chalk/types/index.d.ts create mode 100644 node_modules/color-convert/CHANGELOG.md create mode 100644 node_modules/color-convert/LICENSE create mode 100644 node_modules/color-convert/README.md create mode 100644 node_modules/color-convert/conversions.js create mode 100644 node_modules/color-convert/index.js create mode 100644 node_modules/color-convert/package.json create mode 100644 node_modules/color-convert/route.js create mode 100644 node_modules/color-name/.eslintrc.json create mode 100644 node_modules/color-name/.npmignore create mode 100644 node_modules/color-name/LICENSE create mode 100644 node_modules/color-name/README.md create mode 100644 node_modules/color-name/index.js create mode 100644 node_modules/color-name/package.json create mode 100644 node_modules/color-name/test.js create mode 100644 node_modules/colord/CHANGELOG.md create mode 100644 node_modules/colord/LICENSE.md create mode 100644 node_modules/colord/README.md create mode 100644 node_modules/colord/colord.d.ts create mode 100644 node_modules/colord/constants.d.ts create mode 100644 node_modules/colord/extend.d.ts create mode 100644 node_modules/colord/helpers.d.ts create mode 100644 node_modules/colord/index.d.ts create mode 100644 node_modules/colord/index.js create mode 100644 node_modules/colord/index.mjs create mode 100644 node_modules/colord/package.json create mode 100644 node_modules/colord/parse.d.ts create mode 100644 node_modules/colord/plugins/a11y.d.ts create mode 100644 node_modules/colord/plugins/a11y.js create mode 100644 node_modules/colord/plugins/a11y.mjs create mode 100644 node_modules/colord/plugins/cmyk.d.ts create mode 100644 node_modules/colord/plugins/cmyk.js create mode 100644 node_modules/colord/plugins/cmyk.mjs create mode 100644 node_modules/colord/plugins/harmonies.d.ts create mode 100644 node_modules/colord/plugins/harmonies.js create mode 100644 node_modules/colord/plugins/harmonies.mjs create mode 100644 node_modules/colord/plugins/hwb.d.ts create mode 100644 node_modules/colord/plugins/hwb.js create mode 100644 node_modules/colord/plugins/hwb.mjs create mode 100644 node_modules/colord/plugins/lab.d.ts create mode 100644 node_modules/colord/plugins/lab.js create mode 100644 node_modules/colord/plugins/lab.mjs create mode 100644 node_modules/colord/plugins/lch.d.ts create mode 100644 node_modules/colord/plugins/lch.js create mode 100644 node_modules/colord/plugins/lch.mjs create mode 100644 node_modules/colord/plugins/minify.d.ts create mode 100644 node_modules/colord/plugins/minify.js create mode 100644 node_modules/colord/plugins/minify.mjs create mode 100644 node_modules/colord/plugins/mix.d.ts create mode 100644 node_modules/colord/plugins/mix.js create mode 100644 node_modules/colord/plugins/mix.mjs create mode 100644 node_modules/colord/plugins/names.d.ts create mode 100644 node_modules/colord/plugins/names.js create mode 100644 node_modules/colord/plugins/names.mjs create mode 100644 node_modules/colord/plugins/xyz.d.ts create mode 100644 node_modules/colord/plugins/xyz.js create mode 100644 node_modules/colord/plugins/xyz.mjs create mode 100644 node_modules/colord/random.d.ts create mode 100644 node_modules/colord/types.d.ts create mode 100644 node_modules/concat-map/.travis.yml create mode 100644 node_modules/concat-map/LICENSE create mode 100644 node_modules/concat-map/README.markdown create mode 100644 node_modules/concat-map/example/map.js create mode 100644 node_modules/concat-map/index.js create mode 100644 node_modules/concat-map/package.json create mode 100644 node_modules/concat-map/test/map.js create mode 100644 node_modules/cosmiconfig/LICENSE create mode 100644 node_modules/cosmiconfig/README.md create mode 100644 node_modules/cosmiconfig/dist/Explorer.d.ts create mode 100644 node_modules/cosmiconfig/dist/Explorer.d.ts.map create mode 100644 node_modules/cosmiconfig/dist/Explorer.js create mode 100644 node_modules/cosmiconfig/dist/Explorer.js.map create mode 100644 node_modules/cosmiconfig/dist/ExplorerBase.d.ts create mode 100644 node_modules/cosmiconfig/dist/ExplorerBase.d.ts.map create mode 100644 node_modules/cosmiconfig/dist/ExplorerBase.js create mode 100644 node_modules/cosmiconfig/dist/ExplorerBase.js.map create mode 100644 node_modules/cosmiconfig/dist/ExplorerSync.d.ts create mode 100644 node_modules/cosmiconfig/dist/ExplorerSync.d.ts.map create mode 100644 node_modules/cosmiconfig/dist/ExplorerSync.js create mode 100644 node_modules/cosmiconfig/dist/ExplorerSync.js.map create mode 100644 node_modules/cosmiconfig/dist/cacheWrapper.d.ts create mode 100644 node_modules/cosmiconfig/dist/cacheWrapper.d.ts.map create mode 100644 node_modules/cosmiconfig/dist/cacheWrapper.js create mode 100644 node_modules/cosmiconfig/dist/cacheWrapper.js.map create mode 100644 node_modules/cosmiconfig/dist/canUseDynamicImport.d.ts create mode 100644 node_modules/cosmiconfig/dist/canUseDynamicImport.d.ts.map create mode 100644 node_modules/cosmiconfig/dist/canUseDynamicImport.js create mode 100644 node_modules/cosmiconfig/dist/canUseDynamicImport.js.map create mode 100644 node_modules/cosmiconfig/dist/getDirectory.d.ts create mode 100644 node_modules/cosmiconfig/dist/getDirectory.d.ts.map create mode 100644 node_modules/cosmiconfig/dist/getDirectory.js create mode 100644 node_modules/cosmiconfig/dist/getDirectory.js.map create mode 100644 node_modules/cosmiconfig/dist/getPropertyByPath.d.ts create mode 100644 node_modules/cosmiconfig/dist/getPropertyByPath.d.ts.map create mode 100644 node_modules/cosmiconfig/dist/getPropertyByPath.js create mode 100644 node_modules/cosmiconfig/dist/getPropertyByPath.js.map create mode 100644 node_modules/cosmiconfig/dist/index.d.ts create mode 100644 node_modules/cosmiconfig/dist/index.d.ts.map create mode 100644 node_modules/cosmiconfig/dist/index.js create mode 100644 node_modules/cosmiconfig/dist/index.js.map create mode 100644 node_modules/cosmiconfig/dist/loaders.d.ts create mode 100644 node_modules/cosmiconfig/dist/loaders.d.ts.map create mode 100644 node_modules/cosmiconfig/dist/loaders.js create mode 100644 node_modules/cosmiconfig/dist/loaders.js.map create mode 100644 node_modules/cosmiconfig/dist/readFile.d.ts create mode 100644 node_modules/cosmiconfig/dist/readFile.d.ts.map create mode 100644 node_modules/cosmiconfig/dist/readFile.js create mode 100644 node_modules/cosmiconfig/dist/readFile.js.map create mode 100644 node_modules/cosmiconfig/dist/types.d.ts create mode 100644 node_modules/cosmiconfig/dist/types.d.ts.map create mode 100644 node_modules/cosmiconfig/dist/types.js create mode 100644 node_modules/cosmiconfig/dist/types.js.map create mode 100644 node_modules/cosmiconfig/package.json create mode 100644 node_modules/css-functions-list/CHANGELOG.md create mode 100644 node_modules/css-functions-list/LICENSE.md create mode 100644 node_modules/css-functions-list/README.md create mode 100644 node_modules/css-functions-list/cjs/index.d.ts create mode 100644 node_modules/css-functions-list/cjs/index.d.ts.map create mode 100644 node_modules/css-functions-list/cjs/index.js create mode 100644 node_modules/css-functions-list/cjs/index.js.map create mode 100644 node_modules/css-functions-list/cjs/index.json create mode 100644 node_modules/css-functions-list/cjs/package.json create mode 100644 node_modules/css-functions-list/esm/index.d.ts create mode 100644 node_modules/css-functions-list/esm/index.d.ts.map create mode 100644 node_modules/css-functions-list/esm/index.js create mode 100644 node_modules/css-functions-list/esm/index.js.map create mode 100644 node_modules/css-functions-list/esm/index.json create mode 100644 node_modules/css-functions-list/esm/package.json create mode 100644 node_modules/css-functions-list/package.json create mode 100644 node_modules/css-tree/LICENSE create mode 100644 node_modules/css-tree/README.md create mode 100644 node_modules/css-tree/cjs/convertor/create.cjs create mode 100644 node_modules/css-tree/cjs/convertor/index.cjs create mode 100644 node_modules/css-tree/cjs/data-patch.cjs create mode 100644 node_modules/css-tree/cjs/data.cjs create mode 100644 node_modules/css-tree/cjs/definition-syntax/SyntaxError.cjs create mode 100644 node_modules/css-tree/cjs/definition-syntax/generate.cjs create mode 100644 node_modules/css-tree/cjs/definition-syntax/index.cjs create mode 100644 node_modules/css-tree/cjs/definition-syntax/parse.cjs create mode 100644 node_modules/css-tree/cjs/definition-syntax/tokenizer.cjs create mode 100644 node_modules/css-tree/cjs/definition-syntax/walk.cjs create mode 100644 node_modules/css-tree/cjs/generator/create.cjs create mode 100644 node_modules/css-tree/cjs/generator/index.cjs create mode 100644 node_modules/css-tree/cjs/generator/sourceMap.cjs create mode 100644 node_modules/css-tree/cjs/generator/token-before.cjs create mode 100644 node_modules/css-tree/cjs/index.cjs create mode 100644 node_modules/css-tree/cjs/lexer/Lexer.cjs create mode 100644 node_modules/css-tree/cjs/lexer/error.cjs create mode 100644 node_modules/css-tree/cjs/lexer/generic-an-plus-b.cjs create mode 100644 node_modules/css-tree/cjs/lexer/generic-const.cjs create mode 100644 node_modules/css-tree/cjs/lexer/generic-urange.cjs create mode 100644 node_modules/css-tree/cjs/lexer/generic.cjs create mode 100644 node_modules/css-tree/cjs/lexer/index.cjs create mode 100644 node_modules/css-tree/cjs/lexer/match-graph.cjs create mode 100644 node_modules/css-tree/cjs/lexer/match.cjs create mode 100644 node_modules/css-tree/cjs/lexer/prepare-tokens.cjs create mode 100644 node_modules/css-tree/cjs/lexer/search.cjs create mode 100644 node_modules/css-tree/cjs/lexer/structure.cjs create mode 100644 node_modules/css-tree/cjs/lexer/trace.cjs create mode 100644 node_modules/css-tree/cjs/lexer/units.cjs create mode 100644 node_modules/css-tree/cjs/parser/SyntaxError.cjs create mode 100644 node_modules/css-tree/cjs/parser/create.cjs create mode 100644 node_modules/css-tree/cjs/parser/index.cjs create mode 100644 node_modules/css-tree/cjs/parser/parse-selector.cjs create mode 100644 node_modules/css-tree/cjs/parser/sequence.cjs create mode 100644 node_modules/css-tree/cjs/syntax/atrule/font-face.cjs create mode 100644 node_modules/css-tree/cjs/syntax/atrule/import.cjs create mode 100644 node_modules/css-tree/cjs/syntax/atrule/index.cjs create mode 100644 node_modules/css-tree/cjs/syntax/atrule/media.cjs create mode 100644 node_modules/css-tree/cjs/syntax/atrule/nest.cjs create mode 100644 node_modules/css-tree/cjs/syntax/atrule/page.cjs create mode 100644 node_modules/css-tree/cjs/syntax/atrule/supports.cjs create mode 100644 node_modules/css-tree/cjs/syntax/config/generator.cjs create mode 100644 node_modules/css-tree/cjs/syntax/config/lexer.cjs create mode 100644 node_modules/css-tree/cjs/syntax/config/mix.cjs create mode 100644 node_modules/css-tree/cjs/syntax/config/parser-selector.cjs create mode 100644 node_modules/css-tree/cjs/syntax/config/parser.cjs create mode 100644 node_modules/css-tree/cjs/syntax/config/walker.cjs create mode 100644 node_modules/css-tree/cjs/syntax/create.cjs create mode 100644 node_modules/css-tree/cjs/syntax/function/expression.cjs create mode 100644 node_modules/css-tree/cjs/syntax/function/var.cjs create mode 100644 node_modules/css-tree/cjs/syntax/index.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/AnPlusB.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Atrule.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/AtrulePrelude.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/AttributeSelector.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Block.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Brackets.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/CDC.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/CDO.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/ClassSelector.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Combinator.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Comment.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Condition.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Declaration.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/DeclarationList.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Dimension.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Feature.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/FeatureRange.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Function.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/GeneralEnclosed.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Hash.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/IdSelector.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Identifier.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/MediaCondition.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/MediaFeature.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/MediaFeatureRange.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/MediaQuery.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/MediaQueryList.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/NestingSelector.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Nth.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Number.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Operator.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Parentheses.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Percentage.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/PseudoClassSelector.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/PseudoElementSelector.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Ratio.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Raw.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Rule.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Selector.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/SelectorList.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/String.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/StyleSheet.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/TypeSelector.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/UnicodeRange.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Url.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/Value.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/WhiteSpace.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/common/feature-range.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/common/feature.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/index-generate.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/index-parse-selector.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/index-parse.cjs create mode 100644 node_modules/css-tree/cjs/syntax/node/index.cjs create mode 100644 node_modules/css-tree/cjs/syntax/pseudo/index.cjs create mode 100644 node_modules/css-tree/cjs/syntax/scope/atrulePrelude.cjs create mode 100644 node_modules/css-tree/cjs/syntax/scope/default.cjs create mode 100644 node_modules/css-tree/cjs/syntax/scope/index.cjs create mode 100644 node_modules/css-tree/cjs/syntax/scope/selector.cjs create mode 100644 node_modules/css-tree/cjs/syntax/scope/value.cjs create mode 100644 node_modules/css-tree/cjs/tokenizer/OffsetToLocation.cjs create mode 100644 node_modules/css-tree/cjs/tokenizer/TokenStream.cjs create mode 100644 node_modules/css-tree/cjs/tokenizer/adopt-buffer.cjs create mode 100644 node_modules/css-tree/cjs/tokenizer/char-code-definitions.cjs create mode 100644 node_modules/css-tree/cjs/tokenizer/index.cjs create mode 100644 node_modules/css-tree/cjs/tokenizer/names.cjs create mode 100644 node_modules/css-tree/cjs/tokenizer/types.cjs create mode 100644 node_modules/css-tree/cjs/tokenizer/utils.cjs create mode 100644 node_modules/css-tree/cjs/utils/List.cjs create mode 100644 node_modules/css-tree/cjs/utils/clone.cjs create mode 100644 node_modules/css-tree/cjs/utils/create-custom-error.cjs create mode 100644 node_modules/css-tree/cjs/utils/ident.cjs create mode 100644 node_modules/css-tree/cjs/utils/index.cjs create mode 100644 node_modules/css-tree/cjs/utils/names.cjs create mode 100644 node_modules/css-tree/cjs/utils/string.cjs create mode 100644 node_modules/css-tree/cjs/utils/url.cjs create mode 100644 node_modules/css-tree/cjs/version.cjs create mode 100644 node_modules/css-tree/cjs/walker/create.cjs create mode 100644 node_modules/css-tree/cjs/walker/index.cjs create mode 100644 node_modules/css-tree/data/patch.json create mode 100644 node_modules/css-tree/dist/csstree.esm.js create mode 100644 node_modules/css-tree/dist/csstree.js create mode 100644 node_modules/css-tree/dist/data.cjs create mode 100644 node_modules/css-tree/dist/data.js create mode 100644 node_modules/css-tree/dist/version.cjs create mode 100644 node_modules/css-tree/dist/version.js create mode 100644 node_modules/css-tree/lib/convertor/create.js create mode 100644 node_modules/css-tree/lib/convertor/index.js create mode 100644 node_modules/css-tree/lib/data-patch.js create mode 100755 node_modules/css-tree/lib/data.js create mode 100644 node_modules/css-tree/lib/definition-syntax/SyntaxError.js create mode 100644 node_modules/css-tree/lib/definition-syntax/generate.js create mode 100644 node_modules/css-tree/lib/definition-syntax/index.js create mode 100644 node_modules/css-tree/lib/definition-syntax/parse.js create mode 100644 node_modules/css-tree/lib/definition-syntax/tokenizer.js create mode 100644 node_modules/css-tree/lib/definition-syntax/walk.js create mode 100644 node_modules/css-tree/lib/generator/create.js create mode 100644 node_modules/css-tree/lib/generator/index.js create mode 100644 node_modules/css-tree/lib/generator/sourceMap.js create mode 100644 node_modules/css-tree/lib/generator/token-before.js create mode 100644 node_modules/css-tree/lib/index.js create mode 100644 node_modules/css-tree/lib/lexer/Lexer.js create mode 100644 node_modules/css-tree/lib/lexer/error.js create mode 100644 node_modules/css-tree/lib/lexer/generic-an-plus-b.js create mode 100644 node_modules/css-tree/lib/lexer/generic-const.js create mode 100644 node_modules/css-tree/lib/lexer/generic-urange.js create mode 100644 node_modules/css-tree/lib/lexer/generic.js create mode 100644 node_modules/css-tree/lib/lexer/index.js create mode 100644 node_modules/css-tree/lib/lexer/match-graph.js create mode 100644 node_modules/css-tree/lib/lexer/match.js create mode 100644 node_modules/css-tree/lib/lexer/prepare-tokens.js create mode 100644 node_modules/css-tree/lib/lexer/search.js create mode 100644 node_modules/css-tree/lib/lexer/structure.js create mode 100644 node_modules/css-tree/lib/lexer/trace.js create mode 100644 node_modules/css-tree/lib/lexer/units.js create mode 100644 node_modules/css-tree/lib/parser/SyntaxError.js create mode 100644 node_modules/css-tree/lib/parser/create.js create mode 100644 node_modules/css-tree/lib/parser/index.js create mode 100644 node_modules/css-tree/lib/parser/parse-selector.js create mode 100644 node_modules/css-tree/lib/parser/sequence.js create mode 100644 node_modules/css-tree/lib/syntax/atrule/font-face.js create mode 100644 node_modules/css-tree/lib/syntax/atrule/import.js create mode 100644 node_modules/css-tree/lib/syntax/atrule/index.js create mode 100644 node_modules/css-tree/lib/syntax/atrule/media.js create mode 100644 node_modules/css-tree/lib/syntax/atrule/nest.js create mode 100644 node_modules/css-tree/lib/syntax/atrule/page.js create mode 100644 node_modules/css-tree/lib/syntax/atrule/supports.js create mode 100644 node_modules/css-tree/lib/syntax/config/generator.js create mode 100644 node_modules/css-tree/lib/syntax/config/lexer.js create mode 100644 node_modules/css-tree/lib/syntax/config/mix.js create mode 100644 node_modules/css-tree/lib/syntax/config/parser-selector.js create mode 100644 node_modules/css-tree/lib/syntax/config/parser.js create mode 100644 node_modules/css-tree/lib/syntax/config/walker.js create mode 100644 node_modules/css-tree/lib/syntax/create.js create mode 100644 node_modules/css-tree/lib/syntax/function/expression.js create mode 100644 node_modules/css-tree/lib/syntax/function/var.js create mode 100644 node_modules/css-tree/lib/syntax/index.js create mode 100644 node_modules/css-tree/lib/syntax/node/AnPlusB.js create mode 100644 node_modules/css-tree/lib/syntax/node/Atrule.js create mode 100644 node_modules/css-tree/lib/syntax/node/AtrulePrelude.js create mode 100644 node_modules/css-tree/lib/syntax/node/AttributeSelector.js create mode 100644 node_modules/css-tree/lib/syntax/node/Block.js create mode 100644 node_modules/css-tree/lib/syntax/node/Brackets.js create mode 100644 node_modules/css-tree/lib/syntax/node/CDC.js create mode 100644 node_modules/css-tree/lib/syntax/node/CDO.js create mode 100644 node_modules/css-tree/lib/syntax/node/ClassSelector.js create mode 100644 node_modules/css-tree/lib/syntax/node/Combinator.js create mode 100644 node_modules/css-tree/lib/syntax/node/Comment.js create mode 100644 node_modules/css-tree/lib/syntax/node/Declaration.js create mode 100644 node_modules/css-tree/lib/syntax/node/DeclarationList.js create mode 100644 node_modules/css-tree/lib/syntax/node/Dimension.js create mode 100644 node_modules/css-tree/lib/syntax/node/Function.js create mode 100644 node_modules/css-tree/lib/syntax/node/Hash.js create mode 100644 node_modules/css-tree/lib/syntax/node/IdSelector.js create mode 100644 node_modules/css-tree/lib/syntax/node/Identifier.js create mode 100644 node_modules/css-tree/lib/syntax/node/MediaFeature.js create mode 100644 node_modules/css-tree/lib/syntax/node/MediaQuery.js create mode 100644 node_modules/css-tree/lib/syntax/node/MediaQueryList.js create mode 100644 node_modules/css-tree/lib/syntax/node/NestingSelector.js create mode 100644 node_modules/css-tree/lib/syntax/node/Nth.js create mode 100644 node_modules/css-tree/lib/syntax/node/Number.js create mode 100644 node_modules/css-tree/lib/syntax/node/Operator.js create mode 100644 node_modules/css-tree/lib/syntax/node/Parentheses.js create mode 100644 node_modules/css-tree/lib/syntax/node/Percentage.js create mode 100644 node_modules/css-tree/lib/syntax/node/PseudoClassSelector.js create mode 100644 node_modules/css-tree/lib/syntax/node/PseudoElementSelector.js create mode 100644 node_modules/css-tree/lib/syntax/node/Ratio.js create mode 100644 node_modules/css-tree/lib/syntax/node/Raw.js create mode 100644 node_modules/css-tree/lib/syntax/node/Rule.js create mode 100644 node_modules/css-tree/lib/syntax/node/Selector.js create mode 100644 node_modules/css-tree/lib/syntax/node/SelectorList.js create mode 100644 node_modules/css-tree/lib/syntax/node/String.js create mode 100644 node_modules/css-tree/lib/syntax/node/StyleSheet.js create mode 100644 node_modules/css-tree/lib/syntax/node/TypeSelector.js create mode 100644 node_modules/css-tree/lib/syntax/node/UnicodeRange.js create mode 100644 node_modules/css-tree/lib/syntax/node/Url.js create mode 100644 node_modules/css-tree/lib/syntax/node/Value.js create mode 100644 node_modules/css-tree/lib/syntax/node/WhiteSpace.js create mode 100644 node_modules/css-tree/lib/syntax/node/index-generate.js create mode 100644 node_modules/css-tree/lib/syntax/node/index-parse-selector.js create mode 100644 node_modules/css-tree/lib/syntax/node/index-parse.js create mode 100644 node_modules/css-tree/lib/syntax/node/index.js create mode 100644 node_modules/css-tree/lib/syntax/pseudo/index.js create mode 100644 node_modules/css-tree/lib/syntax/scope/atrulePrelude.js create mode 100644 node_modules/css-tree/lib/syntax/scope/default.js create mode 100644 node_modules/css-tree/lib/syntax/scope/index.js create mode 100644 node_modules/css-tree/lib/syntax/scope/selector.js create mode 100644 node_modules/css-tree/lib/syntax/scope/value.js create mode 100644 node_modules/css-tree/lib/tokenizer/OffsetToLocation.js create mode 100644 node_modules/css-tree/lib/tokenizer/TokenStream.js create mode 100644 node_modules/css-tree/lib/tokenizer/adopt-buffer.js create mode 100644 node_modules/css-tree/lib/tokenizer/char-code-definitions.js create mode 100644 node_modules/css-tree/lib/tokenizer/index.js create mode 100644 node_modules/css-tree/lib/tokenizer/names.js create mode 100644 node_modules/css-tree/lib/tokenizer/types.js create mode 100644 node_modules/css-tree/lib/tokenizer/utils.js create mode 100644 node_modules/css-tree/lib/utils/List.js create mode 100644 node_modules/css-tree/lib/utils/clone.js create mode 100644 node_modules/css-tree/lib/utils/create-custom-error.js create mode 100644 node_modules/css-tree/lib/utils/ident.js create mode 100644 node_modules/css-tree/lib/utils/index.js create mode 100644 node_modules/css-tree/lib/utils/names.js create mode 100644 node_modules/css-tree/lib/utils/string.js create mode 100644 node_modules/css-tree/lib/utils/url.js create mode 100644 node_modules/css-tree/lib/version.js create mode 100644 node_modules/css-tree/lib/walker/create.js create mode 100644 node_modules/css-tree/lib/walker/index.js create mode 100644 node_modules/css-tree/package.json create mode 100644 node_modules/cssesc/LICENSE-MIT.txt create mode 100644 node_modules/cssesc/README.md create mode 100755 node_modules/cssesc/bin/cssesc create mode 100644 node_modules/cssesc/cssesc.js create mode 100644 node_modules/cssesc/man/cssesc.1 create mode 100644 node_modules/cssesc/package.json create mode 100644 node_modules/debug/LICENSE create mode 100644 node_modules/debug/README.md create mode 100644 node_modules/debug/package.json create mode 100644 node_modules/debug/src/browser.js create mode 100644 node_modules/debug/src/common.js create mode 100644 node_modules/debug/src/index.js create mode 100644 node_modules/debug/src/node.js create mode 100644 node_modules/decamelize-keys/index.js create mode 100644 node_modules/decamelize-keys/license create mode 100644 node_modules/decamelize-keys/node_modules/decamelize/index.js create mode 100644 node_modules/decamelize-keys/node_modules/decamelize/license create mode 100644 node_modules/decamelize-keys/node_modules/decamelize/package.json create mode 100644 node_modules/decamelize-keys/node_modules/decamelize/readme.md create mode 100644 node_modules/decamelize-keys/node_modules/map-obj/index.js create mode 100644 node_modules/decamelize-keys/node_modules/map-obj/license create mode 100644 node_modules/decamelize-keys/node_modules/map-obj/package.json create mode 100644 node_modules/decamelize-keys/node_modules/map-obj/readme.md create mode 100644 node_modules/decamelize-keys/package.json create mode 100644 node_modules/decamelize-keys/readme.md create mode 100644 node_modules/decamelize/index.d.ts create mode 100644 node_modules/decamelize/index.js create mode 100644 node_modules/decamelize/license create mode 100644 node_modules/decamelize/package.json create mode 100644 node_modules/decamelize/readme.md create mode 100644 node_modules/dir-glob/index.js create mode 100644 node_modules/dir-glob/license create mode 100644 node_modules/dir-glob/package.json create mode 100644 node_modules/dir-glob/readme.md create mode 100644 node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/emoji-regex/README.md create mode 100644 node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/emoji-regex/index.js create mode 100644 node_modules/emoji-regex/package.json create mode 100644 node_modules/emoji-regex/text.js create mode 100644 node_modules/error-ex/LICENSE create mode 100644 node_modules/error-ex/README.md create mode 100644 node_modules/error-ex/index.js create mode 100644 node_modules/error-ex/package.json create mode 100644 node_modules/escape-string-regexp/index.js create mode 100644 node_modules/escape-string-regexp/license create mode 100644 node_modules/escape-string-regexp/package.json create mode 100644 node_modules/escape-string-regexp/readme.md create mode 100644 node_modules/fast-deep-equal/LICENSE create mode 100644 node_modules/fast-deep-equal/README.md create mode 100644 node_modules/fast-deep-equal/es6/index.d.ts create mode 100644 node_modules/fast-deep-equal/es6/index.js create mode 100644 node_modules/fast-deep-equal/es6/react.d.ts create mode 100644 node_modules/fast-deep-equal/es6/react.js create mode 100644 node_modules/fast-deep-equal/index.d.ts create mode 100644 node_modules/fast-deep-equal/index.js create mode 100644 node_modules/fast-deep-equal/package.json create mode 100644 node_modules/fast-deep-equal/react.d.ts create mode 100644 node_modules/fast-deep-equal/react.js create mode 100644 node_modules/fast-glob/LICENSE create mode 100644 node_modules/fast-glob/README.md create mode 100644 node_modules/fast-glob/out/index.d.ts create mode 100644 node_modules/fast-glob/out/index.js create mode 100644 node_modules/fast-glob/out/managers/tasks.d.ts create mode 100644 node_modules/fast-glob/out/managers/tasks.js create mode 100644 node_modules/fast-glob/out/providers/async.d.ts create mode 100644 node_modules/fast-glob/out/providers/async.js create mode 100644 node_modules/fast-glob/out/providers/filters/deep.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/deep.js create mode 100644 node_modules/fast-glob/out/providers/filters/entry.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/entry.js create mode 100644 node_modules/fast-glob/out/providers/filters/error.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/error.js create mode 100644 node_modules/fast-glob/out/providers/matchers/matcher.d.ts create mode 100644 node_modules/fast-glob/out/providers/matchers/matcher.js create mode 100644 node_modules/fast-glob/out/providers/matchers/partial.d.ts create mode 100644 node_modules/fast-glob/out/providers/matchers/partial.js create mode 100644 node_modules/fast-glob/out/providers/provider.d.ts create mode 100644 node_modules/fast-glob/out/providers/provider.js create mode 100644 node_modules/fast-glob/out/providers/stream.d.ts create mode 100644 node_modules/fast-glob/out/providers/stream.js create mode 100644 node_modules/fast-glob/out/providers/sync.d.ts create mode 100644 node_modules/fast-glob/out/providers/sync.js create mode 100644 node_modules/fast-glob/out/providers/transformers/entry.d.ts create mode 100644 node_modules/fast-glob/out/providers/transformers/entry.js create mode 100644 node_modules/fast-glob/out/readers/async.d.ts create mode 100644 node_modules/fast-glob/out/readers/async.js create mode 100644 node_modules/fast-glob/out/readers/reader.d.ts create mode 100644 node_modules/fast-glob/out/readers/reader.js create mode 100644 node_modules/fast-glob/out/readers/stream.d.ts create mode 100644 node_modules/fast-glob/out/readers/stream.js create mode 100644 node_modules/fast-glob/out/readers/sync.d.ts create mode 100644 node_modules/fast-glob/out/readers/sync.js create mode 100644 node_modules/fast-glob/out/settings.d.ts create mode 100644 node_modules/fast-glob/out/settings.js create mode 100644 node_modules/fast-glob/out/types/index.d.ts create mode 100644 node_modules/fast-glob/out/types/index.js create mode 100644 node_modules/fast-glob/out/utils/array.d.ts create mode 100644 node_modules/fast-glob/out/utils/array.js create mode 100644 node_modules/fast-glob/out/utils/errno.d.ts create mode 100644 node_modules/fast-glob/out/utils/errno.js create mode 100644 node_modules/fast-glob/out/utils/fs.d.ts create mode 100644 node_modules/fast-glob/out/utils/fs.js create mode 100644 node_modules/fast-glob/out/utils/index.d.ts create mode 100644 node_modules/fast-glob/out/utils/index.js create mode 100644 node_modules/fast-glob/out/utils/path.d.ts create mode 100644 node_modules/fast-glob/out/utils/path.js create mode 100644 node_modules/fast-glob/out/utils/pattern.d.ts create mode 100644 node_modules/fast-glob/out/utils/pattern.js create mode 100644 node_modules/fast-glob/out/utils/stream.d.ts create mode 100644 node_modules/fast-glob/out/utils/stream.js create mode 100644 node_modules/fast-glob/out/utils/string.d.ts create mode 100644 node_modules/fast-glob/out/utils/string.js create mode 100644 node_modules/fast-glob/package.json create mode 100644 node_modules/fastest-levenshtein/.eslintrc.json create mode 100644 node_modules/fastest-levenshtein/.prettierrc create mode 100644 node_modules/fastest-levenshtein/.travis.yml create mode 100644 node_modules/fastest-levenshtein/LICENSE.md create mode 100644 node_modules/fastest-levenshtein/README.md create mode 100644 node_modules/fastest-levenshtein/bench.js create mode 100644 node_modules/fastest-levenshtein/esm/mod.d.ts create mode 100644 node_modules/fastest-levenshtein/esm/mod.d.ts.map create mode 100644 node_modules/fastest-levenshtein/esm/mod.js create mode 100644 node_modules/fastest-levenshtein/mod.d.ts create mode 100644 node_modules/fastest-levenshtein/mod.js create mode 100644 node_modules/fastest-levenshtein/package.json create mode 100644 node_modules/fastest-levenshtein/test.js create mode 100644 node_modules/fastest-levenshtein/test.ts create mode 100644 node_modules/fastq/.github/dependabot.yml create mode 100644 node_modules/fastq/.github/workflows/ci.yml create mode 100644 node_modules/fastq/LICENSE create mode 100644 node_modules/fastq/README.md create mode 100644 node_modules/fastq/bench.js create mode 100644 node_modules/fastq/example.js create mode 100644 node_modules/fastq/example.mjs create mode 100644 node_modules/fastq/index.d.ts create mode 100644 node_modules/fastq/package.json create mode 100644 node_modules/fastq/queue.js create mode 100644 node_modules/fastq/test/example.ts create mode 100644 node_modules/fastq/test/promise.js create mode 100644 node_modules/fastq/test/test.js create mode 100644 node_modules/fastq/test/tsconfig.json create mode 100644 node_modules/file-entry-cache/LICENSE create mode 100644 node_modules/file-entry-cache/README.md create mode 100644 node_modules/file-entry-cache/cache.js create mode 100644 node_modules/file-entry-cache/changelog.md create mode 100644 node_modules/file-entry-cache/package.json create mode 100644 node_modules/fill-range/LICENSE create mode 100644 node_modules/fill-range/README.md create mode 100644 node_modules/fill-range/index.js create mode 100644 node_modules/fill-range/package.json create mode 100644 node_modules/find-up/index.d.ts create mode 100644 node_modules/find-up/index.js create mode 100644 node_modules/find-up/license create mode 100644 node_modules/find-up/package.json create mode 100644 node_modules/find-up/readme.md create mode 100644 node_modules/flat-cache/LICENSE create mode 100644 node_modules/flat-cache/README.md create mode 100644 node_modules/flat-cache/changelog.md create mode 100644 node_modules/flat-cache/package.json create mode 100644 node_modules/flat-cache/src/cache.js create mode 100644 node_modules/flat-cache/src/del.js create mode 100644 node_modules/flat-cache/src/utils.js create mode 100644 node_modules/flatted/LICENSE create mode 100644 node_modules/flatted/README.md create mode 100644 node_modules/flatted/cjs/index.js create mode 100644 node_modules/flatted/cjs/package.json create mode 100644 node_modules/flatted/es.js create mode 100644 node_modules/flatted/esm.js create mode 100644 node_modules/flatted/esm/index.js create mode 100644 node_modules/flatted/index.js create mode 100644 node_modules/flatted/min.js create mode 100644 node_modules/flatted/package.json create mode 100644 node_modules/flatted/php/flatted.php create mode 100644 node_modules/flatted/types.d.ts create mode 100644 node_modules/fs.realpath/LICENSE create mode 100644 node_modules/fs.realpath/README.md create mode 100644 node_modules/fs.realpath/index.js create mode 100644 node_modules/fs.realpath/old.js create mode 100644 node_modules/fs.realpath/package.json create mode 100644 node_modules/function-bind/.editorconfig create mode 100644 node_modules/function-bind/.eslintrc create mode 100644 node_modules/function-bind/.jscs.json create mode 100644 node_modules/function-bind/.npmignore create mode 100644 node_modules/function-bind/.travis.yml create mode 100644 node_modules/function-bind/LICENSE create mode 100644 node_modules/function-bind/README.md create mode 100644 node_modules/function-bind/implementation.js create mode 100644 node_modules/function-bind/index.js create mode 100644 node_modules/function-bind/package.json create mode 100644 node_modules/function-bind/test/.eslintrc create mode 100644 node_modules/function-bind/test/index.js create mode 100644 node_modules/glob-parent/CHANGELOG.md create mode 100644 node_modules/glob-parent/LICENSE create mode 100644 node_modules/glob-parent/README.md create mode 100644 node_modules/glob-parent/index.js create mode 100644 node_modules/glob-parent/package.json create mode 100644 node_modules/glob/LICENSE create mode 100644 node_modules/glob/README.md create mode 100644 node_modules/glob/common.js create mode 100644 node_modules/glob/glob.js create mode 100644 node_modules/glob/package.json create mode 100644 node_modules/glob/sync.js create mode 100644 node_modules/global-modules/LICENSE create mode 100644 node_modules/global-modules/README.md create mode 100644 node_modules/global-modules/index.js create mode 100644 node_modules/global-modules/package.json create mode 100644 node_modules/global-prefix/LICENSE create mode 100644 node_modules/global-prefix/README.md create mode 100644 node_modules/global-prefix/index.js create mode 100644 node_modules/global-prefix/package.json create mode 100644 node_modules/globby/gitignore.js create mode 100644 node_modules/globby/index.d.ts create mode 100644 node_modules/globby/index.js create mode 100644 node_modules/globby/license create mode 100644 node_modules/globby/package.json create mode 100644 node_modules/globby/readme.md create mode 100644 node_modules/globby/stream-utils.js create mode 100644 node_modules/globjoin/CHANGELOG.md create mode 100644 node_modules/globjoin/LICENSE create mode 100644 node_modules/globjoin/README.md create mode 100644 node_modules/globjoin/index.js create mode 100644 node_modules/globjoin/package.json create mode 100644 node_modules/hard-rejection/index.d.ts create mode 100644 node_modules/hard-rejection/index.js create mode 100644 node_modules/hard-rejection/license create mode 100644 node_modules/hard-rejection/package.json create mode 100644 node_modules/hard-rejection/readme.md create mode 100644 node_modules/hard-rejection/register.js create mode 100644 node_modules/has-flag/index.js create mode 100644 node_modules/has-flag/license create mode 100644 node_modules/has-flag/package.json create mode 100644 node_modules/has-flag/readme.md create mode 100644 node_modules/has/LICENSE-MIT create mode 100644 node_modules/has/README.md create mode 100644 node_modules/has/package.json create mode 100644 node_modules/has/src/index.js create mode 100644 node_modules/has/test/index.js create mode 100644 node_modules/hosted-git-info/LICENSE create mode 100644 node_modules/hosted-git-info/README.md create mode 100644 node_modules/hosted-git-info/git-host-info.js create mode 100644 node_modules/hosted-git-info/git-host.js create mode 100644 node_modules/hosted-git-info/index.js create mode 100644 node_modules/hosted-git-info/package.json create mode 100644 node_modules/html-tags/html-tags-void.json create mode 100644 node_modules/html-tags/html-tags.json create mode 100644 node_modules/html-tags/index.d.ts create mode 100644 node_modules/html-tags/index.js create mode 100644 node_modules/html-tags/license create mode 100644 node_modules/html-tags/package.json create mode 100644 node_modules/html-tags/readme.md create mode 100644 node_modules/html-tags/void.d.ts create mode 100644 node_modules/html-tags/void.js create mode 100644 node_modules/ignore/LICENSE-MIT create mode 100644 node_modules/ignore/README.md create mode 100644 node_modules/ignore/index.d.ts create mode 100644 node_modules/ignore/index.js create mode 100644 node_modules/ignore/legacy.js create mode 100644 node_modules/ignore/package.json create mode 100644 node_modules/import-fresh/index.d.ts create mode 100644 node_modules/import-fresh/index.js create mode 100644 node_modules/import-fresh/license create mode 100644 node_modules/import-fresh/node_modules/resolve-from/index.js create mode 100644 node_modules/import-fresh/node_modules/resolve-from/license create mode 100644 node_modules/import-fresh/node_modules/resolve-from/package.json create mode 100644 node_modules/import-fresh/node_modules/resolve-from/readme.md create mode 100644 node_modules/import-fresh/package.json create mode 100644 node_modules/import-fresh/readme.md create mode 100644 node_modules/import-lazy/index.d.ts create mode 100644 node_modules/import-lazy/index.js create mode 100644 node_modules/import-lazy/license create mode 100644 node_modules/import-lazy/package.json create mode 100644 node_modules/import-lazy/readme.md create mode 100644 node_modules/imurmurhash/README.md create mode 100644 node_modules/imurmurhash/imurmurhash.js create mode 100644 node_modules/imurmurhash/imurmurhash.min.js create mode 100644 node_modules/imurmurhash/package.json create mode 100644 node_modules/indent-string/index.d.ts create mode 100644 node_modules/indent-string/index.js create mode 100644 node_modules/indent-string/license create mode 100644 node_modules/indent-string/package.json create mode 100644 node_modules/indent-string/readme.md create mode 100644 node_modules/inflight/LICENSE create mode 100644 node_modules/inflight/README.md create mode 100644 node_modules/inflight/inflight.js create mode 100644 node_modules/inflight/package.json create mode 100644 node_modules/inherits/LICENSE create mode 100644 node_modules/inherits/README.md create mode 100644 node_modules/inherits/inherits.js create mode 100644 node_modules/inherits/inherits_browser.js create mode 100644 node_modules/inherits/package.json create mode 100644 node_modules/ini/LICENSE create mode 100644 node_modules/ini/README.md create mode 100644 node_modules/ini/ini.js create mode 100644 node_modules/ini/package.json create mode 100644 node_modules/is-arrayish/.editorconfig create mode 100644 node_modules/is-arrayish/.istanbul.yml create mode 100644 node_modules/is-arrayish/.npmignore create mode 100644 node_modules/is-arrayish/.travis.yml create mode 100644 node_modules/is-arrayish/LICENSE create mode 100644 node_modules/is-arrayish/README.md create mode 100644 node_modules/is-arrayish/index.js create mode 100644 node_modules/is-arrayish/package.json create mode 100644 node_modules/is-core-module/.eslintrc create mode 100644 node_modules/is-core-module/.nycrc create mode 100644 node_modules/is-core-module/CHANGELOG.md create mode 100644 node_modules/is-core-module/LICENSE create mode 100644 node_modules/is-core-module/README.md create mode 100644 node_modules/is-core-module/core.json create mode 100644 node_modules/is-core-module/index.js create mode 100644 node_modules/is-core-module/package.json create mode 100644 node_modules/is-core-module/test/index.js create mode 100644 node_modules/is-extglob/LICENSE create mode 100644 node_modules/is-extglob/README.md create mode 100644 node_modules/is-extglob/index.js create mode 100644 node_modules/is-extglob/package.json create mode 100644 node_modules/is-fullwidth-code-point/index.d.ts create mode 100644 node_modules/is-fullwidth-code-point/index.js create mode 100644 node_modules/is-fullwidth-code-point/license create mode 100644 node_modules/is-fullwidth-code-point/package.json create mode 100644 node_modules/is-fullwidth-code-point/readme.md create mode 100644 node_modules/is-glob/LICENSE create mode 100644 node_modules/is-glob/README.md create mode 100644 node_modules/is-glob/index.js create mode 100644 node_modules/is-glob/package.json create mode 100644 node_modules/is-number/LICENSE create mode 100644 node_modules/is-number/README.md create mode 100644 node_modules/is-number/index.js create mode 100644 node_modules/is-number/package.json create mode 100644 node_modules/is-plain-obj/index.js create mode 100644 node_modules/is-plain-obj/license create mode 100644 node_modules/is-plain-obj/package.json create mode 100644 node_modules/is-plain-obj/readme.md create mode 100644 node_modules/is-plain-object/LICENSE create mode 100644 node_modules/is-plain-object/README.md create mode 100644 node_modules/is-plain-object/dist/is-plain-object.js create mode 100644 node_modules/is-plain-object/dist/is-plain-object.mjs create mode 100644 node_modules/is-plain-object/is-plain-object.d.ts create mode 100644 node_modules/is-plain-object/package.json create mode 100644 node_modules/isexe/.npmignore create mode 100644 node_modules/isexe/LICENSE create mode 100644 node_modules/isexe/README.md create mode 100644 node_modules/isexe/index.js create mode 100644 node_modules/isexe/mode.js create mode 100644 node_modules/isexe/package.json create mode 100644 node_modules/isexe/test/basic.js create mode 100644 node_modules/isexe/windows.js create mode 100644 node_modules/js-tokens/CHANGELOG.md create mode 100644 node_modules/js-tokens/LICENSE create mode 100644 node_modules/js-tokens/README.md create mode 100644 node_modules/js-tokens/index.js create mode 100644 node_modules/js-tokens/package.json create mode 100644 node_modules/js-yaml/CHANGELOG.md create mode 100644 node_modules/js-yaml/LICENSE create mode 100644 node_modules/js-yaml/README.md create mode 100755 node_modules/js-yaml/bin/js-yaml.js create mode 100644 node_modules/js-yaml/dist/js-yaml.js create mode 100644 node_modules/js-yaml/dist/js-yaml.min.js create mode 100644 node_modules/js-yaml/dist/js-yaml.mjs create mode 100644 node_modules/js-yaml/index.js create mode 100644 node_modules/js-yaml/lib/common.js create mode 100644 node_modules/js-yaml/lib/dumper.js create mode 100644 node_modules/js-yaml/lib/exception.js create mode 100644 node_modules/js-yaml/lib/loader.js create mode 100644 node_modules/js-yaml/lib/schema.js create mode 100644 node_modules/js-yaml/lib/schema/core.js create mode 100644 node_modules/js-yaml/lib/schema/default.js create mode 100644 node_modules/js-yaml/lib/schema/failsafe.js create mode 100644 node_modules/js-yaml/lib/schema/json.js create mode 100644 node_modules/js-yaml/lib/snippet.js create mode 100644 node_modules/js-yaml/lib/type.js create mode 100644 node_modules/js-yaml/lib/type/binary.js create mode 100644 node_modules/js-yaml/lib/type/bool.js create mode 100644 node_modules/js-yaml/lib/type/float.js create mode 100644 node_modules/js-yaml/lib/type/int.js create mode 100644 node_modules/js-yaml/lib/type/map.js create mode 100644 node_modules/js-yaml/lib/type/merge.js create mode 100644 node_modules/js-yaml/lib/type/null.js create mode 100644 node_modules/js-yaml/lib/type/omap.js create mode 100644 node_modules/js-yaml/lib/type/pairs.js create mode 100644 node_modules/js-yaml/lib/type/seq.js create mode 100644 node_modules/js-yaml/lib/type/set.js create mode 100644 node_modules/js-yaml/lib/type/str.js create mode 100644 node_modules/js-yaml/lib/type/timestamp.js create mode 100644 node_modules/js-yaml/package.json create mode 100644 node_modules/json-parse-even-better-errors/CHANGELOG.md create mode 100644 node_modules/json-parse-even-better-errors/LICENSE.md create mode 100644 node_modules/json-parse-even-better-errors/README.md create mode 100644 node_modules/json-parse-even-better-errors/index.js create mode 100644 node_modules/json-parse-even-better-errors/package.json create mode 100644 node_modules/json-schema-traverse/.eslintrc.yml create mode 100644 node_modules/json-schema-traverse/.github/FUNDING.yml create mode 100644 node_modules/json-schema-traverse/.github/workflows/build.yml create mode 100644 node_modules/json-schema-traverse/.github/workflows/publish.yml create mode 100644 node_modules/json-schema-traverse/LICENSE create mode 100644 node_modules/json-schema-traverse/README.md create mode 100644 node_modules/json-schema-traverse/index.d.ts create mode 100644 node_modules/json-schema-traverse/index.js create mode 100644 node_modules/json-schema-traverse/package.json create mode 100644 node_modules/json-schema-traverse/spec/.eslintrc.yml create mode 100644 node_modules/json-schema-traverse/spec/fixtures/schema.js create mode 100644 node_modules/json-schema-traverse/spec/index.spec.js create mode 100644 node_modules/kind-of/CHANGELOG.md create mode 100644 node_modules/kind-of/LICENSE create mode 100644 node_modules/kind-of/README.md create mode 100644 node_modules/kind-of/index.js create mode 100644 node_modules/kind-of/package.json create mode 100644 node_modules/known-css-properties/LICENSE create mode 100644 node_modules/known-css-properties/README.md create mode 100644 node_modules/known-css-properties/data/all.json create mode 100644 node_modules/known-css-properties/index.d.ts create mode 100644 node_modules/known-css-properties/index.js create mode 100644 node_modules/known-css-properties/package.json create mode 100644 node_modules/lines-and-columns/LICENSE create mode 100644 node_modules/lines-and-columns/README.md create mode 100644 node_modules/lines-and-columns/build/index.d.ts create mode 100644 node_modules/lines-and-columns/build/index.js create mode 100644 node_modules/lines-and-columns/package.json create mode 100644 node_modules/locate-path/index.d.ts create mode 100644 node_modules/locate-path/index.js create mode 100644 node_modules/locate-path/license create mode 100644 node_modules/locate-path/package.json create mode 100644 node_modules/locate-path/readme.md create mode 100644 node_modules/lodash.truncate/LICENSE create mode 100644 node_modules/lodash.truncate/README.md create mode 100644 node_modules/lodash.truncate/index.js create mode 100644 node_modules/lodash.truncate/package.json create mode 100644 node_modules/lru-cache/LICENSE create mode 100644 node_modules/lru-cache/README.md create mode 100644 node_modules/lru-cache/index.js create mode 100644 node_modules/lru-cache/package.json create mode 100644 node_modules/map-obj/index.d.ts create mode 100644 node_modules/map-obj/index.js create mode 100644 node_modules/map-obj/license create mode 100644 node_modules/map-obj/package.json create mode 100644 node_modules/map-obj/readme.md create mode 100644 node_modules/mathml-tag-names/index.json create mode 100644 node_modules/mathml-tag-names/license create mode 100644 node_modules/mathml-tag-names/package.json create mode 100644 node_modules/mathml-tag-names/readme.md create mode 100644 node_modules/mdn-data/CHANGELOG.md create mode 100644 node_modules/mdn-data/LICENSE create mode 100644 node_modules/mdn-data/README.md create mode 100644 node_modules/mdn-data/api/index.js create mode 100644 node_modules/mdn-data/api/inheritance.json create mode 100644 node_modules/mdn-data/api/inheritance.schema.json create mode 100644 node_modules/mdn-data/css/at-rules.json create mode 100644 node_modules/mdn-data/css/at-rules.schema.json create mode 100644 node_modules/mdn-data/css/definitions.json create mode 100644 node_modules/mdn-data/css/index.js create mode 100644 node_modules/mdn-data/css/properties.json create mode 100644 node_modules/mdn-data/css/properties.schema.json create mode 100644 node_modules/mdn-data/css/readme.md create mode 100644 node_modules/mdn-data/css/selectors.json create mode 100644 node_modules/mdn-data/css/selectors.schema.json create mode 100644 node_modules/mdn-data/css/syntaxes.json create mode 100644 node_modules/mdn-data/css/syntaxes.schema.json create mode 100644 node_modules/mdn-data/css/types.json create mode 100644 node_modules/mdn-data/css/types.schema.json create mode 100644 node_modules/mdn-data/css/units.json create mode 100644 node_modules/mdn-data/css/units.schema.json create mode 100644 node_modules/mdn-data/index.js create mode 100644 node_modules/mdn-data/l10n/css.json create mode 100644 node_modules/mdn-data/l10n/index.js create mode 100644 node_modules/mdn-data/package.json create mode 100644 node_modules/meow/index.d.ts create mode 100644 node_modules/meow/index.js create mode 100644 node_modules/meow/license create mode 100644 node_modules/meow/package.json create mode 100644 node_modules/meow/readme.md create mode 100644 node_modules/merge2/LICENSE create mode 100644 node_modules/merge2/README.md create mode 100644 node_modules/merge2/index.js create mode 100644 node_modules/merge2/package.json create mode 100755 node_modules/micromatch/LICENSE create mode 100644 node_modules/micromatch/README.md create mode 100644 node_modules/micromatch/index.js create mode 100644 node_modules/micromatch/package.json create mode 100644 node_modules/min-indent/index.js create mode 100644 node_modules/min-indent/license create mode 100644 node_modules/min-indent/package.json create mode 100644 node_modules/min-indent/readme.md create mode 100644 node_modules/minimatch/LICENSE create mode 100644 node_modules/minimatch/README.md create mode 100644 node_modules/minimatch/minimatch.js create mode 100644 node_modules/minimatch/package.json create mode 100644 node_modules/minimist-options/index.d.ts create mode 100644 node_modules/minimist-options/index.js create mode 100644 node_modules/minimist-options/license create mode 100644 node_modules/minimist-options/package.json create mode 100644 node_modules/minimist-options/readme.md create mode 100644 node_modules/ms/index.js create mode 100644 node_modules/ms/license.md create mode 100644 node_modules/ms/package.json create mode 100644 node_modules/ms/readme.md create mode 100644 node_modules/nanoid/LICENSE create mode 100644 node_modules/nanoid/README.md create mode 100644 node_modules/nanoid/async/index.browser.cjs create mode 100644 node_modules/nanoid/async/index.browser.js create mode 100644 node_modules/nanoid/async/index.cjs create mode 100644 node_modules/nanoid/async/index.d.ts create mode 100644 node_modules/nanoid/async/index.js create mode 100644 node_modules/nanoid/async/index.native.js create mode 100644 node_modules/nanoid/async/package.json create mode 100755 node_modules/nanoid/bin/nanoid.cjs create mode 100644 node_modules/nanoid/index.browser.cjs create mode 100644 node_modules/nanoid/index.browser.js create mode 100644 node_modules/nanoid/index.cjs create mode 100644 node_modules/nanoid/index.d.ts create mode 100644 node_modules/nanoid/index.js create mode 100644 node_modules/nanoid/nanoid.js create mode 100644 node_modules/nanoid/non-secure/index.cjs create mode 100644 node_modules/nanoid/non-secure/index.d.ts create mode 100644 node_modules/nanoid/non-secure/index.js create mode 100644 node_modules/nanoid/non-secure/package.json create mode 100644 node_modules/nanoid/package.json create mode 100644 node_modules/nanoid/url-alphabet/index.cjs create mode 100644 node_modules/nanoid/url-alphabet/index.js create mode 100644 node_modules/nanoid/url-alphabet/package.json create mode 100644 node_modules/normalize-package-data/AUTHORS create mode 100644 node_modules/normalize-package-data/LICENSE create mode 100644 node_modules/normalize-package-data/README.md create mode 100644 node_modules/normalize-package-data/lib/extract_description.js create mode 100644 node_modules/normalize-package-data/lib/fixer.js create mode 100644 node_modules/normalize-package-data/lib/make_warning.js create mode 100644 node_modules/normalize-package-data/lib/normalize.js create mode 100644 node_modules/normalize-package-data/lib/safe_format.js create mode 100644 node_modules/normalize-package-data/lib/typos.json create mode 100644 node_modules/normalize-package-data/lib/warning_messages.json create mode 100644 node_modules/normalize-package-data/package.json create mode 100644 node_modules/normalize-path/LICENSE create mode 100644 node_modules/normalize-path/README.md create mode 100644 node_modules/normalize-path/index.js create mode 100644 node_modules/normalize-path/package.json create mode 100644 node_modules/once/LICENSE create mode 100644 node_modules/once/README.md create mode 100644 node_modules/once/once.js create mode 100644 node_modules/once/package.json create mode 100644 node_modules/p-limit/index.d.ts create mode 100644 node_modules/p-limit/index.js create mode 100644 node_modules/p-limit/license create mode 100644 node_modules/p-limit/package.json create mode 100644 node_modules/p-limit/readme.md create mode 100644 node_modules/p-locate/index.d.ts create mode 100644 node_modules/p-locate/index.js create mode 100644 node_modules/p-locate/license create mode 100644 node_modules/p-locate/package.json create mode 100644 node_modules/p-locate/readme.md create mode 100644 node_modules/parent-module/index.js create mode 100644 node_modules/parent-module/license create mode 100644 node_modules/parent-module/package.json create mode 100644 node_modules/parent-module/readme.md create mode 100644 node_modules/parse-json/index.js create mode 100644 node_modules/parse-json/license create mode 100644 node_modules/parse-json/package.json create mode 100644 node_modules/parse-json/readme.md create mode 100644 node_modules/path-exists/index.d.ts create mode 100644 node_modules/path-exists/index.js create mode 100644 node_modules/path-exists/license create mode 100644 node_modules/path-exists/package.json create mode 100644 node_modules/path-exists/readme.md create mode 100644 node_modules/path-is-absolute/index.js create mode 100644 node_modules/path-is-absolute/license create mode 100644 node_modules/path-is-absolute/package.json create mode 100644 node_modules/path-is-absolute/readme.md create mode 100644 node_modules/path-type/index.d.ts create mode 100644 node_modules/path-type/index.js create mode 100644 node_modules/path-type/license create mode 100644 node_modules/path-type/package.json create mode 100644 node_modules/path-type/readme.md create mode 100644 node_modules/picocolors/LICENSE create mode 100644 node_modules/picocolors/README.md create mode 100644 node_modules/picocolors/package.json create mode 100644 node_modules/picocolors/picocolors.browser.js create mode 100644 node_modules/picocolors/picocolors.d.ts create mode 100644 node_modules/picocolors/picocolors.js create mode 100644 node_modules/picocolors/types.ts create mode 100644 node_modules/picomatch/CHANGELOG.md create mode 100644 node_modules/picomatch/LICENSE create mode 100644 node_modules/picomatch/README.md create mode 100644 node_modules/picomatch/index.js create mode 100644 node_modules/picomatch/lib/constants.js create mode 100644 node_modules/picomatch/lib/parse.js create mode 100644 node_modules/picomatch/lib/picomatch.js create mode 100644 node_modules/picomatch/lib/scan.js create mode 100644 node_modules/picomatch/lib/utils.js create mode 100644 node_modules/picomatch/package.json create mode 100644 node_modules/postcss-media-query-parser/CHANGELOG.md create mode 100644 node_modules/postcss-media-query-parser/README.md create mode 100644 node_modules/postcss-media-query-parser/dist/index.js create mode 100644 node_modules/postcss-media-query-parser/dist/nodes/Container.js create mode 100644 node_modules/postcss-media-query-parser/dist/nodes/Node.js create mode 100644 node_modules/postcss-media-query-parser/dist/parsers.js create mode 100644 node_modules/postcss-media-query-parser/package.json create mode 100644 node_modules/postcss-resolve-nested-selector/LICENSE create mode 100644 node_modules/postcss-resolve-nested-selector/README.md create mode 100644 node_modules/postcss-resolve-nested-selector/index.js create mode 100644 node_modules/postcss-resolve-nested-selector/package.json create mode 100644 node_modules/postcss-safe-parser/LICENSE create mode 100644 node_modules/postcss-safe-parser/README.md create mode 100644 node_modules/postcss-safe-parser/lib/safe-parse.js create mode 100644 node_modules/postcss-safe-parser/lib/safe-parser.js create mode 100644 node_modules/postcss-safe-parser/package.json create mode 100644 node_modules/postcss-scss/LICENSE create mode 100644 node_modules/postcss-scss/README.md create mode 100644 node_modules/postcss-scss/lib/nested-declaration.js create mode 100644 node_modules/postcss-scss/lib/scss-parse.js create mode 100644 node_modules/postcss-scss/lib/scss-parser.js create mode 100644 node_modules/postcss-scss/lib/scss-stringifier.js create mode 100644 node_modules/postcss-scss/lib/scss-stringify.js create mode 100644 node_modules/postcss-scss/lib/scss-syntax.d.ts create mode 100644 node_modules/postcss-scss/lib/scss-syntax.js create mode 100644 node_modules/postcss-scss/lib/scss-syntax.mjs create mode 100644 node_modules/postcss-scss/lib/scss-tokenize.js create mode 100644 node_modules/postcss-scss/package.json create mode 100644 node_modules/postcss-selector-parser/API.md create mode 100644 node_modules/postcss-selector-parser/CHANGELOG.md create mode 100644 node_modules/postcss-selector-parser/LICENSE-MIT create mode 100644 node_modules/postcss-selector-parser/README.md create mode 100644 node_modules/postcss-selector-parser/dist/index.js create mode 100644 node_modules/postcss-selector-parser/dist/parser.js create mode 100644 node_modules/postcss-selector-parser/dist/processor.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/attribute.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/className.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/combinator.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/comment.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/constructors.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/container.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/guards.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/id.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/index.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/namespace.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/nesting.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/node.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/pseudo.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/root.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/selector.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/string.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/tag.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/types.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/universal.js create mode 100644 node_modules/postcss-selector-parser/dist/sortAscending.js create mode 100644 node_modules/postcss-selector-parser/dist/tokenTypes.js create mode 100644 node_modules/postcss-selector-parser/dist/tokenize.js create mode 100644 node_modules/postcss-selector-parser/dist/util/ensureObject.js create mode 100644 node_modules/postcss-selector-parser/dist/util/getProp.js create mode 100644 node_modules/postcss-selector-parser/dist/util/index.js create mode 100644 node_modules/postcss-selector-parser/dist/util/stripComments.js create mode 100644 node_modules/postcss-selector-parser/dist/util/unesc.js create mode 100644 node_modules/postcss-selector-parser/package.json create mode 100644 node_modules/postcss-selector-parser/postcss-selector-parser.d.ts create mode 100644 node_modules/postcss-value-parser/LICENSE create mode 100644 node_modules/postcss-value-parser/README.md create mode 100644 node_modules/postcss-value-parser/lib/index.d.ts create mode 100644 node_modules/postcss-value-parser/lib/index.js create mode 100644 node_modules/postcss-value-parser/lib/parse.js create mode 100644 node_modules/postcss-value-parser/lib/stringify.js create mode 100644 node_modules/postcss-value-parser/lib/unit.js create mode 100644 node_modules/postcss-value-parser/lib/walk.js create mode 100644 node_modules/postcss-value-parser/package.json create mode 100644 node_modules/postcss/LICENSE create mode 100644 node_modules/postcss/README.md create mode 100644 node_modules/postcss/lib/at-rule.d.ts create mode 100644 node_modules/postcss/lib/at-rule.js create mode 100644 node_modules/postcss/lib/comment.d.ts create mode 100644 node_modules/postcss/lib/comment.js create mode 100644 node_modules/postcss/lib/container.d.ts create mode 100644 node_modules/postcss/lib/container.js create mode 100644 node_modules/postcss/lib/css-syntax-error.d.ts create mode 100644 node_modules/postcss/lib/css-syntax-error.js create mode 100644 node_modules/postcss/lib/declaration.d.ts create mode 100644 node_modules/postcss/lib/declaration.js create mode 100644 node_modules/postcss/lib/document.d.ts create mode 100644 node_modules/postcss/lib/document.js create mode 100644 node_modules/postcss/lib/fromJSON.d.ts create mode 100644 node_modules/postcss/lib/fromJSON.js create mode 100644 node_modules/postcss/lib/input.d.ts create mode 100644 node_modules/postcss/lib/input.js create mode 100644 node_modules/postcss/lib/lazy-result.d.ts create mode 100644 node_modules/postcss/lib/lazy-result.js create mode 100644 node_modules/postcss/lib/list.d.ts create mode 100644 node_modules/postcss/lib/list.js create mode 100644 node_modules/postcss/lib/map-generator.js create mode 100644 node_modules/postcss/lib/no-work-result.d.ts create mode 100644 node_modules/postcss/lib/no-work-result.js create mode 100644 node_modules/postcss/lib/node.d.ts create mode 100644 node_modules/postcss/lib/node.js create mode 100644 node_modules/postcss/lib/parse.d.ts create mode 100644 node_modules/postcss/lib/parse.js create mode 100644 node_modules/postcss/lib/parser.js create mode 100644 node_modules/postcss/lib/postcss.d.mts create mode 100644 node_modules/postcss/lib/postcss.d.ts create mode 100644 node_modules/postcss/lib/postcss.js create mode 100644 node_modules/postcss/lib/postcss.mjs create mode 100644 node_modules/postcss/lib/previous-map.d.ts create mode 100644 node_modules/postcss/lib/previous-map.js create mode 100644 node_modules/postcss/lib/processor.d.ts create mode 100644 node_modules/postcss/lib/processor.js create mode 100644 node_modules/postcss/lib/result.d.ts create mode 100644 node_modules/postcss/lib/result.js create mode 100644 node_modules/postcss/lib/root.d.ts create mode 100644 node_modules/postcss/lib/root.js create mode 100644 node_modules/postcss/lib/rule.d.ts create mode 100644 node_modules/postcss/lib/rule.js create mode 100644 node_modules/postcss/lib/stringifier.d.ts create mode 100644 node_modules/postcss/lib/stringifier.js create mode 100644 node_modules/postcss/lib/stringify.d.ts create mode 100644 node_modules/postcss/lib/stringify.js create mode 100644 node_modules/postcss/lib/symbols.js create mode 100644 node_modules/postcss/lib/terminal-highlight.js create mode 100644 node_modules/postcss/lib/tokenize.js create mode 100644 node_modules/postcss/lib/warn-once.js create mode 100644 node_modules/postcss/lib/warning.d.ts create mode 100644 node_modules/postcss/lib/warning.js create mode 100755 node_modules/postcss/package.json create mode 100644 node_modules/punycode/LICENSE-MIT.txt create mode 100644 node_modules/punycode/README.md create mode 100644 node_modules/punycode/package.json create mode 100644 node_modules/punycode/punycode.es6.js create mode 100644 node_modules/punycode/punycode.js create mode 100755 node_modules/queue-microtask/LICENSE create mode 100644 node_modules/queue-microtask/README.md create mode 100644 node_modules/queue-microtask/index.d.ts create mode 100644 node_modules/queue-microtask/index.js create mode 100644 node_modules/queue-microtask/package.json create mode 100644 node_modules/quick-lru/index.d.ts create mode 100644 node_modules/quick-lru/index.js create mode 100644 node_modules/quick-lru/license create mode 100644 node_modules/quick-lru/package.json create mode 100644 node_modules/quick-lru/readme.md create mode 100644 node_modules/read-pkg-up/index.d.ts create mode 100644 node_modules/read-pkg-up/index.js create mode 100644 node_modules/read-pkg-up/license create mode 100644 node_modules/read-pkg-up/package.json create mode 100644 node_modules/read-pkg-up/readme.md create mode 100644 node_modules/read-pkg/index.d.ts create mode 100644 node_modules/read-pkg/index.js create mode 100644 node_modules/read-pkg/license create mode 100644 node_modules/read-pkg/package.json create mode 100644 node_modules/read-pkg/readme.md create mode 100644 node_modules/redent/index.d.ts create mode 100644 node_modules/redent/index.js create mode 100644 node_modules/redent/license create mode 100644 node_modules/redent/package.json create mode 100644 node_modules/redent/readme.md create mode 100644 node_modules/require-from-string/index.js create mode 100644 node_modules/require-from-string/license create mode 100644 node_modules/require-from-string/package.json create mode 100644 node_modules/require-from-string/readme.md create mode 100644 node_modules/resolve-from/index.d.ts create mode 100644 node_modules/resolve-from/index.js create mode 100644 node_modules/resolve-from/license create mode 100644 node_modules/resolve-from/package.json create mode 100644 node_modules/resolve-from/readme.md create mode 100644 node_modules/reusify/.coveralls.yml create mode 100644 node_modules/reusify/.travis.yml create mode 100644 node_modules/reusify/LICENSE create mode 100644 node_modules/reusify/README.md create mode 100644 node_modules/reusify/benchmarks/createNoCodeFunction.js create mode 100644 node_modules/reusify/benchmarks/fib.js create mode 100644 node_modules/reusify/benchmarks/reuseNoCodeFunction.js create mode 100644 node_modules/reusify/package.json create mode 100644 node_modules/reusify/reusify.js create mode 100644 node_modules/reusify/test.js create mode 100644 node_modules/rimraf/CHANGELOG.md create mode 100644 node_modules/rimraf/LICENSE create mode 100644 node_modules/rimraf/README.md create mode 100755 node_modules/rimraf/bin.js create mode 100644 node_modules/rimraf/package.json create mode 100644 node_modules/rimraf/rimraf.js create mode 100644 node_modules/run-parallel/LICENSE create mode 100644 node_modules/run-parallel/README.md create mode 100644 node_modules/run-parallel/index.js create mode 100644 node_modules/run-parallel/package.json create mode 100644 node_modules/semver/LICENSE create mode 100644 node_modules/semver/README.md create mode 100755 node_modules/semver/bin/semver.js create mode 100644 node_modules/semver/classes/comparator.js create mode 100644 node_modules/semver/classes/index.js create mode 100644 node_modules/semver/classes/range.js create mode 100644 node_modules/semver/classes/semver.js create mode 100644 node_modules/semver/functions/clean.js create mode 100644 node_modules/semver/functions/cmp.js create mode 100644 node_modules/semver/functions/coerce.js create mode 100644 node_modules/semver/functions/compare-build.js create mode 100644 node_modules/semver/functions/compare-loose.js create mode 100644 node_modules/semver/functions/compare.js create mode 100644 node_modules/semver/functions/diff.js create mode 100644 node_modules/semver/functions/eq.js create mode 100644 node_modules/semver/functions/gt.js create mode 100644 node_modules/semver/functions/gte.js create mode 100644 node_modules/semver/functions/inc.js create mode 100644 node_modules/semver/functions/lt.js create mode 100644 node_modules/semver/functions/lte.js create mode 100644 node_modules/semver/functions/major.js create mode 100644 node_modules/semver/functions/minor.js create mode 100644 node_modules/semver/functions/neq.js create mode 100644 node_modules/semver/functions/parse.js create mode 100644 node_modules/semver/functions/patch.js create mode 100644 node_modules/semver/functions/prerelease.js create mode 100644 node_modules/semver/functions/rcompare.js create mode 100644 node_modules/semver/functions/rsort.js create mode 100644 node_modules/semver/functions/satisfies.js create mode 100644 node_modules/semver/functions/sort.js create mode 100644 node_modules/semver/functions/valid.js create mode 100644 node_modules/semver/index.js create mode 100644 node_modules/semver/internal/constants.js create mode 100644 node_modules/semver/internal/debug.js create mode 100644 node_modules/semver/internal/identifiers.js create mode 100644 node_modules/semver/internal/parse-options.js create mode 100644 node_modules/semver/internal/re.js create mode 100644 node_modules/semver/package.json create mode 100644 node_modules/semver/preload.js create mode 100644 node_modules/semver/range.bnf create mode 100644 node_modules/semver/ranges/gtr.js create mode 100644 node_modules/semver/ranges/intersects.js create mode 100644 node_modules/semver/ranges/ltr.js create mode 100644 node_modules/semver/ranges/max-satisfying.js create mode 100644 node_modules/semver/ranges/min-satisfying.js create mode 100644 node_modules/semver/ranges/min-version.js create mode 100644 node_modules/semver/ranges/outside.js create mode 100644 node_modules/semver/ranges/simplify.js create mode 100644 node_modules/semver/ranges/subset.js create mode 100644 node_modules/semver/ranges/to-comparators.js create mode 100644 node_modules/semver/ranges/valid.js create mode 100644 node_modules/signal-exit/LICENSE.txt create mode 100644 node_modules/signal-exit/README.md create mode 100644 node_modules/signal-exit/dist/cjs/browser.d.ts create mode 100644 node_modules/signal-exit/dist/cjs/browser.d.ts.map create mode 100644 node_modules/signal-exit/dist/cjs/browser.js create mode 100644 node_modules/signal-exit/dist/cjs/browser.js.map create mode 100644 node_modules/signal-exit/dist/cjs/index.d.ts create mode 100644 node_modules/signal-exit/dist/cjs/index.d.ts.map create mode 100644 node_modules/signal-exit/dist/cjs/index.js create mode 100644 node_modules/signal-exit/dist/cjs/index.js.map create mode 100644 node_modules/signal-exit/dist/cjs/package.json create mode 100644 node_modules/signal-exit/dist/cjs/signals.d.ts create mode 100644 node_modules/signal-exit/dist/cjs/signals.d.ts.map create mode 100644 node_modules/signal-exit/dist/cjs/signals.js create mode 100644 node_modules/signal-exit/dist/cjs/signals.js.map create mode 100644 node_modules/signal-exit/dist/mjs/browser.d.ts create mode 100644 node_modules/signal-exit/dist/mjs/browser.d.ts.map create mode 100644 node_modules/signal-exit/dist/mjs/browser.js create mode 100644 node_modules/signal-exit/dist/mjs/browser.js.map create mode 100644 node_modules/signal-exit/dist/mjs/index.d.ts create mode 100644 node_modules/signal-exit/dist/mjs/index.d.ts.map create mode 100644 node_modules/signal-exit/dist/mjs/index.js create mode 100644 node_modules/signal-exit/dist/mjs/index.js.map create mode 100644 node_modules/signal-exit/dist/mjs/package.json create mode 100644 node_modules/signal-exit/dist/mjs/signals.d.ts create mode 100644 node_modules/signal-exit/dist/mjs/signals.d.ts.map create mode 100644 node_modules/signal-exit/dist/mjs/signals.js create mode 100644 node_modules/signal-exit/dist/mjs/signals.js.map create mode 100644 node_modules/signal-exit/package.json create mode 100644 node_modules/slash/index.d.ts create mode 100644 node_modules/slash/index.js create mode 100644 node_modules/slash/license create mode 100644 node_modules/slash/package.json create mode 100644 node_modules/slash/readme.md create mode 100755 node_modules/slice-ansi/index.js create mode 100644 node_modules/slice-ansi/license create mode 100644 node_modules/slice-ansi/node_modules/ansi-styles/index.d.ts create mode 100644 node_modules/slice-ansi/node_modules/ansi-styles/index.js create mode 100644 node_modules/slice-ansi/node_modules/ansi-styles/license create mode 100644 node_modules/slice-ansi/node_modules/ansi-styles/package.json create mode 100644 node_modules/slice-ansi/node_modules/ansi-styles/readme.md create mode 100644 node_modules/slice-ansi/node_modules/color-convert/CHANGELOG.md create mode 100644 node_modules/slice-ansi/node_modules/color-convert/LICENSE create mode 100644 node_modules/slice-ansi/node_modules/color-convert/README.md create mode 100644 node_modules/slice-ansi/node_modules/color-convert/conversions.js create mode 100644 node_modules/slice-ansi/node_modules/color-convert/index.js create mode 100644 node_modules/slice-ansi/node_modules/color-convert/package.json create mode 100644 node_modules/slice-ansi/node_modules/color-convert/route.js create mode 100644 node_modules/slice-ansi/node_modules/color-name/LICENSE create mode 100644 node_modules/slice-ansi/node_modules/color-name/README.md create mode 100644 node_modules/slice-ansi/node_modules/color-name/index.js create mode 100644 node_modules/slice-ansi/node_modules/color-name/package.json create mode 100644 node_modules/slice-ansi/package.json create mode 100644 node_modules/slice-ansi/readme.md create mode 100644 node_modules/source-map-js/CHANGELOG.md create mode 100644 node_modules/source-map-js/LICENSE create mode 100644 node_modules/source-map-js/README.md create mode 100644 node_modules/source-map-js/lib/array-set.js create mode 100644 node_modules/source-map-js/lib/base64-vlq.js create mode 100644 node_modules/source-map-js/lib/base64.js create mode 100644 node_modules/source-map-js/lib/binary-search.js create mode 100644 node_modules/source-map-js/lib/mapping-list.js create mode 100644 node_modules/source-map-js/lib/quick-sort.js create mode 100644 node_modules/source-map-js/lib/source-map-consumer.js create mode 100644 node_modules/source-map-js/lib/source-map-generator.js create mode 100644 node_modules/source-map-js/lib/source-node.js create mode 100644 node_modules/source-map-js/lib/util.js create mode 100644 node_modules/source-map-js/package.json create mode 100644 node_modules/source-map-js/source-map.d.ts create mode 100644 node_modules/source-map-js/source-map.js create mode 100644 node_modules/spdx-correct/LICENSE create mode 100644 node_modules/spdx-correct/README.md create mode 100644 node_modules/spdx-correct/index.js create mode 100644 node_modules/spdx-correct/package.json create mode 100644 node_modules/spdx-exceptions/README.md create mode 100644 node_modules/spdx-exceptions/index.json create mode 100644 node_modules/spdx-exceptions/package.json create mode 100644 node_modules/spdx-expression-parse/AUTHORS create mode 100644 node_modules/spdx-expression-parse/LICENSE create mode 100644 node_modules/spdx-expression-parse/README.md create mode 100644 node_modules/spdx-expression-parse/index.js create mode 100644 node_modules/spdx-expression-parse/package.json create mode 100644 node_modules/spdx-expression-parse/parse.js create mode 100644 node_modules/spdx-expression-parse/scan.js create mode 100644 node_modules/spdx-license-ids/README.md create mode 100644 node_modules/spdx-license-ids/deprecated.json create mode 100644 node_modules/spdx-license-ids/index.json create mode 100644 node_modules/spdx-license-ids/package.json create mode 100644 node_modules/string-width/index.d.ts create mode 100644 node_modules/string-width/index.js create mode 100644 node_modules/string-width/license create mode 100644 node_modules/string-width/package.json create mode 100644 node_modules/string-width/readme.md create mode 100644 node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/strip-ansi/index.js create mode 100644 node_modules/strip-ansi/license create mode 100644 node_modules/strip-ansi/package.json create mode 100644 node_modules/strip-ansi/readme.md create mode 100644 node_modules/strip-indent/index.d.ts create mode 100644 node_modules/strip-indent/index.js create mode 100644 node_modules/strip-indent/license create mode 100644 node_modules/strip-indent/package.json create mode 100644 node_modules/strip-indent/readme.md create mode 100644 node_modules/style-search/.npmignore create mode 100644 node_modules/style-search/CHANGELOG.md create mode 100644 node_modules/style-search/LICENSE create mode 100644 node_modules/style-search/README.md create mode 100644 node_modules/style-search/circle.yml create mode 100644 node_modules/style-search/index.js create mode 100644 node_modules/style-search/package.json create mode 100644 node_modules/style-search/test.js create mode 100644 node_modules/stylelint-config-recommended-scss/LICENSE create mode 100644 node_modules/stylelint-config-recommended-scss/README.md create mode 100644 node_modules/stylelint-config-recommended-scss/index.js create mode 100644 node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/LICENSE create mode 100644 node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/README.md create mode 100644 node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/index.js create mode 100644 node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/package.json create mode 100644 node_modules/stylelint-config-recommended-scss/package.json create mode 100644 node_modules/stylelint-config-recommended/LICENSE create mode 100644 node_modules/stylelint-config-recommended/README.md create mode 100644 node_modules/stylelint-config-recommended/index.js create mode 100644 node_modules/stylelint-config-recommended/package.json create mode 100644 node_modules/stylelint-config-standard-scss/LICENSE create mode 100644 node_modules/stylelint-config-standard-scss/README.md create mode 100644 node_modules/stylelint-config-standard-scss/index.js create mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/LICENSE create mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/README.md create mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/index.js create mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/package.json create mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/LICENSE create mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/README.md create mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/index.js create mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/package.json create mode 100644 node_modules/stylelint-config-standard-scss/package.json create mode 100644 node_modules/stylelint-config-standard/LICENSE create mode 100644 node_modules/stylelint-config-standard/README.md create mode 100644 node_modules/stylelint-config-standard/index.js create mode 100644 node_modules/stylelint-config-standard/package.json create mode 100644 node_modules/stylelint-scss/LICENSE create mode 100644 node_modules/stylelint-scss/README.md create mode 100644 node_modules/stylelint-scss/package.json create mode 100644 node_modules/stylelint-scss/src/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-else-empty-line-before/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-else-empty-line-before/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-function-named-arguments/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-function-named-arguments/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-function-pattern/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-function-pattern/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-if-no-null/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-if-no-null/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-import-partial-extension/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-import-partial-extension/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-pattern/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-pattern/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-rule-no-unknown/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-rule-no-unknown/index.js create mode 100644 node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/README.md create mode 100644 node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/index.js create mode 100644 node_modules/stylelint-scss/src/rules/comment-no-empty/README.md create mode 100644 node_modules/stylelint-scss/src/rules/comment-no-empty/index.js create mode 100644 node_modules/stylelint-scss/src/rules/comment-no-loud/README.md create mode 100644 node_modules/stylelint-scss/src/rules/comment-no-loud/index.js create mode 100644 node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/README.md create mode 100644 node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/index.js create mode 100644 node_modules/stylelint-scss/src/rules/declaration-nested-properties/README.md create mode 100644 node_modules/stylelint-scss/src/rules/declaration-nested-properties/index.js create mode 100644 node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/README.md create mode 100644 node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/index.js create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/README.md create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/index.js create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/README.md create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/index.js create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/index.js create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-default/README.md create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-default/index.js create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/README.md create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/index.js create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/README.md create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/index.js create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/README.md create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/index.js create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/README.md create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/index.js create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/README.md create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/index.js create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-pattern/README.md create mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-pattern/index.js create mode 100644 node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/README.md create mode 100644 node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/index.js create mode 100644 node_modules/stylelint-scss/src/rules/double-slash-comment-inline/README.md create mode 100644 node_modules/stylelint-scss/src/rules/double-slash-comment-inline/index.js create mode 100644 node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/README.md create mode 100644 node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/index.js create mode 100644 node_modules/stylelint-scss/src/rules/function-color-relative/README.md create mode 100644 node_modules/stylelint-scss/src/rules/function-color-relative/index.js create mode 100644 node_modules/stylelint-scss/src/rules/function-no-unknown/README.md create mode 100644 node_modules/stylelint-scss/src/rules/function-no-unknown/index.js create mode 100644 node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/README.md create mode 100644 node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/index.js create mode 100644 node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/README.md create mode 100644 node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/index.js create mode 100644 node_modules/stylelint-scss/src/rules/index.js create mode 100644 node_modules/stylelint-scss/src/rules/map-keys-quotes/README.md create mode 100644 node_modules/stylelint-scss/src/rules/map-keys-quotes/index.js create mode 100644 node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/README.md create mode 100644 node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/index.js create mode 100644 node_modules/stylelint-scss/src/rules/no-dollar-variables/README.md create mode 100644 node_modules/stylelint-scss/src/rules/no-dollar-variables/index.js create mode 100644 node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/README.md create mode 100644 node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/index.js create mode 100644 node_modules/stylelint-scss/src/rules/no-duplicate-mixins/README.md create mode 100644 node_modules/stylelint-scss/src/rules/no-duplicate-mixins/index.js create mode 100644 node_modules/stylelint-scss/src/rules/no-global-function-names/README.md create mode 100644 node_modules/stylelint-scss/src/rules/no-global-function-names/index.js create mode 100644 node_modules/stylelint-scss/src/rules/operator-no-newline-after/README.md create mode 100644 node_modules/stylelint-scss/src/rules/operator-no-newline-after/index.js create mode 100644 node_modules/stylelint-scss/src/rules/operator-no-newline-before/README.md create mode 100644 node_modules/stylelint-scss/src/rules/operator-no-newline-before/index.js create mode 100644 node_modules/stylelint-scss/src/rules/operator-no-unspaced/README.md create mode 100644 node_modules/stylelint-scss/src/rules/operator-no-unspaced/index.js create mode 100644 node_modules/stylelint-scss/src/rules/partial-no-import/README.md create mode 100644 node_modules/stylelint-scss/src/rules/partial-no-import/index.js create mode 100644 node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/README.md create mode 100644 node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/index.js create mode 100644 node_modules/stylelint-scss/src/rules/selector-nest-combinators/README.md create mode 100644 node_modules/stylelint-scss/src/rules/selector-nest-combinators/index.js create mode 100644 node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/README.md create mode 100644 node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/index.js create mode 100644 node_modules/stylelint-scss/src/rules/selector-no-union-class-name/README.md create mode 100644 node_modules/stylelint-scss/src/rules/selector-no-union-class-name/index.js create mode 100644 node_modules/stylelint-scss/src/utils/addEmptyLineBefore.js create mode 100644 node_modules/stylelint-scss/src/utils/atRuleBaseName.js create mode 100644 node_modules/stylelint-scss/src/utils/atRuleParamIndex.js create mode 100644 node_modules/stylelint-scss/src/utils/beforeBlockString.js create mode 100644 node_modules/stylelint-scss/src/utils/blockString.js create mode 100644 node_modules/stylelint-scss/src/utils/configurationError.js create mode 100644 node_modules/stylelint-scss/src/utils/declarationValueIndex.js create mode 100644 node_modules/stylelint-scss/src/utils/eachRoot.js create mode 100644 node_modules/stylelint-scss/src/utils/findCommentsInRaws.js create mode 100644 node_modules/stylelint-scss/src/utils/functions.js create mode 100644 node_modules/stylelint-scss/src/utils/hasBlock.js create mode 100644 node_modules/stylelint-scss/src/utils/hasEmptyLine.js create mode 100644 node_modules/stylelint-scss/src/utils/hasInterpolatingAmpersand.js create mode 100644 node_modules/stylelint-scss/src/utils/hasInterpolation.js create mode 100644 node_modules/stylelint-scss/src/utils/hasLessInterpolation.js create mode 100644 node_modules/stylelint-scss/src/utils/hasNestedSibling.js create mode 100644 node_modules/stylelint-scss/src/utils/hasPsvInterpolation.js create mode 100644 node_modules/stylelint-scss/src/utils/hasScssInterpolation.js create mode 100644 node_modules/stylelint-scss/src/utils/hasTplInterpolation.js create mode 100644 node_modules/stylelint-scss/src/utils/isCustomPropertySet.js create mode 100644 node_modules/stylelint-scss/src/utils/isInlineComment.js create mode 100644 node_modules/stylelint-scss/src/utils/isNativeCssFunction.js create mode 100644 node_modules/stylelint-scss/src/utils/isSingleLineString.js create mode 100644 node_modules/stylelint-scss/src/utils/isStandardRule.js create mode 100644 node_modules/stylelint-scss/src/utils/isStandardSelector.js create mode 100644 node_modules/stylelint-scss/src/utils/isStandardSyntaxProperty.js create mode 100644 node_modules/stylelint-scss/src/utils/isStandardSyntaxSelector.js create mode 100644 node_modules/stylelint-scss/src/utils/isType.js create mode 100644 node_modules/stylelint-scss/src/utils/isWhitespace.js create mode 100644 node_modules/stylelint-scss/src/utils/matchesStringOrRegExp.js create mode 100644 node_modules/stylelint-scss/src/utils/moduleNamespace.js create mode 100644 node_modules/stylelint-scss/src/utils/namespace.js create mode 100644 node_modules/stylelint-scss/src/utils/optionsHaveException.js create mode 100644 node_modules/stylelint-scss/src/utils/optionsHaveIgnored.js create mode 100644 node_modules/stylelint-scss/src/utils/optionsMatches.js create mode 100644 node_modules/stylelint-scss/src/utils/parseFunctionArguments.js create mode 100644 node_modules/stylelint-scss/src/utils/parseNestedPropRoot.js create mode 100644 node_modules/stylelint-scss/src/utils/parseSelector.js create mode 100644 node_modules/stylelint-scss/src/utils/rawNodeString.js create mode 100644 node_modules/stylelint-scss/src/utils/removeEmptyLinesBefore.js create mode 100644 node_modules/stylelint-scss/src/utils/ruleUrl.js create mode 100644 node_modules/stylelint-scss/src/utils/sassValueParser/index.js create mode 100644 node_modules/stylelint-scss/src/utils/validateTypes.js create mode 100644 node_modules/stylelint-scss/src/utils/whitespaceChecker.js create mode 100644 node_modules/stylelint/LICENSE create mode 100644 node_modules/stylelint/README.md create mode 100755 node_modules/stylelint/bin/stylelint.mjs create mode 100644 node_modules/stylelint/lib/assignDisabledRanges.js create mode 100644 node_modules/stylelint/lib/augmentConfig.js create mode 100644 node_modules/stylelint/lib/cli.mjs create mode 100644 node_modules/stylelint/lib/constants.js create mode 100644 node_modules/stylelint/lib/createPartialStylelintResult.js create mode 100644 node_modules/stylelint/lib/createPlugin.js create mode 100644 node_modules/stylelint/lib/createStylelint.js create mode 100644 node_modules/stylelint/lib/descriptionlessDisables.js create mode 100644 node_modules/stylelint/lib/formatters/calcSeverityCounts.js create mode 100644 node_modules/stylelint/lib/formatters/compactFormatter.js create mode 100644 node_modules/stylelint/lib/formatters/githubFormatter.js create mode 100644 node_modules/stylelint/lib/formatters/index.js create mode 100644 node_modules/stylelint/lib/formatters/jsonFormatter.js create mode 100644 node_modules/stylelint/lib/formatters/preprocessWarnings.js create mode 100644 node_modules/stylelint/lib/formatters/stringFormatter.js create mode 100644 node_modules/stylelint/lib/formatters/tapFormatter.js create mode 100644 node_modules/stylelint/lib/formatters/terminalLink.js create mode 100644 node_modules/stylelint/lib/formatters/unixFormatter.js create mode 100644 node_modules/stylelint/lib/formatters/verboseFormatter.js create mode 100644 node_modules/stylelint/lib/getConfigForFile.js create mode 100644 node_modules/stylelint/lib/getPostcssResult.js create mode 100644 node_modules/stylelint/lib/index.js create mode 100644 node_modules/stylelint/lib/invalidScopeDisables.js create mode 100644 node_modules/stylelint/lib/isPathIgnored.js create mode 100644 node_modules/stylelint/lib/lintPostcssResult.js create mode 100644 node_modules/stylelint/lib/lintSource.js create mode 100644 node_modules/stylelint/lib/needlessDisables.js create mode 100644 node_modules/stylelint/lib/normalizeAllRuleSettings.js create mode 100644 node_modules/stylelint/lib/normalizeRuleSettings.js create mode 100644 node_modules/stylelint/lib/postcssPlugin.js create mode 100644 node_modules/stylelint/lib/prepareReturnValue.js create mode 100644 node_modules/stylelint/lib/printConfig.js create mode 100644 node_modules/stylelint/lib/reference/atKeywords.js create mode 100644 node_modules/stylelint/lib/reference/functions.js create mode 100644 node_modules/stylelint/lib/reference/keywords.js create mode 100644 node_modules/stylelint/lib/reference/mediaFeatures.js create mode 100644 node_modules/stylelint/lib/reference/prefixes.js create mode 100644 node_modules/stylelint/lib/reference/properties.js create mode 100644 node_modules/stylelint/lib/reference/selectors.js create mode 100644 node_modules/stylelint/lib/reference/units.js create mode 100644 node_modules/stylelint/lib/reportDisables.js create mode 100644 node_modules/stylelint/lib/reportUnknownRuleNames.js create mode 100644 node_modules/stylelint/lib/resolveConfig.js create mode 100644 node_modules/stylelint/lib/resolveCustomFormatter.js create mode 100644 node_modules/stylelint/lib/rules/alpha-value-notation/index.js create mode 100644 node_modules/stylelint/lib/rules/annotation-no-unknown/index.js create mode 100644 node_modules/stylelint/lib/rules/at-rule-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/at-rule-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/at-rule-empty-line-before/index.js create mode 100644 node_modules/stylelint/lib/rules/at-rule-name-case/index.js create mode 100644 node_modules/stylelint/lib/rules/at-rule-name-newline-after/index.js create mode 100644 node_modules/stylelint/lib/rules/at-rule-name-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/at-rule-no-unknown/index.js create mode 100644 node_modules/stylelint/lib/rules/at-rule-no-vendor-prefix/index.js create mode 100644 node_modules/stylelint/lib/rules/at-rule-property-required-list/index.js create mode 100644 node_modules/stylelint/lib/rules/at-rule-semicolon-newline-after/index.js create mode 100644 node_modules/stylelint/lib/rules/at-rule-semicolon-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js create mode 100644 node_modules/stylelint/lib/rules/block-closing-brace-empty-line-before/index.js create mode 100644 node_modules/stylelint/lib/rules/block-closing-brace-newline-after/index.js create mode 100644 node_modules/stylelint/lib/rules/block-closing-brace-newline-before/index.js create mode 100644 node_modules/stylelint/lib/rules/block-closing-brace-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/block-closing-brace-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/block-no-empty/index.js create mode 100644 node_modules/stylelint/lib/rules/block-opening-brace-newline-after/index.js create mode 100644 node_modules/stylelint/lib/rules/block-opening-brace-newline-before/index.js create mode 100644 node_modules/stylelint/lib/rules/block-opening-brace-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/block-opening-brace-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/color-function-notation/index.js create mode 100644 node_modules/stylelint/lib/rules/color-hex-alpha/index.js create mode 100644 node_modules/stylelint/lib/rules/color-hex-case/index.js create mode 100644 node_modules/stylelint/lib/rules/color-hex-length/index.js create mode 100644 node_modules/stylelint/lib/rules/color-named/colordUtils.js create mode 100644 node_modules/stylelint/lib/rules/color-named/index.js create mode 100644 node_modules/stylelint/lib/rules/color-no-hex/index.js create mode 100644 node_modules/stylelint/lib/rules/color-no-invalid-hex/index.js create mode 100644 node_modules/stylelint/lib/rules/comment-empty-line-before/index.js create mode 100644 node_modules/stylelint/lib/rules/comment-no-empty/index.js create mode 100644 node_modules/stylelint/lib/rules/comment-pattern/index.js create mode 100644 node_modules/stylelint/lib/rules/comment-whitespace-inside/index.js create mode 100644 node_modules/stylelint/lib/rules/comment-word-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/custom-media-pattern/index.js create mode 100644 node_modules/stylelint/lib/rules/custom-property-empty-line-before/index.js create mode 100644 node_modules/stylelint/lib/rules/custom-property-no-missing-var-function/index.js create mode 100644 node_modules/stylelint/lib/rules/custom-property-pattern/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-bang-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-bang-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-block-no-duplicate-custom-properties/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-block-no-duplicate-properties/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-block-no-redundant-longhand-properties/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-after/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-before/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-block-semicolon-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-block-semicolon-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-block-single-line-max-declarations/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-block-trailing-semicolon/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-colon-newline-after/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-colon-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-colon-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-empty-line-before/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-no-important/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-property-max-values/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-property-unit-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-property-unit-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-property-value-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-property-value-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/declaration-property-value-no-unknown/index.js create mode 100644 node_modules/stylelint/lib/rules/declarationBangSpaceChecker.js create mode 100644 node_modules/stylelint/lib/rules/declarationColonSpaceChecker.js create mode 100644 node_modules/stylelint/lib/rules/findMediaOperator.js create mode 100644 node_modules/stylelint/lib/rules/font-family-name-quotes/index.js create mode 100644 node_modules/stylelint/lib/rules/font-family-no-duplicate-names/index.js create mode 100644 node_modules/stylelint/lib/rules/font-family-no-missing-generic-family-keyword/index.js create mode 100644 node_modules/stylelint/lib/rules/font-weight-notation/index.js create mode 100644 node_modules/stylelint/lib/rules/function-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/function-calc-no-unspaced-operator/index.js create mode 100644 node_modules/stylelint/lib/rules/function-comma-newline-after/index.js create mode 100644 node_modules/stylelint/lib/rules/function-comma-newline-before/index.js create mode 100644 node_modules/stylelint/lib/rules/function-comma-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/function-comma-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/function-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/function-linear-gradient-no-nonstandard-direction/index.js create mode 100644 node_modules/stylelint/lib/rules/function-max-empty-lines/index.js create mode 100644 node_modules/stylelint/lib/rules/function-name-case/index.js create mode 100644 node_modules/stylelint/lib/rules/function-no-unknown/index.js create mode 100644 node_modules/stylelint/lib/rules/function-parentheses-newline-inside/index.js create mode 100644 node_modules/stylelint/lib/rules/function-parentheses-space-inside/index.js create mode 100644 node_modules/stylelint/lib/rules/function-url-no-scheme-relative/index.js create mode 100644 node_modules/stylelint/lib/rules/function-url-quotes/index.js create mode 100644 node_modules/stylelint/lib/rules/function-url-scheme-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/function-url-scheme-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/function-whitespace-after/index.js create mode 100644 node_modules/stylelint/lib/rules/functionCommaSpaceChecker.js create mode 100644 node_modules/stylelint/lib/rules/functionCommaSpaceFix.js create mode 100644 node_modules/stylelint/lib/rules/hue-degree-notation/index.js create mode 100644 node_modules/stylelint/lib/rules/import-notation/index.js create mode 100644 node_modules/stylelint/lib/rules/indentation/index.js create mode 100644 node_modules/stylelint/lib/rules/index.js create mode 100644 node_modules/stylelint/lib/rules/keyframe-block-no-duplicate-selectors/index.js create mode 100644 node_modules/stylelint/lib/rules/keyframe-declaration-no-important/index.js create mode 100644 node_modules/stylelint/lib/rules/keyframe-selector-notation/index.js create mode 100644 node_modules/stylelint/lib/rules/keyframes-name-pattern/index.js create mode 100644 node_modules/stylelint/lib/rules/length-zero-no-unit/index.js create mode 100644 node_modules/stylelint/lib/rules/linebreaks/index.js create mode 100644 node_modules/stylelint/lib/rules/max-empty-lines/index.js create mode 100644 node_modules/stylelint/lib/rules/max-line-length/index.js create mode 100644 node_modules/stylelint/lib/rules/max-nesting-depth/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-colon-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-colon-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-name-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-name-case/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-name-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-name-no-unknown/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-name-no-vendor-prefix/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-name-unit-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-name-value-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-name-value-no-unknown/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-parentheses-space-inside/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-range-notation/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-range-operator-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/media-feature-range-operator-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/media-query-list-comma-newline-after/index.js create mode 100644 node_modules/stylelint/lib/rules/media-query-list-comma-newline-before/index.js create mode 100644 node_modules/stylelint/lib/rules/media-query-list-comma-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/media-query-list-comma-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/media-query-no-invalid/index.js create mode 100644 node_modules/stylelint/lib/rules/mediaFeatureColonSpaceChecker.js create mode 100644 node_modules/stylelint/lib/rules/mediaQueryListCommaWhitespaceChecker.js create mode 100644 node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/index.js create mode 100644 node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/utils/findNotContiguousOrRectangular.js create mode 100644 node_modules/stylelint/lib/rules/no-descending-specificity/index.js create mode 100644 node_modules/stylelint/lib/rules/no-duplicate-at-import-rules/index.js create mode 100644 node_modules/stylelint/lib/rules/no-duplicate-selectors/index.js create mode 100644 node_modules/stylelint/lib/rules/no-empty-first-line/index.js create mode 100644 node_modules/stylelint/lib/rules/no-empty-source/index.js create mode 100644 node_modules/stylelint/lib/rules/no-eol-whitespace/index.js create mode 100644 node_modules/stylelint/lib/rules/no-extra-semicolons/index.js create mode 100644 node_modules/stylelint/lib/rules/no-invalid-double-slash-comments/index.js create mode 100644 node_modules/stylelint/lib/rules/no-invalid-position-at-import-rule/index.js create mode 100644 node_modules/stylelint/lib/rules/no-irregular-whitespace/index.js create mode 100644 node_modules/stylelint/lib/rules/no-missing-end-of-source-newline/index.js create mode 100644 node_modules/stylelint/lib/rules/no-unknown-animations/index.js create mode 100644 node_modules/stylelint/lib/rules/no-unknown-custom-properties/index.js create mode 100644 node_modules/stylelint/lib/rules/number-leading-zero/index.js create mode 100644 node_modules/stylelint/lib/rules/number-max-precision/index.js create mode 100644 node_modules/stylelint/lib/rules/number-no-trailing-zeros/index.js create mode 100644 node_modules/stylelint/lib/rules/property-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/property-case/index.js create mode 100644 node_modules/stylelint/lib/rules/property-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/property-no-unknown/index.js create mode 100644 node_modules/stylelint/lib/rules/property-no-vendor-prefix/index.js create mode 100644 node_modules/stylelint/lib/rules/rule-empty-line-before/index.js create mode 100644 node_modules/stylelint/lib/rules/rule-selector-property-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-anb-no-unmatchable/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-attribute-brackets-space-inside/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-attribute-name-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-attribute-operator-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-attribute-operator-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-attribute-operator-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-attribute-operator-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-attribute-quotes/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-class-pattern/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-combinator-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-combinator-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-combinator-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-combinator-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-descendant-combinator-no-non-space/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-id-pattern/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-list-comma-newline-after/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-list-comma-newline-before/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-list-comma-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-list-comma-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-max-attribute/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-max-class/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-max-combinators/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-max-compound-selectors/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-max-empty-lines/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-max-id/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-max-pseudo-class/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-max-specificity/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-max-type/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-max-universal/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-nested-pattern/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-no-qualifying-type/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-no-vendor-prefix/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-not-notation/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-class-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-class-case/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-class-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-class-no-unknown/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-class-parentheses-space-inside/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-element-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-element-case/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-element-colon-notation/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-element-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-element-no-unknown/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-type-case/index.js create mode 100644 node_modules/stylelint/lib/rules/selector-type-no-unknown/index.js create mode 100644 node_modules/stylelint/lib/rules/selectorAttributeOperatorSpaceChecker.js create mode 100644 node_modules/stylelint/lib/rules/selectorCombinatorSpaceChecker.js create mode 100644 node_modules/stylelint/lib/rules/selectorListCommaWhitespaceChecker.js create mode 100644 node_modules/stylelint/lib/rules/shorthand-property-no-redundant-values/index.js create mode 100644 node_modules/stylelint/lib/rules/string-no-newline/index.js create mode 100644 node_modules/stylelint/lib/rules/string-quotes/index.js create mode 100644 node_modules/stylelint/lib/rules/time-min-milliseconds/index.js create mode 100644 node_modules/stylelint/lib/rules/unicode-bom/index.js create mode 100644 node_modules/stylelint/lib/rules/unit-allowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/unit-case/index.js create mode 100644 node_modules/stylelint/lib/rules/unit-disallowed-list/index.js create mode 100644 node_modules/stylelint/lib/rules/unit-no-unknown/index.js create mode 100644 node_modules/stylelint/lib/rules/value-keyword-case/index.js create mode 100644 node_modules/stylelint/lib/rules/value-list-comma-newline-after/index.js create mode 100644 node_modules/stylelint/lib/rules/value-list-comma-newline-before/index.js create mode 100644 node_modules/stylelint/lib/rules/value-list-comma-space-after/index.js create mode 100644 node_modules/stylelint/lib/rules/value-list-comma-space-before/index.js create mode 100644 node_modules/stylelint/lib/rules/value-list-max-empty-lines/index.js create mode 100644 node_modules/stylelint/lib/rules/value-no-vendor-prefix/index.js create mode 100644 node_modules/stylelint/lib/rules/valueListCommaWhitespaceChecker.js create mode 100644 node_modules/stylelint/lib/standalone.js create mode 100644 node_modules/stylelint/lib/utils/FileCache.js create mode 100644 node_modules/stylelint/lib/utils/addEmptyLineAfter.js create mode 100644 node_modules/stylelint/lib/utils/addEmptyLineBefore.js create mode 100644 node_modules/stylelint/lib/utils/allFilesIgnoredError.js create mode 100644 node_modules/stylelint/lib/utils/arrayEqual.js create mode 100644 node_modules/stylelint/lib/utils/atRuleParamIndex.js create mode 100644 node_modules/stylelint/lib/utils/beforeBlockString.js create mode 100644 node_modules/stylelint/lib/utils/blockString.js create mode 100644 node_modules/stylelint/lib/utils/blurInterpolation.js create mode 100644 node_modules/stylelint/lib/utils/checkAgainstRule.js create mode 100644 node_modules/stylelint/lib/utils/checkInvalidCLIOptions.js create mode 100644 node_modules/stylelint/lib/utils/configurationComment.js create mode 100644 node_modules/stylelint/lib/utils/configurationError.js create mode 100644 node_modules/stylelint/lib/utils/containsString.js create mode 100644 node_modules/stylelint/lib/utils/createMapWithSet.js create mode 100644 node_modules/stylelint/lib/utils/declarationValueIndex.js create mode 100644 node_modules/stylelint/lib/utils/eachDeclarationBlock.js create mode 100644 node_modules/stylelint/lib/utils/filterFilePaths.js create mode 100644 node_modules/stylelint/lib/utils/findAnimationName.js create mode 100644 node_modules/stylelint/lib/utils/findAtRuleContext.js create mode 100644 node_modules/stylelint/lib/utils/findFontFamily.js create mode 100644 node_modules/stylelint/lib/utils/findMediaFeatureNames.js create mode 100644 node_modules/stylelint/lib/utils/functionArgumentsSearch.js create mode 100644 node_modules/stylelint/lib/utils/getAtRuleParams.js create mode 100644 node_modules/stylelint/lib/utils/getCacheFile.js create mode 100644 node_modules/stylelint/lib/utils/getDeclarationValue.js create mode 100644 node_modules/stylelint/lib/utils/getDimension.js create mode 100644 node_modules/stylelint/lib/utils/getFileIgnorer.js create mode 100644 node_modules/stylelint/lib/utils/getFormatterOptionsText.js create mode 100644 node_modules/stylelint/lib/utils/getImportantPosition.js create mode 100644 node_modules/stylelint/lib/utils/getModulePath.js create mode 100644 node_modules/stylelint/lib/utils/getNextNonSharedLineCommentNode.js create mode 100644 node_modules/stylelint/lib/utils/getOsEol.js create mode 100644 node_modules/stylelint/lib/utils/getPreviousNonSharedLineCommentNode.js create mode 100644 node_modules/stylelint/lib/utils/getRuleSelector.js create mode 100644 node_modules/stylelint/lib/utils/getSchemeFromUrl.js create mode 100644 node_modules/stylelint/lib/utils/getStylelintRule.js create mode 100644 node_modules/stylelint/lib/utils/hasANPlusBNotationPseudoClasses.js create mode 100644 node_modules/stylelint/lib/utils/hasBlock.js create mode 100644 node_modules/stylelint/lib/utils/hasColorFunction.js create mode 100644 node_modules/stylelint/lib/utils/hasDimension.js create mode 100644 node_modules/stylelint/lib/utils/hasEmptyBlock.js create mode 100644 node_modules/stylelint/lib/utils/hasEmptyLine.js create mode 100644 node_modules/stylelint/lib/utils/hasInterpolation.js create mode 100644 node_modules/stylelint/lib/utils/hasLessInterpolation.js create mode 100644 node_modules/stylelint/lib/utils/hasNamedColor.js create mode 100644 node_modules/stylelint/lib/utils/hasPrefix.js create mode 100644 node_modules/stylelint/lib/utils/hasPsvInterpolation.js create mode 100644 node_modules/stylelint/lib/utils/hasScssInterpolation.js create mode 100644 node_modules/stylelint/lib/utils/hasTplInterpolation.js create mode 100644 node_modules/stylelint/lib/utils/hasValidHex.js create mode 100644 node_modules/stylelint/lib/utils/hash.js create mode 100644 node_modules/stylelint/lib/utils/isAfterComment.js create mode 100644 node_modules/stylelint/lib/utils/isAfterSingleLineComment.js create mode 100644 node_modules/stylelint/lib/utils/isAfterStandardPropertyDeclaration.js create mode 100644 node_modules/stylelint/lib/utils/isAutoprefixable.js create mode 100644 node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterBlocklessAtRule.js create mode 100644 node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterSameNameBlocklessAtRule.js create mode 100644 node_modules/stylelint/lib/utils/isContextFunctionalPseudoClass.js create mode 100644 node_modules/stylelint/lib/utils/isCounterIncrementCustomIdentValue.js create mode 100644 node_modules/stylelint/lib/utils/isCounterResetCustomIdentValue.js create mode 100644 node_modules/stylelint/lib/utils/isCustomElement.js create mode 100644 node_modules/stylelint/lib/utils/isCustomFunction.js create mode 100644 node_modules/stylelint/lib/utils/isCustomMediaQuery.js create mode 100644 node_modules/stylelint/lib/utils/isCustomProperty.js create mode 100644 node_modules/stylelint/lib/utils/isCustomSelector.js create mode 100644 node_modules/stylelint/lib/utils/isFirstNested.js create mode 100644 node_modules/stylelint/lib/utils/isFirstNodeOfRoot.js create mode 100644 node_modules/stylelint/lib/utils/isKeyframeRule.js create mode 100644 node_modules/stylelint/lib/utils/isKeyframeSelector.js create mode 100644 node_modules/stylelint/lib/utils/isMathFunction.js create mode 100644 node_modules/stylelint/lib/utils/isNonNegativeInteger.js create mode 100644 node_modules/stylelint/lib/utils/isNumbery.js create mode 100644 node_modules/stylelint/lib/utils/isOnlyWhitespace.js create mode 100644 node_modules/stylelint/lib/utils/isPathNotFoundError.js create mode 100644 node_modules/stylelint/lib/utils/isScssVariable.js create mode 100644 node_modules/stylelint/lib/utils/isSharedLineComment.js create mode 100644 node_modules/stylelint/lib/utils/isSingleLineString.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxAtRule.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxColorFunction.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxCombinator.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxComment.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxDeclaration.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxFunction.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxHexColor.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxKeyframesName.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxMathFunction.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeature.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeatureName.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxProperty.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxRule.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxSelector.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxTypeSelector.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxUrl.js create mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxValue.js create mode 100644 node_modules/stylelint/lib/utils/isUnicodeRangeDescriptor.js create mode 100644 node_modules/stylelint/lib/utils/isValidFontSize.js create mode 100644 node_modules/stylelint/lib/utils/isValidHex.js create mode 100644 node_modules/stylelint/lib/utils/isValidIdentifier.js create mode 100644 node_modules/stylelint/lib/utils/isVariable.js create mode 100644 node_modules/stylelint/lib/utils/isWhitespace.js create mode 100644 node_modules/stylelint/lib/utils/matchesStringOrRegExp.js create mode 100644 node_modules/stylelint/lib/utils/nextNonCommentNode.js create mode 100644 node_modules/stylelint/lib/utils/noFilesFoundError.js create mode 100644 node_modules/stylelint/lib/utils/nodeContextLookup.js create mode 100644 node_modules/stylelint/lib/utils/optionsMatches.js create mode 100644 node_modules/stylelint/lib/utils/parseMediaQuery.js create mode 100644 node_modules/stylelint/lib/utils/parseSelector.js create mode 100644 node_modules/stylelint/lib/utils/pluralize.js create mode 100644 node_modules/stylelint/lib/utils/putIfAbsent.js create mode 100644 node_modules/stylelint/lib/utils/rawNodeString.js create mode 100644 node_modules/stylelint/lib/utils/removeEmptyLinesAfter.js create mode 100644 node_modules/stylelint/lib/utils/removeEmptyLinesBefore.js create mode 100644 node_modules/stylelint/lib/utils/report.js create mode 100644 node_modules/stylelint/lib/utils/ruleMessages.js create mode 100644 node_modules/stylelint/lib/utils/setAtRuleParams.js create mode 100644 node_modules/stylelint/lib/utils/setDeclarationValue.js create mode 100644 node_modules/stylelint/lib/utils/transformSelector.js create mode 100644 node_modules/stylelint/lib/utils/typeGuards.js create mode 100644 node_modules/stylelint/lib/utils/uniteSets.js create mode 100644 node_modules/stylelint/lib/utils/validateObjectWithArrayProps.js create mode 100644 node_modules/stylelint/lib/utils/validateObjectWithProps.js create mode 100644 node_modules/stylelint/lib/utils/validateOptions.js create mode 100644 node_modules/stylelint/lib/utils/validateTypes.js create mode 100644 node_modules/stylelint/lib/utils/vendor.js create mode 100644 node_modules/stylelint/lib/utils/whitespaceChecker.js create mode 100644 node_modules/stylelint/lib/validateDisableSettings.js create mode 100644 node_modules/stylelint/lib/writeOutputFile.js create mode 100644 node_modules/stylelint/package.json create mode 100644 node_modules/stylelint/types/stylelint/index.d.ts create mode 100644 node_modules/supports-color/browser.js create mode 100644 node_modules/supports-color/index.js create mode 100644 node_modules/supports-color/license create mode 100644 node_modules/supports-color/package.json create mode 100644 node_modules/supports-color/readme.md create mode 100644 node_modules/supports-hyperlinks/browser.js create mode 100644 node_modules/supports-hyperlinks/index.d.ts create mode 100644 node_modules/supports-hyperlinks/index.js create mode 100644 node_modules/supports-hyperlinks/license create mode 100644 node_modules/supports-hyperlinks/node_modules/has-flag/index.d.ts create mode 100644 node_modules/supports-hyperlinks/node_modules/has-flag/index.js create mode 100644 node_modules/supports-hyperlinks/node_modules/has-flag/license create mode 100644 node_modules/supports-hyperlinks/node_modules/has-flag/package.json create mode 100644 node_modules/supports-hyperlinks/node_modules/has-flag/readme.md create mode 100644 node_modules/supports-hyperlinks/node_modules/supports-color/browser.js create mode 100644 node_modules/supports-hyperlinks/node_modules/supports-color/index.js create mode 100644 node_modules/supports-hyperlinks/node_modules/supports-color/license create mode 100644 node_modules/supports-hyperlinks/node_modules/supports-color/package.json create mode 100644 node_modules/supports-hyperlinks/node_modules/supports-color/readme.md create mode 100644 node_modules/supports-hyperlinks/package.json create mode 100644 node_modules/supports-hyperlinks/readme.md create mode 100644 node_modules/svg-tags/LICENSE create mode 100644 node_modules/svg-tags/README.md create mode 100644 node_modules/svg-tags/lib/index.js create mode 100644 node_modules/svg-tags/lib/svg-tags.json create mode 100644 node_modules/svg-tags/package.json create mode 100644 node_modules/table/LICENSE create mode 100644 node_modules/table/README.md create mode 100644 node_modules/table/dist/src/alignSpanningCell.d.ts create mode 100644 node_modules/table/dist/src/alignSpanningCell.js create mode 100644 node_modules/table/dist/src/alignSpanningCell.js.map create mode 100644 node_modules/table/dist/src/alignString.d.ts create mode 100644 node_modules/table/dist/src/alignString.js create mode 100644 node_modules/table/dist/src/alignString.js.map create mode 100644 node_modules/table/dist/src/alignTableData.d.ts create mode 100644 node_modules/table/dist/src/alignTableData.js create mode 100644 node_modules/table/dist/src/alignTableData.js.map create mode 100644 node_modules/table/dist/src/calculateCellHeight.d.ts create mode 100644 node_modules/table/dist/src/calculateCellHeight.js create mode 100644 node_modules/table/dist/src/calculateCellHeight.js.map create mode 100644 node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts create mode 100644 node_modules/table/dist/src/calculateMaximumColumnWidths.js create mode 100644 node_modules/table/dist/src/calculateMaximumColumnWidths.js.map create mode 100644 node_modules/table/dist/src/calculateOutputColumnWidths.d.ts create mode 100644 node_modules/table/dist/src/calculateOutputColumnWidths.js create mode 100644 node_modules/table/dist/src/calculateOutputColumnWidths.js.map create mode 100644 node_modules/table/dist/src/calculateRowHeights.d.ts create mode 100644 node_modules/table/dist/src/calculateRowHeights.js create mode 100644 node_modules/table/dist/src/calculateRowHeights.js.map create mode 100644 node_modules/table/dist/src/calculateSpanningCellWidth.d.ts create mode 100644 node_modules/table/dist/src/calculateSpanningCellWidth.js create mode 100644 node_modules/table/dist/src/calculateSpanningCellWidth.js.map create mode 100644 node_modules/table/dist/src/createStream.d.ts create mode 100644 node_modules/table/dist/src/createStream.js create mode 100644 node_modules/table/dist/src/createStream.js.map create mode 100644 node_modules/table/dist/src/drawBorder.d.ts create mode 100644 node_modules/table/dist/src/drawBorder.js create mode 100644 node_modules/table/dist/src/drawBorder.js.map create mode 100644 node_modules/table/dist/src/drawContent.d.ts create mode 100644 node_modules/table/dist/src/drawContent.js create mode 100644 node_modules/table/dist/src/drawContent.js.map create mode 100644 node_modules/table/dist/src/drawRow.d.ts create mode 100644 node_modules/table/dist/src/drawRow.js create mode 100644 node_modules/table/dist/src/drawRow.js.map create mode 100644 node_modules/table/dist/src/drawTable.d.ts create mode 100644 node_modules/table/dist/src/drawTable.js create mode 100644 node_modules/table/dist/src/drawTable.js.map create mode 100644 node_modules/table/dist/src/generated/validators.d.ts create mode 100644 node_modules/table/dist/src/generated/validators.js create mode 100644 node_modules/table/dist/src/generated/validators.js.map create mode 100644 node_modules/table/dist/src/getBorderCharacters.d.ts create mode 100644 node_modules/table/dist/src/getBorderCharacters.js create mode 100644 node_modules/table/dist/src/getBorderCharacters.js.map create mode 100644 node_modules/table/dist/src/index.d.ts create mode 100644 node_modules/table/dist/src/index.js create mode 100644 node_modules/table/dist/src/index.js.map create mode 100644 node_modules/table/dist/src/injectHeaderConfig.d.ts create mode 100644 node_modules/table/dist/src/injectHeaderConfig.js create mode 100644 node_modules/table/dist/src/injectHeaderConfig.js.map create mode 100644 node_modules/table/dist/src/makeRangeConfig.d.ts create mode 100644 node_modules/table/dist/src/makeRangeConfig.js create mode 100644 node_modules/table/dist/src/makeRangeConfig.js.map create mode 100644 node_modules/table/dist/src/makeStreamConfig.d.ts create mode 100644 node_modules/table/dist/src/makeStreamConfig.js create mode 100644 node_modules/table/dist/src/makeStreamConfig.js.map create mode 100644 node_modules/table/dist/src/makeTableConfig.d.ts create mode 100644 node_modules/table/dist/src/makeTableConfig.js create mode 100644 node_modules/table/dist/src/makeTableConfig.js.map create mode 100644 node_modules/table/dist/src/mapDataUsingRowHeights.d.ts create mode 100644 node_modules/table/dist/src/mapDataUsingRowHeights.js create mode 100644 node_modules/table/dist/src/mapDataUsingRowHeights.js.map create mode 100644 node_modules/table/dist/src/padTableData.d.ts create mode 100644 node_modules/table/dist/src/padTableData.js create mode 100644 node_modules/table/dist/src/padTableData.js.map create mode 100644 node_modules/table/dist/src/schemas/config.json create mode 100644 node_modules/table/dist/src/schemas/shared.json create mode 100644 node_modules/table/dist/src/schemas/streamConfig.json create mode 100644 node_modules/table/dist/src/spanningCellManager.d.ts create mode 100644 node_modules/table/dist/src/spanningCellManager.js create mode 100644 node_modules/table/dist/src/spanningCellManager.js.map create mode 100644 node_modules/table/dist/src/stringifyTableData.d.ts create mode 100644 node_modules/table/dist/src/stringifyTableData.js create mode 100644 node_modules/table/dist/src/stringifyTableData.js.map create mode 100644 node_modules/table/dist/src/table.d.ts create mode 100644 node_modules/table/dist/src/table.js create mode 100644 node_modules/table/dist/src/table.js.map create mode 100644 node_modules/table/dist/src/truncateTableData.d.ts create mode 100644 node_modules/table/dist/src/truncateTableData.js create mode 100644 node_modules/table/dist/src/truncateTableData.js.map create mode 100644 node_modules/table/dist/src/types/api.d.ts create mode 100644 node_modules/table/dist/src/types/api.js create mode 100644 node_modules/table/dist/src/types/api.js.map create mode 100644 node_modules/table/dist/src/types/internal.d.ts create mode 100644 node_modules/table/dist/src/types/internal.js create mode 100644 node_modules/table/dist/src/types/internal.js.map create mode 100644 node_modules/table/dist/src/utils.d.ts create mode 100644 node_modules/table/dist/src/utils.js create mode 100644 node_modules/table/dist/src/utils.js.map create mode 100644 node_modules/table/dist/src/validateConfig.d.ts create mode 100644 node_modules/table/dist/src/validateConfig.js create mode 100644 node_modules/table/dist/src/validateConfig.js.map create mode 100644 node_modules/table/dist/src/validateSpanningCellConfig.d.ts create mode 100644 node_modules/table/dist/src/validateSpanningCellConfig.js create mode 100644 node_modules/table/dist/src/validateSpanningCellConfig.js.map create mode 100644 node_modules/table/dist/src/validateTableData.d.ts create mode 100644 node_modules/table/dist/src/validateTableData.js create mode 100644 node_modules/table/dist/src/validateTableData.js.map create mode 100644 node_modules/table/dist/src/wrapCell.d.ts create mode 100644 node_modules/table/dist/src/wrapCell.js create mode 100644 node_modules/table/dist/src/wrapCell.js.map create mode 100644 node_modules/table/dist/src/wrapString.d.ts create mode 100644 node_modules/table/dist/src/wrapString.js create mode 100644 node_modules/table/dist/src/wrapString.js.map create mode 100644 node_modules/table/dist/src/wrapWord.d.ts create mode 100644 node_modules/table/dist/src/wrapWord.js create mode 100644 node_modules/table/dist/src/wrapWord.js.map create mode 100644 node_modules/table/package.json create mode 100644 node_modules/to-regex-range/LICENSE create mode 100644 node_modules/to-regex-range/README.md create mode 100644 node_modules/to-regex-range/index.js create mode 100644 node_modules/to-regex-range/package.json create mode 100644 node_modules/trim-newlines/index.d.ts create mode 100644 node_modules/trim-newlines/index.js create mode 100644 node_modules/trim-newlines/license create mode 100644 node_modules/trim-newlines/package.json create mode 100644 node_modules/trim-newlines/readme.md create mode 100644 node_modules/type-fest/base.d.ts create mode 100644 node_modules/type-fest/index.d.ts create mode 100644 node_modules/type-fest/license create mode 100644 node_modules/type-fest/package.json create mode 100644 node_modules/type-fest/readme.md create mode 100644 node_modules/type-fest/source/async-return-type.d.ts create mode 100644 node_modules/type-fest/source/asyncify.d.ts create mode 100644 node_modules/type-fest/source/basic.d.ts create mode 100644 node_modules/type-fest/source/conditional-except.d.ts create mode 100644 node_modules/type-fest/source/conditional-keys.d.ts create mode 100644 node_modules/type-fest/source/conditional-pick.d.ts create mode 100644 node_modules/type-fest/source/entries.d.ts create mode 100644 node_modules/type-fest/source/entry.d.ts create mode 100644 node_modules/type-fest/source/except.d.ts create mode 100644 node_modules/type-fest/source/fixed-length-array.d.ts create mode 100644 node_modules/type-fest/source/iterable-element.d.ts create mode 100644 node_modules/type-fest/source/literal-union.d.ts create mode 100644 node_modules/type-fest/source/merge-exclusive.d.ts create mode 100644 node_modules/type-fest/source/merge.d.ts create mode 100644 node_modules/type-fest/source/mutable.d.ts create mode 100644 node_modules/type-fest/source/observable-like.d.ts create mode 100644 node_modules/type-fest/source/opaque.d.ts create mode 100644 node_modules/type-fest/source/package-json.d.ts create mode 100644 node_modules/type-fest/source/partial-deep.d.ts create mode 100644 node_modules/type-fest/source/primitive.d.ts create mode 100644 node_modules/type-fest/source/promisable.d.ts create mode 100644 node_modules/type-fest/source/promise-value.d.ts create mode 100644 node_modules/type-fest/source/readonly-deep.d.ts create mode 100644 node_modules/type-fest/source/require-at-least-one.d.ts create mode 100644 node_modules/type-fest/source/require-exactly-one.d.ts create mode 100644 node_modules/type-fest/source/set-optional.d.ts create mode 100644 node_modules/type-fest/source/set-required.d.ts create mode 100644 node_modules/type-fest/source/set-return-type.d.ts create mode 100644 node_modules/type-fest/source/simplify.d.ts create mode 100644 node_modules/type-fest/source/stringified.d.ts create mode 100644 node_modules/type-fest/source/tsconfig-json.d.ts create mode 100644 node_modules/type-fest/source/typed-array.d.ts create mode 100644 node_modules/type-fest/source/union-to-intersection.d.ts create mode 100644 node_modules/type-fest/source/utilities.d.ts create mode 100644 node_modules/type-fest/source/value-of.d.ts create mode 100644 node_modules/type-fest/ts41/camel-case.d.ts create mode 100644 node_modules/type-fest/ts41/camel-cased-properties-deep.d.ts create mode 100644 node_modules/type-fest/ts41/camel-cased-properties.d.ts create mode 100644 node_modules/type-fest/ts41/delimiter-case.d.ts create mode 100644 node_modules/type-fest/ts41/delimiter-cased-properties-deep.d.ts create mode 100644 node_modules/type-fest/ts41/delimiter-cased-properties.d.ts create mode 100644 node_modules/type-fest/ts41/get.d.ts create mode 100644 node_modules/type-fest/ts41/includes.d.ts create mode 100644 node_modules/type-fest/ts41/index.d.ts create mode 100644 node_modules/type-fest/ts41/kebab-case.d.ts create mode 100644 node_modules/type-fest/ts41/kebab-cased-properties-deep.d.ts create mode 100644 node_modules/type-fest/ts41/kebab-cased-properties.d.ts create mode 100644 node_modules/type-fest/ts41/last-array-element.d.ts create mode 100644 node_modules/type-fest/ts41/pascal-case.d.ts create mode 100644 node_modules/type-fest/ts41/pascal-cased-properties-deep.d.ts create mode 100644 node_modules/type-fest/ts41/pascal-cased-properties.d.ts create mode 100644 node_modules/type-fest/ts41/screaming-snake-case.d.ts create mode 100644 node_modules/type-fest/ts41/snake-case.d.ts create mode 100644 node_modules/type-fest/ts41/snake-cased-properties-deep.d.ts create mode 100644 node_modules/type-fest/ts41/snake-cased-properties.d.ts create mode 100644 node_modules/type-fest/ts41/split.d.ts create mode 100644 node_modules/type-fest/ts41/trim.d.ts create mode 100644 node_modules/type-fest/ts41/utilities.d.ts create mode 100755 node_modules/uri-js/LICENSE create mode 100755 node_modules/uri-js/README.md create mode 100755 node_modules/uri-js/dist/es5/uri.all.d.ts create mode 100755 node_modules/uri-js/dist/es5/uri.all.js create mode 100755 node_modules/uri-js/dist/es5/uri.all.js.map create mode 100755 node_modules/uri-js/dist/es5/uri.all.min.d.ts create mode 100755 node_modules/uri-js/dist/es5/uri.all.min.js create mode 100755 node_modules/uri-js/dist/es5/uri.all.min.js.map create mode 100755 node_modules/uri-js/dist/esnext/index.d.ts create mode 100755 node_modules/uri-js/dist/esnext/index.js create mode 100755 node_modules/uri-js/dist/esnext/index.js.map create mode 100755 node_modules/uri-js/dist/esnext/regexps-iri.d.ts create mode 100755 node_modules/uri-js/dist/esnext/regexps-iri.js create mode 100755 node_modules/uri-js/dist/esnext/regexps-iri.js.map create mode 100755 node_modules/uri-js/dist/esnext/regexps-uri.d.ts create mode 100755 node_modules/uri-js/dist/esnext/regexps-uri.js create mode 100755 node_modules/uri-js/dist/esnext/regexps-uri.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/http.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/http.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/http.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/https.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/https.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/https.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/mailto.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/mailto.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/mailto.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/urn.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.js.map create mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.d.ts create mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.js create mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.js.map create mode 100755 node_modules/uri-js/dist/esnext/uri.d.ts create mode 100755 node_modules/uri-js/dist/esnext/uri.js create mode 100755 node_modules/uri-js/dist/esnext/uri.js.map create mode 100755 node_modules/uri-js/dist/esnext/util.d.ts create mode 100755 node_modules/uri-js/dist/esnext/util.js create mode 100755 node_modules/uri-js/dist/esnext/util.js.map create mode 100755 node_modules/uri-js/package.json create mode 100755 node_modules/uri-js/yarn.lock create mode 100644 node_modules/util-deprecate/History.md create mode 100644 node_modules/util-deprecate/LICENSE create mode 100644 node_modules/util-deprecate/README.md create mode 100644 node_modules/util-deprecate/browser.js create mode 100644 node_modules/util-deprecate/node.js create mode 100644 node_modules/util-deprecate/package.json create mode 100644 node_modules/validate-npm-package-license/LICENSE create mode 100644 node_modules/validate-npm-package-license/README.md create mode 100644 node_modules/validate-npm-package-license/index.js create mode 100644 node_modules/validate-npm-package-license/package.json create mode 100644 node_modules/which/CHANGELOG.md create mode 100644 node_modules/which/LICENSE create mode 100644 node_modules/which/README.md create mode 100755 node_modules/which/bin/which create mode 100644 node_modules/which/package.json create mode 100644 node_modules/which/which.js create mode 100644 node_modules/wrappy/LICENSE create mode 100644 node_modules/wrappy/README.md create mode 100644 node_modules/wrappy/package.json create mode 100644 node_modules/wrappy/wrappy.js create mode 100644 node_modules/write-file-atomic/LICENSE.md create mode 100644 node_modules/write-file-atomic/README.md create mode 100644 node_modules/write-file-atomic/lib/index.js create mode 100644 node_modules/write-file-atomic/package.json create mode 100644 node_modules/yallist/LICENSE create mode 100644 node_modules/yallist/README.md create mode 100644 node_modules/yallist/iterator.js create mode 100644 node_modules/yallist/package.json create mode 100644 node_modules/yallist/yallist.js create mode 100644 node_modules/yargs-parser/CHANGELOG.md create mode 100644 node_modules/yargs-parser/LICENSE.txt create mode 100644 node_modules/yargs-parser/README.md create mode 100644 node_modules/yargs-parser/browser.js create mode 100644 node_modules/yargs-parser/build/index.cjs create mode 100644 node_modules/yargs-parser/build/lib/index.js create mode 100644 node_modules/yargs-parser/build/lib/string-utils.js create mode 100644 node_modules/yargs-parser/build/lib/tokenize-arg-string.js create mode 100644 node_modules/yargs-parser/build/lib/yargs-parser-types.js create mode 100644 node_modules/yargs-parser/build/lib/yargs-parser.js create mode 100644 node_modules/yargs-parser/package.json create mode 100644 node_modules/yocto-queue/index.d.ts create mode 100644 node_modules/yocto-queue/index.js create mode 100644 node_modules/yocto-queue/license create mode 100644 node_modules/yocto-queue/package.json create mode 100644 node_modules/yocto-queue/readme.md create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml new file mode 100644 index 000000000..70d393b71 --- /dev/null +++ b/.github/workflows/linter.yaml @@ -0,0 +1,27 @@ +name: Run Linters +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + build: + if: github.event.pull_request.draft == false + name: Run Linters + runs-on: ubuntu-latest + environment: dev + permissions: + contents: read + packages: read + statuses: write + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Lint Code Base + uses: super-linter/super-linter@v5 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: redesign2023 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index e98687189..4b0ff2c5f 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -7,6 +7,7 @@ on: - "feat/**" jobs: dev-pr-create-s3: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest environment: dev steps: diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100644 index 000000000..77ceb29f8 --- /dev/null +++ b/.stylelintrc.json @@ -0,0 +1 @@ +{ "extends": ["stylelint-config-standard"] } \ No newline at end of file diff --git a/node_modules/.bin/cssesc b/node_modules/.bin/cssesc new file mode 120000 index 000000000..487b68908 --- /dev/null +++ b/node_modules/.bin/cssesc @@ -0,0 +1 @@ +../cssesc/bin/cssesc \ No newline at end of file diff --git a/node_modules/.bin/js-yaml b/node_modules/.bin/js-yaml new file mode 120000 index 000000000..9dbd010d4 --- /dev/null +++ b/node_modules/.bin/js-yaml @@ -0,0 +1 @@ +../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/node_modules/.bin/nanoid b/node_modules/.bin/nanoid new file mode 120000 index 000000000..e2be547bc --- /dev/null +++ b/node_modules/.bin/nanoid @@ -0,0 +1 @@ +../nanoid/bin/nanoid.cjs \ No newline at end of file diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf new file mode 120000 index 000000000..4cd49a49d --- /dev/null +++ b/node_modules/.bin/rimraf @@ -0,0 +1 @@ +../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 120000 index 000000000..5aaadf42c --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver.js \ No newline at end of file diff --git a/node_modules/.bin/stylelint b/node_modules/.bin/stylelint new file mode 120000 index 000000000..df47b6f4e --- /dev/null +++ b/node_modules/.bin/stylelint @@ -0,0 +1 @@ +../stylelint/bin/stylelint.mjs \ No newline at end of file diff --git a/node_modules/.bin/which b/node_modules/.bin/which new file mode 120000 index 000000000..f62471c85 --- /dev/null +++ b/node_modules/.bin/which @@ -0,0 +1 @@ +../which/bin/which \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 000000000..2e8333dc6 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,2063 @@ +{ + "name": "bioconductor.org", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@babel/code-frame": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.3.0.tgz", + "integrity": "sha512-dTKSIHHWc0zPvcS5cqGP+/TPFUJB0ekJ9dGKvMAFoNuBFhDPBt9OMGNZiIA5vTiNdGHHBeScYPXIGBMnVOahsA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^2.1.1" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.1.1.tgz", + "integrity": "sha512-GbrTj2Z8MCTUv+52GE0RbFGM527xuXZ0Xa5g0Z+YN573uveS4G0qi6WNOMyz3yrFM/jaILTTwJ0+umx81EzqfA==", + "dev": true, + "engines": { + "node": "^14 || ^16 || >=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + }, + "node_modules/@csstools/media-query-list-parser": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.2.tgz", + "integrity": "sha512-M8cFGGwl866o6++vIY7j1AKuq9v57cf+dGepScwCcbut9ypJNr4Cj+LLTWligYUZ0uyhEoJDKt5lvyBfh2L3ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^2.3.0", + "@csstools/css-tokenizer": "^2.1.1" + } + }, + "node_modules/@csstools/selector-specificity": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.0.0.tgz", + "integrity": "sha512-hBI9tfBtuPIi885ZsZ32IMEU/5nlZH/KOVYJCOh7gyMxaVLGmLedYqFN6Ui1LXkI8JlC8IsuC0rF0btcRZKd5g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "postcss-selector-parser": "^6.0.13" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/minimist": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "dev": true + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "dev": true + }, + "node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-2.0.0.tgz", + "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/brace-expansion/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/camelcase-keys": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-7.0.2.tgz", + "integrity": "sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==", + "dev": true, + "dependencies": { + "camelcase": "^6.3.0", + "map-obj": "^4.1.0", + "quick-lru": "^5.1.1", + "type-fest": "^1.2.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/colord": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", + "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cosmiconfig": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", + "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", + "dev": true, + "dependencies": { + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + } + }, + "node_modules/css-functions-list": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.0.tgz", + "integrity": "sha512-d/jBMPyYybkkLVypgtGv12R+pIFw4/f/IHtCTxWpZc8ofTYOPigIgmA6vu5rMHartZC+WuXhBUHfnyNUIQSYrg==", + "dev": true, + "engines": { + "node": ">=12.22" + } + }, + "node_modules/css-tree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", + "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dev": true, + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", + "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "dependencies": { + "global-prefix": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globjoin": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/globjoin/-/globjoin-0.1.4.tgz", + "integrity": "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==", + "dev": true + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/html-tags": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz", + "integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/known-css-properties": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.27.0.tgz", + "integrity": "sha512-uMCj6+hZYDoffuvAJjFAPz56E9uoowFHmTkqRtRq5WyC5Q6Cu/fTZKNQpX/RbzChBYLLl3lo8CjFZBAZXq9qFg==", + "dev": true + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mathml-tag-names": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", + "integrity": "sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdn-data": { + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", + "dev": true + }, + "node_modules/meow": { + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.5.tgz", + "integrity": "sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==", + "dev": true, + "dependencies": { + "@types/minimist": "^1.2.2", + "camelcase-keys": "^7.0.0", + "decamelize": "^5.0.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.2", + "read-pkg-up": "^8.0.0", + "redent": "^4.0.0", + "trim-newlines": "^4.0.2", + "type-fest": "^1.2.2", + "yargs-parser": "^20.2.9" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.4.25", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.25.tgz", + "integrity": "sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-media-query-parser": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", + "integrity": "sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==", + "dev": true + }, + "node_modules/postcss-resolve-nested-selector": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", + "integrity": "sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw==", + "dev": true + }, + "node_modules/postcss-safe-parser": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz", + "integrity": "sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==", + "dev": true, + "engines": { + "node": ">=12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.3.3" + } + }, + "node_modules/postcss-scss": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.6.tgz", + "integrity": "sha512-rLDPhJY4z/i4nVFZ27j9GqLxj1pwxE80eAzUNRMXtcpipFYIeowerzBgG3yJhMtObGEXidtIgbUpQ3eLDsf5OQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss-scss" + } + ], + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.4.19" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", + "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-6.0.0.tgz", + "integrity": "sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-8.0.0.tgz", + "integrity": "sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==", + "dev": true, + "dependencies": { + "find-up": "^5.0.0", + "read-pkg": "^6.0.0", + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/redent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", + "integrity": "sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==", + "dev": true, + "dependencies": { + "indent-string": "^5.0.0", + "strip-indent": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/signal-exit": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", + "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/slice-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", + "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", + "dev": true + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", + "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", + "dev": true, + "dependencies": { + "min-indent": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/style-search": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", + "integrity": "sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==", + "dev": true + }, + "node_modules/stylelint": { + "version": "15.10.1", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.10.1.tgz", + "integrity": "sha512-CYkzYrCFfA/gnOR+u9kJ1PpzwG10WLVnoxHDuBA/JiwGqdM9+yx9+ou6SE/y9YHtfv1mcLo06fdadHTOx4gBZQ==", + "dev": true, + "dependencies": { + "@csstools/css-parser-algorithms": "^2.3.0", + "@csstools/css-tokenizer": "^2.1.1", + "@csstools/media-query-list-parser": "^2.1.2", + "@csstools/selector-specificity": "^3.0.0", + "balanced-match": "^2.0.0", + "colord": "^2.9.3", + "cosmiconfig": "^8.2.0", + "css-functions-list": "^3.1.0", + "css-tree": "^2.3.1", + "debug": "^4.3.4", + "fast-glob": "^3.3.0", + "fastest-levenshtein": "^1.0.16", + "file-entry-cache": "^6.0.1", + "global-modules": "^2.0.0", + "globby": "^11.1.0", + "globjoin": "^0.1.4", + "html-tags": "^3.3.1", + "ignore": "^5.2.4", + "import-lazy": "^4.0.0", + "imurmurhash": "^0.1.4", + "is-plain-object": "^5.0.0", + "known-css-properties": "^0.27.0", + "mathml-tag-names": "^2.1.3", + "meow": "^10.1.5", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.24", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-safe-parser": "^6.0.0", + "postcss-selector-parser": "^6.0.13", + "postcss-value-parser": "^4.2.0", + "resolve-from": "^5.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "style-search": "^0.1.0", + "supports-hyperlinks": "^3.0.0", + "svg-tags": "^1.0.0", + "table": "^6.8.1", + "write-file-atomic": "^5.0.1" + }, + "bin": { + "stylelint": "bin/stylelint.mjs" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stylelint" + } + }, + "node_modules/stylelint-config-recommended": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-13.0.0.tgz", + "integrity": "sha512-EH+yRj6h3GAe/fRiyaoO2F9l9Tgg50AOFhaszyfov9v6ayXJ1IkSHwTxd7lB48FmOeSGDPLjatjO11fJpmarkQ==", + "dev": true, + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "stylelint": "^15.10.0" + } + }, + "node_modules/stylelint-config-recommended-scss": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-12.0.0.tgz", + "integrity": "sha512-5Bb2mlGy6WLa30oNeKpZvavv2lowJUsUJO25+OA68GFTemlwd1zbFsL7q0bReKipOSU3sG47hKneZ6Nd+ctrFA==", + "dev": true, + "dependencies": { + "postcss-scss": "^4.0.6", + "stylelint-config-recommended": "^12.0.0", + "stylelint-scss": "^5.0.0" + }, + "peerDependencies": { + "postcss": "^8.3.3", + "stylelint": "^15.5.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + } + } + }, + "node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", + "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", + "dev": true, + "peerDependencies": { + "stylelint": "^15.5.0" + } + }, + "node_modules/stylelint-config-standard": { + "version": "34.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-34.0.0.tgz", + "integrity": "sha512-u0VSZnVyW9VSryBG2LSO+OQTjN7zF9XJaAJRX/4EwkmU0R2jYwmBSN10acqZisDitS0CLiEiGjX7+Hrq8TAhfQ==", + "dev": true, + "dependencies": { + "stylelint-config-recommended": "^13.0.0" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "stylelint": "^15.10.0" + } + }, + "node_modules/stylelint-config-standard-scss": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-10.0.0.tgz", + "integrity": "sha512-bChBEo1p3xUVWh/wenJI+josoMk21f2yuLDGzGjmKYcALfl2u3DFltY+n4UHswYiXghqXaA8mRh+bFy/q1hQlg==", + "dev": true, + "dependencies": { + "stylelint-config-recommended-scss": "^12.0.0", + "stylelint-config-standard": "^33.0.0" + }, + "peerDependencies": { + "postcss": "^8.3.3", + "stylelint": "^15.5.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + } + } + }, + "node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", + "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", + "dev": true, + "peerDependencies": { + "stylelint": "^15.5.0" + } + }, + "node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard": { + "version": "33.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-33.0.0.tgz", + "integrity": "sha512-eyxnLWoXImUn77+ODIuW9qXBDNM+ALN68L3wT1lN2oNspZ7D9NVGlNHb2QCUn4xDug6VZLsh0tF8NyoYzkgTzg==", + "dev": true, + "dependencies": { + "stylelint-config-recommended": "^12.0.0" + }, + "peerDependencies": { + "stylelint": "^15.5.0" + } + }, + "node_modules/stylelint-scss": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-5.0.1.tgz", + "integrity": "sha512-n87iCRZrr2J7//I/QFsDXxFLnHKw633U4qvWZ+mOW6KDAp/HLj06H+6+f9zOuTYy+MdGdTuCSDROCpQIhw5fvQ==", + "dev": true, + "dependencies": { + "postcss-media-query-parser": "^0.2.3", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-selector-parser": "^6.0.13", + "postcss-value-parser": "^4.2.0" + }, + "peerDependencies": { + "stylelint": "^14.5.1 || ^15.0.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-hyperlinks": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", + "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/supports-hyperlinks/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/svg-tags": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz", + "integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==", + "dev": true + }, + "node_modules/table": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", + "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", + "dev": true, + "dependencies": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/trim-newlines": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-4.1.1.tgz", + "integrity": "sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/node_modules/@babel/code-frame/LICENSE b/node_modules/@babel/code-frame/LICENSE new file mode 100644 index 000000000..f31575ec7 --- /dev/null +++ b/node_modules/@babel/code-frame/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/code-frame/README.md b/node_modules/@babel/code-frame/README.md new file mode 100644 index 000000000..08cacb047 --- /dev/null +++ b/node_modules/@babel/code-frame/README.md @@ -0,0 +1,19 @@ +# @babel/code-frame + +> Generate errors that contain a code frame that point to source locations. + +See our website [@babel/code-frame](https://babeljs.io/docs/en/babel-code-frame) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/code-frame +``` + +or using yarn: + +```sh +yarn add @babel/code-frame --dev +``` diff --git a/node_modules/@babel/code-frame/lib/index.js b/node_modules/@babel/code-frame/lib/index.js new file mode 100644 index 000000000..cf70a04ea --- /dev/null +++ b/node_modules/@babel/code-frame/lib/index.js @@ -0,0 +1,142 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.codeFrameColumns = codeFrameColumns; +exports.default = _default; +var _highlight = require("@babel/highlight"); +let deprecationWarningShown = false; +function getDefs(chalk) { + return { + gutter: chalk.grey, + marker: chalk.red.bold, + message: chalk.red.bold + }; +} +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; +function getMarkerLines(loc, source, opts) { + const startLoc = Object.assign({ + column: 0, + line: -1 + }, loc.start); + const endLoc = Object.assign({}, startLoc, loc.end); + const { + linesAbove = 2, + linesBelow = 3 + } = opts || {}; + const startLine = startLoc.line; + const startColumn = startLoc.column; + const endLine = endLoc.line; + const endColumn = endLoc.column; + let start = Math.max(startLine - (linesAbove + 1), 0); + let end = Math.min(source.length, endLine + linesBelow); + if (startLine === -1) { + start = 0; + } + if (endLine === -1) { + end = source.length; + } + const lineDiff = endLine - startLine; + const markerLines = {}; + if (lineDiff) { + for (let i = 0; i <= lineDiff; i++) { + const lineNumber = i + startLine; + if (!startColumn) { + markerLines[lineNumber] = true; + } else if (i === 0) { + const sourceLength = source[lineNumber - 1].length; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; + } else if (i === lineDiff) { + markerLines[lineNumber] = [0, endColumn]; + } else { + const sourceLength = source[lineNumber - i].length; + markerLines[lineNumber] = [0, sourceLength]; + } + } + } else { + if (startColumn === endColumn) { + if (startColumn) { + markerLines[startLine] = [startColumn, 0]; + } else { + markerLines[startLine] = true; + } + } else { + markerLines[startLine] = [startColumn, endColumn - startColumn]; + } + } + return { + start, + end, + markerLines + }; +} +function codeFrameColumns(rawLines, loc, opts = {}) { + const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts); + const chalk = (0, _highlight.getChalk)(opts); + const defs = getDefs(chalk); + const maybeHighlight = (chalkFn, string) => { + return highlighted ? chalkFn(string) : string; + }; + const lines = rawLines.split(NEWLINE); + const { + start, + end, + markerLines + } = getMarkerLines(loc, lines, opts); + const hasColumns = loc.start && typeof loc.start.column === "number"; + const numberMaxWidth = String(end).length; + const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines; + let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => { + const number = start + 1 + index; + const paddedNumber = ` ${number}`.slice(-numberMaxWidth); + const gutter = ` ${paddedNumber} |`; + const hasMarker = markerLines[number]; + const lastMarkerLine = !markerLines[number + 1]; + if (hasMarker) { + let markerLine = ""; + if (Array.isArray(hasMarker)) { + const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); + const numberOfMarkers = hasMarker[1] || 1; + markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); + if (lastMarkerLine && opts.message) { + markerLine += " " + maybeHighlight(defs.message, opts.message); + } + } + return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); + } else { + return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`; + } + }).join("\n"); + if (opts.message && !hasColumns) { + frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; + } + if (highlighted) { + return chalk.reset(frame); + } else { + return frame; + } +} +function _default(rawLines, lineNumber, colNumber, opts = {}) { + if (!deprecationWarningShown) { + deprecationWarningShown = true; + const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; + if (process.emitWarning) { + process.emitWarning(message, "DeprecationWarning"); + } else { + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); + } + } + colNumber = Math.max(colNumber, 0); + const location = { + start: { + column: colNumber, + line: lineNumber + } + }; + return codeFrameColumns(rawLines, location, opts); +} + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/code-frame/lib/index.js.map b/node_modules/@babel/code-frame/lib/index.js.map new file mode 100644 index 000000000..68d399e1c --- /dev/null +++ b/node_modules/@babel/code-frame/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_highlight","require","deprecationWarningShown","getDefs","chalk","gutter","grey","marker","red","bold","message","NEWLINE","getMarkerLines","loc","source","opts","startLoc","Object","assign","column","line","start","endLoc","end","linesAbove","linesBelow","startLine","startColumn","endLine","endColumn","Math","max","min","length","lineDiff","markerLines","i","lineNumber","sourceLength","codeFrameColumns","rawLines","highlighted","highlightCode","forceColor","shouldHighlight","getChalk","defs","maybeHighlight","chalkFn","string","lines","split","hasColumns","numberMaxWidth","String","highlightedLines","highlight","frame","slice","map","index","number","paddedNumber","hasMarker","lastMarkerLine","markerLine","Array","isArray","markerSpacing","replace","numberOfMarkers","repeat","join","reset","_default","colNumber","process","emitWarning","deprecationError","Error","name","console","warn","location"],"sources":["../src/index.ts"],"sourcesContent":["import highlight, { shouldHighlight, getChalk } from \"@babel/highlight\";\n\ntype Chalk = ReturnType;\n\nlet deprecationWarningShown = false;\n\ntype Location = {\n column: number;\n line: number;\n};\n\ntype NodeLocation = {\n end?: Location;\n start: Location;\n};\n\nexport interface Options {\n /** Syntax highlight the code as JavaScript for terminals. default: false */\n highlightCode?: boolean;\n /** The number of lines to show above the error. default: 2 */\n linesAbove?: number;\n /** The number of lines to show below the error. default: 3 */\n linesBelow?: number;\n /**\n * Forcibly syntax highlight the code as JavaScript (for non-terminals);\n * overrides highlightCode.\n * default: false\n */\n forceColor?: boolean;\n /**\n * Pass in a string to be displayed inline (if possible) next to the\n * highlighted location in the code. If it can't be positioned inline,\n * it will be placed above the code frame.\n * default: nothing\n */\n message?: string;\n}\n\n/**\n * Chalk styles for code frame token types.\n */\nfunction getDefs(chalk: Chalk) {\n return {\n gutter: chalk.grey,\n marker: chalk.red.bold,\n message: chalk.red.bold,\n };\n}\n\n/**\n * RegExp to test for newlines in terminal.\n */\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * Extract what lines should be marked and highlighted.\n */\n\ntype MarkerLines = Record;\n\nfunction getMarkerLines(\n loc: NodeLocation,\n source: Array,\n opts: Options,\n): {\n start: number;\n end: number;\n markerLines: MarkerLines;\n} {\n const startLoc: Location = {\n column: 0,\n line: -1,\n ...loc.start,\n };\n const endLoc: Location = {\n ...startLoc,\n ...loc.end,\n };\n const { linesAbove = 2, linesBelow = 3 } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines: MarkerLines = {};\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n\n return { start, end, markerLines };\n}\n\nexport function codeFrameColumns(\n rawLines: string,\n loc: NodeLocation,\n opts: Options = {},\n): string {\n const highlighted =\n (opts.highlightCode || opts.forceColor) && shouldHighlight(opts);\n const chalk = getChalk(opts);\n const defs = getDefs(chalk);\n const maybeHighlight = (chalkFn: Chalk, string: string) => {\n return highlighted ? chalkFn(string) : string;\n };\n const lines = rawLines.split(NEWLINE);\n const { start, end, markerLines } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n\n const numberMaxWidth = String(end).length;\n\n const highlightedLines = highlighted ? highlight(rawLines, opts) : rawLines;\n\n let frame = highlightedLines\n .split(NEWLINE, end)\n .slice(start, end)\n .map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} |`;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line\n .slice(0, Math.max(hasMarker[0] - 1, 0))\n .replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n\n markerLine = [\n \"\\n \",\n maybeHighlight(defs.gutter, gutter.replace(/\\d/g, \" \")),\n \" \",\n markerSpacing,\n maybeHighlight(defs.marker, \"^\").repeat(numberOfMarkers),\n ].join(\"\");\n\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + maybeHighlight(defs.message, opts.message);\n }\n }\n return [\n maybeHighlight(defs.marker, \">\"),\n maybeHighlight(defs.gutter, gutter),\n line.length > 0 ? ` ${line}` : \"\",\n markerLine,\n ].join(\"\");\n } else {\n return ` ${maybeHighlight(defs.gutter, gutter)}${\n line.length > 0 ? ` ${line}` : \"\"\n }`;\n }\n })\n .join(\"\\n\");\n\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n\n if (highlighted) {\n return chalk.reset(frame);\n } else {\n return frame;\n }\n}\n\n/**\n * Create a code frame, adding line numbers, code highlighting, and pointing to a given position.\n */\n\nexport default function (\n rawLines: string,\n lineNumber: number,\n colNumber?: number | null,\n opts: Options = {},\n): string {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n\n const message =\n \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n\n if (process.emitWarning) {\n // A string is directly supplied to emitWarning, because when supplying an\n // Error object node throws in the tests because of different contexts\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n\n colNumber = Math.max(colNumber, 0);\n\n const location: NodeLocation = {\n start: { column: colNumber, line: lineNumber },\n };\n\n return codeFrameColumns(rawLines, location, opts);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAIA,IAAIC,uBAAuB,GAAG,KAAK;AAqCnC,SAASC,OAAOA,CAACC,KAAY,EAAE;EAC7B,OAAO;IACLC,MAAM,EAAED,KAAK,CAACE,IAAI;IACl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el/code-frame/package.json new file mode 100644 index 000000000..cc71339e1 --- /dev/null +++ b/node_modules/@babel/code-frame/package.json @@ -0,0 +1,28 @@ +{ + "name": "@babel/code-frame", + "version": "7.22.5", + "description": "Generate errors that contain a code frame that point to source locations.", + "author": "The Babel Team (https://babel.dev/team)", + "homepage": "https://babel.dev/docs/en/next/babel-code-frame", + "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-code-frame" + }, + "main": "./lib/index.js", + "dependencies": { + "@babel/highlight": "^7.22.5" + }, + "devDependencies": { + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/LICENSE b/node_modules/@babel/helper-validator-identifier/LICENSE new file mode 100644 index 000000000..f31575ec7 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/helper-validator-identifier/README.md b/node_modules/@babel/helper-validator-identifier/README.md new file mode 100644 index 000000000..4f704c428 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/README.md @@ -0,0 +1,19 @@ +# @babel/helper-validator-identifier + +> Validate identifier/keywords name + +See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/babel-helper-validator-identifier) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-validator-identifier +``` + +or using yarn: + +```sh +yarn add @babel/helper-validator-identifier +``` diff --git a/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/node_modules/@babel/helper-validator-identifier/lib/identifier.js new file mode 100644 index 000000000..cd1f4500a --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/identifier.js @@ -0,0 +1,70 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isIdentifierChar = isIdentifierChar; +exports.isIdentifierName = isIdentifierName; +exports.isIdentifierStart = isIdentifierStart; +let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; +const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; +const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191]; +const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; +function isInAstralSet(code, set) { + let pos = 0x10000; + for (let i = 0, length = set.length; i < length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } + return false; +} +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes); +} +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} +function isIdentifierName(name) { + let isFirst = true; + for (let i = 0; i < name.length; i++) { + let cp = name.charCodeAt(i); + if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) { + const trail = name.charCodeAt(++i); + if ((trail & 0xfc00) === 0xdc00) { + cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); + } + } + if (isFirst) { + isFirst = false; + if (!isIdentifierStart(cp)) { + return false; + } + } else if (!isIdentifierChar(cp)) { + return false; + } + } + return !isFirst; +} + +//# sourceMappingURL=identifier.js.map diff --git a/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map b/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map new file mode 100644 index 000000000..dd0449ddc --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map @@ -0,0 +1 @@ +{"version":3,"names":["nonASCIIidentifierStartChars","nonASCIIidentifierChars","nonASCIIidentifierStart","RegExp","nonASCIIidentifier","astralIdentifierStartCodes","astralIdentifierCodes","isInAstralSet","code","set","pos","i","length","isIdentifierStart","test","String","fromCharCode","isIdentifierChar","isIdentifierName","name","isFirst","cp","charCodeAt","trail"],"sources":["../src/identifier.ts"],"sourcesContent":["import * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\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AE,GAAGF,IAAI,CAACG,UAAU,CAACX,CAAC,CAAC;IAC3B,IAAI,CAACU,EAAE,GAAG,MAAM,MAAM,MAAM,IAAIV,CAAC,GAAG,CAAC,GAAGQ,IAAI,CAACP,MAAM,EAAE;MACnD,MAAMW,KAAK,GAAGJ,IAAI,CAACG,UAAU,CAAC,EAAEX,CAAC,CAAC;MAClC,IAAI,CAACY,KAAK,GAAG,MAAM,MAAM,MAAM,EAAE;QAC/BF,EAAE,GAAG,OAAO,IAAI,CAACA,EAAE,GAAG,KAAK,KAAK,EAAE,CAAC,IAAIE,KAAK,GAAG,KAAK,CAAC;MACvD;IACF;IACA,IAAIH,OAAO,EAAE;MACXA,OAAO,GAAG,KAAK;MACf,IAAI,CAACP,iBAAiB,CAACQ,EAAE,CAAC,EAAE;QAC1B,OAAO,KAAK;MACd;IACF,CAAC,MAAM,IAAI,CAACJ,gBAAgB,CAACI,EAAE,CAAC,EAAE;MAChC,OAAO,KAAK;IACd;EACF;EACA,OAAO,CAACD,OAAO;AACjB"} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/lib/index.js b/node_modules/@babel/helper-validator-identifier/lib/index.js new file mode 100644 index 000000000..c677cea19 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/index.js @@ -0,0 +1,57 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "isIdentifierChar", { + enumerable: true, + get: function () { + return _identifier.isIdentifierChar; + } +}); +Object.defineProperty(exports, "isIdentifierName", { + enumerable: true, + get: function () { + return _identifier.isIdentifierName; + } +}); +Object.defineProperty(exports, "isIdentifierStart", { + enumerable: true, + get: function () { + return _identifier.isIdentifierStart; + } +}); +Object.defineProperty(exports, "isKeyword", { + enumerable: true, + get: function () { + return _keyword.isKeyword; + } +}); +Object.defineProperty(exports, "isReservedWord", { + enumerable: true, + get: function () { + return _keyword.isReservedWord; + } +}); +Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictBindOnlyReservedWord; + } +}); +Object.defineProperty(exports, "isStrictBindReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictBindReservedWord; + } +}); +Object.defineProperty(exports, "isStrictReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictReservedWord; + } +}); +var _identifier = require("./identifier"); +var _keyword = require("./keyword"); + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-validator-identifier/lib/index.js.map b/node_modules/@babel/helper-validator-identifier/lib/index.js.map new file mode 100644 index 000000000..cc9ad3d91 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_identifier","require","_keyword"],"sources":["../src/index.ts"],"sourcesContent":["export {\n isIdentifierName,\n isIdentifierChar,\n isIdentifierStart,\n} from \"./identifier\";\nexport {\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"./keyword\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA"} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/node_modules/@babel/helper-validator-identifier/lib/keyword.js new file mode 100644 index 000000000..054cf8474 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/keyword.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isKeyword = isKeyword; +exports.isReservedWord = isReservedWord; +exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; +exports.isStrictBindReservedWord = isStrictBindReservedWord; +exports.isStrictReservedWord = isStrictReservedWord; +const reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] +}; +const keywords = new Set(reservedWords.keyword); +const reservedWordsStrictSet = new Set(reservedWords.strict); +const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); +function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; +} +function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); +} +function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); +} +function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); +} +function isKeyword(word) { + return keywords.has(word); +} + +//# sourceMappingURL=keyword.js.map diff --git a/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map b/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map new file mode 100644 index 000000000..52a9e991c --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map @@ -0,0 +1 @@ +{"version":3,"names":["reservedWords","keyword","strict","strictBind","keywords","Set","reservedWordsStrictSet","reservedWordsStrictBindSet","isReservedWord","word","inModule","isStrictReservedWord","has","isStrictBindOnlyReservedWord","isStrictBindReservedWord","isKeyword"],"sources":["../src/keyword.ts"],"sourcesContent":["const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n"],"mappings":";;;;;;;;;;AAAA,MAAMA,aAAa,GAAG;EACpBC,OAAO,EAAE,CACP,OAAO,EACP,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,EACT,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,QAAQ,CACT;EACDC,MAAM,EAAE,CACN,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,CACR;EACDC,UAAU,EAAE,CAAC,MAAM,EAAE,WAAW;AAClC,CAAC;AACD,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAACL,aAAa,CAACC,OAAO,CAAC;AAC/C,MAAMK,sBAAsB,GAAG,IAAID,GAAG,CAACL,aAAa,CAACE,MAAM,CAAC;AAC5D,MAAMK,0BAA0B,GAAG,IAAIF,GAAG,CAACL,aAAa,CAACG,UAAU,CAAC;AAK7D,SAASK,cAAcA,CAACC,IAAY,EAAEC,QAAiB,EAAW;EACvE,OAAQA,QAAQ,IAAID,IAAI,KAAK,OAAO,IAAKA,IAAI,KAAK,MAAM;AAC1D;AAOO,SAASE,oBAAoBA,CAACF,IAAY,EAAEC,QAAiB,EAAW;EAC7E,OAAOF,cAAc,CAACC,IAAI,EAAEC,QAAQ,CAAC,IAAIJ,sBAAsB,CAACM,GAAG,CAACH,IAAI,CAAC;AAC3E;AAMO,SAASI,4BAA4BA,CAACJ,IAAY,EAAW;EAClE,OAAOF,0BAA0B,CAACK,GAAG,CAACH,IAAI,CAAC;AAC7C;AAOO,SAASK,wBAAwBA,CACtCL,IAAY,EACZC,QAAiB,EACR;EACT,OACEC,oBAAoB,CAACF,IAAI,EAAEC,QAAQ,CAAC,IAAIG,4BAA4B,CAACJ,IAAI,CAAC;AAE9E;AAEO,SAASM,SAASA,CAACN,IAAY,EAAW;EAC/C,OAAOL,QAAQ,CAACQ,GAAG,CAACH,IAAI,CAAC;AAC3B"} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/package.json b/node_modules/@babel/helper-validator-identifier/package.json new file mode 100644 index 000000000..7579010dc --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/package.json @@ -0,0 +1,28 @@ +{ + "name": "@babel/helper-validator-identifier", + "version": "7.22.5", + "description": "Validate identifier/keywords name", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-validator-identifier" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "exports": { + ".": "./lib/index.js", + "./package.json": "./package.json" + }, + "devDependencies": { + "@unicode/unicode-15.0.0": "^1.3.1", + "charcodes": "^0.2.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "author": "The Babel Team (https://babel.dev/team)", + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js b/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js new file mode 100644 index 000000000..aca8710b2 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js @@ -0,0 +1,75 @@ +"use strict"; + +// Always use the latest available version of Unicode! +// https://tc39.github.io/ecma262/#sec-conformance +const version = "15.0.0"; + +const start = require("@unicode/unicode-" + + version + + "/Binary_Property/ID_Start/code-points.js").filter(function (ch) { + return ch > 0x7f; +}); +let last = -1; +const cont = [0x200c, 0x200d].concat( + require("@unicode/unicode-" + + version + + "/Binary_Property/ID_Continue/code-points.js").filter(function (ch) { + return ch > 0x7f && search(start, ch, last + 1) == -1; + }) +); + +function search(arr, ch, starting) { + for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) { + if (arr[i] === ch) return i; + } + return -1; +} + +function pad(str, width) { + while (str.length < width) str = "0" + str; + return str; +} + +function esc(code) { + const hex = code.toString(16); + if (hex.length <= 2) return "\\x" + pad(hex, 2); + else return "\\u" + pad(hex, 4); +} + +function generate(chars) { + const astral = []; + let re = ""; + for (let i = 0, at = 0x10000; i < chars.length; i++) { + const from = chars[i]; + let to = from; + while (i < chars.length - 1 && chars[i + 1] == to + 1) { + i++; + to++; + } + if (to <= 0xffff) { + if (from == to) re += esc(from); + else if (from + 1 == to) re += esc(from) + esc(to); + else re += esc(from) + "-" + esc(to); + } else { + astral.push(from - at, to - from); + at = to; + } + } + return { nonASCII: re, astral: astral }; +} + +const startData = generate(start); +const contData = generate(cont); + +console.log("/* prettier-ignore */"); +console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";'); +console.log("/* prettier-ignore */"); +console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";'); +console.log("/* prettier-ignore */"); +console.log( + "const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";" +); +console.log("/* prettier-ignore */"); +console.log( + "const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";" +); diff --git a/node_modules/@babel/highlight/LICENSE b/node_modules/@babel/highlight/LICENSE new file mode 100644 index 000000000..f31575ec7 --- /dev/null +++ b/node_modules/@babel/highlight/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/highlight/README.md b/node_modules/@babel/highlight/README.md new file mode 100644 index 000000000..f8887ad2c --- /dev/null +++ b/node_modules/@babel/highlight/README.md @@ -0,0 +1,19 @@ +# @babel/highlight + +> Syntax highlight JavaScript strings for output in terminals. + +See our website [@babel/highlight](https://babeljs.io/docs/en/babel-highlight) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/highlight +``` + +or using yarn: + +```sh +yarn add @babel/highlight --dev +``` diff --git a/node_modules/@babel/highlight/lib/index.js b/node_modules/@babel/highlight/lib/index.js new file mode 100644 index 000000000..60bd83510 --- /dev/null +++ b/node_modules/@babel/highlight/lib/index.js @@ -0,0 +1,96 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = highlight; +exports.getChalk = getChalk; +exports.shouldHighlight = shouldHighlight; +var _jsTokens = require("js-tokens"); +var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); +var _chalk = require("chalk"); +const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); +function getDefs(chalk) { + return { + keyword: chalk.cyan, + capitalized: chalk.yellow, + jsxIdentifier: chalk.yellow, + punctuator: chalk.yellow, + number: chalk.magenta, + string: chalk.green, + regex: chalk.magenta, + comment: chalk.grey, + invalid: chalk.white.bgRed.bold + }; +} +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; +const BRACKET = /^[()[\]{}]$/; +let tokenize; +{ + const JSX_TAG = /^[a-z][\w-]*$/i; + const getTokenType = function (token, offset, text) { + if (token.type === "name") { + if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) { + return "keyword"; + } + if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) == " colorize(str)).join("\n"); + } else { + highlighted += value; + } + } + return highlighted; +} +function shouldHighlight(options) { + return !!_chalk.supportsColor || options.forceColor; +} +function getChalk(options) { + return options.forceColor ? new _chalk.constructor({ + enabled: true, + level: 1 + }) : _chalk; +} +function highlight(code, options = {}) { + if (code !== "" && shouldHighlight(options)) { + const chalk = getChalk(options); + const defs = getDefs(chalk); + return highlightTokens(defs, code); + } else { + return code; + } +} + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/highlight/lib/index.js.map b/node_modules/@babel/highlight/lib/index.js.map new file mode 100644 index 000000000..f39fafe9c --- /dev/null +++ b/node_modules/@babel/highlight/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_jsTokens","require","_helperValidatorIdentifier","_chalk","sometimesKeywords","Set","getDefs","chalk","keyword","cyan","capitalized","yellow","jsxIdentifier","punctuator","number","magenta","string","green","regex","comment","grey","invalid","white","bgRed","bold","NEWLINE","BRACKET","tokenize","JSX_TAG","getTokenType","token","offset","text","type","isKeyword","value","isStrictReservedWord","has","test","slice","toLowerCase","match","jsTokens","default","exec","matchToToken","index","highlightTokens","defs","highlighted","colorize","split","map","str","join","shouldHighlight","options","Chalk","supportsColor","forceColor","getChalk","constructor","enabled","level","highlight","code"],"sources":["../src/index.ts"],"sourcesContent":["/// \n\nimport type { Token as JSToken, JSXToken } from \"js-tokens\";\nimport jsTokens from \"js-tokens\";\n\nimport {\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\nimport Chalk from \"chalk\";\n\ntype ChalkClass = ReturnType;\n\n/**\n * Names that are always allowed as identifiers, but also appear as keywords\n * within certain syntactic productions.\n *\n * https://tc39.es/ecma262/#sec-keywords-and-reserved-words\n *\n * `target` has been omitted since it is very likely going to be a false\n * positive.\n */\nconst sometimesKeywords = new Set([\"as\", \"async\", \"from\", \"get\", \"of\", \"set\"]);\n\ntype InternalTokenType =\n | \"keyword\"\n | \"capitalized\"\n | \"jsxIdentifier\"\n | \"punctuator\"\n | \"number\"\n | \"string\"\n | \"regex\"\n | \"comment\"\n | \"invalid\";\n\ntype Token = {\n type: InternalTokenType | \"uncolored\";\n value: string;\n};\n/**\n * Chalk styles for token types.\n */\nfunction getDefs(chalk: ChalkClass): Record {\n return {\n keyword: chalk.cyan,\n capitalized: chalk.yellow,\n jsxIdentifier: chalk.yellow,\n punctuator: chalk.yellow,\n number: chalk.magenta,\n string: chalk.green,\n regex: chalk.magenta,\n comment: chalk.grey,\n invalid: chalk.white.bgRed.bold,\n };\n}\n\n/**\n * RegExp to test for newlines in terminal.\n */\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * RegExp to test for the three types of brackets.\n */\nconst BRACKET = /^[()[\\]{}]$/;\n\nlet tokenize: (\n text: string,\n) => Generator<{ type: InternalTokenType | \"uncolored\"; value: string }>;\n\nif (process.env.BABEL_8_BREAKING) {\n /**\n * Get the type of token, specifying punctuator type.\n */\n const getTokenType = function (\n token: JSToken | JSXToken,\n ): InternalTokenType | \"uncolored\" {\n if (token.type === \"IdentifierName\") {\n if (\n isKeyword(token.value) ||\n isStrictReservedWord(token.value, true) ||\n sometimesKeywords.has(token.value)\n ) {\n return \"keyword\";\n }\n\n if (token.value[0] !== token.value[0].toLowerCase()) {\n return \"capitalized\";\n }\n }\n\n if (token.type === \"Punctuator\" && BRACKET.test(token.value)) {\n return \"uncolored\";\n }\n\n if (token.type === \"Invalid\" && token.value === \"@\") {\n return \"punctuator\";\n }\n\n switch (token.type) {\n case \"NumericLiteral\":\n return \"number\";\n\n case \"StringLiteral\":\n case \"JSXString\":\n case \"NoSubstitutionTemplate\":\n return \"string\";\n\n case \"RegularExpressionLiteral\":\n return \"regex\";\n\n case \"Punctuator\":\n case \"JSXPunctuator\":\n return \"punctuator\";\n\n case \"MultiLineComment\":\n case \"SingleLineComment\":\n return \"comment\";\n\n case \"Invalid\":\n case \"JSXInvalid\":\n return \"invalid\";\n\n case \"JSXIdentifier\":\n return \"jsxIdentifier\";\n\n default:\n return \"uncolored\";\n }\n };\n\n /**\n * Turn a string of JS into an array of objects.\n */\n tokenize = function* (text: string): Generator {\n for (const token of jsTokens(text, { jsx: true })) {\n switch (token.type) {\n case \"TemplateHead\":\n yield { type: \"string\", value: token.value.slice(0, -2) };\n yield { type: \"punctuator\", value: \"${\" };\n break;\n\n case \"TemplateMiddle\":\n yield { type: \"punctuator\", value: \"}\" };\n yield { type: \"string\", value: token.value.slice(1, -2) };\n yield { type: \"punctuator\", value: \"${\" };\n break;\n\n case \"TemplateTail\":\n yield { type: \"punctuator\", value: \"}\" };\n yield { type: \"string\", value: token.value.slice(1) };\n break;\n\n default:\n yield {\n type: getTokenType(token),\n value: token.value,\n };\n }\n }\n };\n} else {\n /**\n * RegExp to test for what seems to be a JSX tag name.\n */\n const JSX_TAG = /^[a-z][\\w-]*$/i;\n\n // The token here is defined in js-tokens@4. However we don't bother\n // typing it since the whole block will be removed in Babel 8\n const getTokenType = function (token: any, offset: number, text: string) {\n if (token.type === \"name\") {\n if (\n isKeyword(token.value) ||\n isStrictReservedWord(token.value, true) ||\n sometimesKeywords.has(token.value)\n ) {\n return \"keyword\";\n }\n\n if (\n JSX_TAG.test(token.value) &&\n (text[offset - 1] === \"<\" || text.slice(offset - 2, offset) == \", text: string) {\n let highlighted = \"\";\n\n for (const { type, value } of tokenize(text)) {\n const colorize = defs[type];\n if (colorize) {\n highlighted += value\n .split(NEWLINE)\n .map(str => colorize(str))\n .join(\"\\n\");\n } else {\n highlighted += value;\n }\n }\n\n return highlighted;\n}\n\n/**\n * Highlight `text` using the token definitions in `defs`.\n */\n\ntype Options = {\n forceColor?: boolean;\n};\n\n/**\n * Whether the code should be highlighted given the passed options.\n */\nexport function shouldHighlight(options: Options): boolean {\n return !!Chalk.supportsColor || options.forceColor;\n}\n\n/**\n * The Chalk instance that should be used given the passed options.\n */\nexport function getChalk(options: Options) {\n return options.forceColor\n ? new Chalk.constructor({ enabled: true, level: 1 })\n : Chalk;\n}\n\n/**\n * Highlight `code`.\n */\nexport default function highlight(code: string, options: Options = {}): string {\n if (code !== \"\" && shouldHighlight(options)) {\n const chalk = getChalk(options);\n const defs = getDefs(chalk);\n return highlightTokens(defs, code);\n } else {\n return code;\n }\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,0BAAA,GAAAD,OAAA;AAIA,IAAAE,MAAA,G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AACC,GAAG,IAAIH,QAAQ,CAACG,GAAG,CAAC,CAAC,CACzBC,IAAI,CAAC,IAAI,CAAC;IACf,CAAC,MAAM;MACLL,WAAW,IAAId,KAAK;IACtB;EACF;EAEA,OAAOc,WAAW;AACpB;AAaO,SAASM,eAAeA,CAACC,OAAgB,EAAW;EACzD,OAAO,CAAC,CAACC,MAAK,CAACC,aAAa,IAAIF,OAAO,CAACG,UAAU;AACpD;AAKO,SAASC,QAAQA,CAACJ,OAAgB,EAAE;EACzC,OAAOA,OAAO,CAACG,UAAU,GACrB,IAAIF,MAAK,CAACI,WAAW,CAAC;IAAEC,OAAO,EAAE,IAAI;IAAEC,KAAK,EAAE;EAAE,CAAC,CAAC,GAClDN,MAAK;AACX;AAKe,SAASO,SAASA,CAACC,IAAY,EAAET,OAAgB,GAAG,CAAC,CAAC,EAAU;EAC7E,IAAIS,IAAI,KAAK,EAAE,IAAIV,eAAe,CAACC,OAAO,CAAC,EAAE;IAC3C,MAAMjD,KAAK,GAAGqD,QAAQ,CAACJ,OAAO,CAAC;IAC/B,MAAMR,IAAI,GAAG1C,OAAO,CAACC,KAAK,CAAC;IAC3B,OAAOwC,eAAe,CAACC,IAAI,EAAEiB,IAAI,CAAC;EACpC,CAAC,MAAM;IACL,OAAOA,IAAI;EACb;AACF"} \ No newline at end of file diff --git a/node_modules/@babel/highlight/package.json b/node_modules/@babel/highlight/package.json new file mode 100644 index 000000000..21220e73f --- /dev/null +++ b/node_modules/@babel/highlight/package.json @@ -0,0 +1,30 @@ +{ + "name": "@babel/highlight", + "version": "7.22.5", + "description": "Syntax highlight JavaScript strings for output in terminals.", + "author": "The Babel Team (https://babel.dev/team)", + "homepage": "https://babel.dev/docs/en/next/babel-highlight", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-highlight" + }, + "main": "./lib/index.js", + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "devDependencies": { + "@types/chalk": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md b/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md new file mode 100644 index 000000000..5bf94441a --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md @@ -0,0 +1,53 @@ +# Changes to CSS Parser Algorithms + +### 2.3.0 + +_July 3, 2023_ + +- Add `sourceIndices` helper function. + +This makes it easier to get the start and end indices of a node in the source string. +This function accepts any node that can be converted into an array of tokens. + +### 2.2.0 + +_June 1, 2023_ + +- Add `state` to `walk` methods. + +This makes it possible pass down information from a parent structure to children. +e.g. you can set `entry.state.isInCalcExpression = true` for `calc((10 + 5) / 2)` when walking the `FunctionNode` for `calc`. + +### 2.1.1 + +_April 10, 2023_ + +- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) + +### 2.1.0 + +_March 25, 2023_ + +- Add `replaceComponentValues` utility function. +- Add `stringify` utility function. + +### 2.0.1 + +_January 28, 2023_ + +- Improve `types` declaration in `package.json` + +### 2.0.0 + +_January 19, 2023_ + +- Fix: Removes `UnclosedFunctionNode` and `UnclosedSimpleBlockNode`. (breaking) +- Change the `ParseError` interface, this is now a subclass of `Error` (breaking) +- Change `nameTokenValue` in `FunctionNode` to `getName` (breaking) +- Fix: Do not discard empty items in comma separated lists. + +### 1.0.0 + +_November 14, 2022_ + +- Initial version diff --git a/node_modules/@csstools/css-parser-algorithms/LICENSE.md b/node_modules/@csstools/css-parser-algorithms/LICENSE.md new file mode 100644 index 000000000..af5411fa2 --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2022 Romain Menke, Antonio Laguna + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@csstools/css-parser-algorithms/README.md b/node_modules/@csstools/css-parser-algorithms/README.md new file mode 100644 index 000000000..b63c2ce39 --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/README.md @@ -0,0 +1,115 @@ +# CSS Parser Algorithms + +[npm version][npm-url] +[Build Status][cli-url] +[Discord][discord] + +Implemented from : https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/ + +## Usage + +Add [CSS Parser Algorithms] to your project: + +```bash +npm install @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev +``` + +[CSS Parser Algorithms] only accepts tokenized CSS. +It must be used together with `@csstools/css-tokenizer`. + + +```js +import { tokenizer, TokenType } from '@csstools/css-tokenizer'; +import { parseComponentValue } from '@csstools/css-parser-algorithms'; + +const myCSS = `@media only screen and (min-width: 768rem) { + .foo { + content: 'Some content!' !important; + } +} +`; + +const t = tokenizer({ + css: myCSS, +}); + +const tokens = []; + +{ + while (!t.endOfFile()) { + tokens.push(t.nextToken()); + } + + tokens.push(t.nextToken()); // EOF-token +} + +const options = { + onParseError: ((err) => { + throw err; + }), +}; + +const result = parseComponentValue(tokens, options); + +console.log(result); +``` + +### Available functions + +- [`parseComponentValue`](https://www.w3.org/TR/css-syntax-3/#parse-component-value) +- [`parseListOfComponentValues`](https://www.w3.org/TR/css-syntax-3/#parse-list-of-component-values) +- [`parseCommaSeparatedListOfComponentValues`](https://www.w3.org/TR/css-syntax-3/#parse-comma-separated-list-of-component-values) + +### Utilities + +#### `gatherNodeAncestry` + +The AST does not expose the entire ancestry of each node. +The walker methods do provide access to the current parent, but also not the entire ancestry. + +To gather the entire ancestry for a a given sub tree of the AST you can use `gatherNodeAncestry`. +The result is a `Map` with the child nodes as keys and the parents as values. +This allows you to lookup any ancestor of any node. + +```css +import { parseComponentValue } from '@csstools/css-parser-algorithms'; + +const result = parseComponentValue(tokens, options); +const ancestry = gatherNodeAncestry(result); +``` + +### Options + +```ts +{ + onParseError?: (error: ParseError) => void +} +``` + +#### `onParseError` + +The parser algorithms are forgiving and won't stop when a parse error is encountered. +Parse errors also aren't tokens. + +To receive parsing error information you can set a callback. + +Parser errors will try to inform you about the point in the parsing logic the error happened. +This tells you the kind of error. + +## Goals and non-goals + +Things this package aims to be: +- specification compliant CSS parser +- a reliable low level package to be used in CSS sub-grammars + +What it is not: +- opinionated +- fast +- small +- a replacement for PostCSS (PostCSS is fast and also an ecosystem) + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/css-parser-algorithms + +[CSS Parser Algorithms]: https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms diff --git a/node_modules/@csstools/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts new file mode 100644 index 000000000..59cdf944a --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts @@ -0,0 +1,118 @@ +import { CSSToken, TokenFunction } from '@csstools/css-tokenizer'; +import { Context } from '../interfaces/context'; +import { ComponentValueType } from '../util/component-value-type'; +export type ContainerNode = FunctionNode | SimpleBlockNode; +export type ComponentValue = FunctionNode | SimpleBlockNode | WhitespaceNode | CommentNode | TokenNode; +export declare function consumeComponentValue(ctx: Context, tokens: Array): { + advance: number; + node: ComponentValue; +}; +export declare class FunctionNode { + type: ComponentValueType; + name: TokenFunction; + endToken: CSSToken; + value: Array; + constructor(name: TokenFunction, endToken: CSSToken, value: Array); + getName(): string; + /** + * Normalize the current Function: + * - if the "endToken" is EOF, replace with a ")-token" + */ + normalize(): void; + tokens(): Array; + toString(): string; + indexOf(item: ComponentValue): number | string; + at(index: number | string): ComponentValue | undefined; + walk>(cb: (entry: { + node: ComponentValue; + parent: ContainerNode; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isFunctionNode(): this is FunctionNode; + static isFunctionNode(x: unknown): x is FunctionNode; +} +export declare function consumeFunction(ctx: Context, tokens: Array): { + advance: number; + node: FunctionNode; +}; +export declare class SimpleBlockNode { + type: ComponentValueType; + startToken: CSSToken; + endToken: CSSToken; + value: Array; + constructor(startToken: CSSToken, endToken: CSSToken, value: Array); + /** + * Normalize the current Simple Block: + * - if the "endToken" is EOF, replace with the mirror token of the "startToken" + */ + normalize(): void; + tokens(): Array; + toString(): string; + indexOf(item: ComponentValue): number | string; + at(index: number | string): ComponentValue | undefined; + walk>(cb: (entry: { + node: ComponentValue; + parent: ContainerNode; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isSimpleBlockNode(): this is SimpleBlockNode; + static isSimpleBlockNode(x: unknown): x is SimpleBlockNode; +} +/** https://www.w3.org/TR/css-syntax-3/#consume-simple-block */ +export declare function consumeSimpleBlock(ctx: Context, tokens: Array): { + advance: number; + node: SimpleBlockNode; +}; +export declare class WhitespaceNode { + type: ComponentValueType; + value: Array; + constructor(value: Array); + tokens(): Array; + toString(): string; + toJSON(): { + type: ComponentValueType; + tokens: CSSToken[]; + }; + isWhitespaceNode(): this is WhitespaceNode; + static isWhitespaceNode(x: unknown): x is WhitespaceNode; +} +export declare function consumeWhitespace(ctx: Context, tokens: Array): { + advance: number; + node: WhitespaceNode; +}; +export declare class CommentNode { + type: ComponentValueType; + value: CSSToken; + constructor(value: CSSToken); + tokens(): Array; + toString(): string; + toJSON(): { + type: ComponentValueType; + tokens: CSSToken[]; + }; + isCommentNode(): this is CommentNode; + static isCommentNode(x: unknown): x is CommentNode; +} +export declare function consumeComment(ctx: Context, tokens: Array): { + advance: number; + node: CommentNode; +}; +export declare function consumeAllCommentsAndWhitespace(ctx: Context, tokens: Array): { + advance: number; + nodes: Array; +}; +export declare class TokenNode { + type: ComponentValueType; + value: CSSToken; + constructor(value: CSSToken); + tokens(): Array; + toString(): string; + toJSON(): { + type: ComponentValueType; + tokens: CSSToken[]; + }; + isTokenNode(): this is TokenNode; + static isTokenNode(x: unknown): x is TokenNode; +} diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.cjs b/node_modules/@csstools/css-parser-algorithms/dist/index.cjs new file mode 100644 index 000000000..4405dce4d --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var e,n=require("@csstools/css-tokenizer");function consumeComponentValue(e,o){const t=o[0];if(t[0]===n.TokenType.OpenParen||t[0]===n.TokenType.OpenCurly||t[0]===n.TokenType.OpenSquare){const n=consumeSimpleBlock(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Function){const n=consumeFunction(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Whitespace){const n=consumeWhitespace(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Comment){const n=consumeComment(e,o);return{advance:n.advance,node:n.node}}return{advance:1,node:new TokenNode(t)}}exports.ComponentValueType=void 0,(e=exports.ComponentValueType||(exports.ComponentValueType={})).Function="function",e.SimpleBlock="simple-block",e.Whitespace="whitespace",e.Comment="comment",e.Token="token";class FunctionNode{type=exports.ComponentValueType.Function;name;endToken;value;constructor(e,n,o){this.name=e,this.endToken=n,this.value=o}getName(){return this.name[4].value}normalize(){this.endToken[0]===n.TokenType.EOF&&(this.endToken=[n.TokenType.CloseParen,")",-1,-1,void 0])}tokens(){return this.endToken[0]===n.TokenType.EOF?[this.name,...this.value.flatMap((e=>e.tokens()))]:[this.name,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n.isToken(e)?n.stringify(e):e.toString())).join("");return n.stringify(this.name)+e+n.stringify(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}walk(e,n){let o=!1;if(this.value.forEach(((t,s)=>{if(o)return;let i;n&&(i={...n}),!1!==e({node:t,parent:this,state:i},s)?"walk"in t&&!1===t.walk(e,i)&&(o=!0):o=!0})),o)return!1}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isFunctionNode(){return FunctionNode.isFunctionNode(this)}static isFunctionNode(e){return!!e&&(e instanceof FunctionNode&&e.type===exports.ComponentValueType.Function)}}function consumeFunction(e,o){const t=[];let s=1;for(;;){const i=o[s];if(!i||i[0]===n.TokenType.EOF)return e.onParseError(new n.ParseError("Unexpected EOF while consuming a function.",o[0][2],o[o.length-1][3],["5.4.9. Consume a function","Unexpected EOF"])),{advance:o.length,node:new FunctionNode(o[0],i,t)};if(i[0]===n.TokenType.CloseParen)return{advance:s+1,node:new FunctionNode(o[0],i,t)};if(i[0]===n.TokenType.Comment||i[0]===n.TokenType.Whitespace){const n=consumeAllCommentsAndWhitespace(e,o.slice(s));s+=n.advance,t.push(...n.nodes);continue}const r=consumeComponentValue(e,o.slice(s));s+=r.advance,t.push(r.node)}}class SimpleBlockNode{type=exports.ComponentValueType.SimpleBlock;startToken;endToken;value;constructor(e,n,o){this.startToken=e,this.endToken=n,this.value=o}normalize(){if(this.endToken[0]===n.TokenType.EOF){const e=n.mirrorVariant(this.startToken);e&&(this.endToken=e)}}tokens(){return this.endToken[0]===n.TokenType.EOF?[this.startToken,...this.value.flatMap((e=>e.tokens()))]:[this.startToken,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n.isToken(e)?n.stringify(e):e.toString())).join("");return n.stringify(this.startToken)+e+n.stringify(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}walk(e,n){let o=!1;if(this.value.forEach(((t,s)=>{if(o)return;let i;n&&(i={...n}),!1!==e({node:t,parent:this,state:i},s)?"walk"in t&&!1===t.walk(e,i)&&(o=!0):o=!0})),o)return!1}toJSON(){return{type:this.type,startToken:this.startToken,tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isSimpleBlockNode(){return SimpleBlockNode.isSimpleBlockNode(this)}static isSimpleBlockNode(e){return!!e&&(e instanceof SimpleBlockNode&&e.type===exports.ComponentValueType.SimpleBlock)}}function consumeSimpleBlock(e,o){const t=n.mirrorVariantType(o[0][0]);if(!t)throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");const s=[];let i=1;for(;;){const r=o[i];if(!r||r[0]===n.TokenType.EOF)return e.onParseError(new n.ParseError("Unexpected EOF while consuming a simple block.",o[0][2],o[o.length-1][3],["5.4.8. Consume a simple block","Unexpected EOF"])),{advance:o.length,node:new SimpleBlockNode(o[0],r,s)};if(r[0]===t)return{advance:i+1,node:new SimpleBlockNode(o[0],r,s)};if(r[0]===n.TokenType.Comment||r[0]===n.TokenType.Whitespace){const n=consumeAllCommentsAndWhitespace(e,o.slice(i));i+=n.advance,s.push(...n.nodes);continue}const a=consumeComponentValue(e,o.slice(i));i+=a.advance,s.push(a.node)}}class WhitespaceNode{type=exports.ComponentValueType.Whitespace;value;constructor(e){this.value=e}tokens(){return this.value}toString(){return n.stringify(...this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isWhitespaceNode(){return WhitespaceNode.isWhitespaceNode(this)}static isWhitespaceNode(e){return!!e&&(e instanceof WhitespaceNode&&e.type===exports.ComponentValueType.Whitespace)}}function consumeWhitespace(e,o){let t=0;for(;;){if(o[t][0]!==n.TokenType.Whitespace)return{advance:t,node:new WhitespaceNode(o.slice(0,t))};t++}}class CommentNode{type=exports.ComponentValueType.Comment;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return n.stringify(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isCommentNode(){return CommentNode.isCommentNode(this)}static isCommentNode(e){return!!e&&(e instanceof CommentNode&&e.type===exports.ComponentValueType.Comment)}}function consumeComment(e,n){return{advance:1,node:new CommentNode(n[0])}}function consumeAllCommentsAndWhitespace(e,o){const t=[];let s=0;for(;;)if(o[s][0]!==n.TokenType.Whitespace){if(o[s][0]!==n.TokenType.Comment)return{advance:s,nodes:t};t.push(new CommentNode(o[s])),s++}else{const e=consumeWhitespace(0,o.slice(s));s+=e.advance,t.push(e.node)}}class TokenNode{type=exports.ComponentValueType.Token;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return n.stringify(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isTokenNode(){return TokenNode.isTokenNode(this)}static isTokenNode(e){return!!e&&(e instanceof TokenNode&&e.type===exports.ComponentValueType.Token)}}function isSimpleBlockNode(e){return SimpleBlockNode.isSimpleBlockNode(e)}function isFunctionNode(e){return FunctionNode.isFunctionNode(e)}exports.CommentNode=CommentNode,exports.FunctionNode=FunctionNode,exports.SimpleBlockNode=SimpleBlockNode,exports.TokenNode=TokenNode,exports.WhitespaceNode=WhitespaceNode,exports.consumeAllCommentsAndWhitespace=consumeAllCommentsAndWhitespace,exports.consumeComment=consumeComment,exports.consumeComponentValue=consumeComponentValue,exports.consumeFunction=consumeFunction,exports.consumeSimpleBlock=consumeSimpleBlock,exports.consumeWhitespace=consumeWhitespace,exports.gatherNodeAncestry=function gatherNodeAncestry(e){const n=new Map;return e.walk((e=>{Array.isArray(e.node)?e.node.forEach((o=>{n.set(o,e.parent)})):n.set(e.node,e.parent)})),n},exports.isCommentNode=function isCommentNode(e){return CommentNode.isCommentNode(e)},exports.isFunctionNode=isFunctionNode,exports.isSimpleBlockNode=isSimpleBlockNode,exports.isTokenNode=function isTokenNode(e){return TokenNode.isTokenNode(e)},exports.isWhitespaceNode=function isWhitespaceNode(e){return WhitespaceNode.isWhitespaceNode(e)},exports.parseCommaSeparatedListOfComponentValues=function parseCommaSeparatedListOfComponentValues(e,o){const t={onParseError:(null==o?void 0:o.onParseError)??(()=>{})},s=[...e];if(0===e.length)return[];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=[],a=0;for(;;){if(!s[a]||s[a][0]===n.TokenType.EOF)return r.length&&i.push(r),i;if(s[a][0]===n.TokenType.Comma){i.push(r),r=[],a++;continue}const o=consumeComponentValue(t,e.slice(a));r.push(o.node),a+=o.advance}},exports.parseComponentValue=function parseComponentValue(e,o){const t={onParseError:(null==o?void 0:o.onParseError)??(()=>{})},s=[...e];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=consumeComponentValue(t,s);if(s[Math.min(i.advance,s.length-1)][0]===n.TokenType.EOF)return i.node;t.onParseError(new n.ParseError("Expected EOF after parsing a component value.",e[0][2],e[e.length-1][3],["5.3.9. Parse a component value","Expected EOF"]))},exports.parseListOfComponentValues=function parseListOfComponentValues(e,o){const t={onParseError:(null==o?void 0:o.onParseError)??(()=>{})},s=[...e];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=0;for(;;){if(!s[r]||s[r][0]===n.TokenType.EOF)return i;const e=consumeComponentValue(t,s.slice(r));i.push(e.node),r+=e.advance}},exports.replaceComponentValues=function replaceComponentValues(e,n){for(let o=0;o{if("number"!=typeof o)return;const t=e.node,s=n(t);s&&e.parent.value.splice(o,1,s)}))}}return e},exports.sourceIndices=function sourceIndices(e){if(Array.isArray(e)){const n=e[0];if(!n)return[0,0];const o=e[e.length-1]||n;return[sourceIndices(n)[0],sourceIndices(o)[1]]}const n=e.tokens(),o=n[0],t=n[n.length-1];return o&&t?[o[2],t[3]]:[0,0]},exports.stringify=function stringify(e){return e.map((e=>e.map((e=>n.stringify(...e.tokens()))).join(""))).join(",")}; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts new file mode 100644 index 000000000..47c3cec9e --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts @@ -0,0 +1,10 @@ +export * from './consume/consume-component-block-function'; +export { parseComponentValue } from './parse/parse-component-value'; +export { parseListOfComponentValues } from './parse/parse-list-of-component-values'; +export { parseCommaSeparatedListOfComponentValues } from './parse/parse-comma-separated-list-of-component-values'; +export { gatherNodeAncestry } from './util/node-ancestry'; +export { replaceComponentValues } from './util/replace-component-values'; +export { stringify } from './util/stringify'; +export { ComponentValueType } from './util/component-value-type'; +export { isCommentNode, isFunctionNode, isSimpleBlockNode, isTokenNode, isWhitespaceNode, } from './util/type-predicates'; +export { sourceIndices } from './util/source-indices'; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.mjs b/node_modules/@csstools/css-parser-algorithms/dist/index.mjs new file mode 100644 index 000000000..cc63349e9 --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/index.mjs @@ -0,0 +1 @@ +import{TokenType as e,isToken as n,stringify as t,ParseError as o,mirrorVariant as s,mirrorVariantType as i}from"@csstools/css-tokenizer";var r;function consumeComponentValue(n,t){const o=t[0];if(o[0]===e.OpenParen||o[0]===e.OpenCurly||o[0]===e.OpenSquare){const e=consumeSimpleBlock(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Function){const e=consumeFunction(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Whitespace){const e=consumeWhitespace(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Comment){const e=consumeComment(n,t);return{advance:e.advance,node:e.node}}return{advance:1,node:new TokenNode(o)}}!function(e){e.Function="function",e.SimpleBlock="simple-block",e.Whitespace="whitespace",e.Comment="comment",e.Token="token"}(r||(r={}));class FunctionNode{type=r.Function;name;endToken;value;constructor(e,n,t){this.name=e,this.endToken=n,this.value=t}getName(){return this.name[4].value}normalize(){this.endToken[0]===e.EOF&&(this.endToken=[e.CloseParen,")",-1,-1,void 0])}tokens(){return this.endToken[0]===e.EOF?[this.name,...this.value.flatMap((e=>e.tokens()))]:[this.name,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n(e)?t(e):e.toString())).join("");return t(this.name)+e+t(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}walk(e,n){let t=!1;if(this.value.forEach(((o,s)=>{if(t)return;let i;n&&(i={...n}),!1!==e({node:o,parent:this,state:i},s)?"walk"in o&&!1===o.walk(e,i)&&(t=!0):t=!0})),t)return!1}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isFunctionNode(){return FunctionNode.isFunctionNode(this)}static isFunctionNode(e){return!!e&&(e instanceof FunctionNode&&e.type===r.Function)}}function consumeFunction(n,t){const s=[];let i=1;for(;;){const r=t[i];if(!r||r[0]===e.EOF)return n.onParseError(new o("Unexpected EOF while consuming a function.",t[0][2],t[t.length-1][3],["5.4.9. Consume a function","Unexpected EOF"])),{advance:t.length,node:new FunctionNode(t[0],r,s)};if(r[0]===e.CloseParen)return{advance:i+1,node:new FunctionNode(t[0],r,s)};if(r[0]===e.Comment||r[0]===e.Whitespace){const e=consumeAllCommentsAndWhitespace(n,t.slice(i));i+=e.advance,s.push(...e.nodes);continue}const a=consumeComponentValue(n,t.slice(i));i+=a.advance,s.push(a.node)}}class SimpleBlockNode{type=r.SimpleBlock;startToken;endToken;value;constructor(e,n,t){this.startToken=e,this.endToken=n,this.value=t}normalize(){if(this.endToken[0]===e.EOF){const e=s(this.startToken);e&&(this.endToken=e)}}tokens(){return this.endToken[0]===e.EOF?[this.startToken,...this.value.flatMap((e=>e.tokens()))]:[this.startToken,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n(e)?t(e):e.toString())).join("");return t(this.startToken)+e+t(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}walk(e,n){let t=!1;if(this.value.forEach(((o,s)=>{if(t)return;let i;n&&(i={...n}),!1!==e({node:o,parent:this,state:i},s)?"walk"in o&&!1===o.walk(e,i)&&(t=!0):t=!0})),t)return!1}toJSON(){return{type:this.type,startToken:this.startToken,tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isSimpleBlockNode(){return SimpleBlockNode.isSimpleBlockNode(this)}static isSimpleBlockNode(e){return!!e&&(e instanceof SimpleBlockNode&&e.type===r.SimpleBlock)}}function consumeSimpleBlock(n,t){const s=i(t[0][0]);if(!s)throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");const r=[];let a=1;for(;;){const i=t[a];if(!i||i[0]===e.EOF)return n.onParseError(new o("Unexpected EOF while consuming a simple block.",t[0][2],t[t.length-1][3],["5.4.8. Consume a simple block","Unexpected EOF"])),{advance:t.length,node:new SimpleBlockNode(t[0],i,r)};if(i[0]===s)return{advance:a+1,node:new SimpleBlockNode(t[0],i,r)};if(i[0]===e.Comment||i[0]===e.Whitespace){const e=consumeAllCommentsAndWhitespace(n,t.slice(a));a+=e.advance,r.push(...e.nodes);continue}const c=consumeComponentValue(n,t.slice(a));a+=c.advance,r.push(c.node)}}class WhitespaceNode{type=r.Whitespace;value;constructor(e){this.value=e}tokens(){return this.value}toString(){return t(...this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isWhitespaceNode(){return WhitespaceNode.isWhitespaceNode(this)}static isWhitespaceNode(e){return!!e&&(e instanceof WhitespaceNode&&e.type===r.Whitespace)}}function consumeWhitespace(n,t){let o=0;for(;;){if(t[o][0]!==e.Whitespace)return{advance:o,node:new WhitespaceNode(t.slice(0,o))};o++}}class CommentNode{type=r.Comment;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return t(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isCommentNode(){return CommentNode.isCommentNode(this)}static isCommentNode(e){return!!e&&(e instanceof CommentNode&&e.type===r.Comment)}}function consumeComment(e,n){return{advance:1,node:new CommentNode(n[0])}}function consumeAllCommentsAndWhitespace(n,t){const o=[];let s=0;for(;;)if(t[s][0]!==e.Whitespace){if(t[s][0]!==e.Comment)return{advance:s,nodes:o};o.push(new CommentNode(t[s])),s++}else{const e=consumeWhitespace(0,t.slice(s));s+=e.advance,o.push(e.node)}}class TokenNode{type=r.Token;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return t(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isTokenNode(){return TokenNode.isTokenNode(this)}static isTokenNode(e){return!!e&&(e instanceof TokenNode&&e.type===r.Token)}}function parseComponentValue(n,t){const s={onParseError:(null==t?void 0:t.onParseError)??(()=>{})},i=[...n];i[i.length-1][0]!==e.EOF&&i.push([e.EOF,"",i[i.length-1][2],i[i.length-1][3],void 0]);const r=consumeComponentValue(s,i);if(i[Math.min(r.advance,i.length-1)][0]===e.EOF)return r.node;s.onParseError(new o("Expected EOF after parsing a component value.",n[0][2],n[n.length-1][3],["5.3.9. Parse a component value","Expected EOF"]))}function parseListOfComponentValues(n,t){const o={onParseError:(null==t?void 0:t.onParseError)??(()=>{})},s=[...n];s[s.length-1][0]!==e.EOF&&s.push([e.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=0;for(;;){if(!s[r]||s[r][0]===e.EOF)return i;const n=consumeComponentValue(o,s.slice(r));i.push(n.node),r+=n.advance}}function parseCommaSeparatedListOfComponentValues(n,t){const o={onParseError:(null==t?void 0:t.onParseError)??(()=>{})},s=[...n];if(0===n.length)return[];s[s.length-1][0]!==e.EOF&&s.push([e.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=[],a=0;for(;;){if(!s[a]||s[a][0]===e.EOF)return r.length&&i.push(r),i;if(s[a][0]===e.Comma){i.push(r),r=[],a++;continue}const t=consumeComponentValue(o,n.slice(a));r.push(t.node),a+=t.advance}}function gatherNodeAncestry(e){const n=new Map;return e.walk((e=>{Array.isArray(e.node)?e.node.forEach((t=>{n.set(t,e.parent)})):n.set(e.node,e.parent)})),n}function isSimpleBlockNode(e){return SimpleBlockNode.isSimpleBlockNode(e)}function isFunctionNode(e){return FunctionNode.isFunctionNode(e)}function isWhitespaceNode(e){return WhitespaceNode.isWhitespaceNode(e)}function isCommentNode(e){return CommentNode.isCommentNode(e)}function isTokenNode(e){return TokenNode.isTokenNode(e)}function replaceComponentValues(e,n){for(let t=0;t{if("number"!=typeof t)return;const o=e.node,s=n(o);s&&e.parent.value.splice(t,1,s)}))}}return e}function stringify(e){return e.map((e=>e.map((e=>t(...e.tokens()))).join(""))).join(",")}function sourceIndices(e){if(Array.isArray(e)){const n=e[0];if(!n)return[0,0];const t=e[e.length-1]||n;return[sourceIndices(n)[0],sourceIndices(t)[1]]}const n=e.tokens(),t=n[0],o=n[n.length-1];return t&&o?[t[2],o[3]]:[0,0]}export{CommentNode,r as ComponentValueType,FunctionNode,SimpleBlockNode,TokenNode,WhitespaceNode,consumeAllCommentsAndWhitespace,consumeComment,consumeComponentValue,consumeFunction,consumeSimpleBlock,consumeWhitespace,gatherNodeAncestry,isCommentNode,isFunctionNode,isSimpleBlockNode,isTokenNode,isWhitespaceNode,parseCommaSeparatedListOfComponentValues,parseComponentValue,parseListOfComponentValues,replaceComponentValues,sourceIndices,stringify}; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/interfaces/context.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/interfaces/context.d.ts new file mode 100644 index 000000000..dc246e000 --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/interfaces/context.d.ts @@ -0,0 +1,4 @@ +import { ParseError } from '@csstools/css-tokenizer'; +export type Context = { + onParseError: (error: ParseError) => void; +}; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts new file mode 100644 index 000000000..67dff1d04 --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts @@ -0,0 +1,5 @@ +import { CSSToken, ParseError } from '@csstools/css-tokenizer'; +import { ComponentValue } from '../consume/consume-component-block-function'; +export declare function parseCommaSeparatedListOfComponentValues(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue[][]; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-component-value.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-component-value.d.ts new file mode 100644 index 000000000..2961290f9 --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-component-value.d.ts @@ -0,0 +1,4 @@ +import { CSSToken, ParseError } from '@csstools/css-tokenizer'; +export declare function parseComponentValue(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): import("../consume/consume-component-block-function").ComponentValue | undefined; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts new file mode 100644 index 000000000..737f554d2 --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts @@ -0,0 +1,5 @@ +import { CSSToken, ParseError } from '@csstools/css-tokenizer'; +import { ComponentValue } from '../consume/consume-component-block-function'; +export declare function parseListOfComponentValues(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue[]; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/component-value-type.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/component-value-type.d.ts new file mode 100644 index 000000000..eda7ee93c --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/util/component-value-type.d.ts @@ -0,0 +1,7 @@ +export declare enum ComponentValueType { + Function = "function", + SimpleBlock = "simple-block", + Whitespace = "whitespace", + Comment = "comment", + Token = "token" +} diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/node-ancestry.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/node-ancestry.d.ts new file mode 100644 index 000000000..219ea6191 --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/util/node-ancestry.d.ts @@ -0,0 +1,7 @@ +export interface walkable { + walk(cb: (entry: { + node: Array | unknown; + parent: unknown; + }, index: number | string) => boolean | void): false | undefined; +} +export declare function gatherNodeAncestry(node: walkable): Map; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/replace-component-values.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/replace-component-values.d.ts new file mode 100644 index 000000000..774051c6d --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/util/replace-component-values.d.ts @@ -0,0 +1,2 @@ +import type { ComponentValue } from '../consume/consume-component-block-function'; +export declare function replaceComponentValues(componentValuesList: Array>, replaceWith: (componentValue: ComponentValue) => ComponentValue | void): ComponentValue[][]; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/source-indices.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/source-indices.d.ts new file mode 100644 index 000000000..92d124bef --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/util/source-indices.d.ts @@ -0,0 +1,9 @@ +import { CSSToken } from '@csstools/css-tokenizer'; +interface TokenConvertible { + tokens(): Array; +} +/** + * Returns the start and end index of a node in the CSS source string. + */ +export declare function sourceIndices(x: TokenConvertible | Array): [number, number]; +export {}; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/stringify.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/stringify.d.ts new file mode 100644 index 000000000..6ab4140cf --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/util/stringify.d.ts @@ -0,0 +1,2 @@ +import type { ComponentValue } from '../consume/consume-component-block-function'; +export declare function stringify(componentValueLists: Array>): string; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/type-predicates.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/type-predicates.d.ts new file mode 100644 index 000000000..896d3036b --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/dist/util/type-predicates.d.ts @@ -0,0 +1,6 @@ +import { CommentNode, FunctionNode, SimpleBlockNode, TokenNode, WhitespaceNode } from '../consume/consume-component-block-function'; +export declare function isSimpleBlockNode(x: unknown): x is SimpleBlockNode; +export declare function isFunctionNode(x: unknown): x is FunctionNode; +export declare function isWhitespaceNode(x: unknown): x is WhitespaceNode; +export declare function isCommentNode(x: unknown): x is CommentNode; +export declare function isTokenNode(x: unknown): x is TokenNode; diff --git a/node_modules/@csstools/css-parser-algorithms/package.json b/node_modules/@csstools/css-parser-algorithms/package.json new file mode 100644 index 000000000..cde65d68c --- /dev/null +++ b/node_modules/@csstools/css-parser-algorithms/package.json @@ -0,0 +1,72 @@ +{ + "name": "@csstools/css-parser-algorithms", + "description": "Algorithms to help you parse CSS from an array of tokens.", + "version": "2.3.0", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "main": "dist/index.cjs", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "peerDependencies": { + "@csstools/css-tokenizer": "^2.1.1" + }, + "scripts": { + "build": "rollup -c ../../rollup/default.mjs", + "lint": "node ../../.github/bin/format-package-json.mjs", + "prepublishOnly": "npm run build && npm run test", + "stryker": "stryker run --logLevel error", + "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs", + "test:rewrite-expects": "REWRITE_EXPECTS=true node ./test/test.mjs" + }, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms#readme", + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "packages/css-parser-algorithms" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "css", + "parser" + ], + "volta": { + "extends": "../../package.json" + } +} diff --git a/node_modules/@csstools/css-tokenizer/CHANGELOG.md b/node_modules/@csstools/css-tokenizer/CHANGELOG.md new file mode 100644 index 000000000..cb50e589d --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/CHANGELOG.md @@ -0,0 +1,28 @@ +# Changes to CSS Tokenizer + +### 2.1.1 (April 10, 2023) + +- Document `tokenize` helper function + +### 2.1.0 (February 21, 2023) + +- Add `tokenize` helper function + +### 2.0.2 (February 13, 2023) + +- Relax `isToken` to match artificial tokens that correctly follow the interface. + +### 2.0.1 (January 28, 2023) + +- Improve `types` declaration in `package.json` + +### 2.0.0 (January 19, 2023) + +- Simplify `Reader` interface (breaking) +- Change the `ParseError` interface, this is now a subclass of `Error` (breaking) +- Remove the `commentsAreTokens` option as `true` was the only desirable value (breaking) +- Improve performance + +### 1.0.0 (November 14, 2022) + +- Initial version diff --git a/node_modules/@csstools/css-tokenizer/LICENSE.md b/node_modules/@csstools/css-tokenizer/LICENSE.md new file mode 100644 index 000000000..af5411fa2 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2022 Romain Menke, Antonio Laguna + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@csstools/css-tokenizer/README.md b/node_modules/@csstools/css-tokenizer/README.md new file mode 100644 index 000000000..810e47c8f --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/README.md @@ -0,0 +1,108 @@ +# CSS Tokenizer + +[npm version][npm-url] +[Build Status][cli-url] +[Discord][discord] + +Implemented from : https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/ + +## Usage + +Add [CSS Tokenizer] to your project: + +```bash +npm install @csstools/css-tokenizer --save-dev +``` + +```js +import { tokenizer, TokenType } from '@csstools/css-tokenizer'; + +const myCSS = `@media only screen and (min-width: 768rem) { + .foo { + content: 'Some content!' !important; + } +} +`; + +const t = tokenizer({ + css: myCSS, +}); + +while (true) { + const token = t.nextToken(); + if (token[0] === TokenType.EOF) { + break; + } + + console.log(token); +} +``` + +Or use the `tokenize` helper function: + +```js +import { tokenize } from '@csstools/css-tokenizer'; + +const myCSS = `@media only screen and (min-width: 768rem) { + .foo { + content: 'Some content!' !important; + } +} +`; + +const tokens = tokenize({ + css: myCSS, +}); + +console.log(tokens); +``` + +### Options + +```ts +{ + onParseError?: (error: ParseError) => void +} +``` + +#### `onParseError` + +The tokenizer is forgiving and won't stop when a parse error is encountered. +Parse errors also aren't tokens. + +To receive parsing error information you can set a callback. + +```js +import { tokenizer, TokenType } from '@csstools/css-tokenizer'; + +const t = tokenizer({ + css: '\\', +}, { onParseError: (err) => console.warn(err) }); + +while (true) { + const token = t.nextToken(); + if (token[0] === TokenType.EOF) { + break; + } +} +``` + +Parser errors will try to inform you about the point in the tokenizer logic the error happened. +This tells you the kind of error. + +## Goals and non-goals + +Things this package aims to be: +- specification compliant CSS tokenizer +- a reliable low level package to be used in CSS parsers + +What it is not: +- opinionated +- fast +- small + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/css-tokenizer + +[CSS Tokenizer]: https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts new file mode 100644 index 000000000..2a59b358f --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts @@ -0,0 +1,3 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +export declare function checkIfFourCodePointsWouldStartCDO(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/matches-url-ident.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/matches-url-ident.d.ts new file mode 100644 index 000000000..aabf7e866 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/checks/matches-url-ident.d.ts @@ -0,0 +1,2 @@ +import { Context } from '../interfaces/context'; +export declare function checkIfCodePointsMatchURLIdent(ctx: Context, codePoints: Array): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts new file mode 100644 index 000000000..1262da304 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts @@ -0,0 +1,3 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +export declare function checkIfThreeCodePointsWouldStartCDC(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts new file mode 100644 index 000000000..d48323bb9 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts @@ -0,0 +1,3 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +export declare function checkIfThreeCodePointsWouldStartAnIdentSequence(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts new file mode 100644 index 000000000..d6eff77d5 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts @@ -0,0 +1,3 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +export declare function checkIfThreeCodePointsWouldStartANumber(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts new file mode 100644 index 000000000..d42102ba2 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts @@ -0,0 +1,3 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +export declare function checkIfTwoCodePointsAreAValidEscape(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts new file mode 100644 index 000000000..42d390177 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts @@ -0,0 +1,3 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +export declare function checkIfTwoCodePointsStartAComment(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/code-points/code-points.d.ts b/node_modules/@csstools/css-tokenizer/dist/code-points/code-points.d.ts new file mode 100644 index 000000000..c920f6193 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/code-points/code-points.d.ts @@ -0,0 +1,78 @@ +/** ' */ +export declare const APOSTROPHE = 39; +/** * */ +export declare const ASTERISK = 42; +/** \b */ +export declare const BACKSPACE = 8; +/** \r */ +export declare const CARRIAGE_RETURN = 13; +/** \t */ +export declare const CHARACTER_TABULATION = 9; +/** : */ +export declare const COLON = 58; +/** , */ +export declare const COMMA = 44; +/** @ */ +export declare const COMMERCIAL_AT = 64; +/** \x7F */ +export declare const DELETE = 127; +/** ! */ +export declare const EXCLAMATION_MARK = 33; +/** \f */ +export declare const FORM_FEED = 12; +/** . */ +export declare const FULL_STOP = 46; +/** > */ +export declare const GREATER_THAN_SIGN = 62; +/** - */ +export declare const HYPHEN_MINUS = 45; +/** \x1F */ +export declare const INFORMATION_SEPARATOR_ONE = 31; +/** E */ +export declare const LATIN_CAPITAL_LETTER_E = 69; +/** e */ +export declare const LATIN_SMALL_LETTER_E = 101; +/** { */ +export declare const LEFT_CURLY_BRACKET = 123; +/** ( */ +export declare const LEFT_PARENTHESIS = 40; +/** [ */ +export declare const LEFT_SQUARE_BRACKET = 91; +/** < */ +export declare const LESS_THAN_SIGN = 60; +/** \n */ +export declare const LINE_FEED = 10; +/** \v */ +export declare const LINE_TABULATION = 11; +/** _ */ +export declare const LOW_LINE = 95; +/** \x10FFFF */ +export declare const MAXIMUM_ALLOWED_CODEPOINT = 1114111; +/** \x00 */ +export declare const NULL = 0; +/** # */ +export declare const NUMBER_SIGN = 35; +/** % */ +export declare const PERCENTAGE_SIGN = 37; +/** + */ +export declare const PLUS_SIGN = 43; +/** " */ +export declare const QUOTATION_MARK = 34; +/** � */ +export declare const REPLACEMENT_CHARACTER = 65533; +/** \ */ +export declare const REVERSE_SOLIDUS = 92; +/** } */ +export declare const RIGHT_CURLY_BRACKET = 125; +/** ) */ +export declare const RIGHT_PARENTHESIS = 41; +/** ] */ +export declare const RIGHT_SQUARE_BRACKET = 93; +/** ; */ +export declare const SEMICOLON = 59; +/** \u0E */ +export declare const SHIFT_OUT = 14; +/** / */ +export declare const SOLIDUS = 47; +/** \u20 */ +export declare const SPACE = 32; diff --git a/node_modules/@csstools/css-tokenizer/dist/code-points/ranges.d.ts b/node_modules/@csstools/css-tokenizer/dist/code-points/ranges.d.ts new file mode 100644 index 000000000..ecfbb9239 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/code-points/ranges.d.ts @@ -0,0 +1,12 @@ +export declare function isDigitCodePoint(search: number): boolean; +export declare function isUppercaseLetterCodePoint(search: number): boolean; +export declare function isLowercaseLetterCodePoint(search: number): boolean; +export declare function isHexDigitCodePoint(search: number): boolean; +export declare function isLetterCodePoint(search: number): boolean; +export declare function isNonASCIICodePoint(search: number): boolean; +export declare function isIdentStartCodePoint(search: number): boolean; +export declare function isIdentCodePoint(search: number): boolean; +export declare function isNonPrintableCodePoint(search: number): boolean; +export declare function isNewLine(search: number): boolean; +export declare function isWhitespace(search: number): boolean; +export declare function isSurrogate(search: number): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/bad-url.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/bad-url.d.ts new file mode 100644 index 000000000..4b18d0e8d --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/consume/bad-url.d.ts @@ -0,0 +1,3 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +export declare function consumeBadURL(ctx: Context, reader: CodePointReader): void; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/comment.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/comment.d.ts new file mode 100644 index 000000000..d4ba2211d --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/consume/comment.d.ts @@ -0,0 +1,4 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +import { TokenComment } from '../interfaces/token'; +export declare function consumeComment(ctx: Context, reader: CodePointReader): TokenComment; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/escaped-code-point.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/escaped-code-point.d.ts new file mode 100644 index 000000000..a6f8dc2e6 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/consume/escaped-code-point.d.ts @@ -0,0 +1,3 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +export declare function consumeEscapedCodePoint(ctx: Context, reader: CodePointReader): number; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/hash-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/hash-token.d.ts new file mode 100644 index 000000000..ac061a84c --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/consume/hash-token.d.ts @@ -0,0 +1,4 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +import { TokenDelim, TokenHash } from '../interfaces/token'; +export declare function consumeHashToken(ctx: Context, reader: CodePointReader): TokenDelim | TokenHash; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/ident-like-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/ident-like-token.d.ts new file mode 100644 index 000000000..6be737627 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/consume/ident-like-token.d.ts @@ -0,0 +1,4 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +import { TokenBadURL, TokenFunction, TokenIdent, TokenURL } from '../interfaces/token'; +export declare function consumeIdentLikeToken(ctx: Context, reader: CodePointReader): TokenIdent | TokenFunction | TokenURL | TokenBadURL; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/ident-sequence.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/ident-sequence.d.ts new file mode 100644 index 000000000..992520e2d --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/consume/ident-sequence.d.ts @@ -0,0 +1,3 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +export declare function consumeIdentSequence(ctx: Context, reader: CodePointReader): Array; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/number.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/number.d.ts new file mode 100644 index 000000000..18f1704f3 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/consume/number.d.ts @@ -0,0 +1,4 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +import { NumberType } from '../interfaces/token'; +export declare function consumeNumber(ctx: Context, reader: CodePointReader): NumberType; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/numeric-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/numeric-token.d.ts new file mode 100644 index 000000000..1217bb0aa --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/consume/numeric-token.d.ts @@ -0,0 +1,4 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +import { TokenDimension, TokenNumber, TokenPercentage } from '../interfaces/token'; +export declare function consumeNumericToken(ctx: Context, reader: CodePointReader): TokenPercentage | TokenNumber | TokenDimension; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/string-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/string-token.d.ts new file mode 100644 index 000000000..31f6448f7 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/consume/string-token.d.ts @@ -0,0 +1,4 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +import { TokenBadString, TokenString } from '../interfaces/token'; +export declare function consumeStringToken(ctx: Context, reader: CodePointReader): TokenBadString | TokenString; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/url-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/url-token.d.ts new file mode 100644 index 000000000..9140be704 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/consume/url-token.d.ts @@ -0,0 +1,4 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +import { TokenBadURL, TokenURL } from '../interfaces/token'; +export declare function consumeUrlToken(ctx: Context, reader: CodePointReader): TokenURL | TokenBadURL; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/whitespace-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/whitespace-token.d.ts new file mode 100644 index 000000000..86585f70d --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/consume/whitespace-token.d.ts @@ -0,0 +1,4 @@ +import { CodePointReader } from '../interfaces/code-point-reader'; +import { Context } from '../interfaces/context'; +import { TokenWhitespace } from '../interfaces/token'; +export declare function consumeWhiteSpace(ctx: Context, reader: CodePointReader): TokenWhitespace; diff --git a/node_modules/@csstools/css-tokenizer/dist/index.cjs b/node_modules/@csstools/css-tokenizer/dist/index.cjs new file mode 100644 index 000000000..a7821a398 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/index.cjs @@ -0,0 +1 @@ +"use strict";class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,o,r,n){super(e),this.name="ParseError",this.sourceStart=o,this.sourceEnd=r,this.parserState=n}}class Reader{cursor;source="";codePointSource=[];length=0;representationStart=0;representationEnd=-1;constructor(e){this.cursor=0,this.source=e,this.length=e.length,this.codePointSource=new Array(this.length);for(let e=0;e=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isNonASCIICodePoint(e){return e>=128}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCIICodePoint(e)||e===O}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===k}function isNewLine(e){return 10===e||13===e||12===e}function isWhitespace(e){return 32===e||10===e||9===e||13===e||12===e}function checkIfTwoCodePointsAreAValidEscape(e,o){return o.codePointSource[o.cursor]===R&&!isNewLine(o.codePointSource[o.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,o){return o.codePointSource[o.cursor]===k?o.codePointSource[o.cursor+1]===k||(!!isIdentStartCodePoint(o.codePointSource[o.cursor+1])||o.codePointSource[o.cursor+1]===R&&!isNewLine(o.codePointSource[o.cursor+2])):!!isIdentStartCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(0,o)}function checkIfThreeCodePointsWouldStartANumber(e,o){return o.codePointSource[o.cursor]===L||o.codePointSource[o.cursor]===k?!!isDigitCodePoint(o.codePointSource[o.cursor+1])||o.codePointSource[o.cursor+1]===T&&isDigitCodePoint(o.codePointSource[o.cursor+2]):o.codePointSource[o.cursor]===T?isDigitCodePoint(o.codePointSource[o.cursor+1]):isDigitCodePoint(o.codePointSource[o.cursor])}function checkIfTwoCodePointsStartAComment(e,o){return o.codePointSource[o.cursor]===H&&o.codePointSource[o.cursor+1]===i}function checkIfThreeCodePointsWouldStartCDC(e,o){return o.codePointSource[o.cursor]===k&&o.codePointSource[o.cursor+1]===k&&o.codePointSource[o.cursor+2]===l}function consumeComment(e,o){for(o.advanceCodePoint(2);;){const r=o.readCodePoint();if(!1===r){e.onParseError(new ParseError("Unexpected EOF while consuming a comment.",o.representationStart,o.representationEnd,["4.3.2. Consume comments","Unexpected EOF"]));break}if(r===i&&(void 0!==o.codePointSource[o.cursor]&&o.codePointSource[o.cursor]===H)){o.advanceCodePoint();break}}return[exports.TokenType.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeEscapedCodePoint(e,o){const r=o.readCodePoint();if(!1===r)return e.onParseError(new ParseError("Unexpected EOF while consuming an escaped code point.",o.representationStart,o.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),b;if(isHexDigitCodePoint(r)){const e=[r];for(;void 0!==o.codePointSource[o.cursor]&&isHexDigitCodePoint(o.codePointSource[o.cursor])&&e.length<6;)e.push(o.codePointSource[o.cursor]),o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor])&&o.advanceCodePoint();const t=parseInt(String.fromCharCode(...e),16);return 0===t?b:(n=t)>=55296&&n<=57343||t>w?b:t}var n;return r}function consumeIdentSequence(e,o){const r=[];for(;;)if(isIdentCodePoint(o.codePointSource[o.cursor]))r.push(o.codePointSource[o.cursor]),o.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(0,o))return r;o.advanceCodePoint(),r.push(consumeEscapedCodePoint(e,o))}}function consumeHashToken(e,o){if(o.advanceCodePoint(),void 0!==o.codePointSource[o.cursor]&&(isIdentCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(0,o))){let n=r.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)&&(n=r.ID);const t=consumeIdentSequence(e,o);return[exports.TokenType.Hash,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCharCode(...t),type:n}]}return[exports.TokenType.Delim,"#",o.representationStart,o.representationEnd,{value:"#"}]}function consumeNumber(e,o){let r=exports.NumberType.Integer;for(o.codePointSource[o.cursor]!==L&&o.codePointSource[o.cursor]!==k||o.advanceCodePoint();isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===T&&isDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint(2),r=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===E||o.codePointSource[o.cursor]===m){if(isDigitCodePoint(o.codePointSource[o.cursor+1]))o.advanceCodePoint(2);else{if(o.codePointSource[o.cursor+1]!==k&&o.codePointSource[o.cursor+1]!==L||!isDigitCodePoint(o.codePointSource[o.cursor+2]))return r;o.advanceCodePoint(3)}for(r=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint()}return r}function consumeNumericToken(e,o){const r=consumeNumber(0,o),n=parseFloat(o.source.slice(o.representationStart,o.representationEnd+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)){const t=consumeIdentSequence(e,o);return[exports.TokenType.Dimension,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n,type:r,unit:String.fromCharCode(...t)}]}return o.codePointSource[o.cursor]===D?(o.advanceCodePoint(),[exports.TokenType.Percentage,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}]):[exports.TokenType.Number,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n,type:r}]}function consumeWhiteSpace(e,o){for(;isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();return[exports.TokenType.Whitespace,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeStringToken(e,o){let r="";const n=o.readCodePoint();for(;;){const t=o.readCodePoint();if(!1===t)return e.onParseError(new ParseError("Unexpected EOF while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"])),[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(isNewLine(t))return e.onParseError(new ParseError("Unexpected newline while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected newline"])),o.unreadCodePoint(),[exports.TokenType.BadString,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(t===n)return[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(t!==R)r+=String.fromCharCode(t);else{if(void 0===o.codePointSource[o.cursor])continue;if(isNewLine(o.codePointSource[o.cursor])){o.advanceCodePoint();continue}r+=String.fromCharCode(consumeEscapedCodePoint(e,o))}}}const K="u".charCodeAt(0),M="U".charCodeAt(0),$="r".charCodeAt(0),J="R".charCodeAt(0),j="l".charCodeAt(0),Q="L".charCodeAt(0);function checkIfCodePointsMatchURLIdent(e,o){return 3===o.length&&((o[0]===K||o[0]===M)&&((o[1]===$||o[1]===J)&&(o[2]===j||o[2]===Q)))}function consumeBadURL(e,o){for(;;){if(void 0===o.codePointSource[o.cursor])return;if(o.codePointSource[o.cursor]===W)return void o.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(0,o)?(o.advanceCodePoint(),consumeEscapedCodePoint(e,o)):o.advanceCodePoint()}}function consumeUrlToken(e,o){consumeWhiteSpace(0,o);let r="";for(;;){if(void 0===o.codePointSource[o.cursor])return e.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"])),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(o.codePointSource[o.cursor]===W)return o.advanceCodePoint(),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(isWhitespace(o.codePointSource[o.cursor]))return consumeWhiteSpace(0,o),void 0===o.codePointSource[o.cursor]?(e.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"])),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}]):o.codePointSource[o.cursor]===W?(o.advanceCodePoint(),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}]):(consumeBadURL(e,o),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]);if(o.codePointSource[o.cursor]===N||o.codePointSource[o.cursor]===t||o.codePointSource[o.cursor]===v||((n=o.codePointSource[o.cursor])===I||n===S||A<=n&&n<=s||B<=n&&n<=f))return consumeBadURL(e,o),e.onParseError(new ParseError("Unexpected character while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"])),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(o.codePointSource[o.cursor]===R){if(checkIfTwoCodePointsAreAValidEscape(0,o)){o.advanceCodePoint(),r+=String.fromCharCode(consumeEscapedCodePoint(e,o));continue}return consumeBadURL(e,o),e.onParseError(new ParseError("Invalid escape sequence while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}r+=String.fromCharCode(o.codePointSource[o.cursor]),o.advanceCodePoint()}var n}function consumeIdentLikeToken(e,o){const r=consumeIdentSequence(e,o);if(o.codePointSource[o.cursor]!==v)return[exports.TokenType.Ident,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCharCode(...r)}];if(checkIfCodePointsMatchURLIdent(0,r)){o.advanceCodePoint();let n=0;for(;;){const e=isWhitespace(o.codePointSource[o.cursor]),i=isWhitespace(o.codePointSource[o.cursor+1]);if(e&&i){n+=1,o.advanceCodePoint(1);continue}const s=e?o.codePointSource[o.cursor+1]:o.codePointSource[o.cursor];if(s===N||s===t)return n>0&&o.unreadCodePoint(n),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCharCode(...r)}];break}return consumeUrlToken(e,o)}return o.advanceCodePoint(),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCharCode(...r)}]}function tokenizer(e,o){const r=e.css.valueOf(),n=new Reader(r),i={onParseError:(null==o?void 0:o.onParseError)??(()=>{})};return{nextToken:function nextToken(){if(n.representationStart=n.cursor,n.representationEnd=-1,checkIfTwoCodePointsStartAComment(0,n))return consumeComment(i,n);const e=n.codePointSource[n.cursor];if(void 0===e)return[exports.TokenType.EOF,"",-1,-1,void 0];if(isIdentStartCodePoint(e))return consumeIdentLikeToken(i,n);if(isDigitCodePoint(e))return consumeNumericToken(i,n);switch(e){case d:return n.advanceCodePoint(),[exports.TokenType.Comma,",",n.representationStart,n.representationEnd,void 0];case u:return n.advanceCodePoint(),[exports.TokenType.Colon,":",n.representationStart,n.representationEnd,void 0];case V:return n.advanceCodePoint(),[exports.TokenType.Semicolon,";",n.representationStart,n.representationEnd,void 0];case v:return n.advanceCodePoint(),[exports.TokenType.OpenParen,"(",n.representationStart,n.representationEnd,void 0];case W:return n.advanceCodePoint(),[exports.TokenType.CloseParen,")",n.representationStart,n.representationEnd,void 0];case x:return n.advanceCodePoint(),[exports.TokenType.OpenSquare,"[",n.representationStart,n.representationEnd,void 0];case F:return n.advanceCodePoint(),[exports.TokenType.CloseSquare,"]",n.representationStart,n.representationEnd,void 0];case h:return n.advanceCodePoint(),[exports.TokenType.OpenCurly,"{",n.representationStart,n.representationEnd,void 0];case q:return n.advanceCodePoint(),[exports.TokenType.CloseCurly,"}",n.representationStart,n.representationEnd,void 0];case t:case N:return consumeStringToken(i,n);case U:return consumeHashToken(i,n);case L:case T:return checkIfThreeCodePointsWouldStartANumber(0,n)?consumeNumericToken(i,n):(n.advanceCodePoint(),[exports.TokenType.Delim,n.source[n.representationStart],n.representationStart,n.representationEnd,{value:n.source[n.representationStart]}]);case g:case c:case C:case a:case z:return consumeWhiteSpace(0,n);case k:return checkIfThreeCodePointsWouldStartANumber(0,n)?consumeNumericToken(i,n):checkIfThreeCodePointsWouldStartCDC(0,n)?(n.advanceCodePoint(3),[exports.TokenType.CDC,"--\x3e",n.representationStart,n.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)?consumeIdentLikeToken(i,n):(n.advanceCodePoint(),[exports.TokenType.Delim,"-",n.representationStart,n.representationEnd,{value:"-"}]);case y:return checkIfFourCodePointsWouldStartCDO(0,n)?(n.advanceCodePoint(4),[exports.TokenType.CDO,"\x3c!--",n.representationStart,n.representationEnd,void 0]):(n.advanceCodePoint(),[exports.TokenType.Delim,"<",n.representationStart,n.representationEnd,{value:"<"}]);case p:if(n.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)){const e=consumeIdentSequence(i,n);return[exports.TokenType.AtKeyword,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCharCode(...e)}]}return[exports.TokenType.Delim,"@",n.representationStart,n.representationEnd,{value:"@"}];case R:return checkIfTwoCodePointsAreAValidEscape(0,n)?consumeIdentLikeToken(i,n):(n.advanceCodePoint(),i.onParseError(new ParseError('Invalid escape sequence after "\\"',n.representationStart,n.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[exports.TokenType.Delim,"\\",n.representationStart,n.representationEnd,{value:"\\"}])}return n.advanceCodePoint(),[exports.TokenType.Delim,n.source[n.representationStart],n.representationStart,n.representationEnd,{value:n.source[n.representationStart]}]},endOfFile:function endOfFile(){return void 0===n.codePointSource[n.cursor]}}}exports.ParseError=ParseError,exports.Reader=Reader,exports.cloneTokens=function cloneTokens(e){return"undefined"!=typeof globalThis&&"structuredClone"in globalThis?structuredClone(e):JSON.parse(JSON.stringify(e))},exports.isToken=function isToken(e){return!!Array.isArray(e)&&(!(e.length<4)&&(!!n.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))},exports.mirrorVariant=function mirrorVariant(e){switch(e[0]){case exports.TokenType.OpenParen:return[exports.TokenType.CloseParen,")",-1,-1,void 0];case exports.TokenType.CloseParen:return[exports.TokenType.OpenParen,"(",-1,-1,void 0];case exports.TokenType.OpenCurly:return[exports.TokenType.CloseCurly,"}",-1,-1,void 0];case exports.TokenType.CloseCurly:return[exports.TokenType.OpenCurly,"{",-1,-1,void 0];case exports.TokenType.OpenSquare:return[exports.TokenType.CloseSquare,"]",-1,-1,void 0];case exports.TokenType.CloseSquare:return[exports.TokenType.OpenSquare,"[",-1,-1,void 0];default:return null}},exports.mirrorVariantType=function mirrorVariantType(e){switch(e){case exports.TokenType.OpenParen:return exports.TokenType.CloseParen;case exports.TokenType.CloseParen:return exports.TokenType.OpenParen;case exports.TokenType.OpenCurly:return exports.TokenType.CloseCurly;case exports.TokenType.CloseCurly:return exports.TokenType.OpenCurly;case exports.TokenType.OpenSquare:return exports.TokenType.CloseSquare;case exports.TokenType.CloseSquare:return exports.TokenType.OpenSquare;default:return null}},exports.mutateIdent=function mutateIdent(e,o){let r="";const n=new Array(o.length);for(let e=0;e=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isNonASCIICodePoint(e){return e>=128}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCIICodePoint(e)||e===A}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===E}function isNewLine(e){return 10===e||13===e||12===e}function isWhitespace(e){return 32===e||10===e||9===e||13===e||12===e}function checkIfTwoCodePointsAreAValidEscape(e,n){return n.codePointSource[n.cursor]===N&&!isNewLine(n.codePointSource[n.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,n){return n.codePointSource[n.cursor]===E?n.codePointSource[n.cursor+1]===E||(!!isIdentStartCodePoint(n.codePointSource[n.cursor+1])||n.codePointSource[n.cursor+1]===N&&!isNewLine(n.codePointSource[n.cursor+2])):!!isIdentStartCodePoint(n.codePointSource[n.cursor])||checkIfTwoCodePointsAreAValidEscape(0,n)}function checkIfThreeCodePointsWouldStartANumber(e,n){return n.codePointSource[n.cursor]===q||n.codePointSource[n.cursor]===E?!!isDigitCodePoint(n.codePointSource[n.cursor+1])||n.codePointSource[n.cursor+1]===l&&isDigitCodePoint(n.codePointSource[n.cursor+2]):n.codePointSource[n.cursor]===l?isDigitCodePoint(n.codePointSource[n.cursor+1]):isDigitCodePoint(n.codePointSource[n.cursor])}function checkIfTwoCodePointsStartAComment(e,n){return n.codePointSource[n.cursor]===H&&n.codePointSource[n.cursor+1]===i}function checkIfThreeCodePointsWouldStartCDC(e,n){return n.codePointSource[n.cursor]===E&&n.codePointSource[n.cursor+1]===E&&n.codePointSource[n.cursor+2]===f}function consumeComment(n,r){for(r.advanceCodePoint(2);;){const e=r.readCodePoint();if(!1===e){n.onParseError(new ParseError("Unexpected EOF while consuming a comment.",r.representationStart,r.representationEnd,["4.3.2. Consume comments","Unexpected EOF"]));break}if(e===i&&(void 0!==r.codePointSource[r.cursor]&&r.codePointSource[r.cursor]===H)){r.advanceCodePoint();break}}return[e.Comment,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0]}function consumeEscapedCodePoint(e,n){const r=n.readCodePoint();if(!1===r)return e.onParseError(new ParseError("Unexpected EOF while consuming an escaped code point.",n.representationStart,n.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),x;if(isHexDigitCodePoint(r)){const e=[r];for(;void 0!==n.codePointSource[n.cursor]&&isHexDigitCodePoint(n.codePointSource[n.cursor])&&e.length<6;)e.push(n.codePointSource[n.cursor]),n.advanceCodePoint();isWhitespace(n.codePointSource[n.cursor])&&n.advanceCodePoint();const o=parseInt(String.fromCharCode(...e),16);return 0===o?x:(t=o)>=55296&&t<=57343||o>U?x:o}var t;return r}function consumeIdentSequence(e,n){const r=[];for(;;)if(isIdentCodePoint(n.codePointSource[n.cursor]))r.push(n.codePointSource[n.cursor]),n.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(0,n))return r;n.advanceCodePoint(),r.push(consumeEscapedCodePoint(e,n))}}function consumeHashToken(n,t){if(t.advanceCodePoint(),void 0!==t.codePointSource[t.cursor]&&(isIdentCodePoint(t.codePointSource[t.cursor])||checkIfTwoCodePointsAreAValidEscape(0,t))){let o=r.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,t)&&(o=r.ID);const i=consumeIdentSequence(n,t);return[e.Hash,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:String.fromCharCode(...i),type:o}]}return[e.Delim,"#",t.representationStart,t.representationEnd,{value:"#"}]}function consumeNumber(e,r){let t=n.Integer;for(r.codePointSource[r.cursor]!==q&&r.codePointSource[r.cursor]!==E||r.advanceCodePoint();isDigitCodePoint(r.codePointSource[r.cursor]);)r.advanceCodePoint();if(r.codePointSource[r.cursor]===l&&isDigitCodePoint(r.codePointSource[r.cursor+1]))for(r.advanceCodePoint(2),t=n.Number;isDigitCodePoint(r.codePointSource[r.cursor]);)r.advanceCodePoint();if(r.codePointSource[r.cursor]===v||r.codePointSource[r.cursor]===m){if(isDigitCodePoint(r.codePointSource[r.cursor+1]))r.advanceCodePoint(2);else{if(r.codePointSource[r.cursor+1]!==E&&r.codePointSource[r.cursor+1]!==q||!isDigitCodePoint(r.codePointSource[r.cursor+2]))return t;r.advanceCodePoint(3)}for(t=n.Number;isDigitCodePoint(r.codePointSource[r.cursor]);)r.advanceCodePoint()}return t}function consumeNumericToken(n,r){const t=consumeNumber(0,r),o=parseFloat(r.source.slice(r.representationStart,r.representationEnd+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,r)){const i=consumeIdentSequence(n,r);return[e.Dimension,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:o,type:t,unit:String.fromCharCode(...i)}]}return r.codePointSource[r.cursor]===y?(r.advanceCodePoint(),[e.Percentage,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:o}]):[e.Number,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:o,type:t}]}function consumeWhiteSpace(n,r){for(;isWhitespace(r.codePointSource[r.cursor]);)r.advanceCodePoint();return[e.Whitespace,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0]}function consumeStringToken(n,r){let t="";const o=r.readCodePoint();for(;;){const i=r.readCodePoint();if(!1===i)return n.onParseError(new ParseError("Unexpected EOF while consuming a string token.",r.representationStart,r.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"])),[e.String,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}];if(isNewLine(i))return n.onParseError(new ParseError("Unexpected newline while consuming a string token.",r.representationStart,r.representationEnd,["4.3.5. Consume a string token","Unexpected newline"])),r.unreadCodePoint(),[e.BadString,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0];if(i===o)return[e.String,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}];if(i!==N)t+=String.fromCharCode(i);else{if(void 0===r.codePointSource[r.cursor])continue;if(isNewLine(r.codePointSource[r.cursor])){r.advanceCodePoint();continue}t+=String.fromCharCode(consumeEscapedCodePoint(n,r))}}}const K="u".charCodeAt(0),M="U".charCodeAt(0),$="r".charCodeAt(0),J="R".charCodeAt(0),j="l".charCodeAt(0),Q="L".charCodeAt(0);function checkIfCodePointsMatchURLIdent(e,n){return 3===n.length&&((n[0]===K||n[0]===M)&&((n[1]===$||n[1]===J)&&(n[2]===j||n[2]===Q)))}function consumeBadURL(e,n){for(;;){if(void 0===n.codePointSource[n.cursor])return;if(n.codePointSource[n.cursor]===W)return void n.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(0,n)?(n.advanceCodePoint(),consumeEscapedCodePoint(e,n)):n.advanceCodePoint()}}function consumeUrlToken(n,r){consumeWhiteSpace(0,r);let t="";for(;;){if(void 0===r.codePointSource[r.cursor])return n.onParseError(new ParseError("Unexpected EOF while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"])),[e.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}];if(r.codePointSource[r.cursor]===W)return r.advanceCodePoint(),[e.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}];if(isWhitespace(r.codePointSource[r.cursor]))return consumeWhiteSpace(0,r),void 0===r.codePointSource[r.cursor]?(n.onParseError(new ParseError("Unexpected EOF while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"])),[e.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}]):r.codePointSource[r.cursor]===W?(r.advanceCodePoint(),[e.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}]):(consumeBadURL(n,r),[e.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0]);if(r.codePointSource[r.cursor]===R||r.codePointSource[r.cursor]===o||r.codePointSource[r.cursor]===g||((i=r.codePointSource[r.cursor])===w||i===S||D<=i&&i<=c||B<=i&&i<=h))return consumeBadURL(n,r),n.onParseError(new ParseError("Unexpected character while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"])),[e.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0];if(r.codePointSource[r.cursor]===N){if(checkIfTwoCodePointsAreAValidEscape(0,r)){r.advanceCodePoint(),t+=String.fromCharCode(consumeEscapedCodePoint(n,r));continue}return consumeBadURL(n,r),n.onParseError(new ParseError("Invalid escape sequence while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[e.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0]}t+=String.fromCharCode(r.codePointSource[r.cursor]),r.advanceCodePoint()}var i}function consumeIdentLikeToken(n,r){const t=consumeIdentSequence(n,r);if(r.codePointSource[r.cursor]!==g)return[e.Ident,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:String.fromCharCode(...t)}];if(checkIfCodePointsMatchURLIdent(0,t)){r.advanceCodePoint();let i=0;for(;;){const n=isWhitespace(r.codePointSource[r.cursor]),c=isWhitespace(r.codePointSource[r.cursor+1]);if(n&&c){i+=1,r.advanceCodePoint(1);continue}const s=n?r.codePointSource[r.cursor+1]:r.codePointSource[r.cursor];if(s===R||s===o)return i>0&&r.unreadCodePoint(i),[e.Function,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:String.fromCharCode(...t)}];break}return consumeUrlToken(n,r)}return r.advanceCodePoint(),[e.Function,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:String.fromCharCode(...t)}]}function tokenize(e,n){const r=tokenizer(e,n),t=[];{for(;!r.endOfFile();){const e=r.nextToken();e&&t.push(e)}const e=r.nextToken();e&&t.push(e)}return t}function tokenizer(n,r){const t=n.css.valueOf(),i=new Reader(t),c={onParseError:(null==r?void 0:r.onParseError)??(()=>{})};return{nextToken:function nextToken(){if(i.representationStart=i.cursor,i.representationEnd=-1,checkIfTwoCodePointsStartAComment(0,i))return consumeComment(c,i);const n=i.codePointSource[i.cursor];if(void 0===n)return[e.EOF,"",-1,-1,void 0];if(isIdentStartCodePoint(n))return consumeIdentLikeToken(c,i);if(isDigitCodePoint(n))return consumeNumericToken(c,i);switch(n){case d:return i.advanceCodePoint(),[e.Comma,",",i.representationStart,i.representationEnd,void 0];case u:return i.advanceCodePoint(),[e.Colon,":",i.representationStart,i.representationEnd,void 0];case V:return i.advanceCodePoint(),[e.Semicolon,";",i.representationStart,i.representationEnd,void 0];case g:return i.advanceCodePoint(),[e.OpenParen,"(",i.representationStart,i.representationEnd,void 0];case W:return i.advanceCodePoint(),[e.CloseParen,")",i.representationStart,i.representationEnd,void 0];case I:return i.advanceCodePoint(),[e.OpenSquare,"[",i.representationStart,i.representationEnd,void 0];case F:return i.advanceCodePoint(),[e.CloseSquare,"]",i.representationStart,i.representationEnd,void 0];case k:return i.advanceCodePoint(),[e.OpenCurly,"{",i.representationStart,i.representationEnd,void 0];case b:return i.advanceCodePoint(),[e.CloseCurly,"}",i.representationStart,i.representationEnd,void 0];case o:case R:return consumeStringToken(c,i);case L:return consumeHashToken(c,i);case q:case l:return checkIfThreeCodePointsWouldStartANumber(0,i)?consumeNumericToken(c,i):(i.advanceCodePoint(),[e.Delim,i.source[i.representationStart],i.representationStart,i.representationEnd,{value:i.source[i.representationStart]}]);case O:case s:case C:case a:case z:return consumeWhiteSpace(0,i);case E:return checkIfThreeCodePointsWouldStartANumber(0,i)?consumeNumericToken(c,i):checkIfThreeCodePointsWouldStartCDC(0,i)?(i.advanceCodePoint(3),[e.CDC,"--\x3e",i.representationStart,i.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,i)?consumeIdentLikeToken(c,i):(i.advanceCodePoint(),[e.Delim,"-",i.representationStart,i.representationEnd,{value:"-"}]);case T:return checkIfFourCodePointsWouldStartCDO(0,i)?(i.advanceCodePoint(4),[e.CDO,"\x3c!--",i.representationStart,i.representationEnd,void 0]):(i.advanceCodePoint(),[e.Delim,"<",i.representationStart,i.representationEnd,{value:"<"}]);case p:if(i.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,i)){const n=consumeIdentSequence(c,i);return[e.AtKeyword,i.source.slice(i.representationStart,i.representationEnd+1),i.representationStart,i.representationEnd,{value:String.fromCharCode(...n)}]}return[e.Delim,"@",i.representationStart,i.representationEnd,{value:"@"}];case N:return checkIfTwoCodePointsAreAValidEscape(0,i)?consumeIdentLikeToken(c,i):(i.advanceCodePoint(),c.onParseError(new ParseError('Invalid escape sequence after "\\"',i.representationStart,i.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[e.Delim,"\\",i.representationStart,i.representationEnd,{value:"\\"}])}return i.advanceCodePoint(),[e.Delim,i.source[i.representationStart],i.representationStart,i.representationEnd,{value:i.source[i.representationStart]}]},endOfFile:function endOfFile(){return void 0===i.codePointSource[i.cursor]}}}function cloneTokens(e){return"undefined"!=typeof globalThis&&"structuredClone"in globalThis?structuredClone(e):JSON.parse(JSON.stringify(e))}function mutateIdent(e,n){let r="";const t=new Array(n.length);for(let e=0;e; + source: string; + advanceCodePoint(n?: number): void; + readCodePoint(n?: number): number | false; + unreadCodePoint(n?: number): void; +}; diff --git a/node_modules/@csstools/css-tokenizer/dist/interfaces/context.d.ts b/node_modules/@csstools/css-tokenizer/dist/interfaces/context.d.ts new file mode 100644 index 000000000..339bfe4e4 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/interfaces/context.d.ts @@ -0,0 +1,4 @@ +import { ParseError } from './error'; +export type Context = { + onParseError: (error: ParseError) => void; +}; diff --git a/node_modules/@csstools/css-tokenizer/dist/interfaces/error.d.ts b/node_modules/@csstools/css-tokenizer/dist/interfaces/error.d.ts new file mode 100644 index 000000000..dc47e1d69 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/interfaces/error.d.ts @@ -0,0 +1,9 @@ +export declare class ParseError extends Error { + /** The index of the start character of the current token. */ + sourceStart: number; + /** The index of the end character of the current token. */ + sourceEnd: number; + /** The parser steps that preceded the error. */ + parserState: Array; + constructor(message: string, sourceStart: number, sourceEnd: number, parserState: Array); +} diff --git a/node_modules/@csstools/css-tokenizer/dist/interfaces/token.d.ts b/node_modules/@csstools/css-tokenizer/dist/interfaces/token.d.ts new file mode 100644 index 000000000..ef353850b --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/interfaces/token.d.ts @@ -0,0 +1,128 @@ +export declare enum TokenType { + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#comment-diagram */ + Comment = "comment", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-at-keyword-token */ + AtKeyword = "at-keyword-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-bad-string-token */ + BadString = "bad-string-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-bad-url-token */ + BadURL = "bad-url-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-cdc-token */ + CDC = "CDC-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-cdo-token */ + CDO = "CDO-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-colon-token */ + Colon = "colon-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-comma-token */ + Comma = "comma-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-delim-token */ + Delim = "delim-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-dimension-token */ + Dimension = "dimension-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-eof-token */ + EOF = "EOF-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-function-token */ + Function = "function-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-hash-token */ + Hash = "hash-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-ident-token */ + Ident = "ident-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-percentage-token */ + Number = "number-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-percentage-token */ + Percentage = "percentage-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-semicolon-token */ + Semicolon = "semicolon-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-string-token */ + String = "string-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-url-token */ + URL = "url-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-whitespace-token */ + Whitespace = "whitespace-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-paren */ + OpenParen = "(-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-paren */ + CloseParen = ")-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-square */ + OpenSquare = "[-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-square */ + CloseSquare = "]-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-curly */ + OpenCurly = "{-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-curly */ + CloseCurly = "}-token" +} +export declare enum NumberType { + Integer = "integer", + Number = "number" +} +export declare enum HashType { + Unrestricted = "unrestricted", + ID = "id" +} +export type TokenAtKeyword = Token; +export type TokenBadString = Token; +export type TokenBadURL = Token; +export type TokenCDC = Token; +export type TokenCDO = Token; +export type TokenColon = Token; +export type TokenComma = Token; +export type TokenComment = Token; +export type TokenDelim = Token; +export type TokenDimension = Token; +export type TokenEOF = Token; +export type TokenFunction = Token; +export type TokenHash = Token; +export type TokenIdent = Token; +export type TokenNumber = Token; +export type TokenPercentage = Token; +export type TokenSemicolon = Token; +export type TokenString = Token; +export type TokenURL = Token; +export type TokenWhitespace = Token; +export type TokenOpenParen = Token; +export type TokenCloseParen = Token; +export type TokenOpenSquare = Token; +export type TokenCloseSquare = Token; +export type TokenOpenCurly = Token; +export type TokenCloseCurly = Token; +export type CSSToken = TokenAtKeyword | TokenBadString | TokenBadURL | TokenCDC | TokenCDO | TokenColon | TokenComma | TokenComment | TokenDelim | TokenDimension | TokenEOF | TokenFunction | TokenHash | TokenIdent | TokenNumber | TokenPercentage | TokenSemicolon | TokenString | TokenURL | TokenWhitespace | TokenOpenParen | TokenCloseParen | TokenOpenSquare | TokenCloseSquare | TokenOpenCurly | TokenCloseCurly; +export type Token = [ + /** The type of token */ + T, + /** The token representation */ + string, + /** Start position of representation */ + number, + /** End position of representation */ + number, + /** Extra data */ + U +]; +export declare function mirrorVariantType(type: TokenType): TokenType | null; +export declare function mirrorVariant(token: CSSToken): CSSToken | null; +export declare function isToken(x: any): x is CSSToken; diff --git a/node_modules/@csstools/css-tokenizer/dist/reader.d.ts b/node_modules/@csstools/css-tokenizer/dist/reader.d.ts new file mode 100644 index 000000000..5a710ced0 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/reader.d.ts @@ -0,0 +1,13 @@ +import { CodePointReader } from './interfaces/code-point-reader'; +export declare class Reader implements CodePointReader { + cursor: number; + source: string; + codePointSource: Array; + length: number; + representationStart: number; + representationEnd: number; + constructor(source: string); + advanceCodePoint(n?: number): void; + readCodePoint(n?: number): number | false; + unreadCodePoint(n?: number): void; +} diff --git a/node_modules/@csstools/css-tokenizer/dist/stringify.d.ts b/node_modules/@csstools/css-tokenizer/dist/stringify.d.ts new file mode 100644 index 000000000..574d2043e --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/stringify.d.ts @@ -0,0 +1,2 @@ +import type { CSSToken } from './interfaces/token'; +export declare function stringify(...tokens: Array): string; diff --git a/node_modules/@csstools/css-tokenizer/dist/tokenizer.d.ts b/node_modules/@csstools/css-tokenizer/dist/tokenizer.d.ts new file mode 100644 index 000000000..aa7f02ee0 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/tokenizer.d.ts @@ -0,0 +1,19 @@ +import { CSSToken } from './interfaces/token'; +import { ParseError } from './interfaces/error'; +interface Stringer { + valueOf(): string; +} +export declare function tokenize(input: { + css: Stringer; +}, options?: { + onParseError?: (error: ParseError) => void; +}): Array; +export declare function tokenizer(input: { + css: Stringer; +}, options?: { + onParseError?: (error: ParseError) => void; +}): { + nextToken: () => CSSToken | undefined; + endOfFile: () => boolean; +}; +export {}; diff --git a/node_modules/@csstools/css-tokenizer/dist/util/clone-tokens.d.ts b/node_modules/@csstools/css-tokenizer/dist/util/clone-tokens.d.ts new file mode 100644 index 000000000..1db05d036 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/util/clone-tokens.d.ts @@ -0,0 +1,2 @@ +import { CSSToken } from '../interfaces/token'; +export declare function cloneTokens(tokens: Array): Array; diff --git a/node_modules/@csstools/css-tokenizer/dist/util/mutations.d.ts b/node_modules/@csstools/css-tokenizer/dist/util/mutations.d.ts new file mode 100644 index 000000000..37f23cd29 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/dist/util/mutations.d.ts @@ -0,0 +1,2 @@ +import { TokenIdent } from '../interfaces/token'; +export declare function mutateIdent(ident: TokenIdent, newValue: string): void; diff --git a/node_modules/@csstools/css-tokenizer/package.json b/node_modules/@csstools/css-tokenizer/package.json new file mode 100644 index 000000000..c17437c39 --- /dev/null +++ b/node_modules/@csstools/css-tokenizer/package.json @@ -0,0 +1,67 @@ +{ + "name": "@csstools/css-tokenizer", + "description": "Tokenize CSS", + "version": "2.1.1", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + }, + "engines": { + "node": "^14 || ^16 || >=18" + }, + "main": "dist/index.cjs", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "devDependencies": { + "@rmenke/css-tokenizer-tests": "^1.0.9", + "postcss-parser-tests": "^8.5.1" + }, + "scripts": { + "benchmark": "node ./test/benchmark.mjs", + "build": "rollup -c ../../rollup/default.mjs", + "lint": "node ../../.github/bin/format-package-json.mjs", + "prepublishOnly": "npm run build && npm run test", + "stryker": "stryker run --logLevel error", + "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs" + }, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer#readme", + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "packages/css-tokenizer" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "css", + "tokenizer" + ], + "volta": { + "extends": "../../package.json" + } +} diff --git a/node_modules/@csstools/media-query-list-parser/CHANGELOG.md b/node_modules/@csstools/media-query-list-parser/CHANGELOG.md new file mode 100644 index 000000000..3045e7c9a --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/CHANGELOG.md @@ -0,0 +1,64 @@ +# Changes to Media Query List Parser + +### 2.1.2 + +_July 3, 2023_ + +- Updated [`@csstools/css-parser-algorithms`](/packages/css-parser-algorithms) to [`2.3.0`](/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) + +### 2.1.1 + +_June 21, 2023_ + +- Fix parsing of `(width == 100px)`. This was erroneously parsed as a range query and will now instead be a general enclosed node. + +### 2.1.0 + +_June 1, 2023_ + +- Fix `walk` for `MediaFeatureValue` with complex component values. +- Add `state` to `walk` methods. + +This makes it possible pass down information from a parent structure to children. +e.g. you can set `entry.state.inInPrintQuery = true` for `print and (min-width: 30cm)`. + +### 2.0.4 + +_April 10, 2023_ + +- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) +- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) + +### 2.0.3 + +_April 10, 2023_ + +- Add support for `env()` functions as values in media queries. +- Improve the detection of math function as values in media queries. + +### 2.0.2 + +_March 25, 2023_ + +- Improve case insensitive string matching. + +### 2.0.1 + +_January 28, 2023_ + +- Improve `types` declaration in `package.json` + +### 2.0.0 + +_January 19, 2023_ + +- Refactor `MediaFeatureBoolean` so that it follows the same structure as `MediaFeaturePlain` (breaking) +- Change the `ParseError` interface, this is now a subclass of `Error` (breaking) +- Add `getName` and `getNameToken` to all nodes that have a feature name. +- Add `@custom-media` parsing. + +### 1.0.0 + +_November 14, 2022_ + +- Initial version diff --git a/node_modules/@csstools/media-query-list-parser/LICENSE.md b/node_modules/@csstools/media-query-list-parser/LICENSE.md new file mode 100644 index 000000000..af5411fa2 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2022 Romain Menke, Antonio Laguna + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@csstools/media-query-list-parser/README.md b/node_modules/@csstools/media-query-list-parser/README.md new file mode 100644 index 000000000..d72dc7ddc --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/README.md @@ -0,0 +1,61 @@ +# Media Query List Parser + +[npm version][npm-url] +[Build Status][cli-url] +[Discord][discord] + +Implemented from : https://www.w3.org/TR/mediaqueries-5/ + +## Usage + +Add [Media Query List Parser] to your project: + +```bash +npm install @csstools/media-query-list-parser @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev +``` + +[Media Query List Parser] depends on our CSS tokenizer and parser algorithms. +It must be used together with `@csstools/css-tokenizer` and `@csstools/css-parser-algorithms`. + +```ts +import { parse } from '@csstools/media-query-list-parser'; + +export function parseCustomMedia() { + const mediaQueryList = parse('screen and (min-width: 300px), (50px < height < 30vw)'); + + mediaQueryList.forEach((mediaQuery) => { + mediaQuery.walk((entry, index) => { + // Index of the current Node in `parent`. + console.log(index); + // Type of `parent`. + console.log(entry.parent.type); + + // Type of `node` + { + // Sometimes nodes can be arrays. + if (Array.isArray(entry.node)) { + entry.node.forEach((item) => { + console.log(item.type); + }); + } + + if ('type' in entry.node) { + console.log(entry.node.type); + } + } + + // stringified version of the current node. + console.log(entry.node.toString()); + + // Return `false` to stop the walker. + return false; + }); + }); +} +``` + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/media-query-list-parser + +[Media Query List Parser]: https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser diff --git a/node_modules/@csstools/media-query-list-parser/dist/index.cjs b/node_modules/@csstools/media-query-list-parser/dist/index.cjs new file mode 100644 index 000000000..0d66a43fd --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var e,t=require("@csstools/css-parser-algorithms"),i=require("@csstools/css-tokenizer");exports.NodeType=void 0,(e=exports.NodeType||(exports.NodeType={})).CustomMedia="custom-media",e.GeneralEnclosed="general-enclosed",e.MediaAnd="media-and",e.MediaCondition="media-condition",e.MediaConditionListWithAnd="media-condition-list-and",e.MediaConditionListWithOr="media-condition-list-or",e.MediaFeature="media-feature",e.MediaFeatureBoolean="mf-boolean",e.MediaFeatureName="mf-name",e.MediaFeaturePlain="mf-plain",e.MediaFeatureRangeNameValue="mf-range-name-value",e.MediaFeatureRangeValueName="mf-range-value-name",e.MediaFeatureRangeValueNameValue="mf-range-value-name-value",e.MediaFeatureValue="mf-value",e.MediaInParens="media-in-parens",e.MediaNot="media-not",e.MediaOr="media-or",e.MediaQueryWithType="media-query-with-type",e.MediaQueryWithoutType="media-query-without-type",e.MediaQueryInvalid="media-query-invalid";const a=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(a,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}class MediaCondition{type=exports.NodeType.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===exports.NodeType.MediaCondition)}}class MediaInParens{type=exports.NodeType.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.media.toString()+i.stringify(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===exports.NodeType.MediaInParens)}}class MediaQueryWithType{type=exports.NodeType.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;ee.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(e,t){let i=!1;if(this.media.forEach(((a,r)=>{if(i)return;let n;t&&(n={...t}),!1!==e({node:a,parent:this,state:n},r)?"walk"in a&&!1===a.walk(e,n)&&(i=!0):i=!0})),i)return!1}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryInvalid(){return MediaQueryInvalid.isMediaQueryInvalid(this)}static isMediaQueryInvalid(e){return!!e&&(e instanceof MediaQueryInvalid&&e.type===exports.NodeType.MediaQueryInvalid)}}class GeneralEnclosed{type=exports.NodeType.GeneralEnclosed;value;constructor(e){this.value=e}tokens(){return this.value.tokens()}toString(){return this.value.toString()}indexOf(e){return e===this.value?"value":-1}at(e){if("value"===e)return this.value}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,tokens:this.tokens()}}isGeneralEnclosed(){return GeneralEnclosed.isGeneralEnclosed(this)}static isGeneralEnclosed(e){return!!e&&(e instanceof GeneralEnclosed&&e.type===exports.NodeType.GeneralEnclosed)}}class MediaAnd{type=exports.NodeType.MediaAnd;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return i.stringify(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){return"media"===e?this.media:null}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaAnd(){return MediaAnd.isMediaAnd(this)}static isMediaAnd(e){return!!e&&(e instanceof MediaAnd&&e.type===exports.NodeType.MediaAnd)}}class MediaConditionListWithAnd{type=exports.NodeType.MediaConditionListWithAnd;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((r,n)=>{a||(t&&(i={...t}),!1!==e({node:r,parent:this,state:i},n)?"walk"in r&&!1===r.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===exports.NodeType.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=exports.NodeType.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((r,n)=>{a||(t&&(i={...t}),!1!==e({node:r,parent:this,state:i},n)?"walk"in r&&!1===r.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===exports.NodeType.MediaConditionListWithOr)}}function isNumber(e){return!!(e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Number||e.type===t.ComponentValueType.Function&&r.has(toLowerCaseAZ(e.name[4].value)))}const r=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(e){return e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Dimension}function isIdent(e){return e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Ident}function isEnvironmentVariable(e){return e.type===t.ComponentValueType.Function&&"env"===toLowerCaseAZ(e.name[4].value)}class MediaFeatureName{type=exports.NodeType.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.name.toString()+i.stringify(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===exports.NodeType.MediaFeatureName)}}function parseMediaFeatureName(e){let i=-1;for(let a=0;ae.tokens())),e.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=exports.NodeType.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===exports.NodeType.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=exports.NodeType.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?i.stringify(...this.before)+this.value.map((e=>e.toString())).join("")+i.stringify(...this.after):i.stringify(...this.before)+this.value.toString()+i.stringify(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(e,t){if(Array.isArray(this.value)){let i=!1;if(this.value.forEach(((a,r)=>{if(i)return;let n;t&&(n={...t}),!1!==e({node:a,parent:this,state:n},r)?"walk"in a&&!1===a.walk(e,n)&&(i=!0):i=!0})),i)return!1}else{let i;if(t&&(i={...t}),!1===e({node:this.value,parent:this,state:i},"value"))return!1;if("walk"in this.value)return this.value.walk(e,i)}}toJSON(){return Array.isArray(this.value)?{type:this.type,value:this.value.map((e=>e.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===exports.NodeType.MediaFeatureValue)}}function parseMediaFeatureValue(e){let i=-1,a=-1;for(let r=0;re.tokens())),e.slice(a+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t2)return!1;if(e[0][0]!==i.TokenType.Delim)return!1;if(1===e.length)switch(e[0][4].value){case exports.MediaFeatureEQ.EQ:return exports.MediaFeatureEQ.EQ;case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT;default:return!1}if(e[1][0]!==i.TokenType.Delim)return!1;if(e[1][4].value!==exports.MediaFeatureEQ.EQ)return!1;switch(e[0][4].value){case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT_OR_EQ;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT_OR_EQ;default:return!1}}exports.MediaFeatureLT=void 0,(n=exports.MediaFeatureLT||(exports.MediaFeatureLT={})).LT="<",n.LT_OR_EQ="<=",exports.MediaFeatureGT=void 0,(o=exports.MediaFeatureGT||(exports.MediaFeatureGT={})).GT=">",o.GT_OR_EQ=">=",exports.MediaFeatureEQ=void 0,(exports.MediaFeatureEQ||(exports.MediaFeatureEQ={})).EQ="=";class MediaFeatureRangeNameValue{type=exports.NodeType.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+i.stringify(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===exports.NodeType.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=exports.NodeType.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+i.stringify(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===exports.NodeType.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=exports.NodeType.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,r){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=r}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+i.stringify(...this.valueOneOperator)+this.name.toString()+i.stringify(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===exports.NodeType.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(e){let a=!1,r=!1;for(let n=0;ne.tokens())),-1!==r&&(s=e.slice(a+1,r+1).flatMap((e=>e.tokens())))):-1!==r&&(s=e.slice(0,r+1).flatMap((e=>e.tokens())));const u=parseMediaConditionWithoutOr(e.slice(Math.max(a,r,n)+1));return!1===u?new MediaQueryWithType(o,[...s,...e.slice(r+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(o,s,e.slice(r+1,n+1).flatMap((e=>e.tokens())),u)}}function parseMediaConditionListWithOr(e){let i=!1;const a=[];let r=-1,n=-1;for(let o=0;oe.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(e){let i=!1;const a=[];let r=-1,n=-1;for(let o=0;oe.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const r=parseMediaInParens(e);return!1!==r&&new MediaCondition(r)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(e){let a=-1;for(let i=0;ie.tokens())),r.startToken],o=[r.endToken,...e.slice(a+1).flatMap((e=>e.tokens()))],s=parseMediaFeature(r,n,o);if(!1!==s)return new MediaInParens(s);const u=parseMediaCondition(r.value);return!1!==u?new MediaInParens(u,n,o):new MediaInParens(new GeneralEnclosed(r),e.slice(0,a).flatMap((e=>e.tokens())),e.slice(a+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(e.startToken[0]!==i.TokenType.OpenParen)return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const a=parseMediaCondition(e.value);return!1!==a?new MediaInParens(a,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}function parseMediaNot(e){let i=!1,a=null;for(let r=0;re.tokens())),t)}}}return a||!1}function parseMediaOr(e){let i=!1;for(let a=0;ae.tokens())),t)}}return!1}}return!1}function parseMediaAnd(e){let i=!1;for(let a=0;ae.tokens())),t)}}return!1}}return!1}function parseFromTokens(e,i){const a=t.parseCommaSeparatedListOfComponentValues(e,{onParseError:null==i?void 0:i.onParseError});return a.map(((e,t)=>{const r=parseMediaQuery(e);return 0==r&&!0===(null==i?void 0:i.preserveInvalidMediaQueries)?new MediaQueryInvalid(a[t]):r})).filter((e=>!!e))}exports.MediaQueryModifier=void 0,(u=exports.MediaQueryModifier||(exports.MediaQueryModifier={})).Not="not",u.Only="only";class CustomMedia{type=exports.NodeType.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;ee.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===exports.NodeType.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let a=[],r=e;for(let t=0;tString.fromCharCode(e.charCodeAt(0)+32)))}class MediaCondition{type=f.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===f.MediaCondition)}}class MediaInParens{type=f.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return u(...this.before)+this.media.toString()+u(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===f.MediaInParens)}}class MediaQueryWithType{type=f.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;ee.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(e,t){let i=!1;if(this.media.forEach(((a,n)=>{if(i)return;let r;t&&(r={...t}),!1!==e({node:a,parent:this,state:r},n)?"walk"in a&&!1===a.walk(e,r)&&(i=!0):i=!0})),i)return!1}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryInvalid(){return MediaQueryInvalid.isMediaQueryInvalid(this)}static isMediaQueryInvalid(e){return!!e&&(e instanceof MediaQueryInvalid&&e.type===f.MediaQueryInvalid)}}class GeneralEnclosed{type=f.GeneralEnclosed;value;constructor(e){this.value=e}tokens(){return this.value.tokens()}toString(){return this.value.toString()}indexOf(e){return e===this.value?"value":-1}at(e){if("value"===e)return this.value}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,tokens:this.tokens()}}isGeneralEnclosed(){return GeneralEnclosed.isGeneralEnclosed(this)}static isGeneralEnclosed(e){return!!e&&(e instanceof GeneralEnclosed&&e.type===f.GeneralEnclosed)}}class MediaAnd{type=f.MediaAnd;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return u(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){return"media"===e?this.media:null}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaAnd(){return MediaAnd.isMediaAnd(this)}static isMediaAnd(e){return!!e&&(e instanceof MediaAnd&&e.type===f.MediaAnd)}}class MediaConditionListWithAnd{type=f.MediaConditionListWithAnd;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return u(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+u(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((n,r)=>{a||(t&&(i={...t}),!1!==e({node:n,parent:this,state:i},r)?"walk"in n&&!1===n.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===f.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=f.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return u(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+u(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((n,r)=>{a||(t&&(i={...t}),!1!==e({node:n,parent:this,state:i},r)?"walk"in n&&!1===n.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===f.MediaConditionListWithOr)}}function isNumber(t){return!!(t.type===e.Token&&t.value[0]===d.Number||t.type===e.Function&&M.has(toLowerCaseAZ(t.name[4].value)))}const M=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(t){return t.type===e.Token&&t.value[0]===d.Dimension}function isIdent(t){return t.type===e.Token&&t.value[0]===d.Ident}function isEnvironmentVariable(t){return t.type===e.Function&&"env"===toLowerCaseAZ(t.name[4].value)}class MediaFeatureName{type=f.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return u(...this.before)+this.name.toString()+u(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===f.MediaFeatureName)}}function parseMediaFeatureName(t){let i=-1;for(let a=0;ae.tokens())),t.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=f.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===f.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=f.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?u(...this.before)+this.value.map((e=>e.toString())).join("")+u(...this.after):u(...this.before)+this.value.toString()+u(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(e,t){if(Array.isArray(this.value)){let i=!1;if(this.value.forEach(((a,n)=>{if(i)return;let r;t&&(r={...t}),!1!==e({node:a,parent:this,state:r},n)?"walk"in a&&!1===a.walk(e,r)&&(i=!0):i=!0})),i)return!1}else{let i;if(t&&(i={...t}),!1===e({node:this.value,parent:this,state:i},"value"))return!1;if("walk"in this.value)return this.value.walk(e,i)}}toJSON(){return Array.isArray(this.value)?{type:this.type,value:this.value.map((e=>e.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===f.MediaFeatureValue)}}function parseMediaFeatureValue(t){let i=-1,a=-1;for(let n=0;ne.tokens())),t.slice(a+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t2)return!1;if(e[0][0]!==d.Delim)return!1;if(1===e.length)switch(e[0][4].value){case v.EQ:return v.EQ;case p.LT:return p.LT;case y.GT:return y.GT;default:return!1}if(e[1][0]!==d.Delim)return!1;if(e[1][4].value!==v.EQ)return!1;switch(e[0][4].value){case p.LT:return p.LT_OR_EQ;case y.GT:return y.GT_OR_EQ;default:return!1}}function invertComparison(e){switch(e){case v.EQ:return v.EQ;case p.LT:return y.GT;case p.LT_OR_EQ:return y.GT_OR_EQ;case y.GT:return p.LT;case y.GT_OR_EQ:return p.LT_OR_EQ;default:return!1}}!function(e){e.LT="<",e.LT_OR_EQ="<="}(p||(p={})),function(e){e.GT=">",e.GT_OR_EQ=">="}(y||(y={})),function(e){e.EQ="="}(v||(v={}));class MediaFeatureRangeNameValue{type=f.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+u(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===f.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=f.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+u(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===f.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=f.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,n){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=n}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+u(...this.valueOneOperator)+this.name.toString()+u(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===f.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(t){let i=!1,a=!1;for(let n=0;ne.tokens())),-1!==i&&(u=e.slice(t+1,i+1).flatMap((e=>e.tokens())))):-1!==i&&(u=e.slice(0,i+1).flatMap((e=>e.tokens())));const l=parseMediaConditionWithoutOr(e.slice(Math.max(t,i,s)+1));return!1===l?new MediaQueryWithType(o,[...u,...e.slice(i+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(o,u,e.slice(i+1,s+1).flatMap((e=>e.tokens())),l)}}function parseMediaConditionListWithOr(t){let i=!1;const a=[];let n=-1,r=-1;for(let o=0;oe.tokens())),t.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(t){let i=!1;const a=[];let n=-1,r=-1;for(let o=0;oe.tokens())),t.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const n=parseMediaInParens(e);return!1!==n&&new MediaCondition(n)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(t){let i=-1;for(let a=0;ae.tokens())),a.startToken],r=[a.endToken,...t.slice(i+1).flatMap((e=>e.tokens()))],o=parseMediaFeature(a,n,r);if(!1!==o)return new MediaInParens(o);const u=parseMediaCondition(a.value);return!1!==u?new MediaInParens(u,n,r):new MediaInParens(new GeneralEnclosed(a),t.slice(0,i).flatMap((e=>e.tokens())),t.slice(i+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(e.startToken[0]!==d.OpenParen)return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const i=parseMediaCondition(e.value);return!1!==i?new MediaInParens(i,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}function parseMediaNot(t){let i=!1,a=null;for(let n=0;ne.tokens())),e)}}}return a||!1}function parseMediaOr(t){let i=!1;for(let a=0;ae.tokens())),e)}}return!1}}return!1}function parseMediaAnd(t){let i=!1;for(let a=0;ae.tokens())),e)}}return!1}}return!1}function parseFromTokens(e,t){const i=o(e,{onParseError:null==t?void 0:t.onParseError});return i.map(((e,a)=>{const n=parseMediaQuery(e);return 0==n&&!0===(null==t?void 0:t.preserveInvalidMediaQueries)?new MediaQueryInvalid(i[a]):n})).filter((e=>!!e))}function parse(e,t){const i=h({css:e},{onParseError:null==t?void 0:t.onParseError}),a=[];for(;!i.endOfFile();)a.push(i.nextToken());return a.push(i.nextToken()),parseFromTokens(a,t)}!function(e){e.Not="not",e.Only="only"}(k||(k={}));class CustomMedia{type=f.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;ee.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===f.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let i=[],a=e;for(let t=0;t; + mediaQueryList: Array | null; + trueOrFalseKeyword: Array | null; + constructor(name: Array, mediaQueryList: Array | null, trueOrFalseKeyword?: Array); + getName(): string; + getNameToken(): CSSToken | null; + hasMediaQueryList(): boolean; + hasTrueKeyword(): boolean; + hasFalseKeyword(): boolean; + tokens(): Array; + toString(): string; + toJSON(): { + type: NodeType; + string: string; + nameValue: string; + name: CSSToken[]; + hasFalseKeyword: boolean; + hasTrueKeyword: boolean; + trueOrFalseKeyword: CSSToken[] | null; + mediaQueryList: ({ + type: NodeType; + string: string; + modifier: CSSToken[]; + mediaType: CSSToken[]; + and: CSSToken[] | undefined; + media: import("./media-condition").MediaCondition | undefined; + } | { + type: NodeType; + string: string; + media: import("./media-condition").MediaCondition; + } | { + type: NodeType; + string: string; + media: import("@csstools/css-parser-algorithms").ComponentValue[]; + })[] | undefined; + }; + isCustomMedia(): this is CustomMedia; + static isCustomMedia(x: unknown): x is CustomMedia; +} diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts new file mode 100644 index 000000000..5ab840f52 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts @@ -0,0 +1,25 @@ +import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { NodeType } from '../util/node-type'; +export declare class GeneralEnclosed { + type: NodeType; + value: ComponentValue; + constructor(value: ComponentValue); + tokens(): Array; + toString(): string; + indexOf(item: ComponentValue): number | string; + at(index: number | string): ComponentValue | undefined; + walk>(cb: (entry: { + node: GeneralEnclosedWalkerEntry; + parent: GeneralEnclosedWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + tokens: CSSToken[]; + }; + isGeneralEnclosed(): this is GeneralEnclosed; + static isGeneralEnclosed(x: unknown): x is GeneralEnclosed; +} +export type GeneralEnclosedWalkerEntry = ComponentValue; +export type GeneralEnclosedWalkerParent = ContainerNode | GeneralEnclosed; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts new file mode 100644 index 000000000..ddd73d539 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts @@ -0,0 +1,23 @@ +import { CSSToken } from '@csstools/css-tokenizer'; +import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens'; +import { NodeType } from '../util/node-type'; +export declare class MediaAnd { + type: NodeType; + modifier: Array; + media: MediaInParens; + constructor(modifier: Array, media: MediaInParens); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens): number | string; + at(index: number | string): MediaInParens | null; + walk>(cb: (entry: { + node: MediaAndWalkerEntry; + parent: MediaAndWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isMediaAnd(): this is MediaAnd; + static isMediaAnd(x: unknown): x is MediaAnd; +} +export type MediaAndWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +export type MediaAndWalkerParent = MediaInParensWalkerParent | MediaAnd; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts new file mode 100644 index 000000000..ddc51062d --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts @@ -0,0 +1,50 @@ +import { CSSToken } from '@csstools/css-tokenizer'; +import { MediaAnd, MediaAndWalkerEntry, MediaAndWalkerParent } from './media-and'; +import { MediaInParens } from './media-in-parens'; +import { MediaOr, MediaOrWalkerEntry, MediaOrWalkerParent } from './media-or'; +import { NodeType } from '../util/node-type'; +export type MediaConditionList = MediaConditionListWithAnd | MediaConditionListWithOr; +export declare class MediaConditionListWithAnd { + type: NodeType; + leading: MediaInParens; + list: Array; + before: Array; + after: Array; + constructor(leading: MediaInParens, list: Array, before?: Array, after?: Array); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens | MediaAnd): number | string; + at(index: number | string): MediaInParens | MediaAnd | undefined; + walk>(cb: (entry: { + node: MediaConditionListWithAndWalkerEntry; + parent: MediaConditionListWithAndWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isMediaConditionListWithAnd(): this is MediaConditionListWithAnd; + static isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; +} +export type MediaConditionListWithAndWalkerEntry = MediaAndWalkerEntry | MediaAnd; +export type MediaConditionListWithAndWalkerParent = MediaAndWalkerParent | MediaConditionListWithAnd; +export declare class MediaConditionListWithOr { + type: NodeType; + leading: MediaInParens; + list: Array; + before: Array; + after: Array; + constructor(leading: MediaInParens, list: Array, before?: Array, after?: Array); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens | MediaOr): number | string; + at(index: number | string): MediaInParens | MediaOr | undefined; + walk>(cb: (entry: { + node: MediaConditionListWithOrWalkerEntry; + parent: MediaConditionListWithOrWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isMediaConditionListWithOr(): this is MediaConditionListWithOr; + static isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; +} +export type MediaConditionListWithOrWalkerEntry = MediaOrWalkerEntry | MediaOr; +export type MediaConditionListWithOrWalkerParent = MediaOrWalkerParent | MediaConditionListWithOr; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts new file mode 100644 index 000000000..faf2b49d2 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts @@ -0,0 +1,24 @@ +import { CSSToken } from '@csstools/css-tokenizer'; +import { MediaConditionListWithAnd, MediaConditionListWithAndWalkerEntry, MediaConditionListWithAndWalkerParent, MediaConditionListWithOr, MediaConditionListWithOrWalkerEntry, MediaConditionListWithOrWalkerParent } from './media-condition-list'; +import { MediaInParens } from './media-in-parens'; +import { MediaNot, MediaNotWalkerEntry, MediaNotWalkerParent } from './media-not'; +import { NodeType } from '../util/node-type'; +export declare class MediaCondition { + type: NodeType; + media: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr; + constructor(media: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr); + tokens(): Array; + toString(): string; + indexOf(item: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr): number | string; + at(index: number | string): MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr | undefined; + walk>(cb: (entry: { + node: MediaConditionWalkerEntry; + parent: MediaConditionWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isMediaCondition(): this is MediaCondition; + static isMediaCondition(x: unknown): x is MediaCondition; +} +export type MediaConditionWalkerEntry = MediaNotWalkerEntry | MediaConditionListWithAndWalkerEntry | MediaConditionListWithOrWalkerEntry | MediaNot | MediaConditionListWithAnd | MediaConditionListWithOr; +export type MediaConditionWalkerParent = MediaNotWalkerParent | MediaConditionListWithAndWalkerParent | MediaConditionListWithOrWalkerParent | MediaCondition; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts new file mode 100644 index 000000000..a5c64ec1f --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts @@ -0,0 +1,27 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +import { MediaFeatureName } from './media-feature-name'; +import { NodeType } from '../util/node-type'; +import { CSSToken } from '@csstools/css-tokenizer'; +export declare class MediaFeatureBoolean { + type: NodeType; + name: MediaFeatureName; + constructor(name: MediaFeatureName); + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName): number | string; + at(index: number | string): MediaFeatureName | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeatureBoolean(): this is MediaFeatureBoolean; + static isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; +} +export declare function parseMediaFeatureBoolean(componentValues: Array): false | MediaFeatureBoolean; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts new file mode 100644 index 000000000..377696577 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts @@ -0,0 +1,17 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +import { TokenDelim } from '@csstools/css-tokenizer'; +export declare enum MediaFeatureLT { + LT = "<", + LT_OR_EQ = "<=" +} +export declare enum MediaFeatureGT { + GT = ">", + GT_OR_EQ = ">=" +} +export declare enum MediaFeatureEQ { + EQ = "=" +} +export type MediaFeatureComparison = MediaFeatureLT | MediaFeatureGT | MediaFeatureEQ; +export declare function matchesComparison(componentValues: Array): false | [number, number]; +export declare function comparisonFromTokens(tokens: [TokenDelim, TokenDelim] | [TokenDelim]): MediaFeatureComparison | false; +export declare function invertComparison(operator: MediaFeatureComparison): MediaFeatureComparison | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts new file mode 100644 index 000000000..332b421a1 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts @@ -0,0 +1,24 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { NodeType } from '../util/node-type'; +export declare class MediaFeatureName { + type: NodeType; + name: ComponentValue; + before: Array; + after: Array; + constructor(name: ComponentValue, before?: Array, after?: Array); + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: ComponentValue): number | string; + at(index: number | string): ComponentValue | undefined; + toJSON(): { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + isMediaFeatureName(): this is MediaFeatureName; + static isMediaFeatureName(x: unknown): x is MediaFeatureName; +} +export declare function parseMediaFeatureName(componentValues: Array): MediaFeatureName | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts new file mode 100644 index 000000000..32f22c401 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts @@ -0,0 +1,42 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +import { CSSToken, TokenColon } from '@csstools/css-tokenizer'; +import { MediaFeatureName } from './media-feature-name'; +import { MediaFeatureValue, MediaFeatureValueWalkerEntry, MediaFeatureValueWalkerParent } from './media-feature-value'; +import { NodeType } from '../util/node-type'; +export declare class MediaFeaturePlain { + type: NodeType; + name: MediaFeatureName; + colon: TokenColon; + value: MediaFeatureValue; + constructor(name: MediaFeatureName, colon: TokenColon, value: MediaFeatureValue); + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; + at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; + walk>(cb: (entry: { + node: MediaFeaturePlainWalkerEntry; + parent: MediaFeaturePlainWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + value: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeaturePlain(): this is MediaFeaturePlain; + static isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; +} +export type MediaFeaturePlainWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; +export type MediaFeaturePlainWalkerParent = MediaFeatureValueWalkerParent | MediaFeaturePlain; +export declare function parseMediaFeaturePlain(componentValues: Array): MediaFeaturePlain | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts new file mode 100644 index 000000000..585d8c188 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts @@ -0,0 +1,124 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +import { CSSToken, TokenDelim } from '@csstools/css-tokenizer'; +import { MediaFeatureComparison } from './media-feature-comparison'; +import { MediaFeatureName } from './media-feature-name'; +import { MediaFeatureValue, MediaFeatureValueWalkerEntry, MediaFeatureValueWalkerParent } from './media-feature-value'; +import { NodeType } from '../util/node-type'; +export type MediaFeatureRange = MediaFeatureRangeNameValue | MediaFeatureRangeValueName | MediaFeatureRangeValueNameValue; +export declare class MediaFeatureRangeNameValue { + type: NodeType; + name: MediaFeatureName; + operator: [TokenDelim, TokenDelim] | [TokenDelim]; + value: MediaFeatureValue; + constructor(name: MediaFeatureName, operator: [TokenDelim, TokenDelim] | [TokenDelim], value: MediaFeatureValue); + operatorKind(): MediaFeatureComparison | false; + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; + at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; + walk>(cb: (entry: { + node: MediaFeatureRangeWalkerEntry; + parent: MediaFeatureRangeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + value: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeatureRangeNameValue(): this is MediaFeatureRangeNameValue; + static isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; +} +export declare class MediaFeatureRangeValueName { + type: NodeType; + name: MediaFeatureName; + operator: [TokenDelim, TokenDelim] | [TokenDelim]; + value: MediaFeatureValue; + constructor(name: MediaFeatureName, operator: [TokenDelim, TokenDelim] | [TokenDelim], value: MediaFeatureValue); + operatorKind(): MediaFeatureComparison | false; + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; + at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; + walk>(cb: (entry: { + node: MediaFeatureRangeWalkerEntry; + parent: MediaFeatureRangeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + value: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeatureRangeValueName(): this is MediaFeatureRangeValueName; + static isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; +} +export declare class MediaFeatureRangeValueNameValue { + type: NodeType; + name: MediaFeatureName; + valueOne: MediaFeatureValue; + valueOneOperator: [TokenDelim, TokenDelim] | [TokenDelim]; + valueTwo: MediaFeatureValue; + valueTwoOperator: [TokenDelim, TokenDelim] | [TokenDelim]; + constructor(name: MediaFeatureName, valueOne: MediaFeatureValue, valueOneOperator: [TokenDelim, TokenDelim] | [TokenDelim], valueTwo: MediaFeatureValue, valueTwoOperator: [TokenDelim, TokenDelim] | [TokenDelim]); + valueOneOperatorKind(): MediaFeatureComparison | false; + valueTwoOperatorKind(): MediaFeatureComparison | false; + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; + at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; + walk>(cb: (entry: { + node: MediaFeatureRangeWalkerEntry; + parent: MediaFeatureRangeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + valueOne: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + valueTwo: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeatureRangeValueNameValue(): this is MediaFeatureRangeValueNameValue; + static isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; +} +export type MediaFeatureRangeWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; +export type MediaFeatureRangeWalkerParent = MediaFeatureValueWalkerParent | MediaFeatureRange; +export declare function parseMediaFeatureRange(componentValues: Array): MediaFeatureRange | false; +export declare const mediaDescriptors: Set; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts new file mode 100644 index 000000000..9615670f3 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts @@ -0,0 +1,31 @@ +import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { NodeType } from '../util/node-type'; +export declare class MediaFeatureValue { + type: NodeType; + value: ComponentValue | Array; + before: Array; + after: Array; + constructor(value: ComponentValue | Array, before?: Array, after?: Array); + tokens(): Array; + toString(): string; + indexOf(item: ComponentValue): number | string; + at(index: number | string): ComponentValue | Array | undefined; + walk>(cb: (entry: { + node: MediaFeatureValueWalkerEntry; + parent: MediaFeatureValueWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + isMediaFeatureValue(): this is MediaFeatureValue; + static isMediaFeatureValue(x: unknown): x is MediaFeatureValue; +} +export type MediaFeatureValueWalkerEntry = ComponentValue; +export type MediaFeatureValueWalkerParent = ContainerNode | MediaFeatureValue; +export declare function parseMediaFeatureValue(componentValues: Array): MediaFeatureValue | false; +export declare function matchesRatioExactly(componentValues: Array): number[] | -1; +export declare function matchesRatio(componentValues: Array): number[] | -1; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts new file mode 100644 index 000000000..bf9c0384f --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts @@ -0,0 +1,45 @@ +import { SimpleBlockNode } from '@csstools/css-parser-algorithms'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { MediaFeatureBoolean } from './media-feature-boolean'; +import { MediaFeaturePlain, MediaFeaturePlainWalkerEntry, MediaFeaturePlainWalkerParent } from './media-feature-plain'; +import { MediaFeatureRange, MediaFeatureRangeWalkerEntry, MediaFeatureRangeWalkerParent } from './media-feature-range'; +import { NodeType } from '../util/node-type'; +export declare class MediaFeature { + type: NodeType; + feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; + before: Array; + after: Array; + constructor(feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange, before?: Array, after?: Array); + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange): number | string; + at(index: number | string): MediaFeatureBoolean | MediaFeaturePlain | MediaFeatureRange | undefined; + walk>(cb: (entry: { + node: MediaFeatureWalkerEntry; + parent: MediaFeatureWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + feature: { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + before: CSSToken[]; + after: CSSToken[]; + }; + isMediaFeature(): this is MediaFeature; + static isMediaFeature(x: unknown): x is MediaFeature; +} +export type MediaFeatureWalkerEntry = MediaFeaturePlainWalkerEntry | MediaFeatureRangeWalkerEntry | MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; +export type MediaFeatureWalkerParent = MediaFeaturePlainWalkerParent | MediaFeatureRangeWalkerParent | MediaFeature; +export declare function parseMediaFeature(simpleBlock: SimpleBlockNode, before?: Array, after?: Array): false | MediaFeature; +export declare function newMediaFeatureBoolean(name: string): MediaFeature; +export declare function newMediaFeaturePlain(name: string, ...value: Array): MediaFeature; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts new file mode 100644 index 000000000..904a0725e --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts @@ -0,0 +1,41 @@ +import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { GeneralEnclosed } from './general-enclosed'; +import { MediaAnd } from './media-and'; +import { MediaCondition } from './media-condition'; +import { MediaConditionList } from './media-condition-list'; +import { MediaFeature } from './media-feature'; +import { MediaFeatureBoolean } from './media-feature-boolean'; +import { MediaFeatureName } from './media-feature-name'; +import { MediaFeaturePlain } from './media-feature-plain'; +import { MediaFeatureRange } from './media-feature-range'; +import { MediaFeatureValue } from './media-feature-value'; +import { NodeType } from '../util/node-type'; +import { MediaNot } from './media-not'; +import { MediaOr } from './media-or'; +export declare class MediaInParens { + type: NodeType; + media: MediaCondition | MediaFeature | GeneralEnclosed; + before: Array; + after: Array; + constructor(media: MediaCondition | MediaFeature | GeneralEnclosed, before?: Array, after?: Array); + tokens(): Array; + toString(): string; + indexOf(item: MediaCondition | MediaFeature | GeneralEnclosed): number | string; + at(index: number | string): MediaCondition | MediaFeature | GeneralEnclosed | undefined; + walk>(cb: (entry: { + node: MediaInParensWalkerEntry; + parent: MediaInParensWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + media: unknown; + before: CSSToken[]; + after: CSSToken[]; + }; + isMediaInParens(): this is MediaInParens; + static isMediaInParens(x: unknown): x is MediaInParens; +} +export type MediaInParensWalkerEntry = ComponentValue | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; +export type MediaInParensWalkerParent = ContainerNode | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts new file mode 100644 index 000000000..2bedcaa31 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts @@ -0,0 +1,32 @@ +import { CSSToken } from '@csstools/css-tokenizer'; +import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens'; +import { NodeType } from '../util/node-type'; +export declare class MediaNot { + type: NodeType; + modifier: Array; + media: MediaInParens; + constructor(modifier: Array, media: MediaInParens); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens): number | string; + at(index: number | string): MediaInParens | undefined; + walk>(cb: (entry: { + node: MediaNotWalkerEntry; + parent: MediaNotWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + modifier: CSSToken[]; + media: { + type: NodeType; + media: unknown; + before: CSSToken[]; + after: CSSToken[]; + }; + }; + isMediaNot(): this is MediaNot; + static isMediaNot(x: unknown): x is MediaNot; +} +export type MediaNotWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +export type MediaNotWalkerParent = MediaInParensWalkerParent | MediaNot; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts new file mode 100644 index 000000000..4459412d4 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts @@ -0,0 +1,32 @@ +import { CSSToken } from '@csstools/css-tokenizer'; +import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens'; +import { NodeType } from '../util/node-type'; +export declare class MediaOr { + type: NodeType; + modifier: Array; + media: MediaInParens; + constructor(modifier: Array, media: MediaInParens); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens): number | string; + at(index: number | string): MediaInParens | undefined; + walk>(cb: (entry: { + node: MediaOrWalkerEntry; + parent: MediaOrWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + modifier: CSSToken[]; + media: { + type: NodeType; + media: unknown; + before: CSSToken[]; + after: CSSToken[]; + }; + }; + isMediaOr(): this is MediaOr; + static isMediaOr(x: unknown): x is MediaOr; +} +export type MediaOrWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +export type MediaOrWalkerParent = MediaInParensWalkerParent | MediaOr; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts new file mode 100644 index 000000000..df9733cb5 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts @@ -0,0 +1,6 @@ +import { TokenIdent } from '@csstools/css-tokenizer'; +export declare enum MediaQueryModifier { + Not = "not", + Only = "only" +} +export declare function modifierFromToken(token: TokenIdent): MediaQueryModifier | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts new file mode 100644 index 000000000..aa77dee09 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts @@ -0,0 +1,83 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { NodeType } from '../util/node-type'; +import { MediaCondition, MediaConditionWalkerEntry, MediaConditionWalkerParent } from './media-condition'; +export type MediaQuery = MediaQueryWithType | MediaQueryWithoutType | MediaQueryInvalid; +export declare class MediaQueryWithType { + type: NodeType; + modifier: Array; + mediaType: Array; + and: Array | undefined; + media: MediaCondition | undefined; + constructor(modifier: Array, mediaType: Array, and?: Array | undefined, media?: MediaCondition | undefined); + getModifier(): string; + negateQuery(): MediaQuery; + getMediaType(): string; + tokens(): Array; + toString(): string; + indexOf(item: MediaCondition): number | string; + at(index: number | string): MediaCondition | undefined; + walk>(cb: (entry: { + node: MediaQueryWithTypeWalkerEntry; + parent: MediaQueryWithTypeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + string: string; + modifier: CSSToken[]; + mediaType: CSSToken[]; + and: CSSToken[] | undefined; + media: MediaCondition | undefined; + }; + isMediaQueryWithType(): this is MediaQueryWithType; + static isMediaQueryWithType(x: unknown): x is MediaQueryWithType; +} +export type MediaQueryWithTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; +export type MediaQueryWithTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithType; +export declare class MediaQueryWithoutType { + type: NodeType; + media: MediaCondition; + constructor(media: MediaCondition); + negateQuery(): MediaQuery; + tokens(): Array; + toString(): string; + indexOf(item: MediaCondition): number | string; + at(index: number | string): MediaCondition | undefined; + walk>(cb: (entry: { + node: MediaQueryWithoutTypeWalkerEntry; + parent: MediaQueryWithoutTypeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + string: string; + media: MediaCondition; + }; + isMediaQueryWithoutType(): this is MediaQueryWithoutType; + static isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; +} +export type MediaQueryWithoutTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; +export type MediaQueryWithoutTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithoutType; +export declare class MediaQueryInvalid { + type: NodeType; + media: Array; + constructor(media: Array); + negateQuery(): MediaQuery; + tokens(): Array; + toString(): string; + walk>(cb: (entry: { + node: MediaQueryInvalidWalkerEntry; + parent: MediaQueryInvalidWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + string: string; + media: ComponentValue[]; + }; + isMediaQueryInvalid(): this is MediaQueryInvalid; + static isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; +} +export type MediaQueryInvalidWalkerEntry = ComponentValue; +export type MediaQueryInvalidWalkerParent = ComponentValue | MediaQueryInvalid; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts new file mode 100644 index 000000000..b7924b760 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts @@ -0,0 +1,24 @@ +import { TokenIdent } from '@csstools/css-tokenizer'; +export declare enum MediaType { + /** Always matches */ + All = "all", + Print = "print", + Screen = "screen", + /** Never matches */ + Tty = "tty", + /** Never matches */ + Tv = "tv", + /** Never matches */ + Projection = "projection", + /** Never matches */ + Handheld = "handheld", + /** Never matches */ + Braille = "braille", + /** Never matches */ + Embossed = "embossed", + /** Never matches */ + Aural = "aural", + /** Never matches */ + Speech = "speech" +} +export declare function typeFromToken(token: TokenIdent): MediaType | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts b/node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts new file mode 100644 index 000000000..1be3d0f36 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts @@ -0,0 +1,8 @@ +import { CSSToken, ParseError } from '@csstools/css-tokenizer'; +import { CustomMedia } from '../nodes/custom-media'; +export type Options = { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}; +export declare function parseCustomMediaFromTokens(tokens: Array, options?: Options): CustomMedia | false; +export declare function parseCustomMedia(source: string, options?: Options): CustomMedia | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts b/node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts new file mode 100644 index 000000000..3801d1789 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts @@ -0,0 +1,24 @@ +import { ComponentValue, SimpleBlockNode } from '@csstools/css-parser-algorithms'; +import { MediaAnd } from '../nodes/media-and'; +import { MediaCondition } from '../nodes/media-condition'; +import { MediaConditionListWithAnd, MediaConditionListWithOr } from '../nodes/media-condition-list'; +import { MediaInParens } from '../nodes/media-in-parens'; +import { MediaNot } from '../nodes/media-not'; +import { MediaOr } from '../nodes/media-or'; +import { MediaQuery } from '../nodes/media-query'; +export declare function parseMediaQuery(componentValues: Array): MediaQuery | false; +export declare function parseMediaConditionListWithOr(componentValues: Array): MediaConditionListWithOr | false; +export declare function parseMediaConditionListWithAnd(componentValues: Array): MediaConditionListWithAnd | false; +export declare function parseMediaCondition(componentValues: Array): MediaCondition | false; +export declare function parseMediaConditionWithoutOr(componentValues: Array): MediaCondition | false; +export declare function parseMediaInParens(componentValues: Array): MediaInParens | false; +export declare function parseMediaInParensFromSimpleBlock(simpleBlock: SimpleBlockNode): MediaInParens | false; +export declare function parseMediaNot(componentValues: Array): MediaNot | false; +export declare function parseMediaOr(componentValues: Array): false | { + advance: number; + node: MediaOr; +}; +export declare function parseMediaAnd(componentValues: Array): false | { + advance: number; + node: MediaAnd; +}; diff --git a/node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts b/node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts new file mode 100644 index 000000000..a09339bda --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts @@ -0,0 +1,8 @@ +import { CSSToken, ParseError } from '@csstools/css-tokenizer'; +import { MediaQuery } from '../nodes/media-query'; +export type Options = { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}; +export declare function parseFromTokens(tokens: Array, options?: Options): MediaQuery[]; +export declare function parse(source: string, options?: Options): MediaQuery[]; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts new file mode 100644 index 000000000..e0702c235 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts @@ -0,0 +1,2 @@ +import { MediaQueryInvalid, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query'; +export declare function cloneMediaQuery(x: T): T; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts new file mode 100644 index 000000000..f0763807b --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts @@ -0,0 +1,5 @@ +import { ComponentValue } from '@csstools/css-parser-algorithms'; +export declare function isNumber(componentValue: ComponentValue): boolean; +export declare function isDimension(componentValue: ComponentValue): boolean; +export declare function isIdent(componentValue: ComponentValue): boolean; +export declare function isEnvironmentVariable(componentValue: ComponentValue): boolean; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts new file mode 100644 index 000000000..935e6eb54 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts @@ -0,0 +1,22 @@ +export declare enum NodeType { + CustomMedia = "custom-media", + GeneralEnclosed = "general-enclosed", + MediaAnd = "media-and", + MediaCondition = "media-condition", + MediaConditionListWithAnd = "media-condition-list-and", + MediaConditionListWithOr = "media-condition-list-or", + MediaFeature = "media-feature", + MediaFeatureBoolean = "mf-boolean", + MediaFeatureName = "mf-name", + MediaFeaturePlain = "mf-plain", + MediaFeatureRangeNameValue = "mf-range-name-value", + MediaFeatureRangeValueName = "mf-range-value-name", + MediaFeatureRangeValueNameValue = "mf-range-value-name-value", + MediaFeatureValue = "mf-value", + MediaInParens = "media-in-parens", + MediaNot = "media-not", + MediaOr = "media-or", + MediaQueryWithType = "media-query-with-type", + MediaQueryWithoutType = "media-query-without-type", + MediaQueryInvalid = "media-query-invalid" +} diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts new file mode 100644 index 000000000..396b252e7 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts @@ -0,0 +1 @@ +export declare function toLowerCaseAZ(x: string): string; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts new file mode 100644 index 000000000..2313f29b0 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts @@ -0,0 +1,37 @@ +import { GeneralEnclosed } from '../nodes/general-enclosed'; +import { MediaAnd } from '../nodes/media-and'; +import { MediaCondition } from '../nodes/media-condition'; +import { MediaConditionList, MediaConditionListWithAnd, MediaConditionListWithOr } from '../nodes/media-condition-list'; +import { MediaFeature } from '../nodes/media-feature'; +import { MediaFeatureBoolean } from '../nodes/media-feature-boolean'; +import { MediaFeatureName } from '../nodes/media-feature-name'; +import { MediaFeaturePlain } from '../nodes/media-feature-plain'; +import { MediaFeatureRange, MediaFeatureRangeNameValue, MediaFeatureRangeValueName, MediaFeatureRangeValueNameValue } from '../nodes/media-feature-range'; +import { MediaFeatureValue } from '../nodes/media-feature-value'; +import { MediaInParens } from '../nodes/media-in-parens'; +import { MediaNot } from '../nodes/media-not'; +import { MediaOr } from '../nodes/media-or'; +import { MediaQuery, MediaQueryInvalid, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query'; +export declare function isCustomMedia(x: unknown): x is GeneralEnclosed; +export declare function isGeneralEnclosed(x: unknown): x is GeneralEnclosed; +export declare function isMediaAnd(x: unknown): x is MediaAnd; +export declare function isMediaConditionList(x: unknown): x is MediaConditionList; +export declare function isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; +export declare function isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; +export declare function isMediaCondition(x: unknown): x is MediaCondition; +export declare function isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; +export declare function isMediaFeatureName(x: unknown): x is MediaFeatureName; +export declare function isMediaFeatureValue(x: unknown): x is MediaFeatureValue; +export declare function isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; +export declare function isMediaFeatureRange(x: unknown): x is MediaFeatureRange; +export declare function isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; +export declare function isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; +export declare function isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; +export declare function isMediaFeature(x: unknown): x is MediaFeature; +export declare function isMediaInParens(x: unknown): x is MediaInParens; +export declare function isMediaNot(x: unknown): x is MediaNot; +export declare function isMediaOr(x: unknown): x is MediaOr; +export declare function isMediaQuery(x: unknown): x is MediaQuery; +export declare function isMediaQueryWithType(x: unknown): x is MediaQueryWithType; +export declare function isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; +export declare function isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; diff --git a/node_modules/@csstools/media-query-list-parser/package.json b/node_modules/@csstools/media-query-list-parser/package.json new file mode 100644 index 000000000..561c858a6 --- /dev/null +++ b/node_modules/@csstools/media-query-list-parser/package.json @@ -0,0 +1,74 @@ +{ + "name": "@csstools/media-query-list-parser", + "description": "Parse CSS media query lists.", + "version": "2.1.2", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "main": "dist/index.cjs", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "peerDependencies": { + "@csstools/css-parser-algorithms": "^2.3.0", + "@csstools/css-tokenizer": "^2.1.1" + }, + "scripts": { + "build": "rollup -c ../../rollup/default.mjs", + "lint": "node ../../.github/bin/format-package-json.mjs", + "prepublishOnly": "npm run build && npm run test", + "stryker": "stryker run --logLevel error", + "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs", + "test:rewrite-expects": "REWRITE_EXPECTS=true node ./test/test.mjs" + }, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser#readme", + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "packages/media-query-list-parser" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "css", + "media query", + "parser" + ], + "volta": { + "extends": "../../package.json" + } +} diff --git a/node_modules/@csstools/selector-specificity/CHANGELOG.md b/node_modules/@csstools/selector-specificity/CHANGELOG.md new file mode 100644 index 000000000..770a6b9fa --- /dev/null +++ b/node_modules/@csstools/selector-specificity/CHANGELOG.md @@ -0,0 +1,63 @@ +# Changes to Selector Specificity + +### 3.0.0 + +_July 3, 2023_ + +- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) + +### 2.2.0 + +_March 21, 2023_ + +- Improve case insensitive string matching. +- Add support for: + - `::view-transition` + - `::view-transition-group(*)` and `::view-transition-group(name)` + - `::view-transition-image-par(*)` and `::view-transition-image-par(name)` + - `::view-transition-old(*)` and `::view-transition-old(name)` + - `::view-transition-new(*)` and `::view-transition-new(name)` + +### 2.1.1 + +_January 28, 2023_ + +- Improve `types` declaration in `package.json` + +### 2.1.0 + +_January 19, 2023_ + +- Add support for `::slotted` +- Add support for `:host` +- Add support for `:host-context` + +### 2.0.2 + +_July 8, 2022_ + +- Fix case insensitive matching. + +### 2.0.1 + +_June 10, 2022_ + +- Fixed: Exception on `:nth-child` without arguments. [#439](https://github.com/csstools/postcss-plugins/issues/439) + +### 2.0.0 + +_June 4, 2022_ + +- Breaking: use only named exports instead of `default` +- Added: `compare(a, b)` function to compare selectors by specificity + +```diff +- `import selectorSpecificity from '@csstools/selector-specificity';` ++ `import { selectorSpecificity } from '@csstools/selector-specificity';` +``` + +### 1.0.0 + +_April 26, 2022_ + +- Initial version diff --git a/node_modules/@csstools/selector-specificity/LICENSE.md b/node_modules/@csstools/selector-specificity/LICENSE.md new file mode 100644 index 000000000..e8ae93b9f --- /dev/null +++ b/node_modules/@csstools/selector-specificity/LICENSE.md @@ -0,0 +1,18 @@ +MIT No Attribution (MIT-0) + +Copyright © CSSTools Contributors + +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. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@csstools/selector-specificity/README.md b/node_modules/@csstools/selector-specificity/README.md new file mode 100644 index 000000000..3868d7d09 --- /dev/null +++ b/node_modules/@csstools/selector-specificity/README.md @@ -0,0 +1,57 @@ +# Selector Specificity + +[npm version][npm-url] +[Build Status][cli-url] +[Discord][discord] + +## Usage + +Add [Selector Specificity] to your project: + +```bash +npm install @csstools/selector-specificity --save-dev +``` + +```js +import parser from 'postcss-selector-parser'; +import { selectorSpecificity } from '@csstools/selector-specificity'; + +const selectorAST = parser().astSync('#foo:has(> .foo)'); +const specificity = selectorSpecificity(selectorAST); + +console.log(specificity.a); // 1 +console.log(specificity.b); // 1 +console.log(specificity.c); // 0 +``` + +_`selectorSpecificity` takes a single selector, not a list of selectors (not : `a, b, c`). +To compare or otherwise manipulate lists of selectors you need to call `selectorSpecificity` on each part._ + +### Comparing + +The package exports a utility function to compare two specificities. + +```js +import { selectorSpecificity, compare } from '@csstools/selector-specificity'; + +const s1 = selectorSpecificity(ast1); +const s2 = selectorSpecificity(ast2); +compare(s1, s2); // -1 | 0 | 1 +``` + +- if `s1 < s2` then `compare(s1, s2)` returns a negative number (`< 0`) +- if `s1 > s2` then `compare(s1, s2)` returns a positive number (`> 0`) +- if `s1 === s2` then `compare(s1, s2)` returns zero (`=== 0`) + +## Prior Art + +- [keeganstreet/specificity](https://github.com/keeganstreet/specificity) +- [bramus/specificity](https://github.com/bramus/specificity) + +For CSSTools we always use `postcss-selector-parser` and want to calculate specificity from this AST. + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/selector-specificity + +[Selector Specificity]: https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity diff --git a/node_modules/@csstools/selector-specificity/dist/index.cjs b/node_modules/@csstools/selector-specificity/dist/index.cjs new file mode 100644 index 000000000..4633d0fc3 --- /dev/null +++ b/node_modules/@csstools/selector-specificity/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var e=require("postcss-selector-parser");const s=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(s,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function selectorSpecificity(s){if(!s)return{a:0,b:0,c:0};let t=0,c=0,i=0;if("universal"==s.type)return{a:0,b:0,c:0};if("id"===s.type)t+=1;else if("tag"===s.type)i+=1;else if("class"===s.type)c+=1;else if("attribute"===s.type)c+=1;else if(isPseudoElement(s))switch(toLowerCaseAZ(s.value)){case"::slotted":if(i+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":if(s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0]))return{a:0,b:0,c:0};i+=1;break;default:i+=1}else if(e.isPseudoClass(s))switch(toLowerCaseAZ(s.value)){case":-moz-any":case":-webkit-any":case":any":case":has":case":is":case":matches":case":not":if(s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;case":where":break;case":nth-child":case":nth-last-child":if(c+=1,s.nodes&&s.nodes.length>0){const n=s.nodes[0].nodes.findIndex((e=>"tag"===e.type&&"of"===toLowerCaseAZ(e.value)));if(n>-1){const o=[e.selector({nodes:s.nodes[0].nodes.slice(n+1),value:""})];s.nodes.length>1&&o.push(...s.nodes.slice(1));const a=specificityOfMostSpecificListItem(o);t+=a.a,c+=a.b,i+=a.c}}break;case":local":case":global":s.nodes&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,i+=s.c}));break;case":host":case":host-context":if(c+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;default:c+=1}else e.isContainer(s)&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,i+=s.c}));return{a:t,b:c,c:i}}function specificityOfMostSpecificListItem(e){let s={a:0,b:0,c:0};return e.forEach((e=>{const t=selectorSpecificity(e);t.a>s.a?s=t:t.as.b?s=t:t.bs.c&&(s=t))})),s}function isPseudoElement(s){return e.isPseudoElement(s)}function selectorNodeContainsOnlyUniversal(e){if(!e)return!1;if(!e.nodes)return!1;const s=e.nodes.filter((e=>"comment"!==e.type));return 1===s.length&&"universal"===s[0].type}exports.compare=function compare(e,s){return e.a===s.a?e.b===s.b?e.c-s.c:e.b-s.b:e.a-s.a},exports.selectorSpecificity=selectorSpecificity; diff --git a/node_modules/@csstools/selector-specificity/dist/index.d.ts b/node_modules/@csstools/selector-specificity/dist/index.d.ts new file mode 100644 index 000000000..f92ce6d84 --- /dev/null +++ b/node_modules/@csstools/selector-specificity/dist/index.d.ts @@ -0,0 +1,8 @@ +import type { Node } from 'postcss-selector-parser'; +export type Specificity = { + a: number; + b: number; + c: number; +}; +export declare function compare(s1: Specificity, s2: Specificity): number; +export declare function selectorSpecificity(node: Node): Specificity; diff --git a/node_modules/@csstools/selector-specificity/dist/index.mjs b/node_modules/@csstools/selector-specificity/dist/index.mjs new file mode 100644 index 000000000..8ac79c745 --- /dev/null +++ b/node_modules/@csstools/selector-specificity/dist/index.mjs @@ -0,0 +1 @@ +import e from"postcss-selector-parser";const s=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(s,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function compare(e,s){return e.a===s.a?e.b===s.b?e.c-s.c:e.b-s.b:e.a-s.a}function selectorSpecificity(s){if(!s)return{a:0,b:0,c:0};let t=0,c=0,i=0;if("universal"==s.type)return{a:0,b:0,c:0};if("id"===s.type)t+=1;else if("tag"===s.type)i+=1;else if("class"===s.type)c+=1;else if("attribute"===s.type)c+=1;else if(isPseudoElement(s))switch(toLowerCaseAZ(s.value)){case"::slotted":if(i+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":if(s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0]))return{a:0,b:0,c:0};i+=1;break;default:i+=1}else if(e.isPseudoClass(s))switch(toLowerCaseAZ(s.value)){case":-moz-any":case":-webkit-any":case":any":case":has":case":is":case":matches":case":not":if(s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;case":where":break;case":nth-child":case":nth-last-child":if(c+=1,s.nodes&&s.nodes.length>0){const n=s.nodes[0].nodes.findIndex((e=>"tag"===e.type&&"of"===toLowerCaseAZ(e.value)));if(n>-1){const o=[e.selector({nodes:s.nodes[0].nodes.slice(n+1),value:""})];s.nodes.length>1&&o.push(...s.nodes.slice(1));const a=specificityOfMostSpecificListItem(o);t+=a.a,c+=a.b,i+=a.c}}break;case":local":case":global":s.nodes&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,i+=s.c}));break;case":host":case":host-context":if(c+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;default:c+=1}else e.isContainer(s)&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,i+=s.c}));return{a:t,b:c,c:i}}function specificityOfMostSpecificListItem(e){let s={a:0,b:0,c:0};return e.forEach((e=>{const t=selectorSpecificity(e);t.a>s.a?s=t:t.as.b?s=t:t.bs.c&&(s=t))})),s}function isPseudoElement(s){return e.isPseudoElement(s)}function selectorNodeContainsOnlyUniversal(e){if(!e)return!1;if(!e.nodes)return!1;const s=e.nodes.filter((e=>"comment"!==e.type));return 1===s.length&&"universal"===s[0].type}export{compare,selectorSpecificity}; diff --git a/node_modules/@csstools/selector-specificity/dist/to-lower-case-a-z.d.ts b/node_modules/@csstools/selector-specificity/dist/to-lower-case-a-z.d.ts new file mode 100644 index 000000000..396b252e7 --- /dev/null +++ b/node_modules/@csstools/selector-specificity/dist/to-lower-case-a-z.d.ts @@ -0,0 +1 @@ +export declare function toLowerCaseAZ(x: string): string; diff --git a/node_modules/@csstools/selector-specificity/package.json b/node_modules/@csstools/selector-specificity/package.json new file mode 100644 index 000000000..36e083896 --- /dev/null +++ b/node_modules/@csstools/selector-specificity/package.json @@ -0,0 +1,75 @@ +{ + "name": "@csstools/selector-specificity", + "description": "Determine selector specificity with postcss-selector-parser", + "version": "3.0.0", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT-0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "main": "dist/index.cjs", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs" + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "peerDependencies": { + "postcss-selector-parser": "^6.0.13" + }, + "devDependencies": { + "postcss-selector-parser": "^6.0.13" + }, + "scripts": { + "build": "rollup -c ../../rollup/default.mjs", + "lint": "node ../../.github/bin/format-package-json.mjs", + "prepublishOnly": "npm run build && npm run test", + "stryker": "stryker run --logLevel error", + "test": "node ./test/index.mjs && node ./test/_import.mjs && node ./test/_require.cjs" + }, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity#readme", + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "packages/selector-specificity" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "css", + "postcss-selector-parser", + "specificity" + ], + "volta": { + "extends": "../../package.json" + } +} diff --git a/node_modules/@nodelib/fs.scandir/LICENSE b/node_modules/@nodelib/fs.scandir/LICENSE new file mode 100644 index 000000000..65a999460 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nodelib/fs.scandir/README.md b/node_modules/@nodelib/fs.scandir/README.md new file mode 100644 index 000000000..e0b218b9f --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/README.md @@ -0,0 +1,171 @@ +# @nodelib/fs.scandir + +> List files and directories inside the specified directory. + +## :bulb: Highlights + +The package is aimed at obtaining information about entries in the directory. + +* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). +* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode). +* :link: Can safely work with broken symbolic links. + +## Install + +```console +npm install @nodelib/fs.scandir +``` + +## Usage + +```ts +import * as fsScandir from '@nodelib/fs.scandir'; + +fsScandir.scandir('path', (error, stats) => { /* … */ }); +``` + +## API + +### .scandir(path, [optionsOrSettings], callback) + +Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style. + +```ts +fsScandir.scandir('path', (error, entries) => { /* … */ }); +fsScandir.scandir('path', {}, (error, entries) => { /* … */ }); +fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ }); +``` + +### .scandirSync(path, [optionsOrSettings]) + +Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path. + +```ts +const entries = fsScandir.scandirSync('path'); +const entries = fsScandir.scandirSync('path', {}); +const entries = fsScandir.scandirSync(('path', new fsScandir.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settingsoptions) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsScandir.Settings({ followSymbolicLinks: false }); + +const entries = fsScandir.scandirSync('path', settings); +``` + +## Entry + +* `name` — The name of the entry (`unknown.txt`). +* `path` — The path of the entry relative to call directory (`root/unknown.txt`). +* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class. +* `stats` (optional) — An instance of `fs.Stats` class. + +For example, the `scandir` call for `tools` directory with one directory inside: + +```ts +{ + dirent: Dirent { name: 'typedoc', /* … */ }, + name: 'typedoc', + path: 'tools/typedoc' +} +``` + +## Options + +### stats + +* Type: `boolean` +* Default: `false` + +Adds an instance of `fs.Stats` class to the [`Entry`](#entry). + +> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO?? + +### followSymbolicLinks + +* Type: `boolean` +* Default: `false` + +Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`. + +### `pathSegmentSeparator` + +* Type: `string` +* Default: `path.sep` + +By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; + readdir?: typeof fs.readdir; + readdirSync?: typeof fs.readdirSync; +} + +const settings = new fsScandir.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## `old` and `modern` mode + +This package has two modes that are used depending on the environment and parameters of use. + +### old + +* Node.js below `10.10` or when the `stats` option is enabled + +When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links). + +### modern + +* Node.js 10.10+ and the `stats` option is disabled + +In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present. + +This mode makes fewer calls to the file system. It's faster. + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts new file mode 100644 index 000000000..827f1db09 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts @@ -0,0 +1,20 @@ +import type * as fsStat from '@nodelib/fs.stat'; +import type { Dirent, ErrnoException } from '../types'; +export interface ReaddirAsynchronousMethod { + (filepath: string, options: { + withFileTypes: true; + }, callback: (error: ErrnoException | null, files: Dirent[]) => void): void; + (filepath: string, callback: (error: ErrnoException | null, files: string[]) => void): void; +} +export interface ReaddirSynchronousMethod { + (filepath: string, options: { + withFileTypes: true; + }): Dirent[]; + (filepath: string): string[]; +} +export declare type FileSystemAdapter = fsStat.FileSystemAdapter & { + readdir: ReaddirAsynchronousMethod; + readdirSync: ReaddirSynchronousMethod; +}; +export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; +export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.js b/node_modules/@nodelib/fs.scandir/out/adapters/fs.js new file mode 100644 index 000000000..f0fe02202 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/adapters/fs.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; +const fs = require("fs"); +exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync, + readdir: fs.readdir, + readdirSync: fs.readdirSync +}; +function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); +} +exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.d.ts b/node_modules/@nodelib/fs.scandir/out/constants.d.ts new file mode 100644 index 000000000..33f17497d --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/constants.d.ts @@ -0,0 +1,4 @@ +/** + * IS `true` for Node.js 10.10 and greater. + */ +export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.js b/node_modules/@nodelib/fs.scandir/out/constants.js new file mode 100644 index 000000000..7e3d4411f --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/constants.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; +const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.'); +if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) { + throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); +} +const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); +const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); +const SUPPORTED_MAJOR_VERSION = 10; +const SUPPORTED_MINOR_VERSION = 10; +const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; +const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; +/** + * IS `true` for Node.js 10.10 and greater. + */ +exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; diff --git a/node_modules/@nodelib/fs.scandir/out/index.d.ts b/node_modules/@nodelib/fs.scandir/out/index.d.ts new file mode 100644 index 000000000..b9da83ed1 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/index.d.ts @@ -0,0 +1,12 @@ +import type { FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod } from './adapters/fs'; +import * as async from './providers/async'; +import Settings, { Options } from './settings'; +import type { Dirent, Entry } from './types'; +declare type AsyncCallback = async.AsyncCallback; +declare function scandir(path: string, callback: AsyncCallback): void; +declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace scandir { + function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[]; +export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod, Options }; diff --git a/node_modules/@nodelib/fs.scandir/out/index.js b/node_modules/@nodelib/fs.scandir/out/index.js new file mode 100644 index 000000000..99c70d3d6 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/index.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Settings = exports.scandirSync = exports.scandir = void 0; +const async = require("./providers/async"); +const sync = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function scandir(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path, getSettings(optionsOrSettingsOrCallback), callback); +} +exports.scandir = scandir; +function scandirSync(path, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path, settings); +} +exports.scandirSync = scandirSync; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts new file mode 100644 index 000000000..5829676df --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts @@ -0,0 +1,7 @@ +/// +import type Settings from '../settings'; +import type { Entry } from '../types'; +export declare type AsyncCallback = (error: NodeJS.ErrnoException, entries: Entry[]) => void; +export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void; +export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void; +export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.js b/node_modules/@nodelib/fs.scandir/out/providers/async.js new file mode 100644 index 000000000..e8e2f0a9c --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/async.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; +const fsStat = require("@nodelib/fs.stat"); +const rpl = require("run-parallel"); +const constants_1 = require("../constants"); +const utils = require("../utils"); +const common = require("./common"); +function read(directory, settings, callback) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + readdirWithFileTypes(directory, settings, callback); + return; + } + readdir(directory, settings, callback); +} +exports.read = read; +function readdirWithFileTypes(directory, settings, callback) { + settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const entries = dirents.map((dirent) => ({ + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + })); + if (!settings.followSymbolicLinks) { + callSuccessCallback(callback, entries); + return; + } + const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); + rpl(tasks, (rplError, rplEntries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, rplEntries); + }); + }); +} +exports.readdirWithFileTypes = readdirWithFileTypes; +function makeRplTaskEntry(entry, settings) { + return (done) => { + if (!entry.dirent.isSymbolicLink()) { + done(null, entry); + return; + } + settings.fs.stat(entry.path, (statError, stats) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + done(statError); + return; + } + done(null, entry); + return; + } + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + done(null, entry); + }); + }; +} +function readdir(directory, settings, callback) { + settings.fs.readdir(directory, (readdirError, names) => { + if (readdirError !== null) { + callFailureCallback(callback, readdirError); + return; + } + const tasks = names.map((name) => { + const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + return (done) => { + fsStat.stat(path, settings.fsStatSettings, (error, stats) => { + if (error !== null) { + done(error); + return; + } + const entry = { + name, + path, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + done(null, entry); + }); + }; + }); + rpl(tasks, (rplError, entries) => { + if (rplError !== null) { + callFailureCallback(callback, rplError); + return; + } + callSuccessCallback(callback, entries); + }); + }); +} +exports.readdir = readdir; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, result) { + callback(null, result); +} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts new file mode 100644 index 000000000..2b4d08b57 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts @@ -0,0 +1 @@ +export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.js b/node_modules/@nodelib/fs.scandir/out/providers/common.js new file mode 100644 index 000000000..8724cb59a --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/common.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.joinPathSegments = void 0; +function joinPathSegments(a, b, separator) { + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; +} +exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts new file mode 100644 index 000000000..e05c8f072 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts @@ -0,0 +1,5 @@ +import type Settings from '../settings'; +import type { Entry } from '../types'; +export declare function read(directory: string, settings: Settings): Entry[]; +export declare function readdirWithFileTypes(directory: string, settings: Settings): Entry[]; +export declare function readdir(directory: string, settings: Settings): Entry[]; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.js b/node_modules/@nodelib/fs.scandir/out/providers/sync.js new file mode 100644 index 000000000..146db3434 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/providers/sync.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; +const fsStat = require("@nodelib/fs.stat"); +const constants_1 = require("../constants"); +const utils = require("../utils"); +const common = require("./common"); +function read(directory, settings) { + if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { + return readdirWithFileTypes(directory, settings); + } + return readdir(directory, settings); +} +exports.read = read; +function readdirWithFileTypes(directory, settings) { + const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); + return dirents.map((dirent) => { + const entry = { + dirent, + name: dirent.name, + path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) + }; + if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { + try { + const stats = settings.fs.statSync(entry.path); + entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); + } + catch (error) { + if (settings.throwErrorOnBrokenSymbolicLink) { + throw error; + } + } + } + return entry; + }); +} +exports.readdirWithFileTypes = readdirWithFileTypes; +function readdir(directory, settings) { + const names = settings.fs.readdirSync(directory); + return names.map((name) => { + const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); + const stats = fsStat.statSync(entryPath, settings.fsStatSettings); + const entry = { + name, + path: entryPath, + dirent: utils.fs.createDirentFromStats(name, stats) + }; + if (settings.stats) { + entry.stats = stats; + } + return entry; + }); +} +exports.readdir = readdir; diff --git a/node_modules/@nodelib/fs.scandir/out/settings.d.ts b/node_modules/@nodelib/fs.scandir/out/settings.d.ts new file mode 100644 index 000000000..a0db11559 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/settings.d.ts @@ -0,0 +1,20 @@ +import * as fsStat from '@nodelib/fs.stat'; +import * as fs from './adapters/fs'; +export interface Options { + followSymbolicLinks?: boolean; + fs?: Partial; + pathSegmentSeparator?: string; + stats?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly followSymbolicLinks: boolean; + readonly fs: fs.FileSystemAdapter; + readonly pathSegmentSeparator: string; + readonly stats: boolean; + readonly throwErrorOnBrokenSymbolicLink: boolean; + readonly fsStatSettings: fsStat.Settings; + constructor(_options?: Options); + private _getValue; +} diff --git a/node_modules/@nodelib/fs.scandir/out/settings.js b/node_modules/@nodelib/fs.scandir/out/settings.js new file mode 100644 index 000000000..15a3e8cde --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/settings.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const fsStat = require("@nodelib/fs.stat"); +const fs = require("./adapters/fs"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); + this.fs = fs.createFileSystemAdapter(this._options.fs); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); + this.stats = this._getValue(this._options.stats, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + this.fsStatSettings = new fsStat.Settings({ + followSymbolicLink: this.followSymbolicLinks, + fs: this.fs, + throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.d.ts b/node_modules/@nodelib/fs.scandir/out/types/index.d.ts new file mode 100644 index 000000000..f326c5e5e --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/types/index.d.ts @@ -0,0 +1,20 @@ +/// +import type * as fs from 'fs'; +export interface Entry { + dirent: Dirent; + name: string; + path: string; + stats?: Stats; +} +export declare type Stats = fs.Stats; +export declare type ErrnoException = NodeJS.ErrnoException; +export interface Dirent { + isBlockDevice: () => boolean; + isCharacterDevice: () => boolean; + isDirectory: () => boolean; + isFIFO: () => boolean; + isFile: () => boolean; + isSocket: () => boolean; + isSymbolicLink: () => boolean; + name: string; +} diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.js b/node_modules/@nodelib/fs.scandir/out/types/index.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts new file mode 100644 index 000000000..bb863f157 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts @@ -0,0 +1,2 @@ +import type { Dirent, Stats } from '../types'; +export declare function createDirentFromStats(name: string, stats: Stats): Dirent; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.js b/node_modules/@nodelib/fs.scandir/out/utils/fs.js new file mode 100644 index 000000000..ace7c74d6 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/fs.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createDirentFromStats = void 0; +class DirentFromStats { + constructor(name, stats) { + this.name = name; + this.isBlockDevice = stats.isBlockDevice.bind(stats); + this.isCharacterDevice = stats.isCharacterDevice.bind(stats); + this.isDirectory = stats.isDirectory.bind(stats); + this.isFIFO = stats.isFIFO.bind(stats); + this.isFile = stats.isFile.bind(stats); + this.isSocket = stats.isSocket.bind(stats); + this.isSymbolicLink = stats.isSymbolicLink.bind(stats); + } +} +function createDirentFromStats(name, stats) { + return new DirentFromStats(name, stats); +} +exports.createDirentFromStats = createDirentFromStats; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts new file mode 100644 index 000000000..1b41954e7 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts @@ -0,0 +1,2 @@ +import * as fs from './fs'; +export { fs }; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.js b/node_modules/@nodelib/fs.scandir/out/utils/index.js new file mode 100644 index 000000000..f5de129f4 --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/out/utils/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fs = void 0; +const fs = require("./fs"); +exports.fs = fs; diff --git a/node_modules/@nodelib/fs.scandir/package.json b/node_modules/@nodelib/fs.scandir/package.json new file mode 100644 index 000000000..d3a89241b --- /dev/null +++ b/node_modules/@nodelib/fs.scandir/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nodelib/fs.scandir", + "version": "2.1.5", + "description": "List files and directories inside the specified directory", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "scandir", + "readdir", + "dirent" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4", + "@types/run-parallel": "^1.1.0" + }, + "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" +} diff --git a/node_modules/@nodelib/fs.stat/LICENSE b/node_modules/@nodelib/fs.stat/LICENSE new file mode 100644 index 000000000..65a999460 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nodelib/fs.stat/README.md b/node_modules/@nodelib/fs.stat/README.md new file mode 100644 index 000000000..686f0471d --- /dev/null +++ b/node_modules/@nodelib/fs.stat/README.md @@ -0,0 +1,126 @@ +# @nodelib/fs.stat + +> Get the status of a file with some features. + +## :bulb: Highlights + +Wrapper around standard method `fs.lstat` and `fs.stat` with some features. + +* :beginner: Normally follows symbolic link. +* :gear: Can safely work with broken symbolic link. + +## Install + +```console +npm install @nodelib/fs.stat +``` + +## Usage + +```ts +import * as fsStat from '@nodelib/fs.stat'; + +fsStat.stat('path', (error, stats) => { /* … */ }); +``` + +## API + +### .stat(path, [optionsOrSettings], callback) + +Returns an instance of `fs.Stats` class for provided path with standard callback-style. + +```ts +fsStat.stat('path', (error, stats) => { /* … */ }); +fsStat.stat('path', {}, (error, stats) => { /* … */ }); +fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ }); +``` + +### .statSync(path, [optionsOrSettings]) + +Returns an instance of `fs.Stats` class for provided path. + +```ts +const stats = fsStat.stat('path'); +const stats = fsStat.stat('path', {}); +const stats = fsStat.stat('path', new fsStat.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsStat.Settings({ followSymbolicLink: false }); + +const stats = fsStat.stat('path', settings); +``` + +## Options + +### `followSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`. + +### `markSymbolicLink` + +* Type: `boolean` +* Default: `false` + +Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`). + +> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `fs` + +* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat?: typeof fs.lstat; + stat?: typeof fs.stat; + lstatSync?: typeof fs.lstatSync; + statSync?: typeof fs.statSync; +} + +const settings = new fsStat.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts new file mode 100644 index 000000000..3af759c95 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts @@ -0,0 +1,13 @@ +/// +import * as fs from 'fs'; +import type { ErrnoException } from '../types'; +export declare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException | null, stats: fs.Stats) => void) => void; +export declare type StatSynchronousMethod = (path: string) => fs.Stats; +export interface FileSystemAdapter { + lstat: StatAsynchronousMethod; + stat: StatAsynchronousMethod; + lstatSync: StatSynchronousMethod; + statSync: StatSynchronousMethod; +} +export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; +export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.js b/node_modules/@nodelib/fs.stat/out/adapters/fs.js new file mode 100644 index 000000000..8dc08c8ca --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/adapters/fs.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; +const fs = require("fs"); +exports.FILE_SYSTEM_ADAPTER = { + lstat: fs.lstat, + stat: fs.stat, + lstatSync: fs.lstatSync, + statSync: fs.statSync +}; +function createFileSystemAdapter(fsMethods) { + if (fsMethods === undefined) { + return exports.FILE_SYSTEM_ADAPTER; + } + return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); +} +exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/index.d.ts b/node_modules/@nodelib/fs.stat/out/index.d.ts new file mode 100644 index 000000000..f95db995c --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/index.d.ts @@ -0,0 +1,12 @@ +import type { FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod } from './adapters/fs'; +import * as async from './providers/async'; +import Settings, { Options } from './settings'; +import type { Stats } from './types'; +declare type AsyncCallback = async.AsyncCallback; +declare function stat(path: string, callback: AsyncCallback): void; +declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace stat { + function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats; +export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod, Options, Stats }; diff --git a/node_modules/@nodelib/fs.stat/out/index.js b/node_modules/@nodelib/fs.stat/out/index.js new file mode 100644 index 000000000..b23f7510d --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/index.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.statSync = exports.stat = exports.Settings = void 0; +const async = require("./providers/async"); +const sync = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function stat(path, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + async.read(path, getSettings(), optionsOrSettingsOrCallback); + return; + } + async.read(path, getSettings(optionsOrSettingsOrCallback), callback); +} +exports.stat = stat; +function statSync(path, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + return sync.read(path, settings); +} +exports.statSync = statSync; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.d.ts b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts new file mode 100644 index 000000000..85423ce11 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts @@ -0,0 +1,4 @@ +import type Settings from '../settings'; +import type { ErrnoException, Stats } from '../types'; +export declare type AsyncCallback = (error: ErrnoException, stats: Stats) => void; +export declare function read(path: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.js b/node_modules/@nodelib/fs.stat/out/providers/async.js new file mode 100644 index 000000000..983ff0e6c --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/async.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.read = void 0; +function read(path, settings, callback) { + settings.fs.lstat(path, (lstatError, lstat) => { + if (lstatError !== null) { + callFailureCallback(callback, lstatError); + return; + } + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + callSuccessCallback(callback, lstat); + return; + } + settings.fs.stat(path, (statError, stat) => { + if (statError !== null) { + if (settings.throwErrorOnBrokenSymbolicLink) { + callFailureCallback(callback, statError); + return; + } + callSuccessCallback(callback, lstat); + return; + } + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + callSuccessCallback(callback, stat); + }); + }); +} +exports.read = read; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, result) { + callback(null, result); +} diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts new file mode 100644 index 000000000..428c3d792 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts @@ -0,0 +1,3 @@ +import type Settings from '../settings'; +import type { Stats } from '../types'; +export declare function read(path: string, settings: Settings): Stats; diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.js b/node_modules/@nodelib/fs.stat/out/providers/sync.js new file mode 100644 index 000000000..1521c3616 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/providers/sync.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.read = void 0; +function read(path, settings) { + const lstat = settings.fs.lstatSync(path); + if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { + return lstat; + } + try { + const stat = settings.fs.statSync(path); + if (settings.markSymbolicLink) { + stat.isSymbolicLink = () => true; + } + return stat; + } + catch (error) { + if (!settings.throwErrorOnBrokenSymbolicLink) { + return lstat; + } + throw error; + } +} +exports.read = read; diff --git a/node_modules/@nodelib/fs.stat/out/settings.d.ts b/node_modules/@nodelib/fs.stat/out/settings.d.ts new file mode 100644 index 000000000..f4b3d4443 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/settings.d.ts @@ -0,0 +1,16 @@ +import * as fs from './adapters/fs'; +export interface Options { + followSymbolicLink?: boolean; + fs?: Partial; + markSymbolicLink?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly followSymbolicLink: boolean; + readonly fs: fs.FileSystemAdapter; + readonly markSymbolicLink: boolean; + readonly throwErrorOnBrokenSymbolicLink: boolean; + constructor(_options?: Options); + private _getValue; +} diff --git a/node_modules/@nodelib/fs.stat/out/settings.js b/node_modules/@nodelib/fs.stat/out/settings.js new file mode 100644 index 000000000..111ec09ca --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/settings.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = require("./adapters/fs"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); + this.fs = fs.createFileSystemAdapter(this._options.fs); + this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); + this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.d.ts b/node_modules/@nodelib/fs.stat/out/types/index.d.ts new file mode 100644 index 000000000..74c08ed2f --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/types/index.d.ts @@ -0,0 +1,4 @@ +/// +import type * as fs from 'fs'; +export declare type Stats = fs.Stats; +export declare type ErrnoException = NodeJS.ErrnoException; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.js b/node_modules/@nodelib/fs.stat/out/types/index.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.stat/package.json b/node_modules/@nodelib/fs.stat/package.json new file mode 100644 index 000000000..f2540c289 --- /dev/null +++ b/node_modules/@nodelib/fs.stat/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nodelib/fs.stat", + "version": "2.0.5", + "description": "Get the status of a file with some features", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "stat" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4" + }, + "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" +} diff --git a/node_modules/@nodelib/fs.walk/LICENSE b/node_modules/@nodelib/fs.walk/LICENSE new file mode 100644 index 000000000..65a999460 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@nodelib/fs.walk/README.md b/node_modules/@nodelib/fs.walk/README.md new file mode 100644 index 000000000..6ccc08db4 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/README.md @@ -0,0 +1,215 @@ +# @nodelib/fs.walk + +> A library for efficiently walking a directory recursively. + +## :bulb: Highlights + +* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). +* :rocket: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type for performance reasons. See [`old` and `modern` mode](https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode). +* :gear: Built-in directories/files and error filtering system. +* :link: Can safely work with broken symbolic links. + +## Install + +```console +npm install @nodelib/fs.walk +``` + +## Usage + +```ts +import * as fsWalk from '@nodelib/fs.walk'; + +fsWalk.walk('path', (error, entries) => { /* … */ }); +``` + +## API + +### .walk(path, [optionsOrSettings], callback) + +Reads the directory recursively and asynchronously. Requires a callback function. + +> :book: If you want to use the Promise API, use `util.promisify`. + +```ts +fsWalk.walk('path', (error, entries) => { /* … */ }); +fsWalk.walk('path', {}, (error, entries) => { /* … */ }); +fsWalk.walk('path', new fsWalk.Settings(), (error, entries) => { /* … */ }); +``` + +### .walkStream(path, [optionsOrSettings]) + +Reads the directory recursively and asynchronously. [Readable Stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_readable_streams) is used as a provider. + +```ts +const stream = fsWalk.walkStream('path'); +const stream = fsWalk.walkStream('path', {}); +const stream = fsWalk.walkStream('path', new fsWalk.Settings()); +``` + +### .walkSync(path, [optionsOrSettings]) + +Reads the directory recursively and synchronously. Returns an array of entries. + +```ts +const entries = fsWalk.walkSync('path'); +const entries = fsWalk.walkSync('path', {}); +const entries = fsWalk.walkSync('path', new fsWalk.Settings()); +``` + +#### path + +* Required: `true` +* Type: `string | Buffer | URL` + +A path to a file. If a URL is provided, it must use the `file:` protocol. + +#### optionsOrSettings + +* Required: `false` +* Type: `Options | Settings` +* Default: An instance of `Settings` class + +An [`Options`](#options) object or an instance of [`Settings`](#settings) class. + +> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. + +### Settings([options]) + +A class of full settings of the package. + +```ts +const settings = new fsWalk.Settings({ followSymbolicLinks: true }); + +const entries = fsWalk.walkSync('path', settings); +``` + +## Entry + +* `name` — The name of the entry (`unknown.txt`). +* `path` — The path of the entry relative to call directory (`root/unknown.txt`). +* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. +* [`stats`] — An instance of `fs.Stats` class. + +## Options + +### basePath + +* Type: `string` +* Default: `undefined` + +By default, all paths are built relative to the root path. You can use this option to set custom root path. + +In the example below we read the files from the `root` directory, but in the results the root path will be `custom`. + +```ts +fsWalk.walkSync('root'); // → ['root/file.txt'] +fsWalk.walkSync('root', { basePath: 'custom' }); // → ['custom/file.txt'] +``` + +### concurrency + +* Type: `number` +* Default: `Infinity` + +The maximum number of concurrent calls to `fs.readdir`. + +> :book: The higher the number, the higher performance and the load on the File System. If you want to read in quiet mode, set the value to `4 * os.cpus().length` (4 is default size of [thread pool work scheduling](http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling)). + +### deepFilter + +* Type: [`DeepFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that indicates whether the directory will be read deep or not. + +```ts +// Skip all directories that starts with `node_modules` +const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules'); +``` + +### entryFilter + +* Type: [`EntryFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that indicates whether the entry will be included to results or not. + +```ts +// Exclude all `.js` files from results +const filter: EntryFilterFunction = (entry) => !entry.name.endsWith('.js'); +``` + +### errorFilter + +* Type: [`ErrorFilterFunction`](./src/settings.ts) +* Default: `undefined` + +A function that allows you to skip errors that occur when reading directories. + +For example, you can skip `ENOENT` errors if required: + +```ts +// Skip all ENOENT errors +const filter: ErrorFilterFunction = (error) => error.code == 'ENOENT'; +``` + +### stats + +* Type: `boolean` +* Default: `false` + +Adds an instance of `fs.Stats` class to the [`Entry`](#entry). + +> :book: Always use `fs.readdir` with additional `fs.lstat/fs.stat` calls to determine the entry type. + +### followSymbolicLinks + +* Type: `boolean` +* Default: `false` + +Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. + +### `throwErrorOnBrokenSymbolicLink` + +* Type: `boolean` +* Default: `true` + +Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. + +### `pathSegmentSeparator` + +* Type: `string` +* Default: `path.sep` + +By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. + +### `fs` + +* Type: `FileSystemAdapter` +* Default: A default FS methods + +By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. + +```ts +interface FileSystemAdapter { + lstat: typeof fs.lstat; + stat: typeof fs.stat; + lstatSync: typeof fs.lstatSync; + statSync: typeof fs.statSync; + readdir: typeof fs.readdir; + readdirSync: typeof fs.readdirSync; +} + +const settings = new fsWalk.Settings({ + fs: { lstat: fakeLstat } +}); +``` + +## Changelog + +See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. + +## License + +This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.walk/out/index.d.ts b/node_modules/@nodelib/fs.walk/out/index.d.ts new file mode 100644 index 000000000..8864c7bff --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/index.d.ts @@ -0,0 +1,14 @@ +/// +import type { Readable } from 'stream'; +import type { Dirent, FileSystemAdapter } from '@nodelib/fs.scandir'; +import { AsyncCallback } from './providers/async'; +import Settings, { DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction, Options } from './settings'; +import type { Entry } from './types'; +declare function walk(directory: string, callback: AsyncCallback): void; +declare function walk(directory: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; +declare namespace walk { + function __promisify__(directory: string, optionsOrSettings?: Options | Settings): Promise; +} +declare function walkSync(directory: string, optionsOrSettings?: Options | Settings): Entry[]; +declare function walkStream(directory: string, optionsOrSettings?: Options | Settings): Readable; +export { walk, walkSync, walkStream, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options, DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction }; diff --git a/node_modules/@nodelib/fs.walk/out/index.js b/node_modules/@nodelib/fs.walk/out/index.js new file mode 100644 index 000000000..15207874a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/index.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; +const async_1 = require("./providers/async"); +const stream_1 = require("./providers/stream"); +const sync_1 = require("./providers/sync"); +const settings_1 = require("./settings"); +exports.Settings = settings_1.default; +function walk(directory, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); + return; + } + new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); +} +exports.walk = walk; +function walkSync(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new sync_1.default(directory, settings); + return provider.read(); +} +exports.walkSync = walkSync; +function walkStream(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new stream_1.default(directory, settings); + return provider.read(); +} +exports.walkStream = walkStream; +function getSettings(settingsOrOptions = {}) { + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.d.ts b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts new file mode 100644 index 000000000..0f6717d78 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts @@ -0,0 +1,12 @@ +import AsyncReader from '../readers/async'; +import type Settings from '../settings'; +import type { Entry, Errno } from '../types'; +export declare type AsyncCallback = (error: Errno, entries: Entry[]) => void; +export default class AsyncProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: AsyncReader; + private readonly _storage; + constructor(_root: string, _settings: Settings); + read(callback: AsyncCallback): void; +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.js b/node_modules/@nodelib/fs.walk/out/providers/async.js new file mode 100644 index 000000000..51d3be51a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/async.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const async_1 = require("../readers/async"); +class AsyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._storage = []; + } + read(callback) { + this._reader.onError((error) => { + callFailureCallback(callback, error); + }); + this._reader.onEntry((entry) => { + this._storage.push(entry); + }); + this._reader.onEnd(() => { + callSuccessCallback(callback, this._storage); + }); + this._reader.read(); + } +} +exports.default = AsyncProvider; +function callFailureCallback(callback, error) { + callback(error); +} +function callSuccessCallback(callback, entries) { + callback(null, entries); +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.d.ts b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts new file mode 100644 index 000000000..874f60c5a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts @@ -0,0 +1,4 @@ +import AsyncProvider from './async'; +import StreamProvider from './stream'; +import SyncProvider from './sync'; +export { AsyncProvider, StreamProvider, SyncProvider }; diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.js b/node_modules/@nodelib/fs.walk/out/providers/index.js new file mode 100644 index 000000000..4c2529ce8 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SyncProvider = exports.StreamProvider = exports.AsyncProvider = void 0; +const async_1 = require("./async"); +exports.AsyncProvider = async_1.default; +const stream_1 = require("./stream"); +exports.StreamProvider = stream_1.default; +const sync_1 = require("./sync"); +exports.SyncProvider = sync_1.default; diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts new file mode 100644 index 000000000..294185f85 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts @@ -0,0 +1,12 @@ +/// +import { Readable } from 'stream'; +import AsyncReader from '../readers/async'; +import type Settings from '../settings'; +export default class StreamProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: AsyncReader; + protected readonly _stream: Readable; + constructor(_root: string, _settings: Settings); + read(): Readable; +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.js b/node_modules/@nodelib/fs.walk/out/providers/stream.js new file mode 100644 index 000000000..51298b0f5 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/stream.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const stream_1 = require("stream"); +const async_1 = require("../readers/async"); +class StreamProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new async_1.default(this._root, this._settings); + this._stream = new stream_1.Readable({ + objectMode: true, + read: () => { }, + destroy: () => { + if (!this._reader.isDestroyed) { + this._reader.destroy(); + } + } + }); + } + read() { + this._reader.onError((error) => { + this._stream.emit('error', error); + }); + this._reader.onEntry((entry) => { + this._stream.push(entry); + }); + this._reader.onEnd(() => { + this._stream.push(null); + }); + this._reader.read(); + return this._stream; + } +} +exports.default = StreamProvider; diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts new file mode 100644 index 000000000..551c42e41 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts @@ -0,0 +1,10 @@ +import SyncReader from '../readers/sync'; +import type Settings from '../settings'; +import type { Entry } from '../types'; +export default class SyncProvider { + private readonly _root; + private readonly _settings; + protected readonly _reader: SyncReader; + constructor(_root: string, _settings: Settings); + read(): Entry[]; +} diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.js b/node_modules/@nodelib/fs.walk/out/providers/sync.js new file mode 100644 index 000000000..faab6ca2a --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/providers/sync.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const sync_1 = require("../readers/sync"); +class SyncProvider { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._reader = new sync_1.default(this._root, this._settings); + } + read() { + return this._reader.read(); + } +} +exports.default = SyncProvider; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.d.ts b/node_modules/@nodelib/fs.walk/out/readers/async.d.ts new file mode 100644 index 000000000..9acf4e6c2 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/async.d.ts @@ -0,0 +1,30 @@ +/// +import { EventEmitter } from 'events'; +import * as fsScandir from '@nodelib/fs.scandir'; +import type Settings from '../settings'; +import type { Entry, Errno } from '../types'; +import Reader from './reader'; +declare type EntryEventCallback = (entry: Entry) => void; +declare type ErrorEventCallback = (error: Errno) => void; +declare type EndEventCallback = () => void; +export default class AsyncReader extends Reader { + protected readonly _settings: Settings; + protected readonly _scandir: typeof fsScandir.scandir; + protected readonly _emitter: EventEmitter; + private readonly _queue; + private _isFatalError; + private _isDestroyed; + constructor(_root: string, _settings: Settings); + read(): EventEmitter; + get isDestroyed(): boolean; + destroy(): void; + onEntry(callback: EntryEventCallback): void; + onError(callback: ErrorEventCallback): void; + onEnd(callback: EndEventCallback): void; + private _pushToQueue; + private _worker; + private _handleError; + private _handleEntry; + private _emitEntry; +} +export {}; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.js b/node_modules/@nodelib/fs.walk/out/readers/async.js new file mode 100644 index 000000000..ebe8dd573 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/async.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const events_1 = require("events"); +const fsScandir = require("@nodelib/fs.scandir"); +const fastq = require("fastq"); +const common = require("./common"); +const reader_1 = require("./reader"); +class AsyncReader extends reader_1.default { + constructor(_root, _settings) { + super(_root, _settings); + this._settings = _settings; + this._scandir = fsScandir.scandir; + this._emitter = new events_1.EventEmitter(); + this._queue = fastq(this._worker.bind(this), this._settings.concurrency); + this._isFatalError = false; + this._isDestroyed = false; + this._queue.drain = () => { + if (!this._isFatalError) { + this._emitter.emit('end'); + } + }; + } + read() { + this._isFatalError = false; + this._isDestroyed = false; + setImmediate(() => { + this._pushToQueue(this._root, this._settings.basePath); + }); + return this._emitter; + } + get isDestroyed() { + return this._isDestroyed; + } + destroy() { + if (this._isDestroyed) { + throw new Error('The reader is already destroyed'); + } + this._isDestroyed = true; + this._queue.killAndDrain(); + } + onEntry(callback) { + this._emitter.on('entry', callback); + } + onError(callback) { + this._emitter.once('error', callback); + } + onEnd(callback) { + this._emitter.once('end', callback); + } + _pushToQueue(directory, base) { + const queueItem = { directory, base }; + this._queue.push(queueItem, (error) => { + if (error !== null) { + this._handleError(error); + } + }); + } + _worker(item, done) { + this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { + if (error !== null) { + done(error, undefined); + return; + } + for (const entry of entries) { + this._handleEntry(entry, item.base); + } + done(null, undefined); + }); + } + _handleError(error) { + if (this._isDestroyed || !common.isFatalError(this._settings, error)) { + return; + } + this._isFatalError = true; + this._isDestroyed = true; + this._emitter.emit('error', error); + } + _handleEntry(entry, base) { + if (this._isDestroyed || this._isFatalError) { + return; + } + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._emitEntry(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _emitEntry(entry) { + this._emitter.emit('entry', entry); + } +} +exports.default = AsyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.d.ts b/node_modules/@nodelib/fs.walk/out/readers/common.d.ts new file mode 100644 index 000000000..5985f97c4 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/common.d.ts @@ -0,0 +1,7 @@ +import type { FilterFunction } from '../settings'; +import type Settings from '../settings'; +import type { Errno } from '../types'; +export declare function isFatalError(settings: Settings, error: Errno): boolean; +export declare function isAppliedFilter(filter: FilterFunction | null, value: T): boolean; +export declare function replacePathSegmentSeparator(filepath: string, separator: string): string; +export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.js b/node_modules/@nodelib/fs.walk/out/readers/common.js new file mode 100644 index 000000000..a93572f48 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/common.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; +function isFatalError(settings, error) { + if (settings.errorFilter === null) { + return true; + } + return !settings.errorFilter(error); +} +exports.isFatalError = isFatalError; +function isAppliedFilter(filter, value) { + return filter === null || filter(value); +} +exports.isAppliedFilter = isAppliedFilter; +function replacePathSegmentSeparator(filepath, separator) { + return filepath.split(/[/\\]/).join(separator); +} +exports.replacePathSegmentSeparator = replacePathSegmentSeparator; +function joinPathSegments(a, b, separator) { + if (a === '') { + return b; + } + /** + * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). + */ + if (a.endsWith(separator)) { + return a + b; + } + return a + separator + b; +} +exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts b/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts new file mode 100644 index 000000000..e1f383b25 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts @@ -0,0 +1,6 @@ +import type Settings from '../settings'; +export default class Reader { + protected readonly _root: string; + protected readonly _settings: Settings; + constructor(_root: string, _settings: Settings); +} diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.js b/node_modules/@nodelib/fs.walk/out/readers/reader.js new file mode 100644 index 000000000..782f07cbf --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/reader.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const common = require("./common"); +class Reader { + constructor(_root, _settings) { + this._root = _root; + this._settings = _settings; + this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); + } +} +exports.default = Reader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts new file mode 100644 index 000000000..af4103353 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts @@ -0,0 +1,15 @@ +import * as fsScandir from '@nodelib/fs.scandir'; +import type { Entry } from '../types'; +import Reader from './reader'; +export default class SyncReader extends Reader { + protected readonly _scandir: typeof fsScandir.scandirSync; + private readonly _storage; + private readonly _queue; + read(): Entry[]; + private _pushToQueue; + private _handleQueue; + private _handleDirectory; + private _handleError; + private _handleEntry; + private _pushToStorage; +} diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.js b/node_modules/@nodelib/fs.walk/out/readers/sync.js new file mode 100644 index 000000000..9a8d5a6f1 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/readers/sync.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fsScandir = require("@nodelib/fs.scandir"); +const common = require("./common"); +const reader_1 = require("./reader"); +class SyncReader extends reader_1.default { + constructor() { + super(...arguments); + this._scandir = fsScandir.scandirSync; + this._storage = []; + this._queue = new Set(); + } + read() { + this._pushToQueue(this._root, this._settings.basePath); + this._handleQueue(); + return this._storage; + } + _pushToQueue(directory, base) { + this._queue.add({ directory, base }); + } + _handleQueue() { + for (const item of this._queue.values()) { + this._handleDirectory(item.directory, item.base); + } + } + _handleDirectory(directory, base) { + try { + const entries = this._scandir(directory, this._settings.fsScandirSettings); + for (const entry of entries) { + this._handleEntry(entry, base); + } + } + catch (error) { + this._handleError(error); + } + } + _handleError(error) { + if (!common.isFatalError(this._settings, error)) { + return; + } + throw error; + } + _handleEntry(entry, base) { + const fullpath = entry.path; + if (base !== undefined) { + entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); + } + if (common.isAppliedFilter(this._settings.entryFilter, entry)) { + this._pushToStorage(entry); + } + if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { + this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); + } + } + _pushToStorage(entry) { + this._storage.push(entry); + } +} +exports.default = SyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/settings.d.ts b/node_modules/@nodelib/fs.walk/out/settings.d.ts new file mode 100644 index 000000000..d1c4b45f6 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/settings.d.ts @@ -0,0 +1,30 @@ +import * as fsScandir from '@nodelib/fs.scandir'; +import type { Entry, Errno } from './types'; +export declare type FilterFunction = (value: T) => boolean; +export declare type DeepFilterFunction = FilterFunction; +export declare type EntryFilterFunction = FilterFunction; +export declare type ErrorFilterFunction = FilterFunction; +export interface Options { + basePath?: string; + concurrency?: number; + deepFilter?: DeepFilterFunction; + entryFilter?: EntryFilterFunction; + errorFilter?: ErrorFilterFunction; + followSymbolicLinks?: boolean; + fs?: Partial; + pathSegmentSeparator?: string; + stats?: boolean; + throwErrorOnBrokenSymbolicLink?: boolean; +} +export default class Settings { + private readonly _options; + readonly basePath?: string; + readonly concurrency: number; + readonly deepFilter: DeepFilterFunction | null; + readonly entryFilter: EntryFilterFunction | null; + readonly errorFilter: ErrorFilterFunction | null; + readonly pathSegmentSeparator: string; + readonly fsScandirSettings: fsScandir.Settings; + constructor(_options?: Options); + private _getValue; +} diff --git a/node_modules/@nodelib/fs.walk/out/settings.js b/node_modules/@nodelib/fs.walk/out/settings.js new file mode 100644 index 000000000..d7a85c81e --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/settings.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const fsScandir = require("@nodelib/fs.scandir"); +class Settings { + constructor(_options = {}) { + this._options = _options; + this.basePath = this._getValue(this._options.basePath, undefined); + this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); + this.deepFilter = this._getValue(this._options.deepFilter, null); + this.entryFilter = this._getValue(this._options.entryFilter, null); + this.errorFilter = this._getValue(this._options.errorFilter, null); + this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); + this.fsScandirSettings = new fsScandir.Settings({ + followSymbolicLinks: this._options.followSymbolicLinks, + fs: this._options.fs, + pathSegmentSeparator: this._options.pathSegmentSeparator, + stats: this._options.stats, + throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink + }); + } + _getValue(option, value) { + return option !== null && option !== void 0 ? option : value; + } +} +exports.default = Settings; diff --git a/node_modules/@nodelib/fs.walk/out/types/index.d.ts b/node_modules/@nodelib/fs.walk/out/types/index.d.ts new file mode 100644 index 000000000..6ee9bd3f9 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/types/index.d.ts @@ -0,0 +1,8 @@ +/// +import type * as scandir from '@nodelib/fs.scandir'; +export declare type Entry = scandir.Entry; +export declare type Errno = NodeJS.ErrnoException; +export interface QueueItem { + directory: string; + base?: string; +} diff --git a/node_modules/@nodelib/fs.walk/out/types/index.js b/node_modules/@nodelib/fs.walk/out/types/index.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/node_modules/@nodelib/fs.walk/out/types/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.walk/package.json b/node_modules/@nodelib/fs.walk/package.json new file mode 100644 index 000000000..86bfce48b --- /dev/null +++ b/node_modules/@nodelib/fs.walk/package.json @@ -0,0 +1,44 @@ +{ + "name": "@nodelib/fs.walk", + "version": "1.2.8", + "description": "A library for efficiently walking a directory recursively", + "license": "MIT", + "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk", + "keywords": [ + "NodeLib", + "fs", + "FileSystem", + "file system", + "walk", + "scanner", + "crawler" + ], + "engines": { + "node": ">= 8" + }, + "files": [ + "out/**", + "!out/**/*.map", + "!out/**/*.spec.*", + "!out/**/tests/**" + ], + "main": "out/index.js", + "typings": "out/index.d.ts", + "scripts": { + "clean": "rimraf {tsconfig.tsbuildinfo,out}", + "lint": "eslint \"src/**/*.ts\" --cache", + "compile": "tsc -b .", + "compile:watch": "tsc -p . --watch --sourceMap", + "test": "mocha \"out/**/*.spec.js\" -s 0", + "build": "npm run clean && npm run compile && npm run lint && npm test", + "watch": "npm run clean && npm run compile:watch" + }, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "devDependencies": { + "@nodelib/fs.macchiato": "1.0.4" + }, + "gitHead": "1e5bad48565da2b06b8600e744324ea240bf49d8" +} diff --git a/node_modules/@types/minimist/LICENSE b/node_modules/@types/minimist/LICENSE new file mode 100755 index 000000000..9e841e7a2 --- /dev/null +++ b/node_modules/@types/minimist/LICENSE @@ -0,0 +1,21 @@ + 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 diff --git a/node_modules/@types/minimist/README.md b/node_modules/@types/minimist/README.md new file mode 100755 index 000000000..8bb1e1a0e --- /dev/null +++ b/node_modules/@types/minimist/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/minimist` + +# Summary +This package contains type definitions for minimist (https://github.com/substack/minimist). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/minimist. + +### Additional Details + * Last updated: Wed, 07 Jul 2021 00:01:41 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by [Bart van der Schoor](https://github.com/Bartvds), [Necroskillz](https://github.com/Necroskillz), [kamranayub](https://github.com/kamranayub), and [Piotr Błażejewicz](https://github.com/peterblazejewicz). diff --git a/node_modules/@types/minimist/index.d.ts b/node_modules/@types/minimist/index.d.ts new file mode 100755 index 000000000..afc15d596 --- /dev/null +++ b/node_modules/@types/minimist/index.d.ts @@ -0,0 +1,95 @@ +// Type definitions for minimist 1.2 +// Project: https://github.com/substack/minimist +// Definitions by: Bart van der Schoor +// Necroskillz +// kamranayub +// Piotr Błażejewicz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Return an argument object populated with the array arguments from args + * + * @param [args] An optional argument array (typically `process.argv.slice(2)`) + * @param [opts] An optional options object to customize the parsing + */ +declare function minimist(args?: string[], opts?: minimist.Opts): minimist.ParsedArgs; + +/** + * Return an argument object populated with the array arguments from args. Strongly-typed + * to be the intersect of type T with minimist.ParsedArgs. + * + * `T` The type that will be intersected with minimist.ParsedArgs to represent the argument object + * + * @param [args] An optional argument array (typically `process.argv.slice(2)`) + * @param [opts] An optional options object to customize the parsing + */ +declare function minimist(args?: string[], opts?: minimist.Opts): T & minimist.ParsedArgs; + +/** + * Return an argument object populated with the array arguments from args. Strongly-typed + * to be the the type T which should extend minimist.ParsedArgs + * + * `T` The type that extends minimist.ParsedArgs and represents the argument object + * + * @param [args] An optional argument array (typically `process.argv.slice(2)`) + * @param [opts] An optional options object to customize the parsing + */ +declare function minimist(args?: string[], opts?: minimist.Opts): T; + +declare namespace minimist { + interface Opts { + /** + * A string or array of strings argument names to always treat as strings + */ + string?: string | string[] | undefined; + + /** + * A boolean, string or array of strings to always treat as booleans. If true will treat + * all double hyphenated arguments without equals signs as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) + */ + boolean?: boolean | string | string[] | undefined; + + /** + * An object mapping string names to strings or arrays of string argument names to use as aliases + */ + alias?: { [key: string]: string | string[] } | undefined; + + /** + * An object mapping string argument names to default values + */ + default?: { [key: string]: any } | undefined; + + /** + * When true, populate argv._ with everything after the first non-option + */ + stopEarly?: boolean | undefined; + + /** + * A function which is invoked with a command line parameter not defined in the opts + * configuration object. If the function returns false, the unknown option is not added to argv + */ + unknown?: ((arg: string) => boolean) | undefined; + + /** + * When true, populate argv._ with everything before the -- and argv['--'] with everything after the --. + * Note that with -- set, parsing for arguments still stops after the `--`. + */ + '--'?: boolean | undefined; + } + + interface ParsedArgs { + [arg: string]: any; + + /** + * If opts['--'] is true, populated with everything after the -- + */ + '--'?: string[] | undefined; + + /** + * Contains all the arguments that didn't have an option associated with them + */ + _: string[]; + } +} + +export = minimist; diff --git a/node_modules/@types/minimist/package.json b/node_modules/@types/minimist/package.json new file mode 100755 index 000000000..99ea2d207 --- /dev/null +++ b/node_modules/@types/minimist/package.json @@ -0,0 +1,40 @@ +{ + "name": "@types/minimist", + "version": "1.2.2", + "description": "TypeScript definitions for minimist", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/minimist", + "license": "MIT", + "contributors": [ + { + "name": "Bart van der Schoor", + "url": "https://github.com/Bartvds", + "githubUsername": "Bartvds" + }, + { + "name": "Necroskillz", + "url": "https://github.com/Necroskillz", + "githubUsername": "Necroskillz" + }, + { + "name": "kamranayub", + "url": "https://github.com/kamranayub", + "githubUsername": "kamranayub" + }, + { + "name": "Piotr Błażejewicz", + "url": "https://github.com/peterblazejewicz", + "githubUsername": "peterblazejewicz" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/minimist" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "9032205d52417d0f537f1e52af6f7ac447acb4b87dca0ab5840b83ec7818232e", + "typeScriptVersion": "3.6" +} \ No newline at end of file diff --git a/node_modules/@types/normalize-package-data/LICENSE b/node_modules/@types/normalize-package-data/LICENSE new file mode 100755 index 000000000..9e841e7a2 --- /dev/null +++ b/node_modules/@types/normalize-package-data/LICENSE @@ -0,0 +1,21 @@ + 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 diff --git a/node_modules/@types/normalize-package-data/README.md b/node_modules/@types/normalize-package-data/README.md new file mode 100755 index 000000000..fd3d77134 --- /dev/null +++ b/node_modules/@types/normalize-package-data/README.md @@ -0,0 +1,66 @@ +# Installation +> `npm install --save @types/normalize-package-data` + +# Summary +This package contains type definitions for normalize-package-data (https://github.com/npm/normalize-package-data#readme). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data. +## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data/index.d.ts) +````ts +// Type definitions for normalize-package-data 2.4 +// Project: https://github.com/npm/normalize-package-data#readme +// Definitions by: Jeff Dickey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = normalize; + +declare function normalize(data: normalize.Input, warn?: normalize.WarnFn, strict?: boolean): void; +declare function normalize(data: normalize.Input, strict?: boolean): void; + +declare namespace normalize { + type WarnFn = (msg: string) => void; + interface Input {[k: string]: any; } + + interface Person { + name?: string | undefined; + email?: string | undefined; + url?: string | undefined; + } + + interface Package { + [k: string]: any; + name: string; + version: string; + files?: string[] | undefined; + bin?: {[k: string]: string } | undefined; + man?: string[] | undefined; + keywords?: string[] | undefined; + author?: Person | undefined; + maintainers?: Person[] | undefined; + contributors?: Person[] | undefined; + bundleDependencies?: {[name: string]: string; } | undefined; + dependencies?: {[name: string]: string; } | undefined; + devDependencies?: {[name: string]: string; } | undefined; + optionalDependencies?: {[name: string]: string; } | undefined; + description?: string | undefined; + engines?: {[type: string]: string } | undefined; + license?: string | undefined; + repository?: { type: string, url: string } | undefined; + bugs?: { url: string, email?: string | undefined } | { url?: string | undefined, email: string } | undefined; + homepage?: string | undefined; + scripts?: {[k: string]: string} | undefined; + readme: string; + _id: string; + } +} + +```` + +### Additional Details + * Last updated: Wed, 07 Jul 2021 16:31:34 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by [Jeff Dickey](https://github.com/jdxcode). diff --git a/node_modules/@types/normalize-package-data/index.d.ts b/node_modules/@types/normalize-package-data/index.d.ts new file mode 100755 index 000000000..102d073b3 --- /dev/null +++ b/node_modules/@types/normalize-package-data/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for normalize-package-data 2.4 +// Project: https://github.com/npm/normalize-package-data#readme +// Definitions by: Jeff Dickey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = normalize; + +declare function normalize(data: normalize.Input, warn?: normalize.WarnFn, strict?: boolean): void; +declare function normalize(data: normalize.Input, strict?: boolean): void; + +declare namespace normalize { + type WarnFn = (msg: string) => void; + interface Input {[k: string]: any; } + + interface Person { + name?: string | undefined; + email?: string | undefined; + url?: string | undefined; + } + + interface Package { + [k: string]: any; + name: string; + version: string; + files?: string[] | undefined; + bin?: {[k: string]: string } | undefined; + man?: string[] | undefined; + keywords?: string[] | undefined; + author?: Person | undefined; + maintainers?: Person[] | undefined; + contributors?: Person[] | undefined; + bundleDependencies?: {[name: string]: string; } | undefined; + dependencies?: {[name: string]: string; } | undefined; + devDependencies?: {[name: string]: string; } | undefined; + optionalDependencies?: {[name: string]: string; } | undefined; + description?: string | undefined; + engines?: {[type: string]: string } | undefined; + license?: string | undefined; + repository?: { type: string, url: string } | undefined; + bugs?: { url: string, email?: string | undefined } | { url?: string | undefined, email: string } | undefined; + homepage?: string | undefined; + scripts?: {[k: string]: string} | undefined; + readme: string; + _id: string; + } +} diff --git a/node_modules/@types/normalize-package-data/package.json b/node_modules/@types/normalize-package-data/package.json new file mode 100755 index 000000000..1f61182ea --- /dev/null +++ b/node_modules/@types/normalize-package-data/package.json @@ -0,0 +1,25 @@ +{ + "name": "@types/normalize-package-data", + "version": "2.4.1", + "description": "TypeScript definitions for normalize-package-data", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data", + "license": "MIT", + "contributors": [ + { + "name": "Jeff Dickey", + "url": "https://github.com/jdxcode", + "githubUsername": "jdxcode" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/normalize-package-data" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "10653410655e204616118acfbe2900dc09227bc3a80c532a93d44b46be54db36", + "typeScriptVersion": "3.6" +} \ No newline at end of file diff --git a/node_modules/ajv/.runkit_example.js b/node_modules/ajv/.runkit_example.js new file mode 100644 index 000000000..0d578d5d5 --- /dev/null +++ b/node_modules/ajv/.runkit_example.js @@ -0,0 +1,23 @@ +const Ajv = require("ajv") +const ajv = new Ajv({allErrors: true}) + +const schema = { + type: "object", + properties: { + foo: {type: "string"}, + bar: {type: "number", maximum: 3}, + }, + required: ["foo", "bar"], + additionalProperties: false, +} + +const validate = ajv.compile(schema) + +test({foo: "abc", bar: 2}) +test({foo: 2, bar: 4}) + +function test(data) { + const valid = validate(data) + if (valid) console.log("Valid!") + else console.log("Invalid: " + ajv.errorsText(validate.errors)) +} diff --git a/node_modules/ajv/LICENSE b/node_modules/ajv/LICENSE new file mode 100644 index 000000000..139162ad2 --- /dev/null +++ b/node_modules/ajv/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015-2021 Evgeny Poberezkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/ajv/README.md b/node_modules/ajv/README.md new file mode 100644 index 000000000..ab3f774a1 --- /dev/null +++ b/node_modules/ajv/README.md @@ -0,0 +1,207 @@ +Ajv logo + +  + +# Ajv JSON schema validator + +The fastest JSON validator for Node.js and browser. + +Supports JSON Schema draft-04/06/07/2019-09/2020-12 ([draft-04 support](https://ajv.js.org/json-schema.html#draft-04) requires ajv-draft-04 package) and JSON Type Definition [RFC8927](https://datatracker.ietf.org/doc/rfc8927/). + +[![build](https://github.com/ajv-validator/ajv/workflows/build/badge.svg)](https://github.com/ajv-validator/ajv/actions?query=workflow%3Abuild) +[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) +[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) +[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master) +[![SimpleX](https://img.shields.io/badge/chat-on%20SimpleX-%2307b4b9)](https://simplex.chat/contact#/?v=1-2&smp=smp%3A%2F%2Fu2dS9sG8nMNURyZwqASV4yROM28Er0luVTx5X1CsMrU%3D%40smp4.simplex.im%2FV-6t4hoy_SsvKMi9KekdGX-VKQOhDeAe%23%2F%3Fv%3D1-2%26dh%3DMCowBQYDK2VuAyEAm98gjwvrAEiiz_YgBoaQB9dtKTl5Om1pborUyevQwzg%253D%26srv%3Do5vmywmrnaxalvz6wi3zicyftgio6psuvyniis6gco6bp6ekl4cqj4id.onion&data=%7B%22type%22%3A%22group%22%2C%22groupLinkId%22%3A%22wYrTFafovkymjUtc2vUjCQ%3D%3D%22%7D) +[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) +[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) + +## Ajv sponsors + +[Mozilla](https://www.mozilla.org)[](https://opencollective.com/ajv) + +[Microsoft](https://opensource.microsoft.com)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv) + +[Retool](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[Tidelift](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise)[SimpleX](https://github.com/simplex-chat/simplex-chat)[](https://opencollective.com/ajv) + +## Contributing + +More than 100 people contributed to Ajv, and we would love to have you join the development. We welcome implementing new features that will benefit many users and ideas to improve our documentation. + +Please review [Contributing guidelines](./CONTRIBUTING.md) and [Code components](https://ajv.js.org/components.html). + +## Documentation + +All documentation is available on the [Ajv website](https://ajv.js.org). + +Some useful site links: + +- [Getting started](https://ajv.js.org/guide/getting-started.html) +- [JSON Schema vs JSON Type Definition](https://ajv.js.org/guide/schema-language.html) +- [API reference](https://ajv.js.org/api.html) +- [Strict mode](https://ajv.js.org/strict-mode.html) +- [Standalone validation code](https://ajv.js.org/standalone.html) +- [Security considerations](https://ajv.js.org/security.html) +- [Command line interface](https://ajv.js.org/packages/ajv-cli.html) +- [Frequently Asked Questions](https://ajv.js.org/faq.html) + +## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) + +Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! + +Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. + +Please sponsor Ajv via: + +- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) +- [Ajv Open Collective](https://opencollective.com/ajv) + +Thank you. + +#### Open Collective sponsors + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Performance + +Ajv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. + +Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: + +- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place +- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster +- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) +- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) + +Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): + +[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=62,4,1&chs=600x416&chxl=-1:|ajv|@exodus/schemasafe|is-my-json-valid|djv|@cfworker/json-schema|jsonschema/=t:100,69.2,51.5,13.1,5.1,1.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) + +## Features + +- Ajv implements JSON Schema [draft-06/07/2019-09/2020-12](http://json-schema.org/) standards (draft-04 is supported in v6): + - all validation keywords (see [JSON Schema validation keywords](https://ajv.js.org/json-schema.html)) + - [OpenAPI](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md) extensions: + - NEW: keyword [discriminator](https://ajv.js.org/json-schema.html#discriminator). + - keyword [nullable](https://ajv.js.org/json-schema.html#nullable). + - full support of remote references (remote schemas have to be added with `addSchema` or compiled to be available) + - support of recursive references between schemas + - correct string lengths for strings with unicode pairs + - JSON Schema [formats](https://ajv.js.org/guide/formats.html) (with [ajv-formats](https://github.com/ajv-validator/ajv-formats) plugin). + - [validates schemas against meta-schema](https://ajv.js.org/api.html#api-validateschema) +- NEW: supports [JSON Type Definition](https://datatracker.ietf.org/doc/rfc8927/): + - all keywords (see [JSON Type Definition schema forms](https://ajv.js.org/json-type-definition.html)) + - meta-schema for JTD schemas + - "union" keyword and user-defined keywords (can be used inside "metadata" member of the schema) +- supports [browsers](https://ajv.js.org/guide/environments.html#browsers) and Node.js 10.x - current +- [asynchronous loading](https://ajv.js.org/guide/managing-schemas.html#asynchronous-schema-loading) of referenced schemas during compilation +- "All errors" validation mode with [option allErrors](https://ajv.js.org/options.html#allerrors) +- [error messages with parameters](https://ajv.js.org/api.html#validation-errors) describing error reasons to allow error message generation +- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package +- [removing-additional-properties](https://ajv.js.org/guide/modifying-data.html#removing-additional-properties) +- [assigning defaults](https://ajv.js.org/guide/modifying-data.html#assigning-defaults) to missing properties and items +- [coercing data](https://ajv.js.org/guide/modifying-data.html#coercing-data-types) to the types specified in `type` keywords +- [user-defined keywords](https://ajv.js.org/guide/user-keywords.html) +- additional extension keywords with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package +- [\$data reference](https://ajv.js.org/guide/combining-schemas.html#data-reference) to use values from the validated data as values for the schema keywords +- [asynchronous validation](https://ajv.js.org/guide/async-validation.html) of user-defined formats and keywords + +## Install + +To install version 8: + +``` +npm install ajv +``` + +## Getting started + +Try it in the Node.js REPL: https://runkit.com/npm/ajv + +In JavaScript: + +```javascript +// or ESM/TypeScript import +import Ajv from "ajv" +// Node.js require: +const Ajv = require("ajv") + +const ajv = new Ajv() // options can be passed, e.g. {allErrors: true} + +const schema = { + type: "object", + properties: { + foo: {type: "integer"}, + bar: {type: "string"}, + }, + required: ["foo"], + additionalProperties: false, +} + +const data = { + foo: 1, + bar: "abc", +} + +const validate = ajv.compile(schema) +const valid = validate(data) +if (!valid) console.log(validate.errors) +``` + +Learn how to use Ajv and see more examples in the [Guide: getting started](https://ajv.js.org/guide/getting-started.html) + +## Changes history + +See [https://github.com/ajv-validator/ajv/releases](https://github.com/ajv-validator/ajv/releases) + +**Please note**: [Changes in version 8.0.0](https://github.com/ajv-validator/ajv/releases/tag/v8.0.0) + +[Version 7.0.0](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0) + +[Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0). + +## Code of conduct + +Please review and follow the [Code of conduct](./CODE_OF_CONDUCT.md). + +Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team. + +## Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. + +## Open-source software support + +Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. + +## License + +[MIT](./LICENSE) diff --git a/node_modules/ajv/dist/2019.d.ts b/node_modules/ajv/dist/2019.d.ts new file mode 100644 index 000000000..0dd0bcb04 --- /dev/null +++ b/node_modules/ajv/dist/2019.d.ts @@ -0,0 +1,19 @@ +import type { AnySchemaObject } from "./types"; +import AjvCore, { Options } from "./core"; +declare class Ajv2019 extends AjvCore { + constructor(opts?: Options); + _addVocabularies(): void; + _addDefaultMetaSchema(): void; + defaultMeta(): string | AnySchemaObject | undefined; +} +export default Ajv2019; +export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; +export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; +export { SchemaCxt, SchemaObjCxt } from "./compile"; +export { KeywordCxt } from "./compile/validate"; +export { DefinedError } from "./vocabularies/errors"; +export { JSONType } from "./compile/rules"; +export { JSONSchemaType } from "./types/json-schema"; +export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; +export { default as ValidationError } from "./runtime/validation_error"; +export { default as MissingRefError } from "./compile/ref_error"; diff --git a/node_modules/ajv/dist/2019.js b/node_modules/ajv/dist/2019.js new file mode 100644 index 000000000..f30eb9e1c --- /dev/null +++ b/node_modules/ajv/dist/2019.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; +const core_1 = require("./core"); +const draft7_1 = require("./vocabularies/draft7"); +const dynamic_1 = require("./vocabularies/dynamic"); +const next_1 = require("./vocabularies/next"); +const unevaluated_1 = require("./vocabularies/unevaluated"); +const discriminator_1 = require("./vocabularies/discriminator"); +const json_schema_2019_09_1 = require("./refs/json-schema-2019-09"); +const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema"; +class Ajv2019 extends core_1.default { + constructor(opts = {}) { + super({ + ...opts, + dynamicRef: true, + next: true, + unevaluated: true, + }); + } + _addVocabularies() { + super._addVocabularies(); + this.addVocabulary(dynamic_1.default); + draft7_1.default.forEach((v) => this.addVocabulary(v)); + this.addVocabulary(next_1.default); + this.addVocabulary(unevaluated_1.default); + if (this.opts.discriminator) + this.addKeyword(discriminator_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + const { $data, meta } = this.opts; + if (!meta) + return; + json_schema_2019_09_1.default.call(this, $data); + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; + } + defaultMeta() { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); + } +} +module.exports = exports = Ajv2019; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = Ajv2019; +var validate_1 = require("./compile/validate"); +Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +var validation_error_1 = require("./runtime/validation_error"); +Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); +var ref_error_1 = require("./compile/ref_error"); +Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); +//# sourceMappingURL=2019.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/2019.js.map b/node_modules/ajv/dist/2019.js.map new file mode 100644 index 000000000..204e730de --- /dev/null +++ b/node_modules/ajv/dist/2019.js.map @@ -0,0 +1 @@ +{"version":3,"file":"2019.js","sourceRoot":"","sources":["../lib/2019.ts"],"names":[],"mappings":";;;AACA,iCAAuC;AAEvC,kDAAsD;AACtD,oDAAsD;AACtD,8CAAgD;AAChD,4DAA8D;AAC9D,gEAAwD;AACxD,oEAA0D;AAE1D,MAAM,cAAc,GAAG,8CAA8C,CAAA;AAErE,MAAM,OAAQ,SAAQ,cA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I,EAAC,CAAC,CAAA;AAE3D,kBAAe,OAAO,CAAA;AAyBtB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ No newline at end of file diff --git a/node_modules/ajv/dist/2020.d.ts b/node_modules/ajv/dist/2020.d.ts new file mode 100644 index 000000000..77b4e016f --- /dev/null +++ b/node_modules/ajv/dist/2020.d.ts @@ -0,0 +1,19 @@ +import type { AnySchemaObject } from "./types"; +import AjvCore, { Options } from "./core"; +declare class Ajv2020 extends AjvCore { + constructor(opts?: Options); + _addVocabularies(): void; + _addDefaultMetaSchema(): void; + defaultMeta(): string | AnySchemaObject | undefined; +} +export default Ajv2020; +export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; +export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; +export { SchemaCxt, SchemaObjCxt } from "./compile"; +export { KeywordCxt } from "./compile/validate"; +export { DefinedError } from "./vocabularies/errors"; +export { JSONType } from "./compile/rules"; +export { JSONSchemaType } from "./types/json-schema"; +export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; +export { default as ValidationError } from "./runtime/validation_error"; +export { default as MissingRefError } from "./compile/ref_error"; diff --git a/node_modules/ajv/dist/2020.js b/node_modules/ajv/dist/2020.js new file mode 100644 index 000000000..50a532ed3 --- /dev/null +++ b/node_modules/ajv/dist/2020.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; +const core_1 = require("./core"); +const draft2020_1 = require("./vocabularies/draft2020"); +const discriminator_1 = require("./vocabularies/discriminator"); +const json_schema_2020_12_1 = require("./refs/json-schema-2020-12"); +const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema"; +class Ajv2020 extends core_1.default { + constructor(opts = {}) { + super({ + ...opts, + dynamicRef: true, + next: true, + unevaluated: true, + }); + } + _addVocabularies() { + super._addVocabularies(); + draft2020_1.default.forEach((v) => this.addVocabulary(v)); + if (this.opts.discriminator) + this.addKeyword(discriminator_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + const { $data, meta } = this.opts; + if (!meta) + return; + json_schema_2020_12_1.default.call(this, $data); + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; + } + defaultMeta() { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); + } +} +module.exports = exports = Ajv2020; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = Ajv2020; +var validate_1 = require("./compile/validate"); +Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +var validation_error_1 = require("./runtime/validation_error"); +Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); +var ref_error_1 = require("./compile/ref_error"); +Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); +//# sourceMappingURL=2020.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/2020.js.map b/node_modules/ajv/dist/2020.js.map new file mode 100644 index 000000000..1db6ae443 --- /dev/null +++ b/node_modules/ajv/dist/2020.js.map @@ -0,0 +1 @@ +{"version":3,"file":"2020.js","sourceRoot":"","sources":["../lib/2020.ts"],"names":[],"mappings":";;;AACA,iCAAuC;AAEvC,wDAA4D;AAC5D,gEAAwD;AACxD,oEAA0D;AAE1D,MAAM,cAAc,GAAG,8CAA8C,CAAA;AAErE,MAAM,OAAQ,SAAQ,cAAO;IAC3B,YAAY,OAAgB,EAAE;QAC5B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,IAAI;SAClB,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,mBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QAC3D,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,IAAI,CAAC,UAAU,CAAC,uBAAa,CAAC,CAAA;IAC7D,CAAC;IAED,qBAAqB;QACnB,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC7B,MAAM,EAAC,KAAK,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;QAC/B,IAAI,CAAC,IAAI;YAAE,OAAM;QACjB,6BAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACnC,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,GAAG,cAAc,CAAA;IAC7D,CAAC;IAED,WAAW;QACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW;YAC3B,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAClC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,OAAO,CAAA;AAyBtB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ No newline at end of file diff --git a/node_modules/ajv/dist/ajv.d.ts b/node_modules/ajv/dist/ajv.d.ts new file mode 100644 index 000000000..bcc17c711 --- /dev/null +++ b/node_modules/ajv/dist/ajv.d.ts @@ -0,0 +1,18 @@ +import type { AnySchemaObject } from "./types"; +import AjvCore from "./core"; +declare class Ajv extends AjvCore { + _addVocabularies(): void; + _addDefaultMetaSchema(): void; + defaultMeta(): string | AnySchemaObject | undefined; +} +export default Ajv; +export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, SchemaValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; +export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; +export { SchemaCxt, SchemaObjCxt } from "./compile"; +export { KeywordCxt } from "./compile/validate"; +export { DefinedError } from "./vocabularies/errors"; +export { JSONType } from "./compile/rules"; +export { JSONSchemaType } from "./types/json-schema"; +export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; +export { default as ValidationError } from "./runtime/validation_error"; +export { default as MissingRefError } from "./compile/ref_error"; diff --git a/node_modules/ajv/dist/ajv.js b/node_modules/ajv/dist/ajv.js new file mode 100644 index 000000000..755256a73 --- /dev/null +++ b/node_modules/ajv/dist/ajv.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; +const core_1 = require("./core"); +const draft7_1 = require("./vocabularies/draft7"); +const discriminator_1 = require("./vocabularies/discriminator"); +const draft7MetaSchema = require("./refs/json-schema-draft-07.json"); +const META_SUPPORT_DATA = ["/properties"]; +const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"; +class Ajv extends core_1.default { + _addVocabularies() { + super._addVocabularies(); + draft7_1.default.forEach((v) => this.addVocabulary(v)); + if (this.opts.discriminator) + this.addKeyword(discriminator_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + if (!this.opts.meta) + return; + const metaSchema = this.opts.$data + ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) + : draft7MetaSchema; + this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; + } + defaultMeta() { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); + } +} +module.exports = exports = Ajv; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = Ajv; +var validate_1 = require("./compile/validate"); +Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +var validation_error_1 = require("./runtime/validation_error"); +Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); +var ref_error_1 = require("./compile/ref_error"); +Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); +//# sourceMappingURL=ajv.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/ajv.js.map b/node_modules/ajv/dist/ajv.js.map new file mode 100644 index 000000000..a229a00b4 --- /dev/null +++ b/node_modules/ajv/dist/ajv.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ajv.js","sourceRoot":"","sources":["../lib/ajv.ts"],"names":[],"mappings":";;;AACA,iCAA4B;AAC5B,kDAAsD;AACtD,gEAAwD;AACxD,qEAAoE;AAEpE,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,MAAM,cAAc,GAAG,wCAAwC,CAAA;AAE/D,MAAM,GAAI,SAAQ,cAAO;IACvB,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,gBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QACxD,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,IAAI,CAAC,UAAU,CAAC,uBAAa,CAAC,CAAA;IAC7D,CAAC;IAED,qBAAqB;QACnB,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAM;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK;YAChC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;YAC3D,CAAC,CAAC,gBAAgB,CAAA;QACpB,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,EAAE,KAAK,CAAC,CAAA;QACrD,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,GAAG,cAAc,CAAA;IAC7D,CAAC;IAED,WAAW;QACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW;YAC3B,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,GAAG,CAAA;AAC9B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,GAAG,CAAA;AA0BlB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/codegen/code.d.ts b/node_modules/ajv/dist/compile/codegen/code.d.ts new file mode 100644 index 000000000..a0220ad76 --- /dev/null +++ b/node_modules/ajv/dist/compile/codegen/code.d.ts @@ -0,0 +1,40 @@ +export declare abstract class _CodeOrName { + abstract readonly str: string; + abstract readonly names: UsedNames; + abstract toString(): string; + abstract emptyStr(): boolean; +} +export declare const IDENTIFIER: RegExp; +export declare class Name extends _CodeOrName { + readonly str: string; + constructor(s: string); + toString(): string; + emptyStr(): boolean; + get names(): UsedNames; +} +export declare class _Code extends _CodeOrName { + readonly _items: readonly CodeItem[]; + private _str?; + private _names?; + constructor(code: string | readonly CodeItem[]); + toString(): string; + emptyStr(): boolean; + get str(): string; + get names(): UsedNames; +} +export type CodeItem = Name | string | number | boolean | null; +export type UsedNames = Record; +export type Code = _Code | Name; +export type SafeExpr = Code | number | boolean | null; +export declare const nil: _Code; +type CodeArg = SafeExpr | string | undefined; +export declare function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code; +export declare function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code; +export declare function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void; +export declare function strConcat(c1: Code, c2: Code): Code; +export declare function stringify(x: unknown): Code; +export declare function safeStringify(x: unknown): string; +export declare function getProperty(key: Code | string | number): Code; +export declare function getEsmExportName(key: Code | string | number): Code; +export declare function regexpCode(rx: RegExp): Code; +export {}; diff --git a/node_modules/ajv/dist/compile/codegen/code.js b/node_modules/ajv/dist/compile/codegen/code.js new file mode 100644 index 000000000..f8268838a --- /dev/null +++ b/node_modules/ajv/dist/compile/codegen/code.js @@ -0,0 +1,155 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0; +class _CodeOrName { +} +exports._CodeOrName = _CodeOrName; +exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; +class Name extends _CodeOrName { + constructor(s) { + super(); + if (!exports.IDENTIFIER.test(s)) + throw new Error("CodeGen: name must be a valid identifier"); + this.str = s; + } + toString() { + return this.str; + } + emptyStr() { + return false; + } + get names() { + return { [this.str]: 1 }; + } +} +exports.Name = Name; +class _Code extends _CodeOrName { + constructor(code) { + super(); + this._items = typeof code === "string" ? [code] : code; + } + toString() { + return this.str; + } + emptyStr() { + if (this._items.length > 1) + return false; + const item = this._items[0]; + return item === "" || item === '""'; + } + get str() { + var _a; + return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, ""))); + } + get names() { + var _a; + return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => { + if (c instanceof Name) + names[c.str] = (names[c.str] || 0) + 1; + return names; + }, {}))); + } +} +exports._Code = _Code; +exports.nil = new _Code(""); +function _(strs, ...args) { + const code = [strs[0]]; + let i = 0; + while (i < args.length) { + addCodeArg(code, args[i]); + code.push(strs[++i]); + } + return new _Code(code); +} +exports._ = _; +const plus = new _Code("+"); +function str(strs, ...args) { + const expr = [safeStringify(strs[0])]; + let i = 0; + while (i < args.length) { + expr.push(plus); + addCodeArg(expr, args[i]); + expr.push(plus, safeStringify(strs[++i])); + } + optimize(expr); + return new _Code(expr); +} +exports.str = str; +function addCodeArg(code, arg) { + if (arg instanceof _Code) + code.push(...arg._items); + else if (arg instanceof Name) + code.push(arg); + else + code.push(interpolate(arg)); +} +exports.addCodeArg = addCodeArg; +function optimize(expr) { + let i = 1; + while (i < expr.length - 1) { + if (expr[i] === plus) { + const res = mergeExprItems(expr[i - 1], expr[i + 1]); + if (res !== undefined) { + expr.splice(i - 1, 3, res); + continue; + } + expr[i++] = "+"; + } + i++; + } +} +function mergeExprItems(a, b) { + if (b === '""') + return a; + if (a === '""') + return b; + if (typeof a == "string") { + if (b instanceof Name || a[a.length - 1] !== '"') + return; + if (typeof b != "string") + return `${a.slice(0, -1)}${b}"`; + if (b[0] === '"') + return a.slice(0, -1) + b.slice(1); + return; + } + if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) + return `"${a}${b.slice(1)}`; + return; +} +function strConcat(c1, c2) { + return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`; +} +exports.strConcat = strConcat; +// TODO do not allow arrays here +function interpolate(x) { + return typeof x == "number" || typeof x == "boolean" || x === null + ? x + : safeStringify(Array.isArray(x) ? x.join(",") : x); +} +function stringify(x) { + return new _Code(safeStringify(x)); +} +exports.stringify = stringify; +function safeStringify(x) { + return JSON.stringify(x) + .replace(/\u2028/g, "\\u2028") + .replace(/\u2029/g, "\\u2029"); +} +exports.safeStringify = safeStringify; +function getProperty(key) { + return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`; +} +exports.getProperty = getProperty; +//Does best effort to format the name properly +function getEsmExportName(key) { + if (typeof key == "string" && exports.IDENTIFIER.test(key)) { + return new _Code(`${key}`); + } + throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`); +} +exports.getEsmExportName = getEsmExportName; +function regexpCode(rx) { + return new _Code(rx.toString()); +} +exports.regexpCode = regexpCode; +//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/codegen/code.js.map b/node_modules/ajv/dist/compile/codegen/code.js.map new file mode 100644 index 000000000..c5c7a3961 --- /dev/null +++ b/node_modules/ajv/dist/compile/codegen/code.js.map @@ -0,0 +1 @@ +{"version":3,"file":"code.js","sourceRoot":"","sources":["../../../lib/compile/codegen/code.ts"],"names":[],"mappings":";;;AAAA,MAAsB,WAAW;CAKhC;AALD,kCAKC;AAEY,QAAA,UAAU,GAAG,uBAAuB,CAAA;AAEjD,MAAa,IAAK,SAAQ,WAAW;IAEnC,YAAY,CAAS;QACnB,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,kBAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;QACpF,IAAI,C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AAC,CAAU;IACtC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;SAC7B,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;AAClC,CAAC;AAJD,sCAIC;AAED,SAAgB,WAAW,CAAC,GAA2B;IACrD,OAAO,OAAO,GAAG,IAAI,QAAQ,IAAI,kBAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,IAAI,GAAG,GAAG,CAAA;AAC5F,CAAC;AAFD,kCAEC;AAED,8CAA8C;AAC9C,SAAgB,gBAAgB,CAAC,GAA2B;IAC1D,IAAI,OAAO,GAAG,IAAI,QAAQ,IAAI,kBAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAClD,OAAO,IAAI,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC,CAAA;KAC3B;IACD,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,iCAAiC,CAAC,CAAA;AACxF,CAAC;AALD,4CAKC;AAED,SAAgB,UAAU,CAAC,EAAU;IACnC,OAAO,IAAI,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;AACjC,CAAC;AAFD,gCAEC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/codegen/index.d.ts b/node_modules/ajv/dist/compile/codegen/index.d.ts new file mode 100644 index 000000000..d586a4b49 --- /dev/null +++ b/node_modules/ajv/dist/compile/codegen/index.d.ts @@ -0,0 +1,79 @@ +import type { ScopeValueSets, NameValue, ValueScope, ValueScopeName } from "./scope"; +import { _Code, Code, Name } from "./code"; +import { Scope } from "./scope"; +export { _, str, strConcat, nil, getProperty, stringify, regexpCode, Name, Code } from "./code"; +export { Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds } from "./scope"; +export type SafeExpr = Code | number | boolean | null; +export type Block = Code | (() => void); +export declare const operators: { + GT: _Code; + GTE: _Code; + LT: _Code; + LTE: _Code; + EQ: _Code; + NEQ: _Code; + NOT: _Code; + OR: _Code; + AND: _Code; + ADD: _Code; +}; +export interface CodeGenOptions { + es5?: boolean; + lines?: boolean; + ownProperties?: boolean; +} +export declare class CodeGen { + readonly _scope: Scope; + readonly _extScope: ValueScope; + readonly _values: ScopeValueSets; + private readonly _nodes; + private readonly _blockStarts; + private readonly _constants; + private readonly opts; + constructor(extScope: ValueScope, opts?: CodeGenOptions); + toString(): string; + name(prefix: string): Name; + scopeName(prefix: string): ValueScopeName; + scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name; + getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined; + scopeRefs(scopeName: Name): Code; + scopeCode(): Code; + private _def; + const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name; + let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name; + var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name; + assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen; + add(lhs: Code, rhs: SafeExpr): CodeGen; + code(c: Block | SafeExpr): CodeGen; + object(...keyValues: [Name | string, SafeExpr | string][]): _Code; + if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen; + elseIf(condition: Code | boolean): CodeGen; + else(): CodeGen; + endIf(): CodeGen; + private _for; + for(iteration: Code, forBody?: Block): CodeGen; + forRange(nameOrPrefix: Name | string, from: SafeExpr, to: SafeExpr, forBody: (index: Name) => void, varKind?: Code): CodeGen; + forOf(nameOrPrefix: Name | string, iterable: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen; + forIn(nameOrPrefix: Name | string, obj: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen; + endFor(): CodeGen; + label(label: Name): CodeGen; + break(label?: Code): CodeGen; + return(value: Block | SafeExpr): CodeGen; + try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen; + throw(error: Code): CodeGen; + block(body?: Block, nodeCount?: number): CodeGen; + endBlock(nodeCount?: number): CodeGen; + func(name: Name, args?: Code, async?: boolean, funcBody?: Block): CodeGen; + endFunc(): CodeGen; + optimize(n?: number): void; + private _leafNode; + private _blockNode; + private _endBlockNode; + private _elseNode; + private get _root(); + private get _currNode(); + private set _currNode(value); +} +export declare function not(x: T): T; +export declare function and(...args: Code[]): Code; +export declare function or(...args: Code[]): Code; diff --git a/node_modules/ajv/dist/compile/codegen/index.js b/node_modules/ajv/dist/compile/codegen/index.js new file mode 100644 index 000000000..a6c805af1 --- /dev/null +++ b/node_modules/ajv/dist/compile/codegen/index.js @@ -0,0 +1,697 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0; +const code_1 = require("./code"); +const scope_1 = require("./scope"); +var code_2 = require("./code"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return code_2._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return code_2.str; } }); +Object.defineProperty(exports, "strConcat", { enumerable: true, get: function () { return code_2.strConcat; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return code_2.nil; } }); +Object.defineProperty(exports, "getProperty", { enumerable: true, get: function () { return code_2.getProperty; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return code_2.stringify; } }); +Object.defineProperty(exports, "regexpCode", { enumerable: true, get: function () { return code_2.regexpCode; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return code_2.Name; } }); +var scope_2 = require("./scope"); +Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return scope_2.Scope; } }); +Object.defineProperty(exports, "ValueScope", { enumerable: true, get: function () { return scope_2.ValueScope; } }); +Object.defineProperty(exports, "ValueScopeName", { enumerable: true, get: function () { return scope_2.ValueScopeName; } }); +Object.defineProperty(exports, "varKinds", { enumerable: true, get: function () { return scope_2.varKinds; } }); +exports.operators = { + GT: new code_1._Code(">"), + GTE: new code_1._Code(">="), + LT: new code_1._Code("<"), + LTE: new code_1._Code("<="), + EQ: new code_1._Code("==="), + NEQ: new code_1._Code("!=="), + NOT: new code_1._Code("!"), + OR: new code_1._Code("||"), + AND: new code_1._Code("&&"), + ADD: new code_1._Code("+"), +}; +class Node { + optimizeNodes() { + return this; + } + optimizeNames(_names, _constants) { + return this; + } +} +class Def extends Node { + constructor(varKind, name, rhs) { + super(); + this.varKind = varKind; + this.name = name; + this.rhs = rhs; + } + render({ es5, _n }) { + const varKind = es5 ? scope_1.varKinds.var : this.varKind; + const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`; + return `${varKind} ${this.name}${rhs};` + _n; + } + optimizeNames(names, constants) { + if (!names[this.name.str]) + return; + if (this.rhs) + this.rhs = optimizeExpr(this.rhs, names, constants); + return this; + } + get names() { + return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {}; + } +} +class Assign extends Node { + constructor(lhs, rhs, sideEffects) { + super(); + this.lhs = lhs; + this.rhs = rhs; + this.sideEffects = sideEffects; + } + render({ _n }) { + return `${this.lhs} = ${this.rhs};` + _n; + } + optimizeNames(names, constants) { + if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) + return; + this.rhs = optimizeExpr(this.rhs, names, constants); + return this; + } + get names() { + const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }; + return addExprNames(names, this.rhs); + } +} +class AssignOp extends Assign { + constructor(lhs, op, rhs, sideEffects) { + super(lhs, rhs, sideEffects); + this.op = op; + } + render({ _n }) { + return `${this.lhs} ${this.op}= ${this.rhs};` + _n; + } +} +class Label extends Node { + constructor(label) { + super(); + this.label = label; + this.names = {}; + } + render({ _n }) { + return `${this.label}:` + _n; + } +} +class Break extends Node { + constructor(label) { + super(); + this.label = label; + this.names = {}; + } + render({ _n }) { + const label = this.label ? ` ${this.label}` : ""; + return `break${label};` + _n; + } +} +class Throw extends Node { + constructor(error) { + super(); + this.error = error; + } + render({ _n }) { + return `throw ${this.error};` + _n; + } + get names() { + return this.error.names; + } +} +class AnyCode extends Node { + constructor(code) { + super(); + this.code = code; + } + render({ _n }) { + return `${this.code};` + _n; + } + optimizeNodes() { + return `${this.code}` ? this : undefined; + } + optimizeNames(names, constants) { + this.code = optimizeExpr(this.code, names, constants); + return this; + } + get names() { + return this.code instanceof code_1._CodeOrName ? this.code.names : {}; + } +} +class ParentNode extends Node { + constructor(nodes = []) { + super(); + this.nodes = nodes; + } + render(opts) { + return this.nodes.reduce((code, n) => code + n.render(opts), ""); + } + optimizeNodes() { + const { nodes } = this; + let i = nodes.length; + while (i--) { + const n = nodes[i].optimizeNodes(); + if (Array.isArray(n)) + nodes.splice(i, 1, ...n); + else if (n) + nodes[i] = n; + else + nodes.splice(i, 1); + } + return nodes.length > 0 ? this : undefined; + } + optimizeNames(names, constants) { + const { nodes } = this; + let i = nodes.length; + while (i--) { + // iterating backwards improves 1-pass optimization + const n = nodes[i]; + if (n.optimizeNames(names, constants)) + continue; + subtractNames(names, n.names); + nodes.splice(i, 1); + } + return nodes.length > 0 ? this : undefined; + } + get names() { + return this.nodes.reduce((names, n) => addNames(names, n.names), {}); + } +} +class BlockNode extends ParentNode { + render(opts) { + return "{" + opts._n + super.render(opts) + "}" + opts._n; + } +} +class Root extends ParentNode { +} +class Else extends BlockNode { +} +Else.kind = "else"; +class If extends BlockNode { + constructor(condition, nodes) { + super(nodes); + this.condition = condition; + } + render(opts) { + let code = `if(${this.condition})` + super.render(opts); + if (this.else) + code += "else " + this.else.render(opts); + return code; + } + optimizeNodes() { + super.optimizeNodes(); + const cond = this.condition; + if (cond === true) + return this.nodes; // else is ignored here + let e = this.else; + if (e) { + const ns = e.optimizeNodes(); + e = this.else = Array.isArray(ns) ? new Else(ns) : ns; + } + if (e) { + if (cond === false) + return e instanceof If ? e : e.nodes; + if (this.nodes.length) + return this; + return new If(not(cond), e instanceof If ? [e] : e.nodes); + } + if (cond === false || !this.nodes.length) + return undefined; + return this; + } + optimizeNames(names, constants) { + var _a; + this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); + if (!(super.optimizeNames(names, constants) || this.else)) + return; + this.condition = optimizeExpr(this.condition, names, constants); + return this; + } + get names() { + const names = super.names; + addExprNames(names, this.condition); + if (this.else) + addNames(names, this.else.names); + return names; + } +} +If.kind = "if"; +class For extends BlockNode { +} +For.kind = "for"; +class ForLoop extends For { + constructor(iteration) { + super(); + this.iteration = iteration; + } + render(opts) { + return `for(${this.iteration})` + super.render(opts); + } + optimizeNames(names, constants) { + if (!super.optimizeNames(names, constants)) + return; + this.iteration = optimizeExpr(this.iteration, names, constants); + return this; + } + get names() { + return addNames(super.names, this.iteration.names); + } +} +class ForRange extends For { + constructor(varKind, name, from, to) { + super(); + this.varKind = varKind; + this.name = name; + this.from = from; + this.to = to; + } + render(opts) { + const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind; + const { name, from, to } = this; + return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts); + } + get names() { + const names = addExprNames(super.names, this.from); + return addExprNames(names, this.to); + } +} +class ForIter extends For { + constructor(loop, varKind, name, iterable) { + super(); + this.loop = loop; + this.varKind = varKind; + this.name = name; + this.iterable = iterable; + } + render(opts) { + return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts); + } + optimizeNames(names, constants) { + if (!super.optimizeNames(names, constants)) + return; + this.iterable = optimizeExpr(this.iterable, names, constants); + return this; + } + get names() { + return addNames(super.names, this.iterable.names); + } +} +class Func extends BlockNode { + constructor(name, args, async) { + super(); + this.name = name; + this.args = args; + this.async = async; + } + render(opts) { + const _async = this.async ? "async " : ""; + return `${_async}function ${this.name}(${this.args})` + super.render(opts); + } +} +Func.kind = "func"; +class Return extends ParentNode { + render(opts) { + return "return " + super.render(opts); + } +} +Return.kind = "return"; +class Try extends BlockNode { + render(opts) { + let code = "try" + super.render(opts); + if (this.catch) + code += this.catch.render(opts); + if (this.finally) + code += this.finally.render(opts); + return code; + } + optimizeNodes() { + var _a, _b; + super.optimizeNodes(); + (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes(); + (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes(); + return this; + } + optimizeNames(names, constants) { + var _a, _b; + super.optimizeNames(names, constants); + (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); + (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants); + return this; + } + get names() { + const names = super.names; + if (this.catch) + addNames(names, this.catch.names); + if (this.finally) + addNames(names, this.finally.names); + return names; + } +} +class Catch extends BlockNode { + constructor(error) { + super(); + this.error = error; + } + render(opts) { + return `catch(${this.error})` + super.render(opts); + } +} +Catch.kind = "catch"; +class Finally extends BlockNode { + render(opts) { + return "finally" + super.render(opts); + } +} +Finally.kind = "finally"; +class CodeGen { + constructor(extScope, opts = {}) { + this._values = {}; + this._blockStarts = []; + this._constants = {}; + this.opts = { ...opts, _n: opts.lines ? "\n" : "" }; + this._extScope = extScope; + this._scope = new scope_1.Scope({ parent: extScope }); + this._nodes = [new Root()]; + } + toString() { + return this._root.render(this.opts); + } + // returns unique name in the internal scope + name(prefix) { + return this._scope.name(prefix); + } + // reserves unique name in the external scope + scopeName(prefix) { + return this._extScope.name(prefix); + } + // reserves unique name in the external scope and assigns value to it + scopeValue(prefixOrName, value) { + const name = this._extScope.value(prefixOrName, value); + const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set()); + vs.add(name); + return name; + } + getScopeValue(prefix, keyOrRef) { + return this._extScope.getValue(prefix, keyOrRef); + } + // return code that assigns values in the external scope to the names that are used internally + // (same names that were returned by gen.scopeName or gen.scopeValue) + scopeRefs(scopeName) { + return this._extScope.scopeRefs(scopeName, this._values); + } + scopeCode() { + return this._extScope.scopeCode(this._values); + } + _def(varKind, nameOrPrefix, rhs, constant) { + const name = this._scope.toName(nameOrPrefix); + if (rhs !== undefined && constant) + this._constants[name.str] = rhs; + this._leafNode(new Def(varKind, name, rhs)); + return name; + } + // `const` declaration (`var` in es5 mode) + const(nameOrPrefix, rhs, _constant) { + return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant); + } + // `let` declaration with optional assignment (`var` in es5 mode) + let(nameOrPrefix, rhs, _constant) { + return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant); + } + // `var` declaration with optional assignment + var(nameOrPrefix, rhs, _constant) { + return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant); + } + // assignment code + assign(lhs, rhs, sideEffects) { + return this._leafNode(new Assign(lhs, rhs, sideEffects)); + } + // `+=` code + add(lhs, rhs) { + return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs)); + } + // appends passed SafeExpr to code or executes Block + code(c) { + if (typeof c == "function") + c(); + else if (c !== code_1.nil) + this._leafNode(new AnyCode(c)); + return this; + } + // returns code for object literal for the passed argument list of key-value pairs + object(...keyValues) { + const code = ["{"]; + for (const [key, value] of keyValues) { + if (code.length > 1) + code.push(","); + code.push(key); + if (key !== value || this.opts.es5) { + code.push(":"); + (0, code_1.addCodeArg)(code, value); + } + } + code.push("}"); + return new code_1._Code(code); + } + // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) + if(condition, thenBody, elseBody) { + this._blockNode(new If(condition)); + if (thenBody && elseBody) { + this.code(thenBody).else().code(elseBody).endIf(); + } + else if (thenBody) { + this.code(thenBody).endIf(); + } + else if (elseBody) { + throw new Error('CodeGen: "else" body without "then" body'); + } + return this; + } + // `else if` clause - invalid without `if` or after `else` clauses + elseIf(condition) { + return this._elseNode(new If(condition)); + } + // `else` clause - only valid after `if` or `else if` clauses + else() { + return this._elseNode(new Else()); + } + // end `if` statement (needed if gen.if was used only with condition) + endIf() { + return this._endBlockNode(If, Else); + } + _for(node, forBody) { + this._blockNode(node); + if (forBody) + this.code(forBody).endFor(); + return this; + } + // a generic `for` clause (or statement if `forBody` is passed) + for(iteration, forBody) { + return this._for(new ForLoop(iteration), forBody); + } + // `for` statement for a range of values + forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) { + const name = this._scope.toName(nameOrPrefix); + return this._for(new ForRange(varKind, name, from, to), () => forBody(name)); + } + // `for-of` statement (in es5 mode replace with a normal for loop) + forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) { + const name = this._scope.toName(nameOrPrefix); + if (this.opts.es5) { + const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable); + return this.forRange("_i", 0, (0, code_1._) `${arr}.length`, (i) => { + this.var(name, (0, code_1._) `${arr}[${i}]`); + forBody(name); + }); + } + return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)); + } + // `for-in` statement. + // With option `ownProperties` replaced with a `for-of` loop for object keys + forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) { + if (this.opts.ownProperties) { + return this.forOf(nameOrPrefix, (0, code_1._) `Object.keys(${obj})`, forBody); + } + const name = this._scope.toName(nameOrPrefix); + return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)); + } + // end `for` loop + endFor() { + return this._endBlockNode(For); + } + // `label` statement + label(label) { + return this._leafNode(new Label(label)); + } + // `break` statement + break(label) { + return this._leafNode(new Break(label)); + } + // `return` statement + return(value) { + const node = new Return(); + this._blockNode(node); + this.code(value); + if (node.nodes.length !== 1) + throw new Error('CodeGen: "return" should have one node'); + return this._endBlockNode(Return); + } + // `try` statement + try(tryBody, catchCode, finallyCode) { + if (!catchCode && !finallyCode) + throw new Error('CodeGen: "try" without "catch" and "finally"'); + const node = new Try(); + this._blockNode(node); + this.code(tryBody); + if (catchCode) { + const error = this.name("e"); + this._currNode = node.catch = new Catch(error); + catchCode(error); + } + if (finallyCode) { + this._currNode = node.finally = new Finally(); + this.code(finallyCode); + } + return this._endBlockNode(Catch, Finally); + } + // `throw` statement + throw(error) { + return this._leafNode(new Throw(error)); + } + // start self-balancing block + block(body, nodeCount) { + this._blockStarts.push(this._nodes.length); + if (body) + this.code(body).endBlock(nodeCount); + return this; + } + // end the current self-balancing block + endBlock(nodeCount) { + const len = this._blockStarts.pop(); + if (len === undefined) + throw new Error("CodeGen: not in self-balancing block"); + const toClose = this._nodes.length - len; + if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) { + throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`); + } + this._nodes.length = len; + return this; + } + // `function` heading (or definition if funcBody is passed) + func(name, args = code_1.nil, async, funcBody) { + this._blockNode(new Func(name, args, async)); + if (funcBody) + this.code(funcBody).endFunc(); + return this; + } + // end function definition + endFunc() { + return this._endBlockNode(Func); + } + optimize(n = 1) { + while (n-- > 0) { + this._root.optimizeNodes(); + this._root.optimizeNames(this._root.names, this._constants); + } + } + _leafNode(node) { + this._currNode.nodes.push(node); + return this; + } + _blockNode(node) { + this._currNode.nodes.push(node); + this._nodes.push(node); + } + _endBlockNode(N1, N2) { + const n = this._currNode; + if (n instanceof N1 || (N2 && n instanceof N2)) { + this._nodes.pop(); + return this; + } + throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`); + } + _elseNode(node) { + const n = this._currNode; + if (!(n instanceof If)) { + throw new Error('CodeGen: "else" without "if"'); + } + this._currNode = n.else = node; + return this; + } + get _root() { + return this._nodes[0]; + } + get _currNode() { + const ns = this._nodes; + return ns[ns.length - 1]; + } + set _currNode(node) { + const ns = this._nodes; + ns[ns.length - 1] = node; + } +} +exports.CodeGen = CodeGen; +function addNames(names, from) { + for (const n in from) + names[n] = (names[n] || 0) + (from[n] || 0); + return names; +} +function addExprNames(names, from) { + return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names; +} +function optimizeExpr(expr, names, constants) { + if (expr instanceof code_1.Name) + return replaceName(expr); + if (!canOptimize(expr)) + return expr; + return new code_1._Code(expr._items.reduce((items, c) => { + if (c instanceof code_1.Name) + c = replaceName(c); + if (c instanceof code_1._Code) + items.push(...c._items); + else + items.push(c); + return items; + }, [])); + function replaceName(n) { + const c = constants[n.str]; + if (c === undefined || names[n.str] !== 1) + return n; + delete names[n.str]; + return c; + } + function canOptimize(e) { + return (e instanceof code_1._Code && + e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined)); + } +} +function subtractNames(names, from) { + for (const n in from) + names[n] = (names[n] || 0) - (from[n] || 0); +} +function not(x) { + return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._) `!${par(x)}`; +} +exports.not = not; +const andCode = mappend(exports.operators.AND); +// boolean AND (&&) expression with the passed arguments +function and(...args) { + return args.reduce(andCode); +} +exports.and = and; +const orCode = mappend(exports.operators.OR); +// boolean OR (||) expression with the passed arguments +function or(...args) { + return args.reduce(orCode); +} +exports.or = or; +function mappend(op) { + return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._) `${par(x)} ${op} ${par(y)}`); +} +function par(x) { + return x instanceof code_1.Name ? x : (0, code_1._) `(${x})`; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/codegen/index.js.map b/node_modules/ajv/dist/compile/codegen/index.js.map new file mode 100644 index 000000000..f3826d283 --- /dev/null +++ b/node_modules/ajv/dist/compile/codegen/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/compile/codegen/index.ts"],"names":[],"mappings":";;;AACA,iCAA8F;AAC9F,mCAAuC;AAEvC,+BAA6F;AAArF,yFAAA,CAAC,OAAA;AAAE,2FAAA,GAAG,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,2FAAA,GAAG,OAAA;AAAE,mGAAA,WAAW,OAAA;AAAE,iGAAA,SAAS,OAAA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AAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAC5B,CAAC;AAFD,gBAEC;AAID,SAAS,OAAO,CAAC,EAAQ;IACvB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,UAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,UAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,QAAC,EAAA,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AACjF,CAAC;AAED,SAAS,GAAG,CAAC,CAAO;IAClB,OAAO,CAAC,YAAY,WAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,QAAC,EAAA,IAAI,CAAC,GAAG,CAAA;AAC1C,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/codegen/scope.d.ts b/node_modules/ajv/dist/compile/codegen/scope.d.ts new file mode 100644 index 000000000..3d9530538 --- /dev/null +++ b/node_modules/ajv/dist/compile/codegen/scope.d.ts @@ -0,0 +1,79 @@ +import { Code, Name } from "./code"; +interface NameGroup { + prefix: string; + index: number; +} +export interface NameValue { + ref: ValueReference; + key?: unknown; + code?: Code; +} +export type ValueReference = unknown; +interface ScopeOptions { + prefixes?: Set; + parent?: Scope; +} +interface ValueScopeOptions extends ScopeOptions { + scope: ScopeStore; + es5?: boolean; + lines?: boolean; +} +export type ScopeStore = Record; +type ScopeValues = { + [Prefix in string]?: Map; +}; +export type ScopeValueSets = { + [Prefix in string]?: Set; +}; +export declare enum UsedValueState { + Started = 0, + Completed = 1 +} +export type UsedScopeValues = { + [Prefix in string]?: Map; +}; +export declare const varKinds: { + const: Name; + let: Name; + var: Name; +}; +export declare class Scope { + protected readonly _names: { + [Prefix in string]?: NameGroup; + }; + protected readonly _prefixes?: Set; + protected readonly _parent?: Scope; + constructor({ prefixes, parent }?: ScopeOptions); + toName(nameOrPrefix: Name | string): Name; + name(prefix: string): Name; + protected _newName(prefix: string): string; + private _nameGroup; +} +interface ScopePath { + property: string; + itemIndex: number; +} +export declare class ValueScopeName extends Name { + readonly prefix: string; + value?: NameValue; + scopePath?: Code; + constructor(prefix: string, nameStr: string); + setValue(value: NameValue, { property, itemIndex }: ScopePath): void; +} +interface VSOptions extends ValueScopeOptions { + _n: Code; +} +export declare class ValueScope extends Scope { + protected readonly _values: ScopeValues; + protected readonly _scope: ScopeStore; + readonly opts: VSOptions; + constructor(opts: ValueScopeOptions); + get(): ScopeStore; + name(prefix: string): ValueScopeName; + value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName; + getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined; + scopeRefs(scopeName: Name, values?: ScopeValues | ScopeValueSets): Code; + scopeCode(values?: ScopeValues | ScopeValueSets, usedValues?: UsedScopeValues, getCode?: (n: ValueScopeName) => Code | undefined): Code; + private _reduceValues; +} +export {}; diff --git a/node_modules/ajv/dist/compile/codegen/scope.js b/node_modules/ajv/dist/compile/codegen/scope.js new file mode 100644 index 000000000..acc5f7626 --- /dev/null +++ b/node_modules/ajv/dist/compile/codegen/scope.js @@ -0,0 +1,143 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0; +const code_1 = require("./code"); +class ValueError extends Error { + constructor(name) { + super(`CodeGen: "code" for ${name} not defined`); + this.value = name.value; + } +} +var UsedValueState; +(function (UsedValueState) { + UsedValueState[UsedValueState["Started"] = 0] = "Started"; + UsedValueState[UsedValueState["Completed"] = 1] = "Completed"; +})(UsedValueState = exports.UsedValueState || (exports.UsedValueState = {})); +exports.varKinds = { + const: new code_1.Name("const"), + let: new code_1.Name("let"), + var: new code_1.Name("var"), +}; +class Scope { + constructor({ prefixes, parent } = {}) { + this._names = {}; + this._prefixes = prefixes; + this._parent = parent; + } + toName(nameOrPrefix) { + return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix); + } + name(prefix) { + return new code_1.Name(this._newName(prefix)); + } + _newName(prefix) { + const ng = this._names[prefix] || this._nameGroup(prefix); + return `${prefix}${ng.index++}`; + } + _nameGroup(prefix) { + var _a, _b; + if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) { + throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`); + } + return (this._names[prefix] = { prefix, index: 0 }); + } +} +exports.Scope = Scope; +class ValueScopeName extends code_1.Name { + constructor(prefix, nameStr) { + super(nameStr); + this.prefix = prefix; + } + setValue(value, { property, itemIndex }) { + this.value = value; + this.scopePath = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`; + } +} +exports.ValueScopeName = ValueScopeName; +const line = (0, code_1._) `\n`; +class ValueScope extends Scope { + constructor(opts) { + super(opts); + this._values = {}; + this._scope = opts.scope; + this.opts = { ...opts, _n: opts.lines ? line : code_1.nil }; + } + get() { + return this._scope; + } + name(prefix) { + return new ValueScopeName(prefix, this._newName(prefix)); + } + value(nameOrPrefix, value) { + var _a; + if (value.ref === undefined) + throw new Error("CodeGen: ref must be passed in value"); + const name = this.toName(nameOrPrefix); + const { prefix } = name; + const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref; + let vs = this._values[prefix]; + if (vs) { + const _name = vs.get(valueKey); + if (_name) + return _name; + } + else { + vs = this._values[prefix] = new Map(); + } + vs.set(valueKey, name); + const s = this._scope[prefix] || (this._scope[prefix] = []); + const itemIndex = s.length; + s[itemIndex] = value.ref; + name.setValue(value, { property: prefix, itemIndex }); + return name; + } + getValue(prefix, keyOrRef) { + const vs = this._values[prefix]; + if (!vs) + return; + return vs.get(keyOrRef); + } + scopeRefs(scopeName, values = this._values) { + return this._reduceValues(values, (name) => { + if (name.scopePath === undefined) + throw new Error(`CodeGen: name "${name}" has no value`); + return (0, code_1._) `${scopeName}${name.scopePath}`; + }); + } + scopeCode(values = this._values, usedValues, getCode) { + return this._reduceValues(values, (name) => { + if (name.value === undefined) + throw new Error(`CodeGen: name "${name}" has no value`); + return name.value.code; + }, usedValues, getCode); + } + _reduceValues(values, valueCode, usedValues = {}, getCode) { + let code = code_1.nil; + for (const prefix in values) { + const vs = values[prefix]; + if (!vs) + continue; + const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map()); + vs.forEach((name) => { + if (nameSet.has(name)) + return; + nameSet.set(name, UsedValueState.Started); + let c = valueCode(name); + if (c) { + const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const; + code = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`; + } + else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) { + code = (0, code_1._) `${code}${c}${this.opts._n}`; + } + else { + throw new ValueError(name); + } + nameSet.set(name, UsedValueState.Completed); + }); + } + return code; + } +} +exports.ValueScope = ValueScope; +//# sourceMappingURL=scope.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/codegen/scope.js.map b/node_modules/ajv/dist/compile/codegen/scope.js.map new file mode 100644 index 000000000..7afde1060 --- /dev/null +++ b/node_modules/ajv/dist/compile/codegen/scope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../lib/compile/codegen/scope.ts"],"names":[],"mappings":";;;AAAA,iCAAyC;AAezC,MAAM,UAAW,SAAQ,KAAK;IAE5B,YAAY,IAAoB;QAC9B,KAAK,CAAC,uBAAuB,IAAI,cAAc,CAAC,CAAA;QAChD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;IACzB,CAAC;CACF;AAuBD,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,yDAAO,CAAA;IACP,6DAAS,CAAA;AACX,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AAMY,QA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AG,CAAC,CAAC,CAAC,gBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAQ,CAAC,KAAK,CAAA;oBACzD,IAAI,GAAG,IAAA,QAAC,EAAA,GAAG,IAAI,GAAG,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAA;iBACvD;qBAAM,IAAI,CAAC,CAAC,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,IAAI,CAAC,CAAC,EAAE;oBAChC,IAAI,GAAG,IAAA,QAAC,EAAA,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAA;iBACrC;qBAAM;oBACL,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA;iBAC3B;gBACD,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;YAC7C,CAAC,CAAC,CAAA;SACH;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAjGD,gCAiGC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/errors.d.ts b/node_modules/ajv/dist/compile/errors.d.ts new file mode 100644 index 000000000..74eef7e21 --- /dev/null +++ b/node_modules/ajv/dist/compile/errors.d.ts @@ -0,0 +1,13 @@ +import type { KeywordErrorCxt, KeywordErrorDefinition } from "../types"; +import { CodeGen, Code, Name } from "./codegen"; +export declare const keywordError: KeywordErrorDefinition; +export declare const keyword$DataError: KeywordErrorDefinition; +export interface ErrorPaths { + instancePath?: Code; + schemaPath?: string; + parentSchema?: boolean; +} +export declare function reportError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, errorPaths?: ErrorPaths, overrideAllErrors?: boolean): void; +export declare function reportExtraError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, errorPaths?: ErrorPaths): void; +export declare function resetErrorsCount(gen: CodeGen, errsCount: Name): void; +export declare function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }: KeywordErrorCxt): void; diff --git a/node_modules/ajv/dist/compile/errors.js b/node_modules/ajv/dist/compile/errors.js new file mode 100644 index 000000000..e2aca7b93 --- /dev/null +++ b/node_modules/ajv/dist/compile/errors.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0; +const codegen_1 = require("./codegen"); +const util_1 = require("./util"); +const names_1 = require("./names"); +exports.keywordError = { + message: ({ keyword }) => (0, codegen_1.str) `must pass "${keyword}" keyword validation`, +}; +exports.keyword$DataError = { + message: ({ keyword, schemaType }) => schemaType + ? (0, codegen_1.str) `"${keyword}" keyword must be ${schemaType} ($data)` + : (0, codegen_1.str) `"${keyword}" keyword is invalid ($data)`, +}; +function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) { + const { it } = cxt; + const { gen, compositeRule, allErrors } = it; + const errObj = errorObjectCode(cxt, error, errorPaths); + if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) { + addError(gen, errObj); + } + else { + returnErrors(it, (0, codegen_1._) `[${errObj}]`); + } +} +exports.reportError = reportError; +function reportExtraError(cxt, error = exports.keywordError, errorPaths) { + const { it } = cxt; + const { gen, compositeRule, allErrors } = it; + const errObj = errorObjectCode(cxt, error, errorPaths); + addError(gen, errObj); + if (!(compositeRule || allErrors)) { + returnErrors(it, names_1.default.vErrors); + } +} +exports.reportExtraError = reportExtraError; +function resetErrorsCount(gen, errsCount) { + gen.assign(names_1.default.errors, errsCount); + gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null))); +} +exports.resetErrorsCount = resetErrorsCount; +function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) { + /* istanbul ignore if */ + if (errsCount === undefined) + throw new Error("ajv implementation error"); + const err = gen.name("err"); + gen.forRange("i", errsCount, names_1.default.errors, (i) => { + gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`); + gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath))); + gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`); + if (it.opts.verbose) { + gen.assign((0, codegen_1._) `${err}.schema`, schemaValue); + gen.assign((0, codegen_1._) `${err}.data`, data); + } + }); +} +exports.extendErrors = extendErrors; +function addError(gen, errObj) { + const err = gen.const("err", errObj); + gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`); + gen.code((0, codegen_1._) `${names_1.default.errors}++`); +} +function returnErrors(it, errs) { + const { gen, validateName, schemaEnv } = it; + if (schemaEnv.$async) { + gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`); + } + else { + gen.assign((0, codegen_1._) `${validateName}.errors`, errs); + gen.return(false); + } +} +const E = { + keyword: new codegen_1.Name("keyword"), + schemaPath: new codegen_1.Name("schemaPath"), + params: new codegen_1.Name("params"), + propertyName: new codegen_1.Name("propertyName"), + message: new codegen_1.Name("message"), + schema: new codegen_1.Name("schema"), + parentSchema: new codegen_1.Name("parentSchema"), +}; +function errorObjectCode(cxt, error, errorPaths) { + const { createErrors } = cxt.it; + if (createErrors === false) + return (0, codegen_1._) `{}`; + return errorObject(cxt, error, errorPaths); +} +function errorObject(cxt, error, errorPaths = {}) { + const { gen, it } = cxt; + const keyValues = [ + errorInstancePath(it, errorPaths), + errorSchemaPath(cxt, errorPaths), + ]; + extraErrorProps(cxt, error, keyValues); + return gen.object(...keyValues); +} +function errorInstancePath({ errorPath }, { instancePath }) { + const instPath = instancePath + ? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` + : errorPath; + return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)]; +} +function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) { + let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`; + if (schemaPath) { + schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`; + } + return [E.schemaPath, schPath]; +} +function extraErrorProps(cxt, { params, message }, keyValues) { + const { keyword, data, schemaValue, it } = cxt; + const { opts, propertyName, topSchemaRef, schemaPath } = it; + keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._) `{}`]); + if (opts.messages) { + keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]); + } + if (opts.verbose) { + keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]); + } + if (propertyName) + keyValues.push([E.propertyName, propertyName]); +} +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/errors.js.map b/node_modules/ajv/dist/compile/errors.js.map new file mode 100644 index 000000000..662089108 --- /dev/null +++ b/node_modules/ajv/dist/compile/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../lib/compile/errors.ts"],"names":[],"mappings":";;;AAEA,uCAAgE;AAEhE,iCAAyC;AACzC,mCAAuB;AAEV,QAAA,YAAY,GAA2B;IAClD,OAAO,EAAE,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,cAAc,OAAO,sBAAsB;CACvE,CAAA;AAEY,QAAA,iBAAiB,GAA2B;IACvD,OAAO,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CACjC,UAAU;QACR,CAAC,CA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AAO,IAAI,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;KACnF;IACD,IAAI,IAAI,CAAC,OAAO,EAAE;QAChB,SAAS,CAAC,IAAI,CACZ,CAAC,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,EACvB,CAAC,CAAC,CAAC,YAAY,EAAE,IAAA,WAAC,EAAA,GAAG,YAAY,GAAG,UAAU,EAAE,CAAC,EACjD,CAAC,eAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CACf,CAAA;KACF;IACD,IAAI,YAAY;QAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;AAClE,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/index.d.ts b/node_modules/ajv/dist/compile/index.d.ts new file mode 100644 index 000000000..2809353d7 --- /dev/null +++ b/node_modules/ajv/dist/compile/index.d.ts @@ -0,0 +1,80 @@ +import type { AnySchema, AnySchemaObject, AnyValidateFunction, EvaluatedProperties, EvaluatedItems } from "../types"; +import type Ajv from "../core"; +import type { InstanceOptions } from "../core"; +import { CodeGen, Name, Code, ValueScopeName } from "./codegen"; +import { LocalRefs } from "./resolve"; +import { JSONType } from "./rules"; +export type SchemaRefs = { + [Ref in string]?: SchemaEnv | AnySchema; +}; +export interface SchemaCxt { + readonly gen: CodeGen; + readonly allErrors?: boolean; + readonly data: Name; + readonly parentData: Name; + readonly parentDataProperty: Code | number; + readonly dataNames: Name[]; + readonly dataPathArr: (Code | number)[]; + readonly dataLevel: number; + dataTypes: JSONType[]; + definedProperties: Set; + readonly topSchemaRef: Code; + readonly validateName: Name; + evaluated?: Name; + readonly ValidationError?: Name; + readonly schema: AnySchema; + readonly schemaEnv: SchemaEnv; + readonly rootId: string; + baseId: string; + readonly schemaPath: Code; + readonly errSchemaPath: string; + readonly errorPath: Code; + readonly propertyName?: Name; + readonly compositeRule?: boolean; + props?: EvaluatedProperties | Name; + items?: EvaluatedItems | Name; + jtdDiscriminator?: string; + jtdMetadata?: boolean; + readonly createErrors?: boolean; + readonly opts: InstanceOptions; + readonly self: Ajv; +} +export interface SchemaObjCxt extends SchemaCxt { + readonly schema: AnySchemaObject; +} +interface SchemaEnvArgs { + readonly schema: AnySchema; + readonly schemaId?: "$id" | "id"; + readonly root?: SchemaEnv; + readonly baseId?: string; + readonly schemaPath?: string; + readonly localRefs?: LocalRefs; + readonly meta?: boolean; +} +export declare class SchemaEnv implements SchemaEnvArgs { + readonly schema: AnySchema; + readonly schemaId?: "$id" | "id"; + readonly root: SchemaEnv; + baseId: string; + schemaPath?: string; + localRefs?: LocalRefs; + readonly meta?: boolean; + readonly $async?: boolean; + readonly refs: SchemaRefs; + readonly dynamicAnchors: { + [Ref in string]?: true; + }; + validate?: AnyValidateFunction; + validateName?: ValueScopeName; + serialize?: (data: unknown) => string; + serializeName?: ValueScopeName; + parse?: (data: string) => unknown; + parseName?: ValueScopeName; + constructor(env: SchemaEnvArgs); +} +export declare function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv; +export declare function resolveRef(this: Ajv, root: SchemaEnv, baseId: string, ref: string): AnySchema | SchemaEnv | undefined; +export declare function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void; +export declare function resolveSchema(this: Ajv, root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it +ref: string): SchemaEnv | undefined; +export {}; diff --git a/node_modules/ajv/dist/compile/index.js b/node_modules/ajv/dist/compile/index.js new file mode 100644 index 000000000..b125ecd02 --- /dev/null +++ b/node_modules/ajv/dist/compile/index.js @@ -0,0 +1,242 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0; +const codegen_1 = require("./codegen"); +const validation_error_1 = require("../runtime/validation_error"); +const names_1 = require("./names"); +const resolve_1 = require("./resolve"); +const util_1 = require("./util"); +const validate_1 = require("./validate"); +class SchemaEnv { + constructor(env) { + var _a; + this.refs = {}; + this.dynamicAnchors = {}; + let schema; + if (typeof env.schema == "object") + schema = env.schema; + this.schema = env.schema; + this.schemaId = env.schemaId; + this.root = env.root || this; + this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]); + this.schemaPath = env.schemaPath; + this.localRefs = env.localRefs; + this.meta = env.meta; + this.$async = schema === null || schema === void 0 ? void 0 : schema.$async; + this.refs = {}; + } +} +exports.SchemaEnv = SchemaEnv; +// let codeSize = 0 +// let nodeCount = 0 +// Compiles schema in SchemaEnv +function compileSchema(sch) { + // TODO refactor - remove compilations + const _sch = getCompilingSchema.call(this, sch); + if (_sch) + return _sch; + const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails + const { es5, lines } = this.opts.code; + const { ownProperties } = this.opts; + const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); + let _ValidationError; + if (sch.$async) { + _ValidationError = gen.scopeValue("Error", { + ref: validation_error_1.default, + code: (0, codegen_1._) `require("ajv/dist/runtime/validation_error").default`, + }); + } + const validateName = gen.scopeName("validate"); + sch.validateName = validateName; + const schemaCxt = { + gen, + allErrors: this.opts.allErrors, + data: names_1.default.data, + parentData: names_1.default.parentData, + parentDataProperty: names_1.default.parentDataProperty, + dataNames: [names_1.default.data], + dataPathArr: [codegen_1.nil], + dataLevel: 0, + dataTypes: [], + definedProperties: new Set(), + topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true + ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) } + : { ref: sch.schema }), + validateName, + ValidationError: _ValidationError, + schema: sch.schema, + schemaEnv: sch, + rootId, + baseId: sch.baseId || rootId, + schemaPath: codegen_1.nil, + errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"), + errorPath: (0, codegen_1._) `""`, + opts: this.opts, + self: this, + }; + let sourceCode; + try { + this._compilations.add(sch); + (0, validate_1.validateFunctionCode)(schemaCxt); + gen.optimize(this.opts.code.optimize); + // gen.optimize(1) + const validateCode = gen.toString(); + sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`; + // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount)) + if (this.opts.code.process) + sourceCode = this.opts.code.process(sourceCode, sch); + // console.log("\n\n\n *** \n", sourceCode) + const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode); + const validate = makeValidate(this, this.scope.get()); + this.scope.value(validateName, { ref: validate }); + validate.errors = null; + validate.schema = sch.schema; + validate.schemaEnv = sch; + if (sch.$async) + validate.$async = true; + if (this.opts.code.source === true) { + validate.source = { validateName, validateCode, scopeValues: gen._values }; + } + if (this.opts.unevaluated) { + const { props, items } = schemaCxt; + validate.evaluated = { + props: props instanceof codegen_1.Name ? undefined : props, + items: items instanceof codegen_1.Name ? undefined : items, + dynamicProps: props instanceof codegen_1.Name, + dynamicItems: items instanceof codegen_1.Name, + }; + if (validate.source) + validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated); + } + sch.validate = validate; + return sch; + } + catch (e) { + delete sch.validate; + delete sch.validateName; + if (sourceCode) + this.logger.error("Error compiling schema, function code:", sourceCode); + // console.log("\n\n\n *** \n", sourceCode, this.opts) + throw e; + } + finally { + this._compilations.delete(sch); + } +} +exports.compileSchema = compileSchema; +function resolveRef(root, baseId, ref) { + var _a; + ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref); + const schOrFunc = root.refs[ref]; + if (schOrFunc) + return schOrFunc; + let _sch = resolve.call(this, root, ref); + if (_sch === undefined) { + const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv + const { schemaId } = this.opts; + if (schema) + _sch = new SchemaEnv({ schema, schemaId, root, baseId }); + } + if (_sch === undefined) + return; + return (root.refs[ref] = inlineOrCompile.call(this, _sch)); +} +exports.resolveRef = resolveRef; +function inlineOrCompile(sch) { + if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs)) + return sch.schema; + return sch.validate ? sch : compileSchema.call(this, sch); +} +// Index of schema compilation in the currently compiled list +function getCompilingSchema(schEnv) { + for (const sch of this._compilations) { + if (sameSchemaEnv(sch, schEnv)) + return sch; + } +} +exports.getCompilingSchema = getCompilingSchema; +function sameSchemaEnv(s1, s2) { + return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; +} +// resolve and compile the references ($ref) +// TODO returns AnySchemaObject (if the schema can be inlined) or validation function +function resolve(root, // information about the root schema for the current schema +ref // reference to resolve +) { + let sch; + while (typeof (sch = this.refs[ref]) == "string") + ref = sch; + return sch || this.schemas[ref] || resolveSchema.call(this, root, ref); +} +// Resolve schema, its root and baseId +function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it +ref // reference to resolve +) { + const p = this.opts.uriResolver.parse(ref); + const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p); + let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined); + // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests + if (Object.keys(root.schema).length > 0 && refPath === baseId) { + return getJsonPointer.call(this, p, root); + } + const id = (0, resolve_1.normalizeId)(refPath); + const schOrRef = this.refs[id] || this.schemas[id]; + if (typeof schOrRef == "string") { + const sch = resolveSchema.call(this, root, schOrRef); + if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") + return; + return getJsonPointer.call(this, p, sch); + } + if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") + return; + if (!schOrRef.validate) + compileSchema.call(this, schOrRef); + if (id === (0, resolve_1.normalizeId)(ref)) { + const { schema } = schOrRef; + const { schemaId } = this.opts; + const schId = schema[schemaId]; + if (schId) + baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); + return new SchemaEnv({ schema, schemaId, root, baseId }); + } + return getJsonPointer.call(this, p, schOrRef); +} +exports.resolveSchema = resolveSchema; +const PREVENT_SCOPE_CHANGE = new Set([ + "properties", + "patternProperties", + "enum", + "dependencies", + "definitions", +]); +function getJsonPointer(parsedRef, { baseId, schema, root }) { + var _a; + if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/") + return; + for (const part of parsedRef.fragment.slice(1).split("/")) { + if (typeof schema === "boolean") + return; + const partSchema = schema[(0, util_1.unescapeFragment)(part)]; + if (partSchema === undefined) + return; + schema = partSchema; + // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? + const schId = typeof schema === "object" && schema[this.opts.schemaId]; + if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { + baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); + } + } + let env; + if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) { + const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref); + env = resolveSchema.call(this, root, $ref); + } + // even though resolution failed we need to return SchemaEnv to throw exception + // so that compileAsync loads missing schema. + const { schemaId } = this.opts; + env = env || new SchemaEnv({ schema, schemaId, root, baseId }); + if (env.schema !== env.root.schema) + return env; + return undefined; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/index.js.map b/node_modules/ajv/dist/compile/index.js.map new file mode 100644 index 000000000..3fd890e67 --- /dev/null +++ b/node_modules/ajv/dist/compile/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/compile/index.ts"],"names":[],"mappings":";;;AAUA,uCAAgF;AAChF,kEAAyD;AACzD,mCAAuB;AACvB,uCAAkG;AAClG,iCAA6D;AAC7D,yCAA+C;AA0D/C,MAAa,SAAS;IAkBpB,YAAY,GAAkB;;QATrB,SAA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A;SAC1D;KACF;IACD,IAAI,GAA0B,CAAA;IAC9B,IAAI,OAAO,MAAM,IAAI,SAAS,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;QAC1F,MAAM,IAAI,GAAG,IAAA,oBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;QACnE,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;KAC3C;IACD,+EAA+E;IAC/E,6CAA6C;IAC7C,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;IAC5B,GAAG,GAAG,GAAG,IAAI,IAAI,SAAS,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC,CAAA;IAC5D,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM;QAAE,OAAO,GAAG,CAAA;IAC9C,OAAO,SAAS,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/jtd/parse.d.ts b/node_modules/ajv/dist/compile/jtd/parse.d.ts new file mode 100644 index 000000000..618c64aea --- /dev/null +++ b/node_modules/ajv/dist/compile/jtd/parse.d.ts @@ -0,0 +1,4 @@ +import type Ajv from "../../core"; +import { SchemaObjectMap } from "./types"; +import { SchemaEnv } from ".."; +export default function compileParser(this: Ajv, sch: SchemaEnv, definitions: SchemaObjectMap): SchemaEnv; diff --git a/node_modules/ajv/dist/compile/jtd/parse.js b/node_modules/ajv/dist/compile/jtd/parse.js new file mode 100644 index 000000000..8fc94fd0e --- /dev/null +++ b/node_modules/ajv/dist/compile/jtd/parse.js @@ -0,0 +1,350 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const types_1 = require("./types"); +const __1 = require(".."); +const codegen_1 = require("../codegen"); +const ref_error_1 = require("../ref_error"); +const names_1 = require("../names"); +const code_1 = require("../../vocabularies/code"); +const ref_1 = require("../../vocabularies/jtd/ref"); +const type_1 = require("../../vocabularies/jtd/type"); +const parseJson_1 = require("../../runtime/parseJson"); +const util_1 = require("../util"); +const timestamp_1 = require("../../runtime/timestamp"); +const genParse = { + elements: parseElements, + values: parseValues, + discriminator: parseDiscriminator, + properties: parseProperties, + optionalProperties: parseProperties, + enum: parseEnum, + type: parseType, + ref: parseRef, +}; +function compileParser(sch, definitions) { + const _sch = __1.getCompilingSchema.call(this, sch); + if (_sch) + return _sch; + const { es5, lines } = this.opts.code; + const { ownProperties } = this.opts; + const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); + const parseName = gen.scopeName("parse"); + const cxt = { + self: this, + gen, + schema: sch.schema, + schemaEnv: sch, + definitions, + data: names_1.default.data, + parseName, + char: gen.name("c"), + }; + let sourceCode; + try { + this._compilations.add(sch); + sch.parseName = parseName; + parserFunction(cxt); + gen.optimize(this.opts.code.optimize); + const parseFuncCode = gen.toString(); + sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${parseFuncCode}`; + const makeParse = new Function(`${names_1.default.scope}`, sourceCode); + const parse = makeParse(this.scope.get()); + this.scope.value(parseName, { ref: parse }); + sch.parse = parse; + } + catch (e) { + if (sourceCode) + this.logger.error("Error compiling parser, function code:", sourceCode); + delete sch.parse; + delete sch.parseName; + throw e; + } + finally { + this._compilations.delete(sch); + } + return sch; +} +exports.default = compileParser; +const undef = (0, codegen_1._) `undefined`; +function parserFunction(cxt) { + const { gen, parseName, char } = cxt; + gen.func(parseName, (0, codegen_1._) `${names_1.default.json}, ${names_1.default.jsonPos}, ${names_1.default.jsonPart}`, false, () => { + gen.let(names_1.default.data); + gen.let(char); + gen.assign((0, codegen_1._) `${parseName}.message`, undef); + gen.assign((0, codegen_1._) `${parseName}.position`, undef); + gen.assign(names_1.default.jsonPos, (0, codegen_1._) `${names_1.default.jsonPos} || 0`); + gen.const(names_1.default.jsonLen, (0, codegen_1._) `${names_1.default.json}.length`); + parseCode(cxt); + skipWhitespace(cxt); + gen.if(names_1.default.jsonPart, () => { + gen.assign((0, codegen_1._) `${parseName}.position`, names_1.default.jsonPos); + gen.return(names_1.default.data); + }); + gen.if((0, codegen_1._) `${names_1.default.jsonPos} === ${names_1.default.jsonLen}`, () => gen.return(names_1.default.data)); + jsonSyntaxError(cxt); + }); +} +function parseCode(cxt) { + let form; + for (const key of types_1.jtdForms) { + if (key in cxt.schema) { + form = key; + break; + } + } + if (form) + parseNullable(cxt, genParse[form]); + else + parseEmpty(cxt); +} +const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError)); +function parseNullable(cxt, parseForm) { + const { gen, schema, data } = cxt; + if (!schema.nullable) + return parseForm(cxt); + tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null)); +} +function parseElements(cxt) { + const { gen, schema, data } = cxt; + parseToken(cxt, "["); + const ix = gen.let("i", 0); + gen.assign(data, (0, codegen_1._) `[]`); + parseItems(cxt, "]", () => { + const el = gen.let("el"); + parseCode({ ...cxt, schema: schema.elements, data: el }); + gen.assign((0, codegen_1._) `${data}[${ix}++]`, el); + }); +} +function parseValues(cxt) { + const { gen, schema, data } = cxt; + parseToken(cxt, "{"); + gen.assign(data, (0, codegen_1._) `{}`); + parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values)); +} +function parseItems(cxt, endToken, block) { + tryParseItems(cxt, endToken, block); + parseToken(cxt, endToken); +} +function tryParseItems(cxt, endToken, block) { + const { gen } = cxt; + gen.for((0, codegen_1._) `;${names_1.default.jsonPos}<${names_1.default.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => { + block(); + tryParseToken(cxt, ",", () => gen.break(), hasItem); + }); + function hasItem() { + tryParseToken(cxt, endToken, () => { }, jsonSyntaxError); + } +} +function parseKeyValue(cxt, schema) { + const { gen } = cxt; + const key = gen.let("key"); + parseString({ ...cxt, data: key }); + parseToken(cxt, ":"); + parsePropertyValue(cxt, key, schema); +} +function parseDiscriminator(cxt) { + const { gen, data, schema } = cxt; + const { discriminator, mapping } = schema; + parseToken(cxt, "{"); + gen.assign(data, (0, codegen_1._) `{}`); + const startPos = gen.const("pos", names_1.default.jsonPos); + const value = gen.let("value"); + const tag = gen.let("tag"); + tryParseItems(cxt, "}", () => { + const key = gen.let("key"); + parseString({ ...cxt, data: key }); + parseToken(cxt, ":"); + gen.if((0, codegen_1._) `${key} === ${discriminator}`, () => { + parseString({ ...cxt, data: tag }); + gen.assign((0, codegen_1._) `${data}[${key}]`, tag); + gen.break(); + }, () => parseEmpty({ ...cxt, data: value }) // can be discarded/skipped + ); + }); + gen.assign(names_1.default.jsonPos, startPos); + gen.if((0, codegen_1._) `${tag} === undefined`); + parsingError(cxt, (0, codegen_1.str) `discriminator tag not found`); + for (const tagValue in mapping) { + gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); + parseSchemaProperties({ ...cxt, schema: mapping[tagValue] }, discriminator); + } + gen.else(); + parsingError(cxt, (0, codegen_1.str) `discriminator value not in schema`); + gen.endIf(); +} +function parseProperties(cxt) { + const { gen, data } = cxt; + parseToken(cxt, "{"); + gen.assign(data, (0, codegen_1._) `{}`); + parseSchemaProperties(cxt); +} +function parseSchemaProperties(cxt, discriminator) { + const { gen, schema, data } = cxt; + const { properties, optionalProperties, additionalProperties } = schema; + parseItems(cxt, "}", () => { + const key = gen.let("key"); + parseString({ ...cxt, data: key }); + parseToken(cxt, ":"); + gen.if(false); + parseDefinedProperty(cxt, key, properties); + parseDefinedProperty(cxt, key, optionalProperties); + if (discriminator) { + gen.elseIf((0, codegen_1._) `${key} === ${discriminator}`); + const tag = gen.let("tag"); + parseString({ ...cxt, data: tag }); // can be discarded, it is already assigned + } + gen.else(); + if (additionalProperties) { + parseEmpty({ ...cxt, data: (0, codegen_1._) `${data}[${key}]` }); + } + else { + parsingError(cxt, (0, codegen_1.str) `property ${key} not allowed`); + } + gen.endIf(); + }); + if (properties) { + const hasProp = (0, code_1.hasPropFunc)(gen); + const allProps = (0, codegen_1.and)(...Object.keys(properties).map((p) => (0, codegen_1._) `${hasProp}.call(${data}, ${p})`)); + gen.if((0, codegen_1.not)(allProps), () => parsingError(cxt, (0, codegen_1.str) `missing required properties`)); + } +} +function parseDefinedProperty(cxt, key, schemas = {}) { + const { gen } = cxt; + for (const prop in schemas) { + gen.elseIf((0, codegen_1._) `${key} === ${prop}`); + parsePropertyValue(cxt, key, schemas[prop]); + } +} +function parsePropertyValue(cxt, key, schema) { + parseCode({ ...cxt, schema, data: (0, codegen_1._) `${cxt.data}[${key}]` }); +} +function parseType(cxt) { + const { gen, schema, data, self } = cxt; + switch (schema.type) { + case "boolean": + parseBoolean(cxt); + break; + case "string": + parseString(cxt); + break; + case "timestamp": { + parseString(cxt); + const vts = (0, util_1.useFunc)(gen, timestamp_1.default); + const { allowDate, parseDate } = self.opts; + const notValid = allowDate ? (0, codegen_1._) `!${vts}(${data}, true)` : (0, codegen_1._) `!${vts}(${data})`; + const fail = parseDate + ? (0, codegen_1.or)(notValid, (0, codegen_1._) `(${data} = new Date(${data}), false)`, (0, codegen_1._) `isNaN(${data}.valueOf())`) + : notValid; + gen.if(fail, () => parsingError(cxt, (0, codegen_1.str) `invalid timestamp`)); + break; + } + case "float32": + case "float64": + parseNumber(cxt); + break; + default: { + const t = schema.type; + if (!self.opts.int32range && (t === "int32" || t === "uint32")) { + parseNumber(cxt, 16); // 2 ** 53 - max safe integer + if (t === "uint32") { + gen.if((0, codegen_1._) `${data} < 0`, () => parsingError(cxt, (0, codegen_1.str) `integer out of range`)); + } + } + else { + const [min, max, maxDigits] = type_1.intRange[t]; + parseNumber(cxt, maxDigits); + gen.if((0, codegen_1._) `${data} < ${min} || ${data} > ${max}`, () => parsingError(cxt, (0, codegen_1.str) `integer out of range`)); + } + } + } +} +function parseString(cxt) { + parseToken(cxt, '"'); + parseWith(cxt, parseJson_1.parseJsonString); +} +function parseEnum(cxt) { + const { gen, data, schema } = cxt; + const enumSch = schema.enum; + parseToken(cxt, '"'); + // TODO loopEnum + gen.if(false); + for (const value of enumSch) { + const valueStr = JSON.stringify(value).slice(1); // remove starting quote + gen.elseIf((0, codegen_1._) `${jsonSlice(valueStr.length)} === ${valueStr}`); + gen.assign(data, (0, codegen_1.str) `${value}`); + gen.add(names_1.default.jsonPos, valueStr.length); + } + gen.else(); + jsonSyntaxError(cxt); + gen.endIf(); +} +function parseNumber(cxt, maxDigits) { + const { gen } = cxt; + skipWhitespace(cxt); + gen.if((0, codegen_1._) `"-0123456789".indexOf(${jsonSlice(1)}) < 0`, () => jsonSyntaxError(cxt), () => parseWith(cxt, parseJson_1.parseJsonNumber, maxDigits)); +} +function parseBooleanToken(bool, fail) { + return (cxt) => { + const { gen, data } = cxt; + tryParseToken(cxt, `${bool}`, () => fail(cxt), () => gen.assign(data, bool)); + }; +} +function parseRef(cxt) { + const { gen, self, definitions, schema, schemaEnv } = cxt; + const { ref } = schema; + const refSchema = definitions[ref]; + if (!refSchema) + throw new ref_error_1.default(self.opts.uriResolver, "", ref, `No definition ${ref}`); + if (!(0, ref_1.hasRef)(refSchema)) + return parseCode({ ...cxt, schema: refSchema }); + const { root } = schemaEnv; + const sch = compileParser.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions); + partialParse(cxt, getParser(gen, sch), true); +} +function getParser(gen, sch) { + return sch.parse + ? gen.scopeValue("parse", { ref: sch.parse }) + : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.parse`; +} +function parseEmpty(cxt) { + parseWith(cxt, parseJson_1.parseJson); +} +function parseWith(cxt, parseFunc, args) { + partialParse(cxt, (0, util_1.useFunc)(cxt.gen, parseFunc), args); +} +function partialParse(cxt, parseFunc, args) { + const { gen, data } = cxt; + gen.assign(data, (0, codegen_1._) `${parseFunc}(${names_1.default.json}, ${names_1.default.jsonPos}${args ? (0, codegen_1._) `, ${args}` : codegen_1.nil})`); + gen.assign(names_1.default.jsonPos, (0, codegen_1._) `${parseFunc}.position`); + gen.if((0, codegen_1._) `${data} === undefined`, () => parsingError(cxt, (0, codegen_1._) `${parseFunc}.message`)); +} +function parseToken(cxt, tok) { + tryParseToken(cxt, tok, jsonSyntaxError); +} +function tryParseToken(cxt, tok, fail, success) { + const { gen } = cxt; + const n = tok.length; + skipWhitespace(cxt); + gen.if((0, codegen_1._) `${jsonSlice(n)} === ${tok}`, () => { + gen.add(names_1.default.jsonPos, n); + success === null || success === void 0 ? void 0 : success(cxt); + }, () => fail(cxt)); +} +function skipWhitespace({ gen, char: c }) { + gen.code((0, codegen_1._) `while((${c}=${names_1.default.json}[${names_1.default.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${names_1.default.jsonPos}++;`); +} +function jsonSlice(len) { + return len === 1 + ? (0, codegen_1._) `${names_1.default.json}[${names_1.default.jsonPos}]` + : (0, codegen_1._) `${names_1.default.json}.slice(${names_1.default.jsonPos}, ${names_1.default.jsonPos}+${len})`; +} +function jsonSyntaxError(cxt) { + parsingError(cxt, (0, codegen_1._) `"unexpected token " + ${names_1.default.json}[${names_1.default.jsonPos}]`); +} +function parsingError({ gen, parseName }, msg) { + gen.assign((0, codegen_1._) `${parseName}.message`, msg); + gen.assign((0, codegen_1._) `${parseName}.position`, names_1.default.jsonPos); + gen.return(undef); +} +//# sourceMappingURL=parse.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/jtd/parse.js.map b/node_modules/ajv/dist/compile/jtd/parse.js.map new file mode 100644 index 000000000..a1e86279d --- /dev/null +++ b/node_modules/ajv/dist/compile/jtd/parse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../lib/compile/jtd/parse.ts"],"names":[],"mappings":";;AAEA,mCAA0D;AAC1D,0BAAgD;AAChD,wCAAmF;AACnF,4CAA0C;AAC1C,oCAAwB;AACxB,kDAAmD;AACnD,oDAAiD;AACjD,sDAA6D;AAC7D,uDAA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,IAAI,eAAC,CAAC,IAAI,IAAI,eAAC,CAAC,OAAO,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,aAAa,CAAC,aAAa,eAAC,CAAC,OAAO,KAAK,CAC7G,CAAA;AACH,CAAC;AAED,SAAS,SAAS,CAAC,GAAkB;IACnC,OAAO,GAAG,KAAK,CAAC;QACd,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,IAAI,IAAI,eAAC,CAAC,OAAO,GAAG;QAC5B,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,IAAI,UAAU,eAAC,CAAC,OAAO,KAAK,eAAC,CAAC,OAAO,IAAI,GAAG,GAAG,CAAA;AAC3D,CAAC;AAED,SAAS,eAAe,CAAC,GAAa;IACpC,YAAY,CAAC,GAAG,EAAE,IAAA,WAAC,EAAA,yBAAyB,eAAC,CAAC,IAAI,IAAI,eAAC,CAAC,OAAO,GAAG,CAAC,CAAA;AACrE,CAAC;AAED,SAAS,YAAY,CAAC,EAAC,GAAG,EAAE,SAAS,EAAW,EAAE,GAAS;IACzD,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,SAAS,UAAU,EAAE,GAAG,CAAC,CAAA;IACxC,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,SAAS,WAAW,EAAE,eAAC,CAAC,OAAO,CAAC,CAAA;IAC/C,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACnB,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/jtd/serialize.d.ts b/node_modules/ajv/dist/compile/jtd/serialize.d.ts new file mode 100644 index 000000000..b0413d716 --- /dev/null +++ b/node_modules/ajv/dist/compile/jtd/serialize.d.ts @@ -0,0 +1,4 @@ +import type Ajv from "../../core"; +import { SchemaObjectMap } from "./types"; +import { SchemaEnv } from ".."; +export default function compileSerializer(this: Ajv, sch: SchemaEnv, definitions: SchemaObjectMap): SchemaEnv; diff --git a/node_modules/ajv/dist/compile/jtd/serialize.js b/node_modules/ajv/dist/compile/jtd/serialize.js new file mode 100644 index 000000000..341c50078 --- /dev/null +++ b/node_modules/ajv/dist/compile/jtd/serialize.js @@ -0,0 +1,229 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const types_1 = require("./types"); +const __1 = require(".."); +const codegen_1 = require("../codegen"); +const ref_error_1 = require("../ref_error"); +const names_1 = require("../names"); +const code_1 = require("../../vocabularies/code"); +const ref_1 = require("../../vocabularies/jtd/ref"); +const util_1 = require("../util"); +const quote_1 = require("../../runtime/quote"); +const genSerialize = { + elements: serializeElements, + values: serializeValues, + discriminator: serializeDiscriminator, + properties: serializeProperties, + optionalProperties: serializeProperties, + enum: serializeString, + type: serializeType, + ref: serializeRef, +}; +function compileSerializer(sch, definitions) { + const _sch = __1.getCompilingSchema.call(this, sch); + if (_sch) + return _sch; + const { es5, lines } = this.opts.code; + const { ownProperties } = this.opts; + const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); + const serializeName = gen.scopeName("serialize"); + const cxt = { + self: this, + gen, + schema: sch.schema, + schemaEnv: sch, + definitions, + data: names_1.default.data, + }; + let sourceCode; + try { + this._compilations.add(sch); + sch.serializeName = serializeName; + gen.func(serializeName, names_1.default.data, false, () => { + gen.let(names_1.default.json, (0, codegen_1.str) ``); + serializeCode(cxt); + gen.return(names_1.default.json); + }); + gen.optimize(this.opts.code.optimize); + const serializeFuncCode = gen.toString(); + sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${serializeFuncCode}`; + const makeSerialize = new Function(`${names_1.default.scope}`, sourceCode); + const serialize = makeSerialize(this.scope.get()); + this.scope.value(serializeName, { ref: serialize }); + sch.serialize = serialize; + } + catch (e) { + if (sourceCode) + this.logger.error("Error compiling serializer, function code:", sourceCode); + delete sch.serialize; + delete sch.serializeName; + throw e; + } + finally { + this._compilations.delete(sch); + } + return sch; +} +exports.default = compileSerializer; +function serializeCode(cxt) { + let form; + for (const key of types_1.jtdForms) { + if (key in cxt.schema) { + form = key; + break; + } + } + serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty); +} +function serializeNullable(cxt, serializeForm) { + const { gen, schema, data } = cxt; + if (!schema.nullable) + return serializeForm(cxt); + gen.if((0, codegen_1._) `${data} === undefined || ${data} === null`, () => gen.add(names_1.default.json, (0, codegen_1._) `"null"`), () => serializeForm(cxt)); +} +function serializeElements(cxt) { + const { gen, schema, data } = cxt; + gen.add(names_1.default.json, (0, codegen_1.str) `[`); + const first = gen.let("first", true); + gen.forOf("el", data, (el) => { + addComma(cxt, first); + serializeCode({ ...cxt, schema: schema.elements, data: el }); + }); + gen.add(names_1.default.json, (0, codegen_1.str) `]`); +} +function serializeValues(cxt) { + const { gen, schema, data } = cxt; + gen.add(names_1.default.json, (0, codegen_1.str) `{`); + const first = gen.let("first", true); + gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first)); + gen.add(names_1.default.json, (0, codegen_1.str) `}`); +} +function serializeKeyValue(cxt, key, schema, first) { + const { gen, data } = cxt; + addComma(cxt, first); + serializeString({ ...cxt, data: key }); + gen.add(names_1.default.json, (0, codegen_1.str) `:`); + const value = gen.const("value", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(key)}`); + serializeCode({ ...cxt, schema, data: value }); +} +function serializeDiscriminator(cxt) { + const { gen, schema, data } = cxt; + const { discriminator } = schema; + gen.add(names_1.default.json, (0, codegen_1.str) `{${JSON.stringify(discriminator)}:`); + const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(discriminator)}`); + serializeString({ ...cxt, data: tag }); + gen.if(false); + for (const tagValue in schema.mapping) { + gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); + const sch = schema.mapping[tagValue]; + serializeSchemaProperties({ ...cxt, schema: sch }, discriminator); + } + gen.endIf(); + gen.add(names_1.default.json, (0, codegen_1.str) `}`); +} +function serializeProperties(cxt) { + const { gen } = cxt; + gen.add(names_1.default.json, (0, codegen_1.str) `{`); + serializeSchemaProperties(cxt); + gen.add(names_1.default.json, (0, codegen_1.str) `}`); +} +function serializeSchemaProperties(cxt, discriminator) { + const { gen, schema, data } = cxt; + const { properties, optionalProperties } = schema; + const props = keys(properties); + const optProps = keys(optionalProperties); + const allProps = allProperties(props.concat(optProps)); + let first = !discriminator; + let firstProp; + for (const key of props) { + if (first) + first = false; + else + gen.add(names_1.default.json, (0, codegen_1.str) `,`); + serializeProperty(key, properties[key], keyValue(key)); + } + if (first) + firstProp = gen.let("first", true); + for (const key of optProps) { + const value = keyValue(key); + gen.if((0, codegen_1.and)((0, codegen_1._) `${value} !== undefined`, (0, code_1.isOwnProperty)(gen, data, key)), () => { + addComma(cxt, firstProp); + serializeProperty(key, optionalProperties[key], value); + }); + } + if (schema.additionalProperties) { + gen.forIn("key", data, (key) => gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp))); + } + function keys(ps) { + return ps ? Object.keys(ps) : []; + } + function allProperties(ps) { + if (discriminator) + ps.push(discriminator); + if (new Set(ps).size !== ps.length) { + throw new Error("JTD: properties/optionalProperties/disciminator overlap"); + } + return ps; + } + function keyValue(key) { + return gen.const("value", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(key)}`); + } + function serializeProperty(key, propSchema, value) { + gen.add(names_1.default.json, (0, codegen_1.str) `${JSON.stringify(key)}:`); + serializeCode({ ...cxt, schema: propSchema, data: value }); + } + function isAdditional(key, ps) { + return ps.length ? (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._) `${key} !== ${p}`)) : true; + } +} +function serializeType(cxt) { + const { gen, schema, data } = cxt; + switch (schema.type) { + case "boolean": + gen.add(names_1.default.json, (0, codegen_1._) `${data} ? "true" : "false"`); + break; + case "string": + serializeString(cxt); + break; + case "timestamp": + gen.if((0, codegen_1._) `${data} instanceof Date`, () => gen.add(names_1.default.json, (0, codegen_1._) `'"' + ${data}.toISOString() + '"'`), () => serializeString(cxt)); + break; + default: + serializeNumber(cxt); + } +} +function serializeString({ gen, data }) { + gen.add(names_1.default.json, (0, codegen_1._) `${(0, util_1.useFunc)(gen, quote_1.default)}(${data})`); +} +function serializeNumber({ gen, data }) { + gen.add(names_1.default.json, (0, codegen_1._) `"" + ${data}`); +} +function serializeRef(cxt) { + const { gen, self, data, definitions, schema, schemaEnv } = cxt; + const { ref } = schema; + const refSchema = definitions[ref]; + if (!refSchema) + throw new ref_error_1.default(self.opts.uriResolver, "", ref, `No definition ${ref}`); + if (!(0, ref_1.hasRef)(refSchema)) + return serializeCode({ ...cxt, schema: refSchema }); + const { root } = schemaEnv; + const sch = compileSerializer.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions); + gen.add(names_1.default.json, (0, codegen_1._) `${getSerialize(gen, sch)}(${data})`); +} +function getSerialize(gen, sch) { + return sch.serialize + ? gen.scopeValue("serialize", { ref: sch.serialize }) + : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.serialize`; +} +function serializeEmpty({ gen, data }) { + gen.add(names_1.default.json, (0, codegen_1._) `JSON.stringify(${data})`); +} +function addComma({ gen }, first) { + if (first) { + gen.if(first, () => gen.assign(first, false), () => gen.add(names_1.default.json, (0, codegen_1.str) `,`)); + } + else { + gen.add(names_1.default.json, (0, codegen_1.str) `,`); + } +} +//# sourceMappingURL=serialize.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/jtd/serialize.js.map b/node_modules/ajv/dist/compile/jtd/serialize.js.map new file mode 100644 index 000000000..8a574d1fd --- /dev/null +++ b/node_modules/ajv/dist/compile/jtd/serialize.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../lib/compile/jtd/serialize.ts"],"names":[],"mappings":";;AAEA,mCAA0D;AAC1D,0BAAgD;AAChD,wCAAwE;AACxE,4CAA0C;AAC1C,oCAAwB;AACxB,kDAAqD;AACrD,oDAAiD;AACjD,kCAA+B;AAC/B,+CAAuC;AAEvC,MAAM,YAAY,GAAkD;IAClE,QAA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EAAE,GAAG,EAAC,CAAC,YAAY,CAAA;AAC3D,CAAC;AAED,SAAS,cAAc,CAAC,EAAC,GAAG,EAAE,IAAI,EAAe;IAC/C,GAAG,CAAC,GAAG,CAAC,eAAC,CAAC,IAAI,EAAE,IAAA,WAAC,EAAA,kBAAkB,IAAI,GAAG,CAAC,CAAA;AAC7C,CAAC;AAED,SAAS,QAAQ,CAAC,EAAC,GAAG,EAAe,EAAE,KAAY;IACjD,IAAI,KAAK,EAAE;QACT,GAAG,CAAC,EAAE,CACJ,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9B,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,eAAC,CAAC,IAAI,EAAE,IAAA,aAAG,EAAA,GAAG,CAAC,CAC9B,CAAA;KACF;SAAM;QACL,GAAG,CAAC,GAAG,CAAC,eAAC,CAAC,IAAI,EAAE,IAAA,aAAG,EAAA,GAAG,CAAC,CAAA;KACxB;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/jtd/types.d.ts b/node_modules/ajv/dist/compile/jtd/types.d.ts new file mode 100644 index 000000000..f131daa55 --- /dev/null +++ b/node_modules/ajv/dist/compile/jtd/types.d.ts @@ -0,0 +1,6 @@ +import type { SchemaObject } from "../../types"; +export type SchemaObjectMap = { + [Ref in string]?: SchemaObject; +}; +export declare const jtdForms: readonly ["elements", "values", "discriminator", "properties", "optionalProperties", "enum", "type", "ref"]; +export type JTDForm = typeof jtdForms[number]; diff --git a/node_modules/ajv/dist/compile/jtd/types.js b/node_modules/ajv/dist/compile/jtd/types.js new file mode 100644 index 000000000..b9c60a90f --- /dev/null +++ b/node_modules/ajv/dist/compile/jtd/types.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.jtdForms = void 0; +exports.jtdForms = [ + "elements", + "values", + "discriminator", + "properties", + "optionalProperties", + "enum", + "type", + "ref", +]; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/jtd/types.js.map b/node_modules/ajv/dist/compile/jtd/types.js.map new file mode 100644 index 000000000..53439e002 --- /dev/null +++ b/node_modules/ajv/dist/compile/jtd/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/compile/jtd/types.ts"],"names":[],"mappings":";;;AAIa,QAAA,QAAQ,GAAG;IACtB,UAAU;IACV,QAAQ;IACR,eAAe;IACf,YAAY;IACZ,oBAAoB;IACpB,MAAM;IACN,MAAM;IACN,KAAK;CACG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/names.d.ts b/node_modules/ajv/dist/compile/names.d.ts new file mode 100644 index 000000000..5740e82c6 --- /dev/null +++ b/node_modules/ajv/dist/compile/names.d.ts @@ -0,0 +1,20 @@ +import { Name } from "./codegen"; +declare const names: { + data: Name; + valCxt: Name; + instancePath: Name; + parentData: Name; + parentDataProperty: Name; + rootData: Name; + dynamicAnchors: Name; + vErrors: Name; + errors: Name; + this: Name; + self: Name; + scope: Name; + json: Name; + jsonPos: Name; + jsonLen: Name; + jsonPart: Name; +}; +export default names; diff --git a/node_modules/ajv/dist/compile/names.js b/node_modules/ajv/dist/compile/names.js new file mode 100644 index 000000000..015334bd5 --- /dev/null +++ b/node_modules/ajv/dist/compile/names.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("./codegen"); +const names = { + // validation function arguments + data: new codegen_1.Name("data"), + // args passed from referencing schema + valCxt: new codegen_1.Name("valCxt"), + instancePath: new codegen_1.Name("instancePath"), + parentData: new codegen_1.Name("parentData"), + parentDataProperty: new codegen_1.Name("parentDataProperty"), + rootData: new codegen_1.Name("rootData"), + dynamicAnchors: new codegen_1.Name("dynamicAnchors"), + // function scoped variables + vErrors: new codegen_1.Name("vErrors"), + errors: new codegen_1.Name("errors"), + this: new codegen_1.Name("this"), + // "globals" + self: new codegen_1.Name("self"), + scope: new codegen_1.Name("scope"), + // JTD serialize/parse name for JSON string and position + json: new codegen_1.Name("json"), + jsonPos: new codegen_1.Name("jsonPos"), + jsonLen: new codegen_1.Name("jsonLen"), + jsonPart: new codegen_1.Name("jsonPart"), +}; +exports.default = names; +//# sourceMappingURL=names.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/names.js.map b/node_modules/ajv/dist/compile/names.js.map new file mode 100644 index 000000000..9bbe8e275 --- /dev/null +++ b/node_modules/ajv/dist/compile/names.js.map @@ -0,0 +1 @@ +{"version":3,"file":"names.js","sourceRoot":"","sources":["../../lib/compile/names.ts"],"names":[],"mappings":";;AAAA,uCAA8B;AAE9B,MAAM,KAAK,GAAG;IACZ,gCAAgC;IAChC,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,sCAAsC;IACtC,MAAM,EAAE,IAAI,cAAI,CAAC,QAAQ,CAAC;IAC1B,YAAY,EAAE,IAAI,cAAI,CAAC,cAAc,CAAC;IACtC,UAAU,EAAE,IAAI,cAAI,CAAC,YAAY,CAAC;IAClC,kBAAkB,EAAE,IAAI,cAAI,CAAC,oBAAoB,CAAC;IAClD,QAAQ,EAAE,IAAI,cAAI,CAAC,UAAU,CAAC;IAC9B,cAAc,EAAE,IAAI,cAAI,CAAC,gBAAgB,CAAC;IAC1C,4BAA4B;IAC5B,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,MAAM,EAAE,IAAI,cAAI,CAAC,QAAQ,CAAC;IAC1B,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,YAAY;IACZ,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,KAAK,EAAE,IAAI,cAAI,CAAC,OAAO,CAAC;IACxB,wDAAwD;IACxD,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,QAAQ,EAAE,IAAI,cAAI,CAAC,UAAU,CAAC;CAC/B,CAAA;AAED,kBAAe,KAAK,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/ref_error.d.ts b/node_modules/ajv/dist/compile/ref_error.d.ts new file mode 100644 index 000000000..43374439e --- /dev/null +++ b/node_modules/ajv/dist/compile/ref_error.d.ts @@ -0,0 +1,6 @@ +import type { UriResolver } from "../types"; +export default class MissingRefError extends Error { + readonly missingRef: string; + readonly missingSchema: string; + constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string); +} diff --git a/node_modules/ajv/dist/compile/ref_error.js b/node_modules/ajv/dist/compile/ref_error.js new file mode 100644 index 000000000..3916dec8a --- /dev/null +++ b/node_modules/ajv/dist/compile/ref_error.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const resolve_1 = require("./resolve"); +class MissingRefError extends Error { + constructor(resolver, baseId, ref, msg) { + super(msg || `can't resolve reference ${ref} from id ${baseId}`); + this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref); + this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef)); + } +} +exports.default = MissingRefError; +//# sourceMappingURL=ref_error.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/ref_error.js.map b/node_modules/ajv/dist/compile/ref_error.js.map new file mode 100644 index 000000000..d13f5f2dd --- /dev/null +++ b/node_modules/ajv/dist/compile/ref_error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ref_error.js","sourceRoot":"","sources":["../../lib/compile/ref_error.ts"],"names":[],"mappings":";;AAAA,uCAA8D;AAG9D,MAAqB,eAAgB,SAAQ,KAAK;IAIhD,YAAY,QAAqB,EAAE,MAAc,EAAE,GAAW,EAAE,GAAY;QAC1E,KAAK,CAAC,GAAG,IAAI,2BAA2B,GAAG,YAAY,MAAM,EAAE,CAAC,CAAA;QAChE,IAAI,CAAC,UAAU,GAAG,IAAA,oBAAU,EAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;QACnD,IAAI,CAAC,aAAa,GAAG,IAAA,qBAAW,EAAC,IAAA,qBAAW,EAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;IAC1E,CAAC;CACF;AATD,kCASC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/resolve.d.ts b/node_modules/ajv/dist/compile/resolve.d.ts new file mode 100644 index 000000000..70ef6ce6a --- /dev/null +++ b/node_modules/ajv/dist/compile/resolve.d.ts @@ -0,0 +1,12 @@ +import type { AnySchema, AnySchemaObject, UriResolver } from "../types"; +import type Ajv from "../ajv"; +import type { URIComponents } from "uri-js"; +export type LocalRefs = { + [Ref in string]?: AnySchemaObject; +}; +export declare function inlineRef(schema: AnySchema, limit?: boolean | number): boolean; +export declare function getFullPath(resolver: UriResolver, id?: string, normalize?: boolean): string; +export declare function _getFullPath(resolver: UriResolver, p: URIComponents): string; +export declare function normalizeId(id: string | undefined): string; +export declare function resolveUrl(resolver: UriResolver, baseId: string, id: string): string; +export declare function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs; diff --git a/node_modules/ajv/dist/compile/resolve.js b/node_modules/ajv/dist/compile/resolve.js new file mode 100644 index 000000000..8b51a20e6 --- /dev/null +++ b/node_modules/ajv/dist/compile/resolve.js @@ -0,0 +1,155 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0; +const util_1 = require("./util"); +const equal = require("fast-deep-equal"); +const traverse = require("json-schema-traverse"); +// TODO refactor to use keyword definitions +const SIMPLE_INLINED = new Set([ + "type", + "format", + "pattern", + "maxLength", + "minLength", + "maxProperties", + "minProperties", + "maxItems", + "minItems", + "maximum", + "minimum", + "uniqueItems", + "multipleOf", + "required", + "enum", + "const", +]); +function inlineRef(schema, limit = true) { + if (typeof schema == "boolean") + return true; + if (limit === true) + return !hasRef(schema); + if (!limit) + return false; + return countKeys(schema) <= limit; +} +exports.inlineRef = inlineRef; +const REF_KEYWORDS = new Set([ + "$ref", + "$recursiveRef", + "$recursiveAnchor", + "$dynamicRef", + "$dynamicAnchor", +]); +function hasRef(schema) { + for (const key in schema) { + if (REF_KEYWORDS.has(key)) + return true; + const sch = schema[key]; + if (Array.isArray(sch) && sch.some(hasRef)) + return true; + if (typeof sch == "object" && hasRef(sch)) + return true; + } + return false; +} +function countKeys(schema) { + let count = 0; + for (const key in schema) { + if (key === "$ref") + return Infinity; + count++; + if (SIMPLE_INLINED.has(key)) + continue; + if (typeof schema[key] == "object") { + (0, util_1.eachItem)(schema[key], (sch) => (count += countKeys(sch))); + } + if (count === Infinity) + return Infinity; + } + return count; +} +function getFullPath(resolver, id = "", normalize) { + if (normalize !== false) + id = normalizeId(id); + const p = resolver.parse(id); + return _getFullPath(resolver, p); +} +exports.getFullPath = getFullPath; +function _getFullPath(resolver, p) { + const serialized = resolver.serialize(p); + return serialized.split("#")[0] + "#"; +} +exports._getFullPath = _getFullPath; +const TRAILING_SLASH_HASH = /#\/?$/; +function normalizeId(id) { + return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; +} +exports.normalizeId = normalizeId; +function resolveUrl(resolver, baseId, id) { + id = normalizeId(id); + return resolver.resolve(baseId, id); +} +exports.resolveUrl = resolveUrl; +const ANCHOR = /^[a-z_][-a-z0-9._]*$/i; +function getSchemaRefs(schema, baseId) { + if (typeof schema == "boolean") + return {}; + const { schemaId, uriResolver } = this.opts; + const schId = normalizeId(schema[schemaId] || baseId); + const baseIds = { "": schId }; + const pathPrefix = getFullPath(uriResolver, schId, false); + const localRefs = {}; + const schemaRefs = new Set(); + traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => { + if (parentJsonPtr === undefined) + return; + const fullPath = pathPrefix + jsonPtr; + let baseId = baseIds[parentJsonPtr]; + if (typeof sch[schemaId] == "string") + baseId = addRef.call(this, sch[schemaId]); + addAnchor.call(this, sch.$anchor); + addAnchor.call(this, sch.$dynamicAnchor); + baseIds[jsonPtr] = baseId; + function addRef(ref) { + // eslint-disable-next-line @typescript-eslint/unbound-method + const _resolve = this.opts.uriResolver.resolve; + ref = normalizeId(baseId ? _resolve(baseId, ref) : ref); + if (schemaRefs.has(ref)) + throw ambiguos(ref); + schemaRefs.add(ref); + let schOrRef = this.refs[ref]; + if (typeof schOrRef == "string") + schOrRef = this.refs[schOrRef]; + if (typeof schOrRef == "object") { + checkAmbiguosRef(sch, schOrRef.schema, ref); + } + else if (ref !== normalizeId(fullPath)) { + if (ref[0] === "#") { + checkAmbiguosRef(sch, localRefs[ref], ref); + localRefs[ref] = sch; + } + else { + this.refs[ref] = fullPath; + } + } + return ref; + } + function addAnchor(anchor) { + if (typeof anchor == "string") { + if (!ANCHOR.test(anchor)) + throw new Error(`invalid anchor "${anchor}"`); + addRef.call(this, `#${anchor}`); + } + } + }); + return localRefs; + function checkAmbiguosRef(sch1, sch2, ref) { + if (sch2 !== undefined && !equal(sch1, sch2)) + throw ambiguos(ref); + } + function ambiguos(ref) { + return new Error(`reference "${ref}" resolves to more than one schema`); + } +} +exports.getSchemaRefs = getSchemaRefs; +//# sourceMappingURL=resolve.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/resolve.js.map b/node_modules/ajv/dist/compile/resolve.js.map new file mode 100644 index 000000000..81f08b0c3 --- /dev/null +++ b/node_modules/ajv/dist/compile/resolve.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../lib/compile/resolve.ts"],"names":[],"mappings":";;;AAGA,iCAA+B;AAC/B,yCAAwC;AACxC,iDAAgD;AAKhD,2CAA2C;AAC3C,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,MAAM;IACN,QAAQ;IACR,SAAS;IACT,WAAW;IACX,WAAW;IACX,e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AAC,IAAI,EAAE,IAAI,MAAM,EAAE,CAAC,CAAA;aAChC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,SAAS,CAAA;IAEhB,SAAS,gBAAgB,CAAC,IAAe,EAAE,IAA2B,EAAE,GAAW;QACjF,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;YAAE,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAA;IACnE,CAAC;IAED,SAAS,QAAQ,CAAC,GAAW;QAC3B,OAAO,IAAI,KAAK,CAAC,cAAc,GAAG,oCAAoC,CAAC,CAAA;IACzE,CAAC;AACH,CAAC;AAxDD,sCAwDC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/rules.d.ts b/node_modules/ajv/dist/compile/rules.d.ts new file mode 100644 index 000000000..d77d68f9c --- /dev/null +++ b/node_modules/ajv/dist/compile/rules.d.ts @@ -0,0 +1,28 @@ +import type { AddedKeywordDefinition } from "../types"; +declare const _jsonTypes: readonly ["string", "number", "integer", "boolean", "null", "object", "array"]; +export type JSONType = typeof _jsonTypes[number]; +export declare function isJSONType(x: unknown): x is JSONType; +type ValidationTypes = { + [K in JSONType]: boolean | RuleGroup | undefined; +}; +export interface ValidationRules { + rules: RuleGroup[]; + post: RuleGroup; + all: { + [Key in string]?: boolean | Rule; + }; + keywords: { + [Key in string]?: boolean; + }; + types: ValidationTypes; +} +export interface RuleGroup { + type?: JSONType; + rules: Rule[]; +} +export interface Rule { + keyword: string; + definition: AddedKeywordDefinition; +} +export declare function getRules(): ValidationRules; +export {}; diff --git a/node_modules/ajv/dist/compile/rules.js b/node_modules/ajv/dist/compile/rules.js new file mode 100644 index 000000000..82a591ff4 --- /dev/null +++ b/node_modules/ajv/dist/compile/rules.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRules = exports.isJSONType = void 0; +const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; +const jsonTypes = new Set(_jsonTypes); +function isJSONType(x) { + return typeof x == "string" && jsonTypes.has(x); +} +exports.isJSONType = isJSONType; +function getRules() { + const groups = { + number: { type: "number", rules: [] }, + string: { type: "string", rules: [] }, + array: { type: "array", rules: [] }, + object: { type: "object", rules: [] }, + }; + return { + types: { ...groups, integer: true, boolean: true, null: true }, + rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object], + post: { rules: [] }, + all: {}, + keywords: {}, + }; +} +exports.getRules = getRules; +//# sourceMappingURL=rules.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/rules.js.map b/node_modules/ajv/dist/compile/rules.js.map new file mode 100644 index 000000000..084c70f82 --- /dev/null +++ b/node_modules/ajv/dist/compile/rules.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../lib/compile/rules.ts"],"names":[],"mappings":";;;AAEA,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAA;AAIjG,MAAM,SAAS,GAAgB,IAAI,GAAG,CAAC,UAAU,CAAC,CAAA;AAElD,SAAgB,UAAU,CAAC,CAAU;IACnC,OAAO,OAAO,CAAC,IAAI,QAAQ,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC;AAFD,gCAEC;AAyBD,SAAgB,QAAQ;IACtB,MAAM,MAAM,GAAgE;QAC1E,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;QACnC,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;QACnC,KAAK,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAC;QACjC,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;KACpC,CAAA;IACD,OAAO;QACL,KAAK,EAAE,EAAC,GAAG,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC;QAC5D,KAAK,EAAE,CAAC,EAAC,KAAK,EAAE,EAAE,EAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;QAC/E,IAAI,EAAE,EAAC,KAAK,EAAE,EAAE,EAAC;QACjB,GAAG,EAAE,EAAE;QACP,QAAQ,EAAE,EAAE;KACb,CAAA;AACH,CAAC;AAdD,4BAcC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/util.d.ts b/node_modules/ajv/dist/compile/util.d.ts new file mode 100644 index 000000000..1ec282aee --- /dev/null +++ b/node_modules/ajv/dist/compile/util.d.ts @@ -0,0 +1,40 @@ +import type { AnySchema, EvaluatedProperties, EvaluatedItems } from "../types"; +import type { SchemaCxt, SchemaObjCxt } from "."; +import { Code, Name, CodeGen } from "./codegen"; +import type { Rule, ValidationRules } from "./rules"; +export declare function toHash(arr: T[]): { + [K in T]?: true; +}; +export declare function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void; +export declare function checkUnknownRules(it: SchemaCxt, schema?: AnySchema): void; +export declare function schemaHasRules(schema: AnySchema, rules: { + [Key in string]?: boolean | Rule; +}): boolean; +export declare function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean; +export declare function schemaRefOrVal({ topSchemaRef, schemaPath }: SchemaObjCxt, schema: unknown, keyword: string, $data?: string | false): Code | number | boolean; +export declare function unescapeFragment(str: string): string; +export declare function escapeFragment(str: string | number): string; +export declare function escapeJsonPointer(str: string | number): string; +export declare function unescapeJsonPointer(str: string): string; +export declare function eachItem(xs: T | T[], f: (x: T) => void): void; +type SomeEvaluated = EvaluatedProperties | EvaluatedItems; +type MergeEvaluatedFunc = (gen: CodeGen, from: Name | T, to: Name | Exclude | undefined, toName?: typeof Name) => Name | T; +interface MergeEvaluated { + props: MergeEvaluatedFunc; + items: MergeEvaluatedFunc; +} +export declare const mergeEvaluated: MergeEvaluated; +export declare function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name; +export declare function setEvaluated(gen: CodeGen, props: Name, ps: { + [K in string]?: true; +}): void; +export declare function useFunc(gen: CodeGen, f: { + code: string; +}): Name; +export declare enum Type { + Num = 0, + Str = 1 +} +export declare function getErrorPath(dataProp: Name | string | number, dataPropType?: Type, jsPropertySyntax?: boolean): Code | string; +export declare function checkStrictMode(it: SchemaCxt, msg: string, mode?: boolean | "log"): void; +export {}; diff --git a/node_modules/ajv/dist/compile/util.js b/node_modules/ajv/dist/compile/util.js new file mode 100644 index 000000000..091ad4c0d --- /dev/null +++ b/node_modules/ajv/dist/compile/util.js @@ -0,0 +1,178 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0; +const codegen_1 = require("./codegen"); +const code_1 = require("./codegen/code"); +// TODO refactor to use Set +function toHash(arr) { + const hash = {}; + for (const item of arr) + hash[item] = true; + return hash; +} +exports.toHash = toHash; +function alwaysValidSchema(it, schema) { + if (typeof schema == "boolean") + return schema; + if (Object.keys(schema).length === 0) + return true; + checkUnknownRules(it, schema); + return !schemaHasRules(schema, it.self.RULES.all); +} +exports.alwaysValidSchema = alwaysValidSchema; +function checkUnknownRules(it, schema = it.schema) { + const { opts, self } = it; + if (!opts.strictSchema) + return; + if (typeof schema === "boolean") + return; + const rules = self.RULES.keywords; + for (const key in schema) { + if (!rules[key]) + checkStrictMode(it, `unknown keyword: "${key}"`); + } +} +exports.checkUnknownRules = checkUnknownRules; +function schemaHasRules(schema, rules) { + if (typeof schema == "boolean") + return !schema; + for (const key in schema) + if (rules[key]) + return true; + return false; +} +exports.schemaHasRules = schemaHasRules; +function schemaHasRulesButRef(schema, RULES) { + if (typeof schema == "boolean") + return !schema; + for (const key in schema) + if (key !== "$ref" && RULES.all[key]) + return true; + return false; +} +exports.schemaHasRulesButRef = schemaHasRulesButRef; +function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) { + if (!$data) { + if (typeof schema == "number" || typeof schema == "boolean") + return schema; + if (typeof schema == "string") + return (0, codegen_1._) `${schema}`; + } + return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`; +} +exports.schemaRefOrVal = schemaRefOrVal; +function unescapeFragment(str) { + return unescapeJsonPointer(decodeURIComponent(str)); +} +exports.unescapeFragment = unescapeFragment; +function escapeFragment(str) { + return encodeURIComponent(escapeJsonPointer(str)); +} +exports.escapeFragment = escapeFragment; +function escapeJsonPointer(str) { + if (typeof str == "number") + return `${str}`; + return str.replace(/~/g, "~0").replace(/\//g, "~1"); +} +exports.escapeJsonPointer = escapeJsonPointer; +function unescapeJsonPointer(str) { + return str.replace(/~1/g, "/").replace(/~0/g, "~"); +} +exports.unescapeJsonPointer = unescapeJsonPointer; +function eachItem(xs, f) { + if (Array.isArray(xs)) { + for (const x of xs) + f(x); + } + else { + f(xs); + } +} +exports.eachItem = eachItem; +function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) { + return (gen, from, to, toName) => { + const res = to === undefined + ? from + : to instanceof codegen_1.Name + ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) + : from instanceof codegen_1.Name + ? (mergeToName(gen, to, from), from) + : mergeValues(from, to); + return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res; + }; +} +exports.mergeEvaluated = { + props: makeMergeEvaluated({ + mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => { + gen.if((0, codegen_1._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._) `${to} || {}`).code((0, codegen_1._) `Object.assign(${to}, ${from})`)); + }), + mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => { + if (from === true) { + gen.assign(to, true); + } + else { + gen.assign(to, (0, codegen_1._) `${to} || {}`); + setEvaluated(gen, to, from); + } + }), + mergeValues: (from, to) => (from === true ? true : { ...from, ...to }), + resultToName: evaluatedPropsToName, + }), + items: makeMergeEvaluated({ + mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)), + mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._) `${to} > ${from} ? ${to} : ${from}`)), + mergeValues: (from, to) => (from === true ? true : Math.max(from, to)), + resultToName: (gen, items) => gen.var("items", items), + }), +}; +function evaluatedPropsToName(gen, ps) { + if (ps === true) + return gen.var("props", true); + const props = gen.var("props", (0, codegen_1._) `{}`); + if (ps !== undefined) + setEvaluated(gen, props, ps); + return props; +} +exports.evaluatedPropsToName = evaluatedPropsToName; +function setEvaluated(gen, props, ps) { + Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true)); +} +exports.setEvaluated = setEvaluated; +const snippets = {}; +function useFunc(gen, f) { + return gen.scopeValue("func", { + ref: f, + code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)), + }); +} +exports.useFunc = useFunc; +var Type; +(function (Type) { + Type[Type["Num"] = 0] = "Num"; + Type[Type["Str"] = 1] = "Str"; +})(Type = exports.Type || (exports.Type = {})); +function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { + // let path + if (dataProp instanceof codegen_1.Name) { + const isNumber = dataPropType === Type.Num; + return jsPropertySyntax + ? isNumber + ? (0, codegen_1._) `"[" + ${dataProp} + "]"` + : (0, codegen_1._) `"['" + ${dataProp} + "']"` + : isNumber + ? (0, codegen_1._) `"/" + ${dataProp}` + : (0, codegen_1._) `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer + } + return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp); +} +exports.getErrorPath = getErrorPath; +function checkStrictMode(it, msg, mode = it.opts.strictSchema) { + if (!mode) + return; + msg = `strict mode: ${msg}`; + if (mode === true) + throw new Error(msg); + it.self.logger.warn(msg); +} +exports.checkStrictMode = checkStrictMode; +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/util.js.map b/node_modules/ajv/dist/compile/util.js.map new file mode 100644 index 000000000..a2128fc39 --- /dev/null +++ b/node_modules/ajv/dist/compile/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../lib/compile/util.ts"],"names":[],"mappings":";;;AAEA,uCAA6D;AAC7D,yCAAoC;AAGpC,2BAA2B;AAC3B,SAAgB,MAAM,CAA4B,GAAQ;IACxD,MAAM,IAAI,GAAsB,EAAE,CAAA;IAClC,KAAK,MAAM,IAAI,IAAI,GAAG;QAAE,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACzC,OAAO,IAAI,CAAA;AACb,CAAC;AAJD,wBAIC;AAED,SAAgB,iBAAiB,CAAC,EAAa,EAAE,MAAiB;IAChE,IAAI,OAAO,MAAM,IAAI,SAAS;QAAE,OAAO,MAAM,CAAA;IAC7C,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IACjD,iBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;IAC7B,OAAO,C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wB,EAAE,CAAC,IAAI,CAAC,YAAY;IAE5C,IAAI,CAAC,IAAI;QAAE,OAAM;IACjB,GAAG,GAAG,gBAAgB,GAAG,EAAE,CAAA;IAC3B,IAAI,IAAI,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAA;IACvC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AATD,0CASC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/applicability.d.ts b/node_modules/ajv/dist/compile/validate/applicability.d.ts new file mode 100644 index 000000000..165d375dc --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/applicability.d.ts @@ -0,0 +1,6 @@ +import type { AnySchemaObject } from "../../types"; +import type { SchemaObjCxt } from ".."; +import type { JSONType, RuleGroup, Rule } from "../rules"; +export declare function schemaHasRulesForType({ schema, self }: SchemaObjCxt, type: JSONType): boolean | undefined; +export declare function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean; +export declare function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined; diff --git a/node_modules/ajv/dist/compile/validate/applicability.js b/node_modules/ajv/dist/compile/validate/applicability.js new file mode 100644 index 000000000..6187dbbee --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/applicability.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0; +function schemaHasRulesForType({ schema, self }, type) { + const group = self.RULES.types[type]; + return group && group !== true && shouldUseGroup(schema, group); +} +exports.schemaHasRulesForType = schemaHasRulesForType; +function shouldUseGroup(schema, group) { + return group.rules.some((rule) => shouldUseRule(schema, rule)); +} +exports.shouldUseGroup = shouldUseGroup; +function shouldUseRule(schema, rule) { + var _a; + return (schema[rule.keyword] !== undefined || + ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined))); +} +exports.shouldUseRule = shouldUseRule; +//# sourceMappingURL=applicability.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/applicability.js.map b/node_modules/ajv/dist/compile/validate/applicability.js.map new file mode 100644 index 000000000..450cfe75a --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/applicability.js.map @@ -0,0 +1 @@ +{"version":3,"file":"applicability.js","sourceRoot":"","sources":["../../../lib/compile/validate/applicability.ts"],"names":[],"mappings":";;;AAIA,SAAgB,qBAAqB,CACnC,EAAC,MAAM,EAAE,IAAI,EAAe,EAC5B,IAAc;IAEd,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACpC,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,IAAI,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AACjE,CAAC;AAND,sDAMC;AAED,SAAgB,cAAc,CAAC,MAAuB,EAAE,KAAgB;IACtE,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;AAChE,CAAC;AAFD,wCAEC;AAED,SAAgB,aAAa,CAAC,MAAuB,EAAE,IAAU;;IAC/D,OAAO,CACL,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,SAAS;SAClC,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,0CAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAA,CACrE,CAAA;AACH,CAAC;AALD,sCAKC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/boolSchema.d.ts b/node_modules/ajv/dist/compile/validate/boolSchema.d.ts new file mode 100644 index 000000000..0ce795201 --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/boolSchema.d.ts @@ -0,0 +1,4 @@ +import type { SchemaCxt } from ".."; +import { Name } from "../codegen"; +export declare function topBoolOrEmptySchema(it: SchemaCxt): void; +export declare function boolOrEmptySchema(it: SchemaCxt, valid: Name): void; diff --git a/node_modules/ajv/dist/compile/validate/boolSchema.js b/node_modules/ajv/dist/compile/validate/boolSchema.js new file mode 100644 index 000000000..8eeb7b5ee --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/boolSchema.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0; +const errors_1 = require("../errors"); +const codegen_1 = require("../codegen"); +const names_1 = require("../names"); +const boolError = { + message: "boolean schema is false", +}; +function topBoolOrEmptySchema(it) { + const { gen, schema, validateName } = it; + if (schema === false) { + falseSchemaError(it, false); + } + else if (typeof schema == "object" && schema.$async === true) { + gen.return(names_1.default.data); + } + else { + gen.assign((0, codegen_1._) `${validateName}.errors`, null); + gen.return(true); + } +} +exports.topBoolOrEmptySchema = topBoolOrEmptySchema; +function boolOrEmptySchema(it, valid) { + const { gen, schema } = it; + if (schema === false) { + gen.var(valid, false); // TODO var + falseSchemaError(it); + } + else { + gen.var(valid, true); // TODO var + } +} +exports.boolOrEmptySchema = boolOrEmptySchema; +function falseSchemaError(it, overrideAllErrors) { + const { gen, data } = it; + // TODO maybe some other interface should be used for non-keyword validation errors... + const cxt = { + gen, + keyword: "false schema", + data, + schema: false, + schemaCode: false, + schemaValue: false, + params: {}, + it, + }; + (0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors); +} +//# sourceMappingURL=boolSchema.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/boolSchema.js.map b/node_modules/ajv/dist/compile/validate/boolSchema.js.map new file mode 100644 index 000000000..4aa6c99a6 --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/boolSchema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"boolSchema.js","sourceRoot":"","sources":["../../../lib/compile/validate/boolSchema.ts"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AAU,EAAE,KAAK;QACjB,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,EAAE;QACV,EAAE;KACH,CAAA;IACD,IAAA,oBAAW,EAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAA;AAC3D,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/dataType.d.ts b/node_modules/ajv/dist/compile/validate/dataType.d.ts new file mode 100644 index 000000000..91a6194ae --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/dataType.d.ts @@ -0,0 +1,17 @@ +import type { ErrorObject, AnySchemaObject } from "../../types"; +import type { SchemaObjCxt } from ".."; +import { JSONType } from "../rules"; +import { Code, Name } from "../codegen"; +export declare enum DataType { + Correct = 0, + Wrong = 1 +} +export declare function getSchemaTypes(schema: AnySchemaObject): JSONType[]; +export declare function getJSONTypes(ts: unknown | unknown[]): JSONType[]; +export declare function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean; +export declare function checkDataType(dataType: JSONType, data: Name, strictNums?: boolean | "log", correct?: DataType): Code; +export declare function checkDataTypes(dataTypes: JSONType[], data: Name, strictNums?: boolean | "log", correct?: DataType): Code; +export type TypeError = ErrorObject<"type", { + type: string; +}>; +export declare function reportTypeError(it: SchemaObjCxt): void; diff --git a/node_modules/ajv/dist/compile/validate/dataType.js b/node_modules/ajv/dist/compile/validate/dataType.js new file mode 100644 index 000000000..1732d4666 --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/dataType.js @@ -0,0 +1,202 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0; +const rules_1 = require("../rules"); +const applicability_1 = require("./applicability"); +const errors_1 = require("../errors"); +const codegen_1 = require("../codegen"); +const util_1 = require("../util"); +var DataType; +(function (DataType) { + DataType[DataType["Correct"] = 0] = "Correct"; + DataType[DataType["Wrong"] = 1] = "Wrong"; +})(DataType = exports.DataType || (exports.DataType = {})); +function getSchemaTypes(schema) { + const types = getJSONTypes(schema.type); + const hasNull = types.includes("null"); + if (hasNull) { + if (schema.nullable === false) + throw new Error("type: null contradicts nullable: false"); + } + else { + if (!types.length && schema.nullable !== undefined) { + throw new Error('"nullable" cannot be used without "type"'); + } + if (schema.nullable === true) + types.push("null"); + } + return types; +} +exports.getSchemaTypes = getSchemaTypes; +function getJSONTypes(ts) { + const types = Array.isArray(ts) ? ts : ts ? [ts] : []; + if (types.every(rules_1.isJSONType)) + return types; + throw new Error("type must be JSONType or JSONType[]: " + types.join(",")); +} +exports.getJSONTypes = getJSONTypes; +function coerceAndCheckDataType(it, types) { + const { gen, data, opts } = it; + const coerceTo = coerceToTypes(types, opts.coerceTypes); + const checkTypes = types.length > 0 && + !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0])); + if (checkTypes) { + const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong); + gen.if(wrongType, () => { + if (coerceTo.length) + coerceData(it, types, coerceTo); + else + reportTypeError(it); + }); + } + return checkTypes; +} +exports.coerceAndCheckDataType = coerceAndCheckDataType; +const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]); +function coerceToTypes(types, coerceTypes) { + return coerceTypes + ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array")) + : []; +} +function coerceData(it, types, coerceTo) { + const { gen, data, opts } = it; + const dataType = gen.let("dataType", (0, codegen_1._) `typeof ${data}`); + const coerced = gen.let("coerced", (0, codegen_1._) `undefined`); + if (opts.coerceTypes === "array") { + gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen + .assign(data, (0, codegen_1._) `${data}[0]`) + .assign(dataType, (0, codegen_1._) `typeof ${data}`) + .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data))); + } + gen.if((0, codegen_1._) `${coerced} !== undefined`); + for (const t of coerceTo) { + if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) { + coerceSpecificType(t); + } + } + gen.else(); + reportTypeError(it); + gen.endIf(); + gen.if((0, codegen_1._) `${coerced} !== undefined`, () => { + gen.assign(data, coerced); + assignParentData(it, coerced); + }); + function coerceSpecificType(t) { + switch (t) { + case "string": + gen + .elseIf((0, codegen_1._) `${dataType} == "number" || ${dataType} == "boolean"`) + .assign(coerced, (0, codegen_1._) `"" + ${data}`) + .elseIf((0, codegen_1._) `${data} === null`) + .assign(coerced, (0, codegen_1._) `""`); + return; + case "number": + gen + .elseIf((0, codegen_1._) `${dataType} == "boolean" || ${data} === null + || (${dataType} == "string" && ${data} && ${data} == +${data})`) + .assign(coerced, (0, codegen_1._) `+${data}`); + return; + case "integer": + gen + .elseIf((0, codegen_1._) `${dataType} === "boolean" || ${data} === null + || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`) + .assign(coerced, (0, codegen_1._) `+${data}`); + return; + case "boolean": + gen + .elseIf((0, codegen_1._) `${data} === "false" || ${data} === 0 || ${data} === null`) + .assign(coerced, false) + .elseIf((0, codegen_1._) `${data} === "true" || ${data} === 1`) + .assign(coerced, true); + return; + case "null": + gen.elseIf((0, codegen_1._) `${data} === "" || ${data} === 0 || ${data} === false`); + gen.assign(coerced, null); + return; + case "array": + gen + .elseIf((0, codegen_1._) `${dataType} === "string" || ${dataType} === "number" + || ${dataType} === "boolean" || ${data} === null`) + .assign(coerced, (0, codegen_1._) `[${data}]`); + } + } +} +function assignParentData({ gen, parentData, parentDataProperty }, expr) { + // TODO use gen.property + gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr)); +} +function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { + const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ; + let cond; + switch (dataType) { + case "null": + return (0, codegen_1._) `${data} ${EQ} null`; + case "array": + cond = (0, codegen_1._) `Array.isArray(${data})`; + break; + case "object": + cond = (0, codegen_1._) `${data} && typeof ${data} == "object" && !Array.isArray(${data})`; + break; + case "integer": + cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`); + break; + case "number": + cond = numCond(); + break; + default: + return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`; + } + return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond); + function numCond(_cond = codegen_1.nil) { + return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._) `isFinite(${data})` : codegen_1.nil); + } +} +exports.checkDataType = checkDataType; +function checkDataTypes(dataTypes, data, strictNums, correct) { + if (dataTypes.length === 1) { + return checkDataType(dataTypes[0], data, strictNums, correct); + } + let cond; + const types = (0, util_1.toHash)(dataTypes); + if (types.array && types.object) { + const notObj = (0, codegen_1._) `typeof ${data} != "object"`; + cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`; + delete types.null; + delete types.array; + delete types.object; + } + else { + cond = codegen_1.nil; + } + if (types.number) + delete types.integer; + for (const t in types) + cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct)); + return cond; +} +exports.checkDataTypes = checkDataTypes; +const typeError = { + message: ({ schema }) => `must be ${schema}`, + params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`, +}; +function reportTypeError(it) { + const cxt = getTypeErrorContext(it); + (0, errors_1.reportError)(cxt, typeError); +} +exports.reportTypeError = reportTypeError; +function getTypeErrorContext(it) { + const { gen, data, schema } = it; + const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type"); + return { + gen, + keyword: "type", + data, + schema: schema.type, + schemaCode, + schemaValue: schemaCode, + parentSchema: schema, + params: {}, + it, + }; +} +//# sourceMappingURL=dataType.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/dataType.js.map b/node_modules/ajv/dist/compile/validate/dataType.js.map new file mode 100644 index 000000000..f19c40bc9 --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/dataType.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dataType.js","sourceRoot":"","sources":["../../../lib/compile/validate/dataType.ts"],"names":[],"mappings":";;;AAOA,oCAA6C;AAC7C,mDAAqD;AACrD,sCAAqC;AACrC,wCAAkE;AAClE,kCAA8C;AAE9C,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,6CAAO,CAAA;IACP,yCAAK,CAAA;AACP,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,SAAgB,cAAc,CAAC,MAAuB;IACpD,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACvC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACtC,IAAI,OAAO,EAAE;QACX,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;KACzF;SAAM;QACL,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE;YAClD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;SAC5D;QACD,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KACjD;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAZD,wCAYC;AAED,SAAgB,YAAY,CAAC,EAAuB;IAClD,MAAM,KAAK,GAAc,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAChE,IAAI,KAAK,CAAC,KAAK,CAAC,kBAAU,CAAC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AC,CAAA;IACnC,IAAA,oBAAW,EAAC,GAAG,EAAE,SAAS,CAAC,CAAA;AAC7B,CAAC;AAHD,0CAGC;AAED,SAAS,mBAAmB,CAAC,EAAgB;IAC3C,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAC,GAAG,EAAE,CAAA;IAC9B,MAAM,UAAU,GAAG,IAAA,qBAAc,EAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACrD,OAAO;QACL,GAAG;QACH,OAAO,EAAE,MAAM;QACf,IAAI;QACJ,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,UAAU;QACV,WAAW,EAAE,UAAU;QACvB,YAAY,EAAE,MAAM;QACpB,MAAM,EAAE,EAAE;QACV,EAAE;KACH,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/defaults.d.ts b/node_modules/ajv/dist/compile/validate/defaults.d.ts new file mode 100644 index 000000000..02ba453b2 --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/defaults.d.ts @@ -0,0 +1,2 @@ +import type { SchemaObjCxt } from ".."; +export declare function assignDefaults(it: SchemaObjCxt, ty?: string): void; diff --git a/node_modules/ajv/dist/compile/validate/defaults.js b/node_modules/ajv/dist/compile/validate/defaults.js new file mode 100644 index 000000000..cd9c42d9a --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/defaults.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assignDefaults = void 0; +const codegen_1 = require("../codegen"); +const util_1 = require("../util"); +function assignDefaults(it, ty) { + const { properties, items } = it.schema; + if (ty === "object" && properties) { + for (const key in properties) { + assignDefault(it, key, properties[key].default); + } + } + else if (ty === "array" && Array.isArray(items)) { + items.forEach((sch, i) => assignDefault(it, i, sch.default)); + } +} +exports.assignDefaults = assignDefaults; +function assignDefault(it, prop, defaultValue) { + const { gen, compositeRule, data, opts } = it; + if (defaultValue === undefined) + return; + const childData = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(prop)}`; + if (compositeRule) { + (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`); + return; + } + let condition = (0, codegen_1._) `${childData} === undefined`; + if (opts.useDefaults === "empty") { + condition = (0, codegen_1._) `${condition} || ${childData} === null || ${childData} === ""`; + } + // `${childData} === undefined` + + // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "") + gen.if(condition, (0, codegen_1._) `${childData} = ${(0, codegen_1.stringify)(defaultValue)}`); +} +//# sourceMappingURL=defaults.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/defaults.js.map b/node_modules/ajv/dist/compile/validate/defaults.js.map new file mode 100644 index 000000000..c435d0578 --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/defaults.js.map @@ -0,0 +1 @@ +{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../lib/compile/validate/defaults.ts"],"names":[],"mappings":";;;AACA,wCAAoD;AACpD,kCAAuC;AAEvC,SAAgB,cAAc,CAAC,EAAgB,EAAE,EAAW;IAC1D,MAAM,EAAC,UAAU,EAAE,KAAK,EAAC,GAAG,EAAE,CAAC,MAAM,CAAA;IACrC,IAAI,EAAE,KAAK,QAAQ,IAAI,UAAU,EAAE;QACjC,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;YAC5B,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAA;SAChD;KACF;SAAM,IAAI,EAAE,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;KACrE;AACH,CAAC;AATD,wCASC;AAED,SAAS,aAAa,CAAC,EAAgB,EAAE,IAAqB,EAAE,YAAqB;IACnF,MAAM,EAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;IAC3C,IAAI,YAAY,KAAK,SAAS;QAAE,OAAM;IACtC,MAAM,SAAS,GAAG,IAAA,WAAC,EAAA,GAAG,IAAI,GAAG,IAAA,qBAAW,EAAC,IAAI,CAAC,EAAE,CAAA;IAChD,IAAI,aAAa,EAAE;QACjB,IAAA,sBAAe,EAAC,EAAE,EAAE,2BAA2B,SAAS,EAAE,CAAC,CAAA;QAC3D,OAAM;KACP;IAED,IAAI,SAAS,GAAG,IAAA,WAAC,EAAA,GAAG,SAAS,gBAAgB,CAAA;IAC7C,IAAI,IAAI,CAAC,WAAW,KAAK,OAAO,EAAE;QAChC,SAAS,GAAG,IAAA,WAAC,EAAA,GAAG,SAAS,OAAO,SAAS,gBAAgB,SAAS,SAAS,CAAA;KAC5E;IACD,iCAAiC;IACjC,2FAA2F;IAC3F,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,IAAA,WAAC,EAAA,GAAG,SAAS,MAAM,IAAA,mBAAS,EAAC,YAAY,CAAC,EAAE,CAAC,CAAA;AACjE,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/index.d.ts b/node_modules/ajv/dist/compile/validate/index.d.ts new file mode 100644 index 000000000..6c533ed72 --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/index.d.ts @@ -0,0 +1,42 @@ +import type { AddedKeywordDefinition, AnySchemaObject, KeywordErrorCxt, KeywordCxtParams } from "../../types"; +import type { SchemaCxt, SchemaObjCxt } from ".."; +import { SubschemaArgs } from "./subschema"; +import { Code, Name, CodeGen } from "../codegen"; +import type { JSONType } from "../rules"; +import { ErrorPaths } from "../errors"; +export declare function validateFunctionCode(it: SchemaCxt): void; +export declare class KeywordCxt implements KeywordErrorCxt { + readonly gen: CodeGen; + readonly allErrors?: boolean; + readonly keyword: string; + readonly data: Name; + readonly $data?: string | false; + schema: any; + readonly schemaValue: Code | number | boolean; + readonly schemaCode: Code | number | boolean; + readonly schemaType: JSONType[]; + readonly parentSchema: AnySchemaObject; + readonly errsCount?: Name; + params: KeywordCxtParams; + readonly it: SchemaObjCxt; + readonly def: AddedKeywordDefinition; + constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string); + result(condition: Code, successAction?: () => void, failAction?: () => void): void; + failResult(condition: Code, successAction?: () => void, failAction?: () => void): void; + pass(condition: Code, failAction?: () => void): void; + fail(condition?: Code): void; + fail$data(condition: Code): void; + error(append?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void; + private _error; + $dataError(): void; + reset(): void; + ok(cond: Code | boolean): void; + setParams(obj: KeywordCxtParams, assign?: true): void; + block$data(valid: Name, codeBlock: () => void, $dataValid?: Code): void; + check$data(valid?: Name, $dataValid?: Code): void; + invalid$data(): Code; + subschema(appl: SubschemaArgs, valid: Name): SchemaCxt; + mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void; + mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void; +} +export declare function getData($data: string, { dataLevel, dataNames, dataPathArr }: SchemaCxt): Code | number; diff --git a/node_modules/ajv/dist/compile/validate/index.js b/node_modules/ajv/dist/compile/validate/index.js new file mode 100644 index 000000000..0d683322a --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/index.js @@ -0,0 +1,520 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0; +const boolSchema_1 = require("./boolSchema"); +const dataType_1 = require("./dataType"); +const applicability_1 = require("./applicability"); +const dataType_2 = require("./dataType"); +const defaults_1 = require("./defaults"); +const keyword_1 = require("./keyword"); +const subschema_1 = require("./subschema"); +const codegen_1 = require("../codegen"); +const names_1 = require("../names"); +const resolve_1 = require("../resolve"); +const util_1 = require("../util"); +const errors_1 = require("../errors"); +// schema compilation - generates validation function, subschemaCode (below) is used for subschemas +function validateFunctionCode(it) { + if (isSchemaObj(it)) { + checkKeywords(it); + if (schemaCxtHasRules(it)) { + topSchemaObjCode(it); + return; + } + } + validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it)); +} +exports.validateFunctionCode = validateFunctionCode; +function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) { + if (opts.code.es5) { + gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => { + gen.code((0, codegen_1._) `"use strict"; ${funcSourceUrl(schema, opts)}`); + destructureValCxtES5(gen, opts); + gen.code(body); + }); + } + else { + gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body)); + } +} +function destructureValCxt(opts) { + return (0, codegen_1._) `{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._) `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`; +} +function destructureValCxtES5(gen, opts) { + gen.if(names_1.default.valCxt, () => { + gen.var(names_1.default.instancePath, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.instancePath}`); + gen.var(names_1.default.parentData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentData}`); + gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`); + gen.var(names_1.default.rootData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.rootData}`); + if (opts.dynamicRef) + gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`); + }, () => { + gen.var(names_1.default.instancePath, (0, codegen_1._) `""`); + gen.var(names_1.default.parentData, (0, codegen_1._) `undefined`); + gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `undefined`); + gen.var(names_1.default.rootData, names_1.default.data); + if (opts.dynamicRef) + gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `{}`); + }); +} +function topSchemaObjCode(it) { + const { schema, opts, gen } = it; + validateFunction(it, () => { + if (opts.$comment && schema.$comment) + commentKeyword(it); + checkNoDefault(it); + gen.let(names_1.default.vErrors, null); + gen.let(names_1.default.errors, 0); + if (opts.unevaluated) + resetEvaluated(it); + typeAndKeywords(it); + returnResults(it); + }); + return; +} +function resetEvaluated(it) { + // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated + const { gen, validateName } = it; + it.evaluated = gen.const("evaluated", (0, codegen_1._) `${validateName}.evaluated`); + gen.if((0, codegen_1._) `${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._) `${it.evaluated}.props`, (0, codegen_1._) `undefined`)); + gen.if((0, codegen_1._) `${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._) `${it.evaluated}.items`, (0, codegen_1._) `undefined`)); +} +function funcSourceUrl(schema, opts) { + const schId = typeof schema == "object" && schema[opts.schemaId]; + return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._) `/*# sourceURL=${schId} */` : codegen_1.nil; +} +// schema compilation - this function is used recursively to generate code for sub-schemas +function subschemaCode(it, valid) { + if (isSchemaObj(it)) { + checkKeywords(it); + if (schemaCxtHasRules(it)) { + subSchemaObjCode(it, valid); + return; + } + } + (0, boolSchema_1.boolOrEmptySchema)(it, valid); +} +function schemaCxtHasRules({ schema, self }) { + if (typeof schema == "boolean") + return !schema; + for (const key in schema) + if (self.RULES.all[key]) + return true; + return false; +} +function isSchemaObj(it) { + return typeof it.schema != "boolean"; +} +function subSchemaObjCode(it, valid) { + const { schema, gen, opts } = it; + if (opts.$comment && schema.$comment) + commentKeyword(it); + updateContext(it); + checkAsyncSchema(it); + const errsCount = gen.const("_errs", names_1.default.errors); + typeAndKeywords(it, errsCount); + // TODO var + gen.var(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); +} +function checkKeywords(it) { + (0, util_1.checkUnknownRules)(it); + checkRefsAndKeywords(it); +} +function typeAndKeywords(it, errsCount) { + if (it.opts.jtd) + return schemaKeywords(it, [], false, errsCount); + const types = (0, dataType_1.getSchemaTypes)(it.schema); + const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types); + schemaKeywords(it, types, !checkedTypes, errsCount); +} +function checkRefsAndKeywords(it) { + const { schema, errSchemaPath, opts, self } = it; + if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) { + self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`); + } +} +function checkNoDefault(it) { + const { schema, opts } = it; + if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) { + (0, util_1.checkStrictMode)(it, "default is ignored in the schema root"); + } +} +function updateContext(it) { + const schId = it.schema[it.opts.schemaId]; + if (schId) + it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId); +} +function checkAsyncSchema(it) { + if (it.schema.$async && !it.schemaEnv.$async) + throw new Error("async schema in sync schema"); +} +function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) { + const msg = schema.$comment; + if (opts.$comment === true) { + gen.code((0, codegen_1._) `${names_1.default.self}.logger.log(${msg})`); + } + else if (typeof opts.$comment == "function") { + const schemaPath = (0, codegen_1.str) `${errSchemaPath}/$comment`; + const rootName = gen.scopeValue("root", { ref: schemaEnv.root }); + gen.code((0, codegen_1._) `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`); + } +} +function returnResults(it) { + const { gen, schemaEnv, validateName, ValidationError, opts } = it; + if (schemaEnv.$async) { + // TODO assign unevaluated + gen.if((0, codegen_1._) `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._) `new ${ValidationError}(${names_1.default.vErrors})`)); + } + else { + gen.assign((0, codegen_1._) `${validateName}.errors`, names_1.default.vErrors); + if (opts.unevaluated) + assignEvaluated(it); + gen.return((0, codegen_1._) `${names_1.default.errors} === 0`); + } +} +function assignEvaluated({ gen, evaluated, props, items }) { + if (props instanceof codegen_1.Name) + gen.assign((0, codegen_1._) `${evaluated}.props`, props); + if (items instanceof codegen_1.Name) + gen.assign((0, codegen_1._) `${evaluated}.items`, items); +} +function schemaKeywords(it, types, typeErrors, errsCount) { + const { gen, schema, data, allErrors, opts, self } = it; + const { RULES } = self; + if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) { + gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition)); // TODO typecast + return; + } + if (!opts.jtd) + checkStrictTypes(it, types); + gen.block(() => { + for (const group of RULES.rules) + groupKeywords(group); + groupKeywords(RULES.post); + }); + function groupKeywords(group) { + if (!(0, applicability_1.shouldUseGroup)(schema, group)) + return; + if (group.type) { + gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers)); + iterateKeywords(it, group); + if (types.length === 1 && types[0] === group.type && typeErrors) { + gen.else(); + (0, dataType_2.reportTypeError)(it); + } + gen.endIf(); + } + else { + iterateKeywords(it, group); + } + // TODO make it "ok" call? + if (!allErrors) + gen.if((0, codegen_1._) `${names_1.default.errors} === ${errsCount || 0}`); + } +} +function iterateKeywords(it, group) { + const { gen, schema, opts: { useDefaults }, } = it; + if (useDefaults) + (0, defaults_1.assignDefaults)(it, group.type); + gen.block(() => { + for (const rule of group.rules) { + if ((0, applicability_1.shouldUseRule)(schema, rule)) { + keywordCode(it, rule.keyword, rule.definition, group.type); + } + } + }); +} +function checkStrictTypes(it, types) { + if (it.schemaEnv.meta || !it.opts.strictTypes) + return; + checkContextTypes(it, types); + if (!it.opts.allowUnionTypes) + checkMultipleTypes(it, types); + checkKeywordTypes(it, it.dataTypes); +} +function checkContextTypes(it, types) { + if (!types.length) + return; + if (!it.dataTypes.length) { + it.dataTypes = types; + return; + } + types.forEach((t) => { + if (!includesType(it.dataTypes, t)) { + strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`); + } + }); + narrowSchemaTypes(it, types); +} +function checkMultipleTypes(it, ts) { + if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { + strictTypesError(it, "use allowUnionTypes to allow union type keyword"); + } +} +function checkKeywordTypes(it, ts) { + const rules = it.self.RULES.all; + for (const keyword in rules) { + const rule = rules[keyword]; + if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) { + const { type } = rule.definition; + if (type.length && !type.some((t) => hasApplicableType(ts, t))) { + strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`); + } + } + } +} +function hasApplicableType(schTs, kwdT) { + return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer")); +} +function includesType(ts, t) { + return ts.includes(t) || (t === "integer" && ts.includes("number")); +} +function narrowSchemaTypes(it, withTypes) { + const ts = []; + for (const t of it.dataTypes) { + if (includesType(withTypes, t)) + ts.push(t); + else if (withTypes.includes("integer") && t === "number") + ts.push("integer"); + } + it.dataTypes = ts; +} +function strictTypesError(it, msg) { + const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; + msg += ` at "${schemaPath}" (strictTypes)`; + (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes); +} +class KeywordCxt { + constructor(it, def, keyword) { + (0, keyword_1.validateKeywordUsage)(it, def, keyword); + this.gen = it.gen; + this.allErrors = it.allErrors; + this.keyword = keyword; + this.data = it.data; + this.schema = it.schema[keyword]; + this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data; + this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data); + this.schemaType = def.schemaType; + this.parentSchema = it.schema; + this.params = {}; + this.it = it; + this.def = def; + if (this.$data) { + this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)); + } + else { + this.schemaCode = this.schemaValue; + if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) { + throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`); + } + } + if ("code" in def ? def.trackErrors : def.errors !== false) { + this.errsCount = it.gen.const("_errs", names_1.default.errors); + } + } + result(condition, successAction, failAction) { + this.failResult((0, codegen_1.not)(condition), successAction, failAction); + } + failResult(condition, successAction, failAction) { + this.gen.if(condition); + if (failAction) + failAction(); + else + this.error(); + if (successAction) { + this.gen.else(); + successAction(); + if (this.allErrors) + this.gen.endIf(); + } + else { + if (this.allErrors) + this.gen.endIf(); + else + this.gen.else(); + } + } + pass(condition, failAction) { + this.failResult((0, codegen_1.not)(condition), undefined, failAction); + } + fail(condition) { + if (condition === undefined) { + this.error(); + if (!this.allErrors) + this.gen.if(false); // this branch will be removed by gen.optimize + return; + } + this.gen.if(condition); + this.error(); + if (this.allErrors) + this.gen.endIf(); + else + this.gen.else(); + } + fail$data(condition) { + if (!this.$data) + return this.fail(condition); + const { schemaCode } = this; + this.fail((0, codegen_1._) `${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`); + } + error(append, errorParams, errorPaths) { + if (errorParams) { + this.setParams(errorParams); + this._error(append, errorPaths); + this.setParams({}); + return; + } + this._error(append, errorPaths); + } + _error(append, errorPaths) { + ; + (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths); + } + $dataError() { + (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError); + } + reset() { + if (this.errsCount === undefined) + throw new Error('add "trackErrors" to keyword definition'); + (0, errors_1.resetErrorsCount)(this.gen, this.errsCount); + } + ok(cond) { + if (!this.allErrors) + this.gen.if(cond); + } + setParams(obj, assign) { + if (assign) + Object.assign(this.params, obj); + else + this.params = obj; + } + block$data(valid, codeBlock, $dataValid = codegen_1.nil) { + this.gen.block(() => { + this.check$data(valid, $dataValid); + codeBlock(); + }); + } + check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) { + if (!this.$data) + return; + const { gen, schemaCode, schemaType, def } = this; + gen.if((0, codegen_1.or)((0, codegen_1._) `${schemaCode} === undefined`, $dataValid)); + if (valid !== codegen_1.nil) + gen.assign(valid, true); + if (schemaType.length || def.validateSchema) { + gen.elseIf(this.invalid$data()); + this.$dataError(); + if (valid !== codegen_1.nil) + gen.assign(valid, false); + } + gen.else(); + } + invalid$data() { + const { gen, schemaCode, schemaType, def, it } = this; + return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema()); + function wrong$DataType() { + if (schemaType.length) { + /* istanbul ignore if */ + if (!(schemaCode instanceof codegen_1.Name)) + throw new Error("ajv implementation error"); + const st = Array.isArray(schemaType) ? schemaType : [schemaType]; + return (0, codegen_1._) `${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`; + } + return codegen_1.nil; + } + function invalid$DataSchema() { + if (def.validateSchema) { + const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); // TODO value.code for standalone + return (0, codegen_1._) `!${validateSchemaRef}(${schemaCode})`; + } + return codegen_1.nil; + } + } + subschema(appl, valid) { + const subschema = (0, subschema_1.getSubschema)(this.it, appl); + (0, subschema_1.extendSubschemaData)(subschema, this.it, appl); + (0, subschema_1.extendSubschemaMode)(subschema, appl); + const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined }; + subschemaCode(nextContext, valid); + return nextContext; + } + mergeEvaluated(schemaCxt, toName) { + const { it, gen } = this; + if (!it.opts.unevaluated) + return; + if (it.props !== true && schemaCxt.props !== undefined) { + it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName); + } + if (it.items !== true && schemaCxt.items !== undefined) { + it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName); + } + } + mergeValidEvaluated(schemaCxt, valid) { + const { it, gen } = this; + if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { + gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name)); + return true; + } + } +} +exports.KeywordCxt = KeywordCxt; +function keywordCode(it, keyword, def, ruleType) { + const cxt = new KeywordCxt(it, def, keyword); + if ("code" in def) { + def.code(cxt, ruleType); + } + else if (cxt.$data && def.validate) { + (0, keyword_1.funcKeywordCode)(cxt, def); + } + else if ("macro" in def) { + (0, keyword_1.macroKeywordCode)(cxt, def); + } + else if (def.compile || def.validate) { + (0, keyword_1.funcKeywordCode)(cxt, def); + } +} +const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; +const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; +function getData($data, { dataLevel, dataNames, dataPathArr }) { + let jsonPointer; + let data; + if ($data === "") + return names_1.default.rootData; + if ($data[0] === "/") { + if (!JSON_POINTER.test($data)) + throw new Error(`Invalid JSON-pointer: ${$data}`); + jsonPointer = $data; + data = names_1.default.rootData; + } + else { + const matches = RELATIVE_JSON_POINTER.exec($data); + if (!matches) + throw new Error(`Invalid JSON-pointer: ${$data}`); + const up = +matches[1]; + jsonPointer = matches[2]; + if (jsonPointer === "#") { + if (up >= dataLevel) + throw new Error(errorMsg("property/index", up)); + return dataPathArr[dataLevel - up]; + } + if (up > dataLevel) + throw new Error(errorMsg("data", up)); + data = dataNames[dataLevel - up]; + if (!jsonPointer) + return data; + } + let expr = data; + const segments = jsonPointer.split("/"); + for (const segment of segments) { + if (segment) { + data = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`; + expr = (0, codegen_1._) `${expr} && ${data}`; + } + } + return expr; + function errorMsg(pointerType, up) { + return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`; + } +} +exports.getData = getData; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/index.js.map b/node_modules/ajv/dist/compile/validate/index.js.map new file mode 100644 index 000000000..873d09b5a --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/compile/validate/index.ts"],"names":[],"mappings":";;;AASA,6CAAoE;AACpE,yCAAiE;AACjE,mDAA6D;AAC7D,yC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/node_modules/ajv/dist/compile/validate/keyword.d.ts new file mode 100644 index 000000000..d15cee878 --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/keyword.d.ts @@ -0,0 +1,8 @@ +import type { KeywordCxt } from "."; +import type { AddedKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition } from "../../types"; +import type { SchemaObjCxt } from ".."; +import type { JSONType } from "../rules"; +export declare function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void; +export declare function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void; +export declare function validSchemaType(schema: unknown, schemaType: JSONType[], allowUndefined?: boolean): boolean; +export declare function validateKeywordUsage({ schema, opts, self, errSchemaPath }: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string): void; diff --git a/node_modules/ajv/dist/compile/validate/keyword.js b/node_modules/ajv/dist/compile/validate/keyword.js new file mode 100644 index 000000000..1109d3a45 --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/keyword.js @@ -0,0 +1,124 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0; +const codegen_1 = require("../codegen"); +const names_1 = require("../names"); +const code_1 = require("../../vocabularies/code"); +const errors_1 = require("../errors"); +function macroKeywordCode(cxt, def) { + const { gen, keyword, schema, parentSchema, it } = cxt; + const macroSchema = def.macro.call(it.self, schema, parentSchema, it); + const schemaRef = useKeyword(gen, keyword, macroSchema); + if (it.opts.validateSchema !== false) + it.self.validateSchema(macroSchema, true); + const valid = gen.name("valid"); + cxt.subschema({ + schema: macroSchema, + schemaPath: codegen_1.nil, + errSchemaPath: `${it.errSchemaPath}/${keyword}`, + topSchemaRef: schemaRef, + compositeRule: true, + }, valid); + cxt.pass(valid, () => cxt.error(true)); +} +exports.macroKeywordCode = macroKeywordCode; +function funcKeywordCode(cxt, def) { + var _a; + const { gen, keyword, schema, parentSchema, $data, it } = cxt; + checkAsyncKeyword(it, def); + const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate; + const validateRef = useKeyword(gen, keyword, validate); + const valid = gen.let("valid"); + cxt.block$data(valid, validateKeyword); + cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid); + function validateKeyword() { + if (def.errors === false) { + assignValid(); + if (def.modifying) + modifyData(cxt); + reportErrs(() => cxt.error()); + } + else { + const ruleErrs = def.async ? validateAsync() : validateSync(); + if (def.modifying) + modifyData(cxt); + reportErrs(() => addErrs(cxt, ruleErrs)); + } + } + function validateAsync() { + const ruleErrs = gen.let("ruleErrs", null); + gen.try(() => assignValid((0, codegen_1._) `await `), (e) => gen.assign(valid, false).if((0, codegen_1._) `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._) `${e}.errors`), () => gen.throw(e))); + return ruleErrs; + } + function validateSync() { + const validateErrs = (0, codegen_1._) `${validateRef}.errors`; + gen.assign(validateErrs, null); + assignValid(codegen_1.nil); + return validateErrs; + } + function assignValid(_await = def.async ? (0, codegen_1._) `await ` : codegen_1.nil) { + const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self; + const passSchema = !(("compile" in def && !$data) || def.schema === false); + gen.assign(valid, (0, codegen_1._) `${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying); + } + function reportErrs(errors) { + var _a; + gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors); + } +} +exports.funcKeywordCode = funcKeywordCode; +function modifyData(cxt) { + const { gen, data, it } = cxt; + gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._) `${it.parentData}[${it.parentDataProperty}]`)); +} +function addErrs(cxt, errs) { + const { gen } = cxt; + gen.if((0, codegen_1._) `Array.isArray(${errs})`, () => { + gen + .assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`) + .assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`); + (0, errors_1.extendErrors)(cxt); + }, () => cxt.error()); +} +function checkAsyncKeyword({ schemaEnv }, def) { + if (def.async && !schemaEnv.$async) + throw new Error("async keyword in sync schema"); +} +function useKeyword(gen, keyword, result) { + if (result === undefined) + throw new Error(`keyword "${keyword}" failed to compile`); + return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) }); +} +function validSchemaType(schema, schemaType, allowUndefined = false) { + // TODO add tests + return (!schemaType.length || + schemaType.some((st) => st === "array" + ? Array.isArray(schema) + : st === "object" + ? schema && typeof schema == "object" && !Array.isArray(schema) + : typeof schema == st || (allowUndefined && typeof schema == "undefined"))); +} +exports.validSchemaType = validSchemaType; +function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) { + /* istanbul ignore if */ + if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { + throw new Error("ajv implementation error"); + } + const deps = def.dependencies; + if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) { + throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`); + } + if (def.validateSchema) { + const valid = def.validateSchema(schema[keyword]); + if (!valid) { + const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + + self.errorsText(def.validateSchema.errors); + if (opts.validateSchema === "log") + self.logger.error(msg); + else + throw new Error(msg); + } + } +} +exports.validateKeywordUsage = validateKeywordUsage; +//# sourceMappingURL=keyword.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/keyword.js.map b/node_modules/ajv/dist/compile/validate/keyword.js.map new file mode 100644 index 000000000..10d716d7e --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/keyword.js.map @@ -0,0 +1 @@ +{"version":3,"file":"keyword.js","sourceRoot":"","sources":["../../../lib/compile/validate/keyword.ts"],"names":[],"mappings":";;;AAUA,wCAAsE;AACtE,oCAAwB;A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,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE;QAC3E,MAAM,IAAI,KAAK,CAAC,2CAA2C,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;KACzF;IAED,IAAI,GAAG,CAAC,cAAc,EAAE;QACtB,MAAM,KAAK,GAAG,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;QACjD,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,GAAG,GACP,YAAY,OAAO,+BAA+B,aAAa,KAAK;gBACpE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;YAC5C,IAAI,IAAI,CAAC,cAAc,KAAK,KAAK;gBAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;;gBACpD,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAA;SAC1B;KACF;AACH,CAAC;AAzBD,oDAyBC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/subschema.d.ts b/node_modules/ajv/dist/compile/validate/subschema.d.ts new file mode 100644 index 000000000..b92785f2d --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/subschema.d.ts @@ -0,0 +1,47 @@ +import type { AnySchema } from "../../types"; +import type { SchemaObjCxt } from ".."; +import { Code, Name } from "../codegen"; +import { Type } from "../util"; +import type { JSONType } from "../rules"; +export interface SubschemaContext { + schema: AnySchema; + schemaPath: Code; + errSchemaPath: string; + topSchemaRef?: Code; + errorPath?: Code; + dataLevel?: number; + dataTypes?: JSONType[]; + data?: Name; + parentData?: Name; + parentDataProperty?: Code | number; + dataNames?: Name[]; + dataPathArr?: (Code | number)[]; + propertyName?: Name; + jtdDiscriminator?: string; + jtdMetadata?: boolean; + compositeRule?: true; + createErrors?: boolean; + allErrors?: boolean; +} +export type SubschemaArgs = Partial<{ + keyword: string; + schemaProp: string | number; + schema: AnySchema; + schemaPath: Code; + errSchemaPath: string; + topSchemaRef: Code; + data: Name | Code; + dataProp: Code | string | number; + dataTypes: JSONType[]; + definedProperties: Set; + propertyName: Name; + dataPropType: Type; + jtdDiscriminator: string; + jtdMetadata: boolean; + compositeRule: true; + createErrors: boolean; + allErrors: boolean; +}>; +export declare function getSubschema(it: SchemaObjCxt, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }: SubschemaArgs): SubschemaContext; +export declare function extendSubschemaData(subschema: SubschemaContext, it: SchemaObjCxt, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }: SubschemaArgs): void; +export declare function extendSubschemaMode(subschema: SubschemaContext, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }: SubschemaArgs): void; diff --git a/node_modules/ajv/dist/compile/validate/subschema.js b/node_modules/ajv/dist/compile/validate/subschema.js new file mode 100644 index 000000000..9de282869 --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/subschema.js @@ -0,0 +1,81 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0; +const codegen_1 = require("../codegen"); +const util_1 = require("../util"); +function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) { + if (keyword !== undefined && schema !== undefined) { + throw new Error('both "keyword" and "schema" passed, only one allowed'); + } + if (keyword !== undefined) { + const sch = it.schema[keyword]; + return schemaProp === undefined + ? { + schema: sch, + schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`, + errSchemaPath: `${it.errSchemaPath}/${keyword}`, + } + : { + schema: sch[schemaProp], + schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`, + errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`, + }; + } + if (schema !== undefined) { + if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) { + throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); + } + return { + schema, + schemaPath, + topSchemaRef, + errSchemaPath, + }; + } + throw new Error('either "keyword" or "schema" must be passed'); +} +exports.getSubschema = getSubschema; +function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) { + if (data !== undefined && dataProp !== undefined) { + throw new Error('both "data" and "dataProp" passed, only one allowed'); + } + const { gen } = it; + if (dataProp !== undefined) { + const { errorPath, dataPathArr, opts } = it; + const nextData = gen.let("data", (0, codegen_1._) `${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true); + dataContextProps(nextData); + subschema.errorPath = (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`; + subschema.parentDataProperty = (0, codegen_1._) `${dataProp}`; + subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]; + } + if (data !== undefined) { + const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); // replaceable if used once? + dataContextProps(nextData); + if (propertyName !== undefined) + subschema.propertyName = propertyName; + // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr + } + if (dataTypes) + subschema.dataTypes = dataTypes; + function dataContextProps(_nextData) { + subschema.data = _nextData; + subschema.dataLevel = it.dataLevel + 1; + subschema.dataTypes = []; + it.definedProperties = new Set(); + subschema.parentData = it.data; + subschema.dataNames = [...it.dataNames, _nextData]; + } +} +exports.extendSubschemaData = extendSubschemaData; +function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) { + if (compositeRule !== undefined) + subschema.compositeRule = compositeRule; + if (createErrors !== undefined) + subschema.createErrors = createErrors; + if (allErrors !== undefined) + subschema.allErrors = allErrors; + subschema.jtdDiscriminator = jtdDiscriminator; // not inherited + subschema.jtdMetadata = jtdMetadata; // not inherited +} +exports.extendSubschemaMode = extendSubschemaMode; +//# sourceMappingURL=subschema.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/subschema.js.map b/node_modules/ajv/dist/compile/validate/subschema.js.map new file mode 100644 index 000000000..a1b84d378 --- /dev/null +++ b/node_modules/ajv/dist/compile/validate/subschema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"subschema.js","sourceRoot":"","sources":["../../../lib/compile/validate/subschema.ts"],"names":[],"mappings":";;;AAEA,wCAA0D;AAC1D,kCAA0D;AA6C1D,SAAgB,YAAY,CAC1B,EAAgB,EAChB,EAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAgB;IAErF,IAAI,OAAO,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE;QACjD,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;KACxE;IAED,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAC9B,OAAO,UAAU,KAAK,SAAS;YAC7B,CAAC,CAAC;gBACE,MAAM,EAAE,GAAG;gBACX,UAAU,EAAE,IAAA,WAAC,EAAA,GAAG,EAAE,CAAC,UAAU,GAAG,IAAA,qBAAW,EAAC,OAAO,CAAC,EAAE;gBACtD,aAAa,EAAE,GAAG,EAAE,CAAC,aAAa,IAAI,OAAO,EAAE;aAChD;YACH,CAAC,CAAC;gBACE,MAAM,EAAE,GAAG,CAAC,UAAU,CAAC;gBACvB,UAAU,EAAE,IAAA,WAAC,EAAA,GAAG,EAAE,CAAC,UAAU,GAAG,IAAA,qBAAW,EAAC,OAAO,CAAC,GAAG,IAAA,qBAAW,EAAC,UAAU,CAAC,EAAE;gBAChF,aAAa,EAAE,GAAG,EAAE,CAAC,aAAa,IAAI,OAAO,IAAI,IAAA,qBAAc,EAAC,UAAU,CAAC,EAAE;aA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AAgB,CAAA,CAAC,gBAAgB;IAC9D,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA,CAAC,gBAAgB;AACtD,CAAC;AATD,kDASC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/core.d.ts b/node_modules/ajv/dist/core.d.ts new file mode 100644 index 000000000..4591ed9ec --- /dev/null +++ b/node_modules/ajv/dist/core.d.ts @@ -0,0 +1,173 @@ +export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, AnyValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; +export { SchemaCxt, SchemaObjCxt } from "./compile"; +export interface Plugin { + (ajv: Ajv, options?: Opts): Ajv; + [prop: string]: any; +} +export { KeywordCxt } from "./compile/validate"; +export { DefinedError } from "./vocabularies/errors"; +export { JSONType } from "./compile/rules"; +export { JSONSchemaType } from "./types/json-schema"; +export { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema"; +export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; +import type { Schema, AnySchema, AnySchemaObject, SchemaObject, AsyncSchema, Vocabulary, KeywordDefinition, AddedKeywordDefinition, AnyValidateFunction, ValidateFunction, AsyncValidateFunction, ErrorObject, Format, AddedFormat, RegExpEngine, UriResolver } from "./types"; +import type { JSONSchemaType } from "./types/json-schema"; +import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema"; +import ValidationError from "./runtime/validation_error"; +import MissingRefError from "./compile/ref_error"; +import { ValidationRules } from "./compile/rules"; +import { SchemaEnv } from "./compile"; +import { Code, ValueScope } from "./compile/codegen"; +export type Options = CurrentOptions & DeprecatedOptions; +export interface CurrentOptions { + strict?: boolean | "log"; + strictSchema?: boolean | "log"; + strictNumbers?: boolean | "log"; + strictTypes?: boolean | "log"; + strictTuples?: boolean | "log"; + strictRequired?: boolean | "log"; + allowMatchingProperties?: boolean; + allowUnionTypes?: boolean; + validateFormats?: boolean; + $data?: boolean; + allErrors?: boolean; + verbose?: boolean; + discriminator?: boolean; + unicodeRegExp?: boolean; + timestamp?: "string" | "date"; + parseDate?: boolean; + allowDate?: boolean; + $comment?: true | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown); + formats?: { + [Name in string]?: Format; + }; + keywords?: Vocabulary; + schemas?: AnySchema[] | { + [Key in string]?: AnySchema; + }; + logger?: Logger | false; + loadSchema?: (uri: string) => Promise; + removeAdditional?: boolean | "all" | "failing"; + useDefaults?: boolean | "empty"; + coerceTypes?: boolean | "array"; + next?: boolean; + unevaluated?: boolean; + dynamicRef?: boolean; + schemaId?: "id" | "$id"; + jtd?: boolean; + meta?: SchemaObject | boolean; + defaultMeta?: string | AnySchemaObject; + validateSchema?: boolean | "log"; + addUsedSchema?: boolean; + inlineRefs?: boolean | number; + passContext?: boolean; + loopRequired?: number; + loopEnum?: number; + ownProperties?: boolean; + multipleOfPrecision?: number; + int32range?: boolean; + messages?: boolean; + code?: CodeOptions; + uriResolver?: UriResolver; +} +export interface CodeOptions { + es5?: boolean; + esm?: boolean; + lines?: boolean; + optimize?: boolean | number; + formats?: Code; + source?: boolean; + process?: (code: string, schema?: SchemaEnv) => string; + regExp?: RegExpEngine; +} +interface InstanceCodeOptions extends CodeOptions { + regExp: RegExpEngine; + optimize: number; +} +interface DeprecatedOptions { + /** @deprecated */ + ignoreKeywordsWithRef?: boolean; + /** @deprecated */ + jsPropertySyntax?: boolean; + /** @deprecated */ + unicode?: boolean; +} +type RequiredInstanceOptions = { + [K in "strictSchema" | "strictNumbers" | "strictTypes" | "strictTuples" | "strictRequired" | "inlineRefs" | "loopRequired" | "loopEnum" | "meta" | "messages" | "schemaId" | "addUsedSchema" | "validateSchema" | "validateFormats" | "int32range" | "unicodeRegExp" | "uriResolver"]: NonNullable; +} & { + code: InstanceCodeOptions; +}; +export type InstanceOptions = Options & RequiredInstanceOptions; +export interface Logger { + log(...args: unknown[]): unknown; + warn(...args: unknown[]): unknown; + error(...args: unknown[]): unknown; +} +export default class Ajv { + opts: InstanceOptions; + errors?: ErrorObject[] | null; + logger: Logger; + readonly scope: ValueScope; + readonly schemas: { + [Key in string]?: SchemaEnv; + }; + readonly refs: { + [Ref in string]?: SchemaEnv | string; + }; + readonly formats: { + [Name in string]?: AddedFormat; + }; + readonly RULES: ValidationRules; + readonly _compilations: Set; + private readonly _loading; + private readonly _cache; + private readonly _metaOpts; + static ValidationError: typeof ValidationError; + static MissingRefError: typeof MissingRefError; + constructor(opts?: Options); + _addVocabularies(): void; + _addDefaultMetaSchema(): void; + defaultMeta(): string | AnySchemaObject | undefined; + validate(schema: Schema | string, data: unknown): boolean; + validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise; + validate(schema: Schema | JSONSchemaType | string, data: unknown): data is T; + validate(schema: JTDSchemaType, data: unknown): data is T; + validate(schema: T, data: unknown): data is JTDDataType; + validate(schema: AsyncSchema, data: unknown | T): Promise; + validate(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise; + compile(schema: Schema | JSONSchemaType, _meta?: boolean): ValidateFunction; + compile(schema: JTDSchemaType, _meta?: boolean): ValidateFunction; + compile(schema: T, _meta?: boolean): ValidateFunction>; + compile(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction; + compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction; + compileAsync(schema: SchemaObject | JSONSchemaType, _meta?: boolean): Promise>; + compileAsync(schema: JTDSchemaType, _meta?: boolean): Promise>; + compileAsync(schema: AsyncSchema, meta?: boolean): Promise>; + compileAsync(schema: AnySchemaObject, meta?: boolean): Promise>; + addSchema(schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored + key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + _validateSchema?: boolean | "log"): Ajv; + addMetaSchema(schema: AnySchemaObject, key?: string, // schema key + _validateSchema?: boolean | "log"): Ajv; + validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise; + getSchema(keyRef: string): AnyValidateFunction | undefined; + removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv; + addVocabulary(definitions: Vocabulary): Ajv; + addKeyword(kwdOrDef: string | KeywordDefinition, def?: KeywordDefinition): Ajv; + getKeyword(keyword: string): AddedKeywordDefinition | boolean; + removeKeyword(keyword: string): Ajv; + addFormat(name: string, format: Format): Ajv; + errorsText(errors?: ErrorObject[] | null | undefined, // optional array of validation errors + { separator, dataVar }?: ErrorsTextOptions): string; + $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject; + private _removeAllSchemas; + _addSchema(schema: AnySchema, meta?: boolean, baseId?: string, validateSchema?: boolean | "log", addSchema?: boolean): SchemaEnv; + private _checkUnique; + private _compileSchemaEnv; + private _compileMetaSchema; +} +export interface ErrorsTextOptions { + separator?: string; + dataVar?: string; +} diff --git a/node_modules/ajv/dist/core.js b/node_modules/ajv/dist/core.js new file mode 100644 index 000000000..84911161f --- /dev/null +++ b/node_modules/ajv/dist/core.js @@ -0,0 +1,617 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; +var validate_1 = require("./compile/validate"); +Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +const validation_error_1 = require("./runtime/validation_error"); +const ref_error_1 = require("./compile/ref_error"); +const rules_1 = require("./compile/rules"); +const compile_1 = require("./compile"); +const codegen_2 = require("./compile/codegen"); +const resolve_1 = require("./compile/resolve"); +const dataType_1 = require("./compile/validate/dataType"); +const util_1 = require("./compile/util"); +const $dataRefSchema = require("./refs/data.json"); +const uri_1 = require("./runtime/uri"); +const defaultRegExp = (str, flags) => new RegExp(str, flags); +defaultRegExp.code = "new RegExp"; +const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"]; +const EXT_SCOPE_NAMES = new Set([ + "validate", + "serialize", + "parse", + "wrapper", + "root", + "schema", + "keyword", + "pattern", + "formats", + "validate$data", + "func", + "obj", + "Error", +]); +const removedOptions = { + errorDataPath: "", + format: "`validateFormats: false` can be used instead.", + nullable: '"nullable" keyword is supported by default.', + jsonPointers: "Deprecated jsPropertySyntax can be used instead.", + extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", + missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", + processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", + sourceCode: "Use option `code: {source: true}`", + strictDefaults: "It is default now, see option `strict`.", + strictKeywords: "It is default now, see option `strict`.", + uniqueItems: '"uniqueItems" keyword is always validated.', + unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", + cache: "Map is used as cache, schema object as key.", + serialize: "Map is used as cache, schema object as key.", + ajvErrors: "It is default now.", +}; +const deprecatedOptions = { + ignoreKeywordsWithRef: "", + jsPropertySyntax: "", + unicode: '"minLength"/"maxLength" account for unicode characters by default.', +}; +const MAX_EXPRESSION = 200; +// eslint-disable-next-line complexity +function requiredOptions(o) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; + const s = o.strict; + const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize; + const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0; + const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp; + const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default; + return { + strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true, + strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true, + strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log", + strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log", + strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false, + code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp }, + loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION, + loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION, + meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true, + messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true, + inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true, + schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id", + addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true, + validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true, + validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true, + unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true, + int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true, + uriResolver: uriResolver, + }; +} +class Ajv { + constructor(opts = {}) { + this.schemas = {}; + this.refs = {}; + this.formats = {}; + this._compilations = new Set(); + this._loading = {}; + this._cache = new Map(); + opts = this.opts = { ...opts, ...requiredOptions(opts) }; + const { es5, lines } = this.opts.code; + this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines }); + this.logger = getLogger(opts.logger); + const formatOpt = opts.validateFormats; + opts.validateFormats = false; + this.RULES = (0, rules_1.getRules)(); + checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED"); + checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn"); + this._metaOpts = getMetaSchemaOptions.call(this); + if (opts.formats) + addInitialFormats.call(this); + this._addVocabularies(); + this._addDefaultMetaSchema(); + if (opts.keywords) + addInitialKeywords.call(this, opts.keywords); + if (typeof opts.meta == "object") + this.addMetaSchema(opts.meta); + addInitialSchemas.call(this); + opts.validateFormats = formatOpt; + } + _addVocabularies() { + this.addKeyword("$async"); + } + _addDefaultMetaSchema() { + const { $data, meta, schemaId } = this.opts; + let _dataRefSchema = $dataRefSchema; + if (schemaId === "id") { + _dataRefSchema = { ...$dataRefSchema }; + _dataRefSchema.id = _dataRefSchema.$id; + delete _dataRefSchema.$id; + } + if (meta && $data) + this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false); + } + defaultMeta() { + const { meta, schemaId } = this.opts; + return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined); + } + validate(schemaKeyRef, // key, ref or schema object + data // to be validated + ) { + let v; + if (typeof schemaKeyRef == "string") { + v = this.getSchema(schemaKeyRef); + if (!v) + throw new Error(`no schema with key or ref "${schemaKeyRef}"`); + } + else { + v = this.compile(schemaKeyRef); + } + const valid = v(data); + if (!("$async" in v)) + this.errors = v.errors; + return valid; + } + compile(schema, _meta) { + const sch = this._addSchema(schema, _meta); + return (sch.validate || this._compileSchemaEnv(sch)); + } + compileAsync(schema, meta) { + if (typeof this.opts.loadSchema != "function") { + throw new Error("options.loadSchema should be a function"); + } + const { loadSchema } = this.opts; + return runCompileAsync.call(this, schema, meta); + async function runCompileAsync(_schema, _meta) { + await loadMetaSchema.call(this, _schema.$schema); + const sch = this._addSchema(_schema, _meta); + return sch.validate || _compileAsync.call(this, sch); + } + async function loadMetaSchema($ref) { + if ($ref && !this.getSchema($ref)) { + await runCompileAsync.call(this, { $ref }, true); + } + } + async function _compileAsync(sch) { + try { + return this._compileSchemaEnv(sch); + } + catch (e) { + if (!(e instanceof ref_error_1.default)) + throw e; + checkLoaded.call(this, e); + await loadMissingSchema.call(this, e.missingSchema); + return _compileAsync.call(this, sch); + } + } + function checkLoaded({ missingSchema: ref, missingRef }) { + if (this.refs[ref]) { + throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`); + } + } + async function loadMissingSchema(ref) { + const _schema = await _loadSchema.call(this, ref); + if (!this.refs[ref]) + await loadMetaSchema.call(this, _schema.$schema); + if (!this.refs[ref]) + this.addSchema(_schema, ref, meta); + } + async function _loadSchema(ref) { + const p = this._loading[ref]; + if (p) + return p; + try { + return await (this._loading[ref] = loadSchema(ref)); + } + finally { + delete this._loading[ref]; + } + } + } + // Adds schema to the instance + addSchema(schema, // If array is passed, `key` will be ignored + key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead. + ) { + if (Array.isArray(schema)) { + for (const sch of schema) + this.addSchema(sch, undefined, _meta, _validateSchema); + return this; + } + let id; + if (typeof schema === "object") { + const { schemaId } = this.opts; + id = schema[schemaId]; + if (id !== undefined && typeof id != "string") { + throw new Error(`schema ${schemaId} must be string`); + } + } + key = (0, resolve_1.normalizeId)(key || id); + this._checkUnique(key); + this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true); + return this; + } + // Add schema that will be used to validate other schemas + // options in META_IGNORE_OPTIONS are alway set to false + addMetaSchema(schema, key, // schema key + _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema + ) { + this.addSchema(schema, key, true, _validateSchema); + return this; + } + // Validate schema against its meta-schema + validateSchema(schema, throwOrLogError) { + if (typeof schema == "boolean") + return true; + let $schema; + $schema = schema.$schema; + if ($schema !== undefined && typeof $schema != "string") { + throw new Error("$schema must be a string"); + } + $schema = $schema || this.opts.defaultMeta || this.defaultMeta(); + if (!$schema) { + this.logger.warn("meta-schema not available"); + this.errors = null; + return true; + } + const valid = this.validate($schema, schema); + if (!valid && throwOrLogError) { + const message = "schema is invalid: " + this.errorsText(); + if (this.opts.validateSchema === "log") + this.logger.error(message); + else + throw new Error(message); + } + return valid; + } + // Get compiled schema by `key` or `ref`. + // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) + getSchema(keyRef) { + let sch; + while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") + keyRef = sch; + if (sch === undefined) { + const { schemaId } = this.opts; + const root = new compile_1.SchemaEnv({ schema: {}, schemaId }); + sch = compile_1.resolveSchema.call(this, root, keyRef); + if (!sch) + return; + this.refs[keyRef] = sch; + } + return (sch.validate || this._compileSchemaEnv(sch)); + } + // Remove cached schema(s). + // If no parameter is passed all schemas but meta-schemas are removed. + // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. + // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. + removeSchema(schemaKeyRef) { + if (schemaKeyRef instanceof RegExp) { + this._removeAllSchemas(this.schemas, schemaKeyRef); + this._removeAllSchemas(this.refs, schemaKeyRef); + return this; + } + switch (typeof schemaKeyRef) { + case "undefined": + this._removeAllSchemas(this.schemas); + this._removeAllSchemas(this.refs); + this._cache.clear(); + return this; + case "string": { + const sch = getSchEnv.call(this, schemaKeyRef); + if (typeof sch == "object") + this._cache.delete(sch.schema); + delete this.schemas[schemaKeyRef]; + delete this.refs[schemaKeyRef]; + return this; + } + case "object": { + const cacheKey = schemaKeyRef; + this._cache.delete(cacheKey); + let id = schemaKeyRef[this.opts.schemaId]; + if (id) { + id = (0, resolve_1.normalizeId)(id); + delete this.schemas[id]; + delete this.refs[id]; + } + return this; + } + default: + throw new Error("ajv.removeSchema: invalid parameter"); + } + } + // add "vocabulary" - a collection of keywords + addVocabulary(definitions) { + for (const def of definitions) + this.addKeyword(def); + return this; + } + addKeyword(kwdOrDef, def // deprecated + ) { + let keyword; + if (typeof kwdOrDef == "string") { + keyword = kwdOrDef; + if (typeof def == "object") { + this.logger.warn("these parameters are deprecated, see docs for addKeyword"); + def.keyword = keyword; + } + } + else if (typeof kwdOrDef == "object" && def === undefined) { + def = kwdOrDef; + keyword = def.keyword; + if (Array.isArray(keyword) && !keyword.length) { + throw new Error("addKeywords: keyword must be string or non-empty array"); + } + } + else { + throw new Error("invalid addKeywords parameters"); + } + checkKeyword.call(this, keyword, def); + if (!def) { + (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd)); + return this; + } + keywordMetaschema.call(this, def); + const definition = { + ...def, + type: (0, dataType_1.getJSONTypes)(def.type), + schemaType: (0, dataType_1.getJSONTypes)(def.schemaType), + }; + (0, util_1.eachItem)(keyword, definition.type.length === 0 + ? (k) => addRule.call(this, k, definition) + : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t))); + return this; + } + getKeyword(keyword) { + const rule = this.RULES.all[keyword]; + return typeof rule == "object" ? rule.definition : !!rule; + } + // Remove keyword + removeKeyword(keyword) { + // TODO return type should be Ajv + const { RULES } = this; + delete RULES.keywords[keyword]; + delete RULES.all[keyword]; + for (const group of RULES.rules) { + const i = group.rules.findIndex((rule) => rule.keyword === keyword); + if (i >= 0) + group.rules.splice(i, 1); + } + return this; + } + // Add format + addFormat(name, format) { + if (typeof format == "string") + format = new RegExp(format); + this.formats[name] = format; + return this; + } + errorsText(errors = this.errors, // optional array of validation errors + { separator = ", ", dataVar = "data" } = {} // optional options with properties `separator` and `dataVar` + ) { + if (!errors || errors.length === 0) + return "No errors"; + return errors + .map((e) => `${dataVar}${e.instancePath} ${e.message}`) + .reduce((text, msg) => text + separator + msg); + } + $dataMetaSchema(metaSchema, keywordsJsonPointers) { + const rules = this.RULES.all; + metaSchema = JSON.parse(JSON.stringify(metaSchema)); + for (const jsonPointer of keywordsJsonPointers) { + const segments = jsonPointer.split("/").slice(1); // first segment is an empty string + let keywords = metaSchema; + for (const seg of segments) + keywords = keywords[seg]; + for (const key in rules) { + const rule = rules[key]; + if (typeof rule != "object") + continue; + const { $data } = rule.definition; + const schema = keywords[key]; + if ($data && schema) + keywords[key] = schemaOrData(schema); + } + } + return metaSchema; + } + _removeAllSchemas(schemas, regex) { + for (const keyRef in schemas) { + const sch = schemas[keyRef]; + if (!regex || regex.test(keyRef)) { + if (typeof sch == "string") { + delete schemas[keyRef]; + } + else if (sch && !sch.meta) { + this._cache.delete(sch.schema); + delete schemas[keyRef]; + } + } + } + } + _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) { + let id; + const { schemaId } = this.opts; + if (typeof schema == "object") { + id = schema[schemaId]; + } + else { + if (this.opts.jtd) + throw new Error("schema must be object"); + else if (typeof schema != "boolean") + throw new Error("schema must be object or boolean"); + } + let sch = this._cache.get(schema); + if (sch !== undefined) + return sch; + baseId = (0, resolve_1.normalizeId)(id || baseId); + const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId); + sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs }); + this._cache.set(sch.schema, sch); + if (addSchema && !baseId.startsWith("#")) { + // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) + if (baseId) + this._checkUnique(baseId); + this.refs[baseId] = sch; + } + if (validateSchema) + this.validateSchema(schema, true); + return sch; + } + _checkUnique(id) { + if (this.schemas[id] || this.refs[id]) { + throw new Error(`schema with key or id "${id}" already exists`); + } + } + _compileSchemaEnv(sch) { + if (sch.meta) + this._compileMetaSchema(sch); + else + compile_1.compileSchema.call(this, sch); + /* istanbul ignore if */ + if (!sch.validate) + throw new Error("ajv implementation error"); + return sch.validate; + } + _compileMetaSchema(sch) { + const currentOpts = this.opts; + this.opts = this._metaOpts; + try { + compile_1.compileSchema.call(this, sch); + } + finally { + this.opts = currentOpts; + } + } +} +exports.default = Ajv; +Ajv.ValidationError = validation_error_1.default; +Ajv.MissingRefError = ref_error_1.default; +function checkOptions(checkOpts, options, msg, log = "error") { + for (const key in checkOpts) { + const opt = key; + if (opt in options) + this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`); + } +} +function getSchEnv(keyRef) { + keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line + return this.schemas[keyRef] || this.refs[keyRef]; +} +function addInitialSchemas() { + const optsSchemas = this.opts.schemas; + if (!optsSchemas) + return; + if (Array.isArray(optsSchemas)) + this.addSchema(optsSchemas); + else + for (const key in optsSchemas) + this.addSchema(optsSchemas[key], key); +} +function addInitialFormats() { + for (const name in this.opts.formats) { + const format = this.opts.formats[name]; + if (format) + this.addFormat(name, format); + } +} +function addInitialKeywords(defs) { + if (Array.isArray(defs)) { + this.addVocabulary(defs); + return; + } + this.logger.warn("keywords option as map is deprecated, pass array"); + for (const keyword in defs) { + const def = defs[keyword]; + if (!def.keyword) + def.keyword = keyword; + this.addKeyword(def); + } +} +function getMetaSchemaOptions() { + const metaOpts = { ...this.opts }; + for (const opt of META_IGNORE_OPTIONS) + delete metaOpts[opt]; + return metaOpts; +} +const noLogs = { log() { }, warn() { }, error() { } }; +function getLogger(logger) { + if (logger === false) + return noLogs; + if (logger === undefined) + return console; + if (logger.log && logger.warn && logger.error) + return logger; + throw new Error("logger must implement log, warn and error methods"); +} +const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i; +function checkKeyword(keyword, def) { + const { RULES } = this; + (0, util_1.eachItem)(keyword, (kwd) => { + if (RULES.keywords[kwd]) + throw new Error(`Keyword ${kwd} is already defined`); + if (!KEYWORD_NAME.test(kwd)) + throw new Error(`Keyword ${kwd} has invalid name`); + }); + if (!def) + return; + if (def.$data && !("code" in def || "validate" in def)) { + throw new Error('$data keyword must have "code" or "validate" function'); + } +} +function addRule(keyword, definition, dataType) { + var _a; + const post = definition === null || definition === void 0 ? void 0 : definition.post; + if (dataType && post) + throw new Error('keyword with "post" flag cannot have "type"'); + const { RULES } = this; + let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType); + if (!ruleGroup) { + ruleGroup = { type: dataType, rules: [] }; + RULES.rules.push(ruleGroup); + } + RULES.keywords[keyword] = true; + if (!definition) + return; + const rule = { + keyword, + definition: { + ...definition, + type: (0, dataType_1.getJSONTypes)(definition.type), + schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType), + }, + }; + if (definition.before) + addBeforeRule.call(this, ruleGroup, rule, definition.before); + else + ruleGroup.rules.push(rule); + RULES.all[keyword] = rule; + (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd)); +} +function addBeforeRule(ruleGroup, rule, before) { + const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before); + if (i >= 0) { + ruleGroup.rules.splice(i, 0, rule); + } + else { + ruleGroup.rules.push(rule); + this.logger.warn(`rule ${before} is not defined`); + } +} +function keywordMetaschema(def) { + let { metaSchema } = def; + if (metaSchema === undefined) + return; + if (def.$data && this.opts.$data) + metaSchema = schemaOrData(metaSchema); + def.validateSchema = this.compile(metaSchema, true); +} +const $dataRef = { + $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", +}; +function schemaOrData(schema) { + return { anyOf: [schema, $dataRef] }; +} +//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/core.js.map b/node_modules/ajv/dist/core.js.map new file mode 100644 index 000000000..c39cd6b53 --- /dev/null +++ b/node_modules/ajv/dist/core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"core.js","sourceRoot":"","sources":["../lib/core.ts"],"names":[],"mappings":";;;AA4BA,+CAA6C;AAAr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E,IAAI,CAAC,CAAA;AACrD,CAAC;AAED,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,gFAAgF;CACvF,CAAA;AAED,SAAS,YAAY,CAAC,MAAiB;IACrC,OAAO,EAAC,KAAK,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,CAAA;AACpC,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/jtd.d.ts b/node_modules/ajv/dist/jtd.d.ts new file mode 100644 index 000000000..de3a2273e --- /dev/null +++ b/node_modules/ajv/dist/jtd.d.ts @@ -0,0 +1,47 @@ +import type { AnySchemaObject, SchemaObject, JTDParser } from "./types"; +import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema"; +import AjvCore, { CurrentOptions } from "./core"; +type JTDOptions = CurrentOptions & { + strict?: never; + allowMatchingProperties?: never; + allowUnionTypes?: never; + validateFormats?: never; + $data?: never; + verbose?: boolean; + $comment?: never; + formats?: never; + loadSchema?: never; + useDefaults?: never; + coerceTypes?: never; + next?: never; + unevaluated?: never; + dynamicRef?: never; + meta?: boolean; + defaultMeta?: never; + inlineRefs?: boolean; + loopRequired?: never; + multipleOfPrecision?: never; +}; +declare class Ajv extends AjvCore { + constructor(opts?: JTDOptions); + _addVocabularies(): void; + _addDefaultMetaSchema(): void; + defaultMeta(): string | AnySchemaObject | undefined; + compileSerializer(schema: SchemaObject): (data: T) => string; + compileSerializer(schema: JTDSchemaType): (data: T) => string; + compileParser(schema: SchemaObject): JTDParser; + compileParser(schema: JTDSchemaType): JTDParser; + private _compileSerializer; + private _compileParser; +} +export default Ajv; +export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, JTDParser, } from "./types"; +export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; +export { SchemaCxt, SchemaObjCxt } from "./compile"; +export { KeywordCxt } from "./compile/validate"; +export { JTDErrorObject } from "./vocabularies/jtd"; +export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; +export { JTDSchemaType, SomeJTDSchemaType, JTDDataType }; +export { JTDOptions }; +export { default as ValidationError } from "./runtime/validation_error"; +export { default as MissingRefError } from "./compile/ref_error"; diff --git a/node_modules/ajv/dist/jtd.js b/node_modules/ajv/dist/jtd.js new file mode 100644 index 000000000..b89387993 --- /dev/null +++ b/node_modules/ajv/dist/jtd.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; +const core_1 = require("./core"); +const jtd_1 = require("./vocabularies/jtd"); +const jtd_schema_1 = require("./refs/jtd-schema"); +const serialize_1 = require("./compile/jtd/serialize"); +const parse_1 = require("./compile/jtd/parse"); +const META_SCHEMA_ID = "JTD-meta-schema"; +class Ajv extends core_1.default { + constructor(opts = {}) { + super({ + ...opts, + jtd: true, + }); + } + _addVocabularies() { + super._addVocabularies(); + this.addVocabulary(jtd_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + if (!this.opts.meta) + return; + this.addMetaSchema(jtd_schema_1.default, META_SCHEMA_ID, false); + } + defaultMeta() { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); + } + compileSerializer(schema) { + const sch = this._addSchema(schema); + return sch.serialize || this._compileSerializer(sch); + } + compileParser(schema) { + const sch = this._addSchema(schema); + return (sch.parse || this._compileParser(sch)); + } + _compileSerializer(sch) { + serialize_1.default.call(this, sch, sch.schema.definitions || {}); + /* istanbul ignore if */ + if (!sch.serialize) + throw new Error("ajv implementation error"); + return sch.serialize; + } + _compileParser(sch) { + parse_1.default.call(this, sch, sch.schema.definitions || {}); + /* istanbul ignore if */ + if (!sch.parse) + throw new Error("ajv implementation error"); + return sch.parse; + } +} +module.exports = exports = Ajv; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = Ajv; +var validate_1 = require("./compile/validate"); +Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); +var codegen_1 = require("./compile/codegen"); +Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); +Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); +Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); +Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); +Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); +var validation_error_1 = require("./runtime/validation_error"); +Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); +var ref_error_1 = require("./compile/ref_error"); +Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); +//# sourceMappingURL=jtd.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/jtd.js.map b/node_modules/ajv/dist/jtd.js.map new file mode 100644 index 000000000..e5ac473d8 --- /dev/null +++ b/node_modules/ajv/dist/jtd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jtd.js","sourceRoot":"","sources":["../lib/jtd.ts"],"names":[],"mappings":";;;AAEA,iCAA8C;AAC9C,4CAA8C;AAC9C,kDAA6C;AAC7C,uDAAuD;AACvD,+CAA+C;AAG/C,MAAM,cAAc,GAAG,iBAAiB,CAAA;AA4BxC,MAAM,GAAI,SAAQ,cAAO;IACvB,YAAY,OAAmB,EAAE;QAC/B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,GAAG,EAAE,IAAI;SACV,CAAC,CAA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GAAc;QACnC,eAAa,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAG,GAAG,CAAC,MAA0B,CAAC,WAAW,IAAI,EAAE,CAAC,CAAA;QAChF,wBAAwB;QACxB,IAAI,CAAC,GAAG,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC3D,OAAO,GAAG,CAAC,KAAK,CAAA;IAClB,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,GAAG,CAAA;AAC9B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,GAAG,CAAA;AA0BlB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAElB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AAInD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ No newline at end of file diff --git a/node_modules/ajv/dist/refs/data.json b/node_modules/ajv/dist/refs/data.json new file mode 100644 index 000000000..9ffc9f5ce --- /dev/null +++ b/node_modules/ajv/dist/refs/data.json @@ -0,0 +1,13 @@ +{ + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", + "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)", + "type": "object", + "required": ["$data"], + "properties": { + "$data": { + "type": "string", + "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}] + } + }, + "additionalProperties": false +} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts b/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts new file mode 100644 index 000000000..cf008331f --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts @@ -0,0 +1,2 @@ +import type Ajv from "../../core"; +export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv; diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/index.js b/node_modules/ajv/dist/refs/json-schema-2019-09/index.js new file mode 100644 index 000000000..e86496282 --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2019-09/index.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const metaSchema = require("./schema.json"); +const applicator = require("./meta/applicator.json"); +const content = require("./meta/content.json"); +const core = require("./meta/core.json"); +const format = require("./meta/format.json"); +const metadata = require("./meta/meta-data.json"); +const validation = require("./meta/validation.json"); +const META_SUPPORT_DATA = ["/properties"]; +function addMetaSchema2019($data) { + ; + [ + metaSchema, + applicator, + content, + core, + with$data(this, format), + metadata, + with$data(this, validation), + ].forEach((sch) => this.addMetaSchema(sch, undefined, false)); + return this; + function with$data(ajv, sch) { + return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch; + } +} +exports.default = addMetaSchema2019; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map b/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map new file mode 100644 index 000000000..9b8a36d61 --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/refs/json-schema-2019-09/index.ts"],"names":[],"mappings":";;AAEA,4CAA2C;AAC3C,qDAAoD;AACpD,+CAA8C;AAC9C,yCAAwC;AACxC,6CAA4C;AAC5C,kDAAiD;AACjD,qDAAoD;AAEpD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,UAAU;QACV,OAAO;QACP,IAAI;QACJ,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QACvB,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;KAC5B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;IAC7D,OAAO,IAAI,CAAA;IAEX,SAAS,SAAS,CAAC,GAAQ,EAAE,GAAoB;QAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAClE,CAAC;AACH,CAAC;AAfD,oCAeC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json new file mode 100644 index 000000000..c5e91cf2a --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/applicator", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/applicator": true + }, + "$recursiveAnchor": true, + + "title": "Applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "additionalItems": {"$recursiveRef": "#"}, + "unevaluatedItems": {"$recursiveRef": "#"}, + "items": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}] + }, + "contains": {"$recursiveRef": "#"}, + "additionalProperties": {"$recursiveRef": "#"}, + "unevaluatedProperties": {"$recursiveRef": "#"}, + "properties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependentSchemas": { + "type": "object", + "additionalProperties": { + "$recursiveRef": "#" + } + }, + "propertyNames": {"$recursiveRef": "#"}, + "if": {"$recursiveRef": "#"}, + "then": {"$recursiveRef": "#"}, + "else": {"$recursiveRef": "#"}, + "allOf": {"$ref": "#/$defs/schemaArray"}, + "anyOf": {"$ref": "#/$defs/schemaArray"}, + "oneOf": {"$ref": "#/$defs/schemaArray"}, + "not": {"$recursiveRef": "#"} + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$recursiveRef": "#"} + } + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json new file mode 100644 index 000000000..b8f637343 --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "contentSchema": {"$recursiveRef": "#"} + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json new file mode 100644 index 000000000..f71adbff0 --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json @@ -0,0 +1,57 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/core", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true + }, + "$recursiveAnchor": true, + + "title": "Core vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference", + "$comment": "Non-empty fragments not allowed.", + "pattern": "^[^#]*#?$" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$anchor": { + "type": "string", + "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveRef": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveAnchor": { + "type": "boolean", + "default": false + }, + "$vocabulary": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri" + }, + "additionalProperties": { + "type": "boolean" + } + }, + "$comment": { + "type": "string" + }, + "$defs": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + } + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json new file mode 100644 index 000000000..03ccfce26 --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/format", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/format": true + }, + "$recursiveAnchor": true, + + "title": "Format vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "format": {"type": "string"} + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json new file mode 100644 index 000000000..0e194326f --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/meta-data": true + }, + "$recursiveAnchor": true, + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "deprecated": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json new file mode 100644 index 000000000..7027a1279 --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/validation": true + }, + "$recursiveAnchor": true, + + "title": "Validation vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, + "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, + "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, + "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/$defs/stringArray"}, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, + "type": { + "anyOf": [ + {"$ref": "#/$defs/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/$defs/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json b/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json new file mode 100644 index 000000000..54eb7157a --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/schema", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true, + "https://json-schema.org/draft/2019-09/vocab/applicator": true, + "https://json-schema.org/draft/2019-09/vocab/validation": true, + "https://json-schema.org/draft/2019-09/vocab/meta-data": true, + "https://json-schema.org/draft/2019-09/vocab/format": false, + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Core and Validation specifications meta-schema", + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format"}, + {"$ref": "meta/content"} + ], + "type": ["object", "boolean"], + "properties": { + "definitions": { + "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "dependencies": { + "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", + "type": "object", + "additionalProperties": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}] + } + } + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts b/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts new file mode 100644 index 000000000..c232ab05c --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts @@ -0,0 +1,2 @@ +import type Ajv from "../../core"; +export default function addMetaSchema2020(this: Ajv, $data?: boolean): Ajv; diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/index.js b/node_modules/ajv/dist/refs/json-schema-2020-12/index.js new file mode 100644 index 000000000..d92567564 --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2020-12/index.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const metaSchema = require("./schema.json"); +const applicator = require("./meta/applicator.json"); +const unevaluated = require("./meta/unevaluated.json"); +const content = require("./meta/content.json"); +const core = require("./meta/core.json"); +const format = require("./meta/format-annotation.json"); +const metadata = require("./meta/meta-data.json"); +const validation = require("./meta/validation.json"); +const META_SUPPORT_DATA = ["/properties"]; +function addMetaSchema2020($data) { + ; + [ + metaSchema, + applicator, + unevaluated, + content, + core, + with$data(this, format), + metadata, + with$data(this, validation), + ].forEach((sch) => this.addMetaSchema(sch, undefined, false)); + return this; + function with$data(ajv, sch) { + return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch; + } +} +exports.default = addMetaSchema2020; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map b/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map new file mode 100644 index 000000000..eb90027dd --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/refs/json-schema-2020-12/index.ts"],"names":[],"mappings":";;AAEA,4CAA2C;AAC3C,qDAAoD;AACpD,uDAAsD;AACtD,+CAA8C;AAC9C,yCAAwC;AACxC,wDAAuD;AACvD,kDAAiD;AACjD,qDAAoD;AAEpD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,UAAU;QACV,WAAW;QACX,OAAO;QACP,IAAI;QACJ,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QACvB,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;KAC5B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;IAC7D,OAAO,IAAI,CAAA;IAEX,SAAS,SAAS,CAAC,GAAQ,EAAE,GAAoB;QAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAClE,CAAC;AACH,CAAC;AAhBD,oCAgBC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json new file mode 100644 index 000000000..674c913da --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/applicator", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/applicator": true + }, + "$dynamicAnchor": "meta", + + "title": "Applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "prefixItems": {"$ref": "#/$defs/schemaArray"}, + "items": {"$dynamicRef": "#meta"}, + "contains": {"$dynamicRef": "#meta"}, + "additionalProperties": {"$dynamicRef": "#meta"}, + "properties": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependentSchemas": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "default": {} + }, + "propertyNames": {"$dynamicRef": "#meta"}, + "if": {"$dynamicRef": "#meta"}, + "then": {"$dynamicRef": "#meta"}, + "else": {"$dynamicRef": "#meta"}, + "allOf": {"$ref": "#/$defs/schemaArray"}, + "anyOf": {"$ref": "#/$defs/schemaArray"}, + "oneOf": {"$ref": "#/$defs/schemaArray"}, + "not": {"$dynamicRef": "#meta"} + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$dynamicRef": "#meta"} + } + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json new file mode 100644 index 000000000..2ae23ddb5 --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + "$dynamicAnchor": "meta", + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentEncoding": {"type": "string"}, + "contentMediaType": {"type": "string"}, + "contentSchema": {"$dynamicRef": "#meta"} + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json new file mode 100644 index 000000000..4c8e5cb61 --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json @@ -0,0 +1,51 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/core", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/core": true + }, + "$dynamicAnchor": "meta", + + "title": "Core vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "$id": { + "$ref": "#/$defs/uriReferenceString", + "$comment": "Non-empty fragments not allowed.", + "pattern": "^[^#]*#?$" + }, + "$schema": {"$ref": "#/$defs/uriString"}, + "$ref": {"$ref": "#/$defs/uriReferenceString"}, + "$anchor": {"$ref": "#/$defs/anchorString"}, + "$dynamicRef": {"$ref": "#/$defs/uriReferenceString"}, + "$dynamicAnchor": {"$ref": "#/$defs/anchorString"}, + "$vocabulary": { + "type": "object", + "propertyNames": {"$ref": "#/$defs/uriString"}, + "additionalProperties": { + "type": "boolean" + } + }, + "$comment": { + "type": "string" + }, + "$defs": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"} + } + }, + "$defs": { + "anchorString": { + "type": "string", + "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" + }, + "uriString": { + "type": "string", + "format": "uri" + }, + "uriReferenceString": { + "type": "string", + "format": "uri-reference" + } + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json new file mode 100644 index 000000000..83c26e35f --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/format-annotation": true + }, + "$dynamicAnchor": "meta", + + "title": "Format vocabulary meta-schema for annotation results", + "type": ["object", "boolean"], + "properties": { + "format": {"type": "string"} + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json new file mode 100644 index 000000000..11946fb50 --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/meta-data": true + }, + "$dynamicAnchor": "meta", + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "deprecated": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json new file mode 100644 index 000000000..5e4b203b2 --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/unevaluated": true + }, + "$dynamicAnchor": "meta", + + "title": "Unevaluated applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "unevaluatedItems": {"$dynamicRef": "#meta"}, + "unevaluatedProperties": {"$dynamicRef": "#meta"} + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json new file mode 100644 index 000000000..e0ae13d9d --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/validation": true + }, + "$dynamicAnchor": "meta", + + "title": "Validation vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "type": { + "anyOf": [ + {"$ref": "#/$defs/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/$defs/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, + "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, + "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, + "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/$defs/stringArray"}, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json b/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json new file mode 100644 index 000000000..1c68270fd --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/schema", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/core": true, + "https://json-schema.org/draft/2020-12/vocab/applicator": true, + "https://json-schema.org/draft/2020-12/vocab/unevaluated": true, + "https://json-schema.org/draft/2020-12/vocab/validation": true, + "https://json-schema.org/draft/2020-12/vocab/meta-data": true, + "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + "$dynamicAnchor": "meta", + + "title": "Core and Validation specifications meta-schema", + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/unevaluated"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format-annotation"}, + {"$ref": "meta/content"} + ], + "type": ["object", "boolean"], + "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", + "properties": { + "definitions": { + "$comment": "\"definitions\" has been replaced by \"$defs\".", + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "deprecated": true, + "default": {} + }, + "dependencies": { + "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.", + "type": "object", + "additionalProperties": { + "anyOf": [{"$dynamicRef": "#meta"}, {"$ref": "meta/validation#/$defs/stringArray"}] + }, + "deprecated": true, + "default": {} + }, + "$recursiveAnchor": { + "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".", + "$ref": "meta/core#/$defs/anchorString", + "deprecated": true + }, + "$recursiveRef": { + "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".", + "$ref": "meta/core#/$defs/uriReferenceString", + "deprecated": true + } + } +} diff --git a/node_modules/ajv/dist/refs/json-schema-draft-06.json b/node_modules/ajv/dist/refs/json-schema-draft-06.json new file mode 100644 index 000000000..5410064ba --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-draft-06.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "http://json-schema.org/draft-06/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "examples": { + "type": "array", + "items": {} + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": {} + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": {}, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": {} +} diff --git a/node_modules/ajv/dist/refs/json-schema-draft-07.json b/node_modules/ajv/dist/refs/json-schema-draft-07.json new file mode 100644 index 000000000..6a7485104 --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-draft-07.json @@ -0,0 +1,151 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": true + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": true +} diff --git a/node_modules/ajv/dist/refs/json-schema-secure.json b/node_modules/ajv/dist/refs/json-schema-secure.json new file mode 100644 index 000000000..3968abd5d --- /dev/null +++ b/node_modules/ajv/dist/refs/json-schema-secure.json @@ -0,0 +1,88 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#", + "title": "Meta-schema for the security assessment of JSON Schemas", + "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + } + }, + "dependencies": { + "patternProperties": { + "description": "prevent slow validation of large property names", + "required": ["propertyNames"], + "properties": { + "propertyNames": { + "required": ["maxLength"] + } + } + }, + "uniqueItems": { + "description": "prevent slow validation of large non-scalar arrays", + "if": { + "properties": { + "uniqueItems": {"const": true}, + "items": { + "properties": { + "type": { + "anyOf": [ + { + "enum": ["object", "array"] + }, + { + "type": "array", + "contains": {"enum": ["object", "array"]} + } + ] + } + } + } + } + }, + "then": { + "required": ["maxItems"] + } + }, + "pattern": { + "description": "prevent slow pattern matching of large strings", + "required": ["maxLength"] + }, + "format": { + "description": "prevent slow format validation of large strings", + "required": ["maxLength"] + } + }, + "properties": { + "additionalItems": {"$ref": "#"}, + "additionalProperties": {"$ref": "#"}, + "dependencies": { + "additionalProperties": { + "anyOf": [{"type": "array"}, {"$ref": "#"}] + } + }, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}] + }, + "definitions": { + "additionalProperties": {"$ref": "#"} + }, + "patternProperties": { + "additionalProperties": {"$ref": "#"} + }, + "properties": { + "additionalProperties": {"$ref": "#"} + }, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"}, + "contains": {"$ref": "#"}, + "propertyNames": {"$ref": "#"} + } +} diff --git a/node_modules/ajv/dist/refs/jtd-schema.d.ts b/node_modules/ajv/dist/refs/jtd-schema.d.ts new file mode 100644 index 000000000..932797a38 --- /dev/null +++ b/node_modules/ajv/dist/refs/jtd-schema.d.ts @@ -0,0 +1,3 @@ +import { SchemaObject } from "../types"; +declare const jtdMetaSchema: SchemaObject; +export default jtdMetaSchema; diff --git a/node_modules/ajv/dist/refs/jtd-schema.js b/node_modules/ajv/dist/refs/jtd-schema.js new file mode 100644 index 000000000..1ee940afb --- /dev/null +++ b/node_modules/ajv/dist/refs/jtd-schema.js @@ -0,0 +1,118 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const shared = (root) => { + const sch = { + nullable: { type: "boolean" }, + metadata: { + optionalProperties: { + union: { elements: { ref: "schema" } }, + }, + additionalProperties: true, + }, + }; + if (root) + sch.definitions = { values: { ref: "schema" } }; + return sch; +}; +const emptyForm = (root) => ({ + optionalProperties: shared(root), +}); +const refForm = (root) => ({ + properties: { + ref: { type: "string" }, + }, + optionalProperties: shared(root), +}); +const typeForm = (root) => ({ + properties: { + type: { + enum: [ + "boolean", + "timestamp", + "string", + "float32", + "float64", + "int8", + "uint8", + "int16", + "uint16", + "int32", + "uint32", + ], + }, + }, + optionalProperties: shared(root), +}); +const enumForm = (root) => ({ + properties: { + enum: { elements: { type: "string" } }, + }, + optionalProperties: shared(root), +}); +const elementsForm = (root) => ({ + properties: { + elements: { ref: "schema" }, + }, + optionalProperties: shared(root), +}); +const propertiesForm = (root) => ({ + properties: { + properties: { values: { ref: "schema" } }, + }, + optionalProperties: { + optionalProperties: { values: { ref: "schema" } }, + additionalProperties: { type: "boolean" }, + ...shared(root), + }, +}); +const optionalPropertiesForm = (root) => ({ + properties: { + optionalProperties: { values: { ref: "schema" } }, + }, + optionalProperties: { + additionalProperties: { type: "boolean" }, + ...shared(root), + }, +}); +const discriminatorForm = (root) => ({ + properties: { + discriminator: { type: "string" }, + mapping: { + values: { + metadata: { + union: [propertiesForm(false), optionalPropertiesForm(false)], + }, + }, + }, + }, + optionalProperties: shared(root), +}); +const valuesForm = (root) => ({ + properties: { + values: { ref: "schema" }, + }, + optionalProperties: shared(root), +}); +const schema = (root) => ({ + metadata: { + union: [ + emptyForm, + refForm, + typeForm, + enumForm, + elementsForm, + propertiesForm, + optionalPropertiesForm, + discriminatorForm, + valuesForm, + ].map((s) => s(root)), + }, +}); +const jtdMetaSchema = { + definitions: { + schema: schema(false), + }, + ...schema(true), +}; +exports.default = jtdMetaSchema; +//# sourceMappingURL=jtd-schema.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/refs/jtd-schema.js.map b/node_modules/ajv/dist/refs/jtd-schema.js.map new file mode 100644 index 000000000..d46755b21 --- /dev/null +++ b/node_modules/ajv/dist/refs/jtd-schema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jtd-schema.js","sourceRoot":"","sources":["../../lib/refs/jtd-schema.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAe,CAAC,IAAI,EAAE,EAAE;IAClC,MAAM,GAAG,GAAiB;QACxB,QAAQ,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;QAC3B,QAAQ,EAAE;YACR,kBAAkB,EAAE;gBAClB,KAAK,EAAE,EAAC,QAAQ,EAAE,EAAC,GAAG,EAAE,QAAQ,EAAC,EAAC;aACnC;YACD,oBAAoB,EAAE,IAAI;SAC3B;KACF,CAAA;IACD,IAAI,IAAI;QAAE,GAAG,CAAC,WAAW,GAAG,EAAC,MAAM,EAAE,EAAC,GAAG,EAAE,QAAQ,EAAC,EAAC,CAAA;IACrD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,MAAM,SAAS,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACvC,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC;CACjC,CAAC,CAAA;AAEF,MAAM,OAAO,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACrC,UAAU,EAAE;QACV,GAAG,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;KACtB;IACD,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC;CACjC,CAAC,CAAA;AAEF,MAAM,QAAQ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ist/runtime/equal.d.ts new file mode 100644 index 000000000..777cae20e --- /dev/null +++ b/node_modules/ajv/dist/runtime/equal.d.ts @@ -0,0 +1,6 @@ +import * as equal from "fast-deep-equal"; +type Equal = typeof equal & { + code: string; +}; +declare const _default: Equal; +export default _default; diff --git a/node_modules/ajv/dist/runtime/equal.js b/node_modules/ajv/dist/runtime/equal.js new file mode 100644 index 000000000..774bba05a --- /dev/null +++ b/node_modules/ajv/dist/runtime/equal.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// https://github.com/ajv-validator/ajv/issues/889 +const equal = require("fast-deep-equal"); +equal.code = 'require("ajv/dist/runtime/equal").default'; +exports.default = equal; +//# sourceMappingURL=equal.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/equal.js.map b/node_modules/ajv/dist/runtime/equal.js.map new file mode 100644 index 000000000..0e17901c3 --- /dev/null +++ b/node_modules/ajv/dist/runtime/equal.js.map @@ -0,0 +1 @@ +{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../lib/runtime/equal.ts"],"names":[],"mappings":";;AAAA,kDAAkD;AAClD,yCAAwC;AAGtC,KAAe,CAAC,IAAI,GAAG,2CAA2C,CAAA;AAEpE,kBAAe,KAAc,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/parseJson.d.ts b/node_modules/ajv/dist/runtime/parseJson.d.ts new file mode 100644 index 000000000..85f1d5670 --- /dev/null +++ b/node_modules/ajv/dist/runtime/parseJson.d.ts @@ -0,0 +1,18 @@ +export declare function parseJson(s: string, pos: number): unknown; +export declare namespace parseJson { + var message: string | undefined; + var position: number; + var code: string; +} +export declare function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined; +export declare namespace parseJsonNumber { + var message: string | undefined; + var position: number; + var code: string; +} +export declare function parseJsonString(s: string, pos: number): string | undefined; +export declare namespace parseJsonString { + var message: string | undefined; + var position: number; + var code: string; +} diff --git a/node_modules/ajv/dist/runtime/parseJson.js b/node_modules/ajv/dist/runtime/parseJson.js new file mode 100644 index 000000000..7ebbc1bfc --- /dev/null +++ b/node_modules/ajv/dist/runtime/parseJson.js @@ -0,0 +1,184 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseJsonString = exports.parseJsonNumber = exports.parseJson = void 0; +const rxParseJson = /position\s(\d+)$/; +function parseJson(s, pos) { + let endPos; + parseJson.message = undefined; + let matches; + if (pos) + s = s.slice(pos); + try { + parseJson.position = pos + s.length; + return JSON.parse(s); + } + catch (e) { + matches = rxParseJson.exec(e.message); + if (!matches) { + parseJson.message = "unexpected end"; + return undefined; + } + endPos = +matches[1]; + const c = s[endPos]; + s = s.slice(0, endPos); + parseJson.position = pos + endPos; + try { + return JSON.parse(s); + } + catch (e1) { + parseJson.message = `unexpected token ${c}`; + return undefined; + } + } +} +exports.parseJson = parseJson; +parseJson.message = undefined; +parseJson.position = 0; +parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson'; +function parseJsonNumber(s, pos, maxDigits) { + let numStr = ""; + let c; + parseJsonNumber.message = undefined; + if (s[pos] === "-") { + numStr += "-"; + pos++; + } + if (s[pos] === "0") { + numStr += "0"; + pos++; + } + else { + if (!parseDigits(maxDigits)) { + errorMessage(); + return undefined; + } + } + if (maxDigits) { + parseJsonNumber.position = pos; + return +numStr; + } + if (s[pos] === ".") { + numStr += "."; + pos++; + if (!parseDigits()) { + errorMessage(); + return undefined; + } + } + if (((c = s[pos]), c === "e" || c === "E")) { + numStr += "e"; + pos++; + if (((c = s[pos]), c === "+" || c === "-")) { + numStr += c; + pos++; + } + if (!parseDigits()) { + errorMessage(); + return undefined; + } + } + parseJsonNumber.position = pos; + return +numStr; + function parseDigits(maxLen) { + let digit = false; + while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) { + digit = true; + numStr += c; + pos++; + } + return digit; + } + function errorMessage() { + parseJsonNumber.position = pos; + parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end"; + } +} +exports.parseJsonNumber = parseJsonNumber; +parseJsonNumber.message = undefined; +parseJsonNumber.position = 0; +parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber'; +const escapedChars = { + b: "\b", + f: "\f", + n: "\n", + r: "\r", + t: "\t", + '"': '"', + "/": "/", + "\\": "\\", +}; +const CODE_A = "a".charCodeAt(0); +const CODE_0 = "0".charCodeAt(0); +function parseJsonString(s, pos) { + let str = ""; + let c; + parseJsonString.message = undefined; + // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition + while (true) { + c = s[pos++]; + if (c === '"') + break; + if (c === "\\") { + c = s[pos]; + if (c in escapedChars) { + str += escapedChars[c]; + pos++; + } + else if (c === "u") { + pos++; + let count = 4; + let code = 0; + while (count--) { + code <<= 4; + c = s[pos]; + if (c === undefined) { + errorMessage("unexpected end"); + return undefined; + } + c = c.toLowerCase(); + if (c >= "a" && c <= "f") { + code += c.charCodeAt(0) - CODE_A + 10; + } + else if (c >= "0" && c <= "9") { + code += c.charCodeAt(0) - CODE_0; + } + else { + errorMessage(`unexpected token ${c}`); + return undefined; + } + pos++; + } + str += String.fromCharCode(code); + } + else { + errorMessage(`unexpected token ${c}`); + return undefined; + } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + } + else if (c === undefined) { + errorMessage("unexpected end"); + return undefined; + } + else { + if (c.charCodeAt(0) >= 0x20) { + str += c; + } + else { + errorMessage(`unexpected token ${c}`); + return undefined; + } + } + } + parseJsonString.position = pos; + return str; + function errorMessage(msg) { + parseJsonString.position = pos; + parseJsonString.message = msg; + } +} +exports.parseJsonString = parseJsonString; +parseJsonString.message = undefined; +parseJsonString.position = 0; +parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString'; +//# sourceMappingURL=parseJson.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/parseJson.js.map b/node_modules/ajv/dist/runtime/parseJson.js.map new file mode 100644 index 000000000..7f239fb71 --- /dev/null +++ b/node_modules/ajv/dist/runtime/parseJson.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parseJson.js","sourceRoot":"","sources":["../../lib/runtime/parseJson.ts"],"names":[],"mappings":";;;AAAA,MAAM,WAAW,GAAG,kBAAkB,CAAA;AAEtC,SAAgB,SAAS,CAAC,CAAS,EAAE,GAAW;IAC9C,IAAI,MAA0B,CAAA;IAC9B,SAAS,CAAC,OAAO,GAAG,SAAS,CAAA;IAC7B,IAAI,OAA+B,CAAA;IACnC,IAAI,GAAG;QAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACzB,IAAI;QACF,SAAS,CAAC,QAAQ,GAAG,GAAG,GAAG,CAAC,CAAC,MAAM,CAAA;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;KACrB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,GAAG,WAAW,CAAC,IAAI,CAAE,CAAW,CAAC,OAAO,CAAC,CAAA;QAChD,IAAI,CAAC,OAAO,EAAE;YACZ,SAAS,CAAC,OAAO,GAAG,gBAAgB,CAAA;YACpC,OAAO,SAAS,CAAA;SACjB;QACD,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QACpB,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;QACnB,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;QACtB,SAAS,CAAC,QAAQ,GAAG,GAAG,GAAG,MAAM,CAAA;QACjC,IAAI;YACF,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;SACrB;QAAC,OAAO,EAAE,EAAE;YACX,SAAS,CAAC,OAAO,GAAG,oBAAoB,CAAC,EAAE,CAAA;YAC3C,OAAO,SAAS,CAAA;SACjB;KACF;AACH,CAAC;AAzBD,8BAyBC;AAED,SAAS,CAAC,OAAO,GAAG,SAA+B,CAAA;AACnD,SAAS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wBACL,YAAY,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAA;wBACrC,OAAO,SAAS,CAAA;qBACjB;oBACD,GAAG,EAAE,CAAA;iBACN;gBACD,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;aACjC;iBAAM;gBACL,YAAY,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAA;gBACrC,OAAO,SAAS,CAAA;aACjB;YACD,uEAAuE;SACxE;aAAM,IAAI,CAAC,KAAK,SAAS,EAAE;YAC1B,YAAY,CAAC,gBAAgB,CAAC,CAAA;YAC9B,OAAO,SAAS,CAAA;SACjB;aAAM;YACL,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;gBAC3B,GAAG,IAAI,CAAC,CAAA;aACT;iBAAM;gBACL,YAAY,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAA;gBACrC,OAAO,SAAS,CAAA;aACjB;SACF;KACF;IACD,eAAe,CAAC,QAAQ,GAAG,GAAG,CAAA;IAC9B,OAAO,GAAG,CAAA;IAEV,SAAS,YAAY,CAAC,GAAW;QAC/B,eAAe,CAAC,QAAQ,GAAG,GAAG,CAAA;QAC9B,eAAe,CAAC,OAAO,GAAG,GAAG,CAAA;IAC/B,CAAC;AACH,CAAC;AA5DD,0CA4DC;AAED,eAAe,CAAC,OAAO,GAAG,SAA+B,CAAA;AACzD,eAAe,CAAC,QAAQ,GAAG,CAAW,CAAA;AACtC,eAAe,CAAC,IAAI,GAAG,uDAAuD,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/quote.d.ts b/node_modules/ajv/dist/runtime/quote.d.ts new file mode 100644 index 000000000..0579dd3c6 --- /dev/null +++ b/node_modules/ajv/dist/runtime/quote.d.ts @@ -0,0 +1,5 @@ +declare function quote(s: string): string; +declare namespace quote { + var code: string; +} +export default quote; diff --git a/node_modules/ajv/dist/runtime/quote.js b/node_modules/ajv/dist/runtime/quote.js new file mode 100644 index 000000000..ebf78f70d --- /dev/null +++ b/node_modules/ajv/dist/runtime/quote.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const rxEscapable = +// eslint-disable-next-line no-control-regex, no-misleading-character-class +/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; +const escaped = { + "\b": "\\b", + "\t": "\\t", + "\n": "\\n", + "\f": "\\f", + "\r": "\\r", + '"': '\\"', + "\\": "\\\\", +}; +function quote(s) { + rxEscapable.lastIndex = 0; + return ('"' + + (rxEscapable.test(s) + ? s.replace(rxEscapable, (a) => { + const c = escaped[a]; + return typeof c === "string" + ? c + : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4); + }) + : s) + + '"'); +} +exports.default = quote; +quote.code = 'require("ajv/dist/runtime/quote").default'; +//# sourceMappingURL=quote.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/quote.js.map b/node_modules/ajv/dist/runtime/quote.js.map new file mode 100644 index 000000000..4d226252d --- /dev/null +++ b/node_modules/ajv/dist/runtime/quote.js.map @@ -0,0 +1 @@ +{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../lib/runtime/quote.ts"],"names":[],"mappings":";;AAAA,MAAM,WAAW;AACf,2EAA2E;AAC3E,iIAAiI,CAAA;AAEnI,MAAM,OAAO,GAA6B;IACxC,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAA;AAED,SAAwB,KAAK,CAAC,CAAS;IACrC,WAAW,CAAC,SAAS,GAAG,CAAC,CAAA;IACzB,OAAO,CACL,GAAG;QACH,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;gBAC3B,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;gBACpB,OAAO,OAAO,CAAC,KAAK,QAAQ;oBAC1B,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;YAC/D,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC,CAAC;QACN,GAAG,CACJ,CAAA;AACH,CAAC;AAdD,wBAcC;AAED,KAAK,CAAC,IAAI,GAAG,2CAA2C,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/re2.d.ts b/node_modules/ajv/dist/runtime/re2.d.ts new file mode 100644 index 000000000..c34a98f2f --- /dev/null +++ b/node_modules/ajv/dist/runtime/re2.d.ts @@ -0,0 +1,6 @@ +import * as re2 from "re2"; +type Re2 = typeof re2 & { + code: string; +}; +declare const _default: Re2; +export default _default; diff --git a/node_modules/ajv/dist/runtime/re2.js b/node_modules/ajv/dist/runtime/re2.js new file mode 100644 index 000000000..4b1ee2537 --- /dev/null +++ b/node_modules/ajv/dist/runtime/re2.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const re2 = require("re2"); +re2.code = 'require("ajv/dist/runtime/re2").default'; +exports.default = re2; +//# sourceMappingURL=re2.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/re2.js.map b/node_modules/ajv/dist/runtime/re2.js.map new file mode 100644 index 000000000..bb938a2c4 --- /dev/null +++ b/node_modules/ajv/dist/runtime/re2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"re2.js","sourceRoot":"","sources":["../../lib/runtime/re2.ts"],"names":[],"mappings":";;AAAA,2BAA0B;AAGxB,GAAW,CAAC,IAAI,GAAG,yCAAyC,CAAA;AAE9D,kBAAe,GAAU,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/timestamp.d.ts b/node_modules/ajv/dist/runtime/timestamp.d.ts new file mode 100644 index 000000000..cd4832688 --- /dev/null +++ b/node_modules/ajv/dist/runtime/timestamp.d.ts @@ -0,0 +1,5 @@ +declare function validTimestamp(str: string, allowDate: boolean): boolean; +declare namespace validTimestamp { + var code: string; +} +export default validTimestamp; diff --git a/node_modules/ajv/dist/runtime/timestamp.js b/node_modules/ajv/dist/runtime/timestamp.js new file mode 100644 index 000000000..5e0f06564 --- /dev/null +++ b/node_modules/ajv/dist/runtime/timestamp.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const DT_SEPARATOR = /t|\s/i; +const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; +const TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i; +const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; +function validTimestamp(str, allowDate) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + const dt = str.split(DT_SEPARATOR); + return ((dt.length === 2 && validDate(dt[0]) && validTime(dt[1])) || + (allowDate && dt.length === 1 && validDate(dt[0]))); +} +exports.default = validTimestamp; +function validDate(str) { + const matches = DATE.exec(str); + if (!matches) + return false; + const y = +matches[1]; + const m = +matches[2]; + const d = +matches[3]; + return (m >= 1 && + m <= 12 && + d >= 1 && + (d <= DAYS[m] || + // leap year: https://tools.ietf.org/html/rfc3339#appendix-C + (m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0)))); +} +function validTime(str) { + const matches = TIME.exec(str); + if (!matches) + return false; + const hr = +matches[1]; + const min = +matches[2]; + const sec = +matches[3]; + const tzH = +(matches[4] || 0); + const tzM = +(matches[5] || 0); + return ((hr <= 23 && min <= 59 && sec <= 59) || + // leap second + (hr - tzH === 23 && min - tzM === 59 && sec === 60)); +} +validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default'; +//# sourceMappingURL=timestamp.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/timestamp.js.map b/node_modules/ajv/dist/runtime/timestamp.js.map new file mode 100644 index 000000000..6b0eee039 --- /dev/null +++ b/node_modules/ajv/dist/runtime/timestamp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../lib/runtime/timestamp.ts"],"names":[],"mappings":";;AAAA,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,IAAI,GAAG,4BAA4B,CAAA;AACzC,MAAM,IAAI,GAAG,gEAAgE,CAAA;AAC7E,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;AAEhE,SAAwB,cAAc,CAAC,GAAW,EAAE,SAAkB;IACpE,iDAAiD;IACjD,MAAM,EAAE,GAAa,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IAC5C,OAAO,CACL,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACzD,CAAC,SAAS,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CACnD,CAAA;AACH,CAAC;AAPD,iCAOC;AAED,SAAS,SAAS,CAAC,GAAW;IAC5B,MAAM,OAAO,GAAoB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC/C,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CA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GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,CAAC,CACpD,CAAA;AACH,CAAC;AAED,cAAc,CAAC,IAAI,GAAG,+CAA+C,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/ucs2length.d.ts b/node_modules/ajv/dist/runtime/ucs2length.d.ts new file mode 100644 index 000000000..ecbee69c5 --- /dev/null +++ b/node_modules/ajv/dist/runtime/ucs2length.d.ts @@ -0,0 +1,5 @@ +declare function ucs2length(str: string): number; +declare namespace ucs2length { + var code: string; +} +export default ucs2length; diff --git a/node_modules/ajv/dist/runtime/ucs2length.js b/node_modules/ajv/dist/runtime/ucs2length.js new file mode 100644 index 000000000..92ea0c08a --- /dev/null +++ b/node_modules/ajv/dist/runtime/ucs2length.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// https://mathiasbynens.be/notes/javascript-encoding +// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode +function ucs2length(str) { + const len = str.length; + let length = 0; + let pos = 0; + let value; + while (pos < len) { + length++; + value = str.charCodeAt(pos++); + if (value >= 0xd800 && value <= 0xdbff && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xfc00) === 0xdc00) + pos++; // low surrogate + } + } + return length; +} +exports.default = ucs2length; +ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'; +//# sourceMappingURL=ucs2length.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/ucs2length.js.map b/node_modules/ajv/dist/runtime/ucs2length.js.map new file mode 100644 index 000000000..7c7f78865 --- /dev/null +++ b/node_modules/ajv/dist/runtime/ucs2length.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ucs2length.js","sourceRoot":"","sources":["../../lib/runtime/ucs2length.ts"],"names":[],"mappings":";;AAAA,qDAAqD;AACrD,iEAAiE;AACjE,SAAwB,UAAU,CAAC,GAAW;IAC5C,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAA;IACtB,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,IAAI,GAAG,GAAG,CAAC,CAAA;IACX,IAAI,KAAa,CAAA;IACjB,OAAO,GAAG,GAAG,GAAG,EAAE;QAChB,MAAM,EAAE,CAAA;QACR,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAA;QAC7B,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,IAAI,GAAG,GAAG,GAAG,EAAE;YACnD,gDAAgD;YAChD,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;YAC3B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,MAAM;gBAAE,GAAG,EAAE,CAAA,CAAC,gBAAgB;SACxD;KACF;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAfD,6BAeC;AAED,UAAU,CAAC,IAAI,GAAG,gDAAgD,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/uri.d.ts b/node_modules/ajv/dist/runtime/uri.d.ts new file mode 100644 index 000000000..4690868fa --- /dev/null +++ b/node_modules/ajv/dist/runtime/uri.d.ts @@ -0,0 +1,6 @@ +import * as uri from "uri-js"; +type URI = typeof uri & { + code: string; +}; +declare const _default: URI; +export default _default; diff --git a/node_modules/ajv/dist/runtime/uri.js b/node_modules/ajv/dist/runtime/uri.js new file mode 100644 index 000000000..fbd38151f --- /dev/null +++ b/node_modules/ajv/dist/runtime/uri.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const uri = require("uri-js"); +uri.code = 'require("ajv/dist/runtime/uri").default'; +exports.default = uri; +//# sourceMappingURL=uri.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/uri.js.map b/node_modules/ajv/dist/runtime/uri.js.map new file mode 100644 index 000000000..701bed950 --- /dev/null +++ b/node_modules/ajv/dist/runtime/uri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../lib/runtime/uri.ts"],"names":[],"mappings":";;AAAA,8BAA6B;AAG3B,GAAW,CAAC,IAAI,GAAG,yCAAyC,CAAA;AAE9D,kBAAe,GAAU,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/validation_error.d.ts b/node_modules/ajv/dist/runtime/validation_error.d.ts new file mode 100644 index 000000000..b0ee9698f --- /dev/null +++ b/node_modules/ajv/dist/runtime/validation_error.d.ts @@ -0,0 +1,7 @@ +import type { ErrorObject } from "../types"; +export default class ValidationError extends Error { + readonly errors: Partial[]; + readonly ajv: true; + readonly validation: true; + constructor(errors: Partial[]); +} diff --git a/node_modules/ajv/dist/runtime/validation_error.js b/node_modules/ajv/dist/runtime/validation_error.js new file mode 100644 index 000000000..353502c08 --- /dev/null +++ b/node_modules/ajv/dist/runtime/validation_error.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ValidationError extends Error { + constructor(errors) { + super("validation failed"); + this.errors = errors; + this.ajv = this.validation = true; + } +} +exports.default = ValidationError; +//# sourceMappingURL=validation_error.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/validation_error.js.map b/node_modules/ajv/dist/runtime/validation_error.js.map new file mode 100644 index 000000000..70206fbc1 --- /dev/null +++ b/node_modules/ajv/dist/runtime/validation_error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validation_error.js","sourceRoot":"","sources":["../../lib/runtime/validation_error.ts"],"names":[],"mappings":";;AAEA,MAAqB,eAAgB,SAAQ,KAAK;IAKhD,YAAY,MAA8B;QACxC,KAAK,CAAC,mBAAmB,CAAC,CAAA;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;IACnC,CAAC;CACF;AAVD,kCAUC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/standalone/index.d.ts b/node_modules/ajv/dist/standalone/index.d.ts new file mode 100644 index 000000000..a9141c3d2 --- /dev/null +++ b/node_modules/ajv/dist/standalone/index.d.ts @@ -0,0 +1,6 @@ +import type AjvCore from "../core"; +import type { AnyValidateFunction } from "../types"; +declare function standaloneCode(ajv: AjvCore, refsOrFunc?: { + [K in string]?: string; +} | AnyValidateFunction): string; +export default standaloneCode; diff --git a/node_modules/ajv/dist/standalone/index.js b/node_modules/ajv/dist/standalone/index.js new file mode 100644 index 000000000..b44bb5db5 --- /dev/null +++ b/node_modules/ajv/dist/standalone/index.js @@ -0,0 +1,90 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_1 = require("../compile/codegen/scope"); +const code_1 = require("../compile/codegen/code"); +function standaloneCode(ajv, refsOrFunc) { + if (!ajv.opts.code.source) { + throw new Error("moduleCode: ajv instance must have code.source option"); + } + const { _n } = ajv.scope.opts; + return typeof refsOrFunc == "function" + ? funcExportCode(refsOrFunc.source) + : refsOrFunc !== undefined + ? multiExportsCode(refsOrFunc, getValidate) + : multiExportsCode(ajv.schemas, (sch) => sch.meta ? undefined : ajv.compile(sch.schema)); + function getValidate(id) { + const v = ajv.getSchema(id); + if (!v) + throw new Error(`moduleCode: no schema with id ${id}`); + return v; + } + function funcExportCode(source) { + const usedValues = {}; + const n = source === null || source === void 0 ? void 0 : source.validateName; + const vCode = validateCode(usedValues, source); + if (ajv.opts.code.esm) { + // Always do named export as `validate` rather than the variable `n` which is `validateXX` for known export value + return `"use strict";${_n}export const validate = ${n};${_n}export default ${n};${_n}${vCode}`; + } + return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}`; + } + function multiExportsCode(schemas, getValidateFunc) { + var _a; + const usedValues = {}; + let code = (0, code_1._) `"use strict";`; + for (const name in schemas) { + const v = getValidateFunc(schemas[name]); + if (v) { + const vCode = validateCode(usedValues, v.source); + const exportSyntax = ajv.opts.code.esm + ? (0, code_1._) `export const ${(0, code_1.getEsmExportName)(name)}` + : (0, code_1._) `exports${(0, code_1.getProperty)(name)}`; + code = (0, code_1._) `${code}${_n}${exportSyntax} = ${(_a = v.source) === null || _a === void 0 ? void 0 : _a.validateName};${_n}${vCode}`; + } + } + return `${code}`; + } + function validateCode(usedValues, s) { + if (!s) + throw new Error('moduleCode: function does not have "source" property'); + if (usedState(s.validateName) === scope_1.UsedValueState.Completed) + return code_1.nil; + setUsedState(s.validateName, scope_1.UsedValueState.Started); + const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode); + const code = new code_1._Code(`${scopeCode}${_n}${s.validateCode}`); + return s.evaluated ? (0, code_1._) `${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code; + function refValidateCode(n) { + var _a; + const vRef = (_a = n.value) === null || _a === void 0 ? void 0 : _a.ref; + if (n.prefix === "validate" && typeof vRef == "function") { + const v = vRef; + return validateCode(usedValues, v.source); + } + else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") { + const { validate, validateName } = vRef; + if (!validateName) + throw new Error("ajv internal error"); + const def = ajv.opts.code.es5 ? scope_1.varKinds.var : scope_1.varKinds.const; + const wrapper = (0, code_1._) `${def} ${n} = {validate: ${validateName}};`; + if (usedState(validateName) === scope_1.UsedValueState.Started) + return wrapper; + const vCode = validateCode(usedValues, validate === null || validate === void 0 ? void 0 : validate.source); + return (0, code_1._) `${wrapper}${_n}${vCode}`; + } + return undefined; + } + function usedState(name) { + var _a; + return (_a = usedValues[name.prefix]) === null || _a === void 0 ? void 0 : _a.get(name); + } + function setUsedState(name, state) { + const { prefix } = name; + const names = (usedValues[prefix] = usedValues[prefix] || new Map()); + names.set(name, state); + } + } +} +module.exports = exports = standaloneCode; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = standaloneCode; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/standalone/index.js.map b/node_modules/ajv/dist/standalone/index.js.map new file mode 100644 index 000000000..11864d36e --- /dev/null +++ b/node_modules/ajv/dist/standalone/index.js.map @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,MAAM,OAAO,GAAG,IAAA,QAAC,EAAA,GAAG,GAAG,IAAI,CAAC,iBAAiB,YAAY,IAAI,CAAA;gBAC7D,IAAI,SAAS,CAAC,YAAY,CAAC,KAAK,sBAAc,CAAC,OAAO;oBAAE,OAAO,OAAO,CAAA;gBACtE,MAAM,KAAK,GAAG,YAAY,CAAC,UAAU,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,CAAA;gBACxD,OAAO,IAAA,QAAC,EAAA,GAAG,OAAO,GAAG,EAAE,GAAG,KAAK,EAAE,CAAA;aAClC;YACD,OAAO,SAAS,CAAA;QAClB,CAAC;QAED,SAAS,SAAS,CAAC,IAAoB;;YACrC,OAAO,MAAA,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,0CAAE,GAAG,CAAC,IAAI,CAAC,CAAA;QAC3C,CAAC;QAED,SAAS,YAAY,CAAC,IAAoB,EAAE,KAAqB;YAC/D,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAA;YACrB,MAAM,KAAK,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC,CAAA;YACpE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,cAAc,CAAA;AACzC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,cAAc,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/standalone/instance.d.ts b/node_modules/ajv/dist/standalone/instance.d.ts new file mode 100644 index 000000000..156ac3226 --- /dev/null +++ b/node_modules/ajv/dist/standalone/instance.d.ts @@ -0,0 +1,12 @@ +import Ajv, { AnySchema, AnyValidateFunction, ErrorObject } from "../core"; +export default class AjvPack { + readonly ajv: Ajv; + errors?: ErrorObject[] | null; + constructor(ajv: Ajv); + validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise; + compile(schema: AnySchema, meta?: boolean): AnyValidateFunction; + getSchema(keyRef: string): AnyValidateFunction | undefined; + private getStandalone; + addSchema(...args: Parameters): AjvPack; + addKeyword(...args: Parameters): AjvPack; +} diff --git a/node_modules/ajv/dist/standalone/instance.js b/node_modules/ajv/dist/standalone/instance.js new file mode 100644 index 000000000..35e5c9925 --- /dev/null +++ b/node_modules/ajv/dist/standalone/instance.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("../core"); +const _1 = require("."); +const requireFromString = require("require-from-string"); +class AjvPack { + constructor(ajv) { + this.ajv = ajv; + } + validate(schemaKeyRef, data) { + return core_1.default.prototype.validate.call(this, schemaKeyRef, data); + } + compile(schema, meta) { + return this.getStandalone(this.ajv.compile(schema, meta)); + } + getSchema(keyRef) { + const v = this.ajv.getSchema(keyRef); + if (!v) + return undefined; + return this.getStandalone(v); + } + getStandalone(v) { + return requireFromString((0, _1.default)(this.ajv, v)); + } + addSchema(...args) { + this.ajv.addSchema.call(this.ajv, ...args); + return this; + } + addKeyword(...args) { + this.ajv.addKeyword.call(this.ajv, ...args); + return this; + } +} +exports.default = AjvPack; +//# sourceMappingURL=instance.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/standalone/instance.js.map b/node_modules/ajv/dist/standalone/instance.js.map new file mode 100644 index 000000000..6ac33b114 --- /dev/null +++ b/node_modules/ajv/dist/standalone/instance.js.map @@ -0,0 +1 @@ +{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../lib/standalone/instance.ts"],"names":[],"mappings":";;AAAA,kCAAwE;AACxE,wBAA8B;AAC9B,yDAAwD;AAExD,MAAqB,OAAO;IAE1B,YAAqB,GAAQ;QAAR,QAAG,GAAH,GAAG,CAAK;IAAG,CAAC;IAEjC,QAAQ,CAAC,YAAgC,EAAE,IAAa;QACtD,OAAO,cAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;IAC9D,CAAC;IAED,OAAO,CAAc,MAAiB,EAAE,IAAc;QACpD,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAI,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;IAC9D,CAAC;IAED,SAAS,CAAc,MAAc;QACnC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAI,MAAM,CAAC,CAAA;QACvC,IAAI,CAAC,CAAC;YAAE,OAAO,SAAS,CAAA;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;IAC9B,CAAC;IAEO,aAAa,CAAc,CAAyB;QAC1D,OAAO,iBAAiB,CAAC,IAAA,UAAc,EAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAA2B,CAAA;IACjF,CAAC;IAED,SAAS,CAAC,GAAG,IAAgD;QAC3D,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;QAC1C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,UAAU,CAAC,GAAG,IAAiD;QAC7D,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;QAC3C,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AA/BD,0BA+BC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/types/index.d.ts b/node_modules/ajv/dist/types/index.d.ts new file mode 100644 index 000000000..485440e9b --- /dev/null +++ b/node_modules/ajv/dist/types/index.d.ts @@ -0,0 +1,183 @@ +import * as URI from "uri-js"; +import type { CodeGen, Code, Name, ScopeValueSets, ValueScopeName } from "../compile/codegen"; +import type { SchemaEnv, SchemaCxt, SchemaObjCxt } from "../compile"; +import type { JSONType } from "../compile/rules"; +import type { KeywordCxt } from "../compile/validate"; +import type Ajv from "../core"; +interface _SchemaObject { + id?: string; + $id?: string; + $schema?: string; + [x: string]: any; +} +export interface SchemaObject extends _SchemaObject { + id?: string; + $id?: string; + $schema?: string; + $async?: false; + [x: string]: any; +} +export interface AsyncSchema extends _SchemaObject { + $async: true; +} +export type AnySchemaObject = SchemaObject | AsyncSchema; +export type Schema = SchemaObject | boolean; +export type AnySchema = Schema | AsyncSchema; +export type SchemaMap = { + [Key in string]?: AnySchema; +}; +export interface SourceCode { + validateName: ValueScopeName; + validateCode: string; + scopeValues: ScopeValueSets; + evaluated?: Code; +} +export interface DataValidationCxt { + instancePath: string; + parentData: { + [K in T]: any; + }; + parentDataProperty: T; + rootData: Record | any[]; + dynamicAnchors: { + [Ref in string]?: ValidateFunction; + }; +} +export interface ValidateFunction { + (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T; + errors?: null | ErrorObject[]; + evaluated?: Evaluated; + schema: AnySchema; + schemaEnv: SchemaEnv; + source?: SourceCode; +} +export interface JTDParser { + (json: string): T | undefined; + message?: string; + position?: number; +} +export type EvaluatedProperties = { + [K in string]?: true; +} | true; +export type EvaluatedItems = number | true; +export interface Evaluated { + props?: EvaluatedProperties; + items?: EvaluatedItems; + dynamicProps: boolean; + dynamicItems: boolean; +} +export interface AsyncValidateFunction extends ValidateFunction { + (...args: Parameters>): Promise; + $async: true; +} +export type AnyValidateFunction = ValidateFunction | AsyncValidateFunction; +export interface ErrorObject, S = unknown> { + keyword: K; + instancePath: string; + schemaPath: string; + params: P; + propertyName?: string; + message?: string; + schema?: S; + parentSchema?: AnySchemaObject; + data?: unknown; +} +export type ErrorNoParams = ErrorObject, S>; +interface _KeywordDef { + keyword: string | string[]; + type?: JSONType | JSONType[]; + schemaType?: JSONType | JSONType[]; + allowUndefined?: boolean; + $data?: boolean; + implements?: string[]; + before?: string; + post?: boolean; + metaSchema?: AnySchemaObject; + validateSchema?: AnyValidateFunction; + dependencies?: string[]; + error?: KeywordErrorDefinition; + $dataError?: KeywordErrorDefinition; +} +export interface CodeKeywordDefinition extends _KeywordDef { + code: (cxt: KeywordCxt, ruleType?: string) => void; + trackErrors?: boolean; +} +export type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema; +export type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction; +export interface DataValidateFunction { + (...args: Parameters): boolean | Promise; + errors?: Partial[]; +} +export interface SchemaValidateFunction { + (schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): boolean | Promise; + errors?: Partial[]; +} +export interface FuncKeywordDefinition extends _KeywordDef { + validate?: SchemaValidateFunction | DataValidateFunction; + compile?: CompileKeywordFunc; + schema?: boolean; + modifying?: boolean; + async?: boolean; + valid?: boolean; + errors?: boolean | "full"; +} +export interface MacroKeywordDefinition extends FuncKeywordDefinition { + macro: MacroKeywordFunc; +} +export type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition; +export type AddedKeywordDefinition = KeywordDefinition & { + type: JSONType[]; + schemaType: JSONType[]; +}; +export interface KeywordErrorDefinition { + message: string | Code | ((cxt: KeywordErrorCxt) => string | Code); + params?: Code | ((cxt: KeywordErrorCxt) => Code); +} +export type Vocabulary = (KeywordDefinition | string)[]; +export interface KeywordErrorCxt { + gen: CodeGen; + keyword: string; + data: Name; + $data?: string | false; + schema: any; + parentSchema?: AnySchemaObject; + schemaCode: Code | number | boolean; + schemaValue: Code | number | boolean; + schemaType?: JSONType[]; + errsCount?: Name; + params: KeywordCxtParams; + it: SchemaCxt; +} +export type KeywordCxtParams = { + [P in string]?: Code | string | number; +}; +export type FormatValidator = (data: T) => boolean; +export type FormatCompare = (data1: T, data2: T) => number | undefined; +export type AsyncFormatValidator = (data: T) => Promise; +export interface FormatDefinition { + type?: T extends string ? "string" | undefined : "number"; + validate: FormatValidator | (T extends string ? string | RegExp : never); + async?: false | undefined; + compare?: FormatCompare; +} +export interface AsyncFormatDefinition { + type?: T extends string ? "string" | undefined : "number"; + validate: AsyncFormatValidator; + async: true; + compare?: FormatCompare; +} +export type AddedFormat = true | RegExp | FormatValidator | FormatDefinition | FormatDefinition | AsyncFormatDefinition | AsyncFormatDefinition; +export type Format = AddedFormat | string; +export interface RegExpEngine { + (pattern: string, u: string): RegExpLike; + code: string; +} +export interface RegExpLike { + test: (s: string) => boolean; +} +export interface UriResolver { + parse(uri: string): URI.URIComponents; + resolve(base: string, path: string): string; + serialize(component: URI.URIComponents): string; +} +export {}; diff --git a/node_modules/ajv/dist/types/index.js b/node_modules/ajv/dist/types/index.js new file mode 100644 index 000000000..aa219d8f2 --- /dev/null +++ b/node_modules/ajv/dist/types/index.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/types/index.js.map b/node_modules/ajv/dist/types/index.js.map new file mode 100644 index 000000000..1f80f85ec --- /dev/null +++ b/node_modules/ajv/dist/types/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/ajv/dist/types/json-schema.d.ts b/node_modules/ajv/dist/types/json-schema.d.ts new file mode 100644 index 000000000..4774233fc --- /dev/null +++ b/node_modules/ajv/dist/types/json-schema.d.ts @@ -0,0 +1,125 @@ +type StrictNullChecksWrapper = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type; +type UnionToIntersection = (U extends any ? (_: U) => void : never) extends (_: infer I) => void ? I : never; +export type SomeJSONSchema = UncheckedJSONSchemaType; +type UncheckedPartialSchema = Partial>; +export type PartialSchema = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema>; +type JSONType = IsPartial extends true ? T | undefined : T; +interface NumberKeywords { + minimum?: number; + maximum?: number; + exclusiveMinimum?: number; + exclusiveMaximum?: number; + multipleOf?: number; + format?: string; +} +interface StringKeywords { + minLength?: number; + maxLength?: number; + pattern?: string; + format?: string; +} +type UncheckedJSONSchemaType = (// these two unions allow arbitrary unions of types +{ + anyOf: readonly UncheckedJSONSchemaType[]; +} | { + oneOf: readonly UncheckedJSONSchemaType[]; +} | ({ + type: readonly (T extends number ? JSONType<"number" | "integer", IsPartial> : T extends string ? JSONType<"string", IsPartial> : T extends boolean ? JSONType<"boolean", IsPartial> : never)[]; +} & UnionToIntersection) | ((T extends number ? { + type: JSONType<"number" | "integer", IsPartial>; +} & NumberKeywords : T extends string ? { + type: JSONType<"string", IsPartial>; +} & StringKeywords : T extends boolean ? { + type: JSONType<"boolean", IsPartial>; +} : T extends readonly [any, ...any[]] ? { + type: JSONType<"array", IsPartial>; + items: { + readonly [K in keyof T]-?: UncheckedJSONSchemaType & Nullable; + } & { + length: T["length"]; + }; + minItems: T["length"]; +} & ({ + maxItems: T["length"]; +} | { + additionalItems: false; +}) : T extends readonly any[] ? { + type: JSONType<"array", IsPartial>; + items: UncheckedJSONSchemaType; + contains?: UncheckedPartialSchema; + minItems?: number; + maxItems?: number; + minContains?: number; + maxContains?: number; + uniqueItems?: true; + additionalItems?: never; +} : T extends Record ? { + type: JSONType<"object", IsPartial>; + additionalProperties?: boolean | UncheckedJSONSchemaType; + unevaluatedProperties?: boolean | UncheckedJSONSchemaType; + properties?: IsPartial extends true ? Partial> : UncheckedPropertiesSchema; + patternProperties?: Record>; + propertyNames?: Omit, "type"> & { + type?: "string"; + }; + dependencies?: { + [K in keyof T]?: Readonly<(keyof T)[]> | UncheckedPartialSchema; + }; + dependentRequired?: { + [K in keyof T]?: Readonly<(keyof T)[]>; + }; + dependentSchemas?: { + [K in keyof T]?: UncheckedPartialSchema; + }; + minProperties?: number; + maxProperties?: number; +} & (IsPartial extends true ? { + required: Readonly<(keyof T)[]>; +} : [UncheckedRequiredMembers] extends [never] ? { + required?: Readonly[]>; +} : { + required: Readonly[]>; +}) : T extends null ? { + type: JSONType<"null", IsPartial>; + nullable: true; +} : never) & { + allOf?: Readonly[]>; + anyOf?: Readonly[]>; + oneOf?: Readonly[]>; + if?: UncheckedPartialSchema; + then?: UncheckedPartialSchema; + else?: UncheckedPartialSchema; + not?: UncheckedPartialSchema; +})) & { + [keyword: string]: any; + $id?: string; + $ref?: string; + $defs?: Record>; + definitions?: Record>; +}; +export type JSONSchemaType = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType>; +type Known = { + [key: string]: Known; +} | [Known, ...Known[]] | Known[] | number | string | boolean | null; +type UncheckedPropertiesSchema = { + [K in keyof T]-?: (UncheckedJSONSchemaType & Nullable) | { + $ref: string; + }; +}; +export type PropertiesSchema = StrictNullChecksWrapper<"PropertiesSchema", UncheckedPropertiesSchema>; +type UncheckedRequiredMembers = { + [K in keyof T]-?: undefined extends T[K] ? never : K; +}[keyof T]; +export type RequiredMembers = StrictNullChecksWrapper<"RequiredMembers", UncheckedRequiredMembers>; +type Nullable = undefined extends T ? { + nullable: true; + const?: null; + enum?: Readonly<(T | null)[]>; + default?: T | null; +} : { + nullable?: false; + const?: T; + enum?: Readonly; + default?: T; +}; +export {}; diff --git a/node_modules/ajv/dist/types/json-schema.js b/node_modules/ajv/dist/types/json-schema.js new file mode 100644 index 000000000..2d8f98dc5 --- /dev/null +++ b/node_modules/ajv/dist/types/json-schema.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=json-schema.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/types/json-schema.js.map b/node_modules/ajv/dist/types/json-schema.js.map new file mode 100644 index 000000000..ae6b4d0fe --- /dev/null +++ b/node_modules/ajv/dist/types/json-schema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"json-schema.js","sourceRoot":"","sources":["../../lib/types/json-schema.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/ajv/dist/types/jtd-schema.d.ts b/node_modules/ajv/dist/types/jtd-schema.d.ts new file mode 100644 index 000000000..80ad3129a --- /dev/null +++ b/node_modules/ajv/dist/types/jtd-schema.d.ts @@ -0,0 +1,174 @@ +/** numeric strings */ +type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"; +/** string strings */ +type StringType = "string" | "timestamp"; +/** Generic JTD Schema without inference of the represented type */ +export type SomeJTDSchemaType = (// ref +{ + ref: string; +} | { + type: NumberType | StringType | "boolean"; +} | { + enum: string[]; +} | { + elements: SomeJTDSchemaType; +} | { + values: SomeJTDSchemaType; +} | { + properties: Record; + optionalProperties?: Record; + additionalProperties?: boolean; +} | { + properties?: Record; + optionalProperties: Record; + additionalProperties?: boolean; +} | { + discriminator: string; + mapping: Record; +} | {}) & { + nullable?: boolean; + metadata?: Record; + definitions?: Record; +}; +/** required keys of an object, not undefined */ +type RequiredKeys = { + [K in keyof T]-?: undefined extends T[K] ? never : K; +}[keyof T]; +/** optional or undifined-able keys of an object */ +type OptionalKeys = { + [K in keyof T]-?: undefined extends T[K] ? K : never; +}[keyof T]; +/** type is true if T is a union type */ +type IsUnion_ = false extends (T extends unknown ? ([U] extends [T] ? false : true) : never) ? false : true; +type IsUnion = IsUnion_; +/** type is true if T is identically E */ +type TypeEquality = [T] extends [E] ? ([E] extends [T] ? true : false) : false; +/** type is true if T or null is identically E or null*/ +type NullTypeEquality = TypeEquality; +/** gets only the string literals of a type or null if a type isn't a string literal */ +type EnumString = [T] extends [never] ? null : T extends string ? string extends T ? null : T : null; +/** true if type is a union of string literals */ +type IsEnum = null extends EnumString ? false : true; +/** true only if all types are array types (not tuples) */ +type IsElements = false extends IsUnion ? [T] extends [readonly unknown[]] ? undefined extends T[0.5] ? false : true : false : false; +/** true if the the type is a values type */ +type IsValues = false extends IsUnion ? TypeEquality : false; +/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */ +type IsRecord = Union extends IsUnion ? null extends EnumString ? false : true : false; +/** true if type represents an empty record */ +type IsEmptyRecord = [T] extends [Record] ? [T] extends [never] ? false : true : false; +/** actual schema */ +export type JTDSchemaType = Record> = (// refs - where null wasn't specified, must match exactly +(null extends EnumString ? never : ({ + [K in keyof D]: [T] extends [D[K]] ? { + ref: K; + } : never; +}[keyof D] & { + nullable?: false; +}) | (null extends T ? { + [K in keyof D]: [Exclude] extends [Exclude] ? { + ref: K; + } : never; +}[keyof D] & { + nullable: true; +} : never)) | (unknown extends T ? { + nullable?: boolean; +} : never) | ((true extends NullTypeEquality ? { + type: NumberType; +} : true extends NullTypeEquality ? { + type: "boolean"; +} : true extends NullTypeEquality ? { + type: StringType; +} : true extends NullTypeEquality ? { + type: "timestamp"; +} : true extends IsEnum> ? { + enum: EnumString>[]; +} : true extends IsElements> ? T extends readonly (infer E)[] ? { + elements: JTDSchemaType; +} : never : true extends IsEmptyRecord> ? { + properties: Record; + optionalProperties?: Record; +} | { + optionalProperties: Record; +} : true extends IsValues> ? T extends Record ? { + values: JTDSchemaType; +} : never : true extends IsRecord, false> ? ([RequiredKeys>] extends [never] ? { + properties?: Record; +} : { + properties: { + [K in RequiredKeys]: JTDSchemaType; + }; +}) & ([OptionalKeys>] extends [never] ? { + optionalProperties?: Record; +} : { + optionalProperties: { + [K in OptionalKeys]: JTDSchemaType, D>; + }; +}) & { + additionalProperties?: boolean; +} : true extends IsRecord, true> ? { + [K in keyof Exclude]-?: Exclude[K] extends string ? { + discriminator: K; + mapping: { + [M in Exclude[K]]: JTDSchemaType ? T : never, K>, D>; + }; + } : never; +}[keyof Exclude] : never) & (null extends T ? { + nullable: true; +} : { + nullable?: false; +}))) & { + metadata?: Record; + definitions?: { + [K in keyof D]: JTDSchemaType; + }; +}; +type JTDDataDef> = // ref +(S extends { + ref: string; +} ? D extends { + [K in S["ref"]]: infer V; +} ? JTDDataDef : never : S extends { + type: NumberType; +} ? number : S extends { + type: "boolean"; +} ? boolean : S extends { + type: "string"; +} ? string : S extends { + type: "timestamp"; +} ? string | Date : S extends { + enum: readonly (infer E)[]; +} ? string extends E ? never : [E] extends [string] ? E : never : S extends { + elements: infer E; +} ? JTDDataDef[] : S extends { + properties: Record; + optionalProperties?: Record; + additionalProperties?: boolean; +} ? { + -readonly [K in keyof S["properties"]]-?: JTDDataDef; +} & { + -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef; +} & ([S["additionalProperties"]] extends [true] ? Record : unknown) : S extends { + properties?: Record; + optionalProperties: Record; + additionalProperties?: boolean; +} ? { + -readonly [K in keyof S["properties"]]-?: JTDDataDef; +} & { + -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef; +} & ([S["additionalProperties"]] extends [true] ? Record : unknown) : S extends { + values: infer V; +} ? Record> : S extends { + discriminator: infer M; + mapping: Record; +} ? [M] extends [string] ? { + [K in keyof S["mapping"]]: JTDDataDef & { + [KM in M]: K; + }; +}[keyof S["mapping"]] : never : unknown) | (S extends { + nullable: true; +} ? null : never); +export type JTDDataType = S extends { + definitions: Record; +} ? JTDDataDef : JTDDataDef>; +export {}; diff --git a/node_modules/ajv/dist/types/jtd-schema.js b/node_modules/ajv/dist/types/jtd-schema.js new file mode 100644 index 000000000..11338aa8a --- /dev/null +++ b/node_modules/ajv/dist/types/jtd-schema.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=jtd-schema.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/types/jtd-schema.js.map b/node_modules/ajv/dist/types/jtd-schema.js.map new file mode 100644 index 000000000..add89bd77 --- /dev/null +++ b/node_modules/ajv/dist/types/jtd-schema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jtd-schema.js","sourceRoot":"","sources":["../../lib/types/jtd-schema.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts b/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts new file mode 100644 index 000000000..607515646 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +export type AdditionalItemsError = ErrorObject<"additionalItems", { + limit: number; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export declare function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js b/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js new file mode 100644 index 000000000..608d51eb6 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateAdditionalItems = void 0; +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`, + params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`, +}; +const def = { + keyword: "additionalItems", + type: "array", + schemaType: ["boolean", "object"], + before: "uniqueItems", + error, + code(cxt) { + const { parentSchema, it } = cxt; + const { items } = parentSchema; + if (!Array.isArray(items)) { + (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas'); + return; + } + validateAdditionalItems(cxt, items); + }, +}; +function validateAdditionalItems(cxt, items) { + const { gen, schema, data, keyword, it } = cxt; + it.items = true; + const len = gen.const("len", (0, codegen_1._) `${data}.length`); + if (schema === false) { + cxt.setParams({ len: items.length }); + cxt.pass((0, codegen_1._) `${len} <= ${items.length}`); + } + else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { + const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items.length}`); // TODO var + gen.if((0, codegen_1.not)(valid), () => validateItems(valid)); + cxt.ok(valid); + } + function validateItems(valid) { + gen.forRange("i", items.length, len, (i) => { + cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid); + if (!it.allErrors) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + }); + } +} +exports.validateAdditionalItems = validateAdditionalItems; +exports.default = def; +//# sourceMappingURL=additionalItems.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map b/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map new file mode 100644 index 000000000..b3d1479c2 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"additionalItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/additionalItems.ts"],"names":[],"mappings":";;;AAOA,mDAAuD;AACvD,6CAA2E;AAI3E,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,2BAA2B,GAAG,QAAQ;IACvE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,GAAG,GAAG;CAChD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,iBAA0B;IACnC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,MAAM,EAAE,aAAa;IACrB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC9B,MAAM,EAAC,KAAK,EAAC,GAAG,YAAY,CAAA;QAC5B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACzB,IAAA,sBAAe,EAAC,EAAE,EAAE,sEAAsE,CAAC,CAAA;YAC3F,OAAM;SACP;QACD,uBAAuB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACrC,CAAC;CACF,CA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E,CAAC,SAAS;gBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;QAC1D,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAnBD,0DAmBC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts b/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts new file mode 100644 index 000000000..74698c7a2 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, AddedKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type AdditionalPropertiesError = ErrorObject<"additionalProperties", { + additionalProperty: string; +}, AnySchema>; +declare const def: CodeKeywordDefinition & AddedKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js b/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js new file mode 100644 index 000000000..1d3374bb7 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js @@ -0,0 +1,106 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const names_1 = require("../../compile/names"); +const util_1 = require("../../compile/util"); +const error = { + message: "must NOT have additional properties", + params: ({ params }) => (0, codegen_1._) `{additionalProperty: ${params.additionalProperty}}`, +}; +const def = { + keyword: "additionalProperties", + type: ["object"], + schemaType: ["boolean", "object"], + allowUndefined: true, + trackErrors: true, + error, + code(cxt) { + const { gen, schema, parentSchema, data, errsCount, it } = cxt; + /* istanbul ignore if */ + if (!errsCount) + throw new Error("ajv implementation error"); + const { allErrors, opts } = it; + it.props = true; + if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema)) + return; + const props = (0, code_1.allSchemaProperties)(parentSchema.properties); + const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties); + checkAdditionalProperties(); + cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); + function checkAdditionalProperties() { + gen.forIn("key", data, (key) => { + if (!props.length && !patProps.length) + additionalPropertyCode(key); + else + gen.if(isAdditional(key), () => additionalPropertyCode(key)); + }); + } + function isAdditional(key) { + let definedProp; + if (props.length > 8) { + // TODO maybe an option instead of hard-coded 8? + const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties"); + definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key); + } + else if (props.length) { + definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._) `${key} === ${p}`)); + } + else { + definedProp = codegen_1.nil; + } + if (patProps.length) { + definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._) `${(0, code_1.usePattern)(cxt, p)}.test(${key})`)); + } + return (0, codegen_1.not)(definedProp); + } + function deleteAdditional(key) { + gen.code((0, codegen_1._) `delete ${data}[${key}]`); + } + function additionalPropertyCode(key) { + if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) { + deleteAdditional(key); + return; + } + if (schema === false) { + cxt.setParams({ additionalProperty: key }); + cxt.error(); + if (!allErrors) + gen.break(); + return; + } + if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { + const valid = gen.name("valid"); + if (opts.removeAdditional === "failing") { + applyAdditionalSchema(key, valid, false); + gen.if((0, codegen_1.not)(valid), () => { + cxt.reset(); + deleteAdditional(key); + }); + } + else { + applyAdditionalSchema(key, valid); + if (!allErrors) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + } + } + } + function applyAdditionalSchema(key, valid, errors) { + const subschema = { + keyword: "additionalProperties", + dataProp: key, + dataPropType: util_1.Type.Str, + }; + if (errors === false) { + Object.assign(subschema, { + compositeRule: true, + createErrors: false, + allErrors: false, + }); + } + cxt.subschema(subschema, valid); + } + }, +}; +exports.default = def; +//# sourceMappingURL=additionalProperties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map b/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map new file mode 100644 index 000000000..d2f249f6f --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"additionalProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/additionalProperties.ts"],"names":[],"mappings":";;AAOA,kCAAsE;AACtE,mDAAiE;AACjE,+CAAmC;AAEnC,6CAA0E;AAQ1E,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,qCAAqC;IAC9C,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,wBAAwB,MAAM,CAAC,kBAAkB,GAAG;CAC5E,CAAA;AAED,MAAM,GAAG,GAAmD;IAC1D,OAAO,EAAE,sBAAsB;IAC/B,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,cAAc,EAAE,IAAI;IACpB,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAG;QACN,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC5D,wBAAwB;QACxB,IAAI,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC3D,MAAM,EAAC,SAAS,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;QAC5B,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,IAAI,IAAI,CAAC,gBAAgB,KAAK,KAAK,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QAC5E,MAAM,KAAK,GAAG,IAAA,0BAAmB,EAAC,YAAY,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AG,CAAC,CAAA;oBACvB,CAAC,CAAC,CAAA;iBACH;qBAAM;oBACL,qBAAqB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;oBACjC,IAAI,CAAC,SAAS;wBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;iBACtD;aACF;QACH,CAAC;QAED,SAAS,qBAAqB,CAAC,GAAS,EAAE,KAAW,EAAE,MAAc;YACnE,MAAM,SAAS,GAAkB;gBAC/B,OAAO,EAAE,sBAAsB;gBAC/B,QAAQ,EAAE,GAAG;gBACb,YAAY,EAAE,WAAI,CAAC,GAAG;aACvB,CAAA;YACD,IAAI,MAAM,KAAK,KAAK,EAAE;gBACpB,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;oBACvB,aAAa,EAAE,IAAI;oBACnB,YAAY,EAAE,KAAK;oBACnB,SAAS,EAAE,KAAK;iBACjB,CAAC,CAAA;aACH;YACD,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QACjC,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts b/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/allOf.js b/node_modules/ajv/dist/vocabularies/applicator/allOf.js new file mode 100644 index 000000000..1b1ae7376 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/allOf.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const def = { + keyword: "allOf", + schemaType: "array", + code(cxt) { + const { gen, schema, it } = cxt; + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + const valid = gen.name("valid"); + schema.forEach((sch, i) => { + if ((0, util_1.alwaysValidSchema)(it, sch)) + return; + const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid); + cxt.ok(valid); + cxt.mergeEvaluated(schCxt); + }); + }, +}; +exports.default = def; +//# sourceMappingURL=allOf.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map b/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map new file mode 100644 index 000000000..d119d0eae --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"allOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/allOf.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AAEpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,wBAAwB;QACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACvE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,MAAM,CAAC,OAAO,CAAC,CAAC,GAAc,EAAE,CAAS,EAAE,EAAE;YAC3C,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,GAAG,CAAC;gBAAE,OAAM;YACtC,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAC,EAAE,KAAK,CAAC,CAAA;YACtE,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;YACb,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAC5B,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts b/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts new file mode 100644 index 000000000..61bca56e0 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts @@ -0,0 +1,4 @@ +import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types"; +export type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/anyOf.js b/node_modules/ajv/dist/vocabularies/applicator/anyOf.js new file mode 100644 index 000000000..66cfce2cc --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/anyOf.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const def = { + keyword: "anyOf", + schemaType: "array", + trackErrors: true, + code: code_1.validateUnion, + error: { message: "must match a schema in anyOf" }, +}; +exports.default = def; +//# sourceMappingURL=anyOf.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map b/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map new file mode 100644 index 000000000..537ffcbeb --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"anyOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/anyOf.ts"],"names":[],"mappings":";;AACA,kCAAqC;AAIrC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE,EAAC,OAAO,EAAE,8BAA8B,EAAC;CACjD,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts b/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts new file mode 100644 index 000000000..5493e844f --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts @@ -0,0 +1,7 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type ContainsError = ErrorObject<"contains", { + minContains: number; + maxContains?: number; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/contains.js b/node_modules/ajv/dist/vocabularies/applicator/contains.js new file mode 100644 index 000000000..6c5473f5d --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/contains.js @@ -0,0 +1,95 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params: { min, max } }) => max === undefined + ? (0, codegen_1.str) `must contain at least ${min} valid item(s)` + : (0, codegen_1.str) `must contain at least ${min} and no more than ${max} valid item(s)`, + params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._) `{minContains: ${min}}` : (0, codegen_1._) `{minContains: ${min}, maxContains: ${max}}`, +}; +const def = { + keyword: "contains", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + trackErrors: true, + error, + code(cxt) { + const { gen, schema, parentSchema, data, it } = cxt; + let min; + let max; + const { minContains, maxContains } = parentSchema; + if (it.opts.next) { + min = minContains === undefined ? 1 : minContains; + max = maxContains; + } + else { + min = 1; + } + const len = gen.const("len", (0, codegen_1._) `${data}.length`); + cxt.setParams({ min, max }); + if (max === undefined && min === 0) { + (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); + return; + } + if (max !== undefined && min > max) { + (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`); + cxt.fail(); + return; + } + if ((0, util_1.alwaysValidSchema)(it, schema)) { + let cond = (0, codegen_1._) `${len} >= ${min}`; + if (max !== undefined) + cond = (0, codegen_1._) `${cond} && ${len} <= ${max}`; + cxt.pass(cond); + return; + } + it.items = true; + const valid = gen.name("valid"); + if (max === undefined && min === 1) { + validateItems(valid, () => gen.if(valid, () => gen.break())); + } + else if (min === 0) { + gen.let(valid, true); + if (max !== undefined) + gen.if((0, codegen_1._) `${data}.length > 0`, validateItemsWithCount); + } + else { + gen.let(valid, false); + validateItemsWithCount(); + } + cxt.result(valid, () => cxt.reset()); + function validateItemsWithCount() { + const schValid = gen.name("_valid"); + const count = gen.let("count", 0); + validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))); + } + function validateItems(_valid, block) { + gen.forRange("i", 0, len, (i) => { + cxt.subschema({ + keyword: "contains", + dataProp: i, + dataPropType: util_1.Type.Num, + compositeRule: true, + }, _valid); + block(); + }); + } + function checkLimits(count) { + gen.code((0, codegen_1._) `${count}++`); + if (max === undefined) { + gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true).break()); + } + else { + gen.if((0, codegen_1._) `${count} > ${max}`, () => gen.assign(valid, false).break()); + if (min === 1) + gen.assign(valid, true); + else + gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true)); + } + } + }, +}; +exports.default = def; +//# sourceMappingURL=contains.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/contains.js.map b/node_modules/ajv/dist/vocabularies/applicator/contains.js.map new file mode 100644 index 000000000..6a0bd39cb --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/contains.js.map @@ -0,0 +1 @@ +{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/contains.ts"],"names":[],"mappings":";;AAOA,mDAAkD;AAClD,6CAA2E;AAQ3E,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAE,GAAG,EAAC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AAM,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;gBACpE,IAAI,GAAG,KAAK,CAAC;oBAAE,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;;oBACjC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAA;aAClE;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts b/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts new file mode 100644 index 000000000..05900e0c5 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts @@ -0,0 +1,21 @@ +import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaMap, AnySchema } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +export type PropertyDependencies = { + [K in string]?: string[]; +}; +export interface DependenciesErrorParams { + property: string; + missingProperty: string; + depsCount: number; + deps: string; +} +export type DependenciesError = ErrorObject<"dependencies", DependenciesErrorParams, { + [K in string]?: string[] | AnySchema; +}>; +export declare const error: KeywordErrorDefinition; +declare const def: CodeKeywordDefinition; +export declare function validatePropertyDeps(cxt: KeywordCxt, propertyDeps?: { + [K in string]?: string[]; +}): void; +export declare function validateSchemaDeps(cxt: KeywordCxt, schemaDeps?: SchemaMap): void; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/dependencies.js b/node_modules/ajv/dist/vocabularies/applicator/dependencies.js new file mode 100644 index 000000000..e81f86d1d --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/dependencies.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0; +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const code_1 = require("../code"); +exports.error = { + message: ({ params: { property, depsCount, deps } }) => { + const property_ies = depsCount === 1 ? "property" : "properties"; + return (0, codegen_1.str) `must have ${property_ies} ${deps} when property ${property} is present`; + }, + params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._) `{property: ${property}, + missingProperty: ${missingProperty}, + depsCount: ${depsCount}, + deps: ${deps}}`, // TODO change to reference +}; +const def = { + keyword: "dependencies", + type: "object", + schemaType: "object", + error: exports.error, + code(cxt) { + const [propDeps, schDeps] = splitDependencies(cxt); + validatePropertyDeps(cxt, propDeps); + validateSchemaDeps(cxt, schDeps); + }, +}; +function splitDependencies({ schema }) { + const propertyDeps = {}; + const schemaDeps = {}; + for (const key in schema) { + if (key === "__proto__") + continue; + const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps; + deps[key] = schema[key]; + } + return [propertyDeps, schemaDeps]; +} +function validatePropertyDeps(cxt, propertyDeps = cxt.schema) { + const { gen, data, it } = cxt; + if (Object.keys(propertyDeps).length === 0) + return; + const missing = gen.let("missing"); + for (const prop in propertyDeps) { + const deps = propertyDeps[prop]; + if (deps.length === 0) + continue; + const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties); + cxt.setParams({ + property: prop, + depsCount: deps.length, + deps: deps.join(", "), + }); + if (it.allErrors) { + gen.if(hasProperty, () => { + for (const depProp of deps) { + (0, code_1.checkReportMissingProp)(cxt, depProp); + } + }); + } + else { + gen.if((0, codegen_1._) `${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`); + (0, code_1.reportMissingProp)(cxt, missing); + gen.else(); + } + } +} +exports.validatePropertyDeps = validatePropertyDeps; +function validateSchemaDeps(cxt, schemaDeps = cxt.schema) { + const { gen, data, keyword, it } = cxt; + const valid = gen.name("valid"); + for (const prop in schemaDeps) { + if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop])) + continue; + gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => { + const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid); + cxt.mergeValidEvaluated(schCxt, valid); + }, () => gen.var(valid, true) // TODO var + ); + cxt.ok(valid); + } +} +exports.validateSchemaDeps = validateSchemaDeps; +exports.default = def; +//# sourceMappingURL=dependencies.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map b/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map new file mode 100644 index 000000000..dafffd16b --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/dependencies.ts"],"names":[],"mappings":";;;AAQA,mDAA4C;AAC5C,6CAAoD;AACpD,kCAAmG;AAmBtF,QAAA,KAAK,GAA2B;IAC3C,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAC,EAAC,EAAE,EAAE;QACjD,MAAM,YAAY,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAA;QAChE,OAAO,IAAA,aAAG,EAAA,aAAa,YAAY,IAAI,IAAI,kBAAkB,QAAQ,aAAa,CAAA;IACpF,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAC,EAAC,EAAE,EAAE,CACjE,IAAA,WAAC,EAAA,cAAc,QAAQ;uBACJ,eAAe;iBACrB,SAAS;YACd,IAAI,GAAG,EAAE,2BAA2B;CAC/C,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,QAAQ;IACd,UAAU,E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AM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;YAChE,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACxC,CAAC,EACD,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,WAAW;SACvC,CAAA;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;KACd;AACH,CAAC;AAfD,gDAeC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts b/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js b/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js new file mode 100644 index 000000000..66ef2e843 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dependencies_1 = require("./dependencies"); +const def = { + keyword: "dependentSchemas", + type: "object", + schemaType: "object", + code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt), +}; +exports.default = def; +//# sourceMappingURL=dependentSchemas.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map b/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map new file mode 100644 index 000000000..17712e6fb --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dependentSchemas.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/dependentSchemas.ts"],"names":[],"mappings":";;AACA,iDAAiD;AAEjD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,iCAAkB,EAAC,GAAG,CAAC;CACvC,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/if.d.ts b/node_modules/ajv/dist/vocabularies/applicator/if.d.ts new file mode 100644 index 000000000..8f602e33f --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/if.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type IfKeywordError = ErrorObject<"if", { + failingKeyword: string; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/if.js b/node_modules/ajv/dist/vocabularies/applicator/if.js new file mode 100644 index 000000000..2c42a3e9c --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/if.js @@ -0,0 +1,66 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params }) => (0, codegen_1.str) `must match "${params.ifClause}" schema`, + params: ({ params }) => (0, codegen_1._) `{failingKeyword: ${params.ifClause}}`, +}; +const def = { + keyword: "if", + schemaType: ["object", "boolean"], + trackErrors: true, + error, + code(cxt) { + const { gen, parentSchema, it } = cxt; + if (parentSchema.then === undefined && parentSchema.else === undefined) { + (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored'); + } + const hasThen = hasSchema(it, "then"); + const hasElse = hasSchema(it, "else"); + if (!hasThen && !hasElse) + return; + const valid = gen.let("valid", true); + const schValid = gen.name("_valid"); + validateIf(); + cxt.reset(); + if (hasThen && hasElse) { + const ifClause = gen.let("ifClause"); + cxt.setParams({ ifClause }); + gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)); + } + else if (hasThen) { + gen.if(schValid, validateClause("then")); + } + else { + gen.if((0, codegen_1.not)(schValid), validateClause("else")); + } + cxt.pass(valid, () => cxt.error(true)); + function validateIf() { + const schCxt = cxt.subschema({ + keyword: "if", + compositeRule: true, + createErrors: false, + allErrors: false, + }, schValid); + cxt.mergeEvaluated(schCxt); + } + function validateClause(keyword, ifClause) { + return () => { + const schCxt = cxt.subschema({ keyword }, schValid); + gen.assign(valid, schValid); + cxt.mergeValidEvaluated(schCxt, valid); + if (ifClause) + gen.assign(ifClause, (0, codegen_1._) `${keyword}`); + else + cxt.setParams({ ifClause: keyword }); + }; + } + }, +}; +function hasSchema(it, keyword) { + const schema = it.schema[keyword]; + return schema !== undefined && !(0, util_1.alwaysValidSchema)(it, schema); +} +exports.default = def; +//# sourceMappingURL=if.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/if.js.map b/node_modules/ajv/dist/vocabularies/applicator/if.js.map new file mode 100644 index 000000000..34b3a5539 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/if.js.map @@ -0,0 +1 @@ +{"version":3,"file":"if.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/if.ts"],"names":[],"mappings":";;AAQA,mDAAuD;AACvD,6CAAqE;AAIrE,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,eAAe,MAAM,CAAC,QAAQ,UAAU;IAClE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,oBAAoB,MAAM,CAAC,QAAQ,GAAG;CAC9D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,WA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AAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;QAEtC,SAAS,UAAU;YACjB,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAC1B;gBACE,OAAO,EAAE,IAAI;gBACb,aAAa,EAAE,IAAI;gBACnB,YAAY,EAAE,KAAK;gBACnB,SAAS,EAAE,KAAK;aACjB,EACD,QAAQ,CACT,CAAA;YACD,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAC5B,CAAC;QAED,SAAS,cAAc,CAAC,OAAe,EAAE,QAAe;YACtD,OAAO,GAAG,EAAE;gBACV,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAC,EAAE,QAAQ,CAAC,CAAA;gBACjD,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;gBAC3B,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;gBACtC,IAAI,QAAQ;oBAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAA,WAAC,EAAA,GAAG,OAAO,EAAE,CAAC,CAAA;;oBAC5C,GAAG,CAAC,SAAS,CAAC,EAAC,QAAQ,EAAE,OAAO,EAAC,CAAC,CAAA;YACzC,CAAC,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,SAAS,SAAS,CAAC,EAAgB,EAAE,OAAe;IAClD,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACjC,OAAO,MAAM,KAAK,SAAS,IAAI,CAAC,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,CAAA;AAC/D,CAAC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/index.d.ts b/node_modules/ajv/dist/vocabularies/applicator/index.d.ts new file mode 100644 index 000000000..b9cc5f5c8 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/index.d.ts @@ -0,0 +1,13 @@ +import type { ErrorNoParams, Vocabulary } from "../../types"; +import { AdditionalItemsError } from "./additionalItems"; +import { ItemsError } from "./items2020"; +import { ContainsError } from "./contains"; +import { DependenciesError } from "./dependencies"; +import { PropertyNamesError } from "./propertyNames"; +import { AdditionalPropertiesError } from "./additionalProperties"; +import { NotKeywordError } from "./not"; +import { AnyOfError } from "./anyOf"; +import { OneOfError } from "./oneOf"; +import { IfKeywordError } from "./if"; +export default function getApplicator(draft2020?: boolean): Vocabulary; +export type ApplicatorKeywordError = ErrorNoParams<"false schema"> | AdditionalItemsError | ItemsError | ContainsError | AdditionalPropertiesError | DependenciesError | IfKeywordError | AnyOfError | OneOfError | NotKeywordError | PropertyNamesError; diff --git a/node_modules/ajv/dist/vocabularies/applicator/index.js b/node_modules/ajv/dist/vocabularies/applicator/index.js new file mode 100644 index 000000000..cf592f279 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/index.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const additionalItems_1 = require("./additionalItems"); +const prefixItems_1 = require("./prefixItems"); +const items_1 = require("./items"); +const items2020_1 = require("./items2020"); +const contains_1 = require("./contains"); +const dependencies_1 = require("./dependencies"); +const propertyNames_1 = require("./propertyNames"); +const additionalProperties_1 = require("./additionalProperties"); +const properties_1 = require("./properties"); +const patternProperties_1 = require("./patternProperties"); +const not_1 = require("./not"); +const anyOf_1 = require("./anyOf"); +const oneOf_1 = require("./oneOf"); +const allOf_1 = require("./allOf"); +const if_1 = require("./if"); +const thenElse_1 = require("./thenElse"); +function getApplicator(draft2020 = false) { + const applicator = [ + // any + not_1.default, + anyOf_1.default, + oneOf_1.default, + allOf_1.default, + if_1.default, + thenElse_1.default, + // object + propertyNames_1.default, + additionalProperties_1.default, + dependencies_1.default, + properties_1.default, + patternProperties_1.default, + ]; + // array + if (draft2020) + applicator.push(prefixItems_1.default, items2020_1.default); + else + applicator.push(additionalItems_1.default, items_1.default); + applicator.push(contains_1.default); + return applicator; +} +exports.default = getApplicator; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/index.js.map b/node_modules/ajv/dist/vocabularies/applicator/index.js.map new file mode 100644 index 000000000..ebcb8534d --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/index.ts"],"names":[],"mappings":";;AACA,uDAAuE;AACvE,+CAAuC;AACvC,mCAA2B;AAC3B,2CAAiD;AACjD,yCAAkD;AAClD,iDAA8D;AAC9D,mDAAiE;AACjE,iEAAsF;AACtF,6CAAqC;AACrC,2DAAmD;AACnD,+BAAiD;AACjD,mCAAyC;AACzC,mCAAyC;AACzC,mCAA2B;AAC3B,6BAA8C;AAC9C,yCAAiC;AAEjC,SAAwB,aAAa,CAAC,SAAS,GAAG,KAAK;IACrD,MAAM,UAAU,GAAG;QACjB,MAAM;QACN,aAAU;QACV,eAAK;QACL,eAAK;QACL,eAAK;QACL,YAAS;QACT,kBAAQ;QACR,SAAS;QACT,uBAAa;QACb,8BAAoB;QACpB,sBAAY;QACZ,oBAAU;QACV,2BAAiB;KAClB,CAAA;IACD,QAAQ;IACR,IAAI,SAAS;QAAE,UAAU,CAAC,IAAI,CAAC,qBAAW,EAAE,mBAAS,CAAC,CAAA;;QACjD,UAAU,CAAC,IAAI,CAAC,yBAAe,EAAE,eAAK,CAAC,CAAA;IAC5C,UAAU,CAAC,IAAI,CAAC,kBAAQ,CAAC,CAAA;IACzB,OAAO,UAAU,CAAA;AACnB,CAAC;AArBD,gCAqBC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/items.d.ts b/node_modules/ajv/dist/vocabularies/applicator/items.d.ts new file mode 100644 index 000000000..8e608ca9c --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/items.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition, AnySchema } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +declare const def: CodeKeywordDefinition; +export declare function validateTuple(cxt: KeywordCxt, extraItems: string, schArr?: AnySchema[]): void; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/items.js b/node_modules/ajv/dist/vocabularies/applicator/items.js new file mode 100644 index 000000000..26f527bc6 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/items.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateTuple = void 0; +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const code_1 = require("../code"); +const def = { + keyword: "items", + type: "array", + schemaType: ["object", "array", "boolean"], + before: "uniqueItems", + code(cxt) { + const { schema, it } = cxt; + if (Array.isArray(schema)) + return validateTuple(cxt, "additionalItems", schema); + it.items = true; + if ((0, util_1.alwaysValidSchema)(it, schema)) + return; + cxt.ok((0, code_1.validateArray)(cxt)); + }, +}; +function validateTuple(cxt, extraItems, schArr = cxt.schema) { + const { gen, parentSchema, data, keyword, it } = cxt; + checkStrictTuple(parentSchema); + if (it.opts.unevaluated && schArr.length && it.items !== true) { + it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items); + } + const valid = gen.name("valid"); + const len = gen.const("len", (0, codegen_1._) `${data}.length`); + schArr.forEach((sch, i) => { + if ((0, util_1.alwaysValidSchema)(it, sch)) + return; + gen.if((0, codegen_1._) `${len} > ${i}`, () => cxt.subschema({ + keyword, + schemaProp: i, + dataProp: i, + }, valid)); + cxt.ok(valid); + }); + function checkStrictTuple(sch) { + const { opts, errSchemaPath } = it; + const l = schArr.length; + const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false); + if (opts.strictTuples && !fullTuple) { + const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`; + (0, util_1.checkStrictMode)(it, msg, opts.strictTuples); + } + } +} +exports.validateTuple = validateTuple; +exports.default = def; +//# sourceMappingURL=items.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/items.js.map b/node_modules/ajv/dist/vocabularies/applicator/items.js.map new file mode 100644 index 000000000..3c4ce614c --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/items.js.map @@ -0,0 +1 @@ +{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/items.ts"],"names":[],"mappings":";;;AAEA,mDAAuC;AACvC,6CAAqF;AACrF,kCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;IAC1C,MAAM,EAAE,aAAa;IACrB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACxB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,OAAO,aAAa,CAAC,GAAG,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAA;QAC/E,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,GAAG,CAAC,EAAE,CAAC,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,CAAA;IAC5B,CAAC;CACF,CAAA;AAED,SAAgB,aAAa,CAC3B,GAAe,EACf,UAAkB,EAClB,SAAsB,GAAG,CAAC,MAAM;IAEhC,MAAM,EAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAClD,gBAAgB,CAAC,YAAY,CAAC,CAAA;IAC9B,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,KAAK,KAAK,IAA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,CAAC,YAAY,CAAC,CAAA;SAC5C;IACH,CAAC;AACH,CAAC;AApCD,sCAoCC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts b/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts new file mode 100644 index 000000000..a2565b2c2 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type ItemsError = ErrorObject<"items", { + limit: number; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/items2020.js b/node_modules/ajv/dist/vocabularies/applicator/items2020.js new file mode 100644 index 000000000..f2387d7d2 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/items2020.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const code_1 = require("../code"); +const additionalItems_1 = require("./additionalItems"); +const error = { + message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`, + params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`, +}; +const def = { + keyword: "items", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + error, + code(cxt) { + const { schema, parentSchema, it } = cxt; + const { prefixItems } = parentSchema; + it.items = true; + if ((0, util_1.alwaysValidSchema)(it, schema)) + return; + if (prefixItems) + (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems); + else + cxt.ok((0, code_1.validateArray)(cxt)); + }, +}; +exports.default = def; +//# sourceMappingURL=items2020.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map b/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map new file mode 100644 index 000000000..5034acda6 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map @@ -0,0 +1 @@ +{"version":3,"file":"items2020.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/items2020.ts"],"names":[],"mappings":";;AAOA,mDAA4C;AAC5C,6CAAoD;AACpD,kCAAqC;AACrC,uDAAyD;AAIzD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,2BAA2B,GAAG,QAAQ;IACvE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,GAAG,GAAG;CAChD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,MAAM,EAAE,aAAa;IACrB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,MAAM,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtC,MAAM,EAAC,WAAW,EAAC,GAAG,YAAY,CAAA;QAClC,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,IAAI,WAAW;YAAE,IAAA,yCAAuB,EAAC,GAAG,EAAE,WAAW,CAAC,CAAA;;YACrD,GAAG,CAAC,EAAE,CAAC,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,CAAA;IACjC,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/not.d.ts b/node_modules/ajv/dist/vocabularies/applicator/not.d.ts new file mode 100644 index 000000000..d2f4888f3 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/not.d.ts @@ -0,0 +1,4 @@ +import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types"; +export type NotKeywordError = ErrorNoParams<"not", AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/not.js b/node_modules/ajv/dist/vocabularies/applicator/not.js new file mode 100644 index 000000000..89f6fddac --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/not.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const def = { + keyword: "not", + schemaType: ["object", "boolean"], + trackErrors: true, + code(cxt) { + const { gen, schema, it } = cxt; + if ((0, util_1.alwaysValidSchema)(it, schema)) { + cxt.fail(); + return; + } + const valid = gen.name("valid"); + cxt.subschema({ + keyword: "not", + compositeRule: true, + createErrors: false, + allErrors: false, + }, valid); + cxt.failResult(valid, () => cxt.reset(), () => cxt.error()); + }, + error: { message: "must NOT be valid" }, +}; +exports.default = def; +//# sourceMappingURL=not.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/not.js.map b/node_modules/ajv/dist/vocabularies/applicator/not.js.map new file mode 100644 index 000000000..5e2a1ca11 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/not.js.map @@ -0,0 +1 @@ +{"version":3,"file":"not.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/not.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AAIpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE;YACjC,GAAG,CAAC,IAAI,EAAE,CAAA;YACV,OAAM;SACP;QAED,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,GAAG,CAAC,SAAS,CACX;YACE,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,KAAK;SACjB,EACD,KAAK,CACN,CAAA;QAED,GAAG,CAAC,UAAU,CACZ,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAClB,CAAA;IACH,CAAC;IACD,KAAK,EAAE,EAAC,OAAO,EAAE,mBAAmB,EAAC;CACtC,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts b/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts new file mode 100644 index 000000000..1e1d34f72 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type OneOfError = ErrorObject<"oneOf", { + passingSchemas: [number, number] | null; +}, AnySchema[]>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/oneOf.js b/node_modules/ajv/dist/vocabularies/applicator/oneOf.js new file mode 100644 index 000000000..441db2ac0 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/oneOf.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: "must match exactly one schema in oneOf", + params: ({ params }) => (0, codegen_1._) `{passingSchemas: ${params.passing}}`, +}; +const def = { + keyword: "oneOf", + schemaType: "array", + trackErrors: true, + error, + code(cxt) { + const { gen, schema, parentSchema, it } = cxt; + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + if (it.opts.discriminator && parentSchema.discriminator) + return; + const schArr = schema; + const valid = gen.let("valid", false); + const passing = gen.let("passing", null); + const schValid = gen.name("_valid"); + cxt.setParams({ passing }); + // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas + gen.block(validateOneOf); + cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); + function validateOneOf() { + schArr.forEach((sch, i) => { + let schCxt; + if ((0, util_1.alwaysValidSchema)(it, sch)) { + gen.var(schValid, true); + } + else { + schCxt = cxt.subschema({ + keyword: "oneOf", + schemaProp: i, + compositeRule: true, + }, schValid); + } + if (i > 0) { + gen + .if((0, codegen_1._) `${schValid} && ${valid}`) + .assign(valid, false) + .assign(passing, (0, codegen_1._) `[${passing}, ${i}]`) + .else(); + } + gen.if(schValid, () => { + gen.assign(valid, true); + gen.assign(passing, i); + if (schCxt) + cxt.mergeEvaluated(schCxt, codegen_1.Name); + }); + }); + } + }, +}; +exports.default = def; +//# sourceMappingURL=oneOf.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map b/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map new file mode 100644 index 000000000..6cc54de65 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"oneOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/oneOf.ts"],"names":[],"mappings":";;AAOA,mDAA6C;AAC7C,6CAAoD;AASpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,wCAAwC;IACjD,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,oBAAoB,MAAM,CAAC,OAAO,GAAG;CAC7D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,G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,CAAC,EAAE;oBACT,GAAG;yBACA,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,QAAQ,OAAO,KAAK,EAAE,CAAC;yBAC9B,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;yBACpB,MAAM,CAAC,OAAO,EAAE,IAAA,WAAC,EAAA,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC;yBACtC,IAAI,EAAE,CAAA;iBACV;gBAED,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;oBACpB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;oBACvB,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;oBACtB,IAAI,MAAM;wBAAE,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,cAAI,CAAC,CAAA;gBAC9C,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts b/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js b/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js new file mode 100644 index 000000000..48501c6e3 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js @@ -0,0 +1,75 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const util_2 = require("../../compile/util"); +const def = { + keyword: "patternProperties", + type: "object", + schemaType: "object", + code(cxt) { + const { gen, schema, data, parentSchema, it } = cxt; + const { opts } = it; + const patterns = (0, code_1.allSchemaProperties)(schema); + const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p])); + if (patterns.length === 0 || + (alwaysValidPatterns.length === patterns.length && + (!it.opts.unevaluated || it.props === true))) { + return; + } + const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties; + const valid = gen.name("valid"); + if (it.props !== true && !(it.props instanceof codegen_1.Name)) { + it.props = (0, util_2.evaluatedPropsToName)(gen, it.props); + } + const { props } = it; + validatePatternProperties(); + function validatePatternProperties() { + for (const pat of patterns) { + if (checkProperties) + checkMatchingProperties(pat); + if (it.allErrors) { + validateProperties(pat); + } + else { + gen.var(valid, true); // TODO var + validateProperties(pat); + gen.if(valid); + } + } + } + function checkMatchingProperties(pat) { + for (const prop in checkProperties) { + if (new RegExp(pat).test(prop)) { + (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`); + } + } + } + function validateProperties(pat) { + gen.forIn("key", data, (key) => { + gen.if((0, codegen_1._) `${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => { + const alwaysValid = alwaysValidPatterns.includes(pat); + if (!alwaysValid) { + cxt.subschema({ + keyword: "patternProperties", + schemaProp: pat, + dataProp: key, + dataPropType: util_2.Type.Str, + }, valid); + } + if (it.opts.unevaluated && props !== true) { + gen.assign((0, codegen_1._) `${props}[${key}]`, true); + } + else if (!alwaysValid && !it.allErrors) { + // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) + // or if all properties were evaluated (props === true) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + } + }); + }); + } + }, +}; +exports.default = def; +//# sourceMappingURL=patternProperties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map b/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map new file mode 100644 index 000000000..2a60b74a5 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"patternProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/patternProperties.ts"],"names":[],"mappings":";;AAEA,kCAAuD;AACvD,mDAAkD;AAClD,6CAAqE;AACrE,6CAA6D;AAG7D,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,MAAM,EAAC,IAAI,EAAC,GAAG,EAAE,CAAA;QACjB,MAAM,QAAQ,GAAG,IAAA,0BAAmB,EAAC,MAAM,CAAC,CAAA;QAC5C,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAChD,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAc,CAAC,CAC9C,CAAA;QAED,IACE,QAAQ,CAAC,MAAM,KAAK,CAAC;YACrB,CAAC,mBAAmB,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;gBAC7C,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,EAC9C;YACA,OAAM;SACP;QAED,MAAM,eAAe,GACnB,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,uBAAuB,IAAI,YAAY,CAAC,UAAU,CAAA;QAC/E,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,YAAY,cAAI,CAAC,EAAE;YACpD,EAAE,CAAC,KAAK,GAAG,IAAA,2BAAoB,EAAC,GAAG,EAAE,EAAE,CAAC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,WAAI,CAAC,GAAG;yBACvB,EACD,KAAK,CACN,CAAA;qBACF;oBAED,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,KAAK,KAAK,IAAI,EAAE;wBACzC,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,IAAI,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;qBACtC;yBAAM,IAAI,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE;wBACxC,sFAAsF;wBACtF,uDAAuD;wBACvD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;qBACtC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts b/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js b/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js new file mode 100644 index 000000000..727bc23ce --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const items_1 = require("./items"); +const def = { + keyword: "prefixItems", + type: "array", + schemaType: ["array"], + before: "uniqueItems", + code: (cxt) => (0, items_1.validateTuple)(cxt, "items"), +}; +exports.default = def; +//# sourceMappingURL=prefixItems.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map b/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map new file mode 100644 index 000000000..deef718e6 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"prefixItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/prefixItems.ts"],"names":[],"mappings":";;AACA,mCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,GAAG,EAAE,OAAO,CAAC;CAC3C,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts b/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/properties.js b/node_modules/ajv/dist/vocabularies/applicator/properties.js new file mode 100644 index 000000000..7347358e2 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/properties.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const validate_1 = require("../../compile/validate"); +const code_1 = require("../code"); +const util_1 = require("../../compile/util"); +const additionalProperties_1 = require("./additionalProperties"); +const def = { + keyword: "properties", + type: "object", + schemaType: "object", + code(cxt) { + const { gen, schema, parentSchema, data, it } = cxt; + if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) { + additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties")); + } + const allProps = (0, code_1.allSchemaProperties)(schema); + for (const prop of allProps) { + it.definedProperties.add(prop); + } + if (it.opts.unevaluated && allProps.length && it.props !== true) { + it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props); + } + const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p])); + if (properties.length === 0) + return; + const valid = gen.name("valid"); + for (const prop of properties) { + if (hasDefault(prop)) { + applyPropertySchema(prop); + } + else { + gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties)); + applyPropertySchema(prop); + if (!it.allErrors) + gen.else().var(valid, true); + gen.endIf(); + } + cxt.it.definedProperties.add(prop); + cxt.ok(valid); + } + function hasDefault(prop) { + return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined; + } + function applyPropertySchema(prop) { + cxt.subschema({ + keyword: "properties", + schemaProp: prop, + dataProp: prop, + }, valid); + } + }, +}; +exports.default = def; +//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/properties.js.map b/node_modules/ajv/dist/vocabularies/applicator/properties.js.map new file mode 100644 index 000000000..27f8148cf --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/properties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/properties.ts"],"names":[],"mappings":";;AACA,qDAAiD;AACjD,kCAA2D;AAC3D,6CAA4E;AAC5E,iEAA0C;AAE1C,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,IAAI,EAAE,CAAC,IAAI,CAAC,gBAAgB,KAAK,KAAK,IAAI,YAAY,CAAC,oBAAoB,KAAK,SAAS,EAAE;YACzF,8BAAK,CAAC,IAAI,CAAC,IAA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AC,KAAK,EAAE,CAAA;aACZ;YACD,GAAG,CAAC,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAClC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;SACd;QAED,SAAS,UAAU,CAAC,IAAY;YAC9B,OAAO,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS,CAAA;QACvF,CAAC;QAED,SAAS,mBAAmB,CAAC,IAAY;YACvC,GAAG,CAAC,SAAS,CACX;gBACE,OAAO,EAAE,YAAY;gBACrB,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,IAAI;aACf,EACD,KAAK,CACN,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts b/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts new file mode 100644 index 000000000..a806da32f --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type PropertyNamesError = ErrorObject<"propertyNames", { + propertyName: string; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js b/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js new file mode 100644 index 000000000..f3871152d --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: "property name must be valid", + params: ({ params }) => (0, codegen_1._) `{propertyName: ${params.propertyName}}`, +}; +const def = { + keyword: "propertyNames", + type: "object", + schemaType: ["object", "boolean"], + error, + code(cxt) { + const { gen, schema, data, it } = cxt; + if ((0, util_1.alwaysValidSchema)(it, schema)) + return; + const valid = gen.name("valid"); + gen.forIn("key", data, (key) => { + cxt.setParams({ propertyName: key }); + cxt.subschema({ + keyword: "propertyNames", + data: key, + dataTypes: ["string"], + propertyName: key, + compositeRule: true, + }, valid); + gen.if((0, codegen_1.not)(valid), () => { + cxt.error(true); + if (!it.allErrors) + gen.break(); + }); + }); + cxt.ok(valid); + }, +}; +exports.default = def; +//# sourceMappingURL=propertyNames.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map b/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map new file mode 100644 index 000000000..835b2bb13 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map @@ -0,0 +1 @@ +{"version":3,"file":"propertyNames.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/propertyNames.ts"],"names":[],"mappings":";;AAOA,mDAA4C;AAC5C,6CAAoD;AAIpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,kBAAkB,MAAM,CAAC,YAAY,GAAG;CAChE,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAE/B,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;YAC7B,GAAG,CAAC,SAAS,CAAC,EAAC,YAAY,EAAE,GAAG,EAAC,CAAC,CAAA;YAClC,GAAG,CAAC,SAAS,CACX;gBACE,OAAO,EAAE,eAAe;gBACxB,IAAI,EAAE,GAAG;gBACT,SAAS,EAAE,CAAC,QAAQ,CAAC;gBACrB,YAAY,EAAE,GAAG;gBACjB,aAAa,EAAE,IAAI;aACpB,EACD,KAAK,CACN,CAAA;YACD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE;gBACtB,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;gBACf,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,GAAG,CAAC,KAAK,EAAE,CAAA;YAChC,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts b/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/thenElse.js b/node_modules/ajv/dist/vocabularies/applicator/thenElse.js new file mode 100644 index 000000000..1ae639021 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/thenElse.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const def = { + keyword: ["then", "else"], + schemaType: ["object", "boolean"], + code({ keyword, parentSchema, it }) { + if (parentSchema.if === undefined) + (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`); + }, +}; +exports.default = def; +//# sourceMappingURL=thenElse.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map b/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map new file mode 100644 index 000000000..2629f4fce --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"thenElse.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/thenElse.ts"],"names":[],"mappings":";;AAEA,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,IAAI,CAAC,EAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAa;QAC1C,IAAI,YAAY,CAAC,EAAE,KAAK,SAAS;YAAE,IAAA,sBAAe,EAAC,EAAE,EAAE,IAAI,OAAO,2BAA2B,CAAC,CAAA;IAChG,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/code.d.ts b/node_modules/ajv/dist/vocabularies/code.d.ts new file mode 100644 index 000000000..f914baca5 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/code.d.ts @@ -0,0 +1,17 @@ +import type { SchemaMap } from "../types"; +import type { SchemaCxt } from "../compile"; +import type { KeywordCxt } from "../compile/validate"; +import { CodeGen, Code, Name } from "../compile/codegen"; +export declare function checkReportMissingProp(cxt: KeywordCxt, prop: string): void; +export declare function checkMissingProp({ gen, data, it: { opts } }: KeywordCxt, properties: string[], missing: Name): Code; +export declare function reportMissingProp(cxt: KeywordCxt, missing: Name): void; +export declare function hasPropFunc(gen: CodeGen): Name; +export declare function isOwnProperty(gen: CodeGen, data: Name, property: Name | string): Code; +export declare function propertyInData(gen: CodeGen, data: Name, property: Name | string, ownProperties?: boolean): Code; +export declare function noPropertyInData(gen: CodeGen, data: Name, property: Name | string, ownProperties?: boolean): Code; +export declare function allSchemaProperties(schemaMap?: SchemaMap): string[]; +export declare function schemaProperties(it: SchemaCxt, schemaMap: SchemaMap): string[]; +export declare function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }: KeywordCxt, func: Code, context: Code, passSchema?: boolean): Code; +export declare function usePattern({ gen, it: { opts } }: KeywordCxt, pattern: string): Name; +export declare function validateArray(cxt: KeywordCxt): Name; +export declare function validateUnion(cxt: KeywordCxt): void; diff --git a/node_modules/ajv/dist/vocabularies/code.js b/node_modules/ajv/dist/vocabularies/code.js new file mode 100644 index 000000000..8cb899324 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/code.js @@ -0,0 +1,131 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0; +const codegen_1 = require("../compile/codegen"); +const util_1 = require("../compile/util"); +const names_1 = require("../compile/names"); +const util_2 = require("../compile/util"); +function checkReportMissingProp(cxt, prop) { + const { gen, data, it } = cxt; + gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { + cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true); + cxt.error(); + }); +} +exports.checkReportMissingProp = checkReportMissingProp; +function checkMissingProp({ gen, data, it: { opts } }, properties, missing) { + return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._) `${missing} = ${prop}`))); +} +exports.checkMissingProp = checkMissingProp; +function reportMissingProp(cxt, missing) { + cxt.setParams({ missingProperty: missing }, true); + cxt.error(); +} +exports.reportMissingProp = reportMissingProp; +function hasPropFunc(gen) { + return gen.scopeValue("func", { + // eslint-disable-next-line @typescript-eslint/unbound-method + ref: Object.prototype.hasOwnProperty, + code: (0, codegen_1._) `Object.prototype.hasOwnProperty`, + }); +} +exports.hasPropFunc = hasPropFunc; +function isOwnProperty(gen, data, property) { + return (0, codegen_1._) `${hasPropFunc(gen)}.call(${data}, ${property})`; +} +exports.isOwnProperty = isOwnProperty; +function propertyInData(gen, data, property, ownProperties) { + const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} !== undefined`; + return ownProperties ? (0, codegen_1._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond; +} +exports.propertyInData = propertyInData; +function noPropertyInData(gen, data, property, ownProperties) { + const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} === undefined`; + return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond; +} +exports.noPropertyInData = noPropertyInData; +function allSchemaProperties(schemaMap) { + return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : []; +} +exports.allSchemaProperties = allSchemaProperties; +function schemaProperties(it, schemaMap) { + return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p])); +} +exports.schemaProperties = schemaProperties; +function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) { + const dataAndSchema = passSchema ? (0, codegen_1._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data; + const valCxt = [ + [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)], + [names_1.default.parentData, it.parentData], + [names_1.default.parentDataProperty, it.parentDataProperty], + [names_1.default.rootData, names_1.default.rootData], + ]; + if (it.opts.dynamicRef) + valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]); + const args = (0, codegen_1._) `${dataAndSchema}, ${gen.object(...valCxt)}`; + return context !== codegen_1.nil ? (0, codegen_1._) `${func}.call(${context}, ${args})` : (0, codegen_1._) `${func}(${args})`; +} +exports.callValidateCode = callValidateCode; +const newRegExp = (0, codegen_1._) `new RegExp`; +function usePattern({ gen, it: { opts } }, pattern) { + const u = opts.unicodeRegExp ? "u" : ""; + const { regExp } = opts.code; + const rx = regExp(pattern, u); + return gen.scopeValue("pattern", { + key: rx.toString(), + ref: rx, + code: (0, codegen_1._) `${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`, + }); +} +exports.usePattern = usePattern; +function validateArray(cxt) { + const { gen, data, keyword, it } = cxt; + const valid = gen.name("valid"); + if (it.allErrors) { + const validArr = gen.let("valid", true); + validateItems(() => gen.assign(validArr, false)); + return validArr; + } + gen.var(valid, true); + validateItems(() => gen.break()); + return valid; + function validateItems(notValid) { + const len = gen.const("len", (0, codegen_1._) `${data}.length`); + gen.forRange("i", 0, len, (i) => { + cxt.subschema({ + keyword, + dataProp: i, + dataPropType: util_1.Type.Num, + }, valid); + gen.if((0, codegen_1.not)(valid), notValid); + }); + } +} +exports.validateArray = validateArray; +function validateUnion(cxt) { + const { gen, schema, keyword, it } = cxt; + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch)); + if (alwaysValid && !it.opts.unevaluated) + return; + const valid = gen.let("valid", false); + const schValid = gen.name("_valid"); + gen.block(() => schema.forEach((_sch, i) => { + const schCxt = cxt.subschema({ + keyword, + schemaProp: i, + compositeRule: true, + }, schValid); + gen.assign(valid, (0, codegen_1._) `${valid} || ${schValid}`); + const merged = cxt.mergeValidEvaluated(schCxt, schValid); + // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true) + // or if all properties and items were evaluated (it.props === true && it.items === true) + if (!merged) + gen.if((0, codegen_1.not)(valid)); + })); + cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); +} +exports.validateUnion = validateUnion; +//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/code.js.map b/node_modules/ajv/dist/vocabularies/code.js.map new file mode 100644 index 000000000..62d7ee121 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/code.js.map @@ -0,0 +1 @@ +{"version":3,"file":"code.js","sourceRoot":"","sources":["../../lib/vocabularies/code.ts"],"names":[],"mappings":";;;AAGA,gDAAoG;AACpG,0CAAuD;AACvD,4CAAgC;AAChC,0CAAuC;AACvC,SAAgB,sBAAsB,CAAC,GAAe,EAAE,IAAY;IAClE,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAC3B,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE;QACpE,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,EAAE,EAAC,EAAE,IAAI,CAAC,CAAA;QAClD,GAAG,CAAC,KAAK,EAAE,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAND,wDAMC;AAED,SAAgB,gBAAgB,CAC9B,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,EAAC,IAAI,EAAC,EAAa,EACnC,UAAoB,EACpB,OAAa;IAEb,OAAO,IAAA,YAAE,EACP,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAA,aAAG,EAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,IAAA,WAAC,EAAA,GAAG,OAAO,MAAM,IAAI,EAAE,CAAC,CACpF,CACF,CAAA;AACH,CAAC;AAVD,4CAUC;AAED,SAAgB,iBAAiB,CAAC,GAAe,EAAE,OAAa;IAC9D,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,OAAO,EAAC,EAAE,IAAI,CAAC,CAAA;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wBAAiB,EAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAA;IAC/E,IAAI,WAAW,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW;QAAE,OAAM;IAE/C,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACrC,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAEnC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CACb,MAAM,CAAC,OAAO,CAAC,CAAC,IAAe,EAAE,CAAS,EAAE,EAAE;QAC5C,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAC1B;YACE,OAAO;YACP,UAAU,EAAE,CAAC;YACb,aAAa,EAAE,IAAI;SACpB,EACD,QAAQ,CACT,CAAA;QACD,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,KAAK,OAAO,QAAQ,EAAE,CAAC,CAAA;QAC7C,MAAM,MAAM,GAAG,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QACxD,+FAA+F;QAC/F,yFAAyF;QACzF,IAAI,CAAC,MAAM;YAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,CAAC,CAAA;IACjC,CAAC,CAAC,CACH,CAAA;IAED,GAAG,CAAC,MAAM,CACR,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CACtB,CAAA;AACH,CAAC;AAjCD,sCAiCC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/core/id.d.ts b/node_modules/ajv/dist/vocabularies/core/id.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/core/id.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/core/id.js b/node_modules/ajv/dist/vocabularies/core/id.js new file mode 100644 index 000000000..313598aab --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/core/id.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const def = { + keyword: "id", + code() { + throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); + }, +}; +exports.default = def; +//# sourceMappingURL=id.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/core/id.js.map b/node_modules/ajv/dist/vocabularies/core/id.js.map new file mode 100644 index 000000000..4eb27eb33 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/core/id.js.map @@ -0,0 +1 @@ +{"version":3,"file":"id.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/id.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,IAAI;IACb,IAAI;QACF,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;IACzE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/core/index.d.ts b/node_modules/ajv/dist/vocabularies/core/index.d.ts new file mode 100644 index 000000000..f2e34ee36 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/core/index.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../../types"; +declare const core: Vocabulary; +export default core; diff --git a/node_modules/ajv/dist/vocabularies/core/index.js b/node_modules/ajv/dist/vocabularies/core/index.js new file mode 100644 index 000000000..87656d743 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/core/index.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const id_1 = require("./id"); +const ref_1 = require("./ref"); +const core = [ + "$schema", + "$id", + "$defs", + "$vocabulary", + { keyword: "$comment" }, + "definitions", + id_1.default, + ref_1.default, +]; +exports.default = core; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/core/index.js.map b/node_modules/ajv/dist/vocabularies/core/index.js.map new file mode 100644 index 000000000..5bf65f941 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/core/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/index.ts"],"names":[],"mappings":";;AACA,6BAA4B;AAC5B,+BAA8B;AAE9B,MAAM,IAAI,GAAe;IACvB,SAAS;IACT,KAAK;IACL,OAAO;IACP,aAAa;IACb,EAAC,OAAO,EAAE,UAAU,EAAC;IACrB,aAAa;IACb,YAAS;IACT,aAAU;CACX,CAAA;AAED,kBAAe,IAAI,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/core/ref.d.ts b/node_modules/ajv/dist/vocabularies/core/ref.d.ts new file mode 100644 index 000000000..6a0967d15 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/core/ref.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +import { Code } from "../../compile/codegen"; +import { SchemaEnv } from "../../compile"; +declare const def: CodeKeywordDefinition; +export declare function getValidate(cxt: KeywordCxt, sch: SchemaEnv): Code; +export declare function callRef(cxt: KeywordCxt, v: Code, sch?: SchemaEnv, $async?: boolean): void; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/core/ref.js b/node_modules/ajv/dist/vocabularies/core/ref.js new file mode 100644 index 000000000..bac1ae853 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/core/ref.js @@ -0,0 +1,122 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.callRef = exports.getValidate = void 0; +const ref_error_1 = require("../../compile/ref_error"); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const names_1 = require("../../compile/names"); +const compile_1 = require("../../compile"); +const util_1 = require("../../compile/util"); +const def = { + keyword: "$ref", + schemaType: "string", + code(cxt) { + const { gen, schema: $ref, it } = cxt; + const { baseId, schemaEnv: env, validateName, opts, self } = it; + const { root } = env; + if (($ref === "#" || $ref === "#/") && baseId === root.baseId) + return callRootRef(); + const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref); + if (schOrEnv === undefined) + throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref); + if (schOrEnv instanceof compile_1.SchemaEnv) + return callValidate(schOrEnv); + return inlineRefSchema(schOrEnv); + function callRootRef() { + if (env === root) + return callRef(cxt, validateName, env, env.$async); + const rootName = gen.scopeValue("root", { ref: root }); + return callRef(cxt, (0, codegen_1._) `${rootName}.validate`, root, root.$async); + } + function callValidate(sch) { + const v = getValidate(cxt, sch); + callRef(cxt, v, sch, sch.$async); + } + function inlineRefSchema(sch) { + const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch }); + const valid = gen.name("valid"); + const schCxt = cxt.subschema({ + schema: sch, + dataTypes: [], + schemaPath: codegen_1.nil, + topSchemaRef: schName, + errSchemaPath: $ref, + }, valid); + cxt.mergeEvaluated(schCxt); + cxt.ok(valid); + } + }, +}; +function getValidate(cxt, sch) { + const { gen } = cxt; + return sch.validate + ? gen.scopeValue("validate", { ref: sch.validate }) + : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.validate`; +} +exports.getValidate = getValidate; +function callRef(cxt, v, sch, $async) { + const { gen, it } = cxt; + const { allErrors, schemaEnv: env, opts } = it; + const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; + if ($async) + callAsyncRef(); + else + callSyncRef(); + function callAsyncRef() { + if (!env.$async) + throw new Error("async schema referenced by sync schema"); + const valid = gen.let("valid"); + gen.try(() => { + gen.code((0, codegen_1._) `await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`); + addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result + if (!allErrors) + gen.assign(valid, true); + }, (e) => { + gen.if((0, codegen_1._) `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e)); + addErrorsFrom(e); + if (!allErrors) + gen.assign(valid, false); + }); + cxt.ok(valid); + } + function callSyncRef() { + cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v)); + } + function addErrorsFrom(source) { + const errs = (0, codegen_1._) `${source}.errors`; + gen.assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged + gen.assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`); + } + function addEvaluatedFrom(source) { + var _a; + if (!it.opts.unevaluated) + return; + const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated; + // TODO refactor + if (it.props !== true) { + if (schEvaluated && !schEvaluated.dynamicProps) { + if (schEvaluated.props !== undefined) { + it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props); + } + } + else { + const props = gen.var("props", (0, codegen_1._) `${source}.evaluated.props`); + it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name); + } + } + if (it.items !== true) { + if (schEvaluated && !schEvaluated.dynamicItems) { + if (schEvaluated.items !== undefined) { + it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items); + } + } + else { + const items = gen.var("items", (0, codegen_1._) `${source}.evaluated.items`); + it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name); + } + } + } +} +exports.callRef = callRef; +exports.default = def; +//# sourceMappingURL=ref.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/core/ref.js.map b/node_modules/ajv/dist/vocabularies/core/ref.js.map new file mode 100644 index 000000000..88ac106af --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/core/ref.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/ref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AAK,CAAC,CAAA;iBACnE;aACF;iBAAM;gBACL,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAA,WAAC,EAAA,GAAG,MAAM,kBAAkB,CAAC,CAAA;gBAC5D,EAAE,CAAC,KAAK,GAAG,qBAAc,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,cAAI,CAAC,CAAA;aAC5D;SACF;QACD,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,EAAE;YACrB,IAAI,YAAY,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;gBAC9C,IAAI,YAAY,CAAC,KAAK,KAAK,SAAS,EAAE;oBACpC,EAAE,CAAC,KAAK,GAAG,qBAAc,CAAC,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;iBACnE;aACF;iBAAM;gBACL,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAA,WAAC,EAAA,GAAG,MAAM,kBAAkB,CAAC,CAAA;gBAC5D,EAAE,CAAC,KAAK,GAAG,qBAAc,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,cAAI,CAAC,CAAA;aAC5D;SACF;IACH,CAAC;AACH,CAAC;AAhED,0BAgEC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts b/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts new file mode 100644 index 000000000..ab3669a42 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition } from "../../types"; +import { DiscrError, DiscrErrorObj } from "../discriminator/types"; +export type DiscriminatorError = DiscrErrorObj | DiscrErrorObj; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/discriminator/index.js b/node_modules/ajv/dist/vocabularies/discriminator/index.js new file mode 100644 index 000000000..ccdb340b2 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/discriminator/index.js @@ -0,0 +1,100 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const types_1 = require("../discriminator/types"); +const compile_1 = require("../../compile"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag + ? `tag "${tagName}" must be string` + : `value of tag "${tagName}" must be in oneOf`, + params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`, +}; +const def = { + keyword: "discriminator", + type: "object", + schemaType: "object", + error, + code(cxt) { + const { gen, data, schema, parentSchema, it } = cxt; + const { oneOf } = parentSchema; + if (!it.opts.discriminator) { + throw new Error("discriminator: requires discriminator option"); + } + const tagName = schema.propertyName; + if (typeof tagName != "string") + throw new Error("discriminator: requires propertyName"); + if (schema.mapping) + throw new Error("discriminator: mapping is not supported"); + if (!oneOf) + throw new Error("discriminator: requires oneOf keyword"); + const valid = gen.let("valid", false); + const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`); + gen.if((0, codegen_1._) `typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName })); + cxt.ok(valid); + function validateMapping() { + const mapping = getMapping(); + gen.if(false); + for (const tagValue in mapping) { + gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); + gen.assign(valid, applyTagSchema(mapping[tagValue])); + } + gen.else(); + cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName }); + gen.endIf(); + } + function applyTagSchema(schemaProp) { + const _valid = gen.name("valid"); + const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid); + cxt.mergeEvaluated(schCxt, codegen_1.Name); + return _valid; + } + function getMapping() { + var _a; + const oneOfMapping = {}; + const topRequired = hasRequired(parentSchema); + let tagRequired = true; + for (let i = 0; i < oneOf.length; i++) { + let sch = oneOf[i]; + if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) { + sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, sch === null || sch === void 0 ? void 0 : sch.$ref); + if (sch instanceof compile_1.SchemaEnv) + sch = sch.schema; + } + const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName]; + if (typeof propSch != "object") { + throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`); + } + tagRequired = tagRequired && (topRequired || hasRequired(sch)); + addMappings(propSch, i); + } + if (!tagRequired) + throw new Error(`discriminator: "${tagName}" must be required`); + return oneOfMapping; + function hasRequired({ required }) { + return Array.isArray(required) && required.includes(tagName); + } + function addMappings(sch, i) { + if (sch.const) { + addMapping(sch.const, i); + } + else if (sch.enum) { + for (const tagValue of sch.enum) { + addMapping(tagValue, i); + } + } + else { + throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`); + } + } + function addMapping(tagValue, i) { + if (typeof tagValue != "string" || tagValue in oneOfMapping) { + throw new Error(`discriminator: "${tagName}" values must be unique strings`); + } + oneOfMapping[tagValue] = i; + } + } + }, +}; +exports.default = def; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/discriminator/index.js.map b/node_modules/ajv/dist/vocabularies/discriminator/index.js.map new file mode 100644 index 000000000..8057a4edc --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/discriminator/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/discriminator/index.ts"],"names":[],"mappings":";;AAEA,mDAA0D;AAC1D,kDAAgE;AAChE,2CAAmD;AACnD,6CAAuD;AAIvD,MAAM,KAAK,GAA2B;IACpC,OAAO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CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;YAC9D,CAAC;YAED,SAAS,WAAW,CAAC,GAAoB,EAAE,CAAS;gBAClD,IAAI,GAAG,CAAC,KAAK,EAAE;oBACb,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;iBACzB;qBAAM,IAAI,GAAG,CAAC,IAAI,EAAE;oBACnB,KAAK,MAAM,QAAQ,IAAI,GAAG,CAAC,IAAI,EAAE;wBAC/B,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;qBACxB;iBACF;qBAAM;oBACL,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,+BAA+B,CAAC,CAAA;iBACtF;YACH,CAAC;YAED,SAAS,UAAU,CAAC,QAAiB,EAAE,CAAS;gBAC9C,IAAI,OAAO,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,YAAY,EAAE;oBAC3D,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,iCAAiC,CAAC,CAAA;iBAC7E;gBACD,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts b/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts new file mode 100644 index 000000000..8550f6d97 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts @@ -0,0 +1,10 @@ +import type { ErrorObject } from "../../types"; +export declare enum DiscrError { + Tag = "tag", + Mapping = "mapping" +} +export type DiscrErrorObj = ErrorObject<"discriminator", { + error: E; + tag: string; + tagValue: unknown; +}, string>; diff --git a/node_modules/ajv/dist/vocabularies/discriminator/types.js b/node_modules/ajv/dist/vocabularies/discriminator/types.js new file mode 100644 index 000000000..d538f0cee --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/discriminator/types.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DiscrError = void 0; +var DiscrError; +(function (DiscrError) { + DiscrError["Tag"] = "tag"; + DiscrError["Mapping"] = "mapping"; +})(DiscrError = exports.DiscrError || (exports.DiscrError = {})); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/discriminator/types.js.map b/node_modules/ajv/dist/vocabularies/discriminator/types.js.map new file mode 100644 index 000000000..4908a4e9d --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/discriminator/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/vocabularies/discriminator/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,iCAAmB,CAAA;AACrB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/draft2020.d.ts b/node_modules/ajv/dist/vocabularies/draft2020.d.ts new file mode 100644 index 000000000..d65752c63 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/draft2020.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../types"; +declare const draft2020Vocabularies: Vocabulary[]; +export default draft2020Vocabularies; diff --git a/node_modules/ajv/dist/vocabularies/draft2020.js b/node_modules/ajv/dist/vocabularies/draft2020.js new file mode 100644 index 000000000..23d244aed --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/draft2020.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("./core"); +const validation_1 = require("./validation"); +const applicator_1 = require("./applicator"); +const dynamic_1 = require("./dynamic"); +const next_1 = require("./next"); +const unevaluated_1 = require("./unevaluated"); +const format_1 = require("./format"); +const metadata_1 = require("./metadata"); +const draft2020Vocabularies = [ + dynamic_1.default, + core_1.default, + validation_1.default, + (0, applicator_1.default)(true), + format_1.default, + metadata_1.metadataVocabulary, + metadata_1.contentVocabulary, + next_1.default, + unevaluated_1.default, +]; +exports.default = draft2020Vocabularies; +//# sourceMappingURL=draft2020.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/draft2020.js.map b/node_modules/ajv/dist/vocabularies/draft2020.js.map new file mode 100644 index 000000000..ae1a4d833 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/draft2020.js.map @@ -0,0 +1 @@ +{"version":3,"file":"draft2020.js","sourceRoot":"","sources":["../../lib/vocabularies/draft2020.ts"],"names":[],"mappings":";;AACA,iCAAmC;AACnC,6CAA+C;AAC/C,6CAAkD;AAClD,uCAAyC;AACzC,iCAAmC;AACnC,+CAAiD;AACjD,qCAAuC;AACvC,yCAAgE;AAEhE,MAAM,qBAAqB,GAAiB;IAC1C,iBAAiB;IACjB,cAAc;IACd,oBAAoB;IACpB,IAAA,oBAAuB,EAAC,IAAI,CAAC;IAC7B,gBAAgB;IAChB,6BAAkB;IAClB,4BAAiB;IACjB,cAAc;IACd,qBAAqB;CACtB,CAAA;AAED,kBAAe,qBAAqB,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/draft7.d.ts b/node_modules/ajv/dist/vocabularies/draft7.d.ts new file mode 100644 index 000000000..469fb8444 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/draft7.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../types"; +declare const draft7Vocabularies: Vocabulary[]; +export default draft7Vocabularies; diff --git a/node_modules/ajv/dist/vocabularies/draft7.js b/node_modules/ajv/dist/vocabularies/draft7.js new file mode 100644 index 000000000..1e993de0e --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/draft7.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const core_1 = require("./core"); +const validation_1 = require("./validation"); +const applicator_1 = require("./applicator"); +const format_1 = require("./format"); +const metadata_1 = require("./metadata"); +const draft7Vocabularies = [ + core_1.default, + validation_1.default, + (0, applicator_1.default)(), + format_1.default, + metadata_1.metadataVocabulary, + metadata_1.contentVocabulary, +]; +exports.default = draft7Vocabularies; +//# sourceMappingURL=draft7.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/draft7.js.map b/node_modules/ajv/dist/vocabularies/draft7.js.map new file mode 100644 index 000000000..bc7389c67 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/draft7.js.map @@ -0,0 +1 @@ +{"version":3,"file":"draft7.js","sourceRoot":"","sources":["../../lib/vocabularies/draft7.ts"],"names":[],"mappings":";;AACA,iCAAmC;AACnC,6CAA+C;AAC/C,6CAAkD;AAClD,qCAAuC;AACvC,yCAAgE;AAEhE,MAAM,kBAAkB,GAAiB;IACvC,cAAc;IACd,oBAAoB;IACpB,IAAA,oBAAuB,GAAE;IACzB,gBAAgB;IAChB,6BAAkB;IAClB,4BAAiB;CAClB,CAAA;AAED,kBAAe,kBAAkB,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts b/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts new file mode 100644 index 000000000..562121399 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +declare const def: CodeKeywordDefinition; +export declare function dynamicAnchor(cxt: KeywordCxt, anchor: string): void; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js b/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js new file mode 100644 index 000000000..972dc35c4 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dynamicAnchor = void 0; +const codegen_1 = require("../../compile/codegen"); +const names_1 = require("../../compile/names"); +const compile_1 = require("../../compile"); +const ref_1 = require("../core/ref"); +const def = { + keyword: "$dynamicAnchor", + schemaType: "string", + code: (cxt) => dynamicAnchor(cxt, cxt.schema), +}; +function dynamicAnchor(cxt, anchor) { + const { gen, it } = cxt; + it.schemaEnv.root.dynamicAnchors[anchor] = true; + const v = (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`; + const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt); + gen.if((0, codegen_1._) `!${v}`, () => gen.assign(v, validate)); +} +exports.dynamicAnchor = dynamicAnchor; +function _getValidate(cxt) { + const { schemaEnv, schema, self } = cxt.it; + const { root, baseId, localRefs, meta } = schemaEnv.root; + const { schemaId } = self.opts; + const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta }); + compile_1.compileSchema.call(self, sch); + return (0, ref_1.getValidate)(cxt, sch); +} +exports.default = def; +//# sourceMappingURL=dynamicAnchor.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map b/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map new file mode 100644 index 000000000..e70afe30f --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dynamicAnchor.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/dynamicAnchor.ts"],"names":[],"mappings":";;;AAEA,mDAA0D;AAC1D,+CAAmC;AACnC,2CAAsD;AACtD,qCAAuC;AAEvC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,gBAAgB;IACzB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC9C,CAAA;AAED,SAAgB,aAAa,CAAC,GAAe,EAAE,MAAc;IAC3D,MAAM,EAAC,GA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mode 100644 index 000000000..fa2f2b81d --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +declare const def: CodeKeywordDefinition; +export declare function dynamicRef(cxt: KeywordCxt, ref: string): void; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js b/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js new file mode 100644 index 000000000..9f010a0df --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dynamicRef = void 0; +const codegen_1 = require("../../compile/codegen"); +const names_1 = require("../../compile/names"); +const ref_1 = require("../core/ref"); +const def = { + keyword: "$dynamicRef", + schemaType: "string", + code: (cxt) => dynamicRef(cxt, cxt.schema), +}; +function dynamicRef(cxt, ref) { + const { gen, keyword, it } = cxt; + if (ref[0] !== "#") + throw new Error(`"${keyword}" only supports hash fragment reference`); + const anchor = ref.slice(1); + if (it.allErrors) { + _dynamicRef(); + } + else { + const valid = gen.let("valid", false); + _dynamicRef(valid); + cxt.ok(valid); + } + function _dynamicRef(valid) { + // TODO the assumption here is that `recursiveRef: #` always points to the root + // of the schema object, which is not correct, because there may be $id that + // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor. + // Because of that 2 tests in recursiveRef.json fail. + // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`). + // (This problem is not tested in JSON-Schema-Test-Suite) + if (it.schemaEnv.root.dynamicAnchors[anchor]) { + const v = gen.let("_v", (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`); + gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid)); + } + else { + _callRef(it.validateName, valid)(); + } + } + function _callRef(validate, valid) { + return valid + ? () => gen.block(() => { + (0, ref_1.callRef)(cxt, validate); + gen.let(valid, true); + }) + : () => (0, ref_1.callRef)(cxt, validate); + } +} +exports.dynamicRef = dynamicRef; +exports.default = def; +//# sourceMappingURL=dynamicRef.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map b/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map new file mode 100644 index 000000000..921c893f7 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dynamicRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/dynamicRef.ts"],"names":[],"mappings":";;;AAEA,mDAAgE;AAChE,+CAAmC;AACnC,qCAAmC;AAEnC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC3C,CAAA;AAED,SAAgB,UAAU,CAAC,GAAe,EAAE,GAAW;IACrD,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAC9B,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,OAAO,yCAAyC,CAAC,CAAA;IACzF,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC3B,IAAI,EAAE,CAAC,SAAS,EAAE;QAChB,WAAW,EAAE,CAAA;KACd;SAAM;QACL,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACrC,WAAW,CAAC,KAAK,CAAC,CAAA;QAClB,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;KACd;IAED,SAAS,WAAW,CAAC,KAAY;QAC/B,+EAA+E;QAC/E,4EAA4E;QAC5E,sFAAsF;QACtF,qDAAqD;QACrD,kGAAkG;QAClG,yDAAyD;QACzD,IAAI,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;YAC5C,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,cAAc,GAAG,IAAA,qBAAW,EAAC,MAAM,CAAC,EAAE,CAAC,CAAA;YACrE,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAA;SAChE;aAAM;YACL,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAA;SACnC;IACH,CAAC;IAED,SAAS,QAAQ,CAAC,QAAc,EAAE,KAAY;QAC5C,OAAO,KAAK;YACV,CAAC,CAAC,GAAG,EAAE,CACH,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE;gBACb,IAAA,aAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;gBACtB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YACtB,CAAC,CAAC;YACN,CAAC,CAAC,GAAG,EAAE,CAAC,IAAA,aAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IAClC,CAAC;AACH,CAAC;AApCD,gCAoCC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts b/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts new file mode 100644 index 000000000..0c751d93f --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../../types"; +declare const dynamic: Vocabulary; +export default dynamic; diff --git a/node_modules/ajv/dist/vocabularies/dynamic/index.js b/node_modules/ajv/dist/vocabularies/dynamic/index.js new file mode 100644 index 000000000..f2388a757 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dynamicAnchor_1 = require("./dynamicAnchor"); +const dynamicRef_1 = require("./dynamicRef"); +const recursiveAnchor_1 = require("./recursiveAnchor"); +const recursiveRef_1 = require("./recursiveRef"); +const dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default]; +exports.default = dynamic; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/index.js.map b/node_modules/ajv/dist/vocabularies/dynamic/index.js.map new file mode 100644 index 000000000..f96ba76dd --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/index.ts"],"names":[],"mappings":";;AACA,mDAA2C;AAC3C,6CAAqC;AACrC,uDAA+C;AAC/C,iDAAyC;AAEzC,MAAM,OAAO,GAAe,CAAC,uBAAa,EAAE,oBAAU,EAAE,yBAAe,EAAE,sBAAY,CAAC,CAAA;AAEtF,kBAAe,OAAO,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts b/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js b/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js new file mode 100644 index 000000000..9fd832353 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dynamicAnchor_1 = require("./dynamicAnchor"); +const util_1 = require("../../compile/util"); +const def = { + keyword: "$recursiveAnchor", + schemaType: "boolean", + code(cxt) { + if (cxt.schema) + (0, dynamicAnchor_1.dynamicAnchor)(cxt, ""); + else + (0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored"); + }, +}; +exports.default = def; +//# sourceMappingURL=recursiveAnchor.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map b/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map new file mode 100644 index 000000000..5d5e381b0 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"recursiveAnchor.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/recursiveAnchor.ts"],"names":[],"mappings":";;AACA,mDAA6C;AAC7C,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,UAAU,EAAE,SAAS;IACrB,IAAI,CAAC,GAAG;QACN,IAAI,GAAG,CAAC,MAAM;YAAE,IAAA,6BAAa,EAAC,GAAG,EAAE,EAAE,CAAC,CAAA;;YACjC,IAAA,sBAAe,EAAC,GAAG,CAAC,EAAE,EAAE,oCAAoC,CAAC,CAAA;IACpE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts b/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js b/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js new file mode 100644 index 000000000..8cd5c6969 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dynamicRef_1 = require("./dynamicRef"); +const def = { + keyword: "$recursiveRef", + schemaType: "string", + code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema), +}; +exports.default = def; +//# sourceMappingURL=recursiveRef.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map b/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map new file mode 100644 index 000000000..f81380446 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map @@ -0,0 +1 @@ +{"version":3,"file":"recursiveRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/recursiveRef.ts"],"names":[],"mappings":";;AACA,6CAAuC;AAEvC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,uBAAU,EAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC3C,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/errors.d.ts b/node_modules/ajv/dist/vocabularies/errors.d.ts new file mode 100644 index 000000000..be67f2e82 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/errors.d.ts @@ -0,0 +1,9 @@ +import type { TypeError } from "../compile/validate/dataType"; +import type { ApplicatorKeywordError } from "./applicator"; +import type { ValidationKeywordError } from "./validation"; +import type { FormatError } from "./format/format"; +import type { UnevaluatedPropertiesError } from "./unevaluated/unevaluatedProperties"; +import type { UnevaluatedItemsError } from "./unevaluated/unevaluatedItems"; +import type { DependentRequiredError } from "./validation/dependentRequired"; +import type { DiscriminatorError } from "./discriminator"; +export type DefinedError = TypeError | ApplicatorKeywordError | ValidationKeywordError | FormatError | UnevaluatedPropertiesError | UnevaluatedItemsError | DependentRequiredError | DiscriminatorError; diff --git a/node_modules/ajv/dist/vocabularies/errors.js b/node_modules/ajv/dist/vocabularies/errors.js new file mode 100644 index 000000000..d4d3fba00 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/errors.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/errors.js.map b/node_modules/ajv/dist/vocabularies/errors.js.map new file mode 100644 index 000000000..56bad7362 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../lib/vocabularies/errors.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/format/format.d.ts b/node_modules/ajv/dist/vocabularies/format/format.d.ts new file mode 100644 index 000000000..04dc98f64 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/format/format.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type FormatError = ErrorObject<"format", { + format: string; +}, string | { + $data: string; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/format/format.js b/node_modules/ajv/dist/vocabularies/format/format.js new file mode 100644 index 000000000..aa667c1ef --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/format/format.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const error = { + message: ({ schemaCode }) => (0, codegen_1.str) `must match format "${schemaCode}"`, + params: ({ schemaCode }) => (0, codegen_1._) `{format: ${schemaCode}}`, +}; +const def = { + keyword: "format", + type: ["number", "string"], + schemaType: "string", + $data: true, + error, + code(cxt, ruleType) { + const { gen, data, $data, schema, schemaCode, it } = cxt; + const { opts, errSchemaPath, schemaEnv, self } = it; + if (!opts.validateFormats) + return; + if ($data) + validate$DataFormat(); + else + validateFormat(); + function validate$DataFormat() { + const fmts = gen.scopeValue("formats", { + ref: self.formats, + code: opts.code.formats, + }); + const fDef = gen.const("fDef", (0, codegen_1._) `${fmts}[${schemaCode}]`); + const fType = gen.let("fType"); + const format = gen.let("format"); + // TODO simplify + gen.if((0, codegen_1._) `typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._) `${fDef}.type || "string"`).assign(format, (0, codegen_1._) `${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._) `"string"`).assign(format, fDef)); + cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt())); + function unknownFmt() { + if (opts.strictSchema === false) + return codegen_1.nil; + return (0, codegen_1._) `${schemaCode} && !${format}`; + } + function invalidFmt() { + const callFormat = schemaEnv.$async + ? (0, codegen_1._) `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` + : (0, codegen_1._) `${format}(${data})`; + const validData = (0, codegen_1._) `(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`; + return (0, codegen_1._) `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`; + } + } + function validateFormat() { + const formatDef = self.formats[schema]; + if (!formatDef) { + unknownFormat(); + return; + } + if (formatDef === true) + return; + const [fmtType, format, fmtRef] = getFormat(formatDef); + if (fmtType === ruleType) + cxt.pass(validCondition()); + function unknownFormat() { + if (opts.strictSchema === false) { + self.logger.warn(unknownMsg()); + return; + } + throw new Error(unknownMsg()); + function unknownMsg() { + return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`; + } + } + function getFormat(fmtDef) { + const code = fmtDef instanceof RegExp + ? (0, codegen_1.regexpCode)(fmtDef) + : opts.code.formats + ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` + : undefined; + const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code }); + if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { + return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._) `${fmt}.validate`]; + } + return ["string", fmtDef, fmt]; + } + function validCondition() { + if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { + if (!schemaEnv.$async) + throw new Error("async format in sync schema"); + return (0, codegen_1._) `await ${fmtRef}(${data})`; + } + return typeof format == "function" ? (0, codegen_1._) `${fmtRef}(${data})` : (0, codegen_1._) `${fmtRef}.test(${data})`; + } + } + }, +}; +exports.default = def; +//# sourceMappingURL=format.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/format/format.js.map b/node_modules/ajv/dist/vocabularies/format/format.js.map new file mode 100644 index 000000000..897d9ded5 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/format/format.js.map @@ -0,0 +1 @@ +{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../lib/vocabularies/format/format.ts"],"names":[],"mappings":";;AASA,mDAAoF;AAapF,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,sBAAsB,UAAU,GAAG;IACjE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,YAAY,UAAU,GAAG;CACrD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC1B,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe,EAAE,QAAiB;QACrC,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtD,MAAM,EAAC,IAAI,EAAE,aAAa,EAA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ACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/format/index.d.ts b/node_modules/ajv/dist/vocabularies/format/index.d.ts new file mode 100644 index 000000000..c8019c9d6 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/format/index.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../../types"; +declare const format: Vocabulary; +export default format; diff --git a/node_modules/ajv/dist/vocabularies/format/index.js b/node_modules/ajv/dist/vocabularies/format/index.js new file mode 100644 index 000000000..d19023d24 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/format/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const format_1 = require("./format"); +const format = [format_1.default]; +exports.default = format; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/format/index.js.map b/node_modules/ajv/dist/vocabularies/format/index.js.map new file mode 100644 index 000000000..6315bfe1f --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/format/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/format/index.ts"],"names":[],"mappings":";;AACA,qCAAoC;AAEpC,MAAM,MAAM,GAAe,CAAC,gBAAa,CAAC,CAAA;AAE1C,kBAAe,MAAM,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts b/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts new file mode 100644 index 000000000..85e16df6a --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition } from "../../types"; +import { _JTDTypeError } from "./error"; +import { DiscrError, DiscrErrorObj } from "../discriminator/types"; +export type JTDDiscriminatorError = _JTDTypeError<"discriminator", "object", string> | DiscrErrorObj | DiscrErrorObj; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/discriminator.js b/node_modules/ajv/dist/vocabularies/jtd/discriminator.js new file mode 100644 index 000000000..e7074d279 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/discriminator.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const metadata_1 = require("./metadata"); +const nullable_1 = require("./nullable"); +const error_1 = require("./error"); +const types_1 = require("../discriminator/types"); +const error = { + message: (cxt) => { + const { schema, params } = cxt; + return params.discrError + ? params.discrError === types_1.DiscrError.Tag + ? `tag "${schema}" must be string` + : `value of tag "${schema}" must be in mapping` + : (0, error_1.typeErrorMessage)(cxt, "object"); + }, + params: (cxt) => { + const { schema, params } = cxt; + return params.discrError + ? (0, codegen_1._) `{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}` + : (0, error_1.typeErrorParams)(cxt, "object"); + }, +}; +const def = { + keyword: "discriminator", + schemaType: "string", + implements: ["mapping"], + error, + code(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { gen, data, schema, parentSchema } = cxt; + const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data); + gen.if(cond); + validateDiscriminator(); + gen.elseIf((0, codegen_1.not)(valid)); + cxt.error(); + gen.endIf(); + cxt.ok(valid); + function validateDiscriminator() { + const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(schema)}`); + gen.if((0, codegen_1._) `${tag} === undefined`); + cxt.error(false, { discrError: types_1.DiscrError.Tag, tag }); + gen.elseIf((0, codegen_1._) `typeof ${tag} == "string"`); + validateMapping(tag); + gen.else(); + cxt.error(false, { discrError: types_1.DiscrError.Tag, tag }, { instancePath: schema }); + gen.endIf(); + } + function validateMapping(tag) { + gen.if(false); + for (const tagValue in parentSchema.mapping) { + gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); + gen.assign(valid, applyTagSchema(tagValue)); + } + gen.else(); + cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag }, { instancePath: schema, schemaPath: "mapping", parentSchema: true }); + gen.endIf(); + } + function applyTagSchema(schemaProp) { + const _valid = gen.name("valid"); + cxt.subschema({ + keyword: "mapping", + schemaProp, + jtdDiscriminator: schema, + }, _valid); + return _valid; + } + }, +}; +exports.default = def; +//# sourceMappingURL=discriminator.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map b/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map new file mode 100644 index 000000000..53cb717b6 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"discriminator.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/discriminator.ts"],"names":[],"mappings":";;AAEA,mDAA+D;AAC/D,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAwE;AACxE,kDAAgE;AAOhE,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAC5B,OAAO,MAAM,CAAC,UAAU;YACtB,CAAC,CAAC,MAAM,CAAC,UAAU,KAAK,kBAAU,CAAC,GAAG;gBACpC,CAAC,CAAC,QAAQ,MAAM,kBAAkB;gBAClC,CAAC,CAAC,iBAAiB,MAAM,sBAAsB;YACjD,CAAC,CAAC,IAAA,wBAAgB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IACrC,CAAC;IACD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;QACd,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAC5B,OAAO,MAAM,CAAC,UAAU;YACtB,CAAC,CAAC,IAAA,WAAC,EAAA,WAAW,MAAM,CAAC,UAAU,UAAU,MAAM,eAAe,MAAM,CAAC,GAAG,GAAG;YAC3E,CAAC,CAAC,IAAA,uBAAe,EAAC,GAAG,EAAE,QA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C,UAAU,EAAE,kBAAU,CAAC,GAAG,EAAE,GAAG,EAAC,EAAE,EAAC,YAAY,EAAE,MAAM,EAAC,CAAC,CAAA;YAC3E,GAAG,CAAC,KAAK,EAAE,CAAA;QACb,CAAC;QAED,SAAS,eAAe,CAAC,GAAS;YAChC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;YACb,KAAK,MAAM,QAAQ,IAAI,YAAY,CAAC,OAAO,EAAE;gBAC3C,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,QAAQ,QAAQ,EAAE,CAAC,CAAA;gBACrC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAA;aAC5C;YACD,GAAG,CAAC,IAAI,EAAE,CAAA;YACV,GAAG,CAAC,KAAK,CACP,KAAK,EACL,EAAC,UAAU,EAAE,kBAAU,CAAC,OAAO,EAAE,GAAG,EAAC,EACrC,EAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAC,CAClE,CAAA;YACD,GAAG,CAAC,KAAK,EAAE,CAAA;QACb,CAAC;QAED,SAAS,cAAc,CAAC,UAAkB;YACxC,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAChC,GAAG,CAAC,SAAS,CACX;gBACE,OAAO,EAAE,SAAS;gBAClB,UAAU;gBACV,gBAAgB,EAAE,MAAM;aACzB,EACD,MAAM,CACP,CAAA;YACD,OAAO,MAAM,CAAA;QACf,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts b/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts new file mode 100644 index 000000000..82c942c35 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition, SchemaObject } from "../../types"; +import { _JTDTypeError } from "./error"; +export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/elements.js b/node_modules/ajv/dist/vocabularies/jtd/elements.js new file mode 100644 index 000000000..9b8fb548a --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/elements.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const metadata_1 = require("./metadata"); +const nullable_1 = require("./nullable"); +const error_1 = require("./error"); +const def = { + keyword: "elements", + schemaType: "object", + error: (0, error_1.typeError)("array"), + code(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { gen, data, schema, it } = cxt; + if ((0, util_1.alwaysValidSchema)(it, schema)) + return; + const [valid] = (0, nullable_1.checkNullable)(cxt); + gen.if((0, codegen_1.not)(valid), () => gen.if((0, codegen_1._) `Array.isArray(${data})`, () => gen.assign(valid, (0, code_1.validateArray)(cxt)), () => cxt.error())); + cxt.ok(valid); + }, +}; +exports.default = def; +//# sourceMappingURL=elements.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/elements.js.map b/node_modules/ajv/dist/vocabularies/jtd/elements.js.map new file mode 100644 index 000000000..38fe3a129 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/elements.js.map @@ -0,0 +1 @@ +{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/elements.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AACpD,kCAAqC;AACrC,mDAA4C;AAC5C,yCAAwC;AACxC,yCAAwC;AACxC,mCAAgD;AAIhD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAA,iBAAS,EAAC,OAAO,CAAC;IACzB,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClC,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CACtB,GAAG,CAAC,EAAE,CACJ,IAAA,WAAC,EAAA,iBAAiB,IAAI,GAAG,EACzB,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,EAC3C,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAClB,CACF,CAAA;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts b/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts new file mode 100644 index 000000000..8ba1790d7 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type JTDEnumError = ErrorObject<"enum", { + allowedValues: string[]; +}, string[]>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/enum.js b/node_modules/ajv/dist/vocabularies/jtd/enum.js new file mode 100644 index 000000000..78b01ee37 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/enum.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const metadata_1 = require("./metadata"); +const nullable_1 = require("./nullable"); +const error = { + message: "must be equal to one of the allowed values", + params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`, +}; +const def = { + keyword: "enum", + schemaType: "array", + error, + code(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { gen, data, schema, schemaValue, parentSchema, it } = cxt; + if (schema.length === 0) + throw new Error("enum must have non-empty array"); + if (schema.length !== new Set(schema).size) + throw new Error("enum items must be unique"); + let valid; + const isString = (0, codegen_1._) `typeof ${data} == "string"`; + if (schema.length >= it.opts.loopEnum) { + let cond; + [valid, cond] = (0, nullable_1.checkNullable)(cxt, isString); + gen.if(cond, loopEnum); + } + else { + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + valid = (0, codegen_1.and)(isString, (0, codegen_1.or)(...schema.map((value) => (0, codegen_1._) `${data} === ${value}`))); + if (parentSchema.nullable) + valid = (0, codegen_1.or)((0, codegen_1._) `${data} === null`, valid); + } + cxt.pass(valid); + function loopEnum() { + gen.forOf("v", schemaValue, (v) => gen.if((0, codegen_1._) `${valid} = ${data} === ${v}`, () => gen.break())); + } + }, +}; +exports.default = def; +//# sourceMappingURL=enum.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/enum.js.map b/node_modules/ajv/dist/vocabularies/jtd/enum.js.map new file mode 100644 index 000000000..663cc7c5d --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/enum.js.map @@ -0,0 +1 @@ +{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/enum.ts"],"names":[],"mappings":";;AAEA,mDAAsD;AACtD,yCAAwC;AACxC,yCAAwC;AAIxC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,4CAA4C;IACrD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,mBAAmB,UAAU,GAAG;CAC5D,CAAA;AAED,MAAM,GAAG,GAA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I,WAAW,EAAE,KAAK,CAAC,CAAA;SAClE;QACD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAEf,SAAS,QAAQ;YACf,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,WAAmB,EAAE,CAAC,CAAC,EAAE,EAAE,CACxC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,MAAM,IAAI,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAC1D,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/error.d.ts b/node_modules/ajv/dist/vocabularies/jtd/error.d.ts new file mode 100644 index 000000000..d334ff54c --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/error.d.ts @@ -0,0 +1,9 @@ +import type { KeywordErrorDefinition, KeywordErrorCxt, ErrorObject } from "../../types"; +import { Code } from "../../compile/codegen"; +export type _JTDTypeError = ErrorObject; +export declare function typeError(t: string): KeywordErrorDefinition; +export declare function typeErrorMessage({ parentSchema }: KeywordErrorCxt, t: string): string; +export declare function typeErrorParams({ parentSchema }: KeywordErrorCxt, t: string): Code; diff --git a/node_modules/ajv/dist/vocabularies/jtd/error.js b/node_modules/ajv/dist/vocabularies/jtd/error.js new file mode 100644 index 000000000..1a3920a7e --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/error.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typeErrorParams = exports.typeErrorMessage = exports.typeError = void 0; +const codegen_1 = require("../../compile/codegen"); +function typeError(t) { + return { + message: (cxt) => typeErrorMessage(cxt, t), + params: (cxt) => typeErrorParams(cxt, t), + }; +} +exports.typeError = typeError; +function typeErrorMessage({ parentSchema }, t) { + return (parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable) ? `must be ${t} or null` : `must be ${t}`; +} +exports.typeErrorMessage = typeErrorMessage; +function typeErrorParams({ parentSchema }, t) { + return (0, codegen_1._) `{type: ${t}, nullable: ${!!(parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable)}}`; +} +exports.typeErrorParams = typeErrorParams; +//# sourceMappingURL=error.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/error.js.map b/node_modules/ajv/dist/vocabularies/jtd/error.js.map new file mode 100644 index 000000000..db5596787 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/error.ts"],"names":[],"mappings":";;;AACA,mDAA6C;AAQ7C,SAAgB,SAAS,CAAC,CAAS;IACjC,OAAO;QACL,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1C,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,CAAC;KACzC,CAAA;AACH,CAAC;AALD,8BAKC;AAED,SAAgB,gBAAgB,CAAC,EAAC,YAAY,EAAkB,EAAE,CAAS;IACzE,OAAO,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,EAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAA;AACzE,CAAC;AAFD,4CAEC;AAED,SAAgB,eAAe,CAAC,EAAC,YAAY,EAAkB,EAAE,CAAS;IACxE,OAAO,IAAA,WAAC,EAAA,UAAU,CAAC,eAAe,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,CAAA,GAAG,CAAA;AAC/D,CAAC;AAFD,0CAEC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/index.d.ts b/node_modules/ajv/dist/vocabularies/jtd/index.d.ts new file mode 100644 index 000000000..c56246b78 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/index.d.ts @@ -0,0 +1,10 @@ +import type { Vocabulary } from "../../types"; +import { JTDTypeError } from "./type"; +import { JTDEnumError } from "./enum"; +import { JTDElementsError } from "./elements"; +import { JTDPropertiesError } from "./properties"; +import { JTDDiscriminatorError } from "./discriminator"; +import { JTDValuesError } from "./values"; +declare const jtdVocabulary: Vocabulary; +export default jtdVocabulary; +export type JTDErrorObject = JTDTypeError | JTDEnumError | JTDElementsError | JTDPropertiesError | JTDDiscriminatorError | JTDValuesError; diff --git a/node_modules/ajv/dist/vocabularies/jtd/index.js b/node_modules/ajv/dist/vocabularies/jtd/index.js new file mode 100644 index 000000000..18f40ab7a --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/index.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const ref_1 = require("./ref"); +const type_1 = require("./type"); +const enum_1 = require("./enum"); +const elements_1 = require("./elements"); +const properties_1 = require("./properties"); +const optionalProperties_1 = require("./optionalProperties"); +const discriminator_1 = require("./discriminator"); +const values_1 = require("./values"); +const union_1 = require("./union"); +const metadata_1 = require("./metadata"); +const jtdVocabulary = [ + "definitions", + ref_1.default, + type_1.default, + enum_1.default, + elements_1.default, + properties_1.default, + optionalProperties_1.default, + discriminator_1.default, + values_1.default, + union_1.default, + metadata_1.default, + { keyword: "additionalProperties", schemaType: "boolean" }, + { keyword: "nullable", schemaType: "boolean" }, +]; +exports.default = jtdVocabulary; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/index.js.map b/node_modules/ajv/dist/vocabularies/jtd/index.js.map new file mode 100644 index 000000000..713a1875b --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/index.ts"],"names":[],"mappings":";;AACA,+BAA8B;AAC9B,iCAAgD;AAChD,iCAAgD;AAChD,yCAAqD;AACrD,6CAA2D;AAC3D,6DAAqD;AACrD,mDAAoE;AACpE,qCAA+C;AAC/C,mCAA2B;AAC3B,yCAAiC;AAEjC,MAAM,aAAa,GAAe;IAChC,aAAa;IACb,aAAU;IACV,cAAW;IACX,cAAW;IACX,kBAAQ;IACR,oBAAU;IACV,4BAAkB;IAClB,uBAAa;IACb,gBAAM;IACN,eAAK;IACL,kBAAQ;IACR,EAAC,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,SAAS,EAAC;IACxD,EAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC;CAC7C,CAAA;AAED,kBAAe,aAAa,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts b/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts new file mode 100644 index 000000000..86e15a8ed --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts @@ -0,0 +1,5 @@ +import { KeywordCxt } from "../../ajv"; +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export declare function checkMetadata({ it, keyword }: KeywordCxt, metadata?: boolean): void; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/metadata.js b/node_modules/ajv/dist/vocabularies/jtd/metadata.js new file mode 100644 index 000000000..eeb3c91cd --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/metadata.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkMetadata = void 0; +const util_1 = require("../../compile/util"); +const def = { + keyword: "metadata", + schemaType: "object", + code(cxt) { + checkMetadata(cxt); + const { gen, schema, it } = cxt; + if ((0, util_1.alwaysValidSchema)(it, schema)) + return; + const valid = gen.name("valid"); + cxt.subschema({ keyword: "metadata", jtdMetadata: true }, valid); + cxt.ok(valid); + }, +}; +function checkMetadata({ it, keyword }, metadata) { + if (it.jtdMetadata !== metadata) { + throw new Error(`JTD: "${keyword}" cannot be used in this schema location`); + } +} +exports.checkMetadata = checkMetadata; +exports.default = def; +//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map b/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map new file mode 100644 index 000000000..c22e73ada --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map @@ -0,0 +1 @@ +{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/metadata.ts"],"names":[],"mappings":";;;AAEA,6CAAoD;AAEpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,aAAa,CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;QAC9D,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,SAAgB,aAAa,CAAC,EAAC,EAAE,EAAE,OAAO,EAAa,EAAE,QAAkB;IACzE,IAAI,EAAE,CAAC,WAAW,KAAK,QAAQ,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,0CAA0C,CAAC,CAAA;KAC5E;AACH,CAAC;AAJD,sCAIC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts b/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts new file mode 100644 index 000000000..254f76023 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts @@ -0,0 +1,4 @@ +import type { KeywordCxt } from "../../compile/validate"; +import { Code, Name } from "../../compile/codegen"; +export declare function checkNullable({ gen, data, parentSchema }: KeywordCxt, cond?: Code): [Name, Code]; +export declare function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code]; diff --git a/node_modules/ajv/dist/vocabularies/jtd/nullable.js b/node_modules/ajv/dist/vocabularies/jtd/nullable.js new file mode 100644 index 000000000..8c92d2cde --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/nullable.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkNullableObject = exports.checkNullable = void 0; +const codegen_1 = require("../../compile/codegen"); +function checkNullable({ gen, data, parentSchema }, cond = codegen_1.nil) { + const valid = gen.name("valid"); + if (parentSchema.nullable) { + gen.let(valid, (0, codegen_1._) `${data} === null`); + cond = (0, codegen_1.not)(valid); + } + else { + gen.let(valid, false); + } + return [valid, cond]; +} +exports.checkNullable = checkNullable; +function checkNullableObject(cxt, cond) { + const [valid, cond_] = checkNullable(cxt, cond); + return [valid, (0, codegen_1._) `${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`]; +} +exports.checkNullableObject = checkNullableObject; +//# sourceMappingURL=nullable.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map b/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map new file mode 100644 index 000000000..5bfaf3279 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/nullable.ts"],"names":[],"mappings":";;;AACA,mDAA6D;AAE7D,SAAgB,aAAa,CAC3B,EAAC,GAAG,EAAE,IAAI,EAAE,YAAY,EAAa,EACrC,OAAa,aAAG;IAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,IAAI,YAAY,CAAC,QAAQ,EAAE;QACzB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,CAAC,CAAA;QACnC,IAAI,GAAG,IAAA,aAAG,EAAC,KAAK,CAAC,CAAA;KAClB;SAAM;QACL,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;KACtB;IACD,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAZD,sCAYC;AAED,SAAgB,mBAAmB,CAAC,GAAe,EAAE,IAAU;IAC7D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC/C,OAAO,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,KAAK,cAAc,GAAG,CAAC,IAAI,kCAAkC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAA;AAC9F,CAAC;AAHD,kDAGC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts b/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js b/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js new file mode 100644 index 000000000..fe272758f --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const properties_1 = require("./properties"); +const def = { + keyword: "optionalProperties", + schemaType: "object", + error: properties_1.error, + code(cxt) { + if (cxt.parentSchema.properties) + return; + (0, properties_1.validateProperties)(cxt); + }, +}; +exports.default = def; +//# sourceMappingURL=optionalProperties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map b/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map new file mode 100644 index 000000000..21e5f0d47 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"optionalProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/optionalProperties.ts"],"names":[],"mappings":";;AAEA,6CAAsD;AAEtD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,oBAAoB;IAC7B,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAL,kBAAK;IACL,IAAI,CAAC,GAAe;QAClB,IAAI,GAAG,CAAC,YAAY,CAAC,UAAU;YAAE,OAAM;QACvC,IAAA,+BAAkB,EAAC,GAAG,CAAC,CAAA;IACzB,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts b/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts new file mode 100644 index 000000000..54e3b347c --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts @@ -0,0 +1,22 @@ +import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaObject } from "../../types"; +import type { KeywordCxt } from "../../compile/validate"; +import { _JTDTypeError } from "./error"; +declare enum PropError { + Additional = "additional", + Missing = "missing" +} +type PropKeyword = "properties" | "optionalProperties"; +type PropSchema = { + [P in string]?: SchemaObject; +}; +export type JTDPropertiesError = _JTDTypeError | ErrorObject | ErrorObject; +export declare const error: KeywordErrorDefinition; +declare const def: CodeKeywordDefinition; +export declare function validateProperties(cxt: KeywordCxt): void; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/properties.js b/node_modules/ajv/dist/vocabularies/jtd/properties.js new file mode 100644 index 000000000..f4e9de458 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/properties.js @@ -0,0 +1,149 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateProperties = exports.error = void 0; +const code_1 = require("../code"); +const util_1 = require("../../compile/util"); +const codegen_1 = require("../../compile/codegen"); +const metadata_1 = require("./metadata"); +const nullable_1 = require("./nullable"); +const error_1 = require("./error"); +var PropError; +(function (PropError) { + PropError["Additional"] = "additional"; + PropError["Missing"] = "missing"; +})(PropError || (PropError = {})); +exports.error = { + message: (cxt) => { + const { params } = cxt; + return params.propError + ? params.propError === PropError.Additional + ? "must NOT have additional properties" + : `must have property '${params.missingProperty}'` + : (0, error_1.typeErrorMessage)(cxt, "object"); + }, + params: (cxt) => { + const { params } = cxt; + return params.propError + ? params.propError === PropError.Additional + ? (0, codegen_1._) `{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}` + : (0, codegen_1._) `{error: ${params.propError}, missingProperty: ${params.missingProperty}}` + : (0, error_1.typeErrorParams)(cxt, "object"); + }, +}; +const def = { + keyword: "properties", + schemaType: "object", + error: exports.error, + code: validateProperties, +}; +// const error: KeywordErrorDefinition = { +// message: "should NOT have additional properties", +// params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, +// } +function validateProperties(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { gen, data, parentSchema, it } = cxt; + const { additionalProperties, nullable } = parentSchema; + if (it.jtdDiscriminator && nullable) + throw new Error("JTD: nullable inside discriminator mapping"); + if (commonProperties()) { + throw new Error("JTD: properties and optionalProperties have common members"); + } + const [allProps, properties] = schemaProperties("properties"); + const [allOptProps, optProperties] = schemaProperties("optionalProperties"); + if (properties.length === 0 && optProperties.length === 0 && additionalProperties) { + return; + } + const [valid, cond] = it.jtdDiscriminator === undefined + ? (0, nullable_1.checkNullableObject)(cxt, data) + : [gen.let("valid", false), true]; + gen.if(cond, () => gen.assign(valid, true).block(() => { + validateProps(properties, "properties", true); + validateProps(optProperties, "optionalProperties"); + if (!additionalProperties) + validateAdditional(); + })); + cxt.pass(valid); + function commonProperties() { + const props = parentSchema.properties; + const optProps = parentSchema.optionalProperties; + if (!(props && optProps)) + return false; + for (const p in props) { + if (Object.prototype.hasOwnProperty.call(optProps, p)) + return true; + } + return false; + } + function schemaProperties(keyword) { + const schema = parentSchema[keyword]; + const allPs = schema ? (0, code_1.allSchemaProperties)(schema) : []; + if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) { + throw new Error(`JTD: discriminator tag used in ${keyword}`); + } + const ps = allPs.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p])); + return [allPs, ps]; + } + function validateProps(props, keyword, required) { + const _valid = gen.var("valid"); + for (const prop of props) { + gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => applyPropertySchema(prop, keyword, _valid), () => missingProperty(prop)); + cxt.ok(_valid); + } + function missingProperty(prop) { + if (required) { + gen.assign(_valid, false); + cxt.error(false, { propError: PropError.Missing, missingProperty: prop }, { schemaPath: prop }); + } + else { + gen.assign(_valid, true); + } + } + } + function applyPropertySchema(prop, keyword, _valid) { + cxt.subschema({ + keyword, + schemaProp: prop, + dataProp: prop, + }, _valid); + } + function validateAdditional() { + gen.forIn("key", data, (key) => { + const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator); + const addOptProp = isAdditional(key, allOptProps, "optionalProperties"); + const extra = addProp === true ? addOptProp : addOptProp === true ? addProp : (0, codegen_1.and)(addProp, addOptProp); + gen.if(extra, () => { + if (it.opts.removeAdditional) { + gen.code((0, codegen_1._) `delete ${data}[${key}]`); + } + else { + cxt.error(false, { propError: PropError.Additional, additionalProperty: key }, { instancePath: key, parentSchema: true }); + if (!it.opts.allErrors) + gen.break(); + } + }); + }); + } + function isAdditional(key, props, keyword, jtdDiscriminator) { + let additional; + if (props.length > 8) { + // TODO maybe an option instead of hard-coded 8? + const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema[keyword], keyword); + additional = (0, codegen_1.not)((0, code_1.isOwnProperty)(gen, propsSchema, key)); + if (jtdDiscriminator !== undefined) { + additional = (0, codegen_1.and)(additional, (0, codegen_1._) `${key} !== ${jtdDiscriminator}`); + } + } + else if (props.length || jtdDiscriminator !== undefined) { + const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props); + additional = (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._) `${key} !== ${p}`)); + } + else { + additional = true; + } + return additional; + } +} +exports.validateProperties = validateProperties; +exports.default = def; +//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/properties.js.map b/node_modules/ajv/dist/vocabularies/jtd/properties.js.map new file mode 100644 index 000000000..03997a3d0 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/properties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/properties.ts"],"names":[],"mappings":";;;AAOA,kCAA0E;AAC1E,6CAAoE;AACpE,mDAA6D;AAC7D,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAwE;AAExE,IAAK,SAGJ;AAHD,WAAK,SAAS;IACZ,sCAAyB,CAAA;IACzB,gCAAmB,CAAA;AACrB,CAAC,EAHI,SAAS,KAAT,SAAS,QAGb;AAWY,QAAA,KAAK,GAA2B;IAC3C,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,EAAC,MAAM,EAAC,GAAG,GAAG,CAAA;QACpB,OAAO,MAAM,CAAC,SAAS;YACrB,CAAC,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,UAAU;gBACzC,CAAC,CAAC,qCAAqC;gBACvC,CAAC,CAAC,uBAAuB,MAAM,CAAC,eAAe,GAAG;YACpD,CAAC,CAAC,IAAA,wBAAgB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IACrC,CAAC;IACD,MAA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AC,KAAK,EAAE,CAAA;iBACpC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,SAAS,YAAY,CACnB,GAAS,EACT,KAAe,EACf,OAAe,EACf,gBAAyB;QAEzB,IAAI,UAA0B,CAAA;QAC9B,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YACpB,gDAAgD;YAChD,MAAM,WAAW,GAAG,IAAA,qBAAc,EAAC,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAA;YACtE,UAAU,GAAG,IAAA,aAAG,EAAC,IAAA,oBAAa,EAAC,GAAG,EAAE,WAAmB,EAAE,GAAG,CAAC,CAAC,CAAA;YAC9D,IAAI,gBAAgB,KAAK,SAAS,EAAE;gBAClC,UAAU,GAAG,IAAA,aAAG,EAAC,UAAU,EAAE,IAAA,WAAC,EAAA,GAAG,GAAG,QAAQ,gBAAgB,EAAE,CAAC,CAAA;aAChE;SACF;aAAM,IAAI,KAAK,CAAC,MAAM,IAAI,gBAAgB,KAAK,SAAS,EAAE;YACzD,MAAM,EAAE,GAAG,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YACpF,UAAU,GAAG,IAAA,aAAG,EAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;SACvD;aAAM;YACL,UAAU,GAAG,IAAI,CAAA;SAClB;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;AACH,CAAC;AA1HD,gDA0HC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts b/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts new file mode 100644 index 000000000..ccdf84c0b --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts @@ -0,0 +1,4 @@ +import type { CodeKeywordDefinition, AnySchemaObject } from "../../types"; +declare const def: CodeKeywordDefinition; +export declare function hasRef(schema: AnySchemaObject): boolean; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/ref.js b/node_modules/ajv/dist/vocabularies/jtd/ref.js new file mode 100644 index 000000000..b7c6b02d7 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/ref.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hasRef = void 0; +const compile_1 = require("../../compile"); +const codegen_1 = require("../../compile/codegen"); +const ref_error_1 = require("../../compile/ref_error"); +const names_1 = require("../../compile/names"); +const ref_1 = require("../core/ref"); +const metadata_1 = require("./metadata"); +const def = { + keyword: "ref", + schemaType: "string", + code(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { gen, data, schema: ref, parentSchema, it } = cxt; + const { schemaEnv: { root }, } = it; + const valid = gen.name("valid"); + if (parentSchema.nullable) { + gen.var(valid, (0, codegen_1._) `${data} === null`); + gen.if((0, codegen_1.not)(valid), validateJtdRef); + } + else { + gen.var(valid, false); + validateJtdRef(); + } + cxt.ok(valid); + function validateJtdRef() { + var _a; + const refSchema = (_a = root.schema.definitions) === null || _a === void 0 ? void 0 : _a[ref]; + if (!refSchema) { + throw new ref_error_1.default(it.opts.uriResolver, "", ref, `No definition ${ref}`); + } + if (hasRef(refSchema) || !it.opts.inlineRefs) + callValidate(refSchema); + else + inlineRefSchema(refSchema); + } + function callValidate(schema) { + const sch = compile_1.compileSchema.call(it.self, new compile_1.SchemaEnv({ schema, root, schemaPath: `/definitions/${ref}` })); + const v = (0, ref_1.getValidate)(cxt, sch); + const errsCount = gen.const("_errs", names_1.default.errors); + (0, ref_1.callRef)(cxt, v, sch, sch.$async); + gen.assign(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); + } + function inlineRefSchema(schema) { + const schName = gen.scopeValue("schema", it.opts.code.source === true ? { ref: schema, code: (0, codegen_1.stringify)(schema) } : { ref: schema }); + cxt.subschema({ + schema, + dataTypes: [], + schemaPath: codegen_1.nil, + topSchemaRef: schName, + errSchemaPath: `/definitions/${ref}`, + }, valid); + } + }, +}; +function hasRef(schema) { + for (const key in schema) { + let sch; + if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) + return true; + } + return false; +} +exports.hasRef = hasRef; +exports.default = def; +//# sourceMappingURL=ref.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/ref.js.map b/node_modules/ajv/dist/vocabularies/jtd/ref.js.map new file mode 100644 index 000000000..c11c45c1f --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/ref.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/ref.ts"],"names":[],"mappings":";;;AAEA,2CAAsD;AACtD,mDAA4D;AAC5D,uDAAqD;AACrD,+CAAmC;AACnC,qCAAgD;AAChD,yCAAwC;AAExC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtD,MAAM,EACJ,SAAS,EAAE,EAAC,IAAI,EAAC,GAClB,GAAG,EAAE,CAAA;QACN,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,YAAY,CAAC,QAAQ,EAAE;YACzB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,CAAC,CAAA;YACnC,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EA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C,MAAuB;YAC9C,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAC5B,QAAQ,EACR,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAA,mBAAS,EAAC,MAAM,CAAC,EAAC,CAAC,CAAC,CAAC,EAAC,GAAG,EAAE,MAAM,EAAC,CACtF,CAAA;YACD,GAAG,CAAC,SAAS,CACX;gBACE,MAAM;gBACN,SAAS,EAAE,EAAE;gBACb,UAAU,EAAE,aAAG;gBACf,YAAY,EAAE,OAAO;gBACrB,aAAa,EAAE,gBAAgB,GAAG,EAAE;aACrC,EACD,KAAK,CACN,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,SAAgB,MAAM,CAAC,MAAuB;IAC5C,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACxB,IAAI,GAAoB,CAAA;QACxB,IAAI,GAAG,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,IAAI,CAAA;KAC1F;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAND,wBAMC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/type.d.ts b/node_modules/ajv/dist/vocabularies/jtd/type.d.ts new file mode 100644 index 000000000..a115c7dad --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/type.d.ts @@ -0,0 +1,10 @@ +import type { CodeKeywordDefinition } from "../../types"; +import { _JTDTypeError } from "./error"; +export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType>; +export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"; +export declare const intRange: { + [T in IntType]: [number, number, number]; +}; +export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/type.js b/node_modules/ajv/dist/vocabularies/jtd/type.js new file mode 100644 index 000000000..17a0b5107 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/type.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.intRange = void 0; +const codegen_1 = require("../../compile/codegen"); +const timestamp_1 = require("../../runtime/timestamp"); +const util_1 = require("../../compile/util"); +const metadata_1 = require("./metadata"); +const error_1 = require("./error"); +exports.intRange = { + int8: [-128, 127, 3], + uint8: [0, 255, 3], + int16: [-32768, 32767, 5], + uint16: [0, 65535, 5], + int32: [-2147483648, 2147483647, 10], + uint32: [0, 4294967295, 10], +}; +const error = { + message: (cxt) => (0, error_1.typeErrorMessage)(cxt, cxt.schema), + params: (cxt) => (0, error_1.typeErrorParams)(cxt, cxt.schema), +}; +function timestampCode(cxt) { + const { gen, data, it } = cxt; + const { timestamp, allowDate } = it.opts; + if (timestamp === "date") + return (0, codegen_1._) `${data} instanceof Date `; + const vts = (0, util_1.useFunc)(gen, timestamp_1.default); + const allowDateArg = allowDate ? (0, codegen_1._) `, true` : codegen_1.nil; + const validString = (0, codegen_1._) `typeof ${data} == "string" && ${vts}(${data}${allowDateArg})`; + return timestamp === "string" ? validString : (0, codegen_1.or)((0, codegen_1._) `${data} instanceof Date`, validString); +} +const def = { + keyword: "type", + schemaType: "string", + error, + code(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { data, schema, parentSchema, it } = cxt; + let cond; + switch (schema) { + case "boolean": + case "string": + cond = (0, codegen_1._) `typeof ${data} == ${schema}`; + break; + case "timestamp": { + cond = timestampCode(cxt); + break; + } + case "float32": + case "float64": + cond = (0, codegen_1._) `typeof ${data} == "number"`; + break; + default: { + const sch = schema; + cond = (0, codegen_1._) `typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)`; + if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) { + if (sch === "uint32") + cond = (0, codegen_1._) `${cond} && ${data} >= 0`; + } + else { + const [min, max] = exports.intRange[sch]; + cond = (0, codegen_1._) `${cond} && ${data} >= ${min} && ${data} <= ${max}`; + } + } + } + cxt.pass(parentSchema.nullable ? (0, codegen_1.or)((0, codegen_1._) `${data} === null`, cond) : cond); + }, +}; +exports.default = def; +//# sourceMappingURL=type.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/type.js.map b/node_modules/ajv/dist/vocabularies/jtd/type.js.map new file mode 100644 index 000000000..9d3393907 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/type.js.map @@ -0,0 +1 @@ +{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/type.ts"],"names":[],"mappings":";;;AAEA,mDAAsD;AACtD,uDAAoD;AACpD,6CAA0C;AAC1C,yCAAwC;AACxC,mCAAwE;AAM3D,QAAA,QAAQ,GAA+C;IAClE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACpB,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAClB,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACrB,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,CAAC;CAC5B,CAAA;AAID,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,wBAAgB,EAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;IACnD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,uBAAe,EAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;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D,KAAK,SAAS,CAAC;YACf,KAAK,SAAS;gBACZ,IAAI,GAAG,IAAA,WAAC,EAAA,UAAU,IAAI,cAAc,CAAA;gBACpC,MAAK;YACP,OAAO,CAAC,CAAC;gBACP,MAAM,GAAG,GAAG,MAAiB,CAAA;gBAC7B,IAAI,GAAG,IAAA,WAAC,EAAA,UAAU,IAAI,4BAA4B,IAAI,UAAU,IAAI,OAAO,CAAA;gBAC3E,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,QAAQ,CAAC,EAAE;oBAChE,IAAI,GAAG,KAAK,QAAQ;wBAAE,IAAI,GAAG,IAAA,WAAC,EAAA,GAAG,IAAI,OAAO,IAAI,OAAO,CAAA;iBACxD;qBAAM;oBACL,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,gBAAQ,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,IAAA,WAAC,EAAA,GAAG,IAAI,OAAO,IAAI,OAAO,GAAG,OAAO,IAAI,OAAO,GAAG,EAAE,CAAA;iBAC5D;aACF;SACF;QACD,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,YAAE,EAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACxE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/union.d.ts b/node_modules/ajv/dist/vocabularies/jtd/union.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/union.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/union.js b/node_modules/ajv/dist/vocabularies/jtd/union.js new file mode 100644 index 000000000..01a943994 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/union.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const def = { + keyword: "union", + schemaType: "array", + trackErrors: true, + code: code_1.validateUnion, + error: { message: "must match a schema in union" }, +}; +exports.default = def; +//# sourceMappingURL=union.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/union.js.map b/node_modules/ajv/dist/vocabularies/jtd/union.js.map new file mode 100644 index 000000000..4d6eb4119 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/union.js.map @@ -0,0 +1 @@ +{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/union.ts"],"names":[],"mappings":";;AACA,kCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE,EAAC,OAAO,EAAE,8BAA8B,EAAC;CACjD,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/values.d.ts b/node_modules/ajv/dist/vocabularies/jtd/values.d.ts new file mode 100644 index 000000000..1eaa884a5 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/values.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition, SchemaObject } from "../../types"; +import { _JTDTypeError } from "./error"; +export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/values.js b/node_modules/ajv/dist/vocabularies/jtd/values.js new file mode 100644 index 000000000..3c2c95f55 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/values.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const codegen_1 = require("../../compile/codegen"); +const metadata_1 = require("./metadata"); +const nullable_1 = require("./nullable"); +const error_1 = require("./error"); +const def = { + keyword: "values", + schemaType: "object", + error: (0, error_1.typeError)("object"), + code(cxt) { + (0, metadata_1.checkMetadata)(cxt); + const { gen, data, schema, it } = cxt; + const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data); + if ((0, util_1.alwaysValidSchema)(it, schema)) { + gen.if((0, codegen_1.not)((0, codegen_1.or)(cond, valid)), () => cxt.error()); + } + else { + gen.if(cond); + gen.assign(valid, validateMap()); + gen.elseIf((0, codegen_1.not)(valid)); + cxt.error(); + gen.endIf(); + } + cxt.ok(valid); + function validateMap() { + const _valid = gen.name("valid"); + if (it.allErrors) { + const validMap = gen.let("valid", true); + validateValues(() => gen.assign(validMap, false)); + return validMap; + } + gen.var(_valid, true); + validateValues(() => gen.break()); + return _valid; + function validateValues(notValid) { + gen.forIn("key", data, (key) => { + cxt.subschema({ + keyword: "values", + dataProp: key, + dataPropType: util_1.Type.Str, + }, _valid); + gen.if((0, codegen_1.not)(_valid), notValid); + }); + } + } + }, +}; +exports.default = def; +//# sourceMappingURL=values.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/values.js.map b/node_modules/ajv/dist/vocabularies/jtd/values.js.map new file mode 100644 index 000000000..790a736d1 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/jtd/values.js.map @@ -0,0 +1 @@ +{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/values.ts"],"names":[],"mappings":";;AAEA,6CAA0D;AAC1D,mDAAmD;AACnD,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAgD;AAIhD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAA,iBAAS,EAAC,QAAQ,CAAC;IAC1B,IAAI,CAAC,GAAe;QAClB,IAAA,wBA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CAAA;YAEb,SAAS,cAAc,CAAC,QAAoB;gBAC1C,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;oBAC7B,GAAG,CAAC,SAAS,CACX;wBACE,OAAO,EAAE,QAAQ;wBACjB,QAAQ,EAAE,GAAG;wBACb,YAAY,EAAE,WAAI,CAAC,GAAG;qBACvB,EACD,MAAM,CACP,CAAA;oBACD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAA;gBAC/B,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/metadata.d.ts b/node_modules/ajv/dist/vocabularies/metadata.d.ts new file mode 100644 index 000000000..df9cc07ca --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/metadata.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../types"; +export declare const metadataVocabulary: Vocabulary; +export declare const contentVocabulary: Vocabulary; diff --git a/node_modules/ajv/dist/vocabularies/metadata.js b/node_modules/ajv/dist/vocabularies/metadata.js new file mode 100644 index 000000000..f07bf28b5 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/metadata.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.contentVocabulary = exports.metadataVocabulary = void 0; +exports.metadataVocabulary = [ + "title", + "description", + "default", + "deprecated", + "readOnly", + "writeOnly", + "examples", +]; +exports.contentVocabulary = [ + "contentMediaType", + "contentEncoding", + "contentSchema", +]; +//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/metadata.js.map b/node_modules/ajv/dist/vocabularies/metadata.js.map new file mode 100644 index 000000000..0d61f0831 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/metadata.js.map @@ -0,0 +1 @@ +{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../lib/vocabularies/metadata.ts"],"names":[],"mappings":";;;AAEa,QAAA,kBAAkB,GAAe;IAC5C,OAAO;IACP,aAAa;IACb,SAAS;IACT,YAAY;IACZ,UAAU;IACV,WAAW;IACX,UAAU;CACX,CAAA;AAEY,QAAA,iBAAiB,GAAe;IAC3C,kBAAkB;IAClB,iBAAiB;IACjB,eAAe;CAChB,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/next.d.ts b/node_modules/ajv/dist/vocabularies/next.d.ts new file mode 100644 index 000000000..7fd5c644b --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/next.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../types"; +declare const next: Vocabulary; +export default next; diff --git a/node_modules/ajv/dist/vocabularies/next.js b/node_modules/ajv/dist/vocabularies/next.js new file mode 100644 index 000000000..c861b3243 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/next.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dependentRequired_1 = require("./validation/dependentRequired"); +const dependentSchemas_1 = require("./applicator/dependentSchemas"); +const limitContains_1 = require("./validation/limitContains"); +const next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default]; +exports.default = next; +//# sourceMappingURL=next.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/next.js.map b/node_modules/ajv/dist/vocabularies/next.js.map new file mode 100644 index 000000000..474a6d4e7 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/next.js.map @@ -0,0 +1 @@ +{"version":3,"file":"next.js","sourceRoot":"","sources":["../../lib/vocabularies/next.ts"],"names":[],"mappings":";;AACA,sEAA8D;AAC9D,oEAA4D;AAC5D,8DAAsD;AAEtD,MAAM,IAAI,GAAe,CAAC,2BAAiB,EAAE,0BAAgB,EAAE,uBAAa,CAAC,CAAA;AAE7E,kBAAe,IAAI,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts b/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts new file mode 100644 index 000000000..ec67e63ea --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts @@ -0,0 +1,3 @@ +import type { Vocabulary } from "../../types"; +declare const unevaluated: Vocabulary; +export default unevaluated; diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/index.js b/node_modules/ajv/dist/vocabularies/unevaluated/index.js new file mode 100644 index 000000000..30e316748 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/unevaluated/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const unevaluatedProperties_1 = require("./unevaluatedProperties"); +const unevaluatedItems_1 = require("./unevaluatedItems"); +const unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default]; +exports.default = unevaluated; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map b/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map new file mode 100644 index 000000000..a4872ea43 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/index.ts"],"names":[],"mappings":";;AACA,mEAA2D;AAC3D,yDAAiD;AAEjD,MAAM,WAAW,GAAe,CAAC,+BAAqB,EAAE,0BAAgB,CAAC,CAAA;AAEzE,kBAAe,WAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts new file mode 100644 index 000000000..06f023926 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", { + limit: number; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js new file mode 100644 index 000000000..0a0cd3aa4 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`, + params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`, +}; +const def = { + keyword: "unevaluatedItems", + type: "array", + schemaType: ["boolean", "object"], + error, + code(cxt) { + const { gen, schema, data, it } = cxt; + const items = it.items || 0; + if (items === true) + return; + const len = gen.const("len", (0, codegen_1._) `${data}.length`); + if (schema === false) { + cxt.setParams({ len: items }); + cxt.fail((0, codegen_1._) `${len} > ${items}`); + } + else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { + const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items}`); + gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items)); + cxt.ok(valid); + } + it.items = true; + function validateItems(valid, from) { + gen.forRange("i", from, len, (i) => { + cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid); + if (!it.allErrors) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + }); + } + }, +}; +exports.default = def; +//# sourceMappingURL=unevaluatedItems.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map new file mode 100644 index 000000000..a8268f031 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unevaluatedItems.js","sour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AAO,KAAK,EAAE,CAAC,CAAA;YACrD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;YACrD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;SACd;QACD,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QAEf,SAAS,aAAa,CAAC,KAAW,EAAE,IAAmB;YACrD,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;gBACjC,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,WAAI,CAAC,GAAG,EAAC,EAAE,KAAK,CAAC,CAAA;gBACxF,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YAC1D,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts new file mode 100644 index 000000000..ba63f62e8 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; +export type UnevaluatedPropertiesError = ErrorObject<"unevaluatedProperties", { + unevaluatedProperty: string; +}, AnySchema>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js new file mode 100644 index 000000000..ad298499f --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const names_1 = require("../../compile/names"); +const error = { + message: "must NOT have unevaluated properties", + params: ({ params }) => (0, codegen_1._) `{unevaluatedProperty: ${params.unevaluatedProperty}}`, +}; +const def = { + keyword: "unevaluatedProperties", + type: "object", + schemaType: ["boolean", "object"], + trackErrors: true, + error, + code(cxt) { + const { gen, schema, data, errsCount, it } = cxt; + /* istanbul ignore if */ + if (!errsCount) + throw new Error("ajv implementation error"); + const { allErrors, props } = it; + if (props instanceof codegen_1.Name) { + gen.if((0, codegen_1._) `${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key)))); + } + else if (props !== true) { + gen.forIn("key", data, (key) => props === undefined + ? unevaluatedPropCode(key) + : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key))); + } + it.props = true; + cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); + function unevaluatedPropCode(key) { + if (schema === false) { + cxt.setParams({ unevaluatedProperty: key }); + cxt.error(); + if (!allErrors) + gen.break(); + return; + } + if (!(0, util_1.alwaysValidSchema)(it, schema)) { + const valid = gen.name("valid"); + cxt.subschema({ + keyword: "unevaluatedProperties", + dataProp: key, + dataPropType: util_1.Type.Str, + }, valid); + if (!allErrors) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + } + } + function unevaluatedDynamic(evaluatedProps, key) { + return (0, codegen_1._) `!${evaluatedProps} || !${evaluatedProps}[${key}]`; + } + function unevaluatedStatic(evaluatedProps, key) { + const ps = []; + for (const p in evaluatedProps) { + if (evaluatedProps[p] === true) + ps.push((0, codegen_1._) `${key} !== ${p}`); + } + return (0, codegen_1.and)(...ps); + } + }, +}; +exports.default = def; +//# sourceMappingURL=unevaluatedProperties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map new file mode 100644 index 000000000..f415251ee --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unevaluatedProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/unevaluatedProperties.ts"],"names":[],"mappings":";;AAMA,mDAA6D;AAC7D,6CAA0D;AAC1D,+CAAmC;AAQnC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,sCAAsC;IAC/C,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,yBAAyB,MAAM,CAAC,mBAAmB,GAAG;CAC9E,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,uBAAuB;IAChC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAG;QACN,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC9C,wBAAwB;QACxB,IAAI,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC3D,MAAM,EAAC,SAAS,EAAE,KAAK,EAAC,GAAG,EAAE,CAAA;QAC7B,IAAI,KAAK,YAAY,cAAI,EAAE;YACzB,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,WAAW,EAAE,GAAG,EAAE,CAChC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAS,EAAE,EAAE,CACnC,GAAG,CAAC,EAAE,CAAC,kBAAkB,CAAC,K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AAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;aACtD;QACH,CAAC;QAED,SAAS,kBAAkB,CAAC,cAAoB,EAAE,GAAS;YACzD,OAAO,IAAA,WAAC,EAAA,IAAI,cAAc,QAAQ,cAAc,IAAI,GAAG,GAAG,CAAA;QAC5D,CAAC;QAED,SAAS,iBAAiB,CAAC,cAAsC,EAAE,GAAS;YAC1E,MAAM,EAAE,GAAW,EAAE,CAAA;YACrB,KAAK,MAAM,CAAC,IAAI,cAAc,EAAE;gBAC9B,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI;oBAAE,EAAE,CAAC,IAAI,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;aAC5D;YACD,OAAO,IAAA,aAAG,EAAC,GAAG,EAAE,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/const.d.ts b/node_modules/ajv/dist/vocabularies/validation/const.d.ts new file mode 100644 index 000000000..af91a9007 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/const.d.ts @@ -0,0 +1,6 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type ConstError = ErrorObject<"const", { + allowedValue: any; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/const.js b/node_modules/ajv/dist/vocabularies/validation/const.js new file mode 100644 index 000000000..9564496a6 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/const.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const equal_1 = require("../../runtime/equal"); +const error = { + message: "must be equal to constant", + params: ({ schemaCode }) => (0, codegen_1._) `{allowedValue: ${schemaCode}}`, +}; +const def = { + keyword: "const", + $data: true, + error, + code(cxt) { + const { gen, data, $data, schemaCode, schema } = cxt; + if ($data || (schema && typeof schema == "object")) { + cxt.fail$data((0, codegen_1._) `!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`); + } + else { + cxt.fail((0, codegen_1._) `${schema} !== ${data}`); + } + }, +}; +exports.default = def; +//# sourceMappingURL=const.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/const.js.map b/node_modules/ajv/dist/vocabularies/validation/const.js.map new file mode 100644 index 000000000..0cf6cd14c --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/const.js.map @@ -0,0 +1 @@ +{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/const.ts"],"names":[],"mappings":";;AAEA,mDAAuC;AACvC,6CAA0C;AAC1C,+CAAuC;AAIvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,2BAA2B;IACpC,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,kBAAkB,UAAU,GAAG;CAC3D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAClD,IAAI,KAAK,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,CAAC,EAAE;YAClD,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,IAAA,cAAO,EAAC,GAAG,EAAE,eAAK,CAAC,IAAI,IAAI,KAAK,UAAU,GAAG,CAAC,CAAA;SAClE;aAAM;YACL,GAAG,CAAC,IAAI,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,QAAQ,IAAI,EAAE,CAAC,CAAA;SACnC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts b/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts new file mode 100644 index 000000000..00f0d370f --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts @@ -0,0 +1,5 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +import { DependenciesErrorParams, PropertyDependencies } from "../applicator/dependencies"; +export type DependentRequiredError = ErrorObject<"dependentRequired", DependenciesErrorParams, PropertyDependencies>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js b/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js new file mode 100644 index 000000000..09e59639f --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dependencies_1 = require("../applicator/dependencies"); +const def = { + keyword: "dependentRequired", + type: "object", + schemaType: "object", + error: dependencies_1.error, + code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt), +}; +exports.default = def; +//# sourceMappingURL=dependentRequired.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map b/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map new file mode 100644 index 000000000..c7e88f885 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dependentRequired.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/dependentRequired.ts"],"names":[],"mappings":";;AACA,6DAKmC;AAQnC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAL,oBAAK;IACL,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,mCAAoB,EAAC,GAAG,CAAC;CACzC,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/enum.d.ts b/node_modules/ajv/dist/vocabularies/validation/enum.d.ts new file mode 100644 index 000000000..6231082fe --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/enum.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type EnumError = ErrorObject<"enum", { + allowedValues: any[]; +}, any[] | { + $data: string; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/enum.js b/node_modules/ajv/dist/vocabularies/validation/enum.js new file mode 100644 index 000000000..eab6487e9 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/enum.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const equal_1 = require("../../runtime/equal"); +const error = { + message: "must be equal to one of the allowed values", + params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`, +}; +const def = { + keyword: "enum", + schemaType: "array", + $data: true, + error, + code(cxt) { + const { gen, data, $data, schema, schemaCode, it } = cxt; + if (!$data && schema.length === 0) + throw new Error("enum must have non-empty array"); + const useLoop = schema.length >= it.opts.loopEnum; + let eql; + const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default))); + let valid; + if (useLoop || $data) { + valid = gen.let("valid"); + cxt.block$data(valid, loopEnum); + } + else { + /* istanbul ignore if */ + if (!Array.isArray(schema)) + throw new Error("ajv implementation error"); + const vSchema = gen.const("vSchema", schemaCode); + valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i))); + } + cxt.pass(valid); + function loopEnum() { + gen.assign(valid, false); + gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break())); + } + function equalCode(vSchema, i) { + const sch = schema[i]; + return typeof sch === "object" && sch !== null + ? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])` + : (0, codegen_1._) `${data} === ${sch}`; + } + }, +}; +exports.default = def; +//# sourceMappingURL=enum.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/enum.js.map b/node_modules/ajv/dist/vocabularies/validation/enum.js.map new file mode 100644 index 000000000..7b4e1eda9 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/enum.js.map @@ -0,0 +1 @@ +{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/enum.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AACvD,6CAA0C;AAC1C,+CAAuC;AAIvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,4CAA4C;IACrD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,mBAAmB,UAAU,GAAG;CAC5D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,OAAO;IACnB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtD,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QACpF,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAA;QACjD,IAAI,GAAqB,CAAA;QACzB,MAAM,MAAM,GAAG,GAAS,EAAE,CAAC,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,IAAH,GAAG,GAAK,IAAA,cAAO,EAAC,GAAG,EAAE,eAAK,CAAC,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AI,CAAC,IAAI;gBAC3C,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,QAAQ,GAAG,EAAE,CAAA;QAC3B,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/index.d.ts b/node_modules/ajv/dist/vocabularies/validation/index.d.ts new file mode 100644 index 000000000..a078be554 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/index.d.ts @@ -0,0 +1,16 @@ +import type { ErrorObject, Vocabulary } from "../../types"; +import { LimitNumberError } from "./limitNumber"; +import { MultipleOfError } from "./multipleOf"; +import { PatternError } from "./pattern"; +import { RequiredError } from "./required"; +import { UniqueItemsError } from "./uniqueItems"; +import { ConstError } from "./const"; +import { EnumError } from "./enum"; +declare const validation: Vocabulary; +export default validation; +type LimitError = ErrorObject<"maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", { + limit: number; +}, number | { + $data: string; +}>; +export type ValidationKeywordError = LimitError | LimitNumberError | MultipleOfError | PatternError | RequiredError | UniqueItemsError | ConstError | EnumError; diff --git a/node_modules/ajv/dist/vocabularies/validation/index.js b/node_modules/ajv/dist/vocabularies/validation/index.js new file mode 100644 index 000000000..7b56b4e45 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/index.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const limitNumber_1 = require("./limitNumber"); +const multipleOf_1 = require("./multipleOf"); +const limitLength_1 = require("./limitLength"); +const pattern_1 = require("./pattern"); +const limitProperties_1 = require("./limitProperties"); +const required_1 = require("./required"); +const limitItems_1 = require("./limitItems"); +const uniqueItems_1 = require("./uniqueItems"); +const const_1 = require("./const"); +const enum_1 = require("./enum"); +const validation = [ + // number + limitNumber_1.default, + multipleOf_1.default, + // string + limitLength_1.default, + pattern_1.default, + // object + limitProperties_1.default, + required_1.default, + // array + limitItems_1.default, + uniqueItems_1.default, + // any + { keyword: "type", schemaType: ["string", "array"] }, + { keyword: "nullable", schemaType: "boolean" }, + const_1.default, + enum_1.default, +]; +exports.default = validation; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/index.js.map b/node_modules/ajv/dist/vocabularies/validation/index.js.map new file mode 100644 index 000000000..69436fb32 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/index.ts"],"names":[],"mappings":";;AACA,+CAA2D;AAC3D,6CAAwD;AACxD,+CAAuC;AACvC,uCAA+C;AAC/C,uDAA+C;AAC/C,yCAAkD;AAClD,6CAAqC;AACrC,+CAA2D;AAC3D,mCAAgD;AAChD,iCAA6C;AAE7C,MAAM,UAAU,GAAe;IAC7B,SAAS;IACT,qBAAW;IACX,oBAAU;IACV,SAAS;IACT,qBAAW;IACX,iBAAO;IACP,SAAS;IACT,yBAAe;IACf,kBAAQ;IACR,QAAQ;IACR,oBAAU;IACV,qBAAW;IACX,MAAM;IACN,EAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAC;IAClD,EAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC;IAC5C,eAAY;IACZ,cAAW;CACZ,CAAA;AAED,kBAAe,UAAU,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts b/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/limitContains.js b/node_modules/ajv/dist/vocabularies/validation/limitContains.js new file mode 100644 index 000000000..c884dae4b --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitContains.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../../compile/util"); +const def = { + keyword: ["maxContains", "minContains"], + type: "array", + schemaType: "number", + code({ keyword, parentSchema, it }) { + if (parentSchema.contains === undefined) { + (0, util_1.checkStrictMode)(it, `"${keyword}" without "contains" is ignored`); + } + }, +}; +exports.default = def; +//# sourceMappingURL=limitContains.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map b/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map new file mode 100644 index 000000000..788010aa9 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map @@ -0,0 +1 @@ +{"version":3,"file":"limitContains.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitContains.ts"],"names":[],"mappings":";;AAEA,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC;IACvC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,EAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAa;QAC1C,IAAI,YAAY,CAAC,QAAQ,KAAK,SAAS,EAAE;YACvC,IAAA,sBAAe,EAAC,EAAE,EAAE,IAAI,OAAO,iCAAiC,CAAC,CAAA;SAClE;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts b/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/limitItems.js b/node_modules/ajv/dist/vocabularies/validation/limitItems.js new file mode 100644 index 000000000..e1386f887 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitItems.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const error = { + message({ keyword, schemaCode }) { + const comp = keyword === "maxItems" ? "more" : "fewer"; + return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} items`; + }, + params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`, +}; +const def = { + keyword: ["maxItems", "minItems"], + type: "array", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { keyword, data, schemaCode } = cxt; + const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; + cxt.fail$data((0, codegen_1._) `${data}.length ${op} ${schemaCode}`); + }, +}; +exports.default = def; +//# sourceMappingURL=limitItems.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map b/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map new file mode 100644 index 000000000..690c73456 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"limitItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitItems.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AAEvD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACtD,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,QAAQ,CAAA;IAC5D,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,MAAM,EAAE,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QAC/D,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts b/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/limitLength.js b/node_modules/ajv/dist/vocabularies/validation/limitLength.js new file mode 100644 index 000000000..6ae5f92e6 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitLength.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const ucs2length_1 = require("../../runtime/ucs2length"); +const error = { + message({ keyword, schemaCode }) { + const comp = keyword === "maxLength" ? "more" : "fewer"; + return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} characters`; + }, + params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`, +}; +const def = { + keyword: ["maxLength", "minLength"], + type: "string", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { keyword, data, schemaCode, it } = cxt; + const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; + const len = it.opts.unicode === false ? (0, codegen_1._) `${data}.length` : (0, codegen_1._) `${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`; + cxt.fail$data((0, codegen_1._) `${len} ${op} ${schemaCode}`); + }, +}; +exports.default = def; +//# sourceMappingURL=limitLength.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map b/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map new file mode 100644 index 000000000..f09c35e54 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map @@ -0,0 +1 @@ +{"version":3,"file":"limitLength.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitLength.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AACvD,6CAA0C;AAC1C,yDAAiD;AAEjD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACvD,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,aAAa,CAAA;IACjE,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;IACnC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC3C,MAAM,EAAE,GAAG,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QAChE,MAAM,GAAG,GACP,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAA,cAAO,EAAC,GAAG,CAAC,GAAG,EAAE,oBAAU,CAAC,IAAI,IAAI,GAAG,CAAA;QAC7F,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,IAAI,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IAC9C,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts b/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts new file mode 100644 index 000000000..7b35096df --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts @@ -0,0 +1,11 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum"; +type Comparison = "<=" | ">=" | "<" | ">"; +export type LimitNumberError = ErrorObject; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/limitNumber.js b/node_modules/ajv/dist/vocabularies/validation/limitNumber.js new file mode 100644 index 000000000..a97c0eb9d --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitNumber.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const ops = codegen_1.operators; +const KWDs = { + maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, + minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, + exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, + exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }, +}; +const error = { + message: ({ keyword, schemaCode }) => (0, codegen_1.str) `must be ${KWDs[keyword].okStr} ${schemaCode}`, + params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`, +}; +const def = { + keyword: Object.keys(KWDs), + type: "number", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { keyword, data, schemaCode } = cxt; + cxt.fail$data((0, codegen_1._) `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); + }, +}; +exports.default = def; +//# sourceMappingURL=limitNumber.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map b/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map new file mode 100644 index 000000000..18a365337 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map @@ -0,0 +1 @@ +{"version":3,"file":"limitNumber.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitNumber.ts"],"names":[],"mappings":";;AAEA,mDAA6D;AAE7D,MAAM,GAAG,GAAG,mBAAS,CAAA;AAMrB,MAAM,IAAI,GAA4D;IACpE,OAAO,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAC;IACjD,OAAO,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAC;IACjD,gBAAgB,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAC;IACzD,gBAAgB,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAC;CAC1D,CAAA;AAQD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,WAAW,IAAI,CAAC,OAAc,CAAC,CAAC,KAAK,IAAI,UAAU,EAAE;IAC5F,MAAM,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CAChC,IAAA,WAAC,EAAA,gBAAgB,IAAI,CAAC,OAAc,CAAC,CAAC,KAAK,YAAY,UAAU,GAAG;CACvE,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,IAAI,IAAI,CAAC,OAAc,CAAC,CAAC,IAAI,IAAI,UAAU,aAAa,IAAI,GAAG,CAAC,CAAA;IACxF,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts b/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts new file mode 100644 index 000000000..cde2aa270 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts @@ -0,0 +1,3 @@ +import type { CodeKeywordDefinition } from "../../types"; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/limitProperties.js b/node_modules/ajv/dist/vocabularies/validation/limitProperties.js new file mode 100644 index 000000000..e6fc40cc6 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitProperties.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const error = { + message({ keyword, schemaCode }) { + const comp = keyword === "maxProperties" ? "more" : "fewer"; + return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`; + }, + params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`, +}; +const def = { + keyword: ["maxProperties", "minProperties"], + type: "object", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { keyword, data, schemaCode } = cxt; + const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; + cxt.fail$data((0, codegen_1._) `Object.keys(${data}).length ${op} ${schemaCode}`); + }, +}; +exports.default = def; +//# sourceMappingURL=limitProperties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map b/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map new file mode 100644 index 000000000..a695943a9 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"limitProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitProperties.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AAEvD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QAC3D,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,aAAa,CAAA;IACjE,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;IAC3C,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,MAAM,EAAE,GAAG,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QACpE,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,eAAe,IAAI,YAAY,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IACnE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts b/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts new file mode 100644 index 000000000..67685dcd3 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type MultipleOfError = ErrorObject<"multipleOf", { + multipleOf: number; +}, number | { + $data: string; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/multipleOf.js b/node_modules/ajv/dist/vocabularies/validation/multipleOf.js new file mode 100644 index 000000000..43cf67b77 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/multipleOf.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const codegen_1 = require("../../compile/codegen"); +const error = { + message: ({ schemaCode }) => (0, codegen_1.str) `must be multiple of ${schemaCode}`, + params: ({ schemaCode }) => (0, codegen_1._) `{multipleOf: ${schemaCode}}`, +}; +const def = { + keyword: "multipleOf", + type: "number", + schemaType: "number", + $data: true, + error, + code(cxt) { + const { gen, data, schemaCode, it } = cxt; + // const bdt = bad$DataType(schemaCode, def.schemaType, $data) + const prec = it.opts.multipleOfPrecision; + const res = gen.let("res"); + const invalid = prec + ? (0, codegen_1._) `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` + : (0, codegen_1._) `${res} !== parseInt(${res})`; + cxt.fail$data((0, codegen_1._) `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`); + }, +}; +exports.default = def; +//# sourceMappingURL=multipleOf.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map b/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map new file mode 100644 index 000000000..9ef825b74 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"multipleOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/multipleOf.ts"],"names":[],"mappings":";;AAEA,mDAA4C;AAQ5C,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,uBAAuB,UAAU,EAAE;IACjE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,gBAAgB,UAAU,GAAG;CACzD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACvC,sEAAsE;QACtE,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAA;QACxC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC1B,MAAM,OAAO,GAAG,IAAI;YAClB,CAAC,CAAC,IAAA,WAAC,EAAA,uBAAuB,GAAG,OAAO,GAAG,UAAU,IAAI,EAAE;YACvD,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,iBAAiB,GAAG,GAAG,CAAA;QAClC,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,UAAU,cAAc,GAAG,MAAM,IAAI,IAAI,UAAU,KAAK,OAAO,IAAI,CAAC,CAAA;IACzF,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts b/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts new file mode 100644 index 000000000..7edbfda93 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type PatternError = ErrorObject<"pattern", { + pattern: string; +}, string | { + $data: string; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/pattern.js b/node_modules/ajv/dist/vocabularies/validation/pattern.js new file mode 100644 index 000000000..f8ccdf295 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/pattern.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const error = { + message: ({ schemaCode }) => (0, codegen_1.str) `must match pattern "${schemaCode}"`, + params: ({ schemaCode }) => (0, codegen_1._) `{pattern: ${schemaCode}}`, +}; +const def = { + keyword: "pattern", + type: "string", + schemaType: "string", + $data: true, + error, + code(cxt) { + const { data, $data, schema, schemaCode, it } = cxt; + // TODO regexp should be wrapped in try/catchs + const u = it.opts.unicodeRegExp ? "u" : ""; + const regExp = $data ? (0, codegen_1._) `(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema); + cxt.fail$data((0, codegen_1._) `!${regExp}.test(${data})`); + }, +}; +exports.default = def; +//# sourceMappingURL=pattern.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/pattern.js.map b/node_modules/ajv/dist/vocabularies/validation/pattern.js.map new file mode 100644 index 000000000..82fa5d74c --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/pattern.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/pattern.ts"],"names":[],"mappings":";;AAEA,kCAAkC;AAClC,mDAA4C;AAI5C,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,uBAAuB,UAAU,GAAG;IAClE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,aAAa,UAAU,GAAG;CACtD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,8CAA8C;QAC9C,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,eAAe,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,iBAAU,EAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QACrF,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,MAAM,SAAS,IAAI,GAAG,CAAC,CAAA;IAC5C,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/required.d.ts b/node_modules/ajv/dist/vocabularies/validation/required.d.ts new file mode 100644 index 000000000..c9cffda1e --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/required.d.ts @@ -0,0 +1,8 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type RequiredError = ErrorObject<"required", { + missingProperty: string; +}, string[] | { + $data: string; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/required.js b/node_modules/ajv/dist/vocabularies/validation/required.js new file mode 100644 index 000000000..1d8e29263 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/required.js @@ -0,0 +1,79 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const code_1 = require("../code"); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const error = { + message: ({ params: { missingProperty } }) => (0, codegen_1.str) `must have required property '${missingProperty}'`, + params: ({ params: { missingProperty } }) => (0, codegen_1._) `{missingProperty: ${missingProperty}}`, +}; +const def = { + keyword: "required", + type: "object", + schemaType: "array", + $data: true, + error, + code(cxt) { + const { gen, schema, schemaCode, data, $data, it } = cxt; + const { opts } = it; + if (!$data && schema.length === 0) + return; + const useLoop = schema.length >= opts.loopRequired; + if (it.allErrors) + allErrorsMode(); + else + exitOnErrorMode(); + if (opts.strictRequired) { + const props = cxt.parentSchema.properties; + const { definedProperties } = cxt.it; + for (const requiredKey of schema) { + if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) { + const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; + const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`; + (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired); + } + } + } + function allErrorsMode() { + if (useLoop || $data) { + cxt.block$data(codegen_1.nil, loopAllRequired); + } + else { + for (const prop of schema) { + (0, code_1.checkReportMissingProp)(cxt, prop); + } + } + } + function exitOnErrorMode() { + const missing = gen.let("missing"); + if (useLoop || $data) { + const valid = gen.let("valid", true); + cxt.block$data(valid, () => loopUntilMissing(missing, valid)); + cxt.ok(valid); + } + else { + gen.if((0, code_1.checkMissingProp)(cxt, schema, missing)); + (0, code_1.reportMissingProp)(cxt, missing); + gen.else(); + } + } + function loopAllRequired() { + gen.forOf("prop", schemaCode, (prop) => { + cxt.setParams({ missingProperty: prop }); + gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error()); + }); + } + function loopUntilMissing(missing, valid) { + cxt.setParams({ missingProperty: missing }); + gen.forOf(missing, schemaCode, () => { + gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties)); + gen.if((0, codegen_1.not)(valid), () => { + cxt.error(); + gen.break(); + }); + }, codegen_1.nil); + } + }, +}; +exports.default = def; +//# sourceMappingURL=required.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/required.js.map b/node_modules/ajv/dist/vocabularies/validation/required.js.map new file mode 100644 index 000000000..0fcbee588 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/required.js.map @@ -0,0 +1 @@ +{"version":3,"file":"required.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/required.ts"],"names":[],"mappings":";;AAEA,kCAMgB;AAChB,mDAAkE;AAClE,6CAAkD;AAQlD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,eAAe,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,gCAAgC,eAAe,GAAG;IAC/F,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,eAAe,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,qBAAqB,eAAe,GAAG;CAClF,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,OAAO;IACnB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EA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AAC,CAAA;gBACzE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE;oBACtB,GAAG,CAAC,KAAK,EAAE,CAAA;oBACX,GAAG,CAAC,KAAK,EAAE,CAAA;gBACb,CAAC,CAAC,CAAA;YACJ,CAAC,EACD,aAAG,CACJ,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts b/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts new file mode 100644 index 000000000..e7c241b98 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts @@ -0,0 +1,9 @@ +import type { CodeKeywordDefinition, ErrorObject } from "../../types"; +export type UniqueItemsError = ErrorObject<"uniqueItems", { + i: number; + j: number; +}, boolean | { + $data: string; +}>; +declare const def: CodeKeywordDefinition; +export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js b/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js new file mode 100644 index 000000000..cdbecea12 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const dataType_1 = require("../../compile/validate/dataType"); +const codegen_1 = require("../../compile/codegen"); +const util_1 = require("../../compile/util"); +const equal_1 = require("../../runtime/equal"); +const error = { + message: ({ params: { i, j } }) => (0, codegen_1.str) `must NOT have duplicate items (items ## ${j} and ${i} are identical)`, + params: ({ params: { i, j } }) => (0, codegen_1._) `{i: ${i}, j: ${j}}`, +}; +const def = { + keyword: "uniqueItems", + type: "array", + schemaType: "boolean", + $data: true, + error, + code(cxt) { + const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt; + if (!$data && !schema) + return; + const valid = gen.let("valid"); + const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : []; + cxt.block$data(valid, validateUniqueItems, (0, codegen_1._) `${schemaCode} === false`); + cxt.ok(valid); + function validateUniqueItems() { + const i = gen.let("i", (0, codegen_1._) `${data}.length`); + const j = gen.let("j"); + cxt.setParams({ i, j }); + gen.assign(valid, true); + gen.if((0, codegen_1._) `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)); + } + function canOptimize() { + return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array"); + } + function loopN(i, j) { + const item = gen.name("item"); + const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong); + const indices = gen.const("indices", (0, codegen_1._) `{}`); + gen.for((0, codegen_1._) `;${i}--;`, () => { + gen.let(item, (0, codegen_1._) `${data}[${i}]`); + gen.if(wrongType, (0, codegen_1._) `continue`); + if (itemTypes.length > 1) + gen.if((0, codegen_1._) `typeof ${item} == "string"`, (0, codegen_1._) `${item} += "_"`); + gen + .if((0, codegen_1._) `typeof ${indices}[${item}] == "number"`, () => { + gen.assign(j, (0, codegen_1._) `${indices}[${item}]`); + cxt.error(); + gen.assign(valid, false).break(); + }) + .code((0, codegen_1._) `${indices}[${item}] = ${i}`); + }); + } + function loopN2(i, j) { + const eql = (0, util_1.useFunc)(gen, equal_1.default); + const outer = gen.name("outer"); + gen.label(outer).for((0, codegen_1._) `;${i}--;`, () => gen.for((0, codegen_1._) `${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._) `${eql}(${data}[${i}], ${data}[${j}])`, () => { + cxt.error(); + gen.assign(valid, false).break(outer); + }))); + } + }, +}; +exports.default = def; +//# sourceMappingURL=uniqueItems.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map b/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map new file mode 100644 index 000000000..46eb7a2a0 --- /dev/null +++ b/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map @@ -0,0 +1 @@ +{"version":3,"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AAE,CAAA;gBACX,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACvC,CAAC,CAAC,CACH,CACF,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/lib/2019.ts b/node_modules/ajv/lib/2019.ts new file mode 100644 index 000000000..45a3fa535 --- /dev/null +++ b/node_modules/ajv/lib/2019.ts @@ -0,0 +1,80 @@ +import type {AnySchemaObject} from "./types" +import AjvCore, {Options} from "./core" + +import draft7Vocabularies from "./vocabularies/draft7" +import dynamicVocabulary from "./vocabularies/dynamic" +import nextVocabulary from "./vocabularies/next" +import unevaluatedVocabulary from "./vocabularies/unevaluated" +import discriminator from "./vocabularies/discriminator" +import addMetaSchema2019 from "./refs/json-schema-2019-09" + +const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema" + +class Ajv2019 extends AjvCore { + constructor(opts: Options = {}) { + super({ + ...opts, + dynamicRef: true, + next: true, + unevaluated: true, + }) + } + + _addVocabularies(): void { + super._addVocabularies() + this.addVocabulary(dynamicVocabulary) + draft7Vocabularies.forEach((v) => this.addVocabulary(v)) + this.addVocabulary(nextVocabulary) + this.addVocabulary(unevaluatedVocabulary) + if (this.opts.discriminator) this.addKeyword(discriminator) + } + + _addDefaultMetaSchema(): void { + super._addDefaultMetaSchema() + const {$data, meta} = this.opts + if (!meta) return + addMetaSchema2019.call(this, $data) + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID + } + + defaultMeta(): string | AnySchemaObject | undefined { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) + } +} + +module.exports = exports = Ajv2019 +Object.defineProperty(exports, "__esModule", {value: true}) + +export default Ajv2019 + +export { + Format, + FormatDefinition, + AsyncFormatDefinition, + KeywordDefinition, + KeywordErrorDefinition, + CodeKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, + Vocabulary, + Schema, + SchemaObject, + AnySchemaObject, + AsyncSchema, + AnySchema, + ValidateFunction, + AsyncValidateFunction, + ErrorObject, + ErrorNoParams, +} from "./types" + +export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" +export {SchemaCxt, SchemaObjCxt} from "./compile" +export {KeywordCxt} from "./compile/validate" +export {DefinedError} from "./vocabularies/errors" +export {JSONType} from "./compile/rules" +export {JSONSchemaType} from "./types/json-schema" +export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" +export {default as ValidationError} from "./runtime/validation_error" +export {default as MissingRefError} from "./compile/ref_error" diff --git a/node_modules/ajv/lib/2020.ts b/node_modules/ajv/lib/2020.ts new file mode 100644 index 000000000..afbdda200 --- /dev/null +++ b/node_modules/ajv/lib/2020.ts @@ -0,0 +1,74 @@ +import type {AnySchemaObject} from "./types" +import AjvCore, {Options} from "./core" + +import draft2020Vocabularies from "./vocabularies/draft2020" +import discriminator from "./vocabularies/discriminator" +import addMetaSchema2020 from "./refs/json-schema-2020-12" + +const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema" + +class Ajv2020 extends AjvCore { + constructor(opts: Options = {}) { + super({ + ...opts, + dynamicRef: true, + next: true, + unevaluated: true, + }) + } + + _addVocabularies(): void { + super._addVocabularies() + draft2020Vocabularies.forEach((v) => this.addVocabulary(v)) + if (this.opts.discriminator) this.addKeyword(discriminator) + } + + _addDefaultMetaSchema(): void { + super._addDefaultMetaSchema() + const {$data, meta} = this.opts + if (!meta) return + addMetaSchema2020.call(this, $data) + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID + } + + defaultMeta(): string | AnySchemaObject | undefined { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) + } +} + +module.exports = exports = Ajv2020 +Object.defineProperty(exports, "__esModule", {value: true}) + +export default Ajv2020 + +export { + Format, + FormatDefinition, + AsyncFormatDefinition, + KeywordDefinition, + KeywordErrorDefinition, + CodeKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, + Vocabulary, + Schema, + SchemaObject, + AnySchemaObject, + AsyncSchema, + AnySchema, + ValidateFunction, + AsyncValidateFunction, + ErrorObject, + ErrorNoParams, +} from "./types" + +export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" +export {SchemaCxt, SchemaObjCxt} from "./compile" +export {KeywordCxt} from "./compile/validate" +export {DefinedError} from "./vocabularies/errors" +export {JSONType} from "./compile/rules" +export {JSONSchemaType} from "./types/json-schema" +export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" +export {default as ValidationError} from "./runtime/validation_error" +export {default as MissingRefError} from "./compile/ref_error" diff --git a/node_modules/ajv/lib/ajv.ts b/node_modules/ajv/lib/ajv.ts new file mode 100644 index 000000000..7f87c8aea --- /dev/null +++ b/node_modules/ajv/lib/ajv.ts @@ -0,0 +1,69 @@ +import type {AnySchemaObject} from "./types" +import AjvCore from "./core" +import draft7Vocabularies from "./vocabularies/draft7" +import discriminator from "./vocabularies/discriminator" +import * as draft7MetaSchema from "./refs/json-schema-draft-07.json" + +const META_SUPPORT_DATA = ["/properties"] + +const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema" + +class Ajv extends AjvCore { + _addVocabularies(): void { + super._addVocabularies() + draft7Vocabularies.forEach((v) => this.addVocabulary(v)) + if (this.opts.discriminator) this.addKeyword(discriminator) + } + + _addDefaultMetaSchema(): void { + super._addDefaultMetaSchema() + if (!this.opts.meta) return + const metaSchema = this.opts.$data + ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) + : draft7MetaSchema + this.addMetaSchema(metaSchema, META_SCHEMA_ID, false) + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID + } + + defaultMeta(): string | AnySchemaObject | undefined { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) + } +} + +module.exports = exports = Ajv +Object.defineProperty(exports, "__esModule", {value: true}) + +export default Ajv + +export { + Format, + FormatDefinition, + AsyncFormatDefinition, + KeywordDefinition, + KeywordErrorDefinition, + CodeKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, + Vocabulary, + Schema, + SchemaObject, + AnySchemaObject, + AsyncSchema, + AnySchema, + ValidateFunction, + AsyncValidateFunction, + SchemaValidateFunction, + ErrorObject, + ErrorNoParams, +} from "./types" + +export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" +export {SchemaCxt, SchemaObjCxt} from "./compile" +export {KeywordCxt} from "./compile/validate" +export {DefinedError} from "./vocabularies/errors" +export {JSONType} from "./compile/rules" +export {JSONSchemaType} from "./types/json-schema" +export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" +export {default as ValidationError} from "./runtime/validation_error" +export {default as MissingRefError} from "./compile/ref_error" diff --git a/node_modules/ajv/lib/compile/codegen/code.ts b/node_modules/ajv/lib/compile/codegen/code.ts new file mode 100644 index 000000000..b17701973 --- /dev/null +++ b/node_modules/ajv/lib/compile/codegen/code.ts @@ -0,0 +1,168 @@ +export abstract class _CodeOrName { + abstract readonly str: string + abstract readonly names: UsedNames + abstract toString(): string + abstract emptyStr(): boolean +} + +export const IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i + +export class Name extends _CodeOrName { + readonly str: string + constructor(s: string) { + super() + if (!IDENTIFIER.test(s)) throw new Error("CodeGen: name must be a valid identifier") + this.str = s + } + + toString(): string { + return this.str + } + + emptyStr(): boolean { + return false + } + + get names(): UsedNames { + return {[this.str]: 1} + } +} + +export class _Code extends _CodeOrName { + readonly _items: readonly CodeItem[] + private _str?: string + private _names?: UsedNames + + constructor(code: string | readonly CodeItem[]) { + super() + this._items = typeof code === "string" ? [code] : code + } + + toString(): string { + return this.str + } + + emptyStr(): boolean { + if (this._items.length > 1) return false + const item = this._items[0] + return item === "" || item === '""' + } + + get str(): string { + return (this._str ??= this._items.reduce((s: string, c: CodeItem) => `${s}${c}`, "")) + } + + get names(): UsedNames { + return (this._names ??= this._items.reduce((names: UsedNames, c) => { + if (c instanceof Name) names[c.str] = (names[c.str] || 0) + 1 + return names + }, {})) + } +} + +export type CodeItem = Name | string | number | boolean | null + +export type UsedNames = Record + +export type Code = _Code | Name + +export type SafeExpr = Code | number | boolean | null + +export const nil = new _Code("") + +type CodeArg = SafeExpr | string | undefined + +export function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code { + const code: CodeItem[] = [strs[0]] + let i = 0 + while (i < args.length) { + addCodeArg(code, args[i]) + code.push(strs[++i]) + } + return new _Code(code) +} + +const plus = new _Code("+") + +export function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code { + const expr: CodeItem[] = [safeStringify(strs[0])] + let i = 0 + while (i < args.length) { + expr.push(plus) + addCodeArg(expr, args[i]) + expr.push(plus, safeStringify(strs[++i])) + } + optimize(expr) + return new _Code(expr) +} + +export function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void { + if (arg instanceof _Code) code.push(...arg._items) + else if (arg instanceof Name) code.push(arg) + else code.push(interpolate(arg)) +} + +function optimize(expr: CodeItem[]): void { + let i = 1 + while (i < expr.length - 1) { + if (expr[i] === plus) { + const res = mergeExprItems(expr[i - 1], expr[i + 1]) + if (res !== undefined) { + expr.splice(i - 1, 3, res) + continue + } + expr[i++] = "+" + } + i++ + } +} + +function mergeExprItems(a: CodeItem, b: CodeItem): CodeItem | undefined { + if (b === '""') return a + if (a === '""') return b + if (typeof a == "string") { + if (b instanceof Name || a[a.length - 1] !== '"') return + if (typeof b != "string") return `${a.slice(0, -1)}${b}"` + if (b[0] === '"') return a.slice(0, -1) + b.slice(1) + return + } + if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) return `"${a}${b.slice(1)}` + return +} + +export function strConcat(c1: Code, c2: Code): Code { + return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}` +} + +// TODO do not allow arrays here +function interpolate(x?: string | string[] | number | boolean | null): SafeExpr | string { + return typeof x == "number" || typeof x == "boolean" || x === null + ? x + : safeStringify(Array.isArray(x) ? x.join(",") : x) +} + +export function stringify(x: unknown): Code { + return new _Code(safeStringify(x)) +} + +export function safeStringify(x: unknown): string { + return JSON.stringify(x) + .replace(/\u2028/g, "\\u2028") + .replace(/\u2029/g, "\\u2029") +} + +export function getProperty(key: Code | string | number): Code { + return typeof key == "string" && IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]` +} + +//Does best effort to format the name properly +export function getEsmExportName(key: Code | string | number): Code { + if (typeof key == "string" && IDENTIFIER.test(key)) { + return new _Code(`${key}`) + } + throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`) +} + +export function regexpCode(rx: RegExp): Code { + return new _Code(rx.toString()) +} diff --git a/node_modules/ajv/lib/compile/codegen/index.ts b/node_modules/ajv/lib/compile/codegen/index.ts new file mode 100644 index 000000000..9d29055dc --- /dev/null +++ b/node_modules/ajv/lib/compile/codegen/index.ts @@ -0,0 +1,832 @@ +import type {ScopeValueSets, NameValue, ValueScope, ValueScopeName} from "./scope" +import {_, nil, _Code, Code, Name, UsedNames, CodeItem, addCodeArg, _CodeOrName} from "./code" +import {Scope, varKinds} from "./scope" + +export {_, str, strConcat, nil, getProperty, stringify, regexpCode, Name, Code} from "./code" +export {Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds} from "./scope" + +// type for expressions that can be safely inserted in code without quotes +export type SafeExpr = Code | number | boolean | null + +// type that is either Code of function that adds code to CodeGen instance using its methods +export type Block = Code | (() => void) + +export const operators = { + GT: new _Code(">"), + GTE: new _Code(">="), + LT: new _Code("<"), + LTE: new _Code("<="), + EQ: new _Code("==="), + NEQ: new _Code("!=="), + NOT: new _Code("!"), + OR: new _Code("||"), + AND: new _Code("&&"), + ADD: new _Code("+"), +} + +abstract class Node { + abstract readonly names: UsedNames + + optimizeNodes(): this | ChildNode | ChildNode[] | undefined { + return this + } + + optimizeNames(_names: UsedNames, _constants: Constants): this | undefined { + return this + } + + // get count(): number { + // return 1 + // } +} + +class Def extends Node { + constructor(private readonly varKind: Name, private readonly name: Name, private rhs?: SafeExpr) { + super() + } + + render({es5, _n}: CGOptions): string { + const varKind = es5 ? varKinds.var : this.varKind + const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}` + return `${varKind} ${this.name}${rhs};` + _n + } + + optimizeNames(names: UsedNames, constants: Constants): this | undefined { + if (!names[this.name.str]) return + if (this.rhs) this.rhs = optimizeExpr(this.rhs, names, constants) + return this + } + + get names(): UsedNames { + return this.rhs instanceof _CodeOrName ? this.rhs.names : {} + } +} + +class Assign extends Node { + constructor(readonly lhs: Code, public rhs: SafeExpr, private readonly sideEffects?: boolean) { + super() + } + + render({_n}: CGOptions): string { + return `${this.lhs} = ${this.rhs};` + _n + } + + optimizeNames(names: UsedNames, constants: Constants): this | undefined { + if (this.lhs instanceof Name && !names[this.lhs.str] && !this.sideEffects) return + this.rhs = optimizeExpr(this.rhs, names, constants) + return this + } + + get names(): UsedNames { + const names = this.lhs instanceof Name ? {} : {...this.lhs.names} + return addExprNames(names, this.rhs) + } +} + +class AssignOp extends Assign { + constructor(lhs: Code, private readonly op: Code, rhs: SafeExpr, sideEffects?: boolean) { + super(lhs, rhs, sideEffects) + } + + render({_n}: CGOptions): string { + return `${this.lhs} ${this.op}= ${this.rhs};` + _n + } +} + +class Label extends Node { + readonly names: UsedNames = {} + constructor(readonly label: Name) { + super() + } + + render({_n}: CGOptions): string { + return `${this.label}:` + _n + } +} + +class Break extends Node { + readonly names: UsedNames = {} + constructor(readonly label?: Code) { + super() + } + + render({_n}: CGOptions): string { + const label = this.label ? ` ${this.label}` : "" + return `break${label};` + _n + } +} + +class Throw extends Node { + constructor(readonly error: Code) { + super() + } + + render({_n}: CGOptions): string { + return `throw ${this.error};` + _n + } + + get names(): UsedNames { + return this.error.names + } +} + +class AnyCode extends Node { + constructor(private code: SafeExpr) { + super() + } + + render({_n}: CGOptions): string { + return `${this.code};` + _n + } + + optimizeNodes(): this | undefined { + return `${this.code}` ? this : undefined + } + + optimizeNames(names: UsedNames, constants: Constants): this { + this.code = optimizeExpr(this.code, names, constants) + return this + } + + get names(): UsedNames { + return this.code instanceof _CodeOrName ? this.code.names : {} + } +} + +abstract class ParentNode extends Node { + constructor(readonly nodes: ChildNode[] = []) { + super() + } + + render(opts: CGOptions): string { + return this.nodes.reduce((code, n) => code + n.render(opts), "") + } + + optimizeNodes(): this | ChildNode | ChildNode[] | undefined { + const {nodes} = this + let i = nodes.length + while (i--) { + const n = nodes[i].optimizeNodes() + if (Array.isArray(n)) nodes.splice(i, 1, ...n) + else if (n) nodes[i] = n + else nodes.splice(i, 1) + } + return nodes.length > 0 ? this : undefined + } + + optimizeNames(names: UsedNames, constants: Constants): this | undefined { + const {nodes} = this + let i = nodes.length + while (i--) { + // iterating backwards improves 1-pass optimization + const n = nodes[i] + if (n.optimizeNames(names, constants)) continue + subtractNames(names, n.names) + nodes.splice(i, 1) + } + return nodes.length > 0 ? this : undefined + } + + get names(): UsedNames { + return this.nodes.reduce((names: UsedNames, n) => addNames(names, n.names), {}) + } + + // get count(): number { + // return this.nodes.reduce((c, n) => c + n.count, 1) + // } +} + +abstract class BlockNode extends ParentNode { + render(opts: CGOptions): string { + return "{" + opts._n + super.render(opts) + "}" + opts._n + } +} + +class Root extends ParentNode {} + +class Else extends BlockNode { + static readonly kind = "else" +} + +class If extends BlockNode { + static readonly kind = "if" + else?: If | Else + constructor(private condition: Code | boolean, nodes?: ChildNode[]) { + super(nodes) + } + + render(opts: CGOptions): string { + let code = `if(${this.condition})` + super.render(opts) + if (this.else) code += "else " + this.else.render(opts) + return code + } + + optimizeNodes(): If | ChildNode[] | undefined { + super.optimizeNodes() + const cond = this.condition + if (cond === true) return this.nodes // else is ignored here + let e = this.else + if (e) { + const ns = e.optimizeNodes() + e = this.else = Array.isArray(ns) ? new Else(ns) : (ns as Else | undefined) + } + if (e) { + if (cond === false) return e instanceof If ? e : e.nodes + if (this.nodes.length) return this + return new If(not(cond), e instanceof If ? [e] : e.nodes) + } + if (cond === false || !this.nodes.length) return undefined + return this + } + + optimizeNames(names: UsedNames, constants: Constants): this | undefined { + this.else = this.else?.optimizeNames(names, constants) + if (!(super.optimizeNames(names, constants) || this.else)) return + this.condition = optimizeExpr(this.condition, names, constants) + return this + } + + get names(): UsedNames { + const names = super.names + addExprNames(names, this.condition) + if (this.else) addNames(names, this.else.names) + return names + } + + // get count(): number { + // return super.count + (this.else?.count || 0) + // } +} + +abstract class For extends BlockNode { + static readonly kind = "for" +} + +class ForLoop extends For { + constructor(private iteration: Code) { + super() + } + + render(opts: CGOptions): string { + return `for(${this.iteration})` + super.render(opts) + } + + optimizeNames(names: UsedNames, constants: Constants): this | undefined { + if (!super.optimizeNames(names, constants)) return + this.iteration = optimizeExpr(this.iteration, names, constants) + return this + } + + get names(): UsedNames { + return addNames(super.names, this.iteration.names) + } +} + +class ForRange extends For { + constructor( + private readonly varKind: Name, + private readonly name: Name, + private readonly from: SafeExpr, + private readonly to: SafeExpr + ) { + super() + } + + render(opts: CGOptions): string { + const varKind = opts.es5 ? varKinds.var : this.varKind + const {name, from, to} = this + return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts) + } + + get names(): UsedNames { + const names = addExprNames(super.names, this.from) + return addExprNames(names, this.to) + } +} + +class ForIter extends For { + constructor( + private readonly loop: "of" | "in", + private readonly varKind: Name, + private readonly name: Name, + private iterable: Code + ) { + super() + } + + render(opts: CGOptions): string { + return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts) + } + + optimizeNames(names: UsedNames, constants: Constants): this | undefined { + if (!super.optimizeNames(names, constants)) return + this.iterable = optimizeExpr(this.iterable, names, constants) + return this + } + + get names(): UsedNames { + return addNames(super.names, this.iterable.names) + } +} + +class Func extends BlockNode { + static readonly kind = "func" + constructor(public name: Name, public args: Code, public async?: boolean) { + super() + } + + render(opts: CGOptions): string { + const _async = this.async ? "async " : "" + return `${_async}function ${this.name}(${this.args})` + super.render(opts) + } +} + +class Return extends ParentNode { + static readonly kind = "return" + + render(opts: CGOptions): string { + return "return " + super.render(opts) + } +} + +class Try extends BlockNode { + catch?: Catch + finally?: Finally + + render(opts: CGOptions): string { + let code = "try" + super.render(opts) + if (this.catch) code += this.catch.render(opts) + if (this.finally) code += this.finally.render(opts) + return code + } + + optimizeNodes(): this { + super.optimizeNodes() + this.catch?.optimizeNodes() as Catch | undefined + this.finally?.optimizeNodes() as Finally | undefined + return this + } + + optimizeNames(names: UsedNames, constants: Constants): this { + super.optimizeNames(names, constants) + this.catch?.optimizeNames(names, constants) + this.finally?.optimizeNames(names, constants) + return this + } + + get names(): UsedNames { + const names = super.names + if (this.catch) addNames(names, this.catch.names) + if (this.finally) addNames(names, this.finally.names) + return names + } + + // get count(): number { + // return super.count + (this.catch?.count || 0) + (this.finally?.count || 0) + // } +} + +class Catch extends BlockNode { + static readonly kind = "catch" + constructor(readonly error: Name) { + super() + } + + render(opts: CGOptions): string { + return `catch(${this.error})` + super.render(opts) + } +} + +class Finally extends BlockNode { + static readonly kind = "finally" + render(opts: CGOptions): string { + return "finally" + super.render(opts) + } +} + +type StartBlockNode = If | For | Func | Return | Try + +type LeafNode = Def | Assign | Label | Break | Throw | AnyCode + +type ChildNode = StartBlockNode | LeafNode + +type EndBlockNodeType = + | typeof If + | typeof Else + | typeof For + | typeof Func + | typeof Return + | typeof Catch + | typeof Finally + +type Constants = Record + +export interface CodeGenOptions { + es5?: boolean + lines?: boolean + ownProperties?: boolean +} + +interface CGOptions extends CodeGenOptions { + _n: "\n" | "" +} + +export class CodeGen { + readonly _scope: Scope + readonly _extScope: ValueScope + readonly _values: ScopeValueSets = {} + private readonly _nodes: ParentNode[] + private readonly _blockStarts: number[] = [] + private readonly _constants: Constants = {} + private readonly opts: CGOptions + + constructor(extScope: ValueScope, opts: CodeGenOptions = {}) { + this.opts = {...opts, _n: opts.lines ? "\n" : ""} + this._extScope = extScope + this._scope = new Scope({parent: extScope}) + this._nodes = [new Root()] + } + + toString(): string { + return this._root.render(this.opts) + } + + // returns unique name in the internal scope + name(prefix: string): Name { + return this._scope.name(prefix) + } + + // reserves unique name in the external scope + scopeName(prefix: string): ValueScopeName { + return this._extScope.name(prefix) + } + + // reserves unique name in the external scope and assigns value to it + scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name { + const name = this._extScope.value(prefixOrName, value) + const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set()) + vs.add(name) + return name + } + + getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined { + return this._extScope.getValue(prefix, keyOrRef) + } + + // return code that assigns values in the external scope to the names that are used internally + // (same names that were returned by gen.scopeName or gen.scopeValue) + scopeRefs(scopeName: Name): Code { + return this._extScope.scopeRefs(scopeName, this._values) + } + + scopeCode(): Code { + return this._extScope.scopeCode(this._values) + } + + private _def( + varKind: Name, + nameOrPrefix: Name | string, + rhs?: SafeExpr, + constant?: boolean + ): Name { + const name = this._scope.toName(nameOrPrefix) + if (rhs !== undefined && constant) this._constants[name.str] = rhs + this._leafNode(new Def(varKind, name, rhs)) + return name + } + + // `const` declaration (`var` in es5 mode) + const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name { + return this._def(varKinds.const, nameOrPrefix, rhs, _constant) + } + + // `let` declaration with optional assignment (`var` in es5 mode) + let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name { + return this._def(varKinds.let, nameOrPrefix, rhs, _constant) + } + + // `var` declaration with optional assignment + var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name { + return this._def(varKinds.var, nameOrPrefix, rhs, _constant) + } + + // assignment code + assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen { + return this._leafNode(new Assign(lhs, rhs, sideEffects)) + } + + // `+=` code + add(lhs: Code, rhs: SafeExpr): CodeGen { + return this._leafNode(new AssignOp(lhs, operators.ADD, rhs)) + } + + // appends passed SafeExpr to code or executes Block + code(c: Block | SafeExpr): CodeGen { + if (typeof c == "function") c() + else if (c !== nil) this._leafNode(new AnyCode(c)) + return this + } + + // returns code for object literal for the passed argument list of key-value pairs + object(...keyValues: [Name | string, SafeExpr | string][]): _Code { + const code: CodeItem[] = ["{"] + for (const [key, value] of keyValues) { + if (code.length > 1) code.push(",") + code.push(key) + if (key !== value || this.opts.es5) { + code.push(":") + addCodeArg(code, value) + } + } + code.push("}") + return new _Code(code) + } + + // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) + if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen { + this._blockNode(new If(condition)) + + if (thenBody && elseBody) { + this.code(thenBody).else().code(elseBody).endIf() + } else if (thenBody) { + this.code(thenBody).endIf() + } else if (elseBody) { + throw new Error('CodeGen: "else" body without "then" body') + } + return this + } + + // `else if` clause - invalid without `if` or after `else` clauses + elseIf(condition: Code | boolean): CodeGen { + return this._elseNode(new If(condition)) + } + + // `else` clause - only valid after `if` or `else if` clauses + else(): CodeGen { + return this._elseNode(new Else()) + } + + // end `if` statement (needed if gen.if was used only with condition) + endIf(): CodeGen { + return this._endBlockNode(If, Else) + } + + private _for(node: For, forBody?: Block): CodeGen { + this._blockNode(node) + if (forBody) this.code(forBody).endFor() + return this + } + + // a generic `for` clause (or statement if `forBody` is passed) + for(iteration: Code, forBody?: Block): CodeGen { + return this._for(new ForLoop(iteration), forBody) + } + + // `for` statement for a range of values + forRange( + nameOrPrefix: Name | string, + from: SafeExpr, + to: SafeExpr, + forBody: (index: Name) => void, + varKind: Code = this.opts.es5 ? varKinds.var : varKinds.let + ): CodeGen { + const name = this._scope.toName(nameOrPrefix) + return this._for(new ForRange(varKind, name, from, to), () => forBody(name)) + } + + // `for-of` statement (in es5 mode replace with a normal for loop) + forOf( + nameOrPrefix: Name | string, + iterable: Code, + forBody: (item: Name) => void, + varKind: Code = varKinds.const + ): CodeGen { + const name = this._scope.toName(nameOrPrefix) + if (this.opts.es5) { + const arr = iterable instanceof Name ? iterable : this.var("_arr", iterable) + return this.forRange("_i", 0, _`${arr}.length`, (i) => { + this.var(name, _`${arr}[${i}]`) + forBody(name) + }) + } + return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)) + } + + // `for-in` statement. + // With option `ownProperties` replaced with a `for-of` loop for object keys + forIn( + nameOrPrefix: Name | string, + obj: Code, + forBody: (item: Name) => void, + varKind: Code = this.opts.es5 ? varKinds.var : varKinds.const + ): CodeGen { + if (this.opts.ownProperties) { + return this.forOf(nameOrPrefix, _`Object.keys(${obj})`, forBody) + } + const name = this._scope.toName(nameOrPrefix) + return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)) + } + + // end `for` loop + endFor(): CodeGen { + return this._endBlockNode(For) + } + + // `label` statement + label(label: Name): CodeGen { + return this._leafNode(new Label(label)) + } + + // `break` statement + break(label?: Code): CodeGen { + return this._leafNode(new Break(label)) + } + + // `return` statement + return(value: Block | SafeExpr): CodeGen { + const node = new Return() + this._blockNode(node) + this.code(value) + if (node.nodes.length !== 1) throw new Error('CodeGen: "return" should have one node') + return this._endBlockNode(Return) + } + + // `try` statement + try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen { + if (!catchCode && !finallyCode) throw new Error('CodeGen: "try" without "catch" and "finally"') + const node = new Try() + this._blockNode(node) + this.code(tryBody) + if (catchCode) { + const error = this.name("e") + this._currNode = node.catch = new Catch(error) + catchCode(error) + } + if (finallyCode) { + this._currNode = node.finally = new Finally() + this.code(finallyCode) + } + return this._endBlockNode(Catch, Finally) + } + + // `throw` statement + throw(error: Code): CodeGen { + return this._leafNode(new Throw(error)) + } + + // start self-balancing block + block(body?: Block, nodeCount?: number): CodeGen { + this._blockStarts.push(this._nodes.length) + if (body) this.code(body).endBlock(nodeCount) + return this + } + + // end the current self-balancing block + endBlock(nodeCount?: number): CodeGen { + const len = this._blockStarts.pop() + if (len === undefined) throw new Error("CodeGen: not in self-balancing block") + const toClose = this._nodes.length - len + if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) { + throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`) + } + this._nodes.length = len + return this + } + + // `function` heading (or definition if funcBody is passed) + func(name: Name, args: Code = nil, async?: boolean, funcBody?: Block): CodeGen { + this._blockNode(new Func(name, args, async)) + if (funcBody) this.code(funcBody).endFunc() + return this + } + + // end function definition + endFunc(): CodeGen { + return this._endBlockNode(Func) + } + + optimize(n = 1): void { + while (n-- > 0) { + this._root.optimizeNodes() + this._root.optimizeNames(this._root.names, this._constants) + } + } + + private _leafNode(node: LeafNode): CodeGen { + this._currNode.nodes.push(node) + return this + } + + private _blockNode(node: StartBlockNode): void { + this._currNode.nodes.push(node) + this._nodes.push(node) + } + + private _endBlockNode(N1: EndBlockNodeType, N2?: EndBlockNodeType): CodeGen { + const n = this._currNode + if (n instanceof N1 || (N2 && n instanceof N2)) { + this._nodes.pop() + return this + } + throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`) + } + + private _elseNode(node: If | Else): CodeGen { + const n = this._currNode + if (!(n instanceof If)) { + throw new Error('CodeGen: "else" without "if"') + } + this._currNode = n.else = node + return this + } + + private get _root(): Root { + return this._nodes[0] as Root + } + + private get _currNode(): ParentNode { + const ns = this._nodes + return ns[ns.length - 1] + } + + private set _currNode(node: ParentNode) { + const ns = this._nodes + ns[ns.length - 1] = node + } + + // get nodeCount(): number { + // return this._root.count + // } +} + +function addNames(names: UsedNames, from: UsedNames): UsedNames { + for (const n in from) names[n] = (names[n] || 0) + (from[n] || 0) + return names +} + +function addExprNames(names: UsedNames, from: SafeExpr): UsedNames { + return from instanceof _CodeOrName ? addNames(names, from.names) : names +} + +function optimizeExpr(expr: T, names: UsedNames, constants: Constants): T +function optimizeExpr(expr: SafeExpr, names: UsedNames, constants: Constants): SafeExpr { + if (expr instanceof Name) return replaceName(expr) + if (!canOptimize(expr)) return expr + return new _Code( + expr._items.reduce((items: CodeItem[], c: SafeExpr | string) => { + if (c instanceof Name) c = replaceName(c) + if (c instanceof _Code) items.push(...c._items) + else items.push(c) + return items + }, []) + ) + + function replaceName(n: Name): SafeExpr { + const c = constants[n.str] + if (c === undefined || names[n.str] !== 1) return n + delete names[n.str] + return c + } + + function canOptimize(e: SafeExpr): e is _Code { + return ( + e instanceof _Code && + e._items.some( + (c) => c instanceof Name && names[c.str] === 1 && constants[c.str] !== undefined + ) + ) + } +} + +function subtractNames(names: UsedNames, from: UsedNames): void { + for (const n in from) names[n] = (names[n] || 0) - (from[n] || 0) +} + +export function not(x: T): T +export function not(x: Code | SafeExpr): Code | SafeExpr { + return typeof x == "boolean" || typeof x == "number" || x === null ? !x : _`!${par(x)}` +} + +const andCode = mappend(operators.AND) + +// boolean AND (&&) expression with the passed arguments +export function and(...args: Code[]): Code { + return args.reduce(andCode) +} + +const orCode = mappend(operators.OR) + +// boolean OR (||) expression with the passed arguments +export function or(...args: Code[]): Code { + return args.reduce(orCode) +} + +type MAppend = (x: Code, y: Code) => Code + +function mappend(op: Code): MAppend { + return (x, y) => (x === nil ? y : y === nil ? x : _`${par(x)} ${op} ${par(y)}`) +} + +function par(x: Code): Code { + return x instanceof Name ? x : _`(${x})` +} diff --git a/node_modules/ajv/lib/compile/codegen/scope.ts b/node_modules/ajv/lib/compile/codegen/scope.ts new file mode 100644 index 000000000..511992297 --- /dev/null +++ b/node_modules/ajv/lib/compile/codegen/scope.ts @@ -0,0 +1,215 @@ +import {_, nil, Code, Name} from "./code" + +interface NameGroup { + prefix: string + index: number +} + +export interface NameValue { + ref: ValueReference // this is the reference to any value that can be referred to from generated code via `globals` var in the closure + key?: unknown // any key to identify a global to avoid duplicates, if not passed ref is used + code?: Code // this is the code creating the value needed for standalone code wit_out closure - can be a primitive value, function or import (`require`) +} + +export type ValueReference = unknown // possibly make CodeGen parameterized type on this type + +class ValueError extends Error { + readonly value?: NameValue + constructor(name: ValueScopeName) { + super(`CodeGen: "code" for ${name} not defined`) + this.value = name.value + } +} + +interface ScopeOptions { + prefixes?: Set + parent?: Scope +} + +interface ValueScopeOptions extends ScopeOptions { + scope: ScopeStore + es5?: boolean + lines?: boolean +} + +export type ScopeStore = Record + +type ScopeValues = { + [Prefix in string]?: Map +} + +export type ScopeValueSets = { + [Prefix in string]?: Set +} + +export enum UsedValueState { + Started, + Completed, +} + +export type UsedScopeValues = { + [Prefix in string]?: Map +} + +export const varKinds = { + const: new Name("const"), + let: new Name("let"), + var: new Name("var"), +} + +export class Scope { + protected readonly _names: {[Prefix in string]?: NameGroup} = {} + protected readonly _prefixes?: Set + protected readonly _parent?: Scope + + constructor({prefixes, parent}: ScopeOptions = {}) { + this._prefixes = prefixes + this._parent = parent + } + + toName(nameOrPrefix: Name | string): Name { + return nameOrPrefix instanceof Name ? nameOrPrefix : this.name(nameOrPrefix) + } + + name(prefix: string): Name { + return new Name(this._newName(prefix)) + } + + protected _newName(prefix: string): string { + const ng = this._names[prefix] || this._nameGroup(prefix) + return `${prefix}${ng.index++}` + } + + private _nameGroup(prefix: string): NameGroup { + if (this._parent?._prefixes?.has(prefix) || (this._prefixes && !this._prefixes.has(prefix))) { + throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`) + } + return (this._names[prefix] = {prefix, index: 0}) + } +} + +interface ScopePath { + property: string + itemIndex: number +} + +export class ValueScopeName extends Name { + readonly prefix: string + value?: NameValue + scopePath?: Code + + constructor(prefix: string, nameStr: string) { + super(nameStr) + this.prefix = prefix + } + + setValue(value: NameValue, {property, itemIndex}: ScopePath): void { + this.value = value + this.scopePath = _`.${new Name(property)}[${itemIndex}]` + } +} + +interface VSOptions extends ValueScopeOptions { + _n: Code +} + +const line = _`\n` + +export class ValueScope extends Scope { + protected readonly _values: ScopeValues = {} + protected readonly _scope: ScopeStore + readonly opts: VSOptions + + constructor(opts: ValueScopeOptions) { + super(opts) + this._scope = opts.scope + this.opts = {...opts, _n: opts.lines ? line : nil} + } + + get(): ScopeStore { + return this._scope + } + + name(prefix: string): ValueScopeName { + return new ValueScopeName(prefix, this._newName(prefix)) + } + + value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName { + if (value.ref === undefined) throw new Error("CodeGen: ref must be passed in value") + const name = this.toName(nameOrPrefix) as ValueScopeName + const {prefix} = name + const valueKey = value.key ?? value.ref + let vs = this._values[prefix] + if (vs) { + const _name = vs.get(valueKey) + if (_name) return _name + } else { + vs = this._values[prefix] = new Map() + } + vs.set(valueKey, name) + + const s = this._scope[prefix] || (this._scope[prefix] = []) + const itemIndex = s.length + s[itemIndex] = value.ref + name.setValue(value, {property: prefix, itemIndex}) + return name + } + + getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined { + const vs = this._values[prefix] + if (!vs) return + return vs.get(keyOrRef) + } + + scopeRefs(scopeName: Name, values: ScopeValues | ScopeValueSets = this._values): Code { + return this._reduceValues(values, (name: ValueScopeName) => { + if (name.scopePath === undefined) throw new Error(`CodeGen: name "${name}" has no value`) + return _`${scopeName}${name.scopePath}` + }) + } + + scopeCode( + values: ScopeValues | ScopeValueSets = this._values, + usedValues?: UsedScopeValues, + getCode?: (n: ValueScopeName) => Code | undefined + ): Code { + return this._reduceValues( + values, + (name: ValueScopeName) => { + if (name.value === undefined) throw new Error(`CodeGen: name "${name}" has no value`) + return name.value.code + }, + usedValues, + getCode + ) + } + + private _reduceValues( + values: ScopeValues | ScopeValueSets, + valueCode: (n: ValueScopeName) => Code | undefined, + usedValues: UsedScopeValues = {}, + getCode?: (n: ValueScopeName) => Code | undefined + ): Code { + let code: Code = nil + for (const prefix in values) { + const vs = values[prefix] + if (!vs) continue + const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map()) + vs.forEach((name: ValueScopeName) => { + if (nameSet.has(name)) return + nameSet.set(name, UsedValueState.Started) + let c = valueCode(name) + if (c) { + const def = this.opts.es5 ? varKinds.var : varKinds.const + code = _`${code}${def} ${name} = ${c};${this.opts._n}` + } else if ((c = getCode?.(name))) { + code = _`${code}${c}${this.opts._n}` + } else { + throw new ValueError(name) + } + nameSet.set(name, UsedValueState.Completed) + }) + } + return code + } +} diff --git a/node_modules/ajv/lib/compile/errors.ts b/node_modules/ajv/lib/compile/errors.ts new file mode 100644 index 000000000..18424a0fc --- /dev/null +++ b/node_modules/ajv/lib/compile/errors.ts @@ -0,0 +1,184 @@ +import type {KeywordErrorCxt, KeywordErrorDefinition} from "../types" +import type {SchemaCxt} from "./index" +import {CodeGen, _, str, strConcat, Code, Name} from "./codegen" +import {SafeExpr} from "./codegen/code" +import {getErrorPath, Type} from "./util" +import N from "./names" + +export const keywordError: KeywordErrorDefinition = { + message: ({keyword}) => str`must pass "${keyword}" keyword validation`, +} + +export const keyword$DataError: KeywordErrorDefinition = { + message: ({keyword, schemaType}) => + schemaType + ? str`"${keyword}" keyword must be ${schemaType} ($data)` + : str`"${keyword}" keyword is invalid ($data)`, +} + +export interface ErrorPaths { + instancePath?: Code + schemaPath?: string + parentSchema?: boolean +} + +export function reportError( + cxt: KeywordErrorCxt, + error: KeywordErrorDefinition = keywordError, + errorPaths?: ErrorPaths, + overrideAllErrors?: boolean +): void { + const {it} = cxt + const {gen, compositeRule, allErrors} = it + const errObj = errorObjectCode(cxt, error, errorPaths) + if (overrideAllErrors ?? (compositeRule || allErrors)) { + addError(gen, errObj) + } else { + returnErrors(it, _`[${errObj}]`) + } +} + +export function reportExtraError( + cxt: KeywordErrorCxt, + error: KeywordErrorDefinition = keywordError, + errorPaths?: ErrorPaths +): void { + const {it} = cxt + const {gen, compositeRule, allErrors} = it + const errObj = errorObjectCode(cxt, error, errorPaths) + addError(gen, errObj) + if (!(compositeRule || allErrors)) { + returnErrors(it, N.vErrors) + } +} + +export function resetErrorsCount(gen: CodeGen, errsCount: Name): void { + gen.assign(N.errors, errsCount) + gen.if(_`${N.vErrors} !== null`, () => + gen.if( + errsCount, + () => gen.assign(_`${N.vErrors}.length`, errsCount), + () => gen.assign(N.vErrors, null) + ) + ) +} + +export function extendErrors({ + gen, + keyword, + schemaValue, + data, + errsCount, + it, +}: KeywordErrorCxt): void { + /* istanbul ignore if */ + if (errsCount === undefined) throw new Error("ajv implementation error") + const err = gen.name("err") + gen.forRange("i", errsCount, N.errors, (i) => { + gen.const(err, _`${N.vErrors}[${i}]`) + gen.if(_`${err}.instancePath === undefined`, () => + gen.assign(_`${err}.instancePath`, strConcat(N.instancePath, it.errorPath)) + ) + gen.assign(_`${err}.schemaPath`, str`${it.errSchemaPath}/${keyword}`) + if (it.opts.verbose) { + gen.assign(_`${err}.schema`, schemaValue) + gen.assign(_`${err}.data`, data) + } + }) +} + +function addError(gen: CodeGen, errObj: Code): void { + const err = gen.const("err", errObj) + gen.if( + _`${N.vErrors} === null`, + () => gen.assign(N.vErrors, _`[${err}]`), + _`${N.vErrors}.push(${err})` + ) + gen.code(_`${N.errors}++`) +} + +function returnErrors(it: SchemaCxt, errs: Code): void { + const {gen, validateName, schemaEnv} = it + if (schemaEnv.$async) { + gen.throw(_`new ${it.ValidationError as Name}(${errs})`) + } else { + gen.assign(_`${validateName}.errors`, errs) + gen.return(false) + } +} + +const E = { + keyword: new Name("keyword"), + schemaPath: new Name("schemaPath"), // also used in JTD errors + params: new Name("params"), + propertyName: new Name("propertyName"), + message: new Name("message"), + schema: new Name("schema"), + parentSchema: new Name("parentSchema"), +} + +function errorObjectCode( + cxt: KeywordErrorCxt, + error: KeywordErrorDefinition, + errorPaths?: ErrorPaths +): Code { + const {createErrors} = cxt.it + if (createErrors === false) return _`{}` + return errorObject(cxt, error, errorPaths) +} + +function errorObject( + cxt: KeywordErrorCxt, + error: KeywordErrorDefinition, + errorPaths: ErrorPaths = {} +): Code { + const {gen, it} = cxt + const keyValues: [Name, SafeExpr | string][] = [ + errorInstancePath(it, errorPaths), + errorSchemaPath(cxt, errorPaths), + ] + extraErrorProps(cxt, error, keyValues) + return gen.object(...keyValues) +} + +function errorInstancePath({errorPath}: SchemaCxt, {instancePath}: ErrorPaths): [Name, Code] { + const instPath = instancePath + ? str`${errorPath}${getErrorPath(instancePath, Type.Str)}` + : errorPath + return [N.instancePath, strConcat(N.instancePath, instPath)] +} + +function errorSchemaPath( + {keyword, it: {errSchemaPath}}: KeywordErrorCxt, + {schemaPath, parentSchema}: ErrorPaths +): [Name, string | Code] { + let schPath = parentSchema ? errSchemaPath : str`${errSchemaPath}/${keyword}` + if (schemaPath) { + schPath = str`${schPath}${getErrorPath(schemaPath, Type.Str)}` + } + return [E.schemaPath, schPath] +} + +function extraErrorProps( + cxt: KeywordErrorCxt, + {params, message}: KeywordErrorDefinition, + keyValues: [Name, SafeExpr | string][] +): void { + const {keyword, data, schemaValue, it} = cxt + const {opts, propertyName, topSchemaRef, schemaPath} = it + keyValues.push( + [E.keyword, keyword], + [E.params, typeof params == "function" ? params(cxt) : params || _`{}`] + ) + if (opts.messages) { + keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]) + } + if (opts.verbose) { + keyValues.push( + [E.schema, schemaValue], + [E.parentSchema, _`${topSchemaRef}${schemaPath}`], + [N.data, data] + ) + } + if (propertyName) keyValues.push([E.propertyName, propertyName]) +} diff --git a/node_modules/ajv/lib/compile/index.ts b/node_modules/ajv/lib/compile/index.ts new file mode 100644 index 000000000..3dac2699b --- /dev/null +++ b/node_modules/ajv/lib/compile/index.ts @@ -0,0 +1,324 @@ +import type { + AnySchema, + AnySchemaObject, + AnyValidateFunction, + AsyncValidateFunction, + EvaluatedProperties, + EvaluatedItems, +} from "../types" +import type Ajv from "../core" +import type {InstanceOptions} from "../core" +import {CodeGen, _, nil, stringify, Name, Code, ValueScopeName} from "./codegen" +import ValidationError from "../runtime/validation_error" +import N from "./names" +import {LocalRefs, getFullPath, _getFullPath, inlineRef, normalizeId, resolveUrl} from "./resolve" +import {schemaHasRulesButRef, unescapeFragment} from "./util" +import {validateFunctionCode} from "./validate" +import * as URI from "uri-js" +import {JSONType} from "./rules" + +export type SchemaRefs = { + [Ref in string]?: SchemaEnv | AnySchema +} + +export interface SchemaCxt { + readonly gen: CodeGen + readonly allErrors?: boolean // validation mode - whether to collect all errors or break on error + readonly data: Name // Name with reference to the current part of data instance + readonly parentData: Name // should be used in keywords modifying data + readonly parentDataProperty: Code | number // should be used in keywords modifying data + readonly dataNames: Name[] + readonly dataPathArr: (Code | number)[] + readonly dataLevel: number // the level of the currently validated data, + // it can be used to access both the property names and the data on all levels from the top. + dataTypes: JSONType[] // data types applied to the current part of data instance + definedProperties: Set // set of properties to keep track of for required checks + readonly topSchemaRef: Code + readonly validateName: Name + evaluated?: Name + readonly ValidationError?: Name + readonly schema: AnySchema // current schema object - equal to parentSchema passed via KeywordCxt + readonly schemaEnv: SchemaEnv + readonly rootId: string + baseId: string // the current schema base URI that should be used as the base for resolving URIs in references (\$ref) + readonly schemaPath: Code // the run-time expression that evaluates to the property name of the current schema + readonly errSchemaPath: string // this is actual string, should not be changed to Code + readonly errorPath: Code + readonly propertyName?: Name + readonly compositeRule?: boolean // true indicates that the current schema is inside the compound keyword, + // where failing some rule doesn't mean validation failure (`anyOf`, `oneOf`, `not`, `if`). + // This flag is used to determine whether you can return validation result immediately after any error in case the option `allErrors` is not `true. + // You only need to use it if you have many steps in your keywords and potentially can define multiple errors. + props?: EvaluatedProperties | Name // properties evaluated by this schema - used by parent schema or assigned to validation function + items?: EvaluatedItems | Name // last item evaluated by this schema - used by parent schema or assigned to validation function + jtdDiscriminator?: string + jtdMetadata?: boolean + readonly createErrors?: boolean + readonly opts: InstanceOptions // Ajv instance option. + readonly self: Ajv // current Ajv instance +} + +export interface SchemaObjCxt extends SchemaCxt { + readonly schema: AnySchemaObject +} +interface SchemaEnvArgs { + readonly schema: AnySchema + readonly schemaId?: "$id" | "id" + readonly root?: SchemaEnv + readonly baseId?: string + readonly schemaPath?: string + readonly localRefs?: LocalRefs + readonly meta?: boolean +} + +export class SchemaEnv implements SchemaEnvArgs { + readonly schema: AnySchema + readonly schemaId?: "$id" | "id" + readonly root: SchemaEnv + baseId: string // TODO possibly, it should be readonly + schemaPath?: string + localRefs?: LocalRefs + readonly meta?: boolean + readonly $async?: boolean // true if the current schema is asynchronous. + readonly refs: SchemaRefs = {} + readonly dynamicAnchors: {[Ref in string]?: true} = {} + validate?: AnyValidateFunction + validateName?: ValueScopeName + serialize?: (data: unknown) => string + serializeName?: ValueScopeName + parse?: (data: string) => unknown + parseName?: ValueScopeName + + constructor(env: SchemaEnvArgs) { + let schema: AnySchemaObject | undefined + if (typeof env.schema == "object") schema = env.schema + this.schema = env.schema + this.schemaId = env.schemaId + this.root = env.root || this + this.baseId = env.baseId ?? normalizeId(schema?.[env.schemaId || "$id"]) + this.schemaPath = env.schemaPath + this.localRefs = env.localRefs + this.meta = env.meta + this.$async = schema?.$async + this.refs = {} + } +} + +// let codeSize = 0 +// let nodeCount = 0 + +// Compiles schema in SchemaEnv +export function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv { + // TODO refactor - remove compilations + const _sch = getCompilingSchema.call(this, sch) + if (_sch) return _sch + const rootId = getFullPath(this.opts.uriResolver, sch.root.baseId) // TODO if getFullPath removed 1 tests fails + const {es5, lines} = this.opts.code + const {ownProperties} = this.opts + const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) + let _ValidationError + if (sch.$async) { + _ValidationError = gen.scopeValue("Error", { + ref: ValidationError, + code: _`require("ajv/dist/runtime/validation_error").default`, + }) + } + + const validateName = gen.scopeName("validate") + sch.validateName = validateName + + const schemaCxt: SchemaCxt = { + gen, + allErrors: this.opts.allErrors, + data: N.data, + parentData: N.parentData, + parentDataProperty: N.parentDataProperty, + dataNames: [N.data], + dataPathArr: [nil], // TODO can its length be used as dataLevel if nil is removed? + dataLevel: 0, + dataTypes: [], + definedProperties: new Set(), + topSchemaRef: gen.scopeValue( + "schema", + this.opts.code.source === true + ? {ref: sch.schema, code: stringify(sch.schema)} + : {ref: sch.schema} + ), + validateName, + ValidationError: _ValidationError, + schema: sch.schema, + schemaEnv: sch, + rootId, + baseId: sch.baseId || rootId, + schemaPath: nil, + errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"), + errorPath: _`""`, + opts: this.opts, + self: this, + } + + let sourceCode: string | undefined + try { + this._compilations.add(sch) + validateFunctionCode(schemaCxt) + gen.optimize(this.opts.code.optimize) + // gen.optimize(1) + const validateCode = gen.toString() + sourceCode = `${gen.scopeRefs(N.scope)}return ${validateCode}` + // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount)) + if (this.opts.code.process) sourceCode = this.opts.code.process(sourceCode, sch) + // console.log("\n\n\n *** \n", sourceCode) + const makeValidate = new Function(`${N.self}`, `${N.scope}`, sourceCode) + const validate: AnyValidateFunction = makeValidate(this, this.scope.get()) + this.scope.value(validateName, {ref: validate}) + + validate.errors = null + validate.schema = sch.schema + validate.schemaEnv = sch + if (sch.$async) (validate as AsyncValidateFunction).$async = true + if (this.opts.code.source === true) { + validate.source = {validateName, validateCode, scopeValues: gen._values} + } + if (this.opts.unevaluated) { + const {props, items} = schemaCxt + validate.evaluated = { + props: props instanceof Name ? undefined : props, + items: items instanceof Name ? undefined : items, + dynamicProps: props instanceof Name, + dynamicItems: items instanceof Name, + } + if (validate.source) validate.source.evaluated = stringify(validate.evaluated) + } + sch.validate = validate + return sch + } catch (e) { + delete sch.validate + delete sch.validateName + if (sourceCode) this.logger.error("Error compiling schema, function code:", sourceCode) + // console.log("\n\n\n *** \n", sourceCode, this.opts) + throw e + } finally { + this._compilations.delete(sch) + } +} + +export function resolveRef( + this: Ajv, + root: SchemaEnv, + baseId: string, + ref: string +): AnySchema | SchemaEnv | undefined { + ref = resolveUrl(this.opts.uriResolver, baseId, ref) + const schOrFunc = root.refs[ref] + if (schOrFunc) return schOrFunc + + let _sch = resolve.call(this, root, ref) + if (_sch === undefined) { + const schema = root.localRefs?.[ref] // TODO maybe localRefs should hold SchemaEnv + const {schemaId} = this.opts + if (schema) _sch = new SchemaEnv({schema, schemaId, root, baseId}) + } + + if (_sch === undefined) return + return (root.refs[ref] = inlineOrCompile.call(this, _sch)) +} + +function inlineOrCompile(this: Ajv, sch: SchemaEnv): AnySchema | SchemaEnv { + if (inlineRef(sch.schema, this.opts.inlineRefs)) return sch.schema + return sch.validate ? sch : compileSchema.call(this, sch) +} + +// Index of schema compilation in the currently compiled list +export function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void { + for (const sch of this._compilations) { + if (sameSchemaEnv(sch, schEnv)) return sch + } +} + +function sameSchemaEnv(s1: SchemaEnv, s2: SchemaEnv): boolean { + return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId +} + +// resolve and compile the references ($ref) +// TODO returns AnySchemaObject (if the schema can be inlined) or validation function +function resolve( + this: Ajv, + root: SchemaEnv, // information about the root schema for the current schema + ref: string // reference to resolve +): SchemaEnv | undefined { + let sch + while (typeof (sch = this.refs[ref]) == "string") ref = sch + return sch || this.schemas[ref] || resolveSchema.call(this, root, ref) +} + +// Resolve schema, its root and baseId +export function resolveSchema( + this: Ajv, + root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it + ref: string // reference to resolve +): SchemaEnv | undefined { + const p = this.opts.uriResolver.parse(ref) + const refPath = _getFullPath(this.opts.uriResolver, p) + let baseId = getFullPath(this.opts.uriResolver, root.baseId, undefined) + // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests + if (Object.keys(root.schema).length > 0 && refPath === baseId) { + return getJsonPointer.call(this, p, root) + } + + const id = normalizeId(refPath) + const schOrRef = this.refs[id] || this.schemas[id] + if (typeof schOrRef == "string") { + const sch = resolveSchema.call(this, root, schOrRef) + if (typeof sch?.schema !== "object") return + return getJsonPointer.call(this, p, sch) + } + + if (typeof schOrRef?.schema !== "object") return + if (!schOrRef.validate) compileSchema.call(this, schOrRef) + if (id === normalizeId(ref)) { + const {schema} = schOrRef + const {schemaId} = this.opts + const schId = schema[schemaId] + if (schId) baseId = resolveUrl(this.opts.uriResolver, baseId, schId) + return new SchemaEnv({schema, schemaId, root, baseId}) + } + return getJsonPointer.call(this, p, schOrRef) +} + +const PREVENT_SCOPE_CHANGE = new Set([ + "properties", + "patternProperties", + "enum", + "dependencies", + "definitions", +]) + +function getJsonPointer( + this: Ajv, + parsedRef: URI.URIComponents, + {baseId, schema, root}: SchemaEnv +): SchemaEnv | undefined { + if (parsedRef.fragment?.[0] !== "/") return + for (const part of parsedRef.fragment.slice(1).split("/")) { + if (typeof schema === "boolean") return + const partSchema = schema[unescapeFragment(part)] + if (partSchema === undefined) return + schema = partSchema + // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? + const schId = typeof schema === "object" && schema[this.opts.schemaId] + if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { + baseId = resolveUrl(this.opts.uriResolver, baseId, schId) + } + } + let env: SchemaEnv | undefined + if (typeof schema != "boolean" && schema.$ref && !schemaHasRulesButRef(schema, this.RULES)) { + const $ref = resolveUrl(this.opts.uriResolver, baseId, schema.$ref) + env = resolveSchema.call(this, root, $ref) + } + // even though resolution failed we need to return SchemaEnv to throw exception + // so that compileAsync loads missing schema. + const {schemaId} = this.opts + env = env || new SchemaEnv({schema, schemaId, root, baseId}) + if (env.schema !== env.root.schema) return env + return undefined +} diff --git a/node_modules/ajv/lib/compile/jtd/parse.ts b/node_modules/ajv/lib/compile/jtd/parse.ts new file mode 100644 index 000000000..a0141c770 --- /dev/null +++ b/node_modules/ajv/lib/compile/jtd/parse.ts @@ -0,0 +1,411 @@ +import type Ajv from "../../core" +import type {SchemaObject} from "../../types" +import {jtdForms, JTDForm, SchemaObjectMap} from "./types" +import {SchemaEnv, getCompilingSchema} from ".." +import {_, str, and, or, nil, not, CodeGen, Code, Name, SafeExpr} from "../codegen" +import MissingRefError from "../ref_error" +import N from "../names" +import {hasPropFunc} from "../../vocabularies/code" +import {hasRef} from "../../vocabularies/jtd/ref" +import {intRange, IntType} from "../../vocabularies/jtd/type" +import {parseJson, parseJsonNumber, parseJsonString} from "../../runtime/parseJson" +import {useFunc} from "../util" +import validTimestamp from "../../runtime/timestamp" + +type GenParse = (cxt: ParseCxt) => void + +const genParse: {[F in JTDForm]: GenParse} = { + elements: parseElements, + values: parseValues, + discriminator: parseDiscriminator, + properties: parseProperties, + optionalProperties: parseProperties, + enum: parseEnum, + type: parseType, + ref: parseRef, +} + +interface ParseCxt { + readonly gen: CodeGen + readonly self: Ajv // current Ajv instance + readonly schemaEnv: SchemaEnv + readonly definitions: SchemaObjectMap + schema: SchemaObject + data: Code + parseName: Name + char: Name +} + +export default function compileParser( + this: Ajv, + sch: SchemaEnv, + definitions: SchemaObjectMap +): SchemaEnv { + const _sch = getCompilingSchema.call(this, sch) + if (_sch) return _sch + const {es5, lines} = this.opts.code + const {ownProperties} = this.opts + const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) + const parseName = gen.scopeName("parse") + const cxt: ParseCxt = { + self: this, + gen, + schema: sch.schema as SchemaObject, + schemaEnv: sch, + definitions, + data: N.data, + parseName, + char: gen.name("c"), + } + + let sourceCode: string | undefined + try { + this._compilations.add(sch) + sch.parseName = parseName + parserFunction(cxt) + gen.optimize(this.opts.code.optimize) + const parseFuncCode = gen.toString() + sourceCode = `${gen.scopeRefs(N.scope)}return ${parseFuncCode}` + const makeParse = new Function(`${N.scope}`, sourceCode) + const parse: (json: string) => unknown = makeParse(this.scope.get()) + this.scope.value(parseName, {ref: parse}) + sch.parse = parse + } catch (e) { + if (sourceCode) this.logger.error("Error compiling parser, function code:", sourceCode) + delete sch.parse + delete sch.parseName + throw e + } finally { + this._compilations.delete(sch) + } + return sch +} + +const undef = _`undefined` + +function parserFunction(cxt: ParseCxt): void { + const {gen, parseName, char} = cxt + gen.func(parseName, _`${N.json}, ${N.jsonPos}, ${N.jsonPart}`, false, () => { + gen.let(N.data) + gen.let(char) + gen.assign(_`${parseName}.message`, undef) + gen.assign(_`${parseName}.position`, undef) + gen.assign(N.jsonPos, _`${N.jsonPos} || 0`) + gen.const(N.jsonLen, _`${N.json}.length`) + parseCode(cxt) + skipWhitespace(cxt) + gen.if(N.jsonPart, () => { + gen.assign(_`${parseName}.position`, N.jsonPos) + gen.return(N.data) + }) + gen.if(_`${N.jsonPos} === ${N.jsonLen}`, () => gen.return(N.data)) + jsonSyntaxError(cxt) + }) +} + +function parseCode(cxt: ParseCxt): void { + let form: JTDForm | undefined + for (const key of jtdForms) { + if (key in cxt.schema) { + form = key + break + } + } + if (form) parseNullable(cxt, genParse[form]) + else parseEmpty(cxt) +} + +const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError)) + +function parseNullable(cxt: ParseCxt, parseForm: GenParse): void { + const {gen, schema, data} = cxt + if (!schema.nullable) return parseForm(cxt) + tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null)) +} + +function parseElements(cxt: ParseCxt): void { + const {gen, schema, data} = cxt + parseToken(cxt, "[") + const ix = gen.let("i", 0) + gen.assign(data, _`[]`) + parseItems(cxt, "]", () => { + const el = gen.let("el") + parseCode({...cxt, schema: schema.elements, data: el}) + gen.assign(_`${data}[${ix}++]`, el) + }) +} + +function parseValues(cxt: ParseCxt): void { + const {gen, schema, data} = cxt + parseToken(cxt, "{") + gen.assign(data, _`{}`) + parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values)) +} + +function parseItems(cxt: ParseCxt, endToken: string, block: () => void): void { + tryParseItems(cxt, endToken, block) + parseToken(cxt, endToken) +} + +function tryParseItems(cxt: ParseCxt, endToken: string, block: () => void): void { + const {gen} = cxt + gen.for(_`;${N.jsonPos}<${N.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => { + block() + tryParseToken(cxt, ",", () => gen.break(), hasItem) + }) + + function hasItem(): void { + tryParseToken(cxt, endToken, () => {}, jsonSyntaxError) + } +} + +function parseKeyValue(cxt: ParseCxt, schema: SchemaObject): void { + const {gen} = cxt + const key = gen.let("key") + parseString({...cxt, data: key}) + parseToken(cxt, ":") + parsePropertyValue(cxt, key, schema) +} + +function parseDiscriminator(cxt: ParseCxt): void { + const {gen, data, schema} = cxt + const {discriminator, mapping} = schema + parseToken(cxt, "{") + gen.assign(data, _`{}`) + const startPos = gen.const("pos", N.jsonPos) + const value = gen.let("value") + const tag = gen.let("tag") + tryParseItems(cxt, "}", () => { + const key = gen.let("key") + parseString({...cxt, data: key}) + parseToken(cxt, ":") + gen.if( + _`${key} === ${discriminator}`, + () => { + parseString({...cxt, data: tag}) + gen.assign(_`${data}[${key}]`, tag) + gen.break() + }, + () => parseEmpty({...cxt, data: value}) // can be discarded/skipped + ) + }) + gen.assign(N.jsonPos, startPos) + gen.if(_`${tag} === undefined`) + parsingError(cxt, str`discriminator tag not found`) + for (const tagValue in mapping) { + gen.elseIf(_`${tag} === ${tagValue}`) + parseSchemaProperties({...cxt, schema: mapping[tagValue]}, discriminator) + } + gen.else() + parsingError(cxt, str`discriminator value not in schema`) + gen.endIf() +} + +function parseProperties(cxt: ParseCxt): void { + const {gen, data} = cxt + parseToken(cxt, "{") + gen.assign(data, _`{}`) + parseSchemaProperties(cxt) +} + +function parseSchemaProperties(cxt: ParseCxt, discriminator?: string): void { + const {gen, schema, data} = cxt + const {properties, optionalProperties, additionalProperties} = schema + parseItems(cxt, "}", () => { + const key = gen.let("key") + parseString({...cxt, data: key}) + parseToken(cxt, ":") + gen.if(false) + parseDefinedProperty(cxt, key, properties) + parseDefinedProperty(cxt, key, optionalProperties) + if (discriminator) { + gen.elseIf(_`${key} === ${discriminator}`) + const tag = gen.let("tag") + parseString({...cxt, data: tag}) // can be discarded, it is already assigned + } + gen.else() + if (additionalProperties) { + parseEmpty({...cxt, data: _`${data}[${key}]`}) + } else { + parsingError(cxt, str`property ${key} not allowed`) + } + gen.endIf() + }) + if (properties) { + const hasProp = hasPropFunc(gen) + const allProps: Code = and( + ...Object.keys(properties).map((p): Code => _`${hasProp}.call(${data}, ${p})`) + ) + gen.if(not(allProps), () => parsingError(cxt, str`missing required properties`)) + } +} + +function parseDefinedProperty(cxt: ParseCxt, key: Name, schemas: SchemaObjectMap = {}): void { + const {gen} = cxt + for (const prop in schemas) { + gen.elseIf(_`${key} === ${prop}`) + parsePropertyValue(cxt, key, schemas[prop] as SchemaObject) + } +} + +function parsePropertyValue(cxt: ParseCxt, key: Name, schema: SchemaObject): void { + parseCode({...cxt, schema, data: _`${cxt.data}[${key}]`}) +} + +function parseType(cxt: ParseCxt): void { + const {gen, schema, data, self} = cxt + switch (schema.type) { + case "boolean": + parseBoolean(cxt) + break + case "string": + parseString(cxt) + break + case "timestamp": { + parseString(cxt) + const vts = useFunc(gen, validTimestamp) + const {allowDate, parseDate} = self.opts + const notValid = allowDate ? _`!${vts}(${data}, true)` : _`!${vts}(${data})` + const fail: Code = parseDate + ? or(notValid, _`(${data} = new Date(${data}), false)`, _`isNaN(${data}.valueOf())`) + : notValid + gen.if(fail, () => parsingError(cxt, str`invalid timestamp`)) + break + } + case "float32": + case "float64": + parseNumber(cxt) + break + default: { + const t = schema.type as IntType + if (!self.opts.int32range && (t === "int32" || t === "uint32")) { + parseNumber(cxt, 16) // 2 ** 53 - max safe integer + if (t === "uint32") { + gen.if(_`${data} < 0`, () => parsingError(cxt, str`integer out of range`)) + } + } else { + const [min, max, maxDigits] = intRange[t] + parseNumber(cxt, maxDigits) + gen.if(_`${data} < ${min} || ${data} > ${max}`, () => + parsingError(cxt, str`integer out of range`) + ) + } + } + } +} + +function parseString(cxt: ParseCxt): void { + parseToken(cxt, '"') + parseWith(cxt, parseJsonString) +} + +function parseEnum(cxt: ParseCxt): void { + const {gen, data, schema} = cxt + const enumSch = schema.enum + parseToken(cxt, '"') + // TODO loopEnum + gen.if(false) + for (const value of enumSch) { + const valueStr = JSON.stringify(value).slice(1) // remove starting quote + gen.elseIf(_`${jsonSlice(valueStr.length)} === ${valueStr}`) + gen.assign(data, str`${value}`) + gen.add(N.jsonPos, valueStr.length) + } + gen.else() + jsonSyntaxError(cxt) + gen.endIf() +} + +function parseNumber(cxt: ParseCxt, maxDigits?: number): void { + const {gen} = cxt + skipWhitespace(cxt) + gen.if( + _`"-0123456789".indexOf(${jsonSlice(1)}) < 0`, + () => jsonSyntaxError(cxt), + () => parseWith(cxt, parseJsonNumber, maxDigits) + ) +} + +function parseBooleanToken(bool: boolean, fail: GenParse): GenParse { + return (cxt) => { + const {gen, data} = cxt + tryParseToken( + cxt, + `${bool}`, + () => fail(cxt), + () => gen.assign(data, bool) + ) + } +} + +function parseRef(cxt: ParseCxt): void { + const {gen, self, definitions, schema, schemaEnv} = cxt + const {ref} = schema + const refSchema = definitions[ref] + if (!refSchema) throw new MissingRefError(self.opts.uriResolver, "", ref, `No definition ${ref}`) + if (!hasRef(refSchema)) return parseCode({...cxt, schema: refSchema}) + const {root} = schemaEnv + const sch = compileParser.call(self, new SchemaEnv({schema: refSchema, root}), definitions) + partialParse(cxt, getParser(gen, sch), true) +} + +function getParser(gen: CodeGen, sch: SchemaEnv): Code { + return sch.parse + ? gen.scopeValue("parse", {ref: sch.parse}) + : _`${gen.scopeValue("wrapper", {ref: sch})}.parse` +} + +function parseEmpty(cxt: ParseCxt): void { + parseWith(cxt, parseJson) +} + +function parseWith(cxt: ParseCxt, parseFunc: {code: string}, args?: SafeExpr): void { + partialParse(cxt, useFunc(cxt.gen, parseFunc), args) +} + +function partialParse(cxt: ParseCxt, parseFunc: Name, args?: SafeExpr): void { + const {gen, data} = cxt + gen.assign(data, _`${parseFunc}(${N.json}, ${N.jsonPos}${args ? _`, ${args}` : nil})`) + gen.assign(N.jsonPos, _`${parseFunc}.position`) + gen.if(_`${data} === undefined`, () => parsingError(cxt, _`${parseFunc}.message`)) +} + +function parseToken(cxt: ParseCxt, tok: string): void { + tryParseToken(cxt, tok, jsonSyntaxError) +} + +function tryParseToken(cxt: ParseCxt, tok: string, fail: GenParse, success?: GenParse): void { + const {gen} = cxt + const n = tok.length + skipWhitespace(cxt) + gen.if( + _`${jsonSlice(n)} === ${tok}`, + () => { + gen.add(N.jsonPos, n) + success?.(cxt) + }, + () => fail(cxt) + ) +} + +function skipWhitespace({gen, char: c}: ParseCxt): void { + gen.code( + _`while((${c}=${N.json}[${N.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${N.jsonPos}++;` + ) +} + +function jsonSlice(len: number | Name): Code { + return len === 1 + ? _`${N.json}[${N.jsonPos}]` + : _`${N.json}.slice(${N.jsonPos}, ${N.jsonPos}+${len})` +} + +function jsonSyntaxError(cxt: ParseCxt): void { + parsingError(cxt, _`"unexpected token " + ${N.json}[${N.jsonPos}]`) +} + +function parsingError({gen, parseName}: ParseCxt, msg: Code): void { + gen.assign(_`${parseName}.message`, msg) + gen.assign(_`${parseName}.position`, N.jsonPos) + gen.return(undef) +} diff --git a/node_modules/ajv/lib/compile/jtd/serialize.ts b/node_modules/ajv/lib/compile/jtd/serialize.ts new file mode 100644 index 000000000..1d228826d --- /dev/null +++ b/node_modules/ajv/lib/compile/jtd/serialize.ts @@ -0,0 +1,266 @@ +import type Ajv from "../../core" +import type {SchemaObject} from "../../types" +import {jtdForms, JTDForm, SchemaObjectMap} from "./types" +import {SchemaEnv, getCompilingSchema} from ".." +import {_, str, and, getProperty, CodeGen, Code, Name} from "../codegen" +import MissingRefError from "../ref_error" +import N from "../names" +import {isOwnProperty} from "../../vocabularies/code" +import {hasRef} from "../../vocabularies/jtd/ref" +import {useFunc} from "../util" +import quote from "../../runtime/quote" + +const genSerialize: {[F in JTDForm]: (cxt: SerializeCxt) => void} = { + elements: serializeElements, + values: serializeValues, + discriminator: serializeDiscriminator, + properties: serializeProperties, + optionalProperties: serializeProperties, + enum: serializeString, + type: serializeType, + ref: serializeRef, +} + +interface SerializeCxt { + readonly gen: CodeGen + readonly self: Ajv // current Ajv instance + readonly schemaEnv: SchemaEnv + readonly definitions: SchemaObjectMap + schema: SchemaObject + data: Code +} + +export default function compileSerializer( + this: Ajv, + sch: SchemaEnv, + definitions: SchemaObjectMap +): SchemaEnv { + const _sch = getCompilingSchema.call(this, sch) + if (_sch) return _sch + const {es5, lines} = this.opts.code + const {ownProperties} = this.opts + const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) + const serializeName = gen.scopeName("serialize") + const cxt: SerializeCxt = { + self: this, + gen, + schema: sch.schema as SchemaObject, + schemaEnv: sch, + definitions, + data: N.data, + } + + let sourceCode: string | undefined + try { + this._compilations.add(sch) + sch.serializeName = serializeName + gen.func(serializeName, N.data, false, () => { + gen.let(N.json, str``) + serializeCode(cxt) + gen.return(N.json) + }) + gen.optimize(this.opts.code.optimize) + const serializeFuncCode = gen.toString() + sourceCode = `${gen.scopeRefs(N.scope)}return ${serializeFuncCode}` + const makeSerialize = new Function(`${N.scope}`, sourceCode) + const serialize: (data: unknown) => string = makeSerialize(this.scope.get()) + this.scope.value(serializeName, {ref: serialize}) + sch.serialize = serialize + } catch (e) { + if (sourceCode) this.logger.error("Error compiling serializer, function code:", sourceCode) + delete sch.serialize + delete sch.serializeName + throw e + } finally { + this._compilations.delete(sch) + } + return sch +} + +function serializeCode(cxt: SerializeCxt): void { + let form: JTDForm | undefined + for (const key of jtdForms) { + if (key in cxt.schema) { + form = key + break + } + } + serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty) +} + +function serializeNullable(cxt: SerializeCxt, serializeForm: (_cxt: SerializeCxt) => void): void { + const {gen, schema, data} = cxt + if (!schema.nullable) return serializeForm(cxt) + gen.if( + _`${data} === undefined || ${data} === null`, + () => gen.add(N.json, _`"null"`), + () => serializeForm(cxt) + ) +} + +function serializeElements(cxt: SerializeCxt): void { + const {gen, schema, data} = cxt + gen.add(N.json, str`[`) + const first = gen.let("first", true) + gen.forOf("el", data, (el) => { + addComma(cxt, first) + serializeCode({...cxt, schema: schema.elements, data: el}) + }) + gen.add(N.json, str`]`) +} + +function serializeValues(cxt: SerializeCxt): void { + const {gen, schema, data} = cxt + gen.add(N.json, str`{`) + const first = gen.let("first", true) + gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first)) + gen.add(N.json, str`}`) +} + +function serializeKeyValue(cxt: SerializeCxt, key: Name, schema: SchemaObject, first?: Name): void { + const {gen, data} = cxt + addComma(cxt, first) + serializeString({...cxt, data: key}) + gen.add(N.json, str`:`) + const value = gen.const("value", _`${data}${getProperty(key)}`) + serializeCode({...cxt, schema, data: value}) +} + +function serializeDiscriminator(cxt: SerializeCxt): void { + const {gen, schema, data} = cxt + const {discriminator} = schema + gen.add(N.json, str`{${JSON.stringify(discriminator)}:`) + const tag = gen.const("tag", _`${data}${getProperty(discriminator)}`) + serializeString({...cxt, data: tag}) + gen.if(false) + for (const tagValue in schema.mapping) { + gen.elseIf(_`${tag} === ${tagValue}`) + const sch = schema.mapping[tagValue] + serializeSchemaProperties({...cxt, schema: sch}, discriminator) + } + gen.endIf() + gen.add(N.json, str`}`) +} + +function serializeProperties(cxt: SerializeCxt): void { + const {gen} = cxt + gen.add(N.json, str`{`) + serializeSchemaProperties(cxt) + gen.add(N.json, str`}`) +} + +function serializeSchemaProperties(cxt: SerializeCxt, discriminator?: string): void { + const {gen, schema, data} = cxt + const {properties, optionalProperties} = schema + const props = keys(properties) + const optProps = keys(optionalProperties) + const allProps = allProperties(props.concat(optProps)) + let first = !discriminator + let firstProp: Name | undefined + + for (const key of props) { + if (first) first = false + else gen.add(N.json, str`,`) + serializeProperty(key, properties[key], keyValue(key)) + } + if (first) firstProp = gen.let("first", true) + for (const key of optProps) { + const value = keyValue(key) + gen.if(and(_`${value} !== undefined`, isOwnProperty(gen, data, key)), () => { + addComma(cxt, firstProp) + serializeProperty(key, optionalProperties[key], value) + }) + } + if (schema.additionalProperties) { + gen.forIn("key", data, (key) => + gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp)) + ) + } + + function keys(ps?: SchemaObjectMap): string[] { + return ps ? Object.keys(ps) : [] + } + + function allProperties(ps: string[]): string[] { + if (discriminator) ps.push(discriminator) + if (new Set(ps).size !== ps.length) { + throw new Error("JTD: properties/optionalProperties/disciminator overlap") + } + return ps + } + + function keyValue(key: string): Name { + return gen.const("value", _`${data}${getProperty(key)}`) + } + + function serializeProperty(key: string, propSchema: SchemaObject, value: Name): void { + gen.add(N.json, str`${JSON.stringify(key)}:`) + serializeCode({...cxt, schema: propSchema, data: value}) + } + + function isAdditional(key: Name, ps: string[]): Code | true { + return ps.length ? and(...ps.map((p) => _`${key} !== ${p}`)) : true + } +} + +function serializeType(cxt: SerializeCxt): void { + const {gen, schema, data} = cxt + switch (schema.type) { + case "boolean": + gen.add(N.json, _`${data} ? "true" : "false"`) + break + case "string": + serializeString(cxt) + break + case "timestamp": + gen.if( + _`${data} instanceof Date`, + () => gen.add(N.json, _`'"' + ${data}.toISOString() + '"'`), + () => serializeString(cxt) + ) + break + default: + serializeNumber(cxt) + } +} + +function serializeString({gen, data}: SerializeCxt): void { + gen.add(N.json, _`${useFunc(gen, quote)}(${data})`) +} + +function serializeNumber({gen, data}: SerializeCxt): void { + gen.add(N.json, _`"" + ${data}`) +} + +function serializeRef(cxt: SerializeCxt): void { + const {gen, self, data, definitions, schema, schemaEnv} = cxt + const {ref} = schema + const refSchema = definitions[ref] + if (!refSchema) throw new MissingRefError(self.opts.uriResolver, "", ref, `No definition ${ref}`) + if (!hasRef(refSchema)) return serializeCode({...cxt, schema: refSchema}) + const {root} = schemaEnv + const sch = compileSerializer.call(self, new SchemaEnv({schema: refSchema, root}), definitions) + gen.add(N.json, _`${getSerialize(gen, sch)}(${data})`) +} + +function getSerialize(gen: CodeGen, sch: SchemaEnv): Code { + return sch.serialize + ? gen.scopeValue("serialize", {ref: sch.serialize}) + : _`${gen.scopeValue("wrapper", {ref: sch})}.serialize` +} + +function serializeEmpty({gen, data}: SerializeCxt): void { + gen.add(N.json, _`JSON.stringify(${data})`) +} + +function addComma({gen}: SerializeCxt, first?: Name): void { + if (first) { + gen.if( + first, + () => gen.assign(first, false), + () => gen.add(N.json, str`,`) + ) + } else { + gen.add(N.json, str`,`) + } +} diff --git a/node_modules/ajv/lib/compile/jtd/types.ts b/node_modules/ajv/lib/compile/jtd/types.ts new file mode 100644 index 000000000..7f3619576 --- /dev/null +++ b/node_modules/ajv/lib/compile/jtd/types.ts @@ -0,0 +1,16 @@ +import type {SchemaObject} from "../../types" + +export type SchemaObjectMap = {[Ref in string]?: SchemaObject} + +export const jtdForms = [ + "elements", + "values", + "discriminator", + "properties", + "optionalProperties", + "enum", + "type", + "ref", +] as const + +export type JTDForm = typeof jtdForms[number] diff --git a/node_modules/ajv/lib/compile/names.ts b/node_modules/ajv/lib/compile/names.ts new file mode 100644 index 000000000..b4b242e17 --- /dev/null +++ b/node_modules/ajv/lib/compile/names.ts @@ -0,0 +1,27 @@ +import {Name} from "./codegen" + +const names = { + // validation function arguments + data: new Name("data"), // data passed to validation function + // args passed from referencing schema + valCxt: new Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below + instancePath: new Name("instancePath"), + parentData: new Name("parentData"), + parentDataProperty: new Name("parentDataProperty"), + rootData: new Name("rootData"), // root data - same as the data passed to the first/top validation function + dynamicAnchors: new Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef + // function scoped variables + vErrors: new Name("vErrors"), // null or array of validation errors + errors: new Name("errors"), // counter of validation errors + this: new Name("this"), + // "globals" + self: new Name("self"), + scope: new Name("scope"), + // JTD serialize/parse name for JSON string and position + json: new Name("json"), + jsonPos: new Name("jsonPos"), + jsonLen: new Name("jsonLen"), + jsonPart: new Name("jsonPart"), +} + +export default names diff --git a/node_modules/ajv/lib/compile/ref_error.ts b/node_modules/ajv/lib/compile/ref_error.ts new file mode 100644 index 000000000..386bf0499 --- /dev/null +++ b/node_modules/ajv/lib/compile/ref_error.ts @@ -0,0 +1,13 @@ +import {resolveUrl, normalizeId, getFullPath} from "./resolve" +import type {UriResolver} from "../types" + +export default class MissingRefError extends Error { + readonly missingRef: string + readonly missingSchema: string + + constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string) { + super(msg || `can't resolve reference ${ref} from id ${baseId}`) + this.missingRef = resolveUrl(resolver, baseId, ref) + this.missingSchema = normalizeId(getFullPath(resolver, this.missingRef)) + } +} diff --git a/node_modules/ajv/lib/compile/resolve.ts b/node_modules/ajv/lib/compile/resolve.ts new file mode 100644 index 000000000..4360eab06 --- /dev/null +++ b/node_modules/ajv/lib/compile/resolve.ts @@ -0,0 +1,149 @@ +import type {AnySchema, AnySchemaObject, UriResolver} from "../types" +import type Ajv from "../ajv" +import type {URIComponents} from "uri-js" +import {eachItem} from "./util" +import * as equal from "fast-deep-equal" +import * as traverse from "json-schema-traverse" + +// the hash of local references inside the schema (created by getSchemaRefs), used for inline resolution +export type LocalRefs = {[Ref in string]?: AnySchemaObject} + +// TODO refactor to use keyword definitions +const SIMPLE_INLINED = new Set([ + "type", + "format", + "pattern", + "maxLength", + "minLength", + "maxProperties", + "minProperties", + "maxItems", + "minItems", + "maximum", + "minimum", + "uniqueItems", + "multipleOf", + "required", + "enum", + "const", +]) + +export function inlineRef(schema: AnySchema, limit: boolean | number = true): boolean { + if (typeof schema == "boolean") return true + if (limit === true) return !hasRef(schema) + if (!limit) return false + return countKeys(schema) <= limit +} + +const REF_KEYWORDS = new Set([ + "$ref", + "$recursiveRef", + "$recursiveAnchor", + "$dynamicRef", + "$dynamicAnchor", +]) + +function hasRef(schema: AnySchemaObject): boolean { + for (const key in schema) { + if (REF_KEYWORDS.has(key)) return true + const sch = schema[key] + if (Array.isArray(sch) && sch.some(hasRef)) return true + if (typeof sch == "object" && hasRef(sch)) return true + } + return false +} + +function countKeys(schema: AnySchemaObject): number { + let count = 0 + for (const key in schema) { + if (key === "$ref") return Infinity + count++ + if (SIMPLE_INLINED.has(key)) continue + if (typeof schema[key] == "object") { + eachItem(schema[key], (sch) => (count += countKeys(sch))) + } + if (count === Infinity) return Infinity + } + return count +} + +export function getFullPath(resolver: UriResolver, id = "", normalize?: boolean): string { + if (normalize !== false) id = normalizeId(id) + const p = resolver.parse(id) + return _getFullPath(resolver, p) +} + +export function _getFullPath(resolver: UriResolver, p: URIComponents): string { + const serialized = resolver.serialize(p) + return serialized.split("#")[0] + "#" +} + +const TRAILING_SLASH_HASH = /#\/?$/ +export function normalizeId(id: string | undefined): string { + return id ? id.replace(TRAILING_SLASH_HASH, "") : "" +} + +export function resolveUrl(resolver: UriResolver, baseId: string, id: string): string { + id = normalizeId(id) + return resolver.resolve(baseId, id) +} + +const ANCHOR = /^[a-z_][-a-z0-9._]*$/i + +export function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs { + if (typeof schema == "boolean") return {} + const {schemaId, uriResolver} = this.opts + const schId = normalizeId(schema[schemaId] || baseId) + const baseIds: {[JsonPtr in string]?: string} = {"": schId} + const pathPrefix = getFullPath(uriResolver, schId, false) + const localRefs: LocalRefs = {} + const schemaRefs: Set = new Set() + + traverse(schema, {allKeys: true}, (sch, jsonPtr, _, parentJsonPtr) => { + if (parentJsonPtr === undefined) return + const fullPath = pathPrefix + jsonPtr + let baseId = baseIds[parentJsonPtr] + if (typeof sch[schemaId] == "string") baseId = addRef.call(this, sch[schemaId]) + addAnchor.call(this, sch.$anchor) + addAnchor.call(this, sch.$dynamicAnchor) + baseIds[jsonPtr] = baseId + + function addRef(this: Ajv, ref: string): string { + // eslint-disable-next-line @typescript-eslint/unbound-method + const _resolve = this.opts.uriResolver.resolve + ref = normalizeId(baseId ? _resolve(baseId, ref) : ref) + if (schemaRefs.has(ref)) throw ambiguos(ref) + schemaRefs.add(ref) + let schOrRef = this.refs[ref] + if (typeof schOrRef == "string") schOrRef = this.refs[schOrRef] + if (typeof schOrRef == "object") { + checkAmbiguosRef(sch, schOrRef.schema, ref) + } else if (ref !== normalizeId(fullPath)) { + if (ref[0] === "#") { + checkAmbiguosRef(sch, localRefs[ref], ref) + localRefs[ref] = sch + } else { + this.refs[ref] = fullPath + } + } + return ref + } + + function addAnchor(this: Ajv, anchor: unknown): void { + if (typeof anchor == "string") { + if (!ANCHOR.test(anchor)) throw new Error(`invalid anchor "${anchor}"`) + addRef.call(this, `#${anchor}`) + } + } + }) + + return localRefs + + function checkAmbiguosRef(sch1: AnySchema, sch2: AnySchema | undefined, ref: string): void { + if (sch2 !== undefined && !equal(sch1, sch2)) throw ambiguos(ref) + } + + function ambiguos(ref: string): Error { + return new Error(`reference "${ref}" resolves to more than one schema`) + } +} diff --git a/node_modules/ajv/lib/compile/rules.ts b/node_modules/ajv/lib/compile/rules.ts new file mode 100644 index 000000000..ea65074f9 --- /dev/null +++ b/node_modules/ajv/lib/compile/rules.ts @@ -0,0 +1,50 @@ +import type {AddedKeywordDefinition} from "../types" + +const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"] as const + +export type JSONType = typeof _jsonTypes[number] + +const jsonTypes: Set = new Set(_jsonTypes) + +export function isJSONType(x: unknown): x is JSONType { + return typeof x == "string" && jsonTypes.has(x) +} + +type ValidationTypes = { + [K in JSONType]: boolean | RuleGroup | undefined +} + +export interface ValidationRules { + rules: RuleGroup[] + post: RuleGroup + all: {[Key in string]?: boolean | Rule} // rules that have to be validated + keywords: {[Key in string]?: boolean} // all known keywords (superset of "all") + types: ValidationTypes +} + +export interface RuleGroup { + type?: JSONType + rules: Rule[] +} + +// This interface wraps KeywordDefinition because definition can have multiple keywords +export interface Rule { + keyword: string + definition: AddedKeywordDefinition +} + +export function getRules(): ValidationRules { + const groups: Record<"number" | "string" | "array" | "object", RuleGroup> = { + number: {type: "number", rules: []}, + string: {type: "string", rules: []}, + array: {type: "array", rules: []}, + object: {type: "object", rules: []}, + } + return { + types: {...groups, integer: true, boolean: true, null: true}, + rules: [{rules: []}, groups.number, groups.string, groups.array, groups.object], + post: {rules: []}, + all: {}, + keywords: {}, + } +} diff --git a/node_modules/ajv/lib/compile/util.ts b/node_modules/ajv/lib/compile/util.ts new file mode 100644 index 000000000..cefae51c2 --- /dev/null +++ b/node_modules/ajv/lib/compile/util.ts @@ -0,0 +1,213 @@ +import type {AnySchema, EvaluatedProperties, EvaluatedItems} from "../types" +import type {SchemaCxt, SchemaObjCxt} from "." +import {_, getProperty, Code, Name, CodeGen} from "./codegen" +import {_Code} from "./codegen/code" +import type {Rule, ValidationRules} from "./rules" + +// TODO refactor to use Set +export function toHash(arr: T[]): {[K in T]?: true} { + const hash: {[K in T]?: true} = {} + for (const item of arr) hash[item] = true + return hash +} + +export function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void { + if (typeof schema == "boolean") return schema + if (Object.keys(schema).length === 0) return true + checkUnknownRules(it, schema) + return !schemaHasRules(schema, it.self.RULES.all) +} + +export function checkUnknownRules(it: SchemaCxt, schema: AnySchema = it.schema): void { + const {opts, self} = it + if (!opts.strictSchema) return + if (typeof schema === "boolean") return + const rules = self.RULES.keywords + for (const key in schema) { + if (!rules[key]) checkStrictMode(it, `unknown keyword: "${key}"`) + } +} + +export function schemaHasRules( + schema: AnySchema, + rules: {[Key in string]?: boolean | Rule} +): boolean { + if (typeof schema == "boolean") return !schema + for (const key in schema) if (rules[key]) return true + return false +} + +export function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean { + if (typeof schema == "boolean") return !schema + for (const key in schema) if (key !== "$ref" && RULES.all[key]) return true + return false +} + +export function schemaRefOrVal( + {topSchemaRef, schemaPath}: SchemaObjCxt, + schema: unknown, + keyword: string, + $data?: string | false +): Code | number | boolean { + if (!$data) { + if (typeof schema == "number" || typeof schema == "boolean") return schema + if (typeof schema == "string") return _`${schema}` + } + return _`${topSchemaRef}${schemaPath}${getProperty(keyword)}` +} + +export function unescapeFragment(str: string): string { + return unescapeJsonPointer(decodeURIComponent(str)) +} + +export function escapeFragment(str: string | number): string { + return encodeURIComponent(escapeJsonPointer(str)) +} + +export function escapeJsonPointer(str: string | number): string { + if (typeof str == "number") return `${str}` + return str.replace(/~/g, "~0").replace(/\//g, "~1") +} + +export function unescapeJsonPointer(str: string): string { + return str.replace(/~1/g, "/").replace(/~0/g, "~") +} + +export function eachItem(xs: T | T[], f: (x: T) => void): void { + if (Array.isArray(xs)) { + for (const x of xs) f(x) + } else { + f(xs) + } +} + +type SomeEvaluated = EvaluatedProperties | EvaluatedItems + +type MergeEvaluatedFunc = ( + gen: CodeGen, + from: Name | T, + to: Name | Exclude | undefined, + toName?: typeof Name +) => Name | T + +interface MakeMergeFuncArgs { + mergeNames: (gen: CodeGen, from: Name, to: Name) => void + mergeToName: (gen: CodeGen, from: T, to: Name) => void + mergeValues: (from: T, to: Exclude) => T + resultToName: (gen: CodeGen, res?: T) => Name +} + +function makeMergeEvaluated({ + mergeNames, + mergeToName, + mergeValues, + resultToName, +}: MakeMergeFuncArgs): MergeEvaluatedFunc { + return (gen, from, to, toName) => { + const res = + to === undefined + ? from + : to instanceof Name + ? (from instanceof Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) + : from instanceof Name + ? (mergeToName(gen, to, from), from) + : mergeValues(from, to) + return toName === Name && !(res instanceof Name) ? resultToName(gen, res) : res + } +} + +interface MergeEvaluated { + props: MergeEvaluatedFunc + items: MergeEvaluatedFunc +} + +export const mergeEvaluated: MergeEvaluated = { + props: makeMergeEvaluated({ + mergeNames: (gen, from, to) => + gen.if(_`${to} !== true && ${from} !== undefined`, () => { + gen.if( + _`${from} === true`, + () => gen.assign(to, true), + () => gen.assign(to, _`${to} || {}`).code(_`Object.assign(${to}, ${from})`) + ) + }), + mergeToName: (gen, from, to) => + gen.if(_`${to} !== true`, () => { + if (from === true) { + gen.assign(to, true) + } else { + gen.assign(to, _`${to} || {}`) + setEvaluated(gen, to, from) + } + }), + mergeValues: (from, to) => (from === true ? true : {...from, ...to}), + resultToName: evaluatedPropsToName, + }), + items: makeMergeEvaluated({ + mergeNames: (gen, from, to) => + gen.if(_`${to} !== true && ${from} !== undefined`, () => + gen.assign(to, _`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`) + ), + mergeToName: (gen, from, to) => + gen.if(_`${to} !== true`, () => + gen.assign(to, from === true ? true : _`${to} > ${from} ? ${to} : ${from}`) + ), + mergeValues: (from, to) => (from === true ? true : Math.max(from, to)), + resultToName: (gen, items) => gen.var("items", items), + }), +} + +export function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name { + if (ps === true) return gen.var("props", true) + const props = gen.var("props", _`{}`) + if (ps !== undefined) setEvaluated(gen, props, ps) + return props +} + +export function setEvaluated(gen: CodeGen, props: Name, ps: {[K in string]?: true}): void { + Object.keys(ps).forEach((p) => gen.assign(_`${props}${getProperty(p)}`, true)) +} + +const snippets: {[S in string]?: _Code} = {} + +export function useFunc(gen: CodeGen, f: {code: string}): Name { + return gen.scopeValue("func", { + ref: f, + code: snippets[f.code] || (snippets[f.code] = new _Code(f.code)), + }) +} + +export enum Type { + Num, + Str, +} + +export function getErrorPath( + dataProp: Name | string | number, + dataPropType?: Type, + jsPropertySyntax?: boolean +): Code | string { + // let path + if (dataProp instanceof Name) { + const isNumber = dataPropType === Type.Num + return jsPropertySyntax + ? isNumber + ? _`"[" + ${dataProp} + "]"` + : _`"['" + ${dataProp} + "']"` + : isNumber + ? _`"/" + ${dataProp}` + : _`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")` // TODO maybe use global escapePointer + } + return jsPropertySyntax ? getProperty(dataProp).toString() : "/" + escapeJsonPointer(dataProp) +} + +export function checkStrictMode( + it: SchemaCxt, + msg: string, + mode: boolean | "log" = it.opts.strictSchema +): void { + if (!mode) return + msg = `strict mode: ${msg}` + if (mode === true) throw new Error(msg) + it.self.logger.warn(msg) +} diff --git a/node_modules/ajv/lib/compile/validate/applicability.ts b/node_modules/ajv/lib/compile/validate/applicability.ts new file mode 100644 index 000000000..478b704ac --- /dev/null +++ b/node_modules/ajv/lib/compile/validate/applicability.ts @@ -0,0 +1,22 @@ +import type {AnySchemaObject} from "../../types" +import type {SchemaObjCxt} from ".." +import type {JSONType, RuleGroup, Rule} from "../rules" + +export function schemaHasRulesForType( + {schema, self}: SchemaObjCxt, + type: JSONType +): boolean | undefined { + const group = self.RULES.types[type] + return group && group !== true && shouldUseGroup(schema, group) +} + +export function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean { + return group.rules.some((rule) => shouldUseRule(schema, rule)) +} + +export function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined { + return ( + schema[rule.keyword] !== undefined || + rule.definition.implements?.some((kwd) => schema[kwd] !== undefined) + ) +} diff --git a/node_modules/ajv/lib/compile/validate/boolSchema.ts b/node_modules/ajv/lib/compile/validate/boolSchema.ts new file mode 100644 index 000000000..156355016 --- /dev/null +++ b/node_modules/ajv/lib/compile/validate/boolSchema.ts @@ -0,0 +1,47 @@ +import type {KeywordErrorDefinition, KeywordErrorCxt} from "../../types" +import type {SchemaCxt} from ".." +import {reportError} from "../errors" +import {_, Name} from "../codegen" +import N from "../names" + +const boolError: KeywordErrorDefinition = { + message: "boolean schema is false", +} + +export function topBoolOrEmptySchema(it: SchemaCxt): void { + const {gen, schema, validateName} = it + if (schema === false) { + falseSchemaError(it, false) + } else if (typeof schema == "object" && schema.$async === true) { + gen.return(N.data) + } else { + gen.assign(_`${validateName}.errors`, null) + gen.return(true) + } +} + +export function boolOrEmptySchema(it: SchemaCxt, valid: Name): void { + const {gen, schema} = it + if (schema === false) { + gen.var(valid, false) // TODO var + falseSchemaError(it) + } else { + gen.var(valid, true) // TODO var + } +} + +function falseSchemaError(it: SchemaCxt, overrideAllErrors?: boolean): void { + const {gen, data} = it + // TODO maybe some other interface should be used for non-keyword validation errors... + const cxt: KeywordErrorCxt = { + gen, + keyword: "false schema", + data, + schema: false, + schemaCode: false, + schemaValue: false, + params: {}, + it, + } + reportError(cxt, boolError, undefined, overrideAllErrors) +} diff --git a/node_modules/ajv/lib/compile/validate/dataType.ts b/node_modules/ajv/lib/compile/validate/dataType.ts new file mode 100644 index 000000000..b315c2ce9 --- /dev/null +++ b/node_modules/ajv/lib/compile/validate/dataType.ts @@ -0,0 +1,229 @@ +import type { + KeywordErrorDefinition, + KeywordErrorCxt, + ErrorObject, + AnySchemaObject, +} from "../../types" +import type {SchemaObjCxt} from ".." +import {isJSONType, JSONType} from "../rules" +import {schemaHasRulesForType} from "./applicability" +import {reportError} from "../errors" +import {_, nil, and, not, operators, Code, Name} from "../codegen" +import {toHash, schemaRefOrVal} from "../util" + +export enum DataType { + Correct, + Wrong, +} + +export function getSchemaTypes(schema: AnySchemaObject): JSONType[] { + const types = getJSONTypes(schema.type) + const hasNull = types.includes("null") + if (hasNull) { + if (schema.nullable === false) throw new Error("type: null contradicts nullable: false") + } else { + if (!types.length && schema.nullable !== undefined) { + throw new Error('"nullable" cannot be used without "type"') + } + if (schema.nullable === true) types.push("null") + } + return types +} + +export function getJSONTypes(ts: unknown | unknown[]): JSONType[] { + const types: unknown[] = Array.isArray(ts) ? ts : ts ? [ts] : [] + if (types.every(isJSONType)) return types + throw new Error("type must be JSONType or JSONType[]: " + types.join(",")) +} + +export function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean { + const {gen, data, opts} = it + const coerceTo = coerceToTypes(types, opts.coerceTypes) + const checkTypes = + types.length > 0 && + !(coerceTo.length === 0 && types.length === 1 && schemaHasRulesForType(it, types[0])) + if (checkTypes) { + const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong) + gen.if(wrongType, () => { + if (coerceTo.length) coerceData(it, types, coerceTo) + else reportTypeError(it) + }) + } + return checkTypes +} + +const COERCIBLE: Set = new Set(["string", "number", "integer", "boolean", "null"]) +function coerceToTypes(types: JSONType[], coerceTypes?: boolean | "array"): JSONType[] { + return coerceTypes + ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array")) + : [] +} + +function coerceData(it: SchemaObjCxt, types: JSONType[], coerceTo: JSONType[]): void { + const {gen, data, opts} = it + const dataType = gen.let("dataType", _`typeof ${data}`) + const coerced = gen.let("coerced", _`undefined`) + if (opts.coerceTypes === "array") { + gen.if(_`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => + gen + .assign(data, _`${data}[0]`) + .assign(dataType, _`typeof ${data}`) + .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)) + ) + } + gen.if(_`${coerced} !== undefined`) + for (const t of coerceTo) { + if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) { + coerceSpecificType(t) + } + } + gen.else() + reportTypeError(it) + gen.endIf() + + gen.if(_`${coerced} !== undefined`, () => { + gen.assign(data, coerced) + assignParentData(it, coerced) + }) + + function coerceSpecificType(t: string): void { + switch (t) { + case "string": + gen + .elseIf(_`${dataType} == "number" || ${dataType} == "boolean"`) + .assign(coerced, _`"" + ${data}`) + .elseIf(_`${data} === null`) + .assign(coerced, _`""`) + return + case "number": + gen + .elseIf( + _`${dataType} == "boolean" || ${data} === null + || (${dataType} == "string" && ${data} && ${data} == +${data})` + ) + .assign(coerced, _`+${data}`) + return + case "integer": + gen + .elseIf( + _`${dataType} === "boolean" || ${data} === null + || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))` + ) + .assign(coerced, _`+${data}`) + return + case "boolean": + gen + .elseIf(_`${data} === "false" || ${data} === 0 || ${data} === null`) + .assign(coerced, false) + .elseIf(_`${data} === "true" || ${data} === 1`) + .assign(coerced, true) + return + case "null": + gen.elseIf(_`${data} === "" || ${data} === 0 || ${data} === false`) + gen.assign(coerced, null) + return + + case "array": + gen + .elseIf( + _`${dataType} === "string" || ${dataType} === "number" + || ${dataType} === "boolean" || ${data} === null` + ) + .assign(coerced, _`[${data}]`) + } + } +} + +function assignParentData({gen, parentData, parentDataProperty}: SchemaObjCxt, expr: Name): void { + // TODO use gen.property + gen.if(_`${parentData} !== undefined`, () => + gen.assign(_`${parentData}[${parentDataProperty}]`, expr) + ) +} + +export function checkDataType( + dataType: JSONType, + data: Name, + strictNums?: boolean | "log", + correct = DataType.Correct +): Code { + const EQ = correct === DataType.Correct ? operators.EQ : operators.NEQ + let cond: Code + switch (dataType) { + case "null": + return _`${data} ${EQ} null` + case "array": + cond = _`Array.isArray(${data})` + break + case "object": + cond = _`${data} && typeof ${data} == "object" && !Array.isArray(${data})` + break + case "integer": + cond = numCond(_`!(${data} % 1) && !isNaN(${data})`) + break + case "number": + cond = numCond() + break + default: + return _`typeof ${data} ${EQ} ${dataType}` + } + return correct === DataType.Correct ? cond : not(cond) + + function numCond(_cond: Code = nil): Code { + return and(_`typeof ${data} == "number"`, _cond, strictNums ? _`isFinite(${data})` : nil) + } +} + +export function checkDataTypes( + dataTypes: JSONType[], + data: Name, + strictNums?: boolean | "log", + correct?: DataType +): Code { + if (dataTypes.length === 1) { + return checkDataType(dataTypes[0], data, strictNums, correct) + } + let cond: Code + const types = toHash(dataTypes) + if (types.array && types.object) { + const notObj = _`typeof ${data} != "object"` + cond = types.null ? notObj : _`!${data} || ${notObj}` + delete types.null + delete types.array + delete types.object + } else { + cond = nil + } + if (types.number) delete types.integer + for (const t in types) cond = and(cond, checkDataType(t as JSONType, data, strictNums, correct)) + return cond +} + +export type TypeError = ErrorObject<"type", {type: string}> + +const typeError: KeywordErrorDefinition = { + message: ({schema}) => `must be ${schema}`, + params: ({schema, schemaValue}) => + typeof schema == "string" ? _`{type: ${schema}}` : _`{type: ${schemaValue}}`, +} + +export function reportTypeError(it: SchemaObjCxt): void { + const cxt = getTypeErrorContext(it) + reportError(cxt, typeError) +} + +function getTypeErrorContext(it: SchemaObjCxt): KeywordErrorCxt { + const {gen, data, schema} = it + const schemaCode = schemaRefOrVal(it, schema, "type") + return { + gen, + keyword: "type", + data, + schema: schema.type, + schemaCode, + schemaValue: schemaCode, + parentSchema: schema, + params: {}, + it, + } +} diff --git a/node_modules/ajv/lib/compile/validate/defaults.ts b/node_modules/ajv/lib/compile/validate/defaults.ts new file mode 100644 index 000000000..2ad3d4df8 --- /dev/null +++ b/node_modules/ajv/lib/compile/validate/defaults.ts @@ -0,0 +1,32 @@ +import type {SchemaObjCxt} from ".." +import {_, getProperty, stringify} from "../codegen" +import {checkStrictMode} from "../util" + +export function assignDefaults(it: SchemaObjCxt, ty?: string): void { + const {properties, items} = it.schema + if (ty === "object" && properties) { + for (const key in properties) { + assignDefault(it, key, properties[key].default) + } + } else if (ty === "array" && Array.isArray(items)) { + items.forEach((sch, i: number) => assignDefault(it, i, sch.default)) + } +} + +function assignDefault(it: SchemaObjCxt, prop: string | number, defaultValue: unknown): void { + const {gen, compositeRule, data, opts} = it + if (defaultValue === undefined) return + const childData = _`${data}${getProperty(prop)}` + if (compositeRule) { + checkStrictMode(it, `default is ignored for: ${childData}`) + return + } + + let condition = _`${childData} === undefined` + if (opts.useDefaults === "empty") { + condition = _`${condition} || ${childData} === null || ${childData} === ""` + } + // `${childData} === undefined` + + // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "") + gen.if(condition, _`${childData} = ${stringify(defaultValue)}`) +} diff --git a/node_modules/ajv/lib/compile/validate/index.ts b/node_modules/ajv/lib/compile/validate/index.ts new file mode 100644 index 000000000..15ecabd85 --- /dev/null +++ b/node_modules/ajv/lib/compile/validate/index.ts @@ -0,0 +1,582 @@ +import type { + AddedKeywordDefinition, + AnySchema, + AnySchemaObject, + KeywordErrorCxt, + KeywordCxtParams, +} from "../../types" +import type {SchemaCxt, SchemaObjCxt} from ".." +import type {InstanceOptions} from "../../core" +import {boolOrEmptySchema, topBoolOrEmptySchema} from "./boolSchema" +import {coerceAndCheckDataType, getSchemaTypes} from "./dataType" +import {shouldUseGroup, shouldUseRule} from "./applicability" +import {checkDataType, checkDataTypes, reportTypeError, DataType} from "./dataType" +import {assignDefaults} from "./defaults" +import {funcKeywordCode, macroKeywordCode, validateKeywordUsage, validSchemaType} from "./keyword" +import {getSubschema, extendSubschemaData, SubschemaArgs, extendSubschemaMode} from "./subschema" +import {_, nil, str, or, not, getProperty, Block, Code, Name, CodeGen} from "../codegen" +import N from "../names" +import {resolveUrl} from "../resolve" +import { + schemaRefOrVal, + schemaHasRulesButRef, + checkUnknownRules, + checkStrictMode, + unescapeJsonPointer, + mergeEvaluated, +} from "../util" +import type {JSONType, Rule, RuleGroup} from "../rules" +import { + ErrorPaths, + reportError, + reportExtraError, + resetErrorsCount, + keyword$DataError, +} from "../errors" + +// schema compilation - generates validation function, subschemaCode (below) is used for subschemas +export function validateFunctionCode(it: SchemaCxt): void { + if (isSchemaObj(it)) { + checkKeywords(it) + if (schemaCxtHasRules(it)) { + topSchemaObjCode(it) + return + } + } + validateFunction(it, () => topBoolOrEmptySchema(it)) +} + +function validateFunction( + {gen, validateName, schema, schemaEnv, opts}: SchemaCxt, + body: Block +): void { + if (opts.code.es5) { + gen.func(validateName, _`${N.data}, ${N.valCxt}`, schemaEnv.$async, () => { + gen.code(_`"use strict"; ${funcSourceUrl(schema, opts)}`) + destructureValCxtES5(gen, opts) + gen.code(body) + }) + } else { + gen.func(validateName, _`${N.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => + gen.code(funcSourceUrl(schema, opts)).code(body) + ) + } +} + +function destructureValCxt(opts: InstanceOptions): Code { + return _`{${N.instancePath}="", ${N.parentData}, ${N.parentDataProperty}, ${N.rootData}=${ + N.data + }${opts.dynamicRef ? _`, ${N.dynamicAnchors}={}` : nil}}={}` +} + +function destructureValCxtES5(gen: CodeGen, opts: InstanceOptions): void { + gen.if( + N.valCxt, + () => { + gen.var(N.instancePath, _`${N.valCxt}.${N.instancePath}`) + gen.var(N.parentData, _`${N.valCxt}.${N.parentData}`) + gen.var(N.parentDataProperty, _`${N.valCxt}.${N.parentDataProperty}`) + gen.var(N.rootData, _`${N.valCxt}.${N.rootData}`) + if (opts.dynamicRef) gen.var(N.dynamicAnchors, _`${N.valCxt}.${N.dynamicAnchors}`) + }, + () => { + gen.var(N.instancePath, _`""`) + gen.var(N.parentData, _`undefined`) + gen.var(N.parentDataProperty, _`undefined`) + gen.var(N.rootData, N.data) + if (opts.dynamicRef) gen.var(N.dynamicAnchors, _`{}`) + } + ) +} + +function topSchemaObjCode(it: SchemaObjCxt): void { + const {schema, opts, gen} = it + validateFunction(it, () => { + if (opts.$comment && schema.$comment) commentKeyword(it) + checkNoDefault(it) + gen.let(N.vErrors, null) + gen.let(N.errors, 0) + if (opts.unevaluated) resetEvaluated(it) + typeAndKeywords(it) + returnResults(it) + }) + return +} + +function resetEvaluated(it: SchemaObjCxt): void { + // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated + const {gen, validateName} = it + it.evaluated = gen.const("evaluated", _`${validateName}.evaluated`) + gen.if(_`${it.evaluated}.dynamicProps`, () => gen.assign(_`${it.evaluated}.props`, _`undefined`)) + gen.if(_`${it.evaluated}.dynamicItems`, () => gen.assign(_`${it.evaluated}.items`, _`undefined`)) +} + +function funcSourceUrl(schema: AnySchema, opts: InstanceOptions): Code { + const schId = typeof schema == "object" && schema[opts.schemaId] + return schId && (opts.code.source || opts.code.process) ? _`/*# sourceURL=${schId} */` : nil +} + +// schema compilation - this function is used recursively to generate code for sub-schemas +function subschemaCode(it: SchemaCxt, valid: Name): void { + if (isSchemaObj(it)) { + checkKeywords(it) + if (schemaCxtHasRules(it)) { + subSchemaObjCode(it, valid) + return + } + } + boolOrEmptySchema(it, valid) +} + +function schemaCxtHasRules({schema, self}: SchemaCxt): boolean { + if (typeof schema == "boolean") return !schema + for (const key in schema) if (self.RULES.all[key]) return true + return false +} + +function isSchemaObj(it: SchemaCxt): it is SchemaObjCxt { + return typeof it.schema != "boolean" +} + +function subSchemaObjCode(it: SchemaObjCxt, valid: Name): void { + const {schema, gen, opts} = it + if (opts.$comment && schema.$comment) commentKeyword(it) + updateContext(it) + checkAsyncSchema(it) + const errsCount = gen.const("_errs", N.errors) + typeAndKeywords(it, errsCount) + // TODO var + gen.var(valid, _`${errsCount} === ${N.errors}`) +} + +function checkKeywords(it: SchemaObjCxt): void { + checkUnknownRules(it) + checkRefsAndKeywords(it) +} + +function typeAndKeywords(it: SchemaObjCxt, errsCount?: Name): void { + if (it.opts.jtd) return schemaKeywords(it, [], false, errsCount) + const types = getSchemaTypes(it.schema) + const checkedTypes = coerceAndCheckDataType(it, types) + schemaKeywords(it, types, !checkedTypes, errsCount) +} + +function checkRefsAndKeywords(it: SchemaObjCxt): void { + const {schema, errSchemaPath, opts, self} = it + if (schema.$ref && opts.ignoreKeywordsWithRef && schemaHasRulesButRef(schema, self.RULES)) { + self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`) + } +} + +function checkNoDefault(it: SchemaObjCxt): void { + const {schema, opts} = it + if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) { + checkStrictMode(it, "default is ignored in the schema root") + } +} + +function updateContext(it: SchemaObjCxt): void { + const schId = it.schema[it.opts.schemaId] + if (schId) it.baseId = resolveUrl(it.opts.uriResolver, it.baseId, schId) +} + +function checkAsyncSchema(it: SchemaObjCxt): void { + if (it.schema.$async && !it.schemaEnv.$async) throw new Error("async schema in sync schema") +} + +function commentKeyword({gen, schemaEnv, schema, errSchemaPath, opts}: SchemaObjCxt): void { + const msg = schema.$comment + if (opts.$comment === true) { + gen.code(_`${N.self}.logger.log(${msg})`) + } else if (typeof opts.$comment == "function") { + const schemaPath = str`${errSchemaPath}/$comment` + const rootName = gen.scopeValue("root", {ref: schemaEnv.root}) + gen.code(_`${N.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`) + } +} + +function returnResults(it: SchemaCxt): void { + const {gen, schemaEnv, validateName, ValidationError, opts} = it + if (schemaEnv.$async) { + // TODO assign unevaluated + gen.if( + _`${N.errors} === 0`, + () => gen.return(N.data), + () => gen.throw(_`new ${ValidationError as Name}(${N.vErrors})`) + ) + } else { + gen.assign(_`${validateName}.errors`, N.vErrors) + if (opts.unevaluated) assignEvaluated(it) + gen.return(_`${N.errors} === 0`) + } +} + +function assignEvaluated({gen, evaluated, props, items}: SchemaCxt): void { + if (props instanceof Name) gen.assign(_`${evaluated}.props`, props) + if (items instanceof Name) gen.assign(_`${evaluated}.items`, items) +} + +function schemaKeywords( + it: SchemaObjCxt, + types: JSONType[], + typeErrors: boolean, + errsCount?: Name +): void { + const {gen, schema, data, allErrors, opts, self} = it + const {RULES} = self + if (schema.$ref && (opts.ignoreKeywordsWithRef || !schemaHasRulesButRef(schema, RULES))) { + gen.block(() => keywordCode(it, "$ref", (RULES.all.$ref as Rule).definition)) // TODO typecast + return + } + if (!opts.jtd) checkStrictTypes(it, types) + gen.block(() => { + for (const group of RULES.rules) groupKeywords(group) + groupKeywords(RULES.post) + }) + + function groupKeywords(group: RuleGroup): void { + if (!shouldUseGroup(schema, group)) return + if (group.type) { + gen.if(checkDataType(group.type, data, opts.strictNumbers)) + iterateKeywords(it, group) + if (types.length === 1 && types[0] === group.type && typeErrors) { + gen.else() + reportTypeError(it) + } + gen.endIf() + } else { + iterateKeywords(it, group) + } + // TODO make it "ok" call? + if (!allErrors) gen.if(_`${N.errors} === ${errsCount || 0}`) + } +} + +function iterateKeywords(it: SchemaObjCxt, group: RuleGroup): void { + const { + gen, + schema, + opts: {useDefaults}, + } = it + if (useDefaults) assignDefaults(it, group.type) + gen.block(() => { + for (const rule of group.rules) { + if (shouldUseRule(schema, rule)) { + keywordCode(it, rule.keyword, rule.definition, group.type) + } + } + }) +} + +function checkStrictTypes(it: SchemaObjCxt, types: JSONType[]): void { + if (it.schemaEnv.meta || !it.opts.strictTypes) return + checkContextTypes(it, types) + if (!it.opts.allowUnionTypes) checkMultipleTypes(it, types) + checkKeywordTypes(it, it.dataTypes) +} + +function checkContextTypes(it: SchemaObjCxt, types: JSONType[]): void { + if (!types.length) return + if (!it.dataTypes.length) { + it.dataTypes = types + return + } + types.forEach((t) => { + if (!includesType(it.dataTypes, t)) { + strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`) + } + }) + narrowSchemaTypes(it, types) +} + +function checkMultipleTypes(it: SchemaObjCxt, ts: JSONType[]): void { + if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { + strictTypesError(it, "use allowUnionTypes to allow union type keyword") + } +} + +function checkKeywordTypes(it: SchemaObjCxt, ts: JSONType[]): void { + const rules = it.self.RULES.all + for (const keyword in rules) { + const rule = rules[keyword] + if (typeof rule == "object" && shouldUseRule(it.schema, rule)) { + const {type} = rule.definition + if (type.length && !type.some((t) => hasApplicableType(ts, t))) { + strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`) + } + } + } +} + +function hasApplicableType(schTs: JSONType[], kwdT: JSONType): boolean { + return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer")) +} + +function includesType(ts: JSONType[], t: JSONType): boolean { + return ts.includes(t) || (t === "integer" && ts.includes("number")) +} + +function narrowSchemaTypes(it: SchemaObjCxt, withTypes: JSONType[]): void { + const ts: JSONType[] = [] + for (const t of it.dataTypes) { + if (includesType(withTypes, t)) ts.push(t) + else if (withTypes.includes("integer") && t === "number") ts.push("integer") + } + it.dataTypes = ts +} + +function strictTypesError(it: SchemaObjCxt, msg: string): void { + const schemaPath = it.schemaEnv.baseId + it.errSchemaPath + msg += ` at "${schemaPath}" (strictTypes)` + checkStrictMode(it, msg, it.opts.strictTypes) +} + +export class KeywordCxt implements KeywordErrorCxt { + readonly gen: CodeGen + readonly allErrors?: boolean + readonly keyword: string + readonly data: Name // Name referencing the current level of the data instance + readonly $data?: string | false + schema: any // keyword value in the schema + readonly schemaValue: Code | number | boolean // Code reference to keyword schema value or primitive value + readonly schemaCode: Code | number | boolean // Code reference to resolved schema value (different if schema is $data) + readonly schemaType: JSONType[] // allowed type(s) of keyword value in the schema + readonly parentSchema: AnySchemaObject + readonly errsCount?: Name // Name reference to the number of validation errors collected before this keyword, + // requires option trackErrors in keyword definition + params: KeywordCxtParams // object to pass parameters to error messages from keyword code + readonly it: SchemaObjCxt // schema compilation context (schema is guaranteed to be an object, not boolean) + readonly def: AddedKeywordDefinition + + constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string) { + validateKeywordUsage(it, def, keyword) + this.gen = it.gen + this.allErrors = it.allErrors + this.keyword = keyword + this.data = it.data + this.schema = it.schema[keyword] + this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data + this.schemaValue = schemaRefOrVal(it, this.schema, keyword, this.$data) + this.schemaType = def.schemaType + this.parentSchema = it.schema + this.params = {} + this.it = it + this.def = def + + if (this.$data) { + this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)) + } else { + this.schemaCode = this.schemaValue + if (!validSchemaType(this.schema, def.schemaType, def.allowUndefined)) { + throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`) + } + } + + if ("code" in def ? def.trackErrors : def.errors !== false) { + this.errsCount = it.gen.const("_errs", N.errors) + } + } + + result(condition: Code, successAction?: () => void, failAction?: () => void): void { + this.failResult(not(condition), successAction, failAction) + } + + failResult(condition: Code, successAction?: () => void, failAction?: () => void): void { + this.gen.if(condition) + if (failAction) failAction() + else this.error() + if (successAction) { + this.gen.else() + successAction() + if (this.allErrors) this.gen.endIf() + } else { + if (this.allErrors) this.gen.endIf() + else this.gen.else() + } + } + + pass(condition: Code, failAction?: () => void): void { + this.failResult(not(condition), undefined, failAction) + } + + fail(condition?: Code): void { + if (condition === undefined) { + this.error() + if (!this.allErrors) this.gen.if(false) // this branch will be removed by gen.optimize + return + } + this.gen.if(condition) + this.error() + if (this.allErrors) this.gen.endIf() + else this.gen.else() + } + + fail$data(condition: Code): void { + if (!this.$data) return this.fail(condition) + const {schemaCode} = this + this.fail(_`${schemaCode} !== undefined && (${or(this.invalid$data(), condition)})`) + } + + error(append?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void { + if (errorParams) { + this.setParams(errorParams) + this._error(append, errorPaths) + this.setParams({}) + return + } + this._error(append, errorPaths) + } + + private _error(append?: boolean, errorPaths?: ErrorPaths): void { + ;(append ? reportExtraError : reportError)(this, this.def.error, errorPaths) + } + + $dataError(): void { + reportError(this, this.def.$dataError || keyword$DataError) + } + + reset(): void { + if (this.errsCount === undefined) throw new Error('add "trackErrors" to keyword definition') + resetErrorsCount(this.gen, this.errsCount) + } + + ok(cond: Code | boolean): void { + if (!this.allErrors) this.gen.if(cond) + } + + setParams(obj: KeywordCxtParams, assign?: true): void { + if (assign) Object.assign(this.params, obj) + else this.params = obj + } + + block$data(valid: Name, codeBlock: () => void, $dataValid: Code = nil): void { + this.gen.block(() => { + this.check$data(valid, $dataValid) + codeBlock() + }) + } + + check$data(valid: Name = nil, $dataValid: Code = nil): void { + if (!this.$data) return + const {gen, schemaCode, schemaType, def} = this + gen.if(or(_`${schemaCode} === undefined`, $dataValid)) + if (valid !== nil) gen.assign(valid, true) + if (schemaType.length || def.validateSchema) { + gen.elseIf(this.invalid$data()) + this.$dataError() + if (valid !== nil) gen.assign(valid, false) + } + gen.else() + } + + invalid$data(): Code { + const {gen, schemaCode, schemaType, def, it} = this + return or(wrong$DataType(), invalid$DataSchema()) + + function wrong$DataType(): Code { + if (schemaType.length) { + /* istanbul ignore if */ + if (!(schemaCode instanceof Name)) throw new Error("ajv implementation error") + const st = Array.isArray(schemaType) ? schemaType : [schemaType] + return _`${checkDataTypes(st, schemaCode, it.opts.strictNumbers, DataType.Wrong)}` + } + return nil + } + + function invalid$DataSchema(): Code { + if (def.validateSchema) { + const validateSchemaRef = gen.scopeValue("validate$data", {ref: def.validateSchema}) // TODO value.code for standalone + return _`!${validateSchemaRef}(${schemaCode})` + } + return nil + } + } + + subschema(appl: SubschemaArgs, valid: Name): SchemaCxt { + const subschema = getSubschema(this.it, appl) + extendSubschemaData(subschema, this.it, appl) + extendSubschemaMode(subschema, appl) + const nextContext = {...this.it, ...subschema, items: undefined, props: undefined} + subschemaCode(nextContext, valid) + return nextContext + } + + mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void { + const {it, gen} = this + if (!it.opts.unevaluated) return + if (it.props !== true && schemaCxt.props !== undefined) { + it.props = mergeEvaluated.props(gen, schemaCxt.props, it.props, toName) + } + if (it.items !== true && schemaCxt.items !== undefined) { + it.items = mergeEvaluated.items(gen, schemaCxt.items, it.items, toName) + } + } + + mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void { + const {it, gen} = this + if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { + gen.if(valid, () => this.mergeEvaluated(schemaCxt, Name)) + return true + } + } +} + +function keywordCode( + it: SchemaObjCxt, + keyword: string, + def: AddedKeywordDefinition, + ruleType?: JSONType +): void { + const cxt = new KeywordCxt(it, def, keyword) + if ("code" in def) { + def.code(cxt, ruleType) + } else if (cxt.$data && def.validate) { + funcKeywordCode(cxt, def) + } else if ("macro" in def) { + macroKeywordCode(cxt, def) + } else if (def.compile || def.validate) { + funcKeywordCode(cxt, def) + } +} + +const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/ +const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/ +export function getData( + $data: string, + {dataLevel, dataNames, dataPathArr}: SchemaCxt +): Code | number { + let jsonPointer + let data: Code + if ($data === "") return N.rootData + if ($data[0] === "/") { + if (!JSON_POINTER.test($data)) throw new Error(`Invalid JSON-pointer: ${$data}`) + jsonPointer = $data + data = N.rootData + } else { + const matches = RELATIVE_JSON_POINTER.exec($data) + if (!matches) throw new Error(`Invalid JSON-pointer: ${$data}`) + const up: number = +matches[1] + jsonPointer = matches[2] + if (jsonPointer === "#") { + if (up >= dataLevel) throw new Error(errorMsg("property/index", up)) + return dataPathArr[dataLevel - up] + } + if (up > dataLevel) throw new Error(errorMsg("data", up)) + data = dataNames[dataLevel - up] + if (!jsonPointer) return data + } + + let expr = data + const segments = jsonPointer.split("/") + for (const segment of segments) { + if (segment) { + data = _`${data}${getProperty(unescapeJsonPointer(segment))}` + expr = _`${expr} && ${data}` + } + } + return expr + + function errorMsg(pointerType: string, up: number): string { + return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}` + } +} diff --git a/node_modules/ajv/lib/compile/validate/keyword.ts b/node_modules/ajv/lib/compile/validate/keyword.ts new file mode 100644 index 000000000..f854aa710 --- /dev/null +++ b/node_modules/ajv/lib/compile/validate/keyword.ts @@ -0,0 +1,171 @@ +import type {KeywordCxt} from "." +import type { + AnySchema, + SchemaValidateFunction, + AnyValidateFunction, + AddedKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, +} from "../../types" +import type {SchemaObjCxt} from ".." +import {_, nil, not, stringify, Code, Name, CodeGen} from "../codegen" +import N from "../names" +import type {JSONType} from "../rules" +import {callValidateCode} from "../../vocabularies/code" +import {extendErrors} from "../errors" + +type KeywordCompilationResult = AnySchema | SchemaValidateFunction | AnyValidateFunction + +export function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void { + const {gen, keyword, schema, parentSchema, it} = cxt + const macroSchema = def.macro.call(it.self, schema, parentSchema, it) + const schemaRef = useKeyword(gen, keyword, macroSchema) + if (it.opts.validateSchema !== false) it.self.validateSchema(macroSchema, true) + + const valid = gen.name("valid") + cxt.subschema( + { + schema: macroSchema, + schemaPath: nil, + errSchemaPath: `${it.errSchemaPath}/${keyword}`, + topSchemaRef: schemaRef, + compositeRule: true, + }, + valid + ) + cxt.pass(valid, () => cxt.error(true)) +} + +export function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void { + const {gen, keyword, schema, parentSchema, $data, it} = cxt + checkAsyncKeyword(it, def) + const validate = + !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate + const validateRef = useKeyword(gen, keyword, validate) + const valid = gen.let("valid") + cxt.block$data(valid, validateKeyword) + cxt.ok(def.valid ?? valid) + + function validateKeyword(): void { + if (def.errors === false) { + assignValid() + if (def.modifying) modifyData(cxt) + reportErrs(() => cxt.error()) + } else { + const ruleErrs = def.async ? validateAsync() : validateSync() + if (def.modifying) modifyData(cxt) + reportErrs(() => addErrs(cxt, ruleErrs)) + } + } + + function validateAsync(): Name { + const ruleErrs = gen.let("ruleErrs", null) + gen.try( + () => assignValid(_`await `), + (e) => + gen.assign(valid, false).if( + _`${e} instanceof ${it.ValidationError as Name}`, + () => gen.assign(ruleErrs, _`${e}.errors`), + () => gen.throw(e) + ) + ) + return ruleErrs + } + + function validateSync(): Code { + const validateErrs = _`${validateRef}.errors` + gen.assign(validateErrs, null) + assignValid(nil) + return validateErrs + } + + function assignValid(_await: Code = def.async ? _`await ` : nil): void { + const passCxt = it.opts.passContext ? N.this : N.self + const passSchema = !(("compile" in def && !$data) || def.schema === false) + gen.assign( + valid, + _`${_await}${callValidateCode(cxt, validateRef, passCxt, passSchema)}`, + def.modifying + ) + } + + function reportErrs(errors: () => void): void { + gen.if(not(def.valid ?? valid), errors) + } +} + +function modifyData(cxt: KeywordCxt): void { + const {gen, data, it} = cxt + gen.if(it.parentData, () => gen.assign(data, _`${it.parentData}[${it.parentDataProperty}]`)) +} + +function addErrs(cxt: KeywordCxt, errs: Code): void { + const {gen} = cxt + gen.if( + _`Array.isArray(${errs})`, + () => { + gen + .assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`) + .assign(N.errors, _`${N.vErrors}.length`) + extendErrors(cxt) + }, + () => cxt.error() + ) +} + +function checkAsyncKeyword({schemaEnv}: SchemaObjCxt, def: FuncKeywordDefinition): void { + if (def.async && !schemaEnv.$async) throw new Error("async keyword in sync schema") +} + +function useKeyword(gen: CodeGen, keyword: string, result?: KeywordCompilationResult): Name { + if (result === undefined) throw new Error(`keyword "${keyword}" failed to compile`) + return gen.scopeValue( + "keyword", + typeof result == "function" ? {ref: result} : {ref: result, code: stringify(result)} + ) +} + +export function validSchemaType( + schema: unknown, + schemaType: JSONType[], + allowUndefined = false +): boolean { + // TODO add tests + return ( + !schemaType.length || + schemaType.some((st) => + st === "array" + ? Array.isArray(schema) + : st === "object" + ? schema && typeof schema == "object" && !Array.isArray(schema) + : typeof schema == st || (allowUndefined && typeof schema == "undefined") + ) + ) +} + +export function validateKeywordUsage( + {schema, opts, self, errSchemaPath}: SchemaObjCxt, + def: AddedKeywordDefinition, + keyword: string +): void { + /* istanbul ignore if */ + if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { + throw new Error("ajv implementation error") + } + + const deps = def.dependencies + if (deps?.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) { + throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`) + } + + if (def.validateSchema) { + const valid = def.validateSchema(schema[keyword]) + if (!valid) { + const msg = + `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + + self.errorsText(def.validateSchema.errors) + if (opts.validateSchema === "log") self.logger.error(msg) + else throw new Error(msg) + } + } +} diff --git a/node_modules/ajv/lib/compile/validate/subschema.ts b/node_modules/ajv/lib/compile/validate/subschema.ts new file mode 100644 index 000000000..9072ed774 --- /dev/null +++ b/node_modules/ajv/lib/compile/validate/subschema.ts @@ -0,0 +1,135 @@ +import type {AnySchema} from "../../types" +import type {SchemaObjCxt} from ".." +import {_, str, getProperty, Code, Name} from "../codegen" +import {escapeFragment, getErrorPath, Type} from "../util" +import type {JSONType} from "../rules" + +export interface SubschemaContext { + // TODO use Optional? align with SchemCxt property types + schema: AnySchema + schemaPath: Code + errSchemaPath: string + topSchemaRef?: Code + errorPath?: Code + dataLevel?: number + dataTypes?: JSONType[] + data?: Name + parentData?: Name + parentDataProperty?: Code | number + dataNames?: Name[] + dataPathArr?: (Code | number)[] + propertyName?: Name + jtdDiscriminator?: string + jtdMetadata?: boolean + compositeRule?: true + createErrors?: boolean + allErrors?: boolean +} + +export type SubschemaArgs = Partial<{ + keyword: string + schemaProp: string | number + schema: AnySchema + schemaPath: Code + errSchemaPath: string + topSchemaRef: Code + data: Name | Code + dataProp: Code | string | number + dataTypes: JSONType[] + definedProperties: Set + propertyName: Name + dataPropType: Type + jtdDiscriminator: string + jtdMetadata: boolean + compositeRule: true + createErrors: boolean + allErrors: boolean +}> + +export function getSubschema( + it: SchemaObjCxt, + {keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef}: SubschemaArgs +): SubschemaContext { + if (keyword !== undefined && schema !== undefined) { + throw new Error('both "keyword" and "schema" passed, only one allowed') + } + + if (keyword !== undefined) { + const sch = it.schema[keyword] + return schemaProp === undefined + ? { + schema: sch, + schemaPath: _`${it.schemaPath}${getProperty(keyword)}`, + errSchemaPath: `${it.errSchemaPath}/${keyword}`, + } + : { + schema: sch[schemaProp], + schemaPath: _`${it.schemaPath}${getProperty(keyword)}${getProperty(schemaProp)}`, + errSchemaPath: `${it.errSchemaPath}/${keyword}/${escapeFragment(schemaProp)}`, + } + } + + if (schema !== undefined) { + if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) { + throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"') + } + return { + schema, + schemaPath, + topSchemaRef, + errSchemaPath, + } + } + + throw new Error('either "keyword" or "schema" must be passed') +} + +export function extendSubschemaData( + subschema: SubschemaContext, + it: SchemaObjCxt, + {dataProp, dataPropType: dpType, data, dataTypes, propertyName}: SubschemaArgs +): void { + if (data !== undefined && dataProp !== undefined) { + throw new Error('both "data" and "dataProp" passed, only one allowed') + } + + const {gen} = it + + if (dataProp !== undefined) { + const {errorPath, dataPathArr, opts} = it + const nextData = gen.let("data", _`${it.data}${getProperty(dataProp)}`, true) + dataContextProps(nextData) + subschema.errorPath = str`${errorPath}${getErrorPath(dataProp, dpType, opts.jsPropertySyntax)}` + subschema.parentDataProperty = _`${dataProp}` + subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty] + } + + if (data !== undefined) { + const nextData = data instanceof Name ? data : gen.let("data", data, true) // replaceable if used once? + dataContextProps(nextData) + if (propertyName !== undefined) subschema.propertyName = propertyName + // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr + } + + if (dataTypes) subschema.dataTypes = dataTypes + + function dataContextProps(_nextData: Name): void { + subschema.data = _nextData + subschema.dataLevel = it.dataLevel + 1 + subschema.dataTypes = [] + it.definedProperties = new Set() + subschema.parentData = it.data + subschema.dataNames = [...it.dataNames, _nextData] + } +} + +export function extendSubschemaMode( + subschema: SubschemaContext, + {jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors}: SubschemaArgs +): void { + if (compositeRule !== undefined) subschema.compositeRule = compositeRule + if (createErrors !== undefined) subschema.createErrors = createErrors + if (allErrors !== undefined) subschema.allErrors = allErrors + subschema.jtdDiscriminator = jtdDiscriminator // not inherited + subschema.jtdMetadata = jtdMetadata // not inherited +} diff --git a/node_modules/ajv/lib/core.ts b/node_modules/ajv/lib/core.ts new file mode 100644 index 000000000..3686ffe76 --- /dev/null +++ b/node_modules/ajv/lib/core.ts @@ -0,0 +1,887 @@ +export { + Format, + FormatDefinition, + AsyncFormatDefinition, + KeywordDefinition, + KeywordErrorDefinition, + CodeKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, + Vocabulary, + Schema, + SchemaObject, + AnySchemaObject, + AsyncSchema, + AnySchema, + ValidateFunction, + AsyncValidateFunction, + AnyValidateFunction, + ErrorObject, + ErrorNoParams, +} from "./types" + +export {SchemaCxt, SchemaObjCxt} from "./compile" +export interface Plugin { + (ajv: Ajv, options?: Opts): Ajv + [prop: string]: any +} + +export {KeywordCxt} from "./compile/validate" +export {DefinedError} from "./vocabularies/errors" +export {JSONType} from "./compile/rules" +export {JSONSchemaType} from "./types/json-schema" +export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" +export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" + +import type { + Schema, + AnySchema, + AnySchemaObject, + SchemaObject, + AsyncSchema, + Vocabulary, + KeywordDefinition, + AddedKeywordDefinition, + AnyValidateFunction, + ValidateFunction, + AsyncValidateFunction, + ErrorObject, + Format, + AddedFormat, + RegExpEngine, + UriResolver, +} from "./types" +import type {JSONSchemaType} from "./types/json-schema" +import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" +import ValidationError from "./runtime/validation_error" +import MissingRefError from "./compile/ref_error" +import {getRules, ValidationRules, Rule, RuleGroup, JSONType} from "./compile/rules" +import {SchemaEnv, compileSchema, resolveSchema} from "./compile" +import {Code, ValueScope} from "./compile/codegen" +import {normalizeId, getSchemaRefs} from "./compile/resolve" +import {getJSONTypes} from "./compile/validate/dataType" +import {eachItem} from "./compile/util" +import * as $dataRefSchema from "./refs/data.json" + +import DefaultUriResolver from "./runtime/uri" + +const defaultRegExp: RegExpEngine = (str, flags) => new RegExp(str, flags) +defaultRegExp.code = "new RegExp" + +const META_IGNORE_OPTIONS: (keyof Options)[] = ["removeAdditional", "useDefaults", "coerceTypes"] +const EXT_SCOPE_NAMES = new Set([ + "validate", + "serialize", + "parse", + "wrapper", + "root", + "schema", + "keyword", + "pattern", + "formats", + "validate$data", + "func", + "obj", + "Error", +]) + +export type Options = CurrentOptions & DeprecatedOptions + +export interface CurrentOptions { + // strict mode options (NEW) + strict?: boolean | "log" + strictSchema?: boolean | "log" + strictNumbers?: boolean | "log" + strictTypes?: boolean | "log" + strictTuples?: boolean | "log" + strictRequired?: boolean | "log" + allowMatchingProperties?: boolean // disables a strict mode restriction + allowUnionTypes?: boolean + validateFormats?: boolean + // validation and reporting options: + $data?: boolean + allErrors?: boolean + verbose?: boolean + discriminator?: boolean + unicodeRegExp?: boolean + timestamp?: "string" | "date" // JTD only + parseDate?: boolean // JTD only + allowDate?: boolean // JTD only + $comment?: + | true + | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown) + formats?: {[Name in string]?: Format} + keywords?: Vocabulary + schemas?: AnySchema[] | {[Key in string]?: AnySchema} + logger?: Logger | false + loadSchema?: (uri: string) => Promise + // options to modify validated data: + removeAdditional?: boolean | "all" | "failing" + useDefaults?: boolean | "empty" + coerceTypes?: boolean | "array" + // advanced options: + next?: boolean // NEW + unevaluated?: boolean // NEW + dynamicRef?: boolean // NEW + schemaId?: "id" | "$id" + jtd?: boolean // NEW + meta?: SchemaObject | boolean + defaultMeta?: string | AnySchemaObject + validateSchema?: boolean | "log" + addUsedSchema?: boolean + inlineRefs?: boolean | number + passContext?: boolean + loopRequired?: number + loopEnum?: number // NEW + ownProperties?: boolean + multipleOfPrecision?: number + int32range?: boolean // JTD only + messages?: boolean + code?: CodeOptions // NEW + uriResolver?: UriResolver +} + +export interface CodeOptions { + es5?: boolean + esm?: boolean + lines?: boolean + optimize?: boolean | number + formats?: Code // code to require (or construct) map of available formats - for standalone code + source?: boolean + process?: (code: string, schema?: SchemaEnv) => string + regExp?: RegExpEngine +} + +interface InstanceCodeOptions extends CodeOptions { + regExp: RegExpEngine + optimize: number +} + +interface DeprecatedOptions { + /** @deprecated */ + ignoreKeywordsWithRef?: boolean + /** @deprecated */ + jsPropertySyntax?: boolean // added instead of jsonPointers + /** @deprecated */ + unicode?: boolean +} + +interface RemovedOptions { + format?: boolean + errorDataPath?: "object" | "property" + nullable?: boolean // "nullable" keyword is supported by default + jsonPointers?: boolean + extendRefs?: true | "ignore" | "fail" + missingRefs?: true | "ignore" | "fail" + processCode?: (code: string, schema?: SchemaEnv) => string + sourceCode?: boolean + strictDefaults?: boolean + strictKeywords?: boolean + uniqueItems?: boolean + unknownFormats?: true | string[] | "ignore" + cache?: any + serialize?: (schema: AnySchema) => unknown + ajvErrors?: boolean +} + +type OptionsInfo = { + [K in keyof T]-?: string | undefined +} + +const removedOptions: OptionsInfo = { + errorDataPath: "", + format: "`validateFormats: false` can be used instead.", + nullable: '"nullable" keyword is supported by default.', + jsonPointers: "Deprecated jsPropertySyntax can be used instead.", + extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", + missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", + processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", + sourceCode: "Use option `code: {source: true}`", + strictDefaults: "It is default now, see option `strict`.", + strictKeywords: "It is default now, see option `strict`.", + uniqueItems: '"uniqueItems" keyword is always validated.', + unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", + cache: "Map is used as cache, schema object as key.", + serialize: "Map is used as cache, schema object as key.", + ajvErrors: "It is default now.", +} + +const deprecatedOptions: OptionsInfo = { + ignoreKeywordsWithRef: "", + jsPropertySyntax: "", + unicode: '"minLength"/"maxLength" account for unicode characters by default.', +} + +type RequiredInstanceOptions = { + [K in + | "strictSchema" + | "strictNumbers" + | "strictTypes" + | "strictTuples" + | "strictRequired" + | "inlineRefs" + | "loopRequired" + | "loopEnum" + | "meta" + | "messages" + | "schemaId" + | "addUsedSchema" + | "validateSchema" + | "validateFormats" + | "int32range" + | "unicodeRegExp" + | "uriResolver"]: NonNullable +} & {code: InstanceCodeOptions} + +export type InstanceOptions = Options & RequiredInstanceOptions + +const MAX_EXPRESSION = 200 + +// eslint-disable-next-line complexity +function requiredOptions(o: Options): RequiredInstanceOptions { + const s = o.strict + const _optz = o.code?.optimize + const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0 + const regExp = o.code?.regExp ?? defaultRegExp + const uriResolver = o.uriResolver ?? DefaultUriResolver + return { + strictSchema: o.strictSchema ?? s ?? true, + strictNumbers: o.strictNumbers ?? s ?? true, + strictTypes: o.strictTypes ?? s ?? "log", + strictTuples: o.strictTuples ?? s ?? "log", + strictRequired: o.strictRequired ?? s ?? false, + code: o.code ? {...o.code, optimize, regExp} : {optimize, regExp}, + loopRequired: o.loopRequired ?? MAX_EXPRESSION, + loopEnum: o.loopEnum ?? MAX_EXPRESSION, + meta: o.meta ?? true, + messages: o.messages ?? true, + inlineRefs: o.inlineRefs ?? true, + schemaId: o.schemaId ?? "$id", + addUsedSchema: o.addUsedSchema ?? true, + validateSchema: o.validateSchema ?? true, + validateFormats: o.validateFormats ?? true, + unicodeRegExp: o.unicodeRegExp ?? true, + int32range: o.int32range ?? true, + uriResolver: uriResolver, + } +} + +export interface Logger { + log(...args: unknown[]): unknown + warn(...args: unknown[]): unknown + error(...args: unknown[]): unknown +} + +export default class Ajv { + opts: InstanceOptions + errors?: ErrorObject[] | null // errors from the last validation + logger: Logger + // shared external scope values for compiled functions + readonly scope: ValueScope + readonly schemas: {[Key in string]?: SchemaEnv} = {} + readonly refs: {[Ref in string]?: SchemaEnv | string} = {} + readonly formats: {[Name in string]?: AddedFormat} = {} + readonly RULES: ValidationRules + readonly _compilations: Set = new Set() + private readonly _loading: {[Ref in string]?: Promise} = {} + private readonly _cache: Map = new Map() + private readonly _metaOpts: InstanceOptions + + static ValidationError = ValidationError + static MissingRefError = MissingRefError + + constructor(opts: Options = {}) { + opts = this.opts = {...opts, ...requiredOptions(opts)} + const {es5, lines} = this.opts.code + + this.scope = new ValueScope({scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines}) + this.logger = getLogger(opts.logger) + const formatOpt = opts.validateFormats + opts.validateFormats = false + + this.RULES = getRules() + checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED") + checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn") + this._metaOpts = getMetaSchemaOptions.call(this) + + if (opts.formats) addInitialFormats.call(this) + this._addVocabularies() + this._addDefaultMetaSchema() + if (opts.keywords) addInitialKeywords.call(this, opts.keywords) + if (typeof opts.meta == "object") this.addMetaSchema(opts.meta) + addInitialSchemas.call(this) + opts.validateFormats = formatOpt + } + + _addVocabularies(): void { + this.addKeyword("$async") + } + + _addDefaultMetaSchema(): void { + const {$data, meta, schemaId} = this.opts + let _dataRefSchema: SchemaObject = $dataRefSchema + if (schemaId === "id") { + _dataRefSchema = {...$dataRefSchema} + _dataRefSchema.id = _dataRefSchema.$id + delete _dataRefSchema.$id + } + if (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false) + } + + defaultMeta(): string | AnySchemaObject | undefined { + const {meta, schemaId} = this.opts + return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined) + } + + // Validate data using schema + // AnySchema will be compiled and cached using schema itself as a key for Map + validate(schema: Schema | string, data: unknown): boolean + validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise + validate(schema: Schema | JSONSchemaType | string, data: unknown): data is T + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + validate(schema: JTDSchemaType, data: unknown): data is T + // This overload is only intended for typescript inference, the first + // argument prevents manual type annotation from matching this overload + validate( + schema: T, + data: unknown + ): data is JTDDataType + validate(schema: AsyncSchema, data: unknown | T): Promise + validate(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise + validate( + schemaKeyRef: AnySchema | string, // key, ref or schema object + data: unknown | T // to be validated + ): boolean | Promise { + let v: AnyValidateFunction | undefined + if (typeof schemaKeyRef == "string") { + v = this.getSchema(schemaKeyRef) + if (!v) throw new Error(`no schema with key or ref "${schemaKeyRef}"`) + } else { + v = this.compile(schemaKeyRef) + } + + const valid = v(data) + if (!("$async" in v)) this.errors = v.errors + return valid + } + + // Create validation function for passed schema + // _meta: true if schema is a meta-schema. Used internally to compile meta schemas of user-defined keywords. + compile(schema: Schema | JSONSchemaType, _meta?: boolean): ValidateFunction + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + compile(schema: JTDSchemaType, _meta?: boolean): ValidateFunction + // This overload is only intended for typescript inference, the first + // argument prevents manual type annotation from matching this overload + compile( + schema: T, + _meta?: boolean + ): ValidateFunction> + compile(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction + compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction + compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction { + const sch = this._addSchema(schema, _meta) + return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction + } + + // Creates validating function for passed schema with asynchronous loading of missing schemas. + // `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema. + // TODO allow passing schema URI + // meta - optional true to compile meta-schema + compileAsync( + schema: SchemaObject | JSONSchemaType, + _meta?: boolean + ): Promise> + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + compileAsync(schema: JTDSchemaType, _meta?: boolean): Promise> + compileAsync(schema: AsyncSchema, meta?: boolean): Promise> + // eslint-disable-next-line @typescript-eslint/unified-signatures + compileAsync( + schema: AnySchemaObject, + meta?: boolean + ): Promise> + compileAsync( + schema: AnySchemaObject, + meta?: boolean + ): Promise> { + if (typeof this.opts.loadSchema != "function") { + throw new Error("options.loadSchema should be a function") + } + const {loadSchema} = this.opts + return runCompileAsync.call(this, schema, meta) + + async function runCompileAsync( + this: Ajv, + _schema: AnySchemaObject, + _meta?: boolean + ): Promise { + await loadMetaSchema.call(this, _schema.$schema) + const sch = this._addSchema(_schema, _meta) + return sch.validate || _compileAsync.call(this, sch) + } + + async function loadMetaSchema(this: Ajv, $ref?: string): Promise { + if ($ref && !this.getSchema($ref)) { + await runCompileAsync.call(this, {$ref}, true) + } + } + + async function _compileAsync(this: Ajv, sch: SchemaEnv): Promise { + try { + return this._compileSchemaEnv(sch) + } catch (e) { + if (!(e instanceof MissingRefError)) throw e + checkLoaded.call(this, e) + await loadMissingSchema.call(this, e.missingSchema) + return _compileAsync.call(this, sch) + } + } + + function checkLoaded(this: Ajv, {missingSchema: ref, missingRef}: MissingRefError): void { + if (this.refs[ref]) { + throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`) + } + } + + async function loadMissingSchema(this: Ajv, ref: string): Promise { + const _schema = await _loadSchema.call(this, ref) + if (!this.refs[ref]) await loadMetaSchema.call(this, _schema.$schema) + if (!this.refs[ref]) this.addSchema(_schema, ref, meta) + } + + async function _loadSchema(this: Ajv, ref: string): Promise { + const p = this._loading[ref] + if (p) return p + try { + return await (this._loading[ref] = loadSchema(ref)) + } finally { + delete this._loading[ref] + } + } + } + + // Adds schema to the instance + addSchema( + schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored + key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead. + ): Ajv { + if (Array.isArray(schema)) { + for (const sch of schema) this.addSchema(sch, undefined, _meta, _validateSchema) + return this + } + let id: string | undefined + if (typeof schema === "object") { + const {schemaId} = this.opts + id = schema[schemaId] + if (id !== undefined && typeof id != "string") { + throw new Error(`schema ${schemaId} must be string`) + } + } + key = normalizeId(key || id) + this._checkUnique(key) + this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true) + return this + } + + // Add schema that will be used to validate other schemas + // options in META_IGNORE_OPTIONS are alway set to false + addMetaSchema( + schema: AnySchemaObject, + key?: string, // schema key + _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema + ): Ajv { + this.addSchema(schema, key, true, _validateSchema) + return this + } + + // Validate schema against its meta-schema + validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise { + if (typeof schema == "boolean") return true + let $schema: string | AnySchemaObject | undefined + $schema = schema.$schema + if ($schema !== undefined && typeof $schema != "string") { + throw new Error("$schema must be a string") + } + $schema = $schema || this.opts.defaultMeta || this.defaultMeta() + if (!$schema) { + this.logger.warn("meta-schema not available") + this.errors = null + return true + } + const valid = this.validate($schema, schema) + if (!valid && throwOrLogError) { + const message = "schema is invalid: " + this.errorsText() + if (this.opts.validateSchema === "log") this.logger.error(message) + else throw new Error(message) + } + return valid + } + + // Get compiled schema by `key` or `ref`. + // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) + getSchema(keyRef: string): AnyValidateFunction | undefined { + let sch + while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") keyRef = sch + if (sch === undefined) { + const {schemaId} = this.opts + const root = new SchemaEnv({schema: {}, schemaId}) + sch = resolveSchema.call(this, root, keyRef) + if (!sch) return + this.refs[keyRef] = sch + } + return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction | undefined + } + + // Remove cached schema(s). + // If no parameter is passed all schemas but meta-schemas are removed. + // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. + // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. + removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv { + if (schemaKeyRef instanceof RegExp) { + this._removeAllSchemas(this.schemas, schemaKeyRef) + this._removeAllSchemas(this.refs, schemaKeyRef) + return this + } + switch (typeof schemaKeyRef) { + case "undefined": + this._removeAllSchemas(this.schemas) + this._removeAllSchemas(this.refs) + this._cache.clear() + return this + case "string": { + const sch = getSchEnv.call(this, schemaKeyRef) + if (typeof sch == "object") this._cache.delete(sch.schema) + delete this.schemas[schemaKeyRef] + delete this.refs[schemaKeyRef] + return this + } + case "object": { + const cacheKey = schemaKeyRef + this._cache.delete(cacheKey) + let id = schemaKeyRef[this.opts.schemaId] + if (id) { + id = normalizeId(id) + delete this.schemas[id] + delete this.refs[id] + } + return this + } + default: + throw new Error("ajv.removeSchema: invalid parameter") + } + } + + // add "vocabulary" - a collection of keywords + addVocabulary(definitions: Vocabulary): Ajv { + for (const def of definitions) this.addKeyword(def) + return this + } + + addKeyword( + kwdOrDef: string | KeywordDefinition, + def?: KeywordDefinition // deprecated + ): Ajv { + let keyword: string | string[] + if (typeof kwdOrDef == "string") { + keyword = kwdOrDef + if (typeof def == "object") { + this.logger.warn("these parameters are deprecated, see docs for addKeyword") + def.keyword = keyword + } + } else if (typeof kwdOrDef == "object" && def === undefined) { + def = kwdOrDef + keyword = def.keyword + if (Array.isArray(keyword) && !keyword.length) { + throw new Error("addKeywords: keyword must be string or non-empty array") + } + } else { + throw new Error("invalid addKeywords parameters") + } + + checkKeyword.call(this, keyword, def) + if (!def) { + eachItem(keyword, (kwd) => addRule.call(this, kwd)) + return this + } + keywordMetaschema.call(this, def) + const definition: AddedKeywordDefinition = { + ...def, + type: getJSONTypes(def.type), + schemaType: getJSONTypes(def.schemaType), + } + eachItem( + keyword, + definition.type.length === 0 + ? (k) => addRule.call(this, k, definition) + : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)) + ) + return this + } + + getKeyword(keyword: string): AddedKeywordDefinition | boolean { + const rule = this.RULES.all[keyword] + return typeof rule == "object" ? rule.definition : !!rule + } + + // Remove keyword + removeKeyword(keyword: string): Ajv { + // TODO return type should be Ajv + const {RULES} = this + delete RULES.keywords[keyword] + delete RULES.all[keyword] + for (const group of RULES.rules) { + const i = group.rules.findIndex((rule) => rule.keyword === keyword) + if (i >= 0) group.rules.splice(i, 1) + } + return this + } + + // Add format + addFormat(name: string, format: Format): Ajv { + if (typeof format == "string") format = new RegExp(format) + this.formats[name] = format + return this + } + + errorsText( + errors: ErrorObject[] | null | undefined = this.errors, // optional array of validation errors + {separator = ", ", dataVar = "data"}: ErrorsTextOptions = {} // optional options with properties `separator` and `dataVar` + ): string { + if (!errors || errors.length === 0) return "No errors" + return errors + .map((e) => `${dataVar}${e.instancePath} ${e.message}`) + .reduce((text, msg) => text + separator + msg) + } + + $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject { + const rules = this.RULES.all + metaSchema = JSON.parse(JSON.stringify(metaSchema)) + for (const jsonPointer of keywordsJsonPointers) { + const segments = jsonPointer.split("/").slice(1) // first segment is an empty string + let keywords = metaSchema + for (const seg of segments) keywords = keywords[seg] as AnySchemaObject + + for (const key in rules) { + const rule = rules[key] + if (typeof rule != "object") continue + const {$data} = rule.definition + const schema = keywords[key] as AnySchemaObject | undefined + if ($data && schema) keywords[key] = schemaOrData(schema) + } + } + + return metaSchema + } + + private _removeAllSchemas(schemas: {[Ref in string]?: SchemaEnv | string}, regex?: RegExp): void { + for (const keyRef in schemas) { + const sch = schemas[keyRef] + if (!regex || regex.test(keyRef)) { + if (typeof sch == "string") { + delete schemas[keyRef] + } else if (sch && !sch.meta) { + this._cache.delete(sch.schema) + delete schemas[keyRef] + } + } + } + } + + _addSchema( + schema: AnySchema, + meta?: boolean, + baseId?: string, + validateSchema = this.opts.validateSchema, + addSchema = this.opts.addUsedSchema + ): SchemaEnv { + let id: string | undefined + const {schemaId} = this.opts + if (typeof schema == "object") { + id = schema[schemaId] + } else { + if (this.opts.jtd) throw new Error("schema must be object") + else if (typeof schema != "boolean") throw new Error("schema must be object or boolean") + } + let sch = this._cache.get(schema) + if (sch !== undefined) return sch + + baseId = normalizeId(id || baseId) + const localRefs = getSchemaRefs.call(this, schema, baseId) + sch = new SchemaEnv({schema, schemaId, meta, baseId, localRefs}) + this._cache.set(sch.schema, sch) + if (addSchema && !baseId.startsWith("#")) { + // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) + if (baseId) this._checkUnique(baseId) + this.refs[baseId] = sch + } + if (validateSchema) this.validateSchema(schema, true) + return sch + } + + private _checkUnique(id: string): void { + if (this.schemas[id] || this.refs[id]) { + throw new Error(`schema with key or id "${id}" already exists`) + } + } + + private _compileSchemaEnv(sch: SchemaEnv): AnyValidateFunction { + if (sch.meta) this._compileMetaSchema(sch) + else compileSchema.call(this, sch) + + /* istanbul ignore if */ + if (!sch.validate) throw new Error("ajv implementation error") + return sch.validate + } + + private _compileMetaSchema(sch: SchemaEnv): void { + const currentOpts = this.opts + this.opts = this._metaOpts + try { + compileSchema.call(this, sch) + } finally { + this.opts = currentOpts + } + } +} + +export interface ErrorsTextOptions { + separator?: string + dataVar?: string +} + +function checkOptions( + this: Ajv, + checkOpts: OptionsInfo, + options: Options & RemovedOptions, + msg: string, + log: "warn" | "error" = "error" +): void { + for (const key in checkOpts) { + const opt = key as keyof typeof checkOpts + if (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`) + } +} + +function getSchEnv(this: Ajv, keyRef: string): SchemaEnv | string | undefined { + keyRef = normalizeId(keyRef) // TODO tests fail without this line + return this.schemas[keyRef] || this.refs[keyRef] +} + +function addInitialSchemas(this: Ajv): void { + const optsSchemas = this.opts.schemas + if (!optsSchemas) return + if (Array.isArray(optsSchemas)) this.addSchema(optsSchemas) + else for (const key in optsSchemas) this.addSchema(optsSchemas[key] as AnySchema, key) +} + +function addInitialFormats(this: Ajv): void { + for (const name in this.opts.formats) { + const format = this.opts.formats[name] + if (format) this.addFormat(name, format) + } +} + +function addInitialKeywords( + this: Ajv, + defs: Vocabulary | {[K in string]?: KeywordDefinition} +): void { + if (Array.isArray(defs)) { + this.addVocabulary(defs) + return + } + this.logger.warn("keywords option as map is deprecated, pass array") + for (const keyword in defs) { + const def = defs[keyword] as KeywordDefinition + if (!def.keyword) def.keyword = keyword + this.addKeyword(def) + } +} + +function getMetaSchemaOptions(this: Ajv): InstanceOptions { + const metaOpts = {...this.opts} + for (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt] + return metaOpts +} + +const noLogs = {log() {}, warn() {}, error() {}} + +function getLogger(logger?: Partial | false): Logger { + if (logger === false) return noLogs + if (logger === undefined) return console + if (logger.log && logger.warn && logger.error) return logger as Logger + throw new Error("logger must implement log, warn and error methods") +} + +const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i + +function checkKeyword(this: Ajv, keyword: string | string[], def?: KeywordDefinition): void { + const {RULES} = this + eachItem(keyword, (kwd) => { + if (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`) + if (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`) + }) + if (!def) return + if (def.$data && !("code" in def || "validate" in def)) { + throw new Error('$data keyword must have "code" or "validate" function') + } +} + +function addRule( + this: Ajv, + keyword: string, + definition?: AddedKeywordDefinition, + dataType?: JSONType +): void { + const post = definition?.post + if (dataType && post) throw new Error('keyword with "post" flag cannot have "type"') + const {RULES} = this + let ruleGroup = post ? RULES.post : RULES.rules.find(({type: t}) => t === dataType) + if (!ruleGroup) { + ruleGroup = {type: dataType, rules: []} + RULES.rules.push(ruleGroup) + } + RULES.keywords[keyword] = true + if (!definition) return + + const rule: Rule = { + keyword, + definition: { + ...definition, + type: getJSONTypes(definition.type), + schemaType: getJSONTypes(definition.schemaType), + }, + } + if (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before) + else ruleGroup.rules.push(rule) + RULES.all[keyword] = rule + definition.implements?.forEach((kwd) => this.addKeyword(kwd)) +} + +function addBeforeRule(this: Ajv, ruleGroup: RuleGroup, rule: Rule, before: string): void { + const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before) + if (i >= 0) { + ruleGroup.rules.splice(i, 0, rule) + } else { + ruleGroup.rules.push(rule) + this.logger.warn(`rule ${before} is not defined`) + } +} + +function keywordMetaschema(this: Ajv, def: KeywordDefinition): void { + let {metaSchema} = def + if (metaSchema === undefined) return + if (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema) + def.validateSchema = this.compile(metaSchema, true) +} + +const $dataRef = { + $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", +} + +function schemaOrData(schema: AnySchema): AnySchemaObject { + return {anyOf: [schema, $dataRef]} +} diff --git a/node_modules/ajv/lib/jtd.ts b/node_modules/ajv/lib/jtd.ts new file mode 100644 index 000000000..96eb7b9dc --- /dev/null +++ b/node_modules/ajv/lib/jtd.ts @@ -0,0 +1,131 @@ +import type {AnySchemaObject, SchemaObject, JTDParser} from "./types" +import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" +import AjvCore, {CurrentOptions} from "./core" +import jtdVocabulary from "./vocabularies/jtd" +import jtdMetaSchema from "./refs/jtd-schema" +import compileSerializer from "./compile/jtd/serialize" +import compileParser from "./compile/jtd/parse" +import {SchemaEnv} from "./compile" + +const META_SCHEMA_ID = "JTD-meta-schema" + +type JTDOptions = CurrentOptions & { + // strict mode options not supported with JTD: + strict?: never + allowMatchingProperties?: never + allowUnionTypes?: never + validateFormats?: never + // validation and reporting options not supported with JTD: + $data?: never + verbose?: boolean + $comment?: never + formats?: never + loadSchema?: never + // options to modify validated data: + useDefaults?: never + coerceTypes?: never + // advanced options: + next?: never + unevaluated?: never + dynamicRef?: never + meta?: boolean + defaultMeta?: never + inlineRefs?: boolean + loopRequired?: never + multipleOfPrecision?: never +} + +class Ajv extends AjvCore { + constructor(opts: JTDOptions = {}) { + super({ + ...opts, + jtd: true, + }) + } + + _addVocabularies(): void { + super._addVocabularies() + this.addVocabulary(jtdVocabulary) + } + + _addDefaultMetaSchema(): void { + super._addDefaultMetaSchema() + if (!this.opts.meta) return + this.addMetaSchema(jtdMetaSchema, META_SCHEMA_ID, false) + } + + defaultMeta(): string | AnySchemaObject | undefined { + return (this.opts.defaultMeta = + super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) + } + + compileSerializer(schema: SchemaObject): (data: T) => string + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + compileSerializer(schema: JTDSchemaType): (data: T) => string + compileSerializer(schema: SchemaObject): (data: T) => string { + const sch = this._addSchema(schema) + return sch.serialize || this._compileSerializer(sch) + } + + compileParser(schema: SchemaObject): JTDParser + // Separated for type inference to work + // eslint-disable-next-line @typescript-eslint/unified-signatures + compileParser(schema: JTDSchemaType): JTDParser + compileParser(schema: SchemaObject): JTDParser { + const sch = this._addSchema(schema) + return (sch.parse || this._compileParser(sch)) as JTDParser + } + + private _compileSerializer(sch: SchemaEnv): (data: T) => string { + compileSerializer.call(this, sch, (sch.schema as AnySchemaObject).definitions || {}) + /* istanbul ignore if */ + if (!sch.serialize) throw new Error("ajv implementation error") + return sch.serialize + } + + private _compileParser(sch: SchemaEnv): JTDParser { + compileParser.call(this, sch, (sch.schema as AnySchemaObject).definitions || {}) + /* istanbul ignore if */ + if (!sch.parse) throw new Error("ajv implementation error") + return sch.parse + } +} + +module.exports = exports = Ajv +Object.defineProperty(exports, "__esModule", {value: true}) + +export default Ajv + +export { + Format, + FormatDefinition, + AsyncFormatDefinition, + KeywordDefinition, + KeywordErrorDefinition, + CodeKeywordDefinition, + MacroKeywordDefinition, + FuncKeywordDefinition, + Vocabulary, + Schema, + SchemaObject, + AnySchemaObject, + AsyncSchema, + AnySchema, + ValidateFunction, + AsyncValidateFunction, + ErrorObject, + ErrorNoParams, + JTDParser, +} from "./types" + +export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" +export {SchemaCxt, SchemaObjCxt} from "./compile" +export {KeywordCxt} from "./compile/validate" +export {JTDErrorObject} from "./vocabularies/jtd" +export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" + +export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} +export {JTDOptions} +export {default as ValidationError} from "./runtime/validation_error" +export {default as MissingRefError} from "./compile/ref_error" diff --git a/node_modules/ajv/lib/refs/data.json b/node_modules/ajv/lib/refs/data.json new file mode 100644 index 000000000..9ffc9f5ce --- /dev/null +++ b/node_modules/ajv/lib/refs/data.json @@ -0,0 +1,13 @@ +{ + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", + "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)", + "type": "object", + "required": ["$data"], + "properties": { + "$data": { + "type": "string", + "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}] + } + }, + "additionalProperties": false +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts b/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts new file mode 100644 index 000000000..b6ea7195f --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts @@ -0,0 +1,28 @@ +import type Ajv from "../../core" +import type {AnySchemaObject} from "../../types" +import * as metaSchema from "./schema.json" +import * as applicator from "./meta/applicator.json" +import * as content from "./meta/content.json" +import * as core from "./meta/core.json" +import * as format from "./meta/format.json" +import * as metadata from "./meta/meta-data.json" +import * as validation from "./meta/validation.json" + +const META_SUPPORT_DATA = ["/properties"] + +export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv { + ;[ + metaSchema, + applicator, + content, + core, + with$data(this, format), + metadata, + with$data(this, validation), + ].forEach((sch) => this.addMetaSchema(sch, undefined, false)) + return this + + function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject { + return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json new file mode 100644 index 000000000..c5e91cf2a --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/applicator", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/applicator": true + }, + "$recursiveAnchor": true, + + "title": "Applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "additionalItems": {"$recursiveRef": "#"}, + "unevaluatedItems": {"$recursiveRef": "#"}, + "items": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}] + }, + "contains": {"$recursiveRef": "#"}, + "additionalProperties": {"$recursiveRef": "#"}, + "unevaluatedProperties": {"$recursiveRef": "#"}, + "properties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependentSchemas": { + "type": "object", + "additionalProperties": { + "$recursiveRef": "#" + } + }, + "propertyNames": {"$recursiveRef": "#"}, + "if": {"$recursiveRef": "#"}, + "then": {"$recursiveRef": "#"}, + "else": {"$recursiveRef": "#"}, + "allOf": {"$ref": "#/$defs/schemaArray"}, + "anyOf": {"$ref": "#/$defs/schemaArray"}, + "oneOf": {"$ref": "#/$defs/schemaArray"}, + "not": {"$recursiveRef": "#"} + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$recursiveRef": "#"} + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json new file mode 100644 index 000000000..b8f637343 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "contentSchema": {"$recursiveRef": "#"} + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json new file mode 100644 index 000000000..f71adbff0 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json @@ -0,0 +1,57 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/core", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true + }, + "$recursiveAnchor": true, + + "title": "Core vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference", + "$comment": "Non-empty fragments not allowed.", + "pattern": "^[^#]*#?$" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$anchor": { + "type": "string", + "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveRef": { + "type": "string", + "format": "uri-reference" + }, + "$recursiveAnchor": { + "type": "boolean", + "default": false + }, + "$vocabulary": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri" + }, + "additionalProperties": { + "type": "boolean" + } + }, + "$comment": { + "type": "string" + }, + "$defs": { + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json new file mode 100644 index 000000000..03ccfce26 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/format", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/format": true + }, + "$recursiveAnchor": true, + + "title": "Format vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "format": {"type": "string"} + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json new file mode 100644 index 000000000..0e194326f --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/meta-data": true + }, + "$recursiveAnchor": true, + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "deprecated": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json new file mode 100644 index 000000000..7027a1279 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/validation": true + }, + "$recursiveAnchor": true, + + "title": "Validation vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, + "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, + "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, + "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/$defs/stringArray"}, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, + "type": { + "anyOf": [ + {"$ref": "#/$defs/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/$defs/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json b/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json new file mode 100644 index 000000000..54eb7157a --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://json-schema.org/draft/2019-09/schema", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true, + "https://json-schema.org/draft/2019-09/vocab/applicator": true, + "https://json-schema.org/draft/2019-09/vocab/validation": true, + "https://json-schema.org/draft/2019-09/vocab/meta-data": true, + "https://json-schema.org/draft/2019-09/vocab/format": false, + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Core and Validation specifications meta-schema", + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format"}, + {"$ref": "meta/content"} + ], + "type": ["object", "boolean"], + "properties": { + "definitions": { + "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", + "type": "object", + "additionalProperties": {"$recursiveRef": "#"}, + "default": {} + }, + "dependencies": { + "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", + "type": "object", + "additionalProperties": { + "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}] + } + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts b/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts new file mode 100644 index 000000000..8e850d08b --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts @@ -0,0 +1,30 @@ +import type Ajv from "../../core" +import type {AnySchemaObject} from "../../types" +import * as metaSchema from "./schema.json" +import * as applicator from "./meta/applicator.json" +import * as unevaluated from "./meta/unevaluated.json" +import * as content from "./meta/content.json" +import * as core from "./meta/core.json" +import * as format from "./meta/format-annotation.json" +import * as metadata from "./meta/meta-data.json" +import * as validation from "./meta/validation.json" + +const META_SUPPORT_DATA = ["/properties"] + +export default function addMetaSchema2020(this: Ajv, $data?: boolean): Ajv { + ;[ + metaSchema, + applicator, + unevaluated, + content, + core, + with$data(this, format), + metadata, + with$data(this, validation), + ].forEach((sch) => this.addMetaSchema(sch, undefined, false)) + return this + + function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject { + return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json new file mode 100644 index 000000000..674c913da --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/applicator", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/applicator": true + }, + "$dynamicAnchor": "meta", + + "title": "Applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "prefixItems": {"$ref": "#/$defs/schemaArray"}, + "items": {"$dynamicRef": "#meta"}, + "contains": {"$dynamicRef": "#meta"}, + "additionalProperties": {"$dynamicRef": "#meta"}, + "properties": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependentSchemas": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "default": {} + }, + "propertyNames": {"$dynamicRef": "#meta"}, + "if": {"$dynamicRef": "#meta"}, + "then": {"$dynamicRef": "#meta"}, + "else": {"$dynamicRef": "#meta"}, + "allOf": {"$ref": "#/$defs/schemaArray"}, + "anyOf": {"$ref": "#/$defs/schemaArray"}, + "oneOf": {"$ref": "#/$defs/schemaArray"}, + "not": {"$dynamicRef": "#meta"} + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$dynamicRef": "#meta"} + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json new file mode 100644 index 000000000..2ae23ddb5 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + "$dynamicAnchor": "meta", + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentEncoding": {"type": "string"}, + "contentMediaType": {"type": "string"}, + "contentSchema": {"$dynamicRef": "#meta"} + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json new file mode 100644 index 000000000..4c8e5cb61 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json @@ -0,0 +1,51 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/core", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/core": true + }, + "$dynamicAnchor": "meta", + + "title": "Core vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "$id": { + "$ref": "#/$defs/uriReferenceString", + "$comment": "Non-empty fragments not allowed.", + "pattern": "^[^#]*#?$" + }, + "$schema": {"$ref": "#/$defs/uriString"}, + "$ref": {"$ref": "#/$defs/uriReferenceString"}, + "$anchor": {"$ref": "#/$defs/anchorString"}, + "$dynamicRef": {"$ref": "#/$defs/uriReferenceString"}, + "$dynamicAnchor": {"$ref": "#/$defs/anchorString"}, + "$vocabulary": { + "type": "object", + "propertyNames": {"$ref": "#/$defs/uriString"}, + "additionalProperties": { + "type": "boolean" + } + }, + "$comment": { + "type": "string" + }, + "$defs": { + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"} + } + }, + "$defs": { + "anchorString": { + "type": "string", + "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" + }, + "uriString": { + "type": "string", + "format": "uri" + }, + "uriReferenceString": { + "type": "string", + "format": "uri-reference" + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json new file mode 100644 index 000000000..83c26e35f --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/format-annotation": true + }, + "$dynamicAnchor": "meta", + + "title": "Format vocabulary meta-schema for annotation results", + "type": ["object", "boolean"], + "properties": { + "format": {"type": "string"} + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json new file mode 100644 index 000000000..11946fb50 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/meta-data": true + }, + "$dynamicAnchor": "meta", + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "deprecated": { + "type": "boolean", + "default": false + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json new file mode 100644 index 000000000..5e4b203b2 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/unevaluated": true + }, + "$dynamicAnchor": "meta", + + "title": "Unevaluated applicator vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "unevaluatedItems": {"$dynamicRef": "#meta"}, + "unevaluatedProperties": {"$dynamicRef": "#meta"} + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json new file mode 100644 index 000000000..e0ae13d9d --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json @@ -0,0 +1,90 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/validation": true + }, + "$dynamicAnchor": "meta", + + "title": "Validation vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "type": { + "anyOf": [ + {"$ref": "#/$defs/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/$defs/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, + "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, + "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, + "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/$defs/stringArray"}, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json b/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json new file mode 100644 index 000000000..1c68270fd --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://json-schema.org/draft/2020-12/schema", + "$vocabulary": { + "https://json-schema.org/draft/2020-12/vocab/core": true, + "https://json-schema.org/draft/2020-12/vocab/applicator": true, + "https://json-schema.org/draft/2020-12/vocab/unevaluated": true, + "https://json-schema.org/draft/2020-12/vocab/validation": true, + "https://json-schema.org/draft/2020-12/vocab/meta-data": true, + "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + "$dynamicAnchor": "meta", + + "title": "Core and Validation specifications meta-schema", + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/unevaluated"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format-annotation"}, + {"$ref": "meta/content"} + ], + "type": ["object", "boolean"], + "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", + "properties": { + "definitions": { + "$comment": "\"definitions\" has been replaced by \"$defs\".", + "type": "object", + "additionalProperties": {"$dynamicRef": "#meta"}, + "deprecated": true, + "default": {} + }, + "dependencies": { + "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.", + "type": "object", + "additionalProperties": { + "anyOf": [{"$dynamicRef": "#meta"}, {"$ref": "meta/validation#/$defs/stringArray"}] + }, + "deprecated": true, + "default": {} + }, + "$recursiveAnchor": { + "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".", + "$ref": "meta/core#/$defs/anchorString", + "deprecated": true + }, + "$recursiveRef": { + "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".", + "$ref": "meta/core#/$defs/uriReferenceString", + "deprecated": true + } + } +} diff --git a/node_modules/ajv/lib/refs/json-schema-draft-06.json b/node_modules/ajv/lib/refs/json-schema-draft-06.json new file mode 100644 index 000000000..5410064ba --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-draft-06.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "http://json-schema.org/draft-06/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "examples": { + "type": "array", + "items": {} + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": {} + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": {}, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": {} +} diff --git a/node_modules/ajv/lib/refs/json-schema-draft-07.json b/node_modules/ajv/lib/refs/json-schema-draft-07.json new file mode 100644 index 000000000..6a7485104 --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-draft-07.json @@ -0,0 +1,151 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] + }, + "simpleTypes": { + "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + "stringArray": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, + "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": {"$ref": "#"}, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], + "default": true + }, + "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, + "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": {"$ref": "#"}, + "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, + "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, + "required": {"$ref": "#/definitions/stringArray"}, + "additionalProperties": {"$ref": "#"}, + "definitions": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": {"$ref": "#"}, + "propertyNames": {"format": "regex"}, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] + } + }, + "propertyNames": {"$ref": "#"}, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + {"$ref": "#/definitions/simpleTypes"}, + { + "type": "array", + "items": {"$ref": "#/definitions/simpleTypes"}, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": {"type": "string"}, + "contentMediaType": {"type": "string"}, + "contentEncoding": {"type": "string"}, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"} + }, + "default": true +} diff --git a/node_modules/ajv/lib/refs/json-schema-secure.json b/node_modules/ajv/lib/refs/json-schema-secure.json new file mode 100644 index 000000000..3968abd5d --- /dev/null +++ b/node_modules/ajv/lib/refs/json-schema-secure.json @@ -0,0 +1,88 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#", + "title": "Meta-schema for the security assessment of JSON Schemas", + "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#"} + } + }, + "dependencies": { + "patternProperties": { + "description": "prevent slow validation of large property names", + "required": ["propertyNames"], + "properties": { + "propertyNames": { + "required": ["maxLength"] + } + } + }, + "uniqueItems": { + "description": "prevent slow validation of large non-scalar arrays", + "if": { + "properties": { + "uniqueItems": {"const": true}, + "items": { + "properties": { + "type": { + "anyOf": [ + { + "enum": ["object", "array"] + }, + { + "type": "array", + "contains": {"enum": ["object", "array"]} + } + ] + } + } + } + } + }, + "then": { + "required": ["maxItems"] + } + }, + "pattern": { + "description": "prevent slow pattern matching of large strings", + "required": ["maxLength"] + }, + "format": { + "description": "prevent slow format validation of large strings", + "required": ["maxLength"] + } + }, + "properties": { + "additionalItems": {"$ref": "#"}, + "additionalProperties": {"$ref": "#"}, + "dependencies": { + "additionalProperties": { + "anyOf": [{"type": "array"}, {"$ref": "#"}] + } + }, + "items": { + "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}] + }, + "definitions": { + "additionalProperties": {"$ref": "#"} + }, + "patternProperties": { + "additionalProperties": {"$ref": "#"} + }, + "properties": { + "additionalProperties": {"$ref": "#"} + }, + "if": {"$ref": "#"}, + "then": {"$ref": "#"}, + "else": {"$ref": "#"}, + "allOf": {"$ref": "#/definitions/schemaArray"}, + "anyOf": {"$ref": "#/definitions/schemaArray"}, + "oneOf": {"$ref": "#/definitions/schemaArray"}, + "not": {"$ref": "#"}, + "contains": {"$ref": "#"}, + "propertyNames": {"$ref": "#"} + } +} diff --git a/node_modules/ajv/lib/refs/jtd-schema.ts b/node_modules/ajv/lib/refs/jtd-schema.ts new file mode 100644 index 000000000..c01981289 --- /dev/null +++ b/node_modules/ajv/lib/refs/jtd-schema.ts @@ -0,0 +1,130 @@ +import {SchemaObject} from "../types" + +type MetaSchema = (root: boolean) => SchemaObject + +const shared: MetaSchema = (root) => { + const sch: SchemaObject = { + nullable: {type: "boolean"}, + metadata: { + optionalProperties: { + union: {elements: {ref: "schema"}}, + }, + additionalProperties: true, + }, + } + if (root) sch.definitions = {values: {ref: "schema"}} + return sch +} + +const emptyForm: MetaSchema = (root) => ({ + optionalProperties: shared(root), +}) + +const refForm: MetaSchema = (root) => ({ + properties: { + ref: {type: "string"}, + }, + optionalProperties: shared(root), +}) + +const typeForm: MetaSchema = (root) => ({ + properties: { + type: { + enum: [ + "boolean", + "timestamp", + "string", + "float32", + "float64", + "int8", + "uint8", + "int16", + "uint16", + "int32", + "uint32", + ], + }, + }, + optionalProperties: shared(root), +}) + +const enumForm: MetaSchema = (root) => ({ + properties: { + enum: {elements: {type: "string"}}, + }, + optionalProperties: shared(root), +}) + +const elementsForm: MetaSchema = (root) => ({ + properties: { + elements: {ref: "schema"}, + }, + optionalProperties: shared(root), +}) + +const propertiesForm: MetaSchema = (root) => ({ + properties: { + properties: {values: {ref: "schema"}}, + }, + optionalProperties: { + optionalProperties: {values: {ref: "schema"}}, + additionalProperties: {type: "boolean"}, + ...shared(root), + }, +}) + +const optionalPropertiesForm: MetaSchema = (root) => ({ + properties: { + optionalProperties: {values: {ref: "schema"}}, + }, + optionalProperties: { + additionalProperties: {type: "boolean"}, + ...shared(root), + }, +}) + +const discriminatorForm: MetaSchema = (root) => ({ + properties: { + discriminator: {type: "string"}, + mapping: { + values: { + metadata: { + union: [propertiesForm(false), optionalPropertiesForm(false)], + }, + }, + }, + }, + optionalProperties: shared(root), +}) + +const valuesForm: MetaSchema = (root) => ({ + properties: { + values: {ref: "schema"}, + }, + optionalProperties: shared(root), +}) + +const schema: MetaSchema = (root) => ({ + metadata: { + union: [ + emptyForm, + refForm, + typeForm, + enumForm, + elementsForm, + propertiesForm, + optionalPropertiesForm, + discriminatorForm, + valuesForm, + ].map((s) => s(root)), + }, +}) + +const jtdMetaSchema: SchemaObject = { + definitions: { + schema: schema(false), + }, + ...schema(true), +} + +export default jtdMetaSchema diff --git a/node_modules/ajv/lib/runtime/equal.ts b/node_modules/ajv/lib/runtime/equal.ts new file mode 100644 index 000000000..3cb00631a --- /dev/null +++ b/node_modules/ajv/lib/runtime/equal.ts @@ -0,0 +1,7 @@ +// https://github.com/ajv-validator/ajv/issues/889 +import * as equal from "fast-deep-equal" + +type Equal = typeof equal & {code: string} +;(equal as Equal).code = 'require("ajv/dist/runtime/equal").default' + +export default equal as Equal diff --git a/node_modules/ajv/lib/runtime/parseJson.ts b/node_modules/ajv/lib/runtime/parseJson.ts new file mode 100644 index 000000000..92579afeb --- /dev/null +++ b/node_modules/ajv/lib/runtime/parseJson.ts @@ -0,0 +1,176 @@ +const rxParseJson = /position\s(\d+)$/ + +export function parseJson(s: string, pos: number): unknown { + let endPos: number | undefined + parseJson.message = undefined + let matches: RegExpExecArray | null + if (pos) s = s.slice(pos) + try { + parseJson.position = pos + s.length + return JSON.parse(s) + } catch (e) { + matches = rxParseJson.exec((e as Error).message) + if (!matches) { + parseJson.message = "unexpected end" + return undefined + } + endPos = +matches[1] + const c = s[endPos] + s = s.slice(0, endPos) + parseJson.position = pos + endPos + try { + return JSON.parse(s) + } catch (e1) { + parseJson.message = `unexpected token ${c}` + return undefined + } + } +} + +parseJson.message = undefined as string | undefined +parseJson.position = 0 as number +parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson' + +export function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined { + let numStr = "" + let c: string + parseJsonNumber.message = undefined + if (s[pos] === "-") { + numStr += "-" + pos++ + } + if (s[pos] === "0") { + numStr += "0" + pos++ + } else { + if (!parseDigits(maxDigits)) { + errorMessage() + return undefined + } + } + if (maxDigits) { + parseJsonNumber.position = pos + return +numStr + } + if (s[pos] === ".") { + numStr += "." + pos++ + if (!parseDigits()) { + errorMessage() + return undefined + } + } + if (((c = s[pos]), c === "e" || c === "E")) { + numStr += "e" + pos++ + if (((c = s[pos]), c === "+" || c === "-")) { + numStr += c + pos++ + } + if (!parseDigits()) { + errorMessage() + return undefined + } + } + parseJsonNumber.position = pos + return +numStr + + function parseDigits(maxLen?: number): boolean { + let digit = false + while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) { + digit = true + numStr += c + pos++ + } + return digit + } + + function errorMessage(): void { + parseJsonNumber.position = pos + parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end" + } +} + +parseJsonNumber.message = undefined as string | undefined +parseJsonNumber.position = 0 as number +parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber' + +const escapedChars: {[X in string]?: string} = { + b: "\b", + f: "\f", + n: "\n", + r: "\r", + t: "\t", + '"': '"', + "/": "/", + "\\": "\\", +} + +const CODE_A: number = "a".charCodeAt(0) +const CODE_0: number = "0".charCodeAt(0) + +export function parseJsonString(s: string, pos: number): string | undefined { + let str = "" + let c: string | undefined + parseJsonString.message = undefined + // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition + while (true) { + c = s[pos++] + if (c === '"') break + if (c === "\\") { + c = s[pos] + if (c in escapedChars) { + str += escapedChars[c] + pos++ + } else if (c === "u") { + pos++ + let count = 4 + let code = 0 + while (count--) { + code <<= 4 + c = s[pos] + if (c === undefined) { + errorMessage("unexpected end") + return undefined + } + c = c.toLowerCase() + if (c >= "a" && c <= "f") { + code += c.charCodeAt(0) - CODE_A + 10 + } else if (c >= "0" && c <= "9") { + code += c.charCodeAt(0) - CODE_0 + } else { + errorMessage(`unexpected token ${c}`) + return undefined + } + pos++ + } + str += String.fromCharCode(code) + } else { + errorMessage(`unexpected token ${c}`) + return undefined + } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + } else if (c === undefined) { + errorMessage("unexpected end") + return undefined + } else { + if (c.charCodeAt(0) >= 0x20) { + str += c + } else { + errorMessage(`unexpected token ${c}`) + return undefined + } + } + } + parseJsonString.position = pos + return str + + function errorMessage(msg: string): void { + parseJsonString.position = pos + parseJsonString.message = msg + } +} + +parseJsonString.message = undefined as string | undefined +parseJsonString.position = 0 as number +parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString' diff --git a/node_modules/ajv/lib/runtime/quote.ts b/node_modules/ajv/lib/runtime/quote.ts new file mode 100644 index 000000000..1160e6a23 --- /dev/null +++ b/node_modules/ajv/lib/runtime/quote.ts @@ -0,0 +1,31 @@ +const rxEscapable = + // eslint-disable-next-line no-control-regex, no-misleading-character-class + /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g + +const escaped: {[K in string]?: string} = { + "\b": "\\b", + "\t": "\\t", + "\n": "\\n", + "\f": "\\f", + "\r": "\\r", + '"': '\\"', + "\\": "\\\\", +} + +export default function quote(s: string): string { + rxEscapable.lastIndex = 0 + return ( + '"' + + (rxEscapable.test(s) + ? s.replace(rxEscapable, (a) => { + const c = escaped[a] + return typeof c === "string" + ? c + : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) + }) + : s) + + '"' + ) +} + +quote.code = 'require("ajv/dist/runtime/quote").default' diff --git a/node_modules/ajv/lib/runtime/re2.ts b/node_modules/ajv/lib/runtime/re2.ts new file mode 100644 index 000000000..0c769bc7a --- /dev/null +++ b/node_modules/ajv/lib/runtime/re2.ts @@ -0,0 +1,6 @@ +import * as re2 from "re2" + +type Re2 = typeof re2 & {code: string} +;(re2 as Re2).code = 'require("ajv/dist/runtime/re2").default' + +export default re2 as Re2 diff --git a/node_modules/ajv/lib/runtime/timestamp.ts b/node_modules/ajv/lib/runtime/timestamp.ts new file mode 100644 index 000000000..1625f9a40 --- /dev/null +++ b/node_modules/ajv/lib/runtime/timestamp.ts @@ -0,0 +1,46 @@ +const DT_SEPARATOR = /t|\s/i +const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/ +const TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i +const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] + +export default function validTimestamp(str: string, allowDate: boolean): boolean { + // http://tools.ietf.org/html/rfc3339#section-5.6 + const dt: string[] = str.split(DT_SEPARATOR) + return ( + (dt.length === 2 && validDate(dt[0]) && validTime(dt[1])) || + (allowDate && dt.length === 1 && validDate(dt[0])) + ) +} + +function validDate(str: string): boolean { + const matches: string[] | null = DATE.exec(str) + if (!matches) return false + const y: number = +matches[1] + const m: number = +matches[2] + const d: number = +matches[3] + return ( + m >= 1 && + m <= 12 && + d >= 1 && + (d <= DAYS[m] || + // leap year: https://tools.ietf.org/html/rfc3339#appendix-C + (m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0))) + ) +} + +function validTime(str: string): boolean { + const matches: string[] | null = TIME.exec(str) + if (!matches) return false + const hr: number = +matches[1] + const min: number = +matches[2] + const sec: number = +matches[3] + const tzH: number = +(matches[4] || 0) + const tzM: number = +(matches[5] || 0) + return ( + (hr <= 23 && min <= 59 && sec <= 59) || + // leap second + (hr - tzH === 23 && min - tzM === 59 && sec === 60) + ) +} + +validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default' diff --git a/node_modules/ajv/lib/runtime/ucs2length.ts b/node_modules/ajv/lib/runtime/ucs2length.ts new file mode 100644 index 000000000..47d8292b8 --- /dev/null +++ b/node_modules/ajv/lib/runtime/ucs2length.ts @@ -0,0 +1,20 @@ +// https://mathiasbynens.be/notes/javascript-encoding +// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode +export default function ucs2length(str: string): number { + const len = str.length + let length = 0 + let pos = 0 + let value: number + while (pos < len) { + length++ + value = str.charCodeAt(pos++) + if (value >= 0xd800 && value <= 0xdbff && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos) + if ((value & 0xfc00) === 0xdc00) pos++ // low surrogate + } + } + return length +} + +ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default' diff --git a/node_modules/ajv/lib/runtime/uri.ts b/node_modules/ajv/lib/runtime/uri.ts new file mode 100644 index 000000000..7dd35f9d1 --- /dev/null +++ b/node_modules/ajv/lib/runtime/uri.ts @@ -0,0 +1,6 @@ +import * as uri from "uri-js" + +type URI = typeof uri & {code: string} +;(uri as URI).code = 'require("ajv/dist/runtime/uri").default' + +export default uri as URI diff --git a/node_modules/ajv/lib/runtime/validation_error.ts b/node_modules/ajv/lib/runtime/validation_error.ts new file mode 100644 index 000000000..2d19a46a2 --- /dev/null +++ b/node_modules/ajv/lib/runtime/validation_error.ts @@ -0,0 +1,13 @@ +import type {ErrorObject} from "../types" + +export default class ValidationError extends Error { + readonly errors: Partial[] + readonly ajv: true + readonly validation: true + + constructor(errors: Partial[]) { + super("validation failed") + this.errors = errors + this.ajv = this.validation = true + } +} diff --git a/node_modules/ajv/lib/standalone/index.ts b/node_modules/ajv/lib/standalone/index.ts new file mode 100644 index 000000000..b6129ce9e --- /dev/null +++ b/node_modules/ajv/lib/standalone/index.ts @@ -0,0 +1,100 @@ +import type AjvCore from "../core" +import type {AnyValidateFunction, SourceCode} from "../types" +import type {SchemaEnv} from "../compile" +import {UsedScopeValues, UsedValueState, ValueScopeName, varKinds} from "../compile/codegen/scope" +import {_, nil, _Code, Code, getProperty, getEsmExportName} from "../compile/codegen/code" + +function standaloneCode( + ajv: AjvCore, + refsOrFunc?: {[K in string]?: string} | AnyValidateFunction +): string { + if (!ajv.opts.code.source) { + throw new Error("moduleCode: ajv instance must have code.source option") + } + const {_n} = ajv.scope.opts + return typeof refsOrFunc == "function" + ? funcExportCode(refsOrFunc.source) + : refsOrFunc !== undefined + ? multiExportsCode(refsOrFunc, getValidate) + : multiExportsCode(ajv.schemas, (sch) => + sch.meta ? undefined : ajv.compile(sch.schema) + ) + + function getValidate(id: string): AnyValidateFunction { + const v = ajv.getSchema(id) + if (!v) throw new Error(`moduleCode: no schema with id ${id}`) + return v + } + + function funcExportCode(source?: SourceCode): string { + const usedValues: UsedScopeValues = {} + const n = source?.validateName + const vCode = validateCode(usedValues, source) + if (ajv.opts.code.esm) { + // Always do named export as `validate` rather than the variable `n` which is `validateXX` for known export value + return `"use strict";${_n}export const validate = ${n};${_n}export default ${n};${_n}${vCode}` + } + return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}` + } + + function multiExportsCode( + schemas: {[K in string]?: T}, + getValidateFunc: (schOrId: T) => AnyValidateFunction | undefined + ): string { + const usedValues: UsedScopeValues = {} + let code = _`"use strict";` + for (const name in schemas) { + const v = getValidateFunc(schemas[name] as T) + if (v) { + const vCode = validateCode(usedValues, v.source) + const exportSyntax = ajv.opts.code.esm + ? _`export const ${getEsmExportName(name)}` + : _`exports${getProperty(name)}` + code = _`${code}${_n}${exportSyntax} = ${v.source?.validateName};${_n}${vCode}` + } + } + return `${code}` + } + + function validateCode(usedValues: UsedScopeValues, s?: SourceCode): Code { + if (!s) throw new Error('moduleCode: function does not have "source" property') + if (usedState(s.validateName) === UsedValueState.Completed) return nil + setUsedState(s.validateName, UsedValueState.Started) + + const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode) + const code = new _Code(`${scopeCode}${_n}${s.validateCode}`) + return s.evaluated ? _`${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code + + function refValidateCode(n: ValueScopeName): Code | undefined { + const vRef = n.value?.ref + if (n.prefix === "validate" && typeof vRef == "function") { + const v = vRef as AnyValidateFunction + return validateCode(usedValues, v.source) + } else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") { + const {validate, validateName} = vRef as SchemaEnv + if (!validateName) throw new Error("ajv internal error") + const def = ajv.opts.code.es5 ? varKinds.var : varKinds.const + const wrapper = _`${def} ${n} = {validate: ${validateName}};` + if (usedState(validateName) === UsedValueState.Started) return wrapper + const vCode = validateCode(usedValues, validate?.source) + return _`${wrapper}${_n}${vCode}` + } + return undefined + } + + function usedState(name: ValueScopeName): UsedValueState | undefined { + return usedValues[name.prefix]?.get(name) + } + + function setUsedState(name: ValueScopeName, state: UsedValueState): void { + const {prefix} = name + const names = (usedValues[prefix] = usedValues[prefix] || new Map()) + names.set(name, state) + } + } +} + +module.exports = exports = standaloneCode +Object.defineProperty(exports, "__esModule", {value: true}) + +export default standaloneCode diff --git a/node_modules/ajv/lib/standalone/instance.ts b/node_modules/ajv/lib/standalone/instance.ts new file mode 100644 index 000000000..c4b2c30b5 --- /dev/null +++ b/node_modules/ajv/lib/standalone/instance.ts @@ -0,0 +1,36 @@ +import Ajv, {AnySchema, AnyValidateFunction, ErrorObject} from "../core" +import standaloneCode from "." +import * as requireFromString from "require-from-string" + +export default class AjvPack { + errors?: ErrorObject[] | null // errors from the last validation + constructor(readonly ajv: Ajv) {} + + validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise { + return Ajv.prototype.validate.call(this, schemaKeyRef, data) + } + + compile(schema: AnySchema, meta?: boolean): AnyValidateFunction { + return this.getStandalone(this.ajv.compile(schema, meta)) + } + + getSchema(keyRef: string): AnyValidateFunction | undefined { + const v = this.ajv.getSchema(keyRef) + if (!v) return undefined + return this.getStandalone(v) + } + + private getStandalone(v: AnyValidateFunction): AnyValidateFunction { + return requireFromString(standaloneCode(this.ajv, v)) as AnyValidateFunction + } + + addSchema(...args: Parameters): AjvPack { + this.ajv.addSchema.call(this.ajv, ...args) + return this + } + + addKeyword(...args: Parameters): AjvPack { + this.ajv.addKeyword.call(this.ajv, ...args) + return this + } +} diff --git a/node_modules/ajv/lib/types/index.ts b/node_modules/ajv/lib/types/index.ts new file mode 100644 index 000000000..123d9df16 --- /dev/null +++ b/node_modules/ajv/lib/types/index.ts @@ -0,0 +1,240 @@ +import * as URI from "uri-js" +import type {CodeGen, Code, Name, ScopeValueSets, ValueScopeName} from "../compile/codegen" +import type {SchemaEnv, SchemaCxt, SchemaObjCxt} from "../compile" +import type {JSONType} from "../compile/rules" +import type {KeywordCxt} from "../compile/validate" +import type Ajv from "../core" + +interface _SchemaObject { + id?: string + $id?: string + $schema?: string + [x: string]: any // TODO +} + +export interface SchemaObject extends _SchemaObject { + id?: string + $id?: string + $schema?: string + $async?: false + [x: string]: any // TODO +} + +export interface AsyncSchema extends _SchemaObject { + $async: true +} + +export type AnySchemaObject = SchemaObject | AsyncSchema + +export type Schema = SchemaObject | boolean + +export type AnySchema = Schema | AsyncSchema + +export type SchemaMap = {[Key in string]?: AnySchema} + +export interface SourceCode { + validateName: ValueScopeName + validateCode: string + scopeValues: ScopeValueSets + evaluated?: Code +} + +export interface DataValidationCxt { + instancePath: string + parentData: {[K in T]: any} // object or array + parentDataProperty: T // string or number + rootData: Record | any[] + dynamicAnchors: {[Ref in string]?: ValidateFunction} +} + +export interface ValidateFunction { + (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T + errors?: null | ErrorObject[] + evaluated?: Evaluated + schema: AnySchema + schemaEnv: SchemaEnv + source?: SourceCode +} + +export interface JTDParser { + (json: string): T | undefined + message?: string + position?: number +} + +export type EvaluatedProperties = {[K in string]?: true} | true + +export type EvaluatedItems = number | true + +export interface Evaluated { + // determined at compile time if staticProps/Items is true + props?: EvaluatedProperties + items?: EvaluatedItems + // whether props/items determined at compile time + dynamicProps: boolean + dynamicItems: boolean +} + +export interface AsyncValidateFunction extends ValidateFunction { + (...args: Parameters>): Promise + $async: true +} + +export type AnyValidateFunction = ValidateFunction | AsyncValidateFunction + +export interface ErrorObject, S = unknown> { + keyword: K + instancePath: string + schemaPath: string + params: P + // Added to validation errors of "propertyNames" keyword schema + propertyName?: string + // Excluded if option `messages` set to false. + message?: string + // These are added with the `verbose` option. + schema?: S + parentSchema?: AnySchemaObject + data?: unknown +} + +export type ErrorNoParams = ErrorObject, S> + +interface _KeywordDef { + keyword: string | string[] + type?: JSONType | JSONType[] // data types that keyword applies to + schemaType?: JSONType | JSONType[] // allowed type(s) of keyword value in the schema + allowUndefined?: boolean // used for keywords that can be invoked by other keywords, not being present in the schema + $data?: boolean // keyword supports [$data reference](../../docs/guide/combining-schemas.md#data-reference) + implements?: string[] // other schema keywords that this keyword implements + before?: string // keyword should be executed before this keyword (should be applicable to the same type) + post?: boolean // keyword should be executed after other keywords without post flag + metaSchema?: AnySchemaObject // meta-schema for keyword schema value - it is better to use schemaType where applicable + validateSchema?: AnyValidateFunction // compiled keyword metaSchema - should not be passed + dependencies?: string[] // keywords that must be present in the same schema + error?: KeywordErrorDefinition + $dataError?: KeywordErrorDefinition +} + +export interface CodeKeywordDefinition extends _KeywordDef { + code: (cxt: KeywordCxt, ruleType?: string) => void + trackErrors?: boolean +} + +export type MacroKeywordFunc = ( + schema: any, + parentSchema: AnySchemaObject, + it: SchemaCxt +) => AnySchema + +export type CompileKeywordFunc = ( + schema: any, + parentSchema: AnySchemaObject, + it: SchemaObjCxt +) => DataValidateFunction + +export interface DataValidateFunction { + (...args: Parameters): boolean | Promise + errors?: Partial[] +} + +export interface SchemaValidateFunction { + (schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): + | boolean + | Promise + errors?: Partial[] +} + +export interface FuncKeywordDefinition extends _KeywordDef { + validate?: SchemaValidateFunction | DataValidateFunction + compile?: CompileKeywordFunc + // schema: false makes validate not to expect schema (DataValidateFunction) + schema?: boolean // requires "validate" + modifying?: boolean + async?: boolean + valid?: boolean + errors?: boolean | "full" +} + +export interface MacroKeywordDefinition extends FuncKeywordDefinition { + macro: MacroKeywordFunc +} + +export type KeywordDefinition = + | CodeKeywordDefinition + | FuncKeywordDefinition + | MacroKeywordDefinition + +export type AddedKeywordDefinition = KeywordDefinition & { + type: JSONType[] + schemaType: JSONType[] +} + +export interface KeywordErrorDefinition { + message: string | Code | ((cxt: KeywordErrorCxt) => string | Code) + params?: Code | ((cxt: KeywordErrorCxt) => Code) +} + +export type Vocabulary = (KeywordDefinition | string)[] + +export interface KeywordErrorCxt { + gen: CodeGen + keyword: string + data: Name + $data?: string | false + schema: any // TODO + parentSchema?: AnySchemaObject + schemaCode: Code | number | boolean + schemaValue: Code | number | boolean + schemaType?: JSONType[] + errsCount?: Name + params: KeywordCxtParams + it: SchemaCxt +} + +export type KeywordCxtParams = {[P in string]?: Code | string | number} + +export type FormatValidator = (data: T) => boolean + +export type FormatCompare = (data1: T, data2: T) => number | undefined + +export type AsyncFormatValidator = (data: T) => Promise + +export interface FormatDefinition { + type?: T extends string ? "string" | undefined : "number" + validate: FormatValidator | (T extends string ? string | RegExp : never) + async?: false | undefined + compare?: FormatCompare +} + +export interface AsyncFormatDefinition { + type?: T extends string ? "string" | undefined : "number" + validate: AsyncFormatValidator + async: true + compare?: FormatCompare +} + +export type AddedFormat = + | true + | RegExp + | FormatValidator + | FormatDefinition + | FormatDefinition + | AsyncFormatDefinition + | AsyncFormatDefinition + +export type Format = AddedFormat | string + +export interface RegExpEngine { + (pattern: string, u: string): RegExpLike + code: string +} + +export interface RegExpLike { + test: (s: string) => boolean +} + +export interface UriResolver { + parse(uri: string): URI.URIComponents + resolve(base: string, path: string): string + serialize(component: URI.URIComponents): string +} diff --git a/node_modules/ajv/lib/types/json-schema.ts b/node_modules/ajv/lib/types/json-schema.ts new file mode 100644 index 000000000..281a38bdb --- /dev/null +++ b/node_modules/ajv/lib/types/json-schema.ts @@ -0,0 +1,187 @@ +/* eslint-disable @typescript-eslint/no-empty-interface */ +type StrictNullChecksWrapper = undefined extends null + ? `strictNullChecks must be true in tsconfig to use ${Name}` + : Type + +type UnionToIntersection = (U extends any ? (_: U) => void : never) extends (_: infer I) => void + ? I + : never + +export type SomeJSONSchema = UncheckedJSONSchemaType + +type UncheckedPartialSchema = Partial> + +export type PartialSchema = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema> + +type JSONType = IsPartial extends true + ? T | undefined + : T + +interface NumberKeywords { + minimum?: number + maximum?: number + exclusiveMinimum?: number + exclusiveMaximum?: number + multipleOf?: number + format?: string +} + +interface StringKeywords { + minLength?: number + maxLength?: number + pattern?: string + format?: string +} + +type UncheckedJSONSchemaType = ( + | // these two unions allow arbitrary unions of types + { + anyOf: readonly UncheckedJSONSchemaType[] + } + | { + oneOf: readonly UncheckedJSONSchemaType[] + } + // this union allows for { type: (primitive)[] } style schemas + | ({ + type: readonly (T extends number + ? JSONType<"number" | "integer", IsPartial> + : T extends string + ? JSONType<"string", IsPartial> + : T extends boolean + ? JSONType<"boolean", IsPartial> + : never)[] + } & UnionToIntersection< + T extends number + ? NumberKeywords + : T extends string + ? StringKeywords + : T extends boolean + ? // eslint-disable-next-line @typescript-eslint/ban-types + {} + : never + >) + // this covers "normal" types; it's last so typescript looks to it first for errors + | ((T extends number + ? { + type: JSONType<"number" | "integer", IsPartial> + } & NumberKeywords + : T extends string + ? { + type: JSONType<"string", IsPartial> + } & StringKeywords + : T extends boolean + ? { + type: JSONType<"boolean", IsPartial> + } + : T extends readonly [any, ...any[]] + ? { + // JSON AnySchema for tuple + type: JSONType<"array", IsPartial> + items: { + readonly [K in keyof T]-?: UncheckedJSONSchemaType & Nullable + } & {length: T["length"]} + minItems: T["length"] + } & ({maxItems: T["length"]} | {additionalItems: false}) + : T extends readonly any[] + ? { + type: JSONType<"array", IsPartial> + items: UncheckedJSONSchemaType + contains?: UncheckedPartialSchema + minItems?: number + maxItems?: number + minContains?: number + maxContains?: number + uniqueItems?: true + additionalItems?: never + } + : T extends Record + ? { + // JSON AnySchema for records and dictionaries + // "required" is not optional because it is often forgotten + // "properties" are optional for more concise dictionary schemas + // "patternProperties" and can be only used with interfaces that have string index + type: JSONType<"object", IsPartial> + additionalProperties?: boolean | UncheckedJSONSchemaType + unevaluatedProperties?: boolean | UncheckedJSONSchemaType + properties?: IsPartial extends true + ? Partial> + : UncheckedPropertiesSchema + patternProperties?: Record> + propertyNames?: Omit, "type"> & {type?: "string"} + dependencies?: {[K in keyof T]?: Readonly<(keyof T)[]> | UncheckedPartialSchema} + dependentRequired?: {[K in keyof T]?: Readonly<(keyof T)[]>} + dependentSchemas?: {[K in keyof T]?: UncheckedPartialSchema} + minProperties?: number + maxProperties?: number + } & (IsPartial extends true // "required" is not necessary if it's a non-partial type with no required keys // are listed it only asserts that optional cannot be listed. // "required" type does not guarantee that all required properties + ? {required: Readonly<(keyof T)[]>} + : [UncheckedRequiredMembers] extends [never] + ? {required?: Readonly[]>} + : {required: Readonly[]>}) + : T extends null + ? { + type: JSONType<"null", IsPartial> + nullable: true + } + : never) & { + allOf?: Readonly[]> + anyOf?: Readonly[]> + oneOf?: Readonly[]> + if?: UncheckedPartialSchema + then?: UncheckedPartialSchema + else?: UncheckedPartialSchema + not?: UncheckedPartialSchema + }) +) & { + [keyword: string]: any + $id?: string + $ref?: string + $defs?: Record> + definitions?: Record> +} + +export type JSONSchemaType = StrictNullChecksWrapper< + "JSONSchemaType", + UncheckedJSONSchemaType +> + +type Known = + | {[key: string]: Known} + | [Known, ...Known[]] + | Known[] + | number + | string + | boolean + | null + +type UncheckedPropertiesSchema = { + [K in keyof T]-?: (UncheckedJSONSchemaType & Nullable) | {$ref: string} +} + +export type PropertiesSchema = StrictNullChecksWrapper< + "PropertiesSchema", + UncheckedPropertiesSchema +> + +type UncheckedRequiredMembers = { + [K in keyof T]-?: undefined extends T[K] ? never : K +}[keyof T] + +export type RequiredMembers = StrictNullChecksWrapper< + "RequiredMembers", + UncheckedRequiredMembers +> + +type Nullable = undefined extends T + ? { + nullable: true + const?: null // any non-null value would fail `const: null`, `null` would fail any other value in const + enum?: Readonly<(T | null)[]> // `null` must be explicitly included in "enum" for `null` to pass + default?: T | null + } + : { + nullable?: false + const?: T + enum?: Readonly + default?: T + } diff --git a/node_modules/ajv/lib/types/jtd-schema.ts b/node_modules/ajv/lib/types/jtd-schema.ts new file mode 100644 index 000000000..61b2bde81 --- /dev/null +++ b/node_modules/ajv/lib/types/jtd-schema.ts @@ -0,0 +1,273 @@ +/** numeric strings */ +type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" + +/** string strings */ +type StringType = "string" | "timestamp" + +/** Generic JTD Schema without inference of the represented type */ +export type SomeJTDSchemaType = ( + | // ref + {ref: string} + // primitives + | {type: NumberType | StringType | "boolean"} + // enum + | {enum: string[]} + // elements + | {elements: SomeJTDSchemaType} + // values + | {values: SomeJTDSchemaType} + // properties + | { + properties: Record + optionalProperties?: Record + additionalProperties?: boolean + } + | { + properties?: Record + optionalProperties: Record + additionalProperties?: boolean + } + // discriminator + | {discriminator: string; mapping: Record} + // empty + // NOTE see the end of + // https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492 + // eslint-disable-next-line @typescript-eslint/ban-types + | {} +) & { + nullable?: boolean + metadata?: Record + definitions?: Record +} + +/** required keys of an object, not undefined */ +type RequiredKeys = { + [K in keyof T]-?: undefined extends T[K] ? never : K +}[keyof T] + +/** optional or undifined-able keys of an object */ +type OptionalKeys = { + [K in keyof T]-?: undefined extends T[K] ? K : never +}[keyof T] + +/** type is true if T is a union type */ +type IsUnion_ = false extends ( + T extends unknown ? ([U] extends [T] ? false : true) : never +) + ? false + : true +type IsUnion = IsUnion_ + +/** type is true if T is identically E */ +type TypeEquality = [T] extends [E] ? ([E] extends [T] ? true : false) : false + +/** type is true if T or null is identically E or null*/ +type NullTypeEquality = TypeEquality + +/** gets only the string literals of a type or null if a type isn't a string literal */ +type EnumString = [T] extends [never] + ? null + : T extends string + ? string extends T + ? null + : T + : null + +/** true if type is a union of string literals */ +type IsEnum = null extends EnumString ? false : true + +/** true only if all types are array types (not tuples) */ +// NOTE relies on the fact that tuples don't have an index at 0.5, but arrays +// have an index at every number +type IsElements = false extends IsUnion + ? [T] extends [readonly unknown[]] + ? undefined extends T[0.5] + ? false + : true + : false + : false + +/** true if the the type is a values type */ +type IsValues = false extends IsUnion ? TypeEquality : false + +/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */ +type IsRecord = Union extends IsUnion + ? null extends EnumString + ? false + : true + : false + +/** true if type represents an empty record */ +type IsEmptyRecord = [T] extends [Record] + ? [T] extends [never] + ? false + : true + : false + +/** actual schema */ +export type JTDSchemaType = Record> = ( + | // refs - where null wasn't specified, must match exactly + (null extends EnumString + ? never + : + | ({[K in keyof D]: [T] extends [D[K]] ? {ref: K} : never}[keyof D] & {nullable?: false}) + // nulled refs - if ref is nullable and nullable is specified, then it can + // match either null or non-null definitions + | (null extends T + ? { + [K in keyof D]: [Exclude] extends [Exclude] + ? {ref: K} + : never + }[keyof D] & {nullable: true} + : never)) + // empty - empty schemas also treat nullable differently in that it's now fully ignored + | (unknown extends T ? {nullable?: boolean} : never) + // all other types // numbers - only accepts the type number + | ((true extends NullTypeEquality + ? {type: NumberType} + : // booleans - accepts the type boolean + true extends NullTypeEquality + ? {type: "boolean"} + : // strings - only accepts the type string + true extends NullTypeEquality + ? {type: StringType} + : // strings - only accepts the type Date + true extends NullTypeEquality + ? {type: "timestamp"} + : // enums - only accepts union of string literals + // TODO we can't actually check that everything in the union was specified + true extends IsEnum> + ? {enum: EnumString>[]} + : // arrays - only accepts arrays, could be array of unions to be resolved later + true extends IsElements> + ? T extends readonly (infer E)[] + ? { + elements: JTDSchemaType + } + : never + : // empty properties + true extends IsEmptyRecord> + ? + | {properties: Record; optionalProperties?: Record} + | {optionalProperties: Record} + : // values + true extends IsValues> + ? T extends Record + ? { + values: JTDSchemaType + } + : never + : // properties + true extends IsRecord, false> + ? ([RequiredKeys>] extends [never] + ? { + properties?: Record + } + : { + properties: {[K in RequiredKeys]: JTDSchemaType} + }) & + ([OptionalKeys>] extends [never] + ? { + optionalProperties?: Record + } + : { + optionalProperties: { + [K in OptionalKeys]: JTDSchemaType, D> + } + }) & { + additionalProperties?: boolean + } + : // discriminator + true extends IsRecord, true> + ? { + [K in keyof Exclude]-?: Exclude[K] extends string + ? { + discriminator: K + mapping: { + // TODO currently allows descriminator to be present in schema + [M in Exclude[K]]: JTDSchemaType< + Omit ? T : never, K>, + D + > + } + } + : never + }[keyof Exclude] + : never) & + (null extends T + ? { + nullable: true + } + : {nullable?: false})) +) & { + // extra properties + metadata?: Record + // TODO these should only be allowed at the top level + definitions?: {[K in keyof D]: JTDSchemaType} +} + +type JTDDataDef> = + | // ref + (S extends {ref: string} + ? D extends {[K in S["ref"]]: infer V} + ? JTDDataDef + : never + : // type + S extends {type: NumberType} + ? number + : S extends {type: "boolean"} + ? boolean + : S extends {type: "string"} + ? string + : S extends {type: "timestamp"} + ? string | Date + : // enum + S extends {enum: readonly (infer E)[]} + ? string extends E + ? never + : [E] extends [string] + ? E + : never + : // elements + S extends {elements: infer E} + ? JTDDataDef[] + : // properties + S extends { + properties: Record + optionalProperties?: Record + additionalProperties?: boolean + } + ? {-readonly [K in keyof S["properties"]]-?: JTDDataDef} & { + -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef< + S["optionalProperties"][K], + D + > + } & ([S["additionalProperties"]] extends [true] ? Record : unknown) + : S extends { + properties?: Record + optionalProperties: Record + additionalProperties?: boolean + } + ? {-readonly [K in keyof S["properties"]]-?: JTDDataDef} & { + -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef< + S["optionalProperties"][K], + D + > + } & ([S["additionalProperties"]] extends [true] ? Record : unknown) + : // values + S extends {values: infer V} + ? Record> + : // discriminator + S extends {discriminator: infer M; mapping: Record} + ? [M] extends [string] + ? { + [K in keyof S["mapping"]]: JTDDataDef & {[KM in M]: K} + }[keyof S["mapping"]] + : never + : // empty + unknown) + | (S extends {nullable: true} ? null : never) + +export type JTDDataType = S extends {definitions: Record} + ? JTDDataDef + : JTDDataDef> diff --git a/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts b/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts new file mode 100644 index 000000000..755e5b3da --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts @@ -0,0 +1,56 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, not, Name} from "../../compile/codegen" +import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util" + +export type AdditionalItemsError = ErrorObject<"additionalItems", {limit: number}, AnySchema> + +const error: KeywordErrorDefinition = { + message: ({params: {len}}) => str`must NOT have more than ${len} items`, + params: ({params: {len}}) => _`{limit: ${len}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "additionalItems" as const, + type: "array", + schemaType: ["boolean", "object"], + before: "uniqueItems", + error, + code(cxt: KeywordCxt) { + const {parentSchema, it} = cxt + const {items} = parentSchema + if (!Array.isArray(items)) { + checkStrictMode(it, '"additionalItems" is ignored when "items" is not an array of schemas') + return + } + validateAdditionalItems(cxt, items) + }, +} + +export function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void { + const {gen, schema, data, keyword, it} = cxt + it.items = true + const len = gen.const("len", _`${data}.length`) + if (schema === false) { + cxt.setParams({len: items.length}) + cxt.pass(_`${len} <= ${items.length}`) + } else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { + const valid = gen.var("valid", _`${len} <= ${items.length}`) // TODO var + gen.if(not(valid), () => validateItems(valid)) + cxt.ok(valid) + } + + function validateItems(valid: Name): void { + gen.forRange("i", items.length, len, (i) => { + cxt.subschema({keyword, dataProp: i, dataPropType: Type.Num}, valid) + if (!it.allErrors) gen.if(not(valid), () => gen.break()) + }) + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts b/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts new file mode 100644 index 000000000..bfb511ce5 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts @@ -0,0 +1,118 @@ +import type { + CodeKeywordDefinition, + AddedKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import {allSchemaProperties, usePattern, isOwnProperty} from "../code" +import {_, nil, or, not, Code, Name} from "../../compile/codegen" +import N from "../../compile/names" +import type {SubschemaArgs} from "../../compile/validate/subschema" +import {alwaysValidSchema, schemaRefOrVal, Type} from "../../compile/util" + +export type AdditionalPropertiesError = ErrorObject< + "additionalProperties", + {additionalProperty: string}, + AnySchema +> + +const error: KeywordErrorDefinition = { + message: "must NOT have additional properties", + params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, +} + +const def: CodeKeywordDefinition & AddedKeywordDefinition = { + keyword: "additionalProperties", + type: ["object"], + schemaType: ["boolean", "object"], + allowUndefined: true, + trackErrors: true, + error, + code(cxt) { + const {gen, schema, parentSchema, data, errsCount, it} = cxt + /* istanbul ignore if */ + if (!errsCount) throw new Error("ajv implementation error") + const {allErrors, opts} = it + it.props = true + if (opts.removeAdditional !== "all" && alwaysValidSchema(it, schema)) return + const props = allSchemaProperties(parentSchema.properties) + const patProps = allSchemaProperties(parentSchema.patternProperties) + checkAdditionalProperties() + cxt.ok(_`${errsCount} === ${N.errors}`) + + function checkAdditionalProperties(): void { + gen.forIn("key", data, (key: Name) => { + if (!props.length && !patProps.length) additionalPropertyCode(key) + else gen.if(isAdditional(key), () => additionalPropertyCode(key)) + }) + } + + function isAdditional(key: Name): Code { + let definedProp: Code + if (props.length > 8) { + // TODO maybe an option instead of hard-coded 8? + const propsSchema = schemaRefOrVal(it, parentSchema.properties, "properties") + definedProp = isOwnProperty(gen, propsSchema as Code, key) + } else if (props.length) { + definedProp = or(...props.map((p) => _`${key} === ${p}`)) + } else { + definedProp = nil + } + if (patProps.length) { + definedProp = or(definedProp, ...patProps.map((p) => _`${usePattern(cxt, p)}.test(${key})`)) + } + return not(definedProp) + } + + function deleteAdditional(key: Name): void { + gen.code(_`delete ${data}[${key}]`) + } + + function additionalPropertyCode(key: Name): void { + if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) { + deleteAdditional(key) + return + } + + if (schema === false) { + cxt.setParams({additionalProperty: key}) + cxt.error() + if (!allErrors) gen.break() + return + } + + if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { + const valid = gen.name("valid") + if (opts.removeAdditional === "failing") { + applyAdditionalSchema(key, valid, false) + gen.if(not(valid), () => { + cxt.reset() + deleteAdditional(key) + }) + } else { + applyAdditionalSchema(key, valid) + if (!allErrors) gen.if(not(valid), () => gen.break()) + } + } + } + + function applyAdditionalSchema(key: Name, valid: Name, errors?: false): void { + const subschema: SubschemaArgs = { + keyword: "additionalProperties", + dataProp: key, + dataPropType: Type.Str, + } + if (errors === false) { + Object.assign(subschema, { + compositeRule: true, + createErrors: false, + allErrors: false, + }) + } + cxt.subschema(subschema, valid) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/allOf.ts b/node_modules/ajv/lib/vocabularies/applicator/allOf.ts new file mode 100644 index 000000000..cdfa86ff4 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/allOf.ts @@ -0,0 +1,22 @@ +import type {CodeKeywordDefinition, AnySchema} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {alwaysValidSchema} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: "allOf", + schemaType: "array", + code(cxt: KeywordCxt) { + const {gen, schema, it} = cxt + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + const valid = gen.name("valid") + schema.forEach((sch: AnySchema, i: number) => { + if (alwaysValidSchema(it, sch)) return + const schCxt = cxt.subschema({keyword: "allOf", schemaProp: i}, valid) + cxt.ok(valid) + cxt.mergeEvaluated(schCxt) + }) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts b/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts new file mode 100644 index 000000000..bd331b5ae --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts @@ -0,0 +1,14 @@ +import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types" +import {validateUnion} from "../code" + +export type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]> + +const def: CodeKeywordDefinition = { + keyword: "anyOf", + schemaType: "array", + trackErrors: true, + code: validateUnion, + error: {message: "must match a schema in anyOf"}, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/contains.ts b/node_modules/ajv/lib/vocabularies/applicator/contains.ts new file mode 100644 index 000000000..d88675c6c --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/contains.ts @@ -0,0 +1,109 @@ +import type { + CodeKeywordDefinition, + KeywordErrorDefinition, + ErrorObject, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, Name} from "../../compile/codegen" +import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util" + +export type ContainsError = ErrorObject< + "contains", + {minContains: number; maxContains?: number}, + AnySchema +> + +const error: KeywordErrorDefinition = { + message: ({params: {min, max}}) => + max === undefined + ? str`must contain at least ${min} valid item(s)` + : str`must contain at least ${min} and no more than ${max} valid item(s)`, + params: ({params: {min, max}}) => + max === undefined ? _`{minContains: ${min}}` : _`{minContains: ${min}, maxContains: ${max}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "contains", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + trackErrors: true, + error, + code(cxt: KeywordCxt) { + const {gen, schema, parentSchema, data, it} = cxt + let min: number + let max: number | undefined + const {minContains, maxContains} = parentSchema + if (it.opts.next) { + min = minContains === undefined ? 1 : minContains + max = maxContains + } else { + min = 1 + } + const len = gen.const("len", _`${data}.length`) + cxt.setParams({min, max}) + if (max === undefined && min === 0) { + checkStrictMode(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`) + return + } + if (max !== undefined && min > max) { + checkStrictMode(it, `"minContains" > "maxContains" is always invalid`) + cxt.fail() + return + } + if (alwaysValidSchema(it, schema)) { + let cond = _`${len} >= ${min}` + if (max !== undefined) cond = _`${cond} && ${len} <= ${max}` + cxt.pass(cond) + return + } + + it.items = true + const valid = gen.name("valid") + if (max === undefined && min === 1) { + validateItems(valid, () => gen.if(valid, () => gen.break())) + } else if (min === 0) { + gen.let(valid, true) + if (max !== undefined) gen.if(_`${data}.length > 0`, validateItemsWithCount) + } else { + gen.let(valid, false) + validateItemsWithCount() + } + cxt.result(valid, () => cxt.reset()) + + function validateItemsWithCount(): void { + const schValid = gen.name("_valid") + const count = gen.let("count", 0) + validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))) + } + + function validateItems(_valid: Name, block: () => void): void { + gen.forRange("i", 0, len, (i) => { + cxt.subschema( + { + keyword: "contains", + dataProp: i, + dataPropType: Type.Num, + compositeRule: true, + }, + _valid + ) + block() + }) + } + + function checkLimits(count: Name): void { + gen.code(_`${count}++`) + if (max === undefined) { + gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true).break()) + } else { + gen.if(_`${count} > ${max}`, () => gen.assign(valid, false).break()) + if (min === 1) gen.assign(valid, true) + else gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true)) + } + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts b/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts new file mode 100644 index 000000000..f67611286 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts @@ -0,0 +1,112 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + SchemaMap, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str} from "../../compile/codegen" +import {alwaysValidSchema} from "../../compile/util" +import {checkReportMissingProp, checkMissingProp, reportMissingProp, propertyInData} from "../code" + +export type PropertyDependencies = {[K in string]?: string[]} + +export interface DependenciesErrorParams { + property: string + missingProperty: string + depsCount: number + deps: string // TODO change to string[] +} + +type SchemaDependencies = SchemaMap + +export type DependenciesError = ErrorObject< + "dependencies", + DependenciesErrorParams, + {[K in string]?: string[] | AnySchema} +> + +export const error: KeywordErrorDefinition = { + message: ({params: {property, depsCount, deps}}) => { + const property_ies = depsCount === 1 ? "property" : "properties" + return str`must have ${property_ies} ${deps} when property ${property} is present` + }, + params: ({params: {property, depsCount, deps, missingProperty}}) => + _`{property: ${property}, + missingProperty: ${missingProperty}, + depsCount: ${depsCount}, + deps: ${deps}}`, // TODO change to reference +} + +const def: CodeKeywordDefinition = { + keyword: "dependencies", + type: "object", + schemaType: "object", + error, + code(cxt: KeywordCxt) { + const [propDeps, schDeps] = splitDependencies(cxt) + validatePropertyDeps(cxt, propDeps) + validateSchemaDeps(cxt, schDeps) + }, +} + +function splitDependencies({schema}: KeywordCxt): [PropertyDependencies, SchemaDependencies] { + const propertyDeps: PropertyDependencies = {} + const schemaDeps: SchemaDependencies = {} + for (const key in schema) { + if (key === "__proto__") continue + const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps + deps[key] = schema[key] + } + return [propertyDeps, schemaDeps] +} + +export function validatePropertyDeps( + cxt: KeywordCxt, + propertyDeps: {[K in string]?: string[]} = cxt.schema +): void { + const {gen, data, it} = cxt + if (Object.keys(propertyDeps).length === 0) return + const missing = gen.let("missing") + for (const prop in propertyDeps) { + const deps = propertyDeps[prop] as string[] + if (deps.length === 0) continue + const hasProperty = propertyInData(gen, data, prop, it.opts.ownProperties) + cxt.setParams({ + property: prop, + depsCount: deps.length, + deps: deps.join(", "), + }) + if (it.allErrors) { + gen.if(hasProperty, () => { + for (const depProp of deps) { + checkReportMissingProp(cxt, depProp) + } + }) + } else { + gen.if(_`${hasProperty} && (${checkMissingProp(cxt, deps, missing)})`) + reportMissingProp(cxt, missing) + gen.else() + } + } +} + +export function validateSchemaDeps(cxt: KeywordCxt, schemaDeps: SchemaMap = cxt.schema): void { + const {gen, data, keyword, it} = cxt + const valid = gen.name("valid") + for (const prop in schemaDeps) { + if (alwaysValidSchema(it, schemaDeps[prop] as AnySchema)) continue + gen.if( + propertyInData(gen, data, prop, it.opts.ownProperties), + () => { + const schCxt = cxt.subschema({keyword, schemaProp: prop}, valid) + cxt.mergeValidEvaluated(schCxt, valid) + }, + () => gen.var(valid, true) // TODO var + ) + cxt.ok(valid) + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts b/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts new file mode 100644 index 000000000..dbd3ae45c --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts @@ -0,0 +1,11 @@ +import type {CodeKeywordDefinition} from "../../types" +import {validateSchemaDeps} from "./dependencies" + +const def: CodeKeywordDefinition = { + keyword: "dependentSchemas", + type: "object", + schemaType: "object", + code: (cxt) => validateSchemaDeps(cxt), +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/if.ts b/node_modules/ajv/lib/vocabularies/applicator/if.ts new file mode 100644 index 000000000..5a40d5e3a --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/if.ts @@ -0,0 +1,80 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {SchemaObjCxt} from "../../compile" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, not, Name} from "../../compile/codegen" +import {alwaysValidSchema, checkStrictMode} from "../../compile/util" + +export type IfKeywordError = ErrorObject<"if", {failingKeyword: string}, AnySchema> + +const error: KeywordErrorDefinition = { + message: ({params}) => str`must match "${params.ifClause}" schema`, + params: ({params}) => _`{failingKeyword: ${params.ifClause}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "if", + schemaType: ["object", "boolean"], + trackErrors: true, + error, + code(cxt: KeywordCxt) { + const {gen, parentSchema, it} = cxt + if (parentSchema.then === undefined && parentSchema.else === undefined) { + checkStrictMode(it, '"if" without "then" and "else" is ignored') + } + const hasThen = hasSchema(it, "then") + const hasElse = hasSchema(it, "else") + if (!hasThen && !hasElse) return + + const valid = gen.let("valid", true) + const schValid = gen.name("_valid") + validateIf() + cxt.reset() + + if (hasThen && hasElse) { + const ifClause = gen.let("ifClause") + cxt.setParams({ifClause}) + gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)) + } else if (hasThen) { + gen.if(schValid, validateClause("then")) + } else { + gen.if(not(schValid), validateClause("else")) + } + + cxt.pass(valid, () => cxt.error(true)) + + function validateIf(): void { + const schCxt = cxt.subschema( + { + keyword: "if", + compositeRule: true, + createErrors: false, + allErrors: false, + }, + schValid + ) + cxt.mergeEvaluated(schCxt) + } + + function validateClause(keyword: string, ifClause?: Name): () => void { + return () => { + const schCxt = cxt.subschema({keyword}, schValid) + gen.assign(valid, schValid) + cxt.mergeValidEvaluated(schCxt, valid) + if (ifClause) gen.assign(ifClause, _`${keyword}`) + else cxt.setParams({ifClause: keyword}) + } + } + }, +} + +function hasSchema(it: SchemaObjCxt, keyword: string): boolean { + const schema = it.schema[keyword] + return schema !== undefined && !alwaysValidSchema(it, schema) +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/index.ts b/node_modules/ajv/lib/vocabularies/applicator/index.ts new file mode 100644 index 000000000..fc5271699 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/index.ts @@ -0,0 +1,53 @@ +import type {ErrorNoParams, Vocabulary} from "../../types" +import additionalItems, {AdditionalItemsError} from "./additionalItems" +import prefixItems from "./prefixItems" +import items from "./items" +import items2020, {ItemsError} from "./items2020" +import contains, {ContainsError} from "./contains" +import dependencies, {DependenciesError} from "./dependencies" +import propertyNames, {PropertyNamesError} from "./propertyNames" +import additionalProperties, {AdditionalPropertiesError} from "./additionalProperties" +import properties from "./properties" +import patternProperties from "./patternProperties" +import notKeyword, {NotKeywordError} from "./not" +import anyOf, {AnyOfError} from "./anyOf" +import oneOf, {OneOfError} from "./oneOf" +import allOf from "./allOf" +import ifKeyword, {IfKeywordError} from "./if" +import thenElse from "./thenElse" + +export default function getApplicator(draft2020 = false): Vocabulary { + const applicator = [ + // any + notKeyword, + anyOf, + oneOf, + allOf, + ifKeyword, + thenElse, + // object + propertyNames, + additionalProperties, + dependencies, + properties, + patternProperties, + ] + // array + if (draft2020) applicator.push(prefixItems, items2020) + else applicator.push(additionalItems, items) + applicator.push(contains) + return applicator +} + +export type ApplicatorKeywordError = + | ErrorNoParams<"false schema"> + | AdditionalItemsError + | ItemsError + | ContainsError + | AdditionalPropertiesError + | DependenciesError + | IfKeywordError + | AnyOfError + | OneOfError + | NotKeywordError + | PropertyNamesError diff --git a/node_modules/ajv/lib/vocabularies/applicator/items.ts b/node_modules/ajv/lib/vocabularies/applicator/items.ts new file mode 100644 index 000000000..033cb3977 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/items.ts @@ -0,0 +1,59 @@ +import type {CodeKeywordDefinition, AnySchema, AnySchemaObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_} from "../../compile/codegen" +import {alwaysValidSchema, mergeEvaluated, checkStrictMode} from "../../compile/util" +import {validateArray} from "../code" + +const def: CodeKeywordDefinition = { + keyword: "items", + type: "array", + schemaType: ["object", "array", "boolean"], + before: "uniqueItems", + code(cxt: KeywordCxt) { + const {schema, it} = cxt + if (Array.isArray(schema)) return validateTuple(cxt, "additionalItems", schema) + it.items = true + if (alwaysValidSchema(it, schema)) return + cxt.ok(validateArray(cxt)) + }, +} + +export function validateTuple( + cxt: KeywordCxt, + extraItems: string, + schArr: AnySchema[] = cxt.schema +): void { + const {gen, parentSchema, data, keyword, it} = cxt + checkStrictTuple(parentSchema) + if (it.opts.unevaluated && schArr.length && it.items !== true) { + it.items = mergeEvaluated.items(gen, schArr.length, it.items) + } + const valid = gen.name("valid") + const len = gen.const("len", _`${data}.length`) + schArr.forEach((sch: AnySchema, i: number) => { + if (alwaysValidSchema(it, sch)) return + gen.if(_`${len} > ${i}`, () => + cxt.subschema( + { + keyword, + schemaProp: i, + dataProp: i, + }, + valid + ) + ) + cxt.ok(valid) + }) + + function checkStrictTuple(sch: AnySchemaObject): void { + const {opts, errSchemaPath} = it + const l = schArr.length + const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false) + if (opts.strictTuples && !fullTuple) { + const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"` + checkStrictMode(it, msg, opts.strictTuples) + } + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/items2020.ts b/node_modules/ajv/lib/vocabularies/applicator/items2020.ts new file mode 100644 index 000000000..2a99b08d5 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/items2020.ts @@ -0,0 +1,36 @@ +import type { + CodeKeywordDefinition, + KeywordErrorDefinition, + ErrorObject, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str} from "../../compile/codegen" +import {alwaysValidSchema} from "../../compile/util" +import {validateArray} from "../code" +import {validateAdditionalItems} from "./additionalItems" + +export type ItemsError = ErrorObject<"items", {limit: number}, AnySchema> + +const error: KeywordErrorDefinition = { + message: ({params: {len}}) => str`must NOT have more than ${len} items`, + params: ({params: {len}}) => _`{limit: ${len}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "items", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + error, + code(cxt: KeywordCxt) { + const {schema, parentSchema, it} = cxt + const {prefixItems} = parentSchema + it.items = true + if (alwaysValidSchema(it, schema)) return + if (prefixItems) validateAdditionalItems(cxt, prefixItems) + else cxt.ok(validateArray(cxt)) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/not.ts b/node_modules/ajv/lib/vocabularies/applicator/not.ts new file mode 100644 index 000000000..8691db0bf --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/not.ts @@ -0,0 +1,38 @@ +import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {alwaysValidSchema} from "../../compile/util" + +export type NotKeywordError = ErrorNoParams<"not", AnySchema> + +const def: CodeKeywordDefinition = { + keyword: "not", + schemaType: ["object", "boolean"], + trackErrors: true, + code(cxt: KeywordCxt) { + const {gen, schema, it} = cxt + if (alwaysValidSchema(it, schema)) { + cxt.fail() + return + } + + const valid = gen.name("valid") + cxt.subschema( + { + keyword: "not", + compositeRule: true, + createErrors: false, + allErrors: false, + }, + valid + ) + + cxt.failResult( + valid, + () => cxt.reset(), + () => cxt.error() + ) + }, + error: {message: "must NOT be valid"}, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts b/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts new file mode 100644 index 000000000..c25353ffd --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts @@ -0,0 +1,82 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, Name} from "../../compile/codegen" +import {alwaysValidSchema} from "../../compile/util" +import {SchemaCxt} from "../../compile" + +export type OneOfError = ErrorObject< + "oneOf", + {passingSchemas: [number, number] | null}, + AnySchema[] +> + +const error: KeywordErrorDefinition = { + message: "must match exactly one schema in oneOf", + params: ({params}) => _`{passingSchemas: ${params.passing}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "oneOf", + schemaType: "array", + trackErrors: true, + error, + code(cxt: KeywordCxt) { + const {gen, schema, parentSchema, it} = cxt + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + if (it.opts.discriminator && parentSchema.discriminator) return + const schArr: AnySchema[] = schema + const valid = gen.let("valid", false) + const passing = gen.let("passing", null) + const schValid = gen.name("_valid") + cxt.setParams({passing}) + // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas + + gen.block(validateOneOf) + + cxt.result( + valid, + () => cxt.reset(), + () => cxt.error(true) + ) + + function validateOneOf(): void { + schArr.forEach((sch: AnySchema, i: number) => { + let schCxt: SchemaCxt | undefined + if (alwaysValidSchema(it, sch)) { + gen.var(schValid, true) + } else { + schCxt = cxt.subschema( + { + keyword: "oneOf", + schemaProp: i, + compositeRule: true, + }, + schValid + ) + } + + if (i > 0) { + gen + .if(_`${schValid} && ${valid}`) + .assign(valid, false) + .assign(passing, _`[${passing}, ${i}]`) + .else() + } + + gen.if(schValid, () => { + gen.assign(valid, true) + gen.assign(passing, i) + if (schCxt) cxt.mergeEvaluated(schCxt, Name) + }) + }) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts b/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts new file mode 100644 index 000000000..ea624e230 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts @@ -0,0 +1,91 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {allSchemaProperties, usePattern} from "../code" +import {_, not, Name} from "../../compile/codegen" +import {alwaysValidSchema, checkStrictMode} from "../../compile/util" +import {evaluatedPropsToName, Type} from "../../compile/util" +import {AnySchema} from "../../types" + +const def: CodeKeywordDefinition = { + keyword: "patternProperties", + type: "object", + schemaType: "object", + code(cxt: KeywordCxt) { + const {gen, schema, data, parentSchema, it} = cxt + const {opts} = it + const patterns = allSchemaProperties(schema) + const alwaysValidPatterns = patterns.filter((p) => + alwaysValidSchema(it, schema[p] as AnySchema) + ) + + if ( + patterns.length === 0 || + (alwaysValidPatterns.length === patterns.length && + (!it.opts.unevaluated || it.props === true)) + ) { + return + } + + const checkProperties = + opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties + const valid = gen.name("valid") + if (it.props !== true && !(it.props instanceof Name)) { + it.props = evaluatedPropsToName(gen, it.props) + } + const {props} = it + validatePatternProperties() + + function validatePatternProperties(): void { + for (const pat of patterns) { + if (checkProperties) checkMatchingProperties(pat) + if (it.allErrors) { + validateProperties(pat) + } else { + gen.var(valid, true) // TODO var + validateProperties(pat) + gen.if(valid) + } + } + } + + function checkMatchingProperties(pat: string): void { + for (const prop in checkProperties) { + if (new RegExp(pat).test(prop)) { + checkStrictMode( + it, + `property ${prop} matches pattern ${pat} (use allowMatchingProperties)` + ) + } + } + } + + function validateProperties(pat: string): void { + gen.forIn("key", data, (key) => { + gen.if(_`${usePattern(cxt, pat)}.test(${key})`, () => { + const alwaysValid = alwaysValidPatterns.includes(pat) + if (!alwaysValid) { + cxt.subschema( + { + keyword: "patternProperties", + schemaProp: pat, + dataProp: key, + dataPropType: Type.Str, + }, + valid + ) + } + + if (it.opts.unevaluated && props !== true) { + gen.assign(_`${props}[${key}]`, true) + } else if (!alwaysValid && !it.allErrors) { + // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) + // or if all properties were evaluated (props === true) + gen.if(not(valid), () => gen.break()) + } + }) + }) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts b/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts new file mode 100644 index 000000000..008fb2db1 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts @@ -0,0 +1,12 @@ +import type {CodeKeywordDefinition} from "../../types" +import {validateTuple} from "./items" + +const def: CodeKeywordDefinition = { + keyword: "prefixItems", + type: "array", + schemaType: ["array"], + before: "uniqueItems", + code: (cxt) => validateTuple(cxt, "items"), +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/properties.ts b/node_modules/ajv/lib/vocabularies/applicator/properties.ts new file mode 100644 index 000000000..a55b19ce5 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/properties.ts @@ -0,0 +1,57 @@ +import type {CodeKeywordDefinition} from "../../types" +import {KeywordCxt} from "../../compile/validate" +import {propertyInData, allSchemaProperties} from "../code" +import {alwaysValidSchema, toHash, mergeEvaluated} from "../../compile/util" +import apDef from "./additionalProperties" + +const def: CodeKeywordDefinition = { + keyword: "properties", + type: "object", + schemaType: "object", + code(cxt: KeywordCxt) { + const {gen, schema, parentSchema, data, it} = cxt + if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) { + apDef.code(new KeywordCxt(it, apDef, "additionalProperties")) + } + const allProps = allSchemaProperties(schema) + for (const prop of allProps) { + it.definedProperties.add(prop) + } + if (it.opts.unevaluated && allProps.length && it.props !== true) { + it.props = mergeEvaluated.props(gen, toHash(allProps), it.props) + } + const properties = allProps.filter((p) => !alwaysValidSchema(it, schema[p])) + if (properties.length === 0) return + const valid = gen.name("valid") + + for (const prop of properties) { + if (hasDefault(prop)) { + applyPropertySchema(prop) + } else { + gen.if(propertyInData(gen, data, prop, it.opts.ownProperties)) + applyPropertySchema(prop) + if (!it.allErrors) gen.else().var(valid, true) + gen.endIf() + } + cxt.it.definedProperties.add(prop) + cxt.ok(valid) + } + + function hasDefault(prop: string): boolean | undefined { + return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined + } + + function applyPropertySchema(prop: string): void { + cxt.subschema( + { + keyword: "properties", + schemaProp: prop, + dataProp: prop, + }, + valid + ) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts b/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts new file mode 100644 index 000000000..1c54d6052 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts @@ -0,0 +1,50 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, not} from "../../compile/codegen" +import {alwaysValidSchema} from "../../compile/util" + +export type PropertyNamesError = ErrorObject<"propertyNames", {propertyName: string}, AnySchema> + +const error: KeywordErrorDefinition = { + message: "property name must be valid", + params: ({params}) => _`{propertyName: ${params.propertyName}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "propertyNames", + type: "object", + schemaType: ["object", "boolean"], + error, + code(cxt: KeywordCxt) { + const {gen, schema, data, it} = cxt + if (alwaysValidSchema(it, schema)) return + const valid = gen.name("valid") + + gen.forIn("key", data, (key) => { + cxt.setParams({propertyName: key}) + cxt.subschema( + { + keyword: "propertyNames", + data: key, + dataTypes: ["string"], + propertyName: key, + compositeRule: true, + }, + valid + ) + gen.if(not(valid), () => { + cxt.error(true) + if (!it.allErrors) gen.break() + }) + }) + + cxt.ok(valid) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts b/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts new file mode 100644 index 000000000..5055182e8 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts @@ -0,0 +1,13 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {checkStrictMode} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: ["then", "else"], + schemaType: ["object", "boolean"], + code({keyword, parentSchema, it}: KeywordCxt) { + if (parentSchema.if === undefined) checkStrictMode(it, `"${keyword}" without "if" is ignored`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/code.ts b/node_modules/ajv/lib/vocabularies/code.ts new file mode 100644 index 000000000..92cdd5b04 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/code.ts @@ -0,0 +1,168 @@ +import type {AnySchema, SchemaMap} from "../types" +import type {SchemaCxt} from "../compile" +import type {KeywordCxt} from "../compile/validate" +import {CodeGen, _, and, or, not, nil, strConcat, getProperty, Code, Name} from "../compile/codegen" +import {alwaysValidSchema, Type} from "../compile/util" +import N from "../compile/names" +import {useFunc} from "../compile/util" +export function checkReportMissingProp(cxt: KeywordCxt, prop: string): void { + const {gen, data, it} = cxt + gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { + cxt.setParams({missingProperty: _`${prop}`}, true) + cxt.error() + }) +} + +export function checkMissingProp( + {gen, data, it: {opts}}: KeywordCxt, + properties: string[], + missing: Name +): Code { + return or( + ...properties.map((prop) => + and(noPropertyInData(gen, data, prop, opts.ownProperties), _`${missing} = ${prop}`) + ) + ) +} + +export function reportMissingProp(cxt: KeywordCxt, missing: Name): void { + cxt.setParams({missingProperty: missing}, true) + cxt.error() +} + +export function hasPropFunc(gen: CodeGen): Name { + return gen.scopeValue("func", { + // eslint-disable-next-line @typescript-eslint/unbound-method + ref: Object.prototype.hasOwnProperty, + code: _`Object.prototype.hasOwnProperty`, + }) +} + +export function isOwnProperty(gen: CodeGen, data: Name, property: Name | string): Code { + return _`${hasPropFunc(gen)}.call(${data}, ${property})` +} + +export function propertyInData( + gen: CodeGen, + data: Name, + property: Name | string, + ownProperties?: boolean +): Code { + const cond = _`${data}${getProperty(property)} !== undefined` + return ownProperties ? _`${cond} && ${isOwnProperty(gen, data, property)}` : cond +} + +export function noPropertyInData( + gen: CodeGen, + data: Name, + property: Name | string, + ownProperties?: boolean +): Code { + const cond = _`${data}${getProperty(property)} === undefined` + return ownProperties ? or(cond, not(isOwnProperty(gen, data, property))) : cond +} + +export function allSchemaProperties(schemaMap?: SchemaMap): string[] { + return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [] +} + +export function schemaProperties(it: SchemaCxt, schemaMap: SchemaMap): string[] { + return allSchemaProperties(schemaMap).filter( + (p) => !alwaysValidSchema(it, schemaMap[p] as AnySchema) + ) +} + +export function callValidateCode( + {schemaCode, data, it: {gen, topSchemaRef, schemaPath, errorPath}, it}: KeywordCxt, + func: Code, + context: Code, + passSchema?: boolean +): Code { + const dataAndSchema = passSchema ? _`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data + const valCxt: [Name, Code | number][] = [ + [N.instancePath, strConcat(N.instancePath, errorPath)], + [N.parentData, it.parentData], + [N.parentDataProperty, it.parentDataProperty], + [N.rootData, N.rootData], + ] + if (it.opts.dynamicRef) valCxt.push([N.dynamicAnchors, N.dynamicAnchors]) + const args = _`${dataAndSchema}, ${gen.object(...valCxt)}` + return context !== nil ? _`${func}.call(${context}, ${args})` : _`${func}(${args})` +} + +const newRegExp = _`new RegExp` + +export function usePattern({gen, it: {opts}}: KeywordCxt, pattern: string): Name { + const u = opts.unicodeRegExp ? "u" : "" + const {regExp} = opts.code + const rx = regExp(pattern, u) + + return gen.scopeValue("pattern", { + key: rx.toString(), + ref: rx, + code: _`${regExp.code === "new RegExp" ? newRegExp : useFunc(gen, regExp)}(${pattern}, ${u})`, + }) +} + +export function validateArray(cxt: KeywordCxt): Name { + const {gen, data, keyword, it} = cxt + const valid = gen.name("valid") + if (it.allErrors) { + const validArr = gen.let("valid", true) + validateItems(() => gen.assign(validArr, false)) + return validArr + } + gen.var(valid, true) + validateItems(() => gen.break()) + return valid + + function validateItems(notValid: () => void): void { + const len = gen.const("len", _`${data}.length`) + gen.forRange("i", 0, len, (i) => { + cxt.subschema( + { + keyword, + dataProp: i, + dataPropType: Type.Num, + }, + valid + ) + gen.if(not(valid), notValid) + }) + } +} + +export function validateUnion(cxt: KeywordCxt): void { + const {gen, schema, keyword, it} = cxt + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + const alwaysValid = schema.some((sch: AnySchema) => alwaysValidSchema(it, sch)) + if (alwaysValid && !it.opts.unevaluated) return + + const valid = gen.let("valid", false) + const schValid = gen.name("_valid") + + gen.block(() => + schema.forEach((_sch: AnySchema, i: number) => { + const schCxt = cxt.subschema( + { + keyword, + schemaProp: i, + compositeRule: true, + }, + schValid + ) + gen.assign(valid, _`${valid} || ${schValid}`) + const merged = cxt.mergeValidEvaluated(schCxt, schValid) + // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true) + // or if all properties and items were evaluated (it.props === true && it.items === true) + if (!merged) gen.if(not(valid)) + }) + ) + + cxt.result( + valid, + () => cxt.reset(), + () => cxt.error(true) + ) +} diff --git a/node_modules/ajv/lib/vocabularies/core/id.ts b/node_modules/ajv/lib/vocabularies/core/id.ts new file mode 100644 index 000000000..aa36c4bb2 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/core/id.ts @@ -0,0 +1,10 @@ +import type {CodeKeywordDefinition} from "../../types" + +const def: CodeKeywordDefinition = { + keyword: "id", + code() { + throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID') + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/core/index.ts b/node_modules/ajv/lib/vocabularies/core/index.ts new file mode 100644 index 000000000..e63e2895d --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/core/index.ts @@ -0,0 +1,16 @@ +import type {Vocabulary} from "../../types" +import idKeyword from "./id" +import refKeyword from "./ref" + +const core: Vocabulary = [ + "$schema", + "$id", + "$defs", + "$vocabulary", + {keyword: "$comment"}, + "definitions", + idKeyword, + refKeyword, +] + +export default core diff --git a/node_modules/ajv/lib/vocabularies/core/ref.ts b/node_modules/ajv/lib/vocabularies/core/ref.ts new file mode 100644 index 000000000..5d59fbcb2 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/core/ref.ts @@ -0,0 +1,129 @@ +import type {CodeKeywordDefinition, AnySchema} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import MissingRefError from "../../compile/ref_error" +import {callValidateCode} from "../code" +import {_, nil, stringify, Code, Name} from "../../compile/codegen" +import N from "../../compile/names" +import {SchemaEnv, resolveRef} from "../../compile" +import {mergeEvaluated} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: "$ref", + schemaType: "string", + code(cxt: KeywordCxt): void { + const {gen, schema: $ref, it} = cxt + const {baseId, schemaEnv: env, validateName, opts, self} = it + const {root} = env + if (($ref === "#" || $ref === "#/") && baseId === root.baseId) return callRootRef() + const schOrEnv = resolveRef.call(self, root, baseId, $ref) + if (schOrEnv === undefined) throw new MissingRefError(it.opts.uriResolver, baseId, $ref) + if (schOrEnv instanceof SchemaEnv) return callValidate(schOrEnv) + return inlineRefSchema(schOrEnv) + + function callRootRef(): void { + if (env === root) return callRef(cxt, validateName, env, env.$async) + const rootName = gen.scopeValue("root", {ref: root}) + return callRef(cxt, _`${rootName}.validate`, root, root.$async) + } + + function callValidate(sch: SchemaEnv): void { + const v = getValidate(cxt, sch) + callRef(cxt, v, sch, sch.$async) + } + + function inlineRefSchema(sch: AnySchema): void { + const schName = gen.scopeValue( + "schema", + opts.code.source === true ? {ref: sch, code: stringify(sch)} : {ref: sch} + ) + const valid = gen.name("valid") + const schCxt = cxt.subschema( + { + schema: sch, + dataTypes: [], + schemaPath: nil, + topSchemaRef: schName, + errSchemaPath: $ref, + }, + valid + ) + cxt.mergeEvaluated(schCxt) + cxt.ok(valid) + } + }, +} + +export function getValidate(cxt: KeywordCxt, sch: SchemaEnv): Code { + const {gen} = cxt + return sch.validate + ? gen.scopeValue("validate", {ref: sch.validate}) + : _`${gen.scopeValue("wrapper", {ref: sch})}.validate` +} + +export function callRef(cxt: KeywordCxt, v: Code, sch?: SchemaEnv, $async?: boolean): void { + const {gen, it} = cxt + const {allErrors, schemaEnv: env, opts} = it + const passCxt = opts.passContext ? N.this : nil + if ($async) callAsyncRef() + else callSyncRef() + + function callAsyncRef(): void { + if (!env.$async) throw new Error("async schema referenced by sync schema") + const valid = gen.let("valid") + gen.try( + () => { + gen.code(_`await ${callValidateCode(cxt, v, passCxt)}`) + addEvaluatedFrom(v) // TODO will not work with async, it has to be returned with the result + if (!allErrors) gen.assign(valid, true) + }, + (e) => { + gen.if(_`!(${e} instanceof ${it.ValidationError as Name})`, () => gen.throw(e)) + addErrorsFrom(e) + if (!allErrors) gen.assign(valid, false) + } + ) + cxt.ok(valid) + } + + function callSyncRef(): void { + cxt.result( + callValidateCode(cxt, v, passCxt), + () => addEvaluatedFrom(v), + () => addErrorsFrom(v) + ) + } + + function addErrorsFrom(source: Code): void { + const errs = _`${source}.errors` + gen.assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`) // TODO tagged + gen.assign(N.errors, _`${N.vErrors}.length`) + } + + function addEvaluatedFrom(source: Code): void { + if (!it.opts.unevaluated) return + const schEvaluated = sch?.validate?.evaluated + // TODO refactor + if (it.props !== true) { + if (schEvaluated && !schEvaluated.dynamicProps) { + if (schEvaluated.props !== undefined) { + it.props = mergeEvaluated.props(gen, schEvaluated.props, it.props) + } + } else { + const props = gen.var("props", _`${source}.evaluated.props`) + it.props = mergeEvaluated.props(gen, props, it.props, Name) + } + } + if (it.items !== true) { + if (schEvaluated && !schEvaluated.dynamicItems) { + if (schEvaluated.items !== undefined) { + it.items = mergeEvaluated.items(gen, schEvaluated.items, it.items) + } + } else { + const items = gen.var("items", _`${source}.evaluated.items`) + it.items = mergeEvaluated.items(gen, items, it.items, Name) + } + } + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/discriminator/index.ts b/node_modules/ajv/lib/vocabularies/discriminator/index.ts new file mode 100644 index 000000000..98f0f8cfb --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/discriminator/index.ts @@ -0,0 +1,110 @@ +import type {CodeKeywordDefinition, AnySchemaObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, getProperty, Name} from "../../compile/codegen" +import {DiscrError, DiscrErrorObj} from "../discriminator/types" +import {resolveRef, SchemaEnv} from "../../compile" +import {schemaHasRulesButRef} from "../../compile/util" + +export type DiscriminatorError = DiscrErrorObj | DiscrErrorObj + +const error: KeywordErrorDefinition = { + message: ({params: {discrError, tagName}}) => + discrError === DiscrError.Tag + ? `tag "${tagName}" must be string` + : `value of tag "${tagName}" must be in oneOf`, + params: ({params: {discrError, tag, tagName}}) => + _`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "discriminator", + type: "object", + schemaType: "object", + error, + code(cxt: KeywordCxt) { + const {gen, data, schema, parentSchema, it} = cxt + const {oneOf} = parentSchema + if (!it.opts.discriminator) { + throw new Error("discriminator: requires discriminator option") + } + const tagName = schema.propertyName + if (typeof tagName != "string") throw new Error("discriminator: requires propertyName") + if (schema.mapping) throw new Error("discriminator: mapping is not supported") + if (!oneOf) throw new Error("discriminator: requires oneOf keyword") + const valid = gen.let("valid", false) + const tag = gen.const("tag", _`${data}${getProperty(tagName)}`) + gen.if( + _`typeof ${tag} == "string"`, + () => validateMapping(), + () => cxt.error(false, {discrError: DiscrError.Tag, tag, tagName}) + ) + cxt.ok(valid) + + function validateMapping(): void { + const mapping = getMapping() + gen.if(false) + for (const tagValue in mapping) { + gen.elseIf(_`${tag} === ${tagValue}`) + gen.assign(valid, applyTagSchema(mapping[tagValue])) + } + gen.else() + cxt.error(false, {discrError: DiscrError.Mapping, tag, tagName}) + gen.endIf() + } + + function applyTagSchema(schemaProp?: number): Name { + const _valid = gen.name("valid") + const schCxt = cxt.subschema({keyword: "oneOf", schemaProp}, _valid) + cxt.mergeEvaluated(schCxt, Name) + return _valid + } + + function getMapping(): {[T in string]?: number} { + const oneOfMapping: {[T in string]?: number} = {} + const topRequired = hasRequired(parentSchema) + let tagRequired = true + for (let i = 0; i < oneOf.length; i++) { + let sch = oneOf[i] + if (sch?.$ref && !schemaHasRulesButRef(sch, it.self.RULES)) { + sch = resolveRef.call(it.self, it.schemaEnv.root, it.baseId, sch?.$ref) + if (sch instanceof SchemaEnv) sch = sch.schema + } + const propSch = sch?.properties?.[tagName] + if (typeof propSch != "object") { + throw new Error( + `discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"` + ) + } + tagRequired = tagRequired && (topRequired || hasRequired(sch)) + addMappings(propSch, i) + } + if (!tagRequired) throw new Error(`discriminator: "${tagName}" must be required`) + return oneOfMapping + + function hasRequired({required}: AnySchemaObject): boolean { + return Array.isArray(required) && required.includes(tagName) + } + + function addMappings(sch: AnySchemaObject, i: number): void { + if (sch.const) { + addMapping(sch.const, i) + } else if (sch.enum) { + for (const tagValue of sch.enum) { + addMapping(tagValue, i) + } + } else { + throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`) + } + } + + function addMapping(tagValue: unknown, i: number): void { + if (typeof tagValue != "string" || tagValue in oneOfMapping) { + throw new Error(`discriminator: "${tagName}" values must be unique strings`) + } + oneOfMapping[tagValue] = i + } + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/discriminator/types.ts b/node_modules/ajv/lib/vocabularies/discriminator/types.ts new file mode 100644 index 000000000..bee5a2785 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/discriminator/types.ts @@ -0,0 +1,12 @@ +import type {ErrorObject} from "../../types" + +export enum DiscrError { + Tag = "tag", + Mapping = "mapping", +} + +export type DiscrErrorObj = ErrorObject< + "discriminator", + {error: E; tag: string; tagValue: unknown}, + string +> diff --git a/node_modules/ajv/lib/vocabularies/draft2020.ts b/node_modules/ajv/lib/vocabularies/draft2020.ts new file mode 100644 index 000000000..47fbf0ee6 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/draft2020.ts @@ -0,0 +1,23 @@ +import type {Vocabulary} from "../types" +import coreVocabulary from "./core" +import validationVocabulary from "./validation" +import getApplicatorVocabulary from "./applicator" +import dynamicVocabulary from "./dynamic" +import nextVocabulary from "./next" +import unevaluatedVocabulary from "./unevaluated" +import formatVocabulary from "./format" +import {metadataVocabulary, contentVocabulary} from "./metadata" + +const draft2020Vocabularies: Vocabulary[] = [ + dynamicVocabulary, + coreVocabulary, + validationVocabulary, + getApplicatorVocabulary(true), + formatVocabulary, + metadataVocabulary, + contentVocabulary, + nextVocabulary, + unevaluatedVocabulary, +] + +export default draft2020Vocabularies diff --git a/node_modules/ajv/lib/vocabularies/draft7.ts b/node_modules/ajv/lib/vocabularies/draft7.ts new file mode 100644 index 000000000..226a644aa --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/draft7.ts @@ -0,0 +1,17 @@ +import type {Vocabulary} from "../types" +import coreVocabulary from "./core" +import validationVocabulary from "./validation" +import getApplicatorVocabulary from "./applicator" +import formatVocabulary from "./format" +import {metadataVocabulary, contentVocabulary} from "./metadata" + +const draft7Vocabularies: Vocabulary[] = [ + coreVocabulary, + validationVocabulary, + getApplicatorVocabulary(), + formatVocabulary, + metadataVocabulary, + contentVocabulary, +] + +export default draft7Vocabularies diff --git a/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts b/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts new file mode 100644 index 000000000..ca1adb912 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts @@ -0,0 +1,31 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, getProperty, Code} from "../../compile/codegen" +import N from "../../compile/names" +import {SchemaEnv, compileSchema} from "../../compile" +import {getValidate} from "../core/ref" + +const def: CodeKeywordDefinition = { + keyword: "$dynamicAnchor", + schemaType: "string", + code: (cxt) => dynamicAnchor(cxt, cxt.schema), +} + +export function dynamicAnchor(cxt: KeywordCxt, anchor: string): void { + const {gen, it} = cxt + it.schemaEnv.root.dynamicAnchors[anchor] = true + const v = _`${N.dynamicAnchors}${getProperty(anchor)}` + const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt) + gen.if(_`!${v}`, () => gen.assign(v, validate)) +} + +function _getValidate(cxt: KeywordCxt): Code { + const {schemaEnv, schema, self} = cxt.it + const {root, baseId, localRefs, meta} = schemaEnv.root + const {schemaId} = self.opts + const sch = new SchemaEnv({schema, schemaId, root, baseId, localRefs, meta}) + compileSchema.call(self, sch) + return getValidate(cxt, sch) +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts b/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts new file mode 100644 index 000000000..6a573f330 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts @@ -0,0 +1,51 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, getProperty, Code, Name} from "../../compile/codegen" +import N from "../../compile/names" +import {callRef} from "../core/ref" + +const def: CodeKeywordDefinition = { + keyword: "$dynamicRef", + schemaType: "string", + code: (cxt) => dynamicRef(cxt, cxt.schema), +} + +export function dynamicRef(cxt: KeywordCxt, ref: string): void { + const {gen, keyword, it} = cxt + if (ref[0] !== "#") throw new Error(`"${keyword}" only supports hash fragment reference`) + const anchor = ref.slice(1) + if (it.allErrors) { + _dynamicRef() + } else { + const valid = gen.let("valid", false) + _dynamicRef(valid) + cxt.ok(valid) + } + + function _dynamicRef(valid?: Name): void { + // TODO the assumption here is that `recursiveRef: #` always points to the root + // of the schema object, which is not correct, because there may be $id that + // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor. + // Because of that 2 tests in recursiveRef.json fail. + // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`). + // (This problem is not tested in JSON-Schema-Test-Suite) + if (it.schemaEnv.root.dynamicAnchors[anchor]) { + const v = gen.let("_v", _`${N.dynamicAnchors}${getProperty(anchor)}`) + gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid)) + } else { + _callRef(it.validateName, valid)() + } + } + + function _callRef(validate: Code, valid?: Name): () => void { + return valid + ? () => + gen.block(() => { + callRef(cxt, validate) + gen.let(valid, true) + }) + : () => callRef(cxt, validate) + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/dynamic/index.ts b/node_modules/ajv/lib/vocabularies/dynamic/index.ts new file mode 100644 index 000000000..6d521db66 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/dynamic/index.ts @@ -0,0 +1,9 @@ +import type {Vocabulary} from "../../types" +import dynamicAnchor from "./dynamicAnchor" +import dynamicRef from "./dynamicRef" +import recursiveAnchor from "./recursiveAnchor" +import recursiveRef from "./recursiveRef" + +const dynamic: Vocabulary = [dynamicAnchor, dynamicRef, recursiveAnchor, recursiveRef] + +export default dynamic diff --git a/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts b/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts new file mode 100644 index 000000000..25f3db96b --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts @@ -0,0 +1,14 @@ +import type {CodeKeywordDefinition} from "../../types" +import {dynamicAnchor} from "./dynamicAnchor" +import {checkStrictMode} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: "$recursiveAnchor", + schemaType: "boolean", + code(cxt) { + if (cxt.schema) dynamicAnchor(cxt, "") + else checkStrictMode(cxt.it, "$recursiveAnchor: false is ignored") + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts b/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts new file mode 100644 index 000000000..c84af0f05 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts @@ -0,0 +1,10 @@ +import type {CodeKeywordDefinition} from "../../types" +import {dynamicRef} from "./dynamicRef" + +const def: CodeKeywordDefinition = { + keyword: "$recursiveRef", + schemaType: "string", + code: (cxt) => dynamicRef(cxt, cxt.schema), +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/errors.ts b/node_modules/ajv/lib/vocabularies/errors.ts new file mode 100644 index 000000000..c9ca3f02f --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/errors.ts @@ -0,0 +1,18 @@ +import type {TypeError} from "../compile/validate/dataType" +import type {ApplicatorKeywordError} from "./applicator" +import type {ValidationKeywordError} from "./validation" +import type {FormatError} from "./format/format" +import type {UnevaluatedPropertiesError} from "./unevaluated/unevaluatedProperties" +import type {UnevaluatedItemsError} from "./unevaluated/unevaluatedItems" +import type {DependentRequiredError} from "./validation/dependentRequired" +import type {DiscriminatorError} from "./discriminator" + +export type DefinedError = + | TypeError + | ApplicatorKeywordError + | ValidationKeywordError + | FormatError + | UnevaluatedPropertiesError + | UnevaluatedItemsError + | DependentRequiredError + | DiscriminatorError diff --git a/node_modules/ajv/lib/vocabularies/format/format.ts b/node_modules/ajv/lib/vocabularies/format/format.ts new file mode 100644 index 000000000..4b1c13e76 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/format/format.ts @@ -0,0 +1,120 @@ +import type { + AddedFormat, + FormatValidator, + AsyncFormatValidator, + CodeKeywordDefinition, + KeywordErrorDefinition, + ErrorObject, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, nil, or, Code, getProperty, regexpCode} from "../../compile/codegen" + +type FormatValidate = + | FormatValidator + | FormatValidator + | AsyncFormatValidator + | AsyncFormatValidator + | RegExp + | string + | true + +export type FormatError = ErrorObject<"format", {format: string}, string | {$data: string}> + +const error: KeywordErrorDefinition = { + message: ({schemaCode}) => str`must match format "${schemaCode}"`, + params: ({schemaCode}) => _`{format: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "format", + type: ["number", "string"], + schemaType: "string", + $data: true, + error, + code(cxt: KeywordCxt, ruleType?: string) { + const {gen, data, $data, schema, schemaCode, it} = cxt + const {opts, errSchemaPath, schemaEnv, self} = it + if (!opts.validateFormats) return + + if ($data) validate$DataFormat() + else validateFormat() + + function validate$DataFormat(): void { + const fmts = gen.scopeValue("formats", { + ref: self.formats, + code: opts.code.formats, + }) + const fDef = gen.const("fDef", _`${fmts}[${schemaCode}]`) + const fType = gen.let("fType") + const format = gen.let("format") + // TODO simplify + gen.if( + _`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, + () => gen.assign(fType, _`${fDef}.type || "string"`).assign(format, _`${fDef}.validate`), + () => gen.assign(fType, _`"string"`).assign(format, fDef) + ) + cxt.fail$data(or(unknownFmt(), invalidFmt())) + + function unknownFmt(): Code { + if (opts.strictSchema === false) return nil + return _`${schemaCode} && !${format}` + } + + function invalidFmt(): Code { + const callFormat = schemaEnv.$async + ? _`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` + : _`${format}(${data})` + const validData = _`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))` + return _`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}` + } + } + + function validateFormat(): void { + const formatDef: AddedFormat | undefined = self.formats[schema] + if (!formatDef) { + unknownFormat() + return + } + if (formatDef === true) return + const [fmtType, format, fmtRef] = getFormat(formatDef) + if (fmtType === ruleType) cxt.pass(validCondition()) + + function unknownFormat(): void { + if (opts.strictSchema === false) { + self.logger.warn(unknownMsg()) + return + } + throw new Error(unknownMsg()) + + function unknownMsg(): string { + return `unknown format "${schema as string}" ignored in schema at path "${errSchemaPath}"` + } + } + + function getFormat(fmtDef: AddedFormat): [string, FormatValidate, Code] { + const code = + fmtDef instanceof RegExp + ? regexpCode(fmtDef) + : opts.code.formats + ? _`${opts.code.formats}${getProperty(schema)}` + : undefined + const fmt = gen.scopeValue("formats", {key: schema, ref: fmtDef, code}) + if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { + return [fmtDef.type || "string", fmtDef.validate, _`${fmt}.validate`] + } + + return ["string", fmtDef, fmt] + } + + function validCondition(): Code { + if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { + if (!schemaEnv.$async) throw new Error("async format in sync schema") + return _`await ${fmtRef}(${data})` + } + return typeof format == "function" ? _`${fmtRef}(${data})` : _`${fmtRef}.test(${data})` + } + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/format/index.ts b/node_modules/ajv/lib/vocabularies/format/index.ts new file mode 100644 index 000000000..bca2f5b3d --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/format/index.ts @@ -0,0 +1,6 @@ +import type {Vocabulary} from "../../types" +import formatKeyword from "./format" + +const format: Vocabulary = [formatKeyword] + +export default format diff --git a/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts b/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts new file mode 100644 index 000000000..f487c97f8 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts @@ -0,0 +1,89 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, not, getProperty, Name} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullableObject} from "./nullable" +import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" +import {DiscrError, DiscrErrorObj} from "../discriminator/types" + +export type JTDDiscriminatorError = + | _JTDTypeError<"discriminator", "object", string> + | DiscrErrorObj + | DiscrErrorObj + +const error: KeywordErrorDefinition = { + message: (cxt) => { + const {schema, params} = cxt + return params.discrError + ? params.discrError === DiscrError.Tag + ? `tag "${schema}" must be string` + : `value of tag "${schema}" must be in mapping` + : typeErrorMessage(cxt, "object") + }, + params: (cxt) => { + const {schema, params} = cxt + return params.discrError + ? _`{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}` + : typeErrorParams(cxt, "object") + }, +} + +const def: CodeKeywordDefinition = { + keyword: "discriminator", + schemaType: "string", + implements: ["mapping"], + error, + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema, parentSchema} = cxt + const [valid, cond] = checkNullableObject(cxt, data) + + gen.if(cond) + validateDiscriminator() + gen.elseIf(not(valid)) + cxt.error() + gen.endIf() + cxt.ok(valid) + + function validateDiscriminator(): void { + const tag = gen.const("tag", _`${data}${getProperty(schema)}`) + gen.if(_`${tag} === undefined`) + cxt.error(false, {discrError: DiscrError.Tag, tag}) + gen.elseIf(_`typeof ${tag} == "string"`) + validateMapping(tag) + gen.else() + cxt.error(false, {discrError: DiscrError.Tag, tag}, {instancePath: schema}) + gen.endIf() + } + + function validateMapping(tag: Name): void { + gen.if(false) + for (const tagValue in parentSchema.mapping) { + gen.elseIf(_`${tag} === ${tagValue}`) + gen.assign(valid, applyTagSchema(tagValue)) + } + gen.else() + cxt.error( + false, + {discrError: DiscrError.Mapping, tag}, + {instancePath: schema, schemaPath: "mapping", parentSchema: true} + ) + gen.endIf() + } + + function applyTagSchema(schemaProp: string): Name { + const _valid = gen.name("valid") + cxt.subschema( + { + keyword: "mapping", + schemaProp, + jtdDiscriminator: schema, + }, + _valid + ) + return _valid + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/elements.ts b/node_modules/ajv/lib/vocabularies/jtd/elements.ts new file mode 100644 index 000000000..983af7c02 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/elements.ts @@ -0,0 +1,32 @@ +import type {CodeKeywordDefinition, SchemaObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {alwaysValidSchema} from "../../compile/util" +import {validateArray} from "../code" +import {_, not} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullable} from "./nullable" +import {typeError, _JTDTypeError} from "./error" + +export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject> + +const def: CodeKeywordDefinition = { + keyword: "elements", + schemaType: "object", + error: typeError("array"), + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema, it} = cxt + if (alwaysValidSchema(it, schema)) return + const [valid] = checkNullable(cxt) + gen.if(not(valid), () => + gen.if( + _`Array.isArray(${data})`, + () => gen.assign(valid, validateArray(cxt)), + () => cxt.error() + ) + ) + cxt.ok(valid) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/enum.ts b/node_modules/ajv/lib/vocabularies/jtd/enum.ts new file mode 100644 index 000000000..75464ff8e --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/enum.ts @@ -0,0 +1,45 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition, ErrorObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, or, and, Code} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullable} from "./nullable" + +export type JTDEnumError = ErrorObject<"enum", {allowedValues: string[]}, string[]> + +const error: KeywordErrorDefinition = { + message: "must be equal to one of the allowed values", + params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "enum", + schemaType: "array", + error, + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema, schemaValue, parentSchema, it} = cxt + if (schema.length === 0) throw new Error("enum must have non-empty array") + if (schema.length !== new Set(schema).size) throw new Error("enum items must be unique") + let valid: Code + const isString = _`typeof ${data} == "string"` + if (schema.length >= it.opts.loopEnum) { + let cond: Code + ;[valid, cond] = checkNullable(cxt, isString) + gen.if(cond, loopEnum) + } else { + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + valid = and(isString, or(...schema.map((value: string) => _`${data} === ${value}`))) + if (parentSchema.nullable) valid = or(_`${data} === null`, valid) + } + cxt.pass(valid) + + function loopEnum(): void { + gen.forOf("v", schemaValue as Code, (v) => + gen.if(_`${valid} = ${data} === ${v}`, () => gen.break()) + ) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/error.ts b/node_modules/ajv/lib/vocabularies/jtd/error.ts new file mode 100644 index 000000000..506932258 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/error.ts @@ -0,0 +1,23 @@ +import type {KeywordErrorDefinition, KeywordErrorCxt, ErrorObject} from "../../types" +import {_, Code} from "../../compile/codegen" + +export type _JTDTypeError = ErrorObject< + K, + {type: T; nullable: boolean}, + S +> + +export function typeError(t: string): KeywordErrorDefinition { + return { + message: (cxt) => typeErrorMessage(cxt, t), + params: (cxt) => typeErrorParams(cxt, t), + } +} + +export function typeErrorMessage({parentSchema}: KeywordErrorCxt, t: string): string { + return parentSchema?.nullable ? `must be ${t} or null` : `must be ${t}` +} + +export function typeErrorParams({parentSchema}: KeywordErrorCxt, t: string): Code { + return _`{type: ${t}, nullable: ${!!parentSchema?.nullable}}` +} diff --git a/node_modules/ajv/lib/vocabularies/jtd/index.ts b/node_modules/ajv/lib/vocabularies/jtd/index.ts new file mode 100644 index 000000000..f7baebc30 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/index.ts @@ -0,0 +1,37 @@ +import type {Vocabulary} from "../../types" +import refKeyword from "./ref" +import typeKeyword, {JTDTypeError} from "./type" +import enumKeyword, {JTDEnumError} from "./enum" +import elements, {JTDElementsError} from "./elements" +import properties, {JTDPropertiesError} from "./properties" +import optionalProperties from "./optionalProperties" +import discriminator, {JTDDiscriminatorError} from "./discriminator" +import values, {JTDValuesError} from "./values" +import union from "./union" +import metadata from "./metadata" + +const jtdVocabulary: Vocabulary = [ + "definitions", + refKeyword, + typeKeyword, + enumKeyword, + elements, + properties, + optionalProperties, + discriminator, + values, + union, + metadata, + {keyword: "additionalProperties", schemaType: "boolean"}, + {keyword: "nullable", schemaType: "boolean"}, +] + +export default jtdVocabulary + +export type JTDErrorObject = + | JTDTypeError + | JTDEnumError + | JTDElementsError + | JTDPropertiesError + | JTDDiscriminatorError + | JTDValuesError diff --git a/node_modules/ajv/lib/vocabularies/jtd/metadata.ts b/node_modules/ajv/lib/vocabularies/jtd/metadata.ts new file mode 100644 index 000000000..19eeb8c7d --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/metadata.ts @@ -0,0 +1,24 @@ +import {KeywordCxt} from "../../ajv" +import type {CodeKeywordDefinition} from "../../types" +import {alwaysValidSchema} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: "metadata", + schemaType: "object", + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, schema, it} = cxt + if (alwaysValidSchema(it, schema)) return + const valid = gen.name("valid") + cxt.subschema({keyword: "metadata", jtdMetadata: true}, valid) + cxt.ok(valid) + }, +} + +export function checkMetadata({it, keyword}: KeywordCxt, metadata?: boolean): void { + if (it.jtdMetadata !== metadata) { + throw new Error(`JTD: "${keyword}" cannot be used in this schema location`) + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/nullable.ts b/node_modules/ajv/lib/vocabularies/jtd/nullable.ts new file mode 100644 index 000000000..c74b05da7 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/nullable.ts @@ -0,0 +1,21 @@ +import type {KeywordCxt} from "../../compile/validate" +import {_, not, nil, Code, Name} from "../../compile/codegen" + +export function checkNullable( + {gen, data, parentSchema}: KeywordCxt, + cond: Code = nil +): [Name, Code] { + const valid = gen.name("valid") + if (parentSchema.nullable) { + gen.let(valid, _`${data} === null`) + cond = not(valid) + } else { + gen.let(valid, false) + } + return [valid, cond] +} + +export function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code] { + const [valid, cond_] = checkNullable(cxt, cond) + return [valid, _`${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`] +} diff --git a/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts b/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts new file mode 100644 index 000000000..8e91c8d91 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts @@ -0,0 +1,15 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {validateProperties, error} from "./properties" + +const def: CodeKeywordDefinition = { + keyword: "optionalProperties", + schemaType: "object", + error, + code(cxt: KeywordCxt) { + if (cxt.parentSchema.properties) return + validateProperties(cxt) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/properties.ts b/node_modules/ajv/lib/vocabularies/jtd/properties.ts new file mode 100644 index 000000000..9dd24c5cd --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/properties.ts @@ -0,0 +1,184 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + SchemaObject, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {propertyInData, allSchemaProperties, isOwnProperty} from "../code" +import {alwaysValidSchema, schemaRefOrVal} from "../../compile/util" +import {_, and, not, Code, Name} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullableObject} from "./nullable" +import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" + +enum PropError { + Additional = "additional", + Missing = "missing", +} + +type PropKeyword = "properties" | "optionalProperties" + +type PropSchema = {[P in string]?: SchemaObject} + +export type JTDPropertiesError = + | _JTDTypeError + | ErrorObject + | ErrorObject + +export const error: KeywordErrorDefinition = { + message: (cxt) => { + const {params} = cxt + return params.propError + ? params.propError === PropError.Additional + ? "must NOT have additional properties" + : `must have property '${params.missingProperty}'` + : typeErrorMessage(cxt, "object") + }, + params: (cxt) => { + const {params} = cxt + return params.propError + ? params.propError === PropError.Additional + ? _`{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}` + : _`{error: ${params.propError}, missingProperty: ${params.missingProperty}}` + : typeErrorParams(cxt, "object") + }, +} + +const def: CodeKeywordDefinition = { + keyword: "properties", + schemaType: "object", + error, + code: validateProperties, +} + +// const error: KeywordErrorDefinition = { +// message: "should NOT have additional properties", +// params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, +// } + +export function validateProperties(cxt: KeywordCxt): void { + checkMetadata(cxt) + const {gen, data, parentSchema, it} = cxt + const {additionalProperties, nullable} = parentSchema + if (it.jtdDiscriminator && nullable) throw new Error("JTD: nullable inside discriminator mapping") + if (commonProperties()) { + throw new Error("JTD: properties and optionalProperties have common members") + } + const [allProps, properties] = schemaProperties("properties") + const [allOptProps, optProperties] = schemaProperties("optionalProperties") + if (properties.length === 0 && optProperties.length === 0 && additionalProperties) { + return + } + + const [valid, cond] = + it.jtdDiscriminator === undefined + ? checkNullableObject(cxt, data) + : [gen.let("valid", false), true] + gen.if(cond, () => + gen.assign(valid, true).block(() => { + validateProps(properties, "properties", true) + validateProps(optProperties, "optionalProperties") + if (!additionalProperties) validateAdditional() + }) + ) + cxt.pass(valid) + + function commonProperties(): boolean { + const props = parentSchema.properties as Record | undefined + const optProps = parentSchema.optionalProperties as Record | undefined + if (!(props && optProps)) return false + for (const p in props) { + if (Object.prototype.hasOwnProperty.call(optProps, p)) return true + } + return false + } + + function schemaProperties(keyword: string): [string[], string[]] { + const schema = parentSchema[keyword] + const allPs = schema ? allSchemaProperties(schema) : [] + if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) { + throw new Error(`JTD: discriminator tag used in ${keyword}`) + } + const ps = allPs.filter((p) => !alwaysValidSchema(it, schema[p])) + return [allPs, ps] + } + + function validateProps(props: string[], keyword: string, required?: boolean): void { + const _valid = gen.var("valid") + for (const prop of props) { + gen.if( + propertyInData(gen, data, prop, it.opts.ownProperties), + () => applyPropertySchema(prop, keyword, _valid), + () => missingProperty(prop) + ) + cxt.ok(_valid) + } + + function missingProperty(prop: string): void { + if (required) { + gen.assign(_valid, false) + cxt.error(false, {propError: PropError.Missing, missingProperty: prop}, {schemaPath: prop}) + } else { + gen.assign(_valid, true) + } + } + } + + function applyPropertySchema(prop: string, keyword: string, _valid: Name): void { + cxt.subschema( + { + keyword, + schemaProp: prop, + dataProp: prop, + }, + _valid + ) + } + + function validateAdditional(): void { + gen.forIn("key", data, (key: Name) => { + const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator) + const addOptProp = isAdditional(key, allOptProps, "optionalProperties") + const extra = + addProp === true ? addOptProp : addOptProp === true ? addProp : and(addProp, addOptProp) + gen.if(extra, () => { + if (it.opts.removeAdditional) { + gen.code(_`delete ${data}[${key}]`) + } else { + cxt.error( + false, + {propError: PropError.Additional, additionalProperty: key}, + {instancePath: key, parentSchema: true} + ) + if (!it.opts.allErrors) gen.break() + } + }) + }) + } + + function isAdditional( + key: Name, + props: string[], + keyword: string, + jtdDiscriminator?: string + ): Code | true { + let additional: Code | boolean + if (props.length > 8) { + // TODO maybe an option instead of hard-coded 8? + const propsSchema = schemaRefOrVal(it, parentSchema[keyword], keyword) + additional = not(isOwnProperty(gen, propsSchema as Code, key)) + if (jtdDiscriminator !== undefined) { + additional = and(additional, _`${key} !== ${jtdDiscriminator}`) + } + } else if (props.length || jtdDiscriminator !== undefined) { + const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props) + additional = and(...ps.map((p) => _`${key} !== ${p}`)) + } else { + additional = true + } + return additional + } +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/ref.ts b/node_modules/ajv/lib/vocabularies/jtd/ref.ts new file mode 100644 index 000000000..97646ee1b --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/ref.ts @@ -0,0 +1,76 @@ +import type {CodeKeywordDefinition, AnySchemaObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {compileSchema, SchemaEnv} from "../../compile" +import {_, not, nil, stringify} from "../../compile/codegen" +import MissingRefError from "../../compile/ref_error" +import N from "../../compile/names" +import {getValidate, callRef} from "../core/ref" +import {checkMetadata} from "./metadata" + +const def: CodeKeywordDefinition = { + keyword: "ref", + schemaType: "string", + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema: ref, parentSchema, it} = cxt + const { + schemaEnv: {root}, + } = it + const valid = gen.name("valid") + if (parentSchema.nullable) { + gen.var(valid, _`${data} === null`) + gen.if(not(valid), validateJtdRef) + } else { + gen.var(valid, false) + validateJtdRef() + } + cxt.ok(valid) + + function validateJtdRef(): void { + const refSchema = (root.schema as AnySchemaObject).definitions?.[ref] + if (!refSchema) { + throw new MissingRefError(it.opts.uriResolver, "", ref, `No definition ${ref}`) + } + if (hasRef(refSchema) || !it.opts.inlineRefs) callValidate(refSchema) + else inlineRefSchema(refSchema) + } + + function callValidate(schema: AnySchemaObject): void { + const sch = compileSchema.call( + it.self, + new SchemaEnv({schema, root, schemaPath: `/definitions/${ref}`}) + ) + const v = getValidate(cxt, sch) + const errsCount = gen.const("_errs", N.errors) + callRef(cxt, v, sch, sch.$async) + gen.assign(valid, _`${errsCount} === ${N.errors}`) + } + + function inlineRefSchema(schema: AnySchemaObject): void { + const schName = gen.scopeValue( + "schema", + it.opts.code.source === true ? {ref: schema, code: stringify(schema)} : {ref: schema} + ) + cxt.subschema( + { + schema, + dataTypes: [], + schemaPath: nil, + topSchemaRef: schName, + errSchemaPath: `/definitions/${ref}`, + }, + valid + ) + } + }, +} + +export function hasRef(schema: AnySchemaObject): boolean { + for (const key in schema) { + let sch: AnySchemaObject + if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) return true + } + return false +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/type.ts b/node_modules/ajv/lib/vocabularies/jtd/type.ts new file mode 100644 index 000000000..17274300b --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/type.ts @@ -0,0 +1,75 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, nil, or, Code} from "../../compile/codegen" +import validTimestamp from "../../runtime/timestamp" +import {useFunc} from "../../compile/util" +import {checkMetadata} from "./metadata" +import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" + +export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType> + +export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" + +export const intRange: {[T in IntType]: [number, number, number]} = { + int8: [-128, 127, 3], + uint8: [0, 255, 3], + int16: [-32768, 32767, 5], + uint16: [0, 65535, 5], + int32: [-2147483648, 2147483647, 10], + uint32: [0, 4294967295, 10], +} + +export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType + +const error: KeywordErrorDefinition = { + message: (cxt) => typeErrorMessage(cxt, cxt.schema), + params: (cxt) => typeErrorParams(cxt, cxt.schema), +} + +function timestampCode(cxt: KeywordCxt): Code { + const {gen, data, it} = cxt + const {timestamp, allowDate} = it.opts + if (timestamp === "date") return _`${data} instanceof Date ` + const vts = useFunc(gen, validTimestamp) + const allowDateArg = allowDate ? _`, true` : nil + const validString = _`typeof ${data} == "string" && ${vts}(${data}${allowDateArg})` + return timestamp === "string" ? validString : or(_`${data} instanceof Date`, validString) +} + +const def: CodeKeywordDefinition = { + keyword: "type", + schemaType: "string", + error, + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {data, schema, parentSchema, it} = cxt + let cond: Code + switch (schema) { + case "boolean": + case "string": + cond = _`typeof ${data} == ${schema}` + break + case "timestamp": { + cond = timestampCode(cxt) + break + } + case "float32": + case "float64": + cond = _`typeof ${data} == "number"` + break + default: { + const sch = schema as IntType + cond = _`typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)` + if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) { + if (sch === "uint32") cond = _`${cond} && ${data} >= 0` + } else { + const [min, max] = intRange[sch] + cond = _`${cond} && ${data} >= ${min} && ${data} <= ${max}` + } + } + } + cxt.pass(parentSchema.nullable ? or(_`${data} === null`, cond) : cond) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/union.ts b/node_modules/ajv/lib/vocabularies/jtd/union.ts new file mode 100644 index 000000000..588f07ab4 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/union.ts @@ -0,0 +1,12 @@ +import type {CodeKeywordDefinition} from "../../types" +import {validateUnion} from "../code" + +const def: CodeKeywordDefinition = { + keyword: "union", + schemaType: "array", + trackErrors: true, + code: validateUnion, + error: {message: "must match a schema in union"}, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/values.ts b/node_modules/ajv/lib/vocabularies/jtd/values.ts new file mode 100644 index 000000000..e64945077 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/jtd/values.ts @@ -0,0 +1,58 @@ +import type {CodeKeywordDefinition, SchemaObject} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {alwaysValidSchema, Type} from "../../compile/util" +import {not, or, Name} from "../../compile/codegen" +import {checkMetadata} from "./metadata" +import {checkNullableObject} from "./nullable" +import {typeError, _JTDTypeError} from "./error" + +export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject> + +const def: CodeKeywordDefinition = { + keyword: "values", + schemaType: "object", + error: typeError("object"), + code(cxt: KeywordCxt) { + checkMetadata(cxt) + const {gen, data, schema, it} = cxt + const [valid, cond] = checkNullableObject(cxt, data) + if (alwaysValidSchema(it, schema)) { + gen.if(not(or(cond, valid)), () => cxt.error()) + } else { + gen.if(cond) + gen.assign(valid, validateMap()) + gen.elseIf(not(valid)) + cxt.error() + gen.endIf() + } + cxt.ok(valid) + + function validateMap(): Name | boolean { + const _valid = gen.name("valid") + if (it.allErrors) { + const validMap = gen.let("valid", true) + validateValues(() => gen.assign(validMap, false)) + return validMap + } + gen.var(_valid, true) + validateValues(() => gen.break()) + return _valid + + function validateValues(notValid: () => void): void { + gen.forIn("key", data, (key) => { + cxt.subschema( + { + keyword: "values", + dataProp: key, + dataPropType: Type.Str, + }, + _valid + ) + gen.if(not(_valid), notValid) + }) + } + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/metadata.ts b/node_modules/ajv/lib/vocabularies/metadata.ts new file mode 100644 index 000000000..b9d5af85f --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/metadata.ts @@ -0,0 +1,17 @@ +import type {Vocabulary} from "../types" + +export const metadataVocabulary: Vocabulary = [ + "title", + "description", + "default", + "deprecated", + "readOnly", + "writeOnly", + "examples", +] + +export const contentVocabulary: Vocabulary = [ + "contentMediaType", + "contentEncoding", + "contentSchema", +] diff --git a/node_modules/ajv/lib/vocabularies/next.ts b/node_modules/ajv/lib/vocabularies/next.ts new file mode 100644 index 000000000..1e987ad21 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/next.ts @@ -0,0 +1,8 @@ +import type {Vocabulary} from "../types" +import dependentRequired from "./validation/dependentRequired" +import dependentSchemas from "./applicator/dependentSchemas" +import limitContains from "./validation/limitContains" + +const next: Vocabulary = [dependentRequired, dependentSchemas, limitContains] + +export default next diff --git a/node_modules/ajv/lib/vocabularies/unevaluated/index.ts b/node_modules/ajv/lib/vocabularies/unevaluated/index.ts new file mode 100644 index 000000000..f7f0815db --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/unevaluated/index.ts @@ -0,0 +1,7 @@ +import type {Vocabulary} from "../../types" +import unevaluatedProperties from "./unevaluatedProperties" +import unevaluatedItems from "./unevaluatedItems" + +const unevaluated: Vocabulary = [unevaluatedProperties, unevaluatedItems] + +export default unevaluated diff --git a/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts b/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts new file mode 100644 index 000000000..50bf0e7c1 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts @@ -0,0 +1,47 @@ +import type { + CodeKeywordDefinition, + ErrorObject, + KeywordErrorDefinition, + AnySchema, +} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, not, Name} from "../../compile/codegen" +import {alwaysValidSchema, Type} from "../../compile/util" + +export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {limit: number}, AnySchema> + +const error: KeywordErrorDefinition = { + message: ({params: {len}}) => str`must NOT have more than ${len} items`, + params: ({params: {len}}) => _`{limit: ${len}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "unevaluatedItems", + type: "array", + schemaType: ["boolean", "object"], + error, + code(cxt: KeywordCxt) { + const {gen, schema, data, it} = cxt + const items = it.items || 0 + if (items === true) return + const len = gen.const("len", _`${data}.length`) + if (schema === false) { + cxt.setParams({len: items}) + cxt.fail(_`${len} > ${items}`) + } else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { + const valid = gen.var("valid", _`${len} <= ${items}`) + gen.if(not(valid), () => validateItems(valid, items)) + cxt.ok(valid) + } + it.items = true + + function validateItems(valid: Name, from: Name | number): void { + gen.forRange("i", from, len, (i) => { + cxt.subschema({keyword: "unevaluatedItems", dataProp: i, dataPropType: Type.Num}, valid) + if (!it.allErrors) gen.if(not(valid), () => gen.break()) + }) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts b/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts new file mode 100644 index 000000000..0e6868fa3 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts @@ -0,0 +1,85 @@ +import type { + CodeKeywordDefinition, + KeywordErrorDefinition, + ErrorObject, + AnySchema, +} from "../../types" +import {_, not, and, Name, Code} from "../../compile/codegen" +import {alwaysValidSchema, Type} from "../../compile/util" +import N from "../../compile/names" + +export type UnevaluatedPropertiesError = ErrorObject< + "unevaluatedProperties", + {unevaluatedProperty: string}, + AnySchema +> + +const error: KeywordErrorDefinition = { + message: "must NOT have unevaluated properties", + params: ({params}) => _`{unevaluatedProperty: ${params.unevaluatedProperty}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "unevaluatedProperties", + type: "object", + schemaType: ["boolean", "object"], + trackErrors: true, + error, + code(cxt) { + const {gen, schema, data, errsCount, it} = cxt + /* istanbul ignore if */ + if (!errsCount) throw new Error("ajv implementation error") + const {allErrors, props} = it + if (props instanceof Name) { + gen.if(_`${props} !== true`, () => + gen.forIn("key", data, (key: Name) => + gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key)) + ) + ) + } else if (props !== true) { + gen.forIn("key", data, (key: Name) => + props === undefined + ? unevaluatedPropCode(key) + : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)) + ) + } + it.props = true + cxt.ok(_`${errsCount} === ${N.errors}`) + + function unevaluatedPropCode(key: Name): void { + if (schema === false) { + cxt.setParams({unevaluatedProperty: key}) + cxt.error() + if (!allErrors) gen.break() + return + } + + if (!alwaysValidSchema(it, schema)) { + const valid = gen.name("valid") + cxt.subschema( + { + keyword: "unevaluatedProperties", + dataProp: key, + dataPropType: Type.Str, + }, + valid + ) + if (!allErrors) gen.if(not(valid), () => gen.break()) + } + } + + function unevaluatedDynamic(evaluatedProps: Name, key: Name): Code { + return _`!${evaluatedProps} || !${evaluatedProps}[${key}]` + } + + function unevaluatedStatic(evaluatedProps: {[K in string]?: true}, key: Name): Code { + const ps: Code[] = [] + for (const p in evaluatedProps) { + if (evaluatedProps[p] === true) ps.push(_`${key} !== ${p}`) + } + return and(...ps) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/const.ts b/node_modules/ajv/lib/vocabularies/validation/const.ts new file mode 100644 index 000000000..a3b94a5dc --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/const.ts @@ -0,0 +1,28 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_} from "../../compile/codegen" +import {useFunc} from "../../compile/util" +import equal from "../../runtime/equal" + +export type ConstError = ErrorObject<"const", {allowedValue: any}> + +const error: KeywordErrorDefinition = { + message: "must be equal to constant", + params: ({schemaCode}) => _`{allowedValue: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "const", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, $data, schemaCode, schema} = cxt + if ($data || (schema && typeof schema == "object")) { + cxt.fail$data(_`!${useFunc(gen, equal)}(${data}, ${schemaCode})`) + } else { + cxt.fail(_`${schema} !== ${data}`) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts b/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts new file mode 100644 index 000000000..4c616cfa9 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts @@ -0,0 +1,23 @@ +import type {CodeKeywordDefinition, ErrorObject} from "../../types" +import { + validatePropertyDeps, + error, + DependenciesErrorParams, + PropertyDependencies, +} from "../applicator/dependencies" + +export type DependentRequiredError = ErrorObject< + "dependentRequired", + DependenciesErrorParams, + PropertyDependencies +> + +const def: CodeKeywordDefinition = { + keyword: "dependentRequired", + type: "object", + schemaType: "object", + error, + code: (cxt) => validatePropertyDeps(cxt), +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/enum.ts b/node_modules/ajv/lib/vocabularies/validation/enum.ts new file mode 100644 index 000000000..76377fb02 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/enum.ts @@ -0,0 +1,54 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, or, Name, Code} from "../../compile/codegen" +import {useFunc} from "../../compile/util" +import equal from "../../runtime/equal" + +export type EnumError = ErrorObject<"enum", {allowedValues: any[]}, any[] | {$data: string}> + +const error: KeywordErrorDefinition = { + message: "must be equal to one of the allowed values", + params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "enum", + schemaType: "array", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, $data, schema, schemaCode, it} = cxt + if (!$data && schema.length === 0) throw new Error("enum must have non-empty array") + const useLoop = schema.length >= it.opts.loopEnum + let eql: Name | undefined + const getEql = (): Name => (eql ??= useFunc(gen, equal)) + + let valid: Code + if (useLoop || $data) { + valid = gen.let("valid") + cxt.block$data(valid, loopEnum) + } else { + /* istanbul ignore if */ + if (!Array.isArray(schema)) throw new Error("ajv implementation error") + const vSchema = gen.const("vSchema", schemaCode) + valid = or(...schema.map((_x: unknown, i: number) => equalCode(vSchema, i))) + } + cxt.pass(valid) + + function loopEnum(): void { + gen.assign(valid, false) + gen.forOf("v", schemaCode as Code, (v) => + gen.if(_`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()) + ) + } + + function equalCode(vSchema: Name, i: number): Code { + const sch = schema[i] + return typeof sch === "object" && sch !== null + ? _`${getEql()}(${data}, ${vSchema}[${i}])` + : _`${data} === ${sch}` + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/index.ts b/node_modules/ajv/lib/vocabularies/validation/index.ts new file mode 100644 index 000000000..3531b1962 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/index.ts @@ -0,0 +1,49 @@ +import type {ErrorObject, Vocabulary} from "../../types" +import limitNumber, {LimitNumberError} from "./limitNumber" +import multipleOf, {MultipleOfError} from "./multipleOf" +import limitLength from "./limitLength" +import pattern, {PatternError} from "./pattern" +import limitProperties from "./limitProperties" +import required, {RequiredError} from "./required" +import limitItems from "./limitItems" +import uniqueItems, {UniqueItemsError} from "./uniqueItems" +import constKeyword, {ConstError} from "./const" +import enumKeyword, {EnumError} from "./enum" + +const validation: Vocabulary = [ + // number + limitNumber, + multipleOf, + // string + limitLength, + pattern, + // object + limitProperties, + required, + // array + limitItems, + uniqueItems, + // any + {keyword: "type", schemaType: ["string", "array"]}, + {keyword: "nullable", schemaType: "boolean"}, + constKeyword, + enumKeyword, +] + +export default validation + +type LimitError = ErrorObject< + "maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", + {limit: number}, + number | {$data: string} +> + +export type ValidationKeywordError = + | LimitError + | LimitNumberError + | MultipleOfError + | PatternError + | RequiredError + | UniqueItemsError + | ConstError + | EnumError diff --git a/node_modules/ajv/lib/vocabularies/validation/limitContains.ts b/node_modules/ajv/lib/vocabularies/validation/limitContains.ts new file mode 100644 index 000000000..8bb43c1a4 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/limitContains.ts @@ -0,0 +1,16 @@ +import type {CodeKeywordDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {checkStrictMode} from "../../compile/util" + +const def: CodeKeywordDefinition = { + keyword: ["maxContains", "minContains"], + type: "array", + schemaType: "number", + code({keyword, parentSchema, it}: KeywordCxt) { + if (parentSchema.contains === undefined) { + checkStrictMode(it, `"${keyword}" without "contains" is ignored`) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/limitItems.ts b/node_modules/ajv/lib/vocabularies/validation/limitItems.ts new file mode 100644 index 000000000..566de8588 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/limitItems.ts @@ -0,0 +1,26 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, operators} from "../../compile/codegen" + +const error: KeywordErrorDefinition = { + message({keyword, schemaCode}) { + const comp = keyword === "maxItems" ? "more" : "fewer" + return str`must NOT have ${comp} than ${schemaCode} items` + }, + params: ({schemaCode}) => _`{limit: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: ["maxItems", "minItems"], + type: "array", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {keyword, data, schemaCode} = cxt + const op = keyword === "maxItems" ? operators.GT : operators.LT + cxt.fail$data(_`${data}.length ${op} ${schemaCode}`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/limitLength.ts b/node_modules/ajv/lib/vocabularies/validation/limitLength.ts new file mode 100644 index 000000000..f4f947259 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/limitLength.ts @@ -0,0 +1,30 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, operators} from "../../compile/codegen" +import {useFunc} from "../../compile/util" +import ucs2length from "../../runtime/ucs2length" + +const error: KeywordErrorDefinition = { + message({keyword, schemaCode}) { + const comp = keyword === "maxLength" ? "more" : "fewer" + return str`must NOT have ${comp} than ${schemaCode} characters` + }, + params: ({schemaCode}) => _`{limit: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: ["maxLength", "minLength"], + type: "string", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {keyword, data, schemaCode, it} = cxt + const op = keyword === "maxLength" ? operators.GT : operators.LT + const len = + it.opts.unicode === false ? _`${data}.length` : _`${useFunc(cxt.gen, ucs2length)}(${data})` + cxt.fail$data(_`${len} ${op} ${schemaCode}`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts b/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts new file mode 100644 index 000000000..5499202ef --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts @@ -0,0 +1,42 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, operators, Code} from "../../compile/codegen" + +const ops = operators + +type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum" + +type Comparison = "<=" | ">=" | "<" | ">" + +const KWDs: {[K in Kwd]: {okStr: Comparison; ok: Code; fail: Code}} = { + maximum: {okStr: "<=", ok: ops.LTE, fail: ops.GT}, + minimum: {okStr: ">=", ok: ops.GTE, fail: ops.LT}, + exclusiveMaximum: {okStr: "<", ok: ops.LT, fail: ops.GTE}, + exclusiveMinimum: {okStr: ">", ok: ops.GT, fail: ops.LTE}, +} + +export type LimitNumberError = ErrorObject< + Kwd, + {limit: number; comparison: Comparison}, + number | {$data: string} +> + +const error: KeywordErrorDefinition = { + message: ({keyword, schemaCode}) => str`must be ${KWDs[keyword as Kwd].okStr} ${schemaCode}`, + params: ({keyword, schemaCode}) => + _`{comparison: ${KWDs[keyword as Kwd].okStr}, limit: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: Object.keys(KWDs), + type: "number", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {keyword, data, schemaCode} = cxt + cxt.fail$data(_`${data} ${KWDs[keyword as Kwd].fail} ${schemaCode} || isNaN(${data})`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts b/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts new file mode 100644 index 000000000..07fffa8b3 --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts @@ -0,0 +1,26 @@ +import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str, operators} from "../../compile/codegen" + +const error: KeywordErrorDefinition = { + message({keyword, schemaCode}) { + const comp = keyword === "maxProperties" ? "more" : "fewer" + return str`must NOT have ${comp} than ${schemaCode} properties` + }, + params: ({schemaCode}) => _`{limit: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: ["maxProperties", "minProperties"], + type: "object", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {keyword, data, schemaCode} = cxt + const op = keyword === "maxProperties" ? operators.GT : operators.LT + cxt.fail$data(_`Object.keys(${data}).length ${op} ${schemaCode}`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts b/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts new file mode 100644 index 000000000..1fd79abbd --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts @@ -0,0 +1,34 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {_, str} from "../../compile/codegen" + +export type MultipleOfError = ErrorObject< + "multipleOf", + {multipleOf: number}, + number | {$data: string} +> + +const error: KeywordErrorDefinition = { + message: ({schemaCode}) => str`must be multiple of ${schemaCode}`, + params: ({schemaCode}) => _`{multipleOf: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "multipleOf", + type: "number", + schemaType: "number", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, schemaCode, it} = cxt + // const bdt = bad$DataType(schemaCode, def.schemaType, $data) + const prec = it.opts.multipleOfPrecision + const res = gen.let("res") + const invalid = prec + ? _`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` + : _`${res} !== parseInt(${res})` + cxt.fail$data(_`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/pattern.ts b/node_modules/ajv/lib/vocabularies/validation/pattern.ts new file mode 100644 index 000000000..7b27b7d3c --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/pattern.ts @@ -0,0 +1,28 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {usePattern} from "../code" +import {_, str} from "../../compile/codegen" + +export type PatternError = ErrorObject<"pattern", {pattern: string}, string | {$data: string}> + +const error: KeywordErrorDefinition = { + message: ({schemaCode}) => str`must match pattern "${schemaCode}"`, + params: ({schemaCode}) => _`{pattern: ${schemaCode}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "pattern", + type: "string", + schemaType: "string", + $data: true, + error, + code(cxt: KeywordCxt) { + const {data, $data, schema, schemaCode, it} = cxt + // TODO regexp should be wrapped in try/catchs + const u = it.opts.unicodeRegExp ? "u" : "" + const regExp = $data ? _`(new RegExp(${schemaCode}, ${u}))` : usePattern(cxt, schema) + cxt.fail$data(_`!${regExp}.test(${data})`) + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/required.ts b/node_modules/ajv/lib/vocabularies/validation/required.ts new file mode 100644 index 000000000..fea7367ed --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/required.ts @@ -0,0 +1,98 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import { + checkReportMissingProp, + checkMissingProp, + reportMissingProp, + propertyInData, + noPropertyInData, +} from "../code" +import {_, str, nil, not, Name, Code} from "../../compile/codegen" +import {checkStrictMode} from "../../compile/util" + +export type RequiredError = ErrorObject< + "required", + {missingProperty: string}, + string[] | {$data: string} +> + +const error: KeywordErrorDefinition = { + message: ({params: {missingProperty}}) => str`must have required property '${missingProperty}'`, + params: ({params: {missingProperty}}) => _`{missingProperty: ${missingProperty}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "required", + type: "object", + schemaType: "array", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, schema, schemaCode, data, $data, it} = cxt + const {opts} = it + if (!$data && schema.length === 0) return + const useLoop = schema.length >= opts.loopRequired + if (it.allErrors) allErrorsMode() + else exitOnErrorMode() + + if (opts.strictRequired) { + const props = cxt.parentSchema.properties + const {definedProperties} = cxt.it + for (const requiredKey of schema) { + if (props?.[requiredKey] === undefined && !definedProperties.has(requiredKey)) { + const schemaPath = it.schemaEnv.baseId + it.errSchemaPath + const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)` + checkStrictMode(it, msg, it.opts.strictRequired) + } + } + } + + function allErrorsMode(): void { + if (useLoop || $data) { + cxt.block$data(nil, loopAllRequired) + } else { + for (const prop of schema) { + checkReportMissingProp(cxt, prop) + } + } + } + + function exitOnErrorMode(): void { + const missing = gen.let("missing") + if (useLoop || $data) { + const valid = gen.let("valid", true) + cxt.block$data(valid, () => loopUntilMissing(missing, valid)) + cxt.ok(valid) + } else { + gen.if(checkMissingProp(cxt, schema, missing)) + reportMissingProp(cxt, missing) + gen.else() + } + } + + function loopAllRequired(): void { + gen.forOf("prop", schemaCode as Code, (prop) => { + cxt.setParams({missingProperty: prop}) + gen.if(noPropertyInData(gen, data, prop, opts.ownProperties), () => cxt.error()) + }) + } + + function loopUntilMissing(missing: Name, valid: Name): void { + cxt.setParams({missingProperty: missing}) + gen.forOf( + missing, + schemaCode as Code, + () => { + gen.assign(valid, propertyInData(gen, data, missing, opts.ownProperties)) + gen.if(not(valid), () => { + cxt.error() + gen.break() + }) + }, + nil + ) + } + }, +} + +export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts b/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts new file mode 100644 index 000000000..765c4d04f --- /dev/null +++ b/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts @@ -0,0 +1,79 @@ +import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" +import type {KeywordCxt} from "../../compile/validate" +import {checkDataTypes, getSchemaTypes, DataType} from "../../compile/validate/dataType" +import {_, str, Name} from "../../compile/codegen" +import {useFunc} from "../../compile/util" +import equal from "../../runtime/equal" + +export type UniqueItemsError = ErrorObject< + "uniqueItems", + {i: number; j: number}, + boolean | {$data: string} +> + +const error: KeywordErrorDefinition = { + message: ({params: {i, j}}) => + str`must NOT have duplicate items (items ## ${j} and ${i} are identical)`, + params: ({params: {i, j}}) => _`{i: ${i}, j: ${j}}`, +} + +const def: CodeKeywordDefinition = { + keyword: "uniqueItems", + type: "array", + schemaType: "boolean", + $data: true, + error, + code(cxt: KeywordCxt) { + const {gen, data, $data, schema, parentSchema, schemaCode, it} = cxt + if (!$data && !schema) return + const valid = gen.let("valid") + const itemTypes = parentSchema.items ? getSchemaTypes(parentSchema.items) : [] + cxt.block$data(valid, validateUniqueItems, _`${schemaCode} === false`) + cxt.ok(valid) + + function validateUniqueItems(): void { + const i = gen.let("i", _`${data}.length`) + const j = gen.let("j") + cxt.setParams({i, j}) + gen.assign(valid, true) + gen.if(_`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)) + } + + function canOptimize(): boolean { + return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array") + } + + function loopN(i: Name, j: Name): void { + const item = gen.name("item") + const wrongType = checkDataTypes(itemTypes, item, it.opts.strictNumbers, DataType.Wrong) + const indices = gen.const("indices", _`{}`) + gen.for(_`;${i}--;`, () => { + gen.let(item, _`${data}[${i}]`) + gen.if(wrongType, _`continue`) + if (itemTypes.length > 1) gen.if(_`typeof ${item} == "string"`, _`${item} += "_"`) + gen + .if(_`typeof ${indices}[${item}] == "number"`, () => { + gen.assign(j, _`${indices}[${item}]`) + cxt.error() + gen.assign(valid, false).break() + }) + .code(_`${indices}[${item}] = ${i}`) + }) + } + + function loopN2(i: Name, j: Name): void { + const eql = useFunc(gen, equal) + const outer = gen.name("outer") + gen.label(outer).for(_`;${i}--;`, () => + gen.for(_`${j} = ${i}; ${j}--;`, () => + gen.if(_`${eql}(${data}[${i}], ${data}[${j}])`, () => { + cxt.error() + gen.assign(valid, false).break(outer) + }) + ) + ) + } + }, +} + +export default def diff --git a/node_modules/ajv/package.json b/node_modules/ajv/package.json new file mode 100644 index 000000000..61ae2b999 --- /dev/null +++ b/node_modules/ajv/package.json @@ -0,0 +1,126 @@ +{ + "name": "ajv", + "version": "8.12.0", + "description": "Another JSON Schema Validator", + "main": "dist/ajv.js", + "types": "dist/ajv.d.ts", + "files": [ + "lib/", + "dist/", + ".runkit_example.js" + ], + "scripts": { + "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" --ignore-pattern spec/JSON-Schema-Test-Suite", + "prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"", + "prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"", + "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot", + "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec", + "test-debug": "npm run test-spec -- --inspect-brk", + "test-cov": "nyc npm run test-spec", + "rollup": "rm -rf bundle && rollup -c", + "bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019 && node ./scripts/bundle.js 2020 ajv2020 ajv2020 && node ./scripts/bundle.js jtd ajvJTD ajvJTD", + "build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts && rm dist/refs/json-schema-2020-12/index.ts && rm dist/refs/jtd-schema.ts", + "json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests", + "test-karma": "karma start", + "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start", + "test-all": "npm run test-cov && if-node-version 12 npm run test-browser", + "test": "npm run json-tests && npm run prettier:check && npm run eslint && npm link && npm link --legacy-peer-deps ajv && npm run test-cov", + "test-ci": "AJV_FULL_TEST=true npm test", + "prepublish": "npm run build", + "benchmark": "npm i && npm run build && npm link && cd ./benchmark && npm link --legacy-peer-deps ajv && npm i && node ./jtd", + "docs:dev": "./scripts/prepare-site && vuepress dev docs", + "docs:build": "./scripts/prepare-site && vuepress build docs" + }, + "nyc": { + "exclude": [ + "**/spec/**", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + }, + "repository": "ajv-validator/ajv", + "keywords": [ + "JSON", + "schema", + "validator", + "validation", + "jsonschema", + "json-schema", + "json-schema-validator", + "json-schema-validation" + ], + "author": "Evgeny Poberezkin", + "license": "MIT", + "bugs": "https://github.com/ajv-validator/ajv/issues", + "homepage": "https://ajv.js.org", + "runkitExampleFilename": ".runkit_example.js", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "devDependencies": { + "@ajv-validator/config": "^0.3.0", + "@rollup/plugin-commonjs": "^24.0.0", + "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-node-resolve": "^15.0.1", + "@rollup/plugin-typescript": "^10.0.1", + "@types/chai": "^4.2.12", + "@types/mocha": "^10.0.0", + "@types/node": "^18.11.9", + "@types/require-from-string": "^1.2.0", + "@typescript-eslint/eslint-plugin": "^3.8.0", + "@typescript-eslint/parser": "^3.8.0", + "ajv-formats": "^3.0.0-rc.0", + "browserify": "^17.0.0", + "chai": "^4.0.1", + "cross-env": "^7.0.2", + "dayjs": "^1.10.4", + "dayjs-plugin-utc": "^0.1.2", + "eslint": "^7.8.1", + "eslint-config-prettier": "^7.0.0", + "fast-uri": "^2.1.0", + "glob": "^8.0.2", + "husky": "^8.0.2", + "if-node-version": "^1.0.0", + "jimp": "^0.16.1", + "js-beautify": "^1.7.3", + "json-schema-test": "^2.0.0", + "karma": "^6.0.0", + "karma-chrome-launcher": "^3.0.0", + "karma-mocha": "^2.0.0", + "lint-staged": "^13.0.3", + "mocha": "^10.0.0", + "module-from-string": "^3.1.3", + "node-fetch": "^3.0.0", + "nyc": "^15.0.0", + "prettier": "^2.3.1", + "re2": "^1.16.0", + "rollup": "^2.44.0", + "rollup-plugin-terser": "^7.0.2", + "ts-node": "^10.0.0", + "tsify": "^5.0.2", + "typescript": "^4.8.0" + }, + "collective": { + "type": "opencollective", + "url": "https://opencollective.com/ajv" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + }, + "prettier": "@ajv-validator/config/prettierrc.json", + "husky": { + "hooks": { + "pre-commit": "lint-staged && npm test" + } + }, + "lint-staged": { + "*.{json,yaml,js,ts}": "prettier --write" + } +} diff --git a/node_modules/ansi-regex/index.d.ts b/node_modules/ansi-regex/index.d.ts new file mode 100644 index 000000000..2dbf6af2b --- /dev/null +++ b/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,37 @@ +declare namespace ansiRegex { + interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + onlyFirst: boolean; + } +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/node_modules/ansi-regex/index.js b/node_modules/ansi-regex/index.js new file mode 100644 index 000000000..616ff837d --- /dev/null +++ b/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/node_modules/ansi-regex/license b/node_modules/ansi-regex/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/ansi-regex/package.json b/node_modules/ansi-regex/package.json new file mode 100644 index 000000000..017f53116 --- /dev/null +++ b/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/ansi-regex/readme.md b/node_modules/ansi-regex/readme.md new file mode 100644 index 000000000..4d848bc36 --- /dev/null +++ b/node_modules/ansi-regex/readme.md @@ -0,0 +1,78 @@ +# ansi-regex + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js new file mode 100644 index 000000000..90a871c4d --- /dev/null +++ b/node_modules/ansi-styles/index.js @@ -0,0 +1,165 @@ +'use strict'; +const colorConvert = require('color-convert'); + +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], + + // Bright color + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Fix humans + styles.color.grey = styles.color.gray; + + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; + + for (const styleName of Object.keys(group)) { + const style = group[styleName]; + + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + } + + const ansi2ansi = n => n; + const rgb2rgb = (r, g, b) => [r, g, b]; + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; + + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + + for (let key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } + + const suite = colorConvert[key]; + + if (key === 'ansi16') { + key = 'ansi'; + } + + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } + + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } + + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/ansi-styles/package.json b/node_modules/ansi-styles/package.json new file mode 100644 index 000000000..65edb48c3 --- /dev/null +++ b/node_modules/ansi-styles/package.json @@ -0,0 +1,56 @@ +{ + "name": "ansi-styles", + "version": "3.2.1", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "color-convert": "^1.9.0" + }, + "devDependencies": { + "ava": "*", + "babel-polyfill": "^6.23.0", + "svg-term-cli": "^2.1.1", + "xo": "*" + }, + "ava": { + "require": "babel-polyfill" + } +} diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md new file mode 100644 index 000000000..3158e2df5 --- /dev/null +++ b/node_modules/ansi-styles/readme.md @@ -0,0 +1,147 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + + + + +## Install + +``` +$ npm install ansi-styles +``` + + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close); +``` + +## API + +Each style has an `open` and `close` property. + + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` ("bright black") +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/node_modules/argparse/CHANGELOG.md b/node_modules/argparse/CHANGELOG.md new file mode 100644 index 000000000..dc39ed695 --- /dev/null +++ b/node_modules/argparse/CHANGELOG.md @@ -0,0 +1,216 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## [2.0.1] - 2020-08-29 +### Fixed +- Fix issue with `process.argv` when used with interpreters (`coffee`, `ts-node`, etc.), #150. + + +## [2.0.0] - 2020-08-14 +### Changed +- Full rewrite. Now port from python 3.9.0 & more precise following. + See [doc](./doc) for difference and migration info. +- node.js 10+ required +- Removed most of local docs in favour of original ones. + + +## [1.0.10] - 2018-02-15 +### Fixed +- Use .concat instead of + for arrays, #122. + + +## [1.0.9] - 2016-09-29 +### Changed +- Rerelease after 1.0.8 - deps cleanup. + + +## [1.0.8] - 2016-09-29 +### Changed +- Maintenance (deps bump, fix node 6.5+ tests, coverage report). + + +## [1.0.7] - 2016-03-17 +### Changed +- Teach `addArgument` to accept string arg names. #97, @tomxtobin. + + +## [1.0.6] - 2016-02-06 +### Changed +- Maintenance: moved to eslint & updated CS. + + +## [1.0.5] - 2016-02-05 +### Changed +- Removed lodash dependency to significantly reduce install size. + Thanks to @mourner. + + +## [1.0.4] - 2016-01-17 +### Changed +- Maintenance: lodash update to 4.0.0. + + +## [1.0.3] - 2015-10-27 +### Fixed +- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple. + + +## [1.0.2] - 2015-03-22 +### Changed +- Relaxed lodash version dependency. + + +## [1.0.1] - 2015-02-20 +### Changed +- Changed dependencies to be compatible with ancient nodejs. + + +## [1.0.0] - 2015-02-19 +### Changed +- Maintenance release. +- Replaced `underscore` with `lodash`. +- Bumped version to 1.0.0 to better reflect semver meaning. +- HISTORY.md -> CHANGELOG.md + + +## [0.1.16] - 2013-12-01 +### Changed +- Maintenance release. Updated dependencies and docs. + + +## [0.1.15] - 2013-05-13 +### Fixed +- Fixed #55, @trebor89 + + +## [0.1.14] - 2013-05-12 +### Fixed +- Fixed #62, @maxtaco + + +## [0.1.13] - 2013-04-08 +### Changed +- Added `.npmignore` to reduce package size + + +## [0.1.12] - 2013-02-10 +### Fixed +- Fixed conflictHandler (#46), @hpaulj + + +## [0.1.11] - 2013-02-07 +### Added +- Added 70+ tests (ported from python), @hpaulj +- Added conflictHandler, @applepicke +- Added fromfilePrefixChar, @hpaulj + +### Fixed +- Multiple bugfixes, @hpaulj + + +## [0.1.10] - 2012-12-30 +### Added +- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion) + support, thanks to @hpaulj + +### Fixed +- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj + + +## [0.1.9] - 2012-12-27 +### Fixed +- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj +- Fixed default value behavior with `*` positionals, thanks to @hpaulj +- Improve `getDefault()` behavior, thanks to @hpaulj +- Improve negative argument parsing, thanks to @hpaulj + + +## [0.1.8] - 2012-12-01 +### Fixed +- Fixed parser parents (issue #19), thanks to @hpaulj +- Fixed negative argument parse (issue #20), thanks to @hpaulj + + +## [0.1.7] - 2012-10-14 +### Fixed +- Fixed 'choices' argument parse (issue #16) +- Fixed stderr output (issue #15) + + +## [0.1.6] - 2012-09-09 +### Fixed +- Fixed check for conflict of options (thanks to @tomxtobin) + + +## [0.1.5] - 2012-09-03 +### Fixed +- Fix parser #setDefaults method (thanks to @tomxtobin) + + +## [0.1.4] - 2012-07-30 +### Fixed +- Fixed pseudo-argument support (thanks to @CGamesPlay) +- Fixed addHelp default (should be true), if not set (thanks to @benblank) + + +## [0.1.3] - 2012-06-27 +### Fixed +- Fixed formatter api name: Formatter -> HelpFormatter + + +## [0.1.2] - 2012-05-29 +### Fixed +- Removed excess whitespace in help +- Fixed error reporting, when parcer with subcommands + called with empty arguments + +### Added +- Added basic tests + + +## [0.1.1] - 2012-05-23 +### Fixed +- Fixed line wrapping in help formatter +- Added better error reporting on invalid arguments + + +## [0.1.0] - 2012-05-16 +### Added +- First release. + + +[2.0.1]: https://github.com/nodeca/argparse/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/nodeca/argparse/compare/1.0.10...2.0.0 +[1.0.10]: https://github.com/nodeca/argparse/compare/1.0.9...1.0.10 +[1.0.9]: https://github.com/nodeca/argparse/compare/1.0.8...1.0.9 +[1.0.8]: https://github.com/nodeca/argparse/compare/1.0.7...1.0.8 +[1.0.7]: https://github.com/nodeca/argparse/compare/1.0.6...1.0.7 +[1.0.6]: https://github.com/nodeca/argparse/compare/1.0.5...1.0.6 +[1.0.5]: https://github.com/nodeca/argparse/compare/1.0.4...1.0.5 +[1.0.4]: https://github.com/nodeca/argparse/compare/1.0.3...1.0.4 +[1.0.3]: https://github.com/nodeca/argparse/compare/1.0.2...1.0.3 +[1.0.2]: https://github.com/nodeca/argparse/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/nodeca/argparse/compare/1.0.0...1.0.1 +[1.0.0]: https://github.com/nodeca/argparse/compare/0.1.16...1.0.0 +[0.1.16]: https://github.com/nodeca/argparse/compare/0.1.15...0.1.16 +[0.1.15]: https://github.com/nodeca/argparse/compare/0.1.14...0.1.15 +[0.1.14]: https://github.com/nodeca/argparse/compare/0.1.13...0.1.14 +[0.1.13]: https://github.com/nodeca/argparse/compare/0.1.12...0.1.13 +[0.1.12]: https://github.com/nodeca/argparse/compare/0.1.11...0.1.12 +[0.1.11]: https://github.com/nodeca/argparse/compare/0.1.10...0.1.11 +[0.1.10]: https://github.com/nodeca/argparse/compare/0.1.9...0.1.10 +[0.1.9]: https://github.com/nodeca/argparse/compare/0.1.8...0.1.9 +[0.1.8]: https://github.com/nodeca/argparse/compare/0.1.7...0.1.8 +[0.1.7]: https://github.com/nodeca/argparse/compare/0.1.6...0.1.7 +[0.1.6]: https://github.com/nodeca/argparse/compare/0.1.5...0.1.6 +[0.1.5]: https://github.com/nodeca/argparse/compare/0.1.4...0.1.5 +[0.1.4]: https://github.com/nodeca/argparse/compare/0.1.3...0.1.4 +[0.1.3]: https://github.com/nodeca/argparse/compare/0.1.2...0.1.3 +[0.1.2]: https://github.com/nodeca/argparse/compare/0.1.1...0.1.2 +[0.1.1]: https://github.com/nodeca/argparse/compare/0.1.0...0.1.1 +[0.1.0]: https://github.com/nodeca/argparse/releases/tag/0.1.0 diff --git a/node_modules/argparse/LICENSE b/node_modules/argparse/LICENSE new file mode 100644 index 000000000..66a3ac80d --- /dev/null +++ b/node_modules/argparse/LICENSE @@ -0,0 +1,254 @@ +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see http://www.opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the Internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the Internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, 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. diff --git a/node_modules/argparse/README.md b/node_modules/argparse/README.md new file mode 100644 index 000000000..550b5c9b7 --- /dev/null +++ b/node_modules/argparse/README.md @@ -0,0 +1,84 @@ +argparse +======== + +[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse) +[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse) + +CLI arguments parser for node.js, with [sub-commands](https://docs.python.org/3.9/library/argparse.html#sub-commands) support. Port of python's [argparse](http://docs.python.org/dev/library/argparse.html) (version [3.9.0](https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py)). + +**Difference with original.** + +- JS has no keyword arguments support. + - Pass options instead: `new ArgumentParser({ description: 'example', add_help: true })`. +- JS has no python's types `int`, `float`, ... + - Use string-typed names: `.add_argument('-b', { type: 'int', help: 'help' })`. +- `%r` format specifier uses `require('util').inspect()`. + +More details in [doc](./doc). + + +Example +------- + +`test.js` file: + +```javascript +#!/usr/bin/env node +'use strict'; + +const { ArgumentParser } = require('argparse'); +const { version } = require('./package.json'); + +const parser = new ArgumentParser({ + description: 'Argparse example' +}); + +parser.add_argument('-v', '--version', { action: 'version', version }); +parser.add_argument('-f', '--foo', { help: 'foo bar' }); +parser.add_argument('-b', '--bar', { help: 'bar foo' }); +parser.add_argument('--baz', { help: 'baz bar' }); + +console.dir(parser.parse_args()); +``` + +Display help: + +``` +$ ./test.js -h +usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ] + +Argparse example + +optional arguments: + -h, --help show this help message and exit + -v, --version show program's version number and exit + -f FOO, --foo FOO foo bar + -b BAR, --bar BAR bar foo + --baz BAZ baz bar +``` + +Parse arguments: + +``` +$ ./test.js -f=3 --bar=4 --baz 5 +{ foo: '3', bar: '4', baz: '5' } +``` + + +API docs +-------- + +Since this is a port with minimal divergence, there's no separate documentation. +Use original one instead, with notes about difference. + +1. [Original doc](https://docs.python.org/3.9/library/argparse.html). +2. [Original tutorial](https://docs.python.org/3.9/howto/argparse.html). +3. [Difference with python](./doc). + + +argparse for enterprise +----------------------- + +Available as part of the Tidelift Subscription + +The maintainers of argparse and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-argparse?utm_source=npm-argparse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/argparse/argparse.js b/node_modules/argparse/argparse.js new file mode 100644 index 000000000..2b8c8c631 --- /dev/null +++ b/node_modules/argparse/argparse.js @@ -0,0 +1,3707 @@ +// Port of python's argparse module, version 3.9.0: +// https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py + +'use strict' + +// Copyright (C) 2010-2020 Python Software Foundation. +// Copyright (C) 2020 argparse.js authors + +/* + * Command-line parsing library + * + * This module is an optparse-inspired command-line parsing library that: + * + * - handles both optional and positional arguments + * - produces highly informative usage messages + * - supports parsers that dispatch to sub-parsers + * + * The following is a simple usage example that sums integers from the + * command-line and writes the result to a file:: + * + * parser = argparse.ArgumentParser( + * description='sum the integers at the command line') + * parser.add_argument( + * 'integers', metavar='int', nargs='+', type=int, + * help='an integer to be summed') + * parser.add_argument( + * '--log', default=sys.stdout, type=argparse.FileType('w'), + * help='the file where the sum should be written') + * args = parser.parse_args() + * args.log.write('%s' % sum(args.integers)) + * args.log.close() + * + * The module contains the following public classes: + * + * - ArgumentParser -- The main entry point for command-line parsing. As the + * example above shows, the add_argument() method is used to populate + * the parser with actions for optional and positional arguments. Then + * the parse_args() method is invoked to convert the args at the + * command-line into an object with attributes. + * + * - ArgumentError -- The exception raised by ArgumentParser objects when + * there are errors with the parser's actions. Errors raised while + * parsing the command-line are caught by ArgumentParser and emitted + * as command-line messages. + * + * - FileType -- A factory for defining types of files to be created. As the + * example above shows, instances of FileType are typically passed as + * the type= argument of add_argument() calls. + * + * - Action -- The base class for parser actions. Typically actions are + * selected by passing strings like 'store_true' or 'append_const' to + * the action= argument of add_argument(). However, for greater + * customization of ArgumentParser actions, subclasses of Action may + * be defined and passed as the action= argument. + * + * - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter, + * ArgumentDefaultsHelpFormatter -- Formatter classes which + * may be passed as the formatter_class= argument to the + * ArgumentParser constructor. HelpFormatter is the default, + * RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser + * not to change the formatting for help text, and + * ArgumentDefaultsHelpFormatter adds information about argument defaults + * to the help. + * + * All other classes in this module are considered implementation details. + * (Also note that HelpFormatter and RawDescriptionHelpFormatter are only + * considered public as object names -- the API of the formatter objects is + * still considered an implementation detail.) + */ + +const SUPPRESS = '==SUPPRESS==' + +const OPTIONAL = '?' +const ZERO_OR_MORE = '*' +const ONE_OR_MORE = '+' +const PARSER = 'A...' +const REMAINDER = '...' +const _UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args' + + +// ================================== +// Utility functions used for porting +// ================================== +const assert = require('assert') +const util = require('util') +const fs = require('fs') +const sub = require('./lib/sub') +const path = require('path') +const repr = util.inspect + +function get_argv() { + // omit first argument (which is assumed to be interpreter - `node`, `coffee`, `ts-node`, etc.) + return process.argv.slice(1) +} + +function get_terminal_size() { + return { + columns: +process.env.COLUMNS || process.stdout.columns || 80 + } +} + +function hasattr(object, name) { + return Object.prototype.hasOwnProperty.call(object, name) +} + +function getattr(object, name, value) { + return hasattr(object, name) ? object[name] : value +} + +function setattr(object, name, value) { + object[name] = value +} + +function setdefault(object, name, value) { + if (!hasattr(object, name)) object[name] = value + return object[name] +} + +function delattr(object, name) { + delete object[name] +} + +function range(from, to, step=1) { + // range(10) is equivalent to range(0, 10) + if (arguments.length === 1) [ to, from ] = [ from, 0 ] + if (typeof from !== 'number' || typeof to !== 'number' || typeof step !== 'number') { + throw new TypeError('argument cannot be interpreted as an integer') + } + if (step === 0) throw new TypeError('range() arg 3 must not be zero') + + let result = [] + if (step > 0) { + for (let i = from; i < to; i += step) result.push(i) + } else { + for (let i = from; i > to; i += step) result.push(i) + } + return result +} + +function splitlines(str, keepends = false) { + let result + if (!keepends) { + result = str.split(/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/) + } else { + result = [] + let parts = str.split(/(\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029])/) + for (let i = 0; i < parts.length; i += 2) { + result.push(parts[i] + (i + 1 < parts.length ? parts[i + 1] : '')) + } + } + if (!result[result.length - 1]) result.pop() + return result +} + +function _string_lstrip(string, prefix_chars) { + let idx = 0 + while (idx < string.length && prefix_chars.includes(string[idx])) idx++ + return idx ? string.slice(idx) : string +} + +function _string_split(string, sep, maxsplit) { + let result = string.split(sep) + if (result.length > maxsplit) { + result = result.slice(0, maxsplit).concat([ result.slice(maxsplit).join(sep) ]) + } + return result +} + +function _array_equal(array1, array2) { + if (array1.length !== array2.length) return false + for (let i = 0; i < array1.length; i++) { + if (array1[i] !== array2[i]) return false + } + return true +} + +function _array_remove(array, item) { + let idx = array.indexOf(item) + if (idx === -1) throw new TypeError(sub('%r not in list', item)) + array.splice(idx, 1) +} + +// normalize choices to array; +// this isn't required in python because `in` and `map` operators work with anything, +// but in js dealing with multiple types here is too clunky +function _choices_to_array(choices) { + if (choices === undefined) { + return [] + } else if (Array.isArray(choices)) { + return choices + } else if (choices !== null && typeof choices[Symbol.iterator] === 'function') { + return Array.from(choices) + } else if (typeof choices === 'object' && choices !== null) { + return Object.keys(choices) + } else { + throw new Error(sub('invalid choices value: %r', choices)) + } +} + +// decorator that allows a class to be called without new +function _callable(cls) { + let result = { // object is needed for inferred class name + [cls.name]: function (...args) { + let this_class = new.target === result || !new.target + return Reflect.construct(cls, args, this_class ? cls : new.target) + } + } + result[cls.name].prototype = cls.prototype + // fix default tag for toString, e.g. [object Action] instead of [object Object] + cls.prototype[Symbol.toStringTag] = cls.name + return result[cls.name] +} + +function _alias(object, from, to) { + try { + let name = object.constructor.name + Object.defineProperty(object, from, { + value: util.deprecate(object[to], sub('%s.%s() is renamed to %s.%s()', + name, from, name, to)), + enumerable: false + }) + } catch {} +} + +// decorator that allows snake_case class methods to be called with camelCase and vice versa +function _camelcase_alias(_class) { + for (let name of Object.getOwnPropertyNames(_class.prototype)) { + let camelcase = name.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase()) + if (camelcase !== name) _alias(_class.prototype, camelcase, name) + } + return _class +} + +function _to_legacy_name(key) { + key = key.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase()) + if (key === 'default') key = 'defaultValue' + if (key === 'const') key = 'constant' + return key +} + +function _to_new_name(key) { + if (key === 'defaultValue') key = 'default' + if (key === 'constant') key = 'const' + key = key.replace(/[A-Z]/g, c => '_' + c.toLowerCase()) + return key +} + +// parse options +let no_default = Symbol('no_default_value') +function _parse_opts(args, descriptor) { + function get_name() { + let stack = new Error().stack.split('\n') + .map(x => x.match(/^ at (.*) \(.*\)$/)) + .filter(Boolean) + .map(m => m[1]) + .map(fn => fn.match(/[^ .]*$/)[0]) + + if (stack.length && stack[0] === get_name.name) stack.shift() + if (stack.length && stack[0] === _parse_opts.name) stack.shift() + return stack.length ? stack[0] : '' + } + + args = Array.from(args) + let kwargs = {} + let result = [] + let last_opt = args.length && args[args.length - 1] + + if (typeof last_opt === 'object' && last_opt !== null && !Array.isArray(last_opt) && + (!last_opt.constructor || last_opt.constructor.name === 'Object')) { + kwargs = Object.assign({}, args.pop()) + } + + // LEGACY (v1 compatibility): camelcase + let renames = [] + for (let key of Object.keys(descriptor)) { + let old_name = _to_legacy_name(key) + if (old_name !== key && (old_name in kwargs)) { + if (key in kwargs) { + // default and defaultValue specified at the same time, happens often in old tests + //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key)) + } else { + kwargs[key] = kwargs[old_name] + } + renames.push([ old_name, key ]) + delete kwargs[old_name] + } + } + if (renames.length) { + let name = get_name() + deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s', + name, renames.map(([ a, b ]) => sub('%r -> %r', a, b)))) + } + // end + + let missing_positionals = [] + let positional_count = args.length + + for (let [ key, def ] of Object.entries(descriptor)) { + if (key[0] === '*') { + if (key.length > 0 && key[1] === '*') { + // LEGACY (v1 compatibility): camelcase + let renames = [] + for (let key of Object.keys(kwargs)) { + let new_name = _to_new_name(key) + if (new_name !== key && (key in kwargs)) { + if (new_name in kwargs) { + // default and defaultValue specified at the same time, happens often in old tests + //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), new_name)) + } else { + kwargs[new_name] = kwargs[key] + } + renames.push([ key, new_name ]) + delete kwargs[key] + } + } + if (renames.length) { + let name = get_name() + deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s', + name, renames.map(([ a, b ]) => sub('%r -> %r', a, b)))) + } + // end + result.push(kwargs) + kwargs = {} + } else { + result.push(args) + args = [] + } + } else if (key in kwargs && args.length > 0) { + throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key)) + } else if (key in kwargs) { + result.push(kwargs[key]) + delete kwargs[key] + } else if (args.length > 0) { + result.push(args.shift()) + } else if (def !== no_default) { + result.push(def) + } else { + missing_positionals.push(key) + } + } + + if (Object.keys(kwargs).length) { + throw new TypeError(sub('%s() got an unexpected keyword argument %r', + get_name(), Object.keys(kwargs)[0])) + } + + if (args.length) { + let from = Object.entries(descriptor).filter(([ k, v ]) => k[0] !== '*' && v !== no_default).length + let to = Object.entries(descriptor).filter(([ k ]) => k[0] !== '*').length + throw new TypeError(sub('%s() takes %s positional argument%s but %s %s given', + get_name(), + from === to ? sub('from %s to %s', from, to) : to, + from === to && to === 1 ? '' : 's', + positional_count, + positional_count === 1 ? 'was' : 'were')) + } + + if (missing_positionals.length) { + let strs = missing_positionals.map(repr) + if (strs.length > 1) strs[strs.length - 1] = 'and ' + strs[strs.length - 1] + let str_joined = strs.join(strs.length === 2 ? '' : ', ') + throw new TypeError(sub('%s() missing %i required positional argument%s: %s', + get_name(), strs.length, strs.length === 1 ? '' : 's', str_joined)) + } + + return result +} + +let _deprecations = {} +function deprecate(id, string) { + _deprecations[id] = _deprecations[id] || util.deprecate(() => {}, string) + _deprecations[id]() +} + + +// ============================= +// Utility functions and classes +// ============================= +function _AttributeHolder(cls = Object) { + /* + * Abstract base class that provides __repr__. + * + * The __repr__ method returns a string in the format:: + * ClassName(attr=name, attr=name, ...) + * The attributes are determined either by a class-level attribute, + * '_kwarg_names', or by inspecting the instance __dict__. + */ + + return class _AttributeHolder extends cls { + [util.inspect.custom]() { + let type_name = this.constructor.name + let arg_strings = [] + let star_args = {} + for (let arg of this._get_args()) { + arg_strings.push(repr(arg)) + } + for (let [ name, value ] of this._get_kwargs()) { + if (/^[a-z_][a-z0-9_$]*$/i.test(name)) { + arg_strings.push(sub('%s=%r', name, value)) + } else { + star_args[name] = value + } + } + if (Object.keys(star_args).length) { + arg_strings.push(sub('**%s', repr(star_args))) + } + return sub('%s(%s)', type_name, arg_strings.join(', ')) + } + + toString() { + return this[util.inspect.custom]() + } + + _get_kwargs() { + return Object.entries(this) + } + + _get_args() { + return [] + } + } +} + + +function _copy_items(items) { + if (items === undefined) { + return [] + } + return items.slice(0) +} + + +// =============== +// Formatting Help +// =============== +const HelpFormatter = _camelcase_alias(_callable(class HelpFormatter { + /* + * Formatter for generating usage messages and argument help strings. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + constructor() { + let [ + prog, + indent_increment, + max_help_position, + width + ] = _parse_opts(arguments, { + prog: no_default, + indent_increment: 2, + max_help_position: 24, + width: undefined + }) + + // default setting for width + if (width === undefined) { + width = get_terminal_size().columns + width -= 2 + } + + this._prog = prog + this._indent_increment = indent_increment + this._max_help_position = Math.min(max_help_position, + Math.max(width - 20, indent_increment * 2)) + this._width = width + + this._current_indent = 0 + this._level = 0 + this._action_max_length = 0 + + this._root_section = this._Section(this, undefined) + this._current_section = this._root_section + + this._whitespace_matcher = /[ \t\n\r\f\v]+/g // equivalent to python /\s+/ with ASCII flag + this._long_break_matcher = /\n\n\n+/g + } + + // =============================== + // Section and indentation methods + // =============================== + _indent() { + this._current_indent += this._indent_increment + this._level += 1 + } + + _dedent() { + this._current_indent -= this._indent_increment + assert(this._current_indent >= 0, 'Indent decreased below 0.') + this._level -= 1 + } + + _add_item(func, args) { + this._current_section.items.push([ func, args ]) + } + + // ======================== + // Message building methods + // ======================== + start_section(heading) { + this._indent() + let section = this._Section(this, this._current_section, heading) + this._add_item(section.format_help.bind(section), []) + this._current_section = section + } + + end_section() { + this._current_section = this._current_section.parent + this._dedent() + } + + add_text(text) { + if (text !== SUPPRESS && text !== undefined) { + this._add_item(this._format_text.bind(this), [text]) + } + } + + add_usage(usage, actions, groups, prefix = undefined) { + if (usage !== SUPPRESS) { + let args = [ usage, actions, groups, prefix ] + this._add_item(this._format_usage.bind(this), args) + } + } + + add_argument(action) { + if (action.help !== SUPPRESS) { + + // find all invocations + let invocations = [this._format_action_invocation(action)] + for (let subaction of this._iter_indented_subactions(action)) { + invocations.push(this._format_action_invocation(subaction)) + } + + // update the maximum item length + let invocation_length = Math.max(...invocations.map(invocation => invocation.length)) + let action_length = invocation_length + this._current_indent + this._action_max_length = Math.max(this._action_max_length, + action_length) + + // add the item to the list + this._add_item(this._format_action.bind(this), [action]) + } + } + + add_arguments(actions) { + for (let action of actions) { + this.add_argument(action) + } + } + + // ======================= + // Help-formatting methods + // ======================= + format_help() { + let help = this._root_section.format_help() + if (help) { + help = help.replace(this._long_break_matcher, '\n\n') + help = help.replace(/^\n+|\n+$/g, '') + '\n' + } + return help + } + + _join_parts(part_strings) { + return part_strings.filter(part => part && part !== SUPPRESS).join('') + } + + _format_usage(usage, actions, groups, prefix) { + if (prefix === undefined) { + prefix = 'usage: ' + } + + // if usage is specified, use that + if (usage !== undefined) { + usage = sub(usage, { prog: this._prog }) + + // if no optionals or positionals are available, usage is just prog + } else if (usage === undefined && !actions.length) { + usage = sub('%(prog)s', { prog: this._prog }) + + // if optionals and positionals are available, calculate usage + } else if (usage === undefined) { + let prog = sub('%(prog)s', { prog: this._prog }) + + // split optionals from positionals + let optionals = [] + let positionals = [] + for (let action of actions) { + if (action.option_strings.length) { + optionals.push(action) + } else { + positionals.push(action) + } + } + + // build full usage string + let action_usage = this._format_actions_usage([].concat(optionals).concat(positionals), groups) + usage = [ prog, action_usage ].map(String).join(' ') + + // wrap the usage parts if it's too long + let text_width = this._width - this._current_indent + if (prefix.length + usage.length > text_width) { + + // break usage into wrappable parts + let part_regexp = /\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+/g + let opt_usage = this._format_actions_usage(optionals, groups) + let pos_usage = this._format_actions_usage(positionals, groups) + let opt_parts = opt_usage.match(part_regexp) || [] + let pos_parts = pos_usage.match(part_regexp) || [] + assert(opt_parts.join(' ') === opt_usage) + assert(pos_parts.join(' ') === pos_usage) + + // helper for wrapping lines + let get_lines = (parts, indent, prefix = undefined) => { + let lines = [] + let line = [] + let line_len + if (prefix !== undefined) { + line_len = prefix.length - 1 + } else { + line_len = indent.length - 1 + } + for (let part of parts) { + if (line_len + 1 + part.length > text_width && line) { + lines.push(indent + line.join(' ')) + line = [] + line_len = indent.length - 1 + } + line.push(part) + line_len += part.length + 1 + } + if (line.length) { + lines.push(indent + line.join(' ')) + } + if (prefix !== undefined) { + lines[0] = lines[0].slice(indent.length) + } + return lines + } + + let lines + + // if prog is short, follow it with optionals or positionals + if (prefix.length + prog.length <= 0.75 * text_width) { + let indent = ' '.repeat(prefix.length + prog.length + 1) + if (opt_parts.length) { + lines = get_lines([prog].concat(opt_parts), indent, prefix) + lines = lines.concat(get_lines(pos_parts, indent)) + } else if (pos_parts.length) { + lines = get_lines([prog].concat(pos_parts), indent, prefix) + } else { + lines = [prog] + } + + // if prog is long, put it on its own line + } else { + let indent = ' '.repeat(prefix.length) + let parts = [].concat(opt_parts).concat(pos_parts) + lines = get_lines(parts, indent) + if (lines.length > 1) { + lines = [] + lines = lines.concat(get_lines(opt_parts, indent)) + lines = lines.concat(get_lines(pos_parts, indent)) + } + lines = [prog].concat(lines) + } + + // join lines into usage + usage = lines.join('\n') + } + } + + // prefix with 'usage:' + return sub('%s%s\n\n', prefix, usage) + } + + _format_actions_usage(actions, groups) { + // find group indices and identify actions in groups + let group_actions = new Set() + let inserts = {} + for (let group of groups) { + let start = actions.indexOf(group._group_actions[0]) + if (start === -1) { + continue + } else { + let end = start + group._group_actions.length + if (_array_equal(actions.slice(start, end), group._group_actions)) { + for (let action of group._group_actions) { + group_actions.add(action) + } + if (!group.required) { + if (start in inserts) { + inserts[start] += ' [' + } else { + inserts[start] = '[' + } + if (end in inserts) { + inserts[end] += ']' + } else { + inserts[end] = ']' + } + } else { + if (start in inserts) { + inserts[start] += ' (' + } else { + inserts[start] = '(' + } + if (end in inserts) { + inserts[end] += ')' + } else { + inserts[end] = ')' + } + } + for (let i of range(start + 1, end)) { + inserts[i] = '|' + } + } + } + } + + // collect all actions format strings + let parts = [] + for (let [ i, action ] of Object.entries(actions)) { + + // suppressed arguments are marked with None + // remove | separators for suppressed arguments + if (action.help === SUPPRESS) { + parts.push(undefined) + if (inserts[+i] === '|') { + delete inserts[+i] + } else if (inserts[+i + 1] === '|') { + delete inserts[+i + 1] + } + + // produce all arg strings + } else if (!action.option_strings.length) { + let default_value = this._get_default_metavar_for_positional(action) + let part = this._format_args(action, default_value) + + // if it's in a group, strip the outer [] + if (group_actions.has(action)) { + if (part[0] === '[' && part[part.length - 1] === ']') { + part = part.slice(1, -1) + } + } + + // add the action string to the list + parts.push(part) + + // produce the first way to invoke the option in brackets + } else { + let option_string = action.option_strings[0] + let part + + // if the Optional doesn't take a value, format is: + // -s or --long + if (action.nargs === 0) { + part = action.format_usage() + + // if the Optional takes a value, format is: + // -s ARGS or --long ARGS + } else { + let default_value = this._get_default_metavar_for_optional(action) + let args_string = this._format_args(action, default_value) + part = sub('%s %s', option_string, args_string) + } + + // make it look optional if it's not required or in a group + if (!action.required && !group_actions.has(action)) { + part = sub('[%s]', part) + } + + // add the action string to the list + parts.push(part) + } + } + + // insert things at the necessary indices + for (let i of Object.keys(inserts).map(Number).sort((a, b) => b - a)) { + parts.splice(+i, 0, inserts[+i]) + } + + // join all the action items with spaces + let text = parts.filter(Boolean).join(' ') + + // clean up separators for mutually exclusive groups + text = text.replace(/([\[(]) /g, '$1') + text = text.replace(/ ([\])])/g, '$1') + text = text.replace(/[\[(] *[\])]/g, '') + text = text.replace(/\(([^|]*)\)/g, '$1', text) + text = text.trim() + + // return the text + return text + } + + _format_text(text) { + if (text.includes('%(prog)')) { + text = sub(text, { prog: this._prog }) + } + let text_width = Math.max(this._width - this._current_indent, 11) + let indent = ' '.repeat(this._current_indent) + return this._fill_text(text, text_width, indent) + '\n\n' + } + + _format_action(action) { + // determine the required width and the entry label + let help_position = Math.min(this._action_max_length + 2, + this._max_help_position) + let help_width = Math.max(this._width - help_position, 11) + let action_width = help_position - this._current_indent - 2 + let action_header = this._format_action_invocation(action) + let indent_first + + // no help; start on same line and add a final newline + if (!action.help) { + let tup = [ this._current_indent, '', action_header ] + action_header = sub('%*s%s\n', ...tup) + + // short action name; start on the same line and pad two spaces + } else if (action_header.length <= action_width) { + let tup = [ this._current_indent, '', action_width, action_header ] + action_header = sub('%*s%-*s ', ...tup) + indent_first = 0 + + // long action name; start on the next line + } else { + let tup = [ this._current_indent, '', action_header ] + action_header = sub('%*s%s\n', ...tup) + indent_first = help_position + } + + // collect the pieces of the action help + let parts = [action_header] + + // if there was help for the action, add lines of help text + if (action.help) { + let help_text = this._expand_help(action) + let help_lines = this._split_lines(help_text, help_width) + parts.push(sub('%*s%s\n', indent_first, '', help_lines[0])) + for (let line of help_lines.slice(1)) { + parts.push(sub('%*s%s\n', help_position, '', line)) + } + + // or add a newline if the description doesn't end with one + } else if (!action_header.endsWith('\n')) { + parts.push('\n') + } + + // if there are any sub-actions, add their help as well + for (let subaction of this._iter_indented_subactions(action)) { + parts.push(this._format_action(subaction)) + } + + // return a single string + return this._join_parts(parts) + } + + _format_action_invocation(action) { + if (!action.option_strings.length) { + let default_value = this._get_default_metavar_for_positional(action) + let metavar = this._metavar_formatter(action, default_value)(1)[0] + return metavar + + } else { + let parts = [] + + // if the Optional doesn't take a value, format is: + // -s, --long + if (action.nargs === 0) { + parts = parts.concat(action.option_strings) + + // if the Optional takes a value, format is: + // -s ARGS, --long ARGS + } else { + let default_value = this._get_default_metavar_for_optional(action) + let args_string = this._format_args(action, default_value) + for (let option_string of action.option_strings) { + parts.push(sub('%s %s', option_string, args_string)) + } + } + + return parts.join(', ') + } + } + + _metavar_formatter(action, default_metavar) { + let result + if (action.metavar !== undefined) { + result = action.metavar + } else if (action.choices !== undefined) { + let choice_strs = _choices_to_array(action.choices).map(String) + result = sub('{%s}', choice_strs.join(',')) + } else { + result = default_metavar + } + + function format(tuple_size) { + if (Array.isArray(result)) { + return result + } else { + return Array(tuple_size).fill(result) + } + } + return format + } + + _format_args(action, default_metavar) { + let get_metavar = this._metavar_formatter(action, default_metavar) + let result + if (action.nargs === undefined) { + result = sub('%s', ...get_metavar(1)) + } else if (action.nargs === OPTIONAL) { + result = sub('[%s]', ...get_metavar(1)) + } else if (action.nargs === ZERO_OR_MORE) { + let metavar = get_metavar(1) + if (metavar.length === 2) { + result = sub('[%s [%s ...]]', ...metavar) + } else { + result = sub('[%s ...]', ...metavar) + } + } else if (action.nargs === ONE_OR_MORE) { + result = sub('%s [%s ...]', ...get_metavar(2)) + } else if (action.nargs === REMAINDER) { + result = '...' + } else if (action.nargs === PARSER) { + result = sub('%s ...', ...get_metavar(1)) + } else if (action.nargs === SUPPRESS) { + result = '' + } else { + let formats + try { + formats = range(action.nargs).map(() => '%s') + } catch (err) { + throw new TypeError('invalid nargs value') + } + result = sub(formats.join(' '), ...get_metavar(action.nargs)) + } + return result + } + + _expand_help(action) { + let params = Object.assign({ prog: this._prog }, action) + for (let name of Object.keys(params)) { + if (params[name] === SUPPRESS) { + delete params[name] + } + } + for (let name of Object.keys(params)) { + if (params[name] && params[name].name) { + params[name] = params[name].name + } + } + if (params.choices !== undefined) { + let choices_str = _choices_to_array(params.choices).map(String).join(', ') + params.choices = choices_str + } + // LEGACY (v1 compatibility): camelcase + for (let key of Object.keys(params)) { + let old_name = _to_legacy_name(key) + if (old_name !== key) { + params[old_name] = params[key] + } + } + // end + return sub(this._get_help_string(action), params) + } + + * _iter_indented_subactions(action) { + if (typeof action._get_subactions === 'function') { + this._indent() + yield* action._get_subactions() + this._dedent() + } + } + + _split_lines(text, width) { + text = text.replace(this._whitespace_matcher, ' ').trim() + // The textwrap module is used only for formatting help. + // Delay its import for speeding up the common usage of argparse. + let textwrap = require('./lib/textwrap') + return textwrap.wrap(text, { width }) + } + + _fill_text(text, width, indent) { + text = text.replace(this._whitespace_matcher, ' ').trim() + let textwrap = require('./lib/textwrap') + return textwrap.fill(text, { width, + initial_indent: indent, + subsequent_indent: indent }) + } + + _get_help_string(action) { + return action.help + } + + _get_default_metavar_for_optional(action) { + return action.dest.toUpperCase() + } + + _get_default_metavar_for_positional(action) { + return action.dest + } +})) + +HelpFormatter.prototype._Section = _callable(class _Section { + + constructor(formatter, parent, heading = undefined) { + this.formatter = formatter + this.parent = parent + this.heading = heading + this.items = [] + } + + format_help() { + // format the indented section + if (this.parent !== undefined) { + this.formatter._indent() + } + let item_help = this.formatter._join_parts(this.items.map(([ func, args ]) => func.apply(null, args))) + if (this.parent !== undefined) { + this.formatter._dedent() + } + + // return nothing if the section was empty + if (!item_help) { + return '' + } + + // add the heading if the section was non-empty + let heading + if (this.heading !== SUPPRESS && this.heading !== undefined) { + let current_indent = this.formatter._current_indent + heading = sub('%*s%s:\n', current_indent, '', this.heading) + } else { + heading = '' + } + + // join the section-initial newline, the heading and the help + return this.formatter._join_parts(['\n', heading, item_help, '\n']) + } +}) + + +const RawDescriptionHelpFormatter = _camelcase_alias(_callable(class RawDescriptionHelpFormatter extends HelpFormatter { + /* + * Help message formatter which retains any formatting in descriptions. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _fill_text(text, width, indent) { + return splitlines(text, true).map(line => indent + line).join('') + } +})) + + +const RawTextHelpFormatter = _camelcase_alias(_callable(class RawTextHelpFormatter extends RawDescriptionHelpFormatter { + /* + * Help message formatter which retains formatting of all help text. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _split_lines(text/*, width*/) { + return splitlines(text) + } +})) + + +const ArgumentDefaultsHelpFormatter = _camelcase_alias(_callable(class ArgumentDefaultsHelpFormatter extends HelpFormatter { + /* + * Help message formatter which adds default values to argument help. + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _get_help_string(action) { + let help = action.help + // LEGACY (v1 compatibility): additional check for defaultValue needed + if (!action.help.includes('%(default)') && !action.help.includes('%(defaultValue)')) { + if (action.default !== SUPPRESS) { + let defaulting_nargs = [OPTIONAL, ZERO_OR_MORE] + if (action.option_strings.length || defaulting_nargs.includes(action.nargs)) { + help += ' (default: %(default)s)' + } + } + } + return help + } +})) + + +const MetavarTypeHelpFormatter = _camelcase_alias(_callable(class MetavarTypeHelpFormatter extends HelpFormatter { + /* + * Help message formatter which uses the argument 'type' as the default + * metavar value (instead of the argument 'dest') + * + * Only the name of this class is considered a public API. All the methods + * provided by the class are considered an implementation detail. + */ + + _get_default_metavar_for_optional(action) { + return typeof action.type === 'function' ? action.type.name : action.type + } + + _get_default_metavar_for_positional(action) { + return typeof action.type === 'function' ? action.type.name : action.type + } +})) + + +// ===================== +// Options and Arguments +// ===================== +function _get_action_name(argument) { + if (argument === undefined) { + return undefined + } else if (argument.option_strings.length) { + return argument.option_strings.join('/') + } else if (![ undefined, SUPPRESS ].includes(argument.metavar)) { + return argument.metavar + } else if (![ undefined, SUPPRESS ].includes(argument.dest)) { + return argument.dest + } else { + return undefined + } +} + + +const ArgumentError = _callable(class ArgumentError extends Error { + /* + * An error from creating or using an argument (optional or positional). + * + * The string value of this exception is the message, augmented with + * information about the argument that caused it. + */ + + constructor(argument, message) { + super() + this.name = 'ArgumentError' + this._argument_name = _get_action_name(argument) + this._message = message + this.message = this.str() + } + + str() { + let format + if (this._argument_name === undefined) { + format = '%(message)s' + } else { + format = 'argument %(argument_name)s: %(message)s' + } + return sub(format, { message: this._message, + argument_name: this._argument_name }) + } +}) + + +const ArgumentTypeError = _callable(class ArgumentTypeError extends Error { + /* + * An error from trying to convert a command line string to a type. + */ + + constructor(message) { + super(message) + this.name = 'ArgumentTypeError' + } +}) + + +// ============== +// Action classes +// ============== +const Action = _camelcase_alias(_callable(class Action extends _AttributeHolder(Function) { + /* + * Information about how to convert command line strings to Python objects. + * + * Action objects are used by an ArgumentParser to represent the information + * needed to parse a single argument from one or more strings from the + * command line. The keyword arguments to the Action constructor are also + * all attributes of Action instances. + * + * Keyword Arguments: + * + * - option_strings -- A list of command-line option strings which + * should be associated with this action. + * + * - dest -- The name of the attribute to hold the created object(s) + * + * - nargs -- The number of command-line arguments that should be + * consumed. By default, one argument will be consumed and a single + * value will be produced. Other values include: + * - N (an integer) consumes N arguments (and produces a list) + * - '?' consumes zero or one arguments + * - '*' consumes zero or more arguments (and produces a list) + * - '+' consumes one or more arguments (and produces a list) + * Note that the difference between the default and nargs=1 is that + * with the default, a single value will be produced, while with + * nargs=1, a list containing a single value will be produced. + * + * - const -- The value to be produced if the option is specified and the + * option uses an action that takes no values. + * + * - default -- The value to be produced if the option is not specified. + * + * - type -- A callable that accepts a single string argument, and + * returns the converted value. The standard Python types str, int, + * float, and complex are useful examples of such callables. If None, + * str is used. + * + * - choices -- A container of values that should be allowed. If not None, + * after a command-line argument has been converted to the appropriate + * type, an exception will be raised if it is not a member of this + * collection. + * + * - required -- True if the action must always be specified at the + * command line. This is only meaningful for optional command-line + * arguments. + * + * - help -- The help string describing the argument. + * + * - metavar -- The name to be used for the option's argument with the + * help string. If None, the 'dest' value will be used as the name. + */ + + constructor() { + let [ + option_strings, + dest, + nargs, + const_value, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + nargs: undefined, + const: undefined, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + // when this class is called as a function, redirect it to .call() method of itself + super('return arguments.callee.call.apply(arguments.callee, arguments)') + + this.option_strings = option_strings + this.dest = dest + this.nargs = nargs + this.const = const_value + this.default = default_value + this.type = type + this.choices = choices + this.required = required + this.help = help + this.metavar = metavar + } + + _get_kwargs() { + let names = [ + 'option_strings', + 'dest', + 'nargs', + 'const', + 'default', + 'type', + 'choices', + 'help', + 'metavar' + ] + return names.map(name => [ name, getattr(this, name) ]) + } + + format_usage() { + return this.option_strings[0] + } + + call(/*parser, namespace, values, option_string = undefined*/) { + throw new Error('.call() not defined') + } +})) + + +const BooleanOptionalAction = _camelcase_alias(_callable(class BooleanOptionalAction extends Action { + + constructor() { + let [ + option_strings, + dest, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + let _option_strings = [] + for (let option_string of option_strings) { + _option_strings.push(option_string) + + if (option_string.startsWith('--')) { + option_string = '--no-' + option_string.slice(2) + _option_strings.push(option_string) + } + } + + if (help !== undefined && default_value !== undefined) { + help += ` (default: ${default_value})` + } + + super({ + option_strings: _option_strings, + dest, + nargs: 0, + default: default_value, + type, + choices, + required, + help, + metavar + }) + } + + call(parser, namespace, values, option_string = undefined) { + if (this.option_strings.includes(option_string)) { + setattr(namespace, this.dest, !option_string.startsWith('--no-')) + } + } + + format_usage() { + return this.option_strings.join(' | ') + } +})) + + +const _StoreAction = _callable(class _StoreAction extends Action { + + constructor() { + let [ + option_strings, + dest, + nargs, + const_value, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + nargs: undefined, + const: undefined, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + if (nargs === 0) { + throw new TypeError('nargs for store actions must be != 0; if you ' + + 'have nothing to store, actions such as store ' + + 'true or store const may be more appropriate') + } + if (const_value !== undefined && nargs !== OPTIONAL) { + throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL)) + } + super({ + option_strings, + dest, + nargs, + const: const_value, + default: default_value, + type, + choices, + required, + help, + metavar + }) + } + + call(parser, namespace, values/*, option_string = undefined*/) { + setattr(namespace, this.dest, values) + } +}) + + +const _StoreConstAction = _callable(class _StoreConstAction extends Action { + + constructor() { + let [ + option_strings, + dest, + const_value, + default_value, + required, + help + //, metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + const: no_default, + default: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + super({ + option_strings, + dest, + nargs: 0, + const: const_value, + default: default_value, + required, + help + }) + } + + call(parser, namespace/*, values, option_string = undefined*/) { + setattr(namespace, this.dest, this.const) + } +}) + + +const _StoreTrueAction = _callable(class _StoreTrueAction extends _StoreConstAction { + + constructor() { + let [ + option_strings, + dest, + default_value, + required, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: false, + required: false, + help: undefined + }) + + super({ + option_strings, + dest, + const: true, + default: default_value, + required, + help + }) + } +}) + + +const _StoreFalseAction = _callable(class _StoreFalseAction extends _StoreConstAction { + + constructor() { + let [ + option_strings, + dest, + default_value, + required, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: true, + required: false, + help: undefined + }) + + super({ + option_strings, + dest, + const: false, + default: default_value, + required, + help + }) + } +}) + + +const _AppendAction = _callable(class _AppendAction extends Action { + + constructor() { + let [ + option_strings, + dest, + nargs, + const_value, + default_value, + type, + choices, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + nargs: undefined, + const: undefined, + default: undefined, + type: undefined, + choices: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + if (nargs === 0) { + throw new TypeError('nargs for append actions must be != 0; if arg ' + + 'strings are not supplying the value to append, ' + + 'the append const action may be more appropriate') + } + if (const_value !== undefined && nargs !== OPTIONAL) { + throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL)) + } + super({ + option_strings, + dest, + nargs, + const: const_value, + default: default_value, + type, + choices, + required, + help, + metavar + }) + } + + call(parser, namespace, values/*, option_string = undefined*/) { + let items = getattr(namespace, this.dest, undefined) + items = _copy_items(items) + items.push(values) + setattr(namespace, this.dest, items) + } +}) + + +const _AppendConstAction = _callable(class _AppendConstAction extends Action { + + constructor() { + let [ + option_strings, + dest, + const_value, + default_value, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + const: no_default, + default: undefined, + required: false, + help: undefined, + metavar: undefined + }) + + super({ + option_strings, + dest, + nargs: 0, + const: const_value, + default: default_value, + required, + help, + metavar + }) + } + + call(parser, namespace/*, values, option_string = undefined*/) { + let items = getattr(namespace, this.dest, undefined) + items = _copy_items(items) + items.push(this.const) + setattr(namespace, this.dest, items) + } +}) + + +const _CountAction = _callable(class _CountAction extends Action { + + constructor() { + let [ + option_strings, + dest, + default_value, + required, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: no_default, + default: undefined, + required: false, + help: undefined + }) + + super({ + option_strings, + dest, + nargs: 0, + default: default_value, + required, + help + }) + } + + call(parser, namespace/*, values, option_string = undefined*/) { + let count = getattr(namespace, this.dest, undefined) + if (count === undefined) { + count = 0 + } + setattr(namespace, this.dest, count + 1) + } +}) + + +const _HelpAction = _callable(class _HelpAction extends Action { + + constructor() { + let [ + option_strings, + dest, + default_value, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + dest: SUPPRESS, + default: SUPPRESS, + help: undefined + }) + + super({ + option_strings, + dest, + default: default_value, + nargs: 0, + help + }) + } + + call(parser/*, namespace, values, option_string = undefined*/) { + parser.print_help() + parser.exit() + } +}) + + +const _VersionAction = _callable(class _VersionAction extends Action { + + constructor() { + let [ + option_strings, + version, + dest, + default_value, + help + ] = _parse_opts(arguments, { + option_strings: no_default, + version: undefined, + dest: SUPPRESS, + default: SUPPRESS, + help: "show program's version number and exit" + }) + + super({ + option_strings, + dest, + default: default_value, + nargs: 0, + help + }) + this.version = version + } + + call(parser/*, namespace, values, option_string = undefined*/) { + let version = this.version + if (version === undefined) { + version = parser.version + } + let formatter = parser._get_formatter() + formatter.add_text(version) + parser._print_message(formatter.format_help(), process.stdout) + parser.exit() + } +}) + + +const _SubParsersAction = _camelcase_alias(_callable(class _SubParsersAction extends Action { + + constructor() { + let [ + option_strings, + prog, + parser_class, + dest, + required, + help, + metavar + ] = _parse_opts(arguments, { + option_strings: no_default, + prog: no_default, + parser_class: no_default, + dest: SUPPRESS, + required: false, + help: undefined, + metavar: undefined + }) + + let name_parser_map = {} + + super({ + option_strings, + dest, + nargs: PARSER, + choices: name_parser_map, + required, + help, + metavar + }) + + this._prog_prefix = prog + this._parser_class = parser_class + this._name_parser_map = name_parser_map + this._choices_actions = [] + } + + add_parser() { + let [ + name, + kwargs + ] = _parse_opts(arguments, { + name: no_default, + '**kwargs': no_default + }) + + // set prog from the existing prefix + if (kwargs.prog === undefined) { + kwargs.prog = sub('%s %s', this._prog_prefix, name) + } + + let aliases = getattr(kwargs, 'aliases', []) + delete kwargs.aliases + + // create a pseudo-action to hold the choice help + if ('help' in kwargs) { + let help = kwargs.help + delete kwargs.help + let choice_action = this._ChoicesPseudoAction(name, aliases, help) + this._choices_actions.push(choice_action) + } + + // create the parser and add it to the map + let parser = new this._parser_class(kwargs) + this._name_parser_map[name] = parser + + // make parser available under aliases also + for (let alias of aliases) { + this._name_parser_map[alias] = parser + } + + return parser + } + + _get_subactions() { + return this._choices_actions + } + + call(parser, namespace, values/*, option_string = undefined*/) { + let parser_name = values[0] + let arg_strings = values.slice(1) + + // set the parser name if requested + if (this.dest !== SUPPRESS) { + setattr(namespace, this.dest, parser_name) + } + + // select the parser + if (hasattr(this._name_parser_map, parser_name)) { + parser = this._name_parser_map[parser_name] + } else { + let args = {parser_name, + choices: this._name_parser_map.join(', ')} + let msg = sub('unknown parser %(parser_name)r (choices: %(choices)s)', args) + throw new ArgumentError(this, msg) + } + + // parse all the remaining options into the namespace + // store any unrecognized options on the object, so that the top + // level parser can decide what to do with them + + // In case this subparser defines new defaults, we parse them + // in a new namespace object and then update the original + // namespace for the relevant parts. + let subnamespace + [ subnamespace, arg_strings ] = parser.parse_known_args(arg_strings, undefined) + for (let [ key, value ] of Object.entries(subnamespace)) { + setattr(namespace, key, value) + } + + if (arg_strings.length) { + setdefault(namespace, _UNRECOGNIZED_ARGS_ATTR, []) + getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).push(...arg_strings) + } + } +})) + + +_SubParsersAction.prototype._ChoicesPseudoAction = _callable(class _ChoicesPseudoAction extends Action { + constructor(name, aliases, help) { + let metavar = name, dest = name + if (aliases.length) { + metavar += sub(' (%s)', aliases.join(', ')) + } + super({ option_strings: [], dest, help, metavar }) + } +}) + + +const _ExtendAction = _callable(class _ExtendAction extends _AppendAction { + call(parser, namespace, values/*, option_string = undefined*/) { + let items = getattr(namespace, this.dest, undefined) + items = _copy_items(items) + items = items.concat(values) + setattr(namespace, this.dest, items) + } +}) + + +// ============== +// Type classes +// ============== +const FileType = _callable(class FileType extends Function { + /* + * Factory for creating file object types + * + * Instances of FileType are typically passed as type= arguments to the + * ArgumentParser add_argument() method. + * + * Keyword Arguments: + * - mode -- A string indicating how the file is to be opened. Accepts the + * same values as the builtin open() function. + * - bufsize -- The file's desired buffer size. Accepts the same values as + * the builtin open() function. + * - encoding -- The file's encoding. Accepts the same values as the + * builtin open() function. + * - errors -- A string indicating how encoding and decoding errors are to + * be handled. Accepts the same value as the builtin open() function. + */ + + constructor() { + let [ + flags, + encoding, + mode, + autoClose, + emitClose, + start, + end, + highWaterMark, + fs + ] = _parse_opts(arguments, { + flags: 'r', + encoding: undefined, + mode: undefined, // 0o666 + autoClose: undefined, // true + emitClose: undefined, // false + start: undefined, // 0 + end: undefined, // Infinity + highWaterMark: undefined, // 64 * 1024 + fs: undefined + }) + + // when this class is called as a function, redirect it to .call() method of itself + super('return arguments.callee.call.apply(arguments.callee, arguments)') + + Object.defineProperty(this, 'name', { + get() { + return sub('FileType(%r)', flags) + } + }) + this._flags = flags + this._options = {} + if (encoding !== undefined) this._options.encoding = encoding + if (mode !== undefined) this._options.mode = mode + if (autoClose !== undefined) this._options.autoClose = autoClose + if (emitClose !== undefined) this._options.emitClose = emitClose + if (start !== undefined) this._options.start = start + if (end !== undefined) this._options.end = end + if (highWaterMark !== undefined) this._options.highWaterMark = highWaterMark + if (fs !== undefined) this._options.fs = fs + } + + call(string) { + // the special argument "-" means sys.std{in,out} + if (string === '-') { + if (this._flags.includes('r')) { + return process.stdin + } else if (this._flags.includes('w')) { + return process.stdout + } else { + let msg = sub('argument "-" with mode %r', this._flags) + throw new TypeError(msg) + } + } + + // all other arguments are used as file names + let fd + try { + fd = fs.openSync(string, this._flags, this._options.mode) + } catch (e) { + let args = { filename: string, error: e.message } + let message = "can't open '%(filename)s': %(error)s" + throw new ArgumentTypeError(sub(message, args)) + } + + let options = Object.assign({ fd, flags: this._flags }, this._options) + if (this._flags.includes('r')) { + return fs.createReadStream(undefined, options) + } else if (this._flags.includes('w')) { + return fs.createWriteStream(undefined, options) + } else { + let msg = sub('argument "%s" with mode %r', string, this._flags) + throw new TypeError(msg) + } + } + + [util.inspect.custom]() { + let args = [ this._flags ] + let kwargs = Object.entries(this._options).map(([ k, v ]) => { + if (k === 'mode') v = { value: v, [util.inspect.custom]() { return '0o' + this.value.toString(8) } } + return [ k, v ] + }) + let args_str = [] + .concat(args.filter(arg => arg !== -1).map(repr)) + .concat(kwargs.filter(([/*kw*/, arg]) => arg !== undefined) + .map(([kw, arg]) => sub('%s=%r', kw, arg))) + .join(', ') + return sub('%s(%s)', this.constructor.name, args_str) + } + + toString() { + return this[util.inspect.custom]() + } +}) + +// =========================== +// Optional and Positional Parsing +// =========================== +const Namespace = _callable(class Namespace extends _AttributeHolder() { + /* + * Simple object for storing attributes. + * + * Implements equality by attribute names and values, and provides a simple + * string representation. + */ + + constructor(options = {}) { + super() + Object.assign(this, options) + } +}) + +// unset string tag to mimic plain object +Namespace.prototype[Symbol.toStringTag] = undefined + + +const _ActionsContainer = _camelcase_alias(_callable(class _ActionsContainer { + + constructor() { + let [ + description, + prefix_chars, + argument_default, + conflict_handler + ] = _parse_opts(arguments, { + description: no_default, + prefix_chars: no_default, + argument_default: no_default, + conflict_handler: no_default + }) + + this.description = description + this.argument_default = argument_default + this.prefix_chars = prefix_chars + this.conflict_handler = conflict_handler + + // set up registries + this._registries = {} + + // register actions + this.register('action', undefined, _StoreAction) + this.register('action', 'store', _StoreAction) + this.register('action', 'store_const', _StoreConstAction) + this.register('action', 'store_true', _StoreTrueAction) + this.register('action', 'store_false', _StoreFalseAction) + this.register('action', 'append', _AppendAction) + this.register('action', 'append_const', _AppendConstAction) + this.register('action', 'count', _CountAction) + this.register('action', 'help', _HelpAction) + this.register('action', 'version', _VersionAction) + this.register('action', 'parsers', _SubParsersAction) + this.register('action', 'extend', _ExtendAction) + // LEGACY (v1 compatibility): camelcase variants + ;[ 'storeConst', 'storeTrue', 'storeFalse', 'appendConst' ].forEach(old_name => { + let new_name = _to_new_name(old_name) + this.register('action', old_name, util.deprecate(this._registry_get('action', new_name), + sub('{action: "%s"} is renamed to {action: "%s"}', old_name, new_name))) + }) + // end + + // raise an exception if the conflict handler is invalid + this._get_handler() + + // action storage + this._actions = [] + this._option_string_actions = {} + + // groups + this._action_groups = [] + this._mutually_exclusive_groups = [] + + // defaults storage + this._defaults = {} + + // determines whether an "option" looks like a negative number + this._negative_number_matcher = /^-\d+$|^-\d*\.\d+$/ + + // whether or not there are any optionals that look like negative + // numbers -- uses a list so it can be shared and edited + this._has_negative_number_optionals = [] + } + + // ==================== + // Registration methods + // ==================== + register(registry_name, value, object) { + let registry = setdefault(this._registries, registry_name, {}) + registry[value] = object + } + + _registry_get(registry_name, value, default_value = undefined) { + return getattr(this._registries[registry_name], value, default_value) + } + + // ================================== + // Namespace default accessor methods + // ================================== + set_defaults(kwargs) { + Object.assign(this._defaults, kwargs) + + // if these defaults match any existing arguments, replace + // the previous default on the object with the new one + for (let action of this._actions) { + if (action.dest in kwargs) { + action.default = kwargs[action.dest] + } + } + } + + get_default(dest) { + for (let action of this._actions) { + if (action.dest === dest && action.default !== undefined) { + return action.default + } + } + return this._defaults[dest] + } + + + // ======================= + // Adding argument actions + // ======================= + add_argument() { + /* + * add_argument(dest, ..., name=value, ...) + * add_argument(option_string, option_string, ..., name=value, ...) + */ + let [ + args, + kwargs + ] = _parse_opts(arguments, { + '*args': no_default, + '**kwargs': no_default + }) + // LEGACY (v1 compatibility), old-style add_argument([ args ], { options }) + if (args.length === 1 && Array.isArray(args[0])) { + args = args[0] + deprecate('argument-array', + sub('use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })', { + args: args.map(repr).join(', ') + })) + } + // end + + // if no positional args are supplied or only one is supplied and + // it doesn't look like an option string, parse a positional + // argument + let chars = this.prefix_chars + if (!args.length || args.length === 1 && !chars.includes(args[0][0])) { + if (args.length && 'dest' in kwargs) { + throw new TypeError('dest supplied twice for positional argument') + } + kwargs = this._get_positional_kwargs(...args, kwargs) + + // otherwise, we're adding an optional argument + } else { + kwargs = this._get_optional_kwargs(...args, kwargs) + } + + // if no default was supplied, use the parser-level default + if (!('default' in kwargs)) { + let dest = kwargs.dest + if (dest in this._defaults) { + kwargs.default = this._defaults[dest] + } else if (this.argument_default !== undefined) { + kwargs.default = this.argument_default + } + } + + // create the action object, and add it to the parser + let action_class = this._pop_action_class(kwargs) + if (typeof action_class !== 'function') { + throw new TypeError(sub('unknown action "%s"', action_class)) + } + // eslint-disable-next-line new-cap + let action = new action_class(kwargs) + + // raise an error if the action type is not callable + let type_func = this._registry_get('type', action.type, action.type) + if (typeof type_func !== 'function') { + throw new TypeError(sub('%r is not callable', type_func)) + } + + if (type_func === FileType) { + throw new TypeError(sub('%r is a FileType class object, instance of it' + + ' must be passed', type_func)) + } + + // raise an error if the metavar does not match the type + if ('_get_formatter' in this) { + try { + this._get_formatter()._format_args(action, undefined) + } catch (err) { + // check for 'invalid nargs value' is an artifact of TypeError and ValueError in js being the same + if (err instanceof TypeError && err.message !== 'invalid nargs value') { + throw new TypeError('length of metavar tuple does not match nargs') + } else { + throw err + } + } + } + + return this._add_action(action) + } + + add_argument_group() { + let group = _ArgumentGroup(this, ...arguments) + this._action_groups.push(group) + return group + } + + add_mutually_exclusive_group() { + // eslint-disable-next-line no-use-before-define + let group = _MutuallyExclusiveGroup(this, ...arguments) + this._mutually_exclusive_groups.push(group) + return group + } + + _add_action(action) { + // resolve any conflicts + this._check_conflict(action) + + // add to actions list + this._actions.push(action) + action.container = this + + // index the action by any option strings it has + for (let option_string of action.option_strings) { + this._option_string_actions[option_string] = action + } + + // set the flag if any option strings look like negative numbers + for (let option_string of action.option_strings) { + if (this._negative_number_matcher.test(option_string)) { + if (!this._has_negative_number_optionals.length) { + this._has_negative_number_optionals.push(true) + } + } + } + + // return the created action + return action + } + + _remove_action(action) { + _array_remove(this._actions, action) + } + + _add_container_actions(container) { + // collect groups by titles + let title_group_map = {} + for (let group of this._action_groups) { + if (group.title in title_group_map) { + let msg = 'cannot merge actions - two groups are named %r' + throw new TypeError(sub(msg, group.title)) + } + title_group_map[group.title] = group + } + + // map each action to its group + let group_map = new Map() + for (let group of container._action_groups) { + + // if a group with the title exists, use that, otherwise + // create a new group matching the container's group + if (!(group.title in title_group_map)) { + title_group_map[group.title] = this.add_argument_group({ + title: group.title, + description: group.description, + conflict_handler: group.conflict_handler + }) + } + + // map the actions to their new group + for (let action of group._group_actions) { + group_map.set(action, title_group_map[group.title]) + } + } + + // add container's mutually exclusive groups + // NOTE: if add_mutually_exclusive_group ever gains title= and + // description= then this code will need to be expanded as above + for (let group of container._mutually_exclusive_groups) { + let mutex_group = this.add_mutually_exclusive_group({ + required: group.required + }) + + // map the actions to their new mutex group + for (let action of group._group_actions) { + group_map.set(action, mutex_group) + } + } + + // add all actions to this container or their group + for (let action of container._actions) { + group_map.get(action)._add_action(action) + } + } + + _get_positional_kwargs() { + let [ + dest, + kwargs + ] = _parse_opts(arguments, { + dest: no_default, + '**kwargs': no_default + }) + + // make sure required is not specified + if ('required' in kwargs) { + let msg = "'required' is an invalid argument for positionals" + throw new TypeError(msg) + } + + // mark positional arguments as required if at least one is + // always required + if (![OPTIONAL, ZERO_OR_MORE].includes(kwargs.nargs)) { + kwargs.required = true + } + if (kwargs.nargs === ZERO_OR_MORE && !('default' in kwargs)) { + kwargs.required = true + } + + // return the keyword arguments with no option strings + return Object.assign(kwargs, { dest, option_strings: [] }) + } + + _get_optional_kwargs() { + let [ + args, + kwargs + ] = _parse_opts(arguments, { + '*args': no_default, + '**kwargs': no_default + }) + + // determine short and long option strings + let option_strings = [] + let long_option_strings = [] + let option_string + for (option_string of args) { + // error on strings that don't start with an appropriate prefix + if (!this.prefix_chars.includes(option_string[0])) { + let args = {option: option_string, + prefix_chars: this.prefix_chars} + let msg = 'invalid option string %(option)r: ' + + 'must start with a character %(prefix_chars)r' + throw new TypeError(sub(msg, args)) + } + + // strings starting with two prefix characters are long options + option_strings.push(option_string) + if (option_string.length > 1 && this.prefix_chars.includes(option_string[1])) { + long_option_strings.push(option_string) + } + } + + // infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x' + let dest = kwargs.dest + delete kwargs.dest + if (dest === undefined) { + let dest_option_string + if (long_option_strings.length) { + dest_option_string = long_option_strings[0] + } else { + dest_option_string = option_strings[0] + } + dest = _string_lstrip(dest_option_string, this.prefix_chars) + if (!dest) { + let msg = 'dest= is required for options like %r' + throw new TypeError(sub(msg, option_string)) + } + dest = dest.replace(/-/g, '_') + } + + // return the updated keyword arguments + return Object.assign(kwargs, { dest, option_strings }) + } + + _pop_action_class(kwargs, default_value = undefined) { + let action = getattr(kwargs, 'action', default_value) + delete kwargs.action + return this._registry_get('action', action, action) + } + + _get_handler() { + // determine function from conflict handler string + let handler_func_name = sub('_handle_conflict_%s', this.conflict_handler) + if (typeof this[handler_func_name] === 'function') { + return this[handler_func_name] + } else { + let msg = 'invalid conflict_resolution value: %r' + throw new TypeError(sub(msg, this.conflict_handler)) + } + } + + _check_conflict(action) { + + // find all options that conflict with this option + let confl_optionals = [] + for (let option_string of action.option_strings) { + if (hasattr(this._option_string_actions, option_string)) { + let confl_optional = this._option_string_actions[option_string] + confl_optionals.push([ option_string, confl_optional ]) + } + } + + // resolve any conflicts + if (confl_optionals.length) { + let conflict_handler = this._get_handler() + conflict_handler.call(this, action, confl_optionals) + } + } + + _handle_conflict_error(action, conflicting_actions) { + let message = conflicting_actions.length === 1 ? + 'conflicting option string: %s' : + 'conflicting option strings: %s' + let conflict_string = conflicting_actions.map(([ option_string/*, action*/ ]) => option_string).join(', ') + throw new ArgumentError(action, sub(message, conflict_string)) + } + + _handle_conflict_resolve(action, conflicting_actions) { + + // remove all conflicting options + for (let [ option_string, action ] of conflicting_actions) { + + // remove the conflicting option + _array_remove(action.option_strings, option_string) + delete this._option_string_actions[option_string] + + // if the option now has no option string, remove it from the + // container holding it + if (!action.option_strings.length) { + action.container._remove_action(action) + } + } + } +})) + + +const _ArgumentGroup = _callable(class _ArgumentGroup extends _ActionsContainer { + + constructor() { + let [ + container, + title, + description, + kwargs + ] = _parse_opts(arguments, { + container: no_default, + title: undefined, + description: undefined, + '**kwargs': no_default + }) + + // add any missing keyword arguments by checking the container + setdefault(kwargs, 'conflict_handler', container.conflict_handler) + setdefault(kwargs, 'prefix_chars', container.prefix_chars) + setdefault(kwargs, 'argument_default', container.argument_default) + super(Object.assign({ description }, kwargs)) + + // group attributes + this.title = title + this._group_actions = [] + + // share most attributes with the container + this._registries = container._registries + this._actions = container._actions + this._option_string_actions = container._option_string_actions + this._defaults = container._defaults + this._has_negative_number_optionals = + container._has_negative_number_optionals + this._mutually_exclusive_groups = container._mutually_exclusive_groups + } + + _add_action(action) { + action = super._add_action(action) + this._group_actions.push(action) + return action + } + + _remove_action(action) { + super._remove_action(action) + _array_remove(this._group_actions, action) + } +}) + + +const _MutuallyExclusiveGroup = _callable(class _MutuallyExclusiveGroup extends _ArgumentGroup { + + constructor() { + let [ + container, + required + ] = _parse_opts(arguments, { + container: no_default, + required: false + }) + + super(container) + this.required = required + this._container = container + } + + _add_action(action) { + if (action.required) { + let msg = 'mutually exclusive arguments must be optional' + throw new TypeError(msg) + } + action = this._container._add_action(action) + this._group_actions.push(action) + return action + } + + _remove_action(action) { + this._container._remove_action(action) + _array_remove(this._group_actions, action) + } +}) + + +const ArgumentParser = _camelcase_alias(_callable(class ArgumentParser extends _AttributeHolder(_ActionsContainer) { + /* + * Object for parsing command line strings into Python objects. + * + * Keyword Arguments: + * - prog -- The name of the program (default: sys.argv[0]) + * - usage -- A usage message (default: auto-generated from arguments) + * - description -- A description of what the program does + * - epilog -- Text following the argument descriptions + * - parents -- Parsers whose arguments should be copied into this one + * - formatter_class -- HelpFormatter class for printing help messages + * - prefix_chars -- Characters that prefix optional arguments + * - fromfile_prefix_chars -- Characters that prefix files containing + * additional arguments + * - argument_default -- The default value for all arguments + * - conflict_handler -- String indicating how to handle conflicts + * - add_help -- Add a -h/-help option + * - allow_abbrev -- Allow long options to be abbreviated unambiguously + * - exit_on_error -- Determines whether or not ArgumentParser exits with + * error info when an error occurs + */ + + constructor() { + let [ + prog, + usage, + description, + epilog, + parents, + formatter_class, + prefix_chars, + fromfile_prefix_chars, + argument_default, + conflict_handler, + add_help, + allow_abbrev, + exit_on_error, + debug, // LEGACY (v1 compatibility), debug mode + version // LEGACY (v1 compatibility), version + ] = _parse_opts(arguments, { + prog: undefined, + usage: undefined, + description: undefined, + epilog: undefined, + parents: [], + formatter_class: HelpFormatter, + prefix_chars: '-', + fromfile_prefix_chars: undefined, + argument_default: undefined, + conflict_handler: 'error', + add_help: true, + allow_abbrev: true, + exit_on_error: true, + debug: undefined, // LEGACY (v1 compatibility), debug mode + version: undefined // LEGACY (v1 compatibility), version + }) + + // LEGACY (v1 compatibility) + if (debug !== undefined) { + deprecate('debug', + 'The "debug" argument to ArgumentParser is deprecated. Please ' + + 'override ArgumentParser.exit function instead.' + ) + } + + if (version !== undefined) { + deprecate('version', + 'The "version" argument to ArgumentParser is deprecated. Please use ' + + "add_argument(..., { action: 'version', version: 'N', ... }) instead." + ) + } + // end + + super({ + description, + prefix_chars, + argument_default, + conflict_handler + }) + + // default setting for prog + if (prog === undefined) { + prog = path.basename(get_argv()[0] || '') + } + + this.prog = prog + this.usage = usage + this.epilog = epilog + this.formatter_class = formatter_class + this.fromfile_prefix_chars = fromfile_prefix_chars + this.add_help = add_help + this.allow_abbrev = allow_abbrev + this.exit_on_error = exit_on_error + // LEGACY (v1 compatibility), debug mode + this.debug = debug + // end + + this._positionals = this.add_argument_group('positional arguments') + this._optionals = this.add_argument_group('optional arguments') + this._subparsers = undefined + + // register types + function identity(string) { + return string + } + this.register('type', undefined, identity) + this.register('type', null, identity) + this.register('type', 'auto', identity) + this.register('type', 'int', function (x) { + let result = Number(x) + if (!Number.isInteger(result)) { + throw new TypeError(sub('could not convert string to int: %r', x)) + } + return result + }) + this.register('type', 'float', function (x) { + let result = Number(x) + if (isNaN(result)) { + throw new TypeError(sub('could not convert string to float: %r', x)) + } + return result + }) + this.register('type', 'str', String) + // LEGACY (v1 compatibility): custom types + this.register('type', 'string', + util.deprecate(String, 'use {type:"str"} or {type:String} instead of {type:"string"}')) + // end + + // add help argument if necessary + // (using explicit default to override global argument_default) + let default_prefix = prefix_chars.includes('-') ? '-' : prefix_chars[0] + if (this.add_help) { + this.add_argument( + default_prefix + 'h', + default_prefix.repeat(2) + 'help', + { + action: 'help', + default: SUPPRESS, + help: 'show this help message and exit' + } + ) + } + // LEGACY (v1 compatibility), version + if (version) { + this.add_argument( + default_prefix + 'v', + default_prefix.repeat(2) + 'version', + { + action: 'version', + default: SUPPRESS, + version: this.version, + help: "show program's version number and exit" + } + ) + } + // end + + // add parent arguments and defaults + for (let parent of parents) { + this._add_container_actions(parent) + Object.assign(this._defaults, parent._defaults) + } + } + + // ======================= + // Pretty __repr__ methods + // ======================= + _get_kwargs() { + let names = [ + 'prog', + 'usage', + 'description', + 'formatter_class', + 'conflict_handler', + 'add_help' + ] + return names.map(name => [ name, getattr(this, name) ]) + } + + // ================================== + // Optional/Positional adding methods + // ================================== + add_subparsers() { + let [ + kwargs + ] = _parse_opts(arguments, { + '**kwargs': no_default + }) + + if (this._subparsers !== undefined) { + this.error('cannot have multiple subparser arguments') + } + + // add the parser class to the arguments if it's not present + setdefault(kwargs, 'parser_class', this.constructor) + + if ('title' in kwargs || 'description' in kwargs) { + let title = getattr(kwargs, 'title', 'subcommands') + let description = getattr(kwargs, 'description', undefined) + delete kwargs.title + delete kwargs.description + this._subparsers = this.add_argument_group(title, description) + } else { + this._subparsers = this._positionals + } + + // prog defaults to the usage message of this parser, skipping + // optional arguments and with no "usage:" prefix + if (kwargs.prog === undefined) { + let formatter = this._get_formatter() + let positionals = this._get_positional_actions() + let groups = this._mutually_exclusive_groups + formatter.add_usage(this.usage, positionals, groups, '') + kwargs.prog = formatter.format_help().trim() + } + + // create the parsers action and add it to the positionals list + let parsers_class = this._pop_action_class(kwargs, 'parsers') + // eslint-disable-next-line new-cap + let action = new parsers_class(Object.assign({ option_strings: [] }, kwargs)) + this._subparsers._add_action(action) + + // return the created parsers action + return action + } + + _add_action(action) { + if (action.option_strings.length) { + this._optionals._add_action(action) + } else { + this._positionals._add_action(action) + } + return action + } + + _get_optional_actions() { + return this._actions.filter(action => action.option_strings.length) + } + + _get_positional_actions() { + return this._actions.filter(action => !action.option_strings.length) + } + + // ===================================== + // Command line argument parsing methods + // ===================================== + parse_args(args = undefined, namespace = undefined) { + let argv + [ args, argv ] = this.parse_known_args(args, namespace) + if (argv && argv.length > 0) { + let msg = 'unrecognized arguments: %s' + this.error(sub(msg, argv.join(' '))) + } + return args + } + + parse_known_args(args = undefined, namespace = undefined) { + if (args === undefined) { + args = get_argv().slice(1) + } + + // default Namespace built from parser defaults + if (namespace === undefined) { + namespace = new Namespace() + } + + // add any action defaults that aren't present + for (let action of this._actions) { + if (action.dest !== SUPPRESS) { + if (!hasattr(namespace, action.dest)) { + if (action.default !== SUPPRESS) { + setattr(namespace, action.dest, action.default) + } + } + } + } + + // add any parser defaults that aren't present + for (let dest of Object.keys(this._defaults)) { + if (!hasattr(namespace, dest)) { + setattr(namespace, dest, this._defaults[dest]) + } + } + + // parse the arguments and exit if there are any errors + if (this.exit_on_error) { + try { + [ namespace, args ] = this._parse_known_args(args, namespace) + } catch (err) { + if (err instanceof ArgumentError) { + this.error(err.message) + } else { + throw err + } + } + } else { + [ namespace, args ] = this._parse_known_args(args, namespace) + } + + if (hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) { + args = args.concat(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) + delattr(namespace, _UNRECOGNIZED_ARGS_ATTR) + } + + return [ namespace, args ] + } + + _parse_known_args(arg_strings, namespace) { + // replace arg strings that are file references + if (this.fromfile_prefix_chars !== undefined) { + arg_strings = this._read_args_from_files(arg_strings) + } + + // map all mutually exclusive arguments to the other arguments + // they can't occur with + let action_conflicts = new Map() + for (let mutex_group of this._mutually_exclusive_groups) { + let group_actions = mutex_group._group_actions + for (let [ i, mutex_action ] of Object.entries(mutex_group._group_actions)) { + let conflicts = action_conflicts.get(mutex_action) || [] + conflicts = conflicts.concat(group_actions.slice(0, +i)) + conflicts = conflicts.concat(group_actions.slice(+i + 1)) + action_conflicts.set(mutex_action, conflicts) + } + } + + // find all option indices, and determine the arg_string_pattern + // which has an 'O' if there is an option at an index, + // an 'A' if there is an argument, or a '-' if there is a '--' + let option_string_indices = {} + let arg_string_pattern_parts = [] + let arg_strings_iter = Object.entries(arg_strings)[Symbol.iterator]() + for (let [ i, arg_string ] of arg_strings_iter) { + + // all args after -- are non-options + if (arg_string === '--') { + arg_string_pattern_parts.push('-') + for ([ i, arg_string ] of arg_strings_iter) { + arg_string_pattern_parts.push('A') + } + + // otherwise, add the arg to the arg strings + // and note the index if it was an option + } else { + let option_tuple = this._parse_optional(arg_string) + let pattern + if (option_tuple === undefined) { + pattern = 'A' + } else { + option_string_indices[i] = option_tuple + pattern = 'O' + } + arg_string_pattern_parts.push(pattern) + } + } + + // join the pieces together to form the pattern + let arg_strings_pattern = arg_string_pattern_parts.join('') + + // converts arg strings to the appropriate and then takes the action + let seen_actions = new Set() + let seen_non_default_actions = new Set() + let extras + + let take_action = (action, argument_strings, option_string = undefined) => { + seen_actions.add(action) + let argument_values = this._get_values(action, argument_strings) + + // error if this argument is not allowed with other previously + // seen arguments, assuming that actions that use the default + // value don't really count as "present" + if (argument_values !== action.default) { + seen_non_default_actions.add(action) + for (let conflict_action of action_conflicts.get(action) || []) { + if (seen_non_default_actions.has(conflict_action)) { + let msg = 'not allowed with argument %s' + let action_name = _get_action_name(conflict_action) + throw new ArgumentError(action, sub(msg, action_name)) + } + } + } + + // take the action if we didn't receive a SUPPRESS value + // (e.g. from a default) + if (argument_values !== SUPPRESS) { + action(this, namespace, argument_values, option_string) + } + } + + // function to convert arg_strings into an optional action + let consume_optional = start_index => { + + // get the optional identified at this index + let option_tuple = option_string_indices[start_index] + let [ action, option_string, explicit_arg ] = option_tuple + + // identify additional optionals in the same arg string + // (e.g. -xyz is the same as -x -y -z if no args are required) + let action_tuples = [] + let stop + for (;;) { + + // if we found no optional action, skip it + if (action === undefined) { + extras.push(arg_strings[start_index]) + return start_index + 1 + } + + // if there is an explicit argument, try to match the + // optional's string arguments to only this + if (explicit_arg !== undefined) { + let arg_count = this._match_argument(action, 'A') + + // if the action is a single-dash option and takes no + // arguments, try to parse more single-dash options out + // of the tail of the option string + let chars = this.prefix_chars + if (arg_count === 0 && !chars.includes(option_string[1])) { + action_tuples.push([ action, [], option_string ]) + let char = option_string[0] + option_string = char + explicit_arg[0] + let new_explicit_arg = explicit_arg.slice(1) || undefined + let optionals_map = this._option_string_actions + if (hasattr(optionals_map, option_string)) { + action = optionals_map[option_string] + explicit_arg = new_explicit_arg + } else { + let msg = 'ignored explicit argument %r' + throw new ArgumentError(action, sub(msg, explicit_arg)) + } + + // if the action expect exactly one argument, we've + // successfully matched the option; exit the loop + } else if (arg_count === 1) { + stop = start_index + 1 + let args = [ explicit_arg ] + action_tuples.push([ action, args, option_string ]) + break + + // error if a double-dash option did not use the + // explicit argument + } else { + let msg = 'ignored explicit argument %r' + throw new ArgumentError(action, sub(msg, explicit_arg)) + } + + // if there is no explicit argument, try to match the + // optional's string arguments with the following strings + // if successful, exit the loop + } else { + let start = start_index + 1 + let selected_patterns = arg_strings_pattern.slice(start) + let arg_count = this._match_argument(action, selected_patterns) + stop = start + arg_count + let args = arg_strings.slice(start, stop) + action_tuples.push([ action, args, option_string ]) + break + } + } + + // add the Optional to the list and return the index at which + // the Optional's string args stopped + assert(action_tuples.length) + for (let [ action, args, option_string ] of action_tuples) { + take_action(action, args, option_string) + } + return stop + } + + // the list of Positionals left to be parsed; this is modified + // by consume_positionals() + let positionals = this._get_positional_actions() + + // function to convert arg_strings into positional actions + let consume_positionals = start_index => { + // match as many Positionals as possible + let selected_pattern = arg_strings_pattern.slice(start_index) + let arg_counts = this._match_arguments_partial(positionals, selected_pattern) + + // slice off the appropriate arg strings for each Positional + // and add the Positional and its args to the list + for (let i = 0; i < positionals.length && i < arg_counts.length; i++) { + let action = positionals[i] + let arg_count = arg_counts[i] + let args = arg_strings.slice(start_index, start_index + arg_count) + start_index += arg_count + take_action(action, args) + } + + // slice off the Positionals that we just parsed and return the + // index at which the Positionals' string args stopped + positionals = positionals.slice(arg_counts.length) + return start_index + } + + // consume Positionals and Optionals alternately, until we have + // passed the last option string + extras = [] + let start_index = 0 + let max_option_string_index = Math.max(-1, ...Object.keys(option_string_indices).map(Number)) + while (start_index <= max_option_string_index) { + + // consume any Positionals preceding the next option + let next_option_string_index = Math.min( + // eslint-disable-next-line no-loop-func + ...Object.keys(option_string_indices).map(Number).filter(index => index >= start_index) + ) + if (start_index !== next_option_string_index) { + let positionals_end_index = consume_positionals(start_index) + + // only try to parse the next optional if we didn't consume + // the option string during the positionals parsing + if (positionals_end_index > start_index) { + start_index = positionals_end_index + continue + } else { + start_index = positionals_end_index + } + } + + // if we consumed all the positionals we could and we're not + // at the index of an option string, there were extra arguments + if (!(start_index in option_string_indices)) { + let strings = arg_strings.slice(start_index, next_option_string_index) + extras = extras.concat(strings) + start_index = next_option_string_index + } + + // consume the next optional and any arguments for it + start_index = consume_optional(start_index) + } + + // consume any positionals following the last Optional + let stop_index = consume_positionals(start_index) + + // if we didn't consume all the argument strings, there were extras + extras = extras.concat(arg_strings.slice(stop_index)) + + // make sure all required actions were present and also convert + // action defaults which were not given as arguments + let required_actions = [] + for (let action of this._actions) { + if (!seen_actions.has(action)) { + if (action.required) { + required_actions.push(_get_action_name(action)) + } else { + // Convert action default now instead of doing it before + // parsing arguments to avoid calling convert functions + // twice (which may fail) if the argument was given, but + // only if it was defined already in the namespace + if (action.default !== undefined && + typeof action.default === 'string' && + hasattr(namespace, action.dest) && + action.default === getattr(namespace, action.dest)) { + setattr(namespace, action.dest, + this._get_value(action, action.default)) + } + } + } + } + + if (required_actions.length) { + this.error(sub('the following arguments are required: %s', + required_actions.join(', '))) + } + + // make sure all required groups had one option present + for (let group of this._mutually_exclusive_groups) { + if (group.required) { + let no_actions_used = true + for (let action of group._group_actions) { + if (seen_non_default_actions.has(action)) { + no_actions_used = false + break + } + } + + // if no actions were used, report the error + if (no_actions_used) { + let names = group._group_actions + .filter(action => action.help !== SUPPRESS) + .map(action => _get_action_name(action)) + let msg = 'one of the arguments %s is required' + this.error(sub(msg, names.join(' '))) + } + } + } + + // return the updated namespace and the extra arguments + return [ namespace, extras ] + } + + _read_args_from_files(arg_strings) { + // expand arguments referencing files + let new_arg_strings = [] + for (let arg_string of arg_strings) { + + // for regular arguments, just add them back into the list + if (!arg_string || !this.fromfile_prefix_chars.includes(arg_string[0])) { + new_arg_strings.push(arg_string) + + // replace arguments referencing files with the file content + } else { + try { + let args_file = fs.readFileSync(arg_string.slice(1), 'utf8') + let arg_strings = [] + for (let arg_line of splitlines(args_file)) { + for (let arg of this.convert_arg_line_to_args(arg_line)) { + arg_strings.push(arg) + } + } + arg_strings = this._read_args_from_files(arg_strings) + new_arg_strings = new_arg_strings.concat(arg_strings) + } catch (err) { + this.error(err.message) + } + } + } + + // return the modified argument list + return new_arg_strings + } + + convert_arg_line_to_args(arg_line) { + return [arg_line] + } + + _match_argument(action, arg_strings_pattern) { + // match the pattern for this action to the arg strings + let nargs_pattern = this._get_nargs_pattern(action) + let match = arg_strings_pattern.match(new RegExp('^' + nargs_pattern)) + + // raise an exception if we weren't able to find a match + if (match === null) { + let nargs_errors = { + undefined: 'expected one argument', + [OPTIONAL]: 'expected at most one argument', + [ONE_OR_MORE]: 'expected at least one argument' + } + let msg = nargs_errors[action.nargs] + if (msg === undefined) { + msg = sub(action.nargs === 1 ? 'expected %s argument' : 'expected %s arguments', action.nargs) + } + throw new ArgumentError(action, msg) + } + + // return the number of arguments matched + return match[1].length + } + + _match_arguments_partial(actions, arg_strings_pattern) { + // progressively shorten the actions list by slicing off the + // final actions until we find a match + let result = [] + for (let i of range(actions.length, 0, -1)) { + let actions_slice = actions.slice(0, i) + let pattern = actions_slice.map(action => this._get_nargs_pattern(action)).join('') + let match = arg_strings_pattern.match(new RegExp('^' + pattern)) + if (match !== null) { + result = result.concat(match.slice(1).map(string => string.length)) + break + } + } + + // return the list of arg string counts + return result + } + + _parse_optional(arg_string) { + // if it's an empty string, it was meant to be a positional + if (!arg_string) { + return undefined + } + + // if it doesn't start with a prefix, it was meant to be positional + if (!this.prefix_chars.includes(arg_string[0])) { + return undefined + } + + // if the option string is present in the parser, return the action + if (arg_string in this._option_string_actions) { + let action = this._option_string_actions[arg_string] + return [ action, arg_string, undefined ] + } + + // if it's just a single character, it was meant to be positional + if (arg_string.length === 1) { + return undefined + } + + // if the option string before the "=" is present, return the action + if (arg_string.includes('=')) { + let [ option_string, explicit_arg ] = _string_split(arg_string, '=', 1) + if (option_string in this._option_string_actions) { + let action = this._option_string_actions[option_string] + return [ action, option_string, explicit_arg ] + } + } + + // search through all possible prefixes of the option string + // and all actions in the parser for possible interpretations + let option_tuples = this._get_option_tuples(arg_string) + + // if multiple actions match, the option string was ambiguous + if (option_tuples.length > 1) { + let options = option_tuples.map(([ /*action*/, option_string/*, explicit_arg*/ ]) => option_string).join(', ') + let args = {option: arg_string, matches: options} + let msg = 'ambiguous option: %(option)s could match %(matches)s' + this.error(sub(msg, args)) + + // if exactly one action matched, this segmentation is good, + // so return the parsed action + } else if (option_tuples.length === 1) { + let [ option_tuple ] = option_tuples + return option_tuple + } + + // if it was not found as an option, but it looks like a negative + // number, it was meant to be positional + // unless there are negative-number-like options + if (this._negative_number_matcher.test(arg_string)) { + if (!this._has_negative_number_optionals.length) { + return undefined + } + } + + // if it contains a space, it was meant to be a positional + if (arg_string.includes(' ')) { + return undefined + } + + // it was meant to be an optional but there is no such option + // in this parser (though it might be a valid option in a subparser) + return [ undefined, arg_string, undefined ] + } + + _get_option_tuples(option_string) { + let result = [] + + // option strings starting with two prefix characters are only + // split at the '=' + let chars = this.prefix_chars + if (chars.includes(option_string[0]) && chars.includes(option_string[1])) { + if (this.allow_abbrev) { + let option_prefix, explicit_arg + if (option_string.includes('=')) { + [ option_prefix, explicit_arg ] = _string_split(option_string, '=', 1) + } else { + option_prefix = option_string + explicit_arg = undefined + } + for (let option_string of Object.keys(this._option_string_actions)) { + if (option_string.startsWith(option_prefix)) { + let action = this._option_string_actions[option_string] + let tup = [ action, option_string, explicit_arg ] + result.push(tup) + } + } + } + + // single character options can be concatenated with their arguments + // but multiple character options always have to have their argument + // separate + } else if (chars.includes(option_string[0]) && !chars.includes(option_string[1])) { + let option_prefix = option_string + let explicit_arg = undefined + let short_option_prefix = option_string.slice(0, 2) + let short_explicit_arg = option_string.slice(2) + + for (let option_string of Object.keys(this._option_string_actions)) { + if (option_string === short_option_prefix) { + let action = this._option_string_actions[option_string] + let tup = [ action, option_string, short_explicit_arg ] + result.push(tup) + } else if (option_string.startsWith(option_prefix)) { + let action = this._option_string_actions[option_string] + let tup = [ action, option_string, explicit_arg ] + result.push(tup) + } + } + + // shouldn't ever get here + } else { + this.error(sub('unexpected option string: %s', option_string)) + } + + // return the collected option tuples + return result + } + + _get_nargs_pattern(action) { + // in all examples below, we have to allow for '--' args + // which are represented as '-' in the pattern + let nargs = action.nargs + let nargs_pattern + + // the default (None) is assumed to be a single argument + if (nargs === undefined) { + nargs_pattern = '(-*A-*)' + + // allow zero or one arguments + } else if (nargs === OPTIONAL) { + nargs_pattern = '(-*A?-*)' + + // allow zero or more arguments + } else if (nargs === ZERO_OR_MORE) { + nargs_pattern = '(-*[A-]*)' + + // allow one or more arguments + } else if (nargs === ONE_OR_MORE) { + nargs_pattern = '(-*A[A-]*)' + + // allow any number of options or arguments + } else if (nargs === REMAINDER) { + nargs_pattern = '([-AO]*)' + + // allow one argument followed by any number of options or arguments + } else if (nargs === PARSER) { + nargs_pattern = '(-*A[-AO]*)' + + // suppress action, like nargs=0 + } else if (nargs === SUPPRESS) { + nargs_pattern = '(-*-*)' + + // all others should be integers + } else { + nargs_pattern = sub('(-*%s-*)', 'A'.repeat(nargs).split('').join('-*')) + } + + // if this is an optional action, -- is not allowed + if (action.option_strings.length) { + nargs_pattern = nargs_pattern.replace(/-\*/g, '') + nargs_pattern = nargs_pattern.replace(/-/g, '') + } + + // return the pattern + return nargs_pattern + } + + // ======================== + // Alt command line argument parsing, allowing free intermix + // ======================== + + parse_intermixed_args(args = undefined, namespace = undefined) { + let argv + [ args, argv ] = this.parse_known_intermixed_args(args, namespace) + if (argv.length) { + let msg = 'unrecognized arguments: %s' + this.error(sub(msg, argv.join(' '))) + } + return args + } + + parse_known_intermixed_args(args = undefined, namespace = undefined) { + // returns a namespace and list of extras + // + // positional can be freely intermixed with optionals. optionals are + // first parsed with all positional arguments deactivated. The 'extras' + // are then parsed. If the parser definition is incompatible with the + // intermixed assumptions (e.g. use of REMAINDER, subparsers) a + // TypeError is raised. + // + // positionals are 'deactivated' by setting nargs and default to + // SUPPRESS. This blocks the addition of that positional to the + // namespace + + let extras + let positionals = this._get_positional_actions() + let a = positionals.filter(action => [ PARSER, REMAINDER ].includes(action.nargs)) + if (a.length) { + throw new TypeError(sub('parse_intermixed_args: positional arg' + + ' with nargs=%s', a[0].nargs)) + } + + for (let group of this._mutually_exclusive_groups) { + for (let action of group._group_actions) { + if (positionals.includes(action)) { + throw new TypeError('parse_intermixed_args: positional in' + + ' mutuallyExclusiveGroup') + } + } + } + + let save_usage + try { + save_usage = this.usage + let remaining_args + try { + if (this.usage === undefined) { + // capture the full usage for use in error messages + this.usage = this.format_usage().slice(7) + } + for (let action of positionals) { + // deactivate positionals + action.save_nargs = action.nargs + // action.nargs = 0 + action.nargs = SUPPRESS + action.save_default = action.default + action.default = SUPPRESS + } + [ namespace, remaining_args ] = this.parse_known_args(args, + namespace) + for (let action of positionals) { + // remove the empty positional values from namespace + let attr = getattr(namespace, action.dest) + if (Array.isArray(attr) && attr.length === 0) { + // eslint-disable-next-line no-console + console.warn(sub('Do not expect %s in %s', action.dest, namespace)) + delattr(namespace, action.dest) + } + } + } finally { + // restore nargs and usage before exiting + for (let action of positionals) { + action.nargs = action.save_nargs + action.default = action.save_default + } + } + let optionals = this._get_optional_actions() + try { + // parse positionals. optionals aren't normally required, but + // they could be, so make sure they aren't. + for (let action of optionals) { + action.save_required = action.required + action.required = false + } + for (let group of this._mutually_exclusive_groups) { + group.save_required = group.required + group.required = false + } + [ namespace, extras ] = this.parse_known_args(remaining_args, + namespace) + } finally { + // restore parser values before exiting + for (let action of optionals) { + action.required = action.save_required + } + for (let group of this._mutually_exclusive_groups) { + group.required = group.save_required + } + } + } finally { + this.usage = save_usage + } + return [ namespace, extras ] + } + + // ======================== + // Value conversion methods + // ======================== + _get_values(action, arg_strings) { + // for everything but PARSER, REMAINDER args, strip out first '--' + if (![PARSER, REMAINDER].includes(action.nargs)) { + try { + _array_remove(arg_strings, '--') + } catch (err) {} + } + + let value + // optional argument produces a default when not present + if (!arg_strings.length && action.nargs === OPTIONAL) { + if (action.option_strings.length) { + value = action.const + } else { + value = action.default + } + if (typeof value === 'string') { + value = this._get_value(action, value) + this._check_value(action, value) + } + + // when nargs='*' on a positional, if there were no command-line + // args, use the default if it is anything other than None + } else if (!arg_strings.length && action.nargs === ZERO_OR_MORE && + !action.option_strings.length) { + if (action.default !== undefined) { + value = action.default + } else { + value = arg_strings + } + this._check_value(action, value) + + // single argument or optional argument produces a single value + } else if (arg_strings.length === 1 && [undefined, OPTIONAL].includes(action.nargs)) { + let arg_string = arg_strings[0] + value = this._get_value(action, arg_string) + this._check_value(action, value) + + // REMAINDER arguments convert all values, checking none + } else if (action.nargs === REMAINDER) { + value = arg_strings.map(v => this._get_value(action, v)) + + // PARSER arguments convert all values, but check only the first + } else if (action.nargs === PARSER) { + value = arg_strings.map(v => this._get_value(action, v)) + this._check_value(action, value[0]) + + // SUPPRESS argument does not put anything in the namespace + } else if (action.nargs === SUPPRESS) { + value = SUPPRESS + + // all other types of nargs produce a list + } else { + value = arg_strings.map(v => this._get_value(action, v)) + for (let v of value) { + this._check_value(action, v) + } + } + + // return the converted value + return value + } + + _get_value(action, arg_string) { + let type_func = this._registry_get('type', action.type, action.type) + if (typeof type_func !== 'function') { + let msg = '%r is not callable' + throw new ArgumentError(action, sub(msg, type_func)) + } + + // convert the value to the appropriate type + let result + try { + try { + result = type_func(arg_string) + } catch (err) { + // Dear TC39, why would you ever consider making es6 classes not callable? + // We had one universal interface, [[Call]], which worked for anything + // (with familiar this-instanceof guard for classes). Now we have two. + if (err instanceof TypeError && + /Class constructor .* cannot be invoked without 'new'/.test(err.message)) { + // eslint-disable-next-line new-cap + result = new type_func(arg_string) + } else { + throw err + } + } + + } catch (err) { + // ArgumentTypeErrors indicate errors + if (err instanceof ArgumentTypeError) { + //let name = getattr(action.type, 'name', repr(action.type)) + let msg = err.message + throw new ArgumentError(action, msg) + + // TypeErrors or ValueErrors also indicate errors + } else if (err instanceof TypeError) { + let name = getattr(action.type, 'name', repr(action.type)) + let args = {type: name, value: arg_string} + let msg = 'invalid %(type)s value: %(value)r' + throw new ArgumentError(action, sub(msg, args)) + } else { + throw err + } + } + + // return the converted value + return result + } + + _check_value(action, value) { + // converted value must be one of the choices (if specified) + if (action.choices !== undefined && !_choices_to_array(action.choices).includes(value)) { + let args = {value, + choices: _choices_to_array(action.choices).map(repr).join(', ')} + let msg = 'invalid choice: %(value)r (choose from %(choices)s)' + throw new ArgumentError(action, sub(msg, args)) + } + } + + // ======================= + // Help-formatting methods + // ======================= + format_usage() { + let formatter = this._get_formatter() + formatter.add_usage(this.usage, this._actions, + this._mutually_exclusive_groups) + return formatter.format_help() + } + + format_help() { + let formatter = this._get_formatter() + + // usage + formatter.add_usage(this.usage, this._actions, + this._mutually_exclusive_groups) + + // description + formatter.add_text(this.description) + + // positionals, optionals and user-defined groups + for (let action_group of this._action_groups) { + formatter.start_section(action_group.title) + formatter.add_text(action_group.description) + formatter.add_arguments(action_group._group_actions) + formatter.end_section() + } + + // epilog + formatter.add_text(this.epilog) + + // determine help from format above + return formatter.format_help() + } + + _get_formatter() { + // eslint-disable-next-line new-cap + return new this.formatter_class({ prog: this.prog }) + } + + // ===================== + // Help-printing methods + // ===================== + print_usage(file = undefined) { + if (file === undefined) file = process.stdout + this._print_message(this.format_usage(), file) + } + + print_help(file = undefined) { + if (file === undefined) file = process.stdout + this._print_message(this.format_help(), file) + } + + _print_message(message, file = undefined) { + if (message) { + if (file === undefined) file = process.stderr + file.write(message) + } + } + + // =============== + // Exiting methods + // =============== + exit(status = 0, message = undefined) { + if (message) { + this._print_message(message, process.stderr) + } + process.exit(status) + } + + error(message) { + /* + * error(message: string) + * + * Prints a usage message incorporating the message to stderr and + * exits. + * + * If you override this in a subclass, it should not return -- it + * should either exit or raise an exception. + */ + + // LEGACY (v1 compatibility), debug mode + if (this.debug === true) throw new Error(message) + // end + this.print_usage(process.stderr) + let args = {prog: this.prog, message: message} + this.exit(2, sub('%(prog)s: error: %(message)s\n', args)) + } +})) + + +module.exports = { + ArgumentParser, + ArgumentError, + ArgumentTypeError, + BooleanOptionalAction, + FileType, + HelpFormatter, + ArgumentDefaultsHelpFormatter, + RawDescriptionHelpFormatter, + RawTextHelpFormatter, + MetavarTypeHelpFormatter, + Namespace, + Action, + ONE_OR_MORE, + OPTIONAL, + PARSER, + REMAINDER, + SUPPRESS, + ZERO_OR_MORE +} + +// LEGACY (v1 compatibility), Const alias +Object.defineProperty(module.exports, 'Const', { + get() { + let result = {} + Object.entries({ ONE_OR_MORE, OPTIONAL, PARSER, REMAINDER, SUPPRESS, ZERO_OR_MORE }).forEach(([ n, v ]) => { + Object.defineProperty(result, n, { + get() { + deprecate(n, sub('use argparse.%s instead of argparse.Const.%s', n, n)) + return v + } + }) + }) + Object.entries({ _UNRECOGNIZED_ARGS_ATTR }).forEach(([ n, v ]) => { + Object.defineProperty(result, n, { + get() { + deprecate(n, sub('argparse.Const.%s is an internal symbol and will no longer be available', n)) + return v + } + }) + }) + return result + }, + enumerable: false +}) +// end diff --git a/node_modules/argparse/lib/sub.js b/node_modules/argparse/lib/sub.js new file mode 100644 index 000000000..e3eb3215f --- /dev/null +++ b/node_modules/argparse/lib/sub.js @@ -0,0 +1,67 @@ +// Limited implementation of python % string operator, supports only %s and %r for now +// (other formats are not used here, but may appear in custom templates) + +'use strict' + +const { inspect } = require('util') + + +module.exports = function sub(pattern, ...values) { + let regex = /%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g + + let result = pattern.replace(regex, function (_, is_literal, is_left_align, is_padded, name, format) { + if (is_literal) return '%' + + let padded_count = 0 + if (is_padded) { + if (values.length === 0) throw new TypeError('not enough arguments for format string') + padded_count = values.shift() + if (!Number.isInteger(padded_count)) throw new TypeError('* wants int') + } + + let str + if (name !== undefined) { + let dict = values[0] + if (typeof dict !== 'object' || dict === null) throw new TypeError('format requires a mapping') + if (!(name in dict)) throw new TypeError(`no such key: '${name}'`) + str = dict[name] + } else { + if (values.length === 0) throw new TypeError('not enough arguments for format string') + str = values.shift() + } + + switch (format) { + case 's': + str = String(str) + break + case 'r': + str = inspect(str) + break + case 'd': + case 'i': + if (typeof str !== 'number') { + throw new TypeError(`%${format} format: a number is required, not ${typeof str}`) + } + str = String(str.toFixed(0)) + break + default: + throw new TypeError(`unsupported format character '${format}'`) + } + + if (padded_count > 0) { + return is_left_align ? str.padEnd(padded_count) : str.padStart(padded_count) + } else { + return str + } + }) + + if (values.length) { + if (values.length === 1 && typeof values[0] === 'object' && values[0] !== null) { + // mapping + } else { + throw new TypeError('not all arguments converted during string formatting') + } + } + + return result +} diff --git a/node_modules/argparse/lib/textwrap.js b/node_modules/argparse/lib/textwrap.js new file mode 100644 index 000000000..23d51cdb9 --- /dev/null +++ b/node_modules/argparse/lib/textwrap.js @@ -0,0 +1,440 @@ +// Partial port of python's argparse module, version 3.9.0 (only wrap and fill functions): +// https://github.com/python/cpython/blob/v3.9.0b4/Lib/textwrap.py + +'use strict' + +/* + * Text wrapping and filling. + */ + +// Copyright (C) 1999-2001 Gregory P. Ward. +// Copyright (C) 2002, 2003 Python Software Foundation. +// Copyright (C) 2020 argparse.js authors +// Originally written by Greg Ward + +// Hardcode the recognized whitespace characters to the US-ASCII +// whitespace characters. The main reason for doing this is that +// some Unicode spaces (like \u00a0) are non-breaking whitespaces. +// +// This less funky little regex just split on recognized spaces. E.g. +// "Hello there -- you goof-ball, use the -b option!" +// splits into +// Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/ +const wordsep_simple_re = /([\t\n\x0b\x0c\r ]+)/ + +class TextWrapper { + /* + * Object for wrapping/filling text. The public interface consists of + * the wrap() and fill() methods; the other methods are just there for + * subclasses to override in order to tweak the default behaviour. + * If you want to completely replace the main wrapping algorithm, + * you'll probably have to override _wrap_chunks(). + * + * Several instance attributes control various aspects of wrapping: + * width (default: 70) + * the maximum width of wrapped lines (unless break_long_words + * is false) + * initial_indent (default: "") + * string that will be prepended to the first line of wrapped + * output. Counts towards the line's width. + * subsequent_indent (default: "") + * string that will be prepended to all lines save the first + * of wrapped output; also counts towards each line's width. + * expand_tabs (default: true) + * Expand tabs in input text to spaces before further processing. + * Each tab will become 0 .. 'tabsize' spaces, depending on its position + * in its line. If false, each tab is treated as a single character. + * tabsize (default: 8) + * Expand tabs in input text to 0 .. 'tabsize' spaces, unless + * 'expand_tabs' is false. + * replace_whitespace (default: true) + * Replace all whitespace characters in the input text by spaces + * after tab expansion. Note that if expand_tabs is false and + * replace_whitespace is true, every tab will be converted to a + * single space! + * fix_sentence_endings (default: false) + * Ensure that sentence-ending punctuation is always followed + * by two spaces. Off by default because the algorithm is + * (unavoidably) imperfect. + * break_long_words (default: true) + * Break words longer than 'width'. If false, those words will not + * be broken, and some lines might be longer than 'width'. + * break_on_hyphens (default: true) + * Allow breaking hyphenated words. If true, wrapping will occur + * preferably on whitespaces and right after hyphens part of + * compound words. + * drop_whitespace (default: true) + * Drop leading and trailing whitespace from lines. + * max_lines (default: None) + * Truncate wrapped lines. + * placeholder (default: ' [...]') + * Append to the last line of truncated text. + */ + + constructor(options = {}) { + let { + width = 70, + initial_indent = '', + subsequent_indent = '', + expand_tabs = true, + replace_whitespace = true, + fix_sentence_endings = false, + break_long_words = true, + drop_whitespace = true, + break_on_hyphens = true, + tabsize = 8, + max_lines = undefined, + placeholder=' [...]' + } = options + + this.width = width + this.initial_indent = initial_indent + this.subsequent_indent = subsequent_indent + this.expand_tabs = expand_tabs + this.replace_whitespace = replace_whitespace + this.fix_sentence_endings = fix_sentence_endings + this.break_long_words = break_long_words + this.drop_whitespace = drop_whitespace + this.break_on_hyphens = break_on_hyphens + this.tabsize = tabsize + this.max_lines = max_lines + this.placeholder = placeholder + } + + + // -- Private methods ----------------------------------------------- + // (possibly useful for subclasses to override) + + _munge_whitespace(text) { + /* + * _munge_whitespace(text : string) -> string + * + * Munge whitespace in text: expand tabs and convert all other + * whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz" + * becomes " foo bar baz". + */ + if (this.expand_tabs) { + text = text.replace(/\t/g, ' '.repeat(this.tabsize)) // not strictly correct in js + } + if (this.replace_whitespace) { + text = text.replace(/[\t\n\x0b\x0c\r]/g, ' ') + } + return text + } + + _split(text) { + /* + * _split(text : string) -> [string] + * + * Split the text to wrap into indivisible chunks. Chunks are + * not quite the same as words; see _wrap_chunks() for full + * details. As an example, the text + * Look, goof-ball -- use the -b option! + * breaks into the following chunks: + * 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ', + * 'use', ' ', 'the', ' ', '-b', ' ', 'option!' + * if break_on_hyphens is True, or in: + * 'Look,', ' ', 'goof-ball', ' ', '--', ' ', + * 'use', ' ', 'the', ' ', '-b', ' ', option!' + * otherwise. + */ + let chunks = text.split(wordsep_simple_re) + chunks = chunks.filter(Boolean) + return chunks + } + + _handle_long_word(reversed_chunks, cur_line, cur_len, width) { + /* + * _handle_long_word(chunks : [string], + * cur_line : [string], + * cur_len : int, width : int) + * + * Handle a chunk of text (most likely a word, not whitespace) that + * is too long to fit in any line. + */ + // Figure out when indent is larger than the specified width, and make + // sure at least one character is stripped off on every pass + let space_left + if (width < 1) { + space_left = 1 + } else { + space_left = width - cur_len + } + + // If we're allowed to break long words, then do so: put as much + // of the next chunk onto the current line as will fit. + if (this.break_long_words) { + cur_line.push(reversed_chunks[reversed_chunks.length - 1].slice(0, space_left)) + reversed_chunks[reversed_chunks.length - 1] = reversed_chunks[reversed_chunks.length - 1].slice(space_left) + + // Otherwise, we have to preserve the long word intact. Only add + // it to the current line if there's nothing already there -- + // that minimizes how much we violate the width constraint. + } else if (!cur_line) { + cur_line.push(...reversed_chunks.pop()) + } + + // If we're not allowed to break long words, and there's already + // text on the current line, do nothing. Next time through the + // main loop of _wrap_chunks(), we'll wind up here again, but + // cur_len will be zero, so the next line will be entirely + // devoted to the long word that we can't handle right now. + } + + _wrap_chunks(chunks) { + /* + * _wrap_chunks(chunks : [string]) -> [string] + * + * Wrap a sequence of text chunks and return a list of lines of + * length 'self.width' or less. (If 'break_long_words' is false, + * some lines may be longer than this.) Chunks correspond roughly + * to words and the whitespace between them: each chunk is + * indivisible (modulo 'break_long_words'), but a line break can + * come between any two chunks. Chunks should not have internal + * whitespace; ie. a chunk is either all whitespace or a "word". + * Whitespace chunks will be removed from the beginning and end of + * lines, but apart from that whitespace is preserved. + */ + let lines = [] + let indent + if (this.width <= 0) { + throw Error(`invalid width ${this.width} (must be > 0)`) + } + if (this.max_lines !== undefined) { + if (this.max_lines > 1) { + indent = this.subsequent_indent + } else { + indent = this.initial_indent + } + if (indent.length + this.placeholder.trimStart().length > this.width) { + throw Error('placeholder too large for max width') + } + } + + // Arrange in reverse order so items can be efficiently popped + // from a stack of chucks. + chunks = chunks.reverse() + + while (chunks.length > 0) { + + // Start the list of chunks that will make up the current line. + // cur_len is just the length of all the chunks in cur_line. + let cur_line = [] + let cur_len = 0 + + // Figure out which static string will prefix this line. + let indent + if (lines) { + indent = this.subsequent_indent + } else { + indent = this.initial_indent + } + + // Maximum width for this line. + let width = this.width - indent.length + + // First chunk on line is whitespace -- drop it, unless this + // is the very beginning of the text (ie. no lines started yet). + if (this.drop_whitespace && chunks[chunks.length - 1].trim() === '' && lines.length > 0) { + chunks.pop() + } + + while (chunks.length > 0) { + let l = chunks[chunks.length - 1].length + + // Can at least squeeze this chunk onto the current line. + if (cur_len + l <= width) { + cur_line.push(chunks.pop()) + cur_len += l + + // Nope, this line is full. + } else { + break + } + } + + // The current line is full, and the next chunk is too big to + // fit on *any* line (not just this one). + if (chunks.length && chunks[chunks.length - 1].length > width) { + this._handle_long_word(chunks, cur_line, cur_len, width) + cur_len = cur_line.map(l => l.length).reduce((a, b) => a + b, 0) + } + + // If the last chunk on this line is all whitespace, drop it. + if (this.drop_whitespace && cur_line.length > 0 && cur_line[cur_line.length - 1].trim() === '') { + cur_len -= cur_line[cur_line.length - 1].length + cur_line.pop() + } + + if (cur_line) { + if (this.max_lines === undefined || + lines.length + 1 < this.max_lines || + (chunks.length === 0 || + this.drop_whitespace && + chunks.length === 1 && + !chunks[0].trim()) && cur_len <= width) { + // Convert current line back to a string and store it in + // list of all lines (return value). + lines.push(indent + cur_line.join('')) + } else { + let had_break = false + while (cur_line) { + if (cur_line[cur_line.length - 1].trim() && + cur_len + this.placeholder.length <= width) { + cur_line.push(this.placeholder) + lines.push(indent + cur_line.join('')) + had_break = true + break + } + cur_len -= cur_line[-1].length + cur_line.pop() + } + if (!had_break) { + if (lines) { + let prev_line = lines[lines.length - 1].trimEnd() + if (prev_line.length + this.placeholder.length <= + this.width) { + lines[lines.length - 1] = prev_line + this.placeholder + break + } + } + lines.push(indent + this.placeholder.lstrip()) + } + break + } + } + } + + return lines + } + + _split_chunks(text) { + text = this._munge_whitespace(text) + return this._split(text) + } + + // -- Public interface ---------------------------------------------- + + wrap(text) { + /* + * wrap(text : string) -> [string] + * + * Reformat the single paragraph in 'text' so it fits in lines of + * no more than 'self.width' columns, and return a list of wrapped + * lines. Tabs in 'text' are expanded with string.expandtabs(), + * and all other whitespace characters (including newline) are + * converted to space. + */ + let chunks = this._split_chunks(text) + // not implemented in js + //if (this.fix_sentence_endings) { + // this._fix_sentence_endings(chunks) + //} + return this._wrap_chunks(chunks) + } + + fill(text) { + /* + * fill(text : string) -> string + * + * Reformat the single paragraph in 'text' to fit in lines of no + * more than 'self.width' columns, and return a new string + * containing the entire wrapped paragraph. + */ + return this.wrap(text).join('\n') + } +} + + +// -- Convenience interface --------------------------------------------- + +function wrap(text, options = {}) { + /* + * Wrap a single paragraph of text, returning a list of wrapped lines. + * + * Reformat the single paragraph in 'text' so it fits in lines of no + * more than 'width' columns, and return a list of wrapped lines. By + * default, tabs in 'text' are expanded with string.expandtabs(), and + * all other whitespace characters (including newline) are converted to + * space. See TextWrapper class for available keyword args to customize + * wrapping behaviour. + */ + let { width = 70, ...kwargs } = options + let w = new TextWrapper(Object.assign({ width }, kwargs)) + return w.wrap(text) +} + +function fill(text, options = {}) { + /* + * Fill a single paragraph of text, returning a new string. + * + * Reformat the single paragraph in 'text' to fit in lines of no more + * than 'width' columns, and return a new string containing the entire + * wrapped paragraph. As with wrap(), tabs are expanded and other + * whitespace characters converted to space. See TextWrapper class for + * available keyword args to customize wrapping behaviour. + */ + let { width = 70, ...kwargs } = options + let w = new TextWrapper(Object.assign({ width }, kwargs)) + return w.fill(text) +} + +// -- Loosely related functionality ------------------------------------- + +let _whitespace_only_re = /^[ \t]+$/mg +let _leading_whitespace_re = /(^[ \t]*)(?:[^ \t\n])/mg + +function dedent(text) { + /* + * Remove any common leading whitespace from every line in `text`. + * + * This can be used to make triple-quoted strings line up with the left + * edge of the display, while still presenting them in the source code + * in indented form. + * + * Note that tabs and spaces are both treated as whitespace, but they + * are not equal: the lines " hello" and "\\thello" are + * considered to have no common leading whitespace. + * + * Entirely blank lines are normalized to a newline character. + */ + // Look for the longest leading string of spaces and tabs common to + // all lines. + let margin = undefined + text = text.replace(_whitespace_only_re, '') + let indents = text.match(_leading_whitespace_re) || [] + for (let indent of indents) { + indent = indent.slice(0, -1) + + if (margin === undefined) { + margin = indent + + // Current line more deeply indented than previous winner: + // no change (previous winner is still on top). + } else if (indent.startsWith(margin)) { + // pass + + // Current line consistent with and no deeper than previous winner: + // it's the new winner. + } else if (margin.startsWith(indent)) { + margin = indent + + // Find the largest common whitespace between current line and previous + // winner. + } else { + for (let i = 0; i < margin.length && i < indent.length; i++) { + if (margin[i] !== indent[i]) { + margin = margin.slice(0, i) + break + } + } + } + } + + if (margin) { + text = text.replace(new RegExp('^' + margin, 'mg'), '') + } + return text +} + +module.exports = { wrap, fill, dedent } diff --git a/node_modules/argparse/package.json b/node_modules/argparse/package.json new file mode 100644 index 000000000..647d2aff1 --- /dev/null +++ b/node_modules/argparse/package.json @@ -0,0 +1,31 @@ +{ + "name": "argparse", + "description": "CLI arguments parser. Native port of python's argparse.", + "version": "2.0.1", + "keywords": [ + "cli", + "parser", + "argparse", + "option", + "args" + ], + "main": "argparse.js", + "files": [ + "argparse.js", + "lib/" + ], + "license": "Python-2.0", + "repository": "nodeca/argparse", + "scripts": { + "lint": "eslint .", + "test": "npm run lint && nyc mocha", + "coverage": "npm run test && nyc report --reporter html" + }, + "devDependencies": { + "@babel/eslint-parser": "^7.11.0", + "@babel/plugin-syntax-class-properties": "^7.10.4", + "eslint": "^7.5.0", + "mocha": "^8.0.1", + "nyc": "^15.1.0" + } +} diff --git a/node_modules/array-union/index.d.ts b/node_modules/array-union/index.d.ts new file mode 100644 index 000000000..379fc1d2f --- /dev/null +++ b/node_modules/array-union/index.d.ts @@ -0,0 +1,25 @@ +/** +Create an array of unique values, in order, from the input arrays. + +@example +``` +import arrayUnion = require('array-union'); + +arrayUnion([1, 1, 2, 3], [2, 3]); +//=> [1, 2, 3] + +arrayUnion(['foo', 'foo', 'bar']); +//=> ['foo', 'bar'] + +arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']); +//=> ['🐱', '🦄', '🐻', '🌈'] + +arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']); +//=> ['🐱', '🦄', '🐻', '🐶', '🌈'] +``` +*/ +declare function arrayUnion( + ...arguments: readonly ArgumentsType[] +): ArgumentsType; + +export = arrayUnion; diff --git a/node_modules/array-union/index.js b/node_modules/array-union/index.js new file mode 100644 index 000000000..7f85d3d19 --- /dev/null +++ b/node_modules/array-union/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = (...arguments_) => { + return [...new Set([].concat(...arguments_))]; +}; diff --git a/node_modules/array-union/license b/node_modules/array-union/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/array-union/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/array-union/package.json b/node_modules/array-union/package.json new file mode 100644 index 000000000..5ad5afa71 --- /dev/null +++ b/node_modules/array-union/package.json @@ -0,0 +1,38 @@ +{ + "name": "array-union", + "version": "2.1.0", + "description": "Create an array of unique values, in order, from the input arrays", + "license": "MIT", + "repository": "sindresorhus/array-union", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "array", + "set", + "uniq", + "unique", + "duplicate", + "remove", + "union", + "combine", + "merge" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/array-union/readme.md b/node_modules/array-union/readme.md new file mode 100644 index 000000000..2474a1aed --- /dev/null +++ b/node_modules/array-union/readme.md @@ -0,0 +1,34 @@ +# array-union [![Build Status](https://travis-ci.org/sindresorhus/array-union.svg?branch=master)](https://travis-ci.org/sindresorhus/array-union) + +> Create an array of unique values, in order, from the input arrays + + +## Install + +``` +$ npm install array-union +``` + + +## Usage + +```js +const arrayUnion = require('array-union'); + +arrayUnion([1, 1, 2, 3], [2, 3]); +//=> [1, 2, 3] + +arrayUnion(['foo', 'foo', 'bar']); +//=> ['foo', 'bar'] + +arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']); +//=> ['🐱', '🦄', '🐻', '🌈'] + +arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']); +//=> ['🐱', '🦄', '🐻', '🐶', '🌈'] +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/arrify/index.js b/node_modules/arrify/index.js new file mode 100644 index 000000000..2a2fdeeb1 --- /dev/null +++ b/node_modules/arrify/index.js @@ -0,0 +1,8 @@ +'use strict'; +module.exports = function (val) { + if (val === null || val === undefined) { + return []; + } + + return Array.isArray(val) ? val : [val]; +}; diff --git a/node_modules/arrify/license b/node_modules/arrify/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/arrify/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/arrify/package.json b/node_modules/arrify/package.json new file mode 100644 index 000000000..1e63e5971 --- /dev/null +++ b/node_modules/arrify/package.json @@ -0,0 +1,33 @@ +{ + "name": "arrify", + "version": "1.0.1", + "description": "Convert a value to an array", + "license": "MIT", + "repository": "sindresorhus/arrify", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "array", + "arr", + "arrify", + "arrayify", + "convert", + "value" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + } +} diff --git a/node_modules/arrify/readme.md b/node_modules/arrify/readme.md new file mode 100644 index 000000000..183d07576 --- /dev/null +++ b/node_modules/arrify/readme.md @@ -0,0 +1,36 @@ +# arrify [![Build Status](https://travis-ci.org/sindresorhus/arrify.svg?branch=master)](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) diff --git a/node_modules/astral-regex/index.d.ts b/node_modules/astral-regex/index.d.ts new file mode 100644 index 000000000..e81ac3158 --- /dev/null +++ b/node_modules/astral-regex/index.d.ts @@ -0,0 +1,28 @@ +declare namespace astralRegex { + interface Options { + /** + Only match an exact string. Useful with `RegExp#test()` to check if a string is a astral symbol. Default: `false` _(Matches any astral symbols in a string)_ + */ + readonly exact?: boolean; + } +} + +/** +Regular expression for matching [astral symbols](https://everything2.com/title/astral+plane). + +@returns A `RegExp` for matching astral symbols. + +@example +``` +import astralRegex = require('astral-regex'); + +astralRegex({exact: true}).test('🦄'); +//=> true + +'foo 🦄 💩 bar'.match(astralRegex()); +//=> ['🦄', '💩'] +``` +*/ +declare function astralRegex(options?: astralRegex.Options): RegExp; + +export = astralRegex; diff --git a/node_modules/astral-regex/index.js b/node_modules/astral-regex/index.js new file mode 100644 index 000000000..651177d40 --- /dev/null +++ b/node_modules/astral-regex/index.js @@ -0,0 +1,6 @@ +'use strict'; +const regex = '[\uD800-\uDBFF][\uDC00-\uDFFF]'; + +const astralRegex = options => options && options.exact ? new RegExp(`^${regex}$`) : new RegExp(regex, 'g'); + +module.exports = astralRegex; diff --git a/node_modules/astral-regex/license b/node_modules/astral-regex/license new file mode 100644 index 000000000..db6bc32cc --- /dev/null +++ b/node_modules/astral-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Kevin Mårtensson (github.com/kevva) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/astral-regex/package.json b/node_modules/astral-regex/package.json new file mode 100644 index 000000000..d1ceea7f3 --- /dev/null +++ b/node_modules/astral-regex/package.json @@ -0,0 +1,33 @@ +{ + "name": "astral-regex", + "version": "2.0.0", + "description": "Regular expression for matching astral symbols", + "license": "MIT", + "repository": "kevva/astral-regex", + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "github.com/kevva" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "astral", + "emoji", + "regex", + "surrogate" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/astral-regex/readme.md b/node_modules/astral-regex/readme.md new file mode 100644 index 000000000..89d6659a4 --- /dev/null +++ b/node_modules/astral-regex/readme.md @@ -0,0 +1,46 @@ +# astral-regex [![Build Status](https://travis-ci.org/kevva/astral-regex.svg?branch=master)](https://travis-ci.org/kevva/astral-regex) + +> Regular expression for matching [astral symbols](https://everything2.com/title/astral+plane) + + +## Install + +``` +$ npm install astral-regex +``` + + +## Usage + +```js +const astralRegex = require('astral-regex'); + +astralRegex({exact: true}).test('🦄'); +//=> true + +'foo 🦄 💩 bar'.match(astralRegex()); +//=> ['🦄', '💩'] +``` + + +## API + +### astralRegex([options]) + +Returns a `RegExp` for matching astral symbols. + +#### options + +Type: `Object` + +##### exact + +Type: `boolean`
+Default: `false` *(Matches any astral symbols in a string)* + +Only match an exact string. Useful with `RegExp#test()` to check if a string is a astral symbol. + + +## License + +MIT © [Kevin Mårtensson](https://github.com/kevva) diff --git a/node_modules/balanced-match/.github/FUNDING.yml b/node_modules/balanced-match/.github/FUNDING.yml new file mode 100644 index 000000000..1c904eb2b --- /dev/null +++ b/node_modules/balanced-match/.github/FUNDING.yml @@ -0,0 +1,2 @@ +tidelift: 'npm/balanced-match' +patreon: juliangruber diff --git a/node_modules/balanced-match/LICENSE.md b/node_modules/balanced-match/LICENSE.md new file mode 100644 index 000000000..2cdc8e414 --- /dev/null +++ b/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/balanced-match/README.md b/node_modules/balanced-match/README.md new file mode 100644 index 000000000..a7ccfec3c --- /dev/null +++ b/node_modules/balanced-match/README.md @@ -0,0 +1,97 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match') + +console.log(balanced('{', '}', 'pre{in{nested}}post')) +console.log(balanced('{', '}', 'pre{first}between{second}post')) +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')) +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +- **start** the index of the first match of `a` +- **end** the index of the matching `b` +- **pre** the preamble, `a` and `b` not included +- **body** the match, `a` and `b` not included +- **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/balanced-match/index.js b/node_modules/balanced-match/index.js new file mode 100644 index 000000000..7c3266fff --- /dev/null +++ b/node_modules/balanced-match/index.js @@ -0,0 +1,64 @@ +'use strict' +module.exports = balanced +function balanced (a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str) + if (b instanceof RegExp) b = maybeMatch(b, str) + + const r = range(a, b, str) + + return ( + r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + } + ) +} + +function maybeMatch (reg, str) { + const m = str.match(reg) + return m ? m[0] : null +} + +balanced.range = range +function range (a, b, str) { + let begs, beg, left, right, result + let ai = str.indexOf(a) + let bi = str.indexOf(b, ai + 1) + let i = ai + + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi] + } + begs = [] + left = str.length + + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i) + ai = str.indexOf(a, i + 1) + } else if (begs.length === 1) { + result = [begs.pop(), bi] + } else { + beg = begs.pop() + if (beg < left) { + left = beg + right = bi + } + + bi = str.indexOf(b, i + 1) + } + + i = ai < bi && ai >= 0 ? ai : bi + } + + if (begs.length) { + result = [left, right] + } + } + + return result +} diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json new file mode 100644 index 000000000..c304ecff2 --- /dev/null +++ b/node_modules/balanced-match/package.json @@ -0,0 +1,52 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "2.0.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "main": "index.js", + "scripts": { + "test": "prettier-standard && standard && tape test/test.js", + "bench": "matcha test/bench.js", + "release": "np" + }, + "devDependencies": { + "@c4312/matcha": "^1.3.1", + "np": "^7.4.0", + "prettier-standard": "^16.4.1", + "standard": "^16.0.3", + "tape": "^4.6.0" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } +} diff --git a/node_modules/brace-expansion/LICENSE b/node_modules/brace-expansion/LICENSE new file mode 100644 index 000000000..de3226673 --- /dev/null +++ b/node_modules/brace-expansion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/brace-expansion/README.md b/node_modules/brace-expansion/README.md new file mode 100644 index 000000000..6b4e0e164 --- /dev/null +++ b/node_modules/brace-expansion/README.md @@ -0,0 +1,129 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) +[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/brace-expansion/index.js b/node_modules/brace-expansion/index.js new file mode 100644 index 000000000..0478be81e --- /dev/null +++ b/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/node_modules/brace-expansion/node_modules/balanced-match/.github/FUNDING.yml b/node_modules/brace-expansion/node_modules/balanced-match/.github/FUNDING.yml new file mode 100644 index 000000000..cea8b16e9 --- /dev/null +++ b/node_modules/brace-expansion/node_modules/balanced-match/.github/FUNDING.yml @@ -0,0 +1,2 @@ +tidelift: "npm/balanced-match" +patreon: juliangruber diff --git a/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md new file mode 100644 index 000000000..2cdc8e414 --- /dev/null +++ b/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/brace-expansion/node_modules/balanced-match/README.md b/node_modules/brace-expansion/node_modules/balanced-match/README.md new file mode 100644 index 000000000..d2a48b6b4 --- /dev/null +++ b/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -0,0 +1,97 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/brace-expansion/node_modules/balanced-match/index.js b/node_modules/brace-expansion/node_modules/balanced-match/index.js new file mode 100644 index 000000000..c67a64608 --- /dev/null +++ b/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -0,0 +1,62 @@ +'use strict'; +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + if(a===b) { + return [ai, bi]; + } + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/node_modules/brace-expansion/node_modules/balanced-match/package.json b/node_modules/brace-expansion/node_modules/balanced-match/package.json new file mode 100644 index 000000000..ce6073e04 --- /dev/null +++ b/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -0,0 +1,48 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "1.0.2", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "main": "index.js", + "scripts": { + "test": "tape test/test.js", + "bench": "matcha test/bench.js" + }, + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } +} diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json new file mode 100644 index 000000000..a18faa8fd --- /dev/null +++ b/node_modules/brace-expansion/package.json @@ -0,0 +1,47 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.1.11", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh", + "bench": "matcha test/perf/bench.js" + }, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + }, + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } +} diff --git a/node_modules/braces/CHANGELOG.md b/node_modules/braces/CHANGELOG.md new file mode 100644 index 000000000..36f798b00 --- /dev/null +++ b/node_modules/braces/CHANGELOG.md @@ -0,0 +1,184 @@ +# Release history + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +
+ Guiding Principles + +- Changelogs are for humans, not machines. +- There should be an entry for every single version. +- The same types of changes should be grouped. +- Versions and sections should be linkable. +- The latest version comes first. +- The release date of each versions is displayed. +- Mention whether you follow Semantic Versioning. + +
+ +
+ Types of changes + +Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +
+ +## [3.0.0] - 2018-04-08 + +v3.0 is a complete refactor, resulting in a faster, smaller codebase, with fewer deps, and a more accurate parser and compiler. + +**Breaking Changes** + +- The undocumented `.makeRe` method was removed + +**Non-breaking changes** + +- Caching was removed + +## [2.3.2] - 2018-04-08 + +- start refactoring +- cover sets +- better range handling + +## [2.3.1] - 2018-02-17 + +- Remove unnecessary escape in Regex. (#14) + +## [2.3.0] - 2017-10-19 + +- minor code reorganization +- optimize regex +- expose `maxLength` option + +## [2.2.1] - 2017-05-30 + +- don't condense when braces contain extglobs + +## [2.2.0] - 2017-05-28 + +- ensure word boundaries are preserved +- fixes edge case where extglob characters precede a brace pattern + +## [2.1.1] - 2017-04-27 + +- use snapdragon-node +- handle edge case +- optimizations, lint + +## [2.0.4] - 2017-04-11 + +- pass opts to compiler +- minor optimization in create method +- re-write parser handlers to remove negation regex + +## [2.0.3] - 2016-12-10 + +- use split-string +- clear queue at the end +- adds sequences example +- add unit tests + +## [2.0.2] - 2016-10-21 + +- fix comma handling in nested extglobs + +## [2.0.1] - 2016-10-20 + +- add comments +- more tests, ensure quotes are stripped + +## [2.0.0] - 2016-10-19 + +- don't expand braces inside character classes +- add quantifier pattern + +## [1.8.5] - 2016-05-21 + +- Refactor (#10) + +## [1.8.4] - 2016-04-20 + +- fixes https://github.com/jonschlinkert/micromatch/issues/66 + +## [1.8.0] - 2015-03-18 + +- adds exponent examples, tests +- fixes the first example in https://github.com/jonschlinkert/micromatch/issues/38 + +## [1.6.0] - 2015-01-30 + +- optimizations, `bash` mode: +- improve path escaping + +## [1.5.0] - 2015-01-28 + +- Merge pull request #5 from eush77/lib-files + +## [1.4.0] - 2015-01-24 + +- add extglob tests +- externalize exponent function +- better whitespace handling + +## [1.3.0] - 2015-01-24 + +- make regex patterns explicity + +## [1.1.0] - 2015-01-11 + +- don't create a match group with `makeRe` + +## [1.0.0] - 2014-12-23 + +- Merge commit '97b05f5544f8348736a8efaecf5c32bbe3e2ad6e' +- support empty brace syntax +- better bash coverage +- better support for regex strings + +## [0.1.4] - 2014-11-14 + +- improve recognition of bad args, recognize mismatched argument types +- support escaping +- remove pathname-expansion +- support whitespace in patterns + +## [0.1.0] + +- first commit + +[2.3.2]: https://github.com/micromatch/braces/compare/2.3.1...2.3.2 +[2.3.1]: https://github.com/micromatch/braces/compare/2.3.0...2.3.1 +[2.3.0]: https://github.com/micromatch/braces/compare/2.2.1...2.3.0 +[2.2.1]: https://github.com/micromatch/braces/compare/2.2.0...2.2.1 +[2.2.0]: https://github.com/micromatch/braces/compare/2.1.1...2.2.0 +[2.1.1]: https://github.com/micromatch/braces/compare/2.1.0...2.1.1 +[2.1.0]: https://github.com/micromatch/braces/compare/2.0.4...2.1.0 +[2.0.4]: https://github.com/micromatch/braces/compare/2.0.3...2.0.4 +[2.0.3]: https://github.com/micromatch/braces/compare/2.0.2...2.0.3 +[2.0.2]: https://github.com/micromatch/braces/compare/2.0.1...2.0.2 +[2.0.1]: https://github.com/micromatch/braces/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/micromatch/braces/compare/1.8.5...2.0.0 +[1.8.5]: https://github.com/micromatch/braces/compare/1.8.4...1.8.5 +[1.8.4]: https://github.com/micromatch/braces/compare/1.8.0...1.8.4 +[1.8.0]: https://github.com/micromatch/braces/compare/1.6.0...1.8.0 +[1.6.0]: https://github.com/micromatch/braces/compare/1.5.0...1.6.0 +[1.5.0]: https://github.com/micromatch/braces/compare/1.4.0...1.5.0 +[1.4.0]: https://github.com/micromatch/braces/compare/1.3.0...1.4.0 +[1.3.0]: https://github.com/micromatch/braces/compare/1.2.0...1.3.0 +[1.2.0]: https://github.com/micromatch/braces/compare/1.1.0...1.2.0 +[1.1.0]: https://github.com/micromatch/braces/compare/1.0.0...1.1.0 +[1.0.0]: https://github.com/micromatch/braces/compare/0.1.4...1.0.0 +[0.1.4]: https://github.com/micromatch/braces/compare/0.1.0...0.1.4 + +[Unreleased]: https://github.com/micromatch/braces/compare/0.1.0...HEAD +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog \ No newline at end of file diff --git a/node_modules/braces/LICENSE b/node_modules/braces/LICENSE new file mode 100644 index 000000000..d32ab4426 --- /dev/null +++ b/node_modules/braces/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2018, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/braces/README.md b/node_modules/braces/README.md new file mode 100644 index 000000000..cba2f600d --- /dev/null +++ b/node_modules/braces/README.md @@ -0,0 +1,593 @@ +# braces [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/braces.svg?style=flat)](https://www.npmjs.com/package/braces) [![NPM monthly downloads](https://img.shields.io/npm/dm/braces.svg?style=flat)](https://npmjs.org/package/braces) [![NPM total downloads](https://img.shields.io/npm/dt/braces.svg?style=flat)](https://npmjs.org/package/braces) [![Linux Build Status](https://img.shields.io/travis/micromatch/braces.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/braces) + +> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save braces +``` + +## v3.0.0 Released!! + +See the [changelog](CHANGELOG.md) for details. + +## Why use braces? + +Brace patterns make globs more powerful by adding the ability to match specific ranges and sequences of characters. + +* **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests) +* **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity. +* **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up. +* **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written). +* **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)). +* [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']` +* [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']` +* [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']` +* [Supports escaping](#escaping) - To prevent evaluation of special characters. + +## Usage + +The main export is a function that takes one or more brace `patterns` and `options`. + +```js +const braces = require('braces'); +// braces(patterns[, options]); + +console.log(braces(['{01..05}', '{a..e}'])); +//=> ['(0[1-5])', '([a-e])'] + +console.log(braces(['{01..05}', '{a..e}'], { expand: true })); +//=> ['01', '02', '03', '04', '05', 'a', 'b', 'c', 'd', 'e'] +``` + +### Brace Expansion vs. Compilation + +By default, brace patterns are compiled into strings that are optimized for creating regular expressions and matching. + +**Compiled** + +```js +console.log(braces('a/{x,y,z}/b')); +//=> ['a/(x|y|z)/b'] +console.log(braces(['a/{01..20}/b', 'a/{1..5}/b'])); +//=> [ 'a/(0[1-9]|1[0-9]|20)/b', 'a/([1-5])/b' ] +``` + +**Expanded** + +Enable brace expansion by setting the `expand` option to true, or by using [braces.expand()](#expand) (returns an array similar to what you'd expect from Bash, or `echo {1..5}`, or [minimatch](https://github.com/isaacs/minimatch)): + +```js +console.log(braces('a/{x,y,z}/b', { expand: true })); +//=> ['a/x/b', 'a/y/b', 'a/z/b'] + +console.log(braces.expand('{01..10}')); +//=> ['01','02','03','04','05','06','07','08','09','10'] +``` + +### Lists + +Expand lists (like Bash "sets"): + +```js +console.log(braces('a/{foo,bar,baz}/*.js')); +//=> ['a/(foo|bar|baz)/*.js'] + +console.log(braces.expand('a/{foo,bar,baz}/*.js')); +//=> ['a/foo/*.js', 'a/bar/*.js', 'a/baz/*.js'] +``` + +### Sequences + +Expand ranges of characters (like Bash "sequences"): + +```js +console.log(braces.expand('{1..3}')); // ['1', '2', '3'] +console.log(braces.expand('a/{1..3}/b')); // ['a/1/b', 'a/2/b', 'a/3/b'] +console.log(braces('{a..c}', { expand: true })); // ['a', 'b', 'c'] +console.log(braces('foo/{a..c}', { expand: true })); // ['foo/a', 'foo/b', 'foo/c'] + +// supports zero-padded ranges +console.log(braces('a/{01..03}/b')); //=> ['a/(0[1-3])/b'] +console.log(braces('a/{001..300}/b')); //=> ['a/(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)/b'] +``` + +See [fill-range](https://github.com/jonschlinkert/fill-range) for all available range-expansion options. + +### Steppped ranges + +Steps, or increments, may be used with ranges: + +```js +console.log(braces.expand('{2..10..2}')); +//=> ['2', '4', '6', '8', '10'] + +console.log(braces('{2..10..2}')); +//=> ['(2|4|6|8|10)'] +``` + +When the [.optimize](#optimize) method is used, or [options.optimize](#optionsoptimize) is set to true, sequences are passed to [to-regex-range](https://github.com/jonschlinkert/to-regex-range) for expansion. + +### Nesting + +Brace patterns may be nested. The results of each expanded string are not sorted, and left to right order is preserved. + +**"Expanded" braces** + +```js +console.log(braces.expand('a{b,c,/{x,y}}/e')); +//=> ['ab/e', 'ac/e', 'a/x/e', 'a/y/e'] + +console.log(braces.expand('a/{x,{1..5},y}/c')); +//=> ['a/x/c', 'a/1/c', 'a/2/c', 'a/3/c', 'a/4/c', 'a/5/c', 'a/y/c'] +``` + +**"Optimized" braces** + +```js +console.log(braces('a{b,c,/{x,y}}/e')); +//=> ['a(b|c|/(x|y))/e'] + +console.log(braces('a/{x,{1..5},y}/c')); +//=> ['a/(x|([1-5])|y)/c'] +``` + +### Escaping + +**Escaping braces** + +A brace pattern will not be expanded or evaluted if _either the opening or closing brace is escaped_: + +```js +console.log(braces.expand('a\\{d,c,b}e')); +//=> ['a{d,c,b}e'] + +console.log(braces.expand('a{d,c,b\\}e')); +//=> ['a{d,c,b}e'] +``` + +**Escaping commas** + +Commas inside braces may also be escaped: + +```js +console.log(braces.expand('a{b\\,c}d')); +//=> ['a{b,c}d'] + +console.log(braces.expand('a{d\\,c,b}e')); +//=> ['ad,ce', 'abe'] +``` + +**Single items** + +Following bash conventions, a brace pattern is also not expanded when it contains a single character: + +```js +console.log(braces.expand('a{b}c')); +//=> ['a{b}c'] +``` + +## Options + +### options.maxLength + +**Type**: `Number` + +**Default**: `65,536` + +**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera. + +```js +console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error +``` + +### options.expand + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Generate an "expanded" brace pattern (alternatively you can use the `braces.expand()` method, which does the same thing). + +```js +console.log(braces('a/{b,c}/d', { expand: true })); +//=> [ 'a/b/d', 'a/c/d' ] +``` + +### options.nodupes + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Remove duplicates from the returned array. + +### options.rangeLimit + +**Type**: `Number` + +**Default**: `1000` + +**Description**: To prevent malicious patterns from being passed by users, an error is thrown when `braces.expand()` is used or `options.expand` is true and the generated range will exceed the `rangeLimit`. + +You can customize `options.rangeLimit` or set it to `Inifinity` to disable this altogether. + +**Examples** + +```js +// pattern exceeds the "rangeLimit", so it's optimized automatically +console.log(braces.expand('{1..1000}')); +//=> ['([1-9]|[1-9][0-9]{1,2}|1000)'] + +// pattern does not exceed "rangeLimit", so it's NOT optimized +console.log(braces.expand('{1..100}')); +//=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100'] +``` + +### options.transform + +**Type**: `Function` + +**Default**: `undefined` + +**Description**: Customize range expansion. + +**Example: Transforming non-numeric values** + +```js +const alpha = braces.expand('x/{a..e}/y', { + transform(value, index) { + // When non-numeric values are passed, "value" is a character code. + return 'foo/' + String.fromCharCode(value) + '-' + index; + } +}); +console.log(alpha); +//=> [ 'x/foo/a-0/y', 'x/foo/b-1/y', 'x/foo/c-2/y', 'x/foo/d-3/y', 'x/foo/e-4/y' ] +``` + +**Example: Transforming numeric values** + +```js +const numeric = braces.expand('{1..5}', { + transform(value) { + // when numeric values are passed, "value" is a number + return 'foo/' + value * 2; + } +}); +console.log(numeric); +//=> [ 'foo/2', 'foo/4', 'foo/6', 'foo/8', 'foo/10' ] +``` + +### options.quantifiers + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times. + +Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists) + +The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) are defined in the given pattern, and not to try to expand them as lists. + +**Examples** + +```js +const braces = require('braces'); +console.log(braces('a/b{1,3}/{x,y,z}')); +//=> [ 'a/b(1|3)/(x|y|z)' ] +console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true})); +//=> [ 'a/b{1,3}/(x|y|z)' ] +console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true, expand: true})); +//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ] +``` + +### options.unescape + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Strip backslashes that were used for escaping from the result. + +## What is "brace expansion"? + +Brace expansion is a type of parameter expansion that was made popular by unix shells for generating lists of strings, as well as regex-like matching when used alongside wildcards (globs). + +In addition to "expansion", braces are also used for matching. In other words: + +* [brace expansion](#brace-expansion) is for generating new lists +* [brace matching](#brace-matching) is for filtering existing lists + +
+More about brace expansion (click to expand) + +There are two main types of brace expansion: + +1. **lists**: which are defined using comma-separated values inside curly braces: `{a,b,c}` +2. **sequences**: which are defined using a starting value and an ending value, separated by two dots: `a{1..3}b`. Optionally, a third argument may be passed to define a "step" or increment to use: `a{1..100..10}b`. These are also sometimes referred to as "ranges". + +Here are some example brace patterns to illustrate how they work: + +**Sets** + +``` +{a,b,c} => a b c +{a,b,c}{1,2} => a1 a2 b1 b2 c1 c2 +``` + +**Sequences** + +``` +{1..9} => 1 2 3 4 5 6 7 8 9 +{4..-4} => 4 3 2 1 0 -1 -2 -3 -4 +{1..20..3} => 1 4 7 10 13 16 19 +{a..j} => a b c d e f g h i j +{j..a} => j i h g f e d c b a +{a..z..3} => a d g j m p s v y +``` + +**Combination** + +Sets and sequences can be mixed together or used along with any other strings. + +``` +{a,b,c}{1..3} => a1 a2 a3 b1 b2 b3 c1 c2 c3 +foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar +``` + +The fact that braces can be "expanded" from relatively simple patterns makes them ideal for quickly generating test fixtures, file paths, and similar use cases. + +## Brace matching + +In addition to _expansion_, brace patterns are also useful for performing regular-expression-like matching. + +For example, the pattern `foo/{1..3}/bar` would match any of following strings: + +``` +foo/1/bar +foo/2/bar +foo/3/bar +``` + +But not: + +``` +baz/1/qux +baz/2/qux +baz/3/qux +``` + +Braces can also be combined with [glob patterns](https://github.com/jonschlinkert/micromatch) to perform more advanced wildcard matching. For example, the pattern `*/{1..3}/*` would match any of following strings: + +``` +foo/1/bar +foo/2/bar +foo/3/bar +baz/1/qux +baz/2/qux +baz/3/qux +``` + +## Brace matching pitfalls + +Although brace patterns offer a user-friendly way of matching ranges or sets of strings, there are also some major disadvantages and potential risks you should be aware of. + +### tldr + +**"brace bombs"** + +* brace expansion can eat up a huge amount of processing resources +* as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially +* users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!) + +For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section. + +### The solution + +Jump to the [performance section](#performance) to see how Braces solves this problem in comparison to other libraries. + +### Geometric complexity + +At minimum, brace patterns with sets limited to two elements have quadradic or `O(n^2)` complexity. But the complexity of the algorithm increases exponentially as the number of sets, _and elements per set_, increases, which is `O(n^c)`. + +For example, the following sets demonstrate quadratic (`O(n^2)`) complexity: + +``` +{1,2}{3,4} => (2X2) => 13 14 23 24 +{1,2}{3,4}{5,6} => (2X2X2) => 135 136 145 146 235 236 245 246 +``` + +But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity: + +``` +{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248 + 249 257 258 259 267 268 269 347 348 349 357 + 358 359 367 368 369 +``` + +Now, imagine how this complexity grows given that each element is a n-tuple: + +``` +{1..100}{1..100} => (100X100) => 10,000 elements (38.4 kB) +{1..100}{1..100}{1..100} => (100X100X100) => 1,000,000 elements (5.76 MB) +``` + +Although these examples are clearly contrived, they demonstrate how brace patterns can quickly grow out of control. + +**More information** + +Interested in learning more about brace expansion? + +* [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion) +* [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion) +* [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) + +
+ +## Performance + +Braces is not only screaming fast, it's also more accurate the other brace expansion libraries. + +### Better algorithms + +Fortunately there is a solution to the ["brace bomb" problem](#brace-matching-pitfalls): _don't expand brace patterns into an array when they're used for matching_. + +Instead, convert the pattern into an optimized regular expression. This is easier said than done, and braces is the only library that does this currently. + +**The proof is in the numbers** + +Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively. + +| **Pattern** | **braces** | **[minimatch][]** | +| --- | --- | --- | +| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs)| N/A (freezes) | +| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) | +| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) | +| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) | +| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) | +| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) | +| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) | +| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) | +| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) | +| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) | +| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) | +| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) | +| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) | +| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) | +| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) | +| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) | +| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) | + +### Faster algorithms + +When you need expansion, braces is still much faster. + +_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_ + +| **Pattern** | **braces** | **[minimatch][]** | +| --- | --- | --- | +| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) | +| `{1..1000000}` | `6.89 MB` (458ms 576μs) | `6.89 MB` (1s 491ms 621μs) | +| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) | +| `{1..10000}` | `48.89 kB` (2ms 202μs) | `48.89 kB` (13ms 641μs) | +| `{1..1000}` | `3.89 kB` (1ms 796μs) | `3.89 kB` (1ms 958μs) | +| `{1..100}` | `291 B` (424μs) | `291 B` (211μs) | +| `{1..10}` | `20 B` (487μs) | `20 B` (72μs) | +| `{1..3}` | `5 B` (166μs) | `5 B` (27μs) | + +If you'd like to run these comparisons yourself, see [test/support/generate.js](test/support/generate.js). + +## Benchmarks + +### Running benchmarks + +Install dev dependencies: + +```bash +npm i -d && npm benchmark +``` + +### Latest results + +Braces is more accurate, without sacrificing performance. + +```bash +# range (expanded) + braces x 29,040 ops/sec ±3.69% (91 runs sampled)) + minimatch x 4,735 ops/sec ±1.28% (90 runs sampled) + +# range (optimized for regex) + braces x 382,878 ops/sec ±0.56% (94 runs sampled) + minimatch x 1,040 ops/sec ±0.44% (93 runs sampled) + +# nested ranges (expanded) + braces x 19,744 ops/sec ±2.27% (92 runs sampled)) + minimatch x 4,579 ops/sec ±0.50% (93 runs sampled) + +# nested ranges (optimized for regex) + braces x 246,019 ops/sec ±2.02% (93 runs sampled) + minimatch x 1,028 ops/sec ±0.39% (94 runs sampled) + +# set (expanded) + braces x 138,641 ops/sec ±0.53% (95 runs sampled) + minimatch x 219,582 ops/sec ±0.98% (94 runs sampled) + +# set (optimized for regex) + braces x 388,408 ops/sec ±0.41% (95 runs sampled) + minimatch x 44,724 ops/sec ±0.91% (89 runs sampled) + +# nested sets (expanded) + braces x 84,966 ops/sec ±0.48% (94 runs sampled) + minimatch x 140,720 ops/sec ±0.37% (95 runs sampled) + +# nested sets (optimized for regex) + braces x 263,340 ops/sec ±2.06% (92 runs sampled) + minimatch x 28,714 ops/sec ±0.40% (90 runs sampled) +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 197 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [es128](https://github.com/es128) | +| 1 | [eush77](https://github.com/eush77) | +| 1 | [hemanth](https://github.com/hemanth) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._ \ No newline at end of file diff --git a/node_modules/braces/index.js b/node_modules/braces/index.js new file mode 100644 index 000000000..0eee0f567 --- /dev/null +++ b/node_modules/braces/index.js @@ -0,0 +1,170 @@ +'use strict'; + +const stringify = require('./lib/stringify'); +const compile = require('./lib/compile'); +const expand = require('./lib/expand'); +const parse = require('./lib/parse'); + +/** + * Expand the given pattern or create a regex-compatible string. + * + * ```js + * const braces = require('braces'); + * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] + * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public + */ + +const braces = (input, options = {}) => { + let output = []; + + if (Array.isArray(input)) { + for (let pattern of input) { + let result = braces.create(pattern, options); + if (Array.isArray(result)) { + output.push(...result); + } else { + output.push(result); + } + } + } else { + output = [].concat(braces.create(input, options)); + } + + if (options && options.expand === true && options.nodupes === true) { + output = [...new Set(output)]; + } + return output; +}; + +/** + * Parse the given `str` with the given `options`. + * + * ```js + * // braces.parse(pattern, [, options]); + * const ast = braces.parse('a/{b,c}/d'); + * console.log(ast); + * ``` + * @param {String} pattern Brace pattern to parse + * @param {Object} options + * @return {Object} Returns an AST + * @api public + */ + +braces.parse = (input, options = {}) => parse(input, options); + +/** + * Creates a braces string from an AST, or an AST node. + * + * ```js + * const braces = require('braces'); + * let ast = braces.parse('foo/{a,b}/bar'); + * console.log(stringify(ast.nodes[2])); //=> '{a,b}' + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.stringify = (input, options = {}) => { + if (typeof input === 'string') { + return stringify(braces.parse(input, options), options); + } + return stringify(input, options); +}; + +/** + * Compiles a brace pattern into a regex-compatible, optimized string. + * This method is called by the main [braces](#braces) function by default. + * + * ```js + * const braces = require('braces'); + * console.log(braces.compile('a/{b,c}/d')); + * //=> ['a/(b|c)/d'] + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.compile = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + return compile(input, options); +}; + +/** + * Expands a brace pattern into an array. This method is called by the + * main [braces](#braces) function when `options.expand` is true. Before + * using this method it's recommended that you read the [performance notes](#performance)) + * and advantages of using [.compile](#compile) instead. + * + * ```js + * const braces = require('braces'); + * console.log(braces.expand('a/{b,c}/d')); + * //=> ['a/b/d', 'a/c/d']; + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.expand = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + + let result = expand(input, options); + + // filter out empty strings if specified + if (options.noempty === true) { + result = result.filter(Boolean); + } + + // filter out duplicates if specified + if (options.nodupes === true) { + result = [...new Set(result)]; + } + + return result; +}; + +/** + * Processes a brace pattern and returns either an expanded array + * (if `options.expand` is true), a highly optimized regex-compatible string. + * This method is called by the main [braces](#braces) function. + * + * ```js + * const braces = require('braces'); + * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) + * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.create = (input, options = {}) => { + if (input === '' || input.length < 3) { + return [input]; + } + + return options.expand !== true + ? braces.compile(input, options) + : braces.expand(input, options); +}; + +/** + * Expose "braces" + */ + +module.exports = braces; diff --git a/node_modules/braces/lib/compile.js b/node_modules/braces/lib/compile.js new file mode 100644 index 000000000..3e984a4bb --- /dev/null +++ b/node_modules/braces/lib/compile.js @@ -0,0 +1,57 @@ +'use strict'; + +const fill = require('fill-range'); +const utils = require('./utils'); + +const compile = (ast, options = {}) => { + let walk = (node, parent = {}) => { + let invalidBlock = utils.isInvalidBrace(parent); + let invalidNode = node.invalid === true && options.escapeInvalid === true; + let invalid = invalidBlock === true || invalidNode === true; + let prefix = options.escapeInvalid === true ? '\\' : ''; + let output = ''; + + if (node.isOpen === true) { + return prefix + node.value; + } + if (node.isClose === true) { + return prefix + node.value; + } + + if (node.type === 'open') { + return invalid ? (prefix + node.value) : '('; + } + + if (node.type === 'close') { + return invalid ? (prefix + node.value) : ')'; + } + + if (node.type === 'comma') { + return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|'); + } + + if (node.value) { + return node.value; + } + + if (node.nodes && node.ranges > 0) { + let args = utils.reduce(node.nodes); + let range = fill(...args, { ...options, wrap: false, toRegex: true }); + + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } + + if (node.nodes) { + for (let child of node.nodes) { + output += walk(child, node); + } + } + return output; + }; + + return walk(ast); +}; + +module.exports = compile; diff --git a/node_modules/braces/lib/constants.js b/node_modules/braces/lib/constants.js new file mode 100644 index 000000000..a93794366 --- /dev/null +++ b/node_modules/braces/lib/constants.js @@ -0,0 +1,57 @@ +'use strict'; + +module.exports = { + MAX_LENGTH: 1024 * 64, + + // Digits + CHAR_0: '0', /* 0 */ + CHAR_9: '9', /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 'A', /* A */ + CHAR_LOWERCASE_A: 'a', /* a */ + CHAR_UPPERCASE_Z: 'Z', /* Z */ + CHAR_LOWERCASE_Z: 'z', /* z */ + + CHAR_LEFT_PARENTHESES: '(', /* ( */ + CHAR_RIGHT_PARENTHESES: ')', /* ) */ + + CHAR_ASTERISK: '*', /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: '&', /* & */ + CHAR_AT: '@', /* @ */ + CHAR_BACKSLASH: '\\', /* \ */ + CHAR_BACKTICK: '`', /* ` */ + CHAR_CARRIAGE_RETURN: '\r', /* \r */ + CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ + CHAR_COLON: ':', /* : */ + CHAR_COMMA: ',', /* , */ + CHAR_DOLLAR: '$', /* . */ + CHAR_DOT: '.', /* . */ + CHAR_DOUBLE_QUOTE: '"', /* " */ + CHAR_EQUAL: '=', /* = */ + CHAR_EXCLAMATION_MARK: '!', /* ! */ + CHAR_FORM_FEED: '\f', /* \f */ + CHAR_FORWARD_SLASH: '/', /* / */ + CHAR_HASH: '#', /* # */ + CHAR_HYPHEN_MINUS: '-', /* - */ + CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ + CHAR_LEFT_CURLY_BRACE: '{', /* { */ + CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ + CHAR_LINE_FEED: '\n', /* \n */ + CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ + CHAR_PERCENT: '%', /* % */ + CHAR_PLUS: '+', /* + */ + CHAR_QUESTION_MARK: '?', /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ + CHAR_RIGHT_CURLY_BRACE: '}', /* } */ + CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ + CHAR_SEMICOLON: ';', /* ; */ + CHAR_SINGLE_QUOTE: '\'', /* ' */ + CHAR_SPACE: ' ', /* */ + CHAR_TAB: '\t', /* \t */ + CHAR_UNDERSCORE: '_', /* _ */ + CHAR_VERTICAL_LINE: '|', /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ +}; diff --git a/node_modules/braces/lib/expand.js b/node_modules/braces/lib/expand.js new file mode 100644 index 000000000..376c748af --- /dev/null +++ b/node_modules/braces/lib/expand.js @@ -0,0 +1,113 @@ +'use strict'; + +const fill = require('fill-range'); +const stringify = require('./stringify'); +const utils = require('./utils'); + +const append = (queue = '', stash = '', enclose = false) => { + let result = []; + + queue = [].concat(queue); + stash = [].concat(stash); + + if (!stash.length) return queue; + if (!queue.length) { + return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; + } + + for (let item of queue) { + if (Array.isArray(item)) { + for (let value of item) { + result.push(append(value, stash, enclose)); + } + } else { + for (let ele of stash) { + if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; + result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele)); + } + } + } + return utils.flatten(result); +}; + +const expand = (ast, options = {}) => { + let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit; + + let walk = (node, parent = {}) => { + node.queue = []; + + let p = parent; + let q = parent.queue; + + while (p.type !== 'brace' && p.type !== 'root' && p.parent) { + p = p.parent; + q = p.queue; + } + + if (node.invalid || node.dollar) { + q.push(append(q.pop(), stringify(node, options))); + return; + } + + if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { + q.push(append(q.pop(), ['{}'])); + return; + } + + if (node.nodes && node.ranges > 0) { + let args = utils.reduce(node.nodes); + + if (utils.exceedsLimit(...args, options.step, rangeLimit)) { + throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); + } + + let range = fill(...args, options); + if (range.length === 0) { + range = stringify(node, options); + } + + q.push(append(q.pop(), range)); + node.nodes = []; + return; + } + + let enclose = utils.encloseBrace(node); + let queue = node.queue; + let block = node; + + while (block.type !== 'brace' && block.type !== 'root' && block.parent) { + block = block.parent; + queue = block.queue; + } + + for (let i = 0; i < node.nodes.length; i++) { + let child = node.nodes[i]; + + if (child.type === 'comma' && node.type === 'brace') { + if (i === 1) queue.push(''); + queue.push(''); + continue; + } + + if (child.type === 'close') { + q.push(append(q.pop(), queue, enclose)); + continue; + } + + if (child.value && child.type !== 'open') { + queue.push(append(queue.pop(), child.value)); + continue; + } + + if (child.nodes) { + walk(child, node); + } + } + + return queue; + }; + + return utils.flatten(walk(ast)); +}; + +module.exports = expand; diff --git a/node_modules/braces/lib/parse.js b/node_modules/braces/lib/parse.js new file mode 100644 index 000000000..145ea2648 --- /dev/null +++ b/node_modules/braces/lib/parse.js @@ -0,0 +1,333 @@ +'use strict'; + +const stringify = require('./stringify'); + +/** + * Constants + */ + +const { + MAX_LENGTH, + CHAR_BACKSLASH, /* \ */ + CHAR_BACKTICK, /* ` */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, /* ] */ + CHAR_DOUBLE_QUOTE, /* " */ + CHAR_SINGLE_QUOTE, /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE +} = require('./constants'); + +/** + * parse + */ + +const parse = (input, options = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + let opts = options || {}; + let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + + let ast = { type: 'root', input, nodes: [] }; + let stack = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + let length = input.length; + let index = 0; + let depth = 0; + let value; + let memo = {}; + + /** + * Helpers + */ + + const advance = () => input[index++]; + const push = node => { + if (node.type === 'text' && prev.type === 'dot') { + prev.type = 'text'; + } + + if (prev && prev.type === 'text' && node.type === 'text') { + prev.value += node.value; + return; + } + + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; + }; + + push({ type: 'bos' }); + + while (index < length) { + block = stack[stack.length - 1]; + value = advance(); + + /** + * Invalid chars + */ + + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { + continue; + } + + /** + * Escaped chars + */ + + if (value === CHAR_BACKSLASH) { + push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); + continue; + } + + /** + * Right square bracket (literal): ']' + */ + + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push({ type: 'text', value: '\\' + value }); + continue; + } + + /** + * Left square bracket: '[' + */ + + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + + let closed = true; + let next; + + while (index < length && (next = advance())) { + value += next; + + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } + + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; + + if (brackets === 0) { + break; + } + } + } + + push({ type: 'text', value }); + continue; + } + + /** + * Parentheses + */ + + if (value === CHAR_LEFT_PARENTHESES) { + block = push({ type: 'paren', nodes: [] }); + stack.push(block); + push({ type: 'text', value }); + continue; + } + + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== 'paren') { + push({ type: 'text', value }); + continue; + } + block = stack.pop(); + push({ type: 'text', value }); + block = stack[stack.length - 1]; + continue; + } + + /** + * Quotes: '|"|` + */ + + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + let open = value; + let next; + + if (options.keepQuotes !== true) { + value = ''; + } + + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); + continue; + } + + if (next === open) { + if (options.keepQuotes === true) value += next; + break; + } + + value += next; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Left curly brace: '{' + */ + + if (value === CHAR_LEFT_CURLY_BRACE) { + depth++; + + let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; + let brace = { + type: 'brace', + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; + + block = push(brace); + stack.push(block); + push({ type: 'open', value }); + continue; + } + + /** + * Right curly brace: '}' + */ + + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== 'brace') { + push({ type: 'text', value }); + continue; + } + + let type = 'close'; + block = stack.pop(); + block.close = true; + + push({ type, value }); + depth--; + + block = stack[stack.length - 1]; + continue; + } + + /** + * Comma: ',' + */ + + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + let open = block.nodes.shift(); + block.nodes = [open, { type: 'text', value: stringify(block) }]; + } + + push({ type: 'comma', value }); + block.commas++; + continue; + } + + /** + * Dot: '.' + */ + + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + let siblings = block.nodes; + + if (depth === 0 || siblings.length === 0) { + push({ type: 'text', value }); + continue; + } + + if (prev.type === 'dot') { + block.range = []; + prev.value += value; + prev.type = 'range'; + + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = 'text'; + continue; + } + + block.ranges++; + block.args = []; + continue; + } + + if (prev.type === 'range') { + siblings.pop(); + + let before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } + + push({ type: 'dot', value }); + continue; + } + + /** + * Text + */ + + push({ type: 'text', value }); + } + + // Mark imbalanced braces and brackets as invalid + do { + block = stack.pop(); + + if (block.type !== 'root') { + block.nodes.forEach(node => { + if (!node.nodes) { + if (node.type === 'open') node.isOpen = true; + if (node.type === 'close') node.isClose = true; + if (!node.nodes) node.type = 'text'; + node.invalid = true; + } + }); + + // get the location of the block on parent.nodes (block's siblings) + let parent = stack[stack.length - 1]; + let index = parent.nodes.indexOf(block); + // replace the (invalid) block with it's nodes + parent.nodes.splice(index, 1, ...block.nodes); + } + } while (stack.length > 0); + + push({ type: 'eos' }); + return ast; +}; + +module.exports = parse; diff --git a/node_modules/braces/lib/stringify.js b/node_modules/braces/lib/stringify.js new file mode 100644 index 000000000..414b7bcc6 --- /dev/null +++ b/node_modules/braces/lib/stringify.js @@ -0,0 +1,32 @@ +'use strict'; + +const utils = require('./utils'); + +module.exports = (ast, options = {}) => { + let stringify = (node, parent = {}) => { + let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); + let invalidNode = node.invalid === true && options.escapeInvalid === true; + let output = ''; + + if (node.value) { + if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { + return '\\' + node.value; + } + return node.value; + } + + if (node.value) { + return node.value; + } + + if (node.nodes) { + for (let child of node.nodes) { + output += stringify(child); + } + } + return output; + }; + + return stringify(ast); +}; + diff --git a/node_modules/braces/lib/utils.js b/node_modules/braces/lib/utils.js new file mode 100644 index 000000000..e3551a674 --- /dev/null +++ b/node_modules/braces/lib/utils.js @@ -0,0 +1,112 @@ +'use strict'; + +exports.isInteger = num => { + if (typeof num === 'number') { + return Number.isInteger(num); + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isInteger(Number(num)); + } + return false; +}; + +/** + * Find a node of the given type + */ + +exports.find = (node, type) => node.nodes.find(node => node.type === type); + +/** + * Find a node of the given type + */ + +exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return ((Number(max) - Number(min)) / Number(step)) >= limit; +}; + +/** + * Escape the given node with '\\' before node.value + */ + +exports.escapeNode = (block, n = 0, type) => { + let node = block.nodes[n]; + if (!node) return; + + if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { + if (node.escaped !== true) { + node.value = '\\' + node.value; + node.escaped = true; + } + } +}; + +/** + * Returns true if the given brace node should be enclosed in literal braces + */ + +exports.encloseBrace = node => { + if (node.type !== 'brace') return false; + if ((node.commas >> 0 + node.ranges >> 0) === 0) { + node.invalid = true; + return true; + } + return false; +}; + +/** + * Returns true if a brace node is invalid. + */ + +exports.isInvalidBrace = block => { + if (block.type !== 'brace') return false; + if (block.invalid === true || block.dollar) return true; + if ((block.commas >> 0 + block.ranges >> 0) === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; +}; + +/** + * Returns true if a node is an open or close node + */ + +exports.isOpenOrClose = node => { + if (node.type === 'open' || node.type === 'close') { + return true; + } + return node.open === true || node.close === true; +}; + +/** + * Reduce an array of text nodes. + */ + +exports.reduce = nodes => nodes.reduce((acc, node) => { + if (node.type === 'text') acc.push(node.value); + if (node.type === 'range') node.type = 'text'; + return acc; +}, []); + +/** + * Flatten an array + */ + +exports.flatten = (...args) => { + const result = []; + const flat = arr => { + for (let i = 0; i < arr.length; i++) { + let ele = arr[i]; + Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele); + } + return result; + }; + flat(args); + return result; +}; diff --git a/node_modules/braces/package.json b/node_modules/braces/package.json new file mode 100644 index 000000000..3f52e346f --- /dev/null +++ b/node_modules/braces/package.json @@ -0,0 +1,77 @@ +{ + "name": "braces", + "description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.", + "version": "3.0.2", + "homepage": "https://github.com/micromatch/braces", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Elan Shanker (https://github.com/es128)", + "Eugene Sharygin (https://github.com/eush77)", + "hemanth.hm (http://h3manth.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "micromatch/braces", + "bugs": { + "url": "https://github.com/micromatch/braces/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "lib" + ], + "main": "index.js", + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "mocha", + "benchmark": "node benchmark" + }, + "dependencies": { + "fill-range": "^7.0.1" + }, + "devDependencies": { + "ansi-colors": "^3.2.4", + "bash-path": "^2.0.1", + "gulp-format-md": "^2.0.0", + "mocha": "^6.1.1" + }, + "keywords": [ + "alpha", + "alphabetical", + "bash", + "brace", + "braces", + "expand", + "expansion", + "filepath", + "fill", + "fs", + "glob", + "globbing", + "letter", + "match", + "matches", + "matching", + "number", + "numerical", + "path", + "range", + "ranges", + "sh" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + }, + "plugins": [ + "gulp-format-md" + ] + } +} diff --git a/node_modules/callsites/index.d.ts b/node_modules/callsites/index.d.ts new file mode 100644 index 000000000..61f597cf5 --- /dev/null +++ b/node_modules/callsites/index.d.ts @@ -0,0 +1,96 @@ +declare namespace callsites { + interface CallSite { + /** + Returns the value of `this`. + */ + getThis(): unknown | undefined; + + /** + Returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property. + */ + getTypeName(): string | null; + + /** + Returns the current function. + */ + getFunction(): Function | undefined; + + /** + Returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + Returns the name of the property of `this` or one of its prototypes that holds the current function. + */ + getMethodName(): string | undefined; + + /** + Returns the name of the script if this function was defined in a script. + */ + getFileName(): string | null; + + /** + Returns the current line number if this function was defined in a script. + */ + getLineNumber(): number | null; + + /** + Returns the current column number if this function was defined in a script. + */ + getColumnNumber(): number | null; + + /** + Returns a string representing the location where `eval` was called if this function was created using a call to `eval`. + */ + getEvalOrigin(): string | undefined; + + /** + Returns `true` if this is a top-level invocation, that is, if it's a global object. + */ + isToplevel(): boolean; + + /** + Returns `true` if this call takes place in code defined by a call to `eval`. + */ + isEval(): boolean; + + /** + Returns `true` if this call is in native V8 code. + */ + isNative(): boolean; + + /** + Returns `true` if this is a constructor call. + */ + isConstructor(): boolean; + } +} + +declare const callsites: { + /** + Get callsites from the V8 stack trace API. + + @returns An array of `CallSite` objects. + + @example + ``` + import callsites = require('callsites'); + + function unicorn() { + console.log(callsites()[0].getFileName()); + //=> '/Users/sindresorhus/dev/callsites/test.js' + } + + unicorn(); + ``` + */ + (): callsites.CallSite[]; + + // TODO: Remove this for the next major release, refactor the whole definition to: + // declare function callsites(): callsites.CallSite[]; + // export = callsites; + default: typeof callsites; +}; + +export = callsites; diff --git a/node_modules/callsites/index.js b/node_modules/callsites/index.js new file mode 100644 index 000000000..486c24104 --- /dev/null +++ b/node_modules/callsites/index.js @@ -0,0 +1,13 @@ +'use strict'; + +const callsites = () => { + const _prepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = (_, stack) => stack; + const stack = new Error().stack.slice(1); + Error.prepareStackTrace = _prepareStackTrace; + return stack; +}; + +module.exports = callsites; +// TODO: Remove this for the next major release +module.exports.default = callsites; diff --git a/node_modules/callsites/license b/node_modules/callsites/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/callsites/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/callsites/package.json b/node_modules/callsites/package.json new file mode 100644 index 000000000..93463c34b --- /dev/null +++ b/node_modules/callsites/package.json @@ -0,0 +1,39 @@ +{ + "name": "callsites", + "version": "3.1.0", + "description": "Get callsites from the V8 stack trace API", + "license": "MIT", + "repository": "sindresorhus/callsites", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "stacktrace", + "v8", + "callsite", + "callsites", + "stack", + "trace", + "function", + "file", + "line", + "debug" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/callsites/readme.md b/node_modules/callsites/readme.md new file mode 100644 index 000000000..fc846138f --- /dev/null +++ b/node_modules/callsites/readme.md @@ -0,0 +1,48 @@ +# callsites [![Build Status](https://travis-ci.org/sindresorhus/callsites.svg?branch=master)](https://travis-ci.org/sindresorhus/callsites) + +> Get callsites from the [V8 stack trace API](https://v8.dev/docs/stack-trace-api) + + +## Install + +``` +$ npm install callsites +``` + + +## Usage + +```js +const callsites = require('callsites'); + +function unicorn() { + console.log(callsites()[0].getFileName()); + //=> '/Users/sindresorhus/dev/callsites/test.js' +} + +unicorn(); +``` + + +## API + +Returns an array of callsite objects with the following methods: + +- `getThis`: returns the value of `this`. +- `getTypeName`: returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property. +- `getFunction`: returns the current function. +- `getFunctionName`: returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context. +- `getMethodName`: returns the name of the property of `this` or one of its prototypes that holds the current function. +- `getFileName`: if this function was defined in a script returns the name of the script. +- `getLineNumber`: if this function was defined in a script returns the current line number. +- `getColumnNumber`: if this function was defined in a script returns the current column number +- `getEvalOrigin`: if this function was created using a call to `eval` returns a string representing the location where `eval` was called. +- `isToplevel`: is this a top-level invocation, that is, is this the global object? +- `isEval`: does this call take place in code defined by a call to `eval`? +- `isNative`: is this call in native V8 code? +- `isConstructor`: is this a constructor call? + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/camelcase-keys/index.d.ts b/node_modules/camelcase-keys/index.d.ts new file mode 100644 index 000000000..b26c88c10 --- /dev/null +++ b/node_modules/camelcase-keys/index.d.ts @@ -0,0 +1,192 @@ +import {CamelCase, PascalCase} from 'type-fest'; + +// eslint-disable-next-line @typescript-eslint/ban-types +type EmptyTuple = []; + +/** +Return a default type if input type is nil. + +@template T - Input type. +@template U - Default type. +*/ +type WithDefault = T extends undefined | void | null ? U : T; + +/** +Check if an element is included in a tuple. + +TODO: Remove this once https://github.com/sindresorhus/type-fest/pull/217 is merged. +*/ +type IsInclude = List extends undefined + ? false + : List extends Readonly + ? false + : List extends readonly [infer First, ...infer Rest] + ? First extends Target + ? true + : IsInclude + : boolean; + +/** +Append a segment to dot-notation path. +*/ +type AppendPath = S extends '' + ? Last + : `${S}.${Last}`; + +/** +Convert keys of an object to camelcase strings. +*/ +type CamelCaseKeys< + T extends Record | readonly any[], + Deep extends boolean, + IsPascalCase extends boolean, + Exclude extends readonly unknown[], + StopPaths extends readonly string[], + Path extends string = '' +> = T extends readonly any[] + // Handle arrays or tuples. + ? { + [P in keyof T]: CamelCaseKeys< + T[P], + Deep, + IsPascalCase, + Exclude, + StopPaths + >; + } + : T extends Record + // Handle objects. + ? { + [P in keyof T & string as [IsInclude] extends [true] + ? P + : [IsPascalCase] extends [true] + ? PascalCase

+ : CamelCase

]: [IsInclude>] extends [ + true + ] + ? T[P] + : [Deep] extends [true] + ? CamelCaseKeys< + T[P], + Deep, + IsPascalCase, + Exclude, + StopPaths, + AppendPath + > + : T[P]; + } + // Return anything else as-is. + : T; + +declare namespace camelcaseKeys { + interface Options { + /** + Recurse nested objects and objects in arrays. + + @default false + */ + readonly deep?: boolean; + + /** + Exclude keys from being camel-cased. + + If this option can be statically determined, it's recommended to add `as const` to it. + + @default [] + */ + readonly exclude?: ReadonlyArray; + + /** + Exclude children at the given object paths in dot-notation from being camel-cased. For example, with an object like `{a: {b: '🦄'}}`, the object path to reach the unicorn is `'a.b'`. + + If this option can be statically determined, it's recommended to add `as const` to it. + + @default [] + + @example + ``` + camelcaseKeys({ + a_b: 1, + a_c: { + c_d: 1, + c_e: { + e_f: 1 + } + } + }, { + deep: true, + stopPaths: [ + 'a_c.c_e' + ] + }), + // { + // aB: 1, + // aC: { + // cD: 1, + // cE: { + // e_f: 1 + // } + // } + // } + ``` + */ + readonly stopPaths?: readonly string[]; + + /** + Uppercase the first character as in `bye-bye` → `ByeBye`. + + @default false + */ + readonly pascalCase?: boolean; + } +} + +/** +Convert object keys to camel case using [`camelcase`](https://github.com/sindresorhus/camelcase). + +@param input - Object or array of objects to camel-case. + +@example +``` +import camelcaseKeys = require('camelcase-keys'); + +// Convert an object +camelcaseKeys({'foo-bar': true}); +//=> {fooBar: true} + +// Convert an array of objects +camelcaseKeys([{'foo-bar': true}, {'bar-foo': false}]); +//=> [{fooBar: true}, {barFoo: false}] + +camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true}); +//=> {fooBar: true, nested: {unicornRainbow: true}} + +// Convert object keys to pascal case +camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true, pascalCase: true}); +//=> {FooBar: true, Nested: {UnicornRainbow: true}} + +import minimist = require('minimist'); + +const argv = minimist(process.argv.slice(2)); +//=> {_: [], 'foo-bar': true} + +camelcaseKeys(argv); +//=> {_: [], fooBar: true} +``` +*/ +declare function camelcaseKeys< + T extends Record | readonly any[], + Options extends camelcaseKeys.Options = camelcaseKeys.Options +>( + input: T, + options?: Options +): CamelCaseKeys< +T, +WithDefault, +WithDefault, +WithDefault, +WithDefault +>; + +export = camelcaseKeys; diff --git a/node_modules/camelcase-keys/index.js b/node_modules/camelcase-keys/index.js new file mode 100644 index 000000000..9f4e261c0 --- /dev/null +++ b/node_modules/camelcase-keys/index.js @@ -0,0 +1,77 @@ +'use strict'; +const mapObj = require('map-obj'); +const camelCase = require('camelcase'); +const QuickLru = require('quick-lru'); + +const has = (array, key) => array.some(x => { + if (typeof x === 'string') { + return x === key; + } + + x.lastIndex = 0; + return x.test(key); +}); + +const cache = new QuickLru({maxSize: 100000}); + +// Reproduces behavior from `map-obj` +const isObject = value => + typeof value === 'object' && + value !== null && + !(value instanceof RegExp) && + !(value instanceof Error) && + !(value instanceof Date); + +const camelCaseConvert = (input, options) => { + if (!isObject(input)) { + return input; + } + + options = { + deep: false, + pascalCase: false, + ...options + }; + + const {exclude, pascalCase, stopPaths, deep} = options; + + const stopPathsSet = new Set(stopPaths); + + const makeMapper = parentPath => (key, value) => { + if (deep && isObject(value)) { + const path = parentPath === undefined ? key : `${parentPath}.${key}`; + + if (!stopPathsSet.has(path)) { + value = mapObj(value, makeMapper(path)); + } + } + + if (!(exclude && has(exclude, key))) { + const cacheKey = pascalCase ? `${key}_` : key; + + if (cache.has(cacheKey)) { + key = cache.get(cacheKey); + } else { + const returnValue = camelCase(key, {pascalCase, locale: false}); + + if (key.length < 100) { // Prevent abuse + cache.set(cacheKey, returnValue); + } + + key = returnValue; + } + } + + return [key, value]; + }; + + return mapObj(input, makeMapper(undefined)); +}; + +module.exports = (input, options) => { + if (Array.isArray(input)) { + return Object.keys(input).map(key => camelCaseConvert(input[key], options)); + } + + return camelCaseConvert(input, options); +}; diff --git a/node_modules/camelcase-keys/license b/node_modules/camelcase-keys/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/camelcase-keys/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/camelcase-keys/package.json b/node_modules/camelcase-keys/package.json new file mode 100644 index 000000000..888a13818 --- /dev/null +++ b/node_modules/camelcase-keys/package.json @@ -0,0 +1,75 @@ +{ + "name": "camelcase-keys", + "version": "7.0.2", + "description": "Convert object keys to camel case", + "license": "MIT", + "repository": "sindresorhus/camelcase-keys", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd", + "bench": "matcha bench/bench.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "map", + "obj", + "object", + "key", + "keys", + "value", + "values", + "val", + "iterate", + "camelcase", + "camel-case", + "camel", + "case", + "dash", + "hyphen", + "dot", + "underscore", + "separator", + "string", + "text", + "convert", + "pascalcase", + "pascal-case", + "deep", + "recurse", + "recursive" + ], + "dependencies": { + "camelcase": "^6.3.0", + "map-obj": "^4.1.0", + "quick-lru": "^5.1.1", + "type-fest": "^1.2.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "matcha": "^0.7.0", + "tsd": "^0.17.0", + "typescript": "^4.3.5", + "xo": "^0.36.1" + }, + "xo": { + "overrides": [ + { + "files": "bench/bench.js", + "rules": { + "import/no-unresolved": "off" + } + } + ] + } +} diff --git a/node_modules/camelcase-keys/readme.md b/node_modules/camelcase-keys/readme.md new file mode 100644 index 000000000..7874e55a4 --- /dev/null +++ b/node_modules/camelcase-keys/readme.md @@ -0,0 +1,125 @@ +# camelcase-keys + +> Convert object keys to camel case using [`camelcase`](https://github.com/sindresorhus/camelcase) + +## Install + +``` +$ npm install camelcase-keys +``` + +## Usage + +```js +const camelcaseKeys = require('camelcase-keys'); + +// Convert an object +camelcaseKeys({'foo-bar': true}); +//=> {fooBar: true} + +// Convert an array of objects +camelcaseKeys([{'foo-bar': true}, {'bar-foo': false}]); +//=> [{fooBar: true}, {barFoo: false}] + +camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true}); +//=> {fooBar: true, nested: {unicornRainbow: true}} + +camelcaseKeys({a_b: 1, a_c: {c_d: 1, c_e: {e_f: 1}}}, {deep: true, stopPaths: ['a_c.c_e']}), +//=> {aB: 1, aC: {cD: 1, cE: {e_f: 1}}} + +// Convert object keys to pascal case +camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true, pascalCase: true}); +//=> {FooBar: true, Nested: {UnicornRainbow: true}} +``` + +```js +const camelcaseKeys = require('camelcase-keys'); + +const argv = require('minimist')(process.argv.slice(2)); +//=> {_: [], 'foo-bar': true} + +camelcaseKeys(argv); +//=> {_: [], fooBar: true} +``` + +## API + +### camelcaseKeys(input, options?) + +#### input + +Type: `object | object[]` + +An object or array of objects to camel-case. + +#### options + +Type: `object` + +##### exclude + +Type: `Array`\ +Default: `[]` + +Exclude keys from being camel-cased. + +##### stopPaths + +Type: `string[]`\ +Default: `[]` + +Exclude children at the given object paths in dot-notation from being camel-cased. For example, with an object like `{a: {b: '🦄'}}`, the object path to reach the unicorn is `'a.b'`. + +```js +camelcaseKeys({ + a_b: 1, + a_c: { + c_d: 1, + c_e: { + e_f: 1 + } + } +}, { + deep: true, + stopPaths: [ + 'a_c.c_e' + ] +}), +/* +{ + aB: 1, + aC: { + cD: 1, + cE: { + e_f: 1 + } + } +} +*/ +``` + +##### deep + +Type: `boolean`\ +Default: `false` + +Recurse nested objects and objects in arrays. + +##### pascalCase + +Type: `boolean`\ +Default: `false` + +Uppercase the first character as in `bye-bye` → `ByeBye`. + +## camelcase-keys for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of camelcase-keys and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-camelcase-keys?utm_source=npm-camelcase-keys&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Related + +- [snakecase-keys](https://github.com/bendrucker/snakecase-keys) +- [kebabcase-keys](https://github.com/mattiloh/kebabcase-keys) + diff --git a/node_modules/camelcase/index.d.ts b/node_modules/camelcase/index.d.ts new file mode 100644 index 000000000..9db94e53c --- /dev/null +++ b/node_modules/camelcase/index.d.ts @@ -0,0 +1,103 @@ +declare namespace camelcase { + interface Options { + /** + Uppercase the first character: `foo-bar` → `FooBar`. + + @default false + */ + readonly pascalCase?: boolean; + + /** + Preserve the consecutive uppercase characters: `foo-BAR` → `FooBAR`. + + @default false + */ + readonly preserveConsecutiveUppercase?: boolean; + + /** + The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used. + + Setting `locale: false` ignores the platform locale and uses the [Unicode Default Case Conversion](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#simple-single-character-case-mapping) algorithm. + + Default: The host environment’s current locale. + + @example + ``` + import camelCase = require('camelcase'); + + camelCase('lorem-ipsum', {locale: 'en-US'}); + //=> 'loremIpsum' + camelCase('lorem-ipsum', {locale: 'tr-TR'}); + //=> 'loremİpsum' + camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']}); + //=> 'loremIpsum' + camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']}); + //=> 'loremİpsum' + ``` + */ + readonly locale?: false | string | readonly string[]; + } +} + +/** +Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`. + +Correctly handles Unicode strings. + +@param input - String to convert to camel case. + +@example +``` +import camelCase = require('camelcase'); + +camelCase('foo-bar'); +//=> 'fooBar' + +camelCase('foo_bar'); +//=> 'fooBar' + +camelCase('Foo-Bar'); +//=> 'fooBar' + +camelCase('розовый_пушистый_единорог'); +//=> 'розовыйПушистыйЕдинорог' + +camelCase('Foo-Bar', {pascalCase: true}); +//=> 'FooBar' + +camelCase('--foo.bar', {pascalCase: false}); +//=> 'fooBar' + +camelCase('Foo-BAR', {preserveConsecutiveUppercase: true}); +//=> 'fooBAR' + +camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true})); +//=> 'FooBAR' + +camelCase('foo bar'); +//=> 'fooBar' + +console.log(process.argv[3]); +//=> '--foo-bar' +camelCase(process.argv[3]); +//=> 'fooBar' + +camelCase(['foo', 'bar']); +//=> 'fooBar' + +camelCase(['__foo__', '--bar'], {pascalCase: true}); +//=> 'FooBar' + +camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true}) +//=> 'FooBAR' + +camelCase('lorem-ipsum', {locale: 'en-US'}); +//=> 'loremIpsum' +``` +*/ +declare function camelcase( + input: string | readonly string[], + options?: camelcase.Options +): string; + +export = camelcase; diff --git a/node_modules/camelcase/index.js b/node_modules/camelcase/index.js new file mode 100644 index 000000000..6ff4ee85c --- /dev/null +++ b/node_modules/camelcase/index.js @@ -0,0 +1,113 @@ +'use strict'; + +const UPPERCASE = /[\p{Lu}]/u; +const LOWERCASE = /[\p{Ll}]/u; +const LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu; +const IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u; +const SEPARATORS = /[_.\- ]+/; + +const LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source); +const SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu'); +const NUMBERS_AND_IDENTIFIER = new RegExp('\\d+' + IDENTIFIER.source, 'gu'); + +const preserveCamelCase = (string, toLowerCase, toUpperCase) => { + let isLastCharLower = false; + let isLastCharUpper = false; + let isLastLastCharUpper = false; + + for (let i = 0; i < string.length; i++) { + const character = string[i]; + + if (isLastCharLower && UPPERCASE.test(character)) { + string = string.slice(0, i) + '-' + string.slice(i); + isLastCharLower = false; + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = true; + i++; + } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) { + string = string.slice(0, i - 1) + '-' + string.slice(i - 1); + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = false; + isLastCharLower = true; + } else { + isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character; + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character; + } + } + + return string; +}; + +const preserveConsecutiveUppercase = (input, toLowerCase) => { + LEADING_CAPITAL.lastIndex = 0; + + return input.replace(LEADING_CAPITAL, m1 => toLowerCase(m1)); +}; + +const postProcess = (input, toUpperCase) => { + SEPARATORS_AND_IDENTIFIER.lastIndex = 0; + NUMBERS_AND_IDENTIFIER.lastIndex = 0; + + return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)) + .replace(NUMBERS_AND_IDENTIFIER, m => toUpperCase(m)); +}; + +const camelCase = (input, options) => { + if (!(typeof input === 'string' || Array.isArray(input))) { + throw new TypeError('Expected the input to be `string | string[]`'); + } + + options = { + pascalCase: false, + preserveConsecutiveUppercase: false, + ...options + }; + + if (Array.isArray(input)) { + input = input.map(x => x.trim()) + .filter(x => x.length) + .join('-'); + } else { + input = input.trim(); + } + + if (input.length === 0) { + return ''; + } + + const toLowerCase = options.locale === false ? + string => string.toLowerCase() : + string => string.toLocaleLowerCase(options.locale); + const toUpperCase = options.locale === false ? + string => string.toUpperCase() : + string => string.toLocaleUpperCase(options.locale); + + if (input.length === 1) { + return options.pascalCase ? toUpperCase(input) : toLowerCase(input); + } + + const hasUpperCase = input !== toLowerCase(input); + + if (hasUpperCase) { + input = preserveCamelCase(input, toLowerCase, toUpperCase); + } + + input = input.replace(LEADING_SEPARATORS, ''); + + if (options.preserveConsecutiveUppercase) { + input = preserveConsecutiveUppercase(input, toLowerCase); + } else { + input = toLowerCase(input); + } + + if (options.pascalCase) { + input = toUpperCase(input.charAt(0)) + input.slice(1); + } + + return postProcess(input, toUpperCase); +}; + +module.exports = camelCase; +// TODO: Remove this for the next major release +module.exports.default = camelCase; diff --git a/node_modules/camelcase/license b/node_modules/camelcase/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/camelcase/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/camelcase/package.json b/node_modules/camelcase/package.json new file mode 100644 index 000000000..c43357925 --- /dev/null +++ b/node_modules/camelcase/package.json @@ -0,0 +1,44 @@ +{ + "name": "camelcase", + "version": "6.3.0", + "description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`", + "license": "MIT", + "repository": "sindresorhus/camelcase", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "camelcase", + "camel-case", + "camel", + "case", + "dash", + "hyphen", + "dot", + "underscore", + "separator", + "string", + "text", + "convert", + "pascalcase", + "pascal-case" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.11.0", + "xo": "^0.28.3" + } +} diff --git a/node_modules/camelcase/readme.md b/node_modules/camelcase/readme.md new file mode 100644 index 000000000..0ff8f9e18 --- /dev/null +++ b/node_modules/camelcase/readme.md @@ -0,0 +1,144 @@ +# camelcase + +> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar` + +Correctly handles Unicode strings. + +If you use this on untrusted user input, don't forget to limit the length to something reasonable. + +## Install + +``` +$ npm install camelcase +``` + +*If you need to support Firefox < 78, stay on version 5 as version 6 uses regex features not available in Firefox < 78.* + +## Usage + +```js +const camelCase = require('camelcase'); + +camelCase('foo-bar'); +//=> 'fooBar' + +camelCase('foo_bar'); +//=> 'fooBar' + +camelCase('Foo-Bar'); +//=> 'fooBar' + +camelCase('розовый_пушистый_единорог'); +//=> 'розовыйПушистыйЕдинорог' + +camelCase('Foo-Bar', {pascalCase: true}); +//=> 'FooBar' + +camelCase('--foo.bar', {pascalCase: false}); +//=> 'fooBar' + +camelCase('Foo-BAR', {preserveConsecutiveUppercase: true}); +//=> 'fooBAR' + +camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true})); +//=> 'FooBAR' + +camelCase('foo bar'); +//=> 'fooBar' + +console.log(process.argv[3]); +//=> '--foo-bar' +camelCase(process.argv[3]); +//=> 'fooBar' + +camelCase(['foo', 'bar']); +//=> 'fooBar' + +camelCase(['__foo__', '--bar'], {pascalCase: true}); +//=> 'FooBar' + +camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true}) +//=> 'FooBAR' + +camelCase('lorem-ipsum', {locale: 'en-US'}); +//=> 'loremIpsum' +``` + +## API + +### camelCase(input, options?) + +#### input + +Type: `string | string[]` + +String to convert to camel case. + +#### options + +Type: `object` + +##### pascalCase + +Type: `boolean`\ +Default: `false` + +Uppercase the first character: `foo-bar` → `FooBar` + +##### preserveConsecutiveUppercase + +Type: `boolean`\ +Default: `false` + +Preserve the consecutive uppercase characters: `foo-BAR` → `FooBAR`. + +##### locale + +Type: `false | string | string[]`\ +Default: The host environment’s current locale. + +The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used. + +```js +const camelCase = require('camelcase'); + +camelCase('lorem-ipsum', {locale: 'en-US'}); +//=> 'loremIpsum' + +camelCase('lorem-ipsum', {locale: 'tr-TR'}); +//=> 'loremİpsum' + +camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']}); +//=> 'loremIpsum' + +camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']}); +//=> 'loremİpsum' +``` + +Setting `locale: false` ignores the platform locale and uses the [Unicode Default Case Conversion](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#simple-single-character-case-mapping) algorithm: + +```js +const camelCase = require('camelcase'); + +// On a platform with 'tr-TR' + +camelCase('lorem-ipsum'); +//=> 'loremİpsum' + +camelCase('lorem-ipsum', {locale: false}); +//=> 'loremIpsum' +``` + +## camelcase for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of camelcase and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Related + +- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module +- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase +- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string +- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one +- [camelcase-keys](https://github.com/sindresorhus/camelcase-keys) - Convert object keys to camel case diff --git a/node_modules/chalk/index.js b/node_modules/chalk/index.js new file mode 100644 index 000000000..1cc5fa89a --- /dev/null +++ b/node_modules/chalk/index.js @@ -0,0 +1,228 @@ +'use strict'; +const escapeStringRegexp = require('escape-string-regexp'); +const ansiStyles = require('ansi-styles'); +const stdoutColor = require('supports-color').stdout; + +const template = require('./templates.js'); + +const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); + +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; + +// `color-convert` models to exclude from the Chalk API due to conflicts and such +const skipModels = new Set(['gray']); + +const styles = Object.create(null); + +function applyOptions(obj, options) { + options = options || {}; + + // Detect level if not set manually + const scLevel = stdoutColor ? stdoutColor.level : 0; + obj.level = options.level === undefined ? scLevel : options.level; + obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; +} + +function Chalk(options) { + // We check for this.template here since calling `chalk.constructor()` + // by itself will have a `this` of a previously constructed chalk object + if (!this || !(this instanceof Chalk) || this.template) { + const chalk = {}; + applyOptions(chalk, options); + + chalk.template = function () { + const args = [].slice.call(arguments); + return chalkTag.apply(null, [chalk.template].concat(args)); + }; + + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); + + chalk.template.constructor = Chalk; + + return chalk.template; + } + + applyOptions(this, options); +} + +// Use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001B[94m'; +} + +for (const key of Object.keys(ansiStyles)) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + styles[key] = { + get() { + const codes = ansiStyles[key]; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); + } + }; +} + +styles.visible = { + get() { + return build.call(this, this._styles || [], true, 'visible'); + } +}; + +ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); +for (const model of Object.keys(ansiStyles.color.ansi)) { + if (skipModels.has(model)) { + continue; + } + + styles[model] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.color.close, + closeRe: ansiStyles.color.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; + } + }; +} + +ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); +for (const model of Object.keys(ansiStyles.bgColor.ansi)) { + if (skipModels.has(model)) { + continue; + } + + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.bgColor.close, + closeRe: ansiStyles.bgColor.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; + } + }; +} + +const proto = Object.defineProperties(() => {}, styles); + +function build(_styles, _empty, key) { + const builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder._empty = _empty; + + const self = this; + + Object.defineProperty(builder, 'level', { + enumerable: true, + get() { + return self.level; + }, + set(level) { + self.level = level; + } + }); + + Object.defineProperty(builder, 'enabled', { + enumerable: true, + get() { + return self.enabled; + }, + set(enabled) { + self.enabled = enabled; + } + }); + + // See below for fix regarding invisible grey/dim combination on Windows + builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; + + // `__proto__` is used because we must return a function, but there is + // no way to create a function with a different prototype + builder.__proto__ = proto; // eslint-disable-line no-proto + + return builder; +} + +function applyStyle() { + // Support varags, but simply cast to string in case there's only one arg + const args = arguments; + const argsLen = args.length; + let str = String(arguments[0]); + + if (argsLen === 0) { + return ''; + } + + if (argsLen > 1) { + // Don't slice `arguments`, it prevents V8 optimizations + for (let a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || this.level <= 0 || !str) { + return this._empty ? '' : str; + } + + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + const originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && this.hasGrey) { + ansiStyles.dim.open = ''; + } + + for (const code of this._styles.slice().reverse()) { + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + + // Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS + // https://github.com/chalk/chalk/pull/92 + str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); + } + + // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue + ansiStyles.dim.open = originalDim; + + return str; +} + +function chalkTag(chalk, strings) { + if (!Array.isArray(strings)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return [].slice.call(arguments, 1).join(' '); + } + + const args = [].slice.call(arguments, 2); + const parts = [strings.raw[0]]; + + for (let i = 1; i < strings.length; i++) { + parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); + parts.push(String(strings.raw[i])); + } + + return template(chalk, parts.join('')); +} + +Object.defineProperties(Chalk.prototype, styles); + +module.exports = Chalk(); // eslint-disable-line new-cap +module.exports.supportsColor = stdoutColor; +module.exports.default = module.exports; // For TypeScript diff --git a/node_modules/chalk/index.js.flow b/node_modules/chalk/index.js.flow new file mode 100644 index 000000000..622caaa2e --- /dev/null +++ b/node_modules/chalk/index.js.flow @@ -0,0 +1,93 @@ +// @flow strict + +type TemplateStringsArray = $ReadOnlyArray; + +export type Level = $Values<{ + None: 0, + Basic: 1, + Ansi256: 2, + TrueColor: 3 +}>; + +export type ChalkOptions = {| + enabled?: boolean, + level?: Level +|}; + +export type ColorSupport = {| + level: Level, + hasBasic: boolean, + has256: boolean, + has16m: boolean +|}; + +export interface Chalk { + (...text: string[]): string, + (text: TemplateStringsArray, ...placeholders: string[]): string, + constructor(options?: ChalkOptions): Chalk, + enabled: boolean, + level: Level, + rgb(r: number, g: number, b: number): Chalk, + hsl(h: number, s: number, l: number): Chalk, + hsv(h: number, s: number, v: number): Chalk, + hwb(h: number, w: number, b: number): Chalk, + bgHex(color: string): Chalk, + bgKeyword(color: string): Chalk, + bgRgb(r: number, g: number, b: number): Chalk, + bgHsl(h: number, s: number, l: number): Chalk, + bgHsv(h: number, s: number, v: number): Chalk, + bgHwb(h: number, w: number, b: number): Chalk, + hex(color: string): Chalk, + keyword(color: string): Chalk, + + +reset: Chalk, + +bold: Chalk, + +dim: Chalk, + +italic: Chalk, + +underline: Chalk, + +inverse: Chalk, + +hidden: Chalk, + +strikethrough: Chalk, + + +visible: Chalk, + + +black: Chalk, + +red: Chalk, + +green: Chalk, + +yellow: Chalk, + +blue: Chalk, + +magenta: Chalk, + +cyan: Chalk, + +white: Chalk, + +gray: Chalk, + +grey: Chalk, + +blackBright: Chalk, + +redBright: Chalk, + +greenBright: Chalk, + +yellowBright: Chalk, + +blueBright: Chalk, + +magentaBright: Chalk, + +cyanBright: Chalk, + +whiteBright: Chalk, + + +bgBlack: Chalk, + +bgRed: Chalk, + +bgGreen: Chalk, + +bgYellow: Chalk, + +bgBlue: Chalk, + +bgMagenta: Chalk, + +bgCyan: Chalk, + +bgWhite: Chalk, + +bgBlackBright: Chalk, + +bgRedBright: Chalk, + +bgGreenBright: Chalk, + +bgYellowBright: Chalk, + +bgBlueBright: Chalk, + +bgMagentaBright: Chalk, + +bgCyanBright: Chalk, + +bgWhiteBrigh: Chalk, + + supportsColor: ColorSupport +}; + +declare module.exports: Chalk; diff --git a/node_modules/chalk/license b/node_modules/chalk/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/chalk/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json new file mode 100644 index 000000000..bc324685a --- /dev/null +++ b/node_modules/chalk/package.json @@ -0,0 +1,71 @@ +{ + "name": "chalk", + "version": "2.4.2", + "description": "Terminal string styling done right", + "license": "MIT", + "repository": "chalk/chalk", + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava", + "bench": "matcha benchmark.js", + "coveralls": "nyc report --reporter=text-lcov | coveralls" + }, + "files": [ + "index.js", + "templates.js", + "types/index.d.ts", + "index.js.flow" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "devDependencies": { + "ava": "*", + "coveralls": "^3.0.0", + "execa": "^0.9.0", + "flow-bin": "^0.68.0", + "import-fresh": "^2.0.0", + "matcha": "^0.7.0", + "nyc": "^11.0.2", + "resolve-from": "^4.0.0", + "typescript": "^2.5.3", + "xo": "*" + }, + "types": "types/index.d.ts", + "xo": { + "envs": [ + "node", + "mocha" + ], + "ignores": [ + "test/_flow.js" + ] + } +} diff --git a/node_modules/chalk/readme.md b/node_modules/chalk/readme.md new file mode 100644 index 000000000..d298e2c48 --- /dev/null +++ b/node_modules/chalk/readme.md @@ -0,0 +1,314 @@ +

+
+
+ Chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs) + +### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0) + + + + +## Highlights + +- Expressive API +- Highly performant +- Ability to nest styles +- [256/Truecolor color support](#256-and-truecolor-color-support) +- Auto-detects color support +- Doesn't extend `String.prototype` +- Clean and focused +- Actively maintained +- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017 + + +## Install + +```console +$ npm install chalk +``` + +
+ + + + +## Usage + +```js +const chalk = require('chalk'); + +console.log(chalk.blue('Hello world!')); +``` + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +const chalk = require('chalk'); +const log = console.log; + +// Combine styled and normal strings +log(chalk.blue('Hello') + ' World' + chalk.red('!')); + +// Compose multiple styles using the chainable API +log(chalk.blue.bgRed.bold('Hello world!')); + +// Pass in multiple arguments +log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); + +// Nest styles +log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); + +// Nest styles of the same type even (color, underline, background) +log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +// ES2015 template literal +log(` +CPU: ${chalk.red('90%')} +RAM: ${chalk.green('40%')} +DISK: ${chalk.yellow('70%')} +`); + +// ES2015 tagged template literal +log(chalk` +CPU: {red ${cpu.totalPercent}%} +RAM: {green ${ram.used / ram.total * 100}%} +DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} +`); + +// Use RGB colors in terminal emulators that support it. +log(chalk.keyword('orange')('Yay for orange colored text!')); +log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); +log(chalk.hex('#DEADED').bold('Bold gray!')); +``` + +Easily define your own themes: + +```js +const chalk = require('chalk'); + +const error = chalk.bold.red; +const warning = chalk.keyword('orange'); + +console.log(error('Error!')); +console.log(warning('Warning!')); +``` + +Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): + +```js +const name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> 'Hello Sindre' +``` + + +## API + +### chalk.`' + * ) + * document.type //=> 'document' + * document.nodes.length //=> 2 + * ``` + */ +declare class Document_ extends Container { + parent: undefined + type: 'document' + + constructor(defaults?: Document.DocumentProps) + + /** + * Returns a `Result` instance representing the document’s CSS roots. + * + * ```js + * const root1 = postcss.parse(css1, { from: 'a.css' }) + * const root2 = postcss.parse(css2, { from: 'b.css' }) + * const document = postcss.document() + * document.append(root1) + * document.append(root2) + * const result = document.toResult({ to: 'all.css', map: true }) + * ``` + * + * @param opts Options. + * @return Result with current document’s CSS. + */ + toResult(options?: ProcessOptions): Result +} + +declare class Document extends Document_ {} + +export = Document diff --git a/node_modules/postcss/lib/document.js b/node_modules/postcss/lib/document.js new file mode 100644 index 000000000..44689917f --- /dev/null +++ b/node_modules/postcss/lib/document.js @@ -0,0 +1,33 @@ +'use strict' + +let Container = require('./container') + +let LazyResult, Processor + +class Document extends Container { + constructor(defaults) { + // type needs to be passed to super, otherwise child roots won't be normalized correctly + super({ type: 'document', ...defaults }) + + if (!this.nodes) { + this.nodes = [] + } + } + + toResult(opts = {}) { + let lazy = new LazyResult(new Processor(), this, opts) + + return lazy.stringify() + } +} + +Document.registerLazyResult = dependant => { + LazyResult = dependant +} + +Document.registerProcessor = dependant => { + Processor = dependant +} + +module.exports = Document +Document.default = Document diff --git a/node_modules/postcss/lib/fromJSON.d.ts b/node_modules/postcss/lib/fromJSON.d.ts new file mode 100644 index 000000000..e1deedbd3 --- /dev/null +++ b/node_modules/postcss/lib/fromJSON.d.ts @@ -0,0 +1,9 @@ +import { JSONHydrator } from './postcss.js' + +interface FromJSON extends JSONHydrator { + default: FromJSON +} + +declare const fromJSON: FromJSON + +export = fromJSON diff --git a/node_modules/postcss/lib/fromJSON.js b/node_modules/postcss/lib/fromJSON.js new file mode 100644 index 000000000..09f2b89aa --- /dev/null +++ b/node_modules/postcss/lib/fromJSON.js @@ -0,0 +1,54 @@ +'use strict' + +let Declaration = require('./declaration') +let PreviousMap = require('./previous-map') +let Comment = require('./comment') +let AtRule = require('./at-rule') +let Input = require('./input') +let Root = require('./root') +let Rule = require('./rule') + +function fromJSON(json, inputs) { + if (Array.isArray(json)) return json.map(n => fromJSON(n)) + + let { inputs: ownInputs, ...defaults } = json + if (ownInputs) { + inputs = [] + for (let input of ownInputs) { + let inputHydrated = { ...input, __proto__: Input.prototype } + if (inputHydrated.map) { + inputHydrated.map = { + ...inputHydrated.map, + __proto__: PreviousMap.prototype + } + } + inputs.push(inputHydrated) + } + } + if (defaults.nodes) { + defaults.nodes = json.nodes.map(n => fromJSON(n, inputs)) + } + if (defaults.source) { + let { inputId, ...source } = defaults.source + defaults.source = source + if (inputId != null) { + defaults.source.input = inputs[inputId] + } + } + if (defaults.type === 'root') { + return new Root(defaults) + } else if (defaults.type === 'decl') { + return new Declaration(defaults) + } else if (defaults.type === 'rule') { + return new Rule(defaults) + } else if (defaults.type === 'comment') { + return new Comment(defaults) + } else if (defaults.type === 'atrule') { + return new AtRule(defaults) + } else { + throw new Error('Unknown node type: ' + json.type) + } +} + +module.exports = fromJSON +fromJSON.default = fromJSON diff --git a/node_modules/postcss/lib/input.d.ts b/node_modules/postcss/lib/input.d.ts new file mode 100644 index 000000000..6143a9b27 --- /dev/null +++ b/node_modules/postcss/lib/input.d.ts @@ -0,0 +1,194 @@ +import { CssSyntaxError, ProcessOptions } from './postcss.js' +import PreviousMap from './previous-map.js' + +declare namespace Input { + export interface FilePosition { + /** + * Column of inclusive start position in source file. + */ + column: number + + /** + * Column of exclusive end position in source file. + */ + endColumn?: number + + /** + * Line of exclusive end position in source file. + */ + endLine?: number + + /** + * Absolute path to the source file. + */ + file?: string + + /** + * Line of inclusive start position in source file. + */ + line: number + + /** + * Source code. + */ + source?: string + + /** + * URL for the source file. + */ + url: string + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Input_ as default } +} + +/** + * Represents the source CSS. + * + * ```js + * const root = postcss.parse(css, { from: file }) + * const input = root.source.input + * ``` + */ +declare class Input_ { + /** + * Input CSS source. + * + * ```js + * const input = postcss.parse('a{}', { from: file }).input + * input.css //=> "a{}" + * ``` + */ + css: string + + /** + * The absolute path to the CSS source file defined + * with the `from` option. + * + * ```js + * const root = postcss.parse(css, { from: 'a.css' }) + * root.source.input.file //=> '/home/ai/a.css' + * ``` + */ + file?: string + + /** + * The flag to indicate whether or not the source code has Unicode BOM. + */ + hasBOM: boolean + + /** + * The unique ID of the CSS source. It will be created if `from` option + * is not provided (because PostCSS does not know the file path). + * + * ```js + * const root = postcss.parse(css) + * root.source.input.file //=> undefined + * root.source.input.id //=> "" + * ``` + */ + id?: string + + /** + * The input source map passed from a compilation step before PostCSS + * (for example, from Sass compiler). + * + * ```js + * root.source.input.map.consumer().sources //=> ['a.sass'] + * ``` + */ + map: PreviousMap + + /** + * @param css Input CSS source. + * @param opts Process options. + */ + constructor(css: string, opts?: ProcessOptions) + + error( + message: string, + start: + | { + column: number + line: number + } + | { + offset: number + }, + end: + | { + column: number + line: number + } + | { + offset: number + }, + opts?: { plugin?: CssSyntaxError['plugin'] } + ): CssSyntaxError + + /** + * Returns `CssSyntaxError` with information about the error and its position. + */ + error( + message: string, + line: number, + column: number, + opts?: { plugin?: CssSyntaxError['plugin'] } + ): CssSyntaxError + + error( + message: string, + offset: number, + opts?: { plugin?: CssSyntaxError['plugin'] } + ): CssSyntaxError + + /** + * The CSS source identifier. Contains `Input#file` if the user + * set the `from` option, or `Input#id` if they did not. + * + * ```js + * const root = postcss.parse(css, { from: 'a.css' }) + * root.source.input.from //=> "/home/ai/a.css" + * + * const root = postcss.parse(css) + * root.source.input.from //=> "" + * ``` + */ + get from(): string + /** + * Converts source offset to line and column. + * + * @param offset Source offset. + */ + fromOffset(offset: number): { col: number; line: number } | null + /** + * Reads the input source map and returns a symbol position + * in the input source (e.g., in a Sass file that was compiled + * to CSS before being passed to PostCSS). Optionally takes an + * end position, exclusive. + * + * ```js + * root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 } + * root.source.input.origin(1, 1, 1, 4) + * //=> { file: 'a.css', line: 3, column: 1, endLine: 3, endColumn: 4 } + * ``` + * + * @param line Line for inclusive start position in input CSS. + * @param column Column for inclusive start position in input CSS. + * @param endLine Line for exclusive end position in input CSS. + * @param endColumn Column for exclusive end position in input CSS. + * + * @return Position in input source. + */ + origin( + line: number, + column: number, + endLine?: number, + endColumn?: number + ): false | Input.FilePosition +} + +declare class Input extends Input_ {} + +export = Input diff --git a/node_modules/postcss/lib/input.js b/node_modules/postcss/lib/input.js new file mode 100644 index 000000000..4f63ce92c --- /dev/null +++ b/node_modules/postcss/lib/input.js @@ -0,0 +1,248 @@ +'use strict' + +let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') +let { fileURLToPath, pathToFileURL } = require('url') +let { isAbsolute, resolve } = require('path') +let { nanoid } = require('nanoid/non-secure') + +let terminalHighlight = require('./terminal-highlight') +let CssSyntaxError = require('./css-syntax-error') +let PreviousMap = require('./previous-map') + +let fromOffsetCache = Symbol('fromOffsetCache') + +let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) +let pathAvailable = Boolean(resolve && isAbsolute) + +class Input { + constructor(css, opts = {}) { + if ( + css === null || + typeof css === 'undefined' || + (typeof css === 'object' && !css.toString) + ) { + throw new Error(`PostCSS received ${css} instead of CSS string`) + } + + this.css = css.toString() + + if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') { + this.hasBOM = true + this.css = this.css.slice(1) + } else { + this.hasBOM = false + } + + if (opts.from) { + if ( + !pathAvailable || + /^\w+:\/\//.test(opts.from) || + isAbsolute(opts.from) + ) { + this.file = opts.from + } else { + this.file = resolve(opts.from) + } + } + + if (pathAvailable && sourceMapAvailable) { + let map = new PreviousMap(this.css, opts) + if (map.text) { + this.map = map + let file = map.consumer().file + if (!this.file && file) this.file = this.mapResolve(file) + } + } + + if (!this.file) { + this.id = '' + } + if (this.map) this.map.file = this.from + } + + error(message, line, column, opts = {}) { + let result, endLine, endColumn + + if (line && typeof line === 'object') { + let start = line + let end = column + if (typeof start.offset === 'number') { + let pos = this.fromOffset(start.offset) + line = pos.line + column = pos.col + } else { + line = start.line + column = start.column + } + if (typeof end.offset === 'number') { + let pos = this.fromOffset(end.offset) + endLine = pos.line + endColumn = pos.col + } else { + endLine = end.line + endColumn = end.column + } + } else if (!column) { + let pos = this.fromOffset(line) + line = pos.line + column = pos.col + } + + let origin = this.origin(line, column, endLine, endColumn) + if (origin) { + result = new CssSyntaxError( + message, + origin.endLine === undefined + ? origin.line + : { column: origin.column, line: origin.line }, + origin.endLine === undefined + ? origin.column + : { column: origin.endColumn, line: origin.endLine }, + origin.source, + origin.file, + opts.plugin + ) + } else { + result = new CssSyntaxError( + message, + endLine === undefined ? line : { column, line }, + endLine === undefined ? column : { column: endColumn, line: endLine }, + this.css, + this.file, + opts.plugin + ) + } + + result.input = { column, endColumn, endLine, line, source: this.css } + if (this.file) { + if (pathToFileURL) { + result.input.url = pathToFileURL(this.file).toString() + } + result.input.file = this.file + } + + return result + } + + get from() { + return this.file || this.id + } + + fromOffset(offset) { + let lastLine, lineToIndex + if (!this[fromOffsetCache]) { + let lines = this.css.split('\n') + lineToIndex = new Array(lines.length) + let prevIndex = 0 + + for (let i = 0, l = lines.length; i < l; i++) { + lineToIndex[i] = prevIndex + prevIndex += lines[i].length + 1 + } + + this[fromOffsetCache] = lineToIndex + } else { + lineToIndex = this[fromOffsetCache] + } + lastLine = lineToIndex[lineToIndex.length - 1] + + let min = 0 + if (offset >= lastLine) { + min = lineToIndex.length - 1 + } else { + let max = lineToIndex.length - 2 + let mid + while (min < max) { + mid = min + ((max - min) >> 1) + if (offset < lineToIndex[mid]) { + max = mid - 1 + } else if (offset >= lineToIndex[mid + 1]) { + min = mid + 1 + } else { + min = mid + break + } + } + } + return { + col: offset - lineToIndex[min] + 1, + line: min + 1 + } + } + + mapResolve(file) { + if (/^\w+:\/\//.test(file)) { + return file + } + return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file) + } + + origin(line, column, endLine, endColumn) { + if (!this.map) return false + let consumer = this.map.consumer() + + let from = consumer.originalPositionFor({ column, line }) + if (!from.source) return false + + let to + if (typeof endLine === 'number') { + to = consumer.originalPositionFor({ column: endColumn, line: endLine }) + } + + let fromUrl + + if (isAbsolute(from.source)) { + fromUrl = pathToFileURL(from.source) + } else { + fromUrl = new URL( + from.source, + this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile) + ) + } + + let result = { + column: from.column, + endColumn: to && to.column, + endLine: to && to.line, + line: from.line, + url: fromUrl.toString() + } + + if (fromUrl.protocol === 'file:') { + if (fileURLToPath) { + result.file = fileURLToPath(fromUrl) + } else { + /* c8 ignore next 2 */ + throw new Error(`file: protocol is not available in this PostCSS build`) + } + } + + let source = consumer.sourceContentFor(from.source) + if (source) result.source = source + + return result + } + + toJSON() { + let json = {} + for (let name of ['hasBOM', 'css', 'file', 'id']) { + if (this[name] != null) { + json[name] = this[name] + } + } + if (this.map) { + json.map = { ...this.map } + if (json.map.consumerCache) { + json.map.consumerCache = undefined + } + } + return json + } +} + +module.exports = Input +Input.default = Input + +if (terminalHighlight && terminalHighlight.registerInput) { + terminalHighlight.registerInput(Input) +} diff --git a/node_modules/postcss/lib/lazy-result.d.ts b/node_modules/postcss/lib/lazy-result.d.ts new file mode 100644 index 000000000..e715d6755 --- /dev/null +++ b/node_modules/postcss/lib/lazy-result.d.ts @@ -0,0 +1,185 @@ +import { SourceMap } from './postcss.js' +import Processor from './processor.js' +import Result, { Message, ResultOptions } from './result.js' +import Root from './root.js' +import Warning from './warning.js' + +declare namespace LazyResult { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { LazyResult_ as default } +} + +/** + * A Promise proxy for the result of PostCSS transformations. + * + * A `LazyResult` instance is returned by `Processor#process`. + * + * ```js + * const lazy = postcss([autoprefixer]).process(css) + * ``` + */ +declare class LazyResult_ implements PromiseLike { + /** + * Processes input CSS through synchronous and asynchronous plugins + * and calls onRejected for each error thrown in any plugin. + * + * It implements standard Promise API. + * + * ```js + * postcss([autoprefixer]).process(css).then(result => { + * console.log(result.css) + * }).catch(error => { + * console.error(error) + * }) + * ``` + */ + catch: Promise['catch'] + + /** + * Processes input CSS through synchronous and asynchronous plugins + * and calls onFinally on any error or when all plugins will finish work. + * + * It implements standard Promise API. + * + * ```js + * postcss([autoprefixer]).process(css).finally(() => { + * console.log('processing ended') + * }) + * ``` + */ + finally: Promise['finally'] + + /** + * Processes input CSS through synchronous and asynchronous plugins + * and calls `onFulfilled` with a Result instance. If a plugin throws + * an error, the `onRejected` callback will be executed. + * + * It implements standard Promise API. + * + * ```js + * postcss([autoprefixer]).process(css, { from: cssPath }).then(result => { + * console.log(result.css) + * }) + * ``` + */ + then: Promise['then'] + + /** + * @param processor Processor used for this transformation. + * @param css CSS to parse and transform. + * @param opts Options from the `Processor#process` or `Root#toResult`. + */ + constructor(processor: Processor, css: string, opts: ResultOptions) + + /** + * Run plugin in async way and return `Result`. + * + * @return Result with output content. + */ + async(): Promise + + /** + * An alias for the `css` property. Use it with syntaxes + * that generate non-CSS output. + * + * This property will only work with synchronous plugins. + * If the processor contains any asynchronous plugins + * it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get content(): string + + /** + * Processes input CSS through synchronous plugins, converts `Root` + * to a CSS string and returns `Result#css`. + * + * This property will only work with synchronous plugins. + * If the processor contains any asynchronous plugins + * it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get css(): string + + /** + * Processes input CSS through synchronous plugins + * and returns `Result#map`. + * + * This property will only work with synchronous plugins. + * If the processor contains any asynchronous plugins + * it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get map(): SourceMap + + /** + * Processes input CSS through synchronous plugins + * and returns `Result#messages`. + * + * This property will only work with synchronous plugins. If the processor + * contains any asynchronous plugins it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get messages(): Message[] + + /** + * Options from the `Processor#process` call. + */ + get opts(): ResultOptions + + /** + * Returns a `Processor` instance, which will be used + * for CSS transformations. + */ + get processor(): Processor + + /** + * Processes input CSS through synchronous plugins + * and returns `Result#root`. + * + * This property will only work with synchronous plugins. If the processor + * contains any asynchronous plugins it will throw an error. + * + * PostCSS runners should always use `LazyResult#then`. + */ + get root(): Root + + /** + * Returns the default string description of an object. + * Required to implement the Promise interface. + */ + get [Symbol.toStringTag](): string + + /** + * Run plugin in sync way and return `Result`. + * + * @return Result with output content. + */ + sync(): Result + + /** + * Alias for the `LazyResult#css` property. + * + * ```js + * lazy + '' === lazy.css + * ``` + * + * @return Output CSS. + */ + toString(): string + + /** + * Processes input CSS through synchronous plugins + * and calls `Result#warnings`. + * + * @return Warnings from plugins. + */ + warnings(): Warning[] +} + +declare class LazyResult extends LazyResult_ {} + +export = LazyResult diff --git a/node_modules/postcss/lib/lazy-result.js b/node_modules/postcss/lib/lazy-result.js new file mode 100644 index 000000000..d18c9c880 --- /dev/null +++ b/node_modules/postcss/lib/lazy-result.js @@ -0,0 +1,550 @@ +'use strict' + +let { isClean, my } = require('./symbols') +let MapGenerator = require('./map-generator') +let stringify = require('./stringify') +let Container = require('./container') +let Document = require('./document') +let warnOnce = require('./warn-once') +let Result = require('./result') +let parse = require('./parse') +let Root = require('./root') + +const TYPE_TO_CLASS_NAME = { + atrule: 'AtRule', + comment: 'Comment', + decl: 'Declaration', + document: 'Document', + root: 'Root', + rule: 'Rule' +} + +const PLUGIN_PROPS = { + AtRule: true, + AtRuleExit: true, + Comment: true, + CommentExit: true, + Declaration: true, + DeclarationExit: true, + Document: true, + DocumentExit: true, + Once: true, + OnceExit: true, + postcssPlugin: true, + prepare: true, + Root: true, + RootExit: true, + Rule: true, + RuleExit: true +} + +const NOT_VISITORS = { + Once: true, + postcssPlugin: true, + prepare: true +} + +const CHILDREN = 0 + +function isPromise(obj) { + return typeof obj === 'object' && typeof obj.then === 'function' +} + +function getEvents(node) { + let key = false + let type = TYPE_TO_CLASS_NAME[node.type] + if (node.type === 'decl') { + key = node.prop.toLowerCase() + } else if (node.type === 'atrule') { + key = node.name.toLowerCase() + } + + if (key && node.append) { + return [ + type, + type + '-' + key, + CHILDREN, + type + 'Exit', + type + 'Exit-' + key + ] + } else if (key) { + return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key] + } else if (node.append) { + return [type, CHILDREN, type + 'Exit'] + } else { + return [type, type + 'Exit'] + } +} + +function toStack(node) { + let events + if (node.type === 'document') { + events = ['Document', CHILDREN, 'DocumentExit'] + } else if (node.type === 'root') { + events = ['Root', CHILDREN, 'RootExit'] + } else { + events = getEvents(node) + } + + return { + eventIndex: 0, + events, + iterator: 0, + node, + visitorIndex: 0, + visitors: [] + } +} + +function cleanMarks(node) { + node[isClean] = false + if (node.nodes) node.nodes.forEach(i => cleanMarks(i)) + return node +} + +let postcss = {} + +class LazyResult { + constructor(processor, css, opts) { + this.stringified = false + this.processed = false + + let root + if ( + typeof css === 'object' && + css !== null && + (css.type === 'root' || css.type === 'document') + ) { + root = cleanMarks(css) + } else if (css instanceof LazyResult || css instanceof Result) { + root = cleanMarks(css.root) + if (css.map) { + if (typeof opts.map === 'undefined') opts.map = {} + if (!opts.map.inline) opts.map.inline = false + opts.map.prev = css.map + } + } else { + let parser = parse + if (opts.syntax) parser = opts.syntax.parse + if (opts.parser) parser = opts.parser + if (parser.parse) parser = parser.parse + + try { + root = parser(css, opts) + } catch (error) { + this.processed = true + this.error = error + } + + if (root && !root[my]) { + /* c8 ignore next 2 */ + Container.rebuild(root) + } + } + + this.result = new Result(processor, root, opts) + this.helpers = { ...postcss, postcss, result: this.result } + this.plugins = this.processor.plugins.map(plugin => { + if (typeof plugin === 'object' && plugin.prepare) { + return { ...plugin, ...plugin.prepare(this.result) } + } else { + return plugin + } + }) + } + + async() { + if (this.error) return Promise.reject(this.error) + if (this.processed) return Promise.resolve(this.result) + if (!this.processing) { + this.processing = this.runAsync() + } + return this.processing + } + + catch(onRejected) { + return this.async().catch(onRejected) + } + + get content() { + return this.stringify().content + } + + get css() { + return this.stringify().css + } + + finally(onFinally) { + return this.async().then(onFinally, onFinally) + } + + getAsyncError() { + throw new Error('Use process(css).then(cb) to work with async plugins') + } + + handleError(error, node) { + let plugin = this.result.lastPlugin + try { + if (node) node.addToError(error) + this.error = error + if (error.name === 'CssSyntaxError' && !error.plugin) { + error.plugin = plugin.postcssPlugin + error.setMessage() + } else if (plugin.postcssVersion) { + if (process.env.NODE_ENV !== 'production') { + let pluginName = plugin.postcssPlugin + let pluginVer = plugin.postcssVersion + let runtimeVer = this.result.processor.version + let a = pluginVer.split('.') + let b = runtimeVer.split('.') + + if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) { + // eslint-disable-next-line no-console + console.error( + 'Unknown error from PostCSS plugin. Your current PostCSS ' + + 'version is ' + + runtimeVer + + ', but ' + + pluginName + + ' uses ' + + pluginVer + + '. Perhaps this is the source of the error below.' + ) + } + } + } + } catch (err) { + /* c8 ignore next 3 */ + // eslint-disable-next-line no-console + if (console && console.error) console.error(err) + } + return error + } + + get map() { + return this.stringify().map + } + + get messages() { + return this.sync().messages + } + + get opts() { + return this.result.opts + } + + prepareVisitors() { + this.listeners = {} + let add = (plugin, type, cb) => { + if (!this.listeners[type]) this.listeners[type] = [] + this.listeners[type].push([plugin, cb]) + } + for (let plugin of this.plugins) { + if (typeof plugin === 'object') { + for (let event in plugin) { + if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { + throw new Error( + `Unknown event ${event} in ${plugin.postcssPlugin}. ` + + `Try to update PostCSS (${this.processor.version} now).` + ) + } + if (!NOT_VISITORS[event]) { + if (typeof plugin[event] === 'object') { + for (let filter in plugin[event]) { + if (filter === '*') { + add(plugin, event, plugin[event][filter]) + } else { + add( + plugin, + event + '-' + filter.toLowerCase(), + plugin[event][filter] + ) + } + } + } else if (typeof plugin[event] === 'function') { + add(plugin, event, plugin[event]) + } + } + } + } + } + this.hasListener = Object.keys(this.listeners).length > 0 + } + + get processor() { + return this.result.processor + } + + get root() { + return this.sync().root + } + + async runAsync() { + this.plugin = 0 + for (let i = 0; i < this.plugins.length; i++) { + let plugin = this.plugins[i] + let promise = this.runOnRoot(plugin) + if (isPromise(promise)) { + try { + await promise + } catch (error) { + throw this.handleError(error) + } + } + } + + this.prepareVisitors() + if (this.hasListener) { + let root = this.result.root + while (!root[isClean]) { + root[isClean] = true + let stack = [toStack(root)] + while (stack.length > 0) { + let promise = this.visitTick(stack) + if (isPromise(promise)) { + try { + await promise + } catch (e) { + let node = stack[stack.length - 1].node + throw this.handleError(e, node) + } + } + } + } + + if (this.listeners.OnceExit) { + for (let [plugin, visitor] of this.listeners.OnceExit) { + this.result.lastPlugin = plugin + try { + if (root.type === 'document') { + let roots = root.nodes.map(subRoot => + visitor(subRoot, this.helpers) + ) + + await Promise.all(roots) + } else { + await visitor(root, this.helpers) + } + } catch (e) { + throw this.handleError(e) + } + } + } + } + + this.processed = true + return this.stringify() + } + + runOnRoot(plugin) { + this.result.lastPlugin = plugin + try { + if (typeof plugin === 'object' && plugin.Once) { + if (this.result.root.type === 'document') { + let roots = this.result.root.nodes.map(root => + plugin.Once(root, this.helpers) + ) + + if (isPromise(roots[0])) { + return Promise.all(roots) + } + + return roots + } + + return plugin.Once(this.result.root, this.helpers) + } else if (typeof plugin === 'function') { + return plugin(this.result.root, this.result) + } + } catch (error) { + throw this.handleError(error) + } + } + + stringify() { + if (this.error) throw this.error + if (this.stringified) return this.result + this.stringified = true + + this.sync() + + let opts = this.result.opts + let str = stringify + if (opts.syntax) str = opts.syntax.stringify + if (opts.stringifier) str = opts.stringifier + if (str.stringify) str = str.stringify + + let map = new MapGenerator(str, this.result.root, this.result.opts) + let data = map.generate() + this.result.css = data[0] + this.result.map = data[1] + + return this.result + } + + get [Symbol.toStringTag]() { + return 'LazyResult' + } + + sync() { + if (this.error) throw this.error + if (this.processed) return this.result + this.processed = true + + if (this.processing) { + throw this.getAsyncError() + } + + for (let plugin of this.plugins) { + let promise = this.runOnRoot(plugin) + if (isPromise(promise)) { + throw this.getAsyncError() + } + } + + this.prepareVisitors() + if (this.hasListener) { + let root = this.result.root + while (!root[isClean]) { + root[isClean] = true + this.walkSync(root) + } + if (this.listeners.OnceExit) { + if (root.type === 'document') { + for (let subRoot of root.nodes) { + this.visitSync(this.listeners.OnceExit, subRoot) + } + } else { + this.visitSync(this.listeners.OnceExit, root) + } + } + } + + return this.result + } + + then(onFulfilled, onRejected) { + if (process.env.NODE_ENV !== 'production') { + if (!('from' in this.opts)) { + warnOnce( + 'Without `from` option PostCSS could generate wrong source map ' + + 'and will not find Browserslist config. Set it to CSS file path ' + + 'or to `undefined` to prevent this warning.' + ) + } + } + return this.async().then(onFulfilled, onRejected) + } + + toString() { + return this.css + } + + visitSync(visitors, node) { + for (let [plugin, visitor] of visitors) { + this.result.lastPlugin = plugin + let promise + try { + promise = visitor(node, this.helpers) + } catch (e) { + throw this.handleError(e, node.proxyOf) + } + if (node.type !== 'root' && node.type !== 'document' && !node.parent) { + return true + } + if (isPromise(promise)) { + throw this.getAsyncError() + } + } + } + + visitTick(stack) { + let visit = stack[stack.length - 1] + let { node, visitors } = visit + + if (node.type !== 'root' && node.type !== 'document' && !node.parent) { + stack.pop() + return + } + + if (visitors.length > 0 && visit.visitorIndex < visitors.length) { + let [plugin, visitor] = visitors[visit.visitorIndex] + visit.visitorIndex += 1 + if (visit.visitorIndex === visitors.length) { + visit.visitors = [] + visit.visitorIndex = 0 + } + this.result.lastPlugin = plugin + try { + return visitor(node.toProxy(), this.helpers) + } catch (e) { + throw this.handleError(e, node) + } + } + + if (visit.iterator !== 0) { + let iterator = visit.iterator + let child + while ((child = node.nodes[node.indexes[iterator]])) { + node.indexes[iterator] += 1 + if (!child[isClean]) { + child[isClean] = true + stack.push(toStack(child)) + return + } + } + visit.iterator = 0 + delete node.indexes[iterator] + } + + let events = visit.events + while (visit.eventIndex < events.length) { + let event = events[visit.eventIndex] + visit.eventIndex += 1 + if (event === CHILDREN) { + if (node.nodes && node.nodes.length) { + node[isClean] = true + visit.iterator = node.getIterator() + } + return + } else if (this.listeners[event]) { + visit.visitors = this.listeners[event] + return + } + } + stack.pop() + } + + walkSync(node) { + node[isClean] = true + let events = getEvents(node) + for (let event of events) { + if (event === CHILDREN) { + if (node.nodes) { + node.each(child => { + if (!child[isClean]) this.walkSync(child) + }) + } + } else { + let visitors = this.listeners[event] + if (visitors) { + if (this.visitSync(visitors, node.toProxy())) return + } + } + } + } + + warnings() { + return this.sync().warnings() + } +} + +LazyResult.registerPostcss = dependant => { + postcss = dependant +} + +module.exports = LazyResult +LazyResult.default = LazyResult + +Root.registerLazyResult(LazyResult) +Document.registerLazyResult(LazyResult) diff --git a/node_modules/postcss/lib/list.d.ts b/node_modules/postcss/lib/list.d.ts new file mode 100644 index 000000000..1a74d74cf --- /dev/null +++ b/node_modules/postcss/lib/list.d.ts @@ -0,0 +1,57 @@ +declare namespace list { + type List = { + /** + * Safely splits comma-separated values (such as those for `transition-*` + * and `background` properties). + * + * ```js + * Once (root, { list }) { + * list.comma('black, linear-gradient(white, black)') + * //=> ['black', 'linear-gradient(white, black)'] + * } + * ``` + * + * @param str Comma-separated values. + * @return Split values. + */ + comma(str: string): string[] + + default: List + + /** + * Safely splits space-separated values (such as those for `background`, + * `border-radius`, and other shorthand properties). + * + * ```js + * Once (root, { list }) { + * list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)'] + * } + * ``` + * + * @param str Space-separated values. + * @return Split values. + */ + space(str: string): string[] + + /** + * Safely splits values. + * + * ```js + * Once (root, { list }) { + * list.split('1px calc(10% + 1px)', [' ', '\n', '\t']) //=> ['1px', 'calc(10% + 1px)'] + * } + * ``` + * + * @param string separated values. + * @param separators array of separators. + * @param last boolean indicator. + * @return Split values. + */ + split(string: string, separators: string[], last: boolean): string[] + } +} + +// eslint-disable-next-line @typescript-eslint/no-redeclare +declare const list: list.List + +export = list diff --git a/node_modules/postcss/lib/list.js b/node_modules/postcss/lib/list.js new file mode 100644 index 000000000..1b31f9809 --- /dev/null +++ b/node_modules/postcss/lib/list.js @@ -0,0 +1,58 @@ +'use strict' + +let list = { + comma(string) { + return list.split(string, [','], true) + }, + + space(string) { + let spaces = [' ', '\n', '\t'] + return list.split(string, spaces) + }, + + split(string, separators, last) { + let array = [] + let current = '' + let split = false + + let func = 0 + let inQuote = false + let prevQuote = '' + let escape = false + + for (let letter of string) { + if (escape) { + escape = false + } else if (letter === '\\') { + escape = true + } else if (inQuote) { + if (letter === prevQuote) { + inQuote = false + } + } else if (letter === '"' || letter === "'") { + inQuote = true + prevQuote = letter + } else if (letter === '(') { + func += 1 + } else if (letter === ')') { + if (func > 0) func -= 1 + } else if (func === 0) { + if (separators.includes(letter)) split = true + } + + if (split) { + if (current !== '') array.push(current.trim()) + current = '' + split = false + } else { + current += letter + } + } + + if (last || current !== '') array.push(current.trim()) + return array + } +} + +module.exports = list +list.default = list diff --git a/node_modules/postcss/lib/map-generator.js b/node_modules/postcss/lib/map-generator.js new file mode 100644 index 000000000..f6320bc2d --- /dev/null +++ b/node_modules/postcss/lib/map-generator.js @@ -0,0 +1,338 @@ +'use strict' + +let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') +let { dirname, relative, resolve, sep } = require('path') +let { pathToFileURL } = require('url') + +let Input = require('./input') + +let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) +let pathAvailable = Boolean(dirname && resolve && relative && sep) + +class MapGenerator { + constructor(stringify, root, opts, cssString) { + this.stringify = stringify + this.mapOpts = opts.map || {} + this.root = root + this.opts = opts + this.css = cssString + this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute + } + + addAnnotation() { + let content + + if (this.isInline()) { + content = + 'data:application/json;base64,' + this.toBase64(this.map.toString()) + } else if (typeof this.mapOpts.annotation === 'string') { + content = this.mapOpts.annotation + } else if (typeof this.mapOpts.annotation === 'function') { + content = this.mapOpts.annotation(this.opts.to, this.root) + } else { + content = this.outputFile() + '.map' + } + let eol = '\n' + if (this.css.includes('\r\n')) eol = '\r\n' + + this.css += eol + '/*# sourceMappingURL=' + content + ' */' + } + + applyPrevMaps() { + for (let prev of this.previous()) { + let from = this.toUrl(this.path(prev.file)) + let root = prev.root || dirname(prev.file) + let map + + if (this.mapOpts.sourcesContent === false) { + map = new SourceMapConsumer(prev.text) + if (map.sourcesContent) { + map.sourcesContent = map.sourcesContent.map(() => null) + } + } else { + map = prev.consumer() + } + + this.map.applySourceMap(map, from, this.toUrl(this.path(root))) + } + } + + clearAnnotation() { + if (this.mapOpts.annotation === false) return + + if (this.root) { + let node + for (let i = this.root.nodes.length - 1; i >= 0; i--) { + node = this.root.nodes[i] + if (node.type !== 'comment') continue + if (node.text.indexOf('# sourceMappingURL=') === 0) { + this.root.removeChild(i) + } + } + } else if (this.css) { + this.css = this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm, '') + } + } + + generate() { + this.clearAnnotation() + if (pathAvailable && sourceMapAvailable && this.isMap()) { + return this.generateMap() + } else { + let result = '' + this.stringify(this.root, i => { + result += i + }) + return [result] + } + } + + generateMap() { + if (this.root) { + this.generateString() + } else if (this.previous().length === 1) { + let prev = this.previous()[0].consumer() + prev.file = this.outputFile() + this.map = SourceMapGenerator.fromSourceMap(prev) + } else { + this.map = new SourceMapGenerator({ file: this.outputFile() }) + this.map.addMapping({ + generated: { column: 0, line: 1 }, + original: { column: 0, line: 1 }, + source: this.opts.from + ? this.toUrl(this.path(this.opts.from)) + : '' + }) + } + + if (this.isSourcesContent()) this.setSourcesContent() + if (this.root && this.previous().length > 0) this.applyPrevMaps() + if (this.isAnnotation()) this.addAnnotation() + + if (this.isInline()) { + return [this.css] + } else { + return [this.css, this.map] + } + } + + generateString() { + this.css = '' + this.map = new SourceMapGenerator({ file: this.outputFile() }) + + let line = 1 + let column = 1 + + let noSource = '' + let mapping = { + generated: { column: 0, line: 0 }, + original: { column: 0, line: 0 }, + source: '' + } + + let lines, last + this.stringify(this.root, (str, node, type) => { + this.css += str + + if (node && type !== 'end') { + mapping.generated.line = line + mapping.generated.column = column - 1 + if (node.source && node.source.start) { + mapping.source = this.sourcePath(node) + mapping.original.line = node.source.start.line + mapping.original.column = node.source.start.column - 1 + this.map.addMapping(mapping) + } else { + mapping.source = noSource + mapping.original.line = 1 + mapping.original.column = 0 + this.map.addMapping(mapping) + } + } + + lines = str.match(/\n/g) + if (lines) { + line += lines.length + last = str.lastIndexOf('\n') + column = str.length - last + } else { + column += str.length + } + + if (node && type !== 'start') { + let p = node.parent || { raws: {} } + let childless = + node.type === 'decl' || (node.type === 'atrule' && !node.nodes) + if (!childless || node !== p.last || p.raws.semicolon) { + if (node.source && node.source.end) { + mapping.source = this.sourcePath(node) + mapping.original.line = node.source.end.line + mapping.original.column = node.source.end.column - 1 + mapping.generated.line = line + mapping.generated.column = column - 2 + this.map.addMapping(mapping) + } else { + mapping.source = noSource + mapping.original.line = 1 + mapping.original.column = 0 + mapping.generated.line = line + mapping.generated.column = column - 1 + this.map.addMapping(mapping) + } + } + } + }) + } + + isAnnotation() { + if (this.isInline()) { + return true + } + if (typeof this.mapOpts.annotation !== 'undefined') { + return this.mapOpts.annotation + } + if (this.previous().length) { + return this.previous().some(i => i.annotation) + } + return true + } + + isInline() { + if (typeof this.mapOpts.inline !== 'undefined') { + return this.mapOpts.inline + } + + let annotation = this.mapOpts.annotation + if (typeof annotation !== 'undefined' && annotation !== true) { + return false + } + + if (this.previous().length) { + return this.previous().some(i => i.inline) + } + return true + } + + isMap() { + if (typeof this.opts.map !== 'undefined') { + return !!this.opts.map + } + return this.previous().length > 0 + } + + isSourcesContent() { + if (typeof this.mapOpts.sourcesContent !== 'undefined') { + return this.mapOpts.sourcesContent + } + if (this.previous().length) { + return this.previous().some(i => i.withContent()) + } + return true + } + + outputFile() { + if (this.opts.to) { + return this.path(this.opts.to) + } else if (this.opts.from) { + return this.path(this.opts.from) + } else { + return 'to.css' + } + } + + path(file) { + if (file.indexOf('<') === 0) return file + if (/^\w+:\/\//.test(file)) return file + if (this.mapOpts.absolute) return file + + let from = this.opts.to ? dirname(this.opts.to) : '.' + + if (typeof this.mapOpts.annotation === 'string') { + from = dirname(resolve(from, this.mapOpts.annotation)) + } + + file = relative(from, file) + return file + } + + previous() { + if (!this.previousMaps) { + this.previousMaps = [] + if (this.root) { + this.root.walk(node => { + if (node.source && node.source.input.map) { + let map = node.source.input.map + if (!this.previousMaps.includes(map)) { + this.previousMaps.push(map) + } + } + }) + } else { + let input = new Input(this.css, this.opts) + if (input.map) this.previousMaps.push(input.map) + } + } + + return this.previousMaps + } + + setSourcesContent() { + let already = {} + if (this.root) { + this.root.walk(node => { + if (node.source) { + let from = node.source.input.from + if (from && !already[from]) { + already[from] = true + let fromUrl = this.usesFileUrls + ? this.toFileUrl(from) + : this.toUrl(this.path(from)) + this.map.setSourceContent(fromUrl, node.source.input.css) + } + } + }) + } else if (this.css) { + let from = this.opts.from + ? this.toUrl(this.path(this.opts.from)) + : '' + this.map.setSourceContent(from, this.css) + } + } + + sourcePath(node) { + if (this.mapOpts.from) { + return this.toUrl(this.mapOpts.from) + } else if (this.usesFileUrls) { + return this.toFileUrl(node.source.input.from) + } else { + return this.toUrl(this.path(node.source.input.from)) + } + } + + toBase64(str) { + if (Buffer) { + return Buffer.from(str).toString('base64') + } else { + return window.btoa(unescape(encodeURIComponent(str))) + } + } + + toFileUrl(path) { + if (pathToFileURL) { + return pathToFileURL(path).toString() + } else { + throw new Error( + '`map.absolute` option is not available in this PostCSS build' + ) + } + } + + toUrl(path) { + if (sep === '\\') { + path = path.replace(/\\/g, '/') + } + return encodeURI(path).replace(/[#?]/g, encodeURIComponent) + } +} + +module.exports = MapGenerator diff --git a/node_modules/postcss/lib/no-work-result.d.ts b/node_modules/postcss/lib/no-work-result.d.ts new file mode 100644 index 000000000..cee0e3ad9 --- /dev/null +++ b/node_modules/postcss/lib/no-work-result.d.ts @@ -0,0 +1,46 @@ +import LazyResult from './lazy-result.js' +import { SourceMap } from './postcss.js' +import Processor from './processor.js' +import Result, { Message, ResultOptions } from './result.js' +import Root from './root.js' +import Warning from './warning.js' + +declare namespace NoWorkResult { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { NoWorkResult_ as default } +} + +/** + * A Promise proxy for the result of PostCSS transformations. + * This lazy result instance doesn't parse css unless `NoWorkResult#root` or `Result#root` + * are accessed. See the example below for details. + * A `NoWork` instance is returned by `Processor#process` ONLY when no plugins defined. + * + * ```js + * const noWorkResult = postcss().process(css) // No plugins are defined. + * // CSS is not parsed + * let root = noWorkResult.root // now css is parsed because we accessed the root + * ``` + */ +declare class NoWorkResult_ implements LazyResult { + catch: Promise['catch'] + finally: Promise['finally'] + then: Promise['then'] + constructor(processor: Processor, css: string, opts: ResultOptions) + async(): Promise + get content(): string + get css(): string + get map(): SourceMap + get messages(): Message[] + get opts(): ResultOptions + get processor(): Processor + get root(): Root + get [Symbol.toStringTag](): string + sync(): Result + toString(): string + warnings(): Warning[] +} + +declare class NoWorkResult extends NoWorkResult_ {} + +export = NoWorkResult diff --git a/node_modules/postcss/lib/no-work-result.js b/node_modules/postcss/lib/no-work-result.js new file mode 100644 index 000000000..717013512 --- /dev/null +++ b/node_modules/postcss/lib/no-work-result.js @@ -0,0 +1,135 @@ +'use strict' + +let MapGenerator = require('./map-generator') +let stringify = require('./stringify') +let warnOnce = require('./warn-once') +let parse = require('./parse') +const Result = require('./result') + +class NoWorkResult { + constructor(processor, css, opts) { + css = css.toString() + this.stringified = false + + this._processor = processor + this._css = css + this._opts = opts + this._map = undefined + let root + + let str = stringify + this.result = new Result(this._processor, root, this._opts) + this.result.css = css + + let self = this + Object.defineProperty(this.result, 'root', { + get() { + return self.root + } + }) + + let map = new MapGenerator(str, root, this._opts, css) + if (map.isMap()) { + let [generatedCSS, generatedMap] = map.generate() + if (generatedCSS) { + this.result.css = generatedCSS + } + if (generatedMap) { + this.result.map = generatedMap + } + } + } + + async() { + if (this.error) return Promise.reject(this.error) + return Promise.resolve(this.result) + } + + catch(onRejected) { + return this.async().catch(onRejected) + } + + get content() { + return this.result.css + } + + get css() { + return this.result.css + } + + finally(onFinally) { + return this.async().then(onFinally, onFinally) + } + + get map() { + return this.result.map + } + + get messages() { + return [] + } + + get opts() { + return this.result.opts + } + + get processor() { + return this.result.processor + } + + get root() { + if (this._root) { + return this._root + } + + let root + let parser = parse + + try { + root = parser(this._css, this._opts) + } catch (error) { + this.error = error + } + + if (this.error) { + throw this.error + } else { + this._root = root + return root + } + } + + get [Symbol.toStringTag]() { + return 'NoWorkResult' + } + + sync() { + if (this.error) throw this.error + return this.result + } + + then(onFulfilled, onRejected) { + if (process.env.NODE_ENV !== 'production') { + if (!('from' in this._opts)) { + warnOnce( + 'Without `from` option PostCSS could generate wrong source map ' + + 'and will not find Browserslist config. Set it to CSS file path ' + + 'or to `undefined` to prevent this warning.' + ) + } + } + + return this.async().then(onFulfilled, onRejected) + } + + toString() { + return this._css + } + + warnings() { + return [] + } +} + +module.exports = NoWorkResult +NoWorkResult.default = NoWorkResult diff --git a/node_modules/postcss/lib/node.d.ts b/node_modules/postcss/lib/node.d.ts new file mode 100644 index 000000000..d094fc265 --- /dev/null +++ b/node_modules/postcss/lib/node.d.ts @@ -0,0 +1,536 @@ +import AtRule = require('./at-rule.js') + +import { AtRuleProps } from './at-rule.js' +import Comment, { CommentProps } from './comment.js' +import Container from './container.js' +import CssSyntaxError from './css-syntax-error.js' +import Declaration, { DeclarationProps } from './declaration.js' +import Document from './document.js' +import Input from './input.js' +import { Stringifier, Syntax } from './postcss.js' +import Result from './result.js' +import Root from './root.js' +import Rule, { RuleProps } from './rule.js' +import Warning, { WarningOptions } from './warning.js' + +declare namespace Node { + export type ChildNode = AtRule.default | Comment | Declaration | Rule + + export type AnyNode = + | AtRule.default + | Comment + | Declaration + | Document + | Root + | Rule + + export type ChildProps = + | AtRuleProps + | CommentProps + | DeclarationProps + | RuleProps + + export interface Position { + /** + * Source line in file. In contrast to `offset` it starts from 1. + */ + column: number + + /** + * Source column in file. + */ + line: number + + /** + * Source offset in file. It starts from 0. + */ + offset: number + } + + export interface Range { + /** + * End position, exclusive. + */ + end: Position + + /** + * Start position, inclusive. + */ + start: Position + } + + /** + * Source represents an interface for the {@link Node.source} property. + */ + export interface Source { + /** + * The inclusive ending position for the source + * code of a node. + */ + end?: Position + + /** + * The source file from where a node has originated. + */ + input: Input + + /** + * The inclusive starting position for the source + * code of a node. + */ + start?: Position + } + + /** + * Interface represents an interface for an object received + * as parameter by Node class constructor. + */ + export interface NodeProps { + source?: Source + } + + export interface NodeErrorOptions { + /** + * An ending index inside a node's string that should be highlighted as + * source of error. + */ + endIndex?: number + /** + * An index inside a node's string that should be highlighted as source + * of error. + */ + index?: number + /** + * Plugin name that created this error. PostCSS will set it automatically. + */ + plugin?: string + /** + * A word inside a node's string, that should be highlighted as source + * of error. + */ + word?: string + } + + // eslint-disable-next-line @typescript-eslint/no-shadow + class Node extends Node_ {} + export { Node as default } +} + +/** + * It represents an abstract class that handles common + * methods for other CSS abstract syntax tree nodes. + * + * Any node that represents CSS selector or value should + * not extend the `Node` class. + */ +declare abstract class Node_ { + /** + * It represents parent of the current node. + * + * ```js + * console.log(root.nodes[0].parent === root) //=> true + * ``` + */ + parent: Container | Document | undefined + + /** + * It represents unnecessary whitespace and characters present + * in the css source code. + * + * Information to generate byte-to-byte equal node string as it was + * in the origin input. + * + * The properties of the raws object are decided by parser, + * the default parser uses the following properties: + * + * * `before`: the space symbols before the node. It also stores `*` + * and `_` symbols before the declaration (IE hack). + * * `after`: the space symbols after the last child of the node + * to the end of the node. + * * `between`: the symbols between the property and value + * for declarations, selector and `{` for rules, or last parameter + * and `{` for at-rules. + * * `semicolon`: contains true if the last child has + * an (optional) semicolon. + * * `afterName`: the space between the at-rule name and its parameters. + * * `left`: the space symbols between `/*` and the comment’s text. + * * `right`: the space symbols between the comment’s text + * and */. + * - `important`: the content of the important statement, + * if it is not just `!important`. + * + * PostCSS filters out the comments inside selectors, declaration values + * and at-rule parameters but it stores the origin content in raws. + * + * ```js + * const root = postcss.parse('a {\n color:black\n}') + * console.log(root.first.first.raws) //=> { before: '\n ', between: ':' } + * ``` + */ + raws: any + + /** + * It represents information related to origin of a node and is required + * for generating source maps. + * + * The nodes that are created manually using the public APIs + * provided by PostCSS will have `source` undefined and + * will be absent in the source map. + * + * For this reason, the plugin developer should consider + * duplicating nodes as the duplicate node will have the + * same source as the original node by default or assign + * source to a node created manually. + * + * ```js + * console.log(decl.source.input.from) //=> '/home/ai/source.css' + * console.log(decl.source.start) //=> { line: 10, column: 2 } + * console.log(decl.source.end) //=> { line: 10, column: 12 } + * ``` + * + * ```js + * // Incorrect method, source not specified! + * const prefixed = postcss.decl({ + * prop: '-moz-' + decl.prop, + * value: decl.value + * }) + * + * // Correct method, source is inherited when duplicating. + * const prefixed = decl.clone({ + * prop: '-moz-' + decl.prop + * }) + * ``` + * + * ```js + * if (atrule.name === 'add-link') { + * const rule = postcss.rule({ + * selector: 'a', + * source: atrule.source + * }) + * + * atrule.parent.insertBefore(atrule, rule) + * } + * ``` + */ + source?: Node.Source + + /** + * It represents type of a node in + * an abstract syntax tree. + * + * A type of node helps in identification of a node + * and perform operation based on it's type. + * + * ```js + * const declaration = new Declaration({ + * prop: 'color', + * value: 'black' + * }) + * + * console.log(declaration.type) //=> 'decl' + * ``` + */ + type: string + + constructor(defaults?: object) + + /** + * Insert new node after current node to current node’s parent. + * + * Just alias for `node.parent.insertAfter(node, add)`. + * + * ```js + * decl.after('color: black') + * ``` + * + * @param newNode New node. + * @return This node for methods chain. + */ + after(newNode: Node | Node.ChildProps | Node[] | string): this + + /** + * It assigns properties to an existing node instance. + * + * ```js + * decl.assign({ prop: 'word-wrap', value: 'break-word' }) + * ``` + * + * @param overrides New properties to override the node. + * + * @return `this` for method chaining. + */ + assign(overrides: object): this + + /** + * Insert new node before current node to current node’s parent. + * + * Just alias for `node.parent.insertBefore(node, add)`. + * + * ```js + * decl.before('content: ""') + * ``` + * + * @param newNode New node. + * @return This node for methods chain. + */ + before(newNode: Node | Node.ChildProps | Node[] | string): this + + /** + * Clear the code style properties for the node and its children. + * + * ```js + * node.raws.before //=> ' ' + * node.cleanRaws() + * node.raws.before //=> undefined + * ``` + * + * @param keepBetween Keep the `raws.between` symbols. + */ + cleanRaws(keepBetween?: boolean): void + + /** + * It creates clone of an existing node, which includes all the properties + * and their values, that includes `raws` but not `type`. + * + * ```js + * decl.raws.before //=> "\n " + * const cloned = decl.clone({ prop: '-moz-' + decl.prop }) + * cloned.raws.before //=> "\n " + * cloned.toString() //=> -moz-transform: scale(0) + * ``` + * + * @param overrides New properties to override in the clone. + * + * @return Duplicate of the node instance. + */ + clone(overrides?: object): Node_ + + /** + * Shortcut to clone the node and insert the resulting cloned node + * after the current node. + * + * @param overrides New properties to override in the clone. + * @return New node. + */ + cloneAfter(overrides?: object): this + + /** + * Shortcut to clone the node and insert the resulting cloned node + * before the current node. + * + * ```js + * decl.cloneBefore({ prop: '-moz-' + decl.prop }) + * ``` + * + * @param overrides Mew properties to override in the clone. + * + * @return New node + */ + cloneBefore(overrides?: object): this + + /** + * It creates an instance of the class `CssSyntaxError` and parameters passed + * to this method are assigned to the error instance. + * + * The error instance will have description for the + * error, original position of the node in the + * source, showing line and column number. + * + * If any previous map is present, it would be used + * to get original position of the source. + * + * The Previous Map here is referred to the source map + * generated by previous compilation, example: Less, + * Stylus and Sass. + * + * This method returns the error instance instead of + * throwing it. + * + * ```js + * if (!variables[name]) { + * throw decl.error(`Unknown variable ${name}`, { word: name }) + * // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black + * // color: $black + * // a + * // ^ + * // background: white + * } + * ``` + * + * @param message Description for the error instance. + * @param options Options for the error instance. + * + * @return Error instance is returned. + */ + error(message: string, options?: Node.NodeErrorOptions): CssSyntaxError + + /** + * Returns the next child of the node’s parent. + * Returns `undefined` if the current node is the last child. + * + * ```js + * if (comment.text === 'delete next') { + * const next = comment.next() + * if (next) { + * next.remove() + * } + * } + * ``` + * + * @return Next node. + */ + next(): Node.ChildNode | undefined + + /** + * Get the position for a word or an index inside the node. + * + * @param opts Options. + * @return Position. + */ + positionBy(opts?: Pick): Node.Position + + /** + * Convert string index to line/column. + * + * @param index The symbol number in the node’s string. + * @return Symbol position in file. + */ + positionInside(index: number): Node.Position + + /** + * Returns the previous child of the node’s parent. + * Returns `undefined` if the current node is the first child. + * + * ```js + * const annotation = decl.prev() + * if (annotation.type === 'comment') { + * readAnnotation(annotation.text) + * } + * ``` + * + * @return Previous node. + */ + prev(): Node.ChildNode | undefined + + /** + * Get the range for a word or start and end index inside the node. + * The start index is inclusive; the end index is exclusive. + * + * @param opts Options. + * @return Range. + */ + rangeBy( + opts?: Pick + ): Node.Range + + /** + * Returns a `raws` value. If the node is missing + * the code style property (because the node was manually built or cloned), + * PostCSS will try to autodetect the code style property by looking + * at other nodes in the tree. + * + * ```js + * const root = postcss.parse('a { background: white }') + * root.nodes[0].append({ prop: 'color', value: 'black' }) + * root.nodes[0].nodes[1].raws.before //=> undefined + * root.nodes[0].nodes[1].raw('before') //=> ' ' + * ``` + * + * @param prop Name of code style property. + * @param defaultType Name of default value, it can be missed + * if the value is the same as prop. + * @return {string} Code style value. + */ + raw(prop: string, defaultType?: string): string + + /** + * It removes the node from its parent and deletes its parent property. + * + * ```js + * if (decl.prop.match(/^-webkit-/)) { + * decl.remove() + * } + * ``` + * + * @return `this` for method chaining. + */ + remove(): this + + /** + * Inserts node(s) before the current node and removes the current node. + * + * ```js + * AtRule: { + * mixin: atrule => { + * atrule.replaceWith(mixinRules[atrule.params]) + * } + * } + * ``` + * + * @param nodes Mode(s) to replace current one. + * @return Current node to methods chain. + */ + replaceWith( + ...nodes: ( + | Node.ChildNode + | Node.ChildNode[] + | Node.ChildProps + | Node.ChildProps[] + )[] + ): this + + /** + * Finds the Root instance of the node’s tree. + * + * ```js + * root.nodes[0].nodes[0].root() === root + * ``` + * + * @return Root parent. + */ + root(): Root + + /** + * Fix circular links on `JSON.stringify()`. + * + * @return Cleaned object. + */ + toJSON(): object + + /** + * It compiles the node to browser readable cascading style sheets string + * depending on it's type. + * + * ```js + * console.log(new Rule({ selector: 'a' }).toString()) //=> "a {}" + * ``` + * + * @param stringifier A syntax to use in string generation. + * @return CSS string of this node. + */ + toString(stringifier?: Stringifier | Syntax): string + + /** + * It is a wrapper for {@link Result#warn}, providing convenient + * way of generating warnings. + * + * ```js + * Declaration: { + * bad: (decl, { result }) => { + * decl.warn(result, 'Deprecated property: bad') + * } + * } + * ``` + * + * @param result The `Result` instance that will receive the warning. + * @param message Description for the warning. + * @param options Options for the warning. + * + * @return `Warning` instance is returned + */ + warn(result: Result, message: string, options?: WarningOptions): Warning +} + +declare class Node extends Node_ { } + +export = Node diff --git a/node_modules/postcss/lib/node.js b/node_modules/postcss/lib/node.js new file mode 100644 index 000000000..6aa0eb31d --- /dev/null +++ b/node_modules/postcss/lib/node.js @@ -0,0 +1,381 @@ +'use strict' + +let { isClean, my } = require('./symbols') +let CssSyntaxError = require('./css-syntax-error') +let Stringifier = require('./stringifier') +let stringify = require('./stringify') + +function cloneNode(obj, parent) { + let cloned = new obj.constructor() + + for (let i in obj) { + if (!Object.prototype.hasOwnProperty.call(obj, i)) { + /* c8 ignore next 2 */ + continue + } + if (i === 'proxyCache') continue + let value = obj[i] + let type = typeof value + + if (i === 'parent' && type === 'object') { + if (parent) cloned[i] = parent + } else if (i === 'source') { + cloned[i] = value + } else if (Array.isArray(value)) { + cloned[i] = value.map(j => cloneNode(j, cloned)) + } else { + if (type === 'object' && value !== null) value = cloneNode(value) + cloned[i] = value + } + } + + return cloned +} + +class Node { + constructor(defaults = {}) { + this.raws = {} + this[isClean] = false + this[my] = true + + for (let name in defaults) { + if (name === 'nodes') { + this.nodes = [] + for (let node of defaults[name]) { + if (typeof node.clone === 'function') { + this.append(node.clone()) + } else { + this.append(node) + } + } + } else { + this[name] = defaults[name] + } + } + } + + addToError(error) { + error.postcssNode = this + if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) { + let s = this.source + error.stack = error.stack.replace( + /\n\s{4}at /, + `$&${s.input.from}:${s.start.line}:${s.start.column}$&` + ) + } + return error + } + + after(add) { + this.parent.insertAfter(this, add) + return this + } + + assign(overrides = {}) { + for (let name in overrides) { + this[name] = overrides[name] + } + return this + } + + before(add) { + this.parent.insertBefore(this, add) + return this + } + + cleanRaws(keepBetween) { + delete this.raws.before + delete this.raws.after + if (!keepBetween) delete this.raws.between + } + + clone(overrides = {}) { + let cloned = cloneNode(this) + for (let name in overrides) { + cloned[name] = overrides[name] + } + return cloned + } + + cloneAfter(overrides = {}) { + let cloned = this.clone(overrides) + this.parent.insertAfter(this, cloned) + return cloned + } + + cloneBefore(overrides = {}) { + let cloned = this.clone(overrides) + this.parent.insertBefore(this, cloned) + return cloned + } + + error(message, opts = {}) { + if (this.source) { + let { end, start } = this.rangeBy(opts) + return this.source.input.error( + message, + { column: start.column, line: start.line }, + { column: end.column, line: end.line }, + opts + ) + } + return new CssSyntaxError(message) + } + + getProxyProcessor() { + return { + get(node, prop) { + if (prop === 'proxyOf') { + return node + } else if (prop === 'root') { + return () => node.root().toProxy() + } else { + return node[prop] + } + }, + + set(node, prop, value) { + if (node[prop] === value) return true + node[prop] = value + if ( + prop === 'prop' || + prop === 'value' || + prop === 'name' || + prop === 'params' || + prop === 'important' || + /* c8 ignore next */ + prop === 'text' + ) { + node.markDirty() + } + return true + } + } + } + + markDirty() { + if (this[isClean]) { + this[isClean] = false + let next = this + while ((next = next.parent)) { + next[isClean] = false + } + } + } + + next() { + if (!this.parent) return undefined + let index = this.parent.index(this) + return this.parent.nodes[index + 1] + } + + positionBy(opts, stringRepresentation) { + let pos = this.source.start + if (opts.index) { + pos = this.positionInside(opts.index, stringRepresentation) + } else if (opts.word) { + stringRepresentation = this.toString() + let index = stringRepresentation.indexOf(opts.word) + if (index !== -1) pos = this.positionInside(index, stringRepresentation) + } + return pos + } + + positionInside(index, stringRepresentation) { + let string = stringRepresentation || this.toString() + let column = this.source.start.column + let line = this.source.start.line + + for (let i = 0; i < index; i++) { + if (string[i] === '\n') { + column = 1 + line += 1 + } else { + column += 1 + } + } + + return { column, line } + } + + prev() { + if (!this.parent) return undefined + let index = this.parent.index(this) + return this.parent.nodes[index - 1] + } + + get proxyOf() { + return this + } + + rangeBy(opts) { + let start = { + column: this.source.start.column, + line: this.source.start.line + } + let end = this.source.end + ? { + column: this.source.end.column + 1, + line: this.source.end.line + } + : { + column: start.column + 1, + line: start.line + } + + if (opts.word) { + let stringRepresentation = this.toString() + let index = stringRepresentation.indexOf(opts.word) + if (index !== -1) { + start = this.positionInside(index, stringRepresentation) + end = this.positionInside(index + opts.word.length, stringRepresentation) + } + } else { + if (opts.start) { + start = { + column: opts.start.column, + line: opts.start.line + } + } else if (opts.index) { + start = this.positionInside(opts.index) + } + + if (opts.end) { + end = { + column: opts.end.column, + line: opts.end.line + } + } else if (opts.endIndex) { + end = this.positionInside(opts.endIndex) + } else if (opts.index) { + end = this.positionInside(opts.index + 1) + } + } + + if ( + end.line < start.line || + (end.line === start.line && end.column <= start.column) + ) { + end = { column: start.column + 1, line: start.line } + } + + return { end, start } + } + + raw(prop, defaultType) { + let str = new Stringifier() + return str.raw(this, prop, defaultType) + } + + remove() { + if (this.parent) { + this.parent.removeChild(this) + } + this.parent = undefined + return this + } + + replaceWith(...nodes) { + if (this.parent) { + let bookmark = this + let foundSelf = false + for (let node of nodes) { + if (node === this) { + foundSelf = true + } else if (foundSelf) { + this.parent.insertAfter(bookmark, node) + bookmark = node + } else { + this.parent.insertBefore(bookmark, node) + } + } + + if (!foundSelf) { + this.remove() + } + } + + return this + } + + root() { + let result = this + while (result.parent && result.parent.type !== 'document') { + result = result.parent + } + return result + } + + toJSON(_, inputs) { + let fixed = {} + let emitInputs = inputs == null + inputs = inputs || new Map() + let inputsNextIndex = 0 + + for (let name in this) { + if (!Object.prototype.hasOwnProperty.call(this, name)) { + /* c8 ignore next 2 */ + continue + } + if (name === 'parent' || name === 'proxyCache') continue + let value = this[name] + + if (Array.isArray(value)) { + fixed[name] = value.map(i => { + if (typeof i === 'object' && i.toJSON) { + return i.toJSON(null, inputs) + } else { + return i + } + }) + } else if (typeof value === 'object' && value.toJSON) { + fixed[name] = value.toJSON(null, inputs) + } else if (name === 'source') { + let inputId = inputs.get(value.input) + if (inputId == null) { + inputId = inputsNextIndex + inputs.set(value.input, inputsNextIndex) + inputsNextIndex++ + } + fixed[name] = { + end: value.end, + inputId, + start: value.start + } + } else { + fixed[name] = value + } + } + + if (emitInputs) { + fixed.inputs = [...inputs.keys()].map(input => input.toJSON()) + } + + return fixed + } + + toProxy() { + if (!this.proxyCache) { + this.proxyCache = new Proxy(this, this.getProxyProcessor()) + } + return this.proxyCache + } + + toString(stringifier = stringify) { + if (stringifier.stringify) stringifier = stringifier.stringify + let result = '' + stringifier(this, i => { + result += i + }) + return result + } + + warn(result, text, opts) { + let data = { node: this } + for (let i in opts) data[i] = opts[i] + return result.warn(text, data) + } +} + +module.exports = Node +Node.default = Node diff --git a/node_modules/postcss/lib/parse.d.ts b/node_modules/postcss/lib/parse.d.ts new file mode 100644 index 000000000..4c943a4d6 --- /dev/null +++ b/node_modules/postcss/lib/parse.d.ts @@ -0,0 +1,9 @@ +import { Parser } from './postcss.js' + +interface Parse extends Parser { + default: Parse +} + +declare const parse: Parse + +export = parse diff --git a/node_modules/postcss/lib/parse.js b/node_modules/postcss/lib/parse.js new file mode 100644 index 000000000..971431f23 --- /dev/null +++ b/node_modules/postcss/lib/parse.js @@ -0,0 +1,42 @@ +'use strict' + +let Container = require('./container') +let Parser = require('./parser') +let Input = require('./input') + +function parse(css, opts) { + let input = new Input(css, opts) + let parser = new Parser(input) + try { + parser.parse() + } catch (e) { + if (process.env.NODE_ENV !== 'production') { + if (e.name === 'CssSyntaxError' && opts && opts.from) { + if (/\.scss$/i.test(opts.from)) { + e.message += + '\nYou tried to parse SCSS with ' + + 'the standard CSS parser; ' + + 'try again with the postcss-scss parser' + } else if (/\.sass/i.test(opts.from)) { + e.message += + '\nYou tried to parse Sass with ' + + 'the standard CSS parser; ' + + 'try again with the postcss-sass parser' + } else if (/\.less$/i.test(opts.from)) { + e.message += + '\nYou tried to parse Less with ' + + 'the standard CSS parser; ' + + 'try again with the postcss-less parser' + } + } + } + throw e + } + + return parser.root +} + +module.exports = parse +parse.default = parse + +Container.registerParse(parse) diff --git a/node_modules/postcss/lib/parser.js b/node_modules/postcss/lib/parser.js new file mode 100644 index 000000000..12f87bd9c --- /dev/null +++ b/node_modules/postcss/lib/parser.js @@ -0,0 +1,603 @@ +'use strict' + +let Declaration = require('./declaration') +let tokenizer = require('./tokenize') +let Comment = require('./comment') +let AtRule = require('./at-rule') +let Root = require('./root') +let Rule = require('./rule') + +const SAFE_COMMENT_NEIGHBOR = { + empty: true, + space: true +} + +function findLastWithPosition(tokens) { + for (let i = tokens.length - 1; i >= 0; i--) { + let token = tokens[i] + let pos = token[3] || token[2] + if (pos) return pos + } +} + +class Parser { + constructor(input) { + this.input = input + + this.root = new Root() + this.current = this.root + this.spaces = '' + this.semicolon = false + this.customProperty = false + + this.createTokenizer() + this.root.source = { input, start: { column: 1, line: 1, offset: 0 } } + } + + atrule(token) { + let node = new AtRule() + node.name = token[1].slice(1) + if (node.name === '') { + this.unnamedAtrule(node, token) + } + this.init(node, token[2]) + + let type + let prev + let shift + let last = false + let open = false + let params = [] + let brackets = [] + + while (!this.tokenizer.endOfFile()) { + token = this.tokenizer.nextToken() + type = token[0] + + if (type === '(' || type === '[') { + brackets.push(type === '(' ? ')' : ']') + } else if (type === '{' && brackets.length > 0) { + brackets.push('}') + } else if (type === brackets[brackets.length - 1]) { + brackets.pop() + } + + if (brackets.length === 0) { + if (type === ';') { + node.source.end = this.getPosition(token[2]) + this.semicolon = true + break + } else if (type === '{') { + open = true + break + } else if (type === '}') { + if (params.length > 0) { + shift = params.length - 1 + prev = params[shift] + while (prev && prev[0] === 'space') { + prev = params[--shift] + } + if (prev) { + node.source.end = this.getPosition(prev[3] || prev[2]) + } + } + this.end(token) + break + } else { + params.push(token) + } + } else { + params.push(token) + } + + if (this.tokenizer.endOfFile()) { + last = true + break + } + } + + node.raws.between = this.spacesAndCommentsFromEnd(params) + if (params.length) { + node.raws.afterName = this.spacesAndCommentsFromStart(params) + this.raw(node, 'params', params) + if (last) { + token = params[params.length - 1] + node.source.end = this.getPosition(token[3] || token[2]) + this.spaces = node.raws.between + node.raws.between = '' + } + } else { + node.raws.afterName = '' + node.params = '' + } + + if (open) { + node.nodes = [] + this.current = node + } + } + + checkMissedSemicolon(tokens) { + let colon = this.colon(tokens) + if (colon === false) return + + let founded = 0 + let token + for (let j = colon - 1; j >= 0; j--) { + token = tokens[j] + if (token[0] !== 'space') { + founded += 1 + if (founded === 2) break + } + } + // If the token is a word, e.g. `!important`, `red` or any other valid property's value. + // Then we need to return the colon after that word token. [3] is the "end" colon of that word. + // And because we need it after that one we do +1 to get the next one. + throw this.input.error( + 'Missed semicolon', + token[0] === 'word' ? token[3] + 1 : token[2] + ) + } + + colon(tokens) { + let brackets = 0 + let token, type, prev + for (let [i, element] of tokens.entries()) { + token = element + type = token[0] + + if (type === '(') { + brackets += 1 + } + if (type === ')') { + brackets -= 1 + } + if (brackets === 0 && type === ':') { + if (!prev) { + this.doubleColon(token) + } else if (prev[0] === 'word' && prev[1] === 'progid') { + continue + } else { + return i + } + } + + prev = token + } + return false + } + + comment(token) { + let node = new Comment() + this.init(node, token[2]) + node.source.end = this.getPosition(token[3] || token[2]) + + let text = token[1].slice(2, -2) + if (/^\s*$/.test(text)) { + node.text = '' + node.raws.left = text + node.raws.right = '' + } else { + let match = text.match(/^(\s*)([^]*\S)(\s*)$/) + node.text = match[2] + node.raws.left = match[1] + node.raws.right = match[3] + } + } + + createTokenizer() { + this.tokenizer = tokenizer(this.input) + } + + decl(tokens, customProperty) { + let node = new Declaration() + this.init(node, tokens[0][2]) + + let last = tokens[tokens.length - 1] + if (last[0] === ';') { + this.semicolon = true + tokens.pop() + } + + node.source.end = this.getPosition( + last[3] || last[2] || findLastWithPosition(tokens) + ) + + while (tokens[0][0] !== 'word') { + if (tokens.length === 1) this.unknownWord(tokens) + node.raws.before += tokens.shift()[1] + } + node.source.start = this.getPosition(tokens[0][2]) + + node.prop = '' + while (tokens.length) { + let type = tokens[0][0] + if (type === ':' || type === 'space' || type === 'comment') { + break + } + node.prop += tokens.shift()[1] + } + + node.raws.between = '' + + let token + while (tokens.length) { + token = tokens.shift() + + if (token[0] === ':') { + node.raws.between += token[1] + break + } else { + if (token[0] === 'word' && /\w/.test(token[1])) { + this.unknownWord([token]) + } + node.raws.between += token[1] + } + } + + if (node.prop[0] === '_' || node.prop[0] === '*') { + node.raws.before += node.prop[0] + node.prop = node.prop.slice(1) + } + + let firstSpaces = [] + let next + while (tokens.length) { + next = tokens[0][0] + if (next !== 'space' && next !== 'comment') break + firstSpaces.push(tokens.shift()) + } + + this.precheckMissedSemicolon(tokens) + + for (let i = tokens.length - 1; i >= 0; i--) { + token = tokens[i] + if (token[1].toLowerCase() === '!important') { + node.important = true + let string = this.stringFrom(tokens, i) + string = this.spacesFromEnd(tokens) + string + if (string !== ' !important') node.raws.important = string + break + } else if (token[1].toLowerCase() === 'important') { + let cache = tokens.slice(0) + let str = '' + for (let j = i; j > 0; j--) { + let type = cache[j][0] + if (str.trim().indexOf('!') === 0 && type !== 'space') { + break + } + str = cache.pop()[1] + str + } + if (str.trim().indexOf('!') === 0) { + node.important = true + node.raws.important = str + tokens = cache + } + } + + if (token[0] !== 'space' && token[0] !== 'comment') { + break + } + } + + let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment') + + if (hasWord) { + node.raws.between += firstSpaces.map(i => i[1]).join('') + firstSpaces = [] + } + this.raw(node, 'value', firstSpaces.concat(tokens), customProperty) + + if (node.value.includes(':') && !customProperty) { + this.checkMissedSemicolon(tokens) + } + } + + doubleColon(token) { + throw this.input.error( + 'Double colon', + { offset: token[2] }, + { offset: token[2] + token[1].length } + ) + } + + emptyRule(token) { + let node = new Rule() + this.init(node, token[2]) + node.selector = '' + node.raws.between = '' + this.current = node + } + + end(token) { + if (this.current.nodes && this.current.nodes.length) { + this.current.raws.semicolon = this.semicolon + } + this.semicolon = false + + this.current.raws.after = (this.current.raws.after || '') + this.spaces + this.spaces = '' + + if (this.current.parent) { + this.current.source.end = this.getPosition(token[2]) + this.current = this.current.parent + } else { + this.unexpectedClose(token) + } + } + + endFile() { + if (this.current.parent) this.unclosedBlock() + if (this.current.nodes && this.current.nodes.length) { + this.current.raws.semicolon = this.semicolon + } + this.current.raws.after = (this.current.raws.after || '') + this.spaces + } + + freeSemicolon(token) { + this.spaces += token[1] + if (this.current.nodes) { + let prev = this.current.nodes[this.current.nodes.length - 1] + if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) { + prev.raws.ownSemicolon = this.spaces + this.spaces = '' + } + } + } + + // Helpers + + getPosition(offset) { + let pos = this.input.fromOffset(offset) + return { + column: pos.col, + line: pos.line, + offset + } + } + + init(node, offset) { + this.current.push(node) + node.source = { + input: this.input, + start: this.getPosition(offset) + } + node.raws.before = this.spaces + this.spaces = '' + if (node.type !== 'comment') this.semicolon = false + } + + other(start) { + let end = false + let type = null + let colon = false + let bracket = null + let brackets = [] + let customProperty = start[1].startsWith('--') + + let tokens = [] + let token = start + while (token) { + type = token[0] + tokens.push(token) + + if (type === '(' || type === '[') { + if (!bracket) bracket = token + brackets.push(type === '(' ? ')' : ']') + } else if (customProperty && colon && type === '{') { + if (!bracket) bracket = token + brackets.push('}') + } else if (brackets.length === 0) { + if (type === ';') { + if (colon) { + this.decl(tokens, customProperty) + return + } else { + break + } + } else if (type === '{') { + this.rule(tokens) + return + } else if (type === '}') { + this.tokenizer.back(tokens.pop()) + end = true + break + } else if (type === ':') { + colon = true + } + } else if (type === brackets[brackets.length - 1]) { + brackets.pop() + if (brackets.length === 0) bracket = null + } + + token = this.tokenizer.nextToken() + } + + if (this.tokenizer.endOfFile()) end = true + if (brackets.length > 0) this.unclosedBracket(bracket) + + if (end && colon) { + if (!customProperty) { + while (tokens.length) { + token = tokens[tokens.length - 1][0] + if (token !== 'space' && token !== 'comment') break + this.tokenizer.back(tokens.pop()) + } + } + this.decl(tokens, customProperty) + } else { + this.unknownWord(tokens) + } + } + + parse() { + let token + while (!this.tokenizer.endOfFile()) { + token = this.tokenizer.nextToken() + + switch (token[0]) { + case 'space': + this.spaces += token[1] + break + + case ';': + this.freeSemicolon(token) + break + + case '}': + this.end(token) + break + + case 'comment': + this.comment(token) + break + + case 'at-word': + this.atrule(token) + break + + case '{': + this.emptyRule(token) + break + + default: + this.other(token) + break + } + } + this.endFile() + } + + precheckMissedSemicolon(/* tokens */) { + // Hook for Safe Parser + } + + raw(node, prop, tokens, customProperty) { + let token, type + let length = tokens.length + let value = '' + let clean = true + let next, prev + + for (let i = 0; i < length; i += 1) { + token = tokens[i] + type = token[0] + if (type === 'space' && i === length - 1 && !customProperty) { + clean = false + } else if (type === 'comment') { + prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty' + next = tokens[i + 1] ? tokens[i + 1][0] : 'empty' + if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { + if (value.slice(-1) === ',') { + clean = false + } else { + value += token[1] + } + } else { + clean = false + } + } else { + value += token[1] + } + } + if (!clean) { + let raw = tokens.reduce((all, i) => all + i[1], '') + node.raws[prop] = { raw, value } + } + node[prop] = value + } + + rule(tokens) { + tokens.pop() + + let node = new Rule() + this.init(node, tokens[0][2]) + + node.raws.between = this.spacesAndCommentsFromEnd(tokens) + this.raw(node, 'selector', tokens) + this.current = node + } + + spacesAndCommentsFromEnd(tokens) { + let lastTokenType + let spaces = '' + while (tokens.length) { + lastTokenType = tokens[tokens.length - 1][0] + if (lastTokenType !== 'space' && lastTokenType !== 'comment') break + spaces = tokens.pop()[1] + spaces + } + return spaces + } + + // Errors + + spacesAndCommentsFromStart(tokens) { + let next + let spaces = '' + while (tokens.length) { + next = tokens[0][0] + if (next !== 'space' && next !== 'comment') break + spaces += tokens.shift()[1] + } + return spaces + } + + spacesFromEnd(tokens) { + let lastTokenType + let spaces = '' + while (tokens.length) { + lastTokenType = tokens[tokens.length - 1][0] + if (lastTokenType !== 'space') break + spaces = tokens.pop()[1] + spaces + } + return spaces + } + + stringFrom(tokens, from) { + let result = '' + for (let i = from; i < tokens.length; i++) { + result += tokens[i][1] + } + tokens.splice(from, tokens.length - from) + return result + } + + unclosedBlock() { + let pos = this.current.source.start + throw this.input.error('Unclosed block', pos.line, pos.column) + } + + unclosedBracket(bracket) { + throw this.input.error( + 'Unclosed bracket', + { offset: bracket[2] }, + { offset: bracket[2] + 1 } + ) + } + + unexpectedClose(token) { + throw this.input.error( + 'Unexpected }', + { offset: token[2] }, + { offset: token[2] + 1 } + ) + } + + unknownWord(tokens) { + throw this.input.error( + 'Unknown word', + { offset: tokens[0][2] }, + { offset: tokens[0][2] + tokens[0][1].length } + ) + } + + unnamedAtrule(node, token) { + throw this.input.error( + 'At-rule without name', + { offset: token[2] }, + { offset: token[2] + token[1].length } + ) + } +} + +module.exports = Parser diff --git a/node_modules/postcss/lib/postcss.d.mts b/node_modules/postcss/lib/postcss.d.mts new file mode 100644 index 000000000..a8ca8c7a1 --- /dev/null +++ b/node_modules/postcss/lib/postcss.d.mts @@ -0,0 +1,72 @@ +export { + // postcss function / namespace + default, + + // Value exports from postcss.mjs + stringify, + fromJSON, + // @ts-expect-error This value exists, but it’s untyped. + plugin, + parse, + list, + + document, + comment, + atRule, + rule, + decl, + root, + + CssSyntaxError, + Declaration, + Container, + Processor, + Document, + Comment, + Warning, + AtRule, + Result, + Input, + Rule, + Root, + Node, + + // Type-only exports + AcceptedPlugin, + AnyNode, + AtRuleProps, + Builder, + ChildNode, + ChildProps, + CommentProps, + ContainerProps, + DeclarationProps, + DocumentProps, + FilePosition, + Helpers, + JSONHydrator, + Message, + NodeErrorOptions, + NodeProps, + OldPlugin, + Parser, + Plugin, + PluginCreator, + Position, + Postcss, + ProcessOptions, + RootProps, + RuleProps, + Source, + SourceMap, + SourceMapOptions, + Stringifier, + Syntax, + TransformCallback, + Transformer, + WarningOptions, + + // This is a class, but it’s not re-exported. That’s why it’s exported as type-only here. + type LazyResult, + +} from './postcss.js' diff --git a/node_modules/postcss/lib/postcss.d.ts b/node_modules/postcss/lib/postcss.d.ts new file mode 100644 index 000000000..146dae0bd --- /dev/null +++ b/node_modules/postcss/lib/postcss.d.ts @@ -0,0 +1,441 @@ +import { RawSourceMap, SourceMapGenerator } from 'source-map-js' + +import AtRule, { AtRuleProps } from './at-rule.js' +import Comment, { CommentProps } from './comment.js' +import Container, { ContainerProps } from './container.js' +import CssSyntaxError from './css-syntax-error.js' +import Declaration, { DeclarationProps } from './declaration.js' +import Document, { DocumentProps } from './document.js' +import Input, { FilePosition } from './input.js' +import LazyResult from './lazy-result.js' +import list from './list.js' +import Node, { + AnyNode, + ChildNode, + ChildProps, + NodeErrorOptions, + NodeProps, + Position, + Source +} from './node.js' +import Processor from './processor.js' +import Result, { Message } from './result.js' +import Root, { RootProps } from './root.js' +import Rule, { RuleProps } from './rule.js' +import Warning, { WarningOptions } from './warning.js' + +type DocumentProcessor = ( + document: Document, + helper: postcss.Helpers +) => Promise | void +type RootProcessor = (root: Root, helper: postcss.Helpers) => Promise | void +type DeclarationProcessor = ( + decl: Declaration, + helper: postcss.Helpers +) => Promise | void +type RuleProcessor = (rule: Rule, helper: postcss.Helpers) => Promise | void +type AtRuleProcessor = (atRule: AtRule, helper: postcss.Helpers) => Promise | void +type CommentProcessor = ( + comment: Comment, + helper: postcss.Helpers +) => Promise | void + +interface Processors { + /** + * Will be called on all`AtRule` nodes. + * + * Will be called again on node or children changes. + */ + AtRule?: { [name: string]: AtRuleProcessor } | AtRuleProcessor + + /** + * Will be called on all `AtRule` nodes, when all children will be processed. + * + * Will be called again on node or children changes. + */ + AtRuleExit?: { [name: string]: AtRuleProcessor } | AtRuleProcessor + + /** + * Will be called on all `Comment` nodes. + * + * Will be called again on node or children changes. + */ + Comment?: CommentProcessor + + /** + * Will be called on all `Comment` nodes after listeners + * for `Comment` event. + * + * Will be called again on node or children changes. + */ + CommentExit?: CommentProcessor + + /** + * Will be called on all `Declaration` nodes after listeners + * for `Declaration` event. + * + * Will be called again on node or children changes. + */ + Declaration?: { [prop: string]: DeclarationProcessor } | DeclarationProcessor + + /** + * Will be called on all `Declaration` nodes. + * + * Will be called again on node or children changes. + */ + DeclarationExit?: + | { [prop: string]: DeclarationProcessor } + | DeclarationProcessor + + /** + * Will be called on `Document` node. + * + * Will be called again on children changes. + */ + Document?: DocumentProcessor + + /** + * Will be called on `Document` node, when all children will be processed. + * + * Will be called again on children changes. + */ + DocumentExit?: DocumentProcessor + + /** + * Will be called on `Root` node once. + */ + Once?: RootProcessor + + /** + * Will be called on `Root` node once, when all children will be processed. + */ + OnceExit?: RootProcessor + + /** + * Will be called on `Root` node. + * + * Will be called again on children changes. + */ + Root?: RootProcessor + + /** + * Will be called on `Root` node, when all children will be processed. + * + * Will be called again on children changes. + */ + RootExit?: RootProcessor + + /** + * Will be called on all `Rule` nodes. + * + * Will be called again on node or children changes. + */ + Rule?: RuleProcessor + + /** + * Will be called on all `Rule` nodes, when all children will be processed. + * + * Will be called again on node or children changes. + */ + RuleExit?: RuleProcessor +} + +declare namespace postcss { + export { + AnyNode, + AtRule, + AtRuleProps, + ChildNode, + ChildProps, + Comment, + CommentProps, + Container, + ContainerProps, + CssSyntaxError, + Declaration, + DeclarationProps, + Document, + DocumentProps, + FilePosition, + Input, + LazyResult, + list, + Message, + Node, + NodeErrorOptions, + NodeProps, + Position, + Processor, + Result, + Root, + RootProps, + Rule, + RuleProps, + Source, + Warning, + WarningOptions + } + + export type SourceMap = SourceMapGenerator & { + toJSON(): RawSourceMap + } + + export type Helpers = { postcss: Postcss; result: Result } & Postcss + + export interface Plugin extends Processors { + postcssPlugin: string + prepare?: (result: Result) => Processors + } + + export interface PluginCreator { + (opts?: PluginOptions): Plugin | Processor + postcss: true + } + + export interface Transformer extends TransformCallback { + postcssPlugin: string + postcssVersion: string + } + + export interface TransformCallback { + (root: Root, result: Result): Promise | void + } + + export interface OldPlugin extends Transformer { + (opts?: T): Transformer + postcss: Transformer + } + + export type AcceptedPlugin = + | { + postcss: Processor | TransformCallback + } + | OldPlugin + | Plugin + | PluginCreator + | Processor + | TransformCallback + + export interface Parser { + ( + css: { toString(): string } | string, + opts?: Pick + ): RootNode + } + + export interface Builder { + (part: string, node?: AnyNode, type?: 'end' | 'start'): void + } + + export interface Stringifier { + (node: AnyNode, builder: Builder): void + } + + export interface JSONHydrator { + (data: object): Node + (data: object[]): Node[] + } + + export interface Syntax { + /** + * Function to generate AST by string. + */ + parse?: Parser + + /** + * Class to generate string by AST. + */ + stringify?: Stringifier + } + + export interface SourceMapOptions { + /** + * Use absolute path in generated source map. + */ + absolute?: boolean + + /** + * Indicates that PostCSS should add annotation comments to the CSS. + * By default, PostCSS will always add a comment with a path + * to the source map. PostCSS will not add annotations to CSS files + * that do not contain any comments. + * + * By default, PostCSS presumes that you want to save the source map as + * `opts.to + '.map'` and will use this path in the annotation comment. + * A different path can be set by providing a string value for annotation. + * + * If you have set `inline: true`, annotation cannot be disabled. + */ + annotation?: ((file: string, root: Root) => string) | boolean | string + + /** + * Override `from` in map’s sources. + */ + from?: string + + /** + * Indicates that the source map should be embedded in the output CSS + * as a Base64-encoded comment. By default, it is `true`. + * But if all previous maps are external, not inline, PostCSS will not embed + * the map even if you do not set this option. + * + * If you have an inline source map, the result.map property will be empty, + * as the source map will be contained within the text of `result.css`. + */ + inline?: boolean + + /** + * Source map content from a previous processing step (e.g., Sass). + * + * PostCSS will try to read the previous source map + * automatically (based on comments within the source CSS), but you can use + * this option to identify it manually. + * + * If desired, you can omit the previous map with prev: `false`. + */ + prev?: ((file: string) => string) | boolean | object | string + + /** + * Indicates that PostCSS should set the origin content (e.g., Sass source) + * of the source map. By default, it is true. But if all previous maps do not + * contain sources content, PostCSS will also leave it out even if you + * do not set this option. + */ + sourcesContent?: boolean + } + + export interface ProcessOptions { + /** + * The path of the CSS source file. You should always set `from`, + * because it is used in source map generation and syntax error messages. + */ + from?: string + + /** + * Source map options + */ + map?: boolean | SourceMapOptions + + /** + * Function to generate AST by string. + */ + parser?: Parser | Syntax + + /** + * Class to generate string by AST. + */ + stringifier?: Stringifier | Syntax + + /** + * Object with parse and stringify. + */ + syntax?: Syntax + + /** + * The path where you'll put the output CSS file. You should always set `to` + * to generate correct source maps. + */ + to?: string + } + + export type Postcss = typeof postcss + + /** + * Default function to convert a node tree into a CSS string. + */ + export let stringify: Stringifier + + /** + * Parses source css and returns a new `Root` or `Document` node, + * which contains the source CSS nodes. + * + * ```js + * // Simple CSS concatenation with source map support + * const root1 = postcss.parse(css1, { from: file1 }) + * const root2 = postcss.parse(css2, { from: file2 }) + * root1.append(root2).toResult().css + * ``` + */ + export let parse: Parser + + /** + * Rehydrate a JSON AST (from `Node#toJSON`) back into the AST classes. + * + * ```js + * const json = root.toJSON() + * // save to file, send by network, etc + * const root2 = postcss.fromJSON(json) + * ``` + */ + export let fromJSON: JSONHydrator + + /** + * Creates a new `Comment` node. + * + * @param defaults Properties for the new node. + * @return New comment node + */ + export function comment(defaults?: CommentProps): Comment + + /** + * Creates a new `AtRule` node. + * + * @param defaults Properties for the new node. + * @return New at-rule node. + */ + export function atRule(defaults?: AtRuleProps): AtRule + + /** + * Creates a new `Declaration` node. + * + * @param defaults Properties for the new node. + * @return New declaration node. + */ + export function decl(defaults?: DeclarationProps): Declaration + + /** + * Creates a new `Rule` node. + * + * @param default Properties for the new node. + * @return New rule node. + */ + export function rule(defaults?: RuleProps): Rule + + /** + * Creates a new `Root` node. + * + * @param defaults Properties for the new node. + * @return New root node. + */ + export function root(defaults?: RootProps): Root + + /** + * Creates a new `Document` node. + * + * @param defaults Properties for the new node. + * @return New document node. + */ + export function document(defaults?: DocumentProps): Document + + export { postcss as default } +} + +/** + * Create a new `Processor` instance that will apply `plugins` + * as CSS processors. + * + * ```js + * let postcss = require('postcss') + * + * postcss(plugins).process(css, { from, to }).then(result => { + * console.log(result.css) + * }) + * ``` + * + * @param plugins PostCSS plugins. + * @return Processor to process multiple CSS. + */ +declare function postcss(plugins?: postcss.AcceptedPlugin[]): Processor +declare function postcss(...plugins: postcss.AcceptedPlugin[]): Processor + +export = postcss diff --git a/node_modules/postcss/lib/postcss.js b/node_modules/postcss/lib/postcss.js new file mode 100644 index 000000000..080ee8378 --- /dev/null +++ b/node_modules/postcss/lib/postcss.js @@ -0,0 +1,101 @@ +'use strict' + +let CssSyntaxError = require('./css-syntax-error') +let Declaration = require('./declaration') +let LazyResult = require('./lazy-result') +let Container = require('./container') +let Processor = require('./processor') +let stringify = require('./stringify') +let fromJSON = require('./fromJSON') +let Document = require('./document') +let Warning = require('./warning') +let Comment = require('./comment') +let AtRule = require('./at-rule') +let Result = require('./result.js') +let Input = require('./input') +let parse = require('./parse') +let list = require('./list') +let Rule = require('./rule') +let Root = require('./root') +let Node = require('./node') + +function postcss(...plugins) { + if (plugins.length === 1 && Array.isArray(plugins[0])) { + plugins = plugins[0] + } + return new Processor(plugins) +} + +postcss.plugin = function plugin(name, initializer) { + let warningPrinted = false + function creator(...args) { + // eslint-disable-next-line no-console + if (console && console.warn && !warningPrinted) { + warningPrinted = true + // eslint-disable-next-line no-console + console.warn( + name + + ': postcss.plugin was deprecated. Migration guide:\n' + + 'https://evilmartians.com/chronicles/postcss-8-plugin-migration' + ) + if (process.env.LANG && process.env.LANG.startsWith('cn')) { + /* c8 ignore next 7 */ + // eslint-disable-next-line no-console + console.warn( + name + + ': 里面 postcss.plugin 被弃用. 迁移指南:\n' + + 'https://www.w3ctech.com/topic/2226' + ) + } + } + let transformer = initializer(...args) + transformer.postcssPlugin = name + transformer.postcssVersion = new Processor().version + return transformer + } + + let cache + Object.defineProperty(creator, 'postcss', { + get() { + if (!cache) cache = creator() + return cache + } + }) + + creator.process = function (css, processOpts, pluginOpts) { + return postcss([creator(pluginOpts)]).process(css, processOpts) + } + + return creator +} + +postcss.stringify = stringify +postcss.parse = parse +postcss.fromJSON = fromJSON +postcss.list = list + +postcss.comment = defaults => new Comment(defaults) +postcss.atRule = defaults => new AtRule(defaults) +postcss.decl = defaults => new Declaration(defaults) +postcss.rule = defaults => new Rule(defaults) +postcss.root = defaults => new Root(defaults) +postcss.document = defaults => new Document(defaults) + +postcss.CssSyntaxError = CssSyntaxError +postcss.Declaration = Declaration +postcss.Container = Container +postcss.Processor = Processor +postcss.Document = Document +postcss.Comment = Comment +postcss.Warning = Warning +postcss.AtRule = AtRule +postcss.Result = Result +postcss.Input = Input +postcss.Rule = Rule +postcss.Root = Root +postcss.Node = Node + +LazyResult.registerPostcss(postcss) + +module.exports = postcss +postcss.default = postcss diff --git a/node_modules/postcss/lib/postcss.mjs b/node_modules/postcss/lib/postcss.mjs new file mode 100644 index 000000000..35075988c --- /dev/null +++ b/node_modules/postcss/lib/postcss.mjs @@ -0,0 +1,30 @@ +import postcss from './postcss.js' + +export default postcss + +export const stringify = postcss.stringify +export const fromJSON = postcss.fromJSON +export const plugin = postcss.plugin +export const parse = postcss.parse +export const list = postcss.list + +export const document = postcss.document +export const comment = postcss.comment +export const atRule = postcss.atRule +export const rule = postcss.rule +export const decl = postcss.decl +export const root = postcss.root + +export const CssSyntaxError = postcss.CssSyntaxError +export const Declaration = postcss.Declaration +export const Container = postcss.Container +export const Processor = postcss.Processor +export const Document = postcss.Document +export const Comment = postcss.Comment +export const Warning = postcss.Warning +export const AtRule = postcss.AtRule +export const Result = postcss.Result +export const Input = postcss.Input +export const Rule = postcss.Rule +export const Root = postcss.Root +export const Node = postcss.Node diff --git a/node_modules/postcss/lib/previous-map.d.ts b/node_modules/postcss/lib/previous-map.d.ts new file mode 100644 index 000000000..23edeb5c5 --- /dev/null +++ b/node_modules/postcss/lib/previous-map.d.ts @@ -0,0 +1,81 @@ +import { SourceMapConsumer } from 'source-map-js' + +import { ProcessOptions } from './postcss.js' + +declare namespace PreviousMap { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { PreviousMap_ as default } +} + +/** + * Source map information from input CSS. + * For example, source map after Sass compiler. + * + * This class will automatically find source map in input CSS or in file system + * near input file (according `from` option). + * + * ```js + * const root = parse(css, { from: 'a.sass.css' }) + * root.input.map //=> PreviousMap + * ``` + */ +declare class PreviousMap_ { + /** + * `sourceMappingURL` content. + */ + annotation?: string + + /** + * The CSS source identifier. Contains `Input#file` if the user + * set the `from` option, or `Input#id` if they did not. + */ + file?: string + + /** + * Was source map inlined by data-uri to input CSS. + */ + inline: boolean + + /** + * Path to source map file. + */ + mapFile?: string + + /** + * The directory with source map file, if source map is in separated file. + */ + root?: string + + /** + * Source map file content. + */ + text?: string + + /** + * @param css Input CSS source. + * @param opts Process options. + */ + constructor(css: string, opts?: ProcessOptions) + + /** + * Create a instance of `SourceMapGenerator` class + * from the `source-map` library to work with source map information. + * + * It is lazy method, so it will create object only on first call + * and then it will use cache. + * + * @return Object with source map information. + */ + consumer(): SourceMapConsumer + + /** + * Does source map contains `sourcesContent` with input source text. + * + * @return Is `sourcesContent` present. + */ + withContent(): boolean +} + +declare class PreviousMap extends PreviousMap_ {} + +export = PreviousMap diff --git a/node_modules/postcss/lib/previous-map.js b/node_modules/postcss/lib/previous-map.js new file mode 100644 index 000000000..f3093dfb8 --- /dev/null +++ b/node_modules/postcss/lib/previous-map.js @@ -0,0 +1,142 @@ +'use strict' + +let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') +let { existsSync, readFileSync } = require('fs') +let { dirname, join } = require('path') + +function fromBase64(str) { + if (Buffer) { + return Buffer.from(str, 'base64').toString() + } else { + /* c8 ignore next 2 */ + return window.atob(str) + } +} + +class PreviousMap { + constructor(css, opts) { + if (opts.map === false) return + this.loadAnnotation(css) + this.inline = this.startWith(this.annotation, 'data:') + + let prev = opts.map ? opts.map.prev : undefined + let text = this.loadMap(opts.from, prev) + if (!this.mapFile && opts.from) { + this.mapFile = opts.from + } + if (this.mapFile) this.root = dirname(this.mapFile) + if (text) this.text = text + } + + consumer() { + if (!this.consumerCache) { + this.consumerCache = new SourceMapConsumer(this.text) + } + return this.consumerCache + } + + decodeInline(text) { + let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/ + let baseUri = /^data:application\/json;base64,/ + let charsetUri = /^data:application\/json;charset=utf-?8,/ + let uri = /^data:application\/json,/ + + if (charsetUri.test(text) || uri.test(text)) { + return decodeURIComponent(text.substr(RegExp.lastMatch.length)) + } + + if (baseCharsetUri.test(text) || baseUri.test(text)) { + return fromBase64(text.substr(RegExp.lastMatch.length)) + } + + let encoding = text.match(/data:application\/json;([^,]+),/)[1] + throw new Error('Unsupported source map encoding ' + encoding) + } + + getAnnotationURL(sourceMapString) { + return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim() + } + + isMap(map) { + if (typeof map !== 'object') return false + return ( + typeof map.mappings === 'string' || + typeof map._mappings === 'string' || + Array.isArray(map.sections) + ) + } + + loadAnnotation(css) { + let comments = css.match(/\/\*\s*# sourceMappingURL=/gm) + if (!comments) return + + // sourceMappingURLs from comments, strings, etc. + let start = css.lastIndexOf(comments.pop()) + let end = css.indexOf('*/', start) + + if (start > -1 && end > -1) { + // Locate the last sourceMappingURL to avoid pickin + this.annotation = this.getAnnotationURL(css.substring(start, end)) + } + } + + loadFile(path) { + this.root = dirname(path) + if (existsSync(path)) { + this.mapFile = path + return readFileSync(path, 'utf-8').toString().trim() + } + } + + loadMap(file, prev) { + if (prev === false) return false + + if (prev) { + if (typeof prev === 'string') { + return prev + } else if (typeof prev === 'function') { + let prevPath = prev(file) + if (prevPath) { + let map = this.loadFile(prevPath) + if (!map) { + throw new Error( + 'Unable to load previous source map: ' + prevPath.toString() + ) + } + return map + } + } else if (prev instanceof SourceMapConsumer) { + return SourceMapGenerator.fromSourceMap(prev).toString() + } else if (prev instanceof SourceMapGenerator) { + return prev.toString() + } else if (this.isMap(prev)) { + return JSON.stringify(prev) + } else { + throw new Error( + 'Unsupported previous source map format: ' + prev.toString() + ) + } + } else if (this.inline) { + return this.decodeInline(this.annotation) + } else if (this.annotation) { + let map = this.annotation + if (file) map = join(dirname(file), map) + return this.loadFile(map) + } + } + + startWith(string, start) { + if (!string) return false + return string.substr(0, start.length) === start + } + + withContent() { + return !!( + this.consumer().sourcesContent && + this.consumer().sourcesContent.length > 0 + ) + } +} + +module.exports = PreviousMap +PreviousMap.default = PreviousMap diff --git a/node_modules/postcss/lib/processor.d.ts b/node_modules/postcss/lib/processor.d.ts new file mode 100644 index 000000000..16c6a6656 --- /dev/null +++ b/node_modules/postcss/lib/processor.d.ts @@ -0,0 +1,111 @@ +import LazyResult from './lazy-result.js' +import NoWorkResult from './no-work-result.js' +import { + AcceptedPlugin, + Plugin, + ProcessOptions, + TransformCallback, + Transformer +} from './postcss.js' +import Result from './result.js' +import Root from './root.js' + +declare namespace Processor { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Processor_ as default } +} + +/** + * Contains plugins to process CSS. Create one `Processor` instance, + * initialize its plugins, and then use that instance on numerous CSS files. + * + * ```js + * const processor = postcss([autoprefixer, postcssNested]) + * processor.process(css1).then(result => console.log(result.css)) + * processor.process(css2).then(result => console.log(result.css)) + * ``` + */ +declare class Processor_ { + /** + * Plugins added to this processor. + * + * ```js + * const processor = postcss([autoprefixer, postcssNested]) + * processor.plugins.length //=> 2 + * ``` + */ + plugins: (Plugin | TransformCallback | Transformer)[] + + /** + * Current PostCSS version. + * + * ```js + * if (result.processor.version.split('.')[0] !== '6') { + * throw new Error('This plugin works only with PostCSS 6') + * } + * ``` + */ + version: string + + /** + * @param plugins PostCSS plugins + */ + constructor(plugins?: AcceptedPlugin[]) + + /** + * Parses source CSS and returns a `LazyResult` Promise proxy. + * Because some plugins can be asynchronous it doesn’t make + * any transformations. Transformations will be applied + * in the `LazyResult` methods. + * + * ```js + * processor.process(css, { from: 'a.css', to: 'a.out.css' }) + * .then(result => { + * console.log(result.css) + * }) + * ``` + * + * @param css String with input CSS or any object with a `toString()` method, + * like a Buffer. Optionally, send a `Result` instance + * and the processor will take the `Root` from it. + * @param opts Options. + * @return Promise proxy. + */ + process( + css: { toString(): string } | LazyResult | Result | Root | string, + options?: ProcessOptions + ): LazyResult | NoWorkResult + + /** + * Adds a plugin to be used as a CSS processor. + * + * PostCSS plugin can be in 4 formats: + * * A plugin in `Plugin` format. + * * A plugin creator function with `pluginCreator.postcss = true`. + * PostCSS will call this function without argument to get plugin. + * * A function. PostCSS will pass the function a {@link Root} + * as the first argument and current `Result` instance + * as the second. + * * Another `Processor` instance. PostCSS will copy plugins + * from that instance into this one. + * + * Plugins can also be added by passing them as arguments when creating + * a `postcss` instance (see [`postcss(plugins)`]). + * + * Asynchronous plugins should return a `Promise` instance. + * + * ```js + * const processor = postcss() + * .use(autoprefixer) + * .use(postcssNested) + * ``` + * + * @param plugin PostCSS plugin or `Processor` with plugins. + * @return Current processor to make methods chain. + */ + use(plugin: AcceptedPlugin): this +} + +declare class Processor extends Processor_ {} + +export = Processor diff --git a/node_modules/postcss/lib/processor.js b/node_modules/postcss/lib/processor.js new file mode 100644 index 000000000..57854cdbd --- /dev/null +++ b/node_modules/postcss/lib/processor.js @@ -0,0 +1,67 @@ +'use strict' + +let NoWorkResult = require('./no-work-result') +let LazyResult = require('./lazy-result') +let Document = require('./document') +let Root = require('./root') + +class Processor { + constructor(plugins = []) { + this.version = '8.4.25' + this.plugins = this.normalize(plugins) + } + + normalize(plugins) { + let normalized = [] + for (let i of plugins) { + if (i.postcss === true) { + i = i() + } else if (i.postcss) { + i = i.postcss + } + + if (typeof i === 'object' && Array.isArray(i.plugins)) { + normalized = normalized.concat(i.plugins) + } else if (typeof i === 'object' && i.postcssPlugin) { + normalized.push(i) + } else if (typeof i === 'function') { + normalized.push(i) + } else if (typeof i === 'object' && (i.parse || i.stringify)) { + if (process.env.NODE_ENV !== 'production') { + throw new Error( + 'PostCSS syntaxes cannot be used as plugins. Instead, please use ' + + 'one of the syntax/parser/stringifier options as outlined ' + + 'in your PostCSS runner documentation.' + ) + } + } else { + throw new Error(i + ' is not a PostCSS plugin') + } + } + return normalized + } + + process(css, opts = {}) { + if ( + this.plugins.length === 0 && + typeof opts.parser === 'undefined' && + typeof opts.stringifier === 'undefined' && + typeof opts.syntax === 'undefined' + ) { + return new NoWorkResult(this, css, opts) + } else { + return new LazyResult(this, css, opts) + } + } + + use(plugin) { + this.plugins = this.plugins.concat(this.normalize([plugin])) + return this + } +} + +module.exports = Processor +Processor.default = Processor + +Root.registerProcessor(Processor) +Document.registerProcessor(Processor) diff --git a/node_modules/postcss/lib/result.d.ts b/node_modules/postcss/lib/result.d.ts new file mode 100644 index 000000000..bde48f582 --- /dev/null +++ b/node_modules/postcss/lib/result.d.ts @@ -0,0 +1,206 @@ +import { + Document, + Node, + Plugin, + ProcessOptions, + Root, + SourceMap, + TransformCallback, + Warning, + WarningOptions +} from './postcss.js' +import Processor from './processor.js' + +declare namespace Result { + export interface Message { + [others: string]: any + + /** + * Source PostCSS plugin name. + */ + plugin?: string + + /** + * Message type. + */ + type: string + } + + export interface ResultOptions extends ProcessOptions { + /** + * The CSS node that was the source of the warning. + */ + node?: Node + + /** + * Name of plugin that created this warning. `Result#warn` will fill it + * automatically with `Plugin#postcssPlugin` value. + */ + plugin?: string + } + + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Result_ as default } +} + +/** + * Provides the result of the PostCSS transformations. + * + * A Result instance is returned by `LazyResult#then` + * or `Root#toResult` methods. + * + * ```js + * postcss([autoprefixer]).process(css).then(result => { + * console.log(result.css) + * }) + * ``` + * + * ```js + * const result2 = postcss.parse(css).toResult() + * ``` + */ +declare class Result_ { + /** + * A CSS string representing of `Result#root`. + * + * ```js + * postcss.parse('a{}').toResult().css //=> "a{}" + * ``` + */ + css: string + + /** + * Last runned PostCSS plugin. + */ + lastPlugin: Plugin | TransformCallback + + /** + * An instance of `SourceMapGenerator` class from the `source-map` library, + * representing changes to the `Result#root` instance. + * + * ```js + * result.map.toJSON() //=> { version: 3, file: 'a.css', … } + * ``` + * + * ```js + * if (result.map) { + * fs.writeFileSync(result.opts.to + '.map', result.map.toString()) + * } + * ``` + */ + map: SourceMap + + /** + * Contains messages from plugins (e.g., warnings or custom messages). + * Each message should have type and plugin properties. + * + * ```js + * AtRule: { + * import: (atRule, { result }) { + * const importedFile = parseImport(atRule) + * result.messages.push({ + * type: 'dependency', + * plugin: 'postcss-import', + * file: importedFile, + * parent: result.opts.from + * }) + * } + * } + * ``` + */ + messages: Result.Message[] + + /** + * Options from the `Processor#process` or `Root#toResult` call + * that produced this Result instance.] + * + * ```js + * root.toResult(opts).opts === opts + * ``` + */ + opts: Result.ResultOptions + + /** + * The Processor instance used for this transformation. + * + * ```js + * for (const plugin of result.processor.plugins) { + * if (plugin.postcssPlugin === 'postcss-bad') { + * throw 'postcss-good is incompatible with postcss-bad' + * } + * }) + * ``` + */ + processor: Processor + + /** + * Root node after all transformations. + * + * ```js + * root.toResult().root === root + * ``` + */ + root: Document | Root + + /** + * @param processor Processor used for this transformation. + * @param root Root node after all transformations. + * @param opts Options from the `Processor#process` or `Root#toResult`. + */ + constructor(processor: Processor, root: Document | Root, opts: Result.ResultOptions) + + /** + * An alias for the `Result#css` property. + * Use it with syntaxes that generate non-CSS output. + * + * ```js + * result.css === result.content + * ``` + */ + get content(): string + + /** + * Returns for `Result#css` content. + * + * ```js + * result + '' === result.css + * ``` + * + * @return String representing of `Result#root`. + */ + toString(): string + + /** + * Creates an instance of `Warning` and adds it to `Result#messages`. + * + * ```js + * if (decl.important) { + * result.warn('Avoid !important', { node: decl, word: '!important' }) + * } + * ``` + * + * @param text Warning message. + * @param opts Warning options. + * @return Created warning. + */ + warn(message: string, options?: WarningOptions): Warning + + /** + * Returns warnings from plugins. Filters `Warning` instances + * from `Result#messages`. + * + * ```js + * result.warnings().forEach(warn => { + * console.warn(warn.toString()) + * }) + * ``` + * + * @return Warnings from plugins. + */ + warnings(): Warning[] +} + +declare class Result extends Result_ {} + +export = Result diff --git a/node_modules/postcss/lib/result.js b/node_modules/postcss/lib/result.js new file mode 100644 index 000000000..4357c2e25 --- /dev/null +++ b/node_modules/postcss/lib/result.js @@ -0,0 +1,42 @@ +'use strict' + +let Warning = require('./warning') + +class Result { + constructor(processor, root, opts) { + this.processor = processor + this.messages = [] + this.root = root + this.opts = opts + this.css = undefined + this.map = undefined + } + + get content() { + return this.css + } + + toString() { + return this.css + } + + warn(text, opts = {}) { + if (!opts.plugin) { + if (this.lastPlugin && this.lastPlugin.postcssPlugin) { + opts.plugin = this.lastPlugin.postcssPlugin + } + } + + let warning = new Warning(text, opts) + this.messages.push(warning) + + return warning + } + + warnings() { + return this.messages.filter(i => i.type === 'warning') + } +} + +module.exports = Result +Result.default = Result diff --git a/node_modules/postcss/lib/root.d.ts b/node_modules/postcss/lib/root.d.ts new file mode 100644 index 000000000..4ba23eb2b --- /dev/null +++ b/node_modules/postcss/lib/root.d.ts @@ -0,0 +1,82 @@ +import Container, { ContainerProps } from './container.js' +import Document from './document.js' +import { ProcessOptions } from './postcss.js' +import Result from './result.js' + +declare namespace Root { + export interface RootRaws extends Record { + /** + * The space symbols after the last child to the end of file. + */ + after?: string + + /** + * Non-CSS code after `Root`, when `Root` is inside `Document`. + * + * **Experimental:** some aspects of this node could change within minor + * or patch version releases. + */ + codeAfter?: string + + /** + * Non-CSS code before `Root`, when `Root` is inside `Document`. + * + * **Experimental:** some aspects of this node could change within minor + * or patch version releases. + */ + codeBefore?: string + + /** + * Is the last child has an (optional) semicolon. + */ + semicolon?: boolean + } + + export interface RootProps extends ContainerProps { + /** + * Information used to generate byte-to-byte equal node string + * as it was in the origin input. + * */ + raws?: RootRaws + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Root_ as default } +} + +/** + * Represents a CSS file and contains all its parsed nodes. + * + * ```js + * const root = postcss.parse('a{color:black} b{z-index:2}') + * root.type //=> 'root' + * root.nodes.length //=> 2 + * ``` + */ +declare class Root_ extends Container { + parent: Document | undefined + raws: Root.RootRaws + type: 'root' + + constructor(defaults?: Root.RootProps) + + assign(overrides: object | Root.RootProps): this + /** + * Returns a `Result` instance representing the root’s CSS. + * + * ```js + * const root1 = postcss.parse(css1, { from: 'a.css' }) + * const root2 = postcss.parse(css2, { from: 'b.css' }) + * root1.append(root2) + * const result = root1.toResult({ to: 'all.css', map: true }) + * ``` + * + * @param opts Options. + * @return Result with current root’s CSS. + */ + toResult(options?: ProcessOptions): Result +} + +declare class Root extends Root_ {} + +export = Root diff --git a/node_modules/postcss/lib/root.js b/node_modules/postcss/lib/root.js new file mode 100644 index 000000000..ea574edca --- /dev/null +++ b/node_modules/postcss/lib/root.js @@ -0,0 +1,61 @@ +'use strict' + +let Container = require('./container') + +let LazyResult, Processor + +class Root extends Container { + constructor(defaults) { + super(defaults) + this.type = 'root' + if (!this.nodes) this.nodes = [] + } + + normalize(child, sample, type) { + let nodes = super.normalize(child) + + if (sample) { + if (type === 'prepend') { + if (this.nodes.length > 1) { + sample.raws.before = this.nodes[1].raws.before + } else { + delete sample.raws.before + } + } else if (this.first !== sample) { + for (let node of nodes) { + node.raws.before = sample.raws.before + } + } + } + + return nodes + } + + removeChild(child, ignore) { + let index = this.index(child) + + if (!ignore && index === 0 && this.nodes.length > 1) { + this.nodes[1].raws.before = this.nodes[index].raws.before + } + + return super.removeChild(child) + } + + toResult(opts = {}) { + let lazy = new LazyResult(new Processor(), this, opts) + return lazy.stringify() + } +} + +Root.registerLazyResult = dependant => { + LazyResult = dependant +} + +Root.registerProcessor = dependant => { + Processor = dependant +} + +module.exports = Root +Root.default = Root + +Container.registerRoot(Root) diff --git a/node_modules/postcss/lib/rule.d.ts b/node_modules/postcss/lib/rule.d.ts new file mode 100644 index 000000000..307c6a67a --- /dev/null +++ b/node_modules/postcss/lib/rule.d.ts @@ -0,0 +1,113 @@ +import Container, { ContainerProps } from './container.js' + +declare namespace Rule { + export interface RuleRaws extends Record { + /** + * The space symbols after the last child of the node to the end of the node. + */ + after?: string + + /** + * The space symbols before the node. It also stores `*` + * and `_` symbols before the declaration (IE hack). + */ + before?: string + + /** + * The symbols between the selector and `{` for rules. + */ + between?: string + + /** + * Contains `true` if there is semicolon after rule. + */ + ownSemicolon?: string + + /** + * The rule’s selector with comments. + */ + selector?: { + raw: string + value: string + } + + /** + * Contains `true` if the last child has an (optional) semicolon. + */ + semicolon?: boolean + } + + export interface RuleProps extends ContainerProps { + /** Information used to generate byte-to-byte equal node string as it was in the origin input. */ + raws?: RuleRaws + /** Selector or selectors of the rule. */ + selector?: string + /** Selectors of the rule represented as an array of strings. */ + selectors?: string[] + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Rule_ as default } +} + +/** + * Represents a CSS rule: a selector followed by a declaration block. + * + * ```js + * Once (root, { Rule }) { + * let a = new Rule({ selector: 'a' }) + * a.append(…) + * root.append(a) + * } + * ``` + * + * ```js + * const root = postcss.parse('a{}') + * const rule = root.first + * rule.type //=> 'rule' + * rule.toString() //=> 'a{}' + * ``` + */ +declare class Rule_ extends Container { + parent: Container | undefined + raws: Rule.RuleRaws + /** + * The rule’s full selector represented as a string. + * + * ```js + * const root = postcss.parse('a, b { }') + * const rule = root.first + * rule.selector //=> 'a, b' + * ``` + */ + selector: string + + /** + * An array containing the rule’s individual selectors. + * Groups of selectors are split at commas. + * + * ```js + * const root = postcss.parse('a, b { }') + * const rule = root.first + * + * rule.selector //=> 'a, b' + * rule.selectors //=> ['a', 'b'] + * + * rule.selectors = ['a', 'strong'] + * rule.selector //=> 'a, strong' + * ``` + */ + selectors: string[] + + type: 'rule' + + constructor(defaults?: Rule.RuleProps) + assign(overrides: object | Rule.RuleProps): this + clone(overrides?: Partial): this + cloneAfter(overrides?: Partial): this + cloneBefore(overrides?: Partial): this +} + +declare class Rule extends Rule_ {} + +export = Rule diff --git a/node_modules/postcss/lib/rule.js b/node_modules/postcss/lib/rule.js new file mode 100644 index 000000000..a93ab25bf --- /dev/null +++ b/node_modules/postcss/lib/rule.js @@ -0,0 +1,27 @@ +'use strict' + +let Container = require('./container') +let list = require('./list') + +class Rule extends Container { + constructor(defaults) { + super(defaults) + this.type = 'rule' + if (!this.nodes) this.nodes = [] + } + + get selectors() { + return list.comma(this.selector) + } + + set selectors(values) { + let match = this.selector ? this.selector.match(/,\s*/) : null + let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen') + this.selector = values.join(sep) + } +} + +module.exports = Rule +Rule.default = Rule + +Container.registerRule(Rule) diff --git a/node_modules/postcss/lib/stringifier.d.ts b/node_modules/postcss/lib/stringifier.d.ts new file mode 100644 index 000000000..f707a6aa3 --- /dev/null +++ b/node_modules/postcss/lib/stringifier.d.ts @@ -0,0 +1,46 @@ +import { + AnyNode, + AtRule, + Builder, + Comment, + Container, + Declaration, + Document, + Root, + Rule +} from './postcss.js' + +declare namespace Stringifier { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Stringifier_ as default } +} + +declare class Stringifier_ { + builder: Builder + constructor(builder: Builder) + atrule(node: AtRule, semicolon?: boolean): void + beforeAfter(node: AnyNode, detect: 'after' | 'before'): string + block(node: AnyNode, start: string): void + body(node: Container): void + comment(node: Comment): void + decl(node: Declaration, semicolon?: boolean): void + document(node: Document): void + raw(node: AnyNode, own: null | string, detect?: string): string + rawBeforeClose(root: Root): string | undefined + rawBeforeComment(root: Root, node: Comment): string | undefined + rawBeforeDecl(root: Root, node: Declaration): string | undefined + rawBeforeOpen(root: Root): string | undefined + rawBeforeRule(root: Root): string | undefined + rawColon(root: Root): string | undefined + rawEmptyBody(root: Root): string | undefined + rawIndent(root: Root): string | undefined + rawSemicolon(root: Root): boolean | undefined + rawValue(node: AnyNode, prop: string): string + root(node: Root): void + rule(node: Rule): void + stringify(node: AnyNode, semicolon?: boolean): void +} + +declare class Stringifier extends Stringifier_ {} + +export = Stringifier diff --git a/node_modules/postcss/lib/stringifier.js b/node_modules/postcss/lib/stringifier.js new file mode 100644 index 000000000..e07ad12e7 --- /dev/null +++ b/node_modules/postcss/lib/stringifier.js @@ -0,0 +1,353 @@ +'use strict' + +const DEFAULT_RAW = { + after: '\n', + beforeClose: '\n', + beforeComment: '\n', + beforeDecl: '\n', + beforeOpen: ' ', + beforeRule: '\n', + colon: ': ', + commentLeft: ' ', + commentRight: ' ', + emptyBody: '', + indent: ' ', + semicolon: false +} + +function capitalize(str) { + return str[0].toUpperCase() + str.slice(1) +} + +class Stringifier { + constructor(builder) { + this.builder = builder + } + + atrule(node, semicolon) { + let name = '@' + node.name + let params = node.params ? this.rawValue(node, 'params') : '' + + if (typeof node.raws.afterName !== 'undefined') { + name += node.raws.afterName + } else if (params) { + name += ' ' + } + + if (node.nodes) { + this.block(node, name + params) + } else { + let end = (node.raws.between || '') + (semicolon ? ';' : '') + this.builder(name + params + end, node) + } + } + + beforeAfter(node, detect) { + let value + if (node.type === 'decl') { + value = this.raw(node, null, 'beforeDecl') + } else if (node.type === 'comment') { + value = this.raw(node, null, 'beforeComment') + } else if (detect === 'before') { + value = this.raw(node, null, 'beforeRule') + } else { + value = this.raw(node, null, 'beforeClose') + } + + let buf = node.parent + let depth = 0 + while (buf && buf.type !== 'root') { + depth += 1 + buf = buf.parent + } + + if (value.includes('\n')) { + let indent = this.raw(node, null, 'indent') + if (indent.length) { + for (let step = 0; step < depth; step++) value += indent + } + } + + return value + } + + block(node, start) { + let between = this.raw(node, 'between', 'beforeOpen') + this.builder(start + between + '{', node, 'start') + + let after + if (node.nodes && node.nodes.length) { + this.body(node) + after = this.raw(node, 'after') + } else { + after = this.raw(node, 'after', 'emptyBody') + } + + if (after) this.builder(after) + this.builder('}', node, 'end') + } + + body(node) { + let last = node.nodes.length - 1 + while (last > 0) { + if (node.nodes[last].type !== 'comment') break + last -= 1 + } + + let semicolon = this.raw(node, 'semicolon') + for (let i = 0; i < node.nodes.length; i++) { + let child = node.nodes[i] + let before = this.raw(child, 'before') + if (before) this.builder(before) + this.stringify(child, last !== i || semicolon) + } + } + + comment(node) { + let left = this.raw(node, 'left', 'commentLeft') + let right = this.raw(node, 'right', 'commentRight') + this.builder('/*' + left + node.text + right + '*/', node) + } + + decl(node, semicolon) { + let between = this.raw(node, 'between', 'colon') + let string = node.prop + between + this.rawValue(node, 'value') + + if (node.important) { + string += node.raws.important || ' !important' + } + + if (semicolon) string += ';' + this.builder(string, node) + } + + document(node) { + this.body(node) + } + + raw(node, own, detect) { + let value + if (!detect) detect = own + + // Already had + if (own) { + value = node.raws[own] + if (typeof value !== 'undefined') return value + } + + let parent = node.parent + + if (detect === 'before') { + // Hack for first rule in CSS + if (!parent || (parent.type === 'root' && parent.first === node)) { + return '' + } + + // `root` nodes in `document` should use only their own raws + if (parent && parent.type === 'document') { + return '' + } + } + + // Floating child without parent + if (!parent) return DEFAULT_RAW[detect] + + // Detect style by other nodes + let root = node.root() + if (!root.rawCache) root.rawCache = {} + if (typeof root.rawCache[detect] !== 'undefined') { + return root.rawCache[detect] + } + + if (detect === 'before' || detect === 'after') { + return this.beforeAfter(node, detect) + } else { + let method = 'raw' + capitalize(detect) + if (this[method]) { + value = this[method](root, node) + } else { + root.walk(i => { + value = i.raws[own] + if (typeof value !== 'undefined') return false + }) + } + } + + if (typeof value === 'undefined') value = DEFAULT_RAW[detect] + + root.rawCache[detect] = value + return value + } + + rawBeforeClose(root) { + let value + root.walk(i => { + if (i.nodes && i.nodes.length > 0) { + if (typeof i.raws.after !== 'undefined') { + value = i.raws.after + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, '') + } + return false + } + } + }) + if (value) value = value.replace(/\S/g, '') + return value + } + + rawBeforeComment(root, node) { + let value + root.walkComments(i => { + if (typeof i.raws.before !== 'undefined') { + value = i.raws.before + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, '') + } + return false + } + }) + if (typeof value === 'undefined') { + value = this.raw(node, null, 'beforeDecl') + } else if (value) { + value = value.replace(/\S/g, '') + } + return value + } + + rawBeforeDecl(root, node) { + let value + root.walkDecls(i => { + if (typeof i.raws.before !== 'undefined') { + value = i.raws.before + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, '') + } + return false + } + }) + if (typeof value === 'undefined') { + value = this.raw(node, null, 'beforeRule') + } else if (value) { + value = value.replace(/\S/g, '') + } + return value + } + + rawBeforeOpen(root) { + let value + root.walk(i => { + if (i.type !== 'decl') { + value = i.raws.between + if (typeof value !== 'undefined') return false + } + }) + return value + } + + rawBeforeRule(root) { + let value + root.walk(i => { + if (i.nodes && (i.parent !== root || root.first !== i)) { + if (typeof i.raws.before !== 'undefined') { + value = i.raws.before + if (value.includes('\n')) { + value = value.replace(/[^\n]+$/, '') + } + return false + } + } + }) + if (value) value = value.replace(/\S/g, '') + return value + } + + rawColon(root) { + let value + root.walkDecls(i => { + if (typeof i.raws.between !== 'undefined') { + value = i.raws.between.replace(/[^\s:]/g, '') + return false + } + }) + return value + } + + rawEmptyBody(root) { + let value + root.walk(i => { + if (i.nodes && i.nodes.length === 0) { + value = i.raws.after + if (typeof value !== 'undefined') return false + } + }) + return value + } + + rawIndent(root) { + if (root.raws.indent) return root.raws.indent + let value + root.walk(i => { + let p = i.parent + if (p && p !== root && p.parent && p.parent === root) { + if (typeof i.raws.before !== 'undefined') { + let parts = i.raws.before.split('\n') + value = parts[parts.length - 1] + value = value.replace(/\S/g, '') + return false + } + } + }) + return value + } + + rawSemicolon(root) { + let value + root.walk(i => { + if (i.nodes && i.nodes.length && i.last.type === 'decl') { + value = i.raws.semicolon + if (typeof value !== 'undefined') return false + } + }) + return value + } + + rawValue(node, prop) { + let value = node[prop] + let raw = node.raws[prop] + if (raw && raw.value === value) { + return raw.raw + } + + return value + } + + root(node) { + this.body(node) + if (node.raws.after) this.builder(node.raws.after) + } + + rule(node) { + this.block(node, this.rawValue(node, 'selector')) + if (node.raws.ownSemicolon) { + this.builder(node.raws.ownSemicolon, node, 'end') + } + } + + stringify(node, semicolon) { + /* c8 ignore start */ + if (!this[node.type]) { + throw new Error( + 'Unknown AST node type ' + + node.type + + '. ' + + 'Maybe you need to change PostCSS stringifier.' + ) + } + /* c8 ignore stop */ + this[node.type](node, semicolon) + } +} + +module.exports = Stringifier +Stringifier.default = Stringifier diff --git a/node_modules/postcss/lib/stringify.d.ts b/node_modules/postcss/lib/stringify.d.ts new file mode 100644 index 000000000..06ad0b4de --- /dev/null +++ b/node_modules/postcss/lib/stringify.d.ts @@ -0,0 +1,9 @@ +import { Stringifier } from './postcss.js' + +interface Stringify extends Stringifier { + default: Stringify +} + +declare const stringify: Stringify + +export = stringify diff --git a/node_modules/postcss/lib/stringify.js b/node_modules/postcss/lib/stringify.js new file mode 100644 index 000000000..77bd0178b --- /dev/null +++ b/node_modules/postcss/lib/stringify.js @@ -0,0 +1,11 @@ +'use strict' + +let Stringifier = require('./stringifier') + +function stringify(node, builder) { + let str = new Stringifier(builder) + str.stringify(node) +} + +module.exports = stringify +stringify.default = stringify diff --git a/node_modules/postcss/lib/symbols.js b/node_modules/postcss/lib/symbols.js new file mode 100644 index 000000000..a142c268d --- /dev/null +++ b/node_modules/postcss/lib/symbols.js @@ -0,0 +1,5 @@ +'use strict' + +module.exports.isClean = Symbol('isClean') + +module.exports.my = Symbol('my') diff --git a/node_modules/postcss/lib/terminal-highlight.js b/node_modules/postcss/lib/terminal-highlight.js new file mode 100644 index 000000000..6196c9df1 --- /dev/null +++ b/node_modules/postcss/lib/terminal-highlight.js @@ -0,0 +1,70 @@ +'use strict' + +let pico = require('picocolors') + +let tokenizer = require('./tokenize') + +let Input + +function registerInput(dependant) { + Input = dependant +} + +const HIGHLIGHT_THEME = { + ';': pico.yellow, + ':': pico.yellow, + '(': pico.cyan, + ')': pico.cyan, + '[': pico.yellow, + ']': pico.yellow, + '{': pico.yellow, + '}': pico.yellow, + 'at-word': pico.cyan, + 'brackets': pico.cyan, + 'call': pico.cyan, + 'class': pico.yellow, + 'comment': pico.gray, + 'hash': pico.magenta, + 'string': pico.green +} + +function getTokenType([type, value], processor) { + if (type === 'word') { + if (value[0] === '.') { + return 'class' + } + if (value[0] === '#') { + return 'hash' + } + } + + if (!processor.endOfFile()) { + let next = processor.nextToken() + processor.back(next) + if (next[0] === 'brackets' || next[0] === '(') return 'call' + } + + return type +} + +function terminalHighlight(css) { + let processor = tokenizer(new Input(css), { ignoreErrors: true }) + let result = '' + while (!processor.endOfFile()) { + let token = processor.nextToken() + let color = HIGHLIGHT_THEME[getTokenType(token, processor)] + if (color) { + result += token[1] + .split(/\r?\n/) + .map(i => color(i)) + .join('\n') + } else { + result += token[1] + } + } + return result +} + +terminalHighlight.registerInput = registerInput + +module.exports = terminalHighlight diff --git a/node_modules/postcss/lib/tokenize.js b/node_modules/postcss/lib/tokenize.js new file mode 100644 index 000000000..5a9ed1764 --- /dev/null +++ b/node_modules/postcss/lib/tokenize.js @@ -0,0 +1,266 @@ +'use strict' + +const SINGLE_QUOTE = "'".charCodeAt(0) +const DOUBLE_QUOTE = '"'.charCodeAt(0) +const BACKSLASH = '\\'.charCodeAt(0) +const SLASH = '/'.charCodeAt(0) +const NEWLINE = '\n'.charCodeAt(0) +const SPACE = ' '.charCodeAt(0) +const FEED = '\f'.charCodeAt(0) +const TAB = '\t'.charCodeAt(0) +const CR = '\r'.charCodeAt(0) +const OPEN_SQUARE = '['.charCodeAt(0) +const CLOSE_SQUARE = ']'.charCodeAt(0) +const OPEN_PARENTHESES = '('.charCodeAt(0) +const CLOSE_PARENTHESES = ')'.charCodeAt(0) +const OPEN_CURLY = '{'.charCodeAt(0) +const CLOSE_CURLY = '}'.charCodeAt(0) +const SEMICOLON = ';'.charCodeAt(0) +const ASTERISK = '*'.charCodeAt(0) +const COLON = ':'.charCodeAt(0) +const AT = '@'.charCodeAt(0) + +const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g +const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g +const RE_BAD_BRACKET = /.[\n"'(/\\]/ +const RE_HEX_ESCAPE = /[\da-f]/i + +module.exports = function tokenizer(input, options = {}) { + let css = input.css.valueOf() + let ignore = options.ignoreErrors + + let code, next, quote, content, escape + let escaped, escapePos, prev, n, currentToken + + let length = css.length + let pos = 0 + let buffer = [] + let returned = [] + + function position() { + return pos + } + + function unclosed(what) { + throw input.error('Unclosed ' + what, pos) + } + + function endOfFile() { + return returned.length === 0 && pos >= length + } + + function nextToken(opts) { + if (returned.length) return returned.pop() + if (pos >= length) return + + let ignoreUnclosed = opts ? opts.ignoreUnclosed : false + + code = css.charCodeAt(pos) + + switch (code) { + case NEWLINE: + case SPACE: + case TAB: + case CR: + case FEED: { + next = pos + do { + next += 1 + code = css.charCodeAt(next) + } while ( + code === SPACE || + code === NEWLINE || + code === TAB || + code === CR || + code === FEED + ) + + currentToken = ['space', css.slice(pos, next)] + pos = next - 1 + break + } + + case OPEN_SQUARE: + case CLOSE_SQUARE: + case OPEN_CURLY: + case CLOSE_CURLY: + case COLON: + case SEMICOLON: + case CLOSE_PARENTHESES: { + let controlChar = String.fromCharCode(code) + currentToken = [controlChar, controlChar, pos] + break + } + + case OPEN_PARENTHESES: { + prev = buffer.length ? buffer.pop()[1] : '' + n = css.charCodeAt(pos + 1) + if ( + prev === 'url' && + n !== SINGLE_QUOTE && + n !== DOUBLE_QUOTE && + n !== SPACE && + n !== NEWLINE && + n !== TAB && + n !== FEED && + n !== CR + ) { + next = pos + do { + escaped = false + next = css.indexOf(')', next + 1) + if (next === -1) { + if (ignore || ignoreUnclosed) { + next = pos + break + } else { + unclosed('bracket') + } + } + escapePos = next + while (css.charCodeAt(escapePos - 1) === BACKSLASH) { + escapePos -= 1 + escaped = !escaped + } + } while (escaped) + + currentToken = ['brackets', css.slice(pos, next + 1), pos, next] + + pos = next + } else { + next = css.indexOf(')', pos + 1) + content = css.slice(pos, next + 1) + + if (next === -1 || RE_BAD_BRACKET.test(content)) { + currentToken = ['(', '(', pos] + } else { + currentToken = ['brackets', content, pos, next] + pos = next + } + } + + break + } + + case SINGLE_QUOTE: + case DOUBLE_QUOTE: { + quote = code === SINGLE_QUOTE ? "'" : '"' + next = pos + do { + escaped = false + next = css.indexOf(quote, next + 1) + if (next === -1) { + if (ignore || ignoreUnclosed) { + next = pos + 1 + break + } else { + unclosed('string') + } + } + escapePos = next + while (css.charCodeAt(escapePos - 1) === BACKSLASH) { + escapePos -= 1 + escaped = !escaped + } + } while (escaped) + + currentToken = ['string', css.slice(pos, next + 1), pos, next] + pos = next + break + } + + case AT: { + RE_AT_END.lastIndex = pos + 1 + RE_AT_END.test(css) + if (RE_AT_END.lastIndex === 0) { + next = css.length - 1 + } else { + next = RE_AT_END.lastIndex - 2 + } + + currentToken = ['at-word', css.slice(pos, next + 1), pos, next] + + pos = next + break + } + + case BACKSLASH: { + next = pos + escape = true + while (css.charCodeAt(next + 1) === BACKSLASH) { + next += 1 + escape = !escape + } + code = css.charCodeAt(next + 1) + if ( + escape && + code !== SLASH && + code !== SPACE && + code !== NEWLINE && + code !== TAB && + code !== CR && + code !== FEED + ) { + next += 1 + if (RE_HEX_ESCAPE.test(css.charAt(next))) { + while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { + next += 1 + } + if (css.charCodeAt(next + 1) === SPACE) { + next += 1 + } + } + } + + currentToken = ['word', css.slice(pos, next + 1), pos, next] + + pos = next + break + } + + default: { + if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { + next = css.indexOf('*/', pos + 2) + 1 + if (next === 0) { + if (ignore || ignoreUnclosed) { + next = css.length + } else { + unclosed('comment') + } + } + + currentToken = ['comment', css.slice(pos, next + 1), pos, next] + pos = next + } else { + RE_WORD_END.lastIndex = pos + 1 + RE_WORD_END.test(css) + if (RE_WORD_END.lastIndex === 0) { + next = css.length - 1 + } else { + next = RE_WORD_END.lastIndex - 2 + } + + currentToken = ['word', css.slice(pos, next + 1), pos, next] + buffer.push(currentToken) + pos = next + } + + break + } + } + + pos++ + return currentToken + } + + function back(token) { + returned.push(token) + } + + return { + back, + endOfFile, + nextToken, + position + } +} diff --git a/node_modules/postcss/lib/warn-once.js b/node_modules/postcss/lib/warn-once.js new file mode 100644 index 000000000..316e1cf46 --- /dev/null +++ b/node_modules/postcss/lib/warn-once.js @@ -0,0 +1,13 @@ +/* eslint-disable no-console */ +'use strict' + +let printed = {} + +module.exports = function warnOnce(message) { + if (printed[message]) return + printed[message] = true + + if (typeof console !== 'undefined' && console.warn) { + console.warn(message) + } +} diff --git a/node_modules/postcss/lib/warning.d.ts b/node_modules/postcss/lib/warning.d.ts new file mode 100644 index 000000000..b25bba816 --- /dev/null +++ b/node_modules/postcss/lib/warning.d.ts @@ -0,0 +1,147 @@ +import { RangePosition } from './css-syntax-error.js' +import Node from './node.js' + +declare namespace Warning { + export interface WarningOptions { + /** + * End position, exclusive, in CSS node string that caused the warning. + */ + end?: RangePosition + + /** + * End index, exclusive, in CSS node string that caused the warning. + */ + endIndex?: number + + /** + * Start index, inclusive, in CSS node string that caused the warning. + */ + index?: number + + /** + * CSS node that caused the warning. + */ + node?: Node + + /** + * Name of the plugin that created this warning. `Result#warn` fills + * this property automatically. + */ + plugin?: string + + /** + * Start position, inclusive, in CSS node string that caused the warning. + */ + start?: RangePosition + + /** + * Word in CSS source that caused the warning. + */ + word?: string + } + + // eslint-disable-next-line @typescript-eslint/no-use-before-define + export { Warning_ as default } +} + +/** + * Represents a plugin’s warning. It can be created using `Node#warn`. + * + * ```js + * if (decl.important) { + * decl.warn(result, 'Avoid !important', { word: '!important' }) + * } + * ``` + */ +declare class Warning_ { + /** + * Column for inclusive start position in the input file with this warning’s source. + * + * ```js + * warning.column //=> 6 + * ``` + */ + column: number + + /** + * Column for exclusive end position in the input file with this warning’s source. + * + * ```js + * warning.endColumn //=> 4 + * ``` + */ + endColumn?: number + + /** + * Line for exclusive end position in the input file with this warning’s source. + * + * ```js + * warning.endLine //=> 6 + * ``` + */ + endLine?: number + + /** + * Line for inclusive start position in the input file with this warning’s source. + * + * ```js + * warning.line //=> 5 + * ``` + */ + line: number + + /** + * Contains the CSS node that caused the warning. + * + * ```js + * warning.node.toString() //=> 'color: white !important' + * ``` + */ + node: Node + + /** + * The name of the plugin that created this warning. + * When you call `Node#warn` it will fill this property automatically. + * + * ```js + * warning.plugin //=> 'postcss-important' + * ``` + */ + plugin: string + + /** + * The warning message. + * + * ```js + * warning.text //=> 'Try to avoid !important' + * ``` + */ + text: string + + /** + * Type to filter warnings from `Result#messages`. + * Always equal to `"warning"`. + */ + type: 'warning' + + /** + * @param text Warning message. + * @param opts Warning options. + */ + constructor(text: string, opts?: Warning.WarningOptions) + + /** + * Returns a warning position and message. + * + * ```js + * warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important' + * ``` + * + * @return Warning position and message. + */ + toString(): string +} + +declare class Warning extends Warning_ {} + +export = Warning diff --git a/node_modules/postcss/lib/warning.js b/node_modules/postcss/lib/warning.js new file mode 100644 index 000000000..3a3d79c93 --- /dev/null +++ b/node_modules/postcss/lib/warning.js @@ -0,0 +1,37 @@ +'use strict' + +class Warning { + constructor(text, opts = {}) { + this.type = 'warning' + this.text = text + + if (opts.node && opts.node.source) { + let range = opts.node.rangeBy(opts) + this.line = range.start.line + this.column = range.start.column + this.endLine = range.end.line + this.endColumn = range.end.column + } + + for (let opt in opts) this[opt] = opts[opt] + } + + toString() { + if (this.node) { + return this.node.error(this.text, { + index: this.index, + plugin: this.plugin, + word: this.word + }).message + } + + if (this.plugin) { + return this.plugin + ': ' + this.text + } + + return this.text + } +} + +module.exports = Warning +Warning.default = Warning diff --git a/node_modules/postcss/package.json b/node_modules/postcss/package.json new file mode 100755 index 000000000..0aee9a8c8 --- /dev/null +++ b/node_modules/postcss/package.json @@ -0,0 +1,88 @@ +{ + "name": "postcss", + "version": "8.4.25", + "description": "Tool for transforming styles with JS plugins", + "engines": { + "node": "^10 || ^12 || >=14" + }, + "exports": { + ".": { + "require": "./lib/postcss.js", + "import": "./lib/postcss.mjs" + }, + "./lib/at-rule": "./lib/at-rule.js", + "./lib/comment": "./lib/comment.js", + "./lib/container": "./lib/container.js", + "./lib/css-syntax-error": "./lib/css-syntax-error.js", + "./lib/declaration": "./lib/declaration.js", + "./lib/fromJSON": "./lib/fromJSON.js", + "./lib/input": "./lib/input.js", + "./lib/lazy-result": "./lib/lazy-result.js", + "./lib/no-work-result": "./lib/no-work-result.js", + "./lib/list": "./lib/list.js", + "./lib/map-generator": "./lib/map-generator.js", + "./lib/node": "./lib/node.js", + "./lib/parse": "./lib/parse.js", + "./lib/parser": "./lib/parser.js", + "./lib/postcss": "./lib/postcss.js", + "./lib/previous-map": "./lib/previous-map.js", + "./lib/processor": "./lib/processor.js", + "./lib/result": "./lib/result.js", + "./lib/root": "./lib/root.js", + "./lib/rule": "./lib/rule.js", + "./lib/stringifier": "./lib/stringifier.js", + "./lib/stringify": "./lib/stringify.js", + "./lib/symbols": "./lib/symbols.js", + "./lib/terminal-highlight": "./lib/terminal-highlight.js", + "./lib/tokenize": "./lib/tokenize.js", + "./lib/warn-once": "./lib/warn-once.js", + "./lib/warning": "./lib/warning.js", + "./package.json": "./package.json" + }, + "main": "./lib/postcss.js", + "types": "./lib/postcss.d.ts", + "keywords": [ + "css", + "postcss", + "rework", + "preprocessor", + "parser", + "source map", + "transform", + "manipulation", + "transpiler" + ], + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "author": "Andrey Sitnik ", + "license": "MIT", + "homepage": "https://postcss.org/", + "repository": "postcss/postcss", + "bugs": { + "url": "https://github.com/postcss/postcss/issues" + }, + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "browser": { + "./lib/terminal-highlight": false, + "source-map-js": false, + "path": false, + "url": false, + "fs": false + } +} diff --git a/node_modules/punycode/LICENSE-MIT.txt b/node_modules/punycode/LICENSE-MIT.txt new file mode 100644 index 000000000..a41e0a7ef --- /dev/null +++ b/node_modules/punycode/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/punycode/README.md b/node_modules/punycode/README.md new file mode 100644 index 000000000..72b632cdc --- /dev/null +++ b/node_modules/punycode/README.md @@ -0,0 +1,126 @@ +# Punycode.js [![punycode on npm](https://img.shields.io/npm/v/punycode)](https://www.npmjs.com/package/emoji-test-regex-pattern) [![](https://data.jsdelivr.com/v1/package/npm/punycode/badge)](https://www.jsdelivr.com/package/npm/punycode) + +Punycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891). + +This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: + +* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C) +* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) +* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) +* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) +* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) + +This project was [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with Node.js from [v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) until [v7](https://github.com/nodejs/node/pull/7941) (soft-deprecated). + +This project provides a CommonJS module that uses ES2015+ features and JavaScript module, which work in modern Node.js versions and browsers. For the old Punycode.js version that offers the same functionality in a UMD build with support for older pre-ES2015 runtimes, including Rhino, Ringo, and Narwhal, see [v1.4.1](https://github.com/mathiasbynens/punycode.js/releases/tag/v1.4.1). + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install punycode --save +``` + +In [Node.js](https://nodejs.org/): + +> ⚠️ Note that userland modules don't hide core modules. +> For example, `require('punycode')` still imports the deprecated core module even if you executed `npm install punycode`. +> Use `require('punycode/')` to import userland modules rather than core modules. + +```js +const punycode = require('punycode/'); +``` + +## API + +### `punycode.decode(string)` + +Converts a Punycode string of ASCII symbols to a string of Unicode symbols. + +```js +// decode domain name parts +punycode.decode('maana-pta'); // 'mañana' +punycode.decode('--dqo34k'); // '☃-⌘' +``` + +### `punycode.encode(string)` + +Converts a string of Unicode symbols to a Punycode string of ASCII symbols. + +```js +// encode domain name parts +punycode.encode('mañana'); // 'maana-pta' +punycode.encode('☃-⌘'); // '--dqo34k' +``` + +### `punycode.toUnicode(input)` + +Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. + +```js +// decode domain names +punycode.toUnicode('xn--maana-pta.com'); +// → 'mañana.com' +punycode.toUnicode('xn----dqo34k.com'); +// → '☃-⌘.com' + +// decode email addresses +punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); +// → 'джумла@джpумлатест.bрфa' +``` + +### `punycode.toASCII(input)` + +Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII. + +```js +// encode domain names +punycode.toASCII('mañana.com'); +// → 'xn--maana-pta.com' +punycode.toASCII('☃-⌘.com'); +// → 'xn----dqo34k.com' + +// encode email addresses +punycode.toASCII('джумла@джpумлатест.bрфa'); +// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' +``` + +### `punycode.ucs2` + +#### `punycode.ucs2.decode(string)` + +Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. + +```js +punycode.ucs2.decode('abc'); +// → [0x61, 0x62, 0x63] +// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: +punycode.ucs2.decode('\uD834\uDF06'); +// → [0x1D306] +``` + +#### `punycode.ucs2.encode(codePoints)` + +Creates a string based on an array of numeric code point values. + +```js +punycode.ucs2.encode([0x61, 0x62, 0x63]); +// → 'abc' +punycode.ucs2.encode([0x1D306]); +// → '\uD834\uDF06' +``` + +### `punycode.version` + +A string representing the current Punycode.js version number. + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/punycode/package.json b/node_modules/punycode/package.json new file mode 100644 index 000000000..9d0790b2a --- /dev/null +++ b/node_modules/punycode/package.json @@ -0,0 +1,58 @@ +{ + "name": "punycode", + "version": "2.3.0", + "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", + "homepage": "https://mths.be/punycode", + "main": "punycode.js", + "jsnext:main": "punycode.es6.js", + "module": "punycode.es6.js", + "engines": { + "node": ">=6" + }, + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "contributors": [ + { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/punycode.js.git" + }, + "bugs": "https://github.com/mathiasbynens/punycode.js/issues", + "files": [ + "LICENSE-MIT.txt", + "punycode.js", + "punycode.es6.js" + ], + "scripts": { + "test": "mocha tests", + "build": "node scripts/prepublish.js" + }, + "devDependencies": { + "codecov": "^1.0.1", + "istanbul": "^0.4.1", + "mocha": "^10.2.0" + }, + "jspm": { + "map": { + "./punycode.js": { + "node": "@node/punycode" + } + } + } +} diff --git a/node_modules/punycode/punycode.es6.js b/node_modules/punycode/punycode.es6.js new file mode 100644 index 000000000..244e1bfbf --- /dev/null +++ b/node_modules/punycode/punycode.es6.js @@ -0,0 +1,444 @@ +'use strict'; + +/** Highest positive signed 32-bit float value */ +const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +const base = 36; +const tMin = 1; +const tMax = 26; +const skew = 38; +const damp = 700; +const initialBias = 72; +const initialN = 128; // 0x80 +const delimiter = '-'; // '\x2D' + +/** Regular expressions */ +const regexPunycode = /^xn--/; +const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. +const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +const errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +const baseMinusTMin = base - tMin; +const floor = Math.floor; +const stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, callback) { + const result = []; + let length = array.length; + while (length--) { + result[length] = callback(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {String} A new string of characters returned by the callback + * function. + */ +function mapDomain(domain, callback) { + const parts = domain.split('@'); + let result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + domain = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + domain = domain.replace(regexSeparators, '\x2E'); + const labels = domain.split('.'); + const encoded = map(labels, callback).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + const extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +const ucs2encode = codePoints => String.fromCodePoint(...codePoints); + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +const basicToDigit = function(codePoint) { + if (codePoint >= 0x30 && codePoint < 0x3A) { + return 26 + (codePoint - 0x30); + } + if (codePoint >= 0x41 && codePoint < 0x5B) { + return codePoint - 0x41; + } + if (codePoint >= 0x61 && codePoint < 0x7B) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +const digitToBasic = function(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +const adapt = function(delta, numPoints, firstTime) { + let k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +const decode = function(input) { + // Don't use UCS-2. + const output = []; + const inputLength = input.length; + let i = 0; + let n = initialN; + let bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (let j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + const oldi = i; + for (let w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + const digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base) { + error('invalid-input'); + } + if (digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + const baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + const out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + + } + + return String.fromCodePoint(...output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +const encode = function(input) { + const output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + const inputLength = input.length; + + // Initialize the state. + let n = initialN; + let delta = 0; + let bias = initialBias; + + // Handle the basic code points. + for (const currentValue of input) { + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + const basicLength = output.length; + let handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + let m = maxInt; + for (const currentValue of input) { + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + const handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (const currentValue of input) { + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + if (currentValue === n) { + // Represent delta as a generalized variable-length integer. + let q = delta; + for (let k = base; /* no condition */; k += base) { + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + const qMinusT = q - t; + const baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +const toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +const toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +const punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +export { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode }; +export default punycode; diff --git a/node_modules/punycode/punycode.js b/node_modules/punycode/punycode.js new file mode 100644 index 000000000..752b98a9f --- /dev/null +++ b/node_modules/punycode/punycode.js @@ -0,0 +1,443 @@ +'use strict'; + +/** Highest positive signed 32-bit float value */ +const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +const base = 36; +const tMin = 1; +const tMax = 26; +const skew = 38; +const damp = 700; +const initialBias = 72; +const initialN = 128; // 0x80 +const delimiter = '-'; // '\x2D' + +/** Regular expressions */ +const regexPunycode = /^xn--/; +const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. +const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +const errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +const baseMinusTMin = base - tMin; +const floor = Math.floor; +const stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, callback) { + const result = []; + let length = array.length; + while (length--) { + result[length] = callback(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {String} A new string of characters returned by the callback + * function. + */ +function mapDomain(domain, callback) { + const parts = domain.split('@'); + let result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + domain = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + domain = domain.replace(regexSeparators, '\x2E'); + const labels = domain.split('.'); + const encoded = map(labels, callback).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + const extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +const ucs2encode = codePoints => String.fromCodePoint(...codePoints); + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +const basicToDigit = function(codePoint) { + if (codePoint >= 0x30 && codePoint < 0x3A) { + return 26 + (codePoint - 0x30); + } + if (codePoint >= 0x41 && codePoint < 0x5B) { + return codePoint - 0x41; + } + if (codePoint >= 0x61 && codePoint < 0x7B) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +const digitToBasic = function(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +const adapt = function(delta, numPoints, firstTime) { + let k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +const decode = function(input) { + // Don't use UCS-2. + const output = []; + const inputLength = input.length; + let i = 0; + let n = initialN; + let bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (let j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + const oldi = i; + for (let w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + const digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base) { + error('invalid-input'); + } + if (digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + const baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + const out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + + } + + return String.fromCodePoint(...output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +const encode = function(input) { + const output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + const inputLength = input.length; + + // Initialize the state. + let n = initialN; + let delta = 0; + let bias = initialBias; + + // Handle the basic code points. + for (const currentValue of input) { + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + const basicLength = output.length; + let handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + let m = maxInt; + for (const currentValue of input) { + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + const handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (const currentValue of input) { + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + if (currentValue === n) { + // Represent delta as a generalized variable-length integer. + let q = delta; + for (let k = base; /* no condition */; k += base) { + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + const qMinusT = q - t; + const baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +const toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +const toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +const punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +module.exports = punycode; diff --git a/node_modules/queue-microtask/LICENSE b/node_modules/queue-microtask/LICENSE new file mode 100755 index 000000000..c7e685275 --- /dev/null +++ b/node_modules/queue-microtask/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/queue-microtask/README.md b/node_modules/queue-microtask/README.md new file mode 100644 index 000000000..0be05a64f --- /dev/null +++ b/node_modules/queue-microtask/README.md @@ -0,0 +1,90 @@ +# queue-microtask [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[ci-image]: https://img.shields.io/github/workflow/status/feross/queue-microtask/ci/master +[ci-url]: https://github.com/feross/queue-microtask/actions +[npm-image]: https://img.shields.io/npm/v/queue-microtask.svg +[npm-url]: https://npmjs.org/package/queue-microtask +[downloads-image]: https://img.shields.io/npm/dm/queue-microtask.svg +[downloads-url]: https://npmjs.org/package/queue-microtask +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +### fast, tiny [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) shim for modern engines + +- Use [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) in all modern JS engines. +- No dependencies. Less than 10 lines. No shims or complicated fallbacks. +- Optimal performance in all modern environments + - Uses `queueMicrotask` in modern environments + - Fallback to `Promise.resolve().then(fn)` in Node.js 10 and earlier, and old browsers (same performance as `queueMicrotask`) + +## install + +``` +npm install queue-microtask +``` + +## usage + +```js +const queueMicrotask = require('queue-microtask') + +queueMicrotask(() => { /* this will run soon */ }) +``` + +## What is `queueMicrotask` and why would one use it? + +The `queueMicrotask` function is a WHATWG standard. It queues a microtask to be executed prior to control returning to the event loop. + +A microtask is a short function which will run after the current task has completed its work and when there is no other code waiting to be run before control of the execution context is returned to the event loop. + +The code `queueMicrotask(fn)` is equivalent to the code `Promise.resolve().then(fn)`. It is also very similar to [`process.nextTick(fn)`](https://nodejs.org/api/process.html#process_process_nexttick_callback_args) in Node. + +Using microtasks lets code run without interfering with any other, potentially higher priority, code that is pending, but before the JS engine regains control over the execution context. + +See the [spec](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#microtask-queuing) or [Node documentation](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback) for more information. + +## Who is this package for? + +This package allows you to use `queueMicrotask` safely in all modern JS engines. Use it if you prioritize small JS bundle size over support for old browsers. + +If you just need to support Node 12 and later, use `queueMicrotask` directly. If you need to support all versions of Node, use this package. + +## Why not use `process.nextTick`? + +In Node, `queueMicrotask` and `process.nextTick` are [essentially equivalent](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback), though there are [subtle differences](https://github.com/YuzuJS/setImmediate#macrotasks-and-microtasks) that don't matter in most situations. + +You can think of `queueMicrotask` as a standardized version of `process.nextTick` that works in the browser. No need to rely on your browser bundler to shim `process` for the browser environment. + +## Why not use `setTimeout(fn, 0)`? + +This approach is the most compatible, but it has problems. Modern browsers throttle timers severely, so `setTimeout(…, 0)` usually takes at least 4ms to run. Furthermore, the throttling gets even worse if the page is backgrounded. If you have many `setTimeout` calls, then this can severely limit the performance of your program. + +## Why not use a microtask library like [`immediate`](https://www.npmjs.com/package/immediate) or [`asap`](https://www.npmjs.com/package/asap)? + +These packages are great! However, if you prioritize small JS bundle size over optimal performance in old browsers then you may want to consider this package. + +This package (`queue-microtask`) is four times smaller than `immediate`, twice as small as `asap`, and twice as small as using `process.nextTick` and letting the browser bundler shim it automatically. + +Note: This package throws an exception in JS environments which lack `Promise` support -- which are usually very old browsers and Node.js versions. + +Since the `queueMicrotask` API is supported in Node.js, Chrome, Firefox, Safari, Opera, and Edge, **the vast majority of users will get optimal performance**. Any JS environment with `Promise`, which is almost all of them, also get optimal performance. If you need support for JS environments which lack `Promise` support, use one of the alternative packages. + +## What is a shim? + +> In computer programming, a shim is a library that transparently intercepts API calls and changes the arguments passed, handles the operation itself or redirects the operation elsewhere. – [Wikipedia](https://en.wikipedia.org/wiki/Shim_(computing)) + +This package could also be described as a "ponyfill". + +> A ponyfill is almost the same as a polyfill, but not quite. Instead of patching functionality for older browsers, a ponyfill provides that functionality as a standalone module you can use. – [PonyFoo](https://ponyfoo.com/articles/polyfills-or-ponyfills) + +## API + +### `queueMicrotask(fn)` + +The `queueMicrotask()` method queues a microtask. + +The `fn` argument is a function to be executed after all pending tasks have completed but before yielding control to the browser's event loop. + +## license + +MIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org). diff --git a/node_modules/queue-microtask/index.d.ts b/node_modules/queue-microtask/index.d.ts new file mode 100644 index 000000000..b6a864632 --- /dev/null +++ b/node_modules/queue-microtask/index.d.ts @@ -0,0 +1,2 @@ +declare const queueMicrotask: (cb: () => void) => void +export = queueMicrotask diff --git a/node_modules/queue-microtask/index.js b/node_modules/queue-microtask/index.js new file mode 100644 index 000000000..55605343a --- /dev/null +++ b/node_modules/queue-microtask/index.js @@ -0,0 +1,9 @@ +/*! queue-microtask. MIT License. Feross Aboukhadijeh */ +let promise + +module.exports = typeof queueMicrotask === 'function' + ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global) + // reuse resolved promise, and allocate it lazily + : cb => (promise || (promise = Promise.resolve())) + .then(cb) + .catch(err => setTimeout(() => { throw err }, 0)) diff --git a/node_modules/queue-microtask/package.json b/node_modules/queue-microtask/package.json new file mode 100644 index 000000000..d29a401f5 --- /dev/null +++ b/node_modules/queue-microtask/package.json @@ -0,0 +1,55 @@ +{ + "name": "queue-microtask", + "description": "fast, tiny `queueMicrotask` shim for modern engines", + "version": "1.2.3", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/queue-microtask/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^5.2.2" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "homepage": "https://github.com/feross/queue-microtask", + "keywords": [ + "asap", + "immediate", + "micro task", + "microtask", + "nextTick", + "process.nextTick", + "queue micro task", + "queue microtask", + "queue-microtask", + "queueMicrotask", + "setImmediate", + "task" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/queue-microtask.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + } +} diff --git a/node_modules/quick-lru/index.d.ts b/node_modules/quick-lru/index.d.ts new file mode 100644 index 000000000..fa58889b4 --- /dev/null +++ b/node_modules/quick-lru/index.d.ts @@ -0,0 +1,97 @@ +declare namespace QuickLRU { + interface Options { + /** + The maximum number of items before evicting the least recently used items. + */ + readonly maxSize: number; + + /** + Called right before an item is evicted from the cache. + + Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`). + */ + onEviction?: (key: KeyType, value: ValueType) => void; + } +} + +declare class QuickLRU + implements Iterable<[KeyType, ValueType]> { + /** + The stored item count. + */ + readonly size: number; + + /** + Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29). + + The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop. + + @example + ``` + import QuickLRU = require('quick-lru'); + + const lru = new QuickLRU({maxSize: 1000}); + + lru.set('🦄', '🌈'); + + lru.has('🦄'); + //=> true + + lru.get('🦄'); + //=> '🌈' + ``` + */ + constructor(options: QuickLRU.Options); + + [Symbol.iterator](): IterableIterator<[KeyType, ValueType]>; + + /** + Set an item. + + @returns The list instance. + */ + set(key: KeyType, value: ValueType): this; + + /** + Get an item. + + @returns The stored item or `undefined`. + */ + get(key: KeyType): ValueType | undefined; + + /** + Check if an item exists. + */ + has(key: KeyType): boolean; + + /** + Get an item without marking it as recently used. + + @returns The stored item or `undefined`. + */ + peek(key: KeyType): ValueType | undefined; + + /** + Delete an item. + + @returns `true` if the item is removed or `false` if the item doesn't exist. + */ + delete(key: KeyType): boolean; + + /** + Delete all items. + */ + clear(): void; + + /** + Iterable for all the keys. + */ + keys(): IterableIterator; + + /** + Iterable for all the values. + */ + values(): IterableIterator; +} + +export = QuickLRU; diff --git a/node_modules/quick-lru/index.js b/node_modules/quick-lru/index.js new file mode 100644 index 000000000..7d7032e6a --- /dev/null +++ b/node_modules/quick-lru/index.js @@ -0,0 +1,123 @@ +'use strict'; + +class QuickLRU { + constructor(options = {}) { + if (!(options.maxSize && options.maxSize > 0)) { + throw new TypeError('`maxSize` must be a number greater than 0'); + } + + this.maxSize = options.maxSize; + this.onEviction = options.onEviction; + this.cache = new Map(); + this.oldCache = new Map(); + this._size = 0; + } + + _set(key, value) { + this.cache.set(key, value); + this._size++; + + if (this._size >= this.maxSize) { + this._size = 0; + + if (typeof this.onEviction === 'function') { + for (const [key, value] of this.oldCache.entries()) { + this.onEviction(key, value); + } + } + + this.oldCache = this.cache; + this.cache = new Map(); + } + } + + get(key) { + if (this.cache.has(key)) { + return this.cache.get(key); + } + + if (this.oldCache.has(key)) { + const value = this.oldCache.get(key); + this.oldCache.delete(key); + this._set(key, value); + return value; + } + } + + set(key, value) { + if (this.cache.has(key)) { + this.cache.set(key, value); + } else { + this._set(key, value); + } + + return this; + } + + has(key) { + return this.cache.has(key) || this.oldCache.has(key); + } + + peek(key) { + if (this.cache.has(key)) { + return this.cache.get(key); + } + + if (this.oldCache.has(key)) { + return this.oldCache.get(key); + } + } + + delete(key) { + const deleted = this.cache.delete(key); + if (deleted) { + this._size--; + } + + return this.oldCache.delete(key) || deleted; + } + + clear() { + this.cache.clear(); + this.oldCache.clear(); + this._size = 0; + } + + * keys() { + for (const [key] of this) { + yield key; + } + } + + * values() { + for (const [, value] of this) { + yield value; + } + } + + * [Symbol.iterator]() { + for (const item of this.cache) { + yield item; + } + + for (const item of this.oldCache) { + const [key] = item; + if (!this.cache.has(key)) { + yield item; + } + } + } + + get size() { + let oldCacheSize = 0; + for (const key of this.oldCache.keys()) { + if (!this.cache.has(key)) { + oldCacheSize++; + } + } + + return Math.min(this._size + oldCacheSize, this.maxSize); + } +} + +module.exports = QuickLRU; diff --git a/node_modules/quick-lru/license b/node_modules/quick-lru/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/quick-lru/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/quick-lru/package.json b/node_modules/quick-lru/package.json new file mode 100644 index 000000000..ff0dd9a14 --- /dev/null +++ b/node_modules/quick-lru/package.json @@ -0,0 +1,43 @@ +{ + "name": "quick-lru", + "version": "5.1.1", + "description": "Simple “Least Recently Used” (LRU) cache", + "license": "MIT", + "repository": "sindresorhus/quick-lru", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && nyc ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "lru", + "quick", + "cache", + "caching", + "least", + "recently", + "used", + "fast", + "map", + "hash", + "buffer" + ], + "devDependencies": { + "ava": "^2.0.0", + "coveralls": "^3.0.3", + "nyc": "^15.0.0", + "tsd": "^0.11.0", + "xo": "^0.26.0" + } +} diff --git a/node_modules/quick-lru/readme.md b/node_modules/quick-lru/readme.md new file mode 100644 index 000000000..234294a09 --- /dev/null +++ b/node_modules/quick-lru/readme.md @@ -0,0 +1,111 @@ +# quick-lru [![Build Status](https://travis-ci.org/sindresorhus/quick-lru.svg?branch=master)](https://travis-ci.org/sindresorhus/quick-lru) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/quick-lru/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/quick-lru?branch=master) + +> Simple [“Least Recently Used” (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29) + +Useful when you need to cache something and limit memory usage. + +Inspired by the [`hashlru` algorithm](https://github.com/dominictarr/hashlru#algorithm), but instead uses [`Map`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) to support keys of any type, not just strings, and values can be `undefined`. + +## Install + +``` +$ npm install quick-lru +``` + +## Usage + +```js +const QuickLRU = require('quick-lru'); + +const lru = new QuickLRU({maxSize: 1000}); + +lru.set('🦄', '🌈'); + +lru.has('🦄'); +//=> true + +lru.get('🦄'); +//=> '🌈' +``` + +## API + +### new QuickLRU(options?) + +Returns a new instance. + +### options + +Type: `object` + +#### maxSize + +*Required*\ +Type: `number` + +The maximum number of items before evicting the least recently used items. + +#### onEviction + +*Optional*\ +Type: `(key, value) => void` + +Called right before an item is evicted from the cache. + +Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`). + +### Instance + +The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop. + +Both `key` and `value` can be of any type. + +#### .set(key, value) + +Set an item. Returns the instance. + +#### .get(key) + +Get an item. + +#### .has(key) + +Check if an item exists. + +#### .peek(key) + +Get an item without marking it as recently used. + +#### .delete(key) + +Delete an item. + +Returns `true` if the item is removed or `false` if the item doesn't exist. + +#### .clear() + +Delete all items. + +#### .keys() + +Iterable for all the keys. + +#### .values() + +Iterable for all the values. + +#### .size + +The stored item count. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/read-pkg-up/index.d.ts b/node_modules/read-pkg-up/index.d.ts new file mode 100644 index 000000000..43886dc82 --- /dev/null +++ b/node_modules/read-pkg-up/index.d.ts @@ -0,0 +1,77 @@ +import {Except} from 'type-fest'; +import {readPackageAsync, readPackageSync, Options as ReadPackageOptions, NormalizeOptions as ReadPackageNormalizeOptions, PackageJson, NormalizedPackageJson} from 'read-pkg'; + +export type Options = { + /** + Directory to start looking for a package.json file. + + @default process.cwd() + */ + cwd?: string; +} & Except; + +export type NormalizeOptions = { + /** + Directory to start looking for a package.json file. + + @default process.cwd() + */ + cwd?: string; +} & Except; + +export interface ReadResult { + packageJson: PackageJson; + path: string; +} + +export interface NormalizedReadResult { + packageJson: NormalizedPackageJson; + path: string; +} + +export { + PackageJson, + NormalizedPackageJson +}; + +/** +Read the closest `package.json` file. + +@example +``` +import {readPackageUpAsync} from 'read-pkg-up'; + +console.log(await readPackageUpAsync()); +// { +// packageJson: { +// name: 'awesome-package', +// version: '1.0.0', +// … +// }, +// path: '/Users/sindresorhus/dev/awesome-package/package.json' +// } +``` +*/ +export function readPackageUpAsync(options?: NormalizeOptions): Promise; +export function readPackageUpAsync(options: Options): Promise; + +/** +Synchronously read the closest `package.json` file. + +@example +``` +import {readPackageUpSync} from 'read-pkg-up'; + +console.log(readPackageUpSync()); +// { +// packageJson: { +// name: 'awesome-package', +// version: '1.0.0', +// … +// }, +// path: '/Users/sindresorhus/dev/awesome-package/package.json' +// } +``` +*/ +export function readPackageUpSync(options?: NormalizeOptions): NormalizedReadResult | undefined; +export function readPackageUpSync(options: Options): ReadResult | undefined; diff --git a/node_modules/read-pkg-up/index.js b/node_modules/read-pkg-up/index.js new file mode 100644 index 000000000..e8181da81 --- /dev/null +++ b/node_modules/read-pkg-up/index.js @@ -0,0 +1,27 @@ +import path from 'path'; +import findUp from 'find-up'; +import {readPackageAsync, readPackageSync} from 'read-pkg'; + +export async function readPackageUpAsync(options) { + const filePath = await findUp('package.json', options); + if (!filePath) { + return; + } + + return { + packageJson: await readPackageAsync({...options, cwd: path.dirname(filePath)}), + path: filePath + }; +} + +export function readPackageUpSync(options) { + const filePath = findUp.sync('package.json', options); + if (!filePath) { + return; + } + + return { + packageJson: readPackageSync({...options, cwd: path.dirname(filePath)}), + path: filePath + }; +} diff --git a/node_modules/read-pkg-up/license b/node_modules/read-pkg-up/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/read-pkg-up/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/read-pkg-up/package.json b/node_modules/read-pkg-up/package.json new file mode 100644 index 000000000..5693d71ef --- /dev/null +++ b/node_modules/read-pkg-up/package.json @@ -0,0 +1,61 @@ +{ + "name": "read-pkg-up", + "version": "8.0.0", + "description": "Read the closest package.json file", + "license": "MIT", + "repository": "sindresorhus/read-pkg-up", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "json", + "read", + "parse", + "file", + "fs", + "graceful", + "load", + "package", + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "search", + "match", + "resolve", + "parent", + "parents", + "folder", + "directory", + "walk", + "walking", + "path" + ], + "dependencies": { + "find-up": "^5.0.0", + "read-pkg": "^6.0.0", + "type-fest": "^1.0.1" + }, + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" + } +} diff --git a/node_modules/read-pkg-up/readme.md b/node_modules/read-pkg-up/readme.md new file mode 100644 index 000000000..8df9c22c3 --- /dev/null +++ b/node_modules/read-pkg-up/readme.md @@ -0,0 +1,74 @@ +# read-pkg-up + +> Read the closest package.json file + +## Why + +- [Finds the closest package.json](https://github.com/sindresorhus/find-up) +- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json) +- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) + +## Install + +``` +$ npm install read-pkg-up +``` + +## Usage + +```js +import {readPackageUpAsync} from 'read-pkg-up'; + +console.log(await readPackageUpAsync()); +/* +{ + packageJson: { + name: 'awesome-package', + version: '1.0.0', + … + }, + path: '/Users/sindresorhus/dev/awesome-package/package.json' +} +*/ +``` + +## API + +### readPackageUpAsync(options?) + +Returns a `Promise` or `Promise` if no `package.json` was found. + +### readPackageUpSync(options?) + +Returns the result object or `undefined` if no `package.json` was found. + +#### options + +Type: `object` + +##### cwd + +Type: `string`\ +Default: `process.cwd()` + +Directory to start looking for a package.json file. + +##### normalize + +Type: `boolean`\ +Default: `true` + +[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data. + +## read-pkg-up for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of read-pkg-up and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-read-pkg-up?utm_source=npm-read-pkg-up&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Related + +- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories +- [pkg-conf](https://github.com/sindresorhus/pkg-conf) - Get namespaced config from the closest package.json diff --git a/node_modules/read-pkg/index.d.ts b/node_modules/read-pkg/index.d.ts new file mode 100644 index 000000000..75e093cf9 --- /dev/null +++ b/node_modules/read-pkg/index.d.ts @@ -0,0 +1,59 @@ +import * as typeFest from 'type-fest'; +import * as normalize from 'normalize-package-data'; + +export interface Options { + /** + Current working directory. + + @default process.cwd() + */ + readonly cwd?: string; + + /** + [Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data. + + @default true + */ + readonly normalize?: boolean; +} + +export interface NormalizeOptions extends Options { + readonly normalize?: true; +} + +export type NormalizedPackageJson = PackageJson & normalize.Package; +export type PackageJson = typeFest.PackageJson; + +/** +@returns The parsed JSON. + +@example +``` +import {readPackageAsync} from 'read-pkg'; + +console.log(await readPackageAsync()); +//=> {name: 'read-pkg', …} + +console.log(await readPackageAsync({cwd: 'some-other-directory'}); +//=> {name: 'unicorn', …} +``` +*/ +export function readPackageAsync(options?: NormalizeOptions): Promise; +export function readPackageAsync(options: Options): Promise; + +/** +@returns The parsed JSON. + +@example +``` +import {readPackageSync} from 'read-pkg'; + +console.log(readPackageSync()); +//=> {name: 'read-pkg', …} + +console.log(readPackageSync({cwd: 'some-other-directory'}); +//=> {name: 'unicorn', …} +``` +*/ +export function readPackageSync(options?: NormalizeOptions): NormalizedPackageJson; +export function readPackageSync(options: Options): PackageJson; diff --git a/node_modules/read-pkg/index.js b/node_modules/read-pkg/index.js new file mode 100644 index 000000000..d58bc28b1 --- /dev/null +++ b/node_modules/read-pkg/index.js @@ -0,0 +1,26 @@ +import fs, {promises as fsAsync} from 'fs'; +import path from 'path'; +import parseJson from 'parse-json'; +import normalizePackageData from 'normalize-package-data'; + +export async function readPackageAsync({cwd = process.cwd(), normalize = true} = {}) { + const filePath = path.resolve(cwd, 'package.json'); + const json = parseJson(await fsAsync.readFile(filePath, 'utf8')); + + if (normalize) { + normalizePackageData(json); + } + + return json; +} + +export function readPackageSync({cwd = process.cwd(), normalize = true} = {}) { + const filePath = path.resolve(cwd, 'package.json'); + const json = parseJson(fs.readFileSync(filePath, 'utf8')); + + if (normalize) { + normalizePackageData(json); + } + + return json; +} diff --git a/node_modules/read-pkg/license b/node_modules/read-pkg/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/read-pkg/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/read-pkg/package.json b/node_modules/read-pkg/package.json new file mode 100644 index 000000000..54a93b8b7 --- /dev/null +++ b/node_modules/read-pkg/package.json @@ -0,0 +1,52 @@ +{ + "name": "read-pkg", + "version": "6.0.0", + "description": "Read a package.json file", + "license": "MIT", + "repository": "sindresorhus/read-pkg", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "json", + "read", + "parse", + "file", + "fs", + "graceful", + "load", + "package", + "normalize" + ], + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^1.0.1" + }, + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" + }, + "xo": { + "ignores": [ + "test/test.js" + ] + } +} diff --git a/node_modules/read-pkg/readme.md b/node_modules/read-pkg/readme.md new file mode 100644 index 000000000..eda793bae --- /dev/null +++ b/node_modules/read-pkg/readme.md @@ -0,0 +1,72 @@ +# read-pkg + +> Read a package.json file + +## Why + +- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json) +- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) + +## Install + +``` +$ npm install read-pkg +``` + +## Usage + +```js +import {readPackageAsync} from 'read-pkg'; + +console.log(await readPkg()); +//=> {name: 'read-pkg', …} + +console.log(await readPkg({cwd: 'some-other-directory'})); +//=> {name: 'unicorn', …} +``` + +## API + +### readPackageAsync(options?) + +Returns a `Promise` with the parsed JSON. + +### readPackageSync(options?) + +Returns the parsed JSON. + +#### options + +Type: `object` + +##### cwd + +Type: `string`\ +Default: `process.cwd()` + +Current working directory. + +##### normalize + +Type: `boolean`\ +Default: `true` + +[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data. + +## Related + +- [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file +- [write-pkg](https://github.com/sindresorhus/write-pkg) - Write a `package.json` file +- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/redent/index.d.ts b/node_modules/redent/index.d.ts new file mode 100644 index 000000000..df1656ec8 --- /dev/null +++ b/node_modules/redent/index.d.ts @@ -0,0 +1,23 @@ +import {Options} from 'indent-string'; + +/** +[Strip redundant indentation](https://github.com/sindresorhus/strip-indent) and [indent the string](https://github.com/sindresorhus/indent-string). + +@param string - The string to normalize indentation. +@param count - How many times you want `options.indent` repeated. Default: `0`. + +@example +``` +import redent from 'redent'; + +redent('\n foo\n bar\n', 1); +//=> '\n foo\n bar\n' +``` +*/ +export default function redent( + string: string, + count?: number, + options?: Options +): string; + +export {Options}; diff --git a/node_modules/redent/index.js b/node_modules/redent/index.js new file mode 100644 index 000000000..aa5d81443 --- /dev/null +++ b/node_modules/redent/index.js @@ -0,0 +1,6 @@ +import stripIndent from 'strip-indent'; +import indentString from 'indent-string'; + +export default function redent(string, count = 0, options = {}) { + return indentString(stripIndent(string), count, options); +} diff --git a/node_modules/redent/license b/node_modules/redent/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/redent/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/redent/package.json b/node_modules/redent/package.json new file mode 100644 index 000000000..8c93fdfea --- /dev/null +++ b/node_modules/redent/package.json @@ -0,0 +1,47 @@ +{ + "name": "redent", + "version": "4.0.0", + "description": "Strip redundant indentation and indent the string", + "license": "MIT", + "repository": "sindresorhus/redent", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "string", + "strip", + "trim", + "indent", + "indentation", + "add", + "reindent", + "normalize", + "remove", + "whitespace", + "space" + ], + "dependencies": { + "indent-string": "^5.0.0", + "strip-indent": "^4.0.0" + }, + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.39.1" + } +} diff --git a/node_modules/redent/readme.md b/node_modules/redent/readme.md new file mode 100644 index 000000000..f9da974d6 --- /dev/null +++ b/node_modules/redent/readme.md @@ -0,0 +1,65 @@ +# redent + +> [Strip redundant indentation](https://github.com/sindresorhus/strip-indent) and [indent the string](https://github.com/sindresorhus/indent-string) + +## Install + +``` +$ npm install redent +``` + +## Usage + +```js +import redent from 'redent'; + +redent('\n foo\n bar\n', 1); +//=> '\n foo\n bar\n' +``` + +## API + +### redent(string, count?, options?) + +#### string + +Type: `string` + +The string to normalize indentation. + +#### count + +Type: `number`\ +Default: `0` + +How many times you want `options.indent` repeated. + +#### options + +Type: `object` + +##### indent + +Type: `string`\ +Default: `' '` + +The string to use for the indent. + +##### includeEmptyLines + +Type: `boolean`\ +Default: `false` + +Also indent empty lines. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/require-from-string/index.js b/node_modules/require-from-string/index.js new file mode 100644 index 000000000..cb5595fde --- /dev/null +++ b/node_modules/require-from-string/index.js @@ -0,0 +1,34 @@ +'use strict'; + +var Module = require('module'); +var path = require('path'); + +module.exports = function requireFromString(code, filename, opts) { + if (typeof filename === 'object') { + opts = filename; + filename = undefined; + } + + opts = opts || {}; + filename = filename || ''; + + opts.appendPaths = opts.appendPaths || []; + opts.prependPaths = opts.prependPaths || []; + + if (typeof code !== 'string') { + throw new Error('code must be a string, not ' + typeof code); + } + + var paths = Module._nodeModulePaths(path.dirname(filename)); + + var parent = module.parent; + var m = new Module(filename, parent); + m.filename = filename; + m.paths = [].concat(opts.prependPaths).concat(paths).concat(opts.appendPaths); + m._compile(code, filename); + + var exports = m.exports; + parent && parent.children && parent.children.splice(parent.children.indexOf(m), 1); + + return exports; +}; diff --git a/node_modules/require-from-string/license b/node_modules/require-from-string/license new file mode 100644 index 000000000..1aeb74fd2 --- /dev/null +++ b/node_modules/require-from-string/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/require-from-string/package.json b/node_modules/require-from-string/package.json new file mode 100644 index 000000000..800d46efc --- /dev/null +++ b/node_modules/require-from-string/package.json @@ -0,0 +1,28 @@ +{ + "name": "require-from-string", + "version": "2.0.2", + "description": "Require module from string", + "license": "MIT", + "repository": "floatdrop/require-from-string", + "author": { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", + "url": "github.com/floatdrop" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "" + ], + "dependencies": {}, + "devDependencies": { + "mocha": "*" + } +} diff --git a/node_modules/require-from-string/readme.md b/node_modules/require-from-string/readme.md new file mode 100644 index 000000000..88b3236f8 --- /dev/null +++ b/node_modules/require-from-string/readme.md @@ -0,0 +1,56 @@ +# require-from-string [![Build Status](https://travis-ci.org/floatdrop/require-from-string.svg?branch=master)](https://travis-ci.org/floatdrop/require-from-string) + +Load module from string in Node. + +## Install + +``` +$ npm install --save require-from-string +``` + + +## Usage + +```js +var requireFromString = require('require-from-string'); + +requireFromString('module.exports = 1'); +//=> 1 +``` + + +## API + +### requireFromString(code, [filename], [options]) + +#### code + +*Required* +Type: `string` + +Module code. + +#### filename +Type: `string` +Default: `''` + +Optional filename. + + +#### options +Type: `object` + +##### appendPaths +Type: `Array` + +List of `paths`, that will be appended to module `paths`. Useful, when you want +to be able require modules from these paths. + +##### prependPaths +Type: `Array` + +Same as `appendPaths`, but paths will be prepended. + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/node_modules/resolve-from/index.d.ts b/node_modules/resolve-from/index.d.ts new file mode 100644 index 000000000..dd5f5ef61 --- /dev/null +++ b/node_modules/resolve-from/index.d.ts @@ -0,0 +1,31 @@ +declare const resolveFrom: { + /** + Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path. + + @param fromDirectory - Directory to resolve from. + @param moduleId - What you would use in `require()`. + @returns Resolved module path. Throws when the module can't be found. + + @example + ``` + import resolveFrom = require('resolve-from'); + + // There is a file at `./foo/bar.js` + + resolveFrom('foo', './bar'); + //=> '/Users/sindresorhus/dev/test/foo/bar.js' + ``` + */ + (fromDirectory: string, moduleId: string): string; + + /** + Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path. + + @param fromDirectory - Directory to resolve from. + @param moduleId - What you would use in `require()`. + @returns Resolved module path or `undefined` when the module can't be found. + */ + silent(fromDirectory: string, moduleId: string): string | undefined; +}; + +export = resolveFrom; diff --git a/node_modules/resolve-from/index.js b/node_modules/resolve-from/index.js new file mode 100644 index 000000000..44f291c1f --- /dev/null +++ b/node_modules/resolve-from/index.js @@ -0,0 +1,47 @@ +'use strict'; +const path = require('path'); +const Module = require('module'); +const fs = require('fs'); + +const resolveFrom = (fromDirectory, moduleId, silent) => { + if (typeof fromDirectory !== 'string') { + throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``); + } + + if (typeof moduleId !== 'string') { + throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); + } + + try { + fromDirectory = fs.realpathSync(fromDirectory); + } catch (error) { + if (error.code === 'ENOENT') { + fromDirectory = path.resolve(fromDirectory); + } else if (silent) { + return; + } else { + throw error; + } + } + + const fromFile = path.join(fromDirectory, 'noop.js'); + + const resolveFileName = () => Module._resolveFilename(moduleId, { + id: fromFile, + filename: fromFile, + paths: Module._nodeModulePaths(fromDirectory) + }); + + if (silent) { + try { + return resolveFileName(); + } catch (error) { + return; + } + } + + return resolveFileName(); +}; + +module.exports = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId); +module.exports.silent = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId, true); diff --git a/node_modules/resolve-from/license b/node_modules/resolve-from/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/resolve-from/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/resolve-from/package.json b/node_modules/resolve-from/package.json new file mode 100644 index 000000000..733df1627 --- /dev/null +++ b/node_modules/resolve-from/package.json @@ -0,0 +1,36 @@ +{ + "name": "resolve-from", + "version": "5.0.0", + "description": "Resolve the path of a module like `require.resolve()` but from a given path", + "license": "MIT", + "repository": "sindresorhus/resolve-from", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "require", + "resolve", + "path", + "module", + "from", + "like", + "import" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/resolve-from/readme.md b/node_modules/resolve-from/readme.md new file mode 100644 index 000000000..fd4f46f94 --- /dev/null +++ b/node_modules/resolve-from/readme.md @@ -0,0 +1,72 @@ +# resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from) + +> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path + + +## Install + +``` +$ npm install resolve-from +``` + + +## Usage + +```js +const resolveFrom = require('resolve-from'); + +// There is a file at `./foo/bar.js` + +resolveFrom('foo', './bar'); +//=> '/Users/sindresorhus/dev/test/foo/bar.js' +``` + + +## API + +### resolveFrom(fromDirectory, moduleId) + +Like `require()`, throws when the module can't be found. + +### resolveFrom.silent(fromDirectory, moduleId) + +Returns `undefined` instead of throwing when the module can't be found. + +#### fromDirectory + +Type: `string` + +Directory to resolve from. + +#### moduleId + +Type: `string` + +What you would use in `require()`. + + +## Tip + +Create a partial using a bound function if you want to resolve from the same `fromDirectory` multiple times: + +```js +const resolveFromFoo = resolveFrom.bind(null, 'foo'); + +resolveFromFoo('./bar'); +resolveFromFoo('./baz'); +``` + + +## Related + +- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory +- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path +- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory +- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point +- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily +- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/reusify/.coveralls.yml b/node_modules/reusify/.coveralls.yml new file mode 100644 index 000000000..359f68349 --- /dev/null +++ b/node_modules/reusify/.coveralls.yml @@ -0,0 +1 @@ +repo_token: yIxhFqtaaz5iGVYfie9mODehFYogm8S8L diff --git a/node_modules/reusify/.travis.yml b/node_modules/reusify/.travis.yml new file mode 100644 index 000000000..197047681 --- /dev/null +++ b/node_modules/reusify/.travis.yml @@ -0,0 +1,28 @@ +language: node_js +sudo: false + +node_js: + - 9 + - 8 + - 7 + - 6 + - 5 + - 4 + - 4.0 + - iojs-v3 + - iojs-v2 + - iojs-v1 + - 0.12 + - 0.10 + +cache: + directories: + - node_modules + +after_script: +- npm run coverage + +notifications: + email: + on_success: never + on_failure: always diff --git a/node_modules/reusify/LICENSE b/node_modules/reusify/LICENSE new file mode 100644 index 000000000..fbf3a01d8 --- /dev/null +++ b/node_modules/reusify/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Matteo Collina + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/reusify/README.md b/node_modules/reusify/README.md new file mode 100644 index 000000000..badcb7ccf --- /dev/null +++ b/node_modules/reusify/README.md @@ -0,0 +1,145 @@ +# reusify + +[![npm version][npm-badge]][npm-url] +[![Build Status][travis-badge]][travis-url] +[![Coverage Status][coveralls-badge]][coveralls-url] + +Reuse your objects and functions for maximum speed. This technique will +make any function run ~10% faster. You call your functions a +lot, and it adds up quickly in hot code paths. + +``` +$ node benchmarks/createNoCodeFunction.js +Total time 53133 +Total iterations 100000000 +Iteration/s 1882069.5236482036 + +$ node benchmarks/reuseNoCodeFunction.js +Total time 50617 +Total iterations 100000000 +Iteration/s 1975620.838848608 +``` + +The above benchmark uses fibonacci to simulate a real high-cpu load. +The actual numbers might differ for your use case, but the difference +should not. + +The benchmark was taken using Node v6.10.0. + +This library was extracted from +[fastparallel](http://npm.im/fastparallel). + +## Example + +```js +var reusify = require('reusify') +var fib = require('reusify/benchmarks/fib') +var instance = reusify(MyObject) + +// get an object from the cache, +// or creates a new one when cache is empty +var obj = instance.get() + +// set the state +obj.num = 100 +obj.func() + +// reset the state. +// if the state contains any external object +// do not use delete operator (it is slow) +// prefer set them to null +obj.num = 0 + +// store an object in the cache +instance.release(obj) + +function MyObject () { + // you need to define this property + // so V8 can compile MyObject into an + // hidden class + this.next = null + this.num = 0 + + var that = this + + // this function is never reallocated, + // so it can be optimized by V8 + this.func = function () { + if (null) { + // do nothing + } else { + // calculates fibonacci + fib(that.num) + } + } +} +``` + +The above example was intended for synchronous code, let's see async: +```js +var reusify = require('reusify') +var instance = reusify(MyObject) + +for (var i = 0; i < 100; i++) { + getData(i, console.log) +} + +function getData (value, cb) { + var obj = instance.get() + + obj.value = value + obj.cb = cb + obj.run() +} + +function MyObject () { + this.next = null + this.value = null + + var that = this + + this.run = function () { + asyncOperation(that.value, that.handle) + } + + this.handle = function (err, result) { + that.cb(err, result) + that.value = null + that.cb = null + instance.release(that) + } +} +``` + +Also note how in the above examples, the code, that consumes an istance of `MyObject`, +reset the state to initial condition, just before storing it in the cache. +That's needed so that every subsequent request for an instance from the cache, +could get a clean instance. + +## Why + +It is faster because V8 doesn't have to collect all the functions you +create. On a short-lived benchmark, it is as fast as creating the +nested function, but on a longer time frame it creates less +pressure on the garbage collector. + +## Other examples +If you want to see some complex example, checkout [middie](https://github.com/fastify/middie) and [steed](https://github.com/mcollina/steed). + +## Acknowledgements + +Thanks to [Trevor Norris](https://github.com/trevnorris) for +getting me down the rabbit hole of performance, and thanks to [Mathias +Buss](http://github.com/mafintosh) for suggesting me to share this +trick. + +## License + +MIT + +[npm-badge]: https://badge.fury.io/js/reusify.svg +[npm-url]: https://badge.fury.io/js/reusify +[travis-badge]: https://api.travis-ci.org/mcollina/reusify.svg +[travis-url]: https://travis-ci.org/mcollina/reusify +[coveralls-badge]: https://coveralls.io/repos/mcollina/reusify/badge.svg?branch=master&service=github +[coveralls-url]: https://coveralls.io/github/mcollina/reusify?branch=master diff --git a/node_modules/reusify/benchmarks/createNoCodeFunction.js b/node_modules/reusify/benchmarks/createNoCodeFunction.js new file mode 100644 index 000000000..ce1aac7b7 --- /dev/null +++ b/node_modules/reusify/benchmarks/createNoCodeFunction.js @@ -0,0 +1,30 @@ +'use strict' + +var fib = require('./fib') +var max = 100000000 +var start = Date.now() + +// create a funcion with the typical error +// pattern, that delegates the heavy load +// to something else +function createNoCodeFunction () { + /* eslint no-constant-condition: "off" */ + var num = 100 + + ;(function () { + if (null) { + // do nothing + } else { + fib(num) + } + })() +} + +for (var i = 0; i < max; i++) { + createNoCodeFunction() +} + +var time = Date.now() - start +console.log('Total time', time) +console.log('Total iterations', max) +console.log('Iteration/s', max / time * 1000) diff --git a/node_modules/reusify/benchmarks/fib.js b/node_modules/reusify/benchmarks/fib.js new file mode 100644 index 000000000..e22cc48de --- /dev/null +++ b/node_modules/reusify/benchmarks/fib.js @@ -0,0 +1,13 @@ +'use strict' + +function fib (num) { + var fib = [] + + fib[0] = 0 + fib[1] = 1 + for (var i = 2; i <= num; i++) { + fib[i] = fib[i - 2] + fib[i - 1] + } +} + +module.exports = fib diff --git a/node_modules/reusify/benchmarks/reuseNoCodeFunction.js b/node_modules/reusify/benchmarks/reuseNoCodeFunction.js new file mode 100644 index 000000000..3358d6e50 --- /dev/null +++ b/node_modules/reusify/benchmarks/reuseNoCodeFunction.js @@ -0,0 +1,38 @@ +'use strict' + +var reusify = require('../') +var fib = require('./fib') +var instance = reusify(MyObject) +var max = 100000000 +var start = Date.now() + +function reuseNoCodeFunction () { + var obj = instance.get() + obj.num = 100 + obj.func() + obj.num = 0 + instance.release(obj) +} + +function MyObject () { + this.next = null + var that = this + this.num = 0 + this.func = function () { + /* eslint no-constant-condition: "off" */ + if (null) { + // do nothing + } else { + fib(that.num) + } + } +} + +for (var i = 0; i < max; i++) { + reuseNoCodeFunction() +} + +var time = Date.now() - start +console.log('Total time', time) +console.log('Total iterations', max) +console.log('Iteration/s', max / time * 1000) diff --git a/node_modules/reusify/package.json b/node_modules/reusify/package.json new file mode 100644 index 000000000..ee66aeecb --- /dev/null +++ b/node_modules/reusify/package.json @@ -0,0 +1,45 @@ +{ + "name": "reusify", + "version": "1.0.4", + "description": "Reuse objects and functions with style", + "main": "reusify.js", + "scripts": { + "lint": "standard", + "test": "tape test.js | faucet", + "istanbul": "istanbul cover tape test.js", + "coverage": "npm run istanbul; cat coverage/lcov.info | coveralls" + }, + "pre-commit": [ + "lint", + "test" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/mcollina/reusify.git" + }, + "keywords": [ + "reuse", + "object", + "performance", + "function", + "fast" + ], + "author": "Matteo Collina ", + "license": "MIT", + "bugs": { + "url": "https://github.com/mcollina/reusify/issues" + }, + "homepage": "https://github.com/mcollina/reusify#readme", + "engines": { + "node": ">=0.10.0", + "iojs": ">=1.0.0" + }, + "devDependencies": { + "coveralls": "^2.13.3", + "faucet": "0.0.1", + "istanbul": "^0.4.5", + "pre-commit": "^1.2.2", + "standard": "^10.0.3", + "tape": "^4.8.0" + } +} diff --git a/node_modules/reusify/reusify.js b/node_modules/reusify/reusify.js new file mode 100644 index 000000000..e6f36f3a8 --- /dev/null +++ b/node_modules/reusify/reusify.js @@ -0,0 +1,33 @@ +'use strict' + +function reusify (Constructor) { + var head = new Constructor() + var tail = head + + function get () { + var current = head + + if (current.next) { + head = current.next + } else { + head = new Constructor() + tail = head + } + + current.next = null + + return current + } + + function release (obj) { + tail.next = obj + tail = obj + } + + return { + get: get, + release: release + } +} + +module.exports = reusify diff --git a/node_modules/reusify/test.js b/node_modules/reusify/test.js new file mode 100644 index 000000000..929cfd719 --- /dev/null +++ b/node_modules/reusify/test.js @@ -0,0 +1,66 @@ +'use strict' + +var test = require('tape') +var reusify = require('./') + +test('reuse objects', function (t) { + t.plan(6) + + function MyObject () { + t.pass('constructor called') + this.next = null + } + + var instance = reusify(MyObject) + var obj = instance.get() + + t.notEqual(obj, instance.get(), 'two instance created') + t.notOk(obj.next, 'next must be null') + + instance.release(obj) + + // the internals keeps a hot copy ready for reuse + // putting this one back in the queue + instance.release(instance.get()) + + // comparing the old one with the one we got + // never do this in real code, after release you + // should never reuse that instance + t.equal(obj, instance.get(), 'instance must be reused') +}) + +test('reuse more than 2 objects', function (t) { + function MyObject () { + t.pass('constructor called') + this.next = null + } + + var instance = reusify(MyObject) + var obj = instance.get() + var obj2 = instance.get() + var obj3 = instance.get() + + t.notOk(obj.next, 'next must be null') + t.notOk(obj2.next, 'next must be null') + t.notOk(obj3.next, 'next must be null') + + t.notEqual(obj, obj2) + t.notEqual(obj, obj3) + t.notEqual(obj3, obj2) + + instance.release(obj) + instance.release(obj2) + instance.release(obj3) + + // skip one + instance.get() + + var obj4 = instance.get() + var obj5 = instance.get() + var obj6 = instance.get() + + t.equal(obj4, obj) + t.equal(obj5, obj2) + t.equal(obj6, obj3) + t.end() +}) diff --git a/node_modules/rimraf/CHANGELOG.md b/node_modules/rimraf/CHANGELOG.md new file mode 100644 index 000000000..f116f1414 --- /dev/null +++ b/node_modules/rimraf/CHANGELOG.md @@ -0,0 +1,65 @@ +# v3.0 + +- Add `--preserve-root` option to executable (default true) +- Drop support for Node.js below version 6 + +# v2.7 + +- Make `glob` an optional dependency + +# 2.6 + +- Retry on EBUSY on non-windows platforms as well +- Make `rimraf.sync` 10000% more reliable on Windows + +# 2.5 + +- Handle Windows EPERM when lstat-ing read-only dirs +- Add glob option to pass options to glob + +# 2.4 + +- Add EPERM to delay/retry loop +- Add `disableGlob` option + +# 2.3 + +- Make maxBusyTries and emfileWait configurable +- Handle weird SunOS unlink-dir issue +- Glob the CLI arg for better Windows support + +# 2.2 + +- Handle ENOENT properly on Windows +- Allow overriding fs methods +- Treat EPERM as indicative of non-empty dir +- Remove optional graceful-fs dep +- Consistently return null error instead of undefined on success +- win32: Treat ENOTEMPTY the same as EBUSY +- Add `rimraf` binary + +# 2.1 + +- Fix SunOS error code for a non-empty directory +- Try rmdir before readdir +- Treat EISDIR like EPERM +- Remove chmod +- Remove lstat polyfill, node 0.7 is not supported + +# 2.0 + +- Fix myGid call to check process.getgid +- Simplify the EBUSY backoff logic. +- Use fs.lstat in node >= 0.7.9 +- Remove gently option +- remove fiber implementation +- Delete files that are marked read-only + +# 1.0 + +- Allow ENOENT in sync method +- Throw when no callback is provided +- Make opts.gently an absolute path +- use 'stat' if 'lstat' is not available +- Consistent error naming, and rethrow non-ENOENT stat errors +- add fiber implementation diff --git a/node_modules/rimraf/LICENSE b/node_modules/rimraf/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/rimraf/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +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. diff --git a/node_modules/rimraf/README.md b/node_modules/rimraf/README.md new file mode 100644 index 000000000..423b8cf85 --- /dev/null +++ b/node_modules/rimraf/README.md @@ -0,0 +1,101 @@ +[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) + +The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. + +Install with `npm install rimraf`, or just drop rimraf.js somewhere. + +## API + +`rimraf(f, [opts], callback)` + +The first parameter will be interpreted as a globbing pattern for files. If you +want to disable globbing you can do so with `opts.disableGlob` (defaults to +`false`). This might be handy, for instance, if you have filenames that contain +globbing wildcard characters. + +The callback will be called with an error if there is one. Certain +errors are handled for you: + +* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of + `opts.maxBusyTries` times before giving up, adding 100ms of wait + between each attempt. The default `maxBusyTries` is 3. +* `ENOENT` - If the file doesn't exist, rimraf will return + successfully, since your desired outcome is already the case. +* `EMFILE` - Since `readdir` requires opening a file descriptor, it's + possible to hit `EMFILE` if too many file descriptors are in use. + In the sync case, there's nothing to be done for this. But in the + async case, rimraf will gradually back off with timeouts up to + `opts.emfileWait` ms, which defaults to 1000. + +## options + +* unlink, chmod, stat, lstat, rmdir, readdir, + unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync + + In order to use a custom file system library, you can override + specific fs functions on the options object. + + If any of these functions are present on the options object, then + the supplied function will be used instead of the default fs + method. + + Sync methods are only relevant for `rimraf.sync()`, of course. + + For example: + + ```javascript + var myCustomFS = require('some-custom-fs') + + rimraf('some-thing', myCustomFS, callback) + ``` + +* maxBusyTries + + If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered + on Windows systems, then rimraf will retry with a linear backoff + wait of 100ms longer on each try. The default maxBusyTries is 3. + + Only relevant for async usage. + +* emfileWait + + If an `EMFILE` error is encountered, then rimraf will retry + repeatedly with a linear backoff of 1ms longer on each try, until + the timeout counter hits this max. The default limit is 1000. + + If you repeatedly encounter `EMFILE` errors, then consider using + [graceful-fs](http://npm.im/graceful-fs) in your program. + + Only relevant for async usage. + +* glob + + Set to `false` to disable [glob](http://npm.im/glob) pattern + matching. + + Set to an object to pass options to the glob module. The default + glob options are `{ nosort: true, silent: true }`. + + Glob version 6 is used in this module. + + Relevant for both sync and async usage. + +* disableGlob + + Set to any non-falsey value to disable globbing entirely. + (Equivalent to setting `glob: false`.) + +## rimraf.sync + +It can remove stuff synchronously, too. But that's not so good. Use +the async API. It's better. + +## CLI + +If installed with `npm install rimraf -g` it can be used as a global +command `rimraf [ ...]` which is useful for cross platform support. + +## mkdirp + +If you need to create a directory recursively, check out +[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/node_modules/rimraf/bin.js b/node_modules/rimraf/bin.js new file mode 100755 index 000000000..023814cc9 --- /dev/null +++ b/node_modules/rimraf/bin.js @@ -0,0 +1,68 @@ +#!/usr/bin/env node + +const rimraf = require('./') + +const path = require('path') + +const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) +const filterOutRoot = arg => { + const ok = preserveRoot === false || !isRoot(arg) + if (!ok) { + console.error(`refusing to remove ${arg}`) + console.error('Set --no-preserve-root to allow this') + } + return ok +} + +let help = false +let dashdash = false +let noglob = false +let preserveRoot = true +const args = process.argv.slice(2).filter(arg => { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg === '--no-glob' || arg === '-G') + noglob = true + else if (arg === '--glob' || arg === '-g') + noglob = false + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else if (arg === '--preserve-root') + preserveRoot = true + else if (arg === '--no-preserve-root') + preserveRoot = false + else + return !!arg +}).filter(arg => !preserveRoot || filterOutRoot(arg)) + +const go = n => { + if (n >= args.length) + return + const options = noglob ? { glob: false } : {} + rimraf(args[n], options, er => { + if (er) + throw er + go(n+1) + }) +} + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + const log = help ? console.log : console.error + log('Usage: rimraf [ ...]') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + log(' -G, --no-glob Do not expand glob patterns in arguments') + log(' -g, --glob Expand glob patterns in arguments (default)') + log(' --preserve-root Do not remove \'/\' (default)') + log(' --no-preserve-root Do not treat \'/\' specially') + log(' -- Stop parsing flags') + process.exit(help ? 0 : 1) +} else + go(0) diff --git a/node_modules/rimraf/package.json b/node_modules/rimraf/package.json new file mode 100644 index 000000000..1bf8d5e38 --- /dev/null +++ b/node_modules/rimraf/package.json @@ -0,0 +1,32 @@ +{ + "name": "rimraf", + "version": "3.0.2", + "main": "rimraf.js", + "description": "A deep deletion module for node (like `rm -rf`)", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "repository": "git://github.com/isaacs/rimraf.git", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "test": "tap test/*.js" + }, + "bin": "./bin.js", + "dependencies": { + "glob": "^7.1.3" + }, + "files": [ + "LICENSE", + "README.md", + "bin.js", + "rimraf.js" + ], + "devDependencies": { + "mkdirp": "^0.5.1", + "tap": "^12.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node_modules/rimraf/rimraf.js b/node_modules/rimraf/rimraf.js new file mode 100644 index 000000000..34da4171d --- /dev/null +++ b/node_modules/rimraf/rimraf.js @@ -0,0 +1,360 @@ +const assert = require("assert") +const path = require("path") +const fs = require("fs") +let glob = undefined +try { + glob = require("glob") +} catch (_err) { + // treat glob as optional. +} + +const defaultGlobOpts = { + nosort: true, + silent: true +} + +// for EMFILE handling +let timeout = 0 + +const isWindows = (process.platform === "win32") + +const defaults = options => { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 + options.emfileWait = options.emfileWait || 1000 + if (options.glob === false) { + options.disableGlob = true + } + if (options.disableGlob !== true && glob === undefined) { + throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') + } + options.disableGlob = options.disableGlob || false + options.glob = options.glob || defaultGlobOpts +} + +const rimraf = (p, options, cb) => { + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + let busyTries = 0 + let errState = null + let n = 0 + + const next = (er) => { + errState = errState || er + if (--n === 0) + cb(errState) + } + + const afterGlob = (er, results) => { + if (er) + return cb(er) + + n = results.length + if (n === 0) + return cb() + + results.forEach(p => { + const CB = (er) => { + if (er) { + if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && + busyTries < options.maxBusyTries) { + busyTries ++ + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < options.emfileWait) { + return setTimeout(() => rimraf_(p, options, CB), timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + next(er) + } + rimraf_(p, options, CB) + }) + } + + if (options.disableGlob || !glob.hasMagic(p)) + return afterGlob(null, [p]) + + options.lstat(p, (er, stat) => { + if (!er) + return afterGlob(null, [p]) + + glob(p, options.glob, afterGlob) + }) + +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +const rimraf_ = (p, options, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === "ENOENT") + return cb(null) + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === "EPERM" && isWindows) + fixWinEPERM(p, options, er, cb) + + if (st && st.isDirectory()) + return rmdir(p, options, er, cb) + + options.unlink(p, er => { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + if (er.code === "EISDIR") + return rmdir(p, options, er, cb) + } + return cb(er) + }) + }) +} + +const fixWinEPERM = (p, options, er, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.chmod(p, 0o666, er2 => { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + options.stat(p, (er3, stats) => { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, options, er, cb) + else + options.unlink(p, cb) + }) + }) +} + +const fixWinEPERMSync = (p, options, er) => { + assert(p) + assert(options) + + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === "ENOENT") + return + else + throw er + } + + let stats + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === "ENOENT") + return + else + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, options, er) + else + options.unlinkSync(p) +} + +const rmdir = (p, options, originalEr, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +const rmkids = (p, options, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, (er, files) => { + if (er) + return cb(er) + let n = files.length + if (n === 0) + return options.rmdir(p, cb) + let errState + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + options.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +const rimrafSync = (p, options) => { + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + let results + + if (options.disableGlob || !glob.hasMagic(p)) { + results = [p] + } else { + try { + options.lstatSync(p) + results = [p] + } catch (er) { + results = glob.sync(p, options.glob) + } + } + + if (!results.length) + return + + for (let i = 0; i < results.length; i++) { + const p = results[i] + + let st + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + + // Windows can EPERM on stat. Life is suffering. + if (er.code === "EPERM" && isWindows) + fixWinEPERMSync(p, options, er) + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) + rmdirSync(p, options, null) + else + options.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + if (er.code !== "EISDIR") + throw er + + rmdirSync(p, options, er) + } + } +} + +const rmdirSync = (p, options, originalEr) => { + assert(p) + assert(options) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options) + } +} + +const rmkidsSync = (p, options) => { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const retries = isWindows ? 100 : 1 + let i = 0 + do { + let threw = true + try { + const ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) + continue + } + } while (true) +} + +module.exports = rimraf +rimraf.sync = rimrafSync diff --git a/node_modules/run-parallel/LICENSE b/node_modules/run-parallel/LICENSE new file mode 100644 index 000000000..c7e685275 --- /dev/null +++ b/node_modules/run-parallel/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/run-parallel/README.md b/node_modules/run-parallel/README.md new file mode 100644 index 000000000..edc3da452 --- /dev/null +++ b/node_modules/run-parallel/README.md @@ -0,0 +1,85 @@ +# run-parallel [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/run-parallel/master.svg +[travis-url]: https://travis-ci.org/feross/run-parallel +[npm-image]: https://img.shields.io/npm/v/run-parallel.svg +[npm-url]: https://npmjs.org/package/run-parallel +[downloads-image]: https://img.shields.io/npm/dm/run-parallel.svg +[downloads-url]: https://npmjs.org/package/run-parallel +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +### Run an array of functions in parallel + +![parallel](https://raw.githubusercontent.com/feross/run-parallel/master/img.png) [![Sauce Test Status](https://saucelabs.com/browser-matrix/run-parallel.svg)](https://saucelabs.com/u/run-parallel) + +### install + +``` +npm install run-parallel +``` + +### usage + +#### parallel(tasks, [callback]) + +Run the `tasks` array of functions in parallel, without waiting until the previous +function has completed. If any of the functions pass an error to its callback, the main +`callback` is immediately called with the value of the error. Once the `tasks` have +completed, the results are passed to the final `callback` as an array. + +It is also possible to use an object instead of an array. Each property will be run as a +function and the results will be passed to the final `callback` as an object instead of +an array. This can be a more readable way of handling the results. + +##### arguments + +- `tasks` - An array or object containing functions to run. Each function is passed a +`callback(err, result)` which it must call on completion with an error `err` (which can +be `null`) and an optional `result` value. +- `callback(err, results)` - An optional callback to run once all the functions have +completed. This function gets a results array (or object) containing all the result +arguments passed to the task callbacks. + +##### example + +```js +var parallel = require('run-parallel') + +parallel([ + function (callback) { + setTimeout(function () { + callback(null, 'one') + }, 200) + }, + function (callback) { + setTimeout(function () { + callback(null, 'two') + }, 100) + } +], +// optional callback +function (err, results) { + // the results array will equal ['one','two'] even though + // the second function had a shorter timeout. +}) +``` + +This module is basically equavalent to +[`async.parallel`](https://github.com/caolan/async#paralleltasks-callback), but it's +handy to just have the one function you need instead of the kitchen sink. Modularity! +Especially handy if you're serving to the browser and need to reduce your javascript +bundle size. + +Works great in the browser with [browserify](http://browserify.org/)! + +### see also + +- [run-auto](https://github.com/feross/run-auto) +- [run-parallel-limit](https://github.com/feross/run-parallel-limit) +- [run-series](https://github.com/feross/run-series) +- [run-waterfall](https://github.com/feross/run-waterfall) + +### license + +MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org). diff --git a/node_modules/run-parallel/index.js b/node_modules/run-parallel/index.js new file mode 100644 index 000000000..6307141d6 --- /dev/null +++ b/node_modules/run-parallel/index.js @@ -0,0 +1,51 @@ +/*! run-parallel. MIT License. Feross Aboukhadijeh */ +module.exports = runParallel + +const queueMicrotask = require('queue-microtask') + +function runParallel (tasks, cb) { + let results, pending, keys + let isSync = true + + if (Array.isArray(tasks)) { + results = [] + pending = tasks.length + } else { + keys = Object.keys(tasks) + results = {} + pending = keys.length + } + + function done (err) { + function end () { + if (cb) cb(err, results) + cb = null + } + if (isSync) queueMicrotask(end) + else end() + } + + function each (i, err, result) { + results[i] = result + if (--pending === 0 || err) { + done(err) + } + } + + if (!pending) { + // empty + done(null) + } else if (keys) { + // object + keys.forEach(function (key) { + tasks[key](function (err, result) { each(key, err, result) }) + }) + } else { + // array + tasks.forEach(function (task, i) { + task(function (err, result) { each(i, err, result) }) + }) + } + + isSync = false +} diff --git a/node_modules/run-parallel/package.json b/node_modules/run-parallel/package.json new file mode 100644 index 000000000..1f1475788 --- /dev/null +++ b/node_modules/run-parallel/package.json @@ -0,0 +1,58 @@ +{ + "name": "run-parallel", + "description": "Run an array of functions in parallel", + "version": "1.2.0", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/run-parallel/issues" + }, + "dependencies": { + "queue-microtask": "^1.2.2" + }, + "devDependencies": { + "airtap": "^3.0.0", + "standard": "*", + "tape": "^5.0.1" + }, + "homepage": "https://github.com/feross/run-parallel", + "keywords": [ + "parallel", + "async", + "function", + "callback", + "asynchronous", + "run", + "array", + "run parallel" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/run-parallel.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "airtap -- test/*.js", + "test-browser-local": "airtap --local -- test/*.js", + "test-node": "tape test/*.js" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] +} diff --git a/node_modules/semver/LICENSE b/node_modules/semver/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +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. diff --git a/node_modules/semver/README.md b/node_modules/semver/README.md new file mode 100644 index 000000000..53ea9b52a --- /dev/null +++ b/node_modules/semver/README.md @@ -0,0 +1,637 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +You can also just load the module for the function that you care about, if +you'd like to minimize your footprint. + +```js +// load the whole API at once in a single object +const semver = require('semver') + +// or just load the bits you need +// all of them listed here, just pick and choose what you want + +// classes +const SemVer = require('semver/classes/semver') +const Comparator = require('semver/classes/comparator') +const Range = require('semver/classes/range') + +// functions for working with versions +const semverParse = require('semver/functions/parse') +const semverValid = require('semver/functions/valid') +const semverClean = require('semver/functions/clean') +const semverInc = require('semver/functions/inc') +const semverDiff = require('semver/functions/diff') +const semverMajor = require('semver/functions/major') +const semverMinor = require('semver/functions/minor') +const semverPatch = require('semver/functions/patch') +const semverPrerelease = require('semver/functions/prerelease') +const semverCompare = require('semver/functions/compare') +const semverRcompare = require('semver/functions/rcompare') +const semverCompareLoose = require('semver/functions/compare-loose') +const semverCompareBuild = require('semver/functions/compare-build') +const semverSort = require('semver/functions/sort') +const semverRsort = require('semver/functions/rsort') + +// low-level comparators between versions +const semverGt = require('semver/functions/gt') +const semverLt = require('semver/functions/lt') +const semverEq = require('semver/functions/eq') +const semverNeq = require('semver/functions/neq') +const semverGte = require('semver/functions/gte') +const semverLte = require('semver/functions/lte') +const semverCmp = require('semver/functions/cmp') +const semverCoerce = require('semver/functions/coerce') + +// working with ranges +const semverSatisfies = require('semver/functions/satisfies') +const semverMaxSatisfying = require('semver/ranges/max-satisfying') +const semverMinSatisfying = require('semver/ranges/min-satisfying') +const semverToComparators = require('semver/ranges/to-comparators') +const semverMinVersion = require('semver/ranges/min-version') +const semverValidRange = require('semver/ranges/valid') +const semverOutside = require('semver/ranges/outside') +const semverGtr = require('semver/ranges/gtr') +const semverLtr = require('semver/ranges/ltr') +const semverIntersects = require('semver/ranges/intersects') +const simplifyRange = require('semver/ranges/simplify') +const rangeSubset = require('semver/ranges/subset') +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-n <0|1> + This is the base to be used for the prerelease identifier. + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and +would match the versions `2.0.0` and `3.1.0`, but not the versions +`1.0.1` or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for the purpose of range +matching) by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +#### Prerelease Identifier Base + +The method `.inc` takes an optional parameter 'identifierBase' string +that will let you let your prerelease number as zero-based or one-based. +Set to `false` to omit the prerelease number altogether. +If you do not specify this parameter, it will default to zero-based. + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta', '1') +// '1.2.4-beta.1' +``` + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta', false) +// '1.2.4-beta' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta -n 1 +1.2.4-beta.1 +``` + +```bash +$ semver 1.2.3 -i prerelease --preid beta -n false +1.2.4-beta +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless + `includePrerelease` is specified, in which case any version at all + satisfies) +* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero element in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0-0` +* `^0.2.3` := `>=0.2.3 <0.3.0-0` +* `^0.0.3` := `>=0.0.3 <0.0.4-0` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0-0` +* `^0.0.x` := `>=0.0.0 <0.1.0-0` +* `^0.0` := `>=0.0.0 <0.1.0-0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0-0` +* `^0.x` := `>=0.0.0 <1.0.0-0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose` Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease` Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions + are equal. Sorts in ascending order if passed to `Array.sort()`. + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can possibly match + the given range. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the ranges comparators intersect +* `simplifyRange(versions, range)`: Return a "simplified" range that + matches the same items in `versions` list as the range specified. Note + that it does *not* guarantee that it would match the same versions in all + cases, only for the set of versions provided. This is useful when + generating ranges by joining together multiple versions with `||` + programmatically, to provide the user with something a bit more + ergonomic. If the provided range is shorter in string-length than the + generated range, then that is returned. +* `subset(subRange, superRange)`: Return `true` if the `subRange` range is + entirely contained by the `superRange` range. + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version, options)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string, and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). + +If the `options.rtl` flag is set, then `coerce` will return the right-most +coercible tuple that does not share an ending index with a longer coercible +tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not +`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of +any other overlapping SemVer tuple. + +### Clean + +* `clean(version)`: Clean a string to be a valid semver if possible + +This will return a cleaned and trimmed semver version. If the provided +version is not valid a null will be returned. This does not work for +ranges. + +ex. +* `s.clean(' = v 2.1.5foo')`: `null` +* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean(' = v 2.1.5-foo')`: `null` +* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean('=v2.1.5')`: `'2.1.5'` +* `s.clean(' =v2.1.5')`: `2.1.5` +* `s.clean(' 2.1.5 ')`: `'2.1.5'` +* `s.clean('~1.0.0')`: `null` + +## Constants + +As a convenience, helper constants are exported to provide information about what `node-semver` supports: + +### `RELEASE_TYPES` + +- major +- premajor +- minor +- preminor +- patch +- prepatch +- prerelease + +``` +const semver = require('semver'); + +if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) { + console.log('This is a valid release type!'); +} else { + console.warn('This is NOT a valid release type!'); +} +``` + +### `SEMVER_SPEC_VERSION` + +2.0.0 + +``` +const semver = require('semver'); + +console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION); +``` + +## Exported Modules + + + +You may pull in just the part of this semver utility that you need, if you +are sensitive to packing and tree-shaking concerns. The main +`require('semver')` export uses getter functions to lazily load the parts +of the API that are used. + +The following modules are available: + +* `require('semver')` +* `require('semver/classes')` +* `require('semver/classes/comparator')` +* `require('semver/classes/range')` +* `require('semver/classes/semver')` +* `require('semver/functions/clean')` +* `require('semver/functions/cmp')` +* `require('semver/functions/coerce')` +* `require('semver/functions/compare')` +* `require('semver/functions/compare-build')` +* `require('semver/functions/compare-loose')` +* `require('semver/functions/diff')` +* `require('semver/functions/eq')` +* `require('semver/functions/gt')` +* `require('semver/functions/gte')` +* `require('semver/functions/inc')` +* `require('semver/functions/lt')` +* `require('semver/functions/lte')` +* `require('semver/functions/major')` +* `require('semver/functions/minor')` +* `require('semver/functions/neq')` +* `require('semver/functions/parse')` +* `require('semver/functions/patch')` +* `require('semver/functions/prerelease')` +* `require('semver/functions/rcompare')` +* `require('semver/functions/rsort')` +* `require('semver/functions/satisfies')` +* `require('semver/functions/sort')` +* `require('semver/functions/valid')` +* `require('semver/ranges/gtr')` +* `require('semver/ranges/intersects')` +* `require('semver/ranges/ltr')` +* `require('semver/ranges/max-satisfying')` +* `require('semver/ranges/min-satisfying')` +* `require('semver/ranges/min-version')` +* `require('semver/ranges/outside')` +* `require('semver/ranges/to-comparators')` +* `require('semver/ranges/valid')` + diff --git a/node_modules/semver/bin/semver.js b/node_modules/semver/bin/semver.js new file mode 100755 index 000000000..242b7ade7 --- /dev/null +++ b/node_modules/semver/bin/semver.js @@ -0,0 +1,197 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +const argv = process.argv.slice(2) + +let versions = [] + +const range = [] + +let inc = null + +const version = require('../package.json').version + +let loose = false + +let includePrerelease = false + +let coerce = false + +let rtl = false + +let identifier + +let identifierBase + +const semver = require('../') +const parseOptions = require('../internal/parse-options') + +let reverse = false + +let options = {} + +const main = () => { + if (!argv.length) { + return help() + } + while (argv.length) { + let a = argv.shift() + const indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + const value = a.slice(indexOfEqualSign + 1) + a = a.slice(0, indexOfEqualSign) + argv.unshift(value) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-n': + identifierBase = argv.shift() + if (identifierBase === 'false') { + identifierBase = false + } + break + case '-c': case '--coerce': + coerce = true + break + case '--rtl': + rtl = true + break + case '--ltr': + rtl = false + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + options = parseOptions({ loose, includePrerelease, rtl }) + + versions = versions.map((v) => { + return coerce ? (semver.coerce(v, options) || { version: v }).version : v + }).filter((v) => { + return semver.valid(v) + }) + if (!versions.length) { + return fail() + } + if (inc && (versions.length !== 1 || range.length)) { + return failInc() + } + + for (let i = 0, l = range.length; i < l; i++) { + versions = versions.filter((v) => { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) { + return fail() + } + } + return success(versions) +} + +const failInc = () => { + console.error('--inc can only be used on a single version with no range') + fail() +} + +const fail = () => process.exit(1) + +const success = () => { + const compare = reverse ? 'rcompare' : 'compare' + versions.sort((a, b) => { + return semver[compare](a, b, options) + }).map((v) => { + return semver.clean(v, options) + }).map((v) => { + return inc ? semver.inc(v, inc, options, identifier, identifierBase) : v + }).forEach((v, i, _) => { + console.log(v) + }) +} + +const help = () => console.log( +`SemVer ${version} + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +-n + Base number to be used for the prerelease identifier. + Can be either 0 or 1, or false to omit the number altogether. + Defaults to 0. + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them.`) + +main() diff --git a/node_modules/semver/classes/comparator.js b/node_modules/semver/classes/comparator.js new file mode 100644 index 000000000..3d39c0eef --- /dev/null +++ b/node_modules/semver/classes/comparator.js @@ -0,0 +1,141 @@ +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + + constructor (comp, options) { + options = parseOptions(options) + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) + } + + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) + + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } + } + + toString () { + return this.value + } + + test (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) + } + + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } + + options = parseOptions(options) + + // Special cases where nothing can possibly be lower + if (options.includePrerelease && + (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { + return false + } + if (!options.includePrerelease && + (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { + return false + } + + // Same direction increasing (> or >=) + if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { + return true + } + // Same direction decreasing (< or <=) + if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { + return true + } + // same SemVer and both sides are inclusive (<= or >=) + if ( + (this.semver.version === comp.semver.version) && + this.operator.includes('=') && comp.operator.includes('=')) { + return true + } + // opposite directions less than + if (cmp(this.semver, '<', comp.semver, options) && + this.operator.startsWith('>') && comp.operator.startsWith('<')) { + return true + } + // opposite directions greater than + if (cmp(this.semver, '>', comp.semver, options) && + this.operator.startsWith('<') && comp.operator.startsWith('>')) { + return true + } + return false + } +} + +module.exports = Comparator + +const parseOptions = require('../internal/parse-options') +const { safeRe: re, t } = require('../internal/re') +const cmp = require('../functions/cmp') +const debug = require('../internal/debug') +const SemVer = require('./semver') +const Range = require('./range') diff --git a/node_modules/semver/classes/index.js b/node_modules/semver/classes/index.js new file mode 100644 index 000000000..5e3f5c9b1 --- /dev/null +++ b/node_modules/semver/classes/index.js @@ -0,0 +1,5 @@ +module.exports = { + SemVer: require('./semver.js'), + Range: require('./range.js'), + Comparator: require('./comparator.js'), +} diff --git a/node_modules/semver/classes/range.js b/node_modules/semver/classes/range.js new file mode 100644 index 000000000..7e7c41410 --- /dev/null +++ b/node_modules/semver/classes/range.js @@ -0,0 +1,539 @@ +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + options = parseOptions(options) + + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.format() + return this + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range + .trim() + .split(/\s+/) + .join(' ') + + // First, split on || + this.set = this.raw + .split('||') + // map the range to a 2d array of comparators + .map(r => this.parseRange(r.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) + + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`) + } + + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) { + this.set = [first] + } else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } + } + + this.format() + } + + format () { + this.range = this.set + .map((comps) => comps.join(' ').trim()) + .join('||') + .trim() + return this.range + } + + toString () { + return this.range + } + + parseRange (range) { + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = + (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | + (this.options.loose && FLAG_LOOSE) + const memoKey = memoOpts + ':' + range + const cached = cache.get(memoKey) + if (cached) { + return cached + } + + const loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + debug('tilde trim', range) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) + debug('caret trim', range) + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + let rangeList = range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map(comp => replaceGTE0(comp, this.options)) + + if (loose) { + // in loose mode, throw out any that are not valid comparators + rangeList = rangeList.filter(comp => { + debug('loose invalid filter', comp, this.options) + return !!comp.match(re[t.COMPARATORLOOSE]) + }) + } + debug('range list', rangeList) + + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const rangeMap = new Map() + const comparators = rangeList.map(comp => new Comparator(comp, this.options)) + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp] + } + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) { + rangeMap.delete('') + } + + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result + } + + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } + + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false + } +} + +module.exports = Range + +const LRU = require('lru-cache') +const cache = new LRU({ max: 1000 }) + +const parseOptions = require('../internal/parse-options') +const Comparator = require('./comparator') +const debug = require('../internal/debug') +const SemVer = require('./semver') +const { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace, +} = require('../internal/re') +const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants') + +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +// ~0.0.1 --> >=0.0.1 <0.1.0-0 +const replaceTildes = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceTilde(c, options)) + .join(' ') +} + +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +// ^0.0.1 --> >=0.0.1 <0.0.2-0 +// ^0.1.0 --> >=0.1.0 <0.2.0-0 +const replaceCarets = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceCaret(c, options)) + .join(' ') +} + +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } + + debug('caret return', ret) + return ret + }) +} + +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp + .split(/\s+/) + .map((c) => replaceXRange(c, options)) + .join(' ') +} + +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + if (gtlt === '<') { + pr = '-0' + } + + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp + .trim() + .replace(re[t.STAR], '') +} + +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp + .trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } + + return `${from} ${to}`.trim() +} + +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} diff --git a/node_modules/semver/classes/semver.js b/node_modules/semver/classes/semver.js new file mode 100644 index 000000000..84e84590e --- /dev/null +++ b/node_modules/semver/classes/semver.js @@ -0,0 +1,302 @@ +const debug = require('../internal/debug') +const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') +const { safeRe: re, t } = require('../internal/re') + +const parseOptions = require('../internal/parse-options') +const { compareIdentifiers } = require('../internal/identifiers') +class SemVer { + constructor (version, options) { + options = parseOptions(options) + + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } + + if (other.version === this.version) { + return 0 + } + + return this.compareMain(other) || this.comparePre(other) + } + + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) + } + + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier, identifierBase) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier, identifierBase) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier, identifierBase) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier, identifierBase) + this.inc('pre', identifier, identifierBase) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier, identifierBase) + } + this.inc('pre', identifier, identifierBase) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': { + const base = Number(identifierBase) ? 1 : 0 + + if (!identifier && identifierBase === false) { + throw new Error('invalid increment argument: identifier is empty') + } + + if (this.prerelease.length === 0) { + this.prerelease = [base] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + if (identifier === this.prerelease.join('.') && identifierBase === false) { + throw new Error('invalid increment argument: identifier already exists') + } + this.prerelease.push(base) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + let prerelease = [identifier, base] + if (identifierBase === false) { + prerelease = [identifier] + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease + } + } else { + this.prerelease = prerelease + } + } + break + } + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.raw = this.format() + if (this.build.length) { + this.raw += `+${this.build.join('.')}` + } + return this + } +} + +module.exports = SemVer diff --git a/node_modules/semver/functions/clean.js b/node_modules/semver/functions/clean.js new file mode 100644 index 000000000..811fe6b82 --- /dev/null +++ b/node_modules/semver/functions/clean.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean diff --git a/node_modules/semver/functions/cmp.js b/node_modules/semver/functions/cmp.js new file mode 100644 index 000000000..401190947 --- /dev/null +++ b/node_modules/semver/functions/cmp.js @@ -0,0 +1,52 @@ +const eq = require('./eq') +const neq = require('./neq') +const gt = require('./gt') +const gte = require('./gte') +const lt = require('./lt') +const lte = require('./lte') + +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a === b + + case '!==': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError(`Invalid operator: ${op}`) + } +} +module.exports = cmp diff --git a/node_modules/semver/functions/coerce.js b/node_modules/semver/functions/coerce.js new file mode 100644 index 000000000..febbff9c2 --- /dev/null +++ b/node_modules/semver/functions/coerce.js @@ -0,0 +1,52 @@ +const SemVer = require('../classes/semver') +const parse = require('./parse') +const { safeRe: re, t } = require('../internal/re') + +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + let match = null + if (!options.rtl) { + match = version.match(re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + let next + while ((next = re[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + re[t.COERCERTL].lastIndex = -1 + } + + if (match === null) { + return null + } + + return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) +} +module.exports = coerce diff --git a/node_modules/semver/functions/compare-build.js b/node_modules/semver/functions/compare-build.js new file mode 100644 index 000000000..9eb881bef --- /dev/null +++ b/node_modules/semver/functions/compare-build.js @@ -0,0 +1,7 @@ +const SemVer = require('../classes/semver') +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} +module.exports = compareBuild diff --git a/node_modules/semver/functions/compare-loose.js b/node_modules/semver/functions/compare-loose.js new file mode 100644 index 000000000..4881fbe00 --- /dev/null +++ b/node_modules/semver/functions/compare-loose.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose diff --git a/node_modules/semver/functions/compare.js b/node_modules/semver/functions/compare.js new file mode 100644 index 000000000..748b7afa5 --- /dev/null +++ b/node_modules/semver/functions/compare.js @@ -0,0 +1,5 @@ +const SemVer = require('../classes/semver') +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) + +module.exports = compare diff --git a/node_modules/semver/functions/diff.js b/node_modules/semver/functions/diff.js new file mode 100644 index 000000000..fc224e302 --- /dev/null +++ b/node_modules/semver/functions/diff.js @@ -0,0 +1,65 @@ +const parse = require('./parse.js') + +const diff = (version1, version2) => { + const v1 = parse(version1, null, true) + const v2 = parse(version2, null, true) + const comparison = v1.compare(v2) + + if (comparison === 0) { + return null + } + + const v1Higher = comparison > 0 + const highVersion = v1Higher ? v1 : v2 + const lowVersion = v1Higher ? v2 : v1 + const highHasPre = !!highVersion.prerelease.length + const lowHasPre = !!lowVersion.prerelease.length + + if (lowHasPre && !highHasPre) { + // Going from prerelease -> no prerelease requires some special casing + + // If the low version has only a major, then it will always be a major + // Some examples: + // 1.0.0-1 -> 1.0.0 + // 1.0.0-1 -> 1.1.1 + // 1.0.0-1 -> 2.0.0 + if (!lowVersion.patch && !lowVersion.minor) { + return 'major' + } + + // Otherwise it can be determined by checking the high version + + if (highVersion.patch) { + // anything higher than a patch bump would result in the wrong version + return 'patch' + } + + if (highVersion.minor) { + // anything higher than a minor bump would result in the wrong version + return 'minor' + } + + // bumping major/minor/patch all have same result + return 'major' + } + + // add the `pre` prefix if we are going to a prerelease version + const prefix = highHasPre ? 'pre' : '' + + if (v1.major !== v2.major) { + return prefix + 'major' + } + + if (v1.minor !== v2.minor) { + return prefix + 'minor' + } + + if (v1.patch !== v2.patch) { + return prefix + 'patch' + } + + // high and low are preleases + return 'prerelease' +} + +module.exports = diff diff --git a/node_modules/semver/functions/eq.js b/node_modules/semver/functions/eq.js new file mode 100644 index 000000000..271fed976 --- /dev/null +++ b/node_modules/semver/functions/eq.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq diff --git a/node_modules/semver/functions/gt.js b/node_modules/semver/functions/gt.js new file mode 100644 index 000000000..d9b2156d8 --- /dev/null +++ b/node_modules/semver/functions/gt.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt diff --git a/node_modules/semver/functions/gte.js b/node_modules/semver/functions/gte.js new file mode 100644 index 000000000..5aeaa6347 --- /dev/null +++ b/node_modules/semver/functions/gte.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte diff --git a/node_modules/semver/functions/inc.js b/node_modules/semver/functions/inc.js new file mode 100644 index 000000000..7670b1bea --- /dev/null +++ b/node_modules/semver/functions/inc.js @@ -0,0 +1,19 @@ +const SemVer = require('../classes/semver') + +const inc = (version, release, options, identifier, identifierBase) => { + if (typeof (options) === 'string') { + identifierBase = identifier + identifier = options + options = undefined + } + + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version + } catch (er) { + return null + } +} +module.exports = inc diff --git a/node_modules/semver/functions/lt.js b/node_modules/semver/functions/lt.js new file mode 100644 index 000000000..b440ab7d4 --- /dev/null +++ b/node_modules/semver/functions/lt.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt diff --git a/node_modules/semver/functions/lte.js b/node_modules/semver/functions/lte.js new file mode 100644 index 000000000..6dcc95650 --- /dev/null +++ b/node_modules/semver/functions/lte.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte diff --git a/node_modules/semver/functions/major.js b/node_modules/semver/functions/major.js new file mode 100644 index 000000000..4283165e9 --- /dev/null +++ b/node_modules/semver/functions/major.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major diff --git a/node_modules/semver/functions/minor.js b/node_modules/semver/functions/minor.js new file mode 100644 index 000000000..57b3455f8 --- /dev/null +++ b/node_modules/semver/functions/minor.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const minor = (a, loose) => new SemVer(a, loose).minor +module.exports = minor diff --git a/node_modules/semver/functions/neq.js b/node_modules/semver/functions/neq.js new file mode 100644 index 000000000..f944c0157 --- /dev/null +++ b/node_modules/semver/functions/neq.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const neq = (a, b, loose) => compare(a, b, loose) !== 0 +module.exports = neq diff --git a/node_modules/semver/functions/parse.js b/node_modules/semver/functions/parse.js new file mode 100644 index 000000000..459b3b173 --- /dev/null +++ b/node_modules/semver/functions/parse.js @@ -0,0 +1,16 @@ +const SemVer = require('../classes/semver') +const parse = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version + } + try { + return new SemVer(version, options) + } catch (er) { + if (!throwErrors) { + return null + } + throw er + } +} + +module.exports = parse diff --git a/node_modules/semver/functions/patch.js b/node_modules/semver/functions/patch.js new file mode 100644 index 000000000..63afca252 --- /dev/null +++ b/node_modules/semver/functions/patch.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const patch = (a, loose) => new SemVer(a, loose).patch +module.exports = patch diff --git a/node_modules/semver/functions/prerelease.js b/node_modules/semver/functions/prerelease.js new file mode 100644 index 000000000..06aa13248 --- /dev/null +++ b/node_modules/semver/functions/prerelease.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease diff --git a/node_modules/semver/functions/rcompare.js b/node_modules/semver/functions/rcompare.js new file mode 100644 index 000000000..0ac509e79 --- /dev/null +++ b/node_modules/semver/functions/rcompare.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const rcompare = (a, b, loose) => compare(b, a, loose) +module.exports = rcompare diff --git a/node_modules/semver/functions/rsort.js b/node_modules/semver/functions/rsort.js new file mode 100644 index 000000000..82404c5cf --- /dev/null +++ b/node_modules/semver/functions/rsort.js @@ -0,0 +1,3 @@ +const compareBuild = require('./compare-build') +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort diff --git a/node_modules/semver/functions/satisfies.js b/node_modules/semver/functions/satisfies.js new file mode 100644 index 000000000..50af1c199 --- /dev/null +++ b/node_modules/semver/functions/satisfies.js @@ -0,0 +1,10 @@ +const Range = require('../classes/range') +const satisfies = (version, range, options) => { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} +module.exports = satisfies diff --git a/node_modules/semver/functions/sort.js b/node_modules/semver/functions/sort.js new file mode 100644 index 000000000..4d10917ab --- /dev/null +++ b/node_modules/semver/functions/sort.js @@ -0,0 +1,3 @@ +const compareBuild = require('./compare-build') +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort diff --git a/node_modules/semver/functions/valid.js b/node_modules/semver/functions/valid.js new file mode 100644 index 000000000..f27bae107 --- /dev/null +++ b/node_modules/semver/functions/valid.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null +} +module.exports = valid diff --git a/node_modules/semver/index.js b/node_modules/semver/index.js new file mode 100644 index 000000000..86d42ac16 --- /dev/null +++ b/node_modules/semver/index.js @@ -0,0 +1,89 @@ +// just pre-load all the stuff that index.js lazily exports +const internalRe = require('./internal/re') +const constants = require('./internal/constants') +const SemVer = require('./classes/semver') +const identifiers = require('./internal/identifiers') +const parse = require('./functions/parse') +const valid = require('./functions/valid') +const clean = require('./functions/clean') +const inc = require('./functions/inc') +const diff = require('./functions/diff') +const major = require('./functions/major') +const minor = require('./functions/minor') +const patch = require('./functions/patch') +const prerelease = require('./functions/prerelease') +const compare = require('./functions/compare') +const rcompare = require('./functions/rcompare') +const compareLoose = require('./functions/compare-loose') +const compareBuild = require('./functions/compare-build') +const sort = require('./functions/sort') +const rsort = require('./functions/rsort') +const gt = require('./functions/gt') +const lt = require('./functions/lt') +const eq = require('./functions/eq') +const neq = require('./functions/neq') +const gte = require('./functions/gte') +const lte = require('./functions/lte') +const cmp = require('./functions/cmp') +const coerce = require('./functions/coerce') +const Comparator = require('./classes/comparator') +const Range = require('./classes/range') +const satisfies = require('./functions/satisfies') +const toComparators = require('./ranges/to-comparators') +const maxSatisfying = require('./ranges/max-satisfying') +const minSatisfying = require('./ranges/min-satisfying') +const minVersion = require('./ranges/min-version') +const validRange = require('./ranges/valid') +const outside = require('./ranges/outside') +const gtr = require('./ranges/gtr') +const ltr = require('./ranges/ltr') +const intersects = require('./ranges/intersects') +const simplifyRange = require('./ranges/simplify') +const subset = require('./ranges/subset') +module.exports = { + parse, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers, +} diff --git a/node_modules/semver/internal/constants.js b/node_modules/semver/internal/constants.js new file mode 100644 index 000000000..94be1c570 --- /dev/null +++ b/node_modules/semver/internal/constants.js @@ -0,0 +1,35 @@ +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' + +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || +/* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 + +// Max safe length for a build identifier. The max length minus 6 characters for +// the shortest version with a build 0.0.0+BUILD. +const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +const RELEASE_TYPES = [ + 'major', + 'premajor', + 'minor', + 'preminor', + 'patch', + 'prepatch', + 'prerelease', +] + +module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 0b001, + FLAG_LOOSE: 0b010, +} diff --git a/node_modules/semver/internal/debug.js b/node_modules/semver/internal/debug.js new file mode 100644 index 000000000..1c00e1369 --- /dev/null +++ b/node_modules/semver/internal/debug.js @@ -0,0 +1,9 @@ +const debug = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {} + +module.exports = debug diff --git a/node_modules/semver/internal/identifiers.js b/node_modules/semver/internal/identifiers.js new file mode 100644 index 000000000..e612d0a3d --- /dev/null +++ b/node_modules/semver/internal/identifiers.js @@ -0,0 +1,23 @@ +const numeric = /^[0-9]+$/ +const compareIdentifiers = (a, b) => { + const anum = numeric.test(a) + const bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) + +module.exports = { + compareIdentifiers, + rcompareIdentifiers, +} diff --git a/node_modules/semver/internal/parse-options.js b/node_modules/semver/internal/parse-options.js new file mode 100644 index 000000000..10d64ce06 --- /dev/null +++ b/node_modules/semver/internal/parse-options.js @@ -0,0 +1,15 @@ +// parse out just the options we care about +const looseOption = Object.freeze({ loose: true }) +const emptyOpts = Object.freeze({ }) +const parseOptions = options => { + if (!options) { + return emptyOpts + } + + if (typeof options !== 'object') { + return looseOption + } + + return options +} +module.exports = parseOptions diff --git a/node_modules/semver/internal/re.js b/node_modules/semver/internal/re.js new file mode 100644 index 000000000..21150b3ec --- /dev/null +++ b/node_modules/semver/internal/re.js @@ -0,0 +1,212 @@ +const { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH, +} = require('./constants') +const debug = require('./debug') +exports = module.exports = {} + +// The actual regexps go on exports.re +const re = exports.re = [] +const safeRe = exports.safeRe = [] +const src = exports.src = [] +const t = exports.t = {} +let R = 0 + +const LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +const safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +const makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value + .split(`${token}*`).join(`${token}{0,${max}}`) + .split(`${token}+`).join(`${token}{1,${max}}`) + } + return value +} + +const createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value) + const index = R++ + debug(name, index, value) + t[name] = index + src[index] = value + re[index] = new RegExp(value, isGlobal ? 'g' : undefined) + safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') +createToken('NUMERICIDENTIFIERLOOSE', '\\d+') + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) + +// ## Main Version +// Three dot-separated numeric identifiers. + +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`) + +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) + +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] +}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`) + +createToken('FULL', `^${src[t.FULLPLAIN]}$`) + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`) + +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + +createToken('GTLT', '((?:<|>)?=?)') + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCE', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:$|[^\\d])`) +createToken('COERCERTL', src[t.COERCE], true) + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)') + +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) +exports.tildeTrimReplace = '$1~' + +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)') + +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) +exports.caretTrimReplace = '$1^' + +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) +createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) +exports.comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`) + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json new file mode 100644 index 000000000..c145eca2f --- /dev/null +++ b/node_modules/semver/package.json @@ -0,0 +1,87 @@ +{ + "name": "semver", + "version": "7.5.4", + "description": "The semantic version parser used by npm.", + "main": "index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force" + }, + "devDependencies": { + "@npmcli/eslint-config": "^4.0.0", + "@npmcli/template-oss": "4.17.0", + "tap": "^16.0.0" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/npm/node-semver.git" + }, + "bin": { + "semver": "bin/semver.js" + }, + "files": [ + "bin/", + "lib/", + "classes/", + "functions/", + "internal/", + "ranges/", + "index.js", + "preload.js", + "range.bnf" + ], + "tap": { + "timeout": 30, + "coverage-map": "map.js", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": ">=10" + }, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.17.0", + "engines": ">=10", + "ciVersions": [ + "10.0.0", + "10.x", + "12.x", + "14.x", + "16.x", + "18.x" + ], + "npmSpec": "8", + "distPaths": [ + "classes/", + "functions/", + "internal/", + "ranges/", + "index.js", + "preload.js", + "range.bnf" + ], + "allowPaths": [ + "/classes/", + "/functions/", + "/internal/", + "/ranges/", + "/index.js", + "/preload.js", + "/range.bnf" + ], + "publish": "true" + } +} diff --git a/node_modules/semver/preload.js b/node_modules/semver/preload.js new file mode 100644 index 000000000..947cd4f79 --- /dev/null +++ b/node_modules/semver/preload.js @@ -0,0 +1,2 @@ +// XXX remove in v8 or beyond +module.exports = require('./index.js') diff --git a/node_modules/semver/range.bnf b/node_modules/semver/range.bnf new file mode 100644 index 000000000..d4c6ae0d7 --- /dev/null +++ b/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/node_modules/semver/ranges/gtr.js b/node_modules/semver/ranges/gtr.js new file mode 100644 index 000000000..db7e35599 --- /dev/null +++ b/node_modules/semver/ranges/gtr.js @@ -0,0 +1,4 @@ +// Determine if version is greater than all the versions possible in the range. +const outside = require('./outside') +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr diff --git a/node_modules/semver/ranges/intersects.js b/node_modules/semver/ranges/intersects.js new file mode 100644 index 000000000..e0e9b7ce0 --- /dev/null +++ b/node_modules/semver/ranges/intersects.js @@ -0,0 +1,7 @@ +const Range = require('../classes/range') +const intersects = (r1, r2, options) => { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2, options) +} +module.exports = intersects diff --git a/node_modules/semver/ranges/ltr.js b/node_modules/semver/ranges/ltr.js new file mode 100644 index 000000000..528a885eb --- /dev/null +++ b/node_modules/semver/ranges/ltr.js @@ -0,0 +1,4 @@ +const outside = require('./outside') +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr diff --git a/node_modules/semver/ranges/max-satisfying.js b/node_modules/semver/ranges/max-satisfying.js new file mode 100644 index 000000000..6e3d993c6 --- /dev/null +++ b/node_modules/semver/ranges/max-satisfying.js @@ -0,0 +1,25 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} +module.exports = maxSatisfying diff --git a/node_modules/semver/ranges/min-satisfying.js b/node_modules/semver/ranges/min-satisfying.js new file mode 100644 index 000000000..9b60974e2 --- /dev/null +++ b/node_modules/semver/ranges/min-satisfying.js @@ -0,0 +1,24 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} +module.exports = minSatisfying diff --git a/node_modules/semver/ranges/min-version.js b/node_modules/semver/ranges/min-version.js new file mode 100644 index 000000000..350e1f783 --- /dev/null +++ b/node_modules/semver/ranges/min-version.js @@ -0,0 +1,61 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const gt = require('../functions/gt') + +const minVersion = (range, loose) => { + range = new Range(range, loose) + + let minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let setMin = null + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!setMin || gt(compver, setMin)) { + setMin = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`) + } + }) + if (setMin && (!minver || gt(minver, setMin))) { + minver = setMin + } + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} +module.exports = minVersion diff --git a/node_modules/semver/ranges/outside.js b/node_modules/semver/ranges/outside.js new file mode 100644 index 000000000..ae99b10a5 --- /dev/null +++ b/node_modules/semver/ranges/outside.js @@ -0,0 +1,80 @@ +const SemVer = require('../classes/semver') +const Comparator = require('../classes/comparator') +const { ANY } = Comparator +const Range = require('../classes/range') +const satisfies = require('../functions/satisfies') +const gt = require('../functions/gt') +const lt = require('../functions/lt') +const lte = require('../functions/lte') +const gte = require('../functions/gte') + +const outside = (version, range, hilo, options) => { + version = new SemVer(version, options) + range = new Range(range, options) + + let gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisfies the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let high = null + let low = null + + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +module.exports = outside diff --git a/node_modules/semver/ranges/simplify.js b/node_modules/semver/ranges/simplify.js new file mode 100644 index 000000000..618d5b627 --- /dev/null +++ b/node_modules/semver/ranges/simplify.js @@ -0,0 +1,47 @@ +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') +module.exports = (versions, range, options) => { + const set = [] + let first = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!first) { + first = version + } + } else { + if (prev) { + set.push([first, prev]) + } + prev = null + first = null + } + } + if (first) { + set.push([first, null]) + } + + const ranges = [] + for (const [min, max] of set) { + if (min === max) { + ranges.push(min) + } else if (!max && min === v[0]) { + ranges.push('*') + } else if (!max) { + ranges.push(`>=${min}`) + } else if (min === v[0]) { + ranges.push(`<=${max}`) + } else { + ranges.push(`${min} - ${max}`) + } + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} diff --git a/node_modules/semver/ranges/subset.js b/node_modules/semver/ranges/subset.js new file mode 100644 index 000000000..1e5c26837 --- /dev/null +++ b/node_modules/semver/ranges/subset.js @@ -0,0 +1,247 @@ +const Range = require('../classes/range.js') +const Comparator = require('../classes/comparator.js') +const { ANY } = Comparator +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') + +// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: +// - Every simple range `r1, r2, ...` is a null set, OR +// - Every simple range `r1, r2, ...` which is not a null set is a subset of +// some `R1, R2, ...` +// +// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: +// - If c is only the ANY comparator +// - If C is only the ANY comparator, return true +// - Else if in prerelease mode, return false +// - else replace c with `[>=0.0.0]` +// - If C is only the ANY comparator +// - if in prerelease mode, return true +// - else replace C with `[>=0.0.0]` +// - Let EQ be the set of = comparators in c +// - If EQ is more than one, return true (null set) +// - Let GT be the highest > or >= comparator in c +// - Let LT be the lowest < or <= comparator in c +// - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If any C is a = range, and GT or LT are set, return false +// - If EQ +// - If GT, and EQ does not satisfy GT, return true (null set) +// - If LT, and EQ does not satisfy LT, return true (null set) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT.semver is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the GT.semver tuple, return false +// - If LT +// - If LT.semver is greater than any < or <= comp in C, return false +// - If LT is <=, and LT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the LT.semver tuple, return false +// - Else return true + +const subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true + } + + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) { + continue OUTER + } + } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) { + return false + } + } + return true +} + +const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] +const minimumVersion = [new Comparator('>=0.0.0')] + +const simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true + } + + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease + } else { + sub = minimumVersion + } + } + + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true + } else { + dom = minimumVersion + } + } + + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') { + gt = higherGT(gt, c, options) + } else if (c.operator === '<' || c.operator === '<=') { + lt = lowerLT(lt, c, options) + } else { + eqSet.add(c.semver) + } + } + + if (eqSet.size > 1) { + return null + } + + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) { + return null + } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { + return null + } + } + + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { + return null + } + + if (lt && !satisfies(eq, String(lt), options)) { + return null + } + + for (const c of dom) { + if (!satisfies(eq, String(c), options)) { + return false + } + } + + return true + } + + let higher, lower + let hasDomLT, hasDomGT + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = lt && + !options.includePrerelease && + lt.semver.prerelease.length ? lt.semver : false + let needDomGTPre = gt && + !options.includePrerelease && + gt.semver.prerelease.length ? gt.semver : false + // exception: <1.2.3-0 is the same as <1.2.3 + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && + lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false + } + + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false + } + } + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c && higher !== gt) { + return false + } + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { + return false + } + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false + } + } + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c && lower !== lt) { + return false + } + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { + return false + } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false + } + } + + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false + } + + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false + } + + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) { + return false + } + + return true +} + +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a +} + +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a +} + +module.exports = subset diff --git a/node_modules/semver/ranges/to-comparators.js b/node_modules/semver/ranges/to-comparators.js new file mode 100644 index 000000000..6c8bc7e6f --- /dev/null +++ b/node_modules/semver/ranges/to-comparators.js @@ -0,0 +1,8 @@ +const Range = require('../classes/range') + +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + +module.exports = toComparators diff --git a/node_modules/semver/ranges/valid.js b/node_modules/semver/ranges/valid.js new file mode 100644 index 000000000..365f35689 --- /dev/null +++ b/node_modules/semver/ranges/valid.js @@ -0,0 +1,11 @@ +const Range = require('../classes/range') +const validRange = (range, options) => { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} +module.exports = validRange diff --git a/node_modules/signal-exit/LICENSE.txt b/node_modules/signal-exit/LICENSE.txt new file mode 100644 index 000000000..954f2fa82 --- /dev/null +++ b/node_modules/signal-exit/LICENSE.txt @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) 2015-2023 Benjamin Coe, Isaac Z. Schlueter, and Contributors + +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. diff --git a/node_modules/signal-exit/README.md b/node_modules/signal-exit/README.md new file mode 100644 index 000000000..f8e6d9d2b --- /dev/null +++ b/node_modules/signal-exit/README.md @@ -0,0 +1,51 @@ +# signal-exit + +When you want to fire an event no matter how a process exits: + +- reaching the end of execution. +- explicitly having `process.exit(code)` called. +- having `process.kill(pid, sig)` called. +- receiving a fatal signal from outside the process + +Use `signal-exit`. + +```js +// Hybrid module, either works +import { onExit } from 'signal-exit' +// or: +// const { onExit } = require('signal-exit') + +onExit((code, signal) => { + console.log('process exited!', code, signal) +}) +``` + +## API + +`remove = onExit((code, signal) => {}, options)` + +The return value of the function is a function that will remove +the handler. + +Note that the function _only_ fires for signals if the signal +would cause the process to exit. That is, there are no other +listeners, and it is a fatal signal. + +If the global `process` object is not suitable for this purpose +(ie, it's unset, or doesn't have an `emit` method, etc.) then the +`onExit` function is a no-op that returns a no-op `remove` method. + +### Options + +- `alwaysLast`: Run this handler after any other signal or exit + handlers. This causes `process.emit` to be monkeypatched. + +### Browser Fallback + +The `'signal-exit/browser'` module is the same fallback shim that +just doesn't do anything, but presents the same function +interface. + +Patches welcome to add something that hooks onto +`window.onbeforeunload` or similar, but it might just not be a +thing that makes sense there. diff --git a/node_modules/signal-exit/dist/cjs/browser.d.ts b/node_modules/signal-exit/dist/cjs/browser.d.ts new file mode 100644 index 000000000..90f2e3f11 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/browser.d.ts @@ -0,0 +1,12 @@ +/** + * This is a browser shim that provides the same functional interface + * as the main node export, but it does nothing. + * @module + */ +import type { Handler } from './index.js'; +export declare const onExit: (cb: Handler, opts: { + alwaysLast?: boolean; +}) => () => void; +export declare const load: () => void; +export declare const unload: () => void; +//# sourceMappingURL=browser.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/browser.d.ts.map b/node_modules/signal-exit/dist/cjs/browser.d.ts.map new file mode 100644 index 000000000..aacc1d3b6 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,eAAO,MAAM,MAAM,EAAE,CACnB,EAAE,EAAE,OAAO,EACX,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,KAC3B,MAAM,IAAqB,CAAA;AAChC,eAAO,MAAM,IAAI,YAAW,CAAA;AAC5B,eAAO,MAAM,MAAM,YAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/browser.js b/node_modules/signal-exit/dist/cjs/browser.js new file mode 100644 index 000000000..614fbf010 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/browser.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unload = exports.load = exports.onExit = void 0; +const onExit = () => () => { }; +exports.onExit = onExit; +const load = () => { }; +exports.load = load; +const unload = () => { }; +exports.unload = unload; +//# sourceMappingURL=browser.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/browser.js.map b/node_modules/signal-exit/dist/cjs/browser.js.map new file mode 100644 index 000000000..342cf2e20 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":";;;AAMO,MAAM,MAAM,GAGD,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAA;AAHnB,QAAA,MAAM,UAGa;AACzB,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;AAAf,QAAA,IAAI,QAAW;AACrB,MAAM,MAAM,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;AAAjB,QAAA,MAAM,UAAW","sourcesContent":["/**\n * This is a browser shim that provides the same functional interface\n * as the main node export, but it does nothing.\n * @module\n */\nimport type { Handler } from './index.js'\nexport const onExit: (\n cb: Handler,\n opts: { alwaysLast?: boolean }\n) => () => void = () => () => {}\nexport const load = () => {}\nexport const unload = () => {}\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/index.d.ts b/node_modules/signal-exit/dist/cjs/index.d.ts new file mode 100644 index 000000000..18a4cc653 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/index.d.ts @@ -0,0 +1,37 @@ +/// +import { signals } from './signals.js'; +export { signals }; +/** + * A function that takes an exit code and signal as arguments + */ +export type Handler = (code: number | null | undefined, signal: NodeJS.Signals | null) => any; +export declare const +/** + * Called when the process is exiting, whether via signal, explicit + * exit, or running out of stuff to do. + * + * If the global process object is not suitable for instrumentation, + * then this will be a no-op. + * + * Returns a function that may be used to unload signal-exit. + */ +onExit: (cb: Handler, opts?: { + alwaysLast?: boolean | undefined; +} | undefined) => () => void, +/** + * Load the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +load: () => void, +/** + * Unload the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +unload: () => void; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/index.d.ts.map b/node_modules/signal-exit/dist/cjs/index.d.ts.map new file mode 100644 index 000000000..ee8640d9e --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,CAAA;AAuBlB;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,KAC1B,GAAG,CAAA;AAmQR,eAAO;AACL;;;;;;;;GAQG;AACH,MAAM,OAnMO,OAAO;;wBAPiD,IAAI;AA4MzE;;;;;;GAMG;AACH,IAAI;AAEJ;;;;;;GAMG;AACH,MAAM,YAGP,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/index.js b/node_modules/signal-exit/dist/cjs/index.js new file mode 100644 index 000000000..9312d0c96 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/index.js @@ -0,0 +1,272 @@ +"use strict"; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unload = exports.load = exports.onExit = exports.signals = void 0; +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +// grab a reference to node's real process object right away +const signals_js_1 = require("./signals.js"); +Object.defineProperty(exports, "signals", { enumerable: true, get: function () { return signals_js_1.signals; } }); +const processOk = (process) => !!process && + typeof process === 'object' && + typeof process.removeListener === 'function' && + typeof process.emit === 'function' && + typeof process.reallyExit === 'function' && + typeof process.listeners === 'function' && + typeof process.kill === 'function' && + typeof process.pid === 'number' && + typeof process.on === 'function'; +const kExitEmitter = Symbol.for('signal-exit emitter'); +const global = globalThis; +const ObjectDefineProperty = Object.defineProperty.bind(Object); +// teeny tiny ee +class Emitter { + emitted = { + afterExit: false, + exit: false, + }; + listeners = { + afterExit: [], + exit: [], + }; + count = 0; + id = Math.random(); + constructor() { + if (global[kExitEmitter]) { + return global[kExitEmitter]; + } + ObjectDefineProperty(global, kExitEmitter, { + value: this, + writable: false, + enumerable: false, + configurable: false, + }); + } + on(ev, fn) { + this.listeners[ev].push(fn); + } + removeListener(ev, fn) { + const list = this.listeners[ev]; + const i = list.indexOf(fn); + /* c8 ignore start */ + if (i === -1) { + return; + } + /* c8 ignore stop */ + if (i === 0 && list.length === 1) { + list.length = 0; + } + else { + list.splice(i, 1); + } + } + emit(ev, code, signal) { + if (this.emitted[ev]) { + return; + } + this.emitted[ev] = true; + for (const fn of this.listeners[ev]) { + fn(code, signal); + } + } +} +class SignalExitBase { +} +const signalExitWrap = (handler) => { + return { + onExit(cb, opts) { + return handler.onExit(cb, opts); + }, + load() { + return handler.load(); + }, + unload() { + return handler.unload(); + }, + }; +}; +class SignalExitFallback extends SignalExitBase { + onExit() { + return () => { }; + } + load() { } + unload() { } +} +class SignalExit extends SignalExitBase { + // "SIGHUP" throws an `ENOSYS` error on Windows, + // so use a supported signal instead + /* c8 ignore start */ + #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'; + /* c8 ignore stop */ + #emitter = new Emitter(); + #process; + #originalProcessEmit; + #originalProcessReallyExit; + #sigListeners = {}; + #loaded = false; + constructor(process) { + super(); + this.#process = process; + // { : , ... } + this.#sigListeners = {}; + for (const sig of signals_js_1.signals) { + this.#sigListeners[sig] = () => { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + const listeners = this.#process.listeners(sig); + let { count } = this.#emitter; + // This is a workaround for the fact that signal-exit v3 and signal + // exit v4 are not aware of each other, and each will attempt to let + // the other handle it, so neither of them do. To correct this, we + // detect if we're the only handler *except* for previous versions + // of signal-exit. + /* c8 ignore start */ + //@ts-ignore + if (typeof process.__signal_exit_emitter__ === 'object') + count++; + /* c8 ignore stop */ + if (listeners.length === count) { + this.unload(); + this.#emitter.emit('exit', null, sig); + this.#emitter.emit('afterExit', null, sig); + /* c8 ignore start */ + process.kill(process.pid, sig === 'SIGHUP' ? this.#hupSig : sig); + /* c8 ignore stop */ + } + }; + } + this.#originalProcessReallyExit = process.reallyExit; + this.#originalProcessEmit = process.emit; + } + onExit(cb, opts) { + /* c8 ignore start */ + if (!processOk(this.#process)) { + return () => { }; + } + /* c8 ignore stop */ + if (this.#loaded === false) { + this.load(); + } + const ev = opts?.alwaysLast ? 'afterExit' : 'exit'; + this.#emitter.on(ev, cb); + return () => { + this.#emitter.removeListener(ev, cb); + if (this.#emitter.listeners['exit'].length === 0 && + this.#emitter.listeners['afterExit'].length === 0) { + this.unload(); + } + }; + } + load() { + if (this.#loaded) { + return; + } + this.#loaded = true; + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + this.#emitter.count += 1; + for (const sig of signals_js_1.signals) { + try { + const fn = this.#sigListeners[sig]; + if (fn) + this.#process.on(sig, fn); + } + catch (_) { } + } + this.#process.emit = (ev, ...a) => { + return this.#processEmit(ev, ...a); + }; + this.#process.reallyExit = (code) => { + return this.#processReallyExit(code); + }; + } + unload() { + if (!this.#loaded) { + return; + } + this.#loaded = false; + signals_js_1.signals.forEach(sig => { + const listener = this.#sigListeners[sig]; + /* c8 ignore start */ + if (!listener) { + throw new Error('Listener not defined for signal: ' + sig); + } + /* c8 ignore stop */ + try { + this.#process.removeListener(sig, listener); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + }); + this.#process.emit = this.#originalProcessEmit; + this.#process.reallyExit = this.#originalProcessReallyExit; + this.#emitter.count -= 1; + } + #processReallyExit(code) { + /* c8 ignore start */ + if (!processOk(this.#process)) { + return 0; + } + this.#process.exitCode = code || 0; + /* c8 ignore stop */ + this.#emitter.emit('exit', this.#process.exitCode, null); + this.#emitter.emit('afterExit', this.#process.exitCode, null); + return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); + } + #processEmit(ev, ...args) { + const og = this.#originalProcessEmit; + if (ev === 'exit' && processOk(this.#process)) { + if (typeof args[0] === 'number') { + this.#process.exitCode = args[0]; + /* c8 ignore start */ + } + /* c8 ignore start */ + const ret = og.call(this.#process, ev, ...args); + /* c8 ignore start */ + this.#emitter.emit('exit', this.#process.exitCode, null); + this.#emitter.emit('afterExit', this.#process.exitCode, null); + /* c8 ignore stop */ + return ret; + } + else { + return og.call(this.#process, ev, ...args); + } + } +} +const process = globalThis.process; +// wrap so that we call the method on the actual handler, without +// exporting it directly. +_a = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()), +/** + * Called when the process is exiting, whether via signal, explicit + * exit, or running out of stuff to do. + * + * If the global process object is not suitable for instrumentation, + * then this will be a no-op. + * + * Returns a function that may be used to unload signal-exit. + */ +exports.onExit = _a.onExit, +/** + * Load the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +exports.load = _a.load, +/** + * Unload the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +exports.unload = _a.unload; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/index.js.map b/node_modules/signal-exit/dist/cjs/index.js.map new file mode 100644 index 000000000..ebaf7c687 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,iEAAiE;AACjE,+DAA+D;AAC/D,qDAAqD;AACrD,4DAA4D;AAC5D,6CAAsC;AAC7B,wFADA,oBAAO,OACA;AAQhB,MAAM,SAAS,GAAG,CAAC,OAAY,EAAwB,EAAE,CACvD,CAAC,CAAC,OAAO;IACT,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO,OAAO,CAAC,cAAc,KAAK,UAAU;IAC5C,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU;IAClC,OAAO,OAAO,CAAC,UAAU,KAAK,UAAU;IACxC,OAAO,OAAO,CAAC,SAAS,KAAK,UAAU;IACvC,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU;IAClC,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;IAC/B,OAAO,OAAO,CAAC,EAAE,KAAK,UAAU,CAAA;AAElC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;AACtD,MAAM,MAAM,GAAqD,UAAU,CAAA;AAC3E,MAAM,oBAAoB,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAa/D,gBAAgB;AAChB,MAAM,OAAO;IACX,OAAO,GAAY;QACjB,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,KAAK;KACZ,CAAA;IAED,SAAS,GAAc;QACrB,SAAS,EAAE,EAAE;QACb,IAAI,EAAE,EAAE;KACT,CAAA;IAED,KAAK,GAAW,CAAC,CAAA;IACjB,EAAE,GAAW,IAAI,CAAC,MAAM,EAAE,CAAA;IAE1B;QACE,IAAI,MAAM,CAAC,YAAY,CAAC,EAAE;YACxB,OAAO,MAAM,CAAC,YAAY,CAAC,CAAA;SAC5B;QACD,oBAAoB,CAAC,MAAM,EAAE,YAAY,EAAE;YACzC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MAAM,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC7C,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;gBAC/B,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;gBAChC,qBAAqB;aACtB;YACD,qBAAqB;YACrB,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,CAAA;YAC/C,qBAAqB;YACrB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;YACxD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;YAC7D,oBAAoB;YACpB,OAAO,GAAG,CAAA;SACX;aAAM;YACL,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,CAAA;SAC3C;IACH,CAAC;CACF;AAED,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;AAClC,iEAAiE;AACjE,yBAAyB;AACZ,KA6BT,cAAc,CAChB,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,kBAAkB,EAAE,CACxE;AA9BC;;;;;;;;GAQG;AACH,cAAM;AAEN;;;;;;GAMG;AACH,YAAI;AAEJ;;;;;;GAMG;AACH,cAAM,aAGP","sourcesContent":["// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js'\nexport { signals }\n\n// just a loosened process type so we can do some evil things\ntype ProcessRE = NodeJS.Process & {\n reallyExit: (code?: number | undefined | null) => any\n emit: (ev: string, ...a: any[]) => any\n}\n\nconst processOk = (process: any): process is ProcessRE =>\n !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function'\n\nconst kExitEmitter = Symbol.for('signal-exit emitter')\nconst global: typeof globalThis & { [kExitEmitter]?: Emitter } = globalThis\nconst ObjectDefineProperty = Object.defineProperty.bind(Object)\n\n/**\n * A function that takes an exit code and signal as arguments\n */\nexport type Handler = (\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n) => any\ntype ExitEvent = 'afterExit' | 'exit'\ntype Emitted = { [k in ExitEvent]: boolean }\ntype Listeners = { [k in ExitEvent]: Handler[] }\n\n// teeny tiny ee\nclass Emitter {\n emitted: Emitted = {\n afterExit: false,\n exit: false,\n }\n\n listeners: Listeners = {\n afterExit: [],\n exit: [],\n }\n\n count: number = 0\n id: number = Math.random()\n\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter]\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n })\n }\n\n on(ev: ExitEvent, fn: Handler) {\n this.listeners[ev].push(fn)\n }\n\n removeListener(ev: ExitEvent, fn: Handler) {\n const list = this.listeners[ev]\n const i = list.indexOf(fn)\n /* c8 ignore start */\n if (i === -1) {\n return\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0\n } else {\n list.splice(i, 1)\n }\n }\n\n emit(\n ev: ExitEvent,\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n ) {\n if (this.emitted[ev]) {\n return\n }\n this.emitted[ev] = true\n for (const fn of this.listeners[ev]) {\n fn(code, signal)\n }\n }\n}\n\nabstract class SignalExitBase {\n abstract onExit(cb: Handler, opts?: { alwaysLast?: boolean }): () => void\n abstract load(): void\n abstract unload(): void\n}\n\nconst signalExitWrap = (handler: T) => {\n return {\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n return handler.onExit(cb, opts)\n },\n load() {\n return handler.load()\n },\n unload() {\n return handler.unload()\n },\n }\n}\n\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => {}\n }\n load() {}\n unload() {}\n}\n\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'\n /* c8 ignore stop */\n #emitter = new Emitter()\n #process: ProcessRE\n #originalProcessEmit: ProcessRE['emit']\n #originalProcessReallyExit: ProcessRE['reallyExit']\n\n #sigListeners: { [k in NodeJS.Signals]?: () => void } = {}\n #loaded: boolean = false\n\n constructor(process: ProcessRE) {\n super()\n this.#process = process\n // { : , ... }\n this.#sigListeners = {}\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig)\n let { count } = this.#emitter\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit.\n /* c8 ignore start */\n //@ts-ignore\n if (typeof process.__signal_exit_emitter__ === 'object') count++\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload()\n this.#emitter.emit('exit', null, sig)\n this.#emitter.emit('afterExit', null, sig)\n /* c8 ignore start */\n process.kill(process.pid, sig === 'SIGHUP' ? this.#hupSig : sig)\n /* c8 ignore stop */\n }\n }\n }\n\n this.#originalProcessReallyExit = process.reallyExit\n this.#originalProcessEmit = process.emit\n }\n\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => {}\n }\n /* c8 ignore stop */\n\n if (this.#loaded === false) {\n this.load()\n }\n\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit'\n this.#emitter.on(ev, cb)\n return () => {\n this.#emitter.removeListener(ev, cb)\n if (\n this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0\n ) {\n this.unload()\n }\n }\n }\n\n load() {\n if (this.#loaded) {\n return\n }\n this.#loaded = true\n\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1\n\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig]\n if (fn) this.#process.on(sig, fn)\n } catch (_) {}\n }\n\n this.#process.emit = (ev: string, ...a: any[]) => {\n return this.#processEmit(ev, ...a)\n }\n this.#process.reallyExit = (code?: number | null | undefined) => {\n return this.#processReallyExit(code)\n }\n }\n\n unload() {\n if (!this.#loaded) {\n return\n }\n this.#loaded = false\n\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig]\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig)\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n })\n this.#process.emit = this.#originalProcessEmit\n this.#process.reallyExit = this.#originalProcessReallyExit\n this.#emitter.count -= 1\n }\n\n #processReallyExit(code?: number | null | undefined) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0\n }\n this.#process.exitCode = code || 0\n /* c8 ignore stop */\n\n this.#emitter.emit('exit', this.#process.exitCode, null)\n this.#emitter.emit('afterExit', this.#process.exitCode, null)\n return this.#originalProcessReallyExit.call(\n this.#process,\n this.#process.exitCode\n )\n }\n\n #processEmit(ev: string, ...args: any[]): any {\n const og = this.#originalProcessEmit\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0]\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args)\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null)\n this.#emitter.emit('afterExit', this.#process.exitCode, null)\n /* c8 ignore stop */\n return ret\n } else {\n return og.call(this.#process, ev, ...args)\n }\n }\n}\n\nconst process = globalThis.process\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const {\n /**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\n onExit,\n\n /**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n load,\n\n /**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n unload,\n} = signalExitWrap(\n processOk(process) ? new SignalExit(process) : new SignalExitFallback()\n)\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/package.json b/node_modules/signal-exit/dist/cjs/package.json new file mode 100644 index 000000000..5bbefffba --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/signal-exit/dist/cjs/signals.d.ts b/node_modules/signal-exit/dist/cjs/signals.d.ts new file mode 100644 index 000000000..3f01ef00d --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/signals.d.ts @@ -0,0 +1,29 @@ +/// +/** + * This is not the set of all possible signals. + * + * It IS, however, the set of all signals that trigger + * an exit on either Linux or BSD systems. Linux is a + * superset of the signal names supported on BSD, and + * the unknown signals just fail to register, so we can + * catch that easily enough. + * + * Windows signals are a different set, since there are + * signals that terminate Windows processes, but don't + * terminate (or don't even exist) on Posix systems. + * + * Don't bother with SIGKILL. It's uncatchable, which + * means that we can't fire any callbacks anyway. + * + * If a user does happen to register a handler on a non- + * fatal signal like SIGWINCH or something, and then + * exit, it'll end up firing `process.emit('exit')`, so + * the handler will be fired anyway. + * + * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised + * artificially, inherently leave the process in a + * state from which it is not safe to try and enter JS + * listeners. + */ +export declare const signals: NodeJS.Signals[]; +//# sourceMappingURL=signals.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/signals.d.ts.map b/node_modules/signal-exit/dist/cjs/signals.d.ts.map new file mode 100644 index 000000000..891fe1e68 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/signals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,OAAO,EAAO,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/signals.js b/node_modules/signal-exit/dist/cjs/signals.js new file mode 100644 index 000000000..28afc5027 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/signals.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.signals = void 0; +/** + * This is not the set of all possible signals. + * + * It IS, however, the set of all signals that trigger + * an exit on either Linux or BSD systems. Linux is a + * superset of the signal names supported on BSD, and + * the unknown signals just fail to register, so we can + * catch that easily enough. + * + * Windows signals are a different set, since there are + * signals that terminate Windows processes, but don't + * terminate (or don't even exist) on Posix systems. + * + * Don't bother with SIGKILL. It's uncatchable, which + * means that we can't fire any callbacks anyway. + * + * If a user does happen to register a handler on a non- + * fatal signal like SIGWINCH or something, and then + * exit, it'll end up firing `process.emit('exit')`, so + * the handler will be fired anyway. + * + * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised + * artificially, inherently leave the process in a + * state from which it is not safe to try and enter JS + * listeners. + */ +exports.signals = []; +exports.signals.push('SIGHUP', 'SIGINT', 'SIGTERM'); +if (process.platform !== 'win32') { + exports.signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ); +} +if (process.platform === 'linux') { + exports.signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT'); +} +//# sourceMappingURL=signals.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/signals.js.map b/node_modules/signal-exit/dist/cjs/signals.js.map new file mode 100644 index 000000000..78c613f66 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/signals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"signals.js","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACU,QAAA,OAAO,GAAqB,EAAE,CAAA;AAC3C,eAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;AAE3C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,eAAO,CAAC,IAAI,CACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ;IACR,yDAAyD;IACzD,UAAU;IACV,YAAY;KACb,CAAA;CACF;AAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,eAAO,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;CACxD","sourcesContent":["/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals: NodeJS.Signals[] = []\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM')\n\nif (process.platform !== 'win32') {\n signals.push(\n 'SIGALRM',\n 'SIGABRT',\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT')\n}\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/browser.d.ts b/node_modules/signal-exit/dist/mjs/browser.d.ts new file mode 100644 index 000000000..90f2e3f11 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/browser.d.ts @@ -0,0 +1,12 @@ +/** + * This is a browser shim that provides the same functional interface + * as the main node export, but it does nothing. + * @module + */ +import type { Handler } from './index.js'; +export declare const onExit: (cb: Handler, opts: { + alwaysLast?: boolean; +}) => () => void; +export declare const load: () => void; +export declare const unload: () => void; +//# sourceMappingURL=browser.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/browser.d.ts.map b/node_modules/signal-exit/dist/mjs/browser.d.ts.map new file mode 100644 index 000000000..aacc1d3b6 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,eAAO,MAAM,MAAM,EAAE,CACnB,EAAE,EAAE,OAAO,EACX,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,KAC3B,MAAM,IAAqB,CAAA;AAChC,eAAO,MAAM,IAAI,YAAW,CAAA;AAC5B,eAAO,MAAM,MAAM,YAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/browser.js b/node_modules/signal-exit/dist/mjs/browser.js new file mode 100644 index 000000000..9c5f9b9e7 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/browser.js @@ -0,0 +1,4 @@ +export const onExit = () => () => { }; +export const load = () => { }; +export const unload = () => { }; +//# sourceMappingURL=browser.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/browser.js.map b/node_modules/signal-exit/dist/mjs/browser.js.map new file mode 100644 index 000000000..b3ff303af --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,MAAM,GAGD,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAA;AAChC,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;AAC5B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA","sourcesContent":["/**\n * This is a browser shim that provides the same functional interface\n * as the main node export, but it does nothing.\n * @module\n */\nimport type { Handler } from './index.js'\nexport const onExit: (\n cb: Handler,\n opts: { alwaysLast?: boolean }\n) => () => void = () => () => {}\nexport const load = () => {}\nexport const unload = () => {}\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/index.d.ts b/node_modules/signal-exit/dist/mjs/index.d.ts new file mode 100644 index 000000000..18a4cc653 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/index.d.ts @@ -0,0 +1,37 @@ +/// +import { signals } from './signals.js'; +export { signals }; +/** + * A function that takes an exit code and signal as arguments + */ +export type Handler = (code: number | null | undefined, signal: NodeJS.Signals | null) => any; +export declare const +/** + * Called when the process is exiting, whether via signal, explicit + * exit, or running out of stuff to do. + * + * If the global process object is not suitable for instrumentation, + * then this will be a no-op. + * + * Returns a function that may be used to unload signal-exit. + */ +onExit: (cb: Handler, opts?: { + alwaysLast?: boolean | undefined; +} | undefined) => () => void, +/** + * Load the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +load: () => void, +/** + * Unload the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +unload: () => void; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/index.d.ts.map b/node_modules/signal-exit/dist/mjs/index.d.ts.map new file mode 100644 index 000000000..ee8640d9e --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,CAAA;AAuBlB;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,KAC1B,GAAG,CAAA;AAmQR,eAAO;AACL;;;;;;;;GAQG;AACH,MAAM,OAnMO,OAAO;;wBAPiD,IAAI;AA4MzE;;;;;;GAMG;AACH,IAAI;AAEJ;;;;;;GAMG;AACH,MAAM,YAGP,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/index.js b/node_modules/signal-exit/dist/mjs/index.js new file mode 100644 index 000000000..97f409239 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/index.js @@ -0,0 +1,268 @@ +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +// grab a reference to node's real process object right away +import { signals } from './signals.js'; +export { signals }; +const processOk = (process) => !!process && + typeof process === 'object' && + typeof process.removeListener === 'function' && + typeof process.emit === 'function' && + typeof process.reallyExit === 'function' && + typeof process.listeners === 'function' && + typeof process.kill === 'function' && + typeof process.pid === 'number' && + typeof process.on === 'function'; +const kExitEmitter = Symbol.for('signal-exit emitter'); +const global = globalThis; +const ObjectDefineProperty = Object.defineProperty.bind(Object); +// teeny tiny ee +class Emitter { + emitted = { + afterExit: false, + exit: false, + }; + listeners = { + afterExit: [], + exit: [], + }; + count = 0; + id = Math.random(); + constructor() { + if (global[kExitEmitter]) { + return global[kExitEmitter]; + } + ObjectDefineProperty(global, kExitEmitter, { + value: this, + writable: false, + enumerable: false, + configurable: false, + }); + } + on(ev, fn) { + this.listeners[ev].push(fn); + } + removeListener(ev, fn) { + const list = this.listeners[ev]; + const i = list.indexOf(fn); + /* c8 ignore start */ + if (i === -1) { + return; + } + /* c8 ignore stop */ + if (i === 0 && list.length === 1) { + list.length = 0; + } + else { + list.splice(i, 1); + } + } + emit(ev, code, signal) { + if (this.emitted[ev]) { + return; + } + this.emitted[ev] = true; + for (const fn of this.listeners[ev]) { + fn(code, signal); + } + } +} +class SignalExitBase { +} +const signalExitWrap = (handler) => { + return { + onExit(cb, opts) { + return handler.onExit(cb, opts); + }, + load() { + return handler.load(); + }, + unload() { + return handler.unload(); + }, + }; +}; +class SignalExitFallback extends SignalExitBase { + onExit() { + return () => { }; + } + load() { } + unload() { } +} +class SignalExit extends SignalExitBase { + // "SIGHUP" throws an `ENOSYS` error on Windows, + // so use a supported signal instead + /* c8 ignore start */ + #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'; + /* c8 ignore stop */ + #emitter = new Emitter(); + #process; + #originalProcessEmit; + #originalProcessReallyExit; + #sigListeners = {}; + #loaded = false; + constructor(process) { + super(); + this.#process = process; + // { : , ... } + this.#sigListeners = {}; + for (const sig of signals) { + this.#sigListeners[sig] = () => { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + const listeners = this.#process.listeners(sig); + let { count } = this.#emitter; + // This is a workaround for the fact that signal-exit v3 and signal + // exit v4 are not aware of each other, and each will attempt to let + // the other handle it, so neither of them do. To correct this, we + // detect if we're the only handler *except* for previous versions + // of signal-exit. + /* c8 ignore start */ + //@ts-ignore + if (typeof process.__signal_exit_emitter__ === 'object') + count++; + /* c8 ignore stop */ + if (listeners.length === count) { + this.unload(); + this.#emitter.emit('exit', null, sig); + this.#emitter.emit('afterExit', null, sig); + /* c8 ignore start */ + process.kill(process.pid, sig === 'SIGHUP' ? this.#hupSig : sig); + /* c8 ignore stop */ + } + }; + } + this.#originalProcessReallyExit = process.reallyExit; + this.#originalProcessEmit = process.emit; + } + onExit(cb, opts) { + /* c8 ignore start */ + if (!processOk(this.#process)) { + return () => { }; + } + /* c8 ignore stop */ + if (this.#loaded === false) { + this.load(); + } + const ev = opts?.alwaysLast ? 'afterExit' : 'exit'; + this.#emitter.on(ev, cb); + return () => { + this.#emitter.removeListener(ev, cb); + if (this.#emitter.listeners['exit'].length === 0 && + this.#emitter.listeners['afterExit'].length === 0) { + this.unload(); + } + }; + } + load() { + if (this.#loaded) { + return; + } + this.#loaded = true; + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + this.#emitter.count += 1; + for (const sig of signals) { + try { + const fn = this.#sigListeners[sig]; + if (fn) + this.#process.on(sig, fn); + } + catch (_) { } + } + this.#process.emit = (ev, ...a) => { + return this.#processEmit(ev, ...a); + }; + this.#process.reallyExit = (code) => { + return this.#processReallyExit(code); + }; + } + unload() { + if (!this.#loaded) { + return; + } + this.#loaded = false; + signals.forEach(sig => { + const listener = this.#sigListeners[sig]; + /* c8 ignore start */ + if (!listener) { + throw new Error('Listener not defined for signal: ' + sig); + } + /* c8 ignore stop */ + try { + this.#process.removeListener(sig, listener); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + }); + this.#process.emit = this.#originalProcessEmit; + this.#process.reallyExit = this.#originalProcessReallyExit; + this.#emitter.count -= 1; + } + #processReallyExit(code) { + /* c8 ignore start */ + if (!processOk(this.#process)) { + return 0; + } + this.#process.exitCode = code || 0; + /* c8 ignore stop */ + this.#emitter.emit('exit', this.#process.exitCode, null); + this.#emitter.emit('afterExit', this.#process.exitCode, null); + return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); + } + #processEmit(ev, ...args) { + const og = this.#originalProcessEmit; + if (ev === 'exit' && processOk(this.#process)) { + if (typeof args[0] === 'number') { + this.#process.exitCode = args[0]; + /* c8 ignore start */ + } + /* c8 ignore start */ + const ret = og.call(this.#process, ev, ...args); + /* c8 ignore start */ + this.#emitter.emit('exit', this.#process.exitCode, null); + this.#emitter.emit('afterExit', this.#process.exitCode, null); + /* c8 ignore stop */ + return ret; + } + else { + return og.call(this.#process, ev, ...args); + } + } +} +const process = globalThis.process; +// wrap so that we call the method on the actual handler, without +// exporting it directly. +export const { +/** + * Called when the process is exiting, whether via signal, explicit + * exit, or running out of stuff to do. + * + * If the global process object is not suitable for instrumentation, + * then this will be a no-op. + * + * Returns a function that may be used to unload signal-exit. + */ +onExit, +/** + * Load the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +load, +/** + * Unload the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +unload, } = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/index.js.map b/node_modules/signal-exit/dist/mjs/index.js.map new file mode 100644 index 000000000..718ba2d5c --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,+DAA+D;AAC/D,qDAAqD;AACrD,4DAA4D;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,CAAA;AAQlB,MAAM,SAAS,GAAG,CAAC,OAAY,EAAwB,EAAE,CACvD,CAAC,CAAC,OAAO;IACT,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO,OAAO,CAAC,cAAc,KAAK,UAAU;IAC5C,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU;IAClC,OAAO,OAAO,CAAC,UAAU,KAAK,UAAU;IACxC,OAAO,OAAO,CAAC,SAAS,KAAK,UAAU;IACvC,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU;IAClC,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;IAC/B,OAAO,OAAO,CAAC,EAAE,KAAK,UAAU,CAAA;AAElC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;AACtD,MAAM,MAAM,GAAqD,UAAU,CAAA;AAC3E,MAAM,oBAAoB,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAa/D,gBAAgB;AAChB,MAAM,OAAO;IACX,OAAO,GAAY;QACjB,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,KAAK;KACZ,CAAA;IAED,SAAS,GAAc;QACrB,SAAS,EAAE,EAAE;QACb,IAAI,EAAE,EAAE;KACT,CAAA;IAED,KAAK,GAAW,CAAC,CAAA;IACjB,EAAE,GAAW,IA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B,EAAE,CACxE,CAAA","sourcesContent":["// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js'\nexport { signals }\n\n// just a loosened process type so we can do some evil things\ntype ProcessRE = NodeJS.Process & {\n reallyExit: (code?: number | undefined | null) => any\n emit: (ev: string, ...a: any[]) => any\n}\n\nconst processOk = (process: any): process is ProcessRE =>\n !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function'\n\nconst kExitEmitter = Symbol.for('signal-exit emitter')\nconst global: typeof globalThis & { [kExitEmitter]?: Emitter } = globalThis\nconst ObjectDefineProperty = Object.defineProperty.bind(Object)\n\n/**\n * A function that takes an exit code and signal as arguments\n */\nexport type Handler = (\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n) => any\ntype ExitEvent = 'afterExit' | 'exit'\ntype Emitted = { [k in ExitEvent]: boolean }\ntype Listeners = { [k in ExitEvent]: Handler[] }\n\n// teeny tiny ee\nclass Emitter {\n emitted: Emitted = {\n afterExit: false,\n exit: false,\n }\n\n listeners: Listeners = {\n afterExit: [],\n exit: [],\n }\n\n count: number = 0\n id: number = Math.random()\n\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter]\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n })\n }\n\n on(ev: ExitEvent, fn: Handler) {\n this.listeners[ev].push(fn)\n }\n\n removeListener(ev: ExitEvent, fn: Handler) {\n const list = this.listeners[ev]\n const i = list.indexOf(fn)\n /* c8 ignore start */\n if (i === -1) {\n return\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0\n } else {\n list.splice(i, 1)\n }\n }\n\n emit(\n ev: ExitEvent,\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n ) {\n if (this.emitted[ev]) {\n return\n }\n this.emitted[ev] = true\n for (const fn of this.listeners[ev]) {\n fn(code, signal)\n }\n }\n}\n\nabstract class SignalExitBase {\n abstract onExit(cb: Handler, opts?: { alwaysLast?: boolean }): () => void\n abstract load(): void\n abstract unload(): void\n}\n\nconst signalExitWrap = (handler: T) => {\n return {\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n return handler.onExit(cb, opts)\n },\n load() {\n return handler.load()\n },\n unload() {\n return handler.unload()\n },\n }\n}\n\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => {}\n }\n load() {}\n unload() {}\n}\n\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'\n /* c8 ignore stop */\n #emitter = new Emitter()\n #process: ProcessRE\n #originalProcessEmit: ProcessRE['emit']\n #originalProcessReallyExit: ProcessRE['reallyExit']\n\n #sigListeners: { [k in NodeJS.Signals]?: () => void } = {}\n #loaded: boolean = false\n\n constructor(process: ProcessRE) {\n super()\n this.#process = process\n // { : , ... }\n this.#sigListeners = {}\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig)\n let { count } = this.#emitter\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit.\n /* c8 ignore start */\n //@ts-ignore\n if (typeof process.__signal_exit_emitter__ === 'object') count++\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload()\n this.#emitter.emit('exit', null, sig)\n this.#emitter.emit('afterExit', null, sig)\n /* c8 ignore start */\n process.kill(process.pid, sig === 'SIGHUP' ? this.#hupSig : sig)\n /* c8 ignore stop */\n }\n }\n }\n\n this.#originalProcessReallyExit = process.reallyExit\n this.#originalProcessEmit = process.emit\n }\n\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => {}\n }\n /* c8 ignore stop */\n\n if (this.#loaded === false) {\n this.load()\n }\n\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit'\n this.#emitter.on(ev, cb)\n return () => {\n this.#emitter.removeListener(ev, cb)\n if (\n this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0\n ) {\n this.unload()\n }\n }\n }\n\n load() {\n if (this.#loaded) {\n return\n }\n this.#loaded = true\n\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1\n\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig]\n if (fn) this.#process.on(sig, fn)\n } catch (_) {}\n }\n\n this.#process.emit = (ev: string, ...a: any[]) => {\n return this.#processEmit(ev, ...a)\n }\n this.#process.reallyExit = (code?: number | null | undefined) => {\n return this.#processReallyExit(code)\n }\n }\n\n unload() {\n if (!this.#loaded) {\n return\n }\n this.#loaded = false\n\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig]\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig)\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n })\n this.#process.emit = this.#originalProcessEmit\n this.#process.reallyExit = this.#originalProcessReallyExit\n this.#emitter.count -= 1\n }\n\n #processReallyExit(code?: number | null | undefined) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0\n }\n this.#process.exitCode = code || 0\n /* c8 ignore stop */\n\n this.#emitter.emit('exit', this.#process.exitCode, null)\n this.#emitter.emit('afterExit', this.#process.exitCode, null)\n return this.#originalProcessReallyExit.call(\n this.#process,\n this.#process.exitCode\n )\n }\n\n #processEmit(ev: string, ...args: any[]): any {\n const og = this.#originalProcessEmit\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0]\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args)\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null)\n this.#emitter.emit('afterExit', this.#process.exitCode, null)\n /* c8 ignore stop */\n return ret\n } else {\n return og.call(this.#process, ev, ...args)\n }\n }\n}\n\nconst process = globalThis.process\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const {\n /**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\n onExit,\n\n /**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n load,\n\n /**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n unload,\n} = signalExitWrap(\n processOk(process) ? new SignalExit(process) : new SignalExitFallback()\n)\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/package.json b/node_modules/signal-exit/dist/mjs/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/signal-exit/dist/mjs/signals.d.ts b/node_modules/signal-exit/dist/mjs/signals.d.ts new file mode 100644 index 000000000..3f01ef00d --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/signals.d.ts @@ -0,0 +1,29 @@ +/// +/** + * This is not the set of all possible signals. + * + * It IS, however, the set of all signals that trigger + * an exit on either Linux or BSD systems. Linux is a + * superset of the signal names supported on BSD, and + * the unknown signals just fail to register, so we can + * catch that easily enough. + * + * Windows signals are a different set, since there are + * signals that terminate Windows processes, but don't + * terminate (or don't even exist) on Posix systems. + * + * Don't bother with SIGKILL. It's uncatchable, which + * means that we can't fire any callbacks anyway. + * + * If a user does happen to register a handler on a non- + * fatal signal like SIGWINCH or something, and then + * exit, it'll end up firing `process.emit('exit')`, so + * the handler will be fired anyway. + * + * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised + * artificially, inherently leave the process in a + * state from which it is not safe to try and enter JS + * listeners. + */ +export declare const signals: NodeJS.Signals[]; +//# sourceMappingURL=signals.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/signals.d.ts.map b/node_modules/signal-exit/dist/mjs/signals.d.ts.map new file mode 100644 index 000000000..891fe1e68 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/signals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,OAAO,EAAO,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/signals.js b/node_modules/signal-exit/dist/mjs/signals.js new file mode 100644 index 000000000..7dbf15a5a --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/signals.js @@ -0,0 +1,39 @@ +/** + * This is not the set of all possible signals. + * + * It IS, however, the set of all signals that trigger + * an exit on either Linux or BSD systems. Linux is a + * superset of the signal names supported on BSD, and + * the unknown signals just fail to register, so we can + * catch that easily enough. + * + * Windows signals are a different set, since there are + * signals that terminate Windows processes, but don't + * terminate (or don't even exist) on Posix systems. + * + * Don't bother with SIGKILL. It's uncatchable, which + * means that we can't fire any callbacks anyway. + * + * If a user does happen to register a handler on a non- + * fatal signal like SIGWINCH or something, and then + * exit, it'll end up firing `process.emit('exit')`, so + * the handler will be fired anyway. + * + * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised + * artificially, inherently leave the process in a + * state from which it is not safe to try and enter JS + * listeners. + */ +export const signals = []; +signals.push('SIGHUP', 'SIGINT', 'SIGTERM'); +if (process.platform !== 'win32') { + signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ); +} +if (process.platform === 'linux') { + signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT'); +} +//# sourceMappingURL=signals.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/signals.js.map b/node_modules/signal-exit/dist/mjs/signals.js.map new file mode 100644 index 000000000..91008c917 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/signals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"signals.js","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAqB,EAAE,CAAA;AAC3C,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;AAE3C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,OAAO,CAAC,IAAI,CACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ;IACR,yDAAyD;IACzD,UAAU;IACV,YAAY;KACb,CAAA;CACF;AAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;CACxD","sourcesContent":["/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals: NodeJS.Signals[] = []\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM')\n\nif (process.platform !== 'win32') {\n signals.push(\n 'SIGALRM',\n 'SIGABRT',\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT')\n}\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/package.json b/node_modules/signal-exit/package.json new file mode 100644 index 000000000..455452f96 --- /dev/null +++ b/node_modules/signal-exit/package.json @@ -0,0 +1,106 @@ +{ + "name": "signal-exit", + "version": "4.0.2", + "description": "when you want to fire an event no matter how a process exits.", + "main": "./dist/cjs/index.js", + "module": "./dist/mjs/index.js", + "browser": "./dist/mjs/browser.js", + "types": "./dist/mjs/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/mjs/index.d.ts", + "default": "./dist/mjs/index.js" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.js" + } + }, + "./signals": { + "import": { + "types": "./dist/mjs/signals.d.ts", + "default": "./dist/mjs/signals.js" + }, + "require": { + "types": "./dist/cjs/signals.d.ts", + "default": "./dist/cjs/signals.js" + } + }, + "./browser": { + "import": { + "types": "./dist/mjs/browser.d.ts", + "default": "./dist/mjs/browser.js" + }, + "require": { + "types": "./dist/cjs/browser.d.ts", + "default": "./dist/cjs/browser.js" + } + } + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=14" + }, + "repository": { + "type": "git", + "url": "https://github.com/tapjs/signal-exit.git" + }, + "keywords": [ + "signal", + "exit" + ], + "author": "Ben Coe ", + "license": "ISC", + "devDependencies": { + "@types/cross-spawn": "^6.0.2", + "@types/node": "^18.15.11", + "@types/signal-exit": "^3.0.1", + "@types/tap": "^15.0.8", + "c8": "^7.13.0", + "prettier": "^2.8.6", + "tap": "^16.3.4", + "ts-node": "^10.9.1", + "typedoc": "^0.23.28", + "typescript": "^5.0.2" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preprepare": "rm -rf dist", + "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash ./scripts/fixup.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "c8 tap", + "snap": "c8 tap", + "format": "prettier --write . --loglevel warn", + "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts" + }, + "prettier": { + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "tap": { + "coverage": false, + "jobs": 1, + "node-arg": [ + "--no-warnings", + "--loader", + "ts-node/esm" + ], + "ts": false + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node_modules/slash/index.d.ts b/node_modules/slash/index.d.ts new file mode 100644 index 000000000..f9d07d11e --- /dev/null +++ b/node_modules/slash/index.d.ts @@ -0,0 +1,25 @@ +/** +Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar`. + +[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths and don't contain any non-ascii characters. + +@param path - A Windows backslash path. +@returns A path with forward slashes. + +@example +``` +import * as path from 'path'; +import slash = require('slash'); + +const string = path.join('foo', 'bar'); +// Unix => foo/bar +// Windows => foo\\bar + +slash(string); +// Unix => foo/bar +// Windows => foo/bar +``` +*/ +declare function slash(path: string): string; + +export = slash; diff --git a/node_modules/slash/index.js b/node_modules/slash/index.js new file mode 100644 index 000000000..103fbea97 --- /dev/null +++ b/node_modules/slash/index.js @@ -0,0 +1,11 @@ +'use strict'; +module.exports = path => { + const isExtendedLengthPath = /^\\\\\?\\/.test(path); + const hasNonAscii = /[^\u0000-\u0080]+/.test(path); // eslint-disable-line no-control-regex + + if (isExtendedLengthPath || hasNonAscii) { + return path; + } + + return path.replace(/\\/g, '/'); +}; diff --git a/node_modules/slash/license b/node_modules/slash/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/slash/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/slash/package.json b/node_modules/slash/package.json new file mode 100644 index 000000000..c88fcc712 --- /dev/null +++ b/node_modules/slash/package.json @@ -0,0 +1,35 @@ +{ + "name": "slash", + "version": "3.0.0", + "description": "Convert Windows backslash paths to slash paths", + "license": "MIT", + "repository": "sindresorhus/slash", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "path", + "seperator", + "slash", + "backslash", + "windows", + "convert" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/slash/readme.md b/node_modules/slash/readme.md new file mode 100644 index 000000000..f0ef4acbd --- /dev/null +++ b/node_modules/slash/readme.md @@ -0,0 +1,44 @@ +# slash [![Build Status](https://travis-ci.org/sindresorhus/slash.svg?branch=master)](https://travis-ci.org/sindresorhus/slash) + +> Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar` + +[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths and don't contain any non-ascii characters. + +This was created since the `path` methods in Node.js outputs `\\` paths on Windows. + + +## Install + +``` +$ npm install slash +``` + + +## Usage + +```js +const path = require('path'); +const slash = require('slash'); + +const string = path.join('foo', 'bar'); +// Unix => foo/bar +// Windows => foo\\bar + +slash(string); +// Unix => foo/bar +// Windows => foo/bar +``` + + +## API + +### slash(path) + +Type: `string` + +Accepts a Windows backslash path and returns a path with forward slashes. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/slice-ansi/index.js b/node_modules/slice-ansi/index.js new file mode 100755 index 000000000..72d37d9a5 --- /dev/null +++ b/node_modules/slice-ansi/index.js @@ -0,0 +1,103 @@ +'use strict'; +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const astralRegex = require('astral-regex'); +const ansiStyles = require('ansi-styles'); + +const ESCAPES = [ + '\u001B', + '\u009B' +]; + +const wrapAnsi = code => `${ESCAPES[0]}[${code}m`; + +const checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => { + let output = []; + ansiCodes = [...ansiCodes]; + + for (let ansiCode of ansiCodes) { + const ansiCodeOrigin = ansiCode; + if (ansiCode.includes(';')) { + ansiCode = ansiCode.split(';')[0][0] + '0'; + } + + const item = ansiStyles.codes.get(Number.parseInt(ansiCode, 10)); + if (item) { + const indexEscape = ansiCodes.indexOf(item.toString()); + if (indexEscape === -1) { + output.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin)); + } else { + ansiCodes.splice(indexEscape, 1); + } + } else if (isEscapes) { + output.push(wrapAnsi(0)); + break; + } else { + output.push(wrapAnsi(ansiCodeOrigin)); + } + } + + if (isEscapes) { + output = output.filter((element, index) => output.indexOf(element) === index); + + if (endAnsiCode !== undefined) { + const fistEscapeCode = wrapAnsi(ansiStyles.codes.get(Number.parseInt(endAnsiCode, 10))); + output = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []); + } + } + + return output.join(''); +}; + +module.exports = (string, begin, end) => { + const characters = [...string]; + const ansiCodes = []; + + let stringEnd = typeof end === 'number' ? end : characters.length; + let isInsideEscape = false; + let ansiCode; + let visible = 0; + let output = ''; + + for (const [index, character] of characters.entries()) { + let leftEscape = false; + + if (ESCAPES.includes(character)) { + const code = /\d[^m]*/.exec(string.slice(index, index + 18)); + ansiCode = code && code.length > 0 ? code[0] : undefined; + + if (visible < stringEnd) { + isInsideEscape = true; + + if (ansiCode !== undefined) { + ansiCodes.push(ansiCode); + } + } + } else if (isInsideEscape && character === 'm') { + isInsideEscape = false; + leftEscape = true; + } + + if (!isInsideEscape && !leftEscape) { + visible++; + } + + if (!astralRegex({exact: true}).test(character) && isFullwidthCodePoint(character.codePointAt())) { + visible++; + + if (typeof end !== 'number') { + stringEnd++; + } + } + + if (visible > begin && visible <= stringEnd) { + output += character; + } else if (visible === begin && !isInsideEscape && ansiCode !== undefined) { + output = checkAnsi(ansiCodes); + } else if (visible >= stringEnd) { + output += checkAnsi(ansiCodes, true, ansiCode); + break; + } + } + + return output; +}; diff --git a/node_modules/slice-ansi/license b/node_modules/slice-ansi/license new file mode 100644 index 000000000..e05b33c55 --- /dev/null +++ b/node_modules/slice-ansi/license @@ -0,0 +1,10 @@ +MIT License + +Copyright (c) DC +Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/slice-ansi/node_modules/ansi-styles/index.d.ts b/node_modules/slice-ansi/node_modules/ansi-styles/index.d.ts new file mode 100644 index 000000000..44a907e58 --- /dev/null +++ b/node_modules/slice-ansi/node_modules/ansi-styles/index.d.ts @@ -0,0 +1,345 @@ +declare type CSSColor = + | 'aliceblue' + | 'antiquewhite' + | 'aqua' + | 'aquamarine' + | 'azure' + | 'beige' + | 'bisque' + | 'black' + | 'blanchedalmond' + | 'blue' + | 'blueviolet' + | 'brown' + | 'burlywood' + | 'cadetblue' + | 'chartreuse' + | 'chocolate' + | 'coral' + | 'cornflowerblue' + | 'cornsilk' + | 'crimson' + | 'cyan' + | 'darkblue' + | 'darkcyan' + | 'darkgoldenrod' + | 'darkgray' + | 'darkgreen' + | 'darkgrey' + | 'darkkhaki' + | 'darkmagenta' + | 'darkolivegreen' + | 'darkorange' + | 'darkorchid' + | 'darkred' + | 'darksalmon' + | 'darkseagreen' + | 'darkslateblue' + | 'darkslategray' + | 'darkslategrey' + | 'darkturquoise' + | 'darkviolet' + | 'deeppink' + | 'deepskyblue' + | 'dimgray' + | 'dimgrey' + | 'dodgerblue' + | 'firebrick' + | 'floralwhite' + | 'forestgreen' + | 'fuchsia' + | 'gainsboro' + | 'ghostwhite' + | 'gold' + | 'goldenrod' + | 'gray' + | 'green' + | 'greenyellow' + | 'grey' + | 'honeydew' + | 'hotpink' + | 'indianred' + | 'indigo' + | 'ivory' + | 'khaki' + | 'lavender' + | 'lavenderblush' + | 'lawngreen' + | 'lemonchiffon' + | 'lightblue' + | 'lightcoral' + | 'lightcyan' + | 'lightgoldenrodyellow' + | 'lightgray' + | 'lightgreen' + | 'lightgrey' + | 'lightpink' + | 'lightsalmon' + | 'lightseagreen' + | 'lightskyblue' + | 'lightslategray' + | 'lightslategrey' + | 'lightsteelblue' + | 'lightyellow' + | 'lime' + | 'limegreen' + | 'linen' + | 'magenta' + | 'maroon' + | 'mediumaquamarine' + | 'mediumblue' + | 'mediumorchid' + | 'mediumpurple' + | 'mediumseagreen' + | 'mediumslateblue' + | 'mediumspringgreen' + | 'mediumturquoise' + | 'mediumvioletred' + | 'midnightblue' + | 'mintcream' + | 'mistyrose' + | 'moccasin' + | 'navajowhite' + | 'navy' + | 'oldlace' + | 'olive' + | 'olivedrab' + | 'orange' + | 'orangered' + | 'orchid' + | 'palegoldenrod' + | 'palegreen' + | 'paleturquoise' + | 'palevioletred' + | 'papayawhip' + | 'peachpuff' + | 'peru' + | 'pink' + | 'plum' + | 'powderblue' + | 'purple' + | 'rebeccapurple' + | 'red' + | 'rosybrown' + | 'royalblue' + | 'saddlebrown' + | 'salmon' + | 'sandybrown' + | 'seagreen' + | 'seashell' + | 'sienna' + | 'silver' + | 'skyblue' + | 'slateblue' + | 'slategray' + | 'slategrey' + | 'snow' + | 'springgreen' + | 'steelblue' + | 'tan' + | 'teal' + | 'thistle' + | 'tomato' + | 'turquoise' + | 'violet' + | 'wheat' + | 'white' + | 'whitesmoke' + | 'yellow' + | 'yellowgreen'; + +declare namespace ansiStyles { + interface ColorConvert { + /** + The RGB color space. + + @param red - (`0`-`255`) + @param green - (`0`-`255`) + @param blue - (`0`-`255`) + */ + rgb(red: number, green: number, blue: number): string; + + /** + The RGB HEX color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hex(hex: string): string; + + /** + @param keyword - A CSS color name. + */ + keyword(keyword: CSSColor): string; + + /** + The HSL color space. + + @param hue - (`0`-`360`) + @param saturation - (`0`-`100`) + @param lightness - (`0`-`100`) + */ + hsl(hue: number, saturation: number, lightness: number): string; + + /** + The HSV color space. + + @param hue - (`0`-`360`) + @param saturation - (`0`-`100`) + @param value - (`0`-`100`) + */ + hsv(hue: number, saturation: number, value: number): string; + + /** + The HSV color space. + + @param hue - (`0`-`360`) + @param whiteness - (`0`-`100`) + @param blackness - (`0`-`100`) + */ + hwb(hue: number, whiteness: number, blackness: number): string; + + /** + Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. + */ + ansi(ansi: number): string; + + /** + Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. + */ + ansi256(ansi: number): string; + } + + interface CSPair { + /** + The ANSI terminal control sequence for starting this style. + */ + readonly open: string; + + /** + The ANSI terminal control sequence for ending this style. + */ + readonly close: string; + } + + interface ColorBase { + readonly ansi: ColorConvert; + readonly ansi256: ColorConvert; + readonly ansi16m: ColorConvert; + + /** + The ANSI terminal control sequence for ending this color. + */ + readonly close: string; + } + + interface Modifier { + /** + Resets the current color chain. + */ + readonly reset: CSPair; + + /** + Make text bold. + */ + readonly bold: CSPair; + + /** + Emitting only a small amount of light. + */ + readonly dim: CSPair; + + /** + Make text italic. (Not widely supported) + */ + readonly italic: CSPair; + + /** + Make text underline. (Not widely supported) + */ + readonly underline: CSPair; + + /** + Inverse background and foreground colors. + */ + readonly inverse: CSPair; + + /** + Prints the text, but makes it invisible. + */ + readonly hidden: CSPair; + + /** + Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: CSPair; + } + + interface ForegroundColor { + readonly black: CSPair; + readonly red: CSPair; + readonly green: CSPair; + readonly yellow: CSPair; + readonly blue: CSPair; + readonly cyan: CSPair; + readonly magenta: CSPair; + readonly white: CSPair; + + /** + Alias for `blackBright`. + */ + readonly gray: CSPair; + + /** + Alias for `blackBright`. + */ + readonly grey: CSPair; + + readonly blackBright: CSPair; + readonly redBright: CSPair; + readonly greenBright: CSPair; + readonly yellowBright: CSPair; + readonly blueBright: CSPair; + readonly cyanBright: CSPair; + readonly magentaBright: CSPair; + readonly whiteBright: CSPair; + } + + interface BackgroundColor { + readonly bgBlack: CSPair; + readonly bgRed: CSPair; + readonly bgGreen: CSPair; + readonly bgYellow: CSPair; + readonly bgBlue: CSPair; + readonly bgCyan: CSPair; + readonly bgMagenta: CSPair; + readonly bgWhite: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGray: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGrey: CSPair; + + readonly bgBlackBright: CSPair; + readonly bgRedBright: CSPair; + readonly bgGreenBright: CSPair; + readonly bgYellowBright: CSPair; + readonly bgBlueBright: CSPair; + readonly bgCyanBright: CSPair; + readonly bgMagentaBright: CSPair; + readonly bgWhiteBright: CSPair; + } +} + +declare const ansiStyles: { + readonly modifier: ansiStyles.Modifier; + readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; + readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; + readonly codes: ReadonlyMap; +} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; + +export = ansiStyles; diff --git a/node_modules/slice-ansi/node_modules/ansi-styles/index.js b/node_modules/slice-ansi/node_modules/ansi-styles/index.js new file mode 100644 index 000000000..5d82581a1 --- /dev/null +++ b/node_modules/slice-ansi/node_modules/ansi-styles/index.js @@ -0,0 +1,163 @@ +'use strict'; + +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; + +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + + return value; + }, + enumerable: true, + configurable: true + }); +}; + +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = require('color-convert'); + } + + const offset = isBackground ? 10 : 0; + const styles = {}; + + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } + + return styles; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/node_modules/slice-ansi/node_modules/ansi-styles/license b/node_modules/slice-ansi/node_modules/ansi-styles/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/slice-ansi/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/slice-ansi/node_modules/ansi-styles/package.json b/node_modules/slice-ansi/node_modules/ansi-styles/package.json new file mode 100644 index 000000000..75393284d --- /dev/null +++ b/node_modules/slice-ansi/node_modules/ansi-styles/package.json @@ -0,0 +1,56 @@ +{ + "name": "ansi-styles", + "version": "4.3.0", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "funding": "https://github.com/chalk/ansi-styles?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "color-convert": "^2.0.1" + }, + "devDependencies": { + "@types/color-convert": "^1.9.0", + "ava": "^2.3.0", + "svg-term-cli": "^2.1.1", + "tsd": "^0.11.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/slice-ansi/node_modules/ansi-styles/readme.md b/node_modules/slice-ansi/node_modules/ansi-styles/readme.md new file mode 100644 index 000000000..24883de80 --- /dev/null +++ b/node_modules/slice-ansi/node_modules/ansi-styles/readme.md @@ -0,0 +1,152 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + + + +## Install + +``` +$ npm install ansi-styles +``` + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); +``` + +## API + +Each style has an `open` and `close` property. + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `blackBright` (alias: `gray`, `grey`) +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` (alias: `bgGray`, `bgGrey`) +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +The following color spaces from `color-convert` are supported: + +- `rgb` +- `hex` +- `keyword` +- `hsl` +- `hsv` +- `hwb` +- `ansi` +- `ansi256` + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +## For enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/slice-ansi/node_modules/color-convert/CHANGELOG.md b/node_modules/slice-ansi/node_modules/color-convert/CHANGELOG.md new file mode 100644 index 000000000..0a7bce4fd --- /dev/null +++ b/node_modules/slice-ansi/node_modules/color-convert/CHANGELOG.md @@ -0,0 +1,54 @@ +# 1.0.0 - 2016-01-07 + +- Removed: unused speed test +- Added: Automatic routing between previously unsupported conversions +([#27](https://github.com/Qix-/color-convert/pull/27)) +- Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions +([#27](https://github.com/Qix-/color-convert/pull/27)) +- Removed: `convert()` class +([#27](https://github.com/Qix-/color-convert/pull/27)) +- Changed: all functions to lookup dictionary +([#27](https://github.com/Qix-/color-convert/pull/27)) +- Changed: `ansi` to `ansi256` +([#27](https://github.com/Qix-/color-convert/pull/27)) +- Fixed: argument grouping for functions requiring only one argument +([#27](https://github.com/Qix-/color-convert/pull/27)) + +# 0.6.0 - 2015-07-23 + +- Added: methods to handle +[ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors: + - rgb2ansi16 + - rgb2ansi + - hsl2ansi16 + - hsl2ansi + - hsv2ansi16 + - hsv2ansi + - hwb2ansi16 + - hwb2ansi + - cmyk2ansi16 + - cmyk2ansi + - keyword2ansi16 + - keyword2ansi + - ansi162rgb + - ansi162hsl + - ansi162hsv + - ansi162hwb + - ansi162cmyk + - ansi162keyword + - ansi2rgb + - ansi2hsl + - ansi2hsv + - ansi2hwb + - ansi2cmyk + - ansi2keyword +([#18](https://github.com/harthur/color-convert/pull/18)) + +# 0.5.3 - 2015-06-02 + +- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]` +([#15](https://github.com/harthur/color-convert/issues/15)) + +--- + +Check out commit logs for older releases diff --git a/node_modules/slice-ansi/node_modules/color-convert/LICENSE b/node_modules/slice-ansi/node_modules/color-convert/LICENSE new file mode 100644 index 000000000..5b4c386f9 --- /dev/null +++ b/node_modules/slice-ansi/node_modules/color-convert/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2011-2016 Heather Arthur + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/slice-ansi/node_modules/color-convert/README.md b/node_modules/slice-ansi/node_modules/color-convert/README.md new file mode 100644 index 000000000..d4b08fc36 --- /dev/null +++ b/node_modules/slice-ansi/node_modules/color-convert/README.md @@ -0,0 +1,68 @@ +# color-convert + +[![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert) + +Color-convert is a color conversion library for JavaScript and node. +It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest): + +```js +var convert = require('color-convert'); + +convert.rgb.hsl(140, 200, 100); // [96, 48, 59] +convert.keyword.rgb('blue'); // [0, 0, 255] + +var rgbChannels = convert.rgb.channels; // 3 +var cmykChannels = convert.cmyk.channels; // 4 +var ansiChannels = convert.ansi16.channels; // 1 +``` + +# Install + +```console +$ npm install color-convert +``` + +# API + +Simply get the property of the _from_ and _to_ conversion that you're looking for. + +All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function. + +All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha). + +```js +var convert = require('color-convert'); + +// Hex to LAB +convert.hex.lab('DEADBF'); // [ 76, 21, -2 ] +convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ] + +// RGB to CMYK +convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ] +convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ] +``` + +### Arrays +All functions that accept multiple arguments also support passing an array. + +Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.) + +```js +var convert = require('color-convert'); + +convert.rgb.hex(123, 45, 67); // '7B2D43' +convert.rgb.hex([123, 45, 67]); // '7B2D43' +``` + +## Routing + +Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex). + +Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js). + +# Contribute + +If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request. + +# License +Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE). diff --git a/node_modules/slice-ansi/node_modules/color-convert/conversions.js b/node_modules/slice-ansi/node_modules/color-convert/conversions.js new file mode 100644 index 000000000..2657f265c --- /dev/null +++ b/node_modules/slice-ansi/node_modules/color-convert/conversions.js @@ -0,0 +1,839 @@ +/* MIT license */ +/* eslint-disable no-mixed-operators */ +const cssKeywords = require('color-name'); + +// NOTE: conversions should only return primitive values (i.e. arrays, or +// values that give correct `typeof` results). +// do not use box values types (i.e. Number(), String(), etc.) + +const reverseKeywords = {}; +for (const key of Object.keys(cssKeywords)) { + reverseKeywords[cssKeywords[key]] = key; +} + +const convert = { + rgb: {channels: 3, labels: 'rgb'}, + hsl: {channels: 3, labels: 'hsl'}, + hsv: {channels: 3, labels: 'hsv'}, + hwb: {channels: 3, labels: 'hwb'}, + cmyk: {channels: 4, labels: 'cmyk'}, + xyz: {channels: 3, labels: 'xyz'}, + lab: {channels: 3, labels: 'lab'}, + lch: {channels: 3, labels: 'lch'}, + hex: {channels: 1, labels: ['hex']}, + keyword: {channels: 1, labels: ['keyword']}, + ansi16: {channels: 1, labels: ['ansi16']}, + ansi256: {channels: 1, labels: ['ansi256']}, + hcg: {channels: 3, labels: ['h', 'c', 'g']}, + apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, + gray: {channels: 1, labels: ['gray']} +}; + +module.exports = convert; + +// Hide .channels and .labels properties +for (const model of Object.keys(convert)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } + + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } + + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); + } + + const {channels, labels} = convert[model]; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', {value: channels}); + Object.defineProperty(convert[model], 'labels', {value: labels}); +} + +convert.rgb.hsl = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const min = Math.min(r, g, b); + const max = Math.max(r, g, b); + const delta = max - min; + let h; + let s; + + if (max === min) { + h = 0; + } else if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else if (b === max) { + h = 4 + (r - g) / delta; + } + + h = Math.min(h * 60, 360); + + if (h < 0) { + h += 360; + } + + const l = (min + max) / 2; + + if (max === min) { + s = 0; + } else if (l <= 0.5) { + s = delta / (max + min); + } else { + s = delta / (2 - max - min); + } + + return [h, s * 100, l * 100]; +}; + +convert.rgb.hsv = function (rgb) { + let rdif; + let gdif; + let bdif; + let h; + let s; + + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const v = Math.max(r, g, b); + const diff = v - Math.min(r, g, b); + const diffc = function (c) { + return (v - c) / 6 / diff + 1 / 2; + }; + + if (diff === 0) { + h = 0; + s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); + + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = (1 / 3) + rdif - bdif; + } else if (b === v) { + h = (2 / 3) + gdif - rdif; + } + + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } + + return [ + h * 360, + s * 100, + v * 100 + ]; +}; + +convert.rgb.hwb = function (rgb) { + const r = rgb[0]; + const g = rgb[1]; + let b = rgb[2]; + const h = convert.rgb.hsl(rgb)[0]; + const w = 1 / 255 * Math.min(r, Math.min(g, b)); + + b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); + + return [h, w * 100, b * 100]; +}; + +convert.rgb.cmyk = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + + const k = Math.min(1 - r, 1 - g, 1 - b); + const c = (1 - r - k) / (1 - k) || 0; + const m = (1 - g - k) / (1 - k) || 0; + const y = (1 - b - k) / (1 - k) || 0; + + return [c * 100, m * 100, y * 100, k * 100]; +}; + +function comparativeDistance(x, y) { + /* + See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + */ + return ( + ((x[0] - y[0]) ** 2) + + ((x[1] - y[1]) ** 2) + + ((x[2] - y[2]) ** 2) + ); +} + +convert.rgb.keyword = function (rgb) { + const reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } + + let currentClosestDistance = Infinity; + let currentClosestKeyword; + + for (const keyword of Object.keys(cssKeywords)) { + const value = cssKeywords[keyword]; + + // Compute comparative distance + const distance = comparativeDistance(rgb, value); + + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } + + return currentClosestKeyword; +}; + +convert.keyword.rgb = function (keyword) { + return cssKeywords[keyword]; +}; + +convert.rgb.xyz = function (rgb) { + let r = rgb[0] / 255; + let g = rgb[1] / 255; + let b = rgb[2] / 255; + + // Assume sRGB + r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); + g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); + b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); + + const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); + + return [x * 100, y * 100, z * 100]; +}; + +convert.rgb.lab = function (rgb) { + const xyz = convert.rgb.xyz(rgb); + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; + + x /= 95.047; + y /= 100; + z /= 108.883; + + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); + + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); + + return [l, a, b]; +}; + +convert.hsl.rgb = function (hsl) { + const h = hsl[0] / 360; + const s = hsl[1] / 100; + const l = hsl[2] / 100; + let t2; + let t3; + let val; + + if (s === 0) { + val = l * 255; + return [val, val, val]; + } + + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } + + const t1 = 2 * l - t2; + + const rgb = [0, 0, 0]; + for (let i = 0; i < 3; i++) { + t3 = h + 1 / 3 * -(i - 1); + if (t3 < 0) { + t3++; + } + + if (t3 > 1) { + t3--; + } + + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; + } + + rgb[i] = val * 255; + } + + return rgb; +}; + +convert.hsl.hsv = function (hsl) { + const h = hsl[0]; + let s = hsl[1] / 100; + let l = hsl[2] / 100; + let smin = s; + const lmin = Math.max(l, 0.01); + + l *= 2; + s *= (l <= 1) ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + const v = (l + s) / 2; + const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); + + return [h, sv * 100, v * 100]; +}; + +convert.hsv.rgb = function (hsv) { + const h = hsv[0] / 60; + const s = hsv[1] / 100; + let v = hsv[2] / 100; + const hi = Math.floor(h) % 6; + + const f = h - Math.floor(h); + const p = 255 * v * (1 - s); + const q = 255 * v * (1 - (s * f)); + const t = 255 * v * (1 - (s * (1 - f))); + v *= 255; + + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; + } +}; + +convert.hsv.hsl = function (hsv) { + const h = hsv[0]; + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const vmin = Math.max(v, 0.01); + let sl; + let l; + + l = (2 - s) * v; + const lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= (lmin <= 1) ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; + + return [h, sl * 100, l * 100]; +}; + +// http://dev.w3.org/csswg/css-color/#hwb-to-rgb +convert.hwb.rgb = function (hwb) { + const h = hwb[0] / 360; + let wh = hwb[1] / 100; + let bl = hwb[2] / 100; + const ratio = wh + bl; + let f; + + // Wh + bl cant be > 1 + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } + + const i = Math.floor(6 * h); + const v = 1 - bl; + f = 6 * h - i; + + if ((i & 0x01) !== 0) { + f = 1 - f; + } + + const n = wh + f * (v - wh); // Linear interpolation + + let r; + let g; + let b; + /* eslint-disable max-statements-per-line,no-multi-spaces */ + switch (i) { + default: + case 6: + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; + } + /* eslint-enable max-statements-per-line,no-multi-spaces */ + + return [r * 255, g * 255, b * 255]; +}; + +convert.cmyk.rgb = function (cmyk) { + const c = cmyk[0] / 100; + const m = cmyk[1] / 100; + const y = cmyk[2] / 100; + const k = cmyk[3] / 100; + + const r = 1 - Math.min(1, c * (1 - k) + k); + const g = 1 - Math.min(1, m * (1 - k) + k); + const b = 1 - Math.min(1, y * (1 - k) + k); + + return [r * 255, g * 255, b * 255]; +}; + +convert.xyz.rgb = function (xyz) { + const x = xyz[0] / 100; + const y = xyz[1] / 100; + const z = xyz[2] / 100; + let r; + let g; + let b; + + r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); + g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); + b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); + + // Assume sRGB + r = r > 0.0031308 + ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) + : r * 12.92; + + g = g > 0.0031308 + ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) + : g * 12.92; + + b = b > 0.0031308 + ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) + : b * 12.92; + + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); + + return [r * 255, g * 255, b * 255]; +}; + +convert.xyz.lab = function (xyz) { + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; + + x /= 95.047; + y /= 100; + z /= 108.883; + + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); + + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); + + return [l, a, b]; +}; + +convert.lab.xyz = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let x; + let y; + let z; + + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; + + const y2 = y ** 3; + const x2 = x ** 3; + const z2 = z ** 3; + y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; + + x *= 95.047; + y *= 100; + z *= 108.883; + + return [x, y, z]; +}; + +convert.lab.lch = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let h; + + const hr = Math.atan2(b, a); + h = hr * 360 / 2 / Math.PI; + + if (h < 0) { + h += 360; + } + + const c = Math.sqrt(a * a + b * b); + + return [l, c, h]; +}; + +convert.lch.lab = function (lch) { + const l = lch[0]; + const c = lch[1]; + const h = lch[2]; + + const hr = h / 360 * 2 * Math.PI; + const a = c * Math.cos(hr); + const b = c * Math.sin(hr); + + return [l, a, b]; +}; + +convert.rgb.ansi16 = function (args, saturation = null) { + const [r, g, b] = args; + let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization + + value = Math.round(value / 50); + + if (value === 0) { + return 30; + } + + let ansi = 30 + + ((Math.round(b / 255) << 2) + | (Math.round(g / 255) << 1) + | Math.round(r / 255)); + + if (value === 2) { + ansi += 60; + } + + return ansi; +}; + +convert.hsv.ansi16 = function (args) { + // Optimization here; we already know the value and don't need to get + // it converted for us. + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); +}; + +convert.rgb.ansi256 = function (args) { + const r = args[0]; + const g = args[1]; + const b = args[2]; + + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (r === g && g === b) { + if (r < 8) { + return 16; + } + + if (r > 248) { + return 231; + } + + return Math.round(((r - 8) / 247) * 24) + 232; + } + + const ansi = 16 + + (36 * Math.round(r / 255 * 5)) + + (6 * Math.round(g / 255 * 5)) + + Math.round(b / 255 * 5); + + return ansi; +}; + +convert.ansi16.rgb = function (args) { + let color = args % 10; + + // Handle greyscale + if (color === 0 || color === 7) { + if (args > 50) { + color += 3.5; + } + + color = color / 10.5 * 255; + + return [color, color, color]; + } + + const mult = (~~(args > 50) + 1) * 0.5; + const r = ((color & 1) * mult) * 255; + const g = (((color >> 1) & 1) * mult) * 255; + const b = (((color >> 2) & 1) * mult) * 255; + + return [r, g, b]; +}; + +convert.ansi256.rgb = function (args) { + // Handle greyscale + if (args >= 232) { + const c = (args - 232) * 10 + 8; + return [c, c, c]; + } + + args -= 16; + + let rem; + const r = Math.floor(args / 36) / 5 * 255; + const g = Math.floor((rem = args % 36) / 6) / 5 * 255; + const b = (rem % 6) / 5 * 255; + + return [r, g, b]; +}; + +convert.rgb.hex = function (args) { + const integer = ((Math.round(args[0]) & 0xFF) << 16) + + ((Math.round(args[1]) & 0xFF) << 8) + + (Math.round(args[2]) & 0xFF); + + const string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; + +convert.hex.rgb = function (args) { + const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; + } + + let colorString = match[0]; + + if (match[0].length === 3) { + colorString = colorString.split('').map(char => { + return char + char; + }).join(''); + } + + const integer = parseInt(colorString, 16); + const r = (integer >> 16) & 0xFF; + const g = (integer >> 8) & 0xFF; + const b = integer & 0xFF; + + return [r, g, b]; +}; + +convert.rgb.hcg = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const max = Math.max(Math.max(r, g), b); + const min = Math.min(Math.min(r, g), b); + const chroma = (max - min); + let grayscale; + let hue; + + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; + } + + if (chroma <= 0) { + hue = 0; + } else + if (max === r) { + hue = ((g - b) / chroma) % 6; + } else + if (max === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma; + } + + hue /= 6; + hue %= 1; + + return [hue * 360, chroma * 100, grayscale * 100]; +}; + +convert.hsl.hcg = function (hsl) { + const s = hsl[1] / 100; + const l = hsl[2] / 100; + + const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); + + let f = 0; + if (c < 1.0) { + f = (l - 0.5 * c) / (1.0 - c); + } + + return [hsl[0], c * 100, f * 100]; +}; + +convert.hsv.hcg = function (hsv) { + const s = hsv[1] / 100; + const v = hsv[2] / 100; + + const c = s * v; + let f = 0; + + if (c < 1.0) { + f = (v - c) / (1 - c); + } + + return [hsv[0], c * 100, f * 100]; +}; + +convert.hcg.rgb = function (hcg) { + const h = hcg[0] / 360; + const c = hcg[1] / 100; + const g = hcg[2] / 100; + + if (c === 0.0) { + return [g * 255, g * 255, g * 255]; + } + + const pure = [0, 0, 0]; + const hi = (h % 1) * 6; + const v = hi % 1; + const w = 1 - v; + let mg = 0; + + /* eslint-disable max-statements-per-line */ + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; pure[1] = v; pure[2] = 0; break; + case 1: + pure[0] = w; pure[1] = 1; pure[2] = 0; break; + case 2: + pure[0] = 0; pure[1] = 1; pure[2] = v; break; + case 3: + pure[0] = 0; pure[1] = w; pure[2] = 1; break; + case 4: + pure[0] = v; pure[1] = 0; pure[2] = 1; break; + default: + pure[0] = 1; pure[1] = 0; pure[2] = w; + } + /* eslint-enable max-statements-per-line */ + + mg = (1.0 - c) * g; + + return [ + (c * pure[0] + mg) * 255, + (c * pure[1] + mg) * 255, + (c * pure[2] + mg) * 255 + ]; +}; + +convert.hcg.hsv = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + + const v = c + g * (1.0 - c); + let f = 0; + + if (v > 0.0) { + f = c / v; + } + + return [hcg[0], f * 100, v * 100]; +}; + +convert.hcg.hsl = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + + const l = g * (1.0 - c) + 0.5 * c; + let s = 0; + + if (l > 0.0 && l < 0.5) { + s = c / (2 * l); + } else + if (l >= 0.5 && l < 1.0) { + s = c / (2 * (1 - l)); + } + + return [hcg[0], s * 100, l * 100]; +}; + +convert.hcg.hwb = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c + g * (1.0 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; +}; + +convert.hwb.hcg = function (hwb) { + const w = hwb[1] / 100; + const b = hwb[2] / 100; + const v = 1 - b; + const c = v - w; + let g = 0; + + if (c < 1) { + g = (v - c) / (1 - c); + } + + return [hwb[0], c * 100, g * 100]; +}; + +convert.apple.rgb = function (apple) { + return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; +}; + +convert.rgb.apple = function (rgb) { + return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; +}; + +convert.gray.rgb = function (args) { + return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; +}; + +convert.gray.hsl = function (args) { + return [0, 0, args[0]]; +}; + +convert.gray.hsv = convert.gray.hsl; + +convert.gray.hwb = function (gray) { + return [0, 100, gray[0]]; +}; + +convert.gray.cmyk = function (gray) { + return [0, 0, 0, gray[0]]; +}; + +convert.gray.lab = function (gray) { + return [gray[0], 0, 0]; +}; + +convert.gray.hex = function (gray) { + const val = Math.round(gray[0] / 100 * 255) & 0xFF; + const integer = (val << 16) + (val << 8) + val; + + const string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; + +convert.rgb.gray = function (rgb) { + const val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val / 255 * 100]; +}; diff --git a/node_modules/slice-ansi/node_modules/color-convert/index.js b/node_modules/slice-ansi/node_modules/color-convert/index.js new file mode 100644 index 000000000..b648e5737 --- /dev/null +++ b/node_modules/slice-ansi/node_modules/color-convert/index.js @@ -0,0 +1,81 @@ +const conversions = require('./conversions'); +const route = require('./route'); + +const convert = {}; + +const models = Object.keys(conversions); + +function wrapRaw(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; + if (arg0 === undefined || arg0 === null) { + return arg0; + } + + if (arg0.length > 1) { + args = arg0; + } + + return fn(args); + }; + + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; +} + +function wrapRounded(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; + + if (arg0 === undefined || arg0 === null) { + return arg0; + } + + if (arg0.length > 1) { + args = arg0; + } + + const result = fn(args); + + // We're assuming the result is an array here. + // see notice in conversions.js; don't use box types + // in conversion functions. + if (typeof result === 'object') { + for (let len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } + + return result; + }; + + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; +} + +models.forEach(fromModel => { + convert[fromModel] = {}; + + Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); + Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); + + const routes = route(fromModel); + const routeModels = Object.keys(routes); + + routeModels.forEach(toModel => { + const fn = routes[toModel]; + + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); +}); + +module.exports = convert; diff --git a/node_modules/slice-ansi/node_modules/color-convert/package.json b/node_modules/slice-ansi/node_modules/color-convert/package.json new file mode 100644 index 000000000..6e48000c7 --- /dev/null +++ b/node_modules/slice-ansi/node_modules/color-convert/package.json @@ -0,0 +1,48 @@ +{ + "name": "color-convert", + "description": "Plain color conversion functions", + "version": "2.0.1", + "author": "Heather Arthur ", + "license": "MIT", + "repository": "Qix-/color-convert", + "scripts": { + "pretest": "xo", + "test": "node test/basic.js" + }, + "engines": { + "node": ">=7.0.0" + }, + "keywords": [ + "color", + "colour", + "convert", + "converter", + "conversion", + "rgb", + "hsl", + "hsv", + "hwb", + "cmyk", + "ansi", + "ansi16" + ], + "files": [ + "index.js", + "conversions.js", + "route.js" + ], + "xo": { + "rules": { + "default-case": 0, + "no-inline-comments": 0, + "operator-linebreak": 0 + } + }, + "devDependencies": { + "chalk": "^2.4.2", + "xo": "^0.24.0" + }, + "dependencies": { + "color-name": "~1.1.4" + } +} diff --git a/node_modules/slice-ansi/node_modules/color-convert/route.js b/node_modules/slice-ansi/node_modules/color-convert/route.js new file mode 100644 index 000000000..1a08521b5 --- /dev/null +++ b/node_modules/slice-ansi/node_modules/color-convert/route.js @@ -0,0 +1,97 @@ +const conversions = require('./conversions'); + +/* + This function routes a model to all other models. + + all functions that are routed have a property `.conversion` attached + to the returned synthetic function. This property is an array + of strings, each with the steps in between the 'from' and 'to' + color models (inclusive). + + conversions that are not possible simply are not included. +*/ + +function buildGraph() { + const graph = {}; + // https://jsperf.com/object-keys-vs-for-in-with-closure/3 + const models = Object.keys(conversions); + + for (let len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } + + return graph; +} + +// https://en.wikipedia.org/wiki/Breadth-first_search +function deriveBFS(fromModel) { + const graph = buildGraph(); + const queue = [fromModel]; // Unshift -> queue -> pop + + graph[fromModel].distance = 0; + + while (queue.length) { + const current = queue.pop(); + const adjacents = Object.keys(conversions[current]); + + for (let len = adjacents.length, i = 0; i < len; i++) { + const adjacent = adjacents[i]; + const node = graph[adjacent]; + + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } + + return graph; +} + +function link(from, to) { + return function (args) { + return to(from(args)); + }; +} + +function wrapConversion(toModel, graph) { + const path = [graph[toModel].parent, toModel]; + let fn = conversions[graph[toModel].parent][toModel]; + + let cur = graph[toModel].parent; + while (graph[cur].parent) { + path.unshift(graph[cur].parent); + fn = link(conversions[graph[cur].parent][cur], fn); + cur = graph[cur].parent; + } + + fn.conversion = path; + return fn; +} + +module.exports = function (fromModel) { + const graph = deriveBFS(fromModel); + const conversion = {}; + + const models = Object.keys(graph); + for (let len = models.length, i = 0; i < len; i++) { + const toModel = models[i]; + const node = graph[toModel]; + + if (node.parent === null) { + // No possible conversion, or this node is the source model. + continue; + } + + conversion[toModel] = wrapConversion(toModel, graph); + } + + return conversion; +}; + diff --git a/node_modules/slice-ansi/node_modules/color-name/LICENSE b/node_modules/slice-ansi/node_modules/color-name/LICENSE new file mode 100644 index 000000000..c6b100125 --- /dev/null +++ b/node_modules/slice-ansi/node_modules/color-name/LICENSE @@ -0,0 +1,8 @@ +The MIT License (MIT) +Copyright (c) 2015 Dmitry Ivanov + +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. \ No newline at end of file diff --git a/node_modules/slice-ansi/node_modules/color-name/README.md b/node_modules/slice-ansi/node_modules/color-name/README.md new file mode 100644 index 000000000..932b97917 --- /dev/null +++ b/node_modules/slice-ansi/node_modules/color-name/README.md @@ -0,0 +1,11 @@ +A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. + +[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) + + +```js +var colors = require('color-name'); +colors.red //[255,0,0] +``` + + diff --git a/node_modules/slice-ansi/node_modules/color-name/index.js b/node_modules/slice-ansi/node_modules/color-name/index.js new file mode 100644 index 000000000..b7c198a6f --- /dev/null +++ b/node_modules/slice-ansi/node_modules/color-name/index.js @@ -0,0 +1,152 @@ +'use strict' + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; diff --git a/node_modules/slice-ansi/node_modules/color-name/package.json b/node_modules/slice-ansi/node_modules/color-name/package.json new file mode 100644 index 000000000..782dd8287 --- /dev/null +++ b/node_modules/slice-ansi/node_modules/color-name/package.json @@ -0,0 +1,28 @@ +{ + "name": "color-name", + "version": "1.1.4", + "description": "A list of color names and its values", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "git@github.com:colorjs/color-name.git" + }, + "keywords": [ + "color-name", + "color", + "color-keyword", + "keyword" + ], + "author": "DY ", + "license": "MIT", + "bugs": { + "url": "https://github.com/colorjs/color-name/issues" + }, + "homepage": "https://github.com/colorjs/color-name" +} diff --git a/node_modules/slice-ansi/package.json b/node_modules/slice-ansi/package.json new file mode 100644 index 000000000..7d6ea6956 --- /dev/null +++ b/node_modules/slice-ansi/package.json @@ -0,0 +1,52 @@ +{ + "name": "slice-ansi", + "version": "4.0.0", + "description": "Slice a string with ANSI escape codes", + "license": "MIT", + "repository": "chalk/slice-ansi", + "funding": "https://github.com/chalk/slice-ansi?sponsor=1", + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "slice", + "string", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "devDependencies": { + "ava": "^2.1.0", + "chalk": "^3.0.0", + "random-item": "^3.0.0", + "strip-ansi": "^6.0.0", + "xo": "^0.26.1" + } +} diff --git a/node_modules/slice-ansi/readme.md b/node_modules/slice-ansi/readme.md new file mode 100644 index 000000000..88d36772c --- /dev/null +++ b/node_modules/slice-ansi/readme.md @@ -0,0 +1,66 @@ +# slice-ansi [![Build Status](https://travis-ci.org/chalk/slice-ansi.svg?branch=master)](https://travis-ci.org/chalk/slice-ansi) [![XO: Linted](https://img.shields.io/badge/xo-linted-blue.svg)](https://github.com/xojs/xo) + +> Slice a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) + +## Install + +``` +$ npm install slice-ansi +``` + +## Usage + +```js +const chalk = require('chalk'); +const sliceAnsi = require('slice-ansi'); + +const string = 'The quick brown ' + chalk.red('fox jumped over ') + + 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); + +console.log(sliceAnsi(string, 20, 30)); +``` + +## API + +### sliceAnsi(string, beginSlice, endSlice?) + +#### string + +Type: `string` + +String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). + +#### beginSlice + +Type: `number` + +Zero-based index at which to begin the slice. + +#### endSlice + +Type: `number` + +Zero-based index at which to end the slice. + +## Related + +- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes +- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/source-map-js/CHANGELOG.md b/node_modules/source-map-js/CHANGELOG.md new file mode 100644 index 000000000..4cd530754 --- /dev/null +++ b/node_modules/source-map-js/CHANGELOG.md @@ -0,0 +1,320 @@ +# Change Log + +## 1.0.2 + +* Add types for path imports ([#13](https://github.com/7rulnik/source-map-js/pull/13)) [@TrySound](https://github.com/TrySound) + +## 1.0.1 + +* Remove cleanComments optimization ([#10](https://github.com/7rulnik/source-map-js/pull/10)) [@ai](https://github.com/ai) + +## 1.0.0 + +* Fix package.json#typings field ([#6](https://github.com/7rulnik/source-map-js/pull/6)) [@chalkygames123](https://github.com/chalkygames123) + +* Reduce memory usage of eachMapping w/ loop ([#5](https://github.com/7rulnik/source-map-js/pull/5)) [@noppa](https://github.com/noppa) + +* Reduce npm package size ([#7](https://github.com/7rulnik/source-map-js/pull/7)) [@ai](https://github.com/ai) + +---------- +# It doesn't related to this fork: + +## 0.5.6 + +* Fix for regression when people were using numbers as names in source maps. See + #236. + +## 0.5.5 + +* Fix "regression" of unsupported, implementation behavior that half the world + happens to have come to depend on. See #235. + +* Fix regression involving function hoisting in SpiderMonkey. See #233. + +## 0.5.4 + +* Large performance improvements to source-map serialization. See #228 and #229. + +## 0.5.3 + +* Do not include unnecessary distribution files. See + commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86. + +## 0.5.2 + +* Include browser distributions of the library in package.json's `files`. See + issue #212. + +## 0.5.1 + +* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See + ff05274becc9e6e1295ed60f3ea090d31d843379. + +## 0.5.0 + +* Node 0.8 is no longer supported. + +* Use webpack instead of dryice for bundling. + +* Big speedups serializing source maps. See pull request #203. + +* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that + explicitly start with the source root. See issue #199. + +## 0.4.4 + +* Fix an issue where using a `SourceMapGenerator` after having created a + `SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See + issue #191. + +* Fix an issue with where `SourceMapGenerator` would mistakenly consider + different mappings as duplicates of each other and avoid generating them. See + issue #192. + +## 0.4.3 + +* A very large number of performance improvements, particularly when parsing + source maps. Collectively about 75% of time shaved off of the source map + parsing benchmark! + +* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy + searching in the presence of a column option. See issue #177. + +* Fix a bug with joining a source and its source root when the source is above + the root. See issue #182. + +* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to + determine when all sources' contents are inlined into the source map. See + issue #190. + +## 0.4.2 + +* Add an `.npmignore` file so that the benchmarks aren't pulled down by + dependent projects. Issue #169. + +* Add an optional `column` argument to + `SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines + with no mappings. Issues #172 and #173. + +## 0.4.1 + +* Fix accidentally defining a global variable. #170. + +## 0.4.0 + +* The default direction for fuzzy searching was changed back to its original + direction. See #164. + +* There is now a `bias` option you can supply to `SourceMapConsumer` to control + the fuzzy searching direction. See #167. + +* About an 8% speed up in parsing source maps. See #159. + +* Added a benchmark for parsing and generating source maps. + +## 0.3.0 + +* Change the default direction that searching for positions fuzzes when there is + not an exact match. See #154. + +* Support for environments using json2.js for JSON serialization. See #156. + +## 0.2.0 + +* Support for consuming "indexed" source maps which do not have any remote + sections. See pull request #127. This introduces a minor backwards + incompatibility if you are monkey patching `SourceMapConsumer.prototype` + methods. + +## 0.1.43 + +* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue + #148 for some discussion and issues #150, #151, and #152 for implementations. + +## 0.1.42 + +* Fix an issue where `SourceNode`s from different versions of the source-map + library couldn't be used in conjunction with each other. See issue #142. + +## 0.1.41 + +* Fix a bug with getting the source content of relative sources with a "./" + prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). + +* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the + column span of each mapping. + +* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find + all generated positions associated with a given original source and line. + +## 0.1.40 + +* Performance improvements for parsing source maps in SourceMapConsumer. + +## 0.1.39 + +* Fix a bug where setting a source's contents to null before any source content + had been set before threw a TypeError. See issue #131. + +## 0.1.38 + +* Fix a bug where finding relative paths from an empty path were creating + absolute paths. See issue #129. + +## 0.1.37 + +* Fix a bug where if the source root was an empty string, relative source paths + would turn into absolute source paths. Issue #124. + +## 0.1.36 + +* Allow the `names` mapping property to be an empty string. Issue #121. + +## 0.1.35 + +* A third optional parameter was added to `SourceNode.fromStringWithSourceMap` + to specify a path that relative sources in the second parameter should be + relative to. Issue #105. + +* If no file property is given to a `SourceMapGenerator`, then the resulting + source map will no longer have a `null` file property. The property will + simply not exist. Issue #104. + +* Fixed a bug where consecutive newlines were ignored in `SourceNode`s. + Issue #116. + +## 0.1.34 + +* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103. + +* Fix bug involving source contents and the + `SourceMapGenerator.prototype.applySourceMap`. Issue #100. + +## 0.1.33 + +* Fix some edge cases surrounding path joining and URL resolution. + +* Add a third parameter for relative path to + `SourceMapGenerator.prototype.applySourceMap`. + +* Fix issues with mappings and EOLs. + +## 0.1.32 + +* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns + (issue 92). + +* Fixed test runner to actually report number of failed tests as its process + exit code. + +* Fixed a typo when reporting bad mappings (issue 87). + +## 0.1.31 + +* Delay parsing the mappings in SourceMapConsumer until queried for a source + location. + +* Support Sass source maps (which at the time of writing deviate from the spec + in small ways) in SourceMapConsumer. + +## 0.1.30 + +* Do not join source root with a source, when the source is a data URI. + +* Extend the test runner to allow running single specific test files at a time. + +* Performance improvements in `SourceNode.prototype.walk` and + `SourceMapConsumer.prototype.eachMapping`. + +* Source map browser builds will now work inside Workers. + +* Better error messages when attempting to add an invalid mapping to a + `SourceMapGenerator`. + +## 0.1.29 + +* Allow duplicate entries in the `names` and `sources` arrays of source maps + (usually from TypeScript) we are parsing. Fixes github issue 72. + +## 0.1.28 + +* Skip duplicate mappings when creating source maps from SourceNode; github + issue 75. + +## 0.1.27 + +* Don't throw an error when the `file` property is missing in SourceMapConsumer, + we don't use it anyway. + +## 0.1.26 + +* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. + +## 0.1.25 + +* Make compatible with browserify + +## 0.1.24 + +* Fix issue with absolute paths and `file://` URIs. See + https://bugzilla.mozilla.org/show_bug.cgi?id=885597 + +## 0.1.23 + +* Fix issue with absolute paths and sourcesContent, github issue 64. + +## 0.1.22 + +* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. + +## 0.1.21 + +* Fixed handling of sources that start with a slash so that they are relative to + the source root's host. + +## 0.1.20 + +* Fixed github issue #43: absolute URLs aren't joined with the source root + anymore. + +## 0.1.19 + +* Using Travis CI to run tests. + +## 0.1.18 + +* Fixed a bug in the handling of sourceRoot. + +## 0.1.17 + +* Added SourceNode.fromStringWithSourceMap. + +## 0.1.16 + +* Added missing documentation. + +* Fixed the generating of empty mappings in SourceNode. + +## 0.1.15 + +* Added SourceMapGenerator.applySourceMap. + +## 0.1.14 + +* The sourceRoot is now handled consistently. + +## 0.1.13 + +* Added SourceMapGenerator.fromSourceMap. + +## 0.1.12 + +* SourceNode now generates empty mappings too. + +## 0.1.11 + +* Added name support to SourceNode. + +## 0.1.10 + +* Added sourcesContent support to the customer and generator. diff --git a/node_modules/source-map-js/LICENSE b/node_modules/source-map-js/LICENSE new file mode 100644 index 000000000..ed1b7cf27 --- /dev/null +++ b/node_modules/source-map-js/LICENSE @@ -0,0 +1,28 @@ + +Copyright (c) 2009-2011, Mozilla Foundation and contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the names of the Mozilla Foundation nor the names of project + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/source-map-js/README.md b/node_modules/source-map-js/README.md new file mode 100644 index 000000000..ba01846ca --- /dev/null +++ b/node_modules/source-map-js/README.md @@ -0,0 +1,758 @@ +# Source Map JS + +[![NPM](https://nodei.co/npm/source-map-js.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map-js) + +Difference between original [source-map](https://github.com/mozilla/source-map): + +> TL,DR: it's fork of original source-map@0.6, but with perfomance optimizations. + +This journey starts from [source-map@0.7.0](https://github.com/mozilla/source-map/blob/master/CHANGELOG.md#070). Some part of it was rewritten to Rust and WASM and API became async. + +It's still a major block for many libraries like PostCSS or Sass for example because they need to migrate the whole API to the async way. This is the reason why 0.6.1 has 2x more downloads than 0.7.3 while it's faster several times. + +![Downloads count](media/downloads.png) + +More important that WASM version has some optimizations in JS code too. This is why [community asked to create branch for 0.6 version](https://github.com/mozilla/source-map/issues/324) and port these optimizations but, sadly, the answer was «no». A bit later I discovered [the issue](https://github.com/mozilla/source-map/issues/370) created by [Ben Rothman (@benthemonkey)](https://github.com/benthemonkey) with no response at all. + +[Roman Dvornov (@lahmatiy)](https://github.com/lahmatiy) wrote a [serveral posts](https://t.me/gorshochekvarit/76) (russian, only, sorry) about source-map library in his own Telegram channel. He mentioned the article [«Maybe you don't need Rust and WASM to speed up your JS»](https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html) written by [Vyacheslav Egorov (@mraleph)](https://github.com/mraleph). This article contains optimizations and hacks that lead to almost the same performance compare to WASM implementation. + +I decided to fork the original source-map and port these optimizations from the article and several others PR from the original source-map. + +--------- + +This is a library to generate and consume the source map format +[described here][format]. + +[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit + +## Use with Node + + $ npm install source-map-js + + + +-------------------------------------------------------------------------------- + + + + + +## Table of Contents + +- [Examples](#examples) + - [Consuming a source map](#consuming-a-source-map) + - [Generating a source map](#generating-a-source-map) + - [With SourceNode (high level API)](#with-sourcenode-high-level-api) + - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) +- [API](#api) + - [SourceMapConsumer](#sourcemapconsumer) + - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) + - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) + - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) + - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) + - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) + - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) + - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) + - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) + - [SourceMapGenerator](#sourcemapgenerator) + - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) + - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) + - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) + - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) + - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) + - [SourceNode](#sourcenode) + - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) + - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) + - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) + - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) + - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) + - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) + - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) + - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) + - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) + - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) + + + +## Examples + +### Consuming a source map + +```js +var rawSourceMap = { + version: 3, + file: 'min.js', + names: ['bar', 'baz', 'n'], + sources: ['one.js', 'two.js'], + sourceRoot: 'http://example.com/www/js/', + mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' +}; + +var smc = new SourceMapConsumer(rawSourceMap); + +console.log(smc.sources); +// [ 'http://example.com/www/js/one.js', +// 'http://example.com/www/js/two.js' ] + +console.log(smc.originalPositionFor({ + line: 2, + column: 28 +})); +// { source: 'http://example.com/www/js/two.js', +// line: 2, +// column: 10, +// name: 'n' } + +console.log(smc.generatedPositionFor({ + source: 'http://example.com/www/js/two.js', + line: 2, + column: 10 +})); +// { line: 2, column: 28 } + +smc.eachMapping(function (m) { + // ... +}); +``` + +### Generating a source map + +In depth guide: +[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) + +#### With SourceNode (high level API) + +```js +function compile(ast) { + switch (ast.type) { + case 'BinaryExpression': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + [compile(ast.left), " + ", compile(ast.right)] + ); + case 'Literal': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + String(ast.value) + ); + // ... + default: + throw new Error("Bad AST"); + } +} + +var ast = parse("40 + 2", "add.js"); +console.log(compile(ast).toStringWithSourceMap({ + file: 'add.js' +})); +// { code: '40 + 2', +// map: [object SourceMapGenerator] } +``` + +#### With SourceMapGenerator (low level API) + +```js +var map = new SourceMapGenerator({ + file: "source-mapped.js" +}); + +map.addMapping({ + generated: { + line: 10, + column: 35 + }, + source: "foo.js", + original: { + line: 33, + column: 2 + }, + name: "christopher" +}); + +console.log(map.toString()); +// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' +``` + +## API + +Get a reference to the module: + +```js +// Node.js +var sourceMap = require('source-map'); + +// Browser builds +var sourceMap = window.sourceMap; + +// Inside Firefox +const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); +``` + +### SourceMapConsumer + +A SourceMapConsumer instance represents a parsed source map which we can query +for information about the original file positions by giving it a file position +in the generated source. + +#### new SourceMapConsumer(rawSourceMap) + +The only parameter is the raw source map (either as a string which can be +`JSON.parse`'d, or an object). According to the spec, source maps have the +following attributes: + +* `version`: Which version of the source map spec this map is following. + +* `sources`: An array of URLs to the original source files. + +* `names`: An array of identifiers which can be referenced by individual + mappings. + +* `sourceRoot`: Optional. The URL root from which all sources are relative. + +* `sourcesContent`: Optional. An array of contents of the original source files. + +* `mappings`: A string of base64 VLQs which contain the actual mappings. + +* `file`: Optional. The generated filename this source map is associated with. + +```js +var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); +``` + +#### SourceMapConsumer.prototype.computeColumnSpans() + +Compute the last column for each generated mapping. The last column is +inclusive. + +```js +// Before: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] + +consumer.computeColumnSpans(); + +// After: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1, +// lastColumn: 9 }, +// { line: 2, +// column: 10, +// lastColumn: 19 }, +// { line: 2, +// column: 20, +// lastColumn: Infinity } ] + +``` + +#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) + +Returns the original source, line, and column information for the generated +source's line and column positions provided. The only argument is an object with +the following properties: + +* `line`: The line number in the generated source. Line numbers in + this library are 1-based (note that the underlying source map + specification uses 0-based line numbers -- this library handles the + translation). + +* `column`: The column number in the generated source. Column numbers + in this library are 0-based. + +* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or + `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest + element that is smaller than or greater than the one we are searching for, + respectively, if the exact element cannot be found. Defaults to + `SourceMapConsumer.GREATEST_LOWER_BOUND`. + +and an object is returned with the following properties: + +* `source`: The original source file, or null if this information is not + available. + +* `line`: The line number in the original source, or null if this information is + not available. The line number is 1-based. + +* `column`: The column number in the original source, or null if this + information is not available. The column number is 0-based. + +* `name`: The original identifier, or null if this information is not available. + +```js +consumer.originalPositionFor({ line: 2, column: 10 }) +// { source: 'foo.coffee', +// line: 2, +// column: 2, +// name: null } + +consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) +// { source: null, +// line: null, +// column: null, +// name: null } +``` + +#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) + +Returns the generated line and column information for the original source, +line, and column positions provided. The only argument is an object with +the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. The line number is + 1-based. + +* `column`: The column number in the original source. The column + number is 0-based. + +and an object is returned with the following properties: + +* `line`: The line number in the generated source, or null. The line + number is 1-based. + +* `column`: The column number in the generated source, or null. The + column number is 0-based. + +```js +consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) +// { line: 1, +// column: 56 } +``` + +#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) + +Returns all generated line and column information for the original source, line, +and column provided. If no column is provided, returns all mappings +corresponding to a either the line we are searching for or the next closest line +that has any mappings. Otherwise, returns all mappings corresponding to the +given line and either the column we are searching for or the next closest column +that has any offsets. + +The only argument is an object with the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. The line number is + 1-based. + +* `column`: Optional. The column number in the original source. The + column number is 0-based. + +and an array of objects is returned, each with the following properties: + +* `line`: The line number in the generated source, or null. The line + number is 1-based. + +* `column`: The column number in the generated source, or null. The + column number is 0-based. + +```js +consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] +``` + +#### SourceMapConsumer.prototype.hasContentsOfAllSources() + +Return true if we have the embedded source content for every source listed in +the source map, false otherwise. + +In other words, if this method returns `true`, then +`consumer.sourceContentFor(s)` will succeed for every source `s` in +`consumer.sources`. + +```js +// ... +if (consumer.hasContentsOfAllSources()) { + consumerReadyCallback(consumer); +} else { + fetchSources(consumer, consumerReadyCallback); +} +// ... +``` + +#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) + +Returns the original source content for the source provided. The only +argument is the URL of the original source file. + +If the source content for the given source is not found, then an error is +thrown. Optionally, pass `true` as the second param to have `null` returned +instead. + +```js +consumer.sources +// [ "my-cool-lib.clj" ] + +consumer.sourceContentFor("my-cool-lib.clj") +// "..." + +consumer.sourceContentFor("this is not in the source map"); +// Error: "this is not in the source map" is not in the source map + +consumer.sourceContentFor("this is not in the source map", true); +// null +``` + +#### SourceMapConsumer.prototype.eachMapping(callback, context, order) + +Iterate over each mapping between an original source/line/column and a +generated line/column in this source map. + +* `callback`: The function that is called with each mapping. Mappings have the + form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, + name }` + +* `context`: Optional. If specified, this object will be the value of `this` + every time that `callback` is called. + +* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or + `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over + the mappings sorted by the generated file's line/column order or the + original's source/line/column order, respectively. Defaults to + `SourceMapConsumer.GENERATED_ORDER`. + +```js +consumer.eachMapping(function (m) { console.log(m); }) +// ... +// { source: 'illmatic.js', +// generatedLine: 1, +// generatedColumn: 0, +// originalLine: 1, +// originalColumn: 0, +// name: null } +// { source: 'illmatic.js', +// generatedLine: 2, +// generatedColumn: 0, +// originalLine: 2, +// originalColumn: 0, +// name: null } +// ... +``` +### SourceMapGenerator + +An instance of the SourceMapGenerator represents a source map which is being +built incrementally. + +#### new SourceMapGenerator([startOfSourceMap]) + +You may pass an object with the following properties: + +* `file`: The filename of the generated source that this source map is + associated with. + +* `sourceRoot`: A root for all relative URLs in this source map. + +* `skipValidation`: Optional. When `true`, disables validation of mappings as + they are added. This can improve performance but should be used with + discretion, as a last resort. Even then, one should avoid using this flag when + running tests, if possible. + +```js +var generator = new sourceMap.SourceMapGenerator({ + file: "my-generated-javascript-file.js", + sourceRoot: "http://example.com/app/js/" +}); +``` + +#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) + +Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. + +* `sourceMapConsumer` The SourceMap. + +```js +var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer); +``` + +#### SourceMapGenerator.prototype.addMapping(mapping) + +Add a single mapping from original source line and column to the generated +source's line and column for this source map being created. The mapping object +should have the following properties: + +* `generated`: An object with the generated line and column positions. + +* `original`: An object with the original line and column positions. + +* `source`: The original source file (relative to the sourceRoot). + +* `name`: An optional original token name for this mapping. + +```js +generator.addMapping({ + source: "module-one.scm", + original: { line: 128, column: 0 }, + generated: { line: 3, column: 456 } +}) +``` + +#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for an original source file. + +* `sourceFile` the URL of the original source file. + +* `sourceContent` the content of the source file. + +```js +generator.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) + +Applies a SourceMap for a source file to the SourceMap. +Each mapping to the supplied source file is rewritten using the +supplied SourceMap. Note: The resolution for the resulting mappings +is the minimum of this map and the supplied map. + +* `sourceMapConsumer`: The SourceMap to be applied. + +* `sourceFile`: Optional. The filename of the source file. + If omitted, sourceMapConsumer.file will be used, if it exists. + Otherwise an error will be thrown. + +* `sourceMapPath`: Optional. The dirname of the path to the SourceMap + to be applied. If relative, it is relative to the SourceMap. + + This parameter is needed when the two SourceMaps aren't in the same + directory, and the SourceMap to be applied contains relative source + paths. If so, those relative source paths need to be rewritten + relative to the SourceMap. + + If omitted, it is assumed that both SourceMaps are in the same directory, + thus not needing any rewriting. (Supplying `'.'` has the same effect.) + +#### SourceMapGenerator.prototype.toString() + +Renders the source map being generated to a string. + +```js +generator.toString() +// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' +``` + +### SourceNode + +SourceNodes provide a way to abstract over interpolating and/or concatenating +snippets of generated JavaScript source code, while maintaining the line and +column information associated between those snippets and the original source +code. This is useful as the final intermediate representation a compiler might +use before outputting the generated JS and source map. + +#### new SourceNode([line, column, source[, chunk[, name]]]) + +* `line`: The original line number associated with this source node, or null if + it isn't associated with an original line. The line number is 1-based. + +* `column`: The original column number associated with this source node, or null + if it isn't associated with an original column. The column number + is 0-based. + +* `source`: The original source's filename; null if no filename is provided. + +* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see + below. + +* `name`: Optional. The original identifier. + +```js +var node = new SourceNode(1, 2, "a.cpp", [ + new SourceNode(3, 4, "b.cpp", "extern int status;\n"), + new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), + new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), +]); +``` + +#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) + +Creates a SourceNode from generated code and a SourceMapConsumer. + +* `code`: The generated code + +* `sourceMapConsumer` The SourceMap for the generated code + +* `relativePath` The optional path that relative sources in `sourceMapConsumer` + should be relative to. + +```js +var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); +var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), + consumer); +``` + +#### SourceNode.prototype.add(chunk) + +Add a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.add(" + "); +node.add(otherNode); +node.add([leftHandOperandNode, " + ", rightHandOperandNode]); +``` + +#### SourceNode.prototype.prepend(chunk) + +Prepend a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.prepend("/** Build Id: f783haef86324gf **/\n\n"); +``` + +#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for a source file. This will be added to the +`SourceMap` in the `sourcesContent` field. + +* `sourceFile`: The filename of the source file + +* `sourceContent`: The content of the source file + +```js +node.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceNode.prototype.walk(fn) + +Walk over the tree of JS snippets in this node and its children. The walking +function is called once for each snippet of JS and is passed that snippet and +the its original associated source's line/column location. + +* `fn`: The traversal function. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.walk(function (code, loc) { console.log("WALK:", code, loc); }) +// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } +// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } +// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } +// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } +``` + +#### SourceNode.prototype.walkSourceContents(fn) + +Walk over the tree of SourceNodes. The walking function is called for each +source file content and is passed the filename and source content. + +* `fn`: The traversal function. + +```js +var a = new SourceNode(1, 2, "a.js", "generated from a"); +a.setSourceContent("a.js", "original a"); +var b = new SourceNode(1, 2, "b.js", "generated from b"); +b.setSourceContent("b.js", "original b"); +var c = new SourceNode(1, 2, "c.js", "generated from c"); +c.setSourceContent("c.js", "original c"); + +var node = new SourceNode(null, null, null, [a, b, c]); +node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) +// WALK: a.js : original a +// WALK: b.js : original b +// WALK: c.js : original c +``` + +#### SourceNode.prototype.join(sep) + +Like `Array.prototype.join` except for SourceNodes. Inserts the separator +between each of this source node's children. + +* `sep`: The separator. + +```js +var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); +var operand = new SourceNode(3, 4, "a.rs", "="); +var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); + +var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); +var joinedNode = node.join(" "); +``` + +#### SourceNode.prototype.replaceRight(pattern, replacement) + +Call `String.prototype.replace` on the very right-most source snippet. Useful +for trimming white space from the end of a source node, etc. + +* `pattern`: The pattern to replace. + +* `replacement`: The thing to replace the pattern with. + +```js +// Trim trailing white space. +node.replaceRight(/\s*$/, ""); +``` + +#### SourceNode.prototype.toString() + +Return the string representation of this source node. Walks over the tree and +concatenates all the various snippets together to one string. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toString() +// 'unodostresquatro' +``` + +#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) + +Returns the string representation of this tree of source nodes, plus a +SourceMapGenerator which contains all the mappings between the generated and +original sources. + +The arguments are the same as those to `new SourceMapGenerator`. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toStringWithSourceMap({ file: "my-output-file.js" }) +// { code: 'unodostresquatro', +// map: [object SourceMapGenerator] } +``` diff --git a/node_modules/source-map-js/lib/array-set.js b/node_modules/source-map-js/lib/array-set.js new file mode 100644 index 000000000..fbd5c81ca --- /dev/null +++ b/node_modules/source-map-js/lib/array-set.js @@ -0,0 +1,121 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var has = Object.prototype.hasOwnProperty; +var hasNativeMap = typeof Map !== "undefined"; + +/** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ +function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); +} + +/** + * Static method for creating ArraySet instances from an existing array. + */ +ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; +}; + +/** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ +ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; +}; + +/** + * Add the given string to this set. + * + * @param String aStr + */ +ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } +}; + +/** + * Is the given string a member of this set? + * + * @param String aStr + */ +ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } +}; + +/** + * What is the index of the given string in the array? + * + * @param String aStr + */ +ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); +}; + +/** + * What is the element at the given index? + * + * @param Number aIdx + */ +ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); +}; + +/** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ +ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); +}; + +exports.ArraySet = ArraySet; diff --git a/node_modules/source-map-js/lib/base64-vlq.js b/node_modules/source-map-js/lib/base64-vlq.js new file mode 100644 index 000000000..612b40401 --- /dev/null +++ b/node_modules/source-map-js/lib/base64-vlq.js @@ -0,0 +1,140 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +var base64 = require('./base64'); + +// A single base 64 digit can contain 6 bits of data. For the base 64 variable +// length quantities we use in the source map spec, the first bit is the sign, +// the next four bits are the actual value, and the 6th bit is the +// continuation bit. The continuation bit tells us whether there are more +// digits in this value following this digit. +// +// Continuation +// | Sign +// | | +// V V +// 101011 + +var VLQ_BASE_SHIFT = 5; + +// binary: 100000 +var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + +// binary: 011111 +var VLQ_BASE_MASK = VLQ_BASE - 1; + +// binary: 100000 +var VLQ_CONTINUATION_BIT = VLQ_BASE; + +/** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ +function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; +} + +/** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ +function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; +} + +/** + * Returns the base 64 VLQ encoded value. + */ +exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; +}; + +/** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ +exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; +}; diff --git a/node_modules/source-map-js/lib/base64.js b/node_modules/source-map-js/lib/base64.js new file mode 100644 index 000000000..8aa86b302 --- /dev/null +++ b/node_modules/source-map-js/lib/base64.js @@ -0,0 +1,67 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + +/** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ +exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); +}; + +/** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ +exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; +}; diff --git a/node_modules/source-map-js/lib/binary-search.js b/node_modules/source-map-js/lib/binary-search.js new file mode 100644 index 000000000..010ac941e --- /dev/null +++ b/node_modules/source-map-js/lib/binary-search.js @@ -0,0 +1,111 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +exports.GREATEST_LOWER_BOUND = 1; +exports.LEAST_UPPER_BOUND = 2; + +/** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ +function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } +} + +/** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ +exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; +}; diff --git a/node_modules/source-map-js/lib/mapping-list.js b/node_modules/source-map-js/lib/mapping-list.js new file mode 100644 index 000000000..06d1274a0 --- /dev/null +++ b/node_modules/source-map-js/lib/mapping-list.js @@ -0,0 +1,79 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); + +/** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ +function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; +} + +/** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ +function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; +} + +/** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ +MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + +/** + * Add the given source mapping. + * + * @param Object aMapping + */ +MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } +}; + +/** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ +MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; +}; + +exports.MappingList = MappingList; diff --git a/node_modules/source-map-js/lib/quick-sort.js b/node_modules/source-map-js/lib/quick-sort.js new file mode 100644 index 000000000..23f9eda57 --- /dev/null +++ b/node_modules/source-map-js/lib/quick-sort.js @@ -0,0 +1,132 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +// It turns out that some (most?) JavaScript engines don't self-host +// `Array.prototype.sort`. This makes sense because C++ will likely remain +// faster than JS when doing raw CPU-intensive sorting. However, when using a +// custom comparator function, calling back and forth between the VM's C++ and +// JIT'd JS is rather slow *and* loses JIT type information, resulting in +// worse generated code for the comparator function than would be optimal. In +// fact, when sorting with a comparator, these costs outweigh the benefits of +// sorting in C++. By using our own JS-implemented Quick Sort (below), we get +// a ~3500ms mean speed-up in `bench/bench.html`. + +function SortTemplate(comparator) { + +/** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ +function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; +} + +/** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ +function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); +} + +/** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ +function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot, false) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } +} + + return doQuickSort; +} + +function cloneSort(comparator) { + let template = SortTemplate.toString(); + let templateFn = new Function(`return ${template}`)(); + return templateFn(comparator); +} + +/** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + +let sortCache = new WeakMap(); +exports.quickSort = function (ary, comparator, start = 0) { + let doQuickSort = sortCache.get(comparator); + if (doQuickSort === void 0) { + doQuickSort = cloneSort(comparator); + sortCache.set(comparator, doQuickSort); + } + doQuickSort(ary, comparator, start, ary.length - 1); +}; diff --git a/node_modules/source-map-js/lib/source-map-consumer.js b/node_modules/source-map-js/lib/source-map-consumer.js new file mode 100644 index 000000000..4bd7a4a5d --- /dev/null +++ b/node_modules/source-map-js/lib/source-map-consumer.js @@ -0,0 +1,1184 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var binarySearch = require('./binary-search'); +var ArraySet = require('./array-set').ArraySet; +var base64VLQ = require('./base64-vlq'); +var quickSort = require('./quick-sort').quickSort; + +function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); +} + +SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); +} + +/** + * The version of the source mapping spec that we are consuming. + */ +SourceMapConsumer.prototype._version = 3; + +// `__generatedMappings` and `__originalMappings` are arrays that hold the +// parsed mapping coordinates from the source map's "mappings" attribute. They +// are lazily instantiated, accessed via the `_generatedMappings` and +// `_originalMappings` getters respectively, and we only parse the mappings +// and create these arrays once queried for a source location. We jump through +// these hoops because there can be many thousands of mappings, and parsing +// them is expensive, so we only want to do it if we must. +// +// Each object in the arrays is of the form: +// +// { +// generatedLine: The line number in the generated code, +// generatedColumn: The column number in the generated code, +// source: The path to the original source file that generated this +// chunk of code, +// originalLine: The line number in the original source that +// corresponds to this chunk of generated code, +// originalColumn: The column number in the original source that +// corresponds to this chunk of generated code, +// name: The name of the original symbol which generated this chunk of +// code. +// } +// +// All properties except for `generatedLine` and `generatedColumn` can be +// `null`. +// +// `_generatedMappings` is ordered by the generated positions. +// +// `_originalMappings` is ordered by the original positions. + +SourceMapConsumer.prototype.__generatedMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } +}); + +SourceMapConsumer.prototype.__originalMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } +}); + +SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + +SourceMapConsumer.GENERATED_ORDER = 1; +SourceMapConsumer.ORIGINAL_ORDER = 2; + +SourceMapConsumer.GREATEST_LOWER_BOUND = 1; +SourceMapConsumer.LEAST_UPPER_BOUND = 2; + +/** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ +SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + var boundCallback = aCallback.bind(context); + var names = this._names; + var sources = this._sources; + var sourceMapURL = this._sourceMapURL; + + for (var i = 0, n = mappings.length; i < n; i++) { + var mapping = mappings[i]; + var source = mapping.source === null ? null : sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, sourceMapURL); + boundCallback({ + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : names.at(mapping.name) + }); + } + }; + +/** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + +exports.SourceMapConsumer = SourceMapConsumer; + +/** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ +function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; +} + +BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + +/** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ +BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; +}; + +/** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ +BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + +/** + * The version of the source mapping spec that we are consuming. + */ +BasicSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } +}); + +/** + * Provide the JIT with a nice shape / hidden class. + */ +function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; +} + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + +const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine; +function sortGenerated(array, start) { + let l = array.length; + let n = array.length - start; + if (n <= 1) { + return; + } else if (n == 2) { + let a = array[start]; + let b = array[start + 1]; + if (compareGenerated(a, b) > 0) { + array[start] = b; + array[start + 1] = a; + } + } else if (n < 20) { + for (let i = start; i < l; i++) { + for (let j = i; j > start; j--) { + let a = array[j - 1]; + let b = array[j]; + if (compareGenerated(a, b) <= 0) { + break; + } + array[j - 1] = b; + array[j] = a; + } + } + } else { + quickSort(array, compareGenerated, start); + } +} +BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + let subarrayStart = 0; + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + + sortGenerated(generatedMappings, subarrayStart); + subarrayStart = generatedMappings.length; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + let currentSource = mapping.source; + while (originalMappings.length <= currentSource) { + originalMappings.push(null); + } + if (originalMappings[currentSource] === null) { + originalMappings[currentSource] = []; + } + originalMappings[currentSource].push(mapping); + } + } + } + + sortGenerated(generatedMappings, subarrayStart); + this.__generatedMappings = generatedMappings; + + for (var i = 0; i < originalMappings.length; i++) { + if (originalMappings[i] != null) { + quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource); + } + } + this.__originalMappings = [].concat(...originalMappings); + }; + +/** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ +BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + +/** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ +BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + +exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + +/** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ +function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); +} + +IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + +/** + * The version of the source mapping spec that we are consuming. + */ +IndexedSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } +}); + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + +exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/node_modules/source-map-js/lib/source-map-generator.js b/node_modules/source-map-js/lib/source-map-generator.js new file mode 100644 index 000000000..508bcfbbc --- /dev/null +++ b/node_modules/source-map-js/lib/source-map-generator.js @@ -0,0 +1,425 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var base64VLQ = require('./base64-vlq'); +var util = require('./util'); +var ArraySet = require('./array-set').ArraySet; +var MappingList = require('./mapping-list').MappingList; + +/** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ +function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; +} + +SourceMapGenerator.prototype._version = 3; + +/** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ +SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + +/** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ +SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + +/** + * Set the source content for a source file. + */ +SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + +/** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ +SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + +/** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ +SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + +/** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ +SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + +SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + +/** + * Externalize the source map. + */ +SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + +/** + * Render the source map being generated to a string. + */ +SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + +exports.SourceMapGenerator = SourceMapGenerator; diff --git a/node_modules/source-map-js/lib/source-node.js b/node_modules/source-map-js/lib/source-node.js new file mode 100644 index 000000000..8bcdbe385 --- /dev/null +++ b/node_modules/source-map-js/lib/source-node.js @@ -0,0 +1,413 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; +var util = require('./util'); + +// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other +// operating systems these days (capturing the result). +var REGEX_NEWLINE = /(\r?\n)/; + +// Newline character code for charCodeAt() comparisons +var NEWLINE_CODE = 10; + +// Private symbol for identifying `SourceNode`s when multiple versions of +// the source-map library are loaded. This MUST NOT CHANGE across +// versions! +var isSourceNode = "$$$isSourceNode$$$"; + +/** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ +function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); +} + +/** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ +SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + +/** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } +}; + +/** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ +SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; +}; + +/** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ +SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; +}; + +/** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ +SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + +/** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + +/** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ +SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; +}; + +/** + * Returns the string representation of this source node along with a source + * map. + */ +SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; +}; + +exports.SourceNode = SourceNode; diff --git a/node_modules/source-map-js/lib/util.js b/node_modules/source-map-js/lib/util.js new file mode 100644 index 000000000..430e2d0ff --- /dev/null +++ b/node_modules/source-map-js/lib/util.js @@ -0,0 +1,594 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +/** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ +function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } +} +exports.getArg = getArg; + +var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; +var dataUrlRegexp = /^data:.+\,.+$/; + +function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; +} +exports.urlParse = urlParse; + +function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; +} +exports.urlGenerate = urlGenerate; + +var MAX_CACHED_INPUTS = 32; + +/** + * Takes some function `f(input) -> result` and returns a memoized version of + * `f`. + * + * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The + * memoization is a dumb-simple, linear least-recently-used cache. + */ +function lruMemoize(f) { + var cache = []; + + return function(input) { + for (var i = 0; i < cache.length; i++) { + if (cache[i].input === input) { + var temp = cache[0]; + cache[0] = cache[i]; + cache[i] = temp; + return cache[0].result; + } + } + + var result = f(input); + + cache.unshift({ + input, + result, + }); + + if (cache.length > MAX_CACHED_INPUTS) { + cache.pop(); + } + + return result; + }; +} + +/** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ +var normalize = lruMemoize(function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + // Split the path into parts between `/` characters. This is much faster than + // using `.split(/\/+/g)`. + var parts = []; + var start = 0; + var i = 0; + while (true) { + start = i; + i = path.indexOf("/", start); + if (i === -1) { + parts.push(path.slice(start)); + break; + } else { + parts.push(path.slice(start, i)); + while (i < path.length && path[i] === "/") { + i++; + } + } + } + + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; +}); +exports.normalize = normalize; + +/** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ +function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; +} +exports.join = join; + +exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); +}; + +/** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ +function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); +} +exports.relative = relative; + +var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); +}()); + +function identity (s) { + return s; +} + +/** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ +function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; +} +exports.toSetString = supportsNullProto ? identity : toSetString; + +function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; +} +exports.fromSetString = supportsNullProto ? identity : fromSetString; + +function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; +} + +/** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ +function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByOriginalPositions = compareByOriginalPositions; + +function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) { + var cmp + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource; + +/** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ +function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + +function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine; + +function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; +} + +/** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ +function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + +/** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ +function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); +} +exports.parseSourceMapInput = parseSourceMapInput; + +/** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ +function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); +} +exports.computeSourceURL = computeSourceURL; diff --git a/node_modules/source-map-js/package.json b/node_modules/source-map-js/package.json new file mode 100644 index 000000000..501fafe16 --- /dev/null +++ b/node_modules/source-map-js/package.json @@ -0,0 +1,71 @@ +{ + "name": "source-map-js", + "description": "Generates and consumes source maps", + "version": "1.0.2", + "homepage": "https://github.com/7rulnik/source-map-js", + "author": "Valentin 7rulnik Semirulnik ", + "contributors": [ + "Nick Fitzgerald ", + "Tobias Koppers ", + "Duncan Beevers ", + "Stephen Crane ", + "Ryan Seddon ", + "Miles Elam ", + "Mihai Bazon ", + "Michael Ficarra ", + "Todd Wolfson ", + "Alexander Solovyov ", + "Felix Gnass ", + "Conrad Irwin ", + "usrbincc ", + "David Glasser ", + "Chase Douglas ", + "Evan Wallace ", + "Heather Arthur ", + "Hugh Kennedy ", + "David Glasser ", + "Simon Lydell ", + "Jmeas Smith ", + "Michael Z Goddard ", + "azu ", + "John Gozde ", + "Adam Kirkton ", + "Chris Montgomery ", + "J. Ryan Stinnett ", + "Jack Herrington ", + "Chris Truter ", + "Daniel Espeset ", + "Jamie Wong ", + "Eddy Bruël ", + "Hawken Rives ", + "Gilad Peleg ", + "djchie ", + "Gary Ye ", + "Nicolas Lalevée " + ], + "repository": "7rulnik/source-map-js", + "main": "./source-map.js", + "files": [ + "source-map.js", + "source-map.d.ts", + "lib/" + ], + "engines": { + "node": ">=0.10.0" + }, + "license": "BSD-3-Clause", + "scripts": { + "test": "npm run build && node test/run-tests.js", + "build": "webpack --color", + "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" + }, + "devDependencies": { + "clean-publish": "^3.1.0", + "doctoc": "^0.15.0", + "webpack": "^1.12.0" + }, + "clean-publish": { + "cleanDocs": true + }, + "typings": "source-map.d.ts" +} diff --git a/node_modules/source-map-js/source-map.d.ts b/node_modules/source-map-js/source-map.d.ts new file mode 100644 index 000000000..9f8a4b383 --- /dev/null +++ b/node_modules/source-map-js/source-map.d.ts @@ -0,0 +1,115 @@ +declare module 'source-map-js' { + export interface StartOfSourceMap { + file?: string; + sourceRoot?: string; + } + + export interface RawSourceMap extends StartOfSourceMap { + version: string; + sources: string[]; + names: string[]; + sourcesContent?: string[]; + mappings: string; + } + + export interface Position { + line: number; + column: number; + } + + export interface LineRange extends Position { + lastColumn: number; + } + + export interface FindPosition extends Position { + // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND + bias?: number; + } + + export interface SourceFindPosition extends FindPosition { + source: string; + } + + export interface MappedPosition extends Position { + source: string; + name?: string; + } + + export interface MappingItem { + source: string; + generatedLine: number; + generatedColumn: number; + originalLine: number; + originalColumn: number; + name: string; + } + + export class SourceMapConsumer { + static GENERATED_ORDER: number; + static ORIGINAL_ORDER: number; + + static GREATEST_LOWER_BOUND: number; + static LEAST_UPPER_BOUND: number; + + constructor(rawSourceMap: RawSourceMap); + computeColumnSpans(): void; + originalPositionFor(generatedPosition: FindPosition): MappedPosition; + generatedPositionFor(originalPosition: SourceFindPosition): LineRange; + allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; + hasContentsOfAllSources(): boolean; + sourceContentFor(source: string, returnNullOnMissing?: boolean): string; + eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; + } + + export interface Mapping { + generated: Position; + original: Position; + source: string; + name?: string; + } + + export class SourceMapGenerator { + constructor(startOfSourceMap?: StartOfSourceMap); + static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator; + addMapping(mapping: Mapping): void; + setSourceContent(sourceFile: string, sourceContent: string): void; + applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; + toString(): string; + } + + export interface CodeWithSourceMap { + code: string; + map: SourceMapGenerator; + } + + export class SourceNode { + constructor(); + constructor(line: number, column: number, source: string); + constructor(line: number, column: number, source: string, chunk?: string, name?: string); + static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; + add(chunk: string): void; + prepend(chunk: string): void; + setSourceContent(sourceFile: string, sourceContent: string): void; + walk(fn: (chunk: string, mapping: MappedPosition) => void): void; + walkSourceContents(fn: (file: string, content: string) => void): void; + join(sep: string): SourceNode; + replaceRight(pattern: string, replacement: string): SourceNode; + toString(): string; + toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; + } +} + +declare module 'source-map-js/lib/source-map-generator' { + import { SourceMapGenerator } from 'source-map-js' + export { SourceMapGenerator } +} + +declare module 'source-map-js/lib/source-map-consumer' { + import { SourceMapConsumer } from 'source-map-js' + export { SourceMapConsumer } +} + +declare module 'source-map-js/lib/source-node' { + import { SourceNode } from 'source-map-js' + export { SourceNode } +} diff --git a/node_modules/source-map-js/source-map.js b/node_modules/source-map-js/source-map.js new file mode 100644 index 000000000..bc88fe820 --- /dev/null +++ b/node_modules/source-map-js/source-map.js @@ -0,0 +1,8 @@ +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ +exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; +exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; +exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/node_modules/spdx-correct/LICENSE b/node_modules/spdx-correct/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/node_modules/spdx-correct/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/spdx-correct/README.md b/node_modules/spdx-correct/README.md new file mode 100644 index 000000000..af563d865 --- /dev/null +++ b/node_modules/spdx-correct/README.md @@ -0,0 +1,22 @@ +## Usage + +```javascript +var correct = require('spdx-correct') +var assert = require('assert') + +assert.strictEqual(correct('mit'), 'MIT') + +assert.strictEqual(correct('Apache 2'), 'Apache-2.0') + +assert(correct('No idea what license') === null) + +// disable upgrade option +assert(correct('GPL-3.0'), 'GPL-3.0-or-later') +assert(correct('GPL-3.0', { upgrade: false }), 'GPL-3.0') +``` + +## Contributors + +spdx-correct has benefited from the work of several contributors. +See [the GitHub repository](https://github.com/jslicense/spdx-correct.js/graphs/contributors) +for more information. diff --git a/node_modules/spdx-correct/index.js b/node_modules/spdx-correct/index.js new file mode 100644 index 000000000..4d9037e0c --- /dev/null +++ b/node_modules/spdx-correct/index.js @@ -0,0 +1,386 @@ +/* +Copyright spdx-correct.js contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +var parse = require('spdx-expression-parse') +var spdxLicenseIds = require('spdx-license-ids') + +function valid (string) { + try { + parse(string) + return true + } catch (error) { + return false + } +} + +// Sorting function that orders the given array of transpositions such +// that a transposition with the longer pattern comes before a transposition +// with a shorter pattern. This is to prevent e.g. the transposition +// ["General Public License", "GPL"] from matching to "Lesser General Public License" +// before a longer and more accurate transposition ["Lesser General Public License", "LGPL"] +// has a chance to be recognized. +function sortTranspositions(a, b) { + var length = b[0].length - a[0].length + if (length !== 0) return length + return a[0].toUpperCase().localeCompare(b[0].toUpperCase()) +} + +// Common transpositions of license identifier acronyms +var transpositions = [ + ['APGL', 'AGPL'], + ['Gpl', 'GPL'], + ['GLP', 'GPL'], + ['APL', 'Apache'], + ['ISD', 'ISC'], + ['GLP', 'GPL'], + ['IST', 'ISC'], + ['Claude', 'Clause'], + [' or later', '+'], + [' International', ''], + ['GNU', 'GPL'], + ['GUN', 'GPL'], + ['+', ''], + ['GNU GPL', 'GPL'], + ['GNU LGPL', 'LGPL'], + ['GNU/GPL', 'GPL'], + ['GNU GLP', 'GPL'], + ['GNU LESSER GENERAL PUBLIC LICENSE', 'LGPL'], + ['GNU Lesser General Public License', 'LGPL'], + ['GNU LESSER GENERAL PUBLIC LICENSE', 'LGPL-2.1'], + ['GNU Lesser General Public License', 'LGPL-2.1'], + ['LESSER GENERAL PUBLIC LICENSE', 'LGPL'], + ['Lesser General Public License', 'LGPL'], + ['LESSER GENERAL PUBLIC LICENSE', 'LGPL-2.1'], + ['Lesser General Public License', 'LGPL-2.1'], + ['GNU General Public License', 'GPL'], + ['Gnu public license', 'GPL'], + ['GNU Public License', 'GPL'], + ['GNU GENERAL PUBLIC LICENSE', 'GPL'], + ['MTI', 'MIT'], + ['Mozilla Public License', 'MPL'], + ['Universal Permissive License', 'UPL'], + ['WTH', 'WTF'], + ['WTFGPL', 'WTFPL'], + ['-License', ''] +].sort(sortTranspositions) + +var TRANSPOSED = 0 +var CORRECT = 1 + +// Simple corrections to nearly valid identifiers. +var transforms = [ + // e.g. 'mit' + function (argument) { + return argument.toUpperCase() + }, + // e.g. 'MIT ' + function (argument) { + return argument.trim() + }, + // e.g. 'M.I.T.' + function (argument) { + return argument.replace(/\./g, '') + }, + // e.g. 'Apache- 2.0' + function (argument) { + return argument.replace(/\s+/g, '') + }, + // e.g. 'CC BY 4.0'' + function (argument) { + return argument.replace(/\s+/g, '-') + }, + // e.g. 'LGPLv2.1' + function (argument) { + return argument.replace('v', '-') + }, + // e.g. 'Apache 2.0' + function (argument) { + return argument.replace(/,?\s*(\d)/, '-$1') + }, + // e.g. 'GPL 2' + function (argument) { + return argument.replace(/,?\s*(\d)/, '-$1.0') + }, + // e.g. 'Apache Version 2.0' + function (argument) { + return argument + .replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2') + }, + // e.g. 'Apache Version 2' + function (argument) { + return argument + .replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2.0') + }, + // e.g. 'ZLIB' + function (argument) { + return argument[0].toUpperCase() + argument.slice(1) + }, + // e.g. 'MPL/2.0' + function (argument) { + return argument.replace('/', '-') + }, + // e.g. 'Apache 2' + function (argument) { + return argument + .replace(/\s*V\s*(\d)/, '-$1') + .replace(/(\d)$/, '$1.0') + }, + // e.g. 'GPL-2.0', 'GPL-3.0' + function (argument) { + if (argument.indexOf('3.0') !== -1) { + return argument + '-or-later' + } else { + return argument + '-only' + } + }, + // e.g. 'GPL-2.0-' + function (argument) { + return argument + 'only' + }, + // e.g. 'GPL2' + function (argument) { + return argument.replace(/(\d)$/, '-$1.0') + }, + // e.g. 'BSD 3' + function (argument) { + return argument.replace(/(-| )?(\d)$/, '-$2-Clause') + }, + // e.g. 'BSD clause 3' + function (argument) { + return argument.replace(/(-| )clause(-| )(\d)/, '-$3-Clause') + }, + // e.g. 'New BSD license' + function (argument) { + return argument.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i, 'BSD-3-Clause') + }, + // e.g. 'Simplified BSD license' + function (argument) { + return argument.replace(/\bSimplified(-| )?BSD((-| )License)?/i, 'BSD-2-Clause') + }, + // e.g. 'Free BSD license' + function (argument) { + return argument.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i, 'BSD-2-Clause-$1BSD') + }, + // e.g. 'Clear BSD license' + function (argument) { + return argument.replace(/\bClear(-| )?BSD((-| )License)?/i, 'BSD-3-Clause-Clear') + }, + // e.g. 'Old BSD License' + function (argument) { + return argument.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i, 'BSD-4-Clause') + }, + // e.g. 'BY-NC-4.0' + function (argument) { + return 'CC-' + argument + }, + // e.g. 'BY-NC' + function (argument) { + return 'CC-' + argument + '-4.0' + }, + // e.g. 'Attribution-NonCommercial' + function (argument) { + return argument + .replace('Attribution', 'BY') + .replace('NonCommercial', 'NC') + .replace('NoDerivatives', 'ND') + .replace(/ (\d)/, '-$1') + .replace(/ ?International/, '') + }, + // e.g. 'Attribution-NonCommercial' + function (argument) { + return 'CC-' + + argument + .replace('Attribution', 'BY') + .replace('NonCommercial', 'NC') + .replace('NoDerivatives', 'ND') + .replace(/ (\d)/, '-$1') + .replace(/ ?International/, '') + + '-4.0' + } +] + +var licensesWithVersions = spdxLicenseIds + .map(function (id) { + var match = /^(.*)-\d+\.\d+$/.exec(id) + return match + ? [match[0], match[1]] + : [id, null] + }) + .reduce(function (objectMap, item) { + var key = item[1] + objectMap[key] = objectMap[key] || [] + objectMap[key].push(item[0]) + return objectMap + }, {}) + +var licensesWithOneVersion = Object.keys(licensesWithVersions) + .map(function makeEntries (key) { + return [key, licensesWithVersions[key]] + }) + .filter(function identifySoleVersions (item) { + return ( + // Licenses has just one valid version suffix. + item[1].length === 1 && + item[0] !== null && + // APL will be considered Apache, rather than APL-1.0 + item[0] !== 'APL' + ) + }) + .map(function createLastResorts (item) { + return [item[0], item[1][0]] + }) + +licensesWithVersions = undefined + +// If all else fails, guess that strings containing certain substrings +// meant to identify certain licenses. +var lastResorts = [ + ['UNLI', 'Unlicense'], + ['WTF', 'WTFPL'], + ['2 CLAUSE', 'BSD-2-Clause'], + ['2-CLAUSE', 'BSD-2-Clause'], + ['3 CLAUSE', 'BSD-3-Clause'], + ['3-CLAUSE', 'BSD-3-Clause'], + ['AFFERO', 'AGPL-3.0-or-later'], + ['AGPL', 'AGPL-3.0-or-later'], + ['APACHE', 'Apache-2.0'], + ['ARTISTIC', 'Artistic-2.0'], + ['Affero', 'AGPL-3.0-or-later'], + ['BEER', 'Beerware'], + ['BOOST', 'BSL-1.0'], + ['BSD', 'BSD-2-Clause'], + ['CDDL', 'CDDL-1.1'], + ['ECLIPSE', 'EPL-1.0'], + ['FUCK', 'WTFPL'], + ['GNU', 'GPL-3.0-or-later'], + ['LGPL', 'LGPL-3.0-or-later'], + ['GPLV1', 'GPL-1.0-only'], + ['GPL-1', 'GPL-1.0-only'], + ['GPLV2', 'GPL-2.0-only'], + ['GPL-2', 'GPL-2.0-only'], + ['GPL', 'GPL-3.0-or-later'], + ['MIT +NO-FALSE-ATTRIBS', 'MITNFA'], + ['MIT', 'MIT'], + ['MPL', 'MPL-2.0'], + ['X11', 'X11'], + ['ZLIB', 'Zlib'] +].concat(licensesWithOneVersion).sort(sortTranspositions) + +var SUBSTRING = 0 +var IDENTIFIER = 1 + +var validTransformation = function (identifier) { + for (var i = 0; i < transforms.length; i++) { + var transformed = transforms[i](identifier).trim() + if (transformed !== identifier && valid(transformed)) { + return transformed + } + } + return null +} + +var validLastResort = function (identifier) { + var upperCased = identifier.toUpperCase() + for (var i = 0; i < lastResorts.length; i++) { + var lastResort = lastResorts[i] + if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) { + return lastResort[IDENTIFIER] + } + } + return null +} + +var anyCorrection = function (identifier, check) { + for (var i = 0; i < transpositions.length; i++) { + var transposition = transpositions[i] + var transposed = transposition[TRANSPOSED] + if (identifier.indexOf(transposed) > -1) { + var corrected = identifier.replace( + transposed, + transposition[CORRECT] + ) + var checked = check(corrected) + if (checked !== null) { + return checked + } + } + } + return null +} + +module.exports = function (identifier, options) { + options = options || {} + var upgrade = options.upgrade === undefined ? true : !!options.upgrade + function postprocess (value) { + return upgrade ? upgradeGPLs(value) : value + } + var validArugment = ( + typeof identifier === 'string' && + identifier.trim().length !== 0 + ) + if (!validArugment) { + throw Error('Invalid argument. Expected non-empty string.') + } + identifier = identifier.trim() + if (valid(identifier)) { + return postprocess(identifier) + } + var noPlus = identifier.replace(/\+$/, '').trim() + if (valid(noPlus)) { + return postprocess(noPlus) + } + var transformed = validTransformation(identifier) + if (transformed !== null) { + return postprocess(transformed) + } + transformed = anyCorrection(identifier, function (argument) { + if (valid(argument)) { + return argument + } + return validTransformation(argument) + }) + if (transformed !== null) { + return postprocess(transformed) + } + transformed = validLastResort(identifier) + if (transformed !== null) { + return postprocess(transformed) + } + transformed = anyCorrection(identifier, validLastResort) + if (transformed !== null) { + return postprocess(transformed) + } + return null +} + +function upgradeGPLs (value) { + if ([ + 'GPL-1.0', 'LGPL-1.0', 'AGPL-1.0', + 'GPL-2.0', 'LGPL-2.0', 'AGPL-2.0', + 'LGPL-2.1' + ].indexOf(value) !== -1) { + return value + '-only' + } else if ([ + 'GPL-1.0+', 'GPL-2.0+', 'GPL-3.0+', + 'LGPL-2.0+', 'LGPL-2.1+', 'LGPL-3.0+', + 'AGPL-1.0+', 'AGPL-3.0+' + ].indexOf(value) !== -1) { + return value.replace(/\+$/, '-or-later') + } else if (['GPL-3.0', 'LGPL-3.0', 'AGPL-3.0'].indexOf(value) !== -1) { + return value + '-or-later' + } else { + return value + } +} diff --git a/node_modules/spdx-correct/package.json b/node_modules/spdx-correct/package.json new file mode 100644 index 000000000..d77615638 --- /dev/null +++ b/node_modules/spdx-correct/package.json @@ -0,0 +1,32 @@ +{ + "name": "spdx-correct", + "description": "correct invalid SPDX expressions", + "version": "3.2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + }, + "devDependencies": { + "defence-cli": "^3.0.1", + "replace-require-self": "^1.0.0", + "standard": "^14.3.4", + "standard-markdown": "^6.0.0", + "tape": "^5.0.1" + }, + "files": [ + "index.js" + ], + "keywords": [ + "SPDX", + "law", + "legal", + "license", + "metadata" + ], + "license": "Apache-2.0", + "repository": "jslicense/spdx-correct.js", + "scripts": { + "lint": "standard && standard-markdown README.md", + "test": "defence README.md | replace-require-self | node && node test.js" + } +} diff --git a/node_modules/spdx-exceptions/README.md b/node_modules/spdx-exceptions/README.md new file mode 100644 index 000000000..6c927ecc6 --- /dev/null +++ b/node_modules/spdx-exceptions/README.md @@ -0,0 +1,36 @@ +The package exports an array of strings. Each string is an identifier +for a license exception under the [Software Package Data Exchange +(SPDX)][SPDX] software license metadata standard. + +[SPDX]: https://spdx.org + +## Copyright and Licensing + +### SPDX + +"SPDX" is a federally registered United States trademark of The Linux +Foundation Corporation. + +From version 2.0 of the [SPDX] specification: + +> Copyright © 2010-2015 Linux Foundation and its Contributors. Licensed +> under the Creative Commons Attribution License 3.0 Unported. All other +> rights are expressly reserved. + +The Linux Foundation and the SPDX working groups are good people. Only +they decide what "SPDX" means, as a standard and otherwise. I respect +their work and their rights. You should, too. + +### This Package + +> I created this package by copying exception identifiers out of the +> SPDX specification. That work was mechanical, routine, and required no +> creativity whatsoever. - Kyle Mitchell, package author + +United States users concerned about intellectual property may wish to +discuss the following Supreme Court decisions with their attorneys: + +- _Baker v. Selden_, 101 U.S. 99 (1879) + +- _Feist Publications, Inc., v. Rural Telephone Service Co._, + 499 U.S. 340 (1991) diff --git a/node_modules/spdx-exceptions/index.json b/node_modules/spdx-exceptions/index.json new file mode 100644 index 000000000..f88f088ab --- /dev/null +++ b/node_modules/spdx-exceptions/index.json @@ -0,0 +1,40 @@ +[ + "389-exception", + "Autoconf-exception-2.0", + "Autoconf-exception-3.0", + "Bison-exception-2.2", + "Bootloader-exception", + "Classpath-exception-2.0", + "CLISP-exception-2.0", + "DigiRule-FOSS-exception", + "eCos-exception-2.0", + "Fawkes-Runtime-exception", + "FLTK-exception", + "Font-exception-2.0", + "freertos-exception-2.0", + "GCC-exception-2.0", + "GCC-exception-3.1", + "gnu-javamail-exception", + "GPL-3.0-linking-exception", + "GPL-3.0-linking-source-exception", + "GPL-CC-1.0", + "i2p-gpl-java-exception", + "Libtool-exception", + "Linux-syscall-note", + "LLVM-exception", + "LZMA-exception", + "mif-exception", + "Nokia-Qt-exception-1.1", + "OCaml-LGPL-linking-exception", + "OCCT-exception-1.0", + "OpenJDK-assembly-exception-1.0", + "openvpn-openssl-exception", + "PS-or-PDF-font-exception-20170817", + "Qt-GPL-exception-1.0", + "Qt-LGPL-exception-1.1", + "Qwt-exception-1.0", + "Swift-exception", + "u-boot-exception-2.0", + "Universal-FOSS-exception-1.0", + "WxWindows-exception-3.1" +] diff --git a/node_modules/spdx-exceptions/package.json b/node_modules/spdx-exceptions/package.json new file mode 100644 index 000000000..2bafc6a38 --- /dev/null +++ b/node_modules/spdx-exceptions/package.json @@ -0,0 +1,17 @@ +{ + "name": "spdx-exceptions", + "description": "list of SPDX standard license exceptions", + "version": "2.3.0", + "author": "The Linux Foundation", + "contributors": [ + "Kyle E. Mitchell (https://kemitchell.com/)" + ], + "license": "CC-BY-3.0", + "repository": "kemitchell/spdx-exceptions.json", + "files": [ + "index.json" + ], + "scripts": { + "build": "node build.js" + } +} diff --git a/node_modules/spdx-expression-parse/AUTHORS b/node_modules/spdx-expression-parse/AUTHORS new file mode 100644 index 000000000..257a76b94 --- /dev/null +++ b/node_modules/spdx-expression-parse/AUTHORS @@ -0,0 +1,4 @@ +C. Scott Ananian (http://cscott.net) +Kyle E. Mitchell (https://kemitchell.com) +Shinnosuke Watanabe +Antoine Motet diff --git a/node_modules/spdx-expression-parse/LICENSE b/node_modules/spdx-expression-parse/LICENSE new file mode 100644 index 000000000..831618eab --- /dev/null +++ b/node_modules/spdx-expression-parse/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2015 Kyle E. Mitchell & other authors listed in AUTHORS + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/spdx-expression-parse/README.md b/node_modules/spdx-expression-parse/README.md new file mode 100644 index 000000000..9406462e3 --- /dev/null +++ b/node_modules/spdx-expression-parse/README.md @@ -0,0 +1,91 @@ +This package parses [SPDX license expression](https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60) strings describing license terms, like [package.json license strings](https://docs.npmjs.com/files/package.json#license), into consistently structured ECMAScript objects. The npm command-line interface depends on this package, as do many automatic license-audit tools. + +In a nutshell: + +```javascript +var parse = require('spdx-expression-parse') +var assert = require('assert') + +assert.deepEqual( + // Licensed under the terms of the Two-Clause BSD License. + parse('BSD-2-Clause'), + {license: 'BSD-2-Clause'} +) + +assert.throws(function () { + // An invalid SPDX license expression. + // Should be `Apache-2.0`. + parse('Apache 2') +}) + +assert.deepEqual( + // Dual licensed under either: + // - LGPL 2.1 + // - a combination of Three-Clause BSD and MIT + parse('(LGPL-2.1 OR BSD-3-Clause AND MIT)'), + { + left: {license: 'LGPL-2.1'}, + conjunction: 'or', + right: { + left: {license: 'BSD-3-Clause'}, + conjunction: 'and', + right: {license: 'MIT'} + } + } +) +``` + +The syntax comes from the [Software Package Data eXchange (SPDX)](https://spdx.org/), a standard from the [Linux Foundation](https://www.linuxfoundation.org) for shareable data about software package license terms. SPDX aims to make sharing and auditing license data easy, especially for users of open-source software. + +The bulk of the SPDX standard describes syntax and semantics of XML metadata files. This package implements two lightweight, plain-text components of that larger standard: + +1. The [license list](https://spdx.org/licenses), a mapping from specific string identifiers, like `Apache-2.0`, to standard form license texts and bolt-on license exceptions. The [spdx-license-ids](https://www.npmjs.com/package/spdx-license-ids) and [spdx-exceptions](https://www.npmjs.com/package/spdx-exceptions) packages implement the license list. `spdx-expression-parse` depends on and `require()`s them. + + Any license identifier from the license list is a valid license expression: + + ```javascript + var identifiers = [] + .concat(require('spdx-license-ids')) + .concat(require('spdx-license-ids/deprecated')) + + identifiers.forEach(function (id) { + assert.deepEqual(parse(id), {license: id}) + }) + ``` + + So is any license identifier `WITH` a standardized license exception: + + ```javascript + identifiers.forEach(function (id) { + require('spdx-exceptions').forEach(function (e) { + assert.deepEqual( + parse(id + ' WITH ' + e), + {license: id, exception: e} + ) + }) + }) + ``` + +2. The license expression language, for describing simple and complex license terms, like `MIT` for MIT-licensed and `(GPL-2.0 OR Apache-2.0)` for dual-licensing under GPL 2.0 and Apache 2.0. `spdx-expression-parse` itself implements license expression language, exporting a parser. + + ```javascript + assert.deepEqual( + // Licensed under a combination of: + // - the MIT License AND + // - a combination of: + // - LGPL 2.1 (or a later version) AND + // - Three-Clause BSD + parse('(MIT AND (LGPL-2.1+ AND BSD-3-Clause))'), + { + left: {license: 'MIT'}, + conjunction: 'and', + right: { + left: {license: 'LGPL-2.1', plus: true}, + conjunction: 'and', + right: {license: 'BSD-3-Clause'} + } + } + ) + ``` + +The Linux Foundation and its contributors license the SPDX standard under the terms of [the Creative Commons Attribution License 3.0 Unported (SPDX: "CC-BY-3.0")](http://spdx.org/licenses/CC-BY-3.0). "SPDX" is a United States federally registered trademark of the Linux Foundation. The authors of this package license their work under the terms of the MIT License. diff --git a/node_modules/spdx-expression-parse/index.js b/node_modules/spdx-expression-parse/index.js new file mode 100644 index 000000000..52fab560a --- /dev/null +++ b/node_modules/spdx-expression-parse/index.js @@ -0,0 +1,8 @@ +'use strict' + +var scan = require('./scan') +var parse = require('./parse') + +module.exports = function (source) { + return parse(scan(source)) +} diff --git a/node_modules/spdx-expression-parse/package.json b/node_modules/spdx-expression-parse/package.json new file mode 100644 index 000000000..c9edc9f93 --- /dev/null +++ b/node_modules/spdx-expression-parse/package.json @@ -0,0 +1,39 @@ +{ + "name": "spdx-expression-parse", + "description": "parse SPDX license expressions", + "version": "3.0.1", + "author": "Kyle E. Mitchell (https://kemitchell.com)", + "files": [ + "AUTHORS", + "index.js", + "parse.js", + "scan.js" + ], + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + }, + "devDependencies": { + "defence-cli": "^3.0.1", + "replace-require-self": "^1.0.0", + "standard": "^14.1.0" + }, + "keywords": [ + "SPDX", + "law", + "legal", + "license", + "metadata", + "package", + "package.json", + "standards" + ], + "license": "MIT", + "repository": "jslicense/spdx-expression-parse.js", + "scripts": { + "lint": "standard", + "test:readme": "defence -i javascript README.md | replace-require-self | node", + "test:suite": "node test.js", + "test": "npm run test:suite && npm run test:readme" + } +} diff --git a/node_modules/spdx-expression-parse/parse.js b/node_modules/spdx-expression-parse/parse.js new file mode 100644 index 000000000..5a00b45c5 --- /dev/null +++ b/node_modules/spdx-expression-parse/parse.js @@ -0,0 +1,138 @@ +'use strict' + +// The ABNF grammar in the spec is totally ambiguous. +// +// This parser follows the operator precedence defined in the +// `Order of Precedence and Parentheses` section. + +module.exports = function (tokens) { + var index = 0 + + function hasMore () { + return index < tokens.length + } + + function token () { + return hasMore() ? tokens[index] : null + } + + function next () { + if (!hasMore()) { + throw new Error() + } + index++ + } + + function parseOperator (operator) { + var t = token() + if (t && t.type === 'OPERATOR' && operator === t.string) { + next() + return t.string + } + } + + function parseWith () { + if (parseOperator('WITH')) { + var t = token() + if (t && t.type === 'EXCEPTION') { + next() + return t.string + } + throw new Error('Expected exception after `WITH`') + } + } + + function parseLicenseRef () { + // TODO: Actually, everything is concatenated into one string + // for backward-compatibility but it could be better to return + // a nice structure. + var begin = index + var string = '' + var t = token() + if (t.type === 'DOCUMENTREF') { + next() + string += 'DocumentRef-' + t.string + ':' + if (!parseOperator(':')) { + throw new Error('Expected `:` after `DocumentRef-...`') + } + } + t = token() + if (t.type === 'LICENSEREF') { + next() + string += 'LicenseRef-' + t.string + return { license: string } + } + index = begin + } + + function parseLicense () { + var t = token() + if (t && t.type === 'LICENSE') { + next() + var node = { license: t.string } + if (parseOperator('+')) { + node.plus = true + } + var exception = parseWith() + if (exception) { + node.exception = exception + } + return node + } + } + + function parseParenthesizedExpression () { + var left = parseOperator('(') + if (!left) { + return + } + + var expr = parseExpression() + + if (!parseOperator(')')) { + throw new Error('Expected `)`') + } + + return expr + } + + function parseAtom () { + return ( + parseParenthesizedExpression() || + parseLicenseRef() || + parseLicense() + ) + } + + function makeBinaryOpParser (operator, nextParser) { + return function parseBinaryOp () { + var left = nextParser() + if (!left) { + return + } + + if (!parseOperator(operator)) { + return left + } + + var right = parseBinaryOp() + if (!right) { + throw new Error('Expected expression') + } + return { + left: left, + conjunction: operator.toLowerCase(), + right: right + } + } + } + + var parseAnd = makeBinaryOpParser('AND', parseAtom) + var parseExpression = makeBinaryOpParser('OR', parseAnd) + + var node = parseExpression() + if (!node || hasMore()) { + throw new Error('Syntax error') + } + return node +} diff --git a/node_modules/spdx-expression-parse/scan.js b/node_modules/spdx-expression-parse/scan.js new file mode 100644 index 000000000..b74fce2e2 --- /dev/null +++ b/node_modules/spdx-expression-parse/scan.js @@ -0,0 +1,131 @@ +'use strict' + +var licenses = [] + .concat(require('spdx-license-ids')) + .concat(require('spdx-license-ids/deprecated')) +var exceptions = require('spdx-exceptions') + +module.exports = function (source) { + var index = 0 + + function hasMore () { + return index < source.length + } + + // `value` can be a regexp or a string. + // If it is recognized, the matching source string is returned and + // the index is incremented. Otherwise `undefined` is returned. + function read (value) { + if (value instanceof RegExp) { + var chars = source.slice(index) + var match = chars.match(value) + if (match) { + index += match[0].length + return match[0] + } + } else { + if (source.indexOf(value, index) === index) { + index += value.length + return value + } + } + } + + function skipWhitespace () { + read(/[ ]*/) + } + + function operator () { + var string + var possibilities = ['WITH', 'AND', 'OR', '(', ')', ':', '+'] + for (var i = 0; i < possibilities.length; i++) { + string = read(possibilities[i]) + if (string) { + break + } + } + + if (string === '+' && index > 1 && source[index - 2] === ' ') { + throw new Error('Space before `+`') + } + + return string && { + type: 'OPERATOR', + string: string + } + } + + function idstring () { + return read(/[A-Za-z0-9-.]+/) + } + + function expectIdstring () { + var string = idstring() + if (!string) { + throw new Error('Expected idstring at offset ' + index) + } + return string + } + + function documentRef () { + if (read('DocumentRef-')) { + var string = expectIdstring() + return { type: 'DOCUMENTREF', string: string } + } + } + + function licenseRef () { + if (read('LicenseRef-')) { + var string = expectIdstring() + return { type: 'LICENSEREF', string: string } + } + } + + function identifier () { + var begin = index + var string = idstring() + + if (licenses.indexOf(string) !== -1) { + return { + type: 'LICENSE', + string: string + } + } else if (exceptions.indexOf(string) !== -1) { + return { + type: 'EXCEPTION', + string: string + } + } + + index = begin + } + + // Tries to read the next token. Returns `undefined` if no token is + // recognized. + function parseToken () { + // Ordering matters + return ( + operator() || + documentRef() || + licenseRef() || + identifier() + ) + } + + var tokens = [] + while (hasMore()) { + skipWhitespace() + if (!hasMore()) { + break + } + + var token = parseToken() + if (!token) { + throw new Error('Unexpected `' + source[index] + + '` at offset ' + index) + } + + tokens.push(token) + } + return tokens +} diff --git a/node_modules/spdx-license-ids/README.md b/node_modules/spdx-license-ids/README.md new file mode 100644 index 000000000..500e32dff --- /dev/null +++ b/node_modules/spdx-license-ids/README.md @@ -0,0 +1,52 @@ +# spdx-license-ids + +[![npm version](https://img.shields.io/npm/v/spdx-license-ids.svg)](https://www.npmjs.com/package/spdx-license-ids) +[![Github Actions](https://action-badges.now.sh/jslicense/spdx-license-ids)](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/jslicense/spdx-license-ids) + +A list of [SPDX license](https://spdx.org/licenses/) identifiers + +## Installation + +[Download JSON directly](https://raw.githubusercontent.com/jslicense/spdx-license-ids/main/index.json), or [use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/): + +``` +npm install spdx-license-ids +``` + +## [Node.js](https://nodejs.org/) API + +### require('spdx-license-ids') + +Type: `string[]` + +All license IDs except for the currently deprecated ones. + +```javascript +const ids = require('spdx-license-ids'); +//=> ['0BSD', 'AAL', 'ADSL', 'AFL-1.1', 'AFL-1.2', 'AFL-2.0', 'AFL-2.1', 'AFL-3.0', 'AGPL-1.0-only', ...] + +ids.includes('BSD-3-Clause'); //=> true +ids.includes('CC-BY-1.0'); //=> true + +ids.includes('GPL-3.0'); //=> false +``` + +### require('spdx-license-ids/deprecated') + +Type: `string[]` + +Deprecated license IDs. + +```javascript +const deprecatedIds = require('spdx-license-ids/deprecated'); +//=> ['AGPL-1.0', 'AGPL-3.0', 'GFDL-1.1', 'GFDL-1.2', 'GFDL-1.3', 'GPL-1.0', 'GPL-2.0', ...] + +deprecatedIds.includes('BSD-3-Clause'); //=> false +deprecatedIds.includes('CC-BY-1.0'); //=> false + +deprecatedIds.includes('GPL-3.0'); //=> true +``` + +## License + +[Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/deed) diff --git a/node_modules/spdx-license-ids/deprecated.json b/node_modules/spdx-license-ids/deprecated.json new file mode 100644 index 000000000..278531e40 --- /dev/null +++ b/node_modules/spdx-license-ids/deprecated.json @@ -0,0 +1,27 @@ +[ + "AGPL-1.0", + "AGPL-3.0", + "BSD-2-Clause-FreeBSD", + "BSD-2-Clause-NetBSD", + "GFDL-1.1", + "GFDL-1.2", + "GFDL-1.3", + "GPL-1.0", + "GPL-2.0", + "GPL-2.0-with-GCC-exception", + "GPL-2.0-with-autoconf-exception", + "GPL-2.0-with-bison-exception", + "GPL-2.0-with-classpath-exception", + "GPL-2.0-with-font-exception", + "GPL-3.0", + "GPL-3.0-with-GCC-exception", + "GPL-3.0-with-autoconf-exception", + "LGPL-2.0", + "LGPL-2.1", + "LGPL-3.0", + "Nunit", + "StandardML-NJ", + "bzip2-1.0.5", + "eCos-2.0", + "wxWindows" +] diff --git a/node_modules/spdx-license-ids/index.json b/node_modules/spdx-license-ids/index.json new file mode 100644 index 000000000..04c03126d --- /dev/null +++ b/node_modules/spdx-license-ids/index.json @@ -0,0 +1,507 @@ +[ + "0BSD", + "AAL", + "ADSL", + "AFL-1.1", + "AFL-1.2", + "AFL-2.0", + "AFL-2.1", + "AFL-3.0", + "AGPL-1.0-only", + "AGPL-1.0-or-later", + "AGPL-3.0-only", + "AGPL-3.0-or-later", + "AMDPLPA", + "AML", + "AMPAS", + "ANTLR-PD", + "ANTLR-PD-fallback", + "APAFML", + "APL-1.0", + "APSL-1.0", + "APSL-1.1", + "APSL-1.2", + "APSL-2.0", + "Abstyles", + "AdaCore-doc", + "Adobe-2006", + "Adobe-Glyph", + "Afmparse", + "Aladdin", + "Apache-1.0", + "Apache-1.1", + "Apache-2.0", + "App-s2p", + "Arphic-1999", + "Artistic-1.0", + "Artistic-1.0-Perl", + "Artistic-1.0-cl8", + "Artistic-2.0", + "BSD-1-Clause", + "BSD-2-Clause", + "BSD-2-Clause-Patent", + "BSD-2-Clause-Views", + "BSD-3-Clause", + "BSD-3-Clause-Attribution", + "BSD-3-Clause-Clear", + "BSD-3-Clause-LBNL", + "BSD-3-Clause-Modification", + "BSD-3-Clause-No-Military-License", + "BSD-3-Clause-No-Nuclear-License", + "BSD-3-Clause-No-Nuclear-License-2014", + "BSD-3-Clause-No-Nuclear-Warranty", + "BSD-3-Clause-Open-MPI", + "BSD-4-Clause", + "BSD-4-Clause-Shortened", + "BSD-4-Clause-UC", + "BSD-4.3RENO", + "BSD-4.3TAHOE", + "BSD-Advertising-Acknowledgement", + "BSD-Attribution-HPND-disclaimer", + "BSD-Protection", + "BSD-Source-Code", + "BSL-1.0", + "BUSL-1.1", + "Baekmuk", + "Bahyph", + "Barr", + "Beerware", + "BitTorrent-1.0", + "BitTorrent-1.1", + "Bitstream-Charter", + "Bitstream-Vera", + "BlueOak-1.0.0", + "Borceux", + "Brian-Gladman-3-Clause", + "C-UDA-1.0", + "CAL-1.0", + "CAL-1.0-Combined-Work-Exception", + "CATOSL-1.1", + "CC-BY-1.0", + "CC-BY-2.0", + "CC-BY-2.5", + "CC-BY-2.5-AU", + "CC-BY-3.0", + "CC-BY-3.0-AT", + "CC-BY-3.0-DE", + "CC-BY-3.0-IGO", + "CC-BY-3.0-NL", + "CC-BY-3.0-US", + "CC-BY-4.0", + "CC-BY-NC-1.0", + "CC-BY-NC-2.0", + "CC-BY-NC-2.5", + "CC-BY-NC-3.0", + "CC-BY-NC-3.0-DE", + "CC-BY-NC-4.0", + "CC-BY-NC-ND-1.0", + "CC-BY-NC-ND-2.0", + "CC-BY-NC-ND-2.5", + "CC-BY-NC-ND-3.0", + "CC-BY-NC-ND-3.0-DE", + "CC-BY-NC-ND-3.0-IGO", + "CC-BY-NC-ND-4.0", + "CC-BY-NC-SA-1.0", + "CC-BY-NC-SA-2.0", + "CC-BY-NC-SA-2.0-DE", + "CC-BY-NC-SA-2.0-FR", + "CC-BY-NC-SA-2.0-UK", + "CC-BY-NC-SA-2.5", + "CC-BY-NC-SA-3.0", + "CC-BY-NC-SA-3.0-DE", + "CC-BY-NC-SA-3.0-IGO", + "CC-BY-NC-SA-4.0", + "CC-BY-ND-1.0", + "CC-BY-ND-2.0", + "CC-BY-ND-2.5", + "CC-BY-ND-3.0", + "CC-BY-ND-3.0-DE", + "CC-BY-ND-4.0", + "CC-BY-SA-1.0", + "CC-BY-SA-2.0", + "CC-BY-SA-2.0-UK", + "CC-BY-SA-2.1-JP", + "CC-BY-SA-2.5", + "CC-BY-SA-3.0", + "CC-BY-SA-3.0-AT", + "CC-BY-SA-3.0-DE", + "CC-BY-SA-4.0", + "CC-PDDC", + "CC0-1.0", + "CDDL-1.0", + "CDDL-1.1", + "CDL-1.0", + "CDLA-Permissive-1.0", + "CDLA-Permissive-2.0", + "CDLA-Sharing-1.0", + "CECILL-1.0", + "CECILL-1.1", + "CECILL-2.0", + "CECILL-2.1", + "CECILL-B", + "CECILL-C", + "CERN-OHL-1.1", + "CERN-OHL-1.2", + "CERN-OHL-P-2.0", + "CERN-OHL-S-2.0", + "CERN-OHL-W-2.0", + "CFITSIO", + "CMU-Mach", + "CNRI-Jython", + "CNRI-Python", + "CNRI-Python-GPL-Compatible", + "COIL-1.0", + "CPAL-1.0", + "CPL-1.0", + "CPOL-1.02", + "CUA-OPL-1.0", + "Caldera", + "ClArtistic", + "Clips", + "Community-Spec-1.0", + "Condor-1.1", + "Cornell-Lossless-JPEG", + "Crossword", + "CrystalStacker", + "Cube", + "D-FSL-1.0", + "DL-DE-BY-2.0", + "DOC", + "DRL-1.0", + "DSDP", + "Dotseqn", + "ECL-1.0", + "ECL-2.0", + "EFL-1.0", + "EFL-2.0", + "EPICS", + "EPL-1.0", + "EPL-2.0", + "EUDatagrid", + "EUPL-1.0", + "EUPL-1.1", + "EUPL-1.2", + "Elastic-2.0", + "Entessa", + "ErlPL-1.1", + "Eurosym", + "FDK-AAC", + "FSFAP", + "FSFUL", + "FSFULLR", + "FSFULLRWD", + "FTL", + "Fair", + "Frameworx-1.0", + "FreeBSD-DOC", + "FreeImage", + "GD", + "GFDL-1.1-invariants-only", + "GFDL-1.1-invariants-or-later", + "GFDL-1.1-no-invariants-only", + "GFDL-1.1-no-invariants-or-later", + "GFDL-1.1-only", + "GFDL-1.1-or-later", + "GFDL-1.2-invariants-only", + "GFDL-1.2-invariants-or-later", + "GFDL-1.2-no-invariants-only", + "GFDL-1.2-no-invariants-or-later", + "GFDL-1.2-only", + "GFDL-1.2-or-later", + "GFDL-1.3-invariants-only", + "GFDL-1.3-invariants-or-later", + "GFDL-1.3-no-invariants-only", + "GFDL-1.3-no-invariants-or-later", + "GFDL-1.3-only", + "GFDL-1.3-or-later", + "GL2PS", + "GLWTPL", + "GPL-1.0-only", + "GPL-1.0-or-later", + "GPL-2.0-only", + "GPL-2.0-or-later", + "GPL-3.0-only", + "GPL-3.0-or-later", + "Giftware", + "Glide", + "Glulxe", + "Graphics-Gems", + "HP-1986", + "HPND", + "HPND-Markus-Kuhn", + "HPND-export-US", + "HPND-sell-variant", + "HPND-sell-variant-MIT-disclaimer", + "HTMLTIDY", + "HaskellReport", + "Hippocratic-2.1", + "IBM-pibs", + "ICU", + "IEC-Code-Components-EULA", + "IJG", + "IJG-short", + "IPA", + "IPL-1.0", + "ISC", + "ImageMagick", + "Imlib2", + "Info-ZIP", + "Intel", + "Intel-ACPI", + "Interbase-1.0", + "JPL-image", + "JPNIC", + "JSON", + "Jam", + "JasPer-2.0", + "Kazlib", + "Knuth-CTAN", + "LAL-1.2", + "LAL-1.3", + "LGPL-2.0-only", + "LGPL-2.0-or-later", + "LGPL-2.1-only", + "LGPL-2.1-or-later", + "LGPL-3.0-only", + "LGPL-3.0-or-later", + "LGPLLR", + "LOOP", + "LPL-1.0", + "LPL-1.02", + "LPPL-1.0", + "LPPL-1.1", + "LPPL-1.2", + "LPPL-1.3a", + "LPPL-1.3c", + "LZMA-SDK-9.11-to-9.20", + "LZMA-SDK-9.22", + "Latex2e", + "Leptonica", + "LiLiQ-P-1.1", + "LiLiQ-R-1.1", + "LiLiQ-Rplus-1.1", + "Libpng", + "Linux-OpenIB", + "Linux-man-pages-copyleft", + "MIT", + "MIT-0", + "MIT-CMU", + "MIT-Modern-Variant", + "MIT-Wu", + "MIT-advertising", + "MIT-enna", + "MIT-feh", + "MIT-open-group", + "MITNFA", + "MPL-1.0", + "MPL-1.1", + "MPL-2.0", + "MPL-2.0-no-copyleft-exception", + "MS-LPL", + "MS-PL", + "MS-RL", + "MTLL", + "MakeIndex", + "Martin-Birgmeier", + "Minpack", + "MirOS", + "Motosoto", + "MulanPSL-1.0", + "MulanPSL-2.0", + "Multics", + "Mup", + "NAIST-2003", + "NASA-1.3", + "NBPL-1.0", + "NCGL-UK-2.0", + "NCSA", + "NGPL", + "NICTA-1.0", + "NIST-PD", + "NIST-PD-fallback", + "NLOD-1.0", + "NLOD-2.0", + "NLPL", + "NOSL", + "NPL-1.0", + "NPL-1.1", + "NPOSL-3.0", + "NRL", + "NTP", + "NTP-0", + "Naumen", + "Net-SNMP", + "NetCDF", + "Newsletr", + "Nokia", + "Noweb", + "O-UDA-1.0", + "OCCT-PL", + "OCLC-2.0", + "ODC-By-1.0", + "ODbL-1.0", + "OFFIS", + "OFL-1.0", + "OFL-1.0-RFN", + "OFL-1.0-no-RFN", + "OFL-1.1", + "OFL-1.1-RFN", + "OFL-1.1-no-RFN", + "OGC-1.0", + "OGDL-Taiwan-1.0", + "OGL-Canada-2.0", + "OGL-UK-1.0", + "OGL-UK-2.0", + "OGL-UK-3.0", + "OGTSL", + "OLDAP-1.1", + "OLDAP-1.2", + "OLDAP-1.3", + "OLDAP-1.4", + "OLDAP-2.0", + "OLDAP-2.0.1", + "OLDAP-2.1", + "OLDAP-2.2", + "OLDAP-2.2.1", + "OLDAP-2.2.2", + "OLDAP-2.3", + "OLDAP-2.4", + "OLDAP-2.5", + "OLDAP-2.6", + "OLDAP-2.7", + "OLDAP-2.8", + "OML", + "OPL-1.0", + "OPUBL-1.0", + "OSET-PL-2.1", + "OSL-1.0", + "OSL-1.1", + "OSL-2.0", + "OSL-2.1", + "OSL-3.0", + "OpenPBS-2.3", + "OpenSSL", + "PDDL-1.0", + "PHP-3.0", + "PHP-3.01", + "PSF-2.0", + "Parity-6.0.0", + "Parity-7.0.0", + "Plexus", + "PolyForm-Noncommercial-1.0.0", + "PolyForm-Small-Business-1.0.0", + "PostgreSQL", + "Python-2.0", + "Python-2.0.1", + "QPL-1.0", + "QPL-1.0-INRIA-2004", + "Qhull", + "RHeCos-1.1", + "RPL-1.1", + "RPL-1.5", + "RPSL-1.0", + "RSA-MD", + "RSCPL", + "Rdisc", + "Ruby", + "SAX-PD", + "SCEA", + "SGI-B-1.0", + "SGI-B-1.1", + "SGI-B-2.0", + "SHL-0.5", + "SHL-0.51", + "SISSL", + "SISSL-1.2", + "SMLNJ", + "SMPPL", + "SNIA", + "SPL-1.0", + "SSH-OpenSSH", + "SSH-short", + "SSPL-1.0", + "SWL", + "Saxpath", + "SchemeReport", + "Sendmail", + "Sendmail-8.23", + "SimPL-2.0", + "Sleepycat", + "Spencer-86", + "Spencer-94", + "Spencer-99", + "SugarCRM-1.1.3", + "SunPro", + "Symlinks", + "TAPR-OHL-1.0", + "TCL", + "TCP-wrappers", + "TMate", + "TORQUE-1.1", + "TOSL", + "TPDL", + "TPL-1.0", + "TTWL", + "TU-Berlin-1.0", + "TU-Berlin-2.0", + "UCAR", + "UCL-1.0", + "UPL-1.0", + "Unicode-DFS-2015", + "Unicode-DFS-2016", + "Unicode-TOU", + "Unlicense", + "VOSTROM", + "VSL-1.0", + "Vim", + "W3C", + "W3C-19980720", + "W3C-20150513", + "WTFPL", + "Watcom-1.0", + "Wsuipa", + "X11", + "X11-distribute-modifications-variant", + "XFree86-1.1", + "XSkat", + "Xerox", + "Xnet", + "YPL-1.0", + "YPL-1.1", + "ZPL-1.1", + "ZPL-2.0", + "ZPL-2.1", + "Zed", + "Zend-2.0", + "Zimbra-1.3", + "Zimbra-1.4", + "Zlib", + "blessing", + "bzip2-1.0.6", + "checkmk", + "copyleft-next-0.3.0", + "copyleft-next-0.3.1", + "curl", + "diffmark", + "dvipdfm", + "eGenix", + "etalab-2.0", + "gSOAP-1.3b", + "gnuplot", + "iMatix", + "libpng-2.0", + "libselinux-1.0", + "libtiff", + "libutil-David-Nugent", + "mpi-permissive", + "mpich2", + "mplus", + "psfrag", + "psutils", + "snprintf", + "w3m", + "xinetd", + "xlock", + "xpp", + "zlib-acknowledgement" +] diff --git a/node_modules/spdx-license-ids/package.json b/node_modules/spdx-license-ids/package.json new file mode 100644 index 000000000..ea060776d --- /dev/null +++ b/node_modules/spdx-license-ids/package.json @@ -0,0 +1,39 @@ +{ + "name": "spdx-license-ids", + "version": "3.0.13", + "description": "A list of SPDX license identifiers", + "repository": "jslicense/spdx-license-ids", + "author": "Shinnosuke Watanabe (https://github.com/shinnn)", + "license": "CC0-1.0", + "scripts": { + "build": "node build.js", + "pretest": "eslint .", + "latest": "node latest.js", + "test": "node test.js" + }, + "files": [ + "deprecated.json", + "index.json" + ], + "keywords": [ + "spdx", + "license", + "licenses", + "id", + "identifier", + "identifiers", + "json", + "array", + "oss" + ], + "devDependencies": { + "@shinnn/eslint-config": "^7.0.0", + "eslint": "^8.2.0", + "eslint-formatter-codeframe": "^7.32.1", + "rmfr": "^2.0.0", + "tape": "^5.3.1" + }, + "eslintConfig": { + "extends": "@shinnn" + } +} diff --git a/node_modules/string-width/index.d.ts b/node_modules/string-width/index.d.ts new file mode 100644 index 000000000..12b530975 --- /dev/null +++ b/node_modules/string-width/index.d.ts @@ -0,0 +1,29 @@ +declare const stringWidth: { + /** + Get the visual width of a string - the number of columns required to display it. + + Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + + @example + ``` + import stringWidth = require('string-width'); + + stringWidth('a'); + //=> 1 + + stringWidth('古'); + //=> 2 + + stringWidth('\u001B[1m古\u001B[22m'); + //=> 2 + ``` + */ + (string: string): number; + + // TODO: remove this in the next major version, refactor the whole definition to: + // declare function stringWidth(string: string): number; + // export = stringWidth; + default: typeof stringWidth; +} + +export = stringWidth; diff --git a/node_modules/string-width/index.js b/node_modules/string-width/index.js new file mode 100644 index 000000000..f4d261a96 --- /dev/null +++ b/node_modules/string-width/index.js @@ -0,0 +1,47 @@ +'use strict'; +const stripAnsi = require('strip-ansi'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex'); + +const stringWidth = string => { + if (typeof string !== 'string' || string.length === 0) { + return 0; + } + + string = stripAnsi(string); + + if (string.length === 0) { + return 0; + } + + string = string.replace(emojiRegex(), ' '); + + let width = 0; + + for (let i = 0; i < string.length; i++) { + const code = string.codePointAt(i); + + // Ignore control characters + if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { + continue; + } + + // Ignore combining characters + if (code >= 0x300 && code <= 0x36F) { + continue; + } + + // Surrogates + if (code > 0xFFFF) { + i++; + } + + width += isFullwidthCodePoint(code) ? 2 : 1; + } + + return width; +}; + +module.exports = stringWidth; +// TODO: remove this in the next major version +module.exports.default = stringWidth; diff --git a/node_modules/string-width/license b/node_modules/string-width/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/string-width/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/string-width/package.json b/node_modules/string-width/package.json new file mode 100644 index 000000000..28ba7b4ca --- /dev/null +++ b/node_modules/string-width/package.json @@ -0,0 +1,56 @@ +{ + "name": "string-width", + "version": "4.2.3", + "description": "Get the visual width of a string - the number of columns required to display it", + "license": "MIT", + "repository": "sindresorhus/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "string", + "character", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + } +} diff --git a/node_modules/string-width/readme.md b/node_modules/string-width/readme.md new file mode 100644 index 000000000..bdd314129 --- /dev/null +++ b/node_modules/string-width/readme.md @@ -0,0 +1,50 @@ +# string-width + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('a'); +//=> 1 + +stringWidth('古'); +//=> 2 + +stringWidth('\u001B[1m古\u001B[22m'); +//=> 2 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/strip-ansi/index.d.ts b/node_modules/strip-ansi/index.d.ts new file mode 100644 index 000000000..907fccc29 --- /dev/null +++ b/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,17 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +declare function stripAnsi(string: string): string; + +export = stripAnsi; diff --git a/node_modules/strip-ansi/index.js b/node_modules/strip-ansi/index.js new file mode 100644 index 000000000..9a593dfcd --- /dev/null +++ b/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/strip-ansi/license b/node_modules/strip-ansi/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/strip-ansi/package.json b/node_modules/strip-ansi/package.json new file mode 100644 index 000000000..1a41108d4 --- /dev/null +++ b/node_modules/strip-ansi/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/strip-ansi/readme.md b/node_modules/strip-ansi/readme.md new file mode 100644 index 000000000..7c4b56d46 --- /dev/null +++ b/node_modules/strip-ansi/readme.md @@ -0,0 +1,46 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + + +## strip-ansi for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + diff --git a/node_modules/strip-indent/index.d.ts b/node_modules/strip-indent/index.d.ts new file mode 100644 index 000000000..2bacea971 --- /dev/null +++ b/node_modules/strip-indent/index.d.ts @@ -0,0 +1,19 @@ +/** +Strip leading whitespace from each line in a string. + +The line with the least number of leading whitespace, ignoring empty lines, determines the number to remove. + +@example +``` +import stripIndent from 'strip-indent'; + +const string = '\tunicorn\n\t\tcake'; +// unicorn +// cake + +stripIndent(string); +//unicorn +// cake +``` +*/ +export default function stripIndent(string: string): string; diff --git a/node_modules/strip-indent/index.js b/node_modules/strip-indent/index.js new file mode 100644 index 000000000..3b18b97fd --- /dev/null +++ b/node_modules/strip-indent/index.js @@ -0,0 +1,13 @@ +import minIndent from 'min-indent'; + +export default function stripIndent(string) { + const indent = minIndent(string); + + if (indent === 0) { + return string; + } + + const regex = new RegExp(`^[ \\t]{${indent}}`, 'gm'); + + return string.replace(regex, ''); +} diff --git a/node_modules/strip-indent/license b/node_modules/strip-indent/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/strip-indent/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/strip-indent/package.json b/node_modules/strip-indent/package.json new file mode 100644 index 000000000..919e1fb73 --- /dev/null +++ b/node_modules/strip-indent/package.json @@ -0,0 +1,45 @@ +{ + "name": "strip-indent", + "version": "4.0.0", + "description": "Strip leading whitespace from each line in a string", + "license": "MIT", + "repository": "sindresorhus/strip-indent", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "indent", + "indentation", + "normalize", + "remove", + "delete", + "whitespace", + "space", + "tab", + "string" + ], + "dependencies": { + "min-indent": "^1.0.1" + }, + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.39.1" + } +} diff --git a/node_modules/strip-indent/readme.md b/node_modules/strip-indent/readme.md new file mode 100644 index 000000000..371e905c1 --- /dev/null +++ b/node_modules/strip-indent/readme.md @@ -0,0 +1,48 @@ +# strip-indent + +> Strip leading whitespace from each line in a string + +The line with the least number of leading whitespace, ignoring empty lines, determines the number to remove. + +Useful for removing redundant indentation. + +## Install + +``` +$ npm install strip-indent +``` + +## Usage + +```js +import stripIndent from 'strip-indent'; + +const string = '\tunicorn\n\t\tcake'; +/* + unicorn + cake +*/ + +stripIndent(string); +/* +unicorn + cake +*/ +``` + +## Related + +- [strip-indent-cli](https://github.com/sindresorhus/strip-indent-cli) - CLI for this module +- [indent-string](https://github.com/sindresorhus/indent-string) - Indent each line in a string + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/style-search/.npmignore b/node_modules/style-search/.npmignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/node_modules/style-search/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/style-search/CHANGELOG.md b/node_modules/style-search/CHANGELOG.md new file mode 100644 index 000000000..6c572f9b6 --- /dev/null +++ b/node_modules/style-search/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 0.1.0 + +- Initial extraction from [stylelint](https://github.com/stylelint/stylelint), API refactoring, and release. diff --git a/node_modules/style-search/LICENSE b/node_modules/style-search/LICENSE new file mode 100644 index 000000000..cec41a847 --- /dev/null +++ b/node_modules/style-search/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2016, David Clark + +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. diff --git a/node_modules/style-search/README.md b/node_modules/style-search/README.md new file mode 100644 index 000000000..1d662db08 --- /dev/null +++ b/node_modules/style-search/README.md @@ -0,0 +1,96 @@ +# style-search [![CircleCI](https://circleci.com/gh/davidtheclark/style-search.svg?style=svg)](https://circleci.com/gh/davidtheclark/style-search) + +Search CSS (and CSS-like) strings, with sensitivity to whether matches occur inside strings, comments, and functions. + +## Usage + +```js +var styleSearch = require('style-search'); + +styleSearch(options, callback); +``` + +**By default, the search ignores strings, comments, and function names.** You can use the options to change this behavior or introduce other restrictions. That is what makes this module more useful for many searches than `indexOf()` or a `RegExp`. + +However, if you need more detailed parsing, you should consider using the real parsers [PostCSS](https://github.com/postcss/postcss), [`postcss-selector-parser`](https://github.com/postcss/postcss-selector-parser), and [`postcss-value-parser`](https://github.com/TrySound/postcss-value-parser). + +### Example + +```css +/* Here is some pink */ +a { color: pink; } +a::before { content: "pink" } +b { color: shadesOfPink(7); } +``` + +```js +styleSearch({ + source: theCssStringAbove, + target: "pink", +}, function(match, count) { + /* Only the "pink" in `color: pink` will be + reported as a match */ +}); +``` + +### Reporting matches + +For every match found your `callback` is invoked. It is passed two arguments: + +- A `match` object with the following properties: + - `startIndex`: where the match begins + - `endIndex`: where the match ends + - `target`: what got matched (useful if your `target` option is an array instead of a single string) + - `insideFunctionArguments`: whether the match is inside a function — *this includes the parentheses around the arguments* + - `insideComment`: whether the match is inside a comment + - `insideString`: whether the match is inside a string +- The count of how many matches have been found up to this point. + +### Options + +Below you'll see that syntax feature options all accept three keywords: `"skip"`, `"check"`, `"only"`. An error will be thrown if you use `"only"` more than once. + +#### source + +String. *Required.* + +The source string to search through. + +#### target + +String or array of strings. *Required.* + +The target of the search. Can be +- a single character +- a string with some length +- an array of strings, all of which count as matches (the `match` object passed to the `callback` will differentiate which string in the array got matched via its `target` property) + +#### once + +Boolean. Default: `false`. + +If `true`, the search will stop after one match is found. + +#### comments + +`"skip"` | `"check"` | `"only"`. Default: `"skip"`. + +This includes both standard `/* CSS comments */` and non-standard but widely used `// single line comments`. + +#### strings + +`"skip"` | `"check"` | `"only"`. Default: `"skip"`. + +#### functionNames + +`"skip"` | `"check"` | `"only"`. Default: `"skip"`. + +#### functionArguments + +`"skip"` | `"check"` | `"only"`. Default: `"check"`. + +#### parentheticals + +`"skip"` | `"check"` | `"only"`. Default: `"check"`. + +This designates anything inside parentheses, which includes standard functions, but also Sass maps and other non-standard constructs. `parentheticals` is a broader category than `functionArguments`. diff --git a/node_modules/style-search/circle.yml b/node_modules/style-search/circle.yml new file mode 100644 index 000000000..0efe6abfb --- /dev/null +++ b/node_modules/style-search/circle.yml @@ -0,0 +1,5 @@ +test: + override: + - nvm use 0.10 && npm test + - nvm use 0.12 && npm test + - nvm use 4.0 && npm test diff --git a/node_modules/style-search/index.js b/node_modules/style-search/index.js new file mode 100644 index 000000000..74a23f131 --- /dev/null +++ b/node_modules/style-search/index.js @@ -0,0 +1,203 @@ +var SKIP = 'skip'; +var CHECK = 'check'; +var ONLY = 'only'; + +module.exports = function (options, callback) { + var source = options.source; + var target = options.target; + + var skipComments = (options.comments) ? options.comments === SKIP : true; + var skipStrings = (options.strings) ? options.strings === SKIP : true; + var skipFunctionNames = (options.functionNames) ? options.functionNames === SKIP : true; + var skipFunctionArguments = options.functionArguments === SKIP; + var skipParentheticals = options.parentheticals === SKIP; + + var onceOptionUsed = false; + Object.keys(options).forEach(function(key) { + if (options[key] !== ONLY) return; + if (!onceOptionUsed) { + onceOptionUsed = true; + } else { + throw new Error('Only one syntax feature option can be the "only" one to check'); + } + }); + + var onlyComments = options.comments === ONLY; + var onlyStrings = options.strings === ONLY; + var onlyFunctionNames = options.functionNames === ONLY; + var onlyFunctionArguments = options.functionArguments === ONLY; + var onlyParentheticals = options.parentheticals === ONLY; + + var insideString = false; + var insideComment = false; + var insideSingleLineComment = false; + var insideParens = false; + var insideFunctionArguments = false; + var openingParenCount = 0; + var matchCount = 0; + var openingQuote; + + var targetIsArray = Array.isArray(target); + + // If the target is just a string, it is easy to check whether + // some index of the source matches it. + // If the target is an array of strings, though, we have to + // check whether some index of the source matches *any* of + // those target strings (stopping after the first match). + var getMatch = (function () { + if (!targetIsArray) { + return getMatchBase.bind(null, target); + } + return function(index) { + for (var ti = 0, tl = target.length; ti < tl; ti++) { + var checkResult = getMatchBase(target[ti], index); + if (checkResult) return checkResult; + } + return false; + } + })(); + + function getMatchBase(targetString, index) { + var targetStringLength = targetString.length; + + // Target is a single character + if (targetStringLength === 1 && source[index] !== targetString) return false; + + // Target is multiple characters + if (source.substr(index, targetStringLength) !== targetString) return false; + + return { + insideParens: insideParens, + insideFunctionArguments: insideFunctionArguments, + insideComment: insideComment, + insideString: insideString, + startIndex: index, + endIndex: index + targetStringLength, + target: targetString, + }; + } + + for (var i = 0, l = source.length; i < l; i++) { + var currentChar = source[i]; + + // Register the beginning of a comment + if ( + !insideString && !insideComment + && currentChar === "/" + && source[i - 1] !== "\\" // escaping + ) { + // standard comments + if (source[i + 1] === "*") { + insideComment = true; + continue; + } + // single-line comments + if (source[i + 1] === "/") { + insideComment = true; + insideSingleLineComment = true; + continue; + } + } + + if (insideComment) { + // Register the end of a standard comment + if ( + !insideSingleLineComment + && currentChar === "*" + && source[i - 1] !== "\\" // escaping + && source[i + 1] === "/" + && source[i - 1] !== "/" // don't end if it's /*/ + ) { + insideComment = false; + continue; + } + + // Register the end of a single-line comment + if ( + insideSingleLineComment + && currentChar === "\n" + ) { + insideComment = false; + insideSingleLineComment = false; + } + + if (skipComments) continue; + } + + // Register the beginning of a string + if (!insideComment && !insideString && (currentChar === "\"" || currentChar === "'")) { + if (source[i - 1] === "\\") continue; // escaping + + openingQuote = currentChar; + insideString = true; + + // For string-quotes rule + if (target === currentChar) handleMatch(getMatch(i)); + continue; + } + + if (insideString) { + // Register the end of a string + if (currentChar === openingQuote) { + if (source[i - 1] === "\\") continue; // escaping + insideString = false; + continue; + } + + if (skipStrings) continue; + } + + // Register the beginning of parens/functions + if (!insideString && !insideComment && currentChar === "(") { + // Keep track of opening parentheticals so that we + // know when the outermost function (possibly + // containing nested functions) is closing + openingParenCount++; + + insideParens = true; + // Only inside a function if there is a function name + // before the opening paren + if (/[a-zA-Z]/.test(source[i - 1])) { + insideFunctionArguments = true; + } + + if (target === "(") handleMatch(getMatch(i)); + continue; + } + + if (insideParens) { + // Register the end of a function + if (currentChar === ")") { + openingParenCount--; + // Do this here so the match is still technically inside a function + if (target === ")") handleMatch(getMatch(i)); + if (openingParenCount === 0) { + insideParens = false; + insideFunctionArguments = false; + } + continue; + } + } + + var isFunctionName = /^[a-zA-Z]*\(/.test(source.slice(i)); + if (skipFunctionNames && isFunctionName) continue; + if (onlyFunctionNames && !isFunctionName) continue; + + var match = getMatch(i); + + if (!match) continue; + handleMatch(match); + if (options.once) return; + } + + function handleMatch(match) { + if (onlyParentheticals && !insideParens) return; + if (skipParentheticals && insideParens) return; + if (onlyFunctionArguments && !insideFunctionArguments) return; + if (skipFunctionArguments && insideFunctionArguments) return; + if (onlyStrings && !insideString) return; + if (onlyComments && !insideComment) return; + matchCount++; + callback(match, matchCount); + } +} diff --git a/node_modules/style-search/package.json b/node_modules/style-search/package.json new file mode 100644 index 000000000..0a2cefc31 --- /dev/null +++ b/node_modules/style-search/package.json @@ -0,0 +1,27 @@ +{ + "name": "style-search", + "version": "0.1.0", + "description": "Search CSS(-like) strings", + "main": "index.js", + "scripts": { + "test": "tape test.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/davidtheclark/style-search.git" + }, + "keywords": [ + "css", + "search", + "stylelint" + ], + "author": "David Clark", + "license": "ISC", + "bugs": { + "url": "https://github.com/davidtheclark/style-search/issues" + }, + "homepage": "https://github.com/davidtheclark/style-search#readme", + "devDependencies": { + "tape": "^4.5.1" + } +} diff --git a/node_modules/style-search/test.js b/node_modules/style-search/test.js new file mode 100644 index 000000000..71c93e9d8 --- /dev/null +++ b/node_modules/style-search/test.js @@ -0,0 +1,467 @@ +var test = require("tape"); +var styleSearch = require("./index"); + +function styleSearchResults(options) { + const results = []; + styleSearch(options, function(match) { + results.push(match.startIndex); + }); + return results; +} + +test("default options", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: "c", + }), [ 2, 4 ]); + t.deepEqual(styleSearchResults({ + source: "abc cb", + target: "a", + }), [0]); + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: "b", + }), [ 1, 5 ]); + t.deepEqual(styleSearchResults({ + source: "abc \"var(--cba)\"", + target: "a", + }), [0]); + t.end(); +}); + +test("once", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: "c", + once: true, + }), [2]); + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: "a", + once: true, + }), [0]); + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: "b", + once: false, + }), [ 1, 5 ]); + t.end(); +}); + +test("functionArguments: 'only'", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc var(--cba)", + target: "c", + functionArguments: "only", + }), [10]); + t.deepEqual(styleSearchResults({ + source: "abc var(--cba)", + target: "a", + functionArguments: "only", + }), [12]); + t.deepEqual(styleSearchResults({ + source: "abc \"var(--cba)\"", + target: "a", + functionArguments: "only", + }), []); + t.deepEqual(styleSearchResults({ + source: "translate(1px, calc(1px * 2))", + target: "1", + functionArguments: "only", + }), [ 10, 20 ]); + t.deepEqual(styleSearchResults({ + source: "var(--horse)", + target: "v", + functionArguments: "only", + }), []); + t.deepEqual(styleSearchResults({ + source: "abc (abc)", + target: "b", + functionArguments: "only", + }), [], "parens without function is not interpreted as a function"); + t.deepEqual(styleSearchResults({ + source: "de$(abc)fg", + target: "b", + functionArguments: "only", + }), [], "parens preceded by `$`, for postcss-simple-vars interpolation, not interpreted as a function"); + t.deepEqual(styleSearchResults({ + source: "de$(abc)fg", + target: ")", + functionArguments: "only", + }), [], "closing paren of non-function is ignored"); + t.end(); +}); + +test("functionArguments: 'skip'", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc var(--cba)", + target: "c", + functionArguments: "skip", + }), [2]); + t.deepEqual(styleSearchResults({ + source: "abc var(--cba)", + target: "a", + functionArguments: "skip", + }), [0]); + t.deepEqual(styleSearchResults({ + source: "abc \"a var(--cba)\"", + target: "a", + functionArguments: "skip", + }), [0]); + t.deepEqual(styleSearchResults({ + source: "translate(1px, calc(1px * 2))", + target: "1", + functionArguments: "skip", + }), []); + t.deepEqual(styleSearchResults({ + source: "var(--horse)", + target: "v", + functionArguments: "skip", + }), []); + t.deepEqual(styleSearchResults({ + source: "abc (def)", + target: "e", + functionArguments: "skip", + }), [6], "parens without function is not interpreted as a function"); + t.end(); +}); + +test("parentheticals: 'skip'", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc var(--cba)", + target: "c", + parentheticals: "skip", + }), [2]); + t.deepEqual(styleSearchResults({ + source: "abc var(--cba)", + target: "a", + parentheticals: "skip", + }), [0]); + t.deepEqual(styleSearchResults({ + source: "abc \"a var(--cba)\"", + target: "a", + parentheticals: "skip", + }), [0]); + t.deepEqual(styleSearchResults({ + source: "translate(1px, calc(1px * 2))", + target: "1", + parentheticals: "skip", + }), []); + t.deepEqual(styleSearchResults({ + source: "var(--horse)", + target: "v", + parentheticals: "skip", + }), []); + t.deepEqual(styleSearchResults({ + source: "abc (def)", + target: "e", + parentheticals: "skip", + }), [], "parens without function are still ignored"); + t.end(); +}); + +test("ignores matches inside single-quote strings", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc 'abc'", + target: "c", + }), [2]); + t.deepEqual(styleSearchResults({ + source: "abc 'abc' cba", + target: "c", + }), [ 2, 10 ]); + t.end(); +}); + +test("ignores matches inside double-quote strings", function(t) { + t.deepEqual(styleSearchResults({ + source: 'abc "abc"', + target: "c", + }), [2]); + t.deepEqual(styleSearchResults({ + source: 'abc "abc" cba', + target: "c", + }), [ 2, 10 ]); + t.end(); +}); + +test("strings: 'check'", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc 'abc'", + target: "b", + strings: "check", + }), [ 1, 6 ]); + + t.deepEqual(styleSearchResults({ + source: "abc /* 'abc' */", + target: "b", + strings: "check", + }), [1], "no strings inside comments"); + t.end(); +}); + +test("strings: 'only'", function(t) { + t.deepEqual(styleSearchResults({ + source: 'abc "abc"', + target: "b", + strings: "only", + }), [6]); + + t.deepEqual(styleSearchResults({ + source: "p[href^='https://']:before { content: \"\/*\"; \n top: 0;\n}", + target: "\n", + strings: "only", + }), [], "comments do not start inside strings"); + + t.end(); +}); + +test("ignores matches inside comments", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc/*comment*/", + target: "m", + }), []); + t.deepEqual(styleSearchResults({ + source: "abc/*command*/", + target: "a", + }), [0]); + t.end(); +}); + +test("comments: 'check'", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc/*abc*/", + target: "b", + comments: "check", + }), [ 1, 6 ]); + t.end(); +}); + +test("comments: 'only'", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc/*abc*/", + target: "b", + comments: "only", + }), [6]); + t.deepEqual(styleSearchResults({ + source: "abc/*/abc*/", + target: "b", + comments: "only", + }), [7]); + t.deepEqual(styleSearchResults({ + source: "ab'c/*abc*/c'", + target: "b", + comments: "only", + }), [], "no comments inside strings"); + t.end(); +}); + +test("ignores matches inside single-line comment", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc // comment", + target: "m", + }), []); + t.deepEqual(styleSearchResults({ + source: "abc // command", + target: "a", + }), [0]); + // Triple-slash comments are used for sassdoc + t.deepEqual(styleSearchResults({ + source: "abc /// it's all ok", + target: "a", + }), [0]); + t.end(); +}); + +test("handles escaped double-quotes in double-quote strings", function(t) { + t.deepEqual(styleSearchResults({ + source: 'abc "ab\\"c"', + target: "c", + }), [2]); + t.deepEqual(styleSearchResults({ + source: 'abc "a\\"bc" foo cba', + target: "c", + }), [ 2, 16 ]); + t.end(); +}); + +test("handles escaped double-quotes in single-quote strings", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc 'ab\\'c'", + target: "c", + }), [2]); + t.deepEqual(styleSearchResults({ + source: "abc 'a\\'bc' foo cba", + target: "c", + }), [ 2, 16 ]); + t.end(); +}); + +test("count", function(t) { + const endCounts = [] + styleSearch({ source: "123 123 123", target: "1" }, function(index, count) { + endCounts.push(count); + }); + t.deepEqual(endCounts, [ 1, 2, 3 ]); + t.end(); +}); + +test("finds parentheses", function(t) { + t.deepEqual(styleSearchResults({ + source: "a { color: rgb(0,0,0); }", + target: "(", + }), [14]); + t.deepEqual(styleSearchResults({ + source: "a { color: rgb(0,0,0); }", + target: ")", + }), [20]); + t.end(); +}); + +test("functionNames: 'check'", function(t) { + t.deepEqual(styleSearchResults({ + source: "a { color: rgb(0,0,0); }", + target: "rgb", + }), []); + t.deepEqual(styleSearchResults({ + source: "a { color: rgb(0,0,0); }", + target: "rgb", + functionNames: "check" + }), [11]); + t.end(); +}); + +test("non-single-character target", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: "abc", + }), [0]); + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: "cb", + }), [4]); + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: "c c", + }), [2]); + t.deepEqual(styleSearchResults({ + source: "abc cba abc", + target: "abc", + }), [ 0, 8 ]); + t.deepEqual(styleSearchResults({ + source: "abc cba 'abc'", + target: "abc", + }), [0]); + t.deepEqual(styleSearchResults({ + source: "abc cb", + target: "aa", + }), []); + t.end(); +}); + +test("array target", function(t) { + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: [ "a", "b" ], + }), [ 0, 1, 5, 6 ]); + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: [ "c", "b" ], + }), [ 1, 2, 4, 5 ]); + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: [ "bc", "a" ], + }), [ 0, 1, 6 ]); + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: [ "abc", "f" ], + }), [0]); + t.deepEqual(styleSearchResults({ + source: "abc cba", + target: [ 0, 1, 2 ], + }), []); + t.end(); +}); + +test("match object", function(t) { + styleSearch({ source: "abc", target: "bc" }, function(match) { + t.equal(match.startIndex, 1); + t.equal(match.endIndex, 3); + t.equal(match.target, "bc"); + t.equal(match.insideFunctionArguments, false); + t.equal(match.insideComment, false); + }); + + const twoMatches = [] + styleSearch({ source: "abc bca", target: [ "bc ", "ca" ] }, function(match) { + twoMatches.push(match); + }); + const firstMatch = twoMatches[0] + const secondMatch = twoMatches[1] + t.equal(firstMatch.startIndex, 1); + t.equal(firstMatch.endIndex, 4); + t.equal(firstMatch.target, "bc "); + t.equal(firstMatch.insideFunctionArguments, false); + t.equal(firstMatch.insideComment, false); + t.equal(secondMatch.startIndex, 5); + t.equal(secondMatch.endIndex, 7); + t.equal(secondMatch.target, "ca"); + t.equal(secondMatch.insideFunctionArguments, false); + t.equal(secondMatch.insideComment, false); + t.end(); +}); + +test("match inside a function", function(t) { + styleSearch({ source: "a { color: rgb(0, 0, 1); }", target: "1" }, function(match) { + t.equal(match.insideFunctionArguments, true); + t.equal(match.insideComment, false); + t.end(); + }); +}); + +test("match inside a comment", function(t) { + styleSearch({ + source: "a { color: /* 1 */ pink; }", + target: "1", + comments: "check" + }, function(match) { + t.equal(match.insideFunctionArguments, false); + t.equal(match.insideComment, true); + t.end(); + }); +}); + +test("match inside a block comment", function(t) { + styleSearch({ + source: "a { color:\n/**\n * 0\n * 1\n */\npink; }", + target: "1", + comments: "check" + }, function(match) { + t.equal(match.insideFunctionArguments, false); + t.equal(match.insideComment, true); + t.end(); + }); +}); + +test("match inside a comment inside function", function(t) { + styleSearch({ + source: "a { color: rgb(0, 0, 0 /* 1 */); }", + target: "1", + comments: "check" + }, function(match) { + t.equal(match.insideFunctionArguments, true); + t.equal(match.insideComment, true); + t.end(); + }); +}); + +test("error on multiple 'only' options", function(t) { + t.throws(function() { + styleSearch({ + source: "a {}", + target: "a", + comments: "only", + strings: "only", + }, function(match) {}); + }, /Only one syntax/); + t.end(); +}); diff --git a/node_modules/stylelint-config-recommended-scss/LICENSE b/node_modules/stylelint-config-recommended-scss/LICENSE new file mode 100644 index 000000000..9f82c82e4 --- /dev/null +++ b/node_modules/stylelint-config-recommended-scss/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Krister Kari + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/stylelint-config-recommended-scss/README.md b/node_modules/stylelint-config-recommended-scss/README.md new file mode 100644 index 000000000..c2e6ecfd7 --- /dev/null +++ b/node_modules/stylelint-config-recommended-scss/README.md @@ -0,0 +1,53 @@ +# stylelint-config-recommended-scss + +[![npm version](https://img.shields.io/npm/v/stylelint-config-recommended-scss?logo=npm&logoColor=fff)](https://www.npmjs.com/package/stylelint-config-recommended-scss) +[![Build Status](https://img.shields.io/github/actions/workflow/status/stylelint-scss/stylelint-config-recommended-scss/test.yml?branch=master&label=tests&logo=github)](https://github.com/stylelint-scss/stylelint-config-recommended-scss/actions/workflows/test.yml?query=workflow%3ATests) +[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen)](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github) +[![Downloads per month](https://img.shields.io/npm/dm/stylelint-config-recommended-scss)](https://npmcharts.com/compare/stylelint-config-recommended-scss) + +> The recommended shareable SCSS config for Stylelint. + +This config: + +- extends the [`stylelint-config-recommended` shared config](https://github.com/stylelint/stylelint-config-recommended) and configures its rules for SCSS +- bundles the [`stylelint-scss` plugin pack](https://github.com/stylelint-scss/stylelint-scss) and turns on its rules that check for possible errors +- bundles the [`postcss-scss` custom syntax](https://github.com/postcss/postcss-scss) and configures it + +This config is extended by the [`stylelint-config-standard-scss` shared config](https://github.com/stylelint-scss/stylelint-config-standard-scss). That config is better suited to most users as it also turns on the stylistic rules in the [`stylelint-scss` plugin pack](https://github.com/stylelint-scss/stylelint-scss). + +To see the rules that this config uses, please read the [config itself](/index.js). + +## Installation + +```shell +npm install --save-dev stylelint-config-recommended-scss +``` + +## Usage + +Set your `stylelint` config to: + +```json +{ + "extends": "stylelint-config-recommended-scss" +} +``` + +### Extending the config + +Simply add a `"rules"` key to your config, then add your overrides and additions there. + +For example, to turn off the `scss/at-if-no-null` rule: + +```json +{ + "extends": "stylelint-config-recommended-scss", + "rules": { + "scss/at-if-no-null": null + } +} +``` + +## [Changelog](CHANGELOG.md) + +## [License](LICENSE) diff --git a/node_modules/stylelint-config-recommended-scss/index.js b/node_modules/stylelint-config-recommended-scss/index.js new file mode 100644 index 000000000..811831725 --- /dev/null +++ b/node_modules/stylelint-config-recommended-scss/index.js @@ -0,0 +1,36 @@ +'use strict'; + +const postcssScss = require('postcss-scss'); + +module.exports = { + extends: ['stylelint-config-recommended'], + customSyntax: postcssScss, + plugins: ['stylelint-scss'], + rules: { + 'annotation-no-unknown': null, + 'at-rule-no-unknown': null, + 'comment-no-empty': null, + 'function-no-unknown': null, + 'no-invalid-position-at-import-rule': [ + true, + { + ignoreAtRules: ['use', 'forward'], + }, + ], + 'scss/at-extend-no-missing-placeholder': true, + 'scss/at-if-no-null': true, + 'scss/at-import-no-partial-leading-underscore': true, + 'scss/at-import-partial-extension': 'never', + 'scss/at-rule-no-unknown': true, + 'scss/comment-no-empty': true, + 'scss/declaration-nested-properties-no-divided-groups': true, + 'scss/dollar-variable-no-missing-interpolation': true, + 'scss/function-quote-no-quoted-strings-inside': true, + 'scss/function-unquote-no-unquoted-strings-inside': true, + 'scss/no-duplicate-mixins': true, + 'scss/no-global-function-names': true, + 'scss/operator-no-newline-after': true, + 'scss/operator-no-newline-before': true, + 'scss/operator-no-unspaced': true, + }, +}; diff --git a/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/LICENSE b/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/LICENSE new file mode 100644 index 000000000..fb97970a4 --- /dev/null +++ b/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 - present stylelint + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/README.md b/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/README.md new file mode 100644 index 000000000..a9b722bb8 --- /dev/null +++ b/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/README.md @@ -0,0 +1,51 @@ +# stylelint-config-recommended + +[![NPM version](https://img.shields.io/npm/v/stylelint-config-recommended.svg)](https://www.npmjs.org/package/stylelint-config-recommended) [![Build Status](https://github.com/stylelint/stylelint-config-recommended/workflows/CI/badge.svg)](https://github.com/stylelint/stylelint-config-recommended/actions) + +> The recommended shareable config for Stylelint. + +It turns on most of the Stylelint rules that help you [_avoid errors_](https://stylelint.io/user-guide/rules/#avoid-errors). + +You can use this as a foundation for your own config, but we suggest most people use our [standard config](https://www.npmjs.com/package/stylelint-config-standard) instead which extends this config and adds a few more rules to enforce common conventions. + +## Installation + +```bash +npm install stylelint-config-recommended --save-dev +``` + +## Usage + +Set your `stylelint` config to: + +```json +{ + "extends": "stylelint-config-recommended" +} +``` + +### Extending the config + +Add a `"rules"` key to your config, then add your overrides and additions there. + +For example, to change the `at-rule-no-unknown` rule to use its `ignoreAtRules` option, turn off the `block-no-empty` rule, and add the `unit-allowed-list` rule: + +```json +{ + "extends": "stylelint-config-recommended", + "rules": { + "at-rule-no-unknown": [ + true, + { + "ignoreAtRules": ["extends"] + } + ], + "block-no-empty": null, + "unit-allowed-list": ["em", "rem", "s"] + } +} +``` + +## [Changelog](CHANGELOG.md) + +## [License](LICENSE) diff --git a/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/index.js b/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/index.js new file mode 100644 index 000000000..4236def14 --- /dev/null +++ b/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/index.js @@ -0,0 +1,48 @@ +'use strict'; + +module.exports = { + rules: { + 'annotation-no-unknown': true, + 'at-rule-no-unknown': true, + 'block-no-empty': true, + 'color-no-invalid-hex': true, + 'comment-no-empty': true, + 'custom-property-no-missing-var-function': true, + 'declaration-block-no-duplicate-custom-properties': true, + 'declaration-block-no-duplicate-properties': [ + true, + { + ignore: ['consecutive-duplicates-with-different-syntaxes'], + }, + ], + 'declaration-block-no-shorthand-property-overrides': true, + 'font-family-no-duplicate-names': true, + 'font-family-no-missing-generic-family-keyword': true, + 'function-calc-no-unspaced-operator': true, + 'function-linear-gradient-no-nonstandard-direction': true, + 'function-no-unknown': true, + 'keyframe-block-no-duplicate-selectors': true, + 'keyframe-declaration-no-important': true, + 'media-feature-name-no-unknown': true, + 'named-grid-areas-no-invalid': true, + 'no-descending-specificity': true, + 'no-duplicate-at-import-rules': true, + 'no-duplicate-selectors': true, + 'no-empty-source': true, + 'no-invalid-double-slash-comments': true, + 'no-invalid-position-at-import-rule': true, + 'no-irregular-whitespace': true, + 'property-no-unknown': true, + 'selector-anb-no-unmatchable': true, + 'selector-pseudo-class-no-unknown': true, + 'selector-pseudo-element-no-unknown': true, + 'selector-type-no-unknown': [ + true, + { + ignore: ['custom-elements'], + }, + ], + 'string-no-newline': true, + 'unit-no-unknown': true, + }, +}; diff --git a/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/package.json b/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/package.json new file mode 100644 index 000000000..f79b711b3 --- /dev/null +++ b/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/package.json @@ -0,0 +1,67 @@ +{ + "name": "stylelint-config-recommended", + "version": "12.0.0", + "description": "Recommended shareable config for Stylelint", + "keywords": [ + "stylelint", + "stylelint-config", + "recommended" + ], + "repository": "stylelint/stylelint-config-recommended", + "license": "MIT", + "author": "Stylelint", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "format": "prettier . --write", + "prepare": "husky install", + "lint:formatting": "prettier . --check", + "lint:js": "eslint . --ignore-path .gitignore", + "lint:md": "remark . --quiet --frail --ignore-path .gitignore", + "lint": "npm-run-all --parallel lint:*", + "release": "np", + "pretest": "npm run lint", + "test": "jest", + "watch": "jest --watch" + }, + "lint-staged": { + "*.js": "eslint --cache --fix", + "*.{js,md,yml}": "prettier --write" + }, + "prettier": "@stylelint/prettier-config", + "eslintConfig": { + "extends": [ + "stylelint", + "stylelint/jest" + ], + "globals": { + "module": true, + "require": true + } + }, + "remarkConfig": { + "plugins": [ + "@stylelint/remark-preset" + ] + }, + "devDependencies": { + "@stylelint/prettier-config": "^2.0.0", + "@stylelint/remark-preset": "^4.0.0", + "eslint": "^8.38.0", + "eslint-config-stylelint": "^18.0.0", + "eslint-plugin-jest": "^27.2.1", + "husky": "^8.0.3", + "jest": "^29.5.0", + "lint-staged": "^13.2.1", + "np": "^7.7.0", + "npm-run-all": "^4.1.5", + "prettier": "^2.8.7", + "remark-cli": "^11.0.0", + "stylelint": "^15.5.0" + }, + "peerDependencies": { + "stylelint": "^15.5.0" + } +} diff --git a/node_modules/stylelint-config-recommended-scss/package.json b/node_modules/stylelint-config-recommended-scss/package.json new file mode 100644 index 000000000..82408014e --- /dev/null +++ b/node_modules/stylelint-config-recommended-scss/package.json @@ -0,0 +1,55 @@ +{ + "name": "stylelint-config-recommended-scss", + "version": "12.0.0", + "description": "The recommended shareable SCSS config for Stylelint", + "keywords": [ + "stylelint", + "stylelint-config", + "recommended", + "scss" + ], + "repository": "stylelint-scss/stylelint-config-recommended-scss", + "license": "MIT", + "author": "kristerkari", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "format": "prettier . --write", + "lint": "npm-run-all --parallel lint:*", + "lint:formatting": "prettier . --check", + "lint:js": "eslint . --ignore-path .gitignore", + "lint:md": "remark . --quiet --frail --ignore-path .gitignore", + "release": "np", + "test": "jest", + "watch": "jest --watch" + }, + "dependencies": { + "postcss-scss": "^4.0.6", + "stylelint-config-recommended": "^12.0.0", + "stylelint-scss": "^5.0.0" + }, + "devDependencies": { + "@stylelint/prettier-config": "^2.0.0", + "@stylelint/remark-preset": "^4.0.0", + "eslint": "^8.39.0", + "eslint-config-stylelint": "^18.0.0", + "eslint-plugin-jest": "^27.2.1", + "jest": "^29.5.0", + "np": "^7.7.0", + "npm-run-all2": "^5.0.2", + "prettier": "^2.8.8", + "remark-cli": "^11.0.0", + "stylelint": "^15.6.1" + }, + "peerDependencies": { + "postcss": "^8.3.3", + "stylelint": "^15.5.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + } + } +} diff --git a/node_modules/stylelint-config-recommended/LICENSE b/node_modules/stylelint-config-recommended/LICENSE new file mode 100644 index 000000000..fb97970a4 --- /dev/null +++ b/node_modules/stylelint-config-recommended/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 - present stylelint + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/stylelint-config-recommended/README.md b/node_modules/stylelint-config-recommended/README.md new file mode 100644 index 000000000..a9b722bb8 --- /dev/null +++ b/node_modules/stylelint-config-recommended/README.md @@ -0,0 +1,51 @@ +# stylelint-config-recommended + +[![NPM version](https://img.shields.io/npm/v/stylelint-config-recommended.svg)](https://www.npmjs.org/package/stylelint-config-recommended) [![Build Status](https://github.com/stylelint/stylelint-config-recommended/workflows/CI/badge.svg)](https://github.com/stylelint/stylelint-config-recommended/actions) + +> The recommended shareable config for Stylelint. + +It turns on most of the Stylelint rules that help you [_avoid errors_](https://stylelint.io/user-guide/rules/#avoid-errors). + +You can use this as a foundation for your own config, but we suggest most people use our [standard config](https://www.npmjs.com/package/stylelint-config-standard) instead which extends this config and adds a few more rules to enforce common conventions. + +## Installation + +```bash +npm install stylelint-config-recommended --save-dev +``` + +## Usage + +Set your `stylelint` config to: + +```json +{ + "extends": "stylelint-config-recommended" +} +``` + +### Extending the config + +Add a `"rules"` key to your config, then add your overrides and additions there. + +For example, to change the `at-rule-no-unknown` rule to use its `ignoreAtRules` option, turn off the `block-no-empty` rule, and add the `unit-allowed-list` rule: + +```json +{ + "extends": "stylelint-config-recommended", + "rules": { + "at-rule-no-unknown": [ + true, + { + "ignoreAtRules": ["extends"] + } + ], + "block-no-empty": null, + "unit-allowed-list": ["em", "rem", "s"] + } +} +``` + +## [Changelog](CHANGELOG.md) + +## [License](LICENSE) diff --git a/node_modules/stylelint-config-recommended/index.js b/node_modules/stylelint-config-recommended/index.js new file mode 100644 index 000000000..71feb593d --- /dev/null +++ b/node_modules/stylelint-config-recommended/index.js @@ -0,0 +1,49 @@ +'use strict'; + +module.exports = { + rules: { + 'annotation-no-unknown': true, + 'at-rule-no-unknown': true, + 'block-no-empty': true, + 'color-no-invalid-hex': true, + 'comment-no-empty': true, + 'custom-property-no-missing-var-function': true, + 'declaration-block-no-duplicate-custom-properties': true, + 'declaration-block-no-duplicate-properties': [ + true, + { + ignore: ['consecutive-duplicates-with-different-syntaxes'], + }, + ], + 'declaration-block-no-shorthand-property-overrides': true, + 'font-family-no-duplicate-names': true, + 'font-family-no-missing-generic-family-keyword': true, + 'function-calc-no-unspaced-operator': true, + 'function-linear-gradient-no-nonstandard-direction': true, + 'function-no-unknown': true, + 'keyframe-block-no-duplicate-selectors': true, + 'keyframe-declaration-no-important': true, + 'media-feature-name-no-unknown': true, + 'media-query-no-invalid': true, + 'named-grid-areas-no-invalid': true, + 'no-descending-specificity': true, + 'no-duplicate-at-import-rules': true, + 'no-duplicate-selectors': true, + 'no-empty-source': true, + 'no-invalid-double-slash-comments': true, + 'no-invalid-position-at-import-rule': true, + 'no-irregular-whitespace': true, + 'property-no-unknown': true, + 'selector-anb-no-unmatchable': true, + 'selector-pseudo-class-no-unknown': true, + 'selector-pseudo-element-no-unknown': true, + 'selector-type-no-unknown': [ + true, + { + ignore: ['custom-elements'], + }, + ], + 'string-no-newline': true, + 'unit-no-unknown': true, + }, +}; diff --git a/node_modules/stylelint-config-recommended/package.json b/node_modules/stylelint-config-recommended/package.json new file mode 100644 index 000000000..311ba1fa9 --- /dev/null +++ b/node_modules/stylelint-config-recommended/package.json @@ -0,0 +1,70 @@ +{ + "name": "stylelint-config-recommended", + "version": "13.0.0", + "description": "Recommended shareable config for Stylelint", + "keywords": [ + "stylelint", + "stylelint-config", + "recommended" + ], + "repository": "stylelint/stylelint-config-recommended", + "license": "MIT", + "author": "Stylelint", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "format": "prettier . --write", + "prepare": "husky install", + "lint:formatting": "prettier . --check", + "lint:js": "eslint . --ignore-path .gitignore", + "lint:md": "remark . --quiet --frail --ignore-path .gitignore", + "lint": "npm-run-all --parallel lint:*", + "release": "np", + "pretest": "npm run lint", + "test": "jest", + "watch": "jest --watch" + }, + "lint-staged": { + "*.js": "eslint --cache --fix", + "*.{js,md,yml}": "prettier --write" + }, + "prettier": "@stylelint/prettier-config", + "eslintConfig": { + "extends": [ + "stylelint", + "stylelint/jest" + ], + "globals": { + "module": true, + "require": true + } + }, + "remarkConfig": { + "plugins": [ + "@stylelint/remark-preset" + ] + }, + "devDependencies": { + "@stylelint/prettier-config": "^2.0.0", + "@stylelint/remark-preset": "^4.0.0", + "eslint": "^8.43.0", + "eslint-config-stylelint": "^18.0.0", + "eslint-plugin-jest": "^27.2.1", + "husky": "^8.0.3", + "jest": "^29.5.0", + "lint-staged": "^13.2.2", + "np": "^8.0.4", + "npm-run-all": "^4.1.5", + "prettier": "^2.8.8", + "remark-cli": "^11.0.0", + "stylelint": "^15.10.0" + }, + "peerDependencies": { + "stylelint": "^15.10.0" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + } +} diff --git a/node_modules/stylelint-config-standard-scss/LICENSE b/node_modules/stylelint-config-standard-scss/LICENSE new file mode 100644 index 000000000..c0e6a9f20 --- /dev/null +++ b/node_modules/stylelint-config-standard-scss/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2021 Present stylelint-scss authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/stylelint-config-standard-scss/README.md b/node_modules/stylelint-config-standard-scss/README.md new file mode 100644 index 000000000..a9ef31d06 --- /dev/null +++ b/node_modules/stylelint-config-standard-scss/README.md @@ -0,0 +1,50 @@ +# stylelint-config-standard-scss + +[![npm version](https://img.shields.io/npm/v/stylelint-config-standard-scss?logo=npm&logoColor=fff)](https://www.npmjs.com/package/stylelint-config-standard-scss) +[![Build Status](https://img.shields.io/github/actions/workflow/status/stylelint-scss/stylelint-config-standard-scss/test.yml?branch=main&label=tests&logo=github)](https://github.com/stylelint-scss/stylelint-config-standard-scss/actions/workflows/test.yml?query=workflow%3ATests) +[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen)](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github) +[![Downloads per month](https://img.shields.io/npm/dm/stylelint-config-standard-scss)](https://npmcharts.com/compare/stylelint-config-standard-scss) + +> The standard shareable SCSS config for Stylelint. + +This config: + +- extends the [`stylelint-config-standard` shared config](https://github.com/stylelint/stylelint-config-standard) and configures its rules for SCSS +- extends the [`stylelint-config-recommended-scss` shared config](https://github.com/stylelint-scss/stylelint-config-recommended-scss) + +To see the rules that this config uses, please read the [config itself](/index.js). + +## Installation + +```shell +npm install --save-dev stylelint-config-standard-scss +``` + +## Usage + +Set your `stylelint` config to: + +```json +{ + "extends": "stylelint-config-standard-scss" +} +``` + +### Extending the config + +Simply add a `"rules"` key to your config, then add your overrides and additions there. + +For example, to turn off the `scss/dollar-variable-pattern` rule: + +```json +{ + "extends": "stylelint-config-standard-scss", + "rules": { + "scss/dollar-variable-pattern": null + } +} +``` + +## [Changelog](CHANGELOG.md) + +## [License](LICENSE) diff --git a/node_modules/stylelint-config-standard-scss/index.js b/node_modules/stylelint-config-standard-scss/index.js new file mode 100644 index 000000000..2cf42c66d --- /dev/null +++ b/node_modules/stylelint-config-standard-scss/index.js @@ -0,0 +1,67 @@ +'use strict'; + +module.exports = { + extends: ['stylelint-config-standard', 'stylelint-config-recommended-scss'], + rules: { + 'at-rule-empty-line-before': [ + 'always', + { + except: ['blockless-after-blockless', 'first-nested'], + ignore: ['after-comment'], + ignoreAtRules: ['else'], + }, + ], + 'import-notation': 'string', + 'scss/at-else-closing-brace-newline-after': 'always-last-in-chain', + 'scss/at-else-closing-brace-space-after': 'always-intermediate', + 'scss/at-else-empty-line-before': 'never', + 'scss/at-else-if-parentheses-space-before': 'always', + 'scss/at-function-parentheses-space-before': 'never', + 'scss/at-function-pattern': [ + '^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: 'Expected function name to be kebab-case', + }, + ], + 'scss/at-if-closing-brace-newline-after': 'always-last-in-chain', + 'scss/at-if-closing-brace-space-after': 'always-intermediate', + 'scss/at-mixin-argumentless-call-parentheses': 'never', + 'scss/at-mixin-parentheses-space-before': 'never', + 'scss/at-mixin-pattern': [ + '^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: 'Expected mixin name to be kebab-case', + }, + ], + 'scss/at-rule-conditional-no-parentheses': true, + 'scss/dollar-variable-colon-space-after': 'always', + 'scss/dollar-variable-colon-space-before': 'never', + 'scss/dollar-variable-empty-line-before': [ + 'always', + { + except: ['after-dollar-variable', 'first-nested'], + ignore: ['after-comment', 'inside-single-line-block'], + }, + ], + 'scss/dollar-variable-pattern': [ + '^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: 'Expected variable to be kebab-case', + }, + ], + 'scss/double-slash-comment-empty-line-before': [ + 'always', + { + except: ['first-nested'], + ignore: ['between-comments', 'stylelint-commands'], + }, + ], + 'scss/double-slash-comment-whitespace-inside': 'always', + 'scss/percent-placeholder-pattern': [ + '^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: 'Expected placeholder to be kebab-case', + }, + ], + }, +}; diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/LICENSE b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/LICENSE new file mode 100644 index 000000000..fb97970a4 --- /dev/null +++ b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 - present stylelint + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/README.md b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/README.md new file mode 100644 index 000000000..a9b722bb8 --- /dev/null +++ b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/README.md @@ -0,0 +1,51 @@ +# stylelint-config-recommended + +[![NPM version](https://img.shields.io/npm/v/stylelint-config-recommended.svg)](https://www.npmjs.org/package/stylelint-config-recommended) [![Build Status](https://github.com/stylelint/stylelint-config-recommended/workflows/CI/badge.svg)](https://github.com/stylelint/stylelint-config-recommended/actions) + +> The recommended shareable config for Stylelint. + +It turns on most of the Stylelint rules that help you [_avoid errors_](https://stylelint.io/user-guide/rules/#avoid-errors). + +You can use this as a foundation for your own config, but we suggest most people use our [standard config](https://www.npmjs.com/package/stylelint-config-standard) instead which extends this config and adds a few more rules to enforce common conventions. + +## Installation + +```bash +npm install stylelint-config-recommended --save-dev +``` + +## Usage + +Set your `stylelint` config to: + +```json +{ + "extends": "stylelint-config-recommended" +} +``` + +### Extending the config + +Add a `"rules"` key to your config, then add your overrides and additions there. + +For example, to change the `at-rule-no-unknown` rule to use its `ignoreAtRules` option, turn off the `block-no-empty` rule, and add the `unit-allowed-list` rule: + +```json +{ + "extends": "stylelint-config-recommended", + "rules": { + "at-rule-no-unknown": [ + true, + { + "ignoreAtRules": ["extends"] + } + ], + "block-no-empty": null, + "unit-allowed-list": ["em", "rem", "s"] + } +} +``` + +## [Changelog](CHANGELOG.md) + +## [License](LICENSE) diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/index.js b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/index.js new file mode 100644 index 000000000..4236def14 --- /dev/null +++ b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/index.js @@ -0,0 +1,48 @@ +'use strict'; + +module.exports = { + rules: { + 'annotation-no-unknown': true, + 'at-rule-no-unknown': true, + 'block-no-empty': true, + 'color-no-invalid-hex': true, + 'comment-no-empty': true, + 'custom-property-no-missing-var-function': true, + 'declaration-block-no-duplicate-custom-properties': true, + 'declaration-block-no-duplicate-properties': [ + true, + { + ignore: ['consecutive-duplicates-with-different-syntaxes'], + }, + ], + 'declaration-block-no-shorthand-property-overrides': true, + 'font-family-no-duplicate-names': true, + 'font-family-no-missing-generic-family-keyword': true, + 'function-calc-no-unspaced-operator': true, + 'function-linear-gradient-no-nonstandard-direction': true, + 'function-no-unknown': true, + 'keyframe-block-no-duplicate-selectors': true, + 'keyframe-declaration-no-important': true, + 'media-feature-name-no-unknown': true, + 'named-grid-areas-no-invalid': true, + 'no-descending-specificity': true, + 'no-duplicate-at-import-rules': true, + 'no-duplicate-selectors': true, + 'no-empty-source': true, + 'no-invalid-double-slash-comments': true, + 'no-invalid-position-at-import-rule': true, + 'no-irregular-whitespace': true, + 'property-no-unknown': true, + 'selector-anb-no-unmatchable': true, + 'selector-pseudo-class-no-unknown': true, + 'selector-pseudo-element-no-unknown': true, + 'selector-type-no-unknown': [ + true, + { + ignore: ['custom-elements'], + }, + ], + 'string-no-newline': true, + 'unit-no-unknown': true, + }, +}; diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/package.json b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/package.json new file mode 100644 index 000000000..f79b711b3 --- /dev/null +++ b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/package.json @@ -0,0 +1,67 @@ +{ + "name": "stylelint-config-recommended", + "version": "12.0.0", + "description": "Recommended shareable config for Stylelint", + "keywords": [ + "stylelint", + "stylelint-config", + "recommended" + ], + "repository": "stylelint/stylelint-config-recommended", + "license": "MIT", + "author": "Stylelint", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "format": "prettier . --write", + "prepare": "husky install", + "lint:formatting": "prettier . --check", + "lint:js": "eslint . --ignore-path .gitignore", + "lint:md": "remark . --quiet --frail --ignore-path .gitignore", + "lint": "npm-run-all --parallel lint:*", + "release": "np", + "pretest": "npm run lint", + "test": "jest", + "watch": "jest --watch" + }, + "lint-staged": { + "*.js": "eslint --cache --fix", + "*.{js,md,yml}": "prettier --write" + }, + "prettier": "@stylelint/prettier-config", + "eslintConfig": { + "extends": [ + "stylelint", + "stylelint/jest" + ], + "globals": { + "module": true, + "require": true + } + }, + "remarkConfig": { + "plugins": [ + "@stylelint/remark-preset" + ] + }, + "devDependencies": { + "@stylelint/prettier-config": "^2.0.0", + "@stylelint/remark-preset": "^4.0.0", + "eslint": "^8.38.0", + "eslint-config-stylelint": "^18.0.0", + "eslint-plugin-jest": "^27.2.1", + "husky": "^8.0.3", + "jest": "^29.5.0", + "lint-staged": "^13.2.1", + "np": "^7.7.0", + "npm-run-all": "^4.1.5", + "prettier": "^2.8.7", + "remark-cli": "^11.0.0", + "stylelint": "^15.5.0" + }, + "peerDependencies": { + "stylelint": "^15.5.0" + } +} diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/LICENSE b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/LICENSE new file mode 100644 index 000000000..5d3ebd2ba --- /dev/null +++ b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2015 - present stylelint authors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/README.md b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/README.md new file mode 100644 index 000000000..7508154d3 --- /dev/null +++ b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/README.md @@ -0,0 +1,128 @@ +# stylelint-config-standard + +[![NPM version](https://img.shields.io/npm/v/stylelint-config-standard.svg)](https://www.npmjs.org/package/stylelint-config-standard) [![Build Status](https://github.com/stylelint/stylelint-config-standard/workflows/CI/badge.svg)](https://github.com/stylelint/stylelint-config-standard/actions) + +> The standard shareable config for Stylelint. + +It extends [`stylelint-config-recommended`](https://github.com/stylelint/stylelint-config-recommended) and turns on additional rules to enforce modern conventions found in the [CSS specifications](https://www.w3.org/Style/CSS/current-work). + +To see the rules that this config uses, please read the [config itself](./index.js). + +## Example + +```css +@import url("foo.css"); +@import url("bar.css"); + +@custom-media --foo (min-width: 30em); + +/** + * Multi-line comment + */ + +:root { + --brand-red: hsl(5deg 10% 40%); +} + +/* Single-line comment */ + +.class-foo:not(a, div) { + margin: 0; + top: calc(100% - 2rem); +} + +/* Flush single line comment */ +@media (width >= 60em) { + #id-bar { + /* Flush to parent comment */ + --offset: 0px; + + color: #fff; + font-family: Helvetica, "Arial Black", sans-serif; + left: calc(var(--offset) + 50%); + } + + /* Flush nested single line comment */ + a::after { + display: block; + content: "→"; + background-image: url("x.svg"); + } +} + +@keyframes fade-in { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} +``` + +_Note: the config is tested against this example, as such the example contains plenty of CSS syntax and features._ + +## Installation + +```bash +npm install stylelint-config-standard --save-dev +``` + +## Usage + +Set your Stylelint config to: + +```json +{ + "extends": "stylelint-config-standard" +} +``` + +### Extending the config + +Add a `"rules"` key to your config, then add your overrides and additions there. + +You can turn off rules by setting its value to `null`. For example: + +```json +{ + "extends": "stylelint-config-standard", + "rules": { + "selector-class-pattern": null + } +} +``` + +Or lower the severity of a rule to a warning using the `severity` secondary option. For example: + +```json +{ + "extends": "stylelint-config-standard", + "rules": { + "property-no-vendor-prefix": [ + true, + { + "severity": "warning" + } + ] + } +} +``` + +Or to add a rule, For example, the `unit-allowed-list` one: + +```json +{ + "extends": "stylelint-config-standard", + "rules": { + "unit-allowed-list": ["em", "rem", "s"] + } +} +``` + +We recommend adding more of [Stylelint's rules](https://stylelint.io/user-guide/rules/) to your config as these rules need to be configured to suit your specific needs. + +## [Changelog](CHANGELOG.md) + +## [License](LICENSE) diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/index.js b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/index.js new file mode 100644 index 000000000..3f89ae893 --- /dev/null +++ b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/index.js @@ -0,0 +1,120 @@ +'use strict'; + +module.exports = { + extends: 'stylelint-config-recommended', + rules: { + 'alpha-value-notation': [ + 'percentage', + { + exceptProperties: [ + 'opacity', + 'fill-opacity', + 'flood-opacity', + 'stop-opacity', + 'stroke-opacity', + ], + }, + ], + 'at-rule-empty-line-before': [ + 'always', + { + except: ['blockless-after-same-name-blockless', 'first-nested'], + ignore: ['after-comment'], + }, + ], + 'at-rule-no-vendor-prefix': true, + 'color-function-notation': 'modern', + 'color-hex-length': 'short', + 'comment-empty-line-before': [ + 'always', + { + except: ['first-nested'], + ignore: ['stylelint-commands'], + }, + ], + 'comment-whitespace-inside': 'always', + 'custom-property-empty-line-before': [ + 'always', + { + except: ['after-custom-property', 'first-nested'], + ignore: ['after-comment', 'inside-single-line-block'], + }, + ], + 'custom-media-pattern': [ + '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: (name) => `Expected custom media query name "${name}" to be kebab-case`, + }, + ], + 'custom-property-pattern': [ + '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: (name) => `Expected custom property name "${name}" to be kebab-case`, + }, + ], + 'declaration-block-no-redundant-longhand-properties': true, + 'declaration-block-single-line-max-declarations': 1, + 'declaration-empty-line-before': [ + 'always', + { + except: ['after-declaration', 'first-nested'], + ignore: ['after-comment', 'inside-single-line-block'], + }, + ], + 'font-family-name-quotes': 'always-where-recommended', + 'function-name-case': 'lower', + 'function-url-quotes': 'always', + 'hue-degree-notation': 'angle', + 'import-notation': 'url', + 'keyframe-selector-notation': 'percentage-unless-within-keyword-only-block', + 'keyframes-name-pattern': [ + '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: (name) => `Expected keyframe name "${name}" to be kebab-case`, + }, + ], + 'length-zero-no-unit': [ + true, + { + ignore: ['custom-properties'], + }, + ], + 'media-feature-name-no-vendor-prefix': true, + 'media-feature-range-notation': 'context', + 'number-max-precision': 4, + 'property-no-vendor-prefix': true, + 'rule-empty-line-before': [ + 'always-multi-line', + { + except: ['first-nested'], + ignore: ['after-comment'], + }, + ], + 'selector-attribute-quotes': 'always', + 'selector-class-pattern': [ + '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: (selector) => `Expected class selector "${selector}" to be kebab-case`, + }, + ], + 'selector-id-pattern': [ + '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: (selector) => `Expected id selector "${selector}" to be kebab-case`, + }, + ], + 'selector-no-vendor-prefix': true, + 'selector-not-notation': 'complex', + 'selector-pseudo-element-colon-notation': 'double', + 'selector-type-case': 'lower', + 'shorthand-property-no-redundant-values': true, + 'value-keyword-case': 'lower', + 'value-no-vendor-prefix': [ + true, + { + // `-webkit-box` is allowed as standard. See https://www.w3.org/TR/css-overflow-3/#webkit-line-clamp + ignoreValues: ['box', 'inline-box'], + }, + ], + }, +}; diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/package.json b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/package.json new file mode 100644 index 000000000..e66f1b1ef --- /dev/null +++ b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/package.json @@ -0,0 +1,70 @@ +{ + "name": "stylelint-config-standard", + "version": "33.0.0", + "description": "Standard shareable config for Stylelint", + "keywords": [ + "stylelint", + "stylelint-config", + "standard" + ], + "repository": "stylelint/stylelint-config-standard", + "license": "MIT", + "author": "Stylelint", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "format": "prettier . --write", + "prepare": "husky install", + "lint:formatting": "prettier . --check", + "lint:js": "eslint . --ignore-path .gitignore", + "lint:md": "remark . --quiet --frail --ignore-path .gitignore", + "lint": "npm-run-all --parallel lint:*", + "release": "np", + "pretest": "npm run lint", + "test": "jest", + "watch": "jest --watch" + }, + "lint-staged": { + "*.js": "eslint --cache --fix", + "*.{js,md,yml}": "prettier --write" + }, + "prettier": "@stylelint/prettier-config", + "eslintConfig": { + "extends": [ + "stylelint", + "stylelint/jest" + ], + "globals": { + "module": true, + "require": true + } + }, + "remarkConfig": { + "plugins": [ + "@stylelint/remark-preset" + ] + }, + "dependencies": { + "stylelint-config-recommended": "^12.0.0" + }, + "devDependencies": { + "@stylelint/prettier-config": "^2.0.0", + "@stylelint/remark-preset": "^4.0.0", + "eslint": "^8.38.0", + "eslint-config-stylelint": "^18.0.0", + "eslint-plugin-jest": "^27.2.1", + "husky": "^8.0.3", + "jest": "^29.5.0", + "lint-staged": "^13.2.1", + "np": "^7.7.0", + "npm-run-all": "^4.1.5", + "prettier": "^2.8.7", + "remark-cli": "^11.0.0", + "stylelint": "^15.5.0" + }, + "peerDependencies": { + "stylelint": "^15.5.0" + } +} diff --git a/node_modules/stylelint-config-standard-scss/package.json b/node_modules/stylelint-config-standard-scss/package.json new file mode 100644 index 000000000..d1a475355 --- /dev/null +++ b/node_modules/stylelint-config-standard-scss/package.json @@ -0,0 +1,54 @@ +{ + "name": "stylelint-config-standard-scss", + "version": "10.0.0", + "description": "The standard shareable SCSS config for Stylelint", + "keywords": [ + "stylelint", + "stylelint-config", + "standard", + "scss" + ], + "repository": "stylelint-scss/stylelint-config-standard-scss", + "license": "MIT", + "author": "Stylelint SCSS", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "format": "prettier . --write", + "lint": "npm-run-all --parallel lint:*", + "lint:formatting": "prettier . --check", + "lint:js": "eslint . --ignore-path .gitignore", + "lint:md": "remark . --quiet --frail --ignore-path .gitignore", + "release": "np", + "test": "jest", + "watch": "jest --watch" + }, + "dependencies": { + "stylelint-config-recommended-scss": "^12.0.0", + "stylelint-config-standard": "^33.0.0" + }, + "devDependencies": { + "@stylelint/prettier-config": "^2.0.0", + "@stylelint/remark-preset": "^4.0.0", + "eslint": "^8.41.0", + "eslint-config-stylelint": "^18.0.0", + "eslint-plugin-jest": "^27.2.1", + "jest": "^29.5.0", + "np": "^8.0.2", + "npm-run-all2": "^5.0.2", + "prettier": "^2.8.8", + "remark-cli": "^11.0.0", + "stylelint": "^15.6.2" + }, + "peerDependencies": { + "postcss": "^8.3.3", + "stylelint": "^15.5.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + } + } +} diff --git a/node_modules/stylelint-config-standard/LICENSE b/node_modules/stylelint-config-standard/LICENSE new file mode 100644 index 000000000..5d3ebd2ba --- /dev/null +++ b/node_modules/stylelint-config-standard/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2015 - present stylelint authors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/stylelint-config-standard/README.md b/node_modules/stylelint-config-standard/README.md new file mode 100644 index 000000000..7508154d3 --- /dev/null +++ b/node_modules/stylelint-config-standard/README.md @@ -0,0 +1,128 @@ +# stylelint-config-standard + +[![NPM version](https://img.shields.io/npm/v/stylelint-config-standard.svg)](https://www.npmjs.org/package/stylelint-config-standard) [![Build Status](https://github.com/stylelint/stylelint-config-standard/workflows/CI/badge.svg)](https://github.com/stylelint/stylelint-config-standard/actions) + +> The standard shareable config for Stylelint. + +It extends [`stylelint-config-recommended`](https://github.com/stylelint/stylelint-config-recommended) and turns on additional rules to enforce modern conventions found in the [CSS specifications](https://www.w3.org/Style/CSS/current-work). + +To see the rules that this config uses, please read the [config itself](./index.js). + +## Example + +```css +@import url("foo.css"); +@import url("bar.css"); + +@custom-media --foo (min-width: 30em); + +/** + * Multi-line comment + */ + +:root { + --brand-red: hsl(5deg 10% 40%); +} + +/* Single-line comment */ + +.class-foo:not(a, div) { + margin: 0; + top: calc(100% - 2rem); +} + +/* Flush single line comment */ +@media (width >= 60em) { + #id-bar { + /* Flush to parent comment */ + --offset: 0px; + + color: #fff; + font-family: Helvetica, "Arial Black", sans-serif; + left: calc(var(--offset) + 50%); + } + + /* Flush nested single line comment */ + a::after { + display: block; + content: "→"; + background-image: url("x.svg"); + } +} + +@keyframes fade-in { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} +``` + +_Note: the config is tested against this example, as such the example contains plenty of CSS syntax and features._ + +## Installation + +```bash +npm install stylelint-config-standard --save-dev +``` + +## Usage + +Set your Stylelint config to: + +```json +{ + "extends": "stylelint-config-standard" +} +``` + +### Extending the config + +Add a `"rules"` key to your config, then add your overrides and additions there. + +You can turn off rules by setting its value to `null`. For example: + +```json +{ + "extends": "stylelint-config-standard", + "rules": { + "selector-class-pattern": null + } +} +``` + +Or lower the severity of a rule to a warning using the `severity` secondary option. For example: + +```json +{ + "extends": "stylelint-config-standard", + "rules": { + "property-no-vendor-prefix": [ + true, + { + "severity": "warning" + } + ] + } +} +``` + +Or to add a rule, For example, the `unit-allowed-list` one: + +```json +{ + "extends": "stylelint-config-standard", + "rules": { + "unit-allowed-list": ["em", "rem", "s"] + } +} +``` + +We recommend adding more of [Stylelint's rules](https://stylelint.io/user-guide/rules/) to your config as these rules need to be configured to suit your specific needs. + +## [Changelog](CHANGELOG.md) + +## [License](LICENSE) diff --git a/node_modules/stylelint-config-standard/index.js b/node_modules/stylelint-config-standard/index.js new file mode 100644 index 000000000..3f89ae893 --- /dev/null +++ b/node_modules/stylelint-config-standard/index.js @@ -0,0 +1,120 @@ +'use strict'; + +module.exports = { + extends: 'stylelint-config-recommended', + rules: { + 'alpha-value-notation': [ + 'percentage', + { + exceptProperties: [ + 'opacity', + 'fill-opacity', + 'flood-opacity', + 'stop-opacity', + 'stroke-opacity', + ], + }, + ], + 'at-rule-empty-line-before': [ + 'always', + { + except: ['blockless-after-same-name-blockless', 'first-nested'], + ignore: ['after-comment'], + }, + ], + 'at-rule-no-vendor-prefix': true, + 'color-function-notation': 'modern', + 'color-hex-length': 'short', + 'comment-empty-line-before': [ + 'always', + { + except: ['first-nested'], + ignore: ['stylelint-commands'], + }, + ], + 'comment-whitespace-inside': 'always', + 'custom-property-empty-line-before': [ + 'always', + { + except: ['after-custom-property', 'first-nested'], + ignore: ['after-comment', 'inside-single-line-block'], + }, + ], + 'custom-media-pattern': [ + '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: (name) => `Expected custom media query name "${name}" to be kebab-case`, + }, + ], + 'custom-property-pattern': [ + '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: (name) => `Expected custom property name "${name}" to be kebab-case`, + }, + ], + 'declaration-block-no-redundant-longhand-properties': true, + 'declaration-block-single-line-max-declarations': 1, + 'declaration-empty-line-before': [ + 'always', + { + except: ['after-declaration', 'first-nested'], + ignore: ['after-comment', 'inside-single-line-block'], + }, + ], + 'font-family-name-quotes': 'always-where-recommended', + 'function-name-case': 'lower', + 'function-url-quotes': 'always', + 'hue-degree-notation': 'angle', + 'import-notation': 'url', + 'keyframe-selector-notation': 'percentage-unless-within-keyword-only-block', + 'keyframes-name-pattern': [ + '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: (name) => `Expected keyframe name "${name}" to be kebab-case`, + }, + ], + 'length-zero-no-unit': [ + true, + { + ignore: ['custom-properties'], + }, + ], + 'media-feature-name-no-vendor-prefix': true, + 'media-feature-range-notation': 'context', + 'number-max-precision': 4, + 'property-no-vendor-prefix': true, + 'rule-empty-line-before': [ + 'always-multi-line', + { + except: ['first-nested'], + ignore: ['after-comment'], + }, + ], + 'selector-attribute-quotes': 'always', + 'selector-class-pattern': [ + '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: (selector) => `Expected class selector "${selector}" to be kebab-case`, + }, + ], + 'selector-id-pattern': [ + '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', + { + message: (selector) => `Expected id selector "${selector}" to be kebab-case`, + }, + ], + 'selector-no-vendor-prefix': true, + 'selector-not-notation': 'complex', + 'selector-pseudo-element-colon-notation': 'double', + 'selector-type-case': 'lower', + 'shorthand-property-no-redundant-values': true, + 'value-keyword-case': 'lower', + 'value-no-vendor-prefix': [ + true, + { + // `-webkit-box` is allowed as standard. See https://www.w3.org/TR/css-overflow-3/#webkit-line-clamp + ignoreValues: ['box', 'inline-box'], + }, + ], + }, +}; diff --git a/node_modules/stylelint-config-standard/package.json b/node_modules/stylelint-config-standard/package.json new file mode 100644 index 000000000..e2404b385 --- /dev/null +++ b/node_modules/stylelint-config-standard/package.json @@ -0,0 +1,73 @@ +{ + "name": "stylelint-config-standard", + "version": "34.0.0", + "description": "Standard shareable config for Stylelint", + "keywords": [ + "stylelint", + "stylelint-config", + "standard" + ], + "repository": "stylelint/stylelint-config-standard", + "license": "MIT", + "author": "Stylelint", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "format": "prettier . --write", + "prepare": "husky install", + "lint:formatting": "prettier . --check", + "lint:js": "eslint . --ignore-path .gitignore", + "lint:md": "remark . --quiet --frail --ignore-path .gitignore", + "lint": "npm-run-all --parallel lint:*", + "release": "np", + "pretest": "npm run lint", + "test": "jest", + "watch": "jest --watch" + }, + "lint-staged": { + "*.js": "eslint --cache --fix", + "*.{js,md,yml}": "prettier --write" + }, + "prettier": "@stylelint/prettier-config", + "eslintConfig": { + "extends": [ + "stylelint", + "stylelint/jest" + ], + "globals": { + "module": true, + "require": true + } + }, + "remarkConfig": { + "plugins": [ + "@stylelint/remark-preset" + ] + }, + "dependencies": { + "stylelint-config-recommended": "^13.0.0" + }, + "devDependencies": { + "@stylelint/prettier-config": "^2.0.0", + "@stylelint/remark-preset": "^4.0.0", + "eslint": "^8.43.0", + "eslint-config-stylelint": "^18.0.0", + "eslint-plugin-jest": "^27.2.1", + "husky": "^8.0.3", + "jest": "^29.5.0", + "lint-staged": "^13.2.2", + "np": "^8.0.4", + "npm-run-all": "^4.1.5", + "prettier": "^2.8.8", + "remark-cli": "^11.0.0", + "stylelint": "^15.10.0" + }, + "peerDependencies": { + "stylelint": "^15.10.0" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + } +} diff --git a/node_modules/stylelint-scss/LICENSE b/node_modules/stylelint-scss/LICENSE new file mode 100644 index 000000000..9f82c82e4 --- /dev/null +++ b/node_modules/stylelint-scss/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Krister Kari + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/stylelint-scss/README.md b/node_modules/stylelint-scss/README.md new file mode 100644 index 000000000..d0e948cfb --- /dev/null +++ b/node_modules/stylelint-scss/README.md @@ -0,0 +1,359 @@ +# stylelint-scss + +[![npm version](https://img.shields.io/npm/v/stylelint-scss?logo=npm&logoColor=fff)](https://www.npmjs.com/package/stylelint-scss) +[![Build Status](https://img.shields.io/github/actions/workflow/status/stylelint-scss/stylelint-scss/test.yml?branch=master&label=tests&logo=github)](https://github.com/stylelint-scss/stylelint-scss/actions/workflows/test.yml?query=workflow%3ATests) +[![Coverage Status](https://img.shields.io/coveralls/github/stylelint-scss/stylelint-scss/master?logo=coveralls&logoColor=fff)](https://coveralls.io/github/stylelint-scss/stylelint-scss?branch=master) +[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen)](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github) +[![Downloads per month](https://img.shields.io/npm/dm/stylelint-scss)](https://npmcharts.com/compare/stylelint-scss) + +A collection of SCSS-specific linting rules for [Stylelint](https://github.com/stylelint/stylelint) (in a form of a plugin). + +## Purpose + +Stylelint by itself supports [SCSS syntax](https://stylelint.io/user-guide/get-started) very well (as well as other preprocessors' syntaxes). Moreover, it introduces some specific rules that can be used to lint SCSS, e.g. to limit [`nesting`](https://stylelint.io/user-guide/rules/max-nesting-depth), control the way [`@-rules`](https://stylelint.io/user-guide/rules#at-rule) are written. Yet Stylelint is in general focused on standard CSS. + +stylelint-scss introduces rules specific to SCSS syntax. That said, the rules from this plugin can be used with other syntaxes, like Less or some PostCSS syntaxes. That's why the rules' names are not tied to SCSS only (`at-function-pattern` instead of `scss-function-pattern`). + +The plugin follows Stylelint's guidelines (about [rule names](https://stylelint.io/user-guide/rules), testing and [so on](https://github.com/stylelint/stylelint/tree/main/docs/developer-guide)). + +## Installation and usage + +This plugin is used in the [stylelint-config-standard-scss shared config](https://github.com/stylelint-scss/stylelint-config-standard-scss). We recommend using that shared config, rather than installing this plugin directly. + +However, the plugin can still be used in you're crafting a config from the ground up. First, install `stylelint-scss` (and `stylelint`, if you haven't done so yet) via npm: + +```sh +npm install stylelint stylelint-scss +``` + +Create the `.stylelintrc.json` config file (or open the existing one), add `stylelint-scss` to the plugins array and the rules you need to the rules list. All rules from stylelint-scss need to be namespaced with `scss`. + +```jsonc +{ + "plugins": [ + "stylelint-scss" + ], + "rules": { + // recommended rules + "at-rule-no-unknown": null, + "scss/at-rule-no-unknown": true, + // ... + // any other rules you'd want to change e.g. + "scss/dollar-variable-pattern": "^foo", + "scss/selector-no-redundant-nesting-selector": true + } +} +``` + +Please refer to [Stylelint docs](https://stylelint.io/user-guide/get-started) for detailed info on using this linter. + +## List of rules + +Here are stylelint-scss' rules, grouped by the _thing_ they apply to (just like in [Stylelint](https://stylelint.io/user-guide/rules)). + +Please also see the [example configs](./docs/examples/) for special cases. + +### `@`-each + +- [`at-each-key-value-single-line`](./src/rules/at-each-key-value-single-line/README.md): This is a rule that checks for situations where users have done a loop using map-keys or map.keys and grabbed the value for that key inside of the loop. + +### `@`-else + +- [`at-else-closing-brace-newline-after`](./src/rules/at-else-closing-brace-newline-after/README.md): Require or disallow a newline after the closing brace of `@else` statements (Autofixable). +- [`at-else-closing-brace-space-after`](./src/rules/at-else-closing-brace-space-after/README.md): Require a single space or disallow whitespace after the closing brace of `@else` statements (Autofixable). +- [`at-else-empty-line-before`](./src/rules/at-else-empty-line-before/README.md): Require an empty line or disallow empty lines before `@`-else (Autofixable). +- [`at-else-if-parentheses-space-before`](./src/rules/at-else-if-parentheses-space-before/README.md): Require or disallow a space before `@else if` parentheses (Autofixable). + +### `@`-extend + +- [`at-extend-no-missing-placeholder`](./src/rules/at-extend-no-missing-placeholder/README.md): Disallow at-extends (`@extend`) with missing placeholders. + +### `@`-function + +- [`at-function-named-arguments`](./src/rules/at-function-named-arguments/README.md): Require named parameters in SCSS function call rule. +- [`at-function-parentheses-space-before`](./src/rules/at-function-parentheses-space-before/README.md): Require or disallow a space before `@function` parentheses (Autofixable). +- [`at-function-pattern`](./src/rules/at-function-pattern/README.md): Specify a pattern for Sass/SCSS-like function names. + +### `@`-if + +- [`at-if-closing-brace-newline-after`](./src/rules/at-if-closing-brace-newline-after/README.md): Require or disallow a newline after the closing brace of `@if` statements (Autofixable). +- [`at-if-closing-brace-space-after`](./src/rules/at-if-closing-brace-space-after/README.md): Require a single space or disallow whitespace after the closing brace of `@if` statements (Autofixable). +- [`at-if-no-null`](./src/rules/at-if-no-null/README.md): Disallow `null` in `@if` statements. + +### `@`-import + +- [`at-import-no-partial-leading-underscore`](./src/rules/at-import-no-partial-leading-underscore/README.md): Disallow leading underscore in partial names in `@import`. +- [`at-import-partial-extension`](./src/rules/at-import-partial-extension/README.md): Require or disallow extension in `@import` commands (Autofixable). +- [`at-import-partial-extension-blacklist`](./src/rules/at-import-partial-extension-blacklist/README.md): Specify a blacklist of disallowed file extensions for partial names in `@import` commands. +- [`at-import-partial-extension-whitelist`](./src/rules/at-import-partial-extension-whitelist/README.md): Specify a whitelist of allowed file extensions for partial names in `@import` commands. + +### `@`-mixin + +- [`at-mixin-argumentless-call-parentheses`](./src/rules/at-mixin-argumentless-call-parentheses/README.md): Require or disallow parentheses in argumentless `@mixin` calls (Autofixable). +- [`at-mixin-named-arguments`](./src/rules/at-mixin-named-arguments/README.md): Require named parameters in at-mixin call rule. +- [`at-mixin-parentheses-space-before`](./src/rules/at-mixin-parentheses-space-before/README.md): Require or disallow a space before `@mixin` parentheses (Autofixable). +- [`at-mixin-pattern`](./src/rules/at-mixin-pattern/README.md): Specify a pattern for Sass/SCSS-like mixin names. + +### `@`-rule + +- [`at-rule-conditional-no-parentheses`](./src/rules/at-rule-conditional-no-parentheses/README.md): Disallow parentheses in conditional @ rules (if, elsif, while) (Autofixable). +- [`at-rule-no-unknown`](./src/rules/at-rule-no-unknown/README.md): Disallow unknown at-rules. Should be used **instead of** Stylelint's [at-rule-no-unknown](https://stylelint.io/user-guide/rules/at-rule-no-unknown). + +### `@`-use + +- [`at-use-no-unnamespaced`](./src/rules/at-use-no-unnamespaced/README.md): Disallow `@use` without a namespace (i.e. `@use "..." as *`). + +### `$`-variable + +- [`dollar-variable-colon-newline-after`](./src/rules/dollar-variable-colon-newline-after/README.md): Require a newline after the colon in `$`-variable declarations (Autofixable). +- [`dollar-variable-colon-space-after`](./src/rules/dollar-variable-colon-space-after/README.md): Require or disallow whitespace after the colon in `$`-variable declarations (Autofixable). +- [`dollar-variable-colon-space-before`](./src/rules/dollar-variable-colon-space-before/README.md): Require a single space or disallow whitespace before the colon in `$`-variable declarations (Autofixable). +- [`dollar-variable-default`](./src/rules/dollar-variable-default/README.md): Require `!default` flag for `$`-variable declarations. +- [`dollar-variable-empty-line-after`](./src/rules/dollar-variable-empty-line-after/README.md): Require a single empty line or disallow empty lines after `$`-variable declarations (Autofixable). +- [`dollar-variable-empty-line-before`](./src/rules/dollar-variable-empty-line-before/README.md): Require a single empty line or disallow empty lines before `$`-variable declarations (Autofixable). +- [`dollar-variable-first-in-block`](./src/rules/dollar-variable-first-in-block/README.md): Require for variables to be put first in a block (a rule or in root). +- [`dollar-variable-no-missing-interpolation`](./src/rules/dollar-variable-no-missing-interpolation/README.md): Disallow Sass variables that are used without interpolation with CSS features that use custom identifiers. +- [`dollar-variable-no-namespaced-assignment`](./src/rules/dollar-variable-no-namespaced-assignment/README.md): Disallow assignment to namespaced Sass variables. +- [`dollar-variable-pattern`](./src/rules/dollar-variable-pattern/README.md): Specify a pattern for Sass-like variables. + +### `%`-placeholder + +- [`percent-placeholder-pattern`](./src/rules/percent-placeholder-pattern/README.md): Specify a pattern for `%`-placeholders. + +### `//`-comment + +- [`double-slash-comment-empty-line-before`](./src/rules/double-slash-comment-empty-line-before/README.md): Require or disallow an empty line before `//`-comments (Autofixable). +- [`double-slash-comment-inline`](./src/rules/double-slash-comment-inline/README.md): Require or disallow `//`-comments to be inline comments. +- [`double-slash-comment-whitespace-inside`](./src/rules/double-slash-comment-whitespace-inside/README.md): Require or disallow whitespace after the `//` in `//`-comments + +### Comment + +- [`comment-no-empty`](./src/rules/comment-no-empty/README.md): Disallow empty comments. +- [`comment-no-loud`](./src/rules/comment-no-loud/README.md): Disallow `/*`-comments. + +### Declaration + +- [`declaration-nested-properties`](./src/rules/declaration-nested-properties/README.md): Require or disallow properties with `-` in their names to be in a form of a nested group. +- [`declaration-nested-properties-no-divided-groups`](./src/rules/declaration-nested-properties-no-divided-groups/README.md): Disallow nested properties of the same "namespace" to be divided into multiple groups. + +### Dimension + +- [`dimension-no-non-numeric-values`](./src/rules/dimension-no-non-numeric-values/README.md): Disallow non-numeric values when interpolating a value with a unit. + +### Function + +- [`function-color-relative`](./src/rules/function-color-relative/README.md): Encourage the use of the [scale-color](https://sass-lang.com/documentation/modules/color#scale-color) function over regular color functions. +- [`function-no-unknown`](./src/rules/function-no-unknown/README.md): Disallow unknown functions. Should be used **instead of** Stylelint's [function-no-unknown](https://stylelint.io/user-guide/rules/list/at-rule-no-unknown). +- [`function-quote-no-quoted-strings-inside`](./src/rules/function-quote-no-quoted-strings-inside/README.md): Disallow quoted strings inside the [quote function](https://sass-lang.com/documentation/modules/string#quote) (Autofixable). +- [`function-unquote-no-unquoted-strings-inside`](./src/rules/function-unquote-no-unquoted-strings-inside/README.md): Disallow unquoted strings inside the [unquote function](https://sass-lang.com/documentation/modules/string#unquote) (Autofixable). + +### Map + +- [`map-keys-quotes`](./src/rules/map-keys-quotes/README.md): Require quoted keys in Sass maps. + +### Media feature + +- [`media-feature-value-dollar-variable`](./src/rules/media-feature-value-dollar-variable/README.md): Require a media feature value be a `$`-variable or disallow `$`-variables in media feature values. + +### Operator + +- [`operator-no-newline-after`](./src/rules/operator-no-newline-after/README.md): Disallow linebreaks after Sass operators. +- [`operator-no-newline-before`](./src/rules/operator-no-newline-before/README.md): Disallow linebreaks before Sass operators. +- [`operator-no-unspaced`](./src/rules/operator-no-unspaced/README.md): Disallow unspaced operators in Sass operations. + +### Partial + +- [`partial-no-import`](./src/rules/partial-no-import/README.md): Disallow non-CSS `@import`s in partial files. + +### Selector + +- [`selector-nest-combinators`](./src/rules/selector-nest-combinators/README.md): Require or disallow nesting of combinators in selectors. +- [`selector-no-redundant-nesting-selector`](./src/rules/selector-no-redundant-nesting-selector/README.md): Disallow redundant nesting selectors (`&`). +- [`selector-no-union-class-name`](./src/rules/selector-no-union-class-name/README.md): Disallow union class names with the parent selector (`&`). + +### General / Sheet + +- [`no-dollar-variables`](./src/rules/no-dollar-variables/README.md): Disallow dollar variables within a stylesheet. +- [`no-duplicate-dollar-variables`](./src/rules/no-duplicate-dollar-variables/README.md): Disallow duplicate dollar variables within a stylesheet. +- [`no-duplicate-mixins`](./src/rules/no-duplicate-mixins/README.md): Disallow duplicate mixins within a stylesheet. +- [`no-global-function-names`](./src/rules/no-global-function-names/README.md): Disallows the use of global function names, as these global functions are now located inside built-in Sass modules. + +## Help out + +The work on the plugin's rules is still in progress, so if you feel like it, you're welcome to help out with any of these (the plugin follows Stylelint guidelines so most of this is based on its docs): + +- Create, enhance, and debug rules (see Stylelint's guide to "[Working on rules](https://github.com/stylelint/stylelint/blob/main/docs/developer-guide/rules.md)"). +- Improve documentation. +- Chime in on any open issue or pull request. +- Open new issues about your ideas on new rules, or for how to improve the existing ones, and pull requests to show us how your idea works. +- Add new tests to absolutely anything. +- Work on improving performance of rules. +- Contribute to [Stylelint](https://github.com/stylelint/stylelint) +- Spread the word. + +We communicate via [issues](https://github.com/stylelint-scss/stylelint-scss/issues) and [pull requests](https://github.com/stylelint-scss/stylelint-scss/pulls). + +There is also [StackOverflow](https://stackoverflow.com/questions/tagged/stylelint), which would be the preferred QA forum. + +## Contributors + +Thanks goes to these wonderful people: + + + + + + + + + + + + + + + + + + + + +
kristerkaridryomarambleraptorXhmikosREugenojoseph118
kristerkaridryomarambleraptorXhmikosREugenojoseph118
+ + + + + + + + + + + + + + + + + + + +
ybiquitousstofniksykaysonwusrawlinspipopotamasu
ybiquitousstofniksykaysonwusrawlinspipopotamasu
+ + + + + + + + + + + + + + + + + + + +
jhae-deOriRntwbricardogobbosouzajeddy3bjankord
jhae-deOriRntwbricardogobbosouzajeddy3bjankord
+ + + + + + + + + + + + + + + + + + + +
kevindewthibaudcolasAndyOGochalkygames123xboy2012alexander-akait
kevindewthibaudcolasAndyOGochalkygames123xboy2012alexander-akait
+ + + + + + + + + + + + + + + + + + + +
vseventerSterlingVixCalme1709Deimosdiego-codeslithiumlron
vseventerSterlingVixCalme1709Deimosdiego-codeslithiumlron
+ + + + + + + + + + + + + + + + + + + +
EvanHahnguoyunhejantimonstormwarningkeegan-lillomanovotny
EvanHahnguoyunhejantimonstormwarningkeegan-lillomanovotny
+ + + + + + + + + + + + + + + + + + + +
paulgvsajadtorkamaniYozhikMAM-77kershYodaDaCoda
paulgvsajadtorkamaniYozhikMAM-77kershYodaDaCoda
+ + + + + + + + + + + +
freezy-skqmhc
freezy-skqmhc
+ +## Important documents + +- [Changelog](./CHANGELOG.md) +- [Contributing](./CONTRIBUTING.md) +- [License](./LICENSE) diff --git a/node_modules/stylelint-scss/package.json b/node_modules/stylelint-scss/package.json new file mode 100644 index 000000000..486c360b5 --- /dev/null +++ b/node_modules/stylelint-scss/package.json @@ -0,0 +1,59 @@ +{ + "name": "stylelint-scss", + "description": "A collection of SCSS-specific rules for Stylelint", + "version": "5.0.1", + "author": "Krister Kari", + "repository": "stylelint-scss/stylelint-scss", + "license": "MIT", + "main": "src/index.js", + "peerDependencies": { + "stylelint": "^14.5.1 || ^15.0.0" + }, + "dependencies": { + "postcss-media-query-parser": "^0.2.3", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-selector-parser": "^6.0.13", + "postcss-value-parser": "^4.2.0" + }, + "devDependencies": { + "eslint": "^8.41.0", + "github-contributors-list": "^1.2.5", + "husky": "^8.0.3", + "jest": "^29.5.0", + "jest-cli": "^29.5.0", + "jest-preset-stylelint": "^6.1.0", + "lint-staged": "^13.2.2", + "np": "^8.0.2", + "postcss": "^8.4.24", + "postcss-less": "^6.0.0", + "postcss-scss": "^4.0.6", + "prettier": "^2.8.8", + "stylelint": "^15.7.0" + }, + "files": [ + "src/**/*.js", + "!**/__tests__/**" + ], + "keywords": [ + "css", + "csslint", + "lint", + "linter", + "scss", + "stylelint", + "stylelint-plugin" + ], + "scripts": { + "lint": "eslint . --ignore-path .gitignore", + "prettify": "prettier --write \"src/**/*.js\"", + "pretest": "npm run lint", + "release": "np", + "jest": "jest", + "test": "npm run jest -- --coverage", + "watch": "npm run jest -- --watch", + "test-rule": "npm run jest", + "test-util": "npm run jest", + "generate-contributors-list": "githubcontrib --owner stylelint-scss --repo stylelint-scss --cols 6 --sortOrder desc --filter greenkeeper[bot],dependabot[bot] --showlogin true --imagesize 80 --format html", + "prepare": "husky install" + } +} diff --git a/node_modules/stylelint-scss/src/index.js b/node_modules/stylelint-scss/src/index.js new file mode 100644 index 000000000..154a77ac7 --- /dev/null +++ b/node_modules/stylelint-scss/src/index.js @@ -0,0 +1,11 @@ +"use strict"; + +const { createPlugin } = require("stylelint"); +const rules = require("./rules"); +const namespace = require("./utils/namespace"); + +const rulesPlugins = Object.keys(rules).map(ruleName => { + return createPlugin(namespace(ruleName), rules[ruleName]); +}); + +module.exports = rulesPlugins; diff --git a/node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/README.md b/node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/README.md new file mode 100644 index 000000000..ead328e0e --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/README.md @@ -0,0 +1,105 @@ +# at-each-key-value-single-line + +This is a rule that checks for situations where users have: + +- Done a loop using map-keys +- Grabbed the value for that key inside of the loop. + +```scss +$font-weights: ( + "regular": 400, + "medium": 500, + "bold": 700 +); +@each $key in map-keys($font-weights) { + $value: map-get($font-weights, $key); + /** ↑ + * This call should be consolidated into the @each call. + **/ +} +``` + +## Options + +### `true` + +The following patterns are considered violations: + +```scss +$font-weights: ( + "regular": 400, + "medium": 500, + "bold": 700 +); +@each $key in map-keys($font-weights) { + $value: map-get($font-weights, $key); +} +``` + +```scss +@use 'sass:map'; + +$font-weights: ( + "regular": 400, + "medium": 500, + "bold": 700 +); +@each $key in map.keys($font-weights) { + $value: map.get($font-weights, $key); +} +``` + +The following patterns are _not_ considered violations: + +```scss +$font-weights: ("regular": 400, "medium": 500, "bold": 700); +@each $key, $value in $font-weights {...} +``` + +```scss +$font-weights: ( + "regular": 400, + "medium": 500, + "bold": 700 +); +$other-weights: ( + "regular": 400, + "medium": 500, + "bold": 700 +); + +@each $key, $value in map-keys($font-weights) { + $value: map-get($other-weights, $key); +} +``` + +```scss +@use 'sass:map'; + +$font-weights: ( + "regular": 400, + "medium": 500, + "bold": 700 +); +$other-weights: ( + "regular": 400, + "medium": 500, + "bold": 700 +); + +@each $key, $value in map.keys($font-weights) { + $value: map.get($other-weights, $key); +} +``` + +```scss +$font-weights: ("regular": 400, "medium": 500, "bold": 700); +@each $key, $value in map-keys($font-weights) {...} +``` + +```scss +@use 'sass:map'; + +$font-weights: ("regular": 400, "medium": 500, "bold": 700); +@each $key, $value in map.keys($font-weights) {...} +``` diff --git a/node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/index.js b/node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/index.js new file mode 100644 index 000000000..855bee834 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/index.js @@ -0,0 +1,128 @@ +"use strict"; + +const { utils } = require("stylelint"); +const moduleNamespace = require("../../utils/moduleNamespace"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-each-key-value-single-line"); + +const messages = utils.ruleMessages(ruleName, { + expected: + "Use @each $key, $value in $map syntax instead of $value: map-get($map, $key)" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(primary) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: primary + }); + + if (!validOptions) { + return; + } + + const mapNamespace = moduleNamespace(root, "sass:map"); + + root.walkAtRules("each", rule => { + const parts = separateEachParams(rule.params); + + // If loop is fetching both key + value, return + if (parts[0].length === 2) { + return; + } + + // If didn't call map-keys, return. + if (!didCallMapKeys(parts[1], mapNamespace)) { + return; + } + + // Loop over decls inside of each statement and loop for variable assignments. + rule.walkDecls(innerDecl => { + // Check that this decl is a map-get call + if (innerDecl.prop[0] !== "$") { + return; + } + + if (!didCallMapGet(innerDecl.value, mapNamespace)) { + return; + } + + // Check map_name + key_name match. + const map_get_parts = mapGetParameters(innerDecl.value, mapNamespace); + + // Check map names match. + if (map_get_parts[0] !== mapName(parts[1], mapNamespace)) { + return; + } + + // Match key names match. + if (map_get_parts[1] !== parts[0][0]) { + return; + } + + utils.report({ + message: messages.expected, + node: rule, + result, + ruleName, + word: rule.params + }); + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +// Takes in a param string from node.params +// Returns: [[key variable, value variable], map_decl] (all Strings) +function separateEachParams(paramString) { + const parts = paramString.split("in"); + + return [parts[0].split(",").map(s => s.trim()), parts[1].trim()]; +} + +function didCallMapKeys(mapDecl, mapNamespace) { + const pattern = getNamespacedPattern("keys\\(.*\\)", mapNamespace); + + return new RegExp(pattern).test(mapDecl); +} + +function didCallMapGet(mapDecl, mapNamespace) { + const pattern = getNamespacedPattern("get\\((.*),(.*)\\)", mapNamespace); + + return new RegExp(pattern).test(mapDecl); +} + +// Fetch the name of the map from a map-keys() or map.keys() call. +function mapName(mapDecl, mapNamespace) { + if (didCallMapKeys(mapDecl, mapNamespace)) { + const pattern = getNamespacedPattern("keys\\((.*)\\)", mapNamespace); + + return mapDecl.match(new RegExp(pattern))[1]; + } + + return mapDecl; +} + +// Returns the parameters of a map-get or map.get call +// Returns [map variable, key_variable] +function mapGetParameters(mapGetDecl, mapNamespace) { + const pattern = getNamespacedPattern("get\\((.*), ?(.*)\\)", mapNamespace); + const parts = mapGetDecl.match(new RegExp(pattern)); + + return [parts[1], parts[2]]; +} + +function getNamespacedPattern(pattern, namespace) { + return namespace !== null ? `(?:${namespace}\\.|map-)${pattern}` : pattern; +} + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/README.md b/node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/README.md new file mode 100644 index 000000000..23e2e83bb --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/README.md @@ -0,0 +1,74 @@ +# at-else-closing-brace-newline-after + +Require or disallow a newline after the closing brace of `@else` statements. + +```scss +@if (@a == 0) { + +} @else if (@a == 1){ } +@else { } ↑ +/** ↑ ↑ + * The newline after these braces */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +This rule might have conflicts with Stylelint's core rule [`block-closing-brace-newline-after`](https://stylelint.io/user-guide/rules/block-closing-brace-newline-after) if it doesn't have `"ignoreAtRules": ["else"]` in a `.stylelintrc` config file. That's because an `@else { ... }` statement can be successfully parsed as an at-rule with a block. You might also want to set `"ignoreAtRules": ["else"]` for another Stylelint's core rule - [`at-rule-empty-line-before`](https://stylelint.io/user-guide/rules/at-rule-empty-line-before) that could be forcing empty lines before at-rules (including `@else`s that follow `@if`s or other `@else`s). + +This rule doesn't have usual `"always"` and `"never"` main option values, because if you don't need special behavior for `@if` and `@else` you could just use [`block-closing-brace-newline-after`](https://stylelint.io/user-guide/rules/block-closing-brace-newline-after) set to `"always"` or any other value. + +## Options + +`string`: `"always-last-in-chain"` + +### `"always-last-in-chain"` + +There *must always* be a newline after the closing brace of `@else` that is the last statement in a conditional statement chain (i.e. has no `@else` right after it). If it's not, there *must not* be a newline. + +The following patterns are considered warnings: + +```scss +a { + @if ($x == 1) { + // ... + } @else { + // ... + } width: 10px; // No @else after, so should have a newline +} + +@if ($x == 1) { + // ... +} @else if { } // Has @else after it, so shouldn't have a newline +@else { } +``` + +The following patterns are *not* considered warnings: + +```scss +a { + @if ($x == 1) {} @else {} + width: 10px; +} + +a { + @if ($x == 1) { + // ... + } @else if { + // ... + } @else {} + + width: 10px; +} + +a { + @if ($x == 1) { } @else if { }@else { } + + width: 10px; +} +``` + +## Optional secondary options + +### `disableFix: true` + +Disables autofixing for this rule. diff --git a/node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/index.js b/node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/index.js new file mode 100644 index 000000000..3d8e98296 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/index.js @@ -0,0 +1,62 @@ +"use strict"; + +const { utils } = require("stylelint"); +const { isBoolean } = require("../../utils/validateTypes"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const { + sassConditionalBraceNLAfterChecker +} = require("../at-if-closing-brace-newline-after"); + +const ruleName = namespace("at-else-closing-brace-newline-after"); + +const messages = utils.ruleMessages(ruleName, { + expected: 'Expected newline after "}" of @else statement', + rejected: 'Unexpected newline after "}" of @else statement' +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation, options, context) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: expectation, + possible: ["always-last-in-chain"] + }, + { + actual: options, + possible: { + disableFix: isBoolean + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + sassConditionalBraceNLAfterChecker({ + root, + result, + ruleName, + atRuleName: "else", + expectation, + messages, + context, + options + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/README.md b/node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/README.md new file mode 100644 index 000000000..3cc9fdb04 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/README.md @@ -0,0 +1,131 @@ +# at-else-closing-brace-space-after + +Require a single space or disallow whitespace after the closing brace of `@else` statements. + +```scss +@if ($a == 0) { } +@else if ($x == 2) { } + ↑ +/** ↑ + * The space after this brace */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +This rule might have conflicts with Stylelint's core [`block-closing-brace-space-after`](https://stylelint.io/user-guide/rules/block-closing-brace-space-after) rule if the latter is set up in your `.stylelintrc` config file. + +## Options + +`string`: `"always-intermediate"|"never-intermediate"` + +### `"always-intermediate"` + +There *must always* be a single space after the closing brace of `@else` that is not the last statement in a conditional statement chain (i.e. does have another `@else` right after it). + +The following patterns are considered warnings: + +```scss +@if ($x == 1) { + // ... +} @else if ($x == 2) { + // ... +}@else {} + +@if ($x == 1) { + // ... +} @else if ($x == 2) { + // ... +} +@else { } + +// `@else if` has a space and a newline after the closing brace +@if ($x == 1) { + // ... +} @else if ($x == 2) { + // ... +} +@else { } + +@if ($x == 1) { + // ... +} @else if ($x == 2) { + // ... +} @else { } // Two spaces +``` + +The following patterns are *not* considered warnings: + +```scss +@if ($x == 1) { + // ... +} @else if ($x == 2) { + // ... +} @else {} + +a { + @if ($x == 1) { + // ... + } @else ($x == 2) { + // ... + } + width: 10px; +} + +@if ($x == 1) { } @else if ($x == 2) { + // ... +} @include x; + +@if ($x == 1) { + // ... +} @else if ($x == 2) { + // ... +} @include x; +``` + +### `"never-intermediate"` + +There *must never* be a whitespace after the closing brace of `@else` that is not the last statement in a conditional statement chain (i.e. does have another `@else` right after it). + +The following patterns are considered warnings: + +```scss +@if ($x == 1) { + // ... +} @else if ($x == 2) { + // ... +} @else {} + +@if ($x == 1) { + // ... +} @else if ($x == 2) { + // ... +} +@else { } +``` + +The following patterns are *not* considered warnings: + +```scss +@if ($x == 1) { + // ... +}@else {} + +a { + @if ($x == 1) { + // ... + } @else if ($x == 2) { + // ... + } + width: 10px; +} + +@if ($x == 1) { } @else if ($x == 2) { + // ... +}@include x; + +@if ($x == 1) { + // ... +} @else if ($x == 2) { + // ... +} @include x; +``` diff --git a/node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/index.js b/node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/index.js new file mode 100644 index 000000000..ba17d7519 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/index.js @@ -0,0 +1,48 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); +const { + sassConditionalBraceSpaceAfterChecker +} = require("../at-if-closing-brace-space-after"); + +const ruleName = namespace("at-else-closing-brace-space-after"); + +const messages = utils.ruleMessages(ruleName, { + expected: 'Expected single space after "}" of @else statement', + rejected: 'Unexpected space after "}" of @else statement' +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation, _, context) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation, + possible: ["always-intermediate", "never-intermediate"] + }); + + if (!validOptions) { + return; + } + + sassConditionalBraceSpaceAfterChecker({ + root, + result, + ruleName, + atRuleName: "else", + expectation, + messages, + context + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-else-empty-line-before/README.md b/node_modules/stylelint-scss/src/rules/at-else-empty-line-before/README.md new file mode 100644 index 000000000..b786268a9 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-else-empty-line-before/README.md @@ -0,0 +1,69 @@ +# at-else-empty-line-before + +Require an empty line or disallow empty lines before `@`-else. + +```scss +@if ($a == 0) { } + /* ← */ +@else if ($x == 2) { } ↑ + ↑ +/** ↑ + * This empty line */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +`@if` and `@else` statements might need to have different behavior than all the other at-rules. For that you might need to set `"ignoreAtRules": ["else"]` for Stylelint's core rule [`at-rule-empty-line-before`](https://stylelint.io/user-guide/rules/at-rule-empty-line-before). But that would make you unable to disallow empty lines before `@else` while forcing it to be on a new line. This rule is designed to solve exactly that. + +## Options + +`string`: `"never"` + +There is no `"always"`, `"always-single-line"` options, because for such cases Stylelint's `at-rule-empty-line-before` would work. + +### `"never"` + +There *must never* be an empty line before `@else` statements. + +The following patterns are considered warnings: + +```scss +@if ($x == 1) { + // ... +} + +@else {} +``` +```scss +@if ($x == 1) { + // ... +} @else if ($x == 2) { + // ... +} + + +@else { } +``` + +The following patterns are *not* considered warnings: + +```scss +@if ($x == 1) { + // ... +} @else if ($x == 2) { + // ... +} @else {} + +a { + @if ($x == 1) { + // ... + } + @else ($x == 2) { + // ... + } +} +``` + +## Caveats + +If you use autofix, this rule could clash with [`at-mixin-parentheses-space-before`](../at-mixin-parentheses-space-before/README.md) rule. diff --git a/node_modules/stylelint-scss/src/rules/at-else-empty-line-before/index.js b/node_modules/stylelint-scss/src/rules/at-else-empty-line-before/index.js new file mode 100644 index 000000000..d36415622 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-else-empty-line-before/index.js @@ -0,0 +1,61 @@ +"use strict"; + +const { utils } = require("stylelint"); +const hasEmptyLine = require("../../utils/hasEmptyLine"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-else-empty-line-before"); + +const messages = utils.ruleMessages(ruleName, { + rejected: "Unexpected empty line before @else" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation, _, context) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation, + possible: ["never"] + }); + + if (!validOptions) { + return; + } + + root.walkAtRules(atrule => { + if (atrule.name !== "else") { + return; + } + + // Don't need to ignore "the first rule in a stylesheet", etc, cases + // because @else should always go after @if + + if (!hasEmptyLine(atrule.raws.before)) { + return; + } + + if (context.fix) { + atrule.raws.before = " "; + + return; + } + + utils.report({ + message: messages.rejected, + node: atrule, + result, + ruleName + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/README.md b/node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/README.md new file mode 100644 index 000000000..93de15e22 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/README.md @@ -0,0 +1,58 @@ +# at-else-if-parentheses-space-before + +Require or disallow a space before `@else if` parentheses. + +```scss +@else if ($condition) { } +/** ↑ + * The space before this parenthesis */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +There *must always* be exactly one space between the `@else if` and the condition opening parenthesis. + +*Note: This rule does not enforce parentheses to be present.* + +The following patterns are considered warnings: + +```scss +@else if($condition) { } +``` +```scss +@else if ($condition) { } +``` + +The following patterns are *not* considered warnings: + +```scss +@else if ($condition) { } +``` +```scss +@else if $condition { } +``` + +### `"never"` + +There *must never* be whitespace between the `@else if` and the condition opening parenthesis. + +The following patterns are considered warnings: + +```scss +@else if ($condition) { } +``` + +The following patterns are *not* considered warnings: + +```scss +@else if($condition) { } +``` +```scss +@else if $condition { } +``` diff --git a/node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/index.js b/node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/index.js new file mode 100644 index 000000000..b0880fb1b --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/index.js @@ -0,0 +1,60 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); +const whitespaceChecker = require("../../utils/whitespaceChecker"); + +const ruleName = namespace("at-else-if-parentheses-space-before"); + +const messages = utils.ruleMessages(ruleName, { + rejectedBefore: () => + "Unexpected whitespace before parentheses in else-if declaration", + expectedBefore: () => + "Expected a single space before parentheses in else-if declaration" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(value, _, context) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: value, + possible: ["always", "never"] + }); + + if (!validOptions) { + return; + } + + const match = /^if\s*\(/; + const replacement = value === "always" ? "if (" : "if("; + + const checker = whitespaceChecker("space", value, messages).before; + + root.walkAtRules("else", decl => { + // return early if the else-if statement is not surrounded by parentheses + if (!match.test(decl.params)) { + return; + } + + if (context.fix) { + decl.params = decl.params.replace(match, replacement); + } + + checker({ + source: decl.params, + index: decl.params.indexOf("("), + err: message => utils.report({ message, node: decl, result, ruleName }) + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/README.md b/node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/README.md new file mode 100644 index 000000000..aed0bfeb8 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/README.md @@ -0,0 +1,47 @@ +# at-extend-no-missing-placeholder + +Disallow at-extends (`@extend`) with missing placeholders. + +Using a class selector with the `@extend` directive usually results in more generated CSS than when using a placeholder selector. Furthermore, Sass specifically introduced placeholder selectors in order to be used with `@extend`. + +```scss +.foo { + @extend %bar +// ↑ +// This is a placeholder selector +} +``` + +The following patterns are considered warnings: + +```scss +p { + @extend .some-class; +} +``` + +```scss +p { + @extend #some-identifer; +} +``` + +```scss +p { + @extend .blah-#{$dynamically_generated_name}; +} +``` + +The following patterns are *not* considered warnings: + +```scss +p { + @extend %placeholder; +} +``` + +```scss +p { + @extend #{$dynamically_generated_placeholder_name}; +} +``` diff --git a/node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/index.js b/node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/index.js new file mode 100644 index 000000000..4b44297a8 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/index.js @@ -0,0 +1,46 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-extend-no-missing-placeholder"); + +const messages = utils.ruleMessages(ruleName, { + rejected: + "Expected a placeholder selector (e.g. %placeholder) to be used in @extend" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(actual) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { actual }); + + if (!validOptions) { + return; + } + + root.walkAtRules("extend", atrule => { + const isPlaceholder = atrule.params.trim()[0] === "%"; + const isInterpolation = /^#{.+}/.test(atrule.params.trim()); + + if (!isPlaceholder && !isInterpolation) { + utils.report({ + ruleName, + result, + node: atrule, + message: messages.rejected + }); + } + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-function-named-arguments/README.md b/node_modules/stylelint-scss/src/rules/at-function-named-arguments/README.md new file mode 100644 index 000000000..9ed7101ea --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-function-named-arguments/README.md @@ -0,0 +1,131 @@ +# at-function-named-arguments + +Require named parameters in SCSS function call rule. + +```scss +animation: animation($duration: 250ms) { +// ↑ +// Require or disallow this +``` + +## Options + +`string`: `"always"|"never"` + +### `always` + +The following patterns are considered warnings: + +```scss +.foo { + animation: animation(250ms, 100ms, infinite); +} +``` + +```scss +.foo { + animation: animation(250ms); +} +``` + +```scss +.foo { + border: reset($value: 20, "bar", $color: #fff); +} +``` + +The following patterns are _not_ considered warnings: + +```scss +.foo { + animation: animation($duration: 250ms); +} +``` + +```scss +.foo { + animation: animation($duration: 250ms, $delay: 100ms, $direction: infinite); +} +``` + +### `never` + +The following patterns are considered warnings: + +```scss +.foo { + border: reset($value: 20); +} +``` + +```scss +.foo { + animation: animation($duration: 250ms, $delay: 100ms, $direction: infinite); +} +``` + +```scss +.foo { + border: reset($value: 20, "bar", $color: #fff); +} +``` + +The following patterns are _not_ considered warnings: + +```scss +.foo { + animation: animation(250ms, 100ms, infinite); +} +``` + +## Optional secondary options + +### `"ignore": ["single-argument"]` + +Given: + +```json +{ "ignore": ["single-argument"] } +``` + +The following patterns are _not_ considered warnings: + +```scss +.foo { + @include animation($duration: 250ms); +} +``` + +```scss +.foo { + @include reset(20); +} +``` + +### `ignoreFunctions: ["/regex/", "string"]` + +Given: + +```js +["always", { ignoreFunctions: ["/^my-/i", "custom"] }]; +``` + +The following patterns are _not_ considered warnings: + +```scss +.foo { + border: custom(20, 30); +} +``` + +```scss +.foo { + border: my-func(20, 30); +} +``` + +```scss +.foo { + border: MY-FUNC(20, 30); +} +``` diff --git a/node_modules/stylelint-scss/src/rules/at-function-named-arguments/index.js b/node_modules/stylelint-scss/src/rules/at-function-named-arguments/index.js new file mode 100644 index 000000000..c77920a52 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-function-named-arguments/index.js @@ -0,0 +1,131 @@ +"use strict"; + +const valueParser = require("postcss-value-parser"); +const { utils } = require("stylelint"); +const isNativeCssFunction = require("../../utils/isNativeCssFunction"); +const { isString } = require("../../utils/validateTypes"); +const namespace = require("../../utils/namespace"); +const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); +const { + parseFunctionArguments +} = require("../../utils/parseFunctionArguments"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-function-named-arguments"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected a named parameter to be used in function call", + rejected: "Unexpected a named parameter in function call" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +const isScssVarRegExp = /^\$\S*/; + +function rule(expectation, options) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: expectation, + possible: ["always", "never"] + }, + { + actual: options, + possible: { + ignore: ["single-argument"], + ignoreFunctions: [isString] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + const shouldIgnoreSingleArgument = optionsHaveIgnored( + options, + "single-argument" + ); + + root.walkDecls(decl => { + valueParser(decl.value).walk(node => { + if ( + node.type !== "function" || + isNativeCssFunction(node.value) || + node.value === "" + ) { + return; + } + + const hasFuncIgnored = + options && + options.ignoreFunctions && + options.ignoreFunctions.some(f => { + const isRegex = /^\/.*\//.test(f); + + if (!isRegex) { + return f === node.value; + } + + const parts = f.split("/"); + + return new RegExp(parts[1], parts[2] || "").test(node.value); + }); + + if (hasFuncIgnored) { + return; + } + + const args = parseFunctionArguments(valueParser.stringify(node)); + const isSingleArgument = args.length === 1; + + if (isSingleArgument && shouldIgnoreSingleArgument) { + return; + } + + args.forEach(arg => { + switch (expectation) { + case "never": { + if (!arg.key) { + return; + } + + utils.report({ + message: messages.rejected, + node: decl, + result, + ruleName + }); + break; + } + + case "always": { + if (arg.key && isScssVarRegExp.test(arg.key)) { + return; + } + + utils.report({ + message: messages.expected, + node: decl, + result, + ruleName + }); + break; + } + } + }); + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/README.md b/node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/README.md new file mode 100644 index 000000000..402915675 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/README.md @@ -0,0 +1,50 @@ +# at-function-parentheses-space-before + +Require or disallow a space before `@function` parentheses. + +```scss +@function foo ($arg) { } +/** ↑ + * The space before this parenthesis */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +There *must always* be exactly one space between the function name and the opening parenthesis. + +The following patterns are considered warnings: + +```scss +@function foo($arg) { } +``` +```scss +@function foo ($arg) { } +``` + +The following patterns are *not* considered warnings: + +```scss +@function foo ($arg) { } +``` + +### `"never"` + +There *must never* be any whitespace between the function name and the opening parenthesis. + +The following patterns are considered warnings: + +```scss +@function foo ($arg) { } +``` + +The following patterns are *not* considered warnings: + +```scss +@function foo($arg) { } +``` diff --git a/node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/index.js b/node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/index.js new file mode 100644 index 000000000..3700e78a4 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/index.js @@ -0,0 +1,57 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); +const whitespaceChecker = require("../../utils/whitespaceChecker"); + +const ruleName = namespace("at-function-parentheses-space-before"); + +const messages = utils.ruleMessages(ruleName, { + rejectedBefore: () => + "Unexpected whitespace before parentheses in function declaration", + expectedBefore: () => + "Expected a single space before parentheses in function declaration" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(value, _, context) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: value, + possible: ["always", "never"] + }); + + if (!validOptions) { + return; + } + + const match = /^([\w-]+)\s*\(/; + const replacement = value === "always" ? "$1 (" : "$1("; + + const checker = whitespaceChecker("space", value, messages).before; + + root.walkAtRules("function", decl => { + if (context.fix) { + decl.params = decl.params.replace(match, replacement); + + return; + } + + checker({ + source: decl.params, + index: decl.params.indexOf("("), + err: message => utils.report({ message, node: decl, result, ruleName }) + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-function-pattern/README.md b/node_modules/stylelint-scss/src/rules/at-function-pattern/README.md new file mode 100644 index 000000000..0aaf58e0e --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-function-pattern/README.md @@ -0,0 +1,29 @@ +# at-function-pattern + +Specify a pattern for Sass/SCSS-like function names. + +```scss +@function grid-width($n) { +/** ↑ + * The pattern of this */ +``` + +## Options + +`regex` or `string` + +A string will be translated into a RegExp like so `new RegExp(yourString)` — so be sure to escape properly. + +### E.g. `/foo-.+/` + +The following patterns are considered warnings: + +```scss +@function boo-bar ($n) { +``` + +The following patterns are *not* considered warnings: + +```scss +@function foo-bar ($n){ +``` diff --git a/node_modules/stylelint-scss/src/rules/at-function-pattern/index.js b/node_modules/stylelint-scss/src/rules/at-function-pattern/index.js new file mode 100644 index 000000000..87b26b384 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-function-pattern/index.js @@ -0,0 +1,62 @@ +"use strict"; + +const { utils } = require("stylelint"); +const { isRegExp, isString } = require("../../utils/validateTypes"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-function-pattern"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected @function name to match specified pattern" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(pattern) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: pattern, + possible: [isRegExp, isString] + }); + + if (!validOptions) { + return; + } + + const regexpPattern = isString(pattern) ? new RegExp(pattern) : pattern; + + root.walkAtRules(decl => { + if (decl.name !== "function") { + return; + } + + // Stripping the function of its arguments + const funcName = decl.params.replace(/(\s*)\([\s\S]*\)/g, ""); + + if (regexpPattern.test(funcName)) { + return; + } + + const funcTopLine = Object.assign({}, decl.source.start); + funcTopLine.line += 1; + funcTopLine.column = 0; + + utils.report({ + message: messages.expected, + node: decl, + result, + ruleName, + end: funcTopLine + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/README.md b/node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/README.md new file mode 100644 index 000000000..b4946f302 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/README.md @@ -0,0 +1,60 @@ +# at-if-closing-brace-newline-after + +Require or disallow a newline after the closing brace of `@if` statements. + +```scss +@if ($a == 0) { } + ↑ +/** ↑ + * The newline after this brace */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +This rule might have conflicts with Stylelint's core rule [`block-closing-brace-newline-after`](https://stylelint.io/user-guide/rules/block-closing-brace-newline-after) if it doesn't have `"ignoreAtRules": ["if"]` in a `.stylelintrc` config file. That's because an `@if { ... }` statement can be successfully parsed as an at-rule with a block. You might also want to set `"ignoreAtRules": ["else"]` for another stylelint's core rule - [`at-rule-empty-line-before`](https://stylelint.io/user-guide/rules/at-rule-empty-line-before) that could be forcing empty lines before at-rules (including `@else`s that follow `@if`s or other `@else`s). + +This rule doesn't have usual `"always"` and `"never"` main option values, because if you don't need special behavior for `@if` and `@else` you could just use [`block-closing-brace-newline-after`](https://stylelint.io/user-guide/rules/block-closing-brace-newline-after) set to `"always"` or any other value. + +## Options + +`string`: `"always-last-in-chain"` + +### `"always-last-in-chain"` + +There *must always* be a newline after the closing brace of `@if` that is the last statement in a conditional statement chain (i.e. has no `@else` right after it). If it's not, there *must not* be a newline. + +The following patterns are considered warnings: + +```scss +a { + @if ($x == 1) { + // ... + } width: 10px; // No @else - should have a newline +} + +@if ($x == 1) { + // ... +} // Has @else - shouldn't have a newline +@else { } +``` + +The following patterns are *not* considered warnings: + +```scss +a { + @if ($x == 1) {} + width: 10px; +} + +@if ($x == 1) { + // ... +} @else {} // Has @else, so no newline needed + +@if ($x == 1) { }@else { } +``` + +## Optional secondary options + +### `disableFix: true` + +Disables autofixing for this rule. diff --git a/node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/index.js b/node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/index.js new file mode 100644 index 000000000..8a46a9d05 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/index.js @@ -0,0 +1,134 @@ +"use strict"; + +const { utils } = require("stylelint"); +const isSingleLineString = require("../../utils/isSingleLineString"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); +const { isBoolean } = require("../../utils/validateTypes"); + +const ruleName = namespace("at-if-closing-brace-newline-after"); + +const messages = utils.ruleMessages(ruleName, { + expected: 'Expected newline after "}" of @if statement', + rejected: 'Unexpected newline after "}" of @if statement' +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation, options, context) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: expectation, + possible: ["always-last-in-chain"] + }, + { + actual: options, + possible: { + disableFix: isBoolean + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + sassConditionalBraceNLAfterChecker({ + root, + result, + ruleName, + atRuleName: "if", + expectation, + messages, + context, + options + }); + }; +} + +/** + * The core logic for this rule. Can be imported by other rules with similar + * logic, namely at-else-closing-brace-newline-after + * + * @param {Object} args -- Named arguments object + * @param {PostCSS root} args.root + * @param {PostCSS result} args.result + * @param {String ruleName} args.ruleName - needed for `report` function + * @param {String} args.atRuleName - the name of the at-rule to be checked, e.g. "if", "else" + * @param {Object} args.messages - returned by stylelint.utils.ruleMessages + * @return {undefined} + */ +function sassConditionalBraceNLAfterChecker({ + root, + result, + ruleName, + atRuleName, + expectation, + messages, + context, + options +}) { + const shouldFix = context.fix && (!options || options.disableFix !== true); + + function complain(node, message, index, fixValue) { + if (shouldFix) { + node.next().raws.before = fixValue; + + return; + } + + utils.report({ + result, + ruleName, + node, + message, + index + }); + } + + root.walkAtRules(atrule => { + // Do nothing if it's not an @if + if (atrule.name !== atRuleName) { + return; + } + + const nextNode = atrule.next(); + + if (!nextNode) { + return; + } + + const nextBefore = nextNode.raws.before; + const hasNewLinesBeforeNext = nextBefore && !isSingleLineString(nextBefore); + const reportIndex = atrule.toString().length; + + if (expectation === "always-last-in-chain") { + // If followed by @else, no newline is needed + if ( + nextNode.type === "atrule" && + (nextNode.name === "else" || nextNode.name === "elseif") + ) { + if (hasNewLinesBeforeNext) { + complain(atrule, messages.rejected, reportIndex, " "); + } + } else { + if (!hasNewLinesBeforeNext) { + complain(atrule, messages.expected, reportIndex, context.newline); + } + } + } + }); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +rule.sassConditionalBraceNLAfterChecker = sassConditionalBraceNLAfterChecker; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/README.md b/node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/README.md new file mode 100644 index 000000000..f22ed99ee --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/README.md @@ -0,0 +1,100 @@ +# at-if-closing-brace-space-after + +Require a single space or disallow whitespace after the closing brace of `@if` statements. + +```scss +@if ($a == 0) { } + ↑ +/** ↑ + * The space after this brace */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +This rule might have conflicts with Stylelint's core [`block-closing-brace-space-after`](https://stylelint.io/user-guide/rules/block-closing-brace-space-after) rule if the latter is set up in your `.stylelintrc` config file. + +## Options + +`string`: `"always-intermediate"|"never-intermediate"` + +### `"always-intermediate"` + +There *must always* be a single space after the closing brace of `@if` that is not the last statement in a conditional statement chain (i.e. does have `@else` right after it). + +The following patterns are considered warnings: + +```scss +@if ($x == 1) { + // ... +}@else {} + +@if ($x == 1) { + // ... +} +@else { } + +// `@if` has a space and a newline after the closing brace +@if ($x == 1) { + // ... +} +@else { } + +@if ($x == 1) { + // ... +} @else { } // Two spaces +``` + +The following patterns are *not* considered warnings: + +```scss +@if ($x == 1) { + // ... +} @else {} + +a { + @if ($x == 1) {} + width: 10px; +} + +@if ($x == 1) { }@include x; + +@if ($x == 1) { + // ... +} @include x; +``` + +### `"never-intermediate"` + +There *must never* be a whitespace after the closing brace of `@if` that is not the last statement in a conditional statement chain (i.e. does have `@else` right after it). + +The following patterns are considered warnings: + +```scss +@if ($x == 1) { + // ... +} @else {} + +@if ($x == 1) { + // ... +} +@else { } +``` + +The following patterns are *not* considered warnings: + +```scss +@if ($x == 1) { + // ... +}@else {} + +a { + @if ($x == 1) {} + width: 10px; +} + +@if ($x == 1) { }@include x; + +@if ($x == 1) { + // ... +} @include x; +``` diff --git a/node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/index.js b/node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/index.js new file mode 100644 index 000000000..02b87eec3 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/index.js @@ -0,0 +1,108 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-if-closing-brace-space-after"); + +const messages = utils.ruleMessages(ruleName, { + expected: 'Expected single space after "}" of @if statement', + rejected: 'Unexpected space after "}" of @if statement' +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation, _, context) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation, + possible: ["always-intermediate", "never-intermediate"] + }); + + if (!validOptions) { + return; + } + + sassConditionalBraceSpaceAfterChecker({ + root, + result, + ruleName, + atRuleName: "if", + expectation, + messages, + context + }); + }; +} + +/** + * The core logic for this rule. Can be imported by other rules with similar + * logic, namely at-else-closing-brace-space-after + * + * @param {Object} args -- Named arguments object + * @param {PostCSS root} args.root + * @param {PostCSS result} args.result + * @param {String ruleName} args.ruleName - needed for `report` function + * @param {String} args.atRuleName - the name of the at-rule to be checked, e.g. "if", "else" + * @param {Object} args.messages - returned by stylelint.utils.ruleMessages + * @return {undefined} + */ +function sassConditionalBraceSpaceAfterChecker({ + root, + result, + ruleName, + atRuleName, + expectation, + messages, + context +}) { + function complain(node, message, index, fixValue) { + if (context.fix) { + node.next().raws.before = fixValue; + + return; + } + + utils.report({ + result, + ruleName, + node, + message, + index + }); + } + + root.walkAtRules(atrule => { + // Do nothing if it's not an @if + if (atrule.name !== atRuleName) { + return; + } + + const nextNode = atrule.next(); + const hasSpaceAfter = nextNode && nextNode.raws.before === " "; + const hasWhiteSpaceAfter = nextNode && nextNode.raws.before !== ""; + const reportIndex = atrule.toString().length; + + // When followed by an @else + if (nextNode && nextNode.type === "atrule" && nextNode.name === "else") { + // A single space is needed + if (expectation === "always-intermediate" && !hasSpaceAfter) { + complain(atrule, messages.expected, reportIndex, " "); + } else if (expectation === "never-intermediate" && hasWhiteSpaceAfter) { + // No whitespace is needed + complain(atrule, messages.rejected, reportIndex, ""); + } + } + }); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +rule.sassConditionalBraceSpaceAfterChecker = + sassConditionalBraceSpaceAfterChecker; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-if-no-null/README.md b/node_modules/stylelint-scss/src/rules/at-if-no-null/README.md new file mode 100644 index 000000000..66a1edba0 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-if-no-null/README.md @@ -0,0 +1,44 @@ +# at-if-no-null + +Check for equality to null is unnecessarily explicit since `null` is falsey in Sass. + +```scss +a { + @if $x == null {} +/** ↑ ↑ + * == or != null is unncessary */ +} +``` + +## Options + +true + +### `true` + +The following patterns are considered warnings: +```scss +a { + @if $x == null {} +} +``` + +```scss +a { + @if $x != null {} +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { + @if $x {} +} +``` + +```scss +a { + @if not $x {} +} +``` diff --git a/node_modules/stylelint-scss/src/rules/at-if-no-null/index.js b/node_modules/stylelint-scss/src/rules/at-if-no-null/index.js new file mode 100644 index 000000000..363f4b6b1 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-if-no-null/index.js @@ -0,0 +1,62 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-if-no-null"); + +const messages = utils.ruleMessages(ruleName, { + equals_null: "Expected @if not statement rather than @if statement == null", + not_equals_null: "Expected @if statement rather than @if statement != null" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation + }); + + if (!validOptions) { + return; + } + + root.walkAtRules(atrule => { + // Do nothing if it's not an @if + if (atrule.name !== "if") { + return; + } + + // If rule != null and (expr), skip + if (atrule.params.match(/.* != null and .*/)) { + return; + } + + if (atrule.params.match(/.* == null[ \t]*\)?/)) { + utils.report({ + message: messages.equals_null, + node: atrule, + result, + ruleName + }); + } else if (atrule.params.match(/.* != null[ \t]*\)?/)) { + utils.report({ + message: messages.not_equals_null, + node: atrule, + result, + ruleName + }); + } + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md b/node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md new file mode 100644 index 000000000..a12c20765 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md @@ -0,0 +1,59 @@ +# at-import-no-partial-leading-underscore + +Disallow leading underscore in partial names in `@import`. + +```scss +@import "path/to/_file" +/** ↑ + * Disallow this */ +``` + +The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import: + +* If the file’s extension is `.css`. +* If the filename begins with `http://` (or any other protocol). +* If the filename is a `url()`. +* If the `@import` has any media queries. + + +The following patterns are considered warnings: + +```scss +@import "_foo"; +``` + +```scss +@import "path/_fff"; +``` + +```scss +@import "path\\_fff"; /* Windows delimiters */ +``` + +```scss +@import "df/fff", '_1.scss'; +``` + +The following patterns are *not* considered warnings: + +```scss +@import "_path/fff"; /* underscore in a directory name, not in a partial name */ +``` + +```scss +@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */ +``` + +```scss +@import "_file.css"; /* Has ".css" extension, so doesn't count as a partial @import */ +``` + +```scss +/* Both are URIs, so don't count as partial @imports */ +@import "http://_file.scss"; +@import "//_file.scss"; +``` + +```scss +@import "_file.scss" screen; /* Has a media query, so doesn't count as a partial @import */ +``` diff --git a/node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/index.js b/node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/index.js new file mode 100644 index 000000000..349281c14 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/index.js @@ -0,0 +1,67 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-import-no-partial-leading-underscore"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Unexpected leading underscore in imported partial name" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(actual) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { actual }); + + if (!validOptions) { + return; + } + + function checkPathForUnderscore(path, decl) { + // Stripping trailing quotes and whitespaces, if any + const pathStripped = path + .replace(/^\s*(["'])\s*/, "") + .replace(/\s*(["'])\s*$/, ""); + + // Searching a _ at the start of filename + if (pathStripped.search(/(?:^|\/|\\)_[^/]+$/) === -1) { + return; + } + + // Skipping importing CSS: url(), ".css", URI with a protocol, media + if ( + pathStripped.slice(0, 4) === "url(" || + pathStripped.slice(-4) === ".css" || + pathStripped.search("//") !== -1 || + pathStripped.search(/[\s,)"']\w+$/) !== -1 + ) { + return; + } + + utils.report({ + message: messages.expected, + node: decl, + result, + ruleName + }); + } + + root.walkAtRules("import", decl => { + // Processing comma-separated lists of import paths + decl.params.split(",").forEach(path => { + checkPathForUnderscore(path, decl); + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/README.md b/node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/README.md new file mode 100644 index 000000000..ad353395b --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/README.md @@ -0,0 +1,70 @@ +# at-import-partial-extension-blacklist + +Specify a blacklist of disallowed file extensions for partial names in `@import` commands. + +```scss +@import "file.scss" +/** ↑ + * Blacklist of these */ +``` + +The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import: + +* If the file’s extension is `.css`. +* If the filename begins with `http://` (or any other protocol). +* If the filename is a `url()`. +* If the `@import` has any media queries. + +## Options + +`array`: `["array", "of", "extensions"]` + +Each value is either a string or a regexp. + +Given: + +```js +["scss", /less/] +``` + +The following patterns are considered warnings: + +```scss +@import "foo.scss"; +``` + +```scss +@import "path/fff.less"; +``` + +```scss +@import "path\\fff.ruthless"; +``` + +```scss +@import "df/fff", '1.SCSS'; +``` + +The following patterns are *not* considered warnings: + +```scss +@import "path/fff"; +``` + +```scss +@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */ +``` + +```scss +@import "file.css"; /* Has ".css" extension, so doesn't count as a partial @import */ +``` + +```scss +/* Both are URIs, so don't count as partial @imports */ +@import "http://_file.scss"; +@import "//_file.scss"; +``` + +```scss +@import "file.scss" screen; /* Has a media query, so doesn't count as a partial @import */ +``` diff --git a/node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/index.js b/node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/index.js new file mode 100644 index 000000000..72383fbbb --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/index.js @@ -0,0 +1,85 @@ +"use strict"; + +const nodeJsPath = require("path"); +const { utils } = require("stylelint"); +const { isRegExp, isString } = require("../../utils/validateTypes"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-import-partial-extension-blacklist"); + +const messages = utils.ruleMessages(ruleName, { + rejected: ext => `Unexpected extension ".${ext}" in imported partial name` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(blacklistOption) { + const blacklist = [].concat(blacklistOption); + + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: blacklistOption, + possible: [isString, isRegExp] + }); + + if (!validOptions) { + return; + } + + function checkPathForUnderscore(path, decl) { + // Stripping trailing quotes and whitespaces, if any + const pathStripped = path + .replace(/^\s*(["'])\s*/, "") + .replace(/\s*(["'])\s*$/, ""); + const extension = nodeJsPath.extname(pathStripped).slice(1); + // Save this separately to be able to pass the original string to report() + const extensionNormalized = extension.toLowerCase(); + + // If the extension is empty + if (!extension) { + return; + } + + // Skipping importing CSS: url(), ".css", URI with a protocol, media + if ( + pathStripped.slice(0, 4) === "url(" || + pathStripped.slice(-4) === ".css" || + pathStripped.search("//") !== -1 || + pathStripped.search(/[\s,)"']\w+$/) !== -1 + ) { + return; + } + + blacklist.forEach(ext => { + if ( + (isString(ext) && extensionNormalized === ext) || + (isRegExp(ext) && extensionNormalized.search(ext) !== -1) + ) { + utils.report({ + message: messages.rejected(extension), + node: decl, + word: extension, + result, + ruleName + }); + } + }); + } + + root.walkAtRules("import", atRule => { + // Processing comma-separated lists of import paths + atRule.params.split(",").forEach(path => { + checkPathForUnderscore(path, atRule); + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/README.md b/node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/README.md new file mode 100644 index 000000000..48d275e85 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/README.md @@ -0,0 +1,78 @@ +# at-import-partial-extension-whitelist + +Specify a whitelist of allowed file extensions for partial names in `@import` commands. + +```scss +@import "file.scss" +/** ↑ + * Whitelist of these */ +``` + +The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import: + +* If the file’s extension is `.css`. +* If the filename begins with `http://` (or any other protocol). +* If the filename is a `url()`. +* If the `@import` has any media queries. + +## Options + +`array`: `["array", "of", "extensions"]` + +Each value is either a string or a regexp. + +Given: + +```js +["scss", /less/] +``` + +The following patterns are considered warnings: + +```scss +@import "file.sass"; +``` + +```scss +@import "file1", "file.stylus"; +``` + +The following patterns are *not* considered warnings: + +```scss +@import "path/fff"; +``` + +```scss +@import "foo.scss"; +``` + +```scss +@import "path/fff.less"; +``` + +```scss +@import "path\\fff.ruthless"; +``` + +```scss +@import "df/fff", '1.SCSS'; +``` + +```scss +@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */ +``` + +```scss +@import "file.css"; /* Has ".css" extension, so doesn't count as a partial @import */ +``` + +```scss +/* Both are URIs, so don't count as partial @imports */ +@import "http://_file.scss"; +@import "//_file.scss"; +``` + +```scss +@import "file.scss" screen; /* Has a media query, so doesn't count as a partial @import */ +``` diff --git a/node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/index.js b/node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/index.js new file mode 100644 index 000000000..bc7569b99 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/index.js @@ -0,0 +1,89 @@ +"use strict"; + +const nodeJsPath = require("path"); +const { utils } = require("stylelint"); +const { isRegExp, isString } = require("../../utils/validateTypes"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-import-partial-extension-whitelist"); + +const messages = utils.ruleMessages(ruleName, { + rejected: ext => `Unexpected extension ".${ext}" in imported partial name` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(whitelistOption) { + const whitelist = [].concat(whitelistOption); + + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: whitelistOption, + possible: [isString, isRegExp] + }); + + if (!validOptions) { + return; + } + + function checkPathForUnderscore(path, decl) { + // Stripping trailing quotes and whitespaces, if any + const pathStripped = path + .replace(/^\s*(["'])\s*/, "") + .replace(/\s*(["'])\s*$/, ""); + const extension = nodeJsPath.extname(pathStripped).slice(1); + // Save this separately to be able to pass the original string to report() + const extensionNormalized = extension.toLowerCase(); + + // If the extension is empty + if (!extension) { + return; + } + + // Skipping importing CSS: url(), ".css", URI with a protocol, media + if ( + pathStripped.slice(0, 4) === "url(" || + pathStripped.slice(-4) === ".css" || + pathStripped.search("//") !== -1 || + pathStripped.search(/[\s,)"']\w+$/) !== -1 + ) { + return; + } + + if ( + whitelist.some(ext => { + return ( + (isString(ext) && extensionNormalized === ext) || + (isRegExp(ext) && extensionNormalized.search(ext) !== -1) + ); + }) + ) { + return; + } + + utils.report({ + message: messages.rejected(extension), + node: decl, + word: extension, + result, + ruleName + }); + } + + root.walkAtRules("import", atRule => { + // Processing comma-separated lists of import paths + atRule.params.split(",").forEach(path => { + checkPathForUnderscore(path, atRule); + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-import-partial-extension/README.md b/node_modules/stylelint-scss/src/rules/at-import-partial-extension/README.md new file mode 100644 index 000000000..b059c5b00 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-import-partial-extension/README.md @@ -0,0 +1,118 @@ +# at-import-partial-extension + +Require or disallow extension in `@import` commands. + +```scss +@import "file.scss"; +/** ↑ + * This extension */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule only when `"never"` is given. + +The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import: + +- If the file’s extension is `.css`. +- If the filename begins with `http://` (or any other protocol). +- If the filename is a `url()`. +- If the `@import` has any media queries. + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +The following patterns are considered warnings: + +```scss +@import "foo"; +``` + +```scss +@import "path/fff"; +``` + +```scss +@import "path\\fff"; +``` + +```scss +@import "df/fff", "1.SCSS"; +``` + +The following patterns are _not_ considered warnings: + +```scss +@import "fff.scss"; +``` + +```scss +@import "path/fff.scss"; +``` + +```scss +@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */ +``` + +```scss +@import "file.css"; /* Has ".css" extension, so doesn't count as a partial @import */ +``` + +```scss +/* Both are URIs, so don't count as partial @imports */ +@import "http://_file.scss"; +@import "//_file.scss"; +``` + +```scss +@import "file.scss" screen; /* Has a media query, so doesn't count as a partial @import */ +``` + +### `"never"` + +The following patterns are considered warnings: + +```scss +@import "foo.scss"; +``` + +```scss +@import "path/fff.less"; +``` + +```scss +@import "path\\fff.ruthless"; +``` + +```scss +@import "df/fff", "1.SCSS"; +``` + +The following patterns are _not_ considered warnings: + +```scss +@import "foo"; +``` + +```scss +@import "path/fff"; +``` + +```scss +@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */ +``` + +```scss +@import "file.css"; /* Has ".css" extension, so doesn't count as a partial @import */ +``` + +```scss +/* Both are URIs, so don't count as partial @imports */ +@import "http://_file.scss"; +@import "//_file.scss"; +``` + +```scss +@import "file.scss" screen; /* Has a media query, so doesn't count as a partial @import */ +``` diff --git a/node_modules/stylelint-scss/src/rules/at-import-partial-extension/index.js b/node_modules/stylelint-scss/src/rules/at-import-partial-extension/index.js new file mode 100644 index 000000000..9ca1aaba5 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-import-partial-extension/index.js @@ -0,0 +1,107 @@ +"use strict"; + +const nodeJsPath = require("path"); +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-import-partial-extension"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected @import to have an extension", + rejected: ext => `Unexpected extension ".${ext}" in @import` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +// https://drafts.csswg.org/mediaqueries/#media-types +const mediaQueryTypes = [ + "all", + "print", + "screen", + "speech", + "tv", + "tty", + "projection", + "handheld", + "braille", + "embossed", + "aural" +]; + +const mediaQueryTypesRE = new RegExp(`(${mediaQueryTypes.join("|")})$`, "i"); +const stripPath = path => + path.replace(/^\s*(["'])\s*/, "").replace(/\s*(["'])\s*$/, ""); + +function rule(expectation, _, context) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation, + possible: ["always", "never"] + }); + + if (!validOptions) { + return; + } + + root.walkAtRules("import", decl => { + const paths = decl.params + .split(/["']\s*,/) + .filter(path => !mediaQueryTypesRE.test(path.trim())); + + // Processing comma-separated lists of import paths + paths.forEach(path => { + // Stripping trailing quotes and whitespaces, if any + const pathStripped = stripPath(path); + + // Skipping importing CSS: url(), ".css", URI with a protocol + if ( + pathStripped.slice(0, 4) === "url(" || + pathStripped.slice(-4) === ".css" || + pathStripped.search("//") !== -1 + ) { + return; + } + + const extension = nodeJsPath.extname(pathStripped).slice(1); + + if (!extension && expectation === "always") { + utils.report({ + message: messages.expected, + node: decl, + result, + ruleName + }); + + return; + } + + const isScssPartial = extension === "scss"; + if (extension && isScssPartial && expectation === "never") { + if (context.fix) { + const extPattern = new RegExp(`\\.${extension}(['" ]*)$`, "g"); + decl.params = decl.params.replace(extPattern, "$1"); + + return; + } + + utils.report({ + message: messages.rejected(extension), + node: decl, + word: extension, + result, + ruleName + }); + } + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/README.md b/node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/README.md new file mode 100644 index 000000000..50089c160 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/README.md @@ -0,0 +1,47 @@ +# at-mixin-argumentless-call-parentheses + +Require or disallow parentheses in argumentless `@mixin` calls. + +```scss +@include mixin-name() { +/** ↑ + * Such mixin calls */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +There *must always* be parentheses in mixin calls, even if no arguments are passed. + +The following patterns are considered warnings: + +```scss +@include mixin-name; +``` + +The following patterns are *not* considered warnings: + +```scss +@include mixin-name(); +``` + +### `"never"` + +There *must never* be parentheses when calling a mixin without arguments. + +The following patterns are considered warnings: + +```scss +@include mixin-name(); +``` + +The following patterns are *not* considered warnings: + +```scss +@include mixin-name; +``` diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/index.js b/node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/index.js new file mode 100644 index 000000000..f49555e13 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/index.js @@ -0,0 +1,68 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-mixin-argumentless-call-parentheses"); + +const messages = utils.ruleMessages(ruleName, { + expected: mixin => `Expected parentheses in mixin "${mixin}" call`, + rejected: mixin => + `Unexpected parentheses in argumentless mixin "${mixin}" call` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(value, _, context) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: value, + possible: ["always", "never"] + }); + + if (!validOptions) { + return; + } + + root.walkAtRules("include", mixinCall => { + // If it is "No parens in argumentless calls" + if (value === "never" && mixinCall.params.search(/\(\s*\)\s*$/) === -1) { + return; + } + + // If it is "Always use parens" + if (value === "always" && mixinCall.params.search(/\(/) !== -1) { + return; + } + + if (context.fix) { + if (value === "always") { + mixinCall.params = `${mixinCall.params} ()`; + } else { + mixinCall.params = mixinCall.params.replace(/\s*\([\s\S]*?\)$/, ""); + } + + return; + } + + const mixinName = /\s*(\S*?)\s*(?:\(|$)/.exec(mixinCall.params)[1]; + + utils.report({ + message: + messages[value === "never" ? "rejected" : "expected"](mixinName), + node: mixinCall, + result, + ruleName + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/README.md b/node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/README.md new file mode 100644 index 000000000..4eafe2058 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/README.md @@ -0,0 +1,102 @@ +# at-mixin-named-arguments + +Require named parameters in at-mixin call rule. + +```scss +@include animation($duration: 250ms) { +// ↑ +// Require or disallow this +``` + +## Options + +`string`: `"always"|"never"` + +### `always` + +The following patterns are considered warnings: + +```scss +.foo { + @include animation(250ms, 100ms, infinite); +} +``` + +```scss +.foo { + @include animation(250ms); +} +``` + +```scss +.foo { + @include reset($value: 20, 'bar', $color: #FFF); +} +``` + +The following patterns are *not* considered warnings: + +```scss +.foo { + @include animation($duration: 250ms); +} +``` + +```scss +.foo { + @include animation($duration: 250ms, $delay: 100ms, $direction: infinite); +} +``` + +### `never` + +The following patterns are considered warnings: + +```scss +.foo { + @include reset($value: 20); +} +``` + +```scss +.foo { + @include animation($duration: 250ms, $delay: 100ms, $direction: infinite); +} +``` + +```scss +.foo { + @include reset($value: 20, 'bar', $color: #FFF); +} +``` + +The following patterns are *not* considered warnings: + +```scss +.foo { + @include animation(250ms, 100ms, infinite); +} +``` + +## Optional secondary options + +### `"ignore": ["single-argument"]` + +Given: +```json +{ "ignore": ["single-argument"] } +``` + +The following patterns are *not* considered warnings: + +```scss +.foo { + @include animation($duration: 250ms); +} +``` + +```scss +.foo { + @include reset(20); +} +``` diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/index.js b/node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/index.js new file mode 100644 index 000000000..c3063f48a --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/index.js @@ -0,0 +1,125 @@ +"use strict"; + +const { utils } = require("stylelint"); +const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-mixin-named-arguments"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected a named parameter to be used in at-include call", + rejected: "Unexpected a named parameter in at-include call" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +const hasArgumentsRegExp = /\((.*)\)$/; +const isScssVarRegExp = /^\$\S*/; + +function rule(expectation, options) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: expectation, + possible: ["always", "never"] + }, + { + actual: options, + possible: { + ignore: ["single-argument"] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + const shouldIgnoreSingleArgument = optionsHaveIgnored( + options, + "single-argument" + ); + + root.walkAtRules("include", atRule => { + const argsString = atRule.params + .replace(/\n/g, " ") + .match(hasArgumentsRegExp); + + // Ignore @include that does not contain arguments. + if ( + !argsString || + argsString.index === -1 || + argsString[0].length === 2 + ) { + return; + } + + const args = argsString[1] + // Create array of arguments. + .split(",") + // Create a key-value array for every argument. + .map(argsString => + argsString.split(":").map(argsKeyValuePair => argsKeyValuePair.trim()) + ) + .reduce((resultArray, keyValuePair) => { + const pair = { value: keyValuePair[1] || keyValuePair[0] }; + + if (keyValuePair[1]) { + pair.key = keyValuePair[0]; + } + + return [...resultArray, pair]; + }, []); + + const isSingleArgument = args.length === 1; + + if (isSingleArgument && shouldIgnoreSingleArgument) { + return; + } + + args.forEach(arg => { + switch (expectation) { + case "never": { + if (!arg.key) { + return; + } + + utils.report({ + message: messages.rejected, + node: atRule, + result, + ruleName + }); + break; + } + + case "always": { + if (arg.key && isScssVarRegExp.test(arg.key)) { + return; + } + + utils.report({ + message: messages.expected, + node: atRule, + result, + ruleName + }); + break; + } + } + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/README.md b/node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/README.md new file mode 100644 index 000000000..6e291f34e --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/README.md @@ -0,0 +1,58 @@ +# at-mixin-parentheses-space-before + +Require or disallow a space before `@mixin` parentheses. + +```scss +@mixin foo ($arg) { } +/** ↑ + * The space before this parenthesis */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +There *must always* be exactly one space between the mixin name and the opening parenthesis. + +*Note: This rule does not enforce parentheses to be present in a declaration without arguments.* + +The following patterns are considered warnings: + +```scss +@mixin foo($arg) { } +``` +```scss +@mixin foo ($arg) { } +``` + +The following patterns are *not* considered warnings: + +```scss +@mixin foo ($arg) { } +``` +```scss +@mixin foo { } +``` + +### `"never"` + +There *must never* be any whitespace between the mixin name and the opening parenthesis. + +The following patterns are considered warnings: + +```scss +@mixin foo ($arg) { } +``` + +The following patterns are *not* considered warnings: + +```scss +@mixin foo($arg) { } +``` +```scss +@mixin foo { } +``` diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/index.js b/node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/index.js new file mode 100644 index 000000000..1ddccd4f2 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/index.js @@ -0,0 +1,57 @@ +"use strict"; + +const { utils } = require("stylelint"); +const whitespaceChecker = require("../../utils/whitespaceChecker"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-mixin-parentheses-space-before"); + +const messages = utils.ruleMessages(ruleName, { + rejectedBefore: () => + "Unexpected whitespace before parentheses in mixin declaration", + expectedBefore: () => + "Expected a single space before parentheses in mixin declaration" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(value, _, context) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: value, + possible: ["always", "never"] + }); + + if (!validOptions) { + return; + } + + const match = /^([\w-]+)\s*\(/; + const replacement = value === "always" ? "$1 (" : "$1("; + + const checker = whitespaceChecker("space", value, messages).before; + + root.walkAtRules("mixin", decl => { + if (context.fix) { + decl.params = decl.params.replace(match, replacement); + + return; + } + + checker({ + source: decl.params, + index: decl.params.indexOf("("), + err: message => utils.report({ message, node: decl, result, ruleName }) + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-pattern/README.md b/node_modules/stylelint-scss/src/rules/at-mixin-pattern/README.md new file mode 100644 index 000000000..786b2f0c4 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-mixin-pattern/README.md @@ -0,0 +1,29 @@ +# at-mixin-pattern + +Specify a pattern for Sass/SCSS-like mixin names. + +```scss +@mixin complex-object ($items: 10) { +/** ↑ + * The pattern of this */ +``` + +## Options + +`regex` or `string` + +A string will be translated into a RegExp like so `new RegExp(yourString)` — so be sure to escape properly. + +### E.g. `/foo-.+/` + +The following patterns are considered warnings: + +```scss +@mixin boo-bar { +``` + +The following patterns are *not* considered warnings: + +```scss +@mixin foo-bar { +``` diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-pattern/index.js b/node_modules/stylelint-scss/src/rules/at-mixin-pattern/index.js new file mode 100644 index 000000000..9a6634a5e --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-mixin-pattern/index.js @@ -0,0 +1,62 @@ +"use strict"; + +const { utils } = require("stylelint"); +const { isRegExp, isString } = require("../../utils/validateTypes"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-mixin-pattern"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected @mixin name to match specified pattern" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(pattern) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: pattern, + possible: [isRegExp, isString] + }); + + if (!validOptions) { + return; + } + + const regexpPattern = isString(pattern) ? new RegExp(pattern) : pattern; + + root.walkAtRules(decl => { + if (decl.name !== "mixin") { + return; + } + + // Stripping the mixin of its arguments + const mixinName = decl.params.replace(/(\s*)\([\s\S]*\)/g, ""); + + if (regexpPattern.test(mixinName)) { + return; + } + + const mixinTopLine = Object.assign({}, decl.source.start); + mixinTopLine.line += 1; + mixinTopLine.column = 0; + + utils.report({ + message: messages.expected, + node: decl, + result, + ruleName, + end: mixinTopLine + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/README.md b/node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/README.md new file mode 100644 index 000000000..e389992f5 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/README.md @@ -0,0 +1,43 @@ +# at-rule-conditional-no-parentheses + +Disallow parentheses in conditional @ rules (if, elsif, while) + +```css + @if (true) {} +/** ↑ ↑ + * Get rid of parentheses like this. */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +## Options + +### `true` + +The following patterns are considered warnings: + +```scss +@if(true) +``` + +```scss +@else if(true) +``` + +```scss +@while(true) +``` + +The following patterns are *not* considered warnings: + +```scss +@if true +``` + +```scss +@else if true +``` + +```scss +@while true +``` diff --git a/node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/index.js b/node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/index.js new file mode 100644 index 000000000..d89564e25 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/index.js @@ -0,0 +1,82 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-rule-conditional-no-parentheses"); + +const messages = utils.ruleMessages(ruleName, { + rejected: "Unexpected () used to surround statements for @-rules" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +// postcss picks up else-if as else. +const conditional_rules = ["if", "while", "else"]; + +function report(atrule, result) { + utils.report({ + message: messages.rejected, + node: atrule, + result, + ruleName + }); +} + +function fix(atrule) { + const regex = /(if)? ?\((.*)\)/; + + // 2 regex groups: 'if ' and cond. + const groups = atrule.params.match(regex).slice(1); + + atrule.params = [...new Set(groups)].join(" "); +} + +function rule(primary, _unused, context) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: primary + }); + + if (!validOptions) { + return; + } + + root.walkAtRules(atrule => { + // Check if this is a conditional rule. + if (!conditional_rules.includes(atrule.name)) { + return; + } + + // Else uses a different regex + // params are of format "`if (cond)` or `if cond` + // instead of `(cond)` or `cond`" + if (atrule.name === "else") { + if (atrule.params.match(/ ?if ?\(.*\) ?$/)) { + if (context.fix) { + fix(atrule); + } else { + report(atrule, result); + } + } + } else { + if (atrule.params.trim().match(/^\(.*\)$/)) { + if (context.fix) { + fix(atrule); + } else { + report(atrule, result); + } + } + } + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-rule-no-unknown/README.md b/node_modules/stylelint-scss/src/rules/at-rule-no-unknown/README.md new file mode 100644 index 000000000..d26b42bda --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-rule-no-unknown/README.md @@ -0,0 +1,76 @@ +# at-rule-no-unknown + +Disallow unknown at-rules. Should be used **instead of** Stylelint's [at-rule-no-unknown](https://stylelint.io/user-guide/rules/at-rule-no-unknown). + +```css + @unknown (max-width: 960px) {} +/** ↑ + * At-rules like this */ +``` + +This rule is basically a wrapper around the mentioned core rule, but with added SCSS-specific `@`-directives. So if you use the core rule, `@if`, `@extend` and other Sass-y things will get warnings. You must disable Stylelint's core rule to make this rule work: + +```json +{ + "rules": { + "at-rule-no-unknown": null, + "scss/at-rule-no-unknown": true + } +} +``` + +## Options + +### `true` + +The following patterns are considered warnings: + +```css +@unknown {} +``` + +The following patterns are *not* considered warnings: + +```css +@function foo () {} +``` + +```css +@while ($i == 1) {} +``` + +```css +@media (max-width: 960px) {} +``` + +```css +@if ($i) {} @else {} +``` + +## Optional secondary options + +### `ignoreAtRules: ["/regex/", "string"]` + +Given: + +```js +["/^my-/i", "custom"] +``` + +The following patterns are *not* considered warnings: + +```css +@my-at-rule "x.css"; +``` + +```css +@my-other-at-rule {} +``` + +```css +@MY-OTHER-AT-RULE {} +``` + +```css +@custom {} +``` diff --git a/node_modules/stylelint-scss/src/rules/at-rule-no-unknown/index.js b/node_modules/stylelint-scss/src/rules/at-rule-no-unknown/index.js new file mode 100644 index 000000000..1fef73c2e --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-rule-no-unknown/index.js @@ -0,0 +1,102 @@ +"use strict"; + +const { rules, utils } = require("stylelint"); +const { isRegExp, isString } = require("../../utils/validateTypes"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const sassAtRules = [ + "at-root", + "content", + "debug", + "each", + "else", + "else if", + "error", + "extend", + "for", + "forward", + "function", + "if", + "import", + "include", + "media", + "mixin", + "return", + "use", + "warn", + "while" +]; + +const ruleToCheckAgainst = "at-rule-no-unknown"; + +const ruleName = namespace(ruleToCheckAgainst); + +const messages = utils.ruleMessages(ruleName, { + rejected: (...args) => { + return rules[ruleToCheckAgainst].messages + .rejected(...args) + .replace(` (${ruleToCheckAgainst})`, ""); + } +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(primaryOption, secondaryOptions) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: primaryOption + }, + { + actual: secondaryOptions, + possible: { + ignoreAtRules: [isRegExp, isString] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + const optionsAtRules = secondaryOptions && secondaryOptions.ignoreAtRules; + const ignoreAtRules = sassAtRules.concat(optionsAtRules || []); + const defaultedOptions = Object.assign({}, secondaryOptions, { + ignoreAtRules + }); + + utils.checkAgainstRule( + { + ruleName: ruleToCheckAgainst, + ruleSettings: [primaryOption, defaultedOptions], + root + }, + warning => { + const name = warning.node.name; + + if (!ignoreAtRules.includes(name)) { + utils.report({ + message: messages.rejected(`@${name}`), + ruleName, + result, + node: warning.node, + start: { line: warning.line, column: warning.column }, + end: { line: warning.endLine, column: warning.endColumn } + }); + } + } + ); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/README.md b/node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/README.md new file mode 100644 index 000000000..35d8b5dce --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/README.md @@ -0,0 +1,25 @@ +# at-use-no-unnamespaced + +Disallow usage of `@use` without a namespace. + +```scss +@use "foo" as *; +/** ↑ + * Disallow this */ +``` + +The following patterns are considered warnings: + +```scss +@use "foo" as *; +``` + +The following patterns are _not_ considered warnings: + +```scss +@use "foo"; +``` + +```scss +@use "foo" as bar; +``` diff --git a/node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/index.js b/node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/index.js new file mode 100644 index 000000000..2c3503e4c --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/index.js @@ -0,0 +1,42 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("at-use-no-unnamespaced"); + +const messages = utils.ruleMessages(ruleName, { + rejected: "Unexpected @use without namespace" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(actual) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { actual }); + + if (!validOptions) { + return; + } + + root.walkAtRules("use", decl => { + if (/as\s*\*\s*(?:$|with\s*\()/.test(decl.params)) { + utils.report({ + message: messages.rejected, + node: decl, + result, + ruleName + }); + } + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/comment-no-empty/README.md b/node_modules/stylelint-scss/src/rules/comment-no-empty/README.md new file mode 100644 index 000000000..e8ec36378 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/comment-no-empty/README.md @@ -0,0 +1,67 @@ +# comment-no-empty + +Disallow empty comments. Should be used **instead of** the Stylelint's [comment-no-empty](https://stylelint.io/user-guide/rules/comment-no-empty) because the core rule ignores SCSS-like comments. + + +```scss + /* */ + // +``` + +To avoid duplicate issues, you must disable the core rule as follows: + +```json +{ + "rules": { + "comment-no-empty": null, + "scss/comment-no-empty": true + } +} +``` + +## Options + +### `true` + +The following patterns are considered violations: + + +```scss +/**/ +``` + + +```scss +/* */ +``` + + +```scss +/* + + */ +``` + + +```scss +// +``` + + +```scss +width: 10px; // +``` + +The following patterns are _not_ considered violations: + + +```scss +/* comment */ +``` + + +```scss +/* + * Multi-line Comment +**/ +``` diff --git a/node_modules/stylelint-scss/src/rules/comment-no-empty/index.js b/node_modules/stylelint-scss/src/rules/comment-no-empty/index.js new file mode 100644 index 000000000..03b02b3e1 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/comment-no-empty/index.js @@ -0,0 +1,53 @@ +"use strict"; + +const { rules, utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const coreRuleName = "comment-no-empty"; + +const ruleName = namespace(coreRuleName); + +const messages = utils.ruleMessages(ruleName, { + rejected: rules[coreRuleName].messages.rejected.replace( + ` (${coreRuleName})`, + "" + ) +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(primary) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: primary + }); + + if (!validOptions) { + return; + } + + root.walkComments(comment => { + if (isEmptyComment(comment)) { + utils.report({ + message: messages.rejected, + node: comment, + result, + ruleName + }); + } + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +function isEmptyComment(comment) { + return comment.text === ""; +} + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/comment-no-loud/README.md b/node_modules/stylelint-scss/src/rules/comment-no-loud/README.md new file mode 100644 index 000000000..c75232e53 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/comment-no-loud/README.md @@ -0,0 +1,33 @@ +# comment-no-loud + +Disallow `/*`-comments. + +```scss +/* Comment */ +// ↑ ↑ +// This line +``` + +This rule only works on CSS comments (`/* */`) and ignores all double-slash (`//`) comments. + +## Options + +### `true` + +The following patterns are considered violations: + +```scss +/* comment */ +``` + +```scss +/* + * comment +*/ +``` + +The following patterns are *not* considered warnings: + +```scss +// comment +``` diff --git a/node_modules/stylelint-scss/src/rules/comment-no-loud/index.js b/node_modules/stylelint-scss/src/rules/comment-no-loud/index.js new file mode 100644 index 000000000..bc2b2f7bd --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/comment-no-loud/index.js @@ -0,0 +1,53 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("comment-no-loud"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected // for comments instead of /*" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(primary) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: primary + }); + + if (!validOptions) { + return; + } + + root.walkComments(comment => { + if (isLoudComment(comment)) { + utils.report({ + message: messages.expected, + node: comment, + result, + ruleName + }); + } + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +function isLoudComment(comment) { + const regex = new RegExp(/^[ \t\n]*\/\*/); + + const splitComment = comment.source.input.css.split("\n"); + const commentFirstLine = splitComment[comment.source.start.line - 1]; + + return regex.test(commentFirstLine); +} + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/README.md b/node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/README.md new file mode 100644 index 000000000..c96e43103 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/README.md @@ -0,0 +1,68 @@ +# declaration-nested-properties-no-divided-groups + +Disallow nested properties of the same "namespace" be divided into multiple groups. + +```scss +/* Such groups: */ +font: { /* `font` is a "namespace" */ + size: 16px; + weight: 700; +} +``` + +A "namespace" is everything before the first `-` in property names, e.g. `margin` in `margin-bottom`. It is the "namespace" that is used as a root identifier for a nested properties group (`font` in the example above). + +[Sass official docs on nested properties](https://sass-lang.com/documentation/style-rules/declarations#nesting). + +The following patterns are considered warnings: + +```scss +a { + background: url(img.png) center { + size: auto; + } + background: { + repeat: no-repeat; + } +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { + background: url(img.png) center { + size: auto; + } + background-repeat: no-repeat; +} +``` + +```scss +a { + background: url(img.png) center no-repeat { + color: red; + } + margin: 10px { + left: 1px; + } +} +``` + +```scss +a { + background: url(img.png) center { + size: auto; + } + background :red { + repeat: no-repeat; + } +} +/* There is no space after the colon in `background :red` so it is considered A SELECTOR and is compiled into: + +a background :red { + color: blue; +} + +*/ +``` diff --git a/node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/index.js b/node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/index.js new file mode 100644 index 000000000..cce9e986c --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/index.js @@ -0,0 +1,80 @@ +"use strict"; + +const { utils } = require("stylelint"); +const parseNestedPropRoot = require("../../utils/parseNestedPropRoot"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const hasOwnProp = Object.prototype.hasOwnProperty; + +const ruleName = namespace("declaration-nested-properties-no-divided-groups"); + +const messages = utils.ruleMessages(ruleName, { + expected: prop => + `Expected all nested properties of "${prop}" namespace to be in one nested group` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation + }); + + if (!validOptions) { + return; + } + + root.walk(item => { + if (item.type !== "rule" && item.type !== "atrule") { + return; + } + + const nestedGroups = {}; + + // Find all nested property groups + item.each(decl => { + if (decl.type !== "rule") { + return; + } + + const testForProp = parseNestedPropRoot(decl.selector); + + if (testForProp && testForProp.propName !== undefined) { + const ns = testForProp.propName.value; + + if (!hasOwnProp.call(nestedGroups, ns)) { + nestedGroups[ns] = []; + } + + nestedGroups[ns].push(decl); + } + }); + + Object.keys(nestedGroups).forEach(namespace => { + // Only warn if there are more than one nested groups with equal namespaces + if (nestedGroups[namespace].length === 1) { + return; + } + + nestedGroups[namespace].forEach(group => { + utils.report({ + message: messages.expected(namespace), + node: group, + result, + ruleName + }); + }); + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/declaration-nested-properties/README.md b/node_modules/stylelint-scss/src/rules/declaration-nested-properties/README.md new file mode 100644 index 000000000..9536ef06c --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/declaration-nested-properties/README.md @@ -0,0 +1,153 @@ +# declaration-nested-properties + +Require or disallow properties with `-` in their names to be in a form of a nested group. + +```scss +/* This is properties nesting: */ +font: { + size: 16px; + weight: 700; +} +``` + +[Sass official docs on nested properties](https://sass-lang.com/documentation/style-rules/declarations#nesting). + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +*Every property* with a `-` in its name *must be* inside a nested property group. + +Property names with browser prefixes are ignored with `always`. + +The following patterns are considered warnings: + +```scss +a { + margin-left: 10px; +} +``` + +```scss +a { + font: { + size: 10px; + } + font-weight: 400; // This one should be nested aswell +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { + margin: { + left: 10px; + } +} +``` + +```scss +a { + font: 10px/1.1 Arial { + weight: bold; + } +} +``` + +```scss +a { + -webkit-box-sizing: border-box; + -webkit-box-shadow: 1px 0 0 red; +} +``` + +### `"never"` + +Nested properties are not allowed. + +The following patterns are considered warnings: + +```scss +a { + margin: { + left: 10px; + } +} +``` + +```scss +a { + background: red { + repeat: no-repeat; + } +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { + background-color: red; + background-repeat: no-repeat; +} +``` + +```scss +a { + background:red { + color: blue; + } +} + +/* There is no space after the colon in `background:red` so it is considered A SELECTOR and is compiled into: + +a background:red { + color: blue; +} + +*/ +``` + +## Optional options + +### `except: ["only-of-namespace"]` + +*Works only* with `"always"` and reverses its effect for a property if it is the only one with the corresponding "namespace" (e.g. `margin` in `margin-top`) in a ruleset. + +The following patterns are considered warnings: + +```scss +a { + font-family: Arial, sans-serif; + font-size: 10px; +} +``` + +```scss +a { + font: { + size: 10px; // Only one rule nested (reverse "always") + } +} +``` + +```scss +a { + font: { + size: 10px; // Prop 1, ... + } + font-weight: 400; // ... prop 2, so must be nested as well +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { + position: absolute; + background-color: red; // no other `background-` properties in a ruleset +} +``` diff --git a/node_modules/stylelint-scss/src/rules/declaration-nested-properties/index.js b/node_modules/stylelint-scss/src/rules/declaration-nested-properties/index.js new file mode 100644 index 000000000..e9e785f62 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/declaration-nested-properties/index.js @@ -0,0 +1,168 @@ +"use strict"; + +const { utils } = require("stylelint"); +const isStandardSyntaxProperty = require("../../utils/isStandardSyntaxProperty"); +const optionsHaveException = require("../../utils/optionsHaveException"); +const namespace = require("../../utils/namespace"); +const parseNestedPropRoot = require("../../utils/parseNestedPropRoot"); +const ruleUrl = require("../../utils/ruleUrl"); + +const hasOwnProp = Object.prototype.hasOwnProperty; + +const ruleName = namespace("declaration-nested-properties"); + +const messages = utils.ruleMessages(ruleName, { + expected: prop => `Expected property "${prop}" to be in a nested form`, + rejected: prop => `Unexpected nested property "${prop}"` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation, options) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: expectation, + possible: ["always", "never"] + }, + { + actual: options, + possible: { + except: ["only-of-namespace"] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + if (expectation === "always") { + root.walk(item => { + if (item.type !== "rule" && item.type !== "atrule") { + return; + } + + const warningCandidates = {}; + + item.each(decl => { + const { prop, type, selector } = decl; + + // Looking for namespaced non-nested properties + // Namespaced prop is basically a prop with a `-` in a name, e.g. `margin-top` + if (type === "decl") { + if (!isStandardSyntaxProperty(prop)) { + return; + } + + // Add simple namespaced prop decls to warningCandidates.ns + // (prop names with browser prefixes are ignored) + const seekNamespace = /^([a-zA-Z\d]+)-/.exec(prop); + + if (seekNamespace && seekNamespace[1]) { + const ns = seekNamespace[1]; + + if (!hasOwnProp.call(warningCandidates, ns)) { + warningCandidates[ns] = []; + } + + warningCandidates[ns].push({ node: decl }); + } + } + + // Nested props, `prop: [value] { }` + if (type === "rule" || (type === "decl" && decl.isNested)) { + // `background:red {` - selector; + // `background: red {` - nested prop; space is decisive here + const testForProp = parseNestedPropRoot( + selector || decl.toString() + ); + + if (testForProp && testForProp.propName !== undefined) { + const ns = testForProp.propName.value; + + if (!hasOwnProp.call(warningCandidates, ns)) { + warningCandidates[ns] = []; + } + + warningCandidates[ns].push({ + node: decl, + nested: true + }); + } + } + }); + + // Now check if the found properties deserve warnings + Object.keys(warningCandidates).forEach(namespace => { + const exceptIfOnlyOfNs = optionsHaveException( + options, + "only-of-namespace" + ); + const moreThanOneProp = warningCandidates[namespace].length > 1; + + warningCandidates[namespace].forEach(candidate => { + if (candidate.nested === true) { + if (exceptIfOnlyOfNs) { + // If there is only one prop inside a nested prop - warn (reverse "always") + if ( + candidate.nested === true && + candidate.node.nodes.length === 1 + ) { + utils.report({ + message: messages.rejected(namespace), + node: candidate.node, + result, + ruleName + }); + } + } + } else { + // Don't warn on non-nested namespaced props if there are + // less than 2 of them, and except: "only-of-namespace" is set + if (exceptIfOnlyOfNs && !moreThanOneProp) { + return; + } + + utils.report({ + message: messages.expected(candidate.node.prop), + node: candidate.node, + result, + ruleName + }); + } + }); + }); + }); + } else if (expectation === "never") { + root.walk(item => { + // Just check if there are ANY nested props + if (item.type === "rule") { + // `background:red {` - selector; + // `background: red {` - nested prop; space is decisive here + const testForProp = parseNestedPropRoot(item.selector); + + if (testForProp && testForProp.propName !== undefined) { + utils.report({ + message: messages.rejected(testForProp.propName.value), + result, + ruleName, + node: item + }); + } + } + }); + } + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/README.md b/node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/README.md new file mode 100644 index 000000000..985444f9c --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/README.md @@ -0,0 +1,93 @@ +# dimension-no-non-numeric-values + +Interpolating a value with a unit (e.g. `#{$value}px`) results in a +_string_ value, not as numeric value. This value then cannot be used in +numerical operations. It is better to use arithmetic to apply a unit to a +number (e.g. `$value * 1px`). + +This rule requires that all interpolation for values should be in the format `$value * 1` instead of `#{value}` + +```scss +$value: 4; + +p { + padding: #{value}px; +// ↑ ↑ +// should be $value * 1px +} +``` + +## Options + +### `true` + +The following patterns are considered violations: + +```scss +$value: 4; + +p { + padding: #{value}px; +} +``` + +The following patterns are _not_ considered violations: + +```scss +$value: 4; + +p { + padding: $value * 1px; +} +``` + +## List of units +Font-relative lengths ([link](https://www.w3.org/TR/css-values-4/#font-relative-lengths)) +* em +* ex +* cap +* ch +* ic +* rem +* lh +* rlh + +Viewport-relative lengths ([link](https://www.w3.org/TR/css-values-4/#viewport-relative-lengths)) +* vw +* vh +* vi +* vb +* vmin +* vmax + +Absolute lengths ([link](https://www.w3.org/TR/css-values-4/#absolute-lengths)) +* cm +* mm +* Q +* in +* pc +* pt +* px + +Angle units ([link](https://www.w3.org/TR/css-values-4/#angles)) +* deg +* grad +* rad +* turn + +Duration units ([link](https://www.w3.org/TR/css-values-4/#time)) +* s +* ms + +Frequency units ([link](https://www.w3.org/TR/css-values-4/#frequency)) +* Hz +* kHz + +Resolution units ([link](https://www.w3.org/TR/css-values-4/#resolution)) +* dpi +* dpcm +* dppx +* x + +Flexible lengths ([link](https://www.w3.org/TR/css-grid-1/#fr-unit)) +* fr diff --git a/node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/index.js b/node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/index.js new file mode 100644 index 000000000..0d21e74c0 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/index.js @@ -0,0 +1,150 @@ +"use strict"; + +const valueParser = require("postcss-value-parser"); +const { utils } = require("stylelint"); +const declarationValueIndex = require("../../utils/declarationValueIndex"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("dimension-no-non-numeric-values"); + +const messages = utils.ruleMessages(ruleName, { + rejected: unit => + `Expected "$value * 1${unit}" instead of "#{$value}${unit}". Consider writing "value" in terms of ${unit} originally.` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +const units = [ + // Font-relative lengths: + // https://www.w3.org/TR/css-values-4/#font-relative-lengths + "em", + "ex", + "cap", + "ch", + "ic", + "rem", + "lh", + "rlh", + + // Viewport-relative lengths: + // https://www.w3.org/TR/css-values-4/#viewport-relative-lengths + "vw", + "vh", + "vi", + "vb", + "vmin", + "vmax", + + // Absolute lengths: + // https://www.w3.org/TR/css-values-4/#absolute-lengths + "cm", + "mm", + "Q", + "in", + "pc", + "pt", + "px", + + // Angle units: + // https://www.w3.org/TR/css-values-4/#angles + "deg", + "grad", + "rad", + "turn", + + // Duration units: + // https://www.w3.org/TR/css-values-4/#time + "s", + "ms", + + // Frequency units: + // https://www.w3.org/TR/css-values-4/#frequency + "Hz", + "kHz", + + // Resolution units: + // https://www.w3.org/TR/css-values-4/#resolution + "dpi", + "dpcm", + "dppx", + "x", + + // Flexible lengths: + // https://www.w3.org/TR/css-grid-1/#fr-unit + "fr" +]; + +function rule(primary) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: primary + }); + + if (!validOptions) { + return; + } + + root.walkDecls(decl => { + valueParser(decl.value).walk(node => { + // All words are non-quoted, while strings are quoted. + // If quoted, it's probably a deliberate non-numeric dimension. + if (node.type !== "word") { + return; + } + + if (!isInterpolated(node.value)) { + return; + } + + const regex = new RegExp(`#{[$a-z_0-9 +-]*}(${units.join("|")});?`); + const matchUnit = decl.value.match(regex); + + if (!matchUnit) { + return; + } + + const unit = matchUnit[1]; + const offset = decl.value.indexOf(unit); + + utils.report({ + ruleName, + result, + message: messages.rejected(unit), + index: declarationValueIndex(decl) + offset, + node: decl + }); + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +function isInterpolated(value) { + let boolean = false; + + // ValueParser breaks up interpolation with math into multiple, fragmented + // segments (#{$value, +, 2}px). The easiest way to detect this is to look for a fragmented + // interpolated section. + if (value.match(/^#{\$[a-z]*$/)) { + return true; + } + + units.forEach(unit => { + const regex = new RegExp(`^#{[$a-z_0-9 +-]*}${unit};?$`); + + if (value.match(regex)) { + boolean = true; + } + }); + + return boolean; +} + +module.exports = rule; +module.exports.units = units; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/README.md new file mode 100644 index 000000000..c19459763 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/README.md @@ -0,0 +1,85 @@ +# dollar-variable-colon-newline-after + +Require a newline after the colon in `$`-variable declarations. + +```scss +$box-shadow: + 0 0 0 1px #5b9dd9, + 0 0 2px 1px rgba(30, 140, 190, 0.8); + /* ↑ */ +/** ↑ + * The newline after this colon */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +## Options + +`string`: `"always"|"always-multi-line"` + +### `"always"` + +There *must always* be a newline after the colon. + +The following patterns are considered warnings: + +```scss +$var:100px; +``` + +```scss +a { $var:100px; } +``` + +```scss +$var: 100px; +``` + +The following patterns are *not* considered warnings: + +```scss +$var: + 100px; +``` + +```scss +a { + $var: + 100px; +} +``` + +### `"always-multi-line"` + +There *must always* be a newline after the colon *if the variable value is multi-line*. + +The following patterns are considered warnings: + +```scss +$box-shadow: 0 0 0 1px #5b9dd9, + 0 0 2px 1px rgba(30, 140, 190, 0.8); +``` + +The following patterns are *not* considered warnings: + +```scss +$box-shadow: + 0 0 0 1px #5b9dd9, + 0 0 2px 1px rgba(30, 140, 190, 0.8); +``` + +```scss +$box-shadow: + 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); +// The VALUE is single-line, so a newline after the colon is ignored by this rule. +``` + +```scss +$var: 100px; +``` + +## Optional secondary options + +### `disableFix: true` + +Disables autofixing for this rule. diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/index.js new file mode 100644 index 000000000..07007dadf --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/index.js @@ -0,0 +1,123 @@ +"use strict"; + +const { utils } = require("stylelint"); +const declarationValueIndex = require("../../utils/declarationValueIndex"); +const isSingleLineString = require("../../utils/isSingleLineString"); +const whitespaceChecker = require("../../utils/whitespaceChecker"); +const { isBoolean } = require("../../utils/validateTypes"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("dollar-variable-colon-newline-after"); + +const messages = utils.ruleMessages(ruleName, { + expectedAfter: () => 'Expected newline after ":"', + expectedAfterMultiLine: () => + 'Expected newline after ":" with a multi-line value' +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation, options, context) { + const checker = whitespaceChecker("newline", expectation, messages); + + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: expectation, + possible: ["always", "always-multi-line"] + }, + { + actual: options, + possible: { + disableFix: isBoolean + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + const shouldFix = context.fix && (!options || options.disableFix !== true); + + root.walkDecls(decl => { + if (!decl.prop || decl.prop[0] !== "$") { + return; + } + + const value = decl.value.trim(); + const startsWithParen = value[0] === "("; + const endsWithParen = value[value.length - 1] === ")"; + const endsWithDefault = /\)\s*!default$/.test(value); + const isMultilineVarWithParens = + startsWithParen && + (endsWithParen || endsWithDefault) && + !isSingleLineString(value); + + if (isMultilineVarWithParens) { + return; + } + + // Get the raw $var, and only that + const endOfPropIndex = + declarationValueIndex(decl) + decl.raw("between").length - 1; + // `$var:`, `$var :` + const propPlusColon = decl.toString().slice(0, endOfPropIndex); + + for (let i = 0, l = propPlusColon.length; i < l; i++) { + if (propPlusColon[i] !== ":") { + continue; + } + + const indexToCheck = + propPlusColon.substr(propPlusColon[i], 3) === "/*" + ? propPlusColon.indexOf("*/", i) + 1 + : i; + + checker.afterOneOnly({ + source: propPlusColon, + index: indexToCheck, + lineCheckStr: decl.value, + err: m => { + if (shouldFix) { + const nextLinePrefix = + expectation === "always" + ? decl.raws.before.replace(context.newline, "") + : decl.value + .split(context.newline)[1] + .replace(/^(\s+).*$/, (_, whitespace) => whitespace); + + decl.raws.between = decl.raws.between.replace( + /:(.*)$/, + `:${context.newline}${nextLinePrefix}` + ); + + return; + } + + utils.report({ + message: m, + node: decl, + index: indexToCheck, + result, + ruleName + }); + } + }); + break; + } + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/README.md new file mode 100644 index 000000000..bc594c6bf --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/README.md @@ -0,0 +1,139 @@ +# dollar-variable-colon-space-after + +Require or disallow whitespace after the colon in `$`-variable declarations. + +```scss +$variable: 10px; +/** ↑ + * The space after this colon */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +## Options + +`string`: `"always"|"never"|"always-single-line"|"at-least-one-space"` + +### `"always"` + +There *must always* be a single space after the colon. + +The following patterns are considered warnings: + +```scss +a { $var :10px } +``` + +```scss +$var:10px; +``` + +```scss +$var: + 10px; +// a newline is not a space +``` + +The following patterns are *not* considered warnings: + +```scss +a { $var : 10px } +``` + +```scss +$var: 10px; +``` + +### `"never"` + +There *must never* be whitespace after the colon. + +The following patterns are considered warnings: + +```scss +$var: 10px; +``` + +```scss +$var: +10px; +``` + +```scss +a { $var :10px } +``` + +The following patterns are *not* considered warnings: + +```scss +$var :10px; +``` + +```scss +a { $var:10px } +``` + +### `"always-single-line"` + +There *must always* be a single space after the colon *if the variable value is single-line*. + +The following patterns are considered warnings: + +```scss +$box-shadow:0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); +``` + +The following patterns are *not* considered warnings: + +```scss +a { + $box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); +} +``` + +```scss +$box-shadow: + 0 0 0 1px #5b9dd9, + 0 0 2px 1px rgba(30, 140, 190, 0.8); +``` + +```scss +a { + $box-shadow:0 0 0 1px #5b9dd9, + 0 0 2px 1px rgba(30, 140, 190, 0.8); +} +``` + +### `"at-least-one-space"` + +There must always be *at least* a single space after the colon. + +The following patterns are considered warnings: + +```scss +a { $var :10px } +``` + +```scss +$var:10px; +``` + +```scss +$var: + 10px; +// a newline is not a space +``` + +The following patterns are *not* considered warnings: + +```scss +a { $var : 10px } +``` + +```scss +$var: 10px; +``` + +```scss +$var: 10px; +``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/index.js new file mode 100644 index 000000000..707053165 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/index.js @@ -0,0 +1,120 @@ +"use strict"; + +const { utils } = require("stylelint"); +const declarationValueIndex = require("../../utils/declarationValueIndex"); +const isSingleLineString = require("../../utils/isSingleLineString"); +const whitespaceChecker = require("../../utils/whitespaceChecker"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("dollar-variable-colon-space-after"); + +const messages = utils.ruleMessages(ruleName, { + expectedAfter: () => 'Expected single space after ":"', + rejectedAfter: () => 'Unexpected whitespace after ":"', + expectedAfterSingleLine: () => + 'Expected single space after ":" with a single-line value', + expectedAfterAtLeast: () => 'Expected at least one space after ":"' +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation, _, context) { + const checker = whitespaceChecker("space", expectation, messages); + + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation, + possible: ["always", "never", "always-single-line", "at-least-one-space"] + }); + + if (!validOptions) { + return; + } + + variableColonSpaceChecker({ + root, + result, + locationChecker: checker.after, + checkedRuleName: ruleName, + position: "after", + expectation, + context + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +function variableColonSpaceChecker({ + locationChecker, + root, + result, + checkedRuleName, + position, + expectation, + context +}) { + root.walkDecls(decl => { + if (decl.prop === undefined || decl.prop[0] !== "$") { + return; + } + + if (context && context.fix) { + if ( + expectation === "always-single-line" && + !isSingleLineString(decl.value) + ) { + return; + } + + if (position === "before") { + const replacement = expectation === "never" ? ":" : " :"; + + decl.raws.between = decl.raws.between.replace(/\s*:/, replacement); + } else if (position === "after") { + const match = expectation === "at-least-one-space" ? /:(?! )/ : /:\s*/; + const replacement = expectation === "never" ? ":" : ": "; + + decl.raws.between = decl.raws.between.replace(match, replacement); + } + + return; + } + + // Get the raw $var, and only that + const endOfPropIndex = + declarationValueIndex(decl) + decl.raw("between").length - 1; + // `$var:`, `$var :` + const propPlusColon = decl.toString().slice(0, endOfPropIndex); + + for (let i = 0; i < propPlusColon.length; i++) { + if (propPlusColon[i] !== ":") { + continue; + } + + locationChecker({ + source: propPlusColon, + index: i, + lineCheckStr: decl.value, + err: m => { + utils.report({ + message: m, + node: decl, + index: i, + result, + ruleName: checkedRuleName + }); + } + }); + break; + } + }); +} + +module.exports = rule; +module.exports.variableColonSpaceChecker = variableColonSpaceChecker; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md new file mode 100644 index 000000000..1036dae32 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md @@ -0,0 +1,73 @@ +# dollar-variable-colon-space-before + +Require a single space or disallow whitespace before the colon in `$`-variable declarations. + +```scss +$variable: 10px; +/** ↑ + * The space before this colon */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +## Options + +`string`: `"always"|"never" + +### `"always"` + +There *must always* be a single space before the colon. + +The following patterns are considered warnings: + +```scss +a { $var: 10px } +``` + +```scss +$var:10px; +``` + +```scss +$var :10px; +``` + +```scss +$var +:10px; +``` + +The following patterns are *not* considered warnings: + +```scss +a { $var : 10px } +``` + +```scss +$var :10px; +``` + +### `"never"` + +There *must never* be whitespace before the colon. + +The following patterns are considered warnings: + +```scss +$var :10px; +``` + +```scss +a { $var +:10px } +``` + +The following patterns are *not* considered warnings: + +```scss +$var:10px; +``` + +```scss +a { $var: 10px } +``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/index.js new file mode 100644 index 000000000..2f1781390 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/index.js @@ -0,0 +1,51 @@ +"use strict"; + +const { utils } = require("stylelint"); +const { + variableColonSpaceChecker +} = require("../dollar-variable-colon-space-after"); +const whitespaceChecker = require("../../utils/whitespaceChecker"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("dollar-variable-colon-space-before"); + +const messages = utils.ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before ":"', + rejectedBefore: () => 'Unexpected whitespace before ":"' +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation, _, context) { + const checker = whitespaceChecker("space", expectation, messages); + + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation, + possible: ["always", "never"] + }); + + if (!validOptions) { + return; + } + + variableColonSpaceChecker({ + root, + result, + locationChecker: checker.before, + checkedRuleName: ruleName, + position: "before", + expectation, + context + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-default/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-default/README.md new file mode 100644 index 000000000..a75649a49 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-default/README.md @@ -0,0 +1,25 @@ +# dollar-variable-default + +Require `!default` flag for `$`-variable declarations + +```scss +$variable: 10px !default; +/** ↑ + * This is variable with default value */ +``` + +## Optional Options + +### `ignore: "local"` + +Makes this rule ignore local variables (variables defined inside a rule/mixin/function, etc.). + +The following patterns are *not* considered warnings: + +```scss +$var: 10px !default; + +a { + $local-var: 10px; +} +``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-default/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-default/index.js new file mode 100644 index 000000000..fea01d93b --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-default/index.js @@ -0,0 +1,71 @@ +"use strict"; + +const { utils } = require("stylelint"); +const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("dollar-variable-default"); + +const messages = utils.ruleMessages(ruleName, { + expected: variable => `Expected !default flag for "${variable}"` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(primaryOption, secondaryOptions) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: primaryOption + }, + { + actual: secondaryOptions, + possible: { + ignore: ["local"] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + root.walkDecls(decl => { + // not variable + if (decl.prop[0] !== "$") { + return; + } + + // "ignore" options + if ( + optionsHaveIgnored(secondaryOptions, "local") && + decl.parent.type !== "root" + ) { + return; + } + + if (decl.value.toLowerCase().includes("!default")) { + return; + } + + utils.report({ + message: messages.expected(decl.prop), + node: decl, + result, + ruleName + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/README.md new file mode 100644 index 000000000..3ba9cff99 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/README.md @@ -0,0 +1,185 @@ +# dollar-variable-empty-line-after + +Require an empty line or disallow empty lines after `$`-variable declarations. + +If the `$`-variable declaration is the last declaration in a file, it's ignored. + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +There *must always* be one empty line after a `$`-variable declaration. + +The following patterns are considered warnings: + +```scss +$var: 200px; +@import '1.css'; +``` + +```scss +a { + $var: 1; +} +``` + +The following patterns are *not* considered warnings: + +```scss +$var: 100px; // The last declaration in a stylesheet +``` + +```scss +$var: 1; + +a { color: red; } +``` + +### `"never"` + +There *must never* be an empty line after a `$`-variable declaration. + +The following patterns are considered warnings: + +```scss +$var: 1; + +a { color: red; } +``` + +The following patterns are *not* considered warnings: + +```scss +$var: 100px; +$var2: 200px; +``` + +```scss +$var: 1; +a { + width: auto; +} +``` + +## Optional secondary options + +### `except: ["last-nested", "before-comment", "before-dollar-variable"]` + +### `"last-nested"` + +Reverse the primary option for a `$`-variable declaration if it's the last child of its parent. + +For example, with `"always"`: + +The following patterns are considered warnings: + +```scss +a { + $var: 1; + color: red; +} + +b { + $var: 1; + +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { + color: red; + $var: 1; +} + +b { + $var: 1; + + color: red; +} +``` + +### `"before-comment"` + +Reverse the primary option for `$`-variable declarations that go before comments. + +For example, with `"always"`: + +The following patterns are *not* considered warnings: + +```scss +a { + $var: 1; + // comment +} +``` + +### `"before-dollar-variable"` + +Reverse the primary option for `$`-variable declarations that go right after another `$`-variable declaration. + +For example, with `"always"`: + +The following patterns are considered warnings: + +```scss +a { + $var: 1; // this one is ok + $var1: 2; // and this one shouldn't have a preceding empty line + b { + width: 100px; + } +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { + $var: 1; + $var1: 2; + + b { + width: 100%; + } +} +``` + +### `ignore: ["before-comment", "inside-single-line-block"]` + +### `"before-comment"` + +Ignore `$`-variables that go before a comment. + +For example, with `"always"`: + +The following patterns are *not* considered warnings: + +```scss +$var: 1 +// comment + +$var2: 1; +/* comment */ +``` + +### `"inside-single-line-block"` + +Ignore `$`-variables that are inside single-line blocks. + +For example, with `"always"`: + +The following patterns are *not* considered warnings: + +```scss +a { $var: 10; } +``` + +### `disableFix: true` + +Disables autofixing for this rule. diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/index.js new file mode 100644 index 000000000..6244e805a --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/index.js @@ -0,0 +1,251 @@ +"use strict"; + +const { utils } = require("stylelint"); +const blockString = require("../../utils/blockString"); +const hasEmptyLine = require("../../utils/hasEmptyLine"); +const isSingleLineString = require("../../utils/isSingleLineString"); +const namespace = require("../../utils/namespace"); +const optionsHaveException = require("../../utils/optionsHaveException"); +const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); +const ruleUrl = require("../../utils/ruleUrl"); +const { isBoolean } = require("../../utils/validateTypes"); + +const ruleName = namespace("dollar-variable-empty-line-after"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected an empty line after $-variable", + rejected: "Unexpected empty line after $-variable" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation, options, context) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: expectation, + possible: ["always", "never"] + }, + { + actual: options, + possible: { + except: ["last-nested", "before-comment", "before-dollar-variable"], + ignore: ["before-comment", "inside-single-line-block"], + disableFix: isBoolean + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + const fixNext = (decl, match, replace) => { + decl.raws.before = decl.raws.before.replace( + new RegExp(`^${match}`), + replace + ); + }; + + const fixParent = (decl, match, replace) => { + decl.parent.raws.after = decl.parent.raws.after.replace( + new RegExp(`^${match}`), + replace + ); + }; + + const hasNewline = str => str.indexOf(context.newline) > -1; + const isDollarVar = node => node.prop && node.prop[0] === "$"; + + root.walkDecls(decl => { + let expectEmptyLineAfter = expectation === "always"; + const exceptLastNested = optionsHaveException(options, "last-nested"); + const exceptBeforeComment = optionsHaveException( + options, + "before-comment" + ); + const exceptBeforeVariable = optionsHaveException( + options, + "before-dollar-variable" + ); + const ignoreInsideSingleLineBlock = optionsHaveIgnored( + options, + "inside-single-line-block" + ); + const ignoreBeforeComment = optionsHaveIgnored(options, "before-comment"); + + const isSingleLineDeclaration = isSingleLineString( + blockString(decl.parent) + ); + + // Ignore declarations that aren't variables. + // ------------------------------------------ + if (!isDollarVar(decl)) { + return; + } + + // Ignore declaration if it's the last line in a file. + // --------------------------------------------------- + if (decl === root.last) { + return; + } + + // Ignore single line blocks (if chosen as an option). + // --------------------------------------------------- + if ( + ignoreInsideSingleLineBlock && + decl.parent.type !== "root" && + isSingleLineDeclaration + ) { + return; + } + + const next = decl.next(); + + // The declaration is the last in a block. + // --------------------------------------- + if (!next) { + const hasEmptyLineAfter = hasEmptyLine(decl.parent.raws.after); + + if ( + (expectEmptyLineAfter && hasEmptyLineAfter && !exceptLastNested) || + (!expectEmptyLineAfter && !hasEmptyLineAfter && !exceptLastNested) || + (expectEmptyLineAfter && !hasEmptyLineAfter && exceptLastNested) || + (!expectEmptyLineAfter && hasEmptyLineAfter && exceptLastNested) + ) { + return; + } + } + + // The declaration is NOT the last in a block. + // ------------------------------------------- + else { + const hasEmptyLineAfter = hasEmptyLine(next.raws.before); + const nextIsComment = next.type === "comment"; + const nextIsVariable = isDollarVar(next); + + if (nextIsComment) { + if ( + ignoreBeforeComment || + (expectEmptyLineAfter && + hasEmptyLineAfter && + !exceptBeforeComment) || + (!expectEmptyLineAfter && + !hasEmptyLineAfter && + !exceptBeforeComment) || + (expectEmptyLineAfter && + !hasEmptyLineAfter && + exceptBeforeComment) || + (!expectEmptyLineAfter && hasEmptyLineAfter && exceptBeforeComment) + ) { + return; + } + } else if (nextIsVariable) { + if ( + (expectEmptyLineAfter && + hasEmptyLineAfter && + !exceptBeforeVariable) || + (!expectEmptyLineAfter && + !hasEmptyLineAfter && + !exceptBeforeVariable) || + (expectEmptyLineAfter && + !hasEmptyLineAfter && + exceptBeforeVariable) || + (!expectEmptyLineAfter && + hasEmptyLineAfter && + exceptBeforeVariable) || + (expectEmptyLineAfter && hasEmptyLineAfter && exceptBeforeVariable) + ) { + return; + } + } else if (expectEmptyLineAfter === hasEmptyLineAfter) { + return; + } + } + + const isFixDisabled = options && options.disableFix === true; + + if (context.fix && !isFixDisabled) { + if (next) { + const nextBefore = next.raws.before; + const hasEmptyLineAfter = hasEmptyLine(nextBefore); + const nextIsComment = next.type === "comment"; + const nextIsVariable = isDollarVar(next); + + if (expectEmptyLineAfter && !hasEmptyLineAfter) { + fixNext(next, context.newline, context.newline + context.newline); + + if (exceptLastNested && !hasNewline(nextBefore)) { + fixNext(next, "\\s+", context.newline + context.newline); + } + + return; + } else if ( + (expectEmptyLineAfter && + exceptBeforeComment && + nextIsComment && + hasEmptyLineAfter) || + (expectEmptyLineAfter && + exceptBeforeVariable && + nextIsVariable && + hasEmptyLineAfter) || + (!expectEmptyLineAfter && hasEmptyLineAfter) + ) { + fixNext(decl, "\\n\\r\\n", "\r\n"); + fixNext(next, context.newline + context.newline, context.newline); + + return; + } else if ( + (!expectEmptyLineAfter && + exceptBeforeComment && + nextIsComment && + !hasEmptyLineAfter) || + (!expectEmptyLineAfter && + exceptBeforeVariable && + nextIsVariable && + !hasEmptyLineAfter) + ) { + fixNext(next, context.newline, context.newline + context.newline); + + return; + } + } else { + const hasEmptyLineAfter = hasEmptyLine(decl.parent.raws.after); + + expectEmptyLineAfter = exceptLastNested + ? !expectEmptyLineAfter + : expectEmptyLineAfter; + + if (expectEmptyLineAfter && !hasEmptyLineAfter) { + fixParent(decl, context.newline, context.newline + context.newline); + + return; + } else if (!expectEmptyLineAfter && hasEmptyLineAfter) { + fixParent(decl, "\\n\\r\\n", "\r\n"); + fixParent(decl, context.newline + context.newline, context.newline); + + return; + } + } + } + + utils.report({ + message: expectEmptyLineAfter ? messages.expected : messages.rejected, + node: decl, + result, + ruleName + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/README.md new file mode 100644 index 000000000..883257ce5 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/README.md @@ -0,0 +1,229 @@ +# dollar-variable-empty-line-before + +Require an empty line or disallow empty lines before `$`-variable declarations. + +If the `$`-variable declaration is the first declaration in a file, it's ignored. + +```scss + /* ← */ +$width: 10px; ↑ +/** ↑ + * This empty line */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +There _must always_ be one empty line before a `$`-variable declaration. + +The following patterns are considered warnings: + +```scss +@import "1.css"; +$var2: 200px; +``` + +```scss +a { + $var: 1; +} +``` + +The following patterns are _not_ considered warnings: + +```scss +$var: 100px; // The first declaration in a stylesheet +``` + +```scss +a { + color: red; +} + +$var: 1; +``` + +### `"never"` + +There _must never_ be an empty line before a `$`-variable declaration. + +The following patterns are considered warnings: + +```scss +a { + color: red; +} + +$var: 1; +``` + +The following patterns are _not_ considered warnings: + +```scss +$var: 100px; +$var2: 200px; +``` + +```scss +a { + width: auto; +} +$var: 1; +``` + +## Optional secondary options + +### `except: ["first-nested", "after-comment", "after-dollar-variable"]` + +### `"first-nested"` + +Reverse the primary option for a `$`-variable declaration if it's the first child of its parent. + +For example, with `"always"`: + +The following patterns are considered warnings: + +```scss +a { + + $var: 1; + color: red; +} + +b { + color: red; + + $var: 1; +} +``` + +The following patterns are _not_ considered warnings: + +```scss +a { + $var: 1; + color: red; +} + +b { + color: red; + $var: 1; +} +``` + +### `"after-comment"` + +Reverse the primary option for `$`-variable declarations that go after comments. + +For example, with `"always"`: + +The following patterns are considered warnings: + +```scss +a { + // comment + + $var: 1; +} + +b { + /* comment */ + + $var: 1; +} +``` + +The following patterns are _not_ considered warnings: + +```scss +a { + // comment + $var: 1; +} +``` + +### `"after-dollar-variable"` + +Reverse the primary option for `$`-variable declarations that go right after another `$`-variable declaration. + +For example, with `"always"`: + +The following patterns are considered warnings: + +```scss +a { + + $var: 1; // this one is ok + + $var1: 2; // and this one shouldn't have a preceding empty line +} +``` + +The following patterns are _not_ considered warnings: + +```scss +a { + + $var: 1; + $var1: 2; +} +``` + +### `ignore: ["after-comment", "inside-single-line-block", "after-dollar-variable"]` + +### `"after-comment"` + +Ignore `$`-variables that go after a comment. + +For example, with `"always"`: + +The following patterns are _not_ considered warnings: + +```scss +// comment +$var: 1 + +/* comment */ +$var2: 1; +``` + +### `"inside-single-line-block"` + +Ignore `$`-variables that are inside single-line blocks. + +For example, with `"always"`: + +The following patterns are _not_ considered warnings: + +```scss +a { + $var: 10; +} +``` + +### `"after-dollar-variable"` + +For example, with `"always"`: + +The following patterns are considered warnings: + +```scss +width: 1px; +$var2: 2; +``` + +The following patterns are _not_ considered warnings: + +```scss +$var1: 1; +$var2: 2; +``` + +### `disableFix: true` + +Disables autofixing for this rule. diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/index.js new file mode 100644 index 000000000..b983cacc6 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/index.js @@ -0,0 +1,176 @@ +"use strict"; + +const { utils } = require("stylelint"); +const blockString = require("../../utils/blockString"); +const hasEmptyLine = require("../../utils/hasEmptyLine"); +const isSingleLineString = require("../../utils/isSingleLineString"); +const namespace = require("../../utils/namespace"); +const optionsHaveException = require("../../utils/optionsHaveException"); +const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); +const ruleUrl = require("../../utils/ruleUrl"); +const { isBoolean } = require("../../utils/validateTypes"); + +const ruleName = namespace("dollar-variable-empty-line-before"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected an empty line before $-variable", + rejected: "Unexpected empty line before $-variable" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation, options, context) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: expectation, + possible: ["always", "never"] + }, + { + actual: options, + possible: { + except: ["first-nested", "after-comment", "after-dollar-variable"], + ignore: [ + "after-comment", + "inside-single-line-block", + "after-dollar-variable" + ], + disableFix: isBoolean + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + const fix = (decl, match, replace) => { + decl.raws.before = decl.raws.before.replace( + new RegExp(`^${match}`), + replace + ); + }; + + const hasNewline = str => str.includes(context.newline); + + root.walkDecls(decl => { + if (!isDollarVar(decl)) { + return; + } + + // Always ignore the first $var in a stylesheet + if (decl === root.first) { + return; + } + + // If ignoring vars after comments is set + if ( + optionsHaveIgnored(options, "after-comment") && + decl.prev() && + decl.prev().type === "comment" + ) { + return; + } + + // If ignoring single-line blocks + if ( + optionsHaveIgnored(options, "inside-single-line-block") && + decl.parent.type !== "root" && + isSingleLineString(blockString(decl.parent)) + ) { + return; + } + + // if ignoring after another $-variable + if ( + optionsHaveIgnored(options, "after-dollar-variable") && + decl.prev() && + isDollarVar(decl.prev()) + ) { + return; + } + + let expectHasEmptyLineBefore = expectation === "always"; + + // Reverse for a variable that is a first child of its parent + if ( + optionsHaveException(options, "first-nested") && + decl === decl.parent.first + ) { + expectHasEmptyLineBefore = !expectHasEmptyLineBefore; + } + + // Reverse if after a comment + if ( + optionsHaveException(options, "after-comment") && + decl.prev() && + decl.prev().type === "comment" + ) { + expectHasEmptyLineBefore = !expectHasEmptyLineBefore; + } + + // Reverse if after another $-variable + if ( + optionsHaveException(options, "after-dollar-variable") && + decl.prev() && + isDollarVar(decl.prev()) + ) { + expectHasEmptyLineBefore = !expectHasEmptyLineBefore; + } + + const before = decl.raws.before; + + if (expectHasEmptyLineBefore === hasEmptyLine(before)) { + return; + } + + const isFixDisabled = options && options.disableFix === true; + + if (context.fix && !isFixDisabled) { + if (expectHasEmptyLineBefore && !hasEmptyLine(before)) { + fix(decl, context.newline, context.newline + context.newline); + + if ( + optionsHaveException(options, "first-nested") && + !hasNewline(before) + ) { + fix(decl, "\\s+", context.newline + context.newline); + } + + return; + } + + if (!expectHasEmptyLineBefore && hasEmptyLine(before)) { + fix(decl, "\\n\\r\\n", "\r\n"); + fix(decl, context.newline + context.newline, context.newline); + + return; + } + } + + utils.report({ + message: expectHasEmptyLineBefore + ? messages.expected + : messages.rejected, + node: decl, + result, + ruleName + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +function isDollarVar(node) { + return node.prop && node.prop[0] === "$"; +} + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/README.md new file mode 100644 index 000000000..eac3374c2 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/README.md @@ -0,0 +1,202 @@ +# dollar-variable-first-in-block + +Require `$`-variable declarations to be placed first in a block (root or a rule). + +## Options + +### `true` + +The following patterns are considered violations: + +```scss +@import "1.css"; +$var: 200px; +``` + +```scss +a { + width: 100px; + $var: 1; +} +``` + +The following patterns are _not_ considered warnings: + +```scss +$var: 100px; +@import "1.css"; +``` + +```scss +a { + $var: 1; + color: red; +} +``` + +## Optional secondary options + +### `ignore: ["comments", "imports"]` + +### `"comments"` + +The following patterns are _not_ considered violations: + +```scss +// Comment +$var: 1; +``` + +```scss +a { + // Comment + $var: 1; + color: red; +} +``` + +### `"imports"` + +The following patterns are _not_ considered violations: + +```scss +@import "1.css"; +$var: 1; +``` + +```scss +@use "sass:color"; +$primary-color: #f26e21 !default; +$secondary-color: color.change($primary-color, $alpha: 0.08) !default; +``` + +```scss +@forward "src/list"; +$var1: 100px; +``` + +### `except: ["root", "at-rule", "function", "mixin", "if-else", "loops"]` + +### `"root"` + +The following patterns are _not_ considered warnings: + +```scss +// Imports +@import "1.css"; + +// Variables +$var: 1; +``` + +```scss +/* Imports */ +@import "1.css"; +// Variables +$var1: 1; +$var2: 1; + +a { + width: 100px; +} +``` + +### `"at-rule"` + +The following patterns are _not_ considered warnings: + +```scss +@at-root .class { + width: 100px; + $var: 1; +} +``` + +### `"function"` + +The following patterns are _not_ considered warnings: + +```scss +@function function-name($numbers1, $numbers2) { + $var1: 1; + + @each $number in $numbers1 { + $var1: $var1 + $number; + } + + $var: 2; + + @each $number in $numbers2 { + $var2: $var2 + $number; + } + + @return $var1 + $var2; +} +``` + +### `"mixin"` + +The following patterns are _not_ considered warnings: + +```scss +@mixin mixin-name { + width: 100px; + $var: 1000px; + height: $var1; +} +``` + +### `"if-else"` + +The following patterns are _not_ considered warnings: + +```scss +@if $direction == up { + width: 100px; + $var: 1000px; +} +``` + +```scss +@if $direction == up { + width: 100px; +} @else { + height: 100px; + $var: 1000px; +} +``` + +```scss +@if $direction == up { + width: 100px; + $var1: 1000px; +} @else { + height: 100px; + $var2: 1000px; +} +``` + +### `"loops"` + +The following patterns are _not_ considered warnings: + +```scss +@each $size in $sizes { + width: 100px; + $var: 1000px; +} +``` + +```scss +@for $i from 1 through 3 { + width: 100px; + $var: 1000px; +} +``` + +```scss +@while $value > $base { + width: 100px; + $var: 1000px; +} +``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/index.js new file mode 100644 index 000000000..ee13e385b --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/index.js @@ -0,0 +1,125 @@ +"use strict"; + +const { utils } = require("stylelint"); +const optionsHaveException = require("../../utils/optionsHaveException"); +const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("dollar-variable-first-in-block"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected $-variable to be first in block" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(primary, options) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: primary + }, + { + actual: options, + possible: { + ignore: ["comments", "imports"], + except: ["root", "at-rule", "function", "mixin", "if-else", "loops"] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + const isDollarVar = node => node.prop && node.prop[0] === "$"; + + root.walkDecls(decl => { + // Ignore declarations that aren't variables. + // ------------------------------------------ + if (!isDollarVar(decl)) { + return; + } + + // If selected, ignore declarations in root. + // ----------------------------------------- + if (optionsHaveException(options, "root") && decl.parent === root) { + return; + } + + // If selected, ignore declarations in different types of at-rules. + // ---------------------------------------------------------------- + if (decl.parent.type === "atrule") { + if ( + optionsHaveException(options, "at-rule") || + (optionsHaveException(options, "function") && + decl.parent.name === "function") || + (optionsHaveException(options, "mixin") && + decl.parent.name === "mixin") || + (optionsHaveException(options, "if-else") && + (decl.parent.name === "if" || decl.parent.name === "else")) || + (optionsHaveException(options, "loops") && + (decl.parent.name === "each" || + decl.parent.name === "for" || + decl.parent.name === "while")) + ) { + return; + } + } + + const previous = decl.prev(); + + // If first or preceded by another variable. + // ----------------------------------------- + if (!previous || isDollarVar(previous)) { + return; + } + + // Check if preceded only by allowed types. + // ---------------------------------------- + let precededOnlyByAllowed = true; + const allowComments = optionsHaveIgnored(options, "comments"); + const allowImports = optionsHaveIgnored(options, "imports"); + const importAtRules = ["import", "use", "forward"]; + + for (const sibling of decl.parent.nodes) { + if (sibling === decl) { + break; + } else if ( + !isDollarVar(sibling) && + !( + (allowComments && sibling.type === "comment") || + (allowImports && + sibling.type === "atrule" && + importAtRules.includes(sibling.name)) + ) + ) { + precededOnlyByAllowed = false; + } + } + + if (precededOnlyByAllowed) { + return; + } + + utils.report({ + message: messages.expected, + node: decl, + result, + ruleName + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/README.md new file mode 100644 index 000000000..61dfbd0a6 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/README.md @@ -0,0 +1,111 @@ +# dollar-variable-no-missing-interpolation + +Disallow Sass variables that are used without interpolation with CSS features that use custom identifiers. + +```scss +.class { + $var: "my-anim"; + animation-name: $var; +// ↑ +// This variable needs to be interpolated +// because its value is a string +} +``` + +Sass variables that contain a custom identifier as a string always require interpolation when used. Some CSS [at-rules](https://css-tricks.com/the-at-rules-of-css/) require variable interpolation even when the custom identifier value is not a string. + +For example, your CSS animation could look like this: + +```scss +animation: myAnim 5s; +``` + +When you store your custom identifier as string in a Sass variable... + +```scss +$myVar: "myAnim"; +``` + +...then you need to make sure that the variable is interpolated when it gets used: + +```scss +animation: #{$myVar} 5s; +``` + +If you do not interpolate the variable, Sass will compile your animation name to a string, producing invalid CSS: + +```scss +animation: "myAnim" 5s; +``` + +This rule can only check for variables that are defined inside the same file where they are used. + +The following patterns are considered warnings: + +```scss +$var: my-anim; + +@keyframes $var {} +``` + +```scss +$var: "circled-digits"; + +@counter-style $var { + system: fixed; + symbols: ➀ ➁ ➂; + suffix: ' '; + speak-as: numbers; +} +``` + +```scss +$var: "my-counter"; + +body { + counter-reset: $var; +} +``` + +```scss +$var: "my-anim"; + +@supports (animation-name: $var) { + @keyframes {} +} +``` + +The following patterns are *not* considered warnings: + +```scss +$var: my-anim; + +@keyframes #{$var} {} +``` + +```scss +$var: circled-digits; + +@counter-style #{$var} { + system: fixed; + symbols: ➀ ➁ ➂; + suffix: ' '; + speak-as: numbers; +} +``` + +```scss +$var: my-counter; + +body { + counter-reset: $var; +} +``` + +```scss +$var: my-anim; + +@supports (animation-name: $var) { + @keyframes {} +} +``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/index.js new file mode 100644 index 000000000..d64bc8fca --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/index.js @@ -0,0 +1,148 @@ +"use strict"; + +const valueParser = require("postcss-value-parser"); +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("dollar-variable-no-missing-interpolation"); + +const messages = utils.ruleMessages(ruleName, { + rejected: (n, v) => + `Expected variable ${v} to be interpolated when using it with ${n}` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +// https://developer.mozilla.org/en/docs/Web/CSS/custom-ident#Lists_of_excluded_values +const customIdentProps = [ + "animation", + "animation-name", + "counter-reset", + "counter-increment", + "list-style-type", + "will-change" +]; + +// https://developer.mozilla.org/en/docs/Web/CSS/At-rule +const customIdentAtRules = ["counter-style", "keyframes", "supports"]; + +function isAtRule(type) { + return type === "atrule"; +} + +function isCustomIdentAtRule(node) { + return isAtRule(node.type) && customIdentAtRules.includes(node.name); +} + +function isCustomIdentProp(node) { + return customIdentProps.includes(node.prop); +} + +function isAtSupports(node) { + return isAtRule(node.type) && node.name === "supports"; +} + +function isSassVar(value) { + return value[0] === "$"; +} + +function isStringVal(value) { + return /^(["']).*(["'])$/.test(value); +} + +function toRegex(arr) { + return new RegExp(`(${arr.join("|")})`); +} + +function rule(actual) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { actual }); + + if (!validOptions) { + return; + } + + const stringVars = []; + const vars = []; + + function findVars(node) { + node.walkDecls(decl => { + const { prop, value } = decl; + + if (!isSassVar(prop) || vars.includes(prop)) { + return; + } + + if (isStringVal(value)) { + stringVars.push(prop); + } + + vars.push(prop); + }); + } + + findVars(root); + root.walkRules(findVars); + + if (!vars.length) { + return; + } + + function shouldReport(node, value) { + if (isAtSupports(node) || isCustomIdentProp(node)) { + return stringVars.includes(value); + } + + if (isCustomIdentAtRule(node)) { + return vars.includes(value); + } + + return false; + } + + function report(node, value) { + const { name, prop, type } = node; + const nodeName = isAtRule(type) ? `@${name}` : prop; + + utils.report({ + ruleName, + result, + node, + message: messages.rejected(nodeName, value) + }); + } + + function exitEarly(node) { + return node.type !== "word" || !node.value; + } + + function walkValues(node, value) { + valueParser(value).walk(valNode => { + const { value } = valNode; + + if (exitEarly(valNode) || !shouldReport(node, value)) { + return; + } + + report(node, value); + }); + } + + root.walkDecls(toRegex(customIdentProps), decl => { + walkValues(decl, decl.value); + }); + + root.walkAtRules(toRegex(customIdentAtRules), atRule => { + walkValues(atRule, atRule.params); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/README.md new file mode 100644 index 000000000..850094fc8 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/README.md @@ -0,0 +1,24 @@ +# dollar-variable-no-namespaced-assignment + +Disallow assignment to namespaced variables. + +```scss +a { imported.$foo: 1px; } +/** ↑ + * This assignment */ +``` + +## Examples + +The following patterns are considered warnings: + +```scss +imported.$foo: 1; +``` + +The following patterns are *not* considered warnings: + +```scss +a { b: imported.$foo-bar; } +a { $foo: 0; } +``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/index.js new file mode 100644 index 000000000..f3f967a38 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/index.js @@ -0,0 +1,44 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("dollar-variable-no-namespaced-assignment"); + +const messages = utils.ruleMessages(ruleName, { + rejected: "Unexpected assignment to a namespaced $ variable" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(actual) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { actual }); + + if (!validOptions) { + return; + } + + root.walkDecls(decl => { + if (!/^[^$.]+\.\$./.test(decl.prop)) { + return; + } + + utils.report({ + message: messages.rejected, + node: decl, + result, + ruleName + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-pattern/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-pattern/README.md new file mode 100644 index 000000000..de911c1c0 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-pattern/README.md @@ -0,0 +1,73 @@ +# dollar-variable-pattern + +Specify a pattern for Sass-like variables. + +```scss +a { $foo: 1px; } +/** ↑ + * The pattern of this */ +``` + +## Options + +`regex` or `string` + +A string will be translated into a RegExp like so `new RegExp(yourString)` — so be sure to escape properly. + +### Examples + + +The following patterns are considered warnings: + +```scss +/* stylelint scss/dollar-variable-pattern: /foo-.+/ */ +a { $boo-bar: 0; } +a { $fooBar: 0; } + +/* stylelint scss/dollar-variable-pattern: /[a-z][a-zA-Z]+/ */ +a { $foo-bar: 0; } +a { $FooBar: 0; } +a { $fooBar-baz: 0; } +``` + +The following patterns are *not* considered warnings: + +```scss +/* stylelint scss/dollar-variable-pattern: /foo-.+/ */ +a { $foo-bar: 0; } +a { $foo-bar-baz: 0; } +a { $foo-barBaz: 0; } +a { $boo-foo-bar: 0; } + +/* stylelint scss/dollar-variable-pattern: /[a-z][a-zA-Z]+/ */ +a { $fooBar: 0; } +a { $fooBarBaz: 0; } +``` + +## Optional Options + +### `ignore: "local"|"global"` + +#### `"local"` + +Makes this rule ignore local variables (variables defined inside a rule/mixin/function, etc.). + +The following patterns are *not* considered warnings: + +```scss +/* stylelint scss/dollar-variable-pattern: [/^foo-/, {"ignore": "local"}] */ +$foo-name00: 10px; +a { $bar-name01: 10px; } +``` + +#### `"global"` + +Makes this rule ignore global variables (variables defined in the stylesheet root). + +The following patterns are *not* considered warnings: + +```scss +/* stylelint scss/dollar-variable-pattern: [/^foo-/, {"ignore": "global"}] */ +$bar-name01: 10px; +a { $foo-name02: 10px; } +``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-pattern/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-pattern/index.js new file mode 100644 index 000000000..81b44489f --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/dollar-variable-pattern/index.js @@ -0,0 +1,77 @@ +"use strict"; + +const { utils } = require("stylelint"); +const { isRegExp, isString } = require("../../utils/validateTypes"); +const namespace = require("../../utils/namespace"); +const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("dollar-variable-pattern"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected $ variable name to match specified pattern" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(pattern, options) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: pattern, + possible: [isRegExp, isString] + }, + { + actual: options, + possible: { + ignore: ["local", "global"] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + const regexpPattern = isString(pattern) ? new RegExp(pattern) : pattern; + + root.walkDecls(decl => { + const { prop } = decl; + + if (prop[0] !== "$") { + return; + } + + // If local or global variables need to be ignored + if ( + (optionsHaveIgnored(options, "global") && + decl.parent.type === "root") || + (optionsHaveIgnored(options, "local") && decl.parent.type !== "root") + ) { + return; + } + + if (regexpPattern.test(prop.slice(1))) { + return; + } + + utils.report({ + message: messages.expected, + node: decl, + result, + ruleName + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/README.md b/node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/README.md new file mode 100644 index 000000000..52bda18d1 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/README.md @@ -0,0 +1,203 @@ +# double-slash-comment-empty-line-before + +Require or disallow an empty line before `//`-comments. + +```scss +a {} + /* ← */ +// comment /* ↑ */ +/** ↑ +* This line */ +``` + +The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. + +This rule only works with SCSS-like [single-line comments](https://sass-lang.com/documentation/syntax/comments) and ignores: +* comments that are the very first nodes in a file; +* CSS comments (`/* */`); +* comments that are on the same line as some non-comment code (inline comments). + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +There *must always* be an empty line before `//`-comments. + +The following patterns are considered warnings: + +```scss +a {} +// comment +``` + +The following patterns are *not* considered warnings: + +```scss +a {} + +// comment +``` + +```scss +a {} // comment +``` + +### `"never"` + +There *must never* be an empty line before `//`-comments. + +The following patterns are considered warnings: + +```scss +a {} + +// comment +``` + +The following patterns are *not* considered warnings: + +```scss +a {} +// comment +``` + +```scss +a {} // comment +``` + +## Optional options + +### `except: ["first-nested", "inside-block"]` + +#### `"first-nested"` + +Reverse the primary option for `//`-comments that are nested and the first child of their parent node. + +For example, with `"always"`: + +The following patterns are considered warnings: + +```scss +a { + + // comment + color: pink; +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { + // comment + color: pink; +} +``` + +#### `"inside-block"` + +Reverse the primary option for `//`-comments that are inside a block. + +For example, with `"always"`: + +The following patterns are considered warnings: + +```scss +a { + background: pink; + + // comment + color: pink; +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { + background: pink; + // comment + color: pink; +} +``` + +### `ignore: ["between-comments", "stylelint-commands", "inside-block"]` + +#### `"between-comments"` + +Don't require an empty line before `//`-comments that are placed after other `//`-comments or CSS comments. + +For example, with `"always"`: + +The following patterns are *not* considered warnings: + +```scss +a { + background: pink; + + // comment + // comment + color: #eee; +} +``` + +```scss +a { + background: pink; + + /* comment */ + // comment + color: #eee; +} +``` + +#### `"stylelint-commands"` + +Ignore `//`-comments that deliver commands to stylelint, e.g. `// stylelint-disable color-no-hex`. + +For example, with `"always"`: + +The following patterns are considered warnings: + +```scss +a { + background: pink; + // not a stylelint command + color: #eee; +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { + background: pink; + // stylelint-disable color-no-hex + color: pink; +} +``` + +#### `"inside-block"` + +Ignore `//`-comments that are inside a block. + +For example, the following patterns are *not* considered warnings: + +```scss +a { + background: pink; + // comment + color: pink; +} +``` + +```scss +a { + background: pink; + + // comment + color: pink; +} +``` diff --git a/node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/index.js b/node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/index.js new file mode 100644 index 000000000..9a3bd20bd --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/index.js @@ -0,0 +1,151 @@ +"use strict"; + +const { utils } = require("stylelint"); +const addEmptyLineBefore = require("../../utils/addEmptyLineBefore"); +const isInlineComment = require("../../utils/isInlineComment"); +const namespace = require("../../utils/namespace"); +const optionsHaveException = require("../../utils/optionsHaveException"); +const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); +const removeEmptyLinesBefore = require("../../utils/removeEmptyLinesBefore"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("double-slash-comment-empty-line-before"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected empty line before comment", + rejected: "Unexpected empty line before comment" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +const stylelintCommandPrefix = "stylelint-"; + +function rule(expectation, options, context) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: expectation, + possible: ["always", "never"] + }, + { + actual: options, + possible: { + except: ["first-nested", "inside-block"], + ignore: ["stylelint-commands", "between-comments", "inside-block"] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + root.walkComments(comment => { + // Only process // comments + if (!comment.raws.inline && !comment.inline) { + return; + } + + if (isInlineComment(comment)) { + return; + } + + // Ignore the first node + if (comment === root.first) { + return; + } + + // Optionally ignore stylelint commands + if ( + comment.text.indexOf(stylelintCommandPrefix) === 0 && + optionsHaveIgnored(options, "stylelint-commands") + ) { + return; + } + + // Optionally ignore comments inside blocks + if ( + comment.parent !== root && + optionsHaveIgnored(options, "inside-block") + ) { + return; + } + + // Optionally ignore newlines between comments + const prev = comment.prev(); + + if ( + prev && + prev.type === "comment" && + optionsHaveIgnored(options, "between-comments") + ) { + return; + } + + const before = comment.raw("before"); + + const expectEmptyLineBefore = (() => { + if ( + optionsHaveException(options, "first-nested") && + comment.parent !== root && + comment === comment.parent.first + ) { + return false; + } + + // Reverse expectation for comments inside blocks + if ( + comment.parent !== root && + optionsHaveException(options, "inside-block") + ) { + return expectation === "never"; + } + + return expectation === "always"; + })(); + + const hasEmptyLineBefore = before.search(/\n\s*?\n/) !== -1; + + // Return if the expectation is met + if (expectEmptyLineBefore === hasEmptyLineBefore) { + return; + } + + if (context.fix) { + if (expectEmptyLineBefore && !hasEmptyLineBefore) { + addEmptyLineBefore(comment, context.newline); + + return; + } + + if (!expectEmptyLineBefore && hasEmptyLineBefore) { + removeEmptyLinesBefore(comment, context.newline); + + return; + } + } + + const message = expectEmptyLineBefore + ? messages.expected + : messages.rejected; + + utils.report({ + message, + node: comment, + result, + ruleName + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/double-slash-comment-inline/README.md b/node_modules/stylelint-scss/src/rules/double-slash-comment-inline/README.md new file mode 100644 index 000000000..c4ddef648 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/double-slash-comment-inline/README.md @@ -0,0 +1,110 @@ +# double-slash-comment-inline + +Require or disallow `//`-comments to be inline comments. + +```scss +a { + width: 10px; // inline-comment +/* ↑ + * Such comments */ +``` + +An inline comment in terms of this rule is a comment that is placed on the same line with any other code, either before or after it. + +This rule only works with SCSS-like [single-line comments](https://sass-lang.com/documentation/syntax/comments) and ignores CSS comments (`/* */`). + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +`//`-comments *must always* be inline comments. + +The following patterns are considered warnings: + +```scss +// comment +a { width: 10px; } +``` + +```scss +a { + // comment + width: 10px; +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { // comment + width: 10px; +} +``` + +```scss +a { + width: 10px; // comment +} +``` + +```scss +a, // comment +b { + width: 10px; +} +``` + +### `"never"` + +`//`-comments *must never* be inline comments. + +The following patterns are considered warnings: + +```scss +a { + width: 10px; // comment +} +``` + +```scss +a, // comment +b { + width: 10px; +} +``` + +The following patterns are *not* considered warnings: + +```scss +// comment +a { width: 10px; } +``` + +```scss +a { + // comment + width: 10px; +} +``` + +## Optional options + +### `ignore: ["stylelint-commands"]` + +#### `"stylelint-commands"` + +Ignore `//`-comments that deliver commands to stylelint, e.g. `// stylelint-disable color-no-hex`. + +For example, with `"always"`: + +The following patterns are *not* considered warnings: + +```scss +a { + background: pink; + // stylelint-disable color-no-hex + color: pink; +} +``` diff --git a/node_modules/stylelint-scss/src/rules/double-slash-comment-inline/index.js b/node_modules/stylelint-scss/src/rules/double-slash-comment-inline/index.js new file mode 100644 index 000000000..75f4483e6 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/double-slash-comment-inline/index.js @@ -0,0 +1,97 @@ +"use strict"; + +const { utils } = require("stylelint"); +const eachRoot = require("../../utils/eachRoot"); +const findCommentsInRaws = require("../../utils/findCommentsInRaws"); +const namespace = require("../../utils/namespace"); +const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("double-slash-comment-inline"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected //-comment to be inline comment", + rejected: "Unexpected inline //-comment" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +const stylelintCommandPrefix = "stylelint-"; + +function rule(expectation, options) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: expectation, + possible: ["always", "never"] + }, + { + actual: options, + possible: { + ignore: ["stylelint-commands"] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + eachRoot(root, checkRoot); + + function checkRoot(root) { + const rootString = root.source.input.css; + + if (rootString.trim() === "") { + return; + } + + const comments = findCommentsInRaws(rootString); + + comments.forEach(comment => { + // Only process // comments + if (comment.type !== "double-slash") { + return; + } + + // Optionally ignore stylelint commands + if ( + comment.text.indexOf(stylelintCommandPrefix) === 0 && + optionsHaveIgnored(options, "stylelint-commands") + ) { + return; + } + + const isInline = comment.inlineAfter || comment.inlineBefore; + let message; + + if (isInline && expectation === "never") { + message = messages.rejected; + } else if (!isInline && expectation === "always") { + message = messages.expected; + } else { + return; + } + + utils.report({ + message, + node: root, + index: comment.source.start, + result, + ruleName + }); + }); + } + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/README.md b/node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/README.md new file mode 100644 index 000000000..aa99fd778 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/README.md @@ -0,0 +1,60 @@ +# double-slash-comment-whitespace-inside + +Require or disallow whitespace after the `//` in `//`-comments + +```scss +a { + width: 10px; // inline-comment +/* ↑ + * Such whitespace */ +``` + +This rule only works with SCSS-like [single-line comments](https://sass-lang.com/documentation/syntax/comments) and ignores CSS comments (`/* */`). + +Any number of slashes are allowed at the beginning of the comment. So `/// comment` is treated the same way as `// comment`. + +Note that a newline is not possible as a whitespace in terms of this rule as `//`-comments are intended to be single-line. + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +There *must always* be whitespace after the `//` inside `//`-comments. + +The following patterns are considered warnings: + +```scss +//comment +``` + +The following patterns are *not* considered warnings: + +```scss +// comment +``` + +```scss +/// comment +``` + +### `"never"` + +There *must never* be whitespace after the `//` inside `//`-comments. + +The following patterns are considered warnings: + +```scss +// comment +``` + +The following patterns are *not* considered warnings: + +```scss +//comment +``` + +```scss +///comment +``` diff --git a/node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/index.js b/node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/index.js new file mode 100644 index 000000000..213845eff --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/index.js @@ -0,0 +1,80 @@ +"use strict"; + +const { utils } = require("stylelint"); +const eachRoot = require("../../utils/eachRoot"); +const findCommentsInRaws = require("../../utils/findCommentsInRaws"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("double-slash-comment-whitespace-inside"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected a space after //", + rejected: "Unexpected space after //" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation, + possible: ["always", "never"] + }); + + if (!validOptions) { + return; + } + + eachRoot(root, checkRoot); + + function checkRoot(root) { + const rootString = root.source.input.css; + + if (rootString.trim() === "") { + return; + } + + const comments = findCommentsInRaws(rootString); + + comments.forEach(comment => { + // Only process // comments + if (comment.type !== "double-slash") { + return; + } + + // if it's `//` - no warning whatsoever; if `// ` - then trailing + // whitespace rule will govern this + if (comment.text === "") { + return; + } + + let message; + + if (expectation === "never" && comment.raws.left !== "") { + message = messages.rejected; + } else if (comment.raws.left === "" && expectation === "always") { + message = messages.expected; + } else { + return; + } + + utils.report({ + message, + node: root, + index: comment.source.start + comment.raws.startToken.length, + result, + ruleName + }); + }); + } + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/function-color-relative/README.md b/node_modules/stylelint-scss/src/rules/function-color-relative/README.md new file mode 100644 index 000000000..36d4a7629 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/function-color-relative/README.md @@ -0,0 +1,83 @@ +# function-color-relative + +Encourage the use of the [scale-color](https://sass-lang.com/documentation/modules/color#scale-color) over: + +* [darken](https://sass-lang.com/documentation/modules/color#darken) +* [desaturate](https://sass-lang.com/documentation/modules/color#desaturate) +* [fade-in](https://sass-lang.com/documentation/modules/color#fade-in) +* [fade-out](https://sass-lang.com/documentation/modules/color#fade-out) +* [lighten](https://sass-lang.com/documentation/modules/color#lighten) +* [opacify](https://sass-lang.com/documentation/modules/color#opacify) +* [saturate](https://sass-lang.com/documentation/modules/color#saturate) +* [transparentize](https://sass-lang.com/documentation/modules/color#transparentize) + +```scss +p { + color: saturate(blue, 20%); + /** ↑ ↑ + * This function should be scale-color + */ +} +``` + +## Options + +### `true` + +The following patterns are considered violations: + +```scss +p { + color: saturate(blue, 20%); +} +``` + +```scss +p { + color: desaturate(blue, 20%); +} +``` + +```scss +p { + color: darken(blue, .2); +} +``` + +```scss +p { + color: lighten(blue, .2); +} +``` + +```scss +p { + color: opacify(blue, .2); +} +``` + +```scss +p { + color: fade-in(blue, .2); +} +``` + +```scss +p { + color: transparentize(blue, .2); +} +``` + +```scss +p { + color: fade-out(blue, .2); +} +``` + +The following patterns are _not_ considered violations: + +```scss + p { + color: scale-color(blue, $alpha: -40%); + } +``` diff --git a/node_modules/stylelint-scss/src/rules/function-color-relative/index.js b/node_modules/stylelint-scss/src/rules/function-color-relative/index.js new file mode 100644 index 000000000..86c4718c6 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/function-color-relative/index.js @@ -0,0 +1,82 @@ +"use strict"; + +const valueParser = require("postcss-value-parser"); +const { utils } = require("stylelint"); +const declarationValueIndex = require("../../utils/declarationValueIndex"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("function-color-relative"); + +const messages = utils.ruleMessages(ruleName, { + rejected: "Expected the scale-color function to be used" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +const function_names = [ + "saturate", + "desaturate", + "darken", + "lighten", + "opacify", + "fade-in", + "transparentize", + "fade-out" +]; + +function isColorFunction(node) { + return node.type === "function" && function_names.includes(node.value); +} + +function rule(primary) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: primary + }); + + if (!validOptions) { + return; + } + + root.walkDecls(decl => { + valueParser(decl.value).walk(node => { + // Verify that we're only looking at functions. + if (node.type !== "function" || node.value === "") { + return; + } + + const isFilter = decl.prop === "filter"; + const isSassColorFunction = !isFilter && isColorFunction(node); + const isDSFilterColorFunction = + isFilter && + node.value === "drop-shadow" && + node.nodes.some(isColorFunction); + + if (isSassColorFunction || isDSFilterColorFunction) { + const nodes = isDSFilterColorFunction + ? node.nodes.filter(isColorFunction) + : [node]; + + nodes.forEach(node => { + utils.report({ + message: messages.rejected, + node: decl, + index: declarationValueIndex(decl) + node.sourceIndex, + result, + ruleName + }); + }); + } + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/function-no-unknown/README.md b/node_modules/stylelint-scss/src/rules/function-no-unknown/README.md new file mode 100644 index 000000000..2d8a3cb8b --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/function-no-unknown/README.md @@ -0,0 +1,64 @@ +# function-no-unknown + +Disallow unknown functions. Should be used **instead of** Stylelint's [function-no-unknown](https://stylelint.io/user-guide/rules/list/at-rule-no-unknown). + +```css +a { color: unknown(1); } +/** ↑ + * Functions like this */ +``` + +This rule is basically a wrapper around the mentioned core rule. You must disable Stylelint's core rule to make this rule work: + +```json +{ + "rules": { + "function-no-unknown": null, + "scss/function-no-unknown": true + } +} +``` + +## Options + +### `true` + +The following patterns are considered warnings: + +```css +a { color: unknown(1); } +``` + +The following patterns are *not* considered warnings: + +```css +a { color: hsl(240 100% 50%); } +``` + +```css +a { color: if(true, green, red); } +``` + +## Optional secondary options + +### `ignoreFunctions: ["/regex/", /regex/, "non-regex"]` + +Given: + +```json +["/^my-/i", "foo"] +``` + +The following patterns are *not* considered warnings: + +```css +a { color: my-func(1); } +``` + +```css +a { color: MY-FUNC(1); } +``` + +```css +a { color: foo(1); } +``` diff --git a/node_modules/stylelint-scss/src/rules/function-no-unknown/index.js b/node_modules/stylelint-scss/src/rules/function-no-unknown/index.js new file mode 100644 index 000000000..97a17dfb1 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/function-no-unknown/index.js @@ -0,0 +1,133 @@ +"use strict"; + +const valueParser = require("postcss-value-parser"); +const { rules, utils } = require("stylelint"); +const { ALL_FUNCTIONS } = require("../../utils/functions"); +const namespace = require("../../utils/namespace"); +const { isRegExp, isString } = require("../../utils/validateTypes"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleToCheckAgainst = "function-no-unknown"; + +const ruleName = namespace(ruleToCheckAgainst); + +const messages = utils.ruleMessages(ruleName, { + rejected: (...args) => { + return rules[ruleToCheckAgainst].messages + .rejected(...args) + .replace(` (${ruleToCheckAgainst})`, ""); + } +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function isNamespacedFunction(fn) { + const namespacedFunc = /^\w+\.\w+$/; + return namespacedFunc.test(fn); +} + +function isAtUseAsSyntax(nodes) { + const [first, second, third] = nodes.slice(-3); + return ( + first.type === "word" && + first.value === "as" && + second.type === "space" && + third.type === "word" + ); +} + +function getAtUseNamespace(nodes) { + if (isAtUseAsSyntax(nodes)) { + const [last] = nodes.slice(-1); + return last.value; + } + const [first] = nodes; + const parts = first.value.split("/"); + const [last] = parts.slice(-1); + return last; +} + +function rule(primaryOption, secondaryOptions) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: primaryOption + }, + { + actual: secondaryOptions, + possible: { + ignoreFunctions: [isString, isRegExp] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + const optionsFunctions = + (secondaryOptions && secondaryOptions.ignoreFunctions) || []; + const ignoreFunctions = ALL_FUNCTIONS.concat(optionsFunctions); + const ignoreFunctionsAsSet = new Set(ignoreFunctions); + const newSecondaryOptions = Object.assign({}, secondaryOptions, { + ignoreFunctions + }); + + utils.checkAgainstRule( + { + ruleName: ruleToCheckAgainst, + ruleSettings: [primaryOption, newSecondaryOptions], + root + }, + warning => { + const { node, index } = warning; + + // NOTE: Using `valueParser` is necessary for extracting a function name. This may be a performance waste. + valueParser(node.value).walk(valueNode => { + const { type, value: funcName } = valueNode; + + if (type !== "function" || funcName.trim() === "") { + return; + } + + if (isNamespacedFunction(funcName)) { + const atUseNamespaces = []; + + root.walkAtRules(/^use$/i, atRule => { + const { nodes } = valueParser(atRule.params); + atUseNamespaces.push(getAtUseNamespace(nodes)); + }); + + if (atUseNamespaces.length) { + const [namespace] = funcName.split("."); + if (atUseNamespaces.includes(namespace)) { + return; + } + } + } + + if (!ignoreFunctionsAsSet.has(funcName)) { + utils.report({ + message: messages.rejected(funcName), + ruleName, + result, + node, + index + }); + } + }); + } + ); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/README.md b/node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/README.md new file mode 100644 index 000000000..b26b03d72 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/README.md @@ -0,0 +1,46 @@ +# function-quote-no-quoted-strings-inside + +Disallow quoted strings inside the [quote function](https://sass-lang.com/documentation/modules/string#quote) + +```scss +p { + font-family: quote("Helvetica"); + /** ↑ ↑ + * These quotes are unnecessary + */ +} +``` + +## Options + +### `true` + +The following patterns are considered violations: + +```scss +a { + font-family: quote("Helvetica"); +} +``` + +```scss +$font: "Helvetica"; +p { + font-family: quote($font); +} +``` + +The following patterns are _not_ considered violations: + +```scss +a { + color: quote(blue); +} +``` + +```scss +$font: Helvetica; +p { + font-family: quote($font); +} +``` diff --git a/node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/index.js b/node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/index.js new file mode 100644 index 000000000..b0c91a895 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/index.js @@ -0,0 +1,84 @@ +"use strict"; + +const valueParser = require("postcss-value-parser"); +const { utils } = require("stylelint"); +const declarationValueIndex = require("../../utils/declarationValueIndex"); +const isNativeCssFunction = require("../../utils/isNativeCssFunction"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("function-quote-no-quoted-strings-inside"); + +const messages = utils.ruleMessages(ruleName, { + rejected: "Quote function used with an already-quoted string" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(primary, _, context) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: primary + }); + + if (!validOptions) { + return; + } + + // Setup variable naming. + const vars = {}; + + root.walkDecls(decl => { + if (decl.prop[0] !== "$") { + return; + } + + valueParser(decl.value).walk(node => { + vars[decl.prop] = node.type; + }); + }); + + root.walkDecls(decl => { + valueParser(decl.value).walk(node => { + // Verify that we're only looking at functions. + if ( + node.type !== "function" || + isNativeCssFunction(node.value) || + node.value === "" + ) { + return; + } + + // Verify we're only looking at quote() calls. + if (node.value !== "quote") { + return; + } + + // Report error if first character is a quote. + // postcss-value-parser represents quoted strings as type 'string' (as opposed to word) + if (node.nodes[0].quote || vars[node.nodes[0].value] === "string") { + if (context.fix) { + const contents = decl.value.match(/quote\((.*)\)/); + decl.value = decl.value.replace(/quote\(.*\)/, contents[1]); + } else { + utils.report({ + message: messages.rejected, + node: decl, + index: declarationValueIndex(decl) + node.sourceIndex, + result, + ruleName + }); + } + } + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/README.md b/node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/README.md new file mode 100644 index 000000000..79537d918 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/README.md @@ -0,0 +1,46 @@ +# function-unquote-no-unquoted-strings-inside + +Disallow unquoted strings inside the [unquote function](https://sass-lang.com/documentation/modules/string#unquote) + +```scss +p { + font-family: unquote(Helvetica); + /** ↑ ↑ + * This function call is unnecessary + */ +} +``` + +## Options + +### `true` + +The following patterns are considered violations: + +```scss +a { + font-family: unquote(Helvetica); +} +``` + +```scss +$font: Helvetica; +p { + font-family: unquote($font); +} +``` + +The following patterns are _not_ considered violations: + +```scss +a { + color: unquote("blue"); +} +``` + +```scss +$font: "Helvetica"; +p { + font-family: unquote($font); +} +``` diff --git a/node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/index.js b/node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/index.js new file mode 100644 index 000000000..1caded7f4 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/index.js @@ -0,0 +1,88 @@ +"use strict"; + +const valueParser = require("postcss-value-parser"); +const { utils } = require("stylelint"); +const declarationValueIndex = require("../../utils/declarationValueIndex"); +const isNativeCssFunction = require("../../utils/isNativeCssFunction"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("function-unquote-no-unquoted-strings-inside"); + +const messages = utils.ruleMessages(ruleName, { + rejected: "Unquote function used with an already-unquoted string" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(primary, _, context) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: primary + }); + + if (!validOptions) { + return; + } + + // Setup variable naming. + const vars = {}; + + root.walkDecls(decl => { + if (decl.prop[0] !== "$") { + return; + } + + valueParser(decl.value).walk(node => { + vars[decl.prop] = node.type; + }); + }); + + root.walkDecls(decl => { + valueParser(decl.value).walk(node => { + // Verify that we're only looking at functions. + if ( + node.type !== "function" || + isNativeCssFunction(node.value) || + node.value === "" + ) { + return; + } + + // Verify we're only looking at quote() calls. + if (node.value !== "unquote") { + return; + } + + // Report error if first character is a quote. + // postcss-value-parser represents quoted strings as type 'string' (as opposed to word) + if ( + (!node.nodes[0].quote && node.nodes[0].value[0] !== "$") || + vars[node.nodes[0].value] === "word" + ) { + if (context.fix) { + const contents = /unquote\((.*)\)/.exec(decl.value); + + decl.value = contents[1]; + } else { + utils.report({ + message: messages.rejected, + node: decl, + index: declarationValueIndex(decl) + node.sourceIndex, + result, + ruleName + }); + } + } + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/index.js b/node_modules/stylelint-scss/src/rules/index.js new file mode 100644 index 000000000..7d99314b5 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/index.js @@ -0,0 +1,65 @@ +"use strict"; + +const rules = { + "at-each-key-value-single-line": require("./at-each-key-value-single-line"), + "at-else-closing-brace-newline-after": require("./at-else-closing-brace-newline-after"), + "at-else-closing-brace-space-after": require("./at-else-closing-brace-space-after"), + "at-else-empty-line-before": require("./at-else-empty-line-before"), + "at-else-if-parentheses-space-before": require("./at-else-if-parentheses-space-before"), + "at-extend-no-missing-placeholder": require("./at-extend-no-missing-placeholder"), + "at-function-named-arguments": require("./at-function-named-arguments"), + "at-function-parentheses-space-before": require("./at-function-parentheses-space-before"), + "at-function-pattern": require("./at-function-pattern"), + "at-if-closing-brace-newline-after": require("./at-if-closing-brace-newline-after"), + "at-if-closing-brace-space-after": require("./at-if-closing-brace-space-after"), + "at-if-no-null": require("./at-if-no-null"), + "at-import-no-partial-leading-underscore": require("./at-import-no-partial-leading-underscore"), + "at-import-partial-extension-blacklist": require("./at-import-partial-extension-blacklist"), + "at-import-partial-extension-whitelist": require("./at-import-partial-extension-whitelist"), + "at-import-partial-extension": require("./at-import-partial-extension"), + "at-mixin-argumentless-call-parentheses": require("./at-mixin-argumentless-call-parentheses"), + "at-mixin-named-arguments": require("./at-mixin-named-arguments"), + "at-mixin-parentheses-space-before": require("./at-mixin-parentheses-space-before"), + "at-mixin-pattern": require("./at-mixin-pattern"), + "at-rule-conditional-no-parentheses": require("./at-rule-conditional-no-parentheses"), + "at-rule-no-unknown": require("./at-rule-no-unknown"), + "at-use-no-unnamespaced": require("./at-use-no-unnamespaced"), + "comment-no-empty": require("./comment-no-empty"), + "comment-no-loud": require("./comment-no-loud"), + "declaration-nested-properties-no-divided-groups": require("./declaration-nested-properties-no-divided-groups"), + "declaration-nested-properties": require("./declaration-nested-properties"), + "dimension-no-non-numeric-values": require("./dimension-no-non-numeric-values"), + "dollar-variable-colon-newline-after": require("./dollar-variable-colon-newline-after"), + "dollar-variable-colon-space-after": require("./dollar-variable-colon-space-after"), + "dollar-variable-colon-space-before": require("./dollar-variable-colon-space-before"), + "dollar-variable-default": require("./dollar-variable-default"), + "dollar-variable-empty-line-after": require("./dollar-variable-empty-line-after"), + "dollar-variable-empty-line-before": require("./dollar-variable-empty-line-before"), + "dollar-variable-first-in-block": require("./dollar-variable-first-in-block"), + "dollar-variable-no-missing-interpolation": require("./dollar-variable-no-missing-interpolation"), + "dollar-variable-no-namespaced-assignment": require("./dollar-variable-no-namespaced-assignment"), + "dollar-variable-pattern": require("./dollar-variable-pattern"), + "double-slash-comment-empty-line-before": require("./double-slash-comment-empty-line-before"), + "double-slash-comment-inline": require("./double-slash-comment-inline"), + "double-slash-comment-whitespace-inside": require("./double-slash-comment-whitespace-inside"), + "function-color-relative": require("./function-color-relative"), + "function-no-unknown": require("./function-no-unknown"), + "function-quote-no-quoted-strings-inside": require("./function-quote-no-quoted-strings-inside"), + "function-unquote-no-unquoted-strings-inside": require("./function-unquote-no-unquoted-strings-inside"), + "map-keys-quotes": require("./map-keys-quotes"), + "media-feature-value-dollar-variable": require("./media-feature-value-dollar-variable"), + "no-dollar-variables": require("./no-dollar-variables"), + "no-duplicate-dollar-variables": require("./no-duplicate-dollar-variables"), + "no-duplicate-mixins": require("./no-duplicate-mixins"), + "no-global-function-names": require("./no-global-function-names"), + "operator-no-newline-after": require("./operator-no-newline-after"), + "operator-no-newline-before": require("./operator-no-newline-before"), + "operator-no-unspaced": require("./operator-no-unspaced"), + "partial-no-import": require("./partial-no-import"), + "percent-placeholder-pattern": require("./percent-placeholder-pattern"), + "selector-nest-combinators": require("./selector-nest-combinators"), + "selector-no-redundant-nesting-selector": require("./selector-no-redundant-nesting-selector"), + "selector-no-union-class-name": require("./selector-no-union-class-name") +}; + +module.exports = rules; diff --git a/node_modules/stylelint-scss/src/rules/map-keys-quotes/README.md b/node_modules/stylelint-scss/src/rules/map-keys-quotes/README.md new file mode 100644 index 000000000..087177ebe --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/map-keys-quotes/README.md @@ -0,0 +1,26 @@ +# map-keys-quotes + +Require quoted keys in Sass maps. + +```scss +$test: (Helvetica: 14px, Arial: 25px); + /** ↑ ↑ + * These words should be quoted. + */ +``` + +## Options + +### `always` + +The following patterns are considered violations: + +```scss +$test: (Helvetica: 14px, Arial: 25px); +``` + +The following patterns are _not_ considered violations: + +```scss +$test: ("foo": 14px, "bar": 25px); +``` diff --git a/node_modules/stylelint-scss/src/rules/map-keys-quotes/index.js b/node_modules/stylelint-scss/src/rules/map-keys-quotes/index.js new file mode 100644 index 000000000..b5952c7f4 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/map-keys-quotes/index.js @@ -0,0 +1,101 @@ +"use strict"; + +const valueParser = require("postcss-value-parser"); +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("map-keys-quotes"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Expected keys in map to be quoted." +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +const mathOperators = ["+", "/", "-", "*", "%"]; + +function rule(primary) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: primary, + possible: ["always"] + }); + + if (!validOptions) { + return; + } + + root.walkDecls(decl => { + if (decl.prop[0] !== "$") { + return; + } + + valueParser(decl.value).walk(node => { + if ( + node.type === "function" && + node.value === "" && + isMap(node.nodes) + ) { + // Identify all of the map-keys and see if they're strings (not words). + const mapKeys = returnMapKeys(node.nodes); + + mapKeys.forEach(map_key => { + if (mathOperators.includes(map_key.value)) { + return; + } + + if (map_key.type === "word" && isNaN(map_key.value)) { + utils.report({ + message: messages.expected, + node: decl, + result, + ruleName + }); + } + }); + } + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +// Takes in a list of map nodes and identifies if they are a map. +// A map is identified by the pattern: [string/word colon(div) anything comma(div) ...] +function isMap(nodes) { + if (nodes.length < 4) { + return false; + } + + if (nodes[0].type !== "word" && nodes[0].type !== "string") { + return false; + } + + if (nodes[1].value !== ":") { + return false; + } + + if (nodes[3].value !== ",") { + return false; + } + + return true; +} + +function returnMapKeys(array) { + const new_array = []; + + for (let i = 0; i < array.length; i += 4) { + new_array.push(array[i]); + } + + return new_array; +} + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/README.md b/node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/README.md new file mode 100644 index 000000000..c7674e8db --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/README.md @@ -0,0 +1,104 @@ +# media-feature-value-dollar-variable + +Require a media feature value be a `$`-variable or disallow `$`-variables in media feature values. + +```scss +@media (max-width: $var) { a { color: red; } } +// ↑ +// Require or disallow this +} +``` + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +A media feature value *must consist* of just a single `$`-variable (possibly with interpolation). + +The following patterns are considered warnings: + +```scss +@media (max-width: 300px) { b { color: red; } } +``` + +```scss +@media (max-width: $var + 10px) { b { color: red; } } +``` + +```scss +@media screen and (max-width: $var), or (min-width: 100px){ b { color: red; } } +``` + +```scss +@media screen and (max-width: #{$val} + 10px) { a { display: none; } } +``` + +```scss +@media screen and (max-width: #{$val + $x} ) { a { display: none; } } +``` + +```scss +@media screen and (min-width: funcName($p)){ b { color: red; } } +``` + +The following patterns are *not* considered warnings: + +```scss +@media ( max-width: $var ) {b { color: red; }} +``` + +```scss +@media ( max-width: #{$var}) {b { color: red; }} +``` + +### `"never"` + +There *must never* be a `$`-variable in a media feature value. Even as a parameter to a function call. + +The following patterns are considered warnings: + +```scss +@media screen and (min-width: $var){ b { color: red; } } +``` + +```scss +@media screen and (min-width: 100px + $var){ b { color: red; } } +``` + +```scss +@media screen and (min-width: funcName($var)){ b { color: red; } } +``` + +The following patterns are *not* considered warnings: + +```scss +@media screen and (min-width: 100px){ b { color: red; } } +``` + +```scss +@media screen and (min-width: 100px + 10px){ b { color: red; } } +``` + +```scss +@media screen and (min-width: funcName(10px)){ b { color: red; } } +``` + +## Optional options + +### `ignore: ["keywords"]` + +#### `"keywords"` + +Ignore keyword values like `none`, `dark`, `fine`, `srgb`. + +For example, with `"always"`: + +The following patterns are *not* considered warnings: + +```scss +@media screen and (max-width: $var) and (pointer: fine) { + a { display: none; } +} +``` diff --git a/node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/index.js b/node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/index.js new file mode 100644 index 000000000..7100379a1 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/index.js @@ -0,0 +1,109 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("media-feature-value-dollar-variable"); + +const messages = utils.ruleMessages(ruleName, { + rejected: "Unexpected dollar-variable as a media feature value", + expected: + "Expected a dollar-variable (e.g. $var) to be used as a media feature value" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation, options) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: expectation, + possible: ["always", "never"] + }, + { + actual: options, + possible: { + ignore: ["keywords"] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + const valueRegex = /:\s*(\S.+?)(:?\s*)\)/; + // In `(max-width: 10px )` find `: 10px )`. + // Got to go with that (the global search doesn't remember parens' insides) + // and parse it again afterwards to remove trailing junk + const valueRegexGlobal = new RegExp(valueRegex.source, "g"); + // `$var-name_sth` + const variableRegex = /^(\w+\.)?\$[\w-]+$/; + // `#{$var-name_sth}` + const interpolationVarRegex = /^#{\s*(\w+\.)?\$\w+\s*}$/; + // `none`, `dark` + const keywordValueRegex = /^[a-z][a-z\d-]*$/; + + root.walkAtRules("media", atRule => { + const found = atRule.params.match(valueRegexGlobal); + + // If there are no values + if (!found || !found.length) { + return; + } + + found.forEach(found => { + // ... parse `: 10px )` to `10px` + const valueParsed = found.match(valueRegex)[1]; + + // Just a shorthand to stylelint.utils.report() + function complain(message) { + utils.report({ + ruleName, + result, + node: atRule, + word: valueParsed, + message + }); + } + + // Keyword values, like `none`, should always be fine if keywords are + // ignored. + if ( + keywordValueRegex.test(valueParsed) && + optionsHaveIgnored(options, "keywords") + ) { + return; + } + + // A value should be a single variable + // or it should be a single variable inside Sass interpolation + if ( + expectation === "always" && + !( + variableRegex.test(valueParsed) || + interpolationVarRegex.test(valueParsed) + ) + ) { + complain(messages.expected); + } else if (expectation === "never" && valueParsed.includes("$")) { + // "Never" means no variables at all (functions allowed) + complain(messages.rejected); + } + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/no-dollar-variables/README.md b/node_modules/stylelint-scss/src/rules/no-dollar-variables/README.md new file mode 100644 index 000000000..bb282bf7c --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/no-dollar-variables/README.md @@ -0,0 +1,38 @@ +# no-dollar-variables + +Disallow dollar variables within a stylesheet. + +```scss + $a: 1; +/** ↑ + * These dollar variables */ +``` + +## Options + +### `true` + +The following patterns are considered violations: + +```scss +$a: 1; +``` + +```scss +$a: 1; +$b: 2; +``` + +```scss +.b { + $a: 1; +} +``` + +The following patterns are *not* considered violations: + +```scss +a { + color: blue; +} +``` diff --git a/node_modules/stylelint-scss/src/rules/no-dollar-variables/index.js b/node_modules/stylelint-scss/src/rules/no-dollar-variables/index.js new file mode 100644 index 000000000..a07724f78 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/no-dollar-variables/index.js @@ -0,0 +1,46 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("no-dollar-variables"); + +const messages = utils.ruleMessages(ruleName, { + rejected: variable => `Unexpected dollar variable ${variable}` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(value) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: value + }); + + if (!validOptions) { + return; + } + + root.walkDecls(decl => { + if (decl.prop[0] !== "$") { + return; + } + + utils.report({ + message: messages.rejected(decl.prop), + node: decl, + result, + ruleName + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/README.md b/node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/README.md new file mode 100644 index 000000000..2b56dfb96 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/README.md @@ -0,0 +1,212 @@ +# no-duplicate-dollar-variables + +Disallow duplicate dollar variables within a stylesheet. + +```scss +$a: 1; +$a: 2; +/** ↑ + * These are duplicates */ +``` + +A dollar variable is considered a duplicate if it shadows a variable of the same name (see the [Sass documentation](https://sass-lang.com/documentation/variables#shadowing)). Two dollar variables are not duplicates if their scopes are unrelated. + +```scss +.one { + $a: 1; + /** ↑ + * Not a duplicate */ +} +.two { + $a: 2; + /** ↑ + * Not a duplicate */ +} +``` + +A dollar variable is **not** considered a duplicate if it contains the `!default` keyword (see the [Sass documentation](https://sass-lang.com/documentation/variables#default-values)). Two dollar variables are duplicates if they both contain `!default` keyword. + +```scss +$a: 1; +$a: 5 !default; +/** ↑ + * Not a duplicate */ + +$b: 1 !default; +$b: 5 !default; +/** ↑ + * These are duplicates */ +``` + + + +## Options + +### `true` + +The following patterns are considered violations: + +```scss +$a: 1; +$a: 2; +``` + +```scss +$a: 1; +$b: 2; +$a: 3; +``` + +```scss +$a: 1; +.b { + $a: 1; +} +``` + +```scss +$a: 1; +.b { + .c { + $a: 1; + } +} +``` + +```scss +$a: 1; +@mixin b { + $a: 1; +} +``` + +The following patterns are _not_ considered violations: + +```scss +$a: 1; +$b: 2; +``` + +```scss +$a: 1; +.b { + $b: 2; +} +``` + +___ + +### `ignoreInside: ["at-rule", "nested-at-rule"]` + +#### `"at-rule"` + +Ignores dollar variables that are inside both nested and non-nested at-rules (`@media`, `@mixin`, etc.). + +Given: + +```json +{ "ignoreInside": ["at-rule"] } +``` + +The following patterns are _not_ considered warnings: + +```scss +$a: 1; +@mixin c { + $a: 1; +} +``` + +```scss +$a: 1; +.b { + @mixin c { + $a: 1; + } +} +``` + +#### `"nested-at-rule"` + +Ignores dollar variables that are inside nested at-rules (`@media`, `@mixin`, etc.). + +Given: + +```json +{ "ignoreInside": ["nested-at-rule"] } +``` + +The following patterns are _not_ considered warnings: + +```scss +$a: 1; +.b { + @mixin c { + $a: 1; + } +} +``` + +___ + +### `ignoreInsideAtRules: ["array", "of", "at-rules"]` + +Ignores all variables that are inside specified at-rules. + +Given: + +```json +{ "ignoreInsideAtRules": ["if", "mixin"] } +``` + +The following patterns are _not_ considered warnings: + +```scss +$a: 1; + +@mixin b { + $a: 2; +} +``` + +```scss +$a: 1; + +@if (true) { + $a: 2; +} +``` + +___ + +### `ignoreDefaults: [boolean]` + +Ignore all variables containing the `!default` keyword. + +Given: + +```json +{ "ignoreDefaults": true } +``` + +The following patterns are _not_ considered warnings: + +```scss +$a: 5 !default; +$a: $a + 1; + +$a: 15 !default; +``` + +Given: + +```json +{ "ignoreDefaults": false } +``` + +The following patterns are considered warnings: + +```scss +$a: 5 !default; +$a: 1; +``` diff --git a/node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/index.js b/node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/index.js new file mode 100644 index 000000000..e38ba55c8 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/index.js @@ -0,0 +1,194 @@ +"use strict"; + +const { utils } = require("stylelint"); +const { isBoolean } = require("../../utils/validateTypes"); +const { isString } = require("../../utils/validateTypes"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("no-duplicate-dollar-variables"); + +const messages = utils.ruleMessages(ruleName, { + rejected: variable => `Unexpected duplicate dollar variable ${variable}` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(value, secondaryOptions) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { + actual: value + }, + { + actual: secondaryOptions, + possible: { + ignoreInside: ["at-rule", "nested-at-rule"], + ignoreInsideAtRules: [isString], + ignoreDefaults: [isBoolean] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + const vars = {}; + + /** + * Traverse the [vars] tree through the path defined by [ancestors], creating nodes as needed. + * @param {*} ancestors + * @returns the tree of the node defined by the last of [ancestors]. + */ + function getScope(ancestors) { + let scope = vars; + + for (const node of ancestors) { + if (!(node in scope)) { + scope[node] = {}; + } + + scope = scope[node]; + } + + return scope; + } + + /** + * Iterates through the ancestors while checking each scope until the [variable] is found. + * If not found, an object with empty values is returned. + * @param {*} ancestors + * @param {string} variable the variable name. + * @returns The previously declared variable data or an object with empty values. + */ + function getVariableData(ancestors, variable) { + let scope = vars; + + for (const node of ancestors) { + scope = scope[node]; + + if (scope[variable]) { + return scope[variable]; + } + } + + return { + defaultCount: 0, + isDeclared: false + }; + } + + /** + * Checks whether the given [variableData] is declared. + * @param {{ defaultCount: number; isDeclared: boolean; }} variableData the variable data + * containing default count and if the variable is declared. + * @param {boolean} isDefault if the variable contains the `!default` keyword. + * @param {boolean | number} ignoreDefaults the ignore defaults options. + * @returns true if declared. + */ + function isDeclared(variableData, isDefault, ignoreDefaults) { + if (isDefault) { + if (Number.isFinite(ignoreDefaults)) { + return variableData.defaultCount >= ignoreDefaults; + } else if (ignoreDefaults) { + return false; + } + } + + return variableData.isDeclared; + } + + /** + * Processes the variable data based on the given arguments. + * @param {{ defaultCount: number; isDeclared: boolean; }} variableData the variable data + * containing default count and if the variable is declared. + * @param {boolean} isDefault if the variable contains the `!default` keyword. + * @param {boolean | number} ignoreDefaults the ignore defaults options. + * @returns the updated `variableData`. + */ + function processVariableData(variableData, isDefault, ignoreDefaults) { + return { + defaultCount: isDefault + ? ++variableData.defaultCount + : variableData.defaultCount, + isDeclared: + isDefault && ignoreDefaults !== false ? variableData.isDeclared : true + }; + } + + const ignoreDefaults = + secondaryOptions && secondaryOptions.ignoreDefaults !== undefined + ? secondaryOptions.ignoreDefaults + : 1; + + root.walkDecls(decl => { + const isVar = decl.prop[0] === "$"; + const isInsideIgnoredAtRule = + decl.parent.type === "atrule" && + secondaryOptions && + secondaryOptions.ignoreInside && + secondaryOptions.ignoreInside === "at-rule"; + const isInsideIgnoredNestedAtRule = + decl.parent.type === "atrule" && + decl.parent.parent.type !== "root" && + secondaryOptions && + secondaryOptions.ignoreInside && + secondaryOptions.ignoreInside === "nested-at-rule"; + const isInsideIgnoredSpecifiedAtRule = + decl.parent.type === "atrule" && + secondaryOptions && + secondaryOptions.ignoreInsideAtRules && + secondaryOptions.ignoreInsideAtRules.includes(decl.parent.name); + + if ( + !isVar || + isInsideIgnoredAtRule || + isInsideIgnoredNestedAtRule || + isInsideIgnoredSpecifiedAtRule + ) { + return; + } + + const ancestors = []; + let parent = decl.parent; + + while (parent !== null && parent !== undefined) { + const parentKey = parent.toString(); + + ancestors.unshift(parentKey); + parent = parent.parent; + } + + const scope = getScope(ancestors); + const isDefault = /!default/.test(decl.value); + const variableData = getVariableData(ancestors, decl.prop); + + if (isDeclared(variableData, isDefault, ignoreDefaults)) { + utils.report({ + message: messages.rejected(decl.prop), + node: decl, + result, + ruleName + }); + } + + scope[decl.prop] = processVariableData( + variableData, + isDefault, + ignoreDefaults + ); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/no-duplicate-mixins/README.md b/node_modules/stylelint-scss/src/rules/no-duplicate-mixins/README.md new file mode 100644 index 000000000..cdb7bb27c --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/no-duplicate-mixins/README.md @@ -0,0 +1,83 @@ +# no-duplicate-mixins + +Disallow duplicate mixins within a stylesheet. + +```scss +@mixin font-size-default { + font-size: 16px; +} +@mixin font-size-default { + font-size: 18px; +} +/** ↑ + * These are duplicates */ +``` + +## Options + +### `true` + +The following patterns are considered violations: + +```scss +@mixin font-size-default { + font-size: 16px; +} +@mixin font-size-default { + font-size: 18px; +} +``` + +```scss +@mixin font-size-default { + font-size: 16px; +} +@mixin font-size-sm { + font-size: 14px; +} +@mixin font-size-default { + font-size: 18px; +} +``` + +```scss +@mixin font-size { + font-size: 16px; +} +@mixin font-size($var) { + font-size: $var; +} +``` + +```scss +@mixin font-size($property, $value) { + #{$property}: $value; +} +@mixin font-size($var) { + font-size: $var; +} +``` + +```scss +@mixin font-size { + color: blue; +} + +.b { + @mixin font-size { + color: red; + } + @include font-size; +} +``` + +The following patterns are _not_ considered violations: + +```scss +@mixin font-size-default { + font-size: 16px; +} +@mixin font-size-lg { + font-size: 18px; +} +``` diff --git a/node_modules/stylelint-scss/src/rules/no-duplicate-mixins/index.js b/node_modules/stylelint-scss/src/rules/no-duplicate-mixins/index.js new file mode 100644 index 000000000..a1f84135e --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/no-duplicate-mixins/index.js @@ -0,0 +1,57 @@ +"use strict"; + +const { utils } = require("stylelint"); +const atRuleBaseName = require("../../utils/atRuleBaseName"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("no-duplicate-mixins"); + +const messages = utils.ruleMessages(ruleName, { + rejected: mixin => `Unexpected duplicate mixin ${mixin}` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(value) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: value + }); + + if (!validOptions) { + return; + } + + const mixins = {}; + + root.walkAtRules(decl => { + const isMixin = decl.name === "mixin"; + + if (!isMixin) { + return; + } + + const mixinName = atRuleBaseName(decl); + + if (mixins[mixinName]) { + utils.report({ + message: messages.rejected(mixinName), + node: decl, + result, + ruleName + }); + } + + mixins[mixinName] = true; + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/no-global-function-names/README.md b/node_modules/stylelint-scss/src/rules/no-global-function-names/README.md new file mode 100644 index 000000000..fc98125cf --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/no-global-function-names/README.md @@ -0,0 +1,31 @@ +# no-global-function-names + +Disallows the use of global function names, as these global functions are now located inside built-in Sass modules. + +A full list of disallowed names (and their alternatives) is located [here](https://github.com/sass/sass/blob/main/accepted/module-system.md#built-in-modules-1) + +It is recommended to use the [Sass migrator](https://sass-lang.com/documentation/cli/migrator) to change these global function names automatically. + +```scss +@use "sass:color"; +a { + background: color.adjust(#6b717f, $red: 15); +} +``` + +The following patterns are considered warnings: + +```scss +a { + background: adjust-color(#6b717f, $red: 15); +} +``` + +The following patterns are *not* considered warnings: + +```scss +@use "sass:color"; +a { + background: color.adjust(#6b717f, $red: 15); +} +``` \ No newline at end of file diff --git a/node_modules/stylelint-scss/src/rules/no-global-function-names/index.js b/node_modules/stylelint-scss/src/rules/no-global-function-names/index.js new file mode 100644 index 000000000..9d750d7a6 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/no-global-function-names/index.js @@ -0,0 +1,203 @@ +"use strict"; + +const valueParser = require("postcss-value-parser"); +const { utils } = require("stylelint"); +const declarationValueIndex = require("../../utils/declarationValueIndex"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const interpolationPrefix = /^#{\s*/m; + +const rules = { + red: "color", + blue: "color", + green: "color", + mix: "color", + hue: "color", + saturation: "color", + lightness: "color", + complement: "color", + "adjust-color": "color", + "scale-color": "color", + "change-color": "color", + "ie-hex-str": "color", + "map-get": "map", + "map-merge": "map", + "map-remove": "map", + "map-keys": "map", + "map-values": "map", + "map-has-key": "map", + unquote: "string", + quote: "string", + "str-length": "string", + "str-insert": "string", + "str-index": "string", + "str-slice": "string", + "to-upper-case": "string", + "to-lower-case": "string", + "unique-id": "string", + percentage: "math", + round: "math", + ceil: "math", + floor: "math", + abs: "math", + random: "math", + unit: "math", + unitless: "math", + comparable: "math", + length: "list", + nth: "list", + "set-nth": "list", + join: "list", + append: "list", + zip: "list", + index: "list", + "list-separator": "list", + "feature-exists": "meta", + "variable-exists": "meta", + "global-variable-exists": "meta", + "function-exists": "meta", + "mixin-exists": "meta", + inspect: "meta", + "get-function": "meta", + "type-of": "meta", + call: "meta", + "content-exists": "meta", + keywords: "meta", + "selector-nest": "selector", + "selector-append": "selector", + "selector-replace": "selector", + "selector-unify": "selector", + "is-superselector": "selector", + "simple-selectors": "selector", + "selector-parse": "selector", + "selector-extend": "selector", + lighten: "color", + "adjust-hue": "color", + darken: "color", + desaturate: "color", + opacify: "color", + transparentize: "color" +}; + +const new_rule_names = { + "adjust-color": "adjust", + "scale-color": "scale", + "change-color": "change", + "map-get": "get", + "map-merge": "merge", + "map-remove": "remove", + "map-keys": "keys", + "map-values": "values", + "map-has-key": "has-key", + "str-length": "length", + "str-insert": "insert", + "str-index": "index", + "str-slice": "slice", + unitless: "is-unitless", + comparable: "compatible", + "list-separator": "separator", + "selector-nest": "nest", + "selector-append": "append", + "selector-replace": "replace", + "selector-unify": "unify", + "selector-parse": "parse", + "selector-extend": "extend", + lighten: "adjust", + "adjust-hue": "adjust", + darken: "adjust", + desaturate: "adjust", + opacify: "adjust", + saturate: "adjust", + transparentize: "adjust" +}; + +const rule_mapping = { + lighten: ["lighten($color, $amount)", "adjust($color, $lightness: $amount)"], + "adjust-hue": [ + "adjust-hue($color, $amount)", + "adjust($color, $hue: $amount)" + ], + darken: ["darken($color, $amount)", "adjust($color, $lightness: -$amount)"], + desaturate: [ + "desaturate($color, $amount)", + "adjust($color, $saturation: -$amount)" + ], + opacify: ["opacify($color, $amount)", "adjust($color, $alpha: -$amount)"], + saturate: [ + "saturate($color, $amount)", + "adjust($color, $saturation: $amount)" + ], + transparentize: [ + "transparentize($color, $amount)", + "adjust($color, $alpha: -$amount)" + ] +}; + +const ruleName = namespace("no-global-function-names"); + +const messages = utils.ruleMessages(ruleName, { + rejectedFullMessage: string => string, + rejected: name => errorMessage(name) +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function errorMessage(name) { + const sass_package = rules[name]; + const rename = new_rule_names[name]; + const map_rule = rule_mapping[name]; + + if (rename) { + if (map_rule) { + const [old_rule, new_rule] = map_rule; + + return `Expected ${sass_package}.${new_rule} instead of ${old_rule}`; + } + + return `Expected ${sass_package}.${rename} instead of ${name}`; + } else { + return `Expected ${sass_package}.${name} instead of ${name}`; + } +} + +function rule(value) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: value + }); + + if (!validOptions) { + return; + } + + root.walkDecls(decl => { + valueParser(decl.value).walk(node => { + const cleanValue = node.value.replace(interpolationPrefix, ""); + + // Verify that we're only looking at functions. + if (node.type !== "function" || cleanValue === "") { + return; + } + + if (Object.keys(rules).includes(cleanValue)) { + utils.report({ + message: messages.rejected(cleanValue), + node: decl, + index: declarationValueIndex(decl) + node.sourceIndex, + result, + ruleName + }); + } + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/operator-no-newline-after/README.md b/node_modules/stylelint-scss/src/rules/operator-no-newline-after/README.md new file mode 100644 index 000000000..677f1e610 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/operator-no-newline-after/README.md @@ -0,0 +1,54 @@ +# operator-no-newline-after + +Disallow linebreaks after Sass operators. + +```scss +a { width: 10px + $n; } +/** ↑ + * Linebreaks after this */ +``` + +This rule checks math operators (`+`, `-`, `/`, `*`, `%`) and comparison operators (`>`, `<`, `!=`, `==`, `>=`, `<=`). + +Not all symbols that correspond to math operators are actually considered operators by Sass. Some of the exceptions are: + +* `+` and `-` as signs before values; +* `+` and `-` as signs in [space-delimited lists](https://sass-lang.com/documentation/operators/string); +* `-` as part of [a string](https://sass-lang.com/documentation/operators/string) or [a Sass identifier](https://sass-lang.com/documentation/operators/numeric#unary-operators), e.g. a variable; +* `/` as a CSS delimiter in property values like `font: 10px/1.2 Arial;` ([read more](https://sass-lang.com/documentation/operators/numeric#slash-separated-values)). + +For more details refer to [Sass official documentation](https://sass-lang.com/documentation). An online Sass compiler - [Sassmeister](https://www.sassmeister.com/) - could also come in handy. + +The following patterns are considered warnings: + +```scss +a { width: 10 + +1; } +``` + +```scss +a { + width: 10 + + 1; +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { + width: str- // not a math operator, ignored + some; +} +``` + +```scss +a { width: 10px - 1; } +``` + +```scss +a { + width: 10px * 1.7 // the newline is not right after the operator + + 1; +} +``` diff --git a/node_modules/stylelint-scss/src/rules/operator-no-newline-after/index.js b/node_modules/stylelint-scss/src/rules/operator-no-newline-after/index.js new file mode 100644 index 000000000..a8d93edf6 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/operator-no-newline-after/index.js @@ -0,0 +1,82 @@ +"use strict"; + +const { utils } = require("stylelint"); +const eachRoot = require("../../utils/eachRoot"); +const isWhitespace = require("../../utils/isWhitespace"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); +const { calculationOperatorSpaceChecker } = require("../operator-no-unspaced"); + +const ruleName = namespace("operator-no-newline-after"); + +const messages = utils.ruleMessages(ruleName, { + rejected: operator => `Unexpected newline after "${operator}"` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +/** + * The checker function: whether there is a newline before THAT operator. + */ +function checkNewlineBefore({ + string, + globalIndex, + startIndex, + endIndex, + node, + result +}) { + const symbol = string.substring(startIndex, endIndex + 1); + let newLineBefore = false; + + let index = endIndex + 1; + + while (index && isWhitespace(string[index])) { + if (string[index] === "\n") { + newLineBefore = true; + break; + } + + index++; + } + + if (newLineBefore) { + utils.report({ + ruleName, + result, + node, + message: messages.rejected(symbol), + index: endIndex + globalIndex + }); + } +} + +function rule(expectation) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation + }); + + if (!validOptions) { + return; + } + + eachRoot(root, checkRoot); + + function checkRoot(root) { + calculationOperatorSpaceChecker({ + root, + result, + checker: checkNewlineBefore + }); + } + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/operator-no-newline-before/README.md b/node_modules/stylelint-scss/src/rules/operator-no-newline-before/README.md new file mode 100644 index 000000000..81b358aab --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/operator-no-newline-before/README.md @@ -0,0 +1,55 @@ +# operator-no-newline-before + +Disallow linebreaks before Sass operators. + +```scss +a { width: 10px + + $n; } +/** ↑ + * Linebreaks before this */ +``` + +This rule checks math operators (`+`, `-`, `/`, `*`, `%`) and comparison operators (`>`, `<`, `!=`, `==`, `>=`, `<=`). + +Not all symbols that correspond to math operators are actually considered operators by Sass. Some of the exceptions are: + +* `+` and `-` as signs before values; +* `+` and `-` as signs in [space-delimited lists](https://sass-lang.com/documentation/operators/string); +* `-` as part of [a string](https://sass-lang.com/documentation/operators/string) or [a Sass identifier](https://sass-lang.com/documentation/operators/numeric#unary-operators), e.g. a variable; +* `/` as a CSS delimiter in property values like `font: 10px/1.2 Arial;` ([read more](https://sass-lang.com/documentation/operators/numeric#slash-separated-values)). + +For more details refer to [Sass official documentation](https://sass-lang.com/documentation). An online Sass compiler - [Sassmeister](https://www.sassmeister.com/) - could also come in handy. + +The following patterns are considered warnings: + +```scss +a { width: 10 ++ 1; } +``` + +```scss +a { + width: 10 + + 1; +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { + width: 10px + -1; // not a math operator, ignored +} +``` + +```scss +a { width: 10px - 1; } +``` + +```scss +a { + width: 100px + + $var * 0.5625; // the newline is not right before the operator +} +``` diff --git a/node_modules/stylelint-scss/src/rules/operator-no-newline-before/index.js b/node_modules/stylelint-scss/src/rules/operator-no-newline-before/index.js new file mode 100644 index 000000000..0369ae3a6 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/operator-no-newline-before/index.js @@ -0,0 +1,82 @@ +"use strict"; + +const { utils } = require("stylelint"); +const eachRoot = require("../../utils/eachRoot"); +const isWhitespace = require("../../utils/isWhitespace"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); +const { calculationOperatorSpaceChecker } = require("../operator-no-unspaced"); + +const ruleName = namespace("operator-no-newline-before"); + +const messages = utils.ruleMessages(ruleName, { + rejected: operator => `Unexpected newline before "${operator}"` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +/** + * The checker function: whether there is a newline before THAT operator. + */ +function checkNewlineBefore({ + string, + globalIndex, + startIndex, + endIndex, + node, + result +}) { + const symbol = string.substring(startIndex, endIndex + 1); + let newLineBefore = false; + + let index = startIndex - 1; + + while (index && isWhitespace(string[index])) { + if (string[index] === "\n") { + newLineBefore = true; + break; + } + + index--; + } + + if (newLineBefore) { + utils.report({ + ruleName, + result, + node, + message: messages.rejected(symbol), + index: endIndex + globalIndex + }); + } +} + +function rule(expectation) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation + }); + + if (!validOptions) { + return; + } + + eachRoot(root, checkRoot); + + function checkRoot(root) { + calculationOperatorSpaceChecker({ + root, + result, + checker: checkNewlineBefore + }); + } + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/operator-no-unspaced/README.md b/node_modules/stylelint-scss/src/rules/operator-no-unspaced/README.md new file mode 100644 index 000000000..4bef68522 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/operator-no-unspaced/README.md @@ -0,0 +1,100 @@ +# operator-no-unspaced + +Disallow unspaced operators in Sass operations. + +```scss +a { width: 10px*$n; } +/** ↑ + * The space around this operator */ +``` + +This rule checks math operators (`+`, `-`, `/`, `*`, `%`) and comparison operators (`>`, `<`, `!=`, `==`, `>=`, `<=`). + +Not all symbols that correspond to math operators are actually considered operators by Sass. Some of the exceptions are: + +* `+` and `-` as signs before values; +* `+` and `-` as signs in [space-delimited lists](https://sass-lang.com/documentation/operators/string); +* `-` as part of [a string](https://sass-lang.com/documentation/operators/string) or [a Sass identifier](https://sass-lang.com/documentation/operators/numeric#unary-operators), e.g. a variable; +* `/` as a CSS delimiter in property values like `font: 10px/1.2 Arial;` ([read more](https://sass-lang.com/documentation/operators/numeric#slash-separated-values)). + +For more details refer to [Sass official documentation](https://sass-lang.com/documentation/file.SASS_REFERENCE.html). An online Sass compiler - [Sassmeister](https://www.sassmeister.com/) - could also come in handy. + +The following patterns are considered warnings: + +```scss +a { width: 10+1; } +``` + +```scss +a { width: 10+ 1; } +``` + +```scss +a { width: 10-1; } +``` + +```scss +a { width: 10px* 1.5; } +``` + +```scss +@if ($var==10) { ... } +``` + +```scss +a { width: 10px * 1.5; } // More than one space +``` + +```scss +a { width: (10) /1; } // Has a value inside parens on one side, so is an operation +``` + +```scss +// Operations can be inside interpolation in selectors, property names, etc. +.class#{1 +1}name { + color: red; +} + +p { + background-#{\"col\" +\"or\"}: red; +} +``` + +The following patterns are *not* considered warnings: + +```scss +a { width: 10 * 1; } +``` + +```scss +a { width: 10 +1; } // A space-delimited Sass list +``` + +```scss +// A space-delimited Sass list, in "10px-" "10" is a number, "px-" is a unit +a { width: 10px- 1; } +``` + +```scss +a { width: 10px/1; } // Compiled as CSS, as in "font: 10px/1 ..." +``` + +```scss +a { width: (10) /#{1}; } // Has interpolation on one of the sides, so not an operation +``` + +```scss +a { width: $var-1; } // "$var-1" is a variable name +``` + +```scss +a { width: "10*1"; } // Inside a string, ignored +``` + +```scss +// Linebreak will do as a whitespace; indentation before "-" and trailing spaces after "1" are left to the corresponding stylelint rules +a { + width: 1 + - a; +} +``` diff --git a/node_modules/stylelint-scss/src/rules/operator-no-unspaced/index.js b/node_modules/stylelint-scss/src/rules/operator-no-unspaced/index.js new file mode 100644 index 000000000..cdee380a4 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/operator-no-unspaced/index.js @@ -0,0 +1,308 @@ +"use strict"; + +const mediaQueryParser = require("postcss-media-query-parser").default; +const { utils } = require("stylelint"); +const atRuleParamIndex = require("../../utils/atRuleParamIndex"); +const declarationValueIndex = require("../../utils/declarationValueIndex"); +const eachRoot = require("../../utils/eachRoot"); +const findCommentsInRaws = require("../../utils/findCommentsInRaws"); +const findOperators = require("../../utils/sassValueParser"); +const isWhitespace = require("../../utils/isWhitespace"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("operator-no-unspaced"); + +const messages = utils.ruleMessages(ruleName, { + expectedAfter: operator => `Expected single space after "${operator}"`, + expectedBefore: operator => `Expected single space before "${operator}"` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +/** + * The actual check for are there (un)necessary whitespaces + */ +function checkSpaces({ + string, + globalIndex, + startIndex, + endIndex, + node, + result +}) { + const symbol = string.substring(startIndex, endIndex + 1); + + const beforeOk = + (string[startIndex - 1] === " " && !isWhitespace(string[startIndex - 2])) || + newlineBefore(string, startIndex - 1); + + if (!beforeOk) { + utils.report({ + ruleName, + result, + node, + message: messages.expectedBefore(symbol), + index: startIndex + globalIndex + }); + } + + const afterOk = + (string[endIndex + 1] === " " && !isWhitespace(string[endIndex + 2])) || + string[endIndex + 1] === "\n" || + string.substr(endIndex + 1, 2) === "\r\n"; + + if (!afterOk) { + utils.report({ + ruleName, + result, + node, + message: messages.expectedAfter(symbol), + index: endIndex + globalIndex + }); + } +} + +function newlineBefore(str, startIndex) { + let index = startIndex; + + while (index && isWhitespace(str[index])) { + if (str[index] === "\n") return true; + + index--; + } + + return false; +} + +function rule(expectation) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation + }); + + if (!validOptions) { + return; + } + + eachRoot(root, checkRoot); + + function checkRoot(root) { + const rootString = root.source.input.css; + + if (rootString.trim() === "") { + return; + } + + calculationOperatorSpaceChecker({ + root, + result, + checker: checkSpaces + }); + } + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +/** + * The core rule logic function. This one can be imported by some other rules + * that work with Sass operators + * + * @param {Object} args -- Named arguments object + * @param {PostCSS Root} args.root + * @param {PostCSS Result} args.result + * @param {function} args.checker -- the function that is run against all the + * operators found in the input. Takes these arguments: + * {Object} cbArgs -- Named arguments object + * {string} cbArgs.string -- the input string (suspected operation) + * {number} cbArgs.globalIndex -- the string's index in a global input + * {number} cbArgs.startIndex -- the start index of a symbol to inspect + * {number} cbArgs.endIndex -- the end index of a symbol to inspect + * (two indexes needed to allow for `==`, `!=`, etc.) + * {PostCSS Node} cbArgs.node -- for stylelint.utils.report + * {PostCSS Result} cbArgs.result -- for stylelint.utils.report + */ +function calculationOperatorSpaceChecker({ root, result, checker }) { + /** + * Takes a string, finds all occurrences of Sass interpolation in it, then + * finds all operators inside that interpolation + * + * @return {array} An array of objects { string, operators } - effectively, + * a list of operators for each Sass interpolation occurrence + */ + function findInterpolation(string, startIndex) { + const interpolationRegex = /#{(.*?)}/g; + const results = []; + // Searching for interpolation + let match = interpolationRegex.exec(string); + + startIndex = !isNaN(startIndex) ? Number(startIndex) : 0; + while (match !== null) { + results.push({ + source: match[0], + operators: findOperators({ + string: match[0], + globalIndex: match.index + startIndex + }) + }); + match = interpolationRegex.exec(string); + } + + return results; + } + + const dataURIRegex = /^url\(\s*['"]?data:.+['"]?\s*\)/; + + root.walk(item => { + if (item.prop === "unicode-range") { + return; + } + + let results = []; + + // Check a value (`10px` in `width: 10px;`) + if (item.value !== undefined) { + if (dataURIRegex.test(item.value)) { + return results; + } + results.push({ + source: item.value, + operators: findOperators({ + string: item.value, + globalIndex: declarationValueIndex(item), + // For Sass variable values some special rules apply + isAfterColon: item.prop[0] === "$" + }) + }); + } + + // Property name + if (item.prop !== undefined) { + results = results.concat(findInterpolation(item.prop)); + } + + // Selector + if (item.selector !== undefined) { + results = results.concat(findInterpolation(item.selector)); + } + + if (item.type === "atrule") { + // @forward, @use and @at-root + if ( + item.name === "forward" || + item.name === "use" || + item.name === "at-root" + ) { + return; + } + + // Media queries + if (item.name === "media" || item.name === "import") { + mediaQueryParser(item.params).walk(node => { + const type = node.type; + + if (["keyword", "media-type", "media-feature"].includes(type)) { + results = results.concat( + findInterpolation( + node.value, + atRuleParamIndex(item) + node.sourceIndex + ) + ); + } else if (type === "value") { + results.push({ + source: node.value, + operators: findOperators({ + string: node.value, + globalIndex: atRuleParamIndex(item) + node.sourceIndex, + isAfterColon: true + }) + }); + } else if (type === "url") { + const isQuoted = node.value[0] === '"' || node.value[0] === "'"; + const containsWhitespace = node.value.search(/\s/) > -1; + + if (isQuoted || containsWhitespace) { + // The argument to the url function is only parsed as SassScript if it is a quoted + // string, or a _valid_ unquoted URL [1]. + // + // [1] https://sass-lang.com/documentation/syntax/special-functions#url + results.push({ + source: node.value, + operators: findOperators({ + string: node.value, + globalIndex: atRuleParamIndex(item) + node.sourceIndex, + isAfterColon: true + }) + }); + } + } + }); + } else { + // Function and mixin definitions and other rules + results.push({ + source: item.params, + operators: findOperators({ + string: item.params, + globalIndex: atRuleParamIndex(item), + isAfterColon: true + }) + }); + } + } + + // All the strings have been parsed, now run whitespace checking + results.forEach(el => { + // Only if there are operators within a string + if (el.operators && el.operators.length > 0) { + el.operators.forEach(operator => { + checker({ + string: el.source, + globalIndex: operator.globalIndex, + startIndex: operator.startIndex, + endIndex: operator.endIndex, + node: item, + result + }); + }); + } + }); + }); + + // Checking interpolation inside comments + // We have to give up on PostCSS here because it skips some inline comments + findCommentsInRaws(root.source.input.css).forEach(comment => { + const startIndex = + comment.source.start + + comment.raws.startToken.length + + comment.raws.left.length; + + if (comment.type !== "css") { + return; + } + + findInterpolation(comment.text).forEach(el => { + // Only if there are operators within a string + if (el.operators && el.operators.length > 0) { + el.operators.forEach(operator => { + checker({ + string: el.source, + globalIndex: operator.globalIndex + startIndex, + startIndex: operator.startIndex, + endIndex: operator.endIndex, + node: root, + result + }); + }); + } + }); + }); +} + +rule.calculationOperatorSpaceChecker = calculationOperatorSpaceChecker; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/partial-no-import/README.md b/node_modules/stylelint-scss/src/rules/partial-no-import/README.md new file mode 100644 index 000000000..4a280b4ef --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/partial-no-import/README.md @@ -0,0 +1,69 @@ +# partial-no-import + +Disallow non-CSS `@import`s in partial files. + +```scss +// path/to/_file.scss: +/* ↑ in partial files */ + + @import "path/to/file.scss" +/*↑ Disallow imports */ +``` + +The rule skips CSS files (doesn't report any `@import`s in them). + +The rule also ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import: + +* If the file’s extension is `.css`. +* If the filename begins with `http://` (or any other protocol). +* If the filename is a `url()`. +* If the `@import` has any media queries. + +The following patterns are considered warnings: + +```scss +// path/to/_file.scss: + +@import "foo.scss"; +``` + +```scss +// path/to/_file.less: +@import "path/fff.less"; +``` + +```scss +// path/to/_file.scss: +@import "path\\fff.supa"; +``` + +The following patterns are *not* considered warnings: + +```scss +// path/to/file.scss: +@import "path/fff"; + +/* @import in a file that is not a partial */ +``` + +```scss +// path/to/_file.scss: +@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */ +``` + +```scss +// path/to/_file.scss: +@import "file.css"; /* Has ".css" extension, so doesn't count as a partial @import */ +``` + +```scss +// path/to/_file.scss: +@import "http://_file.scss"; +@import "//_file.scss"; +/* Both are URIs, so don't count as partial @imports */ +``` + +```scss +// path/to/_file.scss: +@import "file.scss" screen; /* Has a media query, so doesn't count as a partial @import */ +``` diff --git a/node_modules/stylelint-scss/src/rules/partial-no-import/index.js b/node_modules/stylelint-scss/src/rules/partial-no-import/index.js new file mode 100644 index 000000000..851181ce0 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/partial-no-import/index.js @@ -0,0 +1,89 @@ +"use strict"; + +const nodeJsPath = require("path"); +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("partial-no-import"); + +const messages = utils.ruleMessages(ruleName, { + expected: "Unexpected @import in a partial" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(on) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: on + }); + + if (!validOptions) { + return; + } + + if (root.source.input.file === undefined || !root.source.input.file) { + result.warn( + "The 'partial-no-import' rule won't work if linting in a code string without an actual file." + ); + + return; + } + + const fileName = nodeJsPath.basename(root.source.input.file); + const extName = nodeJsPath.extname(root.source.input.file); + + function checkImportForCSS(path, decl) { + // Stripping trailing quotes and whitespaces, if any + const pathStripped = path + .replace(/^\s*(["'])\s*/, "") + .replace(/\s*(["'])\s*$/, ""); + + // Skipping importing empty import, CSS: url(), ".css", URI with a protocol, media + if ( + pathStripped.trim() === "" || + pathStripped.slice(0, 4) === "url(" || + pathStripped.slice(-4) === ".css" || + pathStripped.search("//") !== -1 || + pathStripped.search(/[\s,)"']\w+$/) !== -1 + ) { + return; + } + + utils.report({ + message: messages.expected, + node: decl, + index: decl.params.indexOf(path), + result, + ruleName + }); + } + + // Usual CSS file + if (extName === ".css") { + return; + } + + // Not a partial + if (fileName[0] !== "_") { + return; + } + + root.walkAtRules("import", mixinCall => { + // Check if @import is treated as CSS import; report only if not + // Processing comma-separated lists of import paths + mixinCall.params.split(/["']\s*,/).forEach(path => { + checkImportForCSS(path, mixinCall); + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/README.md b/node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/README.md new file mode 100644 index 000000000..d4e85c233 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/README.md @@ -0,0 +1,57 @@ +# percent-placeholder-pattern + +Specify a pattern for `%`-placeholders. + +```scss + %foobar { display: flex; } +/** ↑ + * The pattern of this */ +``` + +## Options + +`regex` or `string` + +A string will be translated into a RegExp like so `new RegExp(yourString)` — so be sure to escape properly. + +Nested selectors will be resolved before checking. + +The selector value *after `%`* will be checked. No need to include `%` in your pattern. + +### E.g. `/^foo-[a-z]+$/` + +The following patterns are considered warnings: + +```scss +%myriad { display: flex; } +``` + +```scss +%foo-bar { + &-supa { display: flex; } /* %foo-bar matches, but %foo-bar-supa doesn't */ +} +``` + +```scss +%foo- { /* %foo- on the 1st leves doesn't match */ + &bar { display: flex; } +} +``` + +The following patterns are *not* considered warnings: + +```scss +%foo-aimp { display: flex; } +``` + +```scss +%foo-bar { + &lignt { display: flex; } +} +``` + +```scss +.p { + @extend %mathy; // The rule only checks placeholder definitions +} +``` diff --git a/node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/index.js b/node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/index.js new file mode 100644 index 000000000..767e2e741 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/index.js @@ -0,0 +1,101 @@ +"use strict"; + +const resolveNestedSelector = require("postcss-resolve-nested-selector"); +const { utils } = require("stylelint"); +const { isRegExp, isString } = require("../../utils/validateTypes"); +const hasInterpolatingAmpersand = require("../../utils/hasInterpolatingAmpersand"); +const isStandardRule = require("../../utils/isStandardRule"); +const isStandardSelector = require("../../utils/isStandardSelector"); +const parseSelector = require("../../utils/parseSelector"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("percent-placeholder-pattern"); + +const messages = utils.ruleMessages(ruleName, { + expected: placeholder => + `Expected %-placeholder "%${placeholder}" to match specified pattern` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(pattern) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: pattern, + possible: [isRegExp, isString] + }); + + if (!validOptions) { + return; + } + + const placeholderPattern = isString(pattern) + ? new RegExp(pattern) + : pattern; + + // Checking placeholder definitions (looking among regular rules) + root.walkRules(rule => { + const { selector } = rule; + + // Just a shorthand for calling `parseSelector` + function parse(selector) { + parseSelector(selector, result, rule, s => checkSelector(s, rule)); + } + + // If it's a custom prop or a less mixin + if (!isStandardRule(rule)) { + return; + } + + // If the selector has interpolation + if (!isStandardSelector(selector)) { + return; + } + + // Nested selectors are processed in steps, as nesting levels are resolved. + // Here we skip processing intermediate parts of selectors (to process only fully resolved selectors) + // if (rule.nodes.some(node => node.type === "rule" || node.type === "atrule")) { return } + + // Only resolve selectors that have an interpolating "&" + if (hasInterpolatingAmpersand(selector)) { + resolveNestedSelector(selector, rule).forEach(parse); + } else { + parse(selector); + } + }); + + function checkSelector(fullSelector, rule) { + // postcss-selector-parser gives %placeholders' nodes a "tag" type + fullSelector.walkTags(compoundSelector => { + const { value, sourceIndex } = compoundSelector; + + if (value[0] !== "%") { + return; + } + + const placeholder = value.slice(1); + + if (placeholderPattern.test(placeholder)) { + return; + } + + utils.report({ + result, + ruleName, + message: messages.expected(placeholder), + node: rule, + index: sourceIndex + }); + }); + } + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/selector-nest-combinators/README.md b/node_modules/stylelint-scss/src/rules/selector-nest-combinators/README.md new file mode 100644 index 000000000..8c6f94dfc --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/selector-nest-combinators/README.md @@ -0,0 +1,221 @@ +# selector-nest-combinators + +Require or disallow nesting of combinators in selectors + +```scss +/* Examples of selectors without nesting of combinators */ +.foo .bar {} + +.foo.bar {} + +.foo > .bar {} + +.foo:hover {} + +/* Corresponding selectors with combinators nested */ +.foo { + .bar {} +} + +.foo { + &.bar {} +} + +.foo { + & > .bar {} +} + +.foo { + &:hover {} +} +``` + +## Options + +`string`: `"always"|"never"` + +### `"always"` + +*Every combinator* in a selector *must be* nested where possible without altering the existing resolved selector. + +Sections of selectors preceding a parent selector are ignored with `always`. +e.g. + +```scss +.foo { + .bar.baz & {} +} +``` + +Sections of selectors within pseudo selectors are also ignored with `always`. +e.g. + +```scss +.foo { + &:not(.bar .baz) {} +} +``` + +while this could be refactored to: + +```scss +.bar { + .baz { + .foo:not(&) {} + } +} +``` + +There are variances in the way this is compiled between compilers, therefore for the purposes of this rule the selector sections within pseudo selectors are being ignored. + +The following patterns are considered warnings: + +```scss +.foo .bar {} +``` + +```scss +.foo.bar {} +``` + +```scss +.foo > .bar {} +``` + +```scss +.foo:hover {} +``` + +```scss +a[href] {} +``` + +```scss +* + li {} +``` + +```scss +:nth-child(2n - 1):last-child {} +``` + +The following patterns are *not* considered warnings: + +```scss +.foo { + .bar {} +} +``` + +```scss +.foo { + &.bar {} +} +``` + +```scss +.foo { + & > .bar {} +} +``` + +```scss +.foo { + &:hover {} +} +``` + +```scss +a { + &[href] {} +} +``` + +```scss +* { + & + li {} +} +``` + +```scss +:nth-child(2n - 1) { + &:last-child {} +} +``` + +### `"never"` + +Nested of selectors are not allowed. + +The following patterns are considered warnings: + +```scss +.foo { + .bar {} +} +``` + +```scss +.foo { + &.bar {} +} +``` + +```scss +.foo { + & > .bar {} +} +``` + +```scss +.foo { + &:hover {} +} +``` + +```scss +a { + &[href] {} +} +``` + +```scss +* { + & + li {} +} +``` + +```scss +:nth-child(2n - 1) { + &:last-child {} +} +``` + +The following patterns are *not* considered warnings: + +```scss +.foo .bar {} +``` + +```scss +.foo.bar {} +``` + +```scss +.foo > .bar {} +``` + +```scss +.foo:hover {} +``` + +```scss +a[href] {} +``` + +```scss +* + li {} +``` + +```scss +:nth-child(2n - 1):last-child {} +``` diff --git a/node_modules/stylelint-scss/src/rules/selector-nest-combinators/index.js b/node_modules/stylelint-scss/src/rules/selector-nest-combinators/index.js new file mode 100644 index 000000000..05a546887 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/selector-nest-combinators/index.js @@ -0,0 +1,165 @@ +"use strict"; + +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const parseSelector = require("../../utils/parseSelector"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("selector-nest-combinators"); + +const messages = utils.ruleMessages(ruleName, { + expectedInterpolation: `Expected interpolation to be in a nested form`, + expected: (combinator, type) => + `Expected combinator "${combinator}" of type "${type}" to be in a nested form`, + rejected: `Unexpected nesting found in selector` +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(expectation) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { + actual: expectation, + possible: ["always", "never"] + }); + + if (!validOptions) { + return; + } + + function precedesParentSelector(current) { + do { + current = current.next(); + + if (current.type === "nesting") { + return true; + } + } while (current.next()); + + return false; + } + + // attribute, class, combinator, comment, id, nesting, pseudo, root, selector, string, tag, or universal + const chainingTypes = [ + "attribute", + "class", + "id", + "pseudo", + "tag", + "universal" + ]; + + const interpolationRe = /#{.+?}$/; + + root.walkRules(rule => { + if ( + rule.parent && + rule.parent.type === "atrule" && + rule.parent.name === "keyframes" + ) { + return; + } + + if (typeof rule.selector === "string") { + const isNestedProperty = rule.selector.slice(-1) === ":"; + + if (isNestedProperty) { + return; + } + } + + parseSelector(rule.selector, result, rule, fullSelector => { + let message; + + fullSelector.walk(node => { + if (node.value === "}") { + return; + } + + if (expectation === "always") { + if (node.type === "selector") { + return; + } + + if ( + node.parent && + node.parent.type === "selector" && + node.parent.parent && + node.parent.parent.type === "pseudo" + ) { + return; + } + + if (!node.prev()) { + return; + } + + if (node.next() && precedesParentSelector(node)) { + return; + } + + if (node.type === "combinator") { + if (node.next() && !chainingTypes.includes(node.next().type)) { + return; + } + + if (!chainingTypes.includes(node.prev().type)) { + return; + } + } + + if ( + chainingTypes.includes(node.type) && + !chainingTypes.includes(node.prev().type) + ) { + return; + } + + if ( + node.type !== "combinator" && + !chainingTypes.includes(node.type) + ) { + return; + } + + const hasInterpolation = interpolationRe.test(rule.selector); + + if (node.type !== "combinator" && hasInterpolation) { + return; + } + + if (hasInterpolation) { + message = messages.expectedInterpolation; + } else { + message = messages.expected(node.value, node.type); + } + } + + if (expectation === "never") { + if (rule.parent.type === "root" || rule.parent.type === "atrule") { + return; + } + + message = messages.rejected; + } + + utils.report({ + ruleName, + result, + node: rule, + message, + index: node.sourceIndex + }); + }); + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/README.md b/node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/README.md new file mode 100644 index 000000000..33bbf7f7c --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/README.md @@ -0,0 +1,115 @@ +# selector-no-redundant-nesting-selector + +Disallow redundant nesting selectors (`&`). + +```scss +p { + & a {} +//↑ +// This type of selector +} +``` + +The following patterns are considered warnings: + +```scss +p { + & a {} +} +``` + +```scss +p { + & > a {} +} +``` + +```scss +p { + & .class {} +} +``` + +```scss +p { + & + .foo {} +} +``` + +The following patterns are *not* considered warnings: + +```scss +p { + &.foo {} +} +``` + +```scss +p { + .foo > & {} +} +``` + +```scss +p { + &, + .foo, + .bar { + margin: 0; + } +} +``` + +## Options + +`ignoreKeywords`: `["/regex/", /regex/, "string"]` + +if you are using Less or some other non-SCSS syntax, the warnings can be disabled by using `ignoreKeywords` option. + +For example, you need to ignore the `when` keyword in `less`: + +```js +{ + rules: { + 'scss/selector-no-redundant-nesting-selector', [true, { ignoreKeywords: ['when'] }], + }, +} +``` + +The following patterns are *not* considered warnings: + +```less + @theme: ~'dark'; +p { + & when (@theme = dark) { + color: #000; + } + & when not(@theme = dark) { + color: #fff; + } +} +``` + +Conversely, if you do not use the `ignoreKeywords` option: + +```js +{ + rules: { + 'scss/selector-no-redundant-nesting-selector', true, + }, +} +``` + +The following patterns are considered warnings: + +```less + @theme: ~'dark'; +p { + & when (@theme = dark) { + color: #000; + } + & when not(@theme = dark) { + color: #fff; + } +} +``` diff --git a/node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/index.js b/node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/index.js new file mode 100644 index 000000000..02c76e8a0 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/index.js @@ -0,0 +1,92 @@ +"use strict"; + +const { utils } = require("stylelint"); +const optionsMatches = require("../../utils/optionsMatches"); +const hasNestedSibling = require("../../utils/hasNestedSibling"); +const isType = require("../../utils/isType"); +const parseSelector = require("../../utils/parseSelector"); +const { isRegExp, isString } = require("../../utils/validateTypes"); +const namespace = require("../../utils/namespace"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("selector-no-redundant-nesting-selector"); + +const messages = utils.ruleMessages(ruleName, { + rejected: "Unnecessary nesting selector (&)" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +function rule(actual, options) { + return (root, result) => { + const validOptions = utils.validateOptions( + result, + ruleName, + { actual }, + { + actual: options, + possible: { + ignoreKeywords: [isString, isRegExp] + }, + optional: true + } + ); + + if (!validOptions) { + return; + } + + root.walkRules(/&/, rule => { + parseSelector(rule.selector, result, rule, fullSelector => { + // "Ampersand followed by a combinator followed by non-combinator non-ampersand and not the selector end" + fullSelector.walkNesting(node => { + const prev = node.prev(); + + if (prev || hasNestedSibling(node)) { + return; + } + + const next = node.next(); + + if (!next && node.parent.parent.nodes.length > 1) { + return; + } + + if (next && next.type !== "combinator") { + return; + } + + const nextNext = next ? next.next() : null; + + if ( + (isType(nextNext, "tag") && + optionsMatches( + options, + "ignoreKeywords", + nextNext.value.trim() + )) || + isType(nextNext, "combinator") + ) { + return; + } + + utils.report({ + ruleName, + result, + node: rule, + message: messages.rejected, + index: node.sourceIndex + }); + }); + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/selector-no-union-class-name/README.md b/node_modules/stylelint-scss/src/rules/selector-no-union-class-name/README.md new file mode 100644 index 000000000..ef773c949 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/selector-no-union-class-name/README.md @@ -0,0 +1,46 @@ +# selector-no-union-class-name + +Disallow union class names with the parent selector (`&`). + +```scss +.class { + &-union { +//↑ +// This type usage of `&` + } +} +``` + +The following patterns are considered warnings: + +```scss +.class { + &-union {} +} +``` + +```scss +.class { + &_union {} +} +``` + +```scss +.class { + &union {} +} +``` + +The following patterns are *not* considered warnings: + +```scss +.class { + &.foo {} +} +``` + +```scss +.class { + & p {} +} +``` diff --git a/node_modules/stylelint-scss/src/rules/selector-no-union-class-name/index.js b/node_modules/stylelint-scss/src/rules/selector-no-union-class-name/index.js new file mode 100644 index 000000000..d510f9ad5 --- /dev/null +++ b/node_modules/stylelint-scss/src/rules/selector-no-union-class-name/index.js @@ -0,0 +1,103 @@ +"use strict"; + +const { + isAttribute, + isClassName, + isCombinator, + isIdentifier, + isPseudoClass, + isPseudoElement +} = require("postcss-selector-parser"); +const { utils } = require("stylelint"); +const namespace = require("../../utils/namespace"); +const parseSelector = require("../../utils/parseSelector"); +const ruleUrl = require("../../utils/ruleUrl"); + +const ruleName = namespace("selector-no-union-class-name"); + +const messages = utils.ruleMessages(ruleName, { + rejected: "Unexpected union class name with the parent selector (&)" +}); + +const meta = { + url: ruleUrl(ruleName) +}; + +const validNestingTypes = [ + isClassName, + isCombinator, + isAttribute, + isIdentifier, + isPseudoClass, + isPseudoElement +]; + +function rule(actual) { + return (root, result) => { + const validOptions = utils.validateOptions(result, ruleName, { actual }); + + if (!validOptions) { + return; + } + + root.walkRules(/&/, rule => { + const parentNodes = []; + + const selector = getSelectorFromRule(rule.parent); + + if (selector) { + parseSelector(selector, result, rule, fullSelector => { + fullSelector.walk(node => parentNodes.push(node)); + }); + } + + if (parentNodes.length === 0) return; + + const lastParentNode = parentNodes[parentNodes.length - 1]; + + if (!isClassName(lastParentNode)) return; + + parseSelector(rule.selector, result, rule, fullSelector => { + fullSelector.walkNesting(node => { + const next = node.next(); + + if (!next) return; + + if (validNestingTypes.some(isType => isType(next))) return; + + utils.report({ + ruleName, + result, + node: rule, + message: messages.rejected, + index: node.sourceIndex + }); + }); + }); + }); + }; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; + +/** + * Searches for the closest rule which + * has a selector and returns the selector + * @returns {string|undefined} + */ +function getSelectorFromRule(rule) { + // All non at-rules have their own selector + if (rule.selector !== undefined) { + return rule.selector; + } + + // At-rules like @mixin don't have a selector themself + // but their parents might have one + if (rule.parent) { + return getSelectorFromRule(rule.parent); + } +} + +module.exports = rule; diff --git a/node_modules/stylelint-scss/src/utils/addEmptyLineBefore.js b/node_modules/stylelint-scss/src/utils/addEmptyLineBefore.js new file mode 100644 index 000000000..a962b0a6b --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/addEmptyLineBefore.js @@ -0,0 +1,15 @@ +"use strict"; + +// Add an empty line before a node. Mutates the node. +module.exports = function addEmptyLineBefore( + node /*: postcss$node*/, + newline /*: '\n' | '\r\n'*/ +) /*: postcss$node*/ { + if (!/\r?\n/.test(node.raws.before)) { + node.raws.before = newline.repeat(2) + node.raws.before; + } else { + node.raws.before = node.raws.before.replace(/(\r?\n)/, `${newline}$1`); + } + + return node; +}; diff --git a/node_modules/stylelint-scss/src/utils/atRuleBaseName.js b/node_modules/stylelint-scss/src/utils/atRuleBaseName.js new file mode 100644 index 000000000..c8b807b8b --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/atRuleBaseName.js @@ -0,0 +1,11 @@ +"use strict"; + +/** + * Get an at rule's base name + * + * @param {AtRule} atRule + * @return {string} The name + */ +module.exports = function (atRule) { + return atRule.params.replace(/\([^)]*\)/, "").trim(); +}; diff --git a/node_modules/stylelint-scss/src/utils/atRuleParamIndex.js b/node_modules/stylelint-scss/src/utils/atRuleParamIndex.js new file mode 100644 index 000000000..a68a12620 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/atRuleParamIndex.js @@ -0,0 +1,18 @@ +"use strict"; + +/** + * Get the index of a media query's params + * + * @param {AtRule} atRule + * @return {int} The index + */ +module.exports = function (atRule) { + // Initial 1 is for the `@` + let index = 1 + atRule.name.length; + + if (atRule.raw("afterName")) { + index += atRule.raw("afterName").length; + } + + return index; +}; diff --git a/node_modules/stylelint-scss/src/utils/beforeBlockString.js b/node_modules/stylelint-scss/src/utils/beforeBlockString.js new file mode 100644 index 000000000..4552d1538 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/beforeBlockString.js @@ -0,0 +1,39 @@ +"use strict"; + +/** + * Given a CSS statement, return the string before the block. + * For rules, this is the selector list (and surrounding whitespace). + * For at-rules, this is the name and params (and surrounding whitespace). + * + * If there is no block, return empty string. + * + * @param {Rule|AtRule} statement - postcss rule or at-rule node + * @param {object} options + * @param {boolean} [options.noRawBefore] - Leave out the `before` string + * @return {string} + */ +module.exports = function (statement, { noRawBefore } = {}) { + let result = ""; + + if (statement.type !== "rule" && statement.type !== "atrule") { + return result; + } + + if (!noRawBefore) { + result += statement.raws.before; + } + + if (statement.type === "rule") { + result += statement.selector; + } else { + result += `@${statement.name}${statement.raws.afterName}${statement.params}`; + } + + const between = statement.raws.between; + + if (between !== undefined) { + result += between; + } + + return result; +}; diff --git a/node_modules/stylelint-scss/src/utils/blockString.js b/node_modules/stylelint-scss/src/utils/blockString.js new file mode 100644 index 000000000..d2f0e4b3e --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/blockString.js @@ -0,0 +1,22 @@ +"use strict"; + +const beforeBlockString = require("./beforeBlockString"); +const hasBlock = require("./hasBlock"); +const rawNodeString = require("./rawNodeString"); + +/** + * Return a CSS statement's block -- the string that starts with `{` and ends with `}`. + * + * If the statement has no block (e.g. `@import url(foo.css);`), + * return undefined. + * + * @param {Rule|AtRule} statement - postcss rule or at-rule node + * @return {string|undefined} + */ +module.exports = function (statement) { + if (!hasBlock(statement)) { + return; + } + + return rawNodeString(statement).slice(beforeBlockString(statement).length); +}; diff --git a/node_modules/stylelint-scss/src/utils/configurationError.js b/node_modules/stylelint-scss/src/utils/configurationError.js new file mode 100644 index 000000000..1e3c6b7d9 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/configurationError.js @@ -0,0 +1,15 @@ +"use strict"; + +/** + * Create configurationError from text and set CLI exit code + * + * @param {string} text + * @return {Error} - The error, with text and exit code + */ +module.exports = function (text) { + const err = new Error(text); + + err.code = 78; + + return err; +}; diff --git a/node_modules/stylelint-scss/src/utils/declarationValueIndex.js b/node_modules/stylelint-scss/src/utils/declarationValueIndex.js new file mode 100644 index 000000000..5f573eab8 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/declarationValueIndex.js @@ -0,0 +1,15 @@ +"use strict"; + +/** + * Get the index of a declaration's value + * + * @param {Decl} decl + * @return {int} The index + */ +module.exports = function (decl) { + const beforeColon = decl.toString().indexOf(":"); + const afterColon = + decl.raw("between").length - decl.raw("between").indexOf(":"); + + return beforeColon + afterColon; +}; diff --git a/node_modules/stylelint-scss/src/utils/eachRoot.js b/node_modules/stylelint-scss/src/utils/eachRoot.js new file mode 100644 index 000000000..7d1923cec --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/eachRoot.js @@ -0,0 +1,18 @@ +"use strict"; + +/** + * Executes a provided function once for each CSS block element. + * + * @param {Root|Document} root - root element of file. + * @param {function} cb - Function to execute for each CSS block element + */ +module.exports = function (root, cb) { + // class `Document` is a part of `postcss-html`, + // It is collection of roots in HTML File. + // See: https://github.com/gucong3000/postcss-html/blob/master/lib/document.js + if (root.constructor.name === "Document") { + root.nodes.forEach(cb); + } else { + cb(root); + } +}; diff --git a/node_modules/stylelint-scss/src/utils/findCommentsInRaws.js b/node_modules/stylelint-scss/src/utils/findCommentsInRaws.js new file mode 100644 index 000000000..e9183d929 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/findCommentsInRaws.js @@ -0,0 +1,241 @@ +"use strict"; + +/** + * Finds comments, both CSS comments and double slash ones, in a CSS string + * This helper exists because PostCSS drops some inline comments (those + * between selectors, property values, etc.) + * https://github.com/postcss/postcss/issues/845#issuecomment-232306259 + * + * @param {string} rawString -- the source raw CSS string + * @return {array} array of objects with these props: + * � type -- "css" or "double-slash" + * � source: { start, end } + * IMPORTANT: the function itself considers \r as a character, and counts + * it for `start` and `end`. But if their values are passed to PostCSS's + * result.warn(), than "\r\n" is consideren ONE CHAR (newline)! + * � raws + * raws.startToken -- `/*`, `/**`, `/**!`, etc. + * raws.left -- whitespace after the comment opening marker + * raws.text -- the full comment, including markers (//, /*) + * raws.right -- whitespace before the comment closing marker + * raws.endToken -- `*\/`, `**\/` for CSS comments + * � text -- the comment text only, excluding //, /*, trailing whitespaces + * � inlineAfter -- true, if there is something before the comment on + * the same line + * � inlineBefore -- true, if there is something after the comment on + * the same line + */ + +module.exports = function findCommentsInRaws(rawString) { + const result = []; + let comment = {}; + // Keeps track of which structure the parser is inside (string, comment, + // url function, parens). E.g., /* comment */ inside a string doesn't + // constitute a comment, so as url(//path) + const modesEntered = [ + { + mode: "normal", + character: null + } + ]; + let commentStart = null; + + // postcss-scss transforms //-comments into CSS comments, like so: + // `// comment` -> `/* comment*/`. So to have a correct intex we need to + // keep track on the added `*/` sequences + let offset = 0; + + for (let i = 0; i < rawString.length; i++) { + const character = rawString[i]; + const prevChar = i > 0 ? rawString[i - 1] : null; + const nextChar = i + 1 < rawString.length ? rawString[i + 1] : null; + + const lastModeIndex = modesEntered.length - 1; + const mode = + modesEntered[lastModeIndex] && modesEntered[lastModeIndex].mode; + + switch (character) { + // If entering/exiting a string + case '"': + case "'": { + if (mode === "comment") { + break; + } + + if ( + mode === "string" && + modesEntered[lastModeIndex].character === character && + prevChar !== "\\" + ) { + // Exiting a string + modesEntered.pop(); + } else { + // Entering a string + modesEntered.push({ + mode: "string", + character + }); + } + + break; + } + // Entering url, other function or parens (only url matters) + case "(": { + if (mode === "comment" || mode === "string") { + break; + } + + const functionNameRegSearch = + /(?:^|[\n\r]|\s-|[:\s,.(){}*+/%])([\w-]*)$/.exec( + rawString.substring(0, i) + ); + + // A `\S(` can be in, say, `@media(` + if (!functionNameRegSearch) { + modesEntered.push({ + mode: "parens", + character: "(" + }); + break; + } + + const functionName = functionNameRegSearch[1]; + + modesEntered.push({ + mode: functionName === "url" ? "url" : "parens", + character: "(" + }); + break; + } + // Exiting url, other function or parens + case ")": { + if (mode === "comment" || mode === "string") { + break; + } + + modesEntered.pop(); + break; + } + // checking for comment + case "/": { + // Break if the / is inside a comment because we leap over the second + // slash in // and in */, so the / is not from a marker. Also break + // if inside a string + if (mode === "comment" || mode === "string") { + break; + } + + if (nextChar === "*") { + modesEntered.push({ + mode: "comment", + character: "/*" + }); + comment = { + type: "css", + source: { start: i + offset }, + // If i is 0 then the file/the line starts with this comment + inlineAfter: + i > 0 && rawString.substring(0, i).search(/\n\s*$/) === -1 + }; + commentStart = i; + // Skip the next iteration as the * is already checked + i++; + } else if (nextChar === "/") { + // `url(//path/to/file)` has no comment + if (mode === "url") { + break; + } + + modesEntered.push({ + mode: "comment", + character: "//" + }); + comment = { + type: "double-slash", + source: { start: i + offset }, + // If i is 0 then the file/the line starts with this comment + inlineAfter: + i > 0 && rawString.substring(0, i).search(/\n\s*$/) === -1 + }; + commentStart = i; + // Skip the next iteration as the second slash in // is already checked + i++; + } + + break; + } + // Might be a closing `*/` + case "*": { + if ( + mode === "comment" && + modesEntered[lastModeIndex].character === "/*" && + nextChar === "/" + ) { + comment.source.end = i + 1 + offset; + + const commentRaw = rawString.substring(commentStart, i + 2); + const matches = /^(\/\*+[!#]?)(\s*)([\s\S]*?)(\s*)(\*+\/)$/.exec( + commentRaw + ); + + modesEntered.pop(); + comment.raws = { + startToken: matches[1], + left: matches[2], + text: commentRaw, + right: matches[4], + endToken: matches[5] + }; + comment.text = matches[3]; + comment.inlineBefore = + rawString.substring(i + 2).search(/^\s*\S+\s*?\n/) !== -1; + result.push(Object.assign({}, comment)); + comment = {}; + // Skip the next loop as the / in */ is already checked + i++; + } + + break; + } + default: { + const isNewline = + (character === "\r" && rawString[i + 1] === "\n") || + (character === "\n" && rawString[i - 1] !== "\r"); + + // //-comments end before newline and if the code string ends + if (isNewline || i === rawString.length - 1) { + if ( + mode === "comment" && + modesEntered[lastModeIndex].character === "//" + ) { + comment.source.end = (isNewline ? i - 1 : i) + offset; + + const commentRaw = rawString.substring( + commentStart, + isNewline ? i : i + 1 + ); + const matches = /^(\/+)(\s*)(.*?)(\s*)$/.exec(commentRaw); + + modesEntered.pop(); + comment.raws = { + startToken: matches[1], + left: matches[2], + text: commentRaw, + right: matches[4] + }; + comment.text = matches[3]; + comment.inlineBefore = false; + result.push(Object.assign({}, comment)); + comment = {}; + // Compensate for the `*/` added by postcss-scss + offset += 2; + } + } + + break; + } + } + } + + return result; +}; diff --git a/node_modules/stylelint-scss/src/utils/functions.js b/node_modules/stylelint-scss/src/utils/functions.js new file mode 100644 index 000000000..24f61ae03 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/functions.js @@ -0,0 +1,257 @@ +"use strict"; + +/** + * @see https://sass-lang.com/documentation/modules#global-functions + */ +const GLOBAL_FUNCTIONS = Object.freeze(["hsl", "hsla", "if", "rgb", "rgba"]); + +/** + * @see https://sass-lang.com/documentation/modules/color + */ +const COLOR_FUNCTIONS = Object.freeze([ + "adjust-color", + "adjust-hue", + "alpha", + "blackness", + "blue", + "change-color", + "complement", + "darken", + "desaturate", + "fade-in", + "fade-out", + "grayscale", + "green", + "hue", + "ie-hex-str", + "invert", + "lighten", + "lightness", + "mix", + "opacity", + "red", + "saturate", + "saturation", + "scale-color", + "transparentize", + + // with namespace + "color.adjust", + "color.alpha", + "color.blackness", + "color.blue", + "color.change", + "color.complement", + "color.grayscale", + "color.green", + "color.hue", + "color.hwb", + "color.ie-hex-str", + "color.invert", + "color.lightness", + "color.mix", + "color.red", + "color.saturation", + "color.scale", + "color.whiteness" +]); + +/** + * @see https://sass-lang.com/documentation/modules/list + */ +const LIST_FUNCTIONS = Object.freeze([ + "append", + "index", + "is-bracketed", + "join", + "length", + "list-separator", + "nth", + "set-nth", + "list.zip", + + // with namespace + "list.append", + "list.index", + "list.is-bracketed", + "list.join", + "list.length", + "list.nth", + "list.separator", + "list.set-nth", + "list.slash", + "zip" +]); + +/** + * @see https://sass-lang.com/documentation/modules/map + */ +const MAP_FUNCTIONS = Object.freeze([ + "map-get", + "map-has-key", + "map-keys", + "map-merge", + "map-remove", + "map-values", + + // with namespace + "map.deep-merge", + "map.deep-remove", + "map.get", + "map.has-key", + "map.keys", + "map.merge", + "map.remove", + "map.set", + "map.values" +]); + +/** + * @see https://sass-lang.com/documentation/modules/math + */ +const MATH_FUNCTIONS = Object.freeze([ + "abs", + "ceil", + "comparable", + "floor", + "max", + "min", + "percentage", + "random", + "round", + "unit", + "unitless", + + // with namespace + "math.abs", + "math.acos", + "math.asin", + "math.atan", + "math.atan2", + "math.ceil", + "math.clamp", + "math.compatible", + "math.cos", + "math.div", + "math.floor", + "math.hypot", + "math.is-unitless", + "math.log", + "math.max", + "math.min", + "math.percentage", + "math.pow", + "math.random", + "math.round", + "math.sin", + "math.sqrt", + "math.tan", + "math.unit" +]); + +/** + * @see https://sass-lang.com/documentation/modules/meta + */ +const META_FUNCTIONS = Object.freeze([ + "call", + "content-exists", + "feature-exists", + "function-exists", + "get-function", + "global-variable-exists", + "inspect", + "keywords", + "mixin-exists", + "type-of", + "variable-exists", + + // with namespace + "meta.calc-args", + "meta.calc-name", + "meta.call", + "meta.content-exists", + "meta.feature-exists", + "meta.function-exists", + "meta.get-function", + "meta.global-variable-exists", + "meta.inspect", + "meta.keywords", + "meta.mixin-exists", + "meta.module-functions", + "meta.module-variables", + "meta.type-of", + "meta.variable-exists" +]); + +/** + * @see https://sass-lang.com/documentation/modules/selector + */ +const SELECTOR_FUNCTIONS = Object.freeze([ + "is-superselector", + "selector-append", + "selector-extend", + "selector-nest", + "selector-parse", + "selector-replace", + "selector-unify", + "simple-selectors", + + // with namespace + "selector.append", + "selector.extend", + "selector.is-superselector", + "selector.nest", + "selector.parse", + "selector.replace", + "selector.simple-selectors", + "selector.unify" +]); + +/** + * @see https://sass-lang.com/documentation/modules/string + */ +const STRING_FUNCTIONS = Object.freeze([ + "quote", + "str-index", + "str-insert", + "str-length", + "str-slice", + "to-lower-case", + "to-upper-case", + "unique-id", + "unquote", + + // with namespace + "string.index", + "string.insert", + "string.length", + "string.quote", + "string.slice", + "string.to-lower-case", + "string.to-upper-case", + "string.unique-id", + "string.unquote" +]); + +const ALL_FUNCTIONS = Object.freeze([ + ...GLOBAL_FUNCTIONS, + ...COLOR_FUNCTIONS, + ...LIST_FUNCTIONS, + ...MAP_FUNCTIONS, + ...MATH_FUNCTIONS, + ...META_FUNCTIONS, + ...SELECTOR_FUNCTIONS, + ...STRING_FUNCTIONS +]); + +module.exports = { + GLOBAL_FUNCTIONS, + COLOR_FUNCTIONS, + LIST_FUNCTIONS, + MAP_FUNCTIONS, + MATH_FUNCTIONS, + META_FUNCTIONS, + SELECTOR_FUNCTIONS, + STRING_FUNCTIONS, + ALL_FUNCTIONS +}; diff --git a/node_modules/stylelint-scss/src/utils/hasBlock.js b/node_modules/stylelint-scss/src/utils/hasBlock.js new file mode 100644 index 000000000..e2d3b37e8 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/hasBlock.js @@ -0,0 +1,11 @@ +"use strict"; + +/** + * Check if a statement has an block (empty or otherwise). + * + * @param {Rule|AtRule} statement - postcss rule or at-rule node + * @return {boolean} True if `statement` has a block (empty or otherwise) + */ +module.exports = function (statement) { + return statement.nodes !== undefined; +}; diff --git a/node_modules/stylelint-scss/src/utils/hasEmptyLine.js b/node_modules/stylelint-scss/src/utils/hasEmptyLine.js new file mode 100644 index 000000000..f7a5afa8a --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/hasEmptyLine.js @@ -0,0 +1,11 @@ +"use strict"; + +/** + * Check if a string contains at least one empty line + * + * @param {string} string + * @return {boolean} + */ +module.exports = function (string) { + return string && (string.includes("\n\n") || string.includes("\n\r\n")); +}; diff --git a/node_modules/stylelint-scss/src/utils/hasInterpolatingAmpersand.js b/node_modules/stylelint-scss/src/utils/hasInterpolatingAmpersand.js new file mode 100644 index 000000000..ac91964c2 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/hasInterpolatingAmpersand.js @@ -0,0 +1,32 @@ +"use strict"; + +/** + * Check whether a selector has an interpolating ampersand + * An "interpolating ampersand" is an "&" used to interpolate within another + * simple selector (e.g. `&-modifier`), rather than an "&" that stands + * on its own as a simple selector (e.g. `& .child`) + * + * @param {string} selector + * @return {boolean} If `true`, the selector has an interpolating ampersand + */ +module.exports = function (selector) { + for (let i = 0; i < selector.length; i++) { + if (selector[i] !== "&") { + continue; + } + + if (selector[i - 1] !== undefined && !isCombinator(selector[i - 1])) { + return true; + } + + if (selector[i + 1] !== undefined && !isCombinator(selector[i + 1])) { + return true; + } + } + + return false; +}; + +function isCombinator(x) { + return /[\s+>~]/.test(x); +} diff --git a/node_modules/stylelint-scss/src/utils/hasInterpolation.js b/node_modules/stylelint-scss/src/utils/hasInterpolation.js new file mode 100644 index 000000000..dcd0ad20a --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/hasInterpolation.js @@ -0,0 +1,22 @@ +"use strict"; + +const hasLessInterpolation = require("./hasLessInterpolation"); +const hasPsvInterpolation = require("./hasPsvInterpolation"); +const hasScssInterpolation = require("./hasScssInterpolation"); +const hasTplInterpolation = require("./hasTplInterpolation"); + +/** + * Check whether a string has interpolation + * + * @param {string} string + * @return {boolean} If `true`, a string has interpolation + */ +module.exports = function (string) { + // SCSS or Less interpolation + return !!( + hasLessInterpolation(string) || + hasScssInterpolation(string) || + hasTplInterpolation(string) || + hasPsvInterpolation(string) + ); +}; diff --git a/node_modules/stylelint-scss/src/utils/hasLessInterpolation.js b/node_modules/stylelint-scss/src/utils/hasLessInterpolation.js new file mode 100644 index 000000000..bb4e82f43 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/hasLessInterpolation.js @@ -0,0 +1,11 @@ +"use strict"; + +/** + * Check whether a string has less interpolation + * + * @param {string} string + * @return {boolean} If `true`, a string has less interpolation + */ +module.exports = function (string) { + return /@{.+?}/.test(string); +}; diff --git a/node_modules/stylelint-scss/src/utils/hasNestedSibling.js b/node_modules/stylelint-scss/src/utils/hasNestedSibling.js new file mode 100644 index 000000000..5860a8a43 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/hasNestedSibling.js @@ -0,0 +1,13 @@ +"use strict"; + +/** + * Determines whether a given node has nested sibling. + * + * @param {import('postcss').Node} node + * @return {boolean} + */ +module.exports = function (node) { + return ( + node && node.parent.nodes.some(n => n !== node && n.type === "nesting") + ); +}; diff --git a/node_modules/stylelint-scss/src/utils/hasPsvInterpolation.js b/node_modules/stylelint-scss/src/utils/hasPsvInterpolation.js new file mode 100644 index 000000000..95a524ce1 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/hasPsvInterpolation.js @@ -0,0 +1,10 @@ +"use strict"; + +/** + * Check whether a string has postcss-simple-vars interpolation + * + * @param {string} string + */ +module.exports = function (string) { + return /\$\(.+?\)/.test(string); +}; diff --git a/node_modules/stylelint-scss/src/utils/hasScssInterpolation.js b/node_modules/stylelint-scss/src/utils/hasScssInterpolation.js new file mode 100644 index 000000000..58ed69ae0 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/hasScssInterpolation.js @@ -0,0 +1,10 @@ +"use strict"; + +/** + * Check whether a string has scss interpolation + * + * @param {string} string + */ +module.exports = function (string) { + return /#{.+?}/.test(string); +}; diff --git a/node_modules/stylelint-scss/src/utils/hasTplInterpolation.js b/node_modules/stylelint-scss/src/utils/hasTplInterpolation.js new file mode 100644 index 000000000..6a93295d4 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/hasTplInterpolation.js @@ -0,0 +1,11 @@ +"use strict"; + +/** + * Check whether a string has JS template literal interpolation or HTML-like template + * + * @param {string} string + * @return {boolean} If `true`, a string has template literal interpolation + */ +module.exports = function (string) { + return /{.+?}/.test(string); +}; diff --git a/node_modules/stylelint-scss/src/utils/isCustomPropertySet.js b/node_modules/stylelint-scss/src/utils/isCustomPropertySet.js new file mode 100644 index 000000000..46937229e --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/isCustomPropertySet.js @@ -0,0 +1,19 @@ +"use strict"; + +/** + * Check whether a Node is a custom property set + * + * @param {import('postcss').Rule} node + * @returns {boolean} + */ +module.exports = function (node) { + const prop = node?.raws?.prop?.raw || node.prop; + const value = node?.raws?.value?.raw || node.value; + + return ( + node.type === "decl" && + prop.startsWith("--") && + value.startsWith("{") && + value.endsWith("}") + ); +}; diff --git a/node_modules/stylelint-scss/src/utils/isInlineComment.js b/node_modules/stylelint-scss/src/utils/isInlineComment.js new file mode 100644 index 000000000..5ee37e42e --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/isInlineComment.js @@ -0,0 +1,20 @@ +"use strict"; + +/** + * Check if a comment is inline one (i.e. on the same line as some non-comment + * code). Only works with comments that are not ignored by PostCSS. To work + * with those that are ignored use `findCommentInRaws` + * + * @param {Comment} comment - PostCSS comment node + * @return {boolean} true, if the comment is an inline one + */ +module.exports = function isInlineComment(comment) { + const nextNode = comment.next(); + const isBeforeSomething = + !!nextNode && + nextNode.type !== "comment" && + comment.source.end.line === nextNode.source.start.line; + const isAfterSomething = comment.raws.before.search(/\n/) === -1; + + return isAfterSomething || isBeforeSomething; +}; diff --git a/node_modules/stylelint-scss/src/utils/isNativeCssFunction.js b/node_modules/stylelint-scss/src/utils/isNativeCssFunction.js new file mode 100644 index 000000000..76c50a103 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/isNativeCssFunction.js @@ -0,0 +1,94 @@ +"use strict"; + +const nativeCssFunctions = new Set([ + "annotation", + "attr", + "blur", + "brightness", + "calc", + "character-variant", + "circle", + "contrast", + "cross-fade", + "cubic-bezier", + "drop-shadow", + "element", + "ellipse", + "fit-content", + "format", + "frames", + "grayscale", + "hsl", + "hsla", + "hue-rotate", + "image", + "image-set", + "inset", + "invert", + "leader", + "linear-gradient", + "local", + "matrix", + "matrix3d", + "minmax", + "opacity", + "ornaments", + "perspective", + "polygon", + "radial-gradient", + "rect", + "repeat", + "repeating-linear-gradient", + "repeating-radial-gradient", + "rgb", + "rgba", + "rotate", + "rotate3d", + "rotateX", + "rotatex", + "rotateY", + "rotatey", + "rotateZ", + "rotatez", + "saturate", + "scale", + "scale3d", + "scaleX", + "scalex", + "scaleY", + "scaley", + "scaleZ", + "scalez", + "sepia", + "skew", + "skewX", + "skewY", + "steps", + "styleset", + "stylistic", + "swash", + "symbols", + "target-counter", + "target-counters", + "target-text", + "translate", + "translate3d", + "translateX", + "translatex", + "translateY", + "translatey", + "translateZ", + "translatez", + "url", + "var" +]); + +/** + * Check if a function name is a native CSS function name. + * + * @param {string} functionName The name to check. + * @returns {boolean} Whether or not the given function name is a native CSS function name. + */ +module.exports = function isNativeCssFunction(functionName) { + return nativeCssFunctions.has(functionName); +}; diff --git a/node_modules/stylelint-scss/src/utils/isSingleLineString.js b/node_modules/stylelint-scss/src/utils/isSingleLineString.js new file mode 100644 index 000000000..e9696ffc8 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/isSingleLineString.js @@ -0,0 +1,12 @@ +"use strict"; + +/** + * Check if a string is a single line (i.e. does not contain + * any newline characters). + * + * @param {string} input + * @return {boolean} + */ +module.exports = function (input) { + return !/[\n\r]/.test(input); +}; diff --git a/node_modules/stylelint-scss/src/utils/isStandardRule.js b/node_modules/stylelint-scss/src/utils/isStandardRule.js new file mode 100644 index 000000000..0e2e51b0b --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/isStandardRule.js @@ -0,0 +1,65 @@ +"use strict"; + +const isCustomPropertySet = require("./isCustomPropertySet"); +const isStandardSyntaxSelector = require("./isStandardSelector"); + +/** + * Check whether a Node is a standard rule + * + * @param {import('postcss').Rule} rule + * @returns {boolean} + */ +module.exports = function (rule) { + // Get full selector + const selector = rule?.raws?.selector?.raw || rule.selector; + + if (!isStandardSyntaxSelector(rule.selector)) { + return false; + } + + // Custom property set (e.g. --custom-property-set: {}) + if (isCustomPropertySet(rule)) { + return false; + } + + // Called Less mixin (e.g. a { .mixin() }) + // @ts-ignore TODO TYPES support LESS and SASS types somehow + if (rule.mixin) { + return false; + } + + // Less detached rulesets + if (selector.startsWith("@") && selector.endsWith(":")) { + return false; + } + + // Ignore Less &:extend rule + // @ts-ignore TODO TYPES support LESS and SASS types somehow + if (rule.extend) { + return false; + } + + // Ignore mixin or &:extend rule + // https://github.com/shellscape/postcss-less/blob/master/lib/less-parser.js#L52 + // @ts-ignore TODO TYPES support LESS and SASS types somehow + if (rule.params && rule.params[0]) { + return false; + } + + // Non-outputting Less mixin definition (e.g. .mixin() {}) + if (selector.endsWith(")") && !selector.includes(":")) { + return false; + } + + // Less guards + if (/when\s+(not\s+)*\(/.test(selector)) { + return false; + } + + // Ignore Scss nested properties + if (selector.endsWith(":")) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint-scss/src/utils/isStandardSelector.js b/node_modules/stylelint-scss/src/utils/isStandardSelector.js new file mode 100644 index 000000000..221f30f25 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/isStandardSelector.js @@ -0,0 +1,23 @@ +"use strict"; + +const hasInterpolation = require("./hasInterpolation"); +const isStandardSyntaxSelector = require("./isStandardSyntaxSelector"); + +/** + * Check whether a selector is standard + * + * @param {string} selector + * @return {boolean} If `true`, the selector is standard + */ +module.exports = function (selector) { + const standardSyntaxSelector = isStandardSyntaxSelector(selector); + + // SCSS placeholder selectors + if (!standardSyntaxSelector) { + if (selector.indexOf("%") === 0 && !hasInterpolation(selector)) { + return true; + } + } + + return standardSyntaxSelector; +}; diff --git a/node_modules/stylelint-scss/src/utils/isStandardSyntaxProperty.js b/node_modules/stylelint-scss/src/utils/isStandardSyntaxProperty.js new file mode 100644 index 000000000..60e180181 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/isStandardSyntaxProperty.js @@ -0,0 +1,33 @@ +"use strict"; + +const hasInterpolation = require("./hasInterpolation"); + +/** + * Check whether a property is standard + * + * @param {string} property + * @returns {boolean} + */ +module.exports = function (property) { + // SCSS var (e.g. $var: x), list (e.g. $list: (x)) or map (e.g. $map: (key:value)) + if (property.startsWith("$")) { + return false; + } + + // Less var (e.g. @var: x) + if (property.startsWith("@")) { + return false; + } + + // Less append property value with space (e.g. transform+_: scale(2)) + if (property.endsWith("+") || property.endsWith("+_")) { + return false; + } + + // SCSS or Less interpolation + if (hasInterpolation(property)) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint-scss/src/utils/isStandardSyntaxSelector.js b/node_modules/stylelint-scss/src/utils/isStandardSyntaxSelector.js new file mode 100644 index 000000000..208e614e8 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/isStandardSyntaxSelector.js @@ -0,0 +1,38 @@ +"use strict"; + +const hasInterpolation = require("./hasInterpolation"); + +/** + * Check whether a selector is standard + * + * @param {string} selector + * @returns {boolean} + */ +module.exports = function (selector) { + // SCSS or Less interpolation + if (hasInterpolation(selector)) { + return false; + } + + // SCSS placeholder selectors + if (selector.startsWith("%")) { + return false; + } + + // Less :extend() + if (/:extend(\(.*?\))?/.test(selector)) { + return false; + } + + // Less mixin with resolved nested selectors (e.g. .foo().bar or .foo(@a, @b)[bar]) + if (/\.[\w-]+\(.*\).+/.test(selector)) { + return false; + } + + // ERB template tags + if (selector.includes("<%") || selector.includes("%>")) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint-scss/src/utils/isType.js b/node_modules/stylelint-scss/src/utils/isType.js new file mode 100644 index 000000000..28bc4f6ff --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/isType.js @@ -0,0 +1,12 @@ +"use strict"; + +/** + * Determine whether the given node is of the given type. + * + * @param {import('postcss').Node} node + * @param {string} type + * @return {boolean} + */ +module.exports = function (node, type) { + return node && node.type === type; +}; diff --git a/node_modules/stylelint-scss/src/utils/isWhitespace.js b/node_modules/stylelint-scss/src/utils/isWhitespace.js new file mode 100644 index 000000000..624c14cfc --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/isWhitespace.js @@ -0,0 +1,11 @@ +"use strict"; + +/** + * Check if a character is whitespace. + * + * @param {string} char - A single character + * @return {boolean} + */ +module.exports = function (char) { + return [" ", "\n", "\t", "\r", "\f"].includes(char); +}; diff --git a/node_modules/stylelint-scss/src/utils/matchesStringOrRegExp.js b/node_modules/stylelint-scss/src/utils/matchesStringOrRegExp.js new file mode 100644 index 000000000..67fce2864 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/matchesStringOrRegExp.js @@ -0,0 +1,94 @@ +"use strict"; + +/** + * Compares a string to a second value that, if it fits a certain convention, + * is converted to a regular expression before the comparison. + * If it doesn't fit the convention, then two strings are compared. + * + * Any strings starting and ending with `/` are interpreted + * as regular expressions. + * + * @param {string | Array} input + * @param {string | RegExp | Array} comparison + * + * @returns {false | {match: string, pattern: (string | RegExp), substring: string}} + */ +module.exports = function matchesStringOrRegExp(input, comparison) { + if (!Array.isArray(input)) { + return testAgainstStringOrRegExpOrArray(input, comparison); + } + + for (const inputItem of input) { + const testResult = testAgainstStringOrRegExpOrArray(inputItem, comparison); + + if (testResult) { + return testResult; + } + } + + return false; +}; + +/** + * @param {string} value + * @param {string | RegExp | Array} comparison + */ +function testAgainstStringOrRegExpOrArray(value, comparison) { + if (!Array.isArray(comparison)) { + return testAgainstStringOrRegExp(value, comparison); + } + + for (const comparisonItem of comparison) { + const testResult = testAgainstStringOrRegExp(value, comparisonItem); + + if (testResult) { + return testResult; + } + } + + return false; +} + +/** + * @param {string} value + * @param {string | RegExp} comparison + */ +function testAgainstStringOrRegExp(value, comparison) { + // If it's a RegExp, test directly + if (comparison instanceof RegExp) { + const match = value.match(comparison); + + return match + ? { match: value, pattern: comparison, substring: match[0] || "" } + : false; + } + + // Check if it's RegExp in a string + const firstComparisonChar = comparison[0]; + const lastComparisonChar = comparison[comparison.length - 1]; + const secondToLastComparisonChar = comparison[comparison.length - 2]; + + const comparisonIsRegex = + firstComparisonChar === "/" && + (lastComparisonChar === "/" || + (secondToLastComparisonChar === "/" && lastComparisonChar === "i")); + + const hasCaseInsensitiveFlag = + comparisonIsRegex && lastComparisonChar === "i"; + + // If so, create a new RegExp from it + if (comparisonIsRegex) { + const valueMatch = hasCaseInsensitiveFlag + ? value.match(new RegExp(comparison.slice(1, -2), "i")) + : value.match(new RegExp(comparison.slice(1, -1))); + + return valueMatch + ? { match: value, pattern: comparison, substring: valueMatch[0] || "" } + : false; + } + + // Otherwise, it's a string. Do a strict comparison + return value === comparison + ? { match: value, pattern: comparison, substring: value } + : false; +} diff --git a/node_modules/stylelint-scss/src/utils/moduleNamespace.js b/node_modules/stylelint-scss/src/utils/moduleNamespace.js new file mode 100644 index 000000000..141cccd2e --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/moduleNamespace.js @@ -0,0 +1,62 @@ +"use strict"; + +/** + * Returns the namespace of an imported module or `null` if the namespace is removed. + * + * Example: no import found, possibly using global function + * `@use "sass:color";` + * `moduleNamespace(root, 'sass:map')` returns 'map' + * + * Example: default namespace + * `@use "sass:map";` + * `moduleNamespace(root, 'sass:map')` returns `map` + * + * Example: custom namespace + * `@use "sass:map" as ns;` + * `moduleNamespace(root, 'sass:map')` returns 'ns' + * + * Example: no namespace + * `@use "sass:map" as *;` + * `moduleNamespace(root, 'sass:map')` returns `null` + * + * Have a look at the tests for more examples. + */ +module.exports = function moduleNamespace(root, module) { + let moduleNamespace = getDefaultNamespace(module); + + root.walkAtRules("use", rule => { + const customNamespace = getCustomNamespace(module, rule); + + switch (customNamespace) { + case null: + return; + case "*": + moduleNamespace = null; + return; + default: + moduleNamespace = customNamespace; + } + }); + + return moduleNamespace; +}; + +function getDefaultNamespace(module) { + return module.match(/([^/:]+)$/)[1].replace(/\.[^.]+$/, ""); +} + +function getCustomNamespace(module, rule) { + const ruleParamsParts = rule.params.split( + new RegExp(`["']${module}['"][ \n]*as`) + ); + + if (ruleParamsParts.length < 2) { + return null; + } + + const secondRuleParamsPart = ruleParamsParts[1].trim(); + + return !secondRuleParamsPart.startsWith("*") + ? secondRuleParamsPart.split(" ")[0] + : "*"; +} diff --git a/node_modules/stylelint-scss/src/utils/namespace.js b/node_modules/stylelint-scss/src/utils/namespace.js new file mode 100644 index 000000000..03ded56ee --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/namespace.js @@ -0,0 +1,7 @@ +"use strict"; + +const prefix = "scss"; + +module.exports = function namespace(ruleName) { + return `${prefix}/${ruleName}`; +}; diff --git a/node_modules/stylelint-scss/src/utils/optionsHaveException.js b/node_modules/stylelint-scss/src/utils/optionsHaveException.js new file mode 100644 index 000000000..00261419c --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/optionsHaveException.js @@ -0,0 +1,14 @@ +"use strict"; + +/** + * Check if an options object contains a certain `except` keyword. + * It will look for an `except` property whose value should + * be an array of keywords. + * + * @param {object} options + * @param {string} exceptionName + * @return {boolean} + */ +module.exports = function (options, exceptionName) { + return options && options.except && options.except.includes(exceptionName); +}; diff --git a/node_modules/stylelint-scss/src/utils/optionsHaveIgnored.js b/node_modules/stylelint-scss/src/utils/optionsHaveIgnored.js new file mode 100644 index 000000000..688b869d5 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/optionsHaveIgnored.js @@ -0,0 +1,14 @@ +"use strict"; + +/** + * Check if an options object contains a certain `ignore` keyword. + * It will look for an `ignore` property whose value should + * be an array of keywords. + * + * @param {object} options + * @param {string} ignoredName + * @return {boolean} + */ +module.exports = function (options, ignoredName) { + return options && options.ignore && options.ignore.includes(ignoredName); +}; diff --git a/node_modules/stylelint-scss/src/utils/optionsMatches.js b/node_modules/stylelint-scss/src/utils/optionsMatches.js new file mode 100644 index 000000000..fb848f682 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/optionsMatches.js @@ -0,0 +1,22 @@ +"use strict"; + +const matchesStringOrRegExp = require("./matchesStringOrRegExp"); + +/** + * Check if an options object's propertyName contains a user-defined string or + * regex that matches the passed in input. + * + * @param {{ [x: string]: any; }} options + * @param {string} propertyName + * @param {unknown} input + * + * @returns {boolean} + */ +module.exports = function optionsMatches(options, propertyName, input) { + return Boolean( + options && + options[propertyName] && + typeof input === "string" && + matchesStringOrRegExp(input, options[propertyName]) + ); +}; diff --git a/node_modules/stylelint-scss/src/utils/parseFunctionArguments.js b/node_modules/stylelint-scss/src/utils/parseFunctionArguments.js new file mode 100644 index 000000000..2b944cbe5 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/parseFunctionArguments.js @@ -0,0 +1,79 @@ +"use strict"; + +const valueParser = require("postcss-value-parser"); + +function groupByKeyValue(nodes) { + if (!nodes) { + return []; + } + + let groupIndex = 0; + + return nodes.reduce((acc, node, nodeIndex) => { + const isComma = node.type === "div" && node.value === ","; + const skipTrailingComma = isComma && nodeIndex === nodes.length - 1; + + if (skipTrailingComma) { + return acc; + } + + if (isComma) { + groupIndex++; + } + + acc[groupIndex] = acc[groupIndex] || []; + + if (!isComma) { + acc[groupIndex].push(node); + } + + return acc; + }, []); +} + +function mapToKeyValue(nodes) { + const keyVal = nodes.reduce((acc, curr, i) => { + if (acc.length === 1) { + return acc; + } + + const nextNode = nodes[i + 1]; + const isNextNodeColon = + nextNode && nextNode.type === "div" && nextNode.value === ":"; + + if (isNextNodeColon) { + acc.push({ + key: valueParser.stringify(nodes[i]), + value: valueParser.stringify(nodes.slice(2)) + }); + + return acc; + } + + acc.push({ + value: valueParser.stringify(nodes) + }); + + return acc; + }, []); + + return keyVal[0]; +} + +function parseFunctionArguments(value) { + const parsed = valueParser(value); + + if (!parsed.nodes[0] || parsed.nodes[0].type !== "function") { + return []; + } + + return parsed.nodes.map(node => + groupByKeyValue(node.nodes).map(mapToKeyValue) + )[0]; +} + +module.exports = { + groupByKeyValue, + mapToKeyValue, + parseFunctionArguments +}; diff --git a/node_modules/stylelint-scss/src/utils/parseNestedPropRoot.js b/node_modules/stylelint-scss/src/utils/parseNestedPropRoot.js new file mode 100644 index 000000000..9675e1914 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/parseNestedPropRoot.js @@ -0,0 +1,96 @@ +"use strict"; + +/** + * Attempts to parse a selector as if it"s a root for a group of nested props + * E.g.: `margin: {`, `font: 10px/1.1 Arial {` ("{" excluded) + */ + +module.exports = function parseNestedPropRoot(propString) { + const modesEntered = [ + { + mode: "normal", + character: null, + isCalculationEnabled: true + } + ]; + const result = {}; + let lastModeIndex = 0; + let propName = ""; + + for (let i = 0; i < propString.length; i++) { + const character = propString[i]; + const prevCharacter = propString[i - 1]; + + // If entering/exiting a string + if (character === '"' || character === "'") { + if (modesEntered[lastModeIndex].isCalculationEnabled === true) { + modesEntered.push({ + mode: "string", + isCalculationEnabled: false, + character + }); + lastModeIndex++; + } else if ( + modesEntered[lastModeIndex].mode === "string" && + modesEntered[lastModeIndex].character === character && + prevCharacter !== "\\" + ) { + modesEntered.pop(); + lastModeIndex--; + } + } + + // If entering/exiting interpolation + if (character === "{") { + modesEntered.push({ + mode: "interpolation", + isCalculationEnabled: true + }); + lastModeIndex++; + } else if (character === "}") { + modesEntered.pop(); + lastModeIndex--; + } + + // Check for : outside fn call, string or interpolation. It must be at the + // end of a string or have a whitespace between it and following value + if ( + modesEntered[lastModeIndex].mode === "normal" && + character === ":" && + prevCharacter !== "\\" + ) { + const propValueStr = propString.substring(i + 1); + + if (propValueStr.length) { + const propValue = { + before: /^(\s*)/.exec(propValueStr)[1], + value: propValueStr.trim() + }; + + // It's a declaration if 1) there is a whitespace after :, or + // 2) the value is a number with/without a unit (starts with a number + // or a dot), or + // 3) the value is a variable (starts with $), or + // 4) the value a string, surprisingly + if (propValue.before === "" && !/^[\d.$'"]/.test(propValue.value)) { + return null; + } + + // +1 for the colon + propValue.sourceIndex = propValue.before.length + i + 1; + result.propValue = propValue; + } + + result.propName = { + after: /(\s*)$/.exec(propName)[1], + value: propName.trim() + }; + + return result; + } + + propName += character; + } + + return null; +}; diff --git a/node_modules/stylelint-scss/src/utils/parseSelector.js b/node_modules/stylelint-scss/src/utils/parseSelector.js new file mode 100644 index 000000000..84d36005e --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/parseSelector.js @@ -0,0 +1,11 @@ +"use strict"; + +const postCssSelectorParser = require("postcss-selector-parser"); + +module.exports = function (selector, result, node, cb) { + try { + return postCssSelectorParser(cb).processSync(selector); + } catch (e) { + result.warn("Cannot parse selector", { node }); + } +}; diff --git a/node_modules/stylelint-scss/src/utils/rawNodeString.js b/node_modules/stylelint-scss/src/utils/rawNodeString.js new file mode 100644 index 000000000..03a1e1d64 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/rawNodeString.js @@ -0,0 +1,19 @@ +"use strict"; + +/** + * Stringify PostCSS node including its raw "before" string. + * + * @param {Node} node - Any PostCSS node + * @return {string} + */ +module.exports = function (node) { + let result = ""; + + if (node.raws.before) { + result += node.raws.before; + } + + result += node.toString(); + + return result; +}; diff --git a/node_modules/stylelint-scss/src/utils/removeEmptyLinesBefore.js b/node_modules/stylelint-scss/src/utils/removeEmptyLinesBefore.js new file mode 100644 index 000000000..be487fdd4 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/removeEmptyLinesBefore.js @@ -0,0 +1,11 @@ +"use strict"; + +// Remove empty lines before a node. Mutates the node. +module.exports = function removeEmptyLinesBefore( + node /*: postcss$node*/, + newline /*: '\n' | '\r\n'*/ +) /*: postcss$node*/ { + node.raws.before = node.raws.before.replace(/(\r?\n\s*\n)+/g, newline); + + return node; +}; diff --git a/node_modules/stylelint-scss/src/utils/ruleUrl.js b/node_modules/stylelint-scss/src/utils/ruleUrl.js new file mode 100644 index 000000000..831baa05e --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/ruleUrl.js @@ -0,0 +1,17 @@ +"use strict"; + +const revision = "master"; + +/** + * Get the specified rule's URL. + * + * @param {string} ruleName + * @return {string} + */ +module.exports = function ruleUrl(ruleName) { + let name = ruleName; + if (name.includes("/")) { + [, name] = name.split("/", 2); + } + return `https://github.com/stylelint-scss/stylelint-scss/blob/${revision}/src/rules/${name}`; +}; diff --git a/node_modules/stylelint-scss/src/utils/sassValueParser/index.js b/node_modules/stylelint-scss/src/utils/sassValueParser/index.js new file mode 100644 index 000000000..04ce78e6a --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/sassValueParser/index.js @@ -0,0 +1,1021 @@ +"use strict"; + +/** + * Processes a string and finds Sass operators in it + * + * @param {Object} args - Named arguments object + * @param {String} args.string - the input string + * @param {Number} args.globalIndex - the position of args.string from the start of the line + * @param {Boolean} args.isAfterColon - pass "true" if the string is + * a variable value, a mixin/function parameter default. + * In such cases + and / tend to be operations more often + * @param {Function} args.callback - will be called on every instance of + * an operator. Accepts parameters: + * • string - the default source string + * • globalIndex - the string's position in the outer input + * • startIndex - index in string, where the operator starts + * • endIndex - index in string, where the operator ends (for `==`, etc.) + * + * @return {Array} array of { symbol, globalIndex, startIndex, endIndex } + * for each operator found within a string + */ +module.exports = function findOperators({ + string, + globalIndex, + isAfterColon, + callback +}) { + const mathOperators = ["+", "/", "-", "*", "%"]; + // A stack of modes activated for the current char: string, interpolation + // Calculations inside strings are not processed, so spaces are not linted + const modesEntered = [ + { + mode: "normal", + isCalculationEnabled: true, + character: null + } + ]; + const result = []; + let lastModeIndex = 0; + + for (let i = 0; i < string.length; i++) { + const character = string[i]; + const substringStartingWithIndex = string.substring(i); + const lastMode = modesEntered[lastModeIndex]; + + // If entering/exiting a string + if (character === '"' || character === "'") { + if (lastMode && lastMode.isCalculationEnabled === true) { + modesEntered.push({ + mode: "string", + isCalculationEnabled: false, + character + }); + lastModeIndex++; + } else if ( + lastMode && + lastMode.mode === "string" && + lastMode.character === character && + string[i - 1] !== "\\" + ) { + modesEntered.pop(); + lastModeIndex--; + } + } + + // If entering/exiting interpolation (may be inside a string) + // Comparing with length-2 because `#{` at the very end doesnt matter + if ( + character === "#" && + i + 1 < string.length - 2 && + string[i + 1] === "{" + ) { + modesEntered.push({ + mode: "interpolation", + isCalculationEnabled: true + }); + lastModeIndex++; + } else if (character === "}") { + modesEntered.pop(); + lastModeIndex--; + } + + // Don't lint if inside a string + if (lastMode && lastMode.isCalculationEnabled === false) { + continue; + } + + // If it's a math operator + if ( + (mathOperators.includes(character) && + mathOperatorCharType(string, i, isAfterColon) === "op") || + // or is "<" or ">" + substringStartingWithIndex.search(/^[<>]([^=]|$)/) !== -1 + ) { + result.push({ + symbol: string[i], + globalIndex, + startIndex: i, + endIndex: i + }); + + if (callback) { + callback(string, globalIndex, i, i); + } + } + + // "<=", ">=", "!=", "==" + if (substringStartingWithIndex.search(/^[><=!]=/) !== -1) { + result.push({ + symbol: string[i], + globalIndex, + startIndex: i, + endIndex: i + 1 + }); + + if (callback) { + callback(string, globalIndex, i, i + 1); + } + } + } + + // result.length > 0 && console.log(string, result) + return result; +}; + +/** + * Checks if a character is an operator, a sign (+ or -), or part of a string + * + * @param {String} string - the source string + * @param {Number} index - the index of the character in string to check + * @param {Boolean} isAfterColon - if the value string a variable + * value, a mixin/function parameter default. In such cases + and / tend + * to be operations more often + * @return {String|false} + * • "op", if the character is a operator in a math/string operation + * • "sign" if it is a + or - before a numeric, + * • "char" if it is a part of a string, + * • false - if it is none from above (most likely an error) + */ +function mathOperatorCharType(string, index, isAfterColon) { + // !Checking here to prevent unnecessary calculations and deep recursion + // when calling isPrecedingOperator() + if (!["+", "/", "-", "*", "%"].includes(string[index])) { + return "char"; + } + + const character = string[index]; + const prevCharacter = string[index - 1]; + + if (prevCharacter !== "\\") { + // ---- Processing + characters + if (character === "+") { + return checkPlus(string, index, isAfterColon); + } + + // ---- Processing - characters + if (character === "-") { + return checkMinus(string, index); + } + + // ---- Processing * character + if (character === "*") { + return checkMultiplication(string, index); + } + + // ---- Processing % character + if (character === "%") { + return checkPercent(string, index); + } + + // ---- Processing / character + // https://sass-lang.com/documentation/operators/numeric#slash-separated-values + if (character === "/") { + return checkSlash(string, index, isAfterColon); + } + } + + return "char"; +} + +// -------------------------------------------------------------------------- +// Functions for checking particular characters (+, -, /) +// -------------------------------------------------------------------------- + +/** + * Checks the specified `*` char type: operator, sign (*), part of string + * + * @param {String} string - the source string + * @param {Number} index - the index of the character in string to check + * @return {String|false} + * • "op", if the character is a operator in a math/string operation + * • "sign" if it is a sign before a positive number, + * • "char" if it is a part of a string or identifier, + * • false - if it is none from above (most likely an error) + */ +function checkMultiplication(string, index) { + const insideFn = isInsideFunctionCall(string, index); + + if (insideFn.is && insideFn.fn) { + const fnArgsReg = new RegExp(insideFn.fn + "\\(([^)]+)\\)"); + const fnArgs = string.match(fnArgsReg); + const isSingleMultiplicationChar = + Array.isArray(fnArgs) && fnArgs[1] === "*"; + // e.g. selector(:has(*)) + if (isSingleMultiplicationChar) { + return "char"; + } + } + + return "op"; +} + +/** + * Checks the specified `+` char type: operator, sign (+ or -), part of string + * + * @param {String} string - the source string + * @param {Number} index - the index of the character in string to check + * @param {Boolean} isAftercolon - if the value string a variable + * value, a mixin/function parameter default. In such cases + is always an + * operator if surrounded by numbers/values with units + * @return {String|false} + * • "op", if the character is a operator in a math/string operation + * • "sign" if it is a sign before a positive number, + * • false - if it is none from above (most likely an error) + */ +function checkPlus(string, index, isAftercolon) { + const before = string.substring(0, index); + const after = string.substring(index + 1); + + // If the character is at the beginning of the input + const isAtStart_ = isAtStart(string, index); + // If the character is at the end of the input + const isAtEnd_ = isAtEnd(string, index); + const isWhitespaceBefore = before.search(/\s$/) !== -1; + const isWhitespaceAfter = after.search(/^\s/) !== -1; + + const isValueWithUnitAfter_ = isValueWithUnitAfter(after); + const isNumberAfter_ = isNumberAfter(after); + const isInterpolationAfter_ = isInterpolationAfter(after); + // The early check above helps prevent deep recursion here + const isPrecedingOperator_ = isPrecedingOperator(string, index); + + if (isAtStart_) { + // console.log("+, `+` or `+ `") + return "sign"; + } + + // E.g. `1+1`, `string+#fff` + if (!isAtStart_ && !isWhitespaceBefore && !isAtEnd_ && !isWhitespaceAfter) { + // E.g. `1-+1` + if (isPrecedingOperator_) { + // console.log('1+1') + return "sign"; + } + + // console.log("+, no spaces") + return "op"; + } + + // e.g. `something +something` + if (!isAtEnd_ && !isWhitespaceAfter) { + // e.g. `+something`, ` ... , +something`, etc. + if (isNoOperandBefore(string, index)) { + // console.log("+, nothing before") + return "sign"; + } + + // e.g. `sth +10px`, `sth +1` + if ( + (isValueWithUnitAfter_.is && !isValueWithUnitAfter_.opsBetween) || + (isNumberAfter_.is && !isNumberAfter_.opsBetween) + ) { + if (isAftercolon === true) { + // console.log(": 10px +1") + return "op"; + } + + // e.g. `(sth +10px)`, `fun(sth +1)` + if ( + isInsideParens(string, index) || + isInsideFunctionCall(string, index).is + ) { + // console.log("+10px or +1, inside function or parens") + return "op"; + } + + // e.g. `#{10px +1}` + if (isInsideInterpolation(string, index)) { + // console.log('+, #{10px +1}') + return "op"; + } + + // console.log('+, default') + return "sign"; + } + + // e.g. `sth +#fff`, `sth +string`, `sth +#{...}`, `sth +$var` + if ( + isStringAfter(after) || + isHexColorAfter(after) || + after[0] === "$" || + (isInterpolationAfter_.is && !isInterpolationAfter_.opsBefore) + ) { + // e.g. `sth+ +string` + if (isPrecedingOperator_) { + // console.log("+10px or +1, before is an operator") + return "sign"; + } + + // console.log("+#000, +string, +#{sth}, +$var") + return "op"; + } + + // console.log('sth +sth, default') + return "op"; + } + + // If the + is after a value, e.g. `$var+` + if (!isAtStart_ && !isWhitespaceBefore) { + // It is always an operator. Prior to Sass 4, `#{...}+` was different, + // but that's not logical and had been fixed. + // console.log('1+ sth') + return "op"; + } + + // If it has whitespaces on both sides + // console.log('sth + sth') + return "op"; +} + +/** + * Checks the specified `-` character: operator, sign (+ or -), part of string + * + * @param {String} string - the source string + * @param {Number} index - the index of the character in string to check + * @return {String|false} + * • "op", if the character is a operator in a math/string operation + * • "sign" if it is a sign before a negative number, + * • "char" if it is a part of a string or identifier, + * • false - if it is none from above (most likely an error) + */ +function checkMinus(string, index) { + const before = string.substring(0, index); + const after = string.substring(index + 1); + // If the character is at the beginning of the input + const isAtStart_ = isAtStart(string, index); + // If the character is at the end of the input + const isAtEnd_ = isAtEnd(string, index); + const isWhitespaceBefore = before.search(/\s$/) !== -1; + const isWhitespaceAfter = after.search(/^\s/) !== -1; + + const isValueWithUnitAfter_ = isValueWithUnitAfter(after); + const isValueWithUnitBefore_ = isValueWithUnitBefore(before); + const isNumberAfter_ = isNumberAfter(after); + const isNumberBefore_ = isNumberBefore(before); + const isInterpolationAfter_ = isInterpolationAfter(after); + const isParensAfter_ = isParensAfter(after); + const isParensBefore_ = isParensBefore(before); + // The early check above helps prevent deep recursion here + const isPrecedingOperator_ = isPrecedingOperator(string, index); + const isInsideFunctionCall_ = isInsideFunctionCall(string, index); + + if (isAtStart_) { + // console.log("-, - or - ") + return "sign"; + } + + // `10 - 11` + if (!isAtEnd_ && !isAtStart_ && isWhitespaceBefore && isWhitespaceAfter) { + // console.log("-, Op: 10px - 10px") + return "op"; + } + + // e.g. `something -10px` + if (!isAtEnd_ && !isAtStart_ && isWhitespaceBefore && !isWhitespaceAfter) { + if (isParensAfter_.is && !isParensAfter_.opsBefore) { + // console.log("-, Op: -(...)") + return "op"; + } + + // e.g. `#{10px -1}`, `#{math.acos(-0.5)}` + if (isInsideInterpolation(string, index)) { + // e.g. `url(https://my-url.com/image-#{$i -2}-dark.svg)` + if (isInsideFunctionCall_.fn === "url") { + return "op"; + } + + if ( + isInsideFunctionCall_.is && + ((isValueWithUnitAfter_.is && !isValueWithUnitAfter_.opsBetween) || + (isNumberAfter_.is && !isNumberAfter_.opsBetween)) + ) { + return "sign"; + } + + // e.g. `#{$i * -10}px` + if (isWhitespaceBefore && isNumberAfter_.is && isPrecedingOperator_) { + return "sign"; + } + + return "op"; + } + + // e.g. `sth -1px`, `sth -1`. + // Always a sign, even inside parens/function args + if ( + (isValueWithUnitAfter_.is && !isValueWithUnitAfter_.opsBetween) || + (isNumberAfter_.is && !isNumberAfter_.opsBetween) + ) { + // console.log("-, sign: -1px or -1") + return "sign"; + } + + // e.g. `sth --1`, `sth +-2px` + if ( + (isValueWithUnitAfter_.is && isValueWithUnitAfter_.opsBetween) || + (isNumberAfter_.is && isNumberAfter_.opsBetween) + ) { + // console.log("-, op: --1px or --1") + return "op"; + } + + // ` -string`, ` -#{...}` + if ( + isStringAfter(after) || + (isInterpolationAfter_.is && !isInterpolationAfter_.opsBefore) + ) { + // console.log("-, char: -#{...}") + return "char"; + } + + // e.g. `#0af -#f0a`, and edge-cases can take a hike + if (isHexColorAfter(after) && isHexColorBefore(before.trim())) { + // console.log("-, op: #fff-, -#fff") + return "op"; + } + + // If the - is before a variable, than it's most likely an operator + if (after[0] === "$") { + if (isPrecedingOperator_) { + // console.log("-, sign: -$var, another operator before") + return "sign"; + } + + // console.log("-, op: -$var, NO other operator before") + return "op"; + } + + // By default let's make it an sign for now + // console.log('-, sign: default in -') + return "sign"; + } + + // No whitespace before, + // e.g. `10x- something` + if (!isAtEnd_ && !isAtStart_ && !isWhitespaceBefore && isWhitespaceAfter) { + if (isParensBefore_) { + // console.log('-, op: `(...)- `') + return "op"; + } + + // e.g. `#{10px- 1}` + if (isInsideInterpolation(string, index)) { + return "op"; + } + + if (isNumberBefore(before) || isHexColorBefore(before)) { + // console.log('`-, op: 10- , #aff- `') + return "op"; + } + + // console.log('-, char: default in - ') + return "char"; + } + + // NO Whitespace, + // e.g. `10px-1` + if (!isAtEnd_ && !isAtStart_ && !isWhitespaceBefore && !isWhitespaceAfter) { + // console.log('no spaces') + // `-1`, `-10px` + if ( + (isValueWithUnitAfter_.is && !isValueWithUnitAfter_.opsBetween) || + (isNumberAfter_.is && !isNumberAfter_.opsBetween) + ) { + // `10px-1`, `1-10px`, `1-1`, `1x-1x` + if (isValueWithUnitBefore_ || isNumberBefore_) { + // console.log("-, op: 1-10px") + return "op"; + } + + // The - could be a "sign" here, but for now "char" does the job + } + + // `1-$var` + if (isNumberBefore_ && after[0] === "$") { + // console.log("-, op: 1-$var") + return "op"; + } + + // `fn()-10px` + if ( + isFunctionBefore(before) && + ((isNumberAfter_.is && !isNumberAfter_.opsBetween) || + (isValueWithUnitAfter_.is && !isValueWithUnitAfter_.opsBetween)) + ) { + // console.log("-, op: fn()-10px") + return "op"; + } + } + + // And in all the other cases it's a character inside a string + // console.log("-, default: char") + return "char"; +} + +/** + * Checks the specified `/` character: operator, sign (+ or -), part of string + * + * @param {String} string - the source string + * @param {Number} index - the index of the character in string to check + * @param {Boolean} isAfterColon - if the value string a variable + * value, a mixin/function parameter default. In such cases / is always an + * operator if surrounded by numbers/values with units + * @return {String|false} + * • "op", if the character is a operator in a math/string operation + * • "char" if it gets compiled as-is, e.g. `font: 10px/1.2;`, + * • false - if it is none from above (most likely an error) + */ +function checkSlash(string, index, isAfterColon) { + // Trimming these, as spaces before/after a slash don't matter + const before = string.substring(0, index).trim(); + const after = string.substring(index + 1).trim(); + + const isValueWithUnitAfter_ = isValueWithUnitAfter(after); + const isValueWithUnitBefore_ = isValueWithUnitBefore(before); + const isNumberAfter_ = isNumberAfter(after); + const isNumberBefore_ = isNumberBefore(before); + const isParensAfter_ = isParensAfter(after); + const isParensBefore_ = isParensBefore(before); + + // FIRST OFF. Interpolation on any of the sides is a NO-GO for division op + if (isInterpolationBefore(before).is || isInterpolationAfter(after).is) { + // console.log("/, interpolation") + return "char"; + } + + // having a dot before probably means a relative path. + // e.g. url(../../image.png) + if (isDotBefore(before)) { + return "char"; + } + + // e.g. `(1px/1)`, `fn(7 / 15)`, but not `url(8/11)` + const isInsideFn = isInsideFunctionCall(string, index); + + if (isInsideFn.is && isInsideFn.fn === "url") { + // e.g. `url(https://my-url.com/image-#{$i /2}-dark.svg)` + if (isInsideInterpolation(string, index)) { + return "op"; + } + return "char"; + } + + // e.g. `10px/normal` + if (isStringBefore(before).is || isStringAfter(after)) { + // console.log("/, string") + return "char"; + } + + // For all other value options (numbers, value+unit, hex color) + + // `$var/1`, `#fff/-$var` + // Here we don't care if there is a sign before the var + if (isVariableBefore(before) || isVariableAfter(after).is) { + // console.log("/, variable") + return "op"; + } + + if (isFunctionBefore(before) || isFunctionAfter(after).is) { + // console.log("/, function as operand") + return "op"; + } + + if (isParensBefore_ || isParensAfter_.is) { + // console.log("/, function as operand") + return "op"; + } + + // `$var: 10px/2; // 5px` + if ( + isAfterColon === true && + (isValueWithUnitAfter_.is || isNumberAfter_.is) && + (isValueWithUnitBefore_ || isNumberBefore_) + ) { + return "op"; + } + + // Quick check of the following operator symbol - if it is a math operator + if ( + // +, *, % count as operators unless after interpolation or at the start + before.search(/[^{,(}\s]\s*[+*%][^(){},]+$/) !== -1 || + // We consider minus as op only if surrounded by whitespaces (` - `); + before.search(/[^{,(}\s]\s+-\s[^(){},]+$/) !== -1 || + // `10/2 * 3`, `10/2 % 3`, with or without spaces + after.search(/^[^(){},]+[*%]/) !== -1 || + // `10px/2px+1`, `10px/2px+ 1` + after.search(/^[^(){},\s]+\+/) !== -1 || + // Anything but `10px/2px +1`, `10px/2px +1px` + after.search(/^[^(){},\s]+\s+(\+\D)/) !== -1 || + // Following ` -`: only if `$var` after (`10/10 -$var`) + after.search(/^[^(){},\s]+\s+-(\$|\s)/) !== -1 || + // Following `-`: only if number after (`10s/10s-10`, `10s/10s-.1`) + after.search(/^[^(){},\s]+-(\.)?\d/) !== -1 || + // Or if there is a number before anything but string after (not `10s/1-str`,) + after.search(/^(\d*\.)?\d+-\s*[^#a-zA-Z_\s]/) !== -1 + ) { + // console.log("/, math op around") + return "op"; + } + + if ( + isInsideParens(string, index) || + (isInsideFn.is && isInsideFn.fn !== "url") + ) { + // console.log("/, parens or function arg") + return "op"; + } + + // console.log("/, default") + return "char"; +} + +/** + * Checks the specified `%` character: operator or part of value + * + * @param {String} string - the source string + * @param {Number} index - the index of the character in string to check + * @return {String|false} + * • "op", if the character is a operator in a math/string operation + * • "char" if it gets compiled as-is, e.g. `width: 10%`, + * • false - if it is none from above (most likely an error) + */ +function checkPercent(string, index) { + // Trimming these, as spaces before/after a slash don't matter + const before = string.substring(0, index); + const after = string.substring(index + 1); + + // If the character is at the beginning of the input + const isAtStart_ = isAtStart(string, index); + // If the character is at the end of the input + const isAtEnd_ = isAtEnd(string, index); + const isWhitespaceBefore = before.search(/\s$/) !== -1; + const isWhitespaceAfter = after.search(/^\s/) !== -1; + + const isParensBefore_ = isParensBefore(before); + + // FIRST OFF. Interpolation on any of the sides is a NO-GO + if ( + isInterpolationBefore(before.trim()).is || + isInterpolationAfter(after.trim()).is + ) { + // console.log("%, interpolation") + return "char"; + } + + if (isAtStart_ || isAtEnd_) { + // console.log("%, start/end") + return "char"; + } + + // In ` %` it's most likely an operator (except for interpolation + // checked above) + if (isWhitespaceBefore && !isWhitespaceAfter) { + // console.log("%, ` %`") + return "op"; + } + + // `$var% 1`, `$var%1`, `$var%-1` + if (isVariableBefore(before) || isParensBefore_) { + // console.log("%, after a variable, function or parens") + return "op"; + } + + // in all other cases in `% ` it is most likely a unit + if (!isWhitespaceBefore && isWhitespaceAfter) { + // console.log("%, `% `") + return "char"; + } + + // console.log("%, default") + return "char"; +} + +// -------------------------------------------------------------------------- +// Lots of elementary helpers +// -------------------------------------------------------------------------- + +function isAtStart(string, index) { + const before = string.substring(0, index).trim(); + + return before.length === 0 || before.search(/[({,]$/) !== -1; +} + +function isAtEnd(string, index) { + const after = string.substring(index + 1).trim(); + + return after.length === 0 || after.search(/^[,)}]/) !== -1; +} + +function isInsideParens(string, index) { + const before = string.substring(0, index).trim(); + const after = string.substring(index + 1).trim(); + + return ( + before.search(/(?:^|[,{\s])\([^(){},]+$/) !== -1 && + after.search(/^[^(){},\s]+\s*\)/) !== -1 + ); +} + +function isInsideInterpolation(string, index) { + const before = string.substring(0, index).trim(); + + return before.search(/#{[^}]*$/) !== -1; +} + +/** + * Checks if the character is inside a function arguments + * + * @param {String} string - the input string + * @param {Number} index - current character index + * @return {Object} return + * {Boolean} return.is - if inside a function arguments + * {String} return.fn - function name + */ +function isInsideFunctionCall(string, index) { + const result = { is: false, fn: null }; + const before = string.substring(0, index).trim(); + const after = string.substring(index + 1).trim(); + const beforeMatch = before.match( + /(?:[a-zA-Z_-][\w-]*\()?(:?[a-zA-Z_-][\w-]*)\(/ + ); + + if (beforeMatch && beforeMatch[0] && after.search(/^[^(,]+\)/) !== -1) { + result.is = true; + result.fn = beforeMatch[1]; + } + + return result; +} + +/** + * Checks if there is a string before the character. + * Also checks if there is a math operator in between + * + * @param {String} before - the input string that preceses the character + * @return {Object} return + * {Boolean} return.is - if there is a string + * {String} return.opsBetween - if there are operators in between + */ +function isStringBefore(before) { + const result = { is: false, opsBetween: false }; + const stringOpsClipped = before.replace(/(\s*[+/*%]|\s+-)+$/, ""); + + if (stringOpsClipped !== before) { + result.opsBetween = true; + } + + // If it is quoted + if ( + stringOpsClipped[stringOpsClipped.length - 1] === '"' || + stringOpsClipped[stringOpsClipped.length - 1] === "'" + ) { + result.is = true; + } else if ( + stringOpsClipped.search( + /(?:^|[/(){},: ])([a-zA-Z_][\w-]*|-+[a-zA-Z_][\w-]*)$/ + ) !== -1 + ) { + // First pattern: a1, a1a, a-1, + result.is = true; + } + + return result; +} + +function isStringAfter(after) { + const stringTrimmed = after.trim(); + + // If it is quoted + if (stringTrimmed[0] === '"' || stringTrimmed[0] === "'") return true; + + // e.g. `a1`, `a1a`, `a-1`, and even `--s323` + return ( + stringTrimmed.search(/^([a-zA-Z_][\w-]*|-+[a-zA-Z_][\w-]*)(?:$|[)}, ])/) !== + -1 + ); +} + +function isInterpolationAfter(after) { + const result = { is: false, opsBetween: false }; + const matches = after.match(/^\s*([+/*%-]\s*)*#{/); + + if (matches) { + if (matches[0]) { + result.is = true; + } + + if (matches[1]) { + result.opsBetween = true; + } + } + + return result; +} + +function isParensAfter(after) { + const result = { is: false, opsBetween: false }; + const matches = after.match(/^\s*([+/*%-]\s*)*\(/); + + if (matches) { + if (matches[0]) { + result.is = true; + } + + if (matches[1]) { + result.opsBetween = true; + } + } + + return result; +} + +function isParensBefore(before) { + return before.search(/\)\s*$/) !== -1; +} + +/** + * Checks if there is an interpolation before the character. + * Also checks if there is a math operator in between + * + * @param {String} before - the input string that preceses the character + * @return {Object} return + * {Boolean} return.is - if there is an interpolation + * {String} return.opsBetween - if there are operators in between + */ +function isInterpolationBefore(before) { + const result = { is: false, opsBetween: false }; + // Removing preceding operators if any + const beforeOpsClipped = before.replace(/(\s*[+/*%-])+$/, ""); + + if (beforeOpsClipped !== before) { + result.opsBetween = true; + } + + if (beforeOpsClipped[beforeOpsClipped.length - 1] === "}") { + result.is = true; + } + + return result; +} + +function isValueWithUnitBefore(before) { + // 1px, 0.1p-x, .2p-, 11.2pdf-df1df_ + // Surprisingly, ` d.10px` - .10px is separated from a sequence + // and is considered a value with a unit + return before.trim().search(/(^|[/(, .])\d[\w-]+$/) !== -1; +} + +function isValueWithUnitAfter(after) { + const result = { is: false, opsBetween: false }; + // 1px, 0.1p-x, .2p-, 11.2pdf-dfd1f_ + // Again, ` d.10px` - .10px is separated from a sequence + // and is considered a value with a unit + const matches = after.match( + /^\s*([+/*%-]\s*)*(\d+(\.\d+)?|\.\d+)[\w-%]+(?:$|[)}, ])/ + ); + + if (matches) { + if (matches[0]) { + result.is = true; + } + + if (matches[1]) { + result.opsBetween = true; + } + } + + return result; +} + +function isNumberAfter(after) { + const result = { is: false, opsBetween: false }; + const matches = after.match( + /^\s*([+/*%-]\s*)*(\d+(\.\d+)?|\.\d+)(?:$|[)}, ])/ + ); + + if (matches) { + if (matches[0]) { + result.is = true; + } + + if (matches[1]) { + result.opsBetween = true; + } + } + + return result; +} + +function isNumberBefore(before) { + return before.trim().search(/(?:^|[/(){},\s])(\d+(\.\d+)?|\.\d+)$/) !== -1; +} + +function isVariableBefore(before) { + return before.trim().search(/\$[\w-]+$/) !== -1; +} + +function isVariableAfter(after) { + const result = { is: false, opsBetween: false }; + const matches = after.match(/^\s*([+/*%-]\s*)*\$/); + + if (matches) { + if (matches[0]) { + result.is = true; + } + + if (matches[1]) { + result.opsBetween = true; + } + } + + return result; +} + +function isDotBefore(before) { + return before.slice(-1) === "."; +} + +function isFunctionBefore(before) { + return before.trim().search(/[\w-]\(.*?\)\s*$/) !== -1; +} + +function isFunctionAfter(after) { + const result = { is: false, opsBetween: false }; + // `-fn()` is a valid function name, so if a - should be a sign/operator, + // it must have a space after + const matches = after.match(/^\s*(-\s+|[+/*%]\s*)*[a-zA-Z_-][\w-]*\(/); + + if (matches) { + if (matches[0]) { + result.is = true; + } + + if (matches[1]) { + result.opsBetween = true; + } + } + + return result; +} + +/** + * Checks if the input string is a hex color value + * + * @param {String} string - the input + * @return {Boolean} true, if the input is a hex color + */ +function isHexColor(string) { + return string.trim().search(/^#([\da-fA-F]{3}|[\da-fA-F]{6})$/) !== -1; +} + +function isHexColorAfter(after) { + const afterTrimmed = after.match(/(.*?)(?:[)},+/*%\-\s]|$)/)[1].trim(); + + return isHexColor(afterTrimmed); +} + +function isHexColorBefore(before) { + return ( + before.search(/(?:[/(){},+*%-\s]|^)#([\da-fA-F]{3}|[\da-fA-F]{6})$/) !== -1 + ); +} + +/** + * Checks if there is no operand before the current char + * In other words, the current char is at the start of a possible operation, + * e.g. at the string start, after the opening paren or after a comma + * + * @param {String} string - the input string + * @param {Number} index - current char's position in string + * @return {Boolean} + */ +function isNoOperandBefore(string, index) { + const before = string.substring(0, index).trim(); + + return before.length === 0 || before.search(/[({,]&/) !== -1; +} + +function isPrecedingOperator(string, index) { + let prevCharIndex = -1; + + for (let i = index - 1; i >= 0; i--) { + if (string[i].search(/\s/) === -1) { + prevCharIndex = i; + break; + } + } + + if (prevCharIndex === -1) { + return false; + } + + if (mathOperatorCharType(string, prevCharIndex) === "op") { + return true; + } + + return false; +} + +module.exports.mathOperatorCharType = mathOperatorCharType; +module.exports.isInsideFunctionCall = isInsideFunctionCall; diff --git a/node_modules/stylelint-scss/src/utils/validateTypes.js b/node_modules/stylelint-scss/src/utils/validateTypes.js new file mode 100644 index 000000000..0610c75a4 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/validateTypes.js @@ -0,0 +1,44 @@ +"use strict"; + +/** + * Checks if the value is a boolean or a Boolean object. + * @param {unknown} value + * @returns {value is boolean} + */ +function isBoolean(value) { + return typeof value === "boolean" || value instanceof Boolean; +} + +/** + * Checks if the value is a number or a Number object. + * @param {unknown} value + * @returns {value is number} + */ +function isNumber(value) { + return typeof value === "number" || value instanceof Number; +} + +/** + * Checks if the value is a regular expression. + * @param {unknown} value + * @returns {value is RegExp} + */ +function isRegExp(value) { + return value instanceof RegExp; +} + +/** + * Checks if the value is a string or a String object. + * @param {unknown} value + * @returns {value is string} + */ +function isString(value) { + return typeof value === "string" || value instanceof String; +} + +module.exports = { + isBoolean, + isNumber, + isRegExp, + isString +}; diff --git a/node_modules/stylelint-scss/src/utils/whitespaceChecker.js b/node_modules/stylelint-scss/src/utils/whitespaceChecker.js new file mode 100644 index 000000000..86dbdaa97 --- /dev/null +++ b/node_modules/stylelint-scss/src/utils/whitespaceChecker.js @@ -0,0 +1,338 @@ +"use strict"; + +const configurationError = require("./configurationError"); +const isSingleLineString = require("./isSingleLineString"); +const isWhitespace = require("./isWhitespace"); + +/** + * Create a whitespaceChecker, which exposes the following functions: + * - `before()` + * - `beforeAllowingIndentation()` + * - `after()` + * - `afterOneOnly()` + * + * @param {"space"|"newline"} targetWhitespace - This is a keyword instead + * of the actual character (e.g. " ") in order to accommodate + * different styles of newline ("\n" vs "\r\n") + * @param { + * "always"|"never" + * |"always-single-line"|"always-multi-line" + * | "never-single-line"|"never-multi-line" + * } expectation + * @param {object} messages - An object of message functions; + * calling `before*()` or `after*()` and the `expectation` that is passed + * determines which message functions are required + * @param {function} [messages.expectedBefore] + * @param {function} [messages.rejectedBefore] + * @param {function} [messages.expectedAfter] + * @param {function} [messages.rejectedAfter] + * @param {function} [messages.expectedBeforeSingleLine] + * @param {function} [messages.rejectedBeforeSingleLine] + * @param {function} [messages.expectedBeforeMultiLine] + * @param {function} [messages.rejectedBeforeMultiLine] + * @return {object} The checker, with its exposed checking functions + */ +module.exports = function (targetWhitespace, expectation, messages) { + // Keep track of active arguments in order to avoid passing + // too much stuff around, making signatures long and confusing. + // This variable gets reset anytime a checking function is called. + let activeArgs; + + /** + * Check for whitespace *before* a character. + * + * @param {object} args - Named arguments object + * @param {string} args.source - The source string + * @param {number} args.index - The index of the character to check before + * @param {function} args.err - If a violation is found, this callback + * will be invoked with the relevant warning message. + * Typically this callback will report() the violation. + * @param {function} args.errTarget - If a violation is found, this string + * will be sent to the relevant warning message. + * @param {string} [args.lineCheckStr] - Single- and multi-line checkers + * will use this string to determine whether they should proceed, + * i.e. if this string is one line only, single-line checkers will check, + * multi-line checkers will ignore. + * If none is passed, they will use `source`. + * @param {boolean} [args.onlyOneChar=false] - Only check *one* character before. + * By default, "always-*" checks will look for the `targetWhitespace` one + * before and then ensure there is no whitespace two before. This option + * bypasses that second check. + * @param {boolean} [args.allowIndentation=false] - Allow arbitrary indentation + * between the `targetWhitespace` (almost definitely a newline) and the `index`. + * With this option, the checker will see if a newline *begins* the whitespace before + * the `index`. + */ + function before({ + source, + index, + err, + errTarget, + lineCheckStr, + onlyOneChar = false, + allowIndentation = false + }) { + activeArgs = { + source, + index, + err, + errTarget, + onlyOneChar, + allowIndentation + }; + + switch (expectation) { + case "always": + expectBefore(); + break; + case "never": + rejectBefore(); + break; + case "always-single-line": + if (!isSingleLineString(lineCheckStr || source)) { + return; + } + + expectBefore(messages.expectedBeforeSingleLine); + break; + case "never-single-line": + if (!isSingleLineString(lineCheckStr || source)) { + return; + } + + rejectBefore(messages.rejectedBeforeSingleLine); + break; + case "always-multi-line": + if (isSingleLineString(lineCheckStr || source)) { + return; + } + + expectBefore(messages.expectedBeforeMultiLine); + break; + case "never-multi-line": + if (isSingleLineString(lineCheckStr || source)) { + return; + } + + rejectBefore(messages.rejectedBeforeMultiLine); + break; + default: + throw configurationError(`Unknown expectation "${expectation}"`); + } + } + + /** + * Check for whitespace *after* a character. + * + * Parameters are pretty much the same as for `before()`, above, just substitute + * the word "after" for "before". + */ + function after({ + source, + index, + err, + errTarget, + lineCheckStr, + onlyOneChar = false + }) { + activeArgs = { source, index, err, errTarget, onlyOneChar }; + + switch (expectation) { + case "always": + expectAfter(); + break; + case "never": + rejectAfter(); + break; + case "always-single-line": + if (!isSingleLineString(lineCheckStr || source)) { + return; + } + + expectAfter(messages.expectedAfterSingleLine); + break; + case "never-single-line": + if (!isSingleLineString(lineCheckStr || source)) { + return; + } + + rejectAfter(messages.rejectedAfterSingleLine); + break; + case "always-multi-line": + if (isSingleLineString(lineCheckStr || source)) { + return; + } + + expectAfter(messages.expectedAfterMultiLine); + break; + case "never-multi-line": + if (isSingleLineString(lineCheckStr || source)) { + return; + } + + rejectAfter(messages.rejectedAfterMultiLine); + break; + case "at-least-one-space": + expectAfter(messages.expectedAfterAtLeast); + break; + default: + throw configurationError(`Unknown expectation "${expectation}"`); + } + } + + function beforeAllowingIndentation(obj) { + before(Object.assign({}, obj, { allowIndentation: true })); + } + + function expectBefore(messageFunc = messages.expectedBefore) { + if (activeArgs.allowIndentation) { + expectBeforeAllowingIndentation(messageFunc); + + return; + } + + const { source, index } = activeArgs; + const oneCharBefore = source[index - 1]; + const twoCharsBefore = source[index - 2]; + + if (!isValue(oneCharBefore)) { + return; + } + + if (targetWhitespace === "newline") { + // If index is preceeded by a Windows CR-LF ... + if (oneCharBefore === "\n" && twoCharsBefore === "\r") { + if (activeArgs.onlyOneChar || !isWhitespace(source[index - 3])) { + return; + } + } + + // If index is followed by a Unix LF ... + if (oneCharBefore === "\n" && twoCharsBefore !== "\r") { + if (activeArgs.onlyOneChar || !isWhitespace(twoCharsBefore)) { + return; + } + } + } + + if (targetWhitespace === "space" && oneCharBefore === " ") { + if (activeArgs.onlyOneChar || !isWhitespace(twoCharsBefore)) { + return; + } + } + + activeArgs.err( + messageFunc(activeArgs.errTarget ? activeArgs.errTarget : source[index]) + ); + } + + function expectBeforeAllowingIndentation( + messageFunc = messages.expectedBefore + ) { + const { source, index, err } = activeArgs; + const expectedChar = (() => { + if (targetWhitespace === "newline") { + return "\n"; + } + + if (targetWhitespace === "space") { + return " "; + } + })(); + let i = index - 1; + + while (source[i] !== expectedChar) { + if (source[i] === "\t" || source[i] === " ") { + i--; + continue; + } + + err( + messageFunc(activeArgs.errTarget ? activeArgs.errTarget : source[index]) + ); + + return; + } + } + + function rejectBefore(messageFunc = messages.rejectedBefore) { + const { source, index } = activeArgs; + const oneCharBefore = source[index - 1]; + + if (isValue(oneCharBefore) && isWhitespace(oneCharBefore)) { + activeArgs.err( + messageFunc(activeArgs.errTarget ? activeArgs.errTarget : source[index]) + ); + } + } + + function afterOneOnly(obj) { + after(Object.assign({}, obj, { onlyOneChar: true })); + } + + function expectAfter(messageFunc = messages.expectedAfter) { + const { source, index } = activeArgs; + + const oneCharAfter = index + 1 < source.length ? source[index + 1] : ""; + const twoCharsAfter = index + 2 < source.length ? source[index + 2] : ""; + + if (!isValue(oneCharAfter)) { + return; + } + + if (targetWhitespace === "newline") { + // If index is followed by a Windows CR-LF ... + if (oneCharAfter === "\r" && twoCharsAfter === "\n") { + const threeCharsAfter = + index + 3 < source.length ? source[index + 3] : ""; + + if (activeArgs.onlyOneChar || !isWhitespace(threeCharsAfter)) { + return; + } + } + + // If index is followed by a Unix LF ... + if (oneCharAfter === "\n") { + if (activeArgs.onlyOneChar || !isWhitespace(twoCharsAfter)) { + return; + } + } + } + + if (targetWhitespace === "space" && oneCharAfter === " ") { + if ( + expectation === "at-least-one-space" || + activeArgs.onlyOneChar || + !isWhitespace(twoCharsAfter) + ) { + return; + } + } + + activeArgs.err( + messageFunc(activeArgs.errTarget ? activeArgs.errTarget : source[index]) + ); + } + + function rejectAfter(messageFunc = messages.rejectedAfter) { + const { source, index } = activeArgs; + const oneCharAfter = index + 1 < source.length ? source[index + 1] : ""; + + if (isValue(oneCharAfter) && isWhitespace(oneCharAfter)) { + activeArgs.err( + messageFunc(activeArgs.errTarget ? activeArgs.errTarget : source[index]) + ); + } + } + + return { + before, + beforeAllowingIndentation, + after, + afterOneOnly + }; +}; + +function isValue(x) { + return x !== undefined && x !== null; +} diff --git a/node_modules/stylelint/LICENSE b/node_modules/stylelint/LICENSE new file mode 100644 index 000000000..58332c87e --- /dev/null +++ b/node_modules/stylelint/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2015 - present Maxime Thirouin, David Clark & Richard Hallows + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/stylelint/README.md b/node_modules/stylelint/README.md new file mode 100644 index 000000000..056537cbf --- /dev/null +++ b/node_modules/stylelint/README.md @@ -0,0 +1,103 @@ +# Stylelint + +[![npm version](https://img.shields.io/npm/v/stylelint?logo=npm&logoColor=fff)](https://www.npmjs.com/package/stylelint) +[![Build Status](https://github.com/stylelint/stylelint/workflows/Testing/badge.svg)](https://github.com/stylelint/stylelint/actions/workflows/testing.yml?query=branch%3Amain) +[![npm downloads](https://img.shields.io/npm/dm/stylelint)](https://npmcharts.com/compare/stylelint?minimal=true) + +A mighty CSS linter that helps you avoid errors and enforce conventions. + +## Features + +It's mighty as it: + +- has over **100 built-in rules** for modern CSS syntax and features +- supports **plugins** so you can create your own custom rules +- automatically **fixes problems** where possible +- supports **shareable configs** that you can create or extend +- can **be customized** to your exact needs +- has **15k unit tests** making it robust +- is **trusted by companies worldwide** like Google and GitHub + +And it can be extended to: + +- extract **embedded styles** from HTML, Markdown and CSS-in-JS template literals +- parse **CSS-like languages** like SCSS, Sass, Less and SugarSS + +## How it'll help you + +It'll help you **avoid errors**, for example: + +- invalid things, e.g. malformed grid areas +- valid things that are problematic, e.g. duplicate selectors +- unknown things, e.g. misspelled property names + +And **enforce conventions**, for example: + +- disallow things, e.g. specific units +- enforce naming patterns, e.g. for custom properties +- set limits, e.g. the number of ID selectors +- specify notations, e.g. for modern color functions + +We recommend using a pretty printer like Prettier alongside Stylelint. Linters and pretty printers are complementary tools that work together to help you write consistent and error-free code. + +## Example output + +![Example](example.png) + +## Guides + +- User guide + - [Getting started](docs/user-guide/get-started.md) + - [Customizing](docs/user-guide/customize.md) + - [Configuring](docs/user-guide/configure.md) + - [Rules](docs/user-guide/rules.md) + - [Ignoring code](docs/user-guide/ignore-code.md) + - [CLI](docs/user-guide/cli.md) + - [Node.js API](docs/user-guide/node-api.md) + - [PostCSS plugin](docs/user-guide/postcss-plugin.md) + - [Options](docs/user-guide/options.md) + - [Errors & warnings](docs/user-guide/errors.md) +- Developer guide + - [Writing rules](docs/developer-guide/rules.md) + - [Writing plugins](docs/developer-guide/plugins.md) + - [Writing custom syntaxes](docs/developer-guide/syntaxes.md) + - [Writing custom formatters](docs/developer-guide/formatters.md) + - [Writing system tests](docs/developer-guide/system-tests.md) +- Migration guide + - [Migrating to 15.0.0](docs/migration-guide/to-15.md) + - [Migrating to 14.0.0](docs/migration-guide/to-14.md) +- Maintainer guide + - [Managing issues](docs/maintainer-guide/issues.md) + - [Managing pull requests](docs/maintainer-guide/pull-requests.md) + - [Performing releases](docs/maintainer-guide/releases.md) +- About + - [Vision](docs/about/vision.md) + - [Semantic versioning](docs/about/semantic-versioning.md) + +## Contributors + +Stylelint is maintained by volunteers. Without the code contributions from [all these fantastic people](https://github.com/stylelint/stylelint/graphs/contributors), Stylelint would not exist. [Become a contributor](CONTRIBUTING.md). + +### Sponsors + + + + + +Thank you to all our sponsors! [Become a sponsor](https://opencollective.com/stylelint). + +### Backers + + + + + +Thank you to all our backers! [Become a backer](https://opencollective.com/stylelint). + +### Website hosting + +[![Deploys by Netlify](https://www.netlify.com/img/global/badges/netlify-color-accent.svg)](https://www.netlify.com) + +## License + +[The MIT License](https://raw.githubusercontent.com/stylelint/stylelint/main/LICENSE). diff --git a/node_modules/stylelint/bin/stylelint.mjs b/node_modules/stylelint/bin/stylelint.mjs new file mode 100755 index 000000000..f9984171a --- /dev/null +++ b/node_modules/stylelint/bin/stylelint.mjs @@ -0,0 +1,5 @@ +#!/usr/bin/env node + +import cli from '../lib/cli.mjs'; + +cli(process.argv.slice(2)); diff --git a/node_modules/stylelint/lib/assignDisabledRanges.js b/node_modules/stylelint/lib/assignDisabledRanges.js new file mode 100644 index 000000000..7a7d40517 --- /dev/null +++ b/node_modules/stylelint/lib/assignDisabledRanges.js @@ -0,0 +1,417 @@ +'use strict'; + +const isStandardSyntaxComment = require('./utils/isStandardSyntaxComment'); +const { + DISABLE_COMMAND, + DISABLE_LINE_COMMAND, + DISABLE_NEXT_LINE_COMMAND, + ENABLE_COMMAND, + extractConfigurationComment, + getConfigurationComment, + isConfigurationComment, +} = require('./utils/configurationComment'); +const { assert, assertNumber, assertString } = require('./utils/validateTypes'); + +const ALL_RULES = 'all'; + +/** @typedef {import('postcss').Comment} PostcssComment */ +/** @typedef {import('postcss').Root} PostcssRoot */ +/** @typedef {import('postcss').Document} PostcssDocument */ +/** @typedef {import('stylelint').PostcssResult} PostcssResult */ +/** @typedef {import('stylelint').DisabledRangeObject} DisabledRangeObject */ +/** @typedef {import('stylelint').DisabledRange} DisabledRange */ + +/** + * @param {PostcssComment} comment + * @param {number} start + * @param {boolean} strictStart + * @param {string|undefined} description + * @param {number} [end] + * @param {boolean} [strictEnd] + * @returns {DisabledRange} + */ +function createDisableRange(comment, start, strictStart, description, end, strictEnd) { + return { + comment, + start, + end: end || undefined, + strictStart, + strictEnd: typeof strictEnd === 'boolean' ? strictEnd : undefined, + description, + }; +} + +/** + * Run it like a PostCSS plugin + * @param {PostcssRoot | PostcssDocument} root + * @param {PostcssResult} result + * @returns {PostcssResult} + */ +module.exports = function assignDisabledRanges(root, result) { + result.stylelint = result.stylelint || { + disabledRanges: {}, + ruleSeverities: {}, + customMessages: {}, + ruleMetadata: {}, + }; + + /** + * Most of the functions below work via side effects mutating this object + * @type {DisabledRangeObject & { all: DisabledRange[] }} + */ + const disabledRanges = { + [ALL_RULES]: [], + }; + + result.stylelint.disabledRanges = disabledRanges; + + // Work around postcss/postcss-scss#109 by merging adjacent `//` comments + // into a single node before passing to `checkComment`. + + /** @type {PostcssComment?} */ + let inlineEnd; + + const configurationComment = result.stylelint.config?.configurationComment; + + root.walkComments((comment) => { + if (inlineEnd) { + // Ignore comments already processed by grouping with a previous one. + if (inlineEnd === comment) inlineEnd = null; + + return; + } + + const nextComment = comment.next(); + + // If any of these conditions are not met, do not merge comments. + if ( + !( + !isStandardSyntaxComment(comment) && + isConfigurationComment(comment, configurationComment) && + nextComment && + nextComment.type === 'comment' && + (comment.text.includes('--') || nextComment.text.startsWith('--')) + ) + ) { + checkComment(comment); + + return; + } + + let lastLine = (comment.source && comment.source.end && comment.source.end.line) || 0; + const fullComment = comment.clone(); + + let current = nextComment; + + while ( + !isStandardSyntaxComment(current) && + !isConfigurationComment(current, configurationComment) + ) { + const currentLine = (current.source && current.source.end && current.source.end.line) || 0; + + if (lastLine + 1 !== currentLine) break; + + fullComment.text += `\n${current.text}`; + + if (fullComment.source && current.source) { + fullComment.source.end = current.source.end; + } + + inlineEnd = current; + const next = current.next(); + + if (!next || next.type !== 'comment') break; + + current = next; + lastLine = currentLine; + } + + checkComment(fullComment); + }); + + return result; + + /** + * @param {PostcssComment} comment + */ + function processDisableLineCommand(comment) { + if (comment.source && comment.source.start) { + const line = comment.source.start.line; + const description = getDescription(comment.text); + + for (const ruleName of getCommandRules(DISABLE_LINE_COMMAND, comment.text)) { + disableLine(comment, line, ruleName, description); + } + } + } + + /** + * @param {PostcssComment} comment + */ + function processDisableNextLineCommand(comment) { + if (comment.source && comment.source.end) { + const line = comment.source.end.line; + const description = getDescription(comment.text); + + for (const ruleName of getCommandRules(DISABLE_NEXT_LINE_COMMAND, comment.text)) { + disableLine(comment, line + 1, ruleName, description); + } + } + } + + /** + * @param {PostcssComment} comment + * @param {number} line + * @param {string} ruleName + * @param {string|undefined} description + */ + function disableLine(comment, line, ruleName, description) { + if (ruleIsDisabled(ALL_RULES)) { + throw comment.error('All rules have already been disabled', { + plugin: 'stylelint', + }); + } + + if (ruleName === ALL_RULES) { + for (const disabledRuleName of Object.keys(disabledRanges)) { + if (ruleIsDisabled(disabledRuleName)) continue; + + const strict = disabledRuleName === ALL_RULES; + + startDisabledRange(comment, line, disabledRuleName, strict, description); + endDisabledRange(line, disabledRuleName, strict); + } + } else { + if (ruleIsDisabled(ruleName)) { + throw comment.error(`"${ruleName}" has already been disabled`, { + plugin: 'stylelint', + }); + } + + startDisabledRange(comment, line, ruleName, true, description); + endDisabledRange(line, ruleName, true); + } + } + + /** + * @param {PostcssComment} comment + */ + function processDisableCommand(comment) { + const description = getDescription(comment.text); + + for (const ruleToDisable of getCommandRules(DISABLE_COMMAND, comment.text)) { + const isAllRules = ruleToDisable === ALL_RULES; + + if (ruleIsDisabled(ruleToDisable)) { + throw comment.error( + isAllRules + ? 'All rules have already been disabled' + : `"${ruleToDisable}" has already been disabled`, + { + plugin: 'stylelint', + }, + ); + } + + if (comment.source && comment.source.start) { + const line = comment.source.start.line; + + if (isAllRules) { + for (const ruleName of Object.keys(disabledRanges)) { + startDisabledRange(comment, line, ruleName, ruleName === ALL_RULES, description); + } + } else { + startDisabledRange(comment, line, ruleToDisable, true, description); + } + } + } + } + + /** + * @param {PostcssComment} comment + */ + function processEnableCommand(comment) { + for (const ruleToEnable of getCommandRules(ENABLE_COMMAND, comment.text)) { + // need fallback if endLine will be undefined + const endLine = comment.source && comment.source.end && comment.source.end.line; + + assertNumber(endLine); + + if (ruleToEnable === ALL_RULES) { + if ( + Object.values(disabledRanges).every((ranges) => { + if (ranges.length === 0) return true; + + const lastRange = ranges[ranges.length - 1]; + + return lastRange && typeof lastRange.end === 'number'; + }) + ) { + throw comment.error('No rules have been disabled', { + plugin: 'stylelint', + }); + } + + for (const [ruleName, ranges] of Object.entries(disabledRanges)) { + const lastRange = ranges[ranges.length - 1]; + + if (!lastRange || !lastRange.end) { + endDisabledRange(endLine, ruleName, ruleName === ALL_RULES); + } + } + + continue; + } + + if (ruleIsDisabled(ALL_RULES) && disabledRanges[ruleToEnable] === undefined) { + // Get a starting point from the where all rules were disabled + disabledRanges[ruleToEnable] = disabledRanges[ALL_RULES].map( + ({ start, end, description }) => + createDisableRange(comment, start, false, description, end, false), + ); + + endDisabledRange(endLine, ruleToEnable, true); + + continue; + } + + if (ruleIsDisabled(ruleToEnable)) { + endDisabledRange(endLine, ruleToEnable, true); + + continue; + } + + throw comment.error(`"${ruleToEnable}" has not been disabled`, { + plugin: 'stylelint', + }); + } + } + + /** + * @param {PostcssComment} comment + */ + function checkComment(comment) { + // Ignore comments that are not relevant commands + + if (!isConfigurationComment(comment, configurationComment)) { + return; + } + + switch (extractConfigurationComment(comment, configurationComment)) { + case DISABLE_LINE_COMMAND: + processDisableLineCommand(comment); + break; + case DISABLE_NEXT_LINE_COMMAND: + processDisableNextLineCommand(comment); + break; + case DISABLE_COMMAND: + processDisableCommand(comment); + break; + case ENABLE_COMMAND: + processEnableCommand(comment); + break; + } + } + + /** + * @param {string} command + * @param {string} fullText + * @returns {string[]} + */ + function getCommandRules(command, fullText) { + // Allow for description (f.e. /* stylelint-disable a, b -- Description */). + const fullCommand = getConfigurationComment(command, configurationComment); + const rulesText = fullText.slice(fullCommand.length).split(/\s-{2,}\s/u)[0]; + + assertString(rulesText); + const rules = rulesText + .trim() + .split(',') + .filter(Boolean) + .map((r) => r.trim()); + + if (rules.length === 0) { + return [ALL_RULES]; + } + + return rules; + } + + /** + * @param {string} fullText + * @returns {string|undefined} + */ + function getDescription(fullText) { + const descriptionStart = fullText.indexOf('--'); + + if (descriptionStart === -1) return; + + return fullText.slice(descriptionStart + 2).trim(); + } + + /** + * @param {PostcssComment} comment + * @param {number} line + * @param {string} ruleName + * @param {boolean} strict + * @param {string|undefined} description + */ + function startDisabledRange(comment, line, ruleName, strict, description) { + const rangeObj = createDisableRange(comment, line, strict, description); + + ensureRuleRanges(ruleName); + + const range = disabledRanges[ruleName]; + + assert(range); + range.push(rangeObj); + } + + /** + * @param {number} line + * @param {string} ruleName + * @param {boolean} strict + */ + function endDisabledRange(line, ruleName, strict) { + const ranges = disabledRanges[ruleName]; + const lastRangeForRule = ranges ? ranges[ranges.length - 1] : null; + + if (!lastRangeForRule) { + return; + } + + // Add an `end` prop to the last range of that rule + lastRangeForRule.end = line; + lastRangeForRule.strictEnd = strict; + } + + /** + * @param {string} ruleName + */ + function ensureRuleRanges(ruleName) { + if (!disabledRanges[ruleName]) { + disabledRanges[ruleName] = disabledRanges[ALL_RULES].map( + ({ comment, start, end, description }) => + createDisableRange(comment, start, false, description, end, false), + ); + } + } + + /** + * @param {string} ruleName + * @returns {boolean} + */ + function ruleIsDisabled(ruleName) { + const ranges = disabledRanges[ruleName]; + + if (!ranges) return false; + + const lastRange = ranges[ranges.length - 1]; + + if (!lastRange) return false; + + if (!lastRange.end) return true; + + return false; + } +}; diff --git a/node_modules/stylelint/lib/augmentConfig.js b/node_modules/stylelint/lib/augmentConfig.js new file mode 100644 index 000000000..9e87635d6 --- /dev/null +++ b/node_modules/stylelint/lib/augmentConfig.js @@ -0,0 +1,440 @@ +'use strict'; + +const configurationError = require('./utils/configurationError'); +const getModulePath = require('./utils/getModulePath'); +const globjoin = require('globjoin'); +const micromatch = require('micromatch'); +const normalizeAllRuleSettings = require('./normalizeAllRuleSettings'); +const normalizePath = require('normalize-path'); +const path = require('path'); + +/** @typedef {import('stylelint').InternalApi} StylelintInternalApi */ +/** @typedef {import('stylelint').Config} StylelintConfig */ +/** @typedef {import('stylelint').CosmiconfigResult} StylelintCosmiconfigResult */ + +/** + * @param {string} glob + * @param {string} basedir + * @returns {string} + */ +function absolutizeGlob(glob, basedir) { + const result = path.isAbsolute(glob.replace(/^!/, '')) ? glob : globjoin(basedir, glob); + + // Glob patterns for micromatch should be in POSIX-style + return normalizePath(result); +} + +/** + * - Merges config and stylelint options + * - Makes all paths absolute + * - Merges extends + * @param {StylelintInternalApi} stylelint + * @param {StylelintConfig} config + * @param {string} configDir + * @param {boolean} allowOverrides + * @param {string} rootConfigDir + * @param {string} [filePath] + * @returns {Promise} + */ +async function augmentConfigBasic( + stylelint, + config, + configDir, + allowOverrides, + rootConfigDir, + filePath, +) { + let augmentedConfig = config; + + if (allowOverrides) { + augmentedConfig = addOptions(stylelint, augmentedConfig); + } + + if (filePath) { + augmentedConfig = applyOverrides(augmentedConfig, rootConfigDir, filePath); + } + + augmentedConfig = await extendConfig( + stylelint, + augmentedConfig, + configDir, + rootConfigDir, + filePath, + ); + + const cwd = stylelint._options.cwd; + + return absolutizePaths(augmentedConfig, configDir, cwd); +} + +/** + * Extended configs need to be run through augmentConfigBasic + * but do not need the full treatment. Things like pluginFunctions + * will be resolved and added by the parent config. + * @param {string} cwd + * @returns {(cosmiconfigResult?: StylelintCosmiconfigResult) => Promise} + */ +function augmentConfigExtended(cwd) { + return async (cosmiconfigResult) => { + if (!cosmiconfigResult) { + return null; + } + + const configDir = path.dirname(cosmiconfigResult.filepath || ''); + const { config } = cosmiconfigResult; + + const augmentedConfig = absolutizePaths(config, configDir, cwd); + + return { + config: augmentedConfig, + filepath: cosmiconfigResult.filepath, + }; + }; +} + +/** + * @param {StylelintInternalApi} stylelint + * @param {string} [filePath] + * @param {StylelintCosmiconfigResult} [cosmiconfigResult] + * @returns {Promise} + */ +async function augmentConfigFull(stylelint, filePath, cosmiconfigResult) { + if (!cosmiconfigResult) { + return null; + } + + const config = cosmiconfigResult.config; + const filepath = cosmiconfigResult.filepath; + + const configDir = stylelint._options.configBasedir || path.dirname(filepath || ''); + + let augmentedConfig = await augmentConfigBasic( + stylelint, + config, + configDir, + true, + configDir, + filePath, + ); + + augmentedConfig = addPluginFunctions(augmentedConfig); + + if (!augmentedConfig.rules) { + throw configurationError( + 'No rules found within configuration. Have you provided a "rules" property?', + ); + } + + augmentedConfig = normalizeAllRuleSettings(augmentedConfig); + + return { + config: augmentedConfig, + filepath: cosmiconfigResult.filepath, + }; +} + +/** + * Make all paths in the config absolute. + * + * @param {StylelintConfig} config + * @param {string} configDir + * @param {string} cwd + * @returns {StylelintConfig} + */ +function absolutizePaths(config, configDir, cwd) { + if (config.ignoreFiles) { + config.ignoreFiles = [config.ignoreFiles].flat().map((glob) => absolutizeGlob(glob, configDir)); + } + + if (config.plugins) { + config.plugins = [config.plugins].flat().map((lookup) => { + if (typeof lookup === 'string') { + return getModulePath(configDir, lookup, cwd); + } + + return lookup; + }); + } + + return config; +} + +/** + * @param {StylelintInternalApi} stylelint + * @param {StylelintConfig} config + * @param {string} configDir + * @param {string} rootConfigDir + * @param {string} [filePath] + * @return {Promise} + */ +async function extendConfig(stylelint, config, configDir, rootConfigDir, filePath) { + if (config.extends === undefined) { + return config; + } + + const { extends: configExtends, ...originalWithoutExtends } = config; + const normalizedExtends = [configExtends].flat(); + + let resultConfig = originalWithoutExtends; + + for (const extendLookup of normalizedExtends) { + let extendResult; + + if (typeof extendLookup === 'string') { + extendResult = await loadExtendedConfig(stylelint, configDir, extendLookup); + } else if (typeof extendLookup === 'object' && extendLookup !== null) { + extendResult = { config: extendLookup }; + } + + if (extendResult) { + let extendResultConfig = extendResult.config; + const extendConfigDir = path.dirname(extendResult.filepath || ''); + + extendResultConfig = await augmentConfigBasic( + stylelint, + extendResultConfig, + extendConfigDir, + false, + rootConfigDir, + filePath, + ); + + resultConfig = mergeConfigs(resultConfig, extendResultConfig); + } + } + + return mergeConfigs(resultConfig, originalWithoutExtends); +} + +/** + * @param {StylelintInternalApi} stylelint + * @param {string} configDir + * @param {string} extendLookup + * @return {Promise} + */ +function loadExtendedConfig(stylelint, configDir, extendLookup) { + const extendPath = getModulePath(configDir, extendLookup, stylelint._options.cwd); + + return stylelint._extendExplorer.load(extendPath); +} + +/** + * When merging configs (via extends) + * - plugin, extends, overrides arrays are joined + * - rules are merged via Object.assign, so there is no attempt made to + * merge any given rule's settings. If b contains the same rule as a, + * b's rule settings will override a's rule settings entirely. + * - Everything else is merged via Object.assign + * @param {StylelintConfig} a + * @param {StylelintConfig} b + * @returns {StylelintConfig} + */ +function mergeConfigs(a, b) { + /** @type {Pick} */ + const pluginMerger = {}; + + if (a.plugins || b.plugins) { + pluginMerger.plugins = []; + + if (a.plugins) { + pluginMerger.plugins = pluginMerger.plugins.concat(a.plugins); + } + + if (b.plugins) { + pluginMerger.plugins = [...new Set(pluginMerger.plugins.concat(b.plugins))]; + } + } + + /** @type {Pick} */ + const overridesMerger = {}; + + if (a.overrides || b.overrides) { + overridesMerger.overrides = []; + + if (a.overrides) { + overridesMerger.overrides = overridesMerger.overrides.concat(a.overrides); + } + + if (b.overrides) { + overridesMerger.overrides = [...new Set(overridesMerger.overrides.concat(b.overrides))]; + } + } + + /** @type {Pick} */ + const extendsMerger = {}; + + if (a.extends || b.extends) { + extendsMerger.extends = []; + + if (a.extends) { + extendsMerger.extends = extendsMerger.extends.concat(a.extends); + } + + if (b.extends) { + extendsMerger.extends = extendsMerger.extends.concat(b.extends); + } + + // Remove duplicates from the array, the last item takes precedence + extendsMerger.extends = extendsMerger.extends.filter( + (item, index, arr) => arr.lastIndexOf(item) === index, + ); + } + + const rulesMerger = {}; + + if (a.rules || b.rules) { + rulesMerger.rules = { ...a.rules, ...b.rules }; + } + + const result = { + ...a, + ...b, + ...extendsMerger, + ...pluginMerger, + ...overridesMerger, + ...rulesMerger, + }; + + return result; +} + +/** + * @param {StylelintConfig} config + * @returns {StylelintConfig} + */ +function addPluginFunctions(config) { + if (!config.plugins) { + return config; + } + + const normalizedPlugins = [config.plugins].flat(); + + /** @type {StylelintConfig['pluginFunctions']} */ + const pluginFunctions = {}; + + for (const pluginLookup of normalizedPlugins) { + let pluginImport; + + if (typeof pluginLookup === 'string') { + pluginImport = require(pluginLookup); + } else { + pluginImport = pluginLookup; + } + + // Handle either ES6 or CommonJS modules + pluginImport = pluginImport.default || pluginImport; + + // A plugin can export either a single rule definition + // or an array of them + const normalizedPluginImport = [pluginImport].flat(); + + for (const pluginRuleDefinition of normalizedPluginImport) { + if (!pluginRuleDefinition.ruleName) { + throw configurationError( + `stylelint requires plugins to expose a ruleName. The plugin "${pluginLookup}" is not doing this, so will not work with stylelint. Please file an issue with the plugin.`, + ); + } + + if (!pluginRuleDefinition.ruleName.includes('/')) { + throw configurationError( + `stylelint requires plugin rules to be namespaced, i.e. only \`plugin-namespace/plugin-rule-name\` plugin rule names are supported. The plugin rule "${pluginRuleDefinition.ruleName}" does not do this, so will not work. Please file an issue with the plugin.`, + ); + } + + pluginFunctions[pluginRuleDefinition.ruleName] = pluginRuleDefinition.rule; + } + } + + config.pluginFunctions = pluginFunctions; + + return config; +} + +/** + * @param {StylelintConfig} fullConfig + * @param {string} rootConfigDir + * @param {string} filePath + * @return {StylelintConfig} + */ +function applyOverrides(fullConfig, rootConfigDir, filePath) { + let { overrides, ...config } = fullConfig; + + if (!overrides) { + return config; + } + + if (!Array.isArray(overrides)) { + throw new TypeError( + 'The `overrides` configuration property should be an array, e.g. { "overrides": [{ "files": "*.css", "rules": {} }] }.', + ); + } + + for (const override of overrides) { + const { files, ...configOverrides } = override; + + if (!files) { + throw new Error( + 'Every object in the `overrides` configuration property should have a `files` property with globs, e.g. { "overrides": [{ "files": "*.css", "rules": {} }] }.', + ); + } + + const absoluteGlobs = [files].flat().map((glob) => absolutizeGlob(glob, rootConfigDir)); + + if ( + micromatch.isMatch(filePath, absoluteGlobs, { dot: true }) || + // E.g. `*.css` matches any CSS files in any directories. + micromatch.isMatch(filePath, files, { dot: true, basename: true }) + ) { + config = mergeConfigs(config, configOverrides); + } + } + + return config; +} + +/** + * Add options to the config + * + * @param {StylelintInternalApi} stylelint + * @param {StylelintConfig} config + * + * @returns {StylelintConfig} + */ +function addOptions(stylelint, config) { + const augmentedConfig = { + ...config, + }; + + if (stylelint._options.ignoreDisables) { + augmentedConfig.ignoreDisables = stylelint._options.ignoreDisables; + } + + if (stylelint._options.quiet) { + augmentedConfig.quiet = stylelint._options.quiet; + } + + if (stylelint._options.reportNeedlessDisables) { + augmentedConfig.reportNeedlessDisables = stylelint._options.reportNeedlessDisables; + } + + if (stylelint._options.reportInvalidScopeDisables) { + augmentedConfig.reportInvalidScopeDisables = stylelint._options.reportInvalidScopeDisables; + } + + if (stylelint._options.reportDescriptionlessDisables) { + augmentedConfig.reportDescriptionlessDisables = + stylelint._options.reportDescriptionlessDisables; + } + + if (stylelint._options.customSyntax) { + augmentedConfig.customSyntax = stylelint._options.customSyntax; + } + + if (stylelint._options.fix) { + augmentedConfig.fix = stylelint._options.fix; + } + + return augmentedConfig; +} + +module.exports = { augmentConfigExtended, augmentConfigFull, applyOverrides }; diff --git a/node_modules/stylelint/lib/cli.mjs b/node_modules/stylelint/lib/cli.mjs new file mode 100644 index 000000000..33f1fb282 --- /dev/null +++ b/node_modules/stylelint/lib/cli.mjs @@ -0,0 +1,639 @@ +import picocolors from 'picocolors'; +const { dim, red } = picocolors; + +import { EOL } from 'os'; +import meow from 'meow'; +import path from 'path'; +import resolveFrom from 'resolve-from'; + +import checkInvalidCLIOptions from './utils/checkInvalidCLIOptions.js'; +import { isPlainObject } from './utils/validateTypes.js'; +import printConfig from './printConfig.js'; +import resolveCustomFormatter from './resolveCustomFormatter.js'; +import standalone from './standalone.js'; +import writeOutputFile from './writeOutputFile.js'; + +import { + DEFAULT_CACHE_LOCATION, + DEFAULT_FORMATTER, + DEFAULT_IGNORE_FILENAME, + EXIT_CODE_ERROR, +} from './constants.js'; + +import { createRequire } from 'module'; +// @ts-expect-error +const require = createRequire(import.meta.url); + +/** + * @typedef {{ + * allowEmptyInput: boolean; + * cache: boolean; + * cacheLocation?: string; + * cacheStrategy?: string; + * color: boolean; + * config?: string; + * configBasedir?: string; + * customFormatter?: string; + * customSyntax?: string; + * disableDefaultIgnores: boolean; + * fix: boolean; + * formatter: string; + * globbyOptions?: string; + * help: boolean; + * ignoreDisables: boolean; + * ignorePath: string[]; + * ignorePattern: string[]; + * maxWarnings?: number; + * outputFile?: string; + * printConfig: boolean; + * quiet: boolean; + * quietDeprecationWarnings: boolean; + * reportDescriptionlessDisables: boolean; + * reportInvalidScopeDisables: boolean; + * reportNeedlessDisables: boolean; + * stdin: boolean; + * stdinFilename?: string; + * version: boolean; + * }} CLIFlags + */ + +/** + * @typedef {{ + * input: string[]; + * showHelp: (code: number) => void; + * showVersion: () => void; + * flags: CLIFlags; + * }} CLIOptions + */ + +/** + * @typedef {{ + * allowEmptyInput?: boolean; + * cache?: boolean; + * cacheLocation?: string; + * cacheStrategy?: string; + * code?: string; + * codeFilename?: string; + * configFile?: string; + * configBasedir?: string; + * customSyntax?: string; + * disableDefaultIgnores?: boolean; + * files?: string[]; + * fix?: boolean; + * formatter: any; + * globbyOptions?: Record; + * ignoreDisables?: boolean; + * ignorePath?: string[]; + * ignorePattern?: string[]; + * maxWarnings?: number; + * outputFile?: string; + * quiet?: boolean; + * quietDeprecationWarnings?: boolean; + * reportDescriptionlessDisables?: boolean; + * reportInvalidScopeDisables?: boolean; + * reportNeedlessDisables?: boolean; + * }} OptionBaseType + */ + +const meowOptions = { + autoHelp: false, + autoVersion: false, + help: ` + Usage: stylelint [input] [options] + + Input: Files(s), glob(s), or nothing to use stdin. + + If an input argument is wrapped in quotation marks, it will be passed to + globby for cross-platform glob support. "node_modules" are always ignored. + You can also pass no input and use stdin, instead. + + Options: + + --config, -c + + A path to a specific configuration file (JSON, YAML, CommonJS, or ES module), + or a module name in "node_modules" that points to one. If no argument is + provided, Stylelint will search for configuration files in the following + places, in this order: + + - a "stylelint" property in "package.json" + - a ".stylelintrc" file + - a ".stylelintrc.{cjs,mjs,js,json,yaml,yml}" file + - a "stylelint.config.{cjs,mjs,js}" file + + The search will begin in the working directory and move up the directory + tree until a configuration file is found. + + --config-basedir + + An absolute path to the directory that relative paths defining "extends", + "plugins", and "customSyntax" are *relative to*. Only necessary if these + values are relative paths. + + --print-config + + Print the configuration for the given input file path. Globs are unsupported. + + --ignore-path, -i + + A path to a file containing patterns that describe files to ignore. The + path can be absolute or relative to "process.cwd()". You can repeat the + option to provide multiple paths. By default, Stylelint looks for + "${DEFAULT_IGNORE_FILENAME}" in "process.cwd()". Multiple can be set. + + --ignore-pattern, --ip + + A pattern of files to ignore (in addition to those in "${DEFAULT_IGNORE_FILENAME}"). + Multiple can be set. + + --fix + + Automatically fix problems of certain rules. + + --custom-syntax + + A module name or path to a JS file exporting a PostCSS-compatible syntax. + + --stdin + + Accept stdin input even if it is empty. + + --stdin-filename + + A filename to assign stdin input. + + --ignore-disables, --id + + Ignore "stylelint-disable" comments. + + --disable-default-ignores, --di + + Allow linting of "node_modules". + + --[no-]cache + + Store the info about processed files in order to only operate on the + changed ones the next time you run Stylelint. By default, the cache is + stored in "${DEFAULT_CACHE_LOCATION}". To adjust this, use "--cache-location". + Cache is disabled by default. + + --cache-location + + A path to a file or directory to be used for the cache location. If a + directory is specified, a cache file will be created inside the specified + folder, with a name derived from a hash of the current working directory. + + If the directory for the cache does not exist, make sure you add a trailing "/" + on *nix systems or "\\" on Windows. Otherwise the path will be assumed to + be a file. + + --cache-strategy + + A strategy for the cache to use for detecting changed files. Either one of: + + metadata by metadata of a file (default) + content by content of a file + + The "content" strategy can be useful in cases where the modification time + of your files changes even if their contents have not. For example, this can + happen during git operations like "git clone" because git does not track file + modification time. + + --formatter, -f + + An output formatter. The variants are as follows: + + string human-readable strings (default) + compact similar to ESLint's compact formatter + github workflow commands for GitHub Actions + json JSON format + tap TAP format + unix C compiler-like format + verbose extend "string" to include a file list and a tally + + --custom-formatter + + A path to a JS file or module name exporting a custom formatting function. + + --quiet, -q + + Only register problems for rules with an "error"-level severity (ignore + "warning"-level). + + --quiet-deprecation-warnings + + Ignore deprecations warnings. + + --[no-]color + + Force enabling/disabling of color. + + --report-needless-disables, --rd + + Also report errors for "stylelint-disable" comments that are not blocking + a lint warning. The process will exit with code ${EXIT_CODE_ERROR} if needless disables are found. + + --report-invalid-scope-disables, --risd + + Report "stylelint-disable" comments that used for rules that don't exist + within the configuration object. The process will exit with code ${EXIT_CODE_ERROR} if invalid + scope disables are found. + + --report-descriptionless-disables, --rdd + + Report "stylelint-disable" comments without a description. The process will + exit with code ${EXIT_CODE_ERROR} if descriptionless disables are found. + + --max-warnings, --mw + + The number of warnings above which the process will exit with code ${EXIT_CODE_ERROR}. + Useful when setting "defaultSeverity" to "warning" and expecting the process + to fail on warnings (e.g. CI build). + + --output-file, -o + + A file path to write a report. + + --allow-empty-input, --aei + + When a glob pattern matches no files, the process will exit without throwing an error. + + --globby-options, --go + + Options in JSON format passed to globby. + + --version, -v + + Show the version. + + --help, -h + + Show the help. + `, + flags: { + allowEmptyInput: { + alias: 'aei', + type: 'boolean', + }, + cache: { + type: 'boolean', + }, + cacheLocation: { + type: 'string', + }, + cacheStrategy: { + type: 'string', + }, + color: { + type: 'boolean', + }, + config: { + alias: 'c', + type: 'string', + }, + configBasedir: { + type: 'string', + }, + customFormatter: { + type: 'string', + }, + customSyntax: { + type: 'string', + }, + disableDefaultIgnores: { + alias: 'di', + type: 'boolean', + }, + fix: { + type: 'boolean', + }, + formatter: { + alias: 'f', + type: 'string', + default: DEFAULT_FORMATTER, + }, + globbyOptions: { + alias: 'go', + type: 'string', + }, + help: { + alias: 'h', + type: 'boolean', + }, + ignoreDisables: { + alias: 'id', + type: 'boolean', + }, + ignorePath: { + alias: 'i', + type: 'string', + isMultiple: true, + }, + ignorePattern: { + alias: 'ip', + type: 'string', + isMultiple: true, + }, + maxWarnings: { + alias: 'mw', + type: 'number', + }, + outputFile: { + alias: 'o', + type: 'string', + }, + printConfig: { + type: 'boolean', + }, + quiet: { + alias: 'q', + type: 'boolean', + }, + quietDeprecationWarnings: { + type: 'boolean', + }, + reportDescriptionlessDisables: { + alias: 'rdd', + type: 'boolean', + }, + reportInvalidScopeDisables: { + alias: 'risd', + type: 'boolean', + }, + reportNeedlessDisables: { + alias: 'rd', + type: 'boolean', + }, + stdin: { + type: 'boolean', + }, + stdinFilename: { + type: 'string', + }, + version: { + alias: 'v', + type: 'boolean', + }, + }, +}; + +/** + * @param {string[]} argv + * @returns {Promise} + */ +export default async function main(argv) { + const cli = buildCLI(argv); + + const invalidOptionsMessage = checkInvalidCLIOptions(meowOptions.flags, cli.flags); + + if (invalidOptionsMessage) { + process.stderr.write(invalidOptionsMessage); + process.exit(EXIT_CODE_ERROR); // eslint-disable-line n/no-process-exit + } + + let formatter = cli.flags.formatter; + + if (cli.flags.customFormatter) { + const customFormatter = resolveCustomFormatter(cli.flags.customFormatter); + + formatter = require(customFormatter); + } + + /** @type {OptionBaseType} */ + const optionsBase = { + formatter, + }; + + if (cli.flags.quiet) { + optionsBase.quiet = cli.flags.quiet; + } + + if (cli.flags.quietDeprecationWarnings) { + optionsBase.quietDeprecationWarnings = cli.flags.quietDeprecationWarnings; + } + + if (cli.flags.customSyntax) { + optionsBase.customSyntax = cli.flags.customSyntax; + } + + if (cli.flags.config) { + // Should check these possibilities: + // a. name of a node_module + // b. absolute path + // c. relative path relative to `process.cwd()`. + // If none of the above work, we'll try a relative path starting + // in `process.cwd()`. + optionsBase.configFile = + resolveFrom.silent(process.cwd(), cli.flags.config) || + path.join(process.cwd(), cli.flags.config); + } + + if (cli.flags.configBasedir) { + optionsBase.configBasedir = path.isAbsolute(cli.flags.configBasedir) + ? cli.flags.configBasedir + : path.resolve(process.cwd(), cli.flags.configBasedir); + } + + if (cli.flags.globbyOptions) { + try { + optionsBase.globbyOptions = await parseGlobbyOptions(cli.flags.globbyOptions); + } catch (error) { + if (typeof error === 'string') { + process.stderr.write(`${error}${EOL}`); + process.exitCode = EXIT_CODE_ERROR; + + return; + } + + throw error; + } + } + + if (cli.flags.stdinFilename) { + optionsBase.codeFilename = cli.flags.stdinFilename; + } + + if (cli.flags.ignorePath) { + optionsBase.ignorePath = cli.flags.ignorePath; + } + + if (cli.flags.ignorePattern) { + optionsBase.ignorePattern = cli.flags.ignorePattern; + } + + if (cli.flags.ignoreDisables) { + optionsBase.ignoreDisables = cli.flags.ignoreDisables; + } + + if (cli.flags.disableDefaultIgnores) { + optionsBase.disableDefaultIgnores = cli.flags.disableDefaultIgnores; + } + + if (cli.flags.cache) { + optionsBase.cache = true; + } + + if (cli.flags.cacheLocation) { + optionsBase.cacheLocation = cli.flags.cacheLocation; + } + + if (cli.flags.cacheStrategy) { + optionsBase.cacheStrategy = cli.flags.cacheStrategy; + } + + if (cli.flags.fix) { + optionsBase.fix = cli.flags.fix; + } + + if (cli.flags.outputFile) { + optionsBase.outputFile = cli.flags.outputFile; + } + + const reportNeedlessDisables = cli.flags.reportNeedlessDisables; + const reportInvalidScopeDisables = cli.flags.reportInvalidScopeDisables; + const reportDescriptionlessDisables = cli.flags.reportDescriptionlessDisables; + + if (reportNeedlessDisables) { + optionsBase.reportNeedlessDisables = reportNeedlessDisables; + } + + if (reportInvalidScopeDisables) { + optionsBase.reportInvalidScopeDisables = reportInvalidScopeDisables; + } + + if (reportDescriptionlessDisables) { + optionsBase.reportDescriptionlessDisables = reportDescriptionlessDisables; + } + + const maxWarnings = cli.flags.maxWarnings; + + if (maxWarnings !== undefined) { + optionsBase.maxWarnings = maxWarnings; + } + + if (cli.flags.help) { + cli.showHelp(0); + + return; + } + + if (cli.flags.version) { + cli.showVersion(); + + return; + } + + if (cli.flags.allowEmptyInput) { + optionsBase.allowEmptyInput = cli.flags.allowEmptyInput; + } + + // Add input/code into options + /** @type {OptionBaseType} */ + const options = cli.input.length + ? { + ...optionsBase, + files: cli.input, + } + : await getStdin().then((stdin) => ({ + ...optionsBase, + code: stdin, + })); + + if (cli.flags.printConfig) { + return printConfig(options) + .then((config) => { + process.stdout.write(JSON.stringify(config, null, ' ')); + }) + .catch(handleError); + } + + if (!options.files && !options.code && !cli.flags.stdin) { + cli.showHelp(0); + + return; + } + + return standalone(options) + .then((linted) => { + if (!linted.output) { + return; + } + + process.stdout.write(linted.output); + + if (options.outputFile) { + writeOutputFile(linted.output, options.outputFile).catch(handleError); + } + + if (linted.errored) { + process.exitCode = EXIT_CODE_ERROR; + } else if (maxWarnings !== undefined && linted.maxWarningsExceeded) { + const foundWarnings = linted.maxWarningsExceeded.foundWarnings; + + process.stderr.write( + `${EOL}${red(`Max warnings exceeded: `)}${foundWarnings} found. ${dim( + `${maxWarnings} allowed${EOL}${EOL}`, + )}`, + ); + process.exitCode = EXIT_CODE_ERROR; + } + }) + .catch(handleError); +} + +/** + * @param {{ stack: any, code: any }} err + * @returns {void} + */ +function handleError(err) { + process.stderr.write(err.stack + EOL); + const exitCode = typeof err.code === 'number' ? err.code : 1; + + process.exitCode = exitCode; +} + +/** + * @param {string} value + * @returns {Promise>} + */ +function parseGlobbyOptions(value) { + const errorMessage = () => + `Invalid option ${red('"--globby-options"')}.` + + ` The value ${red(`"${value}"`)} is not valid JSON object.`; + + let options; + + try { + options = JSON.parse(value); + } catch (_) { + return Promise.reject(errorMessage()); + } + + if (isPlainObject(options)) { + return Promise.resolve(options); + } + + return Promise.reject(errorMessage()); +} + +/** + * @returns {Promise} + */ +async function getStdin() { + const chunks = []; + + for await (const chunk of process.stdin) { + chunks.push(chunk); + } + + return Buffer.concat(chunks).toString(); +} + +/** + * @param {string[]} argv + * @returns {CLIOptions} + */ +export function buildCLI(argv) { + // @ts-expect-error -- TS2322: Type 'Result' is not assignable to type 'CLIOptions'. + return meow({ ...meowOptions, argv, importMeta: import.meta }); +} diff --git a/node_modules/stylelint/lib/constants.js b/node_modules/stylelint/lib/constants.js new file mode 100644 index 000000000..94d816b26 --- /dev/null +++ b/node_modules/stylelint/lib/constants.js @@ -0,0 +1,25 @@ +'use strict'; + +const DEFAULT_CACHE_LOCATION = './.stylelintcache'; +const CACHE_STRATEGY_METADATA = 'metadata'; +const CACHE_STRATEGY_CONTENT = 'content'; +const DEFAULT_CACHE_STRATEGY = CACHE_STRATEGY_METADATA; + +const DEFAULT_IGNORE_FILENAME = '.stylelintignore'; + +const DEFAULT_FORMATTER = 'string'; + +const EXIT_CODE_ERROR = 2; + +module.exports = { + DEFAULT_CACHE_LOCATION, + CACHE_STRATEGY_METADATA, + CACHE_STRATEGY_CONTENT, + DEFAULT_CACHE_STRATEGY, + + DEFAULT_IGNORE_FILENAME, + + DEFAULT_FORMATTER, + + EXIT_CODE_ERROR, +}; diff --git a/node_modules/stylelint/lib/createPartialStylelintResult.js b/node_modules/stylelint/lib/createPartialStylelintResult.js new file mode 100644 index 000000000..171dfc9d8 --- /dev/null +++ b/node_modules/stylelint/lib/createPartialStylelintResult.js @@ -0,0 +1,109 @@ +'use strict'; + +/** @typedef {import('stylelint').PostcssResult} PostcssResult */ +/** @typedef {import('stylelint').LintResult} StylelintResult */ + +/** + * @param {PostcssResult} [postcssResult] + * @param {import('stylelint').CssSyntaxError} [cssSyntaxError] + * @return {StylelintResult} + */ +module.exports = function createPartialStylelintResult(postcssResult, cssSyntaxError) { + /** @type {StylelintResult} */ + let stylelintResult; + /** @type {string | undefined} */ + let source; + + if (postcssResult && postcssResult.root) { + if (postcssResult.root.source) { + source = postcssResult.root.source.input.file; + + if (!source && 'id' in postcssResult.root.source.input) { + source = postcssResult.root.source.input.id; + } + } + + const deprecationMessages = postcssResult.messages.filter( + (message) => message.stylelintType === 'deprecation', + ); + const deprecations = deprecationMessages.map((deprecationMessage) => { + return { + text: deprecationMessage.text, + reference: deprecationMessage.stylelintReference, + }; + }); + + const invalidOptionMessages = postcssResult.messages.filter( + (message) => message.stylelintType === 'invalidOption', + ); + const invalidOptionWarnings = invalidOptionMessages.map((invalidOptionMessage) => { + return { + text: invalidOptionMessage.text, + }; + }); + + const parseErrors = postcssResult.messages.filter( + (message) => message.stylelintType === 'parseError', + ); + + // Remove deprecation warnings, invalid options, and parse errors from the messages + postcssResult.messages = postcssResult.messages.filter( + (message) => + message.stylelintType !== 'deprecation' && + message.stylelintType !== 'invalidOption' && + message.stylelintType !== 'parseError', + ); + + // This defines the stylelint result object that formatters receive + stylelintResult = { + source, + deprecations, + invalidOptionWarnings, + // @ts-expect-error -- TS2322: Type 'Message[]' is not assignable to type '(Warning & { stylelintType: string; })[]'. + parseErrors, + errored: postcssResult.stylelint.stylelintError, + warnings: postcssResult.messages.map((message) => { + return { + line: message.line, + column: message.column, + endLine: message.endLine, + endColumn: message.endColumn, + rule: message.rule, + severity: message.severity, + text: message.text, + }; + }), + ignored: postcssResult.stylelint.ignored, + _postcssResult: postcssResult, + }; + } else if (cssSyntaxError) { + if (cssSyntaxError.name !== 'CssSyntaxError') { + throw cssSyntaxError; + } + + stylelintResult = { + source: cssSyntaxError.file || '', + deprecations: [], + invalidOptionWarnings: [], + parseErrors: [], + errored: true, + warnings: [ + { + line: cssSyntaxError.line, + column: cssSyntaxError.column, + endLine: cssSyntaxError.endLine, + endColumn: cssSyntaxError.endColumn, + rule: cssSyntaxError.name, + severity: 'error', + text: `${cssSyntaxError.reason} (${cssSyntaxError.name})`, + }, + ], + }; + } else { + throw new Error( + 'createPartialStylelintResult must be called with either postcssResult or CssSyntaxError', + ); + } + + return stylelintResult; +}; diff --git a/node_modules/stylelint/lib/createPlugin.js b/node_modules/stylelint/lib/createPlugin.js new file mode 100644 index 000000000..e6d3e3ad1 --- /dev/null +++ b/node_modules/stylelint/lib/createPlugin.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * @type {import('stylelint')['createPlugin']} + */ +module.exports = function createPlugin(ruleName, rule) { + return { + ruleName, + rule, + }; +}; diff --git a/node_modules/stylelint/lib/createStylelint.js b/node_modules/stylelint/lib/createStylelint.js new file mode 100644 index 000000000..3165cc433 --- /dev/null +++ b/node_modules/stylelint/lib/createStylelint.js @@ -0,0 +1,35 @@ +'use strict'; + +const { cosmiconfig, defaultLoadersSync } = require('cosmiconfig'); + +const augmentConfig = require('./augmentConfig'); +const FileCache = require('./utils/FileCache'); + +const IS_TEST = process.env.NODE_ENV === 'test'; +const STOP_DIR = IS_TEST ? process.cwd() : undefined; + +/** + * @type {import('stylelint')['_createLinter']} + */ +module.exports = function createStylelint(options = {}) { + const cwd = options.cwd || process.cwd(); + + return { + _options: { ...options, cwd }, + + _extendExplorer: cosmiconfig('', { + transform: augmentConfig.augmentConfigExtended(cwd), + loaders: { + '.cjs': (cjsPath, cjsContent) => + Promise.resolve(defaultLoadersSync['.cjs'](cjsPath, cjsContent)), + '.js': (jsPath, cjsContent) => + Promise.resolve(defaultLoadersSync['.js'](jsPath, cjsContent)), + }, + stopDir: STOP_DIR, + }), + + _specifiedConfigCache: new Map(), + _postcssResultCache: new Map(), + _fileCache: new FileCache(options.cacheLocation, options.cacheStrategy, cwd), + }; +}; diff --git a/node_modules/stylelint/lib/descriptionlessDisables.js b/node_modules/stylelint/lib/descriptionlessDisables.js new file mode 100644 index 000000000..4c8d7b1c1 --- /dev/null +++ b/node_modules/stylelint/lib/descriptionlessDisables.js @@ -0,0 +1,61 @@ +'use strict'; + +const optionsMatches = require('./utils/optionsMatches'); +const validateDisableSettings = require('./validateDisableSettings'); + +/** @typedef {import('postcss').Comment} PostcssComment */ +/** @typedef {import('stylelint').DisableReportRange} DisableReportRange */ +/** @typedef {import('stylelint').DisableOptionsReport} StylelintDisableOptionsReport */ + +/** + * @param {import('stylelint').LintResult[]} results + */ +module.exports = function descriptionlessDisables(results) { + for (const result of results) { + const settings = validateDisableSettings( + result._postcssResult, + 'reportDescriptionlessDisables', + ); + + if (!settings) continue; + + const [enabled, options, stylelintResult] = settings; + + /** @type {Set} */ + const alreadyReported = new Set(); + + for (const [rule, ruleRanges] of Object.entries(stylelintResult.disabledRanges)) { + for (const range of ruleRanges) { + if (range.description) continue; + + if (alreadyReported.has(range.comment)) continue; + + if (enabled === optionsMatches(options, 'except', rule)) { + // An 'all' rule will get copied for each individual rule. If the + // configuration is `[false, {except: ['specific-rule']}]`, we + // don't want to report the copies that match except, so we record + // the comment as already reported. + if (!enabled && rule === 'all') alreadyReported.add(range.comment); + + continue; + } + + alreadyReported.add(range.comment); + + // If the comment doesn't have a location, we can't report a useful error. + // In practice we expect all comments to have locations, though. + if (!range.comment.source || !range.comment.source.start) continue; + + result.warnings.push({ + text: `Disable for "${rule}" is missing a description`, + rule: '--report-descriptionless-disables', + line: range.comment.source.start.line, + column: range.comment.source.start.column, + endLine: range.comment.source.end && range.comment.source.end.line, + endColumn: range.comment.source.end && range.comment.source.end.column, + severity: options.severity, + }); + } + } + } +}; diff --git a/node_modules/stylelint/lib/formatters/calcSeverityCounts.js b/node_modules/stylelint/lib/formatters/calcSeverityCounts.js new file mode 100644 index 000000000..b19e9c66f --- /dev/null +++ b/node_modules/stylelint/lib/formatters/calcSeverityCounts.js @@ -0,0 +1,21 @@ +'use strict'; + +/** + * @typedef {import('stylelint').Severity} Severity + * + * @param {Severity} severity + * @param {Record} counts + * @returns {void} + */ +module.exports = function calcSeverityCounts(severity, counts) { + switch (severity) { + case 'error': + counts.error += 1; + break; + case 'warning': + counts.warning += 1; + break; + default: + throw new Error(`Unknown severity: "${severity}"`); + } +}; diff --git a/node_modules/stylelint/lib/formatters/compactFormatter.js b/node_modules/stylelint/lib/formatters/compactFormatter.js new file mode 100644 index 000000000..a4318ea18 --- /dev/null +++ b/node_modules/stylelint/lib/formatters/compactFormatter.js @@ -0,0 +1,23 @@ +'use strict'; + +const preprocessWarnings = require('./preprocessWarnings'); + +/** + * @type {import('stylelint').Formatter} + */ +module.exports = function compactFormatter(results) { + return results + .flatMap((result) => { + const { warnings } = preprocessWarnings(result); + + return warnings.map( + (warning) => + `${result.source}: ` + + `line ${warning.line}, ` + + `col ${warning.column}, ` + + `${warning.severity} - ` + + `${warning.text}`, + ); + }) + .join('\n'); +}; diff --git a/node_modules/stylelint/lib/formatters/githubFormatter.js b/node_modules/stylelint/lib/formatters/githubFormatter.js new file mode 100644 index 000000000..1a4b440f1 --- /dev/null +++ b/node_modules/stylelint/lib/formatters/githubFormatter.js @@ -0,0 +1,51 @@ +'use strict'; + +const preprocessWarnings = require('./preprocessWarnings'); + +/** + * @see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions + * + * @type {import('stylelint').Formatter} + */ +module.exports = function githubFormatter(results, returnValue) { + const title = 'Stylelint problem'; + const metadata = returnValue.ruleMetadata; + + const lines = results.flatMap((result) => { + const { source, warnings } = preprocessWarnings(result); + + return warnings.map(({ line, column, endLine, endColumn, text, severity, rule }) => { + const msg = buildMessage(text, metadata[rule]); + + return endLine === undefined + ? `::${severity} file=${source},line=${line},col=${column},title=${title}::${msg}` + : `::${severity} file=${source},line=${line},col=${column},endLine=${endLine},endColumn=${endColumn},title=${title}::${msg}`; + }); + }); + + lines.push(''); + + return lines.join('\n'); +}; + +/** + * @param {string} msg + * @param {Partial | undefined} metadata + * @returns {string} + */ +function buildMessage(msg, metadata) { + if (!metadata) return msg; + + const url = metadata.url ? ` - ${metadata.url}` : ''; + + let additional = [ + metadata.fixable ? 'maybe fixable' : '', + metadata.deprecated ? 'deprecated' : '', + ] + .filter(Boolean) + .join(', '); + + additional = additional ? ` [${additional}]` : ''; + + return `${msg}${additional}${url}`; +} diff --git a/node_modules/stylelint/lib/formatters/index.js b/node_modules/stylelint/lib/formatters/index.js new file mode 100644 index 000000000..4b9569db7 --- /dev/null +++ b/node_modules/stylelint/lib/formatters/index.js @@ -0,0 +1,16 @@ +'use strict'; + +const importLazy = require('import-lazy'); + +/** @type {import('stylelint')['formatters']} */ +const formatters = { + compact: importLazy(() => require('./compactFormatter'))(), + github: importLazy(() => require('./githubFormatter'))(), + json: importLazy(() => require('./jsonFormatter'))(), + string: importLazy(() => require('./stringFormatter'))(), + tap: importLazy(() => require('./tapFormatter'))(), + unix: importLazy(() => require('./unixFormatter'))(), + verbose: importLazy(() => require('./verboseFormatter'))(), +}; + +module.exports = formatters; diff --git a/node_modules/stylelint/lib/formatters/jsonFormatter.js b/node_modules/stylelint/lib/formatters/jsonFormatter.js new file mode 100644 index 000000000..da5ae965e --- /dev/null +++ b/node_modules/stylelint/lib/formatters/jsonFormatter.js @@ -0,0 +1,20 @@ +'use strict'; + +/** + * Omit any properties starting with `_`, which are fake-private + * + * @type {import('stylelint').Formatter} + */ +module.exports = function jsonFormatter(results) { + const cleanedResults = results.map((result) => + Object.entries(result) + .filter(([key]) => !key.startsWith('_')) + .reduce((/** @type {{ [key: string]: any }} */ obj, [key, value]) => { + obj[key] = value; + + return obj; + }, {}), + ); + + return JSON.stringify(cleanedResults); +}; diff --git a/node_modules/stylelint/lib/formatters/preprocessWarnings.js b/node_modules/stylelint/lib/formatters/preprocessWarnings.js new file mode 100644 index 000000000..4bba00841 --- /dev/null +++ b/node_modules/stylelint/lib/formatters/preprocessWarnings.js @@ -0,0 +1,74 @@ +'use strict'; + +/** @typedef {import('stylelint').LintResult} LintResult */ +/** @typedef {LintResult['parseErrors'][0]} ParseError */ +/** @typedef {LintResult['warnings'][0]} Warning */ +/** @typedef {Warning['severity']} Severity */ + +/** + * Preprocess warnings in a given lint result. + * Note that this function has a side-effect. + * + * @param {LintResult} result + * @returns {LintResult} + */ +module.exports = function preprocessWarnings(result) { + for (const error of result.parseErrors || []) { + result.warnings.push(parseErrorToWarning(error)); + } + + for (const warning of result.warnings) { + warning.severity = normalizeSeverity(warning); + } + + result.warnings.sort(byLocationOrder); + + return result; +}; + +/** + * @param {ParseError} error + * @returns {Warning} + */ +function parseErrorToWarning(error) { + return { + line: error.line, + column: error.column, + rule: error.stylelintType, + severity: 'error', + text: `${error.text} (${error.stylelintType})`, + }; +} + +/** + * @param {Warning} warning + * @returns {Severity} + */ +function normalizeSeverity(warning) { + // NOTE: Plugins may add a warning without severity, for example, + // by directly using the PostCSS `Result#warn()` API. + return warning.severity || 'error'; +} + +/** + * @param {Warning} a + * @param {Warning} b + * @returns {number} + */ +function byLocationOrder(a, b) { + // positionless first + if (!a.line && b.line) return -1; + + // positionless first + if (a.line && !b.line) return 1; + + if (a.line < b.line) return -1; + + if (a.line > b.line) return 1; + + if (a.column < b.column) return -1; + + if (a.column > b.column) return 1; + + return 0; +} diff --git a/node_modules/stylelint/lib/formatters/stringFormatter.js b/node_modules/stylelint/lib/formatters/stringFormatter.js new file mode 100644 index 000000000..43a8fe0c5 --- /dev/null +++ b/node_modules/stylelint/lib/formatters/stringFormatter.js @@ -0,0 +1,276 @@ +'use strict'; + +const path = require('path'); +const stringWidth = require('string-width'); +const table = require('table'); +const { yellow, dim, underline, blue, red, green } = require('picocolors'); + +const calcSeverityCounts = require('./calcSeverityCounts'); +const pluralize = require('../utils/pluralize'); +const { assertNumber } = require('../utils/validateTypes'); +const preprocessWarnings = require('./preprocessWarnings'); +const terminalLink = require('./terminalLink'); + +const NON_ASCII_PATTERN = /\P{ASCII}/u; +const MARGIN_WIDTHS = 9; + +/** + * @param {string} s + * @returns {string} + */ +function nope(s) { + return s; +} + +const levelColors = { + info: blue, + warning: yellow, + error: red, + success: nope, +}; + +const symbols = { + info: blue('ℹ'), + warning: yellow('⚠'), + error: red('✖'), + success: green('✔'), +}; + +/** + * @param {import('stylelint').LintResult[]} results + * @returns {string} + */ +function deprecationsFormatter(results) { + const allDeprecationWarnings = results.flatMap((result) => result.deprecations || []); + + if (allDeprecationWarnings.length === 0) { + return ''; + } + + const seenText = new Set(); + const lines = []; + + for (const { text, reference } of allDeprecationWarnings) { + if (seenText.has(text)) continue; + + seenText.add(text); + + let line = ` ${dim('-')} ${text}`; + + if (reference) { + line += dim(` See: ${underline(reference)}`); + } + + lines.push(line); + } + + return ['', yellow('Deprecation warnings:'), ...lines, ''].join('\n'); +} + +/** + * @param {import('stylelint').LintResult[]} results + * @return {string} + */ +function invalidOptionsFormatter(results) { + const allInvalidOptionWarnings = results.flatMap((result) => + (result.invalidOptionWarnings || []).map((warning) => warning.text), + ); + const uniqueInvalidOptionWarnings = [...new Set(allInvalidOptionWarnings)]; + + return uniqueInvalidOptionWarnings.reduce((output, warning) => { + output += red('Invalid Option: '); + output += warning; + + return `${output}\n`; + }, '\n'); +} + +/** + * @param {string} fromValue + * @param {string} cwd + * @return {string} + */ +function logFrom(fromValue, cwd) { + if (fromValue.startsWith('<')) { + return underline(fromValue); + } + + const filePath = path.relative(cwd, fromValue).split(path.sep).join('/'); + + return terminalLink(filePath, `file://${fromValue}`); +} + +/** + * @param {{[k: number]: number}} columnWidths + * @return {number} + */ +function getMessageWidth(columnWidths) { + const width = columnWidths[3]; + + assertNumber(width); + + if (!process.stdout.isTTY) { + return width; + } + + const availableWidth = process.stdout.columns < 80 ? 80 : process.stdout.columns; + const fullWidth = Object.values(columnWidths).reduce((a, b) => a + b); + + // If there is no reason to wrap the text, we won't align the last column to the right + if (availableWidth > fullWidth + MARGIN_WIDTHS) { + return width; + } + + return availableWidth - (fullWidth - width + MARGIN_WIDTHS); +} + +/** + * @param {import('stylelint').Warning[]} messages + * @param {string} source + * @param {string} cwd + * @return {string} + */ +function formatter(messages, source, cwd) { + if (messages.length === 0) return ''; + + /** + * Create a list of column widths, needed to calculate + * the size of the message column and if needed wrap it. + * @type {{[k: string]: number}} + */ + const columnWidths = { 0: 1, 1: 1, 2: 1, 3: 1, 4: 1 }; + + /** + * @param {[string, string, string, string, string]} columns + * @return {[string, string, string, string, string]} + */ + function calculateWidths(columns) { + for (const [key, value] of Object.entries(columns)) { + const normalisedValue = value ? value.toString() : value; + const width = columnWidths[key]; + + assertNumber(width); + columnWidths[key] = Math.max(width, stringWidth(normalisedValue)); + } + + return columns; + } + + let output = '\n'; + + if (source) { + output += `${logFrom(source, cwd)}\n`; + } + + /** + * @param {import('stylelint').Warning} message + * @return {string} + */ + function formatMessageText(message) { + let result = message.text; + + result = result + // Remove all control characters (newline, tab and etc) + .replace(/[\u0001-\u001A]+/g, ' ') // eslint-disable-line no-control-regex + .replace(/\.$/, ''); + + const ruleString = ` (${message.rule})`; + + if (result.endsWith(ruleString)) { + result = result.slice(0, result.lastIndexOf(ruleString)); + } + + return result; + } + + const cleanedMessages = messages.map((message) => { + const { line, column, severity } = message; + /** + * @type {[string, string, string, string, string]} + */ + const row = [ + line ? line.toString() : '', + column ? column.toString() : '', + symbols[severity] ? levelColors[severity](symbols[severity]) : severity, + formatMessageText(message), + dim(message.rule || ''), + ]; + + calculateWidths(row); + + return row; + }); + + const messageWidth = getMessageWidth(columnWidths); + const hasNonAsciiChar = messages.some((msg) => NON_ASCII_PATTERN.test(msg.text)); + + output += table + .table(cleanedMessages, { + border: table.getBorderCharacters('void'), + columns: { + 0: { alignment: 'right', width: columnWidths[0], paddingRight: 0 }, + 1: { alignment: 'left', width: columnWidths[1] }, + 2: { alignment: 'center', width: columnWidths[2] }, + 3: { + alignment: 'left', + width: messageWidth, + wrapWord: messageWidth > 1 && !hasNonAsciiChar, + }, + 4: { alignment: 'left', width: columnWidths[4], paddingRight: 0 }, + }, + drawHorizontalLine: () => false, + }) + .split('\n') + .map((el) => el.replace(/(\d+)\s+(\d+)/, (_m, p1, p2) => dim(`${p1}:${p2}`)).trimEnd()) + .join('\n'); + + return output; +} + +/** + * @type {import('stylelint').Formatter} + */ +module.exports = function stringFormatter(results, returnValue) { + let output = invalidOptionsFormatter(results); + + output += deprecationsFormatter(results); + + const counts = { error: 0, warning: 0 }; + + output = results.reduce((accum, result) => { + preprocessWarnings(result); + + accum += formatter( + result.warnings, + result.source || '', + (returnValue && returnValue.cwd) || process.cwd(), + ); + + for (const warning of result.warnings) { + calcSeverityCounts(warning.severity, counts); + } + + return accum; + }, output); + + // Ensure consistent padding + output = output.trim(); + + if (output !== '') { + output = `\n${output}\n\n`; + + const errorCount = counts.error; + const warningCount = counts.warning; + const total = errorCount + warningCount; + + if (total > 0) { + const error = red(`${errorCount} ${pluralize('error', errorCount)}`); + const warning = yellow(`${warningCount} ${pluralize('warning', warningCount)}`); + const tally = `${total} ${pluralize('problem', total)} (${error}, ${warning})`; + + output += `${tally}\n\n`; + } + } + + return output; +}; diff --git a/node_modules/stylelint/lib/formatters/tapFormatter.js b/node_modules/stylelint/lib/formatters/tapFormatter.js new file mode 100644 index 000000000..e8f597df0 --- /dev/null +++ b/node_modules/stylelint/lib/formatters/tapFormatter.js @@ -0,0 +1,52 @@ +'use strict'; + +const preprocessWarnings = require('./preprocessWarnings'); + +/** + * @type {import('stylelint').Formatter} + */ +module.exports = function tapFormatter(results) { + const lines = [`TAP version 13\n1..${results.length}`]; + + for (const [index, result] of results.entries()) { + preprocessWarnings(result); + + lines.push( + `${result.errored ? 'not ok' : 'ok'} ${index + 1} - ${result.ignored ? 'ignored ' : ''}${ + result.source + }`, + ); + + if (result.warnings.length > 0) { + lines.push('---', 'messages:'); + + for (const warning of result.warnings) { + lines.push( + ` - message: "${warning.text}"`, + ` severity: ${warning.severity}`, + ` data:`, + ` line: ${warning.line}`, + ` column: ${warning.column}`, + ); + + if (typeof warning.endLine === 'number') { + lines.push(` endLine: ${warning.endLine}`); + } + + if (typeof warning.endColumn === 'number') { + lines.push(` endColumn: ${warning.endColumn}`); + } + + if (typeof warning.rule === 'string') { + lines.push(` ruleId: ${warning.rule}`); + } + } + + lines.push('---'); + } + } + + lines.push(''); + + return lines.join('\n'); +}; diff --git a/node_modules/stylelint/lib/formatters/terminalLink.js b/node_modules/stylelint/lib/formatters/terminalLink.js new file mode 100644 index 000000000..3e551e804 --- /dev/null +++ b/node_modules/stylelint/lib/formatters/terminalLink.js @@ -0,0 +1,23 @@ +'use strict'; + +const supportsHyperlinks = require('supports-hyperlinks'); + +// ANSI escapes +const OSC = '\u001B]'; +const BEL = '\u0007'; +const SEP = ';'; + +/** + * @see https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda + * + * @param {string} text + * @param {string} url + * @returns {string} + */ +module.exports = function terminalLink(text, url) { + if (supportsHyperlinks.stdout) { + return [OSC, '8', SEP, SEP, url, BEL, text, OSC, '8', SEP, SEP, BEL].join(''); + } + + return text; +}; diff --git a/node_modules/stylelint/lib/formatters/unixFormatter.js b/node_modules/stylelint/lib/formatters/unixFormatter.js new file mode 100644 index 000000000..170ba1004 --- /dev/null +++ b/node_modules/stylelint/lib/formatters/unixFormatter.js @@ -0,0 +1,34 @@ +'use strict'; + +const calcSeverityCounts = require('./calcSeverityCounts'); +const pluralize = require('../utils/pluralize'); +const preprocessWarnings = require('./preprocessWarnings'); + +/** + * @type {import('stylelint').Formatter} + */ +module.exports = function unixFormatter(results) { + const counts = { error: 0, warning: 0 }; + const lines = results.flatMap((result) => { + preprocessWarnings(result); + + return result.warnings.map((warning) => { + calcSeverityCounts(warning.severity, counts); + + return ( + `${result.source}:${warning.line}:${warning.column}: ` + + `${warning.text} [${warning.severity}]` + ); + }); + }); + const total = lines.length; + let output = lines.join('\n'); + + if (total > 0) { + output += `\n\n${total} ${pluralize('problem', total)}`; + output += ` (${counts.error} ${pluralize('error', counts.error)}`; + output += `, ${counts.warning} ${pluralize('warning', counts.warning)})\n`; + } + + return output; +}; diff --git a/node_modules/stylelint/lib/formatters/verboseFormatter.js b/node_modules/stylelint/lib/formatters/verboseFormatter.js new file mode 100644 index 000000000..a3a3619a5 --- /dev/null +++ b/node_modules/stylelint/lib/formatters/verboseFormatter.js @@ -0,0 +1,149 @@ +'use strict'; + +const { underline, red, yellow, dim, green } = require('picocolors'); + +const pluralize = require('../utils/pluralize'); +const stringFormatter = require('./stringFormatter'); +const terminalLink = require('./terminalLink'); + +/** @typedef {import('stylelint').Formatter} Formatter */ +/** @typedef {import('stylelint').LintResult} LintResult */ +/** @typedef {import('stylelint').Warning} Warning */ +/** @typedef {import('stylelint').Severity} Severity */ +/** @typedef {import('stylelint').RuleMeta} RuleMeta */ + +/** + * @type {Formatter} + */ +module.exports = function verboseFormatter(results, returnValue) { + let output = stringFormatter(results, returnValue); + + if (output === '') { + output = '\n'; + } + + const ignoredCount = results.filter((result) => result.ignored).length; + const checkedDisplay = ignoredCount + ? `${results.length - ignoredCount} of ${results.length}` + : results.length; + + output += underline(`${checkedDisplay} ${pluralize('source', results.length)} checked\n`); + + for (const result of results) { + let formatting = green; + + if (result.errored) { + formatting = red; + } else if (result.warnings.length) { + formatting = yellow; + } else if (result.ignored) { + formatting = dim; + } + + let sourceText = fileLink(result.source); + + if (result.ignored) { + sourceText += ' (ignored)'; + } + + output += formatting(` ${sourceText}\n`); + } + + const warnings = results.flatMap((r) => r.warnings); + + if (warnings.length === 0) { + output += '\n0 problems found\n'; + } else { + const warningsBySeverity = groupBy(warnings, (w) => w.severity); + let fixableProblemsFound = false; + + /** + * @param {Severity} severity + */ + const printProblems = (severity) => { + const problems = warningsBySeverity[severity]; + + if (problems === undefined) return; + + output += '\n'; + output += underline(`${problems.length} ${pluralize(severity, problems.length)} found\n`); + + const problemsByRule = groupBy(problems, (w) => w.rule); + const metadata = returnValue.ruleMetadata; + + for (const [rule, list] of Object.entries(problemsByRule)) { + const meta = metadata[rule] || {}; + + let additional = [meta.fixable ? 'maybe fixable' : '', meta.deprecated ? 'deprecated' : ''] + .filter(Boolean) + .join(', '); + + additional = additional ? ` (${additional})` : ''; + + output += dim(` ${ruleLink(rule, meta)}: ${list.length}${additional}\n`); + + if (!fixableProblemsFound && meta.fixable) { + fixableProblemsFound = true; + } + } + }; + + printProblems('error'); + printProblems('warning'); + + if (fixableProblemsFound) { + output += yellow('\nYou may fix some problems with the "--fix" option.\n'); + } + } + + return `${output}\n`; +}; + +/** + * @template {string} K + * @param {Warning[]} array + * @param {(w: Warning) => K} keyFn + * @returns {Record} + */ +function groupBy(array, keyFn) { + /** @type {Record} */ + const result = {}; + + for (const item of array) { + const key = keyFn(item); + let warnings = result[key]; + + if (warnings === undefined) { + result[key] = warnings = []; + } + + warnings.push(item); + } + + return result; +} + +/** + * @param {string | undefined} source + * @returns {string} + */ +function fileLink(source) { + if (!source || source.startsWith('<')) { + return `${source}`; + } + + return terminalLink(source, `file://${source}`); +} + +/** + * @param {string} rule + * @param {Partial | undefined} metadata + * @returns {string} + */ +function ruleLink(rule, metadata) { + if (metadata && metadata.url) { + return terminalLink(rule, metadata.url); + } + + return rule; +} diff --git a/node_modules/stylelint/lib/getConfigForFile.js b/node_modules/stylelint/lib/getConfigForFile.js new file mode 100644 index 000000000..c5780ed26 --- /dev/null +++ b/node_modules/stylelint/lib/getConfigForFile.js @@ -0,0 +1,75 @@ +'use strict'; + +const configurationError = require('./utils/configurationError'); +const path = require('path'); +const { augmentConfigFull } = require('./augmentConfig'); +const { cosmiconfig, defaultLoadersSync } = require('cosmiconfig'); + +const IS_TEST = process.env.NODE_ENV === 'test'; +const STOP_DIR = IS_TEST ? process.cwd() : undefined; + +/** @typedef {import('stylelint').InternalApi} StylelintInternalApi */ +/** @typedef {import('stylelint').Config} StylelintConfig */ +/** @typedef {import('stylelint').CosmiconfigResult} StylelintCosmiconfigResult */ + +/** + * @param {StylelintInternalApi} stylelint + * @param {string} [searchPath] + * @param {string} [filePath] + * @returns {Promise} + */ +module.exports = async function getConfigForFile( + stylelint, + searchPath = stylelint._options.cwd, + filePath, +) { + const optionsConfig = stylelint._options.config; + const cwd = stylelint._options.cwd; + + if (optionsConfig !== undefined) { + const cached = stylelint._specifiedConfigCache.get(optionsConfig); + + // If config has overrides the resulting config might be different for some files. + // Cache results only if resulted config is the same for all linted files. + if (cached && !optionsConfig.overrides) { + return cached; + } + + const augmentedResult = augmentConfigFull(stylelint, filePath, { + config: optionsConfig, + // Add the extra path part so that we can get the directory without being + // confused + filepath: path.join(cwd, 'argument-config'), + }); + + stylelint._specifiedConfigCache.set(optionsConfig, augmentedResult); + + return augmentedResult; + } + + const configExplorer = cosmiconfig('stylelint', { + transform: (cosmiconfigResult) => augmentConfigFull(stylelint, filePath, cosmiconfigResult), + loaders: { + '.cjs': (cjsPath, cjsContent) => + Promise.resolve(defaultLoadersSync['.cjs'](cjsPath, cjsContent)), + '.js': (jsPath, cjsContent) => Promise.resolve(defaultLoadersSync['.js'](jsPath, cjsContent)), + }, + stopDir: STOP_DIR, + }); + + let config = stylelint._options.configFile + ? await configExplorer.load(stylelint._options.configFile) + : await configExplorer.search(searchPath); + + if (!config) { + config = await configExplorer.search(cwd); + } + + if (!config) { + return Promise.reject( + configurationError(`No configuration provided${searchPath ? ` for ${searchPath}` : ''}`), + ); + } + + return config; +}; diff --git a/node_modules/stylelint/lib/getPostcssResult.js b/node_modules/stylelint/lib/getPostcssResult.js new file mode 100644 index 000000000..024642e17 --- /dev/null +++ b/node_modules/stylelint/lib/getPostcssResult.js @@ -0,0 +1,142 @@ +'use strict'; + +const LazyResult = require('postcss/lib/lazy-result').default; +const path = require('path'); +const { default: postcss } = require('postcss'); +const { promises: fs } = require('fs'); + +const getModulePath = require('./utils/getModulePath'); + +/** @typedef {import('postcss').Result} Result */ +/** @typedef {import('postcss').Syntax} Syntax */ +/** @typedef {import('stylelint').CustomSyntax} CustomSyntax */ +/** @typedef {import('stylelint').GetPostcssOptions} GetPostcssOptions */ +/** @typedef {import('stylelint').InternalApi} StylelintInternalApi */ + +const postcssProcessor = postcss(); + +/** + * @param {StylelintInternalApi} stylelint + * @param {GetPostcssOptions} options + * + * @returns {Promise} + */ +module.exports = async function getPostcssResult(stylelint, options = {}) { + const cached = options.filePath ? stylelint._postcssResultCache.get(options.filePath) : undefined; + + if (cached) { + return cached; + } + + const syntax = options.customSyntax + ? getCustomSyntax(options.customSyntax, stylelint._options.configBasedir) + : cssSyntax(stylelint, options.filePath); + + const postcssOptions = { + from: options.filePath, + syntax, + }; + + /** @type {string | undefined} */ + let getCode; + + if (options.code !== undefined) { + getCode = options.code; + } else if (options.filePath) { + getCode = await fs.readFile(options.filePath, 'utf8'); + } + + if (getCode === undefined) { + return Promise.reject(new Error('code or filePath required')); + } + + const postcssResult = await new LazyResult(postcssProcessor, getCode, postcssOptions); + + if (options.filePath) { + stylelint._postcssResultCache.set(options.filePath, postcssResult); + } + + return postcssResult; +}; + +/** + * @param {CustomSyntax} customSyntax + * @param {string | undefined} basedir + * @returns {Syntax} + */ +function getCustomSyntax(customSyntax, basedir) { + if (typeof customSyntax === 'string') { + const customSyntaxLookup = basedir ? getModulePath(basedir, customSyntax) : customSyntax; + + let resolved; + + try { + resolved = require(customSyntaxLookup); + } catch (error) { + if ( + error && + typeof error === 'object' && + 'code' in error && + error.code === 'MODULE_NOT_FOUND' && + 'message' in error && + typeof error.message === 'string' && + error.message.includes(customSyntax) + ) { + throw new Error( + `Cannot resolve custom syntax module "${customSyntax}". Check that module "${customSyntax}" is available and spelled correctly.\n\nCaused by: ${error}`, + ); + } + + throw error; + } + + /* + * PostCSS allows for syntaxes that only contain a parser, however, + * it then expects the syntax to be set as the `parse` option. + */ + if (!resolved.parse) { + resolved = { + parse: resolved, + stringify: postcss.stringify, + }; + } + + return resolved; + } + + if (typeof customSyntax === 'object') { + if (typeof customSyntax.parse === 'function') { + return { ...customSyntax }; + } + + throw new TypeError( + 'An object provided to the "customSyntax" option must have a "parse" property. Ensure the "parse" property exists and its value is a function.', + ); + } + + throw new Error('Custom syntax must be a string or a Syntax object'); +} + +/** + * @param {StylelintInternalApi} stylelint + * @param {string|undefined} filePath + * @returns {Syntax} + */ +function cssSyntax(stylelint, filePath) { + const fileExtension = filePath ? path.extname(filePath).slice(1).toLowerCase() : ''; + const extensions = ['css', 'pcss', 'postcss']; + + if (fileExtension && !extensions.includes(fileExtension)) { + console.warn( + `${filePath}: you should use the "customSyntax" option when linting something other than CSS`, + ); + } + + return { + parse: + stylelint._options.fix && extensions.includes(fileExtension) + ? require('postcss-safe-parser') + : postcss.parse, + stringify: postcss.stringify, + }; +} diff --git a/node_modules/stylelint/lib/index.js b/node_modules/stylelint/lib/index.js new file mode 100644 index 000000000..4f991e19c --- /dev/null +++ b/node_modules/stylelint/lib/index.js @@ -0,0 +1,35 @@ +'use strict'; + +const checkAgainstRule = require('./utils/checkAgainstRule'); +const createPlugin = require('./createPlugin'); +const createStylelint = require('./createStylelint'); +const formatters = require('./formatters'); +const postcssPlugin = require('./postcssPlugin'); +const report = require('./utils/report'); +const resolveConfig = require('./resolveConfig'); +const ruleMessages = require('./utils/ruleMessages'); +const rules = require('./rules'); +const { longhandSubPropertiesOfShorthandProperties } = require('./reference/properties'); +const standalone = require('./standalone'); +const validateOptions = require('./utils/validateOptions'); + +/** @type {import('stylelint')} */ +const stylelint = Object.assign(postcssPlugin, { + lint: standalone, + rules, + formatters, + createPlugin, + resolveConfig, + _createLinter: createStylelint, + utils: { + report, + ruleMessages, + validateOptions, + checkAgainstRule, + }, + reference: { + longhandSubPropertiesOfShorthandProperties, + }, +}); + +module.exports = stylelint; diff --git a/node_modules/stylelint/lib/invalidScopeDisables.js b/node_modules/stylelint/lib/invalidScopeDisables.js new file mode 100644 index 000000000..7aad8e724 --- /dev/null +++ b/node_modules/stylelint/lib/invalidScopeDisables.js @@ -0,0 +1,47 @@ +'use strict'; + +const optionsMatches = require('./utils/optionsMatches'); +const validateDisableSettings = require('./validateDisableSettings'); + +/** + * @param {import('stylelint').LintResult[]} results + */ +module.exports = function invalidScopeDisables(results) { + for (const result of results) { + const settings = validateDisableSettings(result._postcssResult, 'reportInvalidScopeDisables'); + + if (!settings) continue; + + const [enabled, options, stylelintResult] = settings; + + const configRules = (stylelintResult.config || {}).rules || {}; + + const usedRules = new Set(Object.keys(configRules)); + + usedRules.add('all'); + + for (const [rule, ruleRanges] of Object.entries(stylelintResult.disabledRanges)) { + if (usedRules.has(rule)) continue; + + if (enabled === optionsMatches(options, 'except', rule)) continue; + + for (const range of ruleRanges) { + if (!range.strictStart && !range.strictEnd) continue; + + // If the comment doesn't have a location, we can't report a useful error. + // In practice we expect all comments to have locations, though. + if (!range.comment.source || !range.comment.source.start) continue; + + result.warnings.push({ + text: `Rule "${rule}" isn't enabled`, + rule: '--report-invalid-scope-disables', + line: range.comment.source.start.line, + column: range.comment.source.start.column, + endLine: range.comment.source.end && range.comment.source.end.line, + endColumn: range.comment.source.end && range.comment.source.end.column, + severity: options.severity, + }); + } + } + } +}; diff --git a/node_modules/stylelint/lib/isPathIgnored.js b/node_modules/stylelint/lib/isPathIgnored.js new file mode 100644 index 000000000..31ec2b6a0 --- /dev/null +++ b/node_modules/stylelint/lib/isPathIgnored.js @@ -0,0 +1,44 @@ +'use strict'; + +const micromatch = require('micromatch'); +const path = require('path'); + +const filterFilePaths = require('./utils/filterFilePaths'); +const getConfigForFile = require('./getConfigForFile'); +const getFileIgnorer = require('./utils/getFileIgnorer'); + +/** + * To find out if a path is ignored, we need to load the config, + * which may have an ignoreFiles property. We then check the path + * against these. + * @param {import('stylelint').InternalApi} stylelint + * @param {string} [filePath] + * @return {Promise} + */ +module.exports = async function isPathIgnored(stylelint, filePath) { + if (!filePath) { + return false; + } + + const cwd = stylelint._options.cwd; + const result = await getConfigForFile(stylelint, filePath, filePath); + + if (!result) { + return true; + } + + const ignoreFiles = result.config.ignoreFiles || []; + const absoluteFilePath = path.isAbsolute(filePath) ? filePath : path.resolve(cwd, filePath); + + if (micromatch([absoluteFilePath], ignoreFiles).length > 0) { + return true; + } + + const ignorer = getFileIgnorer(stylelint._options); + + if (filterFilePaths(ignorer, [path.relative(cwd, absoluteFilePath)]).length === 0) { + return true; + } + + return false; +}; diff --git a/node_modules/stylelint/lib/lintPostcssResult.js b/node_modules/stylelint/lib/lintPostcssResult.js new file mode 100644 index 000000000..9f1c368a1 --- /dev/null +++ b/node_modules/stylelint/lib/lintPostcssResult.js @@ -0,0 +1,151 @@ +'use strict'; + +const assignDisabledRanges = require('./assignDisabledRanges'); +const getOsEol = require('./utils/getOsEol'); +const reportUnknownRuleNames = require('./reportUnknownRuleNames'); +const rules = require('./rules'); +const getStylelintRule = require('./utils/getStylelintRule'); +const { DEFAULT_CONFIGURATION_COMMENT } = require('./utils/configurationComment'); + +/** @typedef {import('stylelint').LinterOptions} LinterOptions */ +/** @typedef {import('stylelint').PostcssResult} PostcssResult */ +/** @typedef {import('stylelint').Config} StylelintConfig */ + +/** + * @param {LinterOptions} stylelintOptions + * @param {PostcssResult} postcssResult + * @param {StylelintConfig} config + * @returns {Promise} + */ +module.exports = function lintPostcssResult(stylelintOptions, postcssResult, config) { + postcssResult.stylelint.ruleSeverities = {}; + postcssResult.stylelint.customMessages = {}; + postcssResult.stylelint.ruleMetadata = {}; + postcssResult.stylelint.stylelintError = false; + postcssResult.stylelint.stylelintWarning = false; + postcssResult.stylelint.quiet = config.quiet; + postcssResult.stylelint.config = config; + + /** @type {string | undefined} */ + let newline; + const postcssDoc = postcssResult.root; + + if (postcssDoc) { + if (!('type' in postcssDoc)) { + throw new Error('Unexpected Postcss root object!'); + } + + const newlineMatch = postcssDoc.source && postcssDoc.source.input.css.match(/\r?\n/); + + newline = newlineMatch ? newlineMatch[0] : getOsEol(); + + assignDisabledRanges(postcssDoc, postcssResult); + } + + const isFileFixCompatible = isFixCompatible(postcssResult); + + if (!isFileFixCompatible) { + postcssResult.stylelint.disableWritingFix = true; + } + + const postcssRoots = /** @type {import('postcss').Root[]} */ ( + postcssDoc && postcssDoc.constructor.name === 'Document' ? postcssDoc.nodes : [postcssDoc] + ); + + // Promises for the rules. Although the rule code runs synchronously now, + // the use of Promises makes it compatible with the possibility of async + // rules down the line. + /** @type {Array>} */ + const performRules = []; + + const rulesOrder = Object.keys(rules); + const ruleNames = config.rules + ? Object.keys(config.rules).sort((a, b) => rulesOrder.indexOf(a) - rulesOrder.indexOf(b)) + : []; + + for (const ruleName of ruleNames) { + const ruleFunction = getStylelintRule(ruleName, config); + + if (ruleFunction === undefined) { + performRules.push( + Promise.all( + postcssRoots.map((postcssRoot) => + reportUnknownRuleNames(ruleName, postcssRoot, postcssResult), + ), + ), + ); + + continue; + } + + const ruleSettings = config.rules && config.rules[ruleName]; + + if (ruleSettings === null || ruleSettings[0] === null) { + continue; + } + + if ( + ruleFunction.meta && + ruleFunction.meta.deprecated && + !stylelintOptions.quietDeprecationWarnings + ) { + warnDeprecatedRule(postcssResult, ruleName); + } + + const primaryOption = ruleSettings[0]; + const secondaryOptions = ruleSettings[1]; + + // Log the rule's severity in the PostCSS result + const defaultSeverity = config.defaultSeverity || 'error'; + // disableFix in secondary option + const disableFix = (secondaryOptions && secondaryOptions.disableFix === true) || false; + + postcssResult.stylelint.ruleSeverities[ruleName] = + (secondaryOptions && secondaryOptions.severity) || defaultSeverity; + postcssResult.stylelint.customMessages[ruleName] = secondaryOptions && secondaryOptions.message; + postcssResult.stylelint.ruleMetadata[ruleName] = ruleFunction.meta || {}; + + performRules.push( + Promise.all( + postcssRoots.map((postcssRoot) => + ruleFunction(primaryOption, secondaryOptions, { + configurationComment: config.configurationComment || DEFAULT_CONFIGURATION_COMMENT, + fix: + !disableFix && + config.fix && + // Next two conditionals are temporary measures until #2643 is resolved + isFileFixCompatible && + !postcssResult.stylelint.disabledRanges[ruleName], + newline, + })(postcssRoot, postcssResult), + ), + ), + ); + } + + return Promise.all(performRules); +}; + +/** + * There are currently some bugs in the autofixer of Stylelint. + * The autofixer does not yet adhere to stylelint-disable comments, so if there are disabled + * ranges we can not autofix this document. More info in issue #2643. + * + * @param {PostcssResult} postcssResult + * @returns {boolean} + */ +function isFixCompatible({ stylelint }) { + // Check for issue #2643 + if (stylelint.disabledRanges.all && stylelint.disabledRanges.all.length) return false; + + return true; +} + +/** + * @param {PostcssResult} result + * @param {string} ruleName + * @returns {void} + */ +function warnDeprecatedRule(result, ruleName) { + result.warn(`The "${ruleName}" rule is deprecated.`, { stylelintType: 'deprecation' }); +} diff --git a/node_modules/stylelint/lib/lintSource.js b/node_modules/stylelint/lib/lintSource.js new file mode 100644 index 000000000..2a92619a8 --- /dev/null +++ b/node_modules/stylelint/lib/lintSource.js @@ -0,0 +1,146 @@ +'use strict'; + +const path = require('path'); + +const getConfigForFile = require('./getConfigForFile'); +const getPostcssResult = require('./getPostcssResult'); +const isPathIgnored = require('./isPathIgnored'); +const isPathNotFoundError = require('./utils/isPathNotFoundError'); +const lintPostcssResult = require('./lintPostcssResult'); + +/** @typedef {import('stylelint').InternalApi} StylelintInternalApi */ +/** @typedef {import('stylelint').GetLintSourceOptions} Options */ +/** @typedef {import('postcss').Result} Result */ +/** @typedef {import('stylelint').PostcssResult} PostcssResult */ +/** @typedef {import('stylelint').StylelintPostcssResult} StylelintPostcssResult */ + +/** + * Run stylelint on a PostCSS Result, either one that is provided + * or one that we create + * @param {StylelintInternalApi} stylelint + * @param {Options} options + * @returns {Promise} + */ +module.exports = async function lintSource(stylelint, options = {}) { + if (!options.filePath && options.code === undefined && !options.existingPostcssResult) { + return Promise.reject(new Error('You must provide filePath, code, or existingPostcssResult')); + } + + const isCodeNotFile = options.code !== undefined; + + const inputFilePath = isCodeNotFile ? options.codeFilename : options.filePath; + + if (inputFilePath !== undefined && !path.isAbsolute(inputFilePath)) { + if (isCodeNotFile) { + return Promise.reject(new Error('codeFilename must be an absolute path')); + } + + return Promise.reject(new Error('filePath must be an absolute path')); + } + + const isIgnored = await isPathIgnored(stylelint, inputFilePath).catch((err) => { + if (isCodeNotFile && isPathNotFoundError(err)) return false; + + throw err; + }); + + if (isIgnored) { + return options.existingPostcssResult + ? Object.assign(options.existingPostcssResult, { + stylelint: createEmptyStylelintPostcssResult(), + }) + : createEmptyPostcssResult(inputFilePath); + } + + const configSearchPath = stylelint._options.configFile || inputFilePath; + const cwd = stylelint._options.cwd; + + let configForFile; + + try { + configForFile = await getConfigForFile(stylelint, configSearchPath, inputFilePath); + } catch (err) { + if (isCodeNotFile && isPathNotFoundError(err)) { + configForFile = await getConfigForFile(stylelint, cwd); + } else { + throw err; + } + } + + if (!configForFile) { + return Promise.reject(new Error('Config file not found')); + } + + const config = configForFile.config; + const existingPostcssResult = options.existingPostcssResult; + + if (options.cache) { + stylelint._fileCache.calcHashOfConfig(config); + + if (options.filePath && !stylelint._fileCache.hasFileChanged(options.filePath)) { + return existingPostcssResult + ? Object.assign(existingPostcssResult, { + stylelint: createEmptyStylelintPostcssResult(), + }) + : createEmptyPostcssResult(inputFilePath); + } + } + + /** @type {StylelintPostcssResult} */ + const stylelintResult = { + ruleSeverities: {}, + customMessages: {}, + ruleMetadata: {}, + disabledRanges: {}, + }; + + const postcssResult = + existingPostcssResult || + (await getPostcssResult(stylelint, { + code: options.code, + codeFilename: options.codeFilename, + filePath: inputFilePath, + customSyntax: config.customSyntax, + })); + + const stylelintPostcssResult = Object.assign(postcssResult, { + stylelint: stylelintResult, + }); + + await lintPostcssResult(stylelint._options, stylelintPostcssResult, config); + + return stylelintPostcssResult; +}; + +/** + * @returns {StylelintPostcssResult} + */ +function createEmptyStylelintPostcssResult() { + return { + ruleSeverities: {}, + customMessages: {}, + ruleMetadata: {}, + disabledRanges: {}, + ignored: true, + stylelintError: false, + stylelintWarning: false, + }; +} + +/** + * @param {string} [filePath] + * @returns {PostcssResult} + */ +function createEmptyPostcssResult(filePath) { + return { + root: { + source: { + input: { file: filePath }, + }, + }, + messages: [], + opts: undefined, + stylelint: createEmptyStylelintPostcssResult(), + warn: () => {}, + }; +} diff --git a/node_modules/stylelint/lib/needlessDisables.js b/node_modules/stylelint/lib/needlessDisables.js new file mode 100644 index 000000000..9431e16a7 --- /dev/null +++ b/node_modules/stylelint/lib/needlessDisables.js @@ -0,0 +1,101 @@ +'use strict'; + +const optionsMatches = require('./utils/optionsMatches'); +const putIfAbsent = require('./utils/putIfAbsent'); +const validateDisableSettings = require('./validateDisableSettings'); + +/** @typedef {import('postcss').Comment} PostcssComment */ +/** @typedef {import('stylelint').DisabledRange} DisabledRange */ +/** @typedef {import('stylelint').DisableReportRange} DisableReportRange */ + +/** + * @param {import('stylelint').LintResult[]} results + */ +module.exports = function needlessDisables(results) { + for (const result of results) { + const settings = validateDisableSettings(result._postcssResult, 'reportNeedlessDisables'); + + if (!settings) continue; + + const [enabled, options, stylelintResult] = settings; + + const rangeData = stylelintResult.disabledRanges; + + if (!rangeData) continue; + + const disabledWarnings = stylelintResult.disabledWarnings || []; + + // A map from `stylelint-disable` comments to the set of rules that + // are usefully disabled by each comment. We track this + // comment-by-comment rather than range-by-range because ranges that + // disable *all* rules are duplicated for each rule they apply to in + // practice. + /** @type {Map>}} */ + const usefulDisables = new Map(); + + for (const warning of disabledWarnings) { + const rule = warning.rule; + const ruleRanges = rangeData[rule]; + + if (ruleRanges) { + for (const range of ruleRanges) { + if (isWarningInRange(warning, range)) { + putIfAbsent(usefulDisables, range.comment, () => new Set()).add(rule); + } + } + } + + for (const range of rangeData.all || []) { + if (isWarningInRange(warning, range)) { + putIfAbsent(usefulDisables, range.comment, () => new Set()).add(rule); + } + } + } + + const allRangeComments = new Set((rangeData.all || []).map((range) => range.comment)); + + for (const [rule, ranges] of Object.entries(rangeData)) { + for (const range of ranges) { + if (rule !== 'all' && allRangeComments.has(range.comment)) continue; + + if (enabled === optionsMatches(options, 'except', rule)) continue; + + const useful = usefulDisables.get(range.comment) || new Set(); + + // Only emit a warning if this range's comment isn't useful for this rule. + // For the special rule "all", only emit a warning if it's not useful for + // *any* rules, because it covers all of them. + if (rule === 'all' ? useful.size !== 0 : useful.has(rule)) continue; + + // If the comment doesn't have a location, we can't report a useful error. + // In practice we expect all comments to have locations, though. + if (!range.comment.source || !range.comment.source.start) continue; + + result.warnings.push({ + text: `Needless disable for "${rule}"`, + rule: '--report-needless-disables', + line: range.comment.source.start.line, + column: range.comment.source.start.column, + endLine: range.comment.source.end && range.comment.source.end.line, + endColumn: range.comment.source.end && range.comment.source.end.column, + severity: options.severity, + }); + } + } + } +}; + +/** + * @param {import('stylelint').DisabledWarning} warning + * @param {DisabledRange} range + * @return {boolean} + */ +function isWarningInRange(warning, range) { + const line = warning.line; + + // Need to check if range.end exist, because line number type cannot be compared to undefined + return ( + range.start <= line && + ((range.end !== undefined && range.end >= line) || range.end === undefined) + ); +} diff --git a/node_modules/stylelint/lib/normalizeAllRuleSettings.js b/node_modules/stylelint/lib/normalizeAllRuleSettings.js new file mode 100644 index 000000000..6562efaa3 --- /dev/null +++ b/node_modules/stylelint/lib/normalizeAllRuleSettings.js @@ -0,0 +1,33 @@ +'use strict'; + +const normalizeRuleSettings = require('./normalizeRuleSettings'); +const getStylelintRule = require('./utils/getStylelintRule'); + +/** @typedef {import('stylelint').Config} StylelintConfig */ + +/** + * @param {StylelintConfig} config + * @return {StylelintConfig} + */ +function normalizeAllRuleSettings(config) { + if (!config.rules) return config; + + /** @type {StylelintConfig['rules']} */ + const normalizedRules = {}; + + for (const [ruleName, rawRuleSettings] of Object.entries(config.rules)) { + const rule = getStylelintRule(ruleName, config); + + if (rule) { + normalizedRules[ruleName] = normalizeRuleSettings(rawRuleSettings, rule); + } else { + normalizedRules[ruleName] = []; + } + } + + config.rules = normalizedRules; + + return config; +} + +module.exports = normalizeAllRuleSettings; diff --git a/node_modules/stylelint/lib/normalizeRuleSettings.js b/node_modules/stylelint/lib/normalizeRuleSettings.js new file mode 100644 index 000000000..1169259a8 --- /dev/null +++ b/node_modules/stylelint/lib/normalizeRuleSettings.js @@ -0,0 +1,58 @@ +'use strict'; + +const { isPlainObject } = require('./utils/validateTypes'); + +// Rule settings can take a number of forms, e.g. +// a. "rule-name": null +// b. "rule-name": [null, ...] +// c. "rule-name": primaryOption +// d. "rule-name": [primaryOption] +// e. "rule-name": [primaryOption, secondaryOption] +// Where primaryOption can be anything: primitive, Object, or Array. + +/** + * This function normalizes all the possibilities into the + * standard form: [primaryOption, secondaryOption] + * Except in the cases with null, a & b, in which case + * null is returned + * @template T + * @template {Object} O + * @param {import('stylelint').ConfigRuleSettings} rawSettings + * @param {import('stylelint').Rule} [rule] + * @return {[T] | [T, O] | null} + */ +module.exports = function normalizeRuleSettings(rawSettings, rule) { + if (rawSettings === null || rawSettings === undefined) { + return null; + } + + if (!Array.isArray(rawSettings)) { + return [rawSettings]; + } + // Everything below is an array ... + + const [primary, secondary] = rawSettings; + + if (rawSettings.length > 0 && (primary === null || primary === undefined)) { + return null; + } + + if (rule && !rule.primaryOptionArray) { + return rawSettings; + } + // Everything below is a rule that CAN have an array for a primary option ... + // (they might also have something else, e.g. rule-properties-order can + // have the string "alphabetical") + + if (rawSettings.length === 1 && Array.isArray(primary)) { + return rawSettings; + } + + if (rawSettings.length === 2 && !isPlainObject(primary) && isPlainObject(secondary)) { + return rawSettings; + } + + // `T` must be an array type, but TSC thinks it's probably invalid to + // cast `[T]` to `T` so we cast through `any` first. + return [/** @type {T} */ (/** @type {any} */ (rawSettings))]; +}; diff --git a/node_modules/stylelint/lib/postcssPlugin.js b/node_modules/stylelint/lib/postcssPlugin.js new file mode 100644 index 000000000..ba7e68341 --- /dev/null +++ b/node_modules/stylelint/lib/postcssPlugin.js @@ -0,0 +1,45 @@ +'use strict'; + +const path = require('path'); + +const createStylelint = require('./createStylelint'); +const lintSource = require('./lintSource'); + +/** @typedef {import('stylelint').PostcssPluginOptions} PostcssPluginOptions */ +/** @typedef {import('stylelint').Config} StylelintConfig */ + +/** + * @type {import('postcss').PluginCreator} + * */ +module.exports = (options = {}) => { + const [cwd, tailoredOptions] = isConfig(options) + ? [process.cwd(), { config: options }] + : [options.cwd || process.cwd(), options]; + const stylelint = createStylelint(tailoredOptions); + + return { + postcssPlugin: 'stylelint', + Once(root, { result }) { + let filePath = root.source && root.source.input.file; + + if (filePath && !path.isAbsolute(filePath)) { + filePath = path.join(cwd, filePath); + } + + return lintSource(stylelint, { + filePath, + existingPostcssResult: result, + }); + }, + }; +}; + +module.exports.postcss = true; + +/** + * @param {PostcssPluginOptions} options + * @returns {options is StylelintConfig} + */ +function isConfig(options) { + return 'rules' in options; +} diff --git a/node_modules/stylelint/lib/prepareReturnValue.js b/node_modules/stylelint/lib/prepareReturnValue.js new file mode 100644 index 000000000..52ca874c6 --- /dev/null +++ b/node_modules/stylelint/lib/prepareReturnValue.js @@ -0,0 +1,75 @@ +'use strict'; + +const descriptionlessDisables = require('./descriptionlessDisables'); +const invalidScopeDisables = require('./invalidScopeDisables'); +const needlessDisables = require('./needlessDisables'); +const reportDisables = require('./reportDisables'); + +/** @typedef {import('stylelint').Formatter} Formatter */ +/** @typedef {import('stylelint').LintResult} StylelintResult */ +/** @typedef {import('stylelint').LinterOptions["maxWarnings"]} maxWarnings */ +/** @typedef {import('stylelint').LinterResult} LinterResult */ + +/** + * @param {StylelintResult[]} stylelintResults + * @param {maxWarnings} maxWarnings + * @param {Formatter} formatter + * @param {string} cwd + * + * @returns {LinterResult} + */ +module.exports = function prepareReturnValue(stylelintResults, maxWarnings, formatter, cwd) { + reportDisables(stylelintResults); + needlessDisables(stylelintResults); + invalidScopeDisables(stylelintResults); + descriptionlessDisables(stylelintResults); + + let errored = false; + + for (const result of stylelintResults) { + if ( + result.errored || + result.parseErrors.length > 0 || + result.warnings.some((warning) => warning.severity === 'error') + ) { + errored = true; + result.errored = true; + } + } + + /** @type {LinterResult} */ + const returnValue = { + cwd, + errored, + results: [], + output: '', + reportedDisables: [], + ruleMetadata: getRuleMetadata(stylelintResults), + }; + + if (maxWarnings !== undefined) { + const foundWarnings = stylelintResults.reduce((count, file) => count + file.warnings.length, 0); + + if (foundWarnings > maxWarnings) { + returnValue.maxWarningsExceeded = { maxWarnings, foundWarnings }; + } + } + + returnValue.output = formatter(stylelintResults, returnValue); + returnValue.results = stylelintResults; + + return returnValue; +}; + +/** + * @param {StylelintResult[]} lintResults + */ +function getRuleMetadata(lintResults) { + const [lintResult] = lintResults; + + if (lintResult === undefined) return {}; + + if (lintResult._postcssResult === undefined) return {}; + + return lintResult._postcssResult.stylelint.ruleMetadata; +} diff --git a/node_modules/stylelint/lib/printConfig.js b/node_modules/stylelint/lib/printConfig.js new file mode 100644 index 000000000..d1e972a6e --- /dev/null +++ b/node_modules/stylelint/lib/printConfig.js @@ -0,0 +1,42 @@ +'use strict'; + +const resolveConfig = require('./resolveConfig'); +const globby = require('globby'); + +/** @typedef {import('stylelint').Config} StylelintConfig */ + +/** + * @param {import('stylelint').LinterOptions} options + * @returns {Promise} + */ +module.exports = async function printConfig({ + cwd = process.cwd(), + code, + config, + configBasedir, + configFile, + globbyOptions, + files, +}) { + const isCodeNotFile = code !== undefined; + const filePath = files && files[0]; + + if (!files || files.length !== 1 || !filePath || isCodeNotFile) { + return Promise.reject( + new Error('The --print-config option must be used with exactly one file path.'), + ); + } + + if (globby.hasMagic(filePath)) { + return Promise.reject(new Error('The --print-config option does not support globs.')); + } + + return ( + (await resolveConfig(filePath, { + cwd: (globbyOptions && globbyOptions.cwd) || cwd, + config, + configBasedir, + configFile, + })) || null + ); +}; diff --git a/node_modules/stylelint/lib/reference/atKeywords.js b/node_modules/stylelint/lib/reference/atKeywords.js new file mode 100644 index 000000000..5773d14ea --- /dev/null +++ b/node_modules/stylelint/lib/reference/atKeywords.js @@ -0,0 +1,57 @@ +'use strict'; + +const uniteSets = require('../utils/uniteSets.js'); + +// https://www.w3.org/TR/css-page-3/#syntax-page-selector +const pageMarginAtKeywords = new Set([ + 'top-left-corner', + 'top-left', + 'top-center', + 'top-right', + 'top-right-corner', + 'bottom-left-corner', + 'bottom-left', + 'bottom-center', + 'bottom-right', + 'bottom-right-corner', + 'left-top', + 'left-middle', + 'left-bottom', + 'right-top', + 'right-middle', + 'right-bottom', +]); + +// https://developer.mozilla.org/en/docs/Web/CSS/At-rule +const atKeywords = uniteSets(pageMarginAtKeywords, [ + 'annotation', + 'apply', + 'character-variant', + 'charset', + 'container', + 'counter-style', + 'custom-media', + 'custom-selector', + 'document', + 'font-face', + 'font-feature-values', + 'import', + 'keyframes', + 'layer', + 'media', + 'namespace', + 'nest', + 'ornaments', + 'page', + 'property', + 'scroll-timeline', + 'styleset', + 'stylistic', + 'supports', + 'swash', + 'viewport', +]); + +module.exports = { + atKeywords, +}; diff --git a/node_modules/stylelint/lib/reference/functions.js b/node_modules/stylelint/lib/reference/functions.js new file mode 100644 index 000000000..aedfcd3ff --- /dev/null +++ b/node_modules/stylelint/lib/reference/functions.js @@ -0,0 +1,59 @@ +'use strict'; + +const camelCaseFunctions = new Set([ + 'translateX', + 'translateY', + 'translateZ', + 'scaleX', + 'scaleY', + 'scaleZ', + 'rotateX', + 'rotateY', + 'rotateZ', + 'skewX', + 'skewY', +]); + +const colorFunctions = new Set([ + 'color', + 'color-mix', + 'hsl', + 'hsla', + 'hwb', + 'lab', + 'lch', + 'oklab', + 'oklch', + 'rgb', + 'rgba', +]); + +const mathFunctions = new Set([ + 'abs', + 'acos', + 'asin', + 'atan', + 'atan2', + 'calc', + 'clamp', + 'cos', + 'exp', + 'hypot', + 'log', + 'max', + 'min', + 'mod', + 'pow', + 'rem', + 'round', + 'sign', + 'sin', + 'sqrt', + 'tan', +]); + +module.exports = { + camelCaseFunctions, + colorFunctions, + mathFunctions, +}; diff --git a/node_modules/stylelint/lib/reference/keywords.js b/node_modules/stylelint/lib/reference/keywords.js new file mode 100644 index 000000000..0a0dbdc63 --- /dev/null +++ b/node_modules/stylelint/lib/reference/keywords.js @@ -0,0 +1,505 @@ +'use strict'; + +const uniteSets = require('../utils/uniteSets.js'); + +const basicKeywords = new Set(['initial', 'inherit', 'revert', 'revert-layer', 'unset']); + +const systemFontKeywords = uniteSets(basicKeywords, [ + 'caption', + 'icon', + 'menu', + 'message-box', + 'small-caption', + 'status-bar', +]); + +const fontFamilyKeywords = uniteSets(basicKeywords, [ + 'serif', + 'sans-serif', + 'cursive', + 'fantasy', + 'monospace', + 'system-ui', + 'ui-serif', + 'ui-sans-serif', + 'ui-monospace', + 'ui-rounded', +]); + +const fontWeightRelativeKeywords = new Set(['bolder', 'lighter']); + +const fontWeightAbsoluteKeywords = new Set(['normal', 'bold']); + +const fontWeightNonNumericKeywords = uniteSets( + fontWeightRelativeKeywords, + fontWeightAbsoluteKeywords, +); + +const fontWeightNumericKeywords = new Set([ + '100', + '200', + '300', + '400', + '500', + '600', + '700', + '800', + '900', +]); + +const fontWeightKeywords = uniteSets( + basicKeywords, + fontWeightNonNumericKeywords, + fontWeightNumericKeywords, +); + +const fontStyleKeywords = uniteSets(basicKeywords, ['normal', 'italic', 'oblique']); + +const fontVariantKeywords = uniteSets(basicKeywords, [ + 'normal', + 'none', + 'historical-forms', + 'none', + 'common-ligatures', + 'no-common-ligatures', + 'discretionary-ligatures', + 'no-discretionary-ligatures', + 'historical-ligatures', + 'no-historical-ligatures', + 'contextual', + 'no-contextual', + 'small-caps', + 'small-caps', + 'all-small-caps', + 'petite-caps', + 'all-petite-caps', + 'unicase', + 'titling-caps', + 'lining-nums', + 'oldstyle-nums', + 'proportional-nums', + 'tabular-nums', + 'diagonal-fractions', + 'stacked-fractions', + 'ordinal', + 'slashed-zero', + 'jis78', + 'jis83', + 'jis90', + 'jis04', + 'simplified', + 'traditional', + 'full-width', + 'proportional-width', + 'ruby', +]); + +const fontStretchKeywords = uniteSets(basicKeywords, [ + 'semi-condensed', + 'condensed', + 'extra-condensed', + 'ultra-condensed', + 'semi-expanded', + 'expanded', + 'extra-expanded', + 'ultra-expanded', +]); + +const fontSizeKeywords = uniteSets(basicKeywords, [ + 'xx-small', + 'x-small', + 'small', + 'medium', + 'large', + 'x-large', + 'xx-large', + 'larger', + 'smaller', +]); + +const lineHeightKeywords = uniteSets(basicKeywords, ['normal']); + +const fontShorthandKeywords = uniteSets( + basicKeywords, + fontStyleKeywords, + fontVariantKeywords, + fontWeightKeywords, + fontStretchKeywords, + fontSizeKeywords, + lineHeightKeywords, + fontFamilyKeywords, +); + +const animationNameKeywords = uniteSets(basicKeywords, ['none']); + +const animationTimingFunctionKeywords = uniteSets(basicKeywords, [ + 'linear', + 'ease', + 'ease-in', + 'ease-in-out', + 'ease-out', + 'step-start', + 'step-end', + 'steps', + 'cubic-bezier', +]); + +const animationIterationCountKeywords = new Set(['infinite']); + +const animationDirectionKeywords = uniteSets(basicKeywords, [ + 'normal', + 'reverse', + 'alternate', + 'alternate-reverse', +]); + +const animationFillModeKeywords = new Set(['none', 'forwards', 'backwards', 'both']); + +const animationPlayStateKeywords = uniteSets(basicKeywords, ['running', 'paused']); + +// cf. https://developer.mozilla.org/en-US/docs/Web/CSS/animation +const animationShorthandKeywords = uniteSets( + basicKeywords, + animationNameKeywords, + animationTimingFunctionKeywords, + animationIterationCountKeywords, + animationDirectionKeywords, + animationFillModeKeywords, + animationPlayStateKeywords, +); + +const gridRowKeywords = uniteSets(basicKeywords, ['auto', 'span']); + +const gridColumnKeywords = uniteSets(basicKeywords, ['auto', 'span']); + +const gridAreaKeywords = uniteSets(basicKeywords, ['auto', 'span']); + +// https://developer.mozilla.org/docs/Web/CSS/counter-increment +const counterIncrementKeywords = uniteSets(basicKeywords, ['none']); + +const counterResetKeywords = uniteSets(basicKeywords, ['none']); + +// https://developer.mozilla.org/ru/docs/Web/CSS/list-style-type +const listStyleTypeKeywords = uniteSets(basicKeywords, [ + 'none', + 'disc', + 'circle', + 'square', + 'decimal', + 'cjk-decimal', + 'decimal-leading-zero', + 'lower-roman', + 'upper-roman', + 'lower-greek', + 'lower-alpha', + 'lower-latin', + 'upper-alpha', + 'upper-latin', + 'arabic-indic', + 'armenian', + 'bengali', + 'cambodian', + 'cjk-earthly-branch', + 'cjk-ideographic', + 'devanagari', + 'ethiopic-numeric', + 'georgian', + 'gujarati', + 'gurmukhi', + 'hebrew', + 'hiragana', + 'hiragana-iroha', + 'japanese-formal', + 'japanese-informal', + 'kannada', + 'katakana', + 'katakana-iroha', + 'khmer', + 'korean-hangul-formal', + 'korean-hanja-formal', + 'korean-hanja-informal', + 'lao', + 'lower-armenian', + 'malayalam', + 'mongolian', + 'myanmar', + 'oriya', + 'persian', + 'simp-chinese-formal', + 'simp-chinese-informal', + 'tamil', + 'telugu', + 'thai', + 'tibetan', + 'trad-chinese-formal', + 'trad-chinese-informal', + 'upper-armenian', + 'disclosure-open', + 'disclosure-closed', + // Non-standard extensions (without prefixe) + 'ethiopic-halehame', + 'ethiopic-halehame-am', + 'ethiopic-halehame-ti-er', + 'ethiopic-halehame-ti-et', + 'hangul', + 'hangul-consonant', + 'urdu', +]); + +const listStylePositionKeywords = uniteSets(basicKeywords, ['inside', 'outside']); + +const listStyleImageKeywords = uniteSets(basicKeywords, ['none']); + +const listStyleShorthandKeywords = uniteSets( + basicKeywords, + listStyleTypeKeywords, + listStylePositionKeywords, + listStyleImageKeywords, +); + +const camelCaseKeywords = new Set([ + 'optimizeSpeed', + 'optimizeQuality', + 'optimizeLegibility', + 'geometricPrecision', + 'currentColor', + 'crispEdges', + 'visiblePainted', + 'visibleFill', + 'visibleStroke', + 'sRGB', + 'linearRGB', +]); + +const keyframeSelectorKeywords = new Set(['from', 'to']); + +const systemColorsKeywords = new Set([ + // https://www.w3.org/TR/CSS22/ui.html#system-colors + 'activeborder', + 'activecaption', + 'appworkspace', + 'background', + 'buttonface', + 'buttonhighlight', + 'buttonshadow', + 'buttontext', + 'captiontext', + 'graytext', + 'highlight', + 'highlighttext', + 'inactiveborder', + 'inactivecaption', + 'inactivecaptiontext', + 'infobackground', + 'infotext', + 'menu', + 'menutext', + 'scrollbar', + 'threeddarkshadow', + 'threedface', + 'threedhighlight', + 'threedlightshadow', + 'threedshadow', + 'window', + 'windowframe', + 'windowtext', + // https://www.w3.org/TR/css-color-4/#css-system-colors + 'accentcolor', + 'accentcolortext', + 'activetext', + 'buttonborder', + 'buttonface', + 'buttontext', + 'canvas', + 'canvastext', + 'field', + 'fieldtext', + 'graytext', + 'highlight', + 'highlighttext', + 'linktext', + 'mark', + 'marktext', + 'selecteditem', + 'selecteditemtext', + 'visitedtext', +]); + +const namedColorsKeywords = new Set([ + // https://www.w3.org/TR/css-color-4/#named-colors + 'aliceblue', + 'antiquewhite', + 'aqua', + 'aquamarine', + 'azure', + 'beige', + 'bisque', + 'black', + 'blanchedalmond', + 'blue', + 'blueviolet', + 'brown', + 'burlywood', + 'cadetblue', + 'chartreuse', + 'chocolate', + 'coral', + 'cornflowerblue', + 'cornsilk', + 'crimson', + 'cyan', + 'darkblue', + 'darkcyan', + 'darkgoldenrod', + 'darkgray', + 'darkgreen', + 'darkgrey', + 'darkkhaki', + 'darkmagenta', + 'darkolivegreen', + 'darkorange', + 'darkorchid', + 'darkred', + 'darksalmon', + 'darkseagreen', + 'darkslateblue', + 'darkslategray', + 'darkslategrey', + 'darkturquoise', + 'darkviolet', + 'deeppink', + 'deepskyblue', + 'dimgray', + 'dimgrey', + 'dodgerblue', + 'firebrick', + 'floralwhite', + 'forestgreen', + 'fuchsia', + 'gainsboro', + 'ghostwhite', + 'gold', + 'goldenrod', + 'gray', + 'green', + 'greenyellow', + 'grey', + 'honeydew', + 'hotpink', + 'indianred', + 'indigo', + 'ivory', + 'khaki', + 'lavender', + 'lavenderblush', + 'lawngreen', + 'lemonchiffon', + 'lightblue', + 'lightcoral', + 'lightcyan', + 'lightgoldenrodyellow', + 'lightgray', + 'lightgreen', + 'lightgrey', + 'lightpink', + 'lightsalmon', + 'lightseagreen', + 'lightskyblue', + 'lightslategray', + 'lightslategrey', + 'lightsteelblue', + 'lightyellow', + 'lime', + 'limegreen', + 'linen', + 'magenta', + 'maroon', + 'mediumaquamarine', + 'mediumblue', + 'mediumorchid', + 'mediumpurple', + 'mediumseagreen', + 'mediumslateblue', + 'mediumspringgreen', + 'mediumturquoise', + 'mediumvioletred', + 'midnightblue', + 'mintcream', + 'mistyrose', + 'moccasin', + 'navajowhite', + 'navy', + 'oldlace', + 'olive', + 'olivedrab', + 'orange', + 'orangered', + 'orchid', + 'palegoldenrod', + 'palegreen', + 'paleturquoise', + 'palevioletred', + 'papayawhip', + 'peachpuff', + 'peru', + 'pink', + 'plum', + 'powderblue', + 'purple', + 'rebeccapurple', + 'red', + 'rosybrown', + 'royalblue', + 'saddlebrown', + 'salmon', + 'sandybrown', + 'seagreen', + 'seashell', + 'sienna', + 'silver', + 'skyblue', + 'slateblue', + 'slategray', + 'slategrey', + 'snow', + 'springgreen', + 'steelblue', + 'tan', + 'teal', + 'thistle', + 'tomato', + 'turquoise', + 'violet', + 'wheat', + 'white', + 'whitesmoke', + 'yellow', + 'yellowgreen', +]); + +module.exports = { + animationNameKeywords, + animationShorthandKeywords, + basicKeywords, + camelCaseKeywords, + counterIncrementKeywords, + counterResetKeywords, + fontFamilyKeywords, + fontShorthandKeywords, + fontSizeKeywords, + fontWeightAbsoluteKeywords, + fontWeightKeywords, + fontWeightNonNumericKeywords, + fontWeightRelativeKeywords, + gridAreaKeywords, + gridColumnKeywords, + gridRowKeywords, + keyframeSelectorKeywords, + listStyleImageKeywords, + listStylePositionKeywords, + listStyleShorthandKeywords, + listStyleTypeKeywords, + namedColorsKeywords, + systemColorsKeywords, + systemFontKeywords, +}; diff --git a/node_modules/stylelint/lib/reference/mediaFeatures.js b/node_modules/stylelint/lib/reference/mediaFeatures.js new file mode 100644 index 000000000..71cd63557 --- /dev/null +++ b/node_modules/stylelint/lib/reference/mediaFeatures.js @@ -0,0 +1,115 @@ +'use strict'; + +const uniteSets = require('../utils/uniteSets.js'); + +const deprecatedMediaFeatureNames = new Set([ + 'device-aspect-ratio', + 'device-height', + 'device-width', +]); + +const rangeTypeMediaFeatureNames = uniteSets(deprecatedMediaFeatureNames, [ + 'aspect-ratio', + 'color', + 'color-index', + 'height', + 'horizontal-viewport-segments', + 'monochrome', + 'resolution', + 'vertical-viewport-segments', + 'width', +]); + +const rangeTypeMediaFeatureNamesWithMinMaxPrefix = new Set( + [...rangeTypeMediaFeatureNames].flatMap((name) => { + return [`min-${name}`, `max-${name}`]; + }), +); + +const discreteTypeMediaFeatureNames = new Set([ + 'any-hover', + 'any-pointer', + 'color-gamut', + 'display-mode', + 'dynamic-range', + 'environment-blending', + 'forced-colors', + 'grid', + 'hover', + 'inverted-colors', + 'light-level', + 'nav-controls', + 'orientation', + 'overflow-block', + 'overflow-inline', + 'pointer', + 'prefers-color-scheme', + 'prefers-contrast', + 'prefers-reduced-data', + 'prefers-reduced-motion', + 'prefers-reduced-transparency', + 'scan', + 'scripting', + 'update', + 'video-color-gamut', + 'video-dynamic-range', +]); + +const mediaFeatureNames = uniteSets( + deprecatedMediaFeatureNames, + rangeTypeMediaFeatureNames, + rangeTypeMediaFeatureNamesWithMinMaxPrefix, + discreteTypeMediaFeatureNames, +); + +const mediaFeatureNameAllowedValueKeywords = new Map([ + ['any-hover', new Set(['none', 'hover'])], + ['any-pointer', new Set(['none', 'coarse', 'fine'])], + ['color-gamut', new Set(['srgb', 'p3', 'rec2020'])], + ['display-mode', new Set(['fullscreen', 'standalone', 'minimal-ui', 'browser'])], + ['dynamic-range', new Set(['standard', 'high'])], + ['environment-blending', new Set(['opaque', 'additive', 'subtractive'])], + ['forced-colors', new Set(['none', 'active'])], + ['hover', new Set(['none', 'hover'])], + ['inverted-colors', new Set(['none', 'inverted'])], + ['nav-controls', new Set(['none', 'back'])], + ['orientation', new Set(['portrait', 'landscape'])], + ['overflow-block', new Set(['none', 'scroll', 'paged'])], + ['overflow-inline', new Set(['none', 'scroll'])], + ['pointer', new Set(['none', 'coarse', 'fine'])], + ['prefers-color-scheme', new Set(['light', 'dark'])], + ['prefers-contrast', new Set(['no-preference', 'less', 'more', 'custom'])], + ['prefers-reduced-data', new Set(['no-preference', 'reduce'])], + ['prefers-reduced-motion', new Set(['no-preference', 'reduce'])], + ['prefers-reduced-transparency', new Set(['no-preference', 'reduce'])], + ['resolution', new Set(['infinite'])], + ['scan', new Set(['interlace', 'progressive'])], + ['scripting', new Set(['none', 'initial-only', 'enabled'])], + ['update', new Set(['none', 'slow', 'fast'])], + ['video-color-gamut', new Set(['srgb', 'p3', 'rec2020'])], + ['video-dynamic-range', new Set(['standard', 'high'])], +]); + +const mediaFeatureNameAllowedValueTypes = new Map([ + ['aspect-ratio', new Set(['ratio'])], + ['color', new Set(['integer'])], + ['color-index', new Set(['integer'])], + ['device-aspect-ratio', new Set(['ratio'])], + ['device-height', new Set(['length'])], + ['device-width', new Set(['length'])], + ['grid', new Set(['mq-boolean'])], + ['height', new Set(['length'])], + ['horizontal-viewport-segments', new Set(['integer'])], + ['monochrome', new Set(['integer'])], + ['resolution', new Set(['resolution'])], + ['vertical-viewport-segments', new Set(['integer'])], + ['width', new Set(['length'])], +]); + +module.exports = { + mediaFeatureNameAllowedValueKeywords, + mediaFeatureNameAllowedValueTypes, + mediaFeatureNames, + rangeTypeMediaFeatureNames, + rangeTypeMediaFeatureNamesWithMinMaxPrefix, +}; diff --git a/node_modules/stylelint/lib/reference/prefixes.js b/node_modules/stylelint/lib/reference/prefixes.js new file mode 100644 index 000000000..2dade4265 --- /dev/null +++ b/node_modules/stylelint/lib/reference/prefixes.js @@ -0,0 +1,5 @@ +const prefixes = new Set(['-webkit-', '-moz-', '-ms-', '-o-']); + +module.exports = { + prefixes, +}; diff --git a/node_modules/stylelint/lib/reference/properties.js b/node_modules/stylelint/lib/reference/properties.js new file mode 100644 index 000000000..ba10ec1a0 --- /dev/null +++ b/node_modules/stylelint/lib/reference/properties.js @@ -0,0 +1,399 @@ +'use strict'; + +const acceptCustomIdentsProperties = new Set([ + 'animation', + 'animation-name', + 'font', + 'font-family', + 'counter-increment', + 'grid-row', + 'grid-column', + 'grid-area', + 'list-style', + 'list-style-type', +]); + +/** @type {import('stylelint').LonghandSubPropertiesOfShorthandProperties} */ +const longhandSubPropertiesOfShorthandProperties = new Map([ + // Sort alphabetically + [ + 'animation', + new Set([ + // prettier-ignore + 'animation-name', + 'animation-duration', + 'animation-timing-function', + 'animation-delay', + 'animation-iteration-count', + 'animation-direction', + 'animation-fill-mode', + 'animation-play-state', + ]), + ], + [ + 'background', + new Set([ + // prettier-ignore + 'background-image', + 'background-size', + 'background-position', + 'background-repeat', + 'background-origin', + 'background-clip', + 'background-attachment', + 'background-color', + ]), + ], + [ + 'border', + new Set([ + // prettier-ignore + 'border-top-width', + 'border-right-width', + 'border-bottom-width', + 'border-left-width', + 'border-top-style', + 'border-right-style', + 'border-bottom-style', + 'border-left-style', + 'border-top-color', + 'border-right-color', + 'border-bottom-color', + 'border-left-color', + ]), + ], + [ + 'border-block-end', + new Set([ + // prettier-ignore + 'border-block-end-width', + 'border-block-end-style', + 'border-block-end-color', + ]), + ], + [ + 'border-block-start', + new Set([ + // prettier-ignore + 'border-block-start-width', + 'border-block-start-style', + 'border-block-start-color', + ]), + ], + [ + 'border-bottom', + new Set([ + // prettier-ignore + 'border-bottom-width', + 'border-bottom-style', + 'border-bottom-color', + ]), + ], + [ + 'border-color', + new Set([ + // prettier-ignore + 'border-top-color', + 'border-right-color', + 'border-bottom-color', + 'border-left-color', + ]), + ], + [ + 'border-image', + new Set([ + // prettier-ignore + 'border-image-source', + 'border-image-slice', + 'border-image-width', + 'border-image-outset', + 'border-image-repeat', + ]), + ], + [ + 'border-inline-end', + new Set([ + // prettier-ignore + 'border-inline-end-width', + 'border-inline-end-style', + 'border-inline-end-color', + ]), + ], + [ + 'border-inline-start', + new Set([ + // prettier-ignore + 'border-inline-start-width', + 'border-inline-start-style', + 'border-inline-start-color', + ]), + ], + [ + 'border-left', + new Set([ + // prettier-ignore + 'border-left-width', + 'border-left-style', + 'border-left-color', + ]), + ], + [ + 'border-radius', + new Set([ + // prettier-ignore + 'border-top-left-radius', + 'border-top-right-radius', + 'border-bottom-right-radius', + 'border-bottom-left-radius', + ]), + ], + [ + 'border-right', + new Set([ + // prettier-ignore + 'border-right-width', + 'border-right-style', + 'border-right-color', + ]), + ], + [ + 'border-style', + new Set([ + // prettier-ignore + 'border-top-style', + 'border-right-style', + 'border-bottom-style', + 'border-left-style', + ]), + ], + [ + 'border-top', + new Set([ + // prettier-ignore + 'border-top-width', + 'border-top-style', + 'border-top-color', + ]), + ], + [ + 'border-width', + new Set([ + // prettier-ignore + 'border-top-width', + 'border-right-width', + 'border-bottom-width', + 'border-left-width', + ]), + ], + [ + 'column-rule', + new Set([ + // prettier-ignore + 'column-rule-width', + 'column-rule-style', + 'column-rule-color', + ]), + ], + [ + 'columns', + new Set([ + // prettier-ignore + 'column-width', + 'column-count', + ]), + ], + [ + 'flex', + new Set([ + // prettier-ignore + 'flex-grow', + 'flex-shrink', + 'flex-basis', + ]), + ], + [ + 'flex-flow', + new Set([ + // prettier-ignore + 'flex-direction', + 'flex-wrap', + ]), + ], + [ + 'font', + new Set([ + // prettier-ignore + 'font-style', + 'font-variant', + 'font-weight', + 'font-stretch', + 'font-size', + 'line-height', + 'font-family', + ]), + ], + [ + 'grid', + new Set([ + // prettier-ignore + 'grid-template-rows', + 'grid-template-columns', + 'grid-template-areas', + 'grid-auto-rows', + 'grid-auto-columns', + 'grid-auto-flow', + 'grid-column-gap', + 'grid-row-gap', + ]), + ], + [ + 'grid-area', + new Set([ + // prettier-ignore + 'grid-row-start', + 'grid-column-start', + 'grid-row-end', + 'grid-column-end', + ]), + ], + [ + 'grid-column', + new Set([ + // prettier-ignore + 'grid-column-start', + 'grid-column-end', + ]), + ], + [ + 'grid-gap', + new Set([ + // prettier-ignore + 'grid-row-gap', + 'grid-column-gap', + ]), + ], + [ + 'grid-row', + new Set([ + // prettier-ignore + 'grid-row-start', + 'grid-row-end', + ]), + ], + [ + 'grid-template', + new Set([ + // prettier-ignore + 'grid-template-columns', + 'grid-template-rows', + 'grid-template-areas', + ]), + ], + [ + 'inset', + new Set([ + // prettier-ignore + 'top', + 'right', + 'bottom', + 'left', + ]), + ], + [ + 'list-style', + new Set([ + // prettier-ignore + 'list-style-type', + 'list-style-position', + 'list-style-image', + ]), + ], + [ + 'margin', + new Set([ + // prettier-ignore + 'margin-top', + 'margin-right', + 'margin-bottom', + 'margin-left', + ]), + ], + [ + 'mask', + new Set([ + // prettier-ignore + 'mask-image', + 'mask-mode', + 'mask-position', + 'mask-size', + 'mask-repeat', + 'mask-origin', + 'mask-clip', + 'mask-composite', + ]), + ], + [ + 'outline', + new Set([ + // prettier-ignore + 'outline-color', + 'outline-style', + 'outline-width', + ]), + ], + [ + 'padding', + new Set([ + // prettier-ignore + 'padding-top', + 'padding-right', + 'padding-bottom', + 'padding-left', + ]), + ], + [ + 'text-decoration', + new Set([ + // prettier-ignore + 'text-decoration-line', + 'text-decoration-style', + 'text-decoration-color', + // TODO: add support for text-decoration-thickness, Level 4 + // https://w3c.github.io/csswg-drafts/css-text-decor-4/#text-decoration-width-property + ]), + ], + [ + 'text-emphasis', + new Set([ + // prettier-ignore + 'text-emphasis-style', + 'text-emphasis-color', + ]), + ], + [ + 'transition', + new Set([ + // prettier-ignore + 'transition-property', + 'transition-duration', + 'transition-timing-function', + 'transition-delay', + ]), + ], +]); + +const longhandTimeProperties = new Set([ + 'transition-duration', + 'transition-delay', + 'animation-duration', + 'animation-delay', +]); + +const shorthandTimeProperties = new Set(['transition', 'animation']); + +module.exports = { + acceptCustomIdentsProperties, + longhandSubPropertiesOfShorthandProperties, + longhandTimeProperties, + shorthandTimeProperties, +}; diff --git a/node_modules/stylelint/lib/reference/selectors.js b/node_modules/stylelint/lib/reference/selectors.js new file mode 100644 index 000000000..5acfb7718 --- /dev/null +++ b/node_modules/stylelint/lib/reference/selectors.js @@ -0,0 +1,320 @@ +'use strict'; + +const htmlTags = require('html-tags'); +const uniteSets = require('../utils/uniteSets.js'); + +const deprecatedHtmlTypeSelectors = new Set([ + 'acronym', + 'applet', + 'basefont', + 'big', + 'blink', + 'center', + 'content', + 'dir', + 'font', + 'frame', + 'frameset', + 'hgroup', + 'isindex', + 'keygen', + 'listing', + 'marquee', + 'nobr', + 'noembed', + 'plaintext', + 'spacer', + 'strike', + 'tt', + 'xmp', +]); + +// typecasting htmlTags to be more generic; see https://github.com/stylelint/stylelint/pull/6013 for discussion +/** @type {Set} */ +const standardHtmlTypeSelectors = new Set(htmlTags); + +const htmlTypeSelectors = uniteSets(deprecatedHtmlTypeSelectors, standardHtmlTypeSelectors); + +const mixedCaseSvgTypeSelectors = new Set([ + 'altGlyph', + 'altGlyphDef', + 'altGlyphItem', + 'animateColor', + 'animateMotion', + 'animateTransform', + 'clipPath', + 'feBlend', + 'feColorMatrix', + 'feComponentTransfer', + 'feComposite', + 'feConvolveMatrix', + 'feDiffuseLighting', + 'feDisplacementMap', + 'feDistantLight', + 'feDropShadow', + 'feFlood', + 'feFuncA', + 'feFuncB', + 'feFuncG', + 'feFuncR', + 'feGaussianBlur', + 'feImage', + 'feMerge', + 'feMergeNode', + 'feMorphology', + 'feOffset', + 'fePointLight', + 'feSpecularLighting', + 'feSpotLight', + 'feTile', + 'feTurbulence', + 'foreignObject', + 'glyphRef', + 'linearGradient', + 'radialGradient', + 'textPath', +]); + +// These are the ones that can have single-colon notation +const levelOneAndTwoPseudoElements = new Set(['before', 'after', 'first-line', 'first-letter']); + +const shadowTreePseudoElements = new Set(['part']); + +const webkitScrollbarPseudoElements = new Set([ + '-webkit-resizer', + '-webkit-scrollbar', + '-webkit-scrollbar-button', + '-webkit-scrollbar-corner', + '-webkit-scrollbar-thumb', + '-webkit-scrollbar-track', + '-webkit-scrollbar-track-piece', +]); + +const vendorSpecificPseudoElements = uniteSets(webkitScrollbarPseudoElements, [ + '-moz-focus-inner', + '-moz-focus-outer', + '-moz-list-bullet', + '-moz-meter-bar', + '-moz-placeholder', + '-moz-progress-bar', + '-moz-range-progress', + '-moz-range-thumb', + '-moz-range-track', + '-ms-browse', + '-ms-check', + '-ms-clear', + '-ms-expand', + '-ms-fill', + '-ms-fill-lower', + '-ms-fill-upper', + '-ms-reveal', + '-ms-thumb', + '-ms-ticks-after', + '-ms-ticks-before', + '-ms-tooltip', + '-ms-track', + '-ms-value', + '-webkit-color-swatch', + '-webkit-color-swatch-wrapper', + '-webkit-calendar-picker-indicator', + '-webkit-clear-button', + '-webkit-date-and-time-value', + '-webkit-datetime-edit', + '-webkit-datetime-edit-ampm-field', + '-webkit-datetime-edit-day-field', + '-webkit-datetime-edit-fields-wrapper', + '-webkit-datetime-edit-hour-field', + '-webkit-datetime-edit-millisecond-field', + '-webkit-datetime-edit-minute-field', + '-webkit-datetime-edit-month-field', + '-webkit-datetime-edit-second-field', + '-webkit-datetime-edit-text', + '-webkit-datetime-edit-week-field', + '-webkit-datetime-edit-year-field', + '-webkit-details-marker', + '-webkit-distributed', + '-webkit-file-upload-button', + '-webkit-input-placeholder', + '-webkit-keygen-select', + '-webkit-meter-bar', + '-webkit-meter-even-less-good-value', + '-webkit-meter-inner-element', + '-webkit-meter-optimum-value', + '-webkit-meter-suboptimum-value', + '-webkit-progress-bar', + '-webkit-progress-inner-element', + '-webkit-progress-value', + '-webkit-search-cancel-button', + '-webkit-search-decoration', + '-webkit-search-results-button', + '-webkit-search-results-decoration', + '-webkit-slider-runnable-track', + '-webkit-slider-thumb', + '-webkit-textfield-decoration-container', + '-webkit-validation-bubble', + '-webkit-validation-bubble-arrow', + '-webkit-validation-bubble-arrow-clipper', + '-webkit-validation-bubble-heading', + '-webkit-validation-bubble-message', + '-webkit-validation-bubble-text-block', +]); + +const pseudoElements = uniteSets( + levelOneAndTwoPseudoElements, + vendorSpecificPseudoElements, + shadowTreePseudoElements, + [ + 'backdrop', + 'content', + 'cue', + 'file-selector-button', + 'grammar-error', + 'highlight', + 'marker', + 'placeholder', + 'selection', + 'shadow', + 'slotted', + 'spelling-error', + 'target-text', + ], +); + +const aNPlusBNotationPseudoClasses = new Set([ + 'nth-column', + 'nth-last-column', + 'nth-last-of-type', + 'nth-of-type', +]); + +const aNPlusBOfSNotationPseudoClasses = new Set(['nth-child', 'nth-last-child']); + +const atRulePagePseudoClasses = new Set(['first', 'right', 'left', 'blank']); + +const linguisticPseudoClasses = new Set(['dir', 'lang']); + +const logicalCombinationsPseudoClasses = new Set(['has', 'is', 'matches', 'not', 'where']); + +const vendorSpecificPseudoClasses = new Set([ + '-khtml-drag', + '-moz-any', + '-moz-any-link', + '-moz-broken', + '-moz-drag-over', + '-moz-first-node', + '-moz-focusring', + '-moz-full-screen', + '-moz-full-screen-ancestor', + '-moz-last-node', + '-moz-loading', + '-moz-meter-optimum', + '-moz-meter-sub-optimum', + '-moz-meter-sub-sub-optimum', + '-moz-placeholder', + '-moz-submit-invalid', + '-moz-suppressed', + '-moz-ui-invalid', + '-moz-ui-valid', + '-moz-user-disabled', + '-moz-window-inactive', + '-ms-fullscreen', + '-ms-input-placeholder', + '-webkit-drag', + '-webkit-any', + '-webkit-any-link', + '-webkit-autofill', + '-webkit-full-screen', + '-webkit-full-screen-ancestor', +]); + +// https://webkit.org/blog/363/styling-scrollbars/ +const webkitScrollbarPseudoClasses = new Set([ + 'horizontal', + 'vertical', + 'decrement', + 'increment', + 'start', + 'end', + 'double-button', + 'single-button', + 'no-button', + 'corner-present', + 'window-inactive', +]); + +const pseudoClasses = uniteSets( + aNPlusBNotationPseudoClasses, + linguisticPseudoClasses, + logicalCombinationsPseudoClasses, + aNPlusBOfSNotationPseudoClasses, + vendorSpecificPseudoClasses, + [ + 'active', + 'any-link', + 'autofill', + 'blank', + 'checked', + 'current', + 'default', + 'defined', + 'disabled', + 'empty', + 'enabled', + 'first-child', + 'first-of-type', + 'focus', + 'focus-within', + 'focus-visible', + 'fullscreen', + 'fullscreen-ancestor', + 'future', + 'host', + 'host-context', + 'hover', + 'indeterminate', + 'in-range', + 'invalid', + 'last-child', + 'last-of-type', + 'link', + 'modal', + 'only-child', + 'only-of-type', + 'optional', + 'out-of-range', + 'past', + 'placeholder-shown', + 'playing', + 'picture-in-picture', + 'paused', + 'read-only', + 'read-write', + 'required', + 'root', + 'scope', + 'state', + 'target', + 'unresolved', + 'user-invalid', + 'user-valid', + 'valid', + 'visited', + 'window-inactive', // for ::selection (chrome) + ], +); + +module.exports = { + aNPlusBNotationPseudoClasses, + aNPlusBOfSNotationPseudoClasses, + atRulePagePseudoClasses, + levelOneAndTwoPseudoElements, + linguisticPseudoClasses, + logicalCombinationsPseudoClasses, + mixedCaseSvgTypeSelectors, + pseudoClasses, + pseudoElements, + shadowTreePseudoElements, + htmlTypeSelectors, + webkitScrollbarPseudoClasses, + webkitScrollbarPseudoElements, +}; diff --git a/node_modules/stylelint/lib/reference/units.js b/node_modules/stylelint/lib/reference/units.js new file mode 100644 index 000000000..aaadd4ce1 --- /dev/null +++ b/node_modules/stylelint/lib/reference/units.js @@ -0,0 +1,87 @@ +'use strict'; + +const uniteSets = require('../utils/uniteSets.js'); + +const lengthUnits = new Set([ + // Font-relative length units + 'cap', + 'ch', + 'em', + 'ex', + 'ic', + 'lh', + 'rcap', + 'rch', + 'rem', + 'rex', + 'ric', + 'rlh', + // Viewport-percentage lengths + 'dvb', + 'dvh', + 'dvi', + 'dvmax', + 'dvmin', + 'dvw', + 'lvb', + 'lvh', + 'lvi', + 'lvmax', + 'lvmin', + 'lvw', + 'svb', + 'svh', + 'svi', + 'svmax', + 'svmin', + 'svw', + 'vb', + 'vh', + 'vi', + 'vw', + 'vmin', + 'vmax', + 'vm', + // Absolute length units + 'px', + 'mm', + 'cm', + 'in', + 'pt', + 'pc', + 'q', + 'mozmm', + // Flexible length units + 'fr', + // Container query units + 'cqw', + 'cqh', + 'cqi', + 'cqb', + 'cqmin', + 'cqmax', +]); + +const resolutionUnits = new Set(['dpi', 'dpcm', 'dppx', 'x']); + +const units = uniteSets(lengthUnits, resolutionUnits, [ + // Relative length units + '%', + // Time length units + 's', + 'ms', + // Angle + 'deg', + 'grad', + 'turn', + 'rad', + // Frequency + 'Hz', + 'kHz', +]); + +module.exports = { + lengthUnits, + resolutionUnits, + units, +}; diff --git a/node_modules/stylelint/lib/reportDisables.js b/node_modules/stylelint/lib/reportDisables.js new file mode 100644 index 000000000..1abf008ff --- /dev/null +++ b/node_modules/stylelint/lib/reportDisables.js @@ -0,0 +1,64 @@ +'use strict'; + +/** @typedef {import('stylelint').DisableReportRange} DisabledRange */ +/** @typedef {import('stylelint').LintResult} StylelintResult */ +/** @typedef {import('stylelint').ConfigRuleSettings} StylelintConfigRuleSettings */ + +/** + * Returns a report describing which `results` (if any) contain disabled ranges + * for rules that disallow disables via `reportDisables: true`. + * + * @param {StylelintResult[]} results + */ +module.exports = function reportDisables(results) { + for (const result of results) { + // File with `CssSyntaxError` don't have `_postcssResult`s. + if (!result._postcssResult) { + continue; + } + + const rangeData = result._postcssResult.stylelint.disabledRanges; + + if (!rangeData) continue; + + const config = result._postcssResult.stylelint.config; + + if (!config || !config.rules) continue; + + // If no rules actually disallow disables, don't bother looking for ranges + // that correspond to disabled rules. + if (!Object.values(config.rules).some((rule) => reportDisablesForRule(rule))) { + continue; + } + + for (const [rule, ranges] of Object.entries(rangeData)) { + for (const range of ranges) { + if (!reportDisablesForRule(config.rules[rule] || [])) continue; + + // If the comment doesn't have a location, we can't report a useful error. + // In practice we expect all comments to have locations, though. + if (!range.comment.source || !range.comment.source.start) continue; + + result.warnings.push({ + text: `Rule "${rule}" may not be disabled`, + rule: 'reportDisables', + line: range.comment.source.start.line, + column: range.comment.source.start.column, + endLine: range.comment.source.end && range.comment.source.end.line, + endColumn: range.comment.source.end && range.comment.source.end.column, + severity: 'error', + }); + } + } + } +}; + +/** + * @param {StylelintConfigRuleSettings} options + * @return {boolean} + */ +function reportDisablesForRule(options) { + if (!options || !options[1]) return false; + + return Boolean(options[1].reportDisables); +} diff --git a/node_modules/stylelint/lib/reportUnknownRuleNames.js b/node_modules/stylelint/lib/reportUnknownRuleNames.js new file mode 100644 index 000000000..3f5a1c07f --- /dev/null +++ b/node_modules/stylelint/lib/reportUnknownRuleNames.js @@ -0,0 +1,76 @@ +'use strict'; + +const levenshtein = require('fastest-levenshtein'); +const rules = require('./rules'); + +const MAX_LEVENSHTEIN_DISTANCE = 6; +const MAX_SUGGESTIONS_COUNT = 3; + +/** + * @param {string} ruleName + * @return {string[]} + */ +function extractSuggestions(ruleName) { + const suggestions = Array.from({ length: MAX_LEVENSHTEIN_DISTANCE }); + + for (let i = 0; i < suggestions.length; i++) { + suggestions[i] = []; + } + + for (const existRuleName of Object.keys(rules)) { + const distance = levenshtein.distance(existRuleName, ruleName); + + if (distance <= MAX_LEVENSHTEIN_DISTANCE) { + suggestions[distance - 1].push(existRuleName); + } + } + + /** @type {string[]} */ + let result = []; + + for (const [i, suggestion] of suggestions.entries()) { + if (suggestion.length > 0) { + if (i < 3) { + return suggestion.slice(0, MAX_SUGGESTIONS_COUNT); + } + + result = result.concat(suggestion); + } + } + + return result.slice(0, MAX_SUGGESTIONS_COUNT); +} + +/** + * @param {string} ruleName + * @param {string[]} [suggestions=[]] + * @return {string} + */ +function rejectMessage(ruleName, suggestions = []) { + return `Unknown rule ${ruleName}.${ + suggestions.length > 0 ? ` Did you mean ${suggestions.join(', ')}?` : '' + }`; +} + +/** @type {Map} */ +const cache = new Map(); + +/** + * @param {string} unknownRuleName + * @param {import('postcss').Root} postcssRoot + * @param {import('stylelint').PostcssResult} postcssResult + * @returns {void} + */ +module.exports = function reportUnknownRuleNames(unknownRuleName, postcssRoot, postcssResult) { + const suggestions = cache.has(unknownRuleName) + ? /** @type {string[]} */ (cache.get(unknownRuleName)) + : extractSuggestions(unknownRuleName); + + cache.set(unknownRuleName, suggestions); + postcssResult.warn(rejectMessage(unknownRuleName, suggestions), { + severity: 'error', + rule: unknownRuleName, + node: postcssRoot, + index: 0, + }); +}; diff --git a/node_modules/stylelint/lib/resolveConfig.js b/node_modules/stylelint/lib/resolveConfig.js new file mode 100644 index 000000000..5f710674a --- /dev/null +++ b/node_modules/stylelint/lib/resolveConfig.js @@ -0,0 +1,39 @@ +'use strict'; + +const path = require('path'); + +const createStylelint = require('./createStylelint'); +const getConfigForFile = require('./getConfigForFile'); + +/** + * @type {import('stylelint')['resolveConfig']} + */ +module.exports = async function resolveConfig( + filePath, + { cwd = process.cwd(), config, configBasedir, configFile } = {}, +) { + if (!filePath) { + return undefined; + } + + const stylelint = createStylelint({ + config, + configFile, + configBasedir, + cwd, + }); + + const absoluteFilePath = !path.isAbsolute(filePath) + ? path.join(cwd, filePath) + : path.normalize(filePath); + + const configSearchPath = stylelint._options.configFile || absoluteFilePath; + + const resolved = await getConfigForFile(stylelint, configSearchPath, absoluteFilePath); + + if (!resolved) { + return undefined; + } + + return resolved.config; +}; diff --git a/node_modules/stylelint/lib/resolveCustomFormatter.js b/node_modules/stylelint/lib/resolveCustomFormatter.js new file mode 100644 index 000000000..f2c798caf --- /dev/null +++ b/node_modules/stylelint/lib/resolveCustomFormatter.js @@ -0,0 +1,16 @@ +const fs = require('fs'); +const path = require('path'); + +/** + * @param {string} formatterPath + * @returns {string} + */ +module.exports = function resolveCustomFormatter(formatterPath) { + const resolvedPath = path.resolve(formatterPath); + + if (fs.existsSync(resolvedPath)) { + return resolvedPath; + } + + return require.resolve(formatterPath); +}; diff --git a/node_modules/stylelint/lib/rules/alpha-value-notation/index.js b/node_modules/stylelint/lib/rules/alpha-value-notation/index.js new file mode 100644 index 000000000..3bb297e41 --- /dev/null +++ b/node_modules/stylelint/lib/rules/alpha-value-notation/index.js @@ -0,0 +1,227 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString, assert } = require('../../utils/validateTypes'); + +const ruleName = 'alpha-value-notation'; + +const messages = ruleMessages(ruleName, { + expected: (unfixed, fixed) => `Expected "${unfixed}" to be "${fixed}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/alpha-value-notation', + fixable: true, +}; + +const ALPHA_PROPS = + /^(?:opacity|shape-image-threshold|fill-opacity|flood-opacity|stop-opacity|stroke-opacity)$/i; +const ALPHA_FUNCTION = /(?:color|hsla?|rgba?|hwb|lab|lch|oklab|oklch)\(/i; +const ALPHA_FUNCTION_NAME = /^(?:color|hsla?|rgba?|hwb|lab|lch|oklab|oklch)$/i; +const DIGIT = /\d/; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['number', 'percentage'], + }, + { + actual: secondaryOptions, + possible: { + exceptProperties: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) return; + + const optionFuncs = Object.freeze({ + number: { + expFunc: isNumber, + fixFunc: asNumber, + }, + percentage: { + expFunc: isPercentage, + fixFunc: asPercentage, + }, + }); + + root.walkDecls((decl) => { + const declarationValue = getDeclarationValue(decl); + const isAlphaProp = ALPHA_PROPS.test(decl.prop); + + if ( + // If the property is not an alpha property + (!isAlphaProp && + // And the value is not an alpha function + !ALPHA_FUNCTION.test(declarationValue)) || + // Or the value does not contain digits + !DIGIT.test(declarationValue) + ) { + // Abort early + return; + } + + let needsFix = false; + const parsedValue = valueParser(declarationValue); + + parsedValue.walk((node) => { + /** @type {import('postcss-value-parser').Node | undefined} */ + let alpha; + + if (isAlphaProp && DIGIT.test(node.value)) { + alpha = findAlphaInValue(node); + } else if (node.type === 'function' && ALPHA_FUNCTION_NAME.test(node.value)) { + alpha = findAlphaInFunction(node); + } + + if (!alpha) return; + + const { value } = alpha; + + if (!isStandardSyntaxValue(value)) return; + + if (!isNumber(value) && !isPercentage(value)) return; + + /** @type {'number' | 'percentage'} */ + let expectation = primary; + + if (optionsMatches(secondaryOptions, 'exceptProperties', decl.prop)) { + if (expectation === 'number') { + expectation = 'percentage'; + } else if (expectation === 'percentage') { + expectation = 'number'; + } + } + + if (optionFuncs[expectation].expFunc(value)) return; + + const fixed = optionFuncs[expectation].fixFunc(value); + const unfixed = value; + + if (context.fix) { + alpha.value = String(fixed); + needsFix = true; + + return; + } + + const index = declarationValueIndex(decl) + alpha.sourceIndex; + const endIndex = index + alpha.value.length; + + report({ + message: messages.expected, + messageArgs: [unfixed, fixed], + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + + if (needsFix) { + setDeclarationValue(decl, parsedValue.toString()); + } + }); + }; +}; + +/** + * @param {string} value + * @returns {string} + */ +function asPercentage(value) { + const number = Number(value); + + return `${Number((number * 100).toPrecision(3))}%`; +} + +/** + * @param {string} value + * @returns {string} + */ +function asNumber(value) { + const dimension = valueParser.unit(value); + + assert(dimension); + + const number = Number(dimension.number); + + return Number((number / 100).toPrecision(3)).toString(); +} + +/** + * @template {import('postcss-value-parser').Node} T + * @param {T} node + * @returns {T | undefined} + */ +function findAlphaInValue(node) { + return node.type === 'word' || node.type === 'function' ? node : undefined; +} + +/** + * @param {import('postcss-value-parser').FunctionNode} node + * @returns {import('postcss-value-parser').Node | undefined} + */ +function findAlphaInFunction(node) { + const legacySyntax = node.nodes.some(({ type, value }) => type === 'div' && value === ','); + + if (legacySyntax) { + const args = node.nodes.filter(({ type }) => type === 'word' || type === 'function'); + + if (args.length === 4) return args[3]; + + return undefined; + } + + const slashNodeIndex = node.nodes.findIndex(({ type, value }) => type === 'div' && value === '/'); + + if (slashNodeIndex !== -1) { + const nodesAfterSlash = node.nodes.slice(slashNodeIndex + 1, node.nodes.length); + + return nodesAfterSlash.find(({ type }) => type === 'word'); + } + + return undefined; +} + +/** + * @param {string} value + * @returns {boolean} + */ +function isPercentage(value) { + const dimension = valueParser.unit(value); + + return dimension && dimension.unit === '%'; +} + +/** + * @param {string} value + * @returns {boolean} + */ +function isNumber(value) { + const dimension = valueParser.unit(value); + + return dimension && dimension.unit === ''; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/annotation-no-unknown/index.js b/node_modules/stylelint/lib/rules/annotation-no-unknown/index.js new file mode 100644 index 000000000..a1a187f19 --- /dev/null +++ b/node_modules/stylelint/lib/rules/annotation-no-unknown/index.js @@ -0,0 +1,90 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'annotation-no-unknown'; + +const messages = ruleMessages(ruleName, { + rejected: (annotation) => `Unexpected unknown annotation "${annotation}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/annotation-no-unknown', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignoreAnnotations: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkDecls(checkStatement); + + /** + * @param {import('postcss').Declaration} decl + */ + function checkStatement(decl) { + if (!isStandardSyntaxValue(decl.value)) return; + + if (decl.important) return; + + if (!decl.value.includes('!')) return; + + const parsedValue = valueParser(getDeclarationValue(decl)); + + parsedValue.walk((node) => { + if (!isAnnotation(node)) return; + + const value = node.value; + const tokenValue = value.slice(1); + + if (optionsMatches(secondaryOptions, 'ignoreAnnotations', tokenValue)) { + return; + } + + report({ + message: messages.rejected, + messageArgs: [value], + node: decl, + result, + ruleName, + word: value, + }); + }); + } + + /** + * @param {valueParser.Node} node + */ + function isAnnotation(node) { + return node.type === 'word' && node.value.startsWith('!'); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-allowed-list/index.js b/node_modules/stylelint/lib/rules/at-rule-allowed-list/index.js new file mode 100644 index 000000000..98d9181ab --- /dev/null +++ b/node_modules/stylelint/lib/rules/at-rule-allowed-list/index.js @@ -0,0 +1,62 @@ +'use strict'; + +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isString } = require('../../utils/validateTypes'); + +const ruleName = 'at-rule-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (name) => `Unexpected at-rule "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/at-rule-allowed-list', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString], + }); + + if (!validOptions) { + return; + } + + const primaryValues = [primary].flat(); + + root.walkAtRules((atRule) => { + const name = atRule.name; + + if (!isStandardSyntaxAtRule(atRule)) { + return; + } + + if (primaryValues.includes(vendor.unprefixed(name).toLowerCase())) { + return; + } + + report({ + message: messages.rejected, + messageArgs: [name], + node: atRule, + result, + ruleName, + word: `@${name}`, + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-disallowed-list/index.js b/node_modules/stylelint/lib/rules/at-rule-disallowed-list/index.js new file mode 100644 index 000000000..a59a74289 --- /dev/null +++ b/node_modules/stylelint/lib/rules/at-rule-disallowed-list/index.js @@ -0,0 +1,62 @@ +'use strict'; + +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isString } = require('../../utils/validateTypes'); + +const ruleName = 'at-rule-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (name) => `Unexpected at-rule "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/at-rule-disallowed-list', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString], + }); + + if (!validOptions) { + return; + } + + const primaryValues = [primary].flat(); + + root.walkAtRules((atRule) => { + const name = atRule.name; + + if (!isStandardSyntaxAtRule(atRule)) { + return; + } + + if (!primaryValues.includes(vendor.unprefixed(name).toLowerCase())) { + return; + } + + report({ + message: messages.rejected, + messageArgs: [name], + node: atRule, + result, + ruleName, + word: `@${atRule.name}`, + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-empty-line-before/index.js b/node_modules/stylelint/lib/rules/at-rule-empty-line-before/index.js new file mode 100644 index 000000000..8c5df6832 --- /dev/null +++ b/node_modules/stylelint/lib/rules/at-rule-empty-line-before/index.js @@ -0,0 +1,173 @@ +'use strict'; + +const addEmptyLineBefore = require('../../utils/addEmptyLineBefore'); +const getPreviousNonSharedLineCommentNode = require('../../utils/getPreviousNonSharedLineCommentNode'); +const hasEmptyLine = require('../../utils/hasEmptyLine'); +const isAfterComment = require('../../utils/isAfterComment'); +const isBlocklessAtRuleAfterBlocklessAtRule = require('../../utils/isBlocklessAtRuleAfterBlocklessAtRule'); +const isBlocklessAtRuleAfterSameNameBlocklessAtRule = require('../../utils/isBlocklessAtRuleAfterSameNameBlocklessAtRule'); +const isFirstNested = require('../../utils/isFirstNested'); +const isFirstNodeOfRoot = require('../../utils/isFirstNodeOfRoot'); +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const optionsMatches = require('../../utils/optionsMatches'); +const removeEmptyLinesBefore = require('../../utils/removeEmptyLinesBefore'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const { isAtRule } = require('../../utils/typeGuards'); +const validateOptions = require('../../utils/validateOptions'); +const { isString } = require('../../utils/validateTypes'); + +const ruleName = 'at-rule-empty-line-before'; + +const messages = ruleMessages(ruleName, { + expected: 'Expected empty line before at-rule', + rejected: 'Unexpected empty line before at-rule', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/at-rule-empty-line-before', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['always', 'never'], + }, + { + actual: secondaryOptions, + possible: { + except: [ + 'after-same-name', + 'inside-block', + 'blockless-after-same-name-blockless', + 'blockless-after-blockless', + 'first-nested', + ], + ignore: [ + 'after-comment', + 'first-nested', + 'inside-block', + 'blockless-after-same-name-blockless', + 'blockless-after-blockless', + ], + ignoreAtRules: [isString], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + /** @type {'always' | 'never'} */ + const expectation = primary; + + root.walkAtRules((atRule) => { + const isNested = atRule.parent && atRule.parent.type !== 'root'; + + // Ignore the first node + if (isFirstNodeOfRoot(atRule)) { + return; + } + + if (!isStandardSyntaxAtRule(atRule)) { + return; + } + + // Return early if at-rule is to be ignored + if (optionsMatches(secondaryOptions, 'ignoreAtRules', atRule.name)) { + return; + } + + // Optionally ignore the expectation if the node is blockless + if ( + optionsMatches(secondaryOptions, 'ignore', 'blockless-after-blockless') && + isBlocklessAtRuleAfterBlocklessAtRule(atRule) + ) { + return; + } + + // Optionally ignore the node if it is the first nested + if (optionsMatches(secondaryOptions, 'ignore', 'first-nested') && isFirstNested(atRule)) { + return; + } + + // Optionally ignore the expectation if the node is blockless + // and following another blockless at-rule with the same name + if ( + optionsMatches(secondaryOptions, 'ignore', 'blockless-after-same-name-blockless') && + isBlocklessAtRuleAfterSameNameBlocklessAtRule(atRule) + ) { + return; + } + + // Optionally ignore the expectation if the node is inside a block + if (optionsMatches(secondaryOptions, 'ignore', 'inside-block') && isNested) { + return; + } + + // Optionally ignore the expectation if a comment precedes this node + if (optionsMatches(secondaryOptions, 'ignore', 'after-comment') && isAfterComment(atRule)) { + return; + } + + const hasEmptyLineBefore = hasEmptyLine(atRule.raws.before); + let expectEmptyLineBefore = expectation === 'always'; + + // Optionally reverse the expectation if any exceptions apply + if ( + (optionsMatches(secondaryOptions, 'except', 'after-same-name') && + isAtRuleAfterSameNameAtRule(atRule)) || + (optionsMatches(secondaryOptions, 'except', 'inside-block') && isNested) || + (optionsMatches(secondaryOptions, 'except', 'first-nested') && isFirstNested(atRule)) || + (optionsMatches(secondaryOptions, 'except', 'blockless-after-blockless') && + isBlocklessAtRuleAfterBlocklessAtRule(atRule)) || + (optionsMatches(secondaryOptions, 'except', 'blockless-after-same-name-blockless') && + isBlocklessAtRuleAfterSameNameBlocklessAtRule(atRule)) + ) { + expectEmptyLineBefore = !expectEmptyLineBefore; + } + + // Return if the expectation is met + if (expectEmptyLineBefore === hasEmptyLineBefore) { + return; + } + + // Fix + if (context.fix && context.newline) { + if (expectEmptyLineBefore) { + addEmptyLineBefore(atRule, context.newline); + } else { + removeEmptyLinesBefore(atRule, context.newline); + } + + return; + } + + const message = expectEmptyLineBefore ? messages.expected : messages.rejected; + + report({ message, node: atRule, result, ruleName }); + }); + }; +}; + +/** + * @param {import('postcss').AtRule} atRule + */ +function isAtRuleAfterSameNameAtRule(atRule) { + const previousNode = getPreviousNonSharedLineCommentNode(atRule); + + return previousNode && isAtRule(previousNode) && previousNode.name === atRule.name; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-name-case/index.js b/node_modules/stylelint/lib/rules/at-rule-name-case/index.js new file mode 100644 index 000000000..fd73f4651 --- /dev/null +++ b/node_modules/stylelint/lib/rules/at-rule-name-case/index.js @@ -0,0 +1,67 @@ +'use strict'; + +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'at-rule-name-case'; + +const messages = ruleMessages(ruleName, { + expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/at-rule-name-case', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondary, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['lower', 'upper'], + }); + + if (!validOptions) { + return; + } + + /** @type {'lower' | 'upper'} */ + const expectation = primary; + + root.walkAtRules((atRule) => { + if (!isStandardSyntaxAtRule(atRule)) { + return; + } + + const name = atRule.name; + + const expectedName = expectation === 'lower' ? name.toLowerCase() : name.toUpperCase(); + + if (name === expectedName) { + return; + } + + if (context.fix) { + atRule.name = expectedName; + + return; + } + + report({ + message: messages.expected(name, expectedName), + node: atRule, + ruleName, + result, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-name-newline-after/index.js b/node_modules/stylelint/lib/rules/at-rule-name-newline-after/index.js new file mode 100644 index 000000000..d04dbb312 --- /dev/null +++ b/node_modules/stylelint/lib/rules/at-rule-name-newline-after/index.js @@ -0,0 +1,45 @@ +'use strict'; + +const atRuleNameSpaceChecker = require('../atRuleNameSpaceChecker'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'at-rule-name-newline-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: (name) => `Expected newline after at-rule name "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/at-rule-name-newline-after', + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line'], + }); + + if (!validOptions) { + return; + } + + atRuleNameSpaceChecker({ + root, + result, + locationChecker: checker.afterOneOnly, + checkedRuleName: ruleName, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-name-space-after/index.js b/node_modules/stylelint/lib/rules/at-rule-name-space-after/index.js new file mode 100644 index 000000000..473457dc7 --- /dev/null +++ b/node_modules/stylelint/lib/rules/at-rule-name-space-after/index.js @@ -0,0 +1,53 @@ +'use strict'; + +const atRuleNameSpaceChecker = require('../atRuleNameSpaceChecker'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'at-rule-name-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: (name) => `Expected single space after at-rule name "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/at-rule-name-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondary, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-single-line'], + }); + + if (!validOptions) { + return; + } + + atRuleNameSpaceChecker({ + root, + result, + locationChecker: checker.after, + checkedRuleName: ruleName, + fix: context.fix + ? (atRule) => { + if (typeof atRule.raws.afterName === 'string') { + atRule.raws.afterName = atRule.raws.afterName.replace(/^\s*/, ' '); + } + } + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-no-unknown/index.js b/node_modules/stylelint/lib/rules/at-rule-no-unknown/index.js new file mode 100644 index 000000000..58cdeaab7 --- /dev/null +++ b/node_modules/stylelint/lib/rules/at-rule-no-unknown/index.js @@ -0,0 +1,75 @@ +'use strict'; + +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const { atKeywords } = require('../../reference/atKeywords'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'at-rule-no-unknown'; + +const messages = ruleMessages(ruleName, { + rejected: (atRule) => `Unexpected unknown at-rule "${atRule}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/at-rule-no-unknown', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignoreAtRules: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkAtRules((atRule) => { + if (!isStandardSyntaxAtRule(atRule)) { + return; + } + + const name = atRule.name; + + // Return early if at-rule is to be ignored + if (optionsMatches(secondaryOptions, 'ignoreAtRules', atRule.name)) { + return; + } + + if (vendor.prefix(name) || atKeywords.has(name.toLowerCase())) { + return; + } + + const atName = `@${name}`; + + report({ + message: messages.rejected, + messageArgs: [atName], + node: atRule, + ruleName, + result, + word: atName, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-no-vendor-prefix/index.js b/node_modules/stylelint/lib/rules/at-rule-no-vendor-prefix/index.js new file mode 100644 index 000000000..38a3e99f6 --- /dev/null +++ b/node_modules/stylelint/lib/rules/at-rule-no-vendor-prefix/index.js @@ -0,0 +1,65 @@ +'use strict'; + +const isAutoprefixable = require('../../utils/isAutoprefixable'); +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'at-rule-no-vendor-prefix'; + +const messages = ruleMessages(ruleName, { + rejected: (p) => `Unexpected vendor-prefixed at-rule "@${p}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/at-rule-no-vendor-prefix', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondary, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkAtRules((atRule) => { + if (!isStandardSyntaxAtRule(atRule)) { + return; + } + + const name = atRule.name; + + if (!name.startsWith('-')) { + return; + } + + if (!isAutoprefixable.atRuleName(name)) { + return; + } + + if (context.fix) { + atRule.name = isAutoprefixable.unprefix(atRule.name); + + return; + } + + report({ + message: messages.rejected, + messageArgs: [name], + node: atRule, + word: `@${name}`, + result, + ruleName, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-property-required-list/index.js b/node_modules/stylelint/lib/rules/at-rule-property-required-list/index.js new file mode 100644 index 000000000..a093305a1 --- /dev/null +++ b/node_modules/stylelint/lib/rules/at-rule-property-required-list/index.js @@ -0,0 +1,86 @@ +'use strict'; + +const createMapWithSet = require('../../utils/createMapWithSet'); +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); +const validateOptions = require('../../utils/validateOptions'); +const { isString } = require('../../utils/validateTypes'); + +const ruleName = 'at-rule-property-required-list'; + +const messages = ruleMessages(ruleName, { + expected: (atRule, property) => `Expected property "${property}" for at-rule "${atRule}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/at-rule-property-required-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [validateObjectWithArrayProps(isString)], + }); + + if (!validOptions) { + return; + } + + const propLists = createMapWithSet(primary); + + /** @type {Set} */ + const currentPropList = new Set(); + + root.walkAtRules((atRule) => { + if (!isStandardSyntaxAtRule(atRule)) { + return; + } + + const { name, nodes } = atRule; + const atRuleName = name.toLowerCase(); + const propList = propLists.get(atRuleName); + + if (!propList) { + return; + } + + currentPropList.clear(); + + for (const node of nodes) { + if (!node || node.type !== 'decl') continue; + + const propName = node.prop.toLowerCase(); + + if (!propList.has(propName)) continue; + + currentPropList.add(propName); + } + + if (currentPropList.size === propList.size) { + return; + } + + for (const requiredProp of propList) { + if (currentPropList.has(requiredProp)) continue; + + report({ + message: messages.expected, + messageArgs: [atRuleName, requiredProp], + node: atRule, + word: `@${atRule.name}`, + result, + ruleName, + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-semicolon-newline-after/index.js b/node_modules/stylelint/lib/rules/at-rule-semicolon-newline-after/index.js new file mode 100644 index 000000000..0b93de65a --- /dev/null +++ b/node_modules/stylelint/lib/rules/at-rule-semicolon-newline-after/index.js @@ -0,0 +1,84 @@ +'use strict'; + +const hasBlock = require('../../utils/hasBlock'); +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const nextNonCommentNode = require('../../utils/nextNonCommentNode'); +const rawNodeString = require('../../utils/rawNodeString'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'at-rule-semicolon-newline-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected newline after ";"', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/at-rule-semicolon-newline-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondary, context) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always'], + }); + + if (!validOptions) { + return; + } + + root.walkAtRules((atRule) => { + const nextNode = atRule.next(); + + if (!nextNode) { + return; + } + + if (hasBlock(atRule)) { + return; + } + + if (!isStandardSyntaxAtRule(atRule)) { + return; + } + + // Allow an end-of-line comment + const nodeToCheck = nextNonCommentNode(nextNode); + + if (!nodeToCheck) { + return; + } + + checker.afterOneOnly({ + source: rawNodeString(nodeToCheck), + index: -1, + err: (msg) => { + if (context.fix) { + nodeToCheck.raws.before = context.newline + nodeToCheck.raws.before; + } else { + report({ + message: msg, + node: atRule, + index: atRule.toString().length + 1, + result, + ruleName, + }); + } + }, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-semicolon-space-before/index.js b/node_modules/stylelint/lib/rules/at-rule-semicolon-space-before/index.js new file mode 100644 index 000000000..b75d38531 --- /dev/null +++ b/node_modules/stylelint/lib/rules/at-rule-semicolon-space-before/index.js @@ -0,0 +1,68 @@ +'use strict'; + +const hasBlock = require('../../utils/hasBlock'); +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const rawNodeString = require('../../utils/rawNodeString'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'at-rule-semicolon-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before ";"', + rejectedBefore: () => 'Unexpected whitespace before ";"', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/at-rule-semicolon-space-before', + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + root.walkAtRules((atRule) => { + if (hasBlock(atRule)) { + return; + } + + if (!isStandardSyntaxAtRule(atRule)) { + return; + } + + const nodeString = rawNodeString(atRule); + + checker.before({ + source: nodeString, + index: nodeString.length, + err: (m) => { + report({ + message: m, + node: atRule, + index: nodeString.length - 1, + result, + ruleName, + }); + }, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js b/node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js new file mode 100644 index 000000000..e9213a453 --- /dev/null +++ b/node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js @@ -0,0 +1,55 @@ +'use strict'; + +const isStandardSyntaxAtRule = require('../utils/isStandardSyntaxAtRule'); +const report = require('../utils/report'); + +/** + * @param {{ + * root: import('postcss').Root, + * locationChecker: (opts: { source: string, index: number, err: (msg: string) => void, errTarget: string }) => void, + * result: import('stylelint').PostcssResult, + * checkedRuleName: string, + * fix?: ((atRule: import('postcss').AtRule) => void) | null, + * }} options + */ +module.exports = function atRuleNameSpaceChecker(options) { + options.root.walkAtRules((atRule) => { + if (!isStandardSyntaxAtRule(atRule)) { + return; + } + + checkColon( + `@${atRule.name}${atRule.raws.afterName || ''}${atRule.params}`, + atRule.name.length, + atRule, + ); + }); + + /** + * @param {string} source + * @param {number} index + * @param {import('postcss').AtRule} node + */ + function checkColon(source, index, node) { + options.locationChecker({ + source, + index, + err: (m) => { + if (options.fix) { + options.fix(node); + + return; + } + + report({ + message: m, + node, + index, + result: options.result, + ruleName: options.checkedRuleName, + }); + }, + errTarget: `@${node.name}`, + }); + } +}; diff --git a/node_modules/stylelint/lib/rules/block-closing-brace-empty-line-before/index.js b/node_modules/stylelint/lib/rules/block-closing-brace-empty-line-before/index.js new file mode 100644 index 000000000..e33a1c398 --- /dev/null +++ b/node_modules/stylelint/lib/rules/block-closing-brace-empty-line-before/index.js @@ -0,0 +1,129 @@ +'use strict'; + +const addEmptyLineAfter = require('../../utils/addEmptyLineAfter'); +const blockString = require('../../utils/blockString'); +const hasBlock = require('../../utils/hasBlock'); +const hasEmptyBlock = require('../../utils/hasEmptyBlock'); +const hasEmptyLine = require('../../utils/hasEmptyLine'); +const isSingleLineString = require('../../utils/isSingleLineString'); +const optionsMatches = require('../../utils/optionsMatches'); +const removeEmptyLinesAfter = require('../../utils/removeEmptyLinesAfter'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'block-closing-brace-empty-line-before'; + +const messages = ruleMessages(ruleName, { + expected: 'Expected empty line before closing brace', + rejected: 'Unexpected empty line before closing brace', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/block-closing-brace-empty-line-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['always-multi-line', 'never'], + }, + { + actual: secondaryOptions, + possible: { + except: ['after-closing-brace'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + // Check both kinds of statements: rules and at-rules + root.walkRules(check); + root.walkAtRules(check); + + /** + * @param {import('postcss').Rule | import('postcss').AtRule} statement + */ + function check(statement) { + // Return early if blockless or has empty block + if (!hasBlock(statement) || hasEmptyBlock(statement)) { + return; + } + + // Get whitespace after ""}", ignoring extra semicolon + const before = (statement.raws.after || '').replace(/;+/, ''); + + // Calculate index + const statementString = statement.toString(); + let index = statementString.length - 1; + + if (statementString[index - 1] === '\r') { + index -= 1; + } + + // Set expectation + const expectEmptyLineBefore = (() => { + const childNodeTypes = statement.nodes.map((item) => item.type); + + // Reverse the primary options if `after-closing-brace` is set + if ( + optionsMatches(secondaryOptions, 'except', 'after-closing-brace') && + statement.type === 'atrule' && + !childNodeTypes.includes('decl') + ) { + return primary === 'never'; + } + + return primary === 'always-multi-line' && !isSingleLineString(blockString(statement)); + })(); + + // Check for at least one empty line + const hasEmptyLineBefore = hasEmptyLine(before); + + // Return if the expectation is met + if (expectEmptyLineBefore === hasEmptyLineBefore) { + return; + } + + if (context.fix) { + const { newline } = context; + + if (typeof newline !== 'string') return; + + if (expectEmptyLineBefore) { + addEmptyLineAfter(statement, newline); + } else { + removeEmptyLinesAfter(statement, newline); + } + + return; + } + + const message = expectEmptyLineBefore ? messages.expected : messages.rejected; + + report({ + message, + result, + ruleName, + node: statement, + index, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-closing-brace-newline-after/index.js b/node_modules/stylelint/lib/rules/block-closing-brace-newline-after/index.js new file mode 100644 index 000000000..47a0495e1 --- /dev/null +++ b/node_modules/stylelint/lib/rules/block-closing-brace-newline-after/index.js @@ -0,0 +1,152 @@ +'use strict'; + +const blockString = require('../../utils/blockString'); +const hasBlock = require('../../utils/hasBlock'); +const optionsMatches = require('../../utils/optionsMatches'); +const rawNodeString = require('../../utils/rawNodeString'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); +const { isString } = require('../../utils/validateTypes'); + +const ruleName = 'block-closing-brace-newline-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected newline after "}"', + expectedAfterSingleLine: () => 'Expected newline after "}" of a single-line block', + rejectedAfterSingleLine: () => 'Unexpected whitespace after "}" of a single-line block', + expectedAfterMultiLine: () => 'Expected newline after "}" of a multi-line block', + rejectedAfterMultiLine: () => 'Unexpected whitespace after "}" of a multi-line block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/block-closing-brace-newline-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [ + 'always', + 'always-single-line', + 'never-single-line', + 'always-multi-line', + 'never-multi-line', + ], + }, + { + actual: secondaryOptions, + possible: { + ignoreAtRules: [isString], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + // Check both kinds of statements: rules and at-rules + root.walkRules(check); + root.walkAtRules(check); + + /** + * @param {import('postcss').Rule | import('postcss').AtRule} statement + */ + function check(statement) { + if (!hasBlock(statement)) { + return; + } + + if ( + statement.type === 'atrule' && + optionsMatches(secondaryOptions, 'ignoreAtRules', statement.name) + ) { + return; + } + + const nextNode = statement.next(); + + if (!nextNode) { + return; + } + + // Allow an end-of-line comment x spaces after the brace + const nextNodeIsSingleLineComment = + nextNode.type === 'comment' && + !/[^ ]/.test(nextNode.raws.before || '') && + !nextNode.toString().includes('\n'); + + const nodeToCheck = nextNodeIsSingleLineComment ? nextNode.next() : nextNode; + + if (!nodeToCheck) { + return; + } + + let reportIndex = statement.toString().length; + let source = rawNodeString(nodeToCheck); + + // Skip a semicolon at the beginning, if any + if (source && source.startsWith(';')) { + source = source.slice(1); + reportIndex++; + } + + // Only check one after, because there might be other + // spaces handled by the indentation rule + checker.afterOneOnly({ + source, + index: -1, + lineCheckStr: blockString(statement), + err: (msg) => { + if (context.fix) { + const nodeToCheckRaws = nodeToCheck.raws; + + if (typeof nodeToCheckRaws.before !== 'string') return; + + if (primary.startsWith('always')) { + const index = nodeToCheckRaws.before.search(/\r?\n/); + + nodeToCheckRaws.before = + index >= 0 + ? nodeToCheckRaws.before.slice(index) + : context.newline + nodeToCheckRaws.before; + + return; + } + + if (primary.startsWith('never')) { + nodeToCheckRaws.before = ''; + + return; + } + } + + report({ + message: msg, + node: statement, + index: reportIndex, + result, + ruleName, + }); + }, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-closing-brace-newline-before/index.js b/node_modules/stylelint/lib/rules/block-closing-brace-newline-before/index.js new file mode 100644 index 000000000..e6f96aad9 --- /dev/null +++ b/node_modules/stylelint/lib/rules/block-closing-brace-newline-before/index.js @@ -0,0 +1,132 @@ +'use strict'; + +const blockString = require('../../utils/blockString'); +const hasBlock = require('../../utils/hasBlock'); +const hasEmptyBlock = require('../../utils/hasEmptyBlock'); +const isSingleLineString = require('../../utils/isSingleLineString'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'block-closing-brace-newline-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: 'Expected newline before "}"', + expectedBeforeMultiLine: 'Expected newline before "}" of a multi-line block', + rejectedBeforeMultiLine: 'Unexpected whitespace before "}" of a multi-line block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/block-closing-brace-newline-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line', 'never-multi-line'], + }); + + if (!validOptions) { + return; + } + + // Check both kinds of statements: rules and at-rules + root.walkRules(check); + root.walkAtRules(check); + + /** + * @param {import('postcss').Rule | import('postcss').AtRule} statement + */ + function check(statement) { + // Return early if blockless or has empty block + if (!hasBlock(statement) || hasEmptyBlock(statement)) { + return; + } + + // Ignore extra semicolon + const after = (statement.raws.after || '').replace(/;+/, ''); + + if (after === undefined) { + return; + } + + const blockIsMultiLine = !isSingleLineString(blockString(statement)); + const statementString = statement.toString(); + + let index = statementString.length - 2; + + if (statementString[index - 1] === '\r') { + index -= 1; + } + + // We're really just checking whether a + // newline *starts* the block's final space -- between + // the last declaration and the closing brace. We can + // ignore any other whitespace between them, because that + // will be checked by the indentation rule. + if (!after.startsWith('\n') && !after.startsWith('\r\n')) { + if (primary === 'always') { + complain(messages.expectedBefore); + } else if (blockIsMultiLine && primary === 'always-multi-line') { + complain(messages.expectedBeforeMultiLine); + } + } + + if (after !== '' && blockIsMultiLine && primary === 'never-multi-line') { + complain(messages.rejectedBeforeMultiLine); + } + + /** + * @param {string} message + */ + function complain(message) { + if (context.fix) { + const statementRaws = statement.raws; + + if (typeof statementRaws.after !== 'string') return; + + if (primary.startsWith('always')) { + const firstWhitespaceIndex = statementRaws.after.search(/\s/); + const newlineBefore = + firstWhitespaceIndex >= 0 + ? statementRaws.after.slice(0, firstWhitespaceIndex) + : statementRaws.after; + const newlineAfter = + firstWhitespaceIndex >= 0 ? statementRaws.after.slice(firstWhitespaceIndex) : ''; + const newlineIndex = newlineAfter.search(/\r?\n/); + + statementRaws.after = + newlineIndex >= 0 + ? newlineBefore + newlineAfter.slice(newlineIndex) + : newlineBefore + context.newline + newlineAfter; + + return; + } + + if (primary === 'never-multi-line') { + statementRaws.after = statementRaws.after.replace(/\s/g, ''); + + return; + } + } + + report({ + message, + result, + ruleName, + node: statement, + index, + }); + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-closing-brace-space-after/index.js b/node_modules/stylelint/lib/rules/block-closing-brace-space-after/index.js new file mode 100644 index 000000000..f285d0672 --- /dev/null +++ b/node_modules/stylelint/lib/rules/block-closing-brace-space-after/index.js @@ -0,0 +1,96 @@ +'use strict'; + +const blockString = require('../../utils/blockString'); +const hasBlock = require('../../utils/hasBlock'); +const rawNodeString = require('../../utils/rawNodeString'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'block-closing-brace-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected single space after "}"', + rejectedAfter: () => 'Unexpected whitespace after "}"', + expectedAfterSingleLine: () => 'Expected single space after "}" of a single-line block', + rejectedAfterSingleLine: () => 'Unexpected whitespace after "}" of a single-line block', + expectedAfterMultiLine: () => 'Expected single space after "}" of a multi-line block', + rejectedAfterMultiLine: () => 'Unexpected whitespace after "}" of a multi-line block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/block-closing-brace-space-after', + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [ + 'always', + 'never', + 'always-single-line', + 'never-single-line', + 'always-multi-line', + 'never-multi-line', + ], + }); + + if (!validOptions) { + return; + } + + // Check both kinds of statements: rules and at-rules + root.walkRules(check); + root.walkAtRules(check); + + /** + * @param {import('postcss').Rule | import('postcss').AtRule} statement + */ + function check(statement) { + const nextNode = statement.next(); + + if (!nextNode) { + return; + } + + if (!hasBlock(statement)) { + return; + } + + let reportIndex = statement.toString().length; + let source = rawNodeString(nextNode); + + // Skip a semicolon at the beginning, if any + if (source && source.startsWith(';')) { + source = source.slice(1); + reportIndex++; + } + + checker.after({ + source, + index: -1, + lineCheckStr: blockString(statement), + err: (msg) => { + report({ + message: msg, + node: statement, + index: reportIndex, + result, + ruleName, + }); + }, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-closing-brace-space-before/index.js b/node_modules/stylelint/lib/rules/block-closing-brace-space-before/index.js new file mode 100644 index 000000000..03ac08f1f --- /dev/null +++ b/node_modules/stylelint/lib/rules/block-closing-brace-space-before/index.js @@ -0,0 +1,109 @@ +'use strict'; + +const blockString = require('../../utils/blockString'); +const hasBlock = require('../../utils/hasBlock'); +const hasEmptyBlock = require('../../utils/hasEmptyBlock'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'block-closing-brace-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before "}"', + rejectedBefore: () => 'Unexpected whitespace before "}"', + expectedBeforeSingleLine: () => 'Expected single space before "}" of a single-line block', + rejectedBeforeSingleLine: () => 'Unexpected whitespace before "}" of a single-line block', + expectedBeforeMultiLine: () => 'Expected single space before "}" of a multi-line block', + rejectedBeforeMultiLine: () => 'Unexpected whitespace before "}" of a multi-line block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/block-closing-brace-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [ + 'always', + 'never', + 'always-single-line', + 'never-single-line', + 'always-multi-line', + 'never-multi-line', + ], + }); + + if (!validOptions) { + return; + } + + // Check both kinds of statement: rules and at-rules + root.walkRules(check); + root.walkAtRules(check); + + /** + * @param {import('postcss').Rule | import('postcss').AtRule} statement + */ + function check(statement) { + // Return early if blockless or has empty block + if (!hasBlock(statement) || hasEmptyBlock(statement)) { + return; + } + + const source = blockString(statement); + const statementString = statement.toString(); + + let index = statementString.length - 2; + + if (statementString[index - 1] === '\r') { + index -= 1; + } + + checker.before({ + source, + index: source.length - 1, + err: (msg) => { + if (context.fix) { + const statementRaws = statement.raws; + + if (typeof statementRaws.after !== 'string') return; + + if (primary.startsWith('always')) { + statementRaws.after = statementRaws.after.replace(/\s*$/, ' '); + + return; + } + + if (primary.startsWith('never')) { + statementRaws.after = statementRaws.after.replace(/\s*$/, ''); + + return; + } + } + + report({ + message: msg, + node: statement, + index, + result, + ruleName, + }); + }, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-no-empty/index.js b/node_modules/stylelint/lib/rules/block-no-empty/index.js new file mode 100644 index 000000000..f5c782330 --- /dev/null +++ b/node_modules/stylelint/lib/rules/block-no-empty/index.js @@ -0,0 +1,117 @@ +'use strict'; + +const beforeBlockString = require('../../utils/beforeBlockString'); +const hasBlock = require('../../utils/hasBlock'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const { isConfigurationComment } = require('../../utils/configurationComment'); +const { isComment } = require('../../utils/typeGuards'); +const validateOptions = require('../../utils/validateOptions'); +const { isBoolean } = require('../../utils/validateTypes'); + +const ruleName = 'block-no-empty'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected empty block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/block-no-empty', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: isBoolean, + }, + { + actual: secondaryOptions, + possible: { + ignore: ['comments'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const ignoreComments = optionsMatches(secondaryOptions, 'ignore', 'comments'); + + // Check both kinds of statements: rules and at-rules + root.walkRules(check); + root.walkAtRules(check); + + /** @typedef {import('postcss').Rule | import('postcss').AtRule} Statement */ + + /** + * @param {Statement} statement + */ + function check(statement) { + if (!hasBlock(statement)) { + return; + } + + if (hasNotableChild(statement)) { + return; + } + + if (hasNonWhitespace(statement)) { + return; + } + + let index = beforeBlockString(statement, { noRawBefore: true }).length; + + // For empty blocks when using SugarSS parser + if (statement.raws.between === undefined) { + index--; + } + + report({ + message: messages.rejected, + node: statement, + start: statement.positionBy({ index }), + result, + ruleName, + }); + } + + /** + * @param {Statement} statement + * @returns {boolean} + */ + function hasNotableChild(statement) { + return statement.nodes.some((child) => { + if (isComment(child)) { + if (ignoreComments) return false; + + if (isConfigurationComment(child, context.configurationComment)) return false; + } + + return true; + }); + } + + /** + * @param {Statement} statement + * @returns {boolean} + */ + function hasNonWhitespace(statement) { + const { after } = statement.raws; + + return typeof after === 'string' && /\S/.test(after); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-opening-brace-newline-after/index.js b/node_modules/stylelint/lib/rules/block-opening-brace-newline-after/index.js new file mode 100644 index 000000000..fc6984e7b --- /dev/null +++ b/node_modules/stylelint/lib/rules/block-opening-brace-newline-after/index.js @@ -0,0 +1,182 @@ +'use strict'; + +const beforeBlockString = require('../../utils/beforeBlockString'); +const blockString = require('../../utils/blockString'); +const hasBlock = require('../../utils/hasBlock'); +const hasEmptyBlock = require('../../utils/hasEmptyBlock'); +const optionsMatches = require('../../utils/optionsMatches'); +const rawNodeString = require('../../utils/rawNodeString'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'block-opening-brace-newline-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected newline after "{"', + expectedAfterMultiLine: () => 'Expected newline after "{" of a multi-line block', + rejectedAfterMultiLine: () => 'Unexpected whitespace after "{" of a multi-line block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/block-opening-brace-newline-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['always', 'rules', 'always-multi-line', 'never-multi-line'], + }, + { + actual: secondaryOptions, + possible: { + ignore: ['rules'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + // Check both kinds of statement: rules and at-rules + if (!optionsMatches(secondaryOptions, 'ignore', 'rules')) { + root.walkRules(check); + } + + root.walkAtRules(check); + + /** + * @param {import('postcss').Rule | import('postcss').AtRule} statement + */ + function check(statement) { + // Return early if blockless or has an empty block + if (!hasBlock(statement) || hasEmptyBlock(statement)) { + return; + } + + const backupCommentNextBefores = new Map(); + + /** + * next node with checking newlines after comment + * + * @param {import('postcss').ChildNode | undefined} startNode + * @returns {import('postcss').ChildNode | undefined} + */ + function nextNode(startNode) { + if (!startNode || !startNode.next) return; + + if (startNode.type === 'comment') { + const reNewLine = /\r?\n/; + const newLineMatch = reNewLine.test(startNode.raws.before || ''); + + const next = startNode.next(); + + if (next && newLineMatch && !reNewLine.test(next.raws.before || '')) { + backupCommentNextBefores.set(next, next.raws.before); + next.raws.before = startNode.raws.before; + } + + return nextNode(next); + } + + return startNode; + } + + // Allow an end-of-line comment + const nodeToCheck = nextNode(statement.first); + + if (!nodeToCheck) { + return; + } + + checker.afterOneOnly({ + source: rawNodeString(nodeToCheck), + index: -1, + lineCheckStr: blockString(statement), + err: (m) => { + if (context.fix) { + const nodeToCheckRaws = nodeToCheck.raws; + + if (typeof nodeToCheckRaws.before !== 'string') return; + + if (primary.startsWith('always')) { + const index = nodeToCheckRaws.before.search(/\r?\n/); + + nodeToCheckRaws.before = + index >= 0 + ? nodeToCheckRaws.before.slice(index) + : context.newline + nodeToCheckRaws.before; + + backupCommentNextBefores.delete(nodeToCheck); + + return; + } + + if (primary === 'never-multi-line') { + // Restore the `before` of the node next to the comment node. + for (const [node, before] of backupCommentNextBefores.entries()) { + node.raws.before = before; + } + + backupCommentNextBefores.clear(); + + // Fix + const reNewLine = /\r?\n/; + let fixTarget = statement.first; + + while (fixTarget) { + const fixTargetRaws = fixTarget.raws; + + if (typeof fixTargetRaws.before !== 'string') continue; + + if (reNewLine.test(fixTargetRaws.before || '')) { + fixTargetRaws.before = fixTargetRaws.before.replace(/\r?\n/g, ''); + } + + if (fixTarget.type !== 'comment') { + break; + } + + fixTarget = fixTarget.next(); + } + + nodeToCheckRaws.before = ''; + + return; + } + } + + report({ + message: m, + node: statement, + index: beforeBlockString(statement, { noRawBefore: true }).length + 1, + result, + ruleName, + }); + }, + }); + + // Restore the `before` of the node next to the comment node. + for (const [node, before] of backupCommentNextBefores.entries()) { + node.raws.before = before; + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-opening-brace-newline-before/index.js b/node_modules/stylelint/lib/rules/block-opening-brace-newline-before/index.js new file mode 100644 index 000000000..1bc9aa8d4 --- /dev/null +++ b/node_modules/stylelint/lib/rules/block-opening-brace-newline-before/index.js @@ -0,0 +1,120 @@ +'use strict'; + +const beforeBlockString = require('../../utils/beforeBlockString'); +const blockString = require('../../utils/blockString'); +const hasBlock = require('../../utils/hasBlock'); +const hasEmptyBlock = require('../../utils/hasEmptyBlock'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'block-opening-brace-newline-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected newline before "{"', + expectedBeforeSingleLine: () => 'Expected newline before "{" of a single-line block', + rejectedBeforeSingleLine: () => 'Unexpected whitespace before "{" of a single-line block', + expectedBeforeMultiLine: () => 'Expected newline before "{" of a multi-line block', + rejectedBeforeMultiLine: () => 'Unexpected whitespace before "{" of a multi-line block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/block-opening-brace-newline-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [ + 'always', + 'always-single-line', + 'never-single-line', + 'always-multi-line', + 'never-multi-line', + ], + }); + + if (!validOptions) { + return; + } + + // Check both kinds of statement: rules and at-rules + root.walkRules(check); + root.walkAtRules(check); + + /** + * @param {import('postcss').Rule | import('postcss').AtRule} statement + */ + function check(statement) { + // Return early if blockless or has an empty block + if (!hasBlock(statement) || hasEmptyBlock(statement)) { + return; + } + + const source = beforeBlockString(statement); + const beforeBraceNoRaw = beforeBlockString(statement, { + noRawBefore: true, + }); + + let index = beforeBraceNoRaw.length - 1; + + if (beforeBraceNoRaw[index - 1] === '\r') { + index -= 1; + } + + checker.beforeAllowingIndentation({ + lineCheckStr: blockString(statement), + source, + index: source.length, + err: (m) => { + if (context.fix) { + const statementRaws = statement.raws; + + if (typeof statementRaws.between !== 'string') return; + + if (primary.startsWith('always')) { + const spaceIndex = statementRaws.between.search(/\s+$/); + + if (spaceIndex >= 0) { + statement.raws.between = + statementRaws.between.slice(0, spaceIndex) + + context.newline + + statementRaws.between.slice(spaceIndex); + } else { + statementRaws.between += context.newline; + } + + return; + } + + if (primary.startsWith('never')) { + statementRaws.between = statementRaws.between.replace(/\s*$/, ''); + + return; + } + } + + report({ + message: m, + node: statement, + index, + result, + ruleName, + }); + }, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-opening-brace-space-after/index.js b/node_modules/stylelint/lib/rules/block-opening-brace-space-after/index.js new file mode 100644 index 000000000..02fc149ea --- /dev/null +++ b/node_modules/stylelint/lib/rules/block-opening-brace-space-after/index.js @@ -0,0 +1,116 @@ +'use strict'; + +const beforeBlockString = require('../../utils/beforeBlockString'); +const blockString = require('../../utils/blockString'); +const hasBlock = require('../../utils/hasBlock'); +const hasEmptyBlock = require('../../utils/hasEmptyBlock'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'block-opening-brace-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected single space after "{"', + rejectedAfter: () => 'Unexpected whitespace after "{"', + expectedAfterSingleLine: () => 'Expected single space after "{" of a single-line block', + rejectedAfterSingleLine: () => 'Unexpected whitespace after "{" of a single-line block', + expectedAfterMultiLine: () => 'Expected single space after "{" of a multi-line block', + rejectedAfterMultiLine: () => 'Unexpected whitespace after "{" of a multi-line block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/block-opening-brace-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [ + 'always', + 'never', + 'always-single-line', + 'never-single-line', + 'always-multi-line', + 'never-multi-line', + ], + }, + { + actual: secondaryOptions, + possible: { + ignore: ['at-rules'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + // Check both kinds of statements: rules and at-rules + root.walkRules(check); + + if (!optionsMatches(secondaryOptions, 'ignore', 'at-rules')) { + root.walkAtRules(check); + } + + /** + * @param {import('postcss').Rule | import('postcss').AtRule} statement + */ + function check(statement) { + // Return early if blockless or has an empty block + if (!hasBlock(statement) || hasEmptyBlock(statement)) { + return; + } + + checker.after({ + source: blockString(statement), + index: 0, + err: (m) => { + if (context.fix) { + const statementFirst = statement.first; + + if (statementFirst == null) return; + + if (primary.startsWith('always')) { + statementFirst.raws.before = ' '; + + return; + } + + if (primary.startsWith('never')) { + statementFirst.raws.before = ''; + + return; + } + } + + report({ + message: m, + node: statement, + index: beforeBlockString(statement, { noRawBefore: true }).length + 1, + result, + ruleName, + }); + }, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-opening-brace-space-before/index.js b/node_modules/stylelint/lib/rules/block-opening-brace-space-before/index.js new file mode 100644 index 000000000..fcde4e48d --- /dev/null +++ b/node_modules/stylelint/lib/rules/block-opening-brace-space-before/index.js @@ -0,0 +1,139 @@ +'use strict'; + +const beforeBlockString = require('../../utils/beforeBlockString'); +const blockString = require('../../utils/blockString'); +const hasBlock = require('../../utils/hasBlock'); +const hasEmptyBlock = require('../../utils/hasEmptyBlock'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'block-opening-brace-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before "{"', + rejectedBefore: () => 'Unexpected whitespace before "{"', + expectedBeforeSingleLine: () => 'Expected single space before "{" of a single-line block', + rejectedBeforeSingleLine: () => 'Unexpected whitespace before "{" of a single-line block', + expectedBeforeMultiLine: () => 'Expected single space before "{" of a multi-line block', + rejectedBeforeMultiLine: () => 'Unexpected whitespace before "{" of a multi-line block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/block-opening-brace-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [ + 'always', + 'never', + 'always-single-line', + 'never-single-line', + 'always-multi-line', + 'never-multi-line', + ], + }, + { + actual: secondaryOptions, + possible: { + ignoreAtRules: [isString, isRegExp], + ignoreSelectors: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + // Check both kinds of statements: rules and at-rules + root.walkRules(check); + root.walkAtRules(check); + + /** + * @param {import('postcss').Rule | import('postcss').AtRule} statement + */ + function check(statement) { + // Return early if blockless or has an empty block + if (!hasBlock(statement) || hasEmptyBlock(statement)) { + return; + } + + // Return early if at-rule is to be ignored + if ( + statement.type === 'atrule' && + optionsMatches(secondaryOptions, 'ignoreAtRules', statement.name) + ) { + return; + } + + // Return early if selector is to be ignored + if ( + statement.type === 'rule' && + optionsMatches(secondaryOptions, 'ignoreSelectors', statement.selector) + ) { + return; + } + + const source = beforeBlockString(statement); + const beforeBraceNoRaw = beforeBlockString(statement, { + noRawBefore: true, + }); + + let index = beforeBraceNoRaw.length - 1; + + if (beforeBraceNoRaw[index - 1] === '\r') { + index -= 1; + } + + checker.before({ + source, + index: source.length, + lineCheckStr: blockString(statement), + err: (m) => { + if (context.fix) { + if (primary.startsWith('always')) { + statement.raws.between = ' '; + + return; + } + + if (primary.startsWith('never')) { + statement.raws.between = ''; + + return; + } + } + + report({ + message: m, + node: statement, + index, + result, + ruleName, + }); + }, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-function-notation/index.js b/node_modules/stylelint/lib/rules/color-function-notation/index.js new file mode 100644 index 000000000..ed1eb2d7b --- /dev/null +++ b/node_modules/stylelint/lib/rules/color-function-notation/index.js @@ -0,0 +1,163 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const isStandardSyntaxColorFunction = require('../../utils/isStandardSyntaxColorFunction'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const { isValueFunction } = require('../../utils/typeGuards'); +const validateOptions = require('../../utils/validateOptions'); +const optionsMatches = require('../../utils/optionsMatches'); + +const ruleName = 'color-function-notation'; + +const messages = ruleMessages(ruleName, { + expected: (primary) => `Expected ${primary} color-function notation`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/color-function-notation', + fixable: true, +}; + +const LEGACY_FUNCTION_NAME = /^(?:rgba|hsla)$/i; +const LEGACY_NOTATION_FUNCTION = /\b(?:rgba?|hsla?)\(/i; +const LEGACY_NOTATION_FUNCTION_NAME = /^(?:rgba?|hsla?)$/i; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['modern', 'legacy'], + }, + { + actual: secondaryOptions, + possible: { + ignore: ['with-var-inside'], + }, + optional: true, + }, + ); + + if (!validOptions) return; + + const ignoreWithVarInside = optionsMatches(secondaryOptions, 'ignore', 'with-var-inside'); + + root.walkDecls((decl) => { + if (!LEGACY_NOTATION_FUNCTION.test(decl.value)) return; + + if (primary === 'modern' && !decl.value.includes(',')) return; + + let needsFix = false; + const parsedValue = valueParser(getDeclarationValue(decl)); + + parsedValue.walk((node) => { + if (!isValueFunction(node)) return; + + if (!isStandardSyntaxColorFunction(node)) return; + + const { value, sourceIndex, sourceEndIndex, nodes } = node; + + if (ignoreWithVarInside && containsVariable(nodes)) { + return; + } + + if (!LEGACY_NOTATION_FUNCTION_NAME.test(value)) return; + + if (primary === 'modern' && !hasCommas(node)) return; + + if (primary === 'legacy' && hasCommas(node)) return; + + if (context.fix && primary === 'modern') { + let commaCount = 0; + + // Convert punctuation + node.nodes = nodes.map((childNode) => { + if (isComma(childNode)) { + // Non-alpha commas to space and alpha commas to slashes + if (commaCount < 2) { + // @ts-expect-error -- TS2322: Type '"space"' is not assignable to type '"div"'. + childNode.type = 'space'; + childNode.value = atLeastOneSpace(childNode.after); + commaCount++; + } else { + childNode.value = '/'; + childNode.before = atLeastOneSpace(childNode.before); + childNode.after = atLeastOneSpace(childNode.after); + } + } + + return childNode; + }); + + // Remove trailing 'a' from legacy function name + if (LEGACY_FUNCTION_NAME.test(value)) { + node.value = value.slice(0, -1); + } + + needsFix = true; + + return; + } + + const index = declarationValueIndex(decl) + sourceIndex; + const endIndex = index + (sourceEndIndex - sourceIndex); + + report({ + message: messages.expected, + messageArgs: [primary], + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + + if (needsFix) { + setDeclarationValue(decl, parsedValue.toString()); + } + }); + }; +}; + +/** + * @param {string} whitespace + */ +function atLeastOneSpace(whitespace) { + return whitespace !== '' ? whitespace : ' '; +} + +/** + * @param {import('postcss-value-parser').Node[]} nodes + */ +function containsVariable(nodes) { + return nodes.some(({ type, value }) => type === 'function' && value.toLowerCase() === 'var'); +} + +/** + * @param {import('postcss-value-parser').Node} node + * @returns {node is import('postcss-value-parser').DivNode} + */ +function isComma(node) { + return node.type === 'div' && node.value === ','; +} + +/** + * @param {import('postcss-value-parser').FunctionNode} node + */ +function hasCommas(node) { + return node.nodes && node.nodes.some((childNode) => isComma(childNode)); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-hex-alpha/index.js b/node_modules/stylelint/lib/rules/color-hex-alpha/index.js new file mode 100644 index 000000000..404b7dd72 --- /dev/null +++ b/node_modules/stylelint/lib/rules/color-hex-alpha/index.js @@ -0,0 +1,89 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const hasValidHex = require('../../utils/hasValidHex'); +const isValidHex = require('../../utils/isValidHex'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); + +const ruleName = 'color-hex-alpha'; + +const messages = ruleMessages(ruleName, { + expected: (hex) => `Expected alpha channel in "${hex}"`, + unexpected: (hex) => `Unexpected alpha channel in "${hex}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/color-hex-alpha', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) return; + + root.walkDecls((decl) => { + if (!hasValidHex(decl.value)) return; + + const parsedValue = valueParser(decl.value); + + parsedValue.walk((node) => { + if (isUrlFunction(node)) return false; + + if (!isHexColor(node)) return; + + const { value } = node; + + if (primary === 'always' && hasAlphaChannel(value)) return; + + if (primary === 'never' && !hasAlphaChannel(value)) return; + + const index = declarationValueIndex(decl) + node.sourceIndex; + const endIndex = index + value.length; + + report({ + message: primary === 'never' ? messages.unexpected : messages.expected, + messageArgs: [value], + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + }); + }; +}; + +/** + * @param {import('postcss-value-parser').Node} node + */ +function isUrlFunction({ type, value }) { + return type === 'function' && value === 'url'; +} + +/** + * @param {import('postcss-value-parser').Node} node + */ +function isHexColor({ type, value }) { + return type === 'word' && isValidHex(value); +} + +/** + * @param {string} hex + */ +function hasAlphaChannel(hex) { + return hex.length === 5 || hex.length === 9; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-hex-case/index.js b/node_modules/stylelint/lib/rules/color-hex-case/index.js new file mode 100644 index 000000000..662a14f18 --- /dev/null +++ b/node_modules/stylelint/lib/rules/color-hex-case/index.js @@ -0,0 +1,97 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'color-hex-case'; + +const messages = ruleMessages(ruleName, { + expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/color-hex-case', + fixable: true, + deprecated: true, +}; + +const HEX = /^#[\da-z]+/i; +const CONTAINS_HEX = /#[\da-z]+/i; +const IGNORED_FUNCTIONS = new Set(['url']); + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['lower', 'upper'], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (!CONTAINS_HEX.test(decl.value)) return; + + const parsedValue = valueParser(getDeclarationValue(decl)); + let needsFix = false; + + parsedValue.walk((node) => { + const { value } = node; + + if (isIgnoredFunction(node)) return false; + + if (!isHexColor(node)) return; + + const expected = primary === 'lower' ? value.toLowerCase() : value.toUpperCase(); + + if (value === expected) return; + + if (context.fix) { + node.value = expected; + needsFix = true; + + return; + } + + report({ + message: messages.expected(value, expected), + node: decl, + index: declarationValueIndex(decl) + node.sourceIndex, + result, + ruleName, + }); + }); + + if (needsFix) { + setDeclarationValue(decl, parsedValue.toString()); + } + }); + }; +}; + +/** + * @param {import('postcss-value-parser').Node} node + */ +function isIgnoredFunction({ type, value }) { + return type === 'function' && IGNORED_FUNCTIONS.has(value.toLowerCase()); +} + +/** + * @param {import('postcss-value-parser').Node} node + */ +function isHexColor({ type, value }) { + return type === 'word' && HEX.test(value); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-hex-length/index.js b/node_modules/stylelint/lib/rules/color-hex-length/index.js new file mode 100644 index 000000000..413f5f197 --- /dev/null +++ b/node_modules/stylelint/lib/rules/color-hex-length/index.js @@ -0,0 +1,148 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'color-hex-length'; + +const messages = ruleMessages(ruleName, { + expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/color-hex-length', + fixable: true, +}; + +const HEX = /^#[\da-z]+$/i; +const CONTAINS_HEX = /#[\da-z]+/i; +const IGNORED_FUNCTIONS = new Set(['url']); + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['short', 'long'], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (!CONTAINS_HEX.test(decl.value)) return; + + const parsedValue = valueParser(getDeclarationValue(decl)); + let needsFix = false; + + parsedValue.walk((node) => { + const { value: hexValue } = node; + + if (isIgnoredFunction(node)) return false; + + if (!isHexColor(node)) return; + + if (primary === 'long' && hexValue.length !== 4 && hexValue.length !== 5) { + return; + } + + if (primary === 'short' && (hexValue.length < 6 || !canShrink(hexValue))) { + return; + } + + const variant = primary === 'long' ? longer : shorter; + const expectedHex = variant(hexValue); + + if (context.fix) { + node.value = expectedHex; + needsFix = true; + + return; + } + + const index = declarationValueIndex(decl) + node.sourceIndex; + const endIndex = index + node.value.length; + + report({ + message: messages.expected, + messageArgs: [hexValue, expectedHex], + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + + if (needsFix) { + setDeclarationValue(decl, parsedValue.toString()); + } + }); + }; +}; + +/** + * @param {string} hex + */ +function canShrink(hex) { + hex = hex.toLowerCase(); + + return ( + hex[1] === hex[2] && + hex[3] === hex[4] && + hex[5] === hex[6] && + (hex.length === 7 || (hex.length === 9 && hex[7] === hex[8])) + ); +} + +/** + * @param {string} hex + */ +function shorter(hex) { + let hexVariant = '#'; + + for (let i = 1; i < hex.length; i += 2) { + hexVariant += hex[i]; + } + + return hexVariant; +} + +/** + * @param {string} hex + */ +function longer(hex) { + let hexVariant = '#'; + + for (let i = 1; i < hex.length; i++) { + hexVariant += hex.charAt(i).repeat(2); + } + + return hexVariant; +} + +/** + * @param {import('postcss-value-parser').Node} node + */ +function isIgnoredFunction({ type, value }) { + return type === 'function' && IGNORED_FUNCTIONS.has(value.toLowerCase()); +} + +/** + * @param {import('postcss-value-parser').Node} node + */ +function isHexColor({ type, value }) { + return type === 'word' && HEX.test(value); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-named/colordUtils.js b/node_modules/stylelint/lib/rules/color-named/colordUtils.js new file mode 100644 index 000000000..adf9023dc --- /dev/null +++ b/node_modules/stylelint/lib/rules/color-named/colordUtils.js @@ -0,0 +1,108 @@ +const { colord, extend } = require('colord'); +const valueParser = require('postcss-value-parser'); + +const namesPlugin = require('colord/plugins/names'); +const hwbPlugin = require('colord/plugins/hwb'); +const labPlugin = require('colord/plugins/lab'); +const lchPlugin = require('colord/plugins/lch'); + +extend([ + // Type definitions are not compatible with commonjs. + /** @type {any} */ (namesPlugin), + /** @type {any} */ (hwbPlugin), + /** @type {any} */ (labPlugin), + /** @type {any} */ (lchPlugin), + + /* Syntaxes that is removed in Color Module Level 4 specification. */ + + // hwb() with comma + (_colordClass, parsers) => { + parsers.string.push([parseHwbWithCommaString, /** @type {any} */ ('hwb-with-comma')]); + }, + // gray() + (_colordClass, parsers) => { + parsers.string.push([parseGrayString, /** @type {any} */ ('gray')]); + }, +]); + +module.exports = { + colord, +}; + +/** + * Parses a valid hwb with comma CSS color function + * https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hwb()#syntax + * @type {import('colord/types').ParseFunction} + */ +function parseHwbWithCommaString(input) { + input = input.toLowerCase(); + + if (!input.startsWith('hwb(') || !input.endsWith(')') || input.includes('/')) { + return null; + } + + const [hue, whiteness = '', blackness = '', alpha, ...extraArgs] = input.slice(4, -1).split(','); + + if (!hue || !hue.trim() || !whiteness.trim() || !blackness.trim() || extraArgs.length > 0) { + return null; + } + + // Change the delimiter and parse with colord. + const colordInstance = colord( + `hwb(${hue} ${whiteness} ${blackness}${alpha ? ` / ${alpha}` : ''})`, + ); + + if (!colordInstance.isValid()) { + return null; + } + + return colordInstance.rgba; +} + +/** + * Parses a valid gray() CSS color function + * @type {import('colord/types').ParseFunction} + */ +function parseGrayString(input) { + input = input.toLowerCase(); + + if (!input.startsWith('gray(') || !input.endsWith(')')) { + return null; + } + + const [lightness, alpha, ...extraArgs] = input.slice(5, -1).split(','); + + if (!lightness || extraArgs.length > 0) { + return null; + } + + const lightnessWithUnit = valueParser.unit(lightness.trim()); + + if (!lightnessWithUnit || !['', '%'].includes(lightnessWithUnit.unit)) { + return null; + } + + /** + * @type {import('colord/types').LabColor | import('colord/types').LabaColor} + */ + let colorObject = { + l: Number(lightnessWithUnit.number), + a: 0, + b: 0, + }; + + if (alpha) { + const alphaWithUnit = valueParser.unit(alpha.trim()); + + if (!alphaWithUnit || !['', '%'].includes(alphaWithUnit.unit)) { + return null; + } + + colorObject = { + ...colorObject, + alpha: Number(alphaWithUnit.number) / (alphaWithUnit.unit ? 100 : 1), + }; + } + + return colord(colorObject).rgba; +} diff --git a/node_modules/stylelint/lib/rules/color-named/index.js b/node_modules/stylelint/lib/rules/color-named/index.js new file mode 100644 index 000000000..6cb75bb33 --- /dev/null +++ b/node_modules/stylelint/lib/rules/color-named/index.js @@ -0,0 +1,184 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const optionsMatches = require('../../utils/optionsMatches'); +const { acceptCustomIdentsProperties } = require('../../reference/properties'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); +const { isRegExp, isString } = require('../../utils/validateTypes'); +const { colord } = require('./colordUtils'); +const hasNamedColor = require('../../utils/hasNamedColor'); +const hasValidHex = require('../../utils/hasValidHex'); +const hasColorFunction = require('../../utils/hasColorFunction'); +const { namedColorsKeywords } = require('../../reference/keywords'); + +const ruleName = 'color-named'; + +const messages = ruleMessages(ruleName, { + expected: (named, original) => `Expected "${original}" to be "${named}"`, + rejected: (named) => `Unexpected named color "${named}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/color-named', +}; + +// Todo tested on case insensitivity +const NODE_TYPES = new Set(['word', 'function']); + +const HAS_GRAY_FUNCTION = /\bgray\(/i; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['never', 'always-where-possible'], + }, + { + actual: secondaryOptions, + possible: { + ignoreProperties: [isString, isRegExp], + ignore: ['inside-function'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (acceptCustomIdentsProperties.has(decl.prop)) { + return; + } + + // Return early if the property is to be ignored + if (optionsMatches(secondaryOptions, 'ignoreProperties', decl.prop)) { + return; + } + + const { value: declValue } = decl; + + if (primary === 'never' && !hasNamedColor(declValue)) { + return; + } + + if ( + primary === 'always-where-possible' && + !hasValidHex(declValue) && + !hasColorFunction(declValue) && + !HAS_GRAY_FUNCTION.test(declValue) + ) { + return; + } + + valueParser(declValue).walk((node) => { + const value = node.value; + const type = node.type; + const sourceIndex = node.sourceIndex; + + if (optionsMatches(secondaryOptions, 'ignore', 'inside-function') && type === 'function') { + return false; + } + + if (!isStandardSyntaxFunction(node)) { + return false; + } + + if (!isStandardSyntaxValue(value)) { + return; + } + + // Return early if neither a word nor a function + if (!NODE_TYPES.has(type)) { + return; + } + + // Check for named colors for "never" option + if ( + primary === 'never' && + type === 'word' && + namedColorsKeywords.has(value.toLowerCase()) + ) { + complain( + messages.rejected(value), + decl, + declarationValueIndex(decl) + sourceIndex, + value.length, + ); + + return; + } + + // Check "always-where-possible" option ... + if (primary !== 'always-where-possible') { + return; + } + + let rawColorString = null; + let colorString = null; + + if (type === 'function') { + rawColorString = valueParser.stringify(node); + + // First by checking for alternative color function representations ... + // Remove all spaces to match what's in `representations` + colorString = rawColorString.replace(/\s*([,/()])\s*/g, '$1').replace(/\s{2,}/g, ' '); + } else if (type === 'word' && value.startsWith('#')) { + // Then by checking for alternative hex representations + rawColorString = colorString = value; + } else { + return; + } + + const color = colord(colorString); + + if (!color.isValid()) { + return; + } + + const namedColor = color.toName(); + + if (namedColor && namedColor.toLowerCase() !== 'transparent') { + complain( + messages.expected(namedColor, colorString), + decl, + declarationValueIndex(decl) + sourceIndex, + rawColorString.length, + ); + } + }); + }); + + /** + * @param {string} message + * @param {import('postcss').Node} node + * @param {number} index + * @param {number} length + */ + function complain(message, node, index, length) { + report({ + result, + ruleName, + message, + node, + index, + endIndex: index + length, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-no-hex/index.js b/node_modules/stylelint/lib/rules/color-no-hex/index.js new file mode 100644 index 000000000..99dd87b89 --- /dev/null +++ b/node_modules/stylelint/lib/rules/color-no-hex/index.js @@ -0,0 +1,78 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'color-no-hex'; + +const messages = ruleMessages(ruleName, { + rejected: (hex) => `Unexpected hex color "${hex}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/color-no-hex', +}; + +const HEX = /^#[\da-z]+$/i; +const CONTAINS_HEX = /#[\da-z]+/i; +const IGNORED_FUNCTIONS = new Set(['url']); + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (!CONTAINS_HEX.test(decl.value)) return; + + const parsedValue = valueParser(getDeclarationValue(decl)); + + parsedValue.walk((node) => { + if (isIgnoredFunction(node)) return false; + + if (!isHexColor(node)) return; + + const index = declarationValueIndex(decl) + node.sourceIndex; + const endIndex = index + node.value.length; + + report({ + message: messages.rejected, + messageArgs: [node.value], + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + }); + }; +}; + +/** + * @param {import('postcss-value-parser').Node} node + */ +function isIgnoredFunction({ type, value }) { + return type === 'function' && IGNORED_FUNCTIONS.has(value.toLowerCase()); +} + +/** + * @param {import('postcss-value-parser').Node} node + */ +function isHexColor({ type, value }) { + return type === 'word' && HEX.test(value); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-no-invalid-hex/index.js b/node_modules/stylelint/lib/rules/color-no-invalid-hex/index.js new file mode 100644 index 000000000..16b09fabf --- /dev/null +++ b/node_modules/stylelint/lib/rules/color-no-invalid-hex/index.js @@ -0,0 +1,74 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const isStandardSyntaxHexColor = require('../../utils/isStandardSyntaxHexColor'); +const isValidHex = require('../../utils/isValidHex'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); + +const ruleName = 'color-no-invalid-hex'; + +const messages = ruleMessages(ruleName, { + rejected: (hex) => `Unexpected invalid hex color "${hex}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/color-no-invalid-hex', +}; + +const CONTAINS_HEX = /#[\da-z]+/i; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (!isStandardSyntaxHexColor(decl.value)) { + return; + } + + if (!CONTAINS_HEX.test(decl.value)) { + return; + } + + valueParser(decl.value).walk(({ value, type, sourceIndex }) => { + if (type === 'function' && value.endsWith('url')) return false; + + if (type !== 'word') return; + + const hexMatch = /^#[\da-z]+/i.exec(value); + + if (!hexMatch) return; + + const hexValue = hexMatch[0]; + + if (!hexValue || isValidHex(hexValue)) return; + + const index = declarationValueIndex(decl) + sourceIndex; + const endIndex = index + hexValue.length; + + report({ + message: messages.rejected, + messageArgs: [hexValue], + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/comment-empty-line-before/index.js b/node_modules/stylelint/lib/rules/comment-empty-line-before/index.js new file mode 100644 index 000000000..9aaef4075 --- /dev/null +++ b/node_modules/stylelint/lib/rules/comment-empty-line-before/index.js @@ -0,0 +1,133 @@ +'use strict'; + +const addEmptyLineBefore = require('../../utils/addEmptyLineBefore'); +const hasEmptyLine = require('../../utils/hasEmptyLine'); +const isAfterComment = require('../../utils/isAfterComment'); +const isFirstNested = require('../../utils/isFirstNested'); +const isFirstNodeOfRoot = require('../../utils/isFirstNodeOfRoot'); +const isSharedLineComment = require('../../utils/isSharedLineComment'); +const isStandardSyntaxComment = require('../../utils/isStandardSyntaxComment'); +const optionsMatches = require('../../utils/optionsMatches'); +const removeEmptyLinesBefore = require('../../utils/removeEmptyLinesBefore'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isConfigurationComment } = require('../../utils/configurationComment'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'comment-empty-line-before'; + +const messages = ruleMessages(ruleName, { + expected: 'Expected empty line before comment', + rejected: 'Unexpected empty line before comment', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/comment-empty-line-before', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['always', 'never'], + }, + { + actual: secondaryOptions, + possible: { + except: ['first-nested'], + ignore: ['stylelint-commands', 'after-comment'], + ignoreComments: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkComments((comment) => { + // Ignore the first node + if (isFirstNodeOfRoot(comment)) { + return; + } + + // Optionally ignore stylelint commands + if ( + isConfigurationComment(comment, context.configurationComment) && + optionsMatches(secondaryOptions, 'ignore', 'stylelint-commands') + ) { + return; + } + + // Optionally ignore newlines between comments + if (optionsMatches(secondaryOptions, 'ignore', 'after-comment') && isAfterComment(comment)) { + return; + } + + // Ignore comments matching the ignoreComments option. + if (optionsMatches(secondaryOptions, 'ignoreComments', comment.text)) { + return; + } + + // Ignore shared-line comments + if (isSharedLineComment(comment)) { + return; + } + + // Ignore non-standard comments + if (!isStandardSyntaxComment(comment)) { + return; + } + + const expectEmptyLineBefore = (() => { + if (optionsMatches(secondaryOptions, 'except', 'first-nested') && isFirstNested(comment)) { + return false; + } + + return primary === 'always'; + })(); + + const before = comment.raws.before || ''; + const hasEmptyLineBefore = hasEmptyLine(before); + + // Return if the expectation is met + if (expectEmptyLineBefore === hasEmptyLineBefore) { + return; + } + + // Fix + if (context.fix) { + if (typeof context.newline !== 'string') return; + + if (expectEmptyLineBefore) { + addEmptyLineBefore(comment, context.newline); + } else { + removeEmptyLinesBefore(comment, context.newline); + } + + return; + } + + const message = expectEmptyLineBefore ? messages.expected : messages.rejected; + + report({ + message, + node: comment, + result, + ruleName, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/comment-no-empty/index.js b/node_modules/stylelint/lib/rules/comment-no-empty/index.js new file mode 100644 index 000000000..64b4d3752 --- /dev/null +++ b/node_modules/stylelint/lib/rules/comment-no-empty/index.js @@ -0,0 +1,51 @@ +'use strict'; + +const isStandardSyntaxComment = require('../../utils/isStandardSyntaxComment'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'comment-no-empty'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected empty comment', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/comment-no-empty', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkComments((comment) => { + // To ignore non-standard comments + if (!isStandardSyntaxComment(comment)) { + return; + } + + // To ignore comments that are not empty + if (comment.text && comment.text.length !== 0) { + return; + } + + report({ + message: messages.rejected, + node: comment, + result, + ruleName, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/comment-pattern/index.js b/node_modules/stylelint/lib/rules/comment-pattern/index.js new file mode 100644 index 000000000..27226a83c --- /dev/null +++ b/node_modules/stylelint/lib/rules/comment-pattern/index.js @@ -0,0 +1,53 @@ +'use strict'; + +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'comment-pattern'; + +const messages = ruleMessages(ruleName, { + expected: (pattern) => `Expected comment to match pattern "${pattern}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/comment-pattern', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isRegExp, isString], + }); + + if (!validOptions) { + return; + } + + const normalizedPattern = isString(primary) ? new RegExp(primary) : primary; + + root.walkComments((comment) => { + const text = comment.text; + + if (normalizedPattern.test(text)) { + return; + } + + report({ + message: messages.expected, + messageArgs: [primary], + node: comment, + result, + ruleName, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/comment-whitespace-inside/index.js b/node_modules/stylelint/lib/rules/comment-whitespace-inside/index.js new file mode 100644 index 000000000..6a84af350 --- /dev/null +++ b/node_modules/stylelint/lib/rules/comment-whitespace-inside/index.js @@ -0,0 +1,141 @@ +'use strict'; + +const isStandardSyntaxComment = require('../../utils/isStandardSyntaxComment'); +const isWhitespace = require('../../utils/isWhitespace'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'comment-whitespace-inside'; + +const messages = ruleMessages(ruleName, { + expectedOpening: 'Expected whitespace after "/*"', + rejectedOpening: 'Unexpected whitespace after "/*"', + expectedClosing: 'Expected whitespace before "*/"', + rejectedClosing: 'Unexpected whitespace before "*/"', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/comment-whitespace-inside', + fixable: true, +}; + +/** + * @param {import('postcss').Comment} comment + */ +function addWhitespaceBefore(comment) { + if (comment.text.startsWith('*')) { + comment.text = comment.text.replace(/^(\*+)/, `$1 `); + } else { + comment.raws.left = ' '; + } +} + +/** + * @param {import('postcss').Comment} comment + */ +function addWhitespaceAfter(comment) { + if (comment.text[comment.text.length - 1] === '*') { + comment.text = comment.text.replace(/(\*+)$/, ` $1`); + } else { + comment.raws.right = ' '; + } +} + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + root.walkComments((comment) => { + if (!isStandardSyntaxComment(comment)) { + return; + } + + const rawComment = comment.toString(); + const firstFourChars = rawComment.slice(0, 4); + + // Return early if sourcemap or copyright comment + if (/^\/\*[#!]\s/.test(firstFourChars)) { + return; + } + + const leftMatches = rawComment.match(/(^\/\*+)(\s)?/); + + if (leftMatches == null || leftMatches[1] == null) { + throw new Error(`Invalid comment: "${rawComment}"`); + } + + const rightMatches = rawComment.match(/(\s)?(\*+\/)$/); + + if (rightMatches == null || rightMatches[2] == null) { + throw new Error(`Invalid comment: "${rawComment}"`); + } + + const opener = leftMatches[1]; + const leftSpace = leftMatches[2] || ''; + const rightSpace = rightMatches[1] || ''; + const closer = rightMatches[2]; + + if (primary === 'never' && leftSpace !== '') { + complain(messages.rejectedOpening, opener.length); + } + + if (primary === 'always' && !isWhitespace(leftSpace)) { + complain(messages.expectedOpening, opener.length); + } + + if (primary === 'never' && rightSpace !== '') { + complain(messages.rejectedClosing, comment.toString().length - closer.length - 1); + } + + if (primary === 'always' && !isWhitespace(rightSpace)) { + complain(messages.expectedClosing, comment.toString().length - closer.length - 1); + } + + /** + * @param {string} message + * @param {number} index + */ + function complain(message, index) { + if (context.fix) { + if (primary === 'never') { + comment.raws.left = ''; + comment.raws.right = ''; + comment.text = comment.text.replace(/^(\*+)(\s+)?/, '$1').replace(/(\s+)?(\*+)$/, '$2'); + } else { + if (!leftSpace) { + addWhitespaceBefore(comment); + } + + if (!rightSpace) { + addWhitespaceAfter(comment); + } + } + + return; + } + + report({ + message, + index, + result, + ruleName, + node: comment, + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/comment-word-disallowed-list/index.js b/node_modules/stylelint/lib/rules/comment-word-disallowed-list/index.js new file mode 100644 index 000000000..e2ba6737b --- /dev/null +++ b/node_modules/stylelint/lib/rules/comment-word-disallowed-list/index.js @@ -0,0 +1,65 @@ +'use strict'; + +const containsString = require('../../utils/containsString'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'comment-word-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (pattern) => `Unexpected word matching pattern "${pattern}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/comment-word-disallowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkComments((comment) => { + const text = comment.text; + const rawComment = comment.toString(); + const firstFourChars = rawComment.slice(0, 4); + + // Return early if sourcemap + if (firstFourChars === '/*# ') { + return; + } + + const matchesWord = matchesStringOrRegExp(text, primary) || containsString(text, primary); + + if (!matchesWord) { + return; + } + + report({ + message: messages.rejected, + messageArgs: [matchesWord.pattern], + node: comment, + word: matchesWord.substring, + result, + ruleName, + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/custom-media-pattern/index.js b/node_modules/stylelint/lib/rules/custom-media-pattern/index.js new file mode 100644 index 000000000..fae968dc4 --- /dev/null +++ b/node_modules/stylelint/lib/rules/custom-media-pattern/index.js @@ -0,0 +1,66 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'custom-media-pattern'; + +const messages = ruleMessages(ruleName, { + expected: (mediaName, pattern) => `Expected "${mediaName}" to match pattern "${pattern}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/custom-media-pattern', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isRegExp, isString], + }); + + if (!validOptions) { + return; + } + + const regexpPattern = isString(primary) ? new RegExp(primary) : primary; + + root.walkAtRules((atRule) => { + if (atRule.name.toLowerCase() !== 'custom-media') { + return; + } + + const [fullName, customMediaName] = atRule.params.match(/^--(\S+)\b/) || []; + + if (fullName === undefined || customMediaName === undefined) { + throw new Error(`Unexpected at-rule params: "${atRule.params}"`); + } + + if (regexpPattern.test(customMediaName)) { + return; + } + + const index = atRuleParamIndex(atRule); + + report({ + message: messages.expected, + messageArgs: [fullName, primary], + node: atRule, + index, + endIndex: index + fullName.length, + result, + ruleName, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/custom-property-empty-line-before/index.js b/node_modules/stylelint/lib/rules/custom-property-empty-line-before/index.js new file mode 100644 index 000000000..4d5b0fd00 --- /dev/null +++ b/node_modules/stylelint/lib/rules/custom-property-empty-line-before/index.js @@ -0,0 +1,143 @@ +'use strict'; + +const addEmptyLineBefore = require('../../utils/addEmptyLineBefore'); +const blockString = require('../../utils/blockString'); +const getPreviousNonSharedLineCommentNode = require('../../utils/getPreviousNonSharedLineCommentNode'); +const hasEmptyLine = require('../../utils/hasEmptyLine'); +const isAfterComment = require('../../utils/isAfterComment'); +const isCustomProperty = require('../../utils/isCustomProperty'); +const isFirstNested = require('../../utils/isFirstNested'); +const isSingleLineString = require('../../utils/isSingleLineString'); +const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); +const optionsMatches = require('../../utils/optionsMatches'); +const removeEmptyLinesBefore = require('../../utils/removeEmptyLinesBefore'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isAtRule, isDeclaration, isRule } = require('../../utils/typeGuards'); + +const ruleName = 'custom-property-empty-line-before'; + +const messages = ruleMessages(ruleName, { + expected: 'Expected empty line before custom property', + rejected: 'Unexpected empty line before custom property', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/custom-property-empty-line-before', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['always', 'never'], + }, + { + actual: secondaryOptions, + possible: { + except: ['first-nested', 'after-comment', 'after-custom-property'], + ignore: ['after-comment', 'first-nested', 'inside-single-line-block'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + const prop = decl.prop; + const parent = decl.parent; + + if (!isStandardSyntaxDeclaration(decl)) { + return; + } + + if (!isCustomProperty(prop)) { + return; + } + + // Optionally ignore the node if a comment precedes it + if (optionsMatches(secondaryOptions, 'ignore', 'after-comment') && isAfterComment(decl)) { + return; + } + + // Optionally ignore the node if it is the first nested + if (optionsMatches(secondaryOptions, 'ignore', 'first-nested') && isFirstNested(decl)) { + return; + } + + // Optionally ignore nodes inside single-line blocks + if ( + optionsMatches(secondaryOptions, 'ignore', 'inside-single-line-block') && + parent != null && + (isAtRule(parent) || isRule(parent)) && + isSingleLineString(blockString(parent)) + ) { + return; + } + + let expectEmptyLineBefore = primary === 'always'; + + // Optionally reverse the expectation if any exceptions apply + if ( + (optionsMatches(secondaryOptions, 'except', 'first-nested') && isFirstNested(decl)) || + (optionsMatches(secondaryOptions, 'except', 'after-comment') && isAfterComment(decl)) || + (optionsMatches(secondaryOptions, 'except', 'after-custom-property') && + isAfterCustomProperty(decl)) + ) { + expectEmptyLineBefore = !expectEmptyLineBefore; + } + + const hasEmptyLineBefore = hasEmptyLine(decl.raws.before); + + // Return if the expectation is met + if (expectEmptyLineBefore === hasEmptyLineBefore) { + return; + } + + // Fix + if (context.fix) { + if (context.newline == null) return; + + if (expectEmptyLineBefore) { + addEmptyLineBefore(decl, context.newline); + } else { + removeEmptyLinesBefore(decl, context.newline); + } + + return; + } + + const message = expectEmptyLineBefore ? messages.expected : messages.rejected; + + report({ + message, + node: decl, + result, + ruleName, + }); + }); + }; +}; + +/** + * @param {import('postcss').Declaration} decl + */ +function isAfterCustomProperty(decl) { + const prevNode = getPreviousNonSharedLineCommentNode(decl); + + return prevNode != null && isDeclaration(prevNode) && isCustomProperty(prevNode.prop); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/custom-property-no-missing-var-function/index.js b/node_modules/stylelint/lib/rules/custom-property-no-missing-var-function/index.js new file mode 100644 index 000000000..f6378ff7f --- /dev/null +++ b/node_modules/stylelint/lib/rules/custom-property-no-missing-var-function/index.js @@ -0,0 +1,88 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'custom-property-no-missing-var-function'; + +const messages = ruleMessages(ruleName, { + rejected: (customProperty) => `Unexpected missing var function for "${customProperty}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/custom-property-no-missing-var-function', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) return; + + /** @type {Set} */ + const knownCustomProperties = new Set(); + + root.walkAtRules(/^property$/i, (atRule) => { + knownCustomProperties.add(atRule.params); + }); + + root.walkDecls(/^--/, ({ prop }) => { + knownCustomProperties.add(prop); + }); + + root.walkDecls((decl) => { + const { value } = decl; + + if (!value.includes('--')) return; + + const parsedValue = valueParser(value); + + parsedValue.walk((node) => { + if (isVarFunction(node)) return false; + + if (!isDashedIdent(node)) return; + + if (!knownCustomProperties.has(node.value)) return; + + const index = declarationValueIndex(decl) + node.sourceIndex; + const endIndex = index + node.value.length; + + report({ + message: messages.rejected, + messageArgs: [node.value], + node: decl, + index, + endIndex, + result, + ruleName, + }); + + return false; + }); + }); + }; +}; + +/** + * @param {import('postcss-value-parser').Node} node + */ +function isDashedIdent({ type, value }) { + return type === 'word' && value.startsWith('--'); +} + +/** + * @param {import('postcss-value-parser').Node} node + */ +function isVarFunction({ type, value }) { + return type === 'function' && value === 'var'; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/custom-property-pattern/index.js b/node_modules/stylelint/lib/rules/custom-property-pattern/index.js new file mode 100644 index 000000000..9f8a1dba2 --- /dev/null +++ b/node_modules/stylelint/lib/rules/custom-property-pattern/index.js @@ -0,0 +1,99 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); +const isCustomProperty = require('../../utils/isCustomProperty'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const { isRegExp, isString } = require('../../utils/validateTypes'); +const { isValueFunction } = require('../../utils/typeGuards'); +const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); + +const ruleName = 'custom-property-pattern'; + +const messages = ruleMessages(ruleName, { + expected: (propName, pattern) => `Expected "${propName}" to match pattern "${pattern}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/custom-property-pattern', +}; + +const VAR_FUNC_REGEX = /var\(/i; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isRegExp, isString], + }); + + if (!validOptions) { + return; + } + + const regexpPattern = isString(primary) ? new RegExp(primary) : primary; + + /** + * @param {string} property + * @returns {boolean} + */ + function check(property) { + return ( + !isCustomProperty(property) || + !isStandardSyntaxProperty(property) || + regexpPattern.test(property.slice(2)) + ); + } + + root.walkDecls((decl) => { + const { prop, value } = decl; + + if (VAR_FUNC_REGEX.test(value)) { + const parsedValue = valueParser(value); + + parsedValue.walk((node) => { + if (!isValueFunction(node)) return; + + if (node.value.toLowerCase() !== 'var') return; + + const { nodes } = node; + + const firstNode = nodes[0]; + + if (!firstNode || check(firstNode.value)) return; + + complain(declarationValueIndex(decl) + firstNode.sourceIndex, firstNode.value, decl); + }); + } + + if (check(prop)) return; + + complain(0, prop, decl); + }); + + /** + * @param {number} index + * @param {string} propName + * @param {import('postcss').Declaration} decl + */ + function complain(index, propName, decl) { + report({ + result, + ruleName, + message: messages.expected, + messageArgs: [propName, primary], + node: decl, + index, + endIndex: index + propName.length, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-bang-space-after/index.js b/node_modules/stylelint/lib/rules/declaration-bang-space-after/index.js new file mode 100644 index 000000000..6ce833433 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-bang-space-after/index.js @@ -0,0 +1,91 @@ +'use strict'; + +const declarationBangSpaceChecker = require('../declarationBangSpaceChecker'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'declaration-bang-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected single space after "!"', + rejectedAfter: () => 'Unexpected whitespace after "!"', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-bang-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + declarationBangSpaceChecker({ + root, + result, + locationChecker: checker.after, + checkedRuleName: ruleName, + fix: context.fix + ? (decl, index) => { + let bangIndex = index - declarationValueIndex(decl); + const declValue = getDeclarationValue(decl); + let target; + /** @type {(value: string) => void} */ + let setFixed; + + if (bangIndex < declValue.length) { + target = declValue; + setFixed = (value) => { + setDeclarationValue(decl, value); + }; + } else if (decl.important) { + target = decl.raws.important || ' !important'; + bangIndex -= declValue.length; + setFixed = (value) => { + decl.raws.important = value; + }; + } else { + return false; // not standard + } + + const targetBefore = target.slice(0, bangIndex + 1); + const targetAfter = target.slice(bangIndex + 1); + + if (primary === 'always') { + setFixed(targetBefore + targetAfter.replace(/^\s*/, ' ')); + + return true; + } + + if (primary === 'never') { + setFixed(targetBefore + targetAfter.replace(/^\s*/, '')); + + return true; + } + + return false; + } + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-bang-space-before/index.js b/node_modules/stylelint/lib/rules/declaration-bang-space-before/index.js new file mode 100644 index 000000000..3d6216f48 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-bang-space-before/index.js @@ -0,0 +1,92 @@ +'use strict'; + +const declarationBangSpaceChecker = require('../declarationBangSpaceChecker'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'declaration-bang-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before "!"', + rejectedBefore: () => 'Unexpected whitespace before "!"', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-bang-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + declarationBangSpaceChecker({ + root, + result, + locationChecker: checker.before, + checkedRuleName: ruleName, + fix: context.fix + ? (decl, index) => { + let bangIndex = index - declarationValueIndex(decl); + const value = getDeclarationValue(decl); + let target; + /** @type {(val: string) => void} */ + let setFixed; + + if (bangIndex < value.length) { + target = value; + setFixed = (val) => { + setDeclarationValue(decl, val); + }; + } else if (decl.important) { + target = decl.raws.important || ' !important'; + bangIndex -= value.length; + setFixed = (val) => { + decl.raws.important = val; + }; + } else { + return false; // not standard + } + + const targetBefore = target.slice(0, bangIndex); + const targetAfter = target.slice(bangIndex); + + if (primary === 'always') { + // eslint-disable-next-line prefer-template + setFixed(targetBefore.replace(/\s*$/, '') + ' ' + targetAfter); + + return true; + } + + if (primary === 'never') { + setFixed(targetBefore.replace(/\s*$/, '') + targetAfter); + + return true; + } + + return false; + } + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-custom-properties/index.js b/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-custom-properties/index.js new file mode 100644 index 000000000..4e465f24a --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-custom-properties/index.js @@ -0,0 +1,84 @@ +'use strict'; + +const eachDeclarationBlock = require('../../utils/eachDeclarationBlock'); +const isCustomProperty = require('../../utils/isCustomProperty'); +const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const { isRegExp, isString } = require('../../utils/validateTypes'); +const validateOptions = require('../../utils/validateOptions'); +const optionsMatches = require('../../utils/optionsMatches'); + +const ruleName = 'declaration-block-no-duplicate-custom-properties'; + +const messages = ruleMessages(ruleName, { + rejected: (property) => `Unexpected duplicate "${property}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-block-no-duplicate-custom-properties', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignoreProperties: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + eachDeclarationBlock(root, (eachDecl) => { + const decls = new Set(); + + eachDecl((decl) => { + const prop = decl.prop; + + if (!isStandardSyntaxProperty(prop)) { + return; + } + + if (!isCustomProperty(prop)) { + return; + } + + if (optionsMatches(secondaryOptions, 'ignoreProperties', prop)) { + return; + } + + const isDuplicate = decls.has(prop); + + if (isDuplicate) { + report({ + message: messages.rejected, + messageArgs: [prop], + node: decl, + result, + ruleName, + word: prop, + }); + + return; + } + + decls.add(prop); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-properties/index.js b/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-properties/index.js new file mode 100644 index 000000000..cb03facf9 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-properties/index.js @@ -0,0 +1,277 @@ +'use strict'; + +const { parse, List } = require('css-tree'); +const eachDeclarationBlock = require('../../utils/eachDeclarationBlock'); +const isCustomProperty = require('../../utils/isCustomProperty'); +const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); +const vendor = require('../../utils/vendor'); + +const ruleName = 'declaration-block-no-duplicate-properties'; + +const messages = ruleMessages(ruleName, { + rejected: (property) => `Unexpected duplicate "${property}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-block-no-duplicate-properties', + fixable: true, +}; + +/** @typedef {import('css-tree').CssNode} CssNode */ + +/** @type {(node: CssNode) => node is CssNode & { children: List }} */ +const hasChildren = (node) => 'children' in node && node.children instanceof List; + +/** @type {(node1: CssNode[], node2: CssNode[]) => boolean} */ +const isEqualValueNodes = (nodes1, nodes2) => { + // Different lengths indicate different syntaxes. + if (nodes1.length !== nodes2.length) { + return false; + } + + for (let i = 0; i < nodes1.length; i++) { + const node1 = nodes1[i]; + const node2 = nodes2[i]; + + // Different types indicate different syntaxes. + if (typeof node1 === 'undefined' || typeof node2 === 'undefined' || node1.type !== node2.type) { + return false; + } + + const node1Name = 'name' in node1 ? String(node1.name) : ''; + const node2Name = 'name' in node2 ? String(node2.name) : ''; + + // Custom properties have unknown value syntaxes but are equal for CSS parsers. + if ( + node1.type === 'Identifier' && + isCustomProperty(node1Name) && + node2.type === 'Identifier' && + isCustomProperty(node2Name) + ) { + continue; + } + + // Different ident or function names indicate different syntaxes. + if (node1Name.toLowerCase() !== node2Name.toLowerCase()) { + return false; + } + + const node1Unit = 'unit' in node1 ? node1.unit : ''; + const node2Unit = 'unit' in node2 ? node2.unit : ''; + + // Different units indicate different syntaxes. + if (node1Unit !== node2Unit) { + return false; + } + + const node1Children = hasChildren(node1) ? node1.children.toArray() : null; + const node2Children = hasChildren(node2) ? node2.children.toArray() : null; + + if (Array.isArray(node1Children) && Array.isArray(node2Children)) { + if (isEqualValueNodes(node1Children, node2Children)) { + continue; + } else { + return false; + } + } + } + + return true; +}; + +/** @type {(value1: string, value2: string) => boolean} */ +const isEqualValueSyntaxes = (value1, value2) => { + if (value1 === value2) { + return true; + } + + if (!(isStandardSyntaxValue(value1) && isStandardSyntaxValue(value2))) { + return false; + } + + let value1Node; + let value2Node; + + try { + value1Node = parse(value1, { context: 'value' }); + value2Node = parse(value2, { context: 'value' }); + } catch (error) { + return false; + } + + const node1Children = hasChildren(value1Node) ? value1Node.children.toArray() : []; + const node2Children = hasChildren(value2Node) ? value2Node.children.toArray() : []; + + return isEqualValueNodes(node1Children, node2Children); +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignore: [ + 'consecutive-duplicates', + 'consecutive-duplicates-with-different-values', + 'consecutive-duplicates-with-different-syntaxes', + 'consecutive-duplicates-with-same-prefixless-values', + ], + ignoreProperties: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const ignoreDuplicates = optionsMatches(secondaryOptions, 'ignore', 'consecutive-duplicates'); + const ignoreDiffValues = optionsMatches( + secondaryOptions, + 'ignore', + 'consecutive-duplicates-with-different-values', + ); + const ignoreDiffSyntaxes = optionsMatches( + secondaryOptions, + 'ignore', + 'consecutive-duplicates-with-different-syntaxes', + ); + const ignorePrefixlessSameValues = optionsMatches( + secondaryOptions, + 'ignore', + 'consecutive-duplicates-with-same-prefixless-values', + ); + + eachDeclarationBlock(root, (eachDecl) => { + /** @type {import('postcss').Declaration[]} */ + const decls = []; + + eachDecl((decl) => { + const prop = decl.prop; + const lowerProp = decl.prop.toLowerCase(); + const value = decl.value; + const important = decl.important; + + if (!isStandardSyntaxProperty(prop)) { + return; + } + + if (isCustomProperty(prop)) { + return; + } + + // Return early if the property is to be ignored + if (optionsMatches(secondaryOptions, 'ignoreProperties', prop)) { + return; + } + + // Ignore the src property as commonly duplicated in at-fontface + if (lowerProp === 'src') { + return; + } + + const indexDuplicate = decls.findIndex((d) => d.prop.toLowerCase() === lowerProp); + + if (indexDuplicate === -1) { + decls.push(decl); + } + + const duplicateDecl = decls[indexDuplicate]; + + if (!duplicateDecl) { + return; + } + + const duplicateValue = duplicateDecl.value || ''; + const duplicateImportant = duplicateDecl.important || false; + const duplicateIsMoreImportant = !important && duplicateImportant; + const duplicatesAreConsecutive = indexDuplicate === decls.length - 1; + const unprefixedDuplicatesAreEqual = + vendor.unprefixed(value) === vendor.unprefixed(duplicateValue); + + const fixOrReport = () => { + if (!context.fix) { + return report({ + message: messages.rejected, + messageArgs: [prop], + node: decl, + result, + ruleName, + word: prop, + }); + } + + if (duplicateIsMoreImportant) { + return decl.remove(); + } + + // replace previous "active" decl with current one + decls[indexDuplicate] = decl; + + return duplicateDecl.remove(); + }; + + if (ignoreDiffValues || ignoreDiffSyntaxes || ignorePrefixlessSameValues) { + if ( + !duplicatesAreConsecutive || + (ignorePrefixlessSameValues && !unprefixedDuplicatesAreEqual) + ) { + fixOrReport(); + + return; + } + + if (ignoreDiffSyntaxes) { + const duplicateValueSyntaxesAreEqual = isEqualValueSyntaxes(value, duplicateValue); + + if (duplicateValueSyntaxesAreEqual) { + fixOrReport(); + + return; + } + } + + if (value !== duplicateValue) { + return; + } + + if (context.fix) { + return duplicateDecl.remove(); + } + + return report({ + message: messages.rejected, + messageArgs: [prop], + node: decl, + result, + ruleName, + word: prop, + }); + } + + if (ignoreDuplicates && duplicatesAreConsecutive) { + return; + } + + fixOrReport(); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-no-redundant-longhand-properties/index.js b/node_modules/stylelint/lib/rules/declaration-block-no-redundant-longhand-properties/index.js new file mode 100644 index 000000000..1457f6ebb --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-block-no-redundant-longhand-properties/index.js @@ -0,0 +1,294 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const arrayEqual = require('../../utils/arrayEqual'); +const { basicKeywords } = require('../../reference/keywords'); +const eachDeclarationBlock = require('../../utils/eachDeclarationBlock'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const { longhandSubPropertiesOfShorthandProperties } = require('../../reference/properties'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'declaration-block-no-redundant-longhand-properties'; + +const messages = ruleMessages(ruleName, { + expected: (props) => `Expected shorthand property "${props}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-block-no-redundant-longhand-properties', + fixable: true, +}; + +/** @typedef {import('postcss').Declaration} Declaration */ + +/** @type {Map) => (string | undefined)>} */ +const customResolvers = new Map([ + [ + 'grid-column', + (decls) => { + const start = decls.get('grid-column-start')?.value.trim(); + const end = decls.get('grid-column-end')?.value.trim(); + + if (!start || !end) return; + + return `${start} / ${end}`; + }, + ], + [ + 'grid-row', + (decls) => { + const start = decls.get('grid-row-start')?.value.trim(); + const end = decls.get('grid-row-end')?.value.trim(); + + if (!start || !end) return; + + return `${start} / ${end}`; + }, + ], + [ + 'grid-template', + (decls) => { + const areas = decls.get('grid-template-areas')?.value.trim(); + const columns = decls.get('grid-template-columns')?.value.trim(); + const rows = decls.get('grid-template-rows')?.value.trim(); + + if (!(areas && columns && rows)) return; + + const splitAreas = [...areas.matchAll(/"[^"]+"/g)].map((x) => x[0]); + const splitRows = rows.split(' '); + + if (splitAreas.length === 0 || splitRows.length === 0) return; + + if (splitAreas.length !== splitRows.length) return; + + const zipped = splitAreas.map((area, i) => `${area} ${splitRows[i]}`).join(' '); + + return `${zipped} / ${columns}`; + }, + ], + [ + 'transition', + (decls) => { + /** @type {(input: string | undefined) => string[]} */ + const commaSeparated = (input = '') => { + let trimmedInput = input.trim(); + + if (!trimmedInput) return []; + + if (trimmedInput.indexOf(',') === -1) return [trimmedInput]; + + /** @type {import('postcss-value-parser').ParsedValue} */ + let parsedValue = valueParser(trimmedInput); + /** @type {Array>} */ + let valueParts = []; + + { + /** @type {Array} */ + let currentListItem = []; + + parsedValue.nodes.forEach((node) => { + if (node.type === 'div' && node.value === ',') { + valueParts.push(currentListItem); + currentListItem = []; + + return; + } + + currentListItem.push(node); + }); + + valueParts.push(currentListItem); + } + + return valueParts.map((s) => valueParser.stringify(s).trim()).filter((s) => s.length > 0); + }; + + const delays = commaSeparated(decls.get('transition-delay')?.value); + const durations = commaSeparated(decls.get('transition-duration')?.value); + const timingFunctions = commaSeparated(decls.get('transition-timing-function')?.value); + const properties = commaSeparated(decls.get('transition-property')?.value); + + if (!(delays.length && durations.length && timingFunctions.length && properties.length)) { + return; + } + + // transition-property is the canonical list of the number of properties; + // see spec: https://w3c.github.io/csswg-drafts/css-transitions/#transition-property-property + // if there are more transition-properties than duration/delay/timings, + // the other properties are computed cyclically -- ex with % + // see spec example #3: https://w3c.github.io/csswg-drafts/css-transitions/#example-d94cbd75 + return properties + .map((property, i) => { + return [ + property, + durations[i % durations.length], + timingFunctions[i % timingFunctions.length], + delays[i % delays.length], + ] + .filter(isString) + .join(' '); + }) + .join(', '); + }, + ], +]); + +/** + * @param {string} prefixedShorthandProperty + * @param {string[]} prefixedShorthandData + * @param {Map} transformedDeclarationNodes + * @returns {string | undefined} + */ +const resolveShorthandValue = ( + prefixedShorthandProperty, + prefixedShorthandData, + transformedDeclarationNodes, +) => { + const resolver = customResolvers.get(prefixedShorthandProperty); + + if (resolver === undefined) { + // the "default" resolver: sort the longhand values in the order + // of their properties + const values = prefixedShorthandData + .map((p) => transformedDeclarationNodes.get(p)?.value.trim()) + .filter(Boolean); + + return values.length > 0 ? values.join(' ') : undefined; + } + + return resolver(transformedDeclarationNodes); +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignoreShorthands: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + /** @type {Map} */ + const longhandToShorthands = new Map(); + + for (const [shorthand, longhandProps] of longhandSubPropertiesOfShorthandProperties.entries()) { + if (optionsMatches(secondaryOptions, 'ignoreShorthands', shorthand)) { + continue; + } + + for (const longhand of longhandProps) { + const shorthands = longhandToShorthands.get(longhand) || []; + + shorthands.push(shorthand); + longhandToShorthands.set(longhand, shorthands); + } + } + + eachDeclarationBlock(root, (eachDecl) => { + /** @type {Map} */ + const longhandDeclarations = new Map(); + /** @type {Map} */ + const longhandDeclarationNodes = new Map(); + + eachDecl((decl) => { + // basic keywords are not allowed in shorthand properties + if (basicKeywords.has(decl.value)) { + return; + } + + const prop = decl.prop.toLowerCase(); + const unprefixedProp = vendor.unprefixed(prop); + const prefix = vendor.prefix(prop); + + const shorthandProperties = longhandToShorthands.get(unprefixedProp); + + if (!shorthandProperties) { + return; + } + + for (const shorthandProperty of shorthandProperties) { + const prefixedShorthandProperty = prefix + shorthandProperty; + const longhandDeclaration = longhandDeclarations.get(prefixedShorthandProperty) || []; + const longhandDeclarationNode = + longhandDeclarationNodes.get(prefixedShorthandProperty) || []; + + longhandDeclaration.push(prop); + longhandDeclarations.set(prefixedShorthandProperty, longhandDeclaration); + + longhandDeclarationNode.push(decl); + longhandDeclarationNodes.set(prefixedShorthandProperty, longhandDeclarationNode); + + const shorthandProps = longhandSubPropertiesOfShorthandProperties.get(shorthandProperty); + const prefixedShorthandData = Array.from(shorthandProps || []).map( + (item) => prefix + item, + ); + + const copiedPrefixedShorthandData = [...prefixedShorthandData]; + + if (!arrayEqual(copiedPrefixedShorthandData.sort(), longhandDeclaration.sort())) { + continue; + } + + if (context.fix) { + const declNodes = longhandDeclarationNodes.get(prefixedShorthandProperty) || []; + const [firstDeclNode] = declNodes; + + if (firstDeclNode) { + const transformedDeclarationNodes = new Map( + declNodes.map((d) => [d.prop.toLowerCase(), d]), + ); + const resolvedShorthandValue = resolveShorthandValue( + prefixedShorthandProperty, + prefixedShorthandData, + transformedDeclarationNodes, + ); + + if (resolvedShorthandValue) { + const newShorthandDeclarationNode = firstDeclNode.clone({ + prop: prefixedShorthandProperty, + value: resolvedShorthandValue, + }); + + firstDeclNode.replaceWith(newShorthandDeclarationNode); + + declNodes.forEach((node) => node.remove()); + + return; + } + } + } + + report({ + ruleName, + result, + node: decl, + word: decl.prop, + message: messages.expected, + messageArgs: [prefixedShorthandProperty], + }); + } + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/index.js b/node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/index.js new file mode 100644 index 000000000..db75f18a9 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/index.js @@ -0,0 +1,72 @@ +'use strict'; + +const eachDeclarationBlock = require('../../utils/eachDeclarationBlock'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const { longhandSubPropertiesOfShorthandProperties } = require('../../reference/properties'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); + +const ruleName = 'declaration-block-no-shorthand-property-overrides'; + +const messages = ruleMessages(ruleName, { + rejected: (shorthand, original) => `Unexpected shorthand "${shorthand}" after "${original}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-block-no-shorthand-property-overrides', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + eachDeclarationBlock(root, (eachDecl) => { + /** @type {Map} */ + const declarations = new Map(); + + eachDecl((decl) => { + const prop = decl.prop; + const unprefixedProp = vendor.unprefixed(prop).toLowerCase(); + const prefix = vendor.prefix(prop).toLowerCase(); + + const overrideables = /** @type {Map>} */ ( + longhandSubPropertiesOfShorthandProperties + ).get(unprefixedProp); + + if (!overrideables) { + declarations.set(prop.toLowerCase(), prop); + + return; + } + + for (const longhandProp of overrideables) { + const declaration = declarations.get(prefix + longhandProp); + + if (!declaration) { + continue; + } + + report({ + ruleName, + result, + node: decl, + message: messages.rejected, + messageArgs: [prop, declaration || ''], + word: prop, + }); + } + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-after/index.js b/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-after/index.js new file mode 100644 index 000000000..fa218039b --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-after/index.js @@ -0,0 +1,107 @@ +'use strict'; + +const blockString = require('../../utils/blockString'); +const nextNonCommentNode = require('../../utils/nextNonCommentNode'); +const rawNodeString = require('../../utils/rawNodeString'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); +const { isAtRule, isRule } = require('../../utils/typeGuards'); + +const ruleName = 'declaration-block-semicolon-newline-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected newline after ";"', + expectedAfterMultiLine: () => 'Expected newline after ";" in a multi-line declaration block', + rejectedAfterMultiLine: () => 'Unexpected newline after ";" in a multi-line declaration block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-block-semicolon-newline-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line', 'never-multi-line'], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + // Ignore last declaration if there's no trailing semicolon + const parentRule = decl.parent; + + if (!parentRule) throw new Error('A parent node must be present'); + + if (!isAtRule(parentRule) && !isRule(parentRule)) { + return; + } + + if (!parentRule.raws.semicolon && parentRule.last === decl) { + return; + } + + const nextNode = decl.next(); + + if (!nextNode) { + return; + } + + // Allow end-of-line comment + const nodeToCheck = nextNonCommentNode(nextNode); + + if (!nodeToCheck) { + return; + } + + checker.afterOneOnly({ + source: rawNodeString(nodeToCheck), + index: -1, + lineCheckStr: blockString(parentRule), + err: (m) => { + if (context.fix) { + if (primary.startsWith('always')) { + const index = nodeToCheck.raws.before.search(/\r?\n/); + + nodeToCheck.raws.before = + index >= 0 + ? nodeToCheck.raws.before.slice(index) + : context.newline + nodeToCheck.raws.before; + + return; + } + + if (primary === 'never-multi-line') { + nodeToCheck.raws.before = ''; + + return; + } + } + + report({ + message: m, + node: decl, + index: decl.toString().length + 1, + result, + ruleName, + }); + }, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-before/index.js b/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-before/index.js new file mode 100644 index 000000000..9e75fb293 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-before/index.js @@ -0,0 +1,74 @@ +'use strict'; + +const blockString = require('../../utils/blockString'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); +const { isAtRule, isRule } = require('../../utils/typeGuards'); + +const ruleName = 'declaration-block-semicolon-newline-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected newline before ";"', + expectedBeforeMultiLine: () => 'Expected newline before ";" in a multi-line declaration block', + rejectedBeforeMultiLine: () => + 'Unexpected whitespace before ";" in a multi-line declaration block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-block-semicolon-newline-before', + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line', 'never-multi-line'], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + const parentRule = decl.parent; + + if (!parentRule) throw new Error('A parent node must be present'); + + if (!isAtRule(parentRule) && !isRule(parentRule)) { + return; + } + + if (!parentRule.raws.semicolon && parentRule.last === decl) { + return; + } + + const declString = decl.toString(); + + checker.beforeAllowingIndentation({ + source: declString, + index: declString.length, + lineCheckStr: blockString(parentRule), + err: (m) => { + report({ + message: m, + node: decl, + index: decl.toString().length - 1, + result, + ruleName, + }); + }, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-semicolon-space-after/index.js b/node_modules/stylelint/lib/rules/declaration-block-semicolon-space-after/index.js new file mode 100644 index 000000000..97a16bdc2 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-block-semicolon-space-after/index.js @@ -0,0 +1,97 @@ +'use strict'; + +const blockString = require('../../utils/blockString'); +const rawNodeString = require('../../utils/rawNodeString'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); +const { isAtRule, isRule } = require('../../utils/typeGuards'); + +const ruleName = 'declaration-block-semicolon-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected single space after ";"', + rejectedAfter: () => 'Unexpected whitespace after ";"', + expectedAfterSingleLine: () => + 'Expected single space after ";" in a single-line declaration block', + rejectedAfterSingleLine: () => + 'Unexpected whitespace after ";" in a single-line declaration block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-block-semicolon-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never', 'always-single-line', 'never-single-line'], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + // Ignore last declaration if there's no trailing semicolon + const parentRule = decl.parent; + + if (!parentRule) throw new Error('A parent node must be present'); + + if (!isAtRule(parentRule) && !isRule(parentRule)) { + return; + } + + if (!parentRule.raws.semicolon && parentRule.last === decl) { + return; + } + + const nextDecl = decl.next(); + + if (!nextDecl) { + return; + } + + checker.after({ + source: rawNodeString(nextDecl), + index: -1, + lineCheckStr: blockString(parentRule), + err: (m) => { + if (context.fix) { + if (primary.startsWith('always')) { + nextDecl.raws.before = ' '; + + return; + } + + if (primary.startsWith('never')) { + nextDecl.raws.before = ''; + + return; + } + } + + report({ + message: m, + node: decl, + index: decl.toString().length + 1, + result, + ruleName, + }); + }, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-semicolon-space-before/index.js b/node_modules/stylelint/lib/rules/declaration-block-semicolon-space-before/index.js new file mode 100644 index 000000000..56426dc3b --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-block-semicolon-space-before/index.js @@ -0,0 +1,104 @@ +'use strict'; + +const blockString = require('../../utils/blockString'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); +const { isAtRule, isRule } = require('../../utils/typeGuards'); + +const ruleName = 'declaration-block-semicolon-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before ";"', + rejectedBefore: () => 'Unexpected whitespace before ";"', + expectedBeforeSingleLine: () => + 'Expected single space before ";" in a single-line declaration block', + rejectedBeforeSingleLine: () => + 'Unexpected whitespace before ";" in a single-line declaration block', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-block-semicolon-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never', 'always-single-line', 'never-single-line'], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + // Ignore last declaration if there's no trailing semicolon + const parentRule = decl.parent; + + if (!parentRule) throw new Error('A parent node must be present'); + + if (!isAtRule(parentRule) && !isRule(parentRule)) { + return; + } + + if (!parentRule.raws.semicolon && parentRule.last === decl) { + return; + } + + const declString = decl.toString(); + + checker.before({ + source: declString, + index: declString.length, + lineCheckStr: blockString(parentRule), + err: (m) => { + if (context.fix) { + const value = getDeclarationValue(decl); + + if (primary.startsWith('always')) { + if (decl.important) { + decl.raws.important = ' !important '; + } else { + setDeclarationValue(decl, value.replace(/\s*$/, ' ')); + } + + return; + } + + if (primary.startsWith('never')) { + if (decl.raws.important) { + decl.raws.important = decl.raws.important.replace(/\s*$/, ''); + } else { + setDeclarationValue(decl, value.replace(/\s*$/, '')); + } + + return; + } + } + + report({ + message: m, + node: decl, + index: decl.toString().length - 1, + result, + ruleName, + }); + }, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-single-line-max-declarations/index.js b/node_modules/stylelint/lib/rules/declaration-block-single-line-max-declarations/index.js new file mode 100644 index 000000000..be9498565 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-block-single-line-max-declarations/index.js @@ -0,0 +1,64 @@ +'use strict'; + +const blockString = require('../../utils/blockString'); +const isSingleLineString = require('../../utils/isSingleLineString'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isNumber } = require('../../utils/validateTypes'); + +const ruleName = 'declaration-block-single-line-max-declarations'; + +const messages = ruleMessages(ruleName, { + expected: (max) => `Expected no more than ${max} ${max === 1 ? 'declaration' : 'declarations'}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-block-single-line-max-declarations', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isNumber], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + const block = blockString(ruleNode); + + if (!isSingleLineString(block)) { + return; + } + + if (!ruleNode.nodes) { + return; + } + + const decls = ruleNode.nodes.filter((node) => node.type === 'decl'); + + if (decls.length <= primary) { + return; + } + + report({ + message: messages.expected, + messageArgs: [primary], + node: ruleNode, + word: block, + result, + ruleName, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-trailing-semicolon/index.js b/node_modules/stylelint/lib/rules/declaration-block-trailing-semicolon/index.js new file mode 100644 index 000000000..acc45e646 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-block-trailing-semicolon/index.js @@ -0,0 +1,146 @@ +'use strict'; + +const hasBlock = require('../../utils/hasBlock'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const { isAtRule } = require('../../utils/typeGuards'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'declaration-block-trailing-semicolon'; + +const messages = ruleMessages(ruleName, { + expected: 'Expected a trailing semicolon', + rejected: 'Unexpected trailing semicolon', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-block-trailing-semicolon', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['always', 'never'], + }, + { + actual: secondaryOptions, + possible: { + ignore: ['single-declaration'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkAtRules((atRule) => { + if (!atRule.parent) throw new Error('A parent node must be present'); + + if (atRule.parent === root) { + return; + } + + if (atRule !== atRule.parent.last) { + return; + } + + if (hasBlock(atRule)) { + return; + } + + checkLastNode(atRule); + }); + + root.walkDecls((decl) => { + if (!decl.parent) throw new Error('A parent node must be present'); + + if (decl.parent.type === 'object') { + return; + } + + if (decl !== decl.parent.last) { + return; + } + + checkLastNode(decl); + }); + + /** + * @param {import('postcss').Node} node + */ + function checkLastNode(node) { + if (!node.parent) throw new Error('A parent node must be present'); + + const hasSemicolon = node.parent.raws.semicolon; + const ignoreSingleDeclaration = optionsMatches( + secondaryOptions, + 'ignore', + 'single-declaration', + ); + + if (ignoreSingleDeclaration && node.parent.first === node) { + return; + } + + let message; + + if (primary === 'always') { + if (hasSemicolon) { + return; + } + + // auto-fix + if (context.fix) { + node.parent.raws.semicolon = true; + + if (isAtRule(node)) { + node.raws.between = ''; + node.parent.raws.after = ' '; + } + + return; + } + + message = messages.expected; + } else if (primary === 'never') { + if (!hasSemicolon) { + return; + } + + // auto-fix + if (context.fix) { + node.parent.raws.semicolon = false; + + return; + } + + message = messages.rejected; + } else { + throw new Error(`Unexpected primary option: "${primary}"`); + } + + report({ + message, + node, + index: node.toString().trim().length - 1, + result, + ruleName, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-colon-newline-after/index.js b/node_modules/stylelint/lib/rules/declaration-colon-newline-after/index.js new file mode 100644 index 000000000..acfa40465 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-colon-newline-after/index.js @@ -0,0 +1,97 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'declaration-colon-newline-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected newline after ":"', + expectedAfterMultiLine: () => 'Expected newline after ":" with a multi-line declaration', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-colon-newline-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line'], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (!isStandardSyntaxDeclaration(decl)) { + return; + } + + // Get the raw prop, and only the prop + const endOfPropIndex = declarationValueIndex(decl) + (decl.raws.between || '').length - 1; + + // The extra characters tacked onto the end ensure that there is a character to check + // after the colon. Otherwise, with `background:pink` the character after the + const propPlusColon = `${decl.toString().slice(0, endOfPropIndex)}xxx`; + + for (let i = 0, l = propPlusColon.length; i < l; i++) { + if (propPlusColon[i] !== ':') { + continue; + } + + const indexToCheck = /^[^\S\r\n]*\/\*/.test(propPlusColon.slice(i + 1)) + ? propPlusColon.indexOf('*/', i) + 1 + : i; + + checker.afterOneOnly({ + source: propPlusColon, + index: indexToCheck, + lineCheckStr: decl.value, + err: (m) => { + if (context.fix) { + const between = decl.raws.between; + + if (between == null) throw new Error('`between` must be present'); + + const betweenStart = declarationValueIndex(decl) - between.length; + const sliceIndex = indexToCheck - betweenStart + 1; + const betweenBefore = between.slice(0, sliceIndex); + const betweenAfter = between.slice(sliceIndex); + + decl.raws.between = /^\s*\n/.test(betweenAfter) + ? betweenBefore + betweenAfter.replace(/^[^\S\r\n]*/, '') + : betweenBefore + context.newline + betweenAfter; + + return; + } + + report({ + message: m, + node: decl, + index: indexToCheck, + result, + ruleName, + }); + }, + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-colon-space-after/index.js b/node_modules/stylelint/lib/rules/declaration-colon-space-after/index.js new file mode 100644 index 000000000..93bda5ffc --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-colon-space-after/index.js @@ -0,0 +1,73 @@ +'use strict'; + +const declarationColonSpaceChecker = require('../declarationColonSpaceChecker'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'declaration-colon-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected single space after ":"', + rejectedAfter: () => 'Unexpected whitespace after ":"', + expectedAfterSingleLine: () => 'Expected single space after ":" with a single-line declaration', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-colon-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never', 'always-single-line'], + }); + + if (!validOptions) { + return; + } + + declarationColonSpaceChecker({ + root, + result, + locationChecker: checker.after, + checkedRuleName: ruleName, + fix: context.fix + ? (decl, index) => { + const colonIndex = index - declarationValueIndex(decl); + const between = decl.raws.between; + + if (between == null) throw new Error('`between` must be present'); + + if (primary.startsWith('always')) { + decl.raws.between = + between.slice(0, colonIndex) + between.slice(colonIndex).replace(/^:\s*/, ': '); + + return true; + } + + if (primary === 'never') { + decl.raws.between = + between.slice(0, colonIndex) + between.slice(colonIndex).replace(/^:\s*/, ':'); + + return true; + } + + return false; + } + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-colon-space-before/index.js b/node_modules/stylelint/lib/rules/declaration-colon-space-before/index.js new file mode 100644 index 000000000..38e896695 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-colon-space-before/index.js @@ -0,0 +1,72 @@ +'use strict'; + +const declarationColonSpaceChecker = require('../declarationColonSpaceChecker'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'declaration-colon-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before ":"', + rejectedBefore: () => 'Unexpected whitespace before ":"', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-colon-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + declarationColonSpaceChecker({ + root, + result, + locationChecker: checker.before, + checkedRuleName: ruleName, + fix: context.fix + ? (decl, index) => { + const colonIndex = index - declarationValueIndex(decl); + const between = decl.raws.between; + + if (between == null) throw new Error('`between` must be present'); + + if (primary === 'always') { + decl.raws.between = + between.slice(0, colonIndex).replace(/\s*$/, ' ') + between.slice(colonIndex); + + return true; + } + + if (primary === 'never') { + decl.raws.between = + between.slice(0, colonIndex).replace(/\s*$/, '') + between.slice(colonIndex); + + return true; + } + + return false; + } + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-empty-line-before/index.js b/node_modules/stylelint/lib/rules/declaration-empty-line-before/index.js new file mode 100644 index 000000000..0837b3bb9 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-empty-line-before/index.js @@ -0,0 +1,155 @@ +'use strict'; + +const addEmptyLineBefore = require('../../utils/addEmptyLineBefore'); +const blockString = require('../../utils/blockString'); +const hasEmptyLine = require('../../utils/hasEmptyLine'); +const isAfterComment = require('../../utils/isAfterComment'); +const isAfterStandardPropertyDeclaration = require('../../utils/isAfterStandardPropertyDeclaration'); +const isCustomProperty = require('../../utils/isCustomProperty'); +const isFirstNested = require('../../utils/isFirstNested'); +const isFirstNodeOfRoot = require('../../utils/isFirstNodeOfRoot'); +const isSingleLineString = require('../../utils/isSingleLineString'); +const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); +const optionsMatches = require('../../utils/optionsMatches'); +const removeEmptyLinesBefore = require('../../utils/removeEmptyLinesBefore'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isAtRule, isRule, isRoot } = require('../../utils/typeGuards'); + +const ruleName = 'declaration-empty-line-before'; + +const messages = ruleMessages(ruleName, { + expected: 'Expected empty line before declaration', + rejected: 'Unexpected empty line before declaration', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-empty-line-before', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['always', 'never'], + }, + { + actual: secondaryOptions, + possible: { + except: ['first-nested', 'after-comment', 'after-declaration'], + ignore: [ + 'after-comment', + 'after-declaration', + 'first-nested', + 'inside-single-line-block', + ], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + const prop = decl.prop; + const parent = decl.parent; + + if (parent == null) { + return; + } + + // Ignore the first node + if (isFirstNodeOfRoot(decl)) { + return; + } + + if (!isAtRule(parent) && !isRule(parent) && !isRoot(parent)) { + return; + } + + if (!isStandardSyntaxDeclaration(decl)) { + return; + } + + if (isCustomProperty(prop)) { + return; + } + + // Optionally ignore the node if a comment precedes it + if (optionsMatches(secondaryOptions, 'ignore', 'after-comment') && isAfterComment(decl)) { + return; + } + + // Optionally ignore the node if a declaration precedes it + if ( + optionsMatches(secondaryOptions, 'ignore', 'after-declaration') && + isAfterStandardPropertyDeclaration(decl) + ) { + return; + } + + // Optionally ignore the node if it is the first nested + if (optionsMatches(secondaryOptions, 'ignore', 'first-nested') && isFirstNested(decl)) { + return; + } + + // Optionally ignore nodes inside single-line blocks + if ( + optionsMatches(secondaryOptions, 'ignore', 'inside-single-line-block') && + isSingleLineString(blockString(parent)) + ) { + return; + } + + let expectEmptyLineBefore = primary === 'always'; + + // Optionally reverse the expectation if any exceptions apply + if ( + (optionsMatches(secondaryOptions, 'except', 'first-nested') && isFirstNested(decl)) || + (optionsMatches(secondaryOptions, 'except', 'after-comment') && isAfterComment(decl)) || + (optionsMatches(secondaryOptions, 'except', 'after-declaration') && + isAfterStandardPropertyDeclaration(decl)) + ) { + expectEmptyLineBefore = !expectEmptyLineBefore; + } + + // Check for at least one empty line + const hasEmptyLineBefore = hasEmptyLine(decl.raws.before); + + // Return if the expectation is met + if (expectEmptyLineBefore === hasEmptyLineBefore) { + return; + } + + // Fix + if (context.fix) { + if (context.newline == null) return; + + if (expectEmptyLineBefore) { + addEmptyLineBefore(decl, context.newline); + } else { + removeEmptyLinesBefore(decl, context.newline); + } + + return; + } + + const message = expectEmptyLineBefore ? messages.expected : messages.rejected; + + report({ message, node: decl, result, ruleName }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-no-important/index.js b/node_modules/stylelint/lib/rules/declaration-no-important/index.js new file mode 100644 index 000000000..b6b16e338 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-no-important/index.js @@ -0,0 +1,52 @@ +'use strict'; + +const getImportantPosition = require('../../utils/getImportantPosition'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { assert } = require('../../utils/validateTypes'); + +const ruleName = 'declaration-no-important'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected !important', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-no-important', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (!decl.important) { + return; + } + + const pos = getImportantPosition(decl.toString()); + + assert(pos); + + report({ + message: messages.rejected, + node: decl, + index: pos.index, + endIndex: pos.endIndex, + result, + ruleName, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-property-max-values/index.js b/node_modules/stylelint/lib/rules/declaration-property-max-values/index.js new file mode 100644 index 000000000..1e57e96c2 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-property-max-values/index.js @@ -0,0 +1,78 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const vendor = require('../../utils/vendor'); +const validateOptions = require('../../utils/validateOptions'); +const { isNumber, assertNumber } = require('../../utils/validateTypes'); +const validateObjectWithProps = require('../../utils/validateObjectWithProps'); + +const ruleName = 'declaration-property-max-values'; + +const messages = ruleMessages(ruleName, { + rejected: (property, max) => + `Expected "${property}" to have no more than ${max} ${max === 1 ? 'value' : 'values'}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-property-max-values', +}; + +/** + * @param {valueParser.Node} node + */ +const isValueNode = (node) => { + return node.type === 'word' || node.type === 'function' || node.type === 'string'; +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [validateObjectWithProps(isNumber)], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + const { prop, value } = decl; + const propLength = valueParser(value).nodes.filter(isValueNode).length; + + const unprefixedProp = vendor.unprefixed(prop); + const propKey = Object.keys(primary).find((propIdentifier) => + matchesStringOrRegExp(unprefixedProp, propIdentifier), + ); + + if (!propKey) { + return; + } + + const max = primary[propKey]; + + assertNumber(max); + + if (propLength <= max) { + return; + } + + report({ + message: messages.rejected, + messageArgs: [prop, max], + node: decl, + result, + ruleName, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-property-unit-allowed-list/index.js b/node_modules/stylelint/lib/rules/declaration-property-unit-allowed-list/index.js new file mode 100644 index 000000000..89453350b --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-property-unit-allowed-list/index.js @@ -0,0 +1,113 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDimension = require('../../utils/getDimension'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); +const validateOptions = require('../../utils/validateOptions'); +const { isString } = require('../../utils/validateTypes'); +const vendor = require('../../utils/vendor'); + +const ruleName = 'declaration-property-unit-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (property, unit) => `Unexpected unit "${unit}" for property "${property}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-property-unit-allowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [validateObjectWithArrayProps(isString)], + }, + { + actual: secondaryOptions, + possible: { + ignore: ['inside-function'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + const prop = decl.prop; + const value = decl.value; + + const unprefixedProp = vendor.unprefixed(prop); + + const propKey = Object.keys(primary).find((propIdentifier) => + matchesStringOrRegExp(unprefixedProp, propIdentifier), + ); + + if (!propKey) { + return; + } + + const propValue = primary[propKey]; + + if (!propValue) { + return; + } + + const propList = new Set([propValue].flat()); + + valueParser(value).walk((node) => { + // Ignore wrong units within `url` function + if (node.type === 'function') { + if (node.value.toLowerCase() === 'url') { + return false; + } + + if (optionsMatches(secondaryOptions, 'ignore', 'inside-function')) { + return false; + } + } + + if (node.type === 'string') { + return; + } + + const { unit } = getDimension(node); + + if (!unit || propList.has(unit.toLowerCase())) { + return; + } + + const index = declarationValueIndex(decl) + node.sourceIndex; + const endIndex = index + node.value.length; + + report({ + message: messages.rejected, + messageArgs: [prop, unit], + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-property-unit-disallowed-list/index.js b/node_modules/stylelint/lib/rules/declaration-property-unit-disallowed-list/index.js new file mode 100644 index 000000000..6b13e30a5 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-property-unit-disallowed-list/index.js @@ -0,0 +1,95 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDimension = require('../../utils/getDimension'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); +const validateOptions = require('../../utils/validateOptions'); +const { isString } = require('../../utils/validateTypes'); +const vendor = require('../../utils/vendor'); + +const ruleName = 'declaration-property-unit-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (property, unit) => `Unexpected unit "${unit}" for property "${property}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-property-unit-disallowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [validateObjectWithArrayProps(isString)], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + const prop = decl.prop; + const value = decl.value; + + const unprefixedProp = vendor.unprefixed(prop); + + const propKey = Object.keys(primary).find((propIdentifier) => + matchesStringOrRegExp(unprefixedProp, propIdentifier), + ); + + if (!propKey) { + return; + } + + const propValue = primary[propKey]; + + if (!propValue) { + return; + } + + const propList = new Set([propValue].flat()); + + valueParser(value).walk((node) => { + // Ignore wrong units within `url` function + if (node.type === 'function' && node.value.toLowerCase() === 'url') { + return false; + } + + if (node.type === 'string') { + return; + } + + const { unit } = getDimension(node); + + if (!unit || !propList.has(unit.toLowerCase())) { + return; + } + + const index = declarationValueIndex(decl) + node.sourceIndex; + const endIndex = index + node.value.length; + + report({ + message: messages.rejected, + messageArgs: [prop, unit], + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-property-value-allowed-list/index.js b/node_modules/stylelint/lib/rules/declaration-property-value-allowed-list/index.js new file mode 100644 index 000000000..5f52e3f16 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-property-value-allowed-list/index.js @@ -0,0 +1,70 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); +const validateOptions = require('../../utils/validateOptions'); +const { isString, isRegExp } = require('../../utils/validateTypes'); +const vendor = require('../../utils/vendor'); + +const ruleName = 'declaration-property-value-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (property, value) => `Unexpected value "${value}" for property "${property}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-property-value-allowed-list', +}; + +/** @type {import('stylelint').Rule>>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [validateObjectWithArrayProps(isString, isRegExp)], + }); + + if (!validOptions) { + return; + } + + const propKeys = Object.keys(primary); + + root.walkDecls((decl) => { + const { prop, value } = decl; + + const unprefixedProp = vendor.unprefixed(prop); + const propPatterns = propKeys.filter((key) => matchesStringOrRegExp(unprefixedProp, key)); + + if (propPatterns.length === 0) { + return; + } + + if (propPatterns.some((pattern) => optionsMatches(primary, pattern, value))) { + return; + } + + const index = declarationValueIndex(decl); + const endIndex = index + decl.value.length; + + report({ + message: messages.rejected, + messageArgs: [prop, value], + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-property-value-disallowed-list/index.js b/node_modules/stylelint/lib/rules/declaration-property-value-disallowed-list/index.js new file mode 100644 index 000000000..b7bd7439d --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-property-value-disallowed-list/index.js @@ -0,0 +1,70 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); +const validateOptions = require('../../utils/validateOptions'); +const { isString, isRegExp } = require('../../utils/validateTypes'); +const vendor = require('../../utils/vendor'); + +const ruleName = 'declaration-property-value-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (property, value) => `Unexpected value "${value}" for property "${property}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-property-value-disallowed-list', +}; + +/** @type {import('stylelint').Rule>>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [validateObjectWithArrayProps(isString, isRegExp)], + }); + + if (!validOptions) { + return; + } + + const propKeys = Object.keys(primary); + + root.walkDecls((decl) => { + const { prop, value } = decl; + + const unprefixedProp = vendor.unprefixed(prop); + const propPatterns = propKeys.filter((key) => matchesStringOrRegExp(unprefixedProp, key)); + + if (propPatterns.length === 0) { + return; + } + + if (propPatterns.every((pattern) => !optionsMatches(primary, pattern, value))) { + return; + } + + const index = declarationValueIndex(decl); + const endIndex = index + decl.value.length; + + report({ + message: messages.rejected, + messageArgs: [prop, value], + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-property-value-no-unknown/index.js b/node_modules/stylelint/lib/rules/declaration-property-value-no-unknown/index.js new file mode 100644 index 000000000..46153e672 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declaration-property-value-no-unknown/index.js @@ -0,0 +1,166 @@ +'use strict'; + +const { isPlainObject } = require('is-plain-object'); +const { fork, parse, find } = require('css-tree'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); +const isCustomProperty = require('../../utils/isCustomProperty'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); +const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); +const { isAtRule } = require('../../utils/typeGuards'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'declaration-property-value-no-unknown'; + +const messages = ruleMessages(ruleName, { + rejected: (property, value) => `Unexpected unknown value "${value}" for property "${property}"`, + rejectedParseError: (property, value) => + `Cannot parse property value "${value}" for property "${property}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/declaration-property-value-no-unknown', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignoreProperties: [validateObjectWithArrayProps(isString, isRegExp)], + propertiesSyntax: [isPlainObject], + typesSyntax: [isPlainObject], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const ignoreProperties = Array.from( + Object.entries((secondaryOptions && secondaryOptions.ignoreProperties) || {}), + ); + + /** @type {(name: string, propValue: string) => boolean} */ + const isPropIgnored = (name, value) => { + const [, valuePattern] = + ignoreProperties.find(([namePattern]) => matchesStringOrRegExp(name, namePattern)) || []; + + return valuePattern && matchesStringOrRegExp(value, valuePattern); + }; + + const propertiesSyntax = (secondaryOptions && secondaryOptions.propertiesSyntax) || {}; + const typesSyntax = (secondaryOptions && secondaryOptions.typesSyntax) || {}; + + const forkedLexer = fork({ + properties: propertiesSyntax, + types: typesSyntax, + }).lexer; + + root.walkDecls((decl) => { + const { prop, value, parent } = decl; + + // NOTE: CSSTree's `fork()` doesn't support `-moz-initial`, but it may be possible in the future. + // See https://github.com/stylelint/stylelint/pull/6511#issuecomment-1412921062 + if (/^-moz-initial$/i.test(value)) return; + + if (!isStandardSyntaxDeclaration(decl)) return; + + if (!isStandardSyntaxProperty(prop)) return; + + if (!isStandardSyntaxValue(value)) return; + + if (isCustomProperty(prop)) return; + + if (isPropIgnored(prop, value)) return; + + /** @type {import('css-tree').CssNode} */ + let cssTreeValueNode; + + try { + cssTreeValueNode = parse(value, { context: 'value' }); + + if (containsUnsupportedFunction(cssTreeValueNode)) return; + } catch (e) { + const index = declarationValueIndex(decl); + const endIndex = index + value.length; + + report({ + message: messages.rejectedParseError(prop, value), + node: decl, + index, + endIndex, + result, + ruleName, + }); + + return; + } + + const { error } = + parent && isAtRule(parent) + ? forkedLexer.matchAtruleDescriptor(parent.name, prop, cssTreeValueNode) + : forkedLexer.matchProperty(prop, cssTreeValueNode); + + if (!error) return; + + if (!('mismatchLength' in error)) return; + + const { mismatchLength, mismatchOffset, name, rawMessage } = error; + + if (name !== 'SyntaxMatchError') return; + + if (rawMessage !== 'Mismatch') return; + + const mismatchValue = value.slice(mismatchOffset, mismatchOffset + mismatchLength); + const index = declarationValueIndex(decl) + mismatchOffset; + const endIndex = index + mismatchLength; + + report({ + message: messages.rejected(prop, mismatchValue), + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + }; +}; + +/** + * TODO: This function avoids false positives because CSSTree doesn't fully support + * some math functions like `clamp()` via `fork()`. In the future, it may be unnecessary. + * + * @see https://github.com/stylelint/stylelint/pull/6511#issuecomment-1412921062 + * @see https://github.com/stylelint/stylelint/issues/6635#issuecomment-1425787649 + * + * @param {import('css-tree').CssNode} cssTreeNode + * @returns {boolean} + */ +function containsUnsupportedFunction(cssTreeNode) { + return Boolean( + find( + cssTreeNode, + (node) => node.type === 'Function' && ['clamp', 'min', 'max', 'env'].includes(node.name), + ), + ); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declarationBangSpaceChecker.js b/node_modules/stylelint/lib/rules/declarationBangSpaceChecker.js new file mode 100644 index 000000000..ad17cd22f --- /dev/null +++ b/node_modules/stylelint/lib/rules/declarationBangSpaceChecker.js @@ -0,0 +1,60 @@ +'use strict'; + +const declarationValueIndex = require('../utils/declarationValueIndex'); +const report = require('../utils/report'); +const styleSearch = require('style-search'); + +/** @typedef {import('postcss').Declaration} Declaration */ + +/** @typedef {(args: { source: string, index: number, err: (message: string) => void }) => void} LocationChecker */ + +/** + * @param {{ + * root: import('postcss').Root, + * locationChecker: LocationChecker, + * result: import('stylelint').PostcssResult, + * checkedRuleName: string, + * fix: ((decl: Declaration, index: number) => boolean) | null, + * }} opts + * @returns {void} + */ +module.exports = function declarationBangSpaceChecker(opts) { + opts.root.walkDecls((decl) => { + const indexOffset = declarationValueIndex(decl); + const declString = decl.toString(); + const valueString = decl.toString().slice(indexOffset); + + if (!valueString.includes('!')) { + return; + } + + styleSearch({ source: valueString, target: '!' }, (match) => { + check(declString, match.startIndex + indexOffset, decl); + }); + }); + + /** + * @param {string} source + * @param {number} index + * @param {Declaration} decl + */ + function check(source, index, decl) { + opts.locationChecker({ + source, + index, + err: (message) => { + if (opts.fix && opts.fix(decl, index)) { + return; + } + + report({ + message, + node: decl, + index, + result: opts.result, + ruleName: opts.checkedRuleName, + }); + }, + }); + } +}; diff --git a/node_modules/stylelint/lib/rules/declarationColonSpaceChecker.js b/node_modules/stylelint/lib/rules/declarationColonSpaceChecker.js new file mode 100644 index 000000000..1f84e1d30 --- /dev/null +++ b/node_modules/stylelint/lib/rules/declarationColonSpaceChecker.js @@ -0,0 +1,57 @@ +'use strict'; + +const declarationValueIndex = require('../utils/declarationValueIndex'); +const isStandardSyntaxDeclaration = require('../utils/isStandardSyntaxDeclaration'); +const report = require('../utils/report'); + +/** @typedef {(args: { source: string, index: number, lineCheckStr: string, err: (message: string) => void }) => void} LocationChecker */ + +/** + * @param {{ + * root: import('postcss').Root, + * locationChecker: LocationChecker, + * fix: ((decl: import('postcss').Declaration, index: number) => boolean) | null, + * result: import('stylelint').PostcssResult, + * checkedRuleName: string, + * }} opts + */ +module.exports = function declarationColonSpaceChecker(opts) { + opts.root.walkDecls((decl) => { + if (!isStandardSyntaxDeclaration(decl)) { + return; + } + + // Get the raw prop, and only the prop + const endOfPropIndex = declarationValueIndex(decl) + (decl.raws.between || '').length - 1; + + // The extra characters tacked onto the end ensure that there is a character to check + // after the colon. Otherwise, with `background:pink` the character after the + const propPlusColon = `${decl.toString().slice(0, endOfPropIndex)}xxx`; + + for (let i = 0, l = propPlusColon.length; i < l; i++) { + if (propPlusColon[i] !== ':') { + continue; + } + + opts.locationChecker({ + source: propPlusColon, + index: i, + lineCheckStr: decl.value, + err: (message) => { + if (opts.fix && opts.fix(decl, i)) { + return; + } + + report({ + message, + node: decl, + index: decl.prop.toString().length + 1, + result: opts.result, + ruleName: opts.checkedRuleName, + }); + }, + }); + break; + } + }); +}; diff --git a/node_modules/stylelint/lib/rules/findMediaOperator.js b/node_modules/stylelint/lib/rules/findMediaOperator.js new file mode 100644 index 000000000..698ea8b0b --- /dev/null +++ b/node_modules/stylelint/lib/rules/findMediaOperator.js @@ -0,0 +1,30 @@ +'use strict'; + +const styleSearch = require('style-search'); + +const rangeOperators = ['>=', '<=', '>', '<', '=']; + +/** @typedef {import('style-search').StyleSearchMatch} StyleSearchMatch */ + +/** + * @template {import('postcss').AtRule} T + * @param {T} atRule + * @param {(match: StyleSearchMatch, params: string, atRule: T) => void} cb + */ +module.exports = function findMediaOperator(atRule, cb) { + if (atRule.name.toLowerCase() !== 'media') { + return; + } + + const params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; + + styleSearch({ source: params, target: rangeOperators }, (match) => { + const before = params[match.startIndex - 1]; + + if (before === '>' || before === '<') { + return; + } + + cb(match, params, atRule); + }); +}; diff --git a/node_modules/stylelint/lib/rules/font-family-name-quotes/index.js b/node_modules/stylelint/lib/rules/font-family-name-quotes/index.js new file mode 100644 index 000000000..ba4d58e1b --- /dev/null +++ b/node_modules/stylelint/lib/rules/font-family-name-quotes/index.js @@ -0,0 +1,269 @@ +'use strict'; + +const findFontFamily = require('../../utils/findFontFamily'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const isVariable = require('../../utils/isVariable'); +const { fontFamilyKeywords } = require('../../reference/keywords'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'font-family-name-quotes'; + +const messages = ruleMessages(ruleName, { + expected: (family) => `Expected quotes around "${family}"`, + rejected: (family) => `Unexpected quotes around "${family}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/font-family-name-quotes', + fixable: true, +}; + +/** + * @param {string} font + * @returns {boolean} + */ +function isSystemFontKeyword(font) { + if (font.startsWith('-apple-')) { + return true; + } + + if (font === 'BlinkMacSystemFont') { + return true; + } + + return false; +} + +/** + * "To avoid mistakes in escaping, it is recommended to quote font family names + * that contain white space, digits, or punctuation characters other than hyphens" + * (https://www.w3.org/TR/CSS2/fonts.html#font-family-prop) + * + * @param {string} family + * @returns {boolean} + */ +function quotesRecommended(family) { + return !/^[-a-zA-Z]+$/.test(family); +} + +/** + * Quotes are required if the family is not a valid CSS identifier + * (regexes from https://mathiasbynens.be/notes/unquoted-font-family) + * + * @param {string} family + * @returns {boolean} + */ +function quotesRequired(family) { + return family + .split(/\s+/) + .some((word) => /^(?:-?\d|--)/.test(word) || !/^[-\w\u{00A0}-\u{10FFFF}]+$/u.test(word)); +} + +/** + * @typedef {{ + * name: string, + * rawName: string, + * hasQuotes: boolean, + * sourceIndex: number, + * resetIndexes: (offset: number) => void, + * removeQuotes: () => void, + * addQuotes: () => void, + * }} MutableNode + */ + +/** + * + * @param {import('postcss-value-parser').Node[]} fontFamilies + * @param {import('postcss').Declaration} decl + * @returns {MutableNode[]} + */ +const makeMutableFontFamilies = (fontFamilies, decl) => { + /** + * @type {MutableNode[]} + */ + const mutableNodes = []; + + fontFamilies.forEach((fontFamily, idx) => { + const quote = 'quote' in fontFamily && fontFamily.quote; + const name = fontFamily.value; + + /** @type {MutableNode} */ + const newNode = { + name, + rawName: quote ? `${quote}${name}${quote}` : name, + sourceIndex: fontFamily.sourceIndex, + hasQuotes: Boolean(quote), + resetIndexes(offset) { + mutableNodes.slice(idx + 1).forEach((n) => (n.sourceIndex += offset)); + }, + removeQuotes() { + if (this.hasQuotes === false) return; + + const openIndex = this.sourceIndex; + const closeIndex = openIndex + this.name.length + 2; + + this.hasQuotes = false; + decl.value = decl.value.slice(0, openIndex) + this.name + decl.value.substring(closeIndex); + this.resetIndexes(-2); + }, + addQuotes() { + if (this.hasQuotes === true) return; + + const openIndex = this.sourceIndex; + const closeIndex = openIndex + this.name.length; + + this.hasQuotes = true; + const fixedName = `"${this.name}"`; + + decl.value = decl.value.slice(0, openIndex) + fixedName + decl.value.substring(closeIndex); + this.resetIndexes(2); + }, + }; + + mutableNodes.push(newNode); + }); + + return mutableNodes; +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondary, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always-where-required', 'always-where-recommended', 'always-unless-keyword'], + }); + + if (!validOptions) { + return; + } + + root.walkDecls(/^font(-family)?$/i, (decl) => { + if (!isStandardSyntaxValue(decl.value)) { + return; + } + + let fontFamilyNodes = makeMutableFontFamilies(findFontFamily(decl.value), decl); + + if (fontFamilyNodes.length === 0) { + return; + } + + for (const fontFamilyNode of fontFamilyNodes) { + checkFamilyName(fontFamilyNode, decl); + } + }); + + /** + * @param {MutableNode} fontFamilyNode + * @param {import('postcss').Declaration} decl + */ + function checkFamilyName(fontFamilyNode, decl) { + const { name: family, rawName: rawFamily, hasQuotes } = fontFamilyNode; + + if (isVariable(rawFamily)) { + return; + } + + // Disallow quotes around (case-insensitive) keywords + // and system font keywords in all cases + if (fontFamilyKeywords.has(family.toLowerCase()) || isSystemFontKeyword(family)) { + if (hasQuotes) { + if (context.fix) { + fontFamilyNode.removeQuotes(); + + return; + } + + return complain(messages.rejected(family), rawFamily, decl); + } + + return; + } + + const required = quotesRequired(family); + const recommended = quotesRecommended(family); + + switch (primary) { + case 'always-unless-keyword': + if (!hasQuotes) { + if (context.fix) { + fontFamilyNode.addQuotes(); + + return; + } + + return complain(messages.expected(family), rawFamily, decl); + } + + return; + + case 'always-where-recommended': + if (!recommended && hasQuotes) { + if (context.fix) { + fontFamilyNode.removeQuotes(); + + return; + } + + return complain(messages.rejected(family), rawFamily, decl); + } + + if (recommended && !hasQuotes) { + if (context.fix) { + fontFamilyNode.addQuotes(); + + return; + } + + return complain(messages.expected(family), rawFamily, decl); + } + + return; + + case 'always-where-required': + if (!required && hasQuotes) { + if (context.fix) { + fontFamilyNode.removeQuotes(); + + return; + } + + return complain(messages.rejected(family), rawFamily, decl); + } + + if (required && !hasQuotes) { + if (context.fix) { + fontFamilyNode.addQuotes(); + + return; + } + + return complain(messages.expected(family), rawFamily, decl); + } + } + } + + /** + * @param {string} message + * @param {string} family + * @param {import('postcss').Declaration} decl + */ + function complain(message, family, decl) { + report({ + result, + ruleName, + message, + node: decl, + word: family, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/font-family-no-duplicate-names/index.js b/node_modules/stylelint/lib/rules/font-family-no-duplicate-names/index.js new file mode 100644 index 000000000..6ec11f071 --- /dev/null +++ b/node_modules/stylelint/lib/rules/font-family-no-duplicate-names/index.js @@ -0,0 +1,122 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const findFontFamily = require('../../utils/findFontFamily'); +const { fontFamilyKeywords } = require('../../reference/keywords'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'font-family-no-duplicate-names'; + +const messages = ruleMessages(ruleName, { + rejected: (name) => `Unexpected duplicate name ${name}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/font-family-no-duplicate-names', +}; + +/** + * @param {import('postcss-value-parser').Node} node + */ +const isFamilyNameKeyword = (node) => + !('quote' in node) && fontFamilyKeywords.has(node.value.toLowerCase()); + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignoreFontFamilyNames: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkDecls(/^font(-family)?$/i, (decl) => { + const keywords = new Set(); + const familyNames = new Set(); + + const fontFamilies = findFontFamily(decl.value); + + if (fontFamilies.length === 0) { + return; + } + + for (const fontFamilyNode of fontFamilies) { + const family = fontFamilyNode.value.trim(); + + if (optionsMatches(secondaryOptions, 'ignoreFontFamilyNames', family)) { + continue; + } + + const rawFamily = + 'quote' in fontFamilyNode ? fontFamilyNode.quote + family + fontFamilyNode.quote : family; + + if (isFamilyNameKeyword(fontFamilyNode)) { + if (keywords.has(family.toLowerCase())) { + complain( + messages.rejected(family), + declarationValueIndex(decl) + fontFamilyNode.sourceIndex, + rawFamily.length, + decl, + ); + + continue; + } + + keywords.add(family); + + continue; + } + + if (familyNames.has(family)) { + complain( + messages.rejected(family), + declarationValueIndex(decl) + fontFamilyNode.sourceIndex, + rawFamily.length, + decl, + ); + + continue; + } + + familyNames.add(family); + } + }); + + /** + * @param {string} message + * @param {number} index + * @param {number} length + * @param {import('postcss').Declaration} decl + */ + function complain(message, index, length, decl) { + report({ + result, + ruleName, + message, + node: decl, + index, + endIndex: index + length, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/font-family-no-missing-generic-family-keyword/index.js b/node_modules/stylelint/lib/rules/font-family-no-missing-generic-family-keyword/index.js new file mode 100644 index 000000000..846a469b8 --- /dev/null +++ b/node_modules/stylelint/lib/rules/font-family-no-missing-generic-family-keyword/index.js @@ -0,0 +1,120 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const findFontFamily = require('../../utils/findFontFamily'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const isVariable = require('../../utils/isVariable'); +const { systemFontKeywords, fontFamilyKeywords } = require('../../reference/keywords'); +const optionsMatches = require('../../utils/optionsMatches'); +const postcss = require('postcss'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isAtRule } = require('../../utils/typeGuards'); +const { isRegExp, isString, assert } = require('../../utils/validateTypes'); + +const ruleName = 'font-family-no-missing-generic-family-keyword'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected missing generic font family', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/font-family-no-missing-generic-family-keyword', +}; + +/** + * @param {import('postcss-value-parser').Node} node + * @returns {boolean} + */ +const isFamilyNameKeyword = (node) => + !('quote' in node) && fontFamilyKeywords.has(node.value.toLowerCase()); + +/** + * @param {string} value + * @returns {boolean} + */ +const isLastFontFamilyVariable = (value) => { + const lastValue = postcss.list.comma(value).pop(); + + return lastValue != null && (isVariable(lastValue) || !isStandardSyntaxValue(lastValue)); +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignoreFontFamilies: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkDecls(/^font(-family)?$/i, (decl) => { + // Ignore @font-face + const parent = decl.parent; + + if (parent && isAtRule(parent) && parent.name.toLowerCase() === 'font-face') { + return; + } + + if (decl.prop === 'font' && systemFontKeywords.has(decl.value.toLowerCase())) { + return; + } + + if (isLastFontFamilyVariable(decl.value)) { + return; + } + + const fontFamilies = findFontFamily(decl.value); + + if (fontFamilies.length === 0) { + return; + } + + if (fontFamilies.some((node) => isFamilyNameKeyword(node))) { + return; + } + + if ( + fontFamilies.some((node) => + optionsMatches(secondaryOptions, 'ignoreFontFamilies', node.value), + ) + ) { + return; + } + + const lastFontFamily = fontFamilies[fontFamilies.length - 1]; + + assert(lastFontFamily); + + const valueIndex = declarationValueIndex(decl); + const index = valueIndex + lastFontFamily.sourceIndex; + const endIndex = valueIndex + lastFontFamily.sourceEndIndex; + + report({ + result, + ruleName, + message: messages.rejected, + node: decl, + index, + endIndex, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/font-weight-notation/index.js b/node_modules/stylelint/lib/rules/font-weight-notation/index.js new file mode 100644 index 000000000..f16c6774f --- /dev/null +++ b/node_modules/stylelint/lib/rules/font-weight-notation/index.js @@ -0,0 +1,214 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const isNumbery = require('../../utils/isNumbery'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const isVariable = require('../../utils/isVariable'); +const { + fontWeightNonNumericKeywords, + fontWeightRelativeKeywords, +} = require('../../reference/keywords'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const { assertString } = require('../../utils/validateTypes'); + +const ruleName = 'font-weight-notation'; + +const messages = ruleMessages(ruleName, { + expected: (type) => `Expected ${type} font-weight notation`, + expectedWithActual: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/font-weight-notation', + fixable: true, +}; + +const NORMAL_KEYWORD = 'normal'; + +const NAMED_TO_NUMERIC = new Map([ + ['normal', '400'], + ['bold', '700'], +]); +const NUMERIC_TO_NAMED = new Map([ + ['400', 'normal'], + ['700', 'bold'], +]); + +/** @type {import('stylelint').Rule<'numeric' | 'named-where-possible'>} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['numeric', 'named-where-possible'], + }, + { + actual: secondaryOptions, + possible: { + ignore: ['relative'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const ignoreRelative = optionsMatches(secondaryOptions, 'ignore', 'relative'); + + root.walkDecls(/^font(-weight)?$/i, (decl) => { + const isFontShorthandProp = decl.prop.toLowerCase() === 'font'; + + const parsedValue = valueParser(getDeclarationValue(decl)); + const valueNodes = parsedValue.nodes; + + const hasNumericFontWeight = valueNodes.some((node, index, nodes) => { + return isNumbery(node.value) && !isDivNode(nodes[index - 1]); + }); + + for (const [index, valueNode] of valueNodes.entries()) { + if (!isPossibleFontWeightNode(valueNode, index, valueNodes)) continue; + + const { value } = valueNode; + + if (isFontShorthandProp) { + if (value.toLowerCase() === NORMAL_KEYWORD && hasNumericFontWeight) { + continue; // Not `normal` for font-weight + } + + if (checkWeight(decl, valueNode)) { + break; // Stop traverse if font-weight is processed + } + } + + checkWeight(decl, valueNode); + } + + if (context.fix) { + // Autofix after the loop ends can prevent value nodes from changing their positions during the loop. + setDeclarationValue(decl, parsedValue.toString()); + } + }); + + /** + * @param {import('postcss').Declaration} decl + * @param {import('postcss-value-parser').Node} weightValueNode + * @returns {true | undefined} + */ + function checkWeight(decl, weightValueNode) { + const weightValue = weightValueNode.value; + + if (!isStandardSyntaxValue(weightValue)) { + return; + } + + if (isVariable(weightValue)) { + return; + } + + const lowerWeightValue = weightValue.toLowerCase(); + + if (ignoreRelative && fontWeightRelativeKeywords.has(lowerWeightValue)) { + return; + } + + if (primary === 'numeric') { + if (!isNumbery(lowerWeightValue) && fontWeightNonNumericKeywords.has(lowerWeightValue)) { + const numericValue = NAMED_TO_NUMERIC.get(lowerWeightValue); + + if (context.fix) { + if (numericValue) { + weightValueNode.value = numericValue; + + return true; + } + } + + const msg = numericValue + ? messages.expectedWithActual(weightValue, numericValue) + : messages.expected('numeric'); + + complain(msg, weightValueNode); + + return true; + } + } + + if (primary === 'named-where-possible') { + if (isNumbery(lowerWeightValue) && NUMERIC_TO_NAMED.has(lowerWeightValue)) { + const namedValue = NUMERIC_TO_NAMED.get(lowerWeightValue); + + assertString(namedValue); + + if (context.fix) { + weightValueNode.value = namedValue; + + return true; + } + + complain(messages.expectedWithActual(weightValue, namedValue), weightValueNode); + + return true; + } + } + + /** + * @param {string} message + * @param {import('postcss-value-parser').Node} valueNode + */ + function complain(message, valueNode) { + const index = declarationValueIndex(decl) + valueNode.sourceIndex; + const endIndex = index + valueNode.value.length; + + report({ + ruleName, + result, + message, + node: decl, + index, + endIndex, + }); + } + } + }; +}; + +/** + * @param {import('postcss-value-parser').Node | undefined} node + * @returns {boolean} + */ +function isDivNode(node) { + return node !== undefined && node.type === 'div'; +} + +/** + * @param {import('postcss-value-parser').Node} node + * @param {number} index + * @param {import('postcss-value-parser').Node[]} nodes + * @returns {boolean} + */ +function isPossibleFontWeightNode(node, index, nodes) { + if (node.type !== 'word') return false; + + // Exclude `/` format like `16px/3`. + if (isDivNode(nodes[index - 1])) return false; + + if (isDivNode(nodes[index + 1])) return false; + + return true; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-allowed-list/index.js b/node_modules/stylelint/lib/rules/function-allowed-list/index.js new file mode 100644 index 000000000..e74f4d1a0 --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-allowed-list/index.js @@ -0,0 +1,71 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'function-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (name) => `Unexpected function "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-allowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + valueParser(decl.value).walk((node) => { + if (node.type !== 'function') { + return; + } + + if (!isStandardSyntaxFunction(node)) { + return; + } + + if (matchesStringOrRegExp(vendor.unprefixed(node.value), primary)) { + return; + } + + const index = declarationValueIndex(decl) + node.sourceIndex; + const endIndex = index + node.value.length; + + report({ + message: messages.rejected, + messageArgs: [node.value], + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-calc-no-unspaced-operator/index.js b/node_modules/stylelint/lib/rules/function-calc-no-unspaced-operator/index.js new file mode 100644 index 000000000..0e7c00f07 --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-calc-no-unspaced-operator/index.js @@ -0,0 +1,381 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const { assert } = require('../../utils/validateTypes'); + +const ruleName = 'function-calc-no-unspaced-operator'; + +const messages = ruleMessages(ruleName, { + expectedBefore: (operator) => `Expected single space before "${operator}" operator`, + expectedAfter: (operator) => `Expected single space after "${operator}" operator`, + expectedOperatorBeforeSign: (operator) => `Expected an operator before sign "${operator}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-calc-no-unspaced-operator', + fixable: true, +}; + +const OPERATORS = new Set(['+', '-']); +const OPERATOR_REGEX = /[+-]/; +const ALL_OPERATORS = new Set([...OPERATORS, '*', '/']); + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) return; + + /** + * @param {string} message + * @param {import('postcss').Node} node + * @param {number} index + * @param {string} operator + */ + function complain(message, node, index, operator) { + const endIndex = index + operator.length; + + report({ message, node, index, endIndex, result, ruleName }); + } + + root.walkDecls((decl) => { + const value = getDeclarationValue(decl); + + if (!OPERATOR_REGEX.test(value)) return; + + let needsFix = false; + const valueIndex = declarationValueIndex(decl); + const parsedValue = valueParser(value); + + /** + * @param {import('postcss-value-parser').Node} operatorNode + * @param {import('postcss-value-parser').Node} currentNode + * @param {boolean} isBeforeOp + */ + function checkAroundOperator(operatorNode, currentNode, isBeforeOp) { + const operator = operatorNode.value; + const operatorSourceIndex = operatorNode.sourceIndex; + + if (currentNode && !isSingleSpace(currentNode)) { + if (currentNode.type === 'word') { + if (isBeforeOp) { + const lastChar = currentNode.value.slice(-1); + + if (OPERATORS.has(lastChar)) { + if (context.fix) { + currentNode.value = `${currentNode.value.slice(0, -1)} ${lastChar}`; + + return true; + } + + complain( + messages.expectedOperatorBeforeSign(operator), + decl, + operatorSourceIndex, + operator, + ); + + return true; + } + } else { + const firstChar = currentNode.value.slice(0, 1); + + if (OPERATORS.has(firstChar)) { + if (context.fix) { + currentNode.value = `${firstChar} ${currentNode.value.slice(1)}`; + + return true; + } + + complain(messages.expectedAfter(operator), decl, operatorSourceIndex, operator); + + return true; + } + } + + if (context.fix) { + needsFix = true; + currentNode.value = isBeforeOp ? `${currentNode.value} ` : ` ${currentNode.value}`; + + return true; + } + + complain( + isBeforeOp ? messages.expectedBefore(operator) : messages.expectedAfter(operator), + decl, + valueIndex + operatorSourceIndex, + operator, + ); + + return true; + } + + if (currentNode.type === 'space') { + const indexOfFirstNewLine = currentNode.value.search(/(\n|\r\n)/); + + if (indexOfFirstNewLine === 0) return; + + if (context.fix) { + needsFix = true; + currentNode.value = + indexOfFirstNewLine === -1 ? ' ' : currentNode.value.slice(indexOfFirstNewLine); + + return true; + } + + const message = isBeforeOp + ? messages.expectedBefore(operator) + : messages.expectedAfter(operator); + + complain(message, decl, valueIndex + operatorSourceIndex, operator); + + return true; + } + + if (currentNode.type === 'function') { + if (context.fix) { + needsFix = true; + currentNode.value = isBeforeOp ? `${currentNode.value} ` : ` ${currentNode.value}`; + + return true; + } + + const message = isBeforeOp + ? messages.expectedBefore(operator) + : messages.expectedAfter(operator); + + complain(message, decl, valueIndex + operatorSourceIndex, operator); + + return true; + } + } + + return false; + } + + /** + * @param {import('postcss-value-parser').Node[]} nodes + */ + function checkForOperatorInFirstNode(nodes) { + const firstNode = nodes[0]; + + assert(firstNode); + + if (firstNode.type !== 'word') return false; + + if (!isStandardSyntaxValue(firstNode.value)) return false; + + const operatorIndex = firstNode.value.search(OPERATOR_REGEX); + const operator = firstNode.value.slice(operatorIndex, operatorIndex + 1); + + if (operatorIndex <= 0) return false; + + const charBefore = firstNode.value.charAt(operatorIndex - 1); + const charAfter = firstNode.value.charAt(operatorIndex + 1); + + if (charBefore && charBefore !== ' ' && charAfter && charAfter !== ' ') { + if (context.fix) { + needsFix = true; + firstNode.value = insertCharAtIndex(firstNode.value, operatorIndex + 1, ' '); + firstNode.value = insertCharAtIndex(firstNode.value, operatorIndex, ' '); + } else { + complain( + messages.expectedBefore(operator), + decl, + valueIndex + firstNode.sourceIndex + operatorIndex, + operator, + ); + complain( + messages.expectedAfter(operator), + decl, + valueIndex + firstNode.sourceIndex + operatorIndex + 1, + operator, + ); + } + } else if (charBefore && charBefore !== ' ') { + if (context.fix) { + needsFix = true; + firstNode.value = insertCharAtIndex(firstNode.value, operatorIndex, ' '); + } else { + complain( + messages.expectedBefore(operator), + decl, + valueIndex + firstNode.sourceIndex + operatorIndex, + operator, + ); + } + } else if (charAfter && charAfter !== ' ') { + if (context.fix) { + needsFix = true; + firstNode.value = insertCharAtIndex(firstNode.value, operatorIndex, ' '); + } else { + complain( + messages.expectedAfter(operator), + decl, + valueIndex + firstNode.sourceIndex + operatorIndex + 1, + operator, + ); + } + } + + return true; + } + + /** + * @param {import('postcss-value-parser').Node[]} nodes + */ + function checkForOperatorInLastNode(nodes) { + if (nodes.length === 1) return false; + + const lastNode = nodes[nodes.length - 1]; + + assert(lastNode); + + if (lastNode.type !== 'word') return false; + + const operatorIndex = lastNode.value.search(OPERATOR_REGEX); + + if (operatorIndex === -1) return false; + + if (lastNode.value.charAt(operatorIndex - 1) === ' ') return false; + + // E.g. "10px * -2" when the last node is "-2" + if ( + isOperator(nodes[nodes.length - 3], ALL_OPERATORS) && + isSingleSpace(nodes[nodes.length - 2]) + ) { + return false; + } + + if (context.fix) { + needsFix = true; + lastNode.value = insertCharAtIndex(lastNode.value, operatorIndex + 1, ' ').trim(); + lastNode.value = insertCharAtIndex(lastNode.value, operatorIndex, ' ').trim(); + + return true; + } + + const operator = lastNode.value.charAt(operatorIndex); + + complain( + messages.expectedOperatorBeforeSign(operator), + decl, + valueIndex + lastNode.sourceIndex + operatorIndex, + operator, + ); + + return true; + } + + /** + * @param {import('postcss-value-parser').Node[]} nodes + */ + function checkWords(nodes) { + if (checkForOperatorInFirstNode(nodes) || checkForOperatorInLastNode(nodes)) return; + + for (const [index, node] of nodes.entries()) { + const lastChar = node.value.slice(-1); + const firstChar = node.value.slice(0, 1); + + if (node.type === 'word') { + if (index === 0 && OPERATORS.has(lastChar)) { + if (context.fix) { + node.value = `${node.value.slice(0, -1)} ${lastChar}`; + + continue; + } + + complain(messages.expectedBefore(lastChar), decl, node.sourceIndex, lastChar); + } else if (index === nodes.length && OPERATORS.has(firstChar)) { + if (context.fix) { + node.value = `${firstChar} ${node.value.slice(1)}`; + + continue; + } + + complain( + messages.expectedOperatorBeforeSign(firstChar), + decl, + node.sourceIndex, + firstChar, + ); + } + } + } + } + + parsedValue.walk((node) => { + if (node.type !== 'function' || node.value.toLowerCase() !== 'calc') return; + + const { nodes } = node; + + if (!nodes.length) return; + + let foundOperatorNode = false; + + for (const [nodeIndex, currNode] of nodes.entries()) { + if (!isOperator(currNode)) continue; + + foundOperatorNode = true; + + const nodeBefore = nodes[nodeIndex - 1]; + const nodeAfter = nodes[nodeIndex + 1]; + + if (isSingleSpace(nodeBefore) && isSingleSpace(nodeAfter)) continue; + + if (nodeAfter && checkAroundOperator(currNode, nodeAfter, false)) continue; + + nodeBefore && checkAroundOperator(currNode, nodeBefore, true); + } + + if (!foundOperatorNode) { + checkWords(nodes); + } + }); + + if (needsFix) { + setDeclarationValue(decl, parsedValue.toString()); + } + }); + }; +}; + +/** + * @param {string} str + * @param {number} index + * @param {string} char + */ +function insertCharAtIndex(str, index, char) { + return str.slice(0, index) + char + str.slice(index, str.length); +} + +/** + * @param {import('postcss-value-parser').Node | undefined} node + * @returns {node is import('postcss-value-parser').SpaceNode & { value: ' ' } } + */ +function isSingleSpace(node) { + return node != null && node.type === 'space' && node.value === ' '; +} + +/** + * @param {import('postcss-value-parser').Node | undefined} node + * @param {Set} [operators] + * @returns {node is import('postcss-value-parser').WordNode} + */ +function isOperator(node, operators = OPERATORS) { + return node != null && node.type === 'word' && operators.has(node.value); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-comma-newline-after/index.js b/node_modules/stylelint/lib/rules/function-comma-newline-after/index.js new file mode 100644 index 000000000..1852dc22c --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-comma-newline-after/index.js @@ -0,0 +1,60 @@ +'use strict'; + +const fixer = require('../functionCommaSpaceFix'); +const functionCommaSpaceChecker = require('../functionCommaSpaceChecker'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'function-comma-newline-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected newline after ","', + expectedAfterMultiLine: () => 'Expected newline after "," in a multi-line function', + rejectedAfterMultiLine: () => 'Unexpected whitespace after "," in a multi-line function', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-comma-newline-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line', 'never-multi-line'], + }); + + if (!validOptions) { + return; + } + + functionCommaSpaceChecker({ + root, + result, + locationChecker: checker.afterOneOnly, + checkedRuleName: ruleName, + fix: context.fix + ? (div, index, nodes) => + fixer({ + div, + index, + nodes, + expectation: primary, + position: 'after', + symb: context.newline || '', + }) + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-comma-newline-before/index.js b/node_modules/stylelint/lib/rules/function-comma-newline-before/index.js new file mode 100644 index 000000000..a94d55bfd --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-comma-newline-before/index.js @@ -0,0 +1,60 @@ +'use strict'; + +const fixer = require('../functionCommaSpaceFix'); +const functionCommaSpaceChecker = require('../functionCommaSpaceChecker'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'function-comma-newline-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected newline before ","', + expectedBeforeMultiLine: () => 'Expected newline before "," in a multi-line function', + rejectedBeforeMultiLine: () => 'Unexpected whitespace before "," in a multi-line function', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-comma-newline-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line', 'never-multi-line'], + }); + + if (!validOptions) { + return; + } + + functionCommaSpaceChecker({ + root, + result, + locationChecker: checker.beforeAllowingIndentation, + checkedRuleName: ruleName, + fix: context.fix + ? (div, index, nodes) => + fixer({ + div, + index, + nodes, + expectation: primary, + position: 'before', + symb: context.newline || '', + }) + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-comma-space-after/index.js b/node_modules/stylelint/lib/rules/function-comma-space-after/index.js new file mode 100644 index 000000000..3f4d4122c --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-comma-space-after/index.js @@ -0,0 +1,61 @@ +'use strict'; + +const fixer = require('../functionCommaSpaceFix'); +const functionCommaSpaceChecker = require('../functionCommaSpaceChecker'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'function-comma-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected single space after ","', + rejectedAfter: () => 'Unexpected whitespace after ","', + expectedAfterSingleLine: () => 'Expected single space after "," in a single-line function', + rejectedAfterSingleLine: () => 'Unexpected whitespace after "," in a single-line function', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-comma-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never', 'always-single-line', 'never-single-line'], + }); + + if (!validOptions) { + return; + } + + functionCommaSpaceChecker({ + root, + result, + locationChecker: checker.after, + checkedRuleName: ruleName, + fix: context.fix + ? (div, index, nodes) => + fixer({ + div, + index, + nodes, + expectation: primary, + position: 'after', + symb: ' ', + }) + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-comma-space-before/index.js b/node_modules/stylelint/lib/rules/function-comma-space-before/index.js new file mode 100644 index 000000000..ca97bcc26 --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-comma-space-before/index.js @@ -0,0 +1,61 @@ +'use strict'; + +const fixer = require('../functionCommaSpaceFix'); +const functionCommaSpaceChecker = require('../functionCommaSpaceChecker'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'function-comma-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before ","', + rejectedBefore: () => 'Unexpected whitespace before ","', + expectedBeforeSingleLine: () => 'Expected single space before "," in a single-line function', + rejectedBeforeSingleLine: () => 'Unexpected whitespace before "," in a single-line function', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-comma-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never', 'always-single-line', 'never-single-line'], + }); + + if (!validOptions) { + return; + } + + functionCommaSpaceChecker({ + root, + result, + locationChecker: checker.before, + checkedRuleName: ruleName, + fix: context.fix + ? (div, index, nodes) => + fixer({ + div, + index, + nodes, + expectation: primary, + position: 'before', + symb: ' ', + }) + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-disallowed-list/index.js b/node_modules/stylelint/lib/rules/function-disallowed-list/index.js new file mode 100644 index 000000000..fa8c7f249 --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-disallowed-list/index.js @@ -0,0 +1,71 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'function-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (name) => `Unexpected function "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-disallowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + valueParser(decl.value).walk((node) => { + if (node.type !== 'function') { + return; + } + + if (!isStandardSyntaxFunction(node)) { + return; + } + + if (!matchesStringOrRegExp(vendor.unprefixed(node.value), primary)) { + return; + } + + const index = declarationValueIndex(decl) + node.sourceIndex; + const endIndex = index + node.value.length; + + report({ + message: messages.rejected, + messageArgs: [node.value], + node: decl, + index, + endIndex, + result, + ruleName, + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-linear-gradient-no-nonstandard-direction/index.js b/node_modules/stylelint/lib/rules/function-linear-gradient-no-nonstandard-direction/index.js new file mode 100644 index 000000000..f97679b2a --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-linear-gradient-no-nonstandard-direction/index.js @@ -0,0 +1,140 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const functionArgumentsSearch = require('../../utils/functionArgumentsSearch'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); +const vendor = require('../../utils/vendor'); + +const ruleName = 'function-linear-gradient-no-nonstandard-direction'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected nonstandard direction', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-linear-gradient-no-nonstandard-direction', +}; + +const LINEAR_GRADIENT_FUNCTION = '(?:-webkit-|-moz-|-o-|-ms-)?linear-gradient'; +const LINEAR_GRADIENT_FUNCTION_CALL = new RegExp(`${LINEAR_GRADIENT_FUNCTION}\\(`, 'i'); +const LINEAR_GRADIENT_FUNCTION_NAME = new RegExp(`^${LINEAR_GRADIENT_FUNCTION}$`, 'i'); + +const DIRECTION = /top|left|bottom|right/i; +const DIRECTION_WITH_TO = new RegExp(`^to (${DIRECTION.source})(?: (${DIRECTION.source}))?$`, 'i'); +const DIRECTION_WITHOUT_TO = new RegExp(`^(${DIRECTION.source})(?: (${DIRECTION.source}))?$`, 'i'); + +const DIGIT = /[\d.]/; +const ANGLE = /^[\d.]+(?:deg|grad|rad|turn)$/; +const IN_KEYWORD = /\bin\b/i; + +/** + * @param {string} source + * @param {boolean} withToPrefix + */ +function isStandardDirection(source, withToPrefix) { + const regexp = withToPrefix ? DIRECTION_WITH_TO : DIRECTION_WITHOUT_TO; + + const matches = source.match(regexp); + + if (!matches) { + return false; + } + + if (matches.length === 2) { + return true; + } + + // Cannot repeat side-or-corner, e.g. "to top top" + if (matches.length === 3 && matches[1] !== matches[2]) { + return true; + } + + return false; +} + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (!LINEAR_GRADIENT_FUNCTION_CALL.test(decl.value)) return; + + valueParser(decl.value).walk((valueNode) => { + if (valueNode.type !== 'function') { + return; + } + + functionArgumentsSearch( + valueParser.stringify(valueNode).toLowerCase(), + LINEAR_GRADIENT_FUNCTION_NAME, + (expression, expressionIndex) => { + const args = expression.split(','); + const firstArg = (args[0] || '').trim(); + + // If the first arg is not standard, return early + if (!isStandardSyntaxValue(firstArg)) { + return; + } + + // Ignore gradients with modern syntax that have color space interpolation arguments + if (IN_KEYWORD.test(firstArg)) { + return; + } + + // If the first character is a number, we can assume the user intends an angle + if (DIGIT.test(firstArg.charAt(0))) { + if (ANGLE.test(firstArg)) { + return; + } + + complain(); + + return; + } + + // The first argument may not be a direction: it may be an angle, + // or a color stop (in which case user gets default direction, "to bottom") + // cf. https://drafts.csswg.org/css-images-3/#linear-gradient-syntax + if (!DIRECTION.test(firstArg)) { + return; + } + + const withToPrefix = !vendor.prefix(valueNode.value); + + if (!isStandardDirection(firstArg, withToPrefix)) { + complain(); + } + + function complain() { + const index = declarationValueIndex(decl) + valueNode.sourceIndex + expressionIndex; + const endIndex = index + (args[0] || '').trimEnd().length; + + report({ + message: messages.rejected, + node: decl, + index, + endIndex, + result, + ruleName, + }); + } + }, + ); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-max-empty-lines/index.js b/node_modules/stylelint/lib/rules/function-max-empty-lines/index.js new file mode 100644 index 000000000..c20341375 --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-max-empty-lines/index.js @@ -0,0 +1,113 @@ +'use strict'; + +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); +const { isNumber } = require('../../utils/validateTypes'); + +const ruleName = 'function-max-empty-lines'; + +const messages = ruleMessages(ruleName, { + expected: (max) => `Expected no more than ${max} empty ${max === 1 ? 'line' : 'lines'}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-max-empty-lines', + fixable: true, + deprecated: true, +}; + +/** + * @param {import('postcss').Declaration} decl + */ +function placeIndexOnValueStart(decl) { + if (decl.raws.between == null) throw new Error('`between` must be present'); + + return decl.prop.length + decl.raws.between.length - 1; +} + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const maxAdjacentNewlines = primary + 1; + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: isNumber, + }); + + if (!validOptions) { + return; + } + + const violatedCRLFNewLinesRegex = new RegExp(`(?:\r\n){${maxAdjacentNewlines + 1},}`); + const violatedLFNewLinesRegex = new RegExp(`\n{${maxAdjacentNewlines + 1},}`); + const allowedLFNewLinesString = context.fix ? '\n'.repeat(maxAdjacentNewlines) : ''; + const allowedCRLFNewLinesString = context.fix ? '\r\n'.repeat(maxAdjacentNewlines) : ''; + + root.walkDecls((decl) => { + if (!decl.value.includes('(')) { + return; + } + + const stringValue = getDeclarationValue(decl); + /** @type {Array<[string, string]>} */ + const splittedValue = []; + let sourceIndexStart = 0; + + valueParser(stringValue).walk((node) => { + if ( + node.type !== 'function' /* ignore non functions */ || + node.value.length === 0 /* ignore sass lists */ + ) { + return; + } + + const stringifiedNode = valueParser.stringify(node); + + if ( + !violatedLFNewLinesRegex.test(stringifiedNode) && + !violatedCRLFNewLinesRegex.test(stringifiedNode) + ) { + return; + } + + if (context.fix) { + const newNodeString = stringifiedNode + .replace(new RegExp(violatedLFNewLinesRegex, 'gm'), allowedLFNewLinesString) + .replace(new RegExp(violatedCRLFNewLinesRegex, 'gm'), allowedCRLFNewLinesString); + + splittedValue.push([ + stringValue.slice(sourceIndexStart, node.sourceIndex), + newNodeString, + ]); + sourceIndexStart = node.sourceIndex + stringifiedNode.length; + } else { + report({ + message: messages.expected(primary), + node: decl, + index: placeIndexOnValueStart(decl) + node.sourceIndex, + result, + ruleName, + }); + } + }); + + if (context.fix && splittedValue.length > 0) { + const updatedValue = + splittedValue.reduce((acc, curr) => acc + curr[0] + curr[1], '') + + stringValue.slice(sourceIndexStart); + + setDeclarationValue(decl, updatedValue); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-name-case/index.js b/node_modules/stylelint/lib/rules/function-name-case/index.js new file mode 100644 index 000000000..45c9ceccf --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-name-case/index.js @@ -0,0 +1,120 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction'); +const { camelCaseFunctions } = require('../../reference/functions'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); +const { isRegExp, isString } = require('../../utils/validateTypes'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); + +const ruleName = 'function-name-case'; + +const messages = ruleMessages(ruleName, { + expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-name-case', + fixable: true, +}; + +const mapLowercaseFunctionNamesToCamelCase = new Map(); + +for (const func of camelCaseFunctions) { + mapLowercaseFunctionNamesToCamelCase.set(func.toLowerCase(), func); +} + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['lower', 'upper'], + }, + { + actual: secondaryOptions, + possible: { + ignoreFunctions: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (!decl.value.includes('(')) return; + + if (!isStandardSyntaxValue(decl.value)) return; + + let needFix = false; + const parsed = valueParser(getDeclarationValue(decl)); + + parsed.walk((node) => { + if (node.type !== 'function' || !isStandardSyntaxFunction(node)) { + return; + } + + const functionName = node.value; + const functionNameLowerCase = functionName.toLowerCase(); + + if (optionsMatches(secondaryOptions, 'ignoreFunctions', functionName)) { + return; + } + + let expectedFunctionName = null; + + if ( + primary === 'lower' && + mapLowercaseFunctionNamesToCamelCase.has(functionNameLowerCase) + ) { + expectedFunctionName = mapLowercaseFunctionNamesToCamelCase.get(functionNameLowerCase); + } else if (primary === 'lower') { + expectedFunctionName = functionNameLowerCase; + } else { + expectedFunctionName = functionName.toUpperCase(); + } + + if (functionName === expectedFunctionName) { + return; + } + + if (context.fix) { + needFix = true; + node.value = expectedFunctionName; + + return; + } + + report({ + message: messages.expected, + messageArgs: [functionName, expectedFunctionName], + node: decl, + index: declarationValueIndex(decl) + node.sourceIndex, + result, + ruleName, + }); + }); + + if (context.fix && needFix) { + setDeclarationValue(decl, parsed.toString()); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-no-unknown/index.js b/node_modules/stylelint/lib/rules/function-no-unknown/index.js new file mode 100644 index 000000000..531237721 --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-no-unknown/index.js @@ -0,0 +1,110 @@ +'use strict'; + +const fs = require('fs'); +const functionsListPath = require('css-functions-list'); +const { tokenize } = require('@csstools/css-tokenizer'); +const { + isFunctionNode, + isSimpleBlockNode, + parseListOfComponentValues, +} = require('@csstools/css-parser-algorithms'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const isCustomFunction = require('../../utils/isCustomFunction'); +const { isRegExp, isString } = require('../../utils/validateTypes'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); + +const ruleName = 'function-no-unknown'; + +const messages = ruleMessages(ruleName, { + rejected: (name) => `Unexpected unknown function "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-no-unknown', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignoreFunctions: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const functionsList = [ + ...JSON.parse(fs.readFileSync(functionsListPath.toString(), 'utf8')), + // #5960 + '-webkit-gradient', + 'color-stop', + 'from', + 'to', + // #6537 + 'scroll', + ]; + + root.walkDecls((decl) => { + const { value } = decl; + + if (!value.includes('(')) return; + + if (!isStandardSyntaxValue(value)) return; + + /** + * @param {import('@csstools/css-parser-algorithms').ComponentValue} componentValue + */ + const walker = (componentValue) => { + if (!isFunctionNode(componentValue)) return; + + const name = componentValue.getName(); + + if (isCustomFunction(name)) return; + + if (optionsMatches(secondaryOptions, 'ignoreFunctions', name)) return; + + if (functionsList.includes(name.toLowerCase())) return; + + report({ + message: messages.rejected, + messageArgs: [name], + node: decl, + index: declarationValueIndex(decl) + componentValue.name[2], + result, + ruleName, + word: name, + }); + }; + + parseListOfComponentValues(tokenize({ css: value })).forEach((componentValue) => { + if (isFunctionNode(componentValue) || isSimpleBlockNode(componentValue)) { + walker(componentValue); + + componentValue.walk(({ node }) => { + walker(node); + }); + } + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-parentheses-newline-inside/index.js b/node_modules/stylelint/lib/rules/function-parentheses-newline-inside/index.js new file mode 100644 index 000000000..67dd51e94 --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-parentheses-newline-inside/index.js @@ -0,0 +1,276 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const isSingleLineString = require('../../utils/isSingleLineString'); +const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); + +const ruleName = 'function-parentheses-newline-inside'; + +const messages = ruleMessages(ruleName, { + expectedOpening: 'Expected newline after "("', + expectedClosing: 'Expected newline before ")"', + expectedOpeningMultiLine: 'Expected newline after "(" in a multi-line function', + rejectedOpeningMultiLine: 'Unexpected whitespace after "(" in a multi-line function', + expectedClosingMultiLine: 'Expected newline before ")" in a multi-line function', + rejectedClosingMultiLine: 'Unexpected whitespace before ")" in a multi-line function', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-parentheses-newline-inside', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line', 'never-multi-line'], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (!decl.value.includes('(')) { + return; + } + + let hasFixed = false; + const declValue = getDeclarationValue(decl); + const parsedValue = valueParser(declValue); + + parsedValue.walk((valueNode) => { + if (valueNode.type !== 'function') { + return; + } + + if (!isStandardSyntaxFunction(valueNode)) { + return; + } + + const functionString = valueParser.stringify(valueNode); + const isMultiLine = !isSingleLineString(functionString); + const containsNewline = (/** @type {string} */ str) => str.includes('\n'); + + // Check opening ... + + const openingIndex = valueNode.sourceIndex + valueNode.value.length + 1; + const checkBefore = getCheckBefore(valueNode); + + if (primary === 'always' && !containsNewline(checkBefore)) { + if (context.fix) { + hasFixed = true; + fixBeforeForAlways(valueNode, context.newline || ''); + } else { + complain(messages.expectedOpening, openingIndex); + } + } + + if (isMultiLine && primary === 'always-multi-line' && !containsNewline(checkBefore)) { + if (context.fix) { + hasFixed = true; + fixBeforeForAlways(valueNode, context.newline || ''); + } else { + complain(messages.expectedOpeningMultiLine, openingIndex); + } + } + + if (isMultiLine && primary === 'never-multi-line' && checkBefore !== '') { + if (context.fix) { + hasFixed = true; + fixBeforeForNever(valueNode); + } else { + complain(messages.rejectedOpeningMultiLine, openingIndex); + } + } + + // Check closing ... + + const closingIndex = valueNode.sourceIndex + functionString.length - 2; + const checkAfter = getCheckAfter(valueNode); + + if (primary === 'always' && !containsNewline(checkAfter)) { + if (context.fix) { + hasFixed = true; + fixAfterForAlways(valueNode, context.newline || ''); + } else { + complain(messages.expectedClosing, closingIndex); + } + } + + if (isMultiLine && primary === 'always-multi-line' && !containsNewline(checkAfter)) { + if (context.fix) { + hasFixed = true; + fixAfterForAlways(valueNode, context.newline || ''); + } else { + complain(messages.expectedClosingMultiLine, closingIndex); + } + } + + if (isMultiLine && primary === 'never-multi-line' && checkAfter !== '') { + if (context.fix) { + hasFixed = true; + fixAfterForNever(valueNode); + } else { + complain(messages.rejectedClosingMultiLine, closingIndex); + } + } + }); + + if (hasFixed) { + setDeclarationValue(decl, parsedValue.toString()); + } + + /** + * @param {string} message + * @param {number} offset + */ + function complain(message, offset) { + report({ + ruleName, + result, + message, + node: decl, + index: declarationValueIndex(decl) + offset, + }); + } + }); + }; +}; + +/** @typedef {import('postcss-value-parser').FunctionNode} FunctionNode */ + +/** + * @param {FunctionNode} valueNode + */ +function getCheckBefore(valueNode) { + let before = valueNode.before; + + for (const node of valueNode.nodes) { + if (node.type === 'comment') { + continue; + } + + if (node.type === 'space') { + before += node.value; + continue; + } + + break; + } + + return before; +} + +/** + * @param {FunctionNode} valueNode + */ +function getCheckAfter(valueNode) { + let after = ''; + + for (const node of [...valueNode.nodes].reverse()) { + if (node.type === 'comment') { + continue; + } + + if (node.type === 'space') { + after = node.value + after; + continue; + } + + break; + } + + after += valueNode.after; + + return after; +} + +/** + * @param {FunctionNode} valueNode + * @param {string} newline + */ +function fixBeforeForAlways(valueNode, newline) { + let target; + + for (const node of valueNode.nodes) { + if (node.type === 'comment') { + continue; + } + + if (node.type === 'space') { + target = node; + continue; + } + + break; + } + + if (target) { + target.value = newline + target.value; + } else { + valueNode.before = newline + valueNode.before; + } +} + +/** + * @param {FunctionNode} valueNode + */ +function fixBeforeForNever(valueNode) { + valueNode.before = ''; + + for (const node of valueNode.nodes) { + if (node.type === 'comment') { + continue; + } + + if (node.type === 'space') { + node.value = ''; + continue; + } + + break; + } +} + +/** + * @param {FunctionNode} valueNode + * @param {string} newline + */ +function fixAfterForAlways(valueNode, newline) { + valueNode.after = newline + valueNode.after; +} + +/** + * @param {FunctionNode} valueNode + */ +function fixAfterForNever(valueNode) { + valueNode.after = ''; + + for (const node of [...valueNode.nodes].reverse()) { + if (node.type === 'comment') { + continue; + } + + if (node.type === 'space') { + node.value = ''; + continue; + } + + break; + } +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-parentheses-space-inside/index.js b/node_modules/stylelint/lib/rules/function-parentheses-space-inside/index.js new file mode 100644 index 000000000..4974e7a23 --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-parentheses-space-inside/index.js @@ -0,0 +1,175 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const isSingleLineString = require('../../utils/isSingleLineString'); +const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); + +const ruleName = 'function-parentheses-space-inside'; + +const messages = ruleMessages(ruleName, { + expectedOpening: 'Expected single space after "("', + rejectedOpening: 'Unexpected whitespace after "("', + expectedClosing: 'Expected single space before ")"', + rejectedClosing: 'Unexpected whitespace before ")"', + expectedOpeningSingleLine: 'Expected single space after "(" in a single-line function', + rejectedOpeningSingleLine: 'Unexpected whitespace after "(" in a single-line function', + expectedClosingSingleLine: 'Expected single space before ")" in a single-line function', + rejectedClosingSingleLine: 'Unexpected whitespace before ")" in a single-line function', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-parentheses-space-inside', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never', 'always-single-line', 'never-single-line'], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (!decl.value.includes('(')) { + return; + } + + let hasFixed = false; + const declValue = getDeclarationValue(decl); + const parsedValue = valueParser(declValue); + + parsedValue.walk((valueNode) => { + if (valueNode.type !== 'function') { + return; + } + + if (!isStandardSyntaxFunction(valueNode)) { + return; + } + + // Ignore function without parameters + if (!valueNode.nodes.length) { + return; + } + + const functionString = valueParser.stringify(valueNode); + const isSingleLine = isSingleLineString(functionString); + + // Check opening ... + + const openingIndex = valueNode.sourceIndex + valueNode.value.length + 1; + + if (primary === 'always' && valueNode.before !== ' ') { + if (context.fix) { + hasFixed = true; + valueNode.before = ' '; + } else { + complain(messages.expectedOpening, openingIndex); + } + } + + if (primary === 'never' && valueNode.before !== '') { + if (context.fix) { + hasFixed = true; + valueNode.before = ''; + } else { + complain(messages.rejectedOpening, openingIndex); + } + } + + if (isSingleLine && primary === 'always-single-line' && valueNode.before !== ' ') { + if (context.fix) { + hasFixed = true; + valueNode.before = ' '; + } else { + complain(messages.expectedOpeningSingleLine, openingIndex); + } + } + + if (isSingleLine && primary === 'never-single-line' && valueNode.before !== '') { + if (context.fix) { + hasFixed = true; + valueNode.before = ''; + } else { + complain(messages.rejectedOpeningSingleLine, openingIndex); + } + } + + // Check closing ... + + const closingIndex = valueNode.sourceIndex + functionString.length - 2; + + if (primary === 'always' && valueNode.after !== ' ') { + if (context.fix) { + hasFixed = true; + valueNode.after = ' '; + } else { + complain(messages.expectedClosing, closingIndex); + } + } + + if (primary === 'never' && valueNode.after !== '') { + if (context.fix) { + hasFixed = true; + valueNode.after = ''; + } else { + complain(messages.rejectedClosing, closingIndex); + } + } + + if (isSingleLine && primary === 'always-single-line' && valueNode.after !== ' ') { + if (context.fix) { + hasFixed = true; + valueNode.after = ' '; + } else { + complain(messages.expectedClosingSingleLine, closingIndex); + } + } + + if (isSingleLine && primary === 'never-single-line' && valueNode.after !== '') { + if (context.fix) { + hasFixed = true; + valueNode.after = ''; + } else { + complain(messages.rejectedClosingSingleLine, closingIndex); + } + } + }); + + if (hasFixed) { + setDeclarationValue(decl, parsedValue.toString()); + } + + /** + * @param {string} message + * @param {number} offset + */ + function complain(message, offset) { + report({ + ruleName, + result, + message, + node: decl, + index: declarationValueIndex(decl) + offset, + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-url-no-scheme-relative/index.js b/node_modules/stylelint/lib/rules/function-url-no-scheme-relative/index.js new file mode 100644 index 000000000..601929cdf --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-url-no-scheme-relative/index.js @@ -0,0 +1,52 @@ +'use strict'; + +const functionArgumentsSearch = require('../../utils/functionArgumentsSearch'); +const isStandardSyntaxUrl = require('../../utils/isStandardSyntaxUrl'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'function-url-no-scheme-relative'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected scheme-relative url', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-url-no-scheme-relative', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + functionArgumentsSearch(decl.toString().toLowerCase(), 'url', (args, index) => { + const url = args.trim().replace(/^['"]+|['"]+$/g, ''); + + if (!isStandardSyntaxUrl(url) || !url.startsWith('//')) { + return; + } + + report({ + message: messages.rejected, + node: decl, + index, + endIndex: index + args.length, + result, + ruleName, + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-url-quotes/index.js b/node_modules/stylelint/lib/rules/function-url-quotes/index.js new file mode 100644 index 000000000..efe959ea4 --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-url-quotes/index.js @@ -0,0 +1,195 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const functionArgumentsSearch = require('../../utils/functionArgumentsSearch'); +const getAtRuleParams = require('../../utils/getAtRuleParams'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const isStandardSyntaxUrl = require('../../utils/isStandardSyntaxUrl'); +const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'function-url-quotes'; + +const messages = ruleMessages(ruleName, { + expected: (functionName) => `Expected quotes around "${functionName}" function argument`, + rejected: (functionName) => `Unexpected quotes around "${functionName}" function argument`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-url-quotes', + fixable: true, +}; + +const URL_FUNC_REGEX = /url\(/i; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['always', 'never'], + }, + { + actual: secondaryOptions, + possible: { + except: ['empty'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const exceptEmpty = optionsMatches(secondaryOptions, 'except', 'empty'); + const emptyArgumentPatterns = new Set(['', "''", '""']); + + root.walkAtRules(checkAtRuleParams); + root.walkDecls(checkDeclParams); + + /** + * @param {import('postcss').Declaration} decl + */ + function checkDeclParams(decl) { + if (!URL_FUNC_REGEX.test(decl.value)) return; + + if (!isStandardSyntaxDeclaration(decl)) return; + + const value = getDeclarationValue(decl); + const startIndex = declarationValueIndex(decl); + const parsed = functionArgumentsSearch(value, /^url$/i, (args, index, funcNode) => { + checkArgs(decl, args, startIndex + index, funcNode); + }); + + if (context.fix) { + decl.value = parsed.toString(); + } + } + + /** + * @param {import('postcss').AtRule} atRule + */ + function checkAtRuleParams(atRule) { + const params = getAtRuleParams(atRule); + const startIndex = atRuleParamIndex(atRule); + + let hasUrlFunction = false; + + const parsed = functionArgumentsSearch(params, /^url$/i, (args, index, funcNode) => { + hasUrlFunction = true; + checkArgs(atRule, args, startIndex + index, funcNode); + }); + + if (!hasUrlFunction) return; + + if (context.fix) { + atRule.params = parsed.toString(); + } + } + + /** + * @param {import('postcss-value-parser').FunctionNode} funcNode + */ + function addQuotes(funcNode) { + for (const argNode of funcNode.nodes) { + if (argNode.type === 'word') { + argNode.value = `"${argNode.value}"`; + } + } + } + + /** + * @param {import('postcss-value-parser').FunctionNode} funcNode + */ + function removeQuotes(funcNode) { + for (const argNode of funcNode.nodes) { + if (argNode.type === 'string') { + // NOTE: We can ignore this error because the test passes. + // @ts-expect-error -- TS2322: Type '"word"' is not assignable to type '"string"'. + argNode.type = 'word'; + } + } + } + + /** + * @param {import('postcss').Declaration | import('postcss').AtRule} node + * @param {string} args + * @param {number} index + * @param {import('postcss-value-parser').FunctionNode} funcNode + */ + function checkArgs(node, args, index, funcNode) { + const functionName = funcNode.value.toLowerCase(); + let shouldHasQuotes = primary === 'always'; + + const leftTrimmedArgs = args.trimStart(); + + if (!isStandardSyntaxUrl(leftTrimmedArgs)) { + return; + } + + const complaintIndex = index + args.length - leftTrimmedArgs.length; + const complaintEndIndex = index + args.length; + const hasQuotes = leftTrimmedArgs.startsWith("'") || leftTrimmedArgs.startsWith('"'); + + if (exceptEmpty && emptyArgumentPatterns.has(args.trim())) { + shouldHasQuotes = !shouldHasQuotes; + } + + if (shouldHasQuotes) { + if (hasQuotes) { + return; + } + + if (context.fix) { + addQuotes(funcNode); + + return; + } + + complain(messages.expected(functionName), node, complaintIndex, complaintEndIndex); + } else { + if (!hasQuotes) { + return; + } + + if (context.fix) { + removeQuotes(funcNode); + + return; + } + + complain(messages.rejected(functionName), node, complaintIndex, complaintEndIndex); + } + } + + /** + * @param {string} message + * @param {import('postcss').Node} node + * @param {number} index + * @param {number} endIndex + */ + function complain(message, node, index, endIndex) { + report({ + message, + node, + index, + endIndex, + result, + ruleName, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-url-scheme-allowed-list/index.js b/node_modules/stylelint/lib/rules/function-url-scheme-allowed-list/index.js new file mode 100644 index 000000000..a98f30ef5 --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-url-scheme-allowed-list/index.js @@ -0,0 +1,72 @@ +'use strict'; + +const functionArgumentsSearch = require('../../utils/functionArgumentsSearch'); +const getSchemeFromUrl = require('../../utils/getSchemeFromUrl'); +const isStandardSyntaxUrl = require('../../utils/isStandardSyntaxUrl'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'function-url-scheme-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (scheme) => `Unexpected URL scheme "${scheme}:"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-url-scheme-allowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + functionArgumentsSearch(decl.toString().toLowerCase(), 'url', (args, index) => { + const unspacedUrlString = args.trim(); + + if (!isStandardSyntaxUrl(unspacedUrlString)) { + return; + } + + const urlString = unspacedUrlString.replace(/^['"]+|['"]+$/g, ''); + const scheme = getSchemeFromUrl(urlString); + + if (scheme === null) { + return; + } + + if (matchesStringOrRegExp(scheme, primary)) { + return; + } + + report({ + message: messages.rejected, + messageArgs: [scheme], + node: decl, + index, + endIndex: index + args.length, + result, + ruleName, + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-url-scheme-disallowed-list/index.js b/node_modules/stylelint/lib/rules/function-url-scheme-disallowed-list/index.js new file mode 100644 index 000000000..c9c5214bf --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-url-scheme-disallowed-list/index.js @@ -0,0 +1,72 @@ +'use strict'; + +const functionArgumentsSearch = require('../../utils/functionArgumentsSearch'); +const getSchemeFromUrl = require('../../utils/getSchemeFromUrl'); +const isStandardSyntaxUrl = require('../../utils/isStandardSyntaxUrl'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'function-url-scheme-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (scheme) => `Unexpected URL scheme "${scheme}:"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-url-scheme-disallowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + functionArgumentsSearch(decl.toString().toLowerCase(), 'url', (args, index) => { + const unspacedUrlString = args.trim(); + + if (!isStandardSyntaxUrl(unspacedUrlString)) { + return; + } + + const urlString = unspacedUrlString.replace(/^['"]+|['"]+$/g, ''); + const scheme = getSchemeFromUrl(urlString); + + if (scheme === null) { + return; + } + + if (!matchesStringOrRegExp(scheme, primary)) { + return; + } + + report({ + message: messages.rejected, + messageArgs: [scheme], + node: decl, + index, + endIndex: index + args.length, + result, + ruleName, + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-whitespace-after/index.js b/node_modules/stylelint/lib/rules/function-whitespace-after/index.js new file mode 100644 index 000000000..3e5e2aaa8 --- /dev/null +++ b/node_modules/stylelint/lib/rules/function-whitespace-after/index.js @@ -0,0 +1,194 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const isWhitespace = require('../../utils/isWhitespace'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const styleSearch = require('style-search'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'function-whitespace-after'; + +const messages = ruleMessages(ruleName, { + expected: 'Expected whitespace after ")"', + rejected: 'Unexpected whitespace after ")"', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/function-whitespace-after', + fixable: true, + deprecated: true, +}; + +const ACCEPTABLE_AFTER_CLOSING_PAREN = new Set([')', ',', '}', ':', '/', undefined]); + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + /** + * @param {import('postcss').Node} node + * @param {string} value + * @param {number} nodeIndex + * @param {((index: number) => void) | undefined} fix + */ + function check(node, value, nodeIndex, fix) { + styleSearch( + { + source: value, + target: ')', + functionArguments: 'only', + }, + (match) => { + checkClosingParen(value, match.startIndex + 1, node, nodeIndex, fix); + }, + ); + } + + /** + * @param {string} source + * @param {number} index + * @param {import('postcss').Node} node + * @param {number} nodeIndex + * @param {((index: number) => void) | undefined} fix + */ + function checkClosingParen(source, index, node, nodeIndex, fix) { + const nextChar = source.charAt(index); + + if (!nextChar) return; + + if (primary === 'always') { + // Allow for the next character to be a single empty space, + // another closing parenthesis, a comma, or the end of the value + if (nextChar === ' ') { + return; + } + + if (nextChar === '\n') { + return; + } + + if (source.slice(index, index + 2) === '\r\n') { + return; + } + + if (ACCEPTABLE_AFTER_CLOSING_PAREN.has(nextChar)) { + return; + } + + if (fix) { + fix(index); + + return; + } + + report({ + message: messages.expected, + node, + index: nodeIndex + index, + result, + ruleName, + }); + } else if (primary === 'never' && isWhitespace(nextChar)) { + if (fix) { + fix(index); + + return; + } + + report({ + message: messages.rejected, + node, + index: nodeIndex + index, + result, + ruleName, + }); + } + } + + /** + * @param {string} value + */ + function createFixer(value) { + let fixed = ''; + let lastIndex = 0; + /** @type {(index: number) => void} */ + let applyFix; + + if (primary === 'always') { + applyFix = (index) => { + // eslint-disable-next-line prefer-template + fixed += value.slice(lastIndex, index) + ' '; + lastIndex = index; + }; + } else if (primary === 'never') { + applyFix = (index) => { + let whitespaceEndIndex = index + 1; + + while ( + whitespaceEndIndex < value.length && + isWhitespace(value.charAt(whitespaceEndIndex)) + ) { + whitespaceEndIndex++; + } + + fixed += value.slice(lastIndex, index); + lastIndex = whitespaceEndIndex; + }; + } else { + throw new Error(`Unexpected option: "${primary}"`); + } + + return { + applyFix, + get hasFixed() { + return Boolean(lastIndex); + }, + get fixed() { + return fixed + value.slice(lastIndex); + }, + }; + } + + root.walkAtRules(/^import$/i, (atRule) => { + const param = (atRule.raws.params && atRule.raws.params.raw) || atRule.params; + const fixer = context.fix && createFixer(param); + + check(atRule, param, atRuleParamIndex(atRule), fixer ? fixer.applyFix : undefined); + + if (fixer && fixer.hasFixed) { + if (atRule.raws.params) { + atRule.raws.params.raw = fixer.fixed; + } else { + atRule.params = fixer.fixed; + } + } + }); + root.walkDecls((decl) => { + const value = getDeclarationValue(decl); + const fixer = context.fix && createFixer(value); + + check(decl, value, declarationValueIndex(decl), fixer ? fixer.applyFix : undefined); + + if (fixer && fixer.hasFixed) { + setDeclarationValue(decl, fixer.fixed); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/functionCommaSpaceChecker.js b/node_modules/stylelint/lib/rules/functionCommaSpaceChecker.js new file mode 100644 index 000000000..1c004fa86 --- /dev/null +++ b/node_modules/stylelint/lib/rules/functionCommaSpaceChecker.js @@ -0,0 +1,123 @@ +'use strict'; + +const declarationValueIndex = require('../utils/declarationValueIndex'); +const getDeclarationValue = require('../utils/getDeclarationValue'); +const isStandardSyntaxFunction = require('../utils/isStandardSyntaxFunction'); +const report = require('../utils/report'); +const setDeclarationValue = require('../utils/setDeclarationValue'); +const valueParser = require('postcss-value-parser'); + +/** @typedef {import('postcss-value-parser').Node} ValueParserNode */ +/** @typedef {import('postcss-value-parser').DivNode} ValueParserDivNode */ +/** @typedef {(args: { source: string, index: number, err: (message: string) => void }) => void} LocationChecker */ + +/** + * @param {{ + * root: import('postcss').Root, + * locationChecker: LocationChecker, + * fix: ((node: ValueParserDivNode, index: number, nodes: ValueParserNode[]) => boolean) | null, + * result: import('stylelint').PostcssResult, + * checkedRuleName: string, + * }} opts + */ +module.exports = function functionCommaSpaceChecker(opts) { + opts.root.walkDecls((decl) => { + const declValue = getDeclarationValue(decl); + + let hasFixed; + const parsedValue = valueParser(declValue); + + parsedValue.walk((valueNode) => { + if (valueNode.type !== 'function') { + return; + } + + if (!isStandardSyntaxFunction(valueNode)) { + return; + } + + // Ignore `url()` arguments, which may contain data URIs or other funky stuff + if (valueNode.value.toLowerCase() === 'url') { + return; + } + + const argumentStrings = valueNode.nodes.map((node) => valueParser.stringify(node)); + + const functionArguments = (() => { + // Remove function name and parens + let result = valueNode.before + argumentStrings.join('') + valueNode.after; + + // 1. Remove comments including preceding whitespace (when only succeeded by whitespace) + // 2. Remove all other comments, but leave adjacent whitespace intact + // eslint-disable-next-line regexp/no-dupe-disjunctions -- TODO: Possible to simplify the regex. + result = result.replace(/( *\/(\*.*\*\/(?!\S)|\/.*)|(\/(\*.*\*\/|\/.*)))/, ''); + + return result; + })(); + + /** + * Gets the index of the comma for checking. + * @param {ValueParserDivNode} commaNode The comma node + * @param {number} nodeIndex The index of the comma node + * @returns {number} The index of the comma for checking + */ + const getCommaCheckIndex = (commaNode, nodeIndex) => { + let commaBefore = + valueNode.before + argumentStrings.slice(0, nodeIndex).join('') + commaNode.before; + + // 1. Remove comments including preceding whitespace (when only succeeded by whitespace) + // 2. Remove all other comments, but leave adjacent whitespace intact + // eslint-disable-next-line regexp/no-dupe-disjunctions -- TODO: Possible to simplify the regex. + commaBefore = commaBefore.replace(/( *\/(\*.*\*\/(?!\S)|\/.*)|(\/(\*.*\*\/|\/.*)))/, ''); + + return commaBefore.length; + }; + + /** @type {{ commaNode: ValueParserDivNode, checkIndex: number, nodeIndex: number }[]} */ + const commaDataList = []; + + for (const [nodeIndex, node] of valueNode.nodes.entries()) { + if (node.type !== 'div' || node.value !== ',') { + continue; + } + + const checkIndex = getCommaCheckIndex(node, nodeIndex); + + commaDataList.push({ + commaNode: node, + checkIndex, + nodeIndex, + }); + } + + for (const { commaNode, checkIndex, nodeIndex } of commaDataList) { + opts.locationChecker({ + source: functionArguments, + index: checkIndex, + err: (message) => { + const index = + declarationValueIndex(decl) + commaNode.sourceIndex + commaNode.before.length; + + if (opts.fix && opts.fix(commaNode, nodeIndex, valueNode.nodes)) { + hasFixed = true; + + return; + } + + report({ + index, + message, + node: decl, + result: opts.result, + ruleName: opts.checkedRuleName, + }); + }, + }); + } + }); + + if (hasFixed) { + setDeclarationValue(decl, parsedValue.toString()); + } + }); +}; diff --git a/node_modules/stylelint/lib/rules/functionCommaSpaceFix.js b/node_modules/stylelint/lib/rules/functionCommaSpaceFix.js new file mode 100644 index 000000000..b4ad08c68 --- /dev/null +++ b/node_modules/stylelint/lib/rules/functionCommaSpaceFix.js @@ -0,0 +1,49 @@ +'use strict'; + +/** + * @param {{ + * div: import('postcss-value-parser').DivNode, + * index: number, + * nodes: import('postcss-value-parser').Node[], + * expectation: string, + * position: 'before' | 'after', + * symb: string, + * }} params + * @returns {boolean} + */ +module.exports = function functionCommaSpaceFix(params) { + const { div, index, nodes, expectation, position, symb } = params; + + if (expectation.startsWith('always')) { + div[position] = symb; + + return true; + } + + if (expectation.startsWith('never')) { + div[position] = ''; + + for (let i = index + 1; i < nodes.length; i++) { + const node = nodes[i]; + + if (node === undefined) { + continue; + } + + if (node.type === 'comment') { + continue; + } + + if (node.type === 'space') { + node.value = ''; + continue; + } + + break; + } + + return true; + } + + return false; +}; diff --git a/node_modules/stylelint/lib/rules/hue-degree-notation/index.js b/node_modules/stylelint/lib/rules/hue-degree-notation/index.js new file mode 100644 index 000000000..d596c15bc --- /dev/null +++ b/node_modules/stylelint/lib/rules/hue-degree-notation/index.js @@ -0,0 +1,151 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'hue-degree-notation'; + +const messages = ruleMessages(ruleName, { + expected: (unfixed, fixed) => `Expected "${unfixed}" to be "${fixed}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/hue-degree-notation', + fixable: true, +}; + +const HUE_FIRST_ARG_FUNCS = ['hsl', 'hsla', 'hwb']; +const HUE_THIRD_ARG_FUNCS = ['lch', 'oklch']; +const HUE_FUNCS = new Set([...HUE_FIRST_ARG_FUNCS, ...HUE_THIRD_ARG_FUNCS]); +const HAS_HUE_COLOR_FUNC = new RegExp(`\\b(?:${[...HUE_FUNCS].join('|')})\\(`, 'i'); + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['angle', 'number'], + }); + + if (!validOptions) return; + + root.walkDecls((decl) => { + if (!HAS_HUE_COLOR_FUNC.test(decl.value)) return; + + let needsFix = false; + const parsedValue = valueParser(getDeclarationValue(decl)); + + parsedValue.walk((node) => { + if (node.type !== 'function') return; + + if (!HUE_FUNCS.has(node.value.toLowerCase())) return; + + const hue = findHue(node); + + if (!hue) return; + + const { value } = hue; + + if (!isStandardSyntaxValue(value)) return; + + if (!isDegree(value) && !isNumber(value)) return; + + if (primary === 'angle' && isDegree(value)) return; + + if (primary === 'number' && isNumber(value)) return; + + const fixed = primary === 'angle' ? asDegree(value) : asNumber(value); + const unfixed = value; + + if (context.fix) { + hue.value = fixed; + needsFix = true; + + return; + } + + const valueIndex = declarationValueIndex(decl); + + report({ + message: messages.expected, + messageArgs: [unfixed, fixed], + node: decl, + index: valueIndex + hue.sourceIndex, + endIndex: valueIndex + hue.sourceEndIndex, + result, + ruleName, + }); + }); + + if (needsFix) { + setDeclarationValue(decl, parsedValue.toString()); + } + }); + }; +}; + +/** + * @param {string} value + */ +function asDegree(value) { + return `${value}deg`; +} + +/** + * @param {string} value + */ +function asNumber(value) { + const dimension = valueParser.unit(value); + + if (dimension) return dimension.number; + + throw new TypeError(`The "${value}" value must have a unit`); +} + +/** + * @param {import('postcss-value-parser').FunctionNode} node + */ +function findHue(node) { + const args = node.nodes.filter(({ type }) => type === 'word' || type === 'function'); + const value = node.value.toLowerCase(); + + if (HUE_FIRST_ARG_FUNCS.includes(value)) { + return args[0]; + } + + if (HUE_THIRD_ARG_FUNCS.includes(value)) { + return args[2]; + } + + return undefined; +} + +/** + * @param {string} value + */ +function isDegree(value) { + const dimension = valueParser.unit(value); + + return dimension && dimension.unit.toLowerCase() === 'deg'; +} + +/** + * @param {string} value + */ +function isNumber(value) { + const dimension = valueParser.unit(value); + + return dimension && dimension.unit === ''; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/import-notation/index.js b/node_modules/stylelint/lib/rules/import-notation/index.js new file mode 100644 index 000000000..2e40df5e8 --- /dev/null +++ b/node_modules/stylelint/lib/rules/import-notation/index.js @@ -0,0 +1,126 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const setAtRuleParams = require('../../utils/setAtRuleParams'); +const getAtRuleParams = require('../../utils/getAtRuleParams'); +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); + +const ruleName = 'import-notation'; + +const messages = ruleMessages(ruleName, { + expected: (unfixed, fixed) => `Expected "${unfixed}" to be "${fixed}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/import-notation', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['string', 'url'], + }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^import$/i, checkAtRuleImportParams); + + /** + * @param {import('postcss').AtRule} atRule + */ + function checkAtRuleImportParams(atRule) { + const params = getAtRuleParams(atRule); + const parsed = valueParser(params); + + for (const node of parsed.nodes) { + const start = atRuleParamIndex(atRule); + const end = start + node.sourceEndIndex; + + if (primary === 'string') { + if (node.type === 'function' && node.value.toLowerCase() === 'url') { + const urlFunctionFull = valueParser.stringify(node); + const urlFunctionArguments = valueParser.stringify(node.nodes); + + const quotedUrlFunctionFirstArgument = + node.nodes[0] && node.nodes[0].type === 'word' + ? `"${urlFunctionArguments}"` + : urlFunctionArguments; + + if (context.fix) { + const restAtRuleParams = atRule.params.slice(node.sourceEndIndex); + + setAtRuleParams(atRule, `${quotedUrlFunctionFirstArgument}${restAtRuleParams}`); + + return; + } + + complain( + messages.expected(urlFunctionFull, quotedUrlFunctionFirstArgument), + atRule, + start, + end, + ); + + return; + } + } + + if (primary === 'url') { + if (node.type === 'space') return; + + if (node.type === 'word' || node.type === 'string') { + const path = valueParser.stringify(node); + + const urlFunctionFull = `url(${path})`; + + if (context.fix) { + const restAtRuleParams = atRule.params.slice(node.sourceEndIndex); + + setAtRuleParams(atRule, `${urlFunctionFull}${restAtRuleParams}`); + + return; + } + + const quotedNodeValue = + node.type === 'word' ? `"${node.value}"` : `${node.quote}${node.value}${node.quote}`; + + complain(messages.expected(quotedNodeValue, urlFunctionFull), atRule, start, end); + + return; + } + } + } + } + + /** + * @param {string} message + * @param {import('postcss').Node} node + * @param {number} index + * @param {number} endIndex + */ + function complain(message, node, index, endIndex) { + report({ + message, + node, + index, + endIndex, + result, + ruleName, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/indentation/index.js b/node_modules/stylelint/lib/rules/indentation/index.js new file mode 100644 index 000000000..f6c01c515 --- /dev/null +++ b/node_modules/stylelint/lib/rules/indentation/index.js @@ -0,0 +1,733 @@ +'use strict'; + +const beforeBlockString = require('../../utils/beforeBlockString'); +const hasBlock = require('../../utils/hasBlock'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const styleSearch = require('style-search'); +const validateOptions = require('../../utils/validateOptions'); +const { isAtRule, isDeclaration, isRoot, isRule } = require('../../utils/typeGuards'); +const { isBoolean, isNumber, isString, assertString } = require('../../utils/validateTypes'); + +const ruleName = 'indentation'; +const messages = ruleMessages(ruleName, { + expected: (x) => `Expected indentation of ${x}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/indentation', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions = {}, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [isNumber, 'tab'], + }, + { + actual: secondaryOptions, + possible: { + baseIndentLevel: [isNumber, 'auto'], + except: ['block', 'value', 'param'], + ignore: ['value', 'param', 'inside-parens'], + indentInsideParens: ['twice', 'once-at-root-twice-in-block'], + indentClosingBrace: [isBoolean], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const spaceCount = isNumber(primary) ? primary : null; + const indentChar = spaceCount == null ? '\t' : ' '.repeat(spaceCount); + const warningWord = primary === 'tab' ? 'tab' : 'space'; + + /** @type {number | 'auto'} */ + const baseIndentLevel = secondaryOptions.baseIndentLevel; + /** @type {boolean} */ + const indentClosingBrace = secondaryOptions.indentClosingBrace; + + /** + * @param {number} level + */ + const legibleExpectation = (level) => { + const count = spaceCount == null ? level : level * spaceCount; + const quantifiedWarningWord = count === 1 ? warningWord : `${warningWord}s`; + + return `${count} ${quantifiedWarningWord}`; + }; + + // Cycle through all nodes using walk. + root.walk((node) => { + if (isRoot(node)) { + // Ignore nested template literals root in css-in-js lang + return; + } + + const nodeLevel = indentationLevel(node); + + // Cut out any * and _ hacks from `before` + const before = (node.raws.before || '').replace(/[*_]$/, ''); + const after = typeof node.raws.after === 'string' ? node.raws.after : ''; + const parent = node.parent; + + if (!parent) throw new Error('A parent node must be present'); + + const expectedOpeningBraceIndentation = indentChar.repeat(nodeLevel); + + // Only inspect the spaces before the node + // if this is the first node in root + // or there is a newline in the `before` string. + // (If there is no newline before a node, + // there is no "indentation" to check.) + const isFirstChild = parent.type === 'root' && parent.first === node; + const lastIndexOfNewline = before.lastIndexOf('\n'); + + // Inspect whitespace in the `before` string that is + // *after* the *last* newline character, + // because anything besides that is not indentation for this node: + // it is some other kind of separation, checked by some separate rule + if ( + (lastIndexOfNewline !== -1 || + (isFirstChild && + (!getDocument(parent) || + (parent.raws.codeBefore && parent.raws.codeBefore.endsWith('\n'))))) && + before.slice(lastIndexOfNewline + 1) !== expectedOpeningBraceIndentation + ) { + if (context.fix) { + if (isFirstChild && isString(node.raws.before)) { + node.raws.before = node.raws.before.replace( + /^[ \t]*(?=\S|$)/, + expectedOpeningBraceIndentation, + ); + } + + node.raws.before = fixIndentation(node.raws.before, expectedOpeningBraceIndentation); + } else { + report({ + message: messages.expected(legibleExpectation(nodeLevel)), + node, + result, + ruleName, + }); + } + } + + // Only blocks have the `after` string to check. + // Only inspect `after` strings that start with a newline; + // otherwise there's no indentation involved. + // And check `indentClosingBrace` to see if it should be indented an extra level. + const closingBraceLevel = indentClosingBrace ? nodeLevel + 1 : nodeLevel; + const expectedClosingBraceIndentation = indentChar.repeat(closingBraceLevel); + + if ( + (isRule(node) || isAtRule(node)) && + hasBlock(node) && + after && + after.includes('\n') && + after.slice(after.lastIndexOf('\n') + 1) !== expectedClosingBraceIndentation + ) { + if (context.fix) { + node.raws.after = fixIndentation(node.raws.after, expectedClosingBraceIndentation); + } else { + report({ + message: messages.expected(legibleExpectation(closingBraceLevel)), + node, + index: node.toString().length - 1, + result, + ruleName, + }); + } + } + + // If this is a declaration, check the value + if (isDeclaration(node)) { + checkValue(node, nodeLevel); + } + + // If this is a rule, check the selector + if (isRule(node)) { + checkSelector(node, nodeLevel); + } + + // If this is an at rule, check the params + if (isAtRule(node)) { + checkAtRuleParams(node, nodeLevel); + } + }); + + /** + * @param {import('postcss').Node} node + * @param {number} level + * @returns {number} + */ + function indentationLevel(node, level = 0) { + if (!node.parent) throw new Error('A parent node must be present'); + + if (isRoot(node.parent)) { + return level + getRootBaseIndentLevel(node.parent, baseIndentLevel, primary); + } + + let calculatedLevel; + + // Indentation level equals the ancestor nodes + // separating this node from root; so recursively + // run this operation + calculatedLevel = indentationLevel(node.parent, level + 1); + + // If `secondaryOptions.except` includes "block", + // blocks are taken down one from their calculated level + // (all blocks are the same level as their parents) + if ( + optionsMatches(secondaryOptions, 'except', 'block') && + (isRule(node) || isAtRule(node)) && + hasBlock(node) + ) { + calculatedLevel--; + } + + return calculatedLevel; + } + + /** + * @param {import('postcss').Declaration} decl + * @param {number} declLevel + */ + function checkValue(decl, declLevel) { + if (!decl.value.includes('\n')) { + return; + } + + if (optionsMatches(secondaryOptions, 'ignore', 'value')) { + return; + } + + const declString = decl.toString(); + const valueLevel = optionsMatches(secondaryOptions, 'except', 'value') + ? declLevel + : declLevel + 1; + + checkMultilineBit(declString, valueLevel, decl); + } + + /** + * @param {import('postcss').Rule} ruleNode + * @param {number} ruleLevel + */ + function checkSelector(ruleNode, ruleLevel) { + const selector = ruleNode.selector; + + // Less mixins have params, and they should be indented extra + // @ts-expect-error -- TS2339: Property 'params' does not exist on type 'Rule'. + if (ruleNode.params) { + ruleLevel += 1; + } + + checkMultilineBit(selector, ruleLevel, ruleNode); + } + + /** + * @param {import('postcss').AtRule} atRule + * @param {number} ruleLevel + */ + function checkAtRuleParams(atRule, ruleLevel) { + if (optionsMatches(secondaryOptions, 'ignore', 'param')) { + return; + } + + // @nest and SCSS's @at-root rules should be treated like regular rules, not expected + // to have their params (selectors) indented + const paramLevel = + optionsMatches(secondaryOptions, 'except', 'param') || + atRule.name === 'nest' || + atRule.name === 'at-root' + ? ruleLevel + : ruleLevel + 1; + + checkMultilineBit(beforeBlockString(atRule).trim(), paramLevel, atRule); + } + + /** + * @param {string} source + * @param {number} newlineIndentLevel + * @param {import('postcss').Node} node + */ + function checkMultilineBit(source, newlineIndentLevel, node) { + if (!source.includes('\n')) { + return; + } + + // Data for current node fixing + /** @type {Array<{ expectedIndentation: string, currentIndentation: string, startIndex: number }>} */ + const fixPositions = []; + + // `outsideParens` because function arguments and also non-standard parenthesized stuff like + // Sass maps are ignored to allow for arbitrary indentation + let parentheticalDepth = 0; + + const ignoreInsideParans = optionsMatches(secondaryOptions, 'ignore', 'inside-parens'); + + styleSearch( + { + source, + target: '\n', + // @ts-expect-error -- The `outsideParens` option is unsupported. Why? + outsideParens: ignoreInsideParans, + }, + (match, matchCount) => { + const precedesClosingParenthesis = /^[ \t]*\)/.test(source.slice(match.startIndex + 1)); + + if (ignoreInsideParans && (precedesClosingParenthesis || match.insideParens)) { + return; + } + + let expectedIndentLevel = newlineIndentLevel; + + // Modififications for parenthetical content + if (!ignoreInsideParans && match.insideParens) { + // If the first match in is within parentheses, reduce the parenthesis penalty + if (matchCount === 1) parentheticalDepth -= 1; + + // Account for windows line endings + let newlineIndex = match.startIndex; + + if (source[match.startIndex - 1] === '\r') { + newlineIndex--; + } + + const followsOpeningParenthesis = /\([ \t]*$/.test(source.slice(0, newlineIndex)); + + if (followsOpeningParenthesis) { + parentheticalDepth += 1; + } + + const followsOpeningBrace = /\{[ \t]*$/.test(source.slice(0, newlineIndex)); + + if (followsOpeningBrace) { + parentheticalDepth += 1; + } + + const startingClosingBrace = /^[ \t]*\}/.test(source.slice(match.startIndex + 1)); + + if (startingClosingBrace) { + parentheticalDepth -= 1; + } + + expectedIndentLevel += parentheticalDepth; + + // Past this point, adjustments to parentheticalDepth affect next line + + if (precedesClosingParenthesis) { + parentheticalDepth -= 1; + } + + switch (secondaryOptions.indentInsideParens) { + case 'twice': + if (!precedesClosingParenthesis || indentClosingBrace) { + expectedIndentLevel += 1; + } + + break; + case 'once-at-root-twice-in-block': + if (node.parent === node.root()) { + if (precedesClosingParenthesis && !indentClosingBrace) { + expectedIndentLevel -= 1; + } + + break; + } + + if (!precedesClosingParenthesis || indentClosingBrace) { + expectedIndentLevel += 1; + } + + break; + default: + if (precedesClosingParenthesis && !indentClosingBrace) { + expectedIndentLevel -= 1; + } + } + } + + // Starting at the index after the newline, we want to + // check that the whitespace characters (excluding newlines) before the first + // non-whitespace character equal the expected indentation + const afterNewlineSpaceMatches = /^([ \t]*)\S/.exec(source.slice(match.startIndex + 1)); + + if (!afterNewlineSpaceMatches) { + return; + } + + const afterNewlineSpace = afterNewlineSpaceMatches[1] || ''; + const expectedIndentation = indentChar.repeat( + expectedIndentLevel > 0 ? expectedIndentLevel : 0, + ); + + if (afterNewlineSpace !== expectedIndentation) { + if (context.fix) { + // Adding fixes position in reverse order, because if we change indent in the beginning of the string it will break all following fixes for that string + fixPositions.unshift({ + expectedIndentation, + currentIndentation: afterNewlineSpace, + startIndex: match.startIndex, + }); + } else { + report({ + message: messages.expected(legibleExpectation(expectedIndentLevel)), + node, + index: match.startIndex + afterNewlineSpace.length + 1, + result, + ruleName, + }); + } + } + }, + ); + + if (fixPositions.length) { + if (isRule(node)) { + for (const fixPosition of fixPositions) { + node.selector = replaceIndentation( + node.selector, + fixPosition.currentIndentation, + fixPosition.expectedIndentation, + fixPosition.startIndex, + ); + } + } + + if (isDeclaration(node)) { + const declProp = node.prop; + const declBetween = node.raws.between; + + if (!isString(declBetween)) { + throw new TypeError('The `between` property must be a string'); + } + + for (const fixPosition of fixPositions) { + if (fixPosition.startIndex < declProp.length + declBetween.length) { + node.raws.between = replaceIndentation( + declBetween, + fixPosition.currentIndentation, + fixPosition.expectedIndentation, + fixPosition.startIndex - declProp.length, + ); + } else { + node.value = replaceIndentation( + node.value, + fixPosition.currentIndentation, + fixPosition.expectedIndentation, + fixPosition.startIndex - declProp.length - declBetween.length, + ); + } + } + } + + if (isAtRule(node)) { + const atRuleName = node.name; + const atRuleAfterName = node.raws.afterName; + const atRuleParams = node.params; + + if (!isString(atRuleAfterName)) { + throw new TypeError('The `afterName` property must be a string'); + } + + for (const fixPosition of fixPositions) { + // 1 — it's a @ length + if (fixPosition.startIndex < 1 + atRuleName.length + atRuleAfterName.length) { + node.raws.afterName = replaceIndentation( + atRuleAfterName, + fixPosition.currentIndentation, + fixPosition.expectedIndentation, + fixPosition.startIndex - atRuleName.length - 1, + ); + } else { + node.params = replaceIndentation( + atRuleParams, + fixPosition.currentIndentation, + fixPosition.expectedIndentation, + fixPosition.startIndex - atRuleName.length - atRuleAfterName.length - 1, + ); + } + } + } + } + } + }; +}; + +/** + * @param {import('postcss').Root} root + * @param {number | 'auto'} baseIndentLevel + * @param {string} space + * @returns {number} + */ +function getRootBaseIndentLevel(root, baseIndentLevel, space) { + const document = getDocument(root); + + if (!document) { + return 0; + } + + if (!root.source) { + throw new Error('The root node must have a source'); + } + + /** @type {import('postcss').Source & { baseIndentLevel?: number }} */ + const source = root.source; + + const indentLevel = source.baseIndentLevel; + + if (isNumber(indentLevel) && Number.isSafeInteger(indentLevel)) { + return indentLevel; + } + + const newIndentLevel = inferRootIndentLevel(root, baseIndentLevel, () => + inferDocIndentSize(document, space), + ); + + source.baseIndentLevel = newIndentLevel; + + return newIndentLevel; +} + +/** + * @param {import('postcss').Node} node + */ +function getDocument(node) { + // @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Node'. + const document = node.document; + + if (document) { + return document; + } + + const root = node.root(); + + // @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Node'. + return root && root.document; +} + +/** + * @param {import('postcss').Document} document + * @param {string} space + * returns {number} + */ +function inferDocIndentSize(document, space) { + if (!document.source) throw new Error('The document node must have a source'); + + /** @type {import('postcss').Source & { indentSize?: number }} */ + const docSource = document.source; + + let indentSize = docSource.indentSize; + + if (isNumber(indentSize) && Number.isSafeInteger(indentSize)) { + return indentSize; + } + + const source = document.source.input.css; + const indents = source.match(/^ *(?=\S)/gm); + + if (indents) { + /** @type {Map} */ + const scores = new Map(); + let lastIndentSize = 0; + let lastLeadingSpacesLength = 0; + + /** + * @param {number} leadingSpacesLength + */ + const vote = (leadingSpacesLength) => { + if (leadingSpacesLength) { + lastIndentSize = Math.abs(leadingSpacesLength - lastLeadingSpacesLength) || lastIndentSize; + + if (lastIndentSize > 1) { + const score = scores.get(lastIndentSize); + + if (score) { + scores.set(lastIndentSize, score + 1); + } else { + scores.set(lastIndentSize, 1); + } + } + } else { + lastIndentSize = 0; + } + + lastLeadingSpacesLength = leadingSpacesLength; + }; + + for (const leadingSpaces of indents) { + vote(leadingSpaces.length); + } + + let bestScore = 0; + + for (const [indentSizeDate, score] of scores.entries()) { + if (score > bestScore) { + bestScore = score; + indentSize = indentSizeDate; + } + } + } + + indentSize = + Number(indentSize) || (indents && indents[0] && indents[0].length) || Number(space) || 2; + docSource.indentSize = indentSize; + + return indentSize; +} + +/** + * @param {import('postcss').Root} root + * @param {number | 'auto'} baseIndentLevel + * @param {() => number} indentSize + * @returns {number} + */ +function inferRootIndentLevel(root, baseIndentLevel, indentSize) { + /** + * @param {string} indent + */ + function getIndentLevel(indent) { + const tabMatch = indent.match(/\t/g); + const tabCount = tabMatch ? tabMatch.length : 0; + + const spaceMatch = indent.match(/ /g); + const spaceCount = spaceMatch ? Math.round(spaceMatch.length / indentSize()) : 0; + + return tabCount + spaceCount; + } + + let newBaseIndentLevel = 0; + + if (!isNumber(baseIndentLevel) || !Number.isSafeInteger(baseIndentLevel)) { + if (!root.source) throw new Error('The root node must have a source'); + + let source = root.source.input.css; + + source = source.replace(/^[^\r\n]+/, (firstLine) => { + const match = root.raws.codeBefore && /(?:^|\n)([ \t]*)$/.exec(root.raws.codeBefore); + + if (match) { + return match[1] + firstLine; + } + + return ''; + }); + + const indents = source.match(/^[ \t]*(?=\S)/gm); + + if (indents) { + return Math.min(...indents.map((indent) => getIndentLevel(indent))); + } + + newBaseIndentLevel = 1; + } else { + newBaseIndentLevel = baseIndentLevel; + } + + const indents = []; + const foundIndents = root.raws.codeBefore && /(?:^|\n)([ \t]*)\S/m.exec(root.raws.codeBefore); + + // The indent level of the CSS code block in non-CSS-like files is determined by the shortest indent of non-empty line. + if (foundIndents) { + let shortest = Number.MAX_SAFE_INTEGER; + let i = 0; + + while (++i < foundIndents.length) { + const foundIndent = foundIndents[i]; + + assertString(foundIndent); + const current = getIndentLevel(foundIndent); + + if (current < shortest) { + shortest = current; + + if (shortest === 0) { + break; + } + } + } + + if (shortest !== Number.MAX_SAFE_INTEGER) { + indents.push(new Array(shortest).fill(' ').join('')); + } + } + + const after = root.raws.after; + + if (after) { + let afterEnd; + + if (after.endsWith('\n')) { + // @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Root'. + const document = root.document; + + if (document) { + const nextRoot = document.nodes[document.nodes.indexOf(root) + 1]; + + afterEnd = nextRoot ? nextRoot.raws.codeBefore : document.raws.codeAfter; + } else { + // Nested root node in css-in-js lang + const parent = root.parent; + + if (!parent) throw new Error('The root node must have a parent'); + + const nextRoot = parent.nodes[parent.nodes.indexOf(root) + 1]; + + afterEnd = nextRoot ? nextRoot.raws.codeBefore : root.raws.codeAfter; + } + } else { + afterEnd = after; + } + + if (afterEnd) indents.push(afterEnd.match(/^[ \t]*/)[0]); + } + + if (indents.length) { + return Math.max(...indents.map((indent) => getIndentLevel(indent))) + newBaseIndentLevel; + } + + return newBaseIndentLevel; +} + +/** + * @param {string | undefined} str + * @param {string} whitespace + */ +function fixIndentation(str, whitespace) { + if (!isString(str)) { + return str; + } + + return str.replace(/\n[ \t]*(?=\S|$)/g, `\n${whitespace}`); +} + +/** + * @param {string} input + * @param {string} searchString + * @param {string} replaceString + * @param {number} startIndex + */ +function replaceIndentation(input, searchString, replaceString, startIndex) { + const offset = startIndex + 1; + const stringStart = input.slice(0, offset); + const stringEnd = input.slice(offset + searchString.length); + + return stringStart + replaceString + stringEnd; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/index.js b/node_modules/stylelint/lib/rules/index.js new file mode 100644 index 000000000..6693e5f47 --- /dev/null +++ b/node_modules/stylelint/lib/rules/index.js @@ -0,0 +1,378 @@ +'use strict'; + +const importLazy = require('import-lazy'); + +/** @type {import('stylelint')['rules']} */ +const rules = { + 'alpha-value-notation': importLazy(() => require('./alpha-value-notation'))(), + 'annotation-no-unknown': importLazy(() => require('./annotation-no-unknown'))(), + 'at-rule-allowed-list': importLazy(() => require('./at-rule-allowed-list'))(), + 'at-rule-disallowed-list': importLazy(() => require('./at-rule-disallowed-list'))(), + 'at-rule-empty-line-before': importLazy(() => require('./at-rule-empty-line-before'))(), + 'at-rule-name-case': importLazy(() => require('./at-rule-name-case'))(), + 'at-rule-name-newline-after': importLazy(() => require('./at-rule-name-newline-after'))(), + 'at-rule-semicolon-space-before': importLazy(() => require('./at-rule-semicolon-space-before'))(), + 'at-rule-name-space-after': importLazy(() => require('./at-rule-name-space-after'))(), + 'at-rule-no-unknown': importLazy(() => require('./at-rule-no-unknown'))(), + 'at-rule-no-vendor-prefix': importLazy(() => require('./at-rule-no-vendor-prefix'))(), + 'at-rule-property-required-list': importLazy(() => require('./at-rule-property-required-list'))(), + 'at-rule-semicolon-newline-after': importLazy(() => + require('./at-rule-semicolon-newline-after'), + )(), + 'block-closing-brace-empty-line-before': importLazy(() => + require('./block-closing-brace-empty-line-before'), + )(), + 'block-closing-brace-newline-after': importLazy(() => + require('./block-closing-brace-newline-after'), + )(), + 'block-closing-brace-newline-before': importLazy(() => + require('./block-closing-brace-newline-before'), + )(), + 'block-closing-brace-space-after': importLazy(() => + require('./block-closing-brace-space-after'), + )(), + 'block-closing-brace-space-before': importLazy(() => + require('./block-closing-brace-space-before'), + )(), + 'block-no-empty': importLazy(() => require('./block-no-empty'))(), + 'block-opening-brace-newline-after': importLazy(() => + require('./block-opening-brace-newline-after'), + )(), + 'block-opening-brace-newline-before': importLazy(() => + require('./block-opening-brace-newline-before'), + )(), + 'block-opening-brace-space-after': importLazy(() => + require('./block-opening-brace-space-after'), + )(), + 'block-opening-brace-space-before': importLazy(() => + require('./block-opening-brace-space-before'), + )(), + 'color-function-notation': importLazy(() => require('./color-function-notation'))(), + 'color-hex-alpha': importLazy(() => require('./color-hex-alpha'))(), + 'color-hex-case': importLazy(() => require('./color-hex-case'))(), + 'color-hex-length': importLazy(() => require('./color-hex-length'))(), + 'color-named': importLazy(() => require('./color-named'))(), + 'color-no-hex': importLazy(() => require('./color-no-hex'))(), + 'color-no-invalid-hex': importLazy(() => require('./color-no-invalid-hex'))(), + 'comment-empty-line-before': importLazy(() => require('./comment-empty-line-before'))(), + 'comment-no-empty': importLazy(() => require('./comment-no-empty'))(), + 'comment-pattern': importLazy(() => require('./comment-pattern'))(), + 'comment-whitespace-inside': importLazy(() => require('./comment-whitespace-inside'))(), + 'comment-word-disallowed-list': importLazy(() => require('./comment-word-disallowed-list'))(), + 'custom-media-pattern': importLazy(() => require('./custom-media-pattern'))(), + 'custom-property-empty-line-before': importLazy(() => + require('./custom-property-empty-line-before'), + )(), + 'custom-property-no-missing-var-function': importLazy(() => + require('./custom-property-no-missing-var-function'), + )(), + 'custom-property-pattern': importLazy(() => require('./custom-property-pattern'))(), + 'declaration-bang-space-after': importLazy(() => require('./declaration-bang-space-after'))(), + 'declaration-bang-space-before': importLazy(() => require('./declaration-bang-space-before'))(), + 'declaration-block-no-duplicate-custom-properties': importLazy(() => + require('./declaration-block-no-duplicate-custom-properties'), + )(), + 'declaration-block-no-duplicate-properties': importLazy(() => + require('./declaration-block-no-duplicate-properties'), + )(), + 'declaration-block-no-redundant-longhand-properties': importLazy(() => + require('./declaration-block-no-redundant-longhand-properties'), + )(), + 'declaration-block-no-shorthand-property-overrides': importLazy(() => + require('./declaration-block-no-shorthand-property-overrides'), + )(), + 'declaration-block-semicolon-newline-after': importLazy(() => + require('./declaration-block-semicolon-newline-after'), + )(), + 'declaration-block-semicolon-newline-before': importLazy(() => + require('./declaration-block-semicolon-newline-before'), + )(), + 'declaration-block-semicolon-space-after': importLazy(() => + require('./declaration-block-semicolon-space-after'), + )(), + 'declaration-block-semicolon-space-before': importLazy(() => + require('./declaration-block-semicolon-space-before'), + )(), + 'declaration-block-single-line-max-declarations': importLazy(() => + require('./declaration-block-single-line-max-declarations'), + )(), + 'declaration-block-trailing-semicolon': importLazy(() => + require('./declaration-block-trailing-semicolon'), + )(), + 'declaration-colon-newline-after': importLazy(() => + require('./declaration-colon-newline-after'), + )(), + 'declaration-colon-space-after': importLazy(() => require('./declaration-colon-space-after'))(), + 'declaration-colon-space-before': importLazy(() => require('./declaration-colon-space-before'))(), + 'declaration-empty-line-before': importLazy(() => require('./declaration-empty-line-before'))(), + 'declaration-no-important': importLazy(() => require('./declaration-no-important'))(), + 'declaration-property-max-values': importLazy(() => + require('./declaration-property-max-values'), + )(), + 'declaration-property-unit-allowed-list': importLazy(() => + require('./declaration-property-unit-allowed-list'), + )(), + 'declaration-property-unit-disallowed-list': importLazy(() => + require('./declaration-property-unit-disallowed-list'), + )(), + 'declaration-property-value-allowed-list': importLazy(() => + require('./declaration-property-value-allowed-list'), + )(), + 'declaration-property-value-disallowed-list': importLazy(() => + require('./declaration-property-value-disallowed-list'), + )(), + 'declaration-property-value-no-unknown': importLazy(() => + require('./declaration-property-value-no-unknown'), + )(), + 'font-family-no-missing-generic-family-keyword': importLazy(() => + require('./font-family-no-missing-generic-family-keyword'), + )(), + 'font-family-name-quotes': importLazy(() => require('./font-family-name-quotes'))(), + 'font-family-no-duplicate-names': importLazy(() => require('./font-family-no-duplicate-names'))(), + 'font-weight-notation': importLazy(() => require('./font-weight-notation'))(), + 'function-allowed-list': importLazy(() => require('./function-allowed-list'))(), + 'function-calc-no-unspaced-operator': importLazy(() => + require('./function-calc-no-unspaced-operator'), + )(), + 'function-comma-newline-after': importLazy(() => require('./function-comma-newline-after'))(), + 'function-comma-newline-before': importLazy(() => require('./function-comma-newline-before'))(), + 'function-comma-space-after': importLazy(() => require('./function-comma-space-after'))(), + 'function-comma-space-before': importLazy(() => require('./function-comma-space-before'))(), + 'function-disallowed-list': importLazy(() => require('./function-disallowed-list'))(), + 'function-linear-gradient-no-nonstandard-direction': importLazy(() => + require('./function-linear-gradient-no-nonstandard-direction'), + )(), + 'function-max-empty-lines': importLazy(() => require('./function-max-empty-lines'))(), + 'function-name-case': importLazy(() => require('./function-name-case'))(), + 'function-no-unknown': importLazy(() => require('./function-no-unknown'))(), + 'function-parentheses-newline-inside': importLazy(() => + require('./function-parentheses-newline-inside'), + )(), + 'function-parentheses-space-inside': importLazy(() => + require('./function-parentheses-space-inside'), + )(), + 'function-url-no-scheme-relative': importLazy(() => + require('./function-url-no-scheme-relative'), + )(), + 'function-url-quotes': importLazy(() => require('./function-url-quotes'))(), + 'function-url-scheme-allowed-list': importLazy(() => + require('./function-url-scheme-allowed-list'), + )(), + 'function-url-scheme-disallowed-list': importLazy(() => + require('./function-url-scheme-disallowed-list'), + )(), + 'function-whitespace-after': importLazy(() => require('./function-whitespace-after'))(), + 'hue-degree-notation': importLazy(() => require('./hue-degree-notation'))(), + 'import-notation': importLazy(() => require('./import-notation'))(), + 'keyframe-block-no-duplicate-selectors': importLazy(() => + require('./keyframe-block-no-duplicate-selectors'), + )(), + 'keyframe-declaration-no-important': importLazy(() => + require('./keyframe-declaration-no-important'), + )(), + 'keyframe-selector-notation': importLazy(() => require('./keyframe-selector-notation'))(), + 'keyframes-name-pattern': importLazy(() => require('./keyframes-name-pattern'))(), + 'length-zero-no-unit': importLazy(() => require('./length-zero-no-unit'))(), + linebreaks: importLazy(() => require('./linebreaks'))(), + 'max-empty-lines': importLazy(() => require('./max-empty-lines'))(), + 'max-line-length': importLazy(() => require('./max-line-length'))(), + 'max-nesting-depth': importLazy(() => require('./max-nesting-depth'))(), + 'media-feature-colon-space-after': importLazy(() => + require('./media-feature-colon-space-after'), + )(), + 'media-feature-colon-space-before': importLazy(() => + require('./media-feature-colon-space-before'), + )(), + 'media-feature-name-allowed-list': importLazy(() => + require('./media-feature-name-allowed-list'), + )(), + 'media-feature-name-case': importLazy(() => require('./media-feature-name-case'))(), + 'media-feature-name-disallowed-list': importLazy(() => + require('./media-feature-name-disallowed-list'), + )(), + 'media-feature-name-no-unknown': importLazy(() => require('./media-feature-name-no-unknown'))(), + 'media-feature-name-no-vendor-prefix': importLazy(() => + require('./media-feature-name-no-vendor-prefix'), + )(), + 'media-feature-name-unit-allowed-list': importLazy(() => + require('./media-feature-name-unit-allowed-list'), + )(), + 'media-feature-name-value-allowed-list': importLazy(() => + require('./media-feature-name-value-allowed-list'), + )(), + 'media-feature-name-value-no-unknown': importLazy(() => + require('./media-feature-name-value-no-unknown'), + )(), + 'media-feature-parentheses-space-inside': importLazy(() => + require('./media-feature-parentheses-space-inside'), + )(), + 'media-feature-range-notation': importLazy(() => require('./media-feature-range-notation'))(), + 'media-feature-range-operator-space-after': importLazy(() => + require('./media-feature-range-operator-space-after'), + )(), + 'media-feature-range-operator-space-before': importLazy(() => + require('./media-feature-range-operator-space-before'), + )(), + 'media-query-list-comma-newline-after': importLazy(() => + require('./media-query-list-comma-newline-after'), + )(), + 'media-query-list-comma-newline-before': importLazy(() => + require('./media-query-list-comma-newline-before'), + )(), + 'media-query-list-comma-space-after': importLazy(() => + require('./media-query-list-comma-space-after'), + )(), + 'media-query-list-comma-space-before': importLazy(() => + require('./media-query-list-comma-space-before'), + )(), + 'media-query-no-invalid': importLazy(() => require('./media-query-no-invalid'))(), + 'named-grid-areas-no-invalid': importLazy(() => require('./named-grid-areas-no-invalid'))(), + 'no-descending-specificity': importLazy(() => require('./no-descending-specificity'))(), + 'no-duplicate-at-import-rules': importLazy(() => require('./no-duplicate-at-import-rules'))(), + 'no-duplicate-selectors': importLazy(() => require('./no-duplicate-selectors'))(), + 'no-empty-source': importLazy(() => require('./no-empty-source'))(), + 'no-empty-first-line': importLazy(() => require('./no-empty-first-line'))(), + 'no-eol-whitespace': importLazy(() => require('./no-eol-whitespace'))(), + 'no-extra-semicolons': importLazy(() => require('./no-extra-semicolons'))(), + 'no-invalid-double-slash-comments': importLazy(() => + require('./no-invalid-double-slash-comments'), + )(), + 'no-invalid-position-at-import-rule': importLazy(() => + require('./no-invalid-position-at-import-rule'), + )(), + 'no-irregular-whitespace': importLazy(() => require('./no-irregular-whitespace'))(), + 'no-missing-end-of-source-newline': importLazy(() => + require('./no-missing-end-of-source-newline'), + )(), + 'no-unknown-animations': importLazy(() => require('./no-unknown-animations'))(), + 'no-unknown-custom-properties': importLazy(() => require('./no-unknown-custom-properties'))(), + 'number-leading-zero': importLazy(() => require('./number-leading-zero'))(), + 'number-max-precision': importLazy(() => require('./number-max-precision'))(), + 'number-no-trailing-zeros': importLazy(() => require('./number-no-trailing-zeros'))(), + 'property-allowed-list': importLazy(() => require('./property-allowed-list'))(), + 'property-case': importLazy(() => require('./property-case'))(), + 'property-disallowed-list': importLazy(() => require('./property-disallowed-list'))(), + 'property-no-unknown': importLazy(() => require('./property-no-unknown'))(), + 'property-no-vendor-prefix': importLazy(() => require('./property-no-vendor-prefix'))(), + 'rule-empty-line-before': importLazy(() => require('./rule-empty-line-before'))(), + 'rule-selector-property-disallowed-list': importLazy(() => + require('./rule-selector-property-disallowed-list'), + )(), + 'selector-anb-no-unmatchable': importLazy(() => require('./selector-anb-no-unmatchable'))(), + 'selector-attribute-brackets-space-inside': importLazy(() => + require('./selector-attribute-brackets-space-inside'), + )(), + 'selector-attribute-name-disallowed-list': importLazy(() => + require('./selector-attribute-name-disallowed-list'), + )(), + 'selector-attribute-operator-allowed-list': importLazy(() => + require('./selector-attribute-operator-allowed-list'), + )(), + 'selector-attribute-operator-disallowed-list': importLazy(() => + require('./selector-attribute-operator-disallowed-list'), + )(), + 'selector-attribute-operator-space-after': importLazy(() => + require('./selector-attribute-operator-space-after'), + )(), + 'selector-attribute-operator-space-before': importLazy(() => + require('./selector-attribute-operator-space-before'), + )(), + 'selector-attribute-quotes': importLazy(() => require('./selector-attribute-quotes'))(), + 'selector-class-pattern': importLazy(() => require('./selector-class-pattern'))(), + 'selector-combinator-allowed-list': importLazy(() => + require('./selector-combinator-allowed-list'), + )(), + 'selector-combinator-disallowed-list': importLazy(() => + require('./selector-combinator-disallowed-list'), + )(), + 'selector-combinator-space-after': importLazy(() => + require('./selector-combinator-space-after'), + )(), + 'selector-combinator-space-before': importLazy(() => + require('./selector-combinator-space-before'), + )(), + 'selector-descendant-combinator-no-non-space': importLazy(() => + require('./selector-descendant-combinator-no-non-space'), + )(), + 'selector-disallowed-list': importLazy(() => require('./selector-disallowed-list'))(), + 'selector-id-pattern': importLazy(() => require('./selector-id-pattern'))(), + 'selector-list-comma-newline-after': importLazy(() => + require('./selector-list-comma-newline-after'), + )(), + 'selector-list-comma-newline-before': importLazy(() => + require('./selector-list-comma-newline-before'), + )(), + 'selector-list-comma-space-after': importLazy(() => + require('./selector-list-comma-space-after'), + )(), + 'selector-list-comma-space-before': importLazy(() => + require('./selector-list-comma-space-before'), + )(), + 'selector-max-attribute': importLazy(() => require('./selector-max-attribute'))(), + 'selector-max-class': importLazy(() => require('./selector-max-class'))(), + 'selector-max-combinators': importLazy(() => require('./selector-max-combinators'))(), + 'selector-max-compound-selectors': importLazy(() => + require('./selector-max-compound-selectors'), + )(), + 'selector-max-empty-lines': importLazy(() => require('./selector-max-empty-lines'))(), + 'selector-max-id': importLazy(() => require('./selector-max-id'))(), + 'selector-max-pseudo-class': importLazy(() => require('./selector-max-pseudo-class'))(), + 'selector-max-specificity': importLazy(() => require('./selector-max-specificity'))(), + 'selector-max-type': importLazy(() => require('./selector-max-type'))(), + 'selector-max-universal': importLazy(() => require('./selector-max-universal'))(), + 'selector-nested-pattern': importLazy(() => require('./selector-nested-pattern'))(), + 'selector-no-qualifying-type': importLazy(() => require('./selector-no-qualifying-type'))(), + 'selector-no-vendor-prefix': importLazy(() => require('./selector-no-vendor-prefix'))(), + 'selector-not-notation': importLazy(() => require('./selector-not-notation'))(), + 'selector-pseudo-class-allowed-list': importLazy(() => + require('./selector-pseudo-class-allowed-list'), + )(), + 'selector-pseudo-class-case': importLazy(() => require('./selector-pseudo-class-case'))(), + 'selector-pseudo-class-disallowed-list': importLazy(() => + require('./selector-pseudo-class-disallowed-list'), + )(), + 'selector-pseudo-class-no-unknown': importLazy(() => + require('./selector-pseudo-class-no-unknown'), + )(), + 'selector-pseudo-class-parentheses-space-inside': importLazy(() => + require('./selector-pseudo-class-parentheses-space-inside'), + )(), + 'selector-pseudo-element-allowed-list': importLazy(() => + require('./selector-pseudo-element-allowed-list'), + )(), + 'selector-pseudo-element-case': importLazy(() => require('./selector-pseudo-element-case'))(), + 'selector-pseudo-element-colon-notation': importLazy(() => + require('./selector-pseudo-element-colon-notation'), + )(), + 'selector-pseudo-element-disallowed-list': importLazy(() => + require('./selector-pseudo-element-disallowed-list'), + )(), + 'selector-pseudo-element-no-unknown': importLazy(() => + require('./selector-pseudo-element-no-unknown'), + )(), + 'selector-type-case': importLazy(() => require('./selector-type-case'))(), + 'selector-type-no-unknown': importLazy(() => require('./selector-type-no-unknown'))(), + 'shorthand-property-no-redundant-values': importLazy(() => + require('./shorthand-property-no-redundant-values'), + )(), + 'string-no-newline': importLazy(() => require('./string-no-newline'))(), + 'string-quotes': importLazy(() => require('./string-quotes'))(), + 'time-min-milliseconds': importLazy(() => require('./time-min-milliseconds'))(), + 'unicode-bom': importLazy(() => require('./unicode-bom'))(), + 'unit-allowed-list': importLazy(() => require('./unit-allowed-list'))(), + 'unit-case': importLazy(() => require('./unit-case'))(), + 'unit-disallowed-list': importLazy(() => require('./unit-disallowed-list'))(), + 'unit-no-unknown': importLazy(() => require('./unit-no-unknown'))(), + 'value-keyword-case': importLazy(() => require('./value-keyword-case'))(), + 'value-list-comma-newline-after': importLazy(() => require('./value-list-comma-newline-after'))(), + 'value-list-comma-newline-before': importLazy(() => + require('./value-list-comma-newline-before'), + )(), + 'value-list-comma-space-after': importLazy(() => require('./value-list-comma-space-after'))(), + 'value-list-comma-space-before': importLazy(() => require('./value-list-comma-space-before'))(), + 'value-list-max-empty-lines': importLazy(() => require('./value-list-max-empty-lines'))(), + 'value-no-vendor-prefix': importLazy(() => require('./value-no-vendor-prefix'))(), + indentation: importLazy(() => require('./indentation'))(), +}; + +module.exports = rules; diff --git a/node_modules/stylelint/lib/rules/keyframe-block-no-duplicate-selectors/index.js b/node_modules/stylelint/lib/rules/keyframe-block-no-duplicate-selectors/index.js new file mode 100644 index 000000000..2e064bf8e --- /dev/null +++ b/node_modules/stylelint/lib/rules/keyframe-block-no-duplicate-selectors/index.js @@ -0,0 +1,65 @@ +'use strict'; + +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'keyframe-block-no-duplicate-selectors'; + +const messages = ruleMessages(ruleName, { + rejected: (selector) => `Unexpected duplicate "${selector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/keyframe-block-no-duplicate-selectors', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^(-(moz|webkit)-)?keyframes$/i, (atRuleKeyframes) => { + const selectors = new Set(); + + atRuleKeyframes.walkRules((keyframeRule) => { + const ruleSelectors = keyframeRule.selectors; + + ruleSelectors.forEach((selector) => { + if (!isStandardSyntaxSelector(selector)) { + return; + } + + const normalizedSelector = selector.toLowerCase(); + + const isDuplicate = selectors.has(normalizedSelector); + + if (isDuplicate) { + report({ + message: messages.rejected, + messageArgs: [selector], + node: keyframeRule, + result, + ruleName, + word: selector, + }); + + return; + } + + selectors.add(normalizedSelector); + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/keyframe-declaration-no-important/index.js b/node_modules/stylelint/lib/rules/keyframe-declaration-no-important/index.js new file mode 100644 index 000000000..bcadeeffe --- /dev/null +++ b/node_modules/stylelint/lib/rules/keyframe-declaration-no-important/index.js @@ -0,0 +1,54 @@ +'use strict'; + +const getImportantPosition = require('../../utils/getImportantPosition'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { assert } = require('../../utils/validateTypes'); + +const ruleName = 'keyframe-declaration-no-important'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected !important', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/keyframe-declaration-no-important', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^(-(moz|webkit)-)?keyframes$/i, (atRuleKeyframes) => { + atRuleKeyframes.walkDecls((decl) => { + if (!decl.important) { + return; + } + + const pos = getImportantPosition(decl.toString()); + + assert(pos); + + report({ + message: messages.rejected, + node: decl, + index: pos.index, + endIndex: pos.endIndex, + result, + ruleName, + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/keyframe-selector-notation/index.js b/node_modules/stylelint/lib/rules/keyframe-selector-notation/index.js new file mode 100644 index 000000000..b951379a9 --- /dev/null +++ b/node_modules/stylelint/lib/rules/keyframe-selector-notation/index.js @@ -0,0 +1,164 @@ +'use strict'; + +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const transformSelector = require('../../utils/transformSelector'); +const validateOptions = require('../../utils/validateOptions'); +const { assertString } = require('../../utils/validateTypes'); + +const ruleName = 'keyframe-selector-notation'; + +const messages = ruleMessages(ruleName, { + expected: (selector, fixedSelector) => `Expected "${selector}" to be "${fixedSelector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/keyframe-selector-notation', + fixable: true, +}; + +const PERCENTAGE_SELECTORS = new Set(['0%', '100%']); +const KEYWORD_SELECTORS = new Set(['from', 'to']); +const NAMED_TIMELINE_RANGE_SELECTORS = new Set(['cover', 'contain', 'entry', 'enter', 'exit']); +const PERCENTAGE_TO_KEYWORD = new Map([ + ['0%', 'from'], + ['100%', 'to'], +]); +const KEYWORD_TO_PERCENTAGE = new Map([ + ['from', '0%'], + ['to', '100%'], +]); + +/** @type {import('stylelint').Rule<'keyword' | 'percentage' | 'percentage-unless-within-keyword-only-block'>} */ +const rule = (primary, _, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['keyword', 'percentage', 'percentage-unless-within-keyword-only-block'], + }); + + if (!validOptions) return; + + /** + * @typedef {{ + * expFunc: (selector: string, selectorsInBlock: string[]) => boolean, + * fixFunc: (selector: string) => string, + * }} OptionFuncs + * + * @type {Record} + */ + const optionFuncs = Object.freeze({ + keyword: { + expFunc: (selector) => KEYWORD_SELECTORS.has(selector), + fixFunc: (selector) => getFromMap(PERCENTAGE_TO_KEYWORD, selector), + }, + percentage: { + expFunc: (selector) => PERCENTAGE_SELECTORS.has(selector), + fixFunc: (selector) => getFromMap(KEYWORD_TO_PERCENTAGE, selector), + }, + 'percentage-unless-within-keyword-only-block': { + expFunc: (selector, selectorsInBlock) => { + if (selectorsInBlock.every((s) => KEYWORD_SELECTORS.has(s))) return true; + + return PERCENTAGE_SELECTORS.has(selector); + }, + fixFunc: (selector) => getFromMap(KEYWORD_TO_PERCENTAGE, selector), + }, + }); + + root.walkAtRules(/^(-(moz|webkit)-)?keyframes$/i, (atRuleKeyframes) => { + const selectorsInBlock = + primary === 'percentage-unless-within-keyword-only-block' + ? getSelectorsInBlock(atRuleKeyframes) + : []; + + atRuleKeyframes.walkRules((keyframeRule) => { + transformSelector(result, keyframeRule, (selectors) => { + let first = true; + + selectors.walkTags((selectorTag) => { + if (first && NAMED_TIMELINE_RANGE_SELECTORS.has(selectorTag.value)) { + return false; + } + + first = false; + + checkSelector( + selectorTag.value, + optionFuncs[primary], + (fixedSelector) => (selectorTag.value = fixedSelector), + ); + }); + }); + + /** + * @param {string} selector + * @param {OptionFuncs} funcs + * @param {(fixedSelector: string) => void} fixer + */ + function checkSelector(selector, { expFunc, fixFunc }, fixer) { + const normalizedSelector = selector.toLowerCase(); + + if ( + !KEYWORD_SELECTORS.has(normalizedSelector) && + !PERCENTAGE_SELECTORS.has(normalizedSelector) + ) { + return; + } + + if (expFunc(selector, selectorsInBlock)) return; + + const fixedSelector = fixFunc(selector); + + if (context.fix) { + fixer(fixedSelector); + + return; + } + + report({ + message: messages.expected, + messageArgs: [selector, fixedSelector], + node: keyframeRule, + result, + ruleName, + word: selector, + }); + } + }); + }); + }; +}; + +/** + * @param {Map} map + * @param {string} key + * @returns {string} + */ +function getFromMap(map, key) { + const value = map.get(key); + + assertString(value); + + return value; +} + +/** + * @param {import('postcss').AtRule} atRule + * @returns {string[]} + */ +function getSelectorsInBlock(atRule) { + /** @type {string[]} */ + const selectors = []; + + atRule.walkRules((r) => { + selectors.push(...r.selectors); + }); + + return selectors; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/keyframes-name-pattern/index.js b/node_modules/stylelint/lib/rules/keyframes-name-pattern/index.js new file mode 100644 index 000000000..dbdd96dd5 --- /dev/null +++ b/node_modules/stylelint/lib/rules/keyframes-name-pattern/index.js @@ -0,0 +1,64 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const isStandardSyntaxKeyframesName = require('../../utils/isStandardSyntaxKeyframesName'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'keyframes-name-pattern'; + +const messages = ruleMessages(ruleName, { + expected: (keyframeName, pattern) => `Expected "${keyframeName}" to match pattern "${pattern}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/keyframes-name-pattern', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isRegExp, isString], + }); + + if (!validOptions) { + return; + } + + const regex = isString(primary) ? new RegExp(primary) : primary; + + root.walkAtRules(/keyframes/i, (keyframesNode) => { + const value = keyframesNode.params; + + if (!isStandardSyntaxKeyframesName(value)) { + return; + } + + if (regex.test(value)) { + return; + } + + const index = atRuleParamIndex(keyframesNode); + const endIndex = index + value.length; + + report({ + index, + endIndex, + message: messages.expected, + messageArgs: [value, primary], + node: keyframesNode, + ruleName, + result, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/length-zero-no-unit/index.js b/node_modules/stylelint/lib/rules/length-zero-no-unit/index.js new file mode 100644 index 000000000..7c8eaaee3 --- /dev/null +++ b/node_modules/stylelint/lib/rules/length-zero-no-unit/index.js @@ -0,0 +1,227 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getAtRuleParams = require('../../utils/getAtRuleParams'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const isCustomProperty = require('../../utils/isCustomProperty'); +const isMathFunction = require('../../utils/isMathFunction'); +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const { lengthUnits } = require('../../reference/units'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setAtRuleParams = require('../../utils/setAtRuleParams'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'length-zero-no-unit'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected unit', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/length-zero-no-unit', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + }, + { + actual: secondaryOptions, + possible: { + ignore: ['custom-properties'], + ignoreFunctions: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) return; + + let needsFix; + + /** + * @param {import('postcss').Node} node + * @param {number} nodeIndex + * @param {import('postcss-value-parser').Node} valueNode + */ + function check(node, nodeIndex, valueNode) { + const { value, sourceIndex } = valueNode; + + if (isMathFunction(valueNode)) return false; + + if (isFunction(valueNode) && optionsMatches(secondaryOptions, 'ignoreFunctions', value)) + return false; + + if (!isWord(valueNode)) return; + + const numberUnit = valueParser.unit(value); + + if (numberUnit === false) return; + + const { number, unit } = numberUnit; + + if (unit === '') return; + + if (!isLength(unit)) return; + + if (isFraction(unit)) return; + + if (!isZero(number)) return; + + if (context.fix) { + let regularNumber = number; + + if (regularNumber.startsWith('.')) { + regularNumber = number.slice(1); + } + + valueNode.value = regularNumber; + needsFix = true; + + return; + } + + const index = nodeIndex + sourceIndex + number.length; + const endIndex = index + unit.length; + + report({ + index, + endIndex, + message: messages.rejected, + node, + result, + ruleName, + }); + } + + /** + * @param {import('postcss').AtRule} node + */ + function checkAtRule(node) { + if (!isStandardSyntaxAtRule(node)) return; + + needsFix = false; + + const index = atRuleParamIndex(node); + const parsedValue = valueParser(getAtRuleParams(node)); + + parsedValue.walk((valueNode) => check(node, index, valueNode)); + + if (needsFix) { + setAtRuleParams(node, parsedValue.toString()); + } + } + + /** + * @param {import('postcss').Declaration} node + */ + function checkDecl(node) { + needsFix = false; + + const { prop } = node; + + if (isLineHeight(prop)) return; + + if (isFlex(prop)) return; + + if (optionsMatches(secondaryOptions, 'ignore', 'custom-properties') && isCustomProperty(prop)) + return; + + const index = declarationValueIndex(node); + const parsedValue = valueParser(getDeclarationValue(node)); + + parsedValue.walk((valueNode, valueNodeIndex, valueNodes) => { + if (isLineHeightValue(node, valueNodes, valueNodeIndex)) return; + + return check(node, index, valueNode); + }); + + if (needsFix) { + setDeclarationValue(node, parsedValue.toString()); + } + } + + root.walkAtRules(checkAtRule); + root.walkDecls(checkDecl); + }; +}; + +/** + * @param {import('postcss').Declaration} decl + * @param {import('postcss-value-parser').Node[]} nodes + * @param {number} index + */ +function isLineHeightValue({ prop }, nodes, index) { + const lastNode = nodes[index - 1]; + + return ( + prop.toLowerCase() === 'font' && lastNode && lastNode.type === 'div' && lastNode.value === '/' + ); +} + +/** + * @param {string} prop + */ +function isLineHeight(prop) { + return prop.toLowerCase() === 'line-height'; +} + +/** + * @param {string} prop + */ +function isFlex(prop) { + return prop.toLowerCase() === 'flex'; +} + +/** + * @param {import('postcss-value-parser').Node} node + */ +function isWord({ type }) { + return type === 'word'; +} + +/** + * @param {string} unit + */ +function isLength(unit) { + return lengthUnits.has(unit.toLowerCase()); +} + +/** + * @param {import('postcss-value-parser').Node} node + */ +function isFunction({ type }) { + return type === 'function'; +} + +/** + * @param {string} unit + */ +function isFraction(unit) { + return unit.toLowerCase() === 'fr'; +} + +/** + * @param {string} number + */ +function isZero(number) { + return Number.parseFloat(number) === 0; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/linebreaks/index.js b/node_modules/stylelint/lib/rules/linebreaks/index.js new file mode 100644 index 000000000..e16dee79c --- /dev/null +++ b/node_modules/stylelint/lib/rules/linebreaks/index.js @@ -0,0 +1,132 @@ +'use strict'; + +const postcss = require('postcss'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'linebreaks'; + +const messages = ruleMessages(ruleName, { + expected: (linebreak) => `Expected linebreak to be ${linebreak}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/linebreaks', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['unix', 'windows'], + }); + + if (!validOptions) { + return; + } + + const shouldHaveCR = primary === 'windows'; + + if (context.fix) { + root.walk((node) => { + if ('selector' in node) { + node.selector = fixData(node.selector); + } + + if ('value' in node) { + node.value = fixData(node.value); + } + + if ('text' in node) { + node.text = fixData(node.text); + } + + if (node.raws.before) { + node.raws.before = fixData(node.raws.before); + } + + if (typeof node.raws.after === 'string') { + node.raws.after = fixData(node.raws.after); + } + }); + + if (typeof root.raws.after === 'string') { + root.raws.after = fixData(root.raws.after); + } + } else { + if (root.source == null) throw new Error('The root node must have a source'); + + const lines = root.source.input.css.split('\n'); + + for (let [i, line] of lines.entries()) { + if (i < lines.length - 1 && !line.includes('\r')) { + line += '\n'; + } + + if (hasError(line)) { + const lineNum = i + 1; + const colNum = line.length; + + reportNewlineError(lineNum, colNum); + } + } + } + + /** + * @param {string} dataToCheck + */ + function hasError(dataToCheck) { + const hasNewlineToVerify = /[\r\n]/.test(dataToCheck); + const hasCR = hasNewlineToVerify ? /\r/.test(dataToCheck) : false; + + return hasNewlineToVerify && hasCR !== shouldHaveCR; + } + + /** + * @param {string} data + */ + function fixData(data) { + if (data) { + let res = data.replace(/\r/g, ''); + + if (shouldHaveCR) { + res = res.replace(/\n/g, '\r\n'); + } + + return res; + } + + return data; + } + + /** + * @param {number} line + * @param {number} column + */ + function reportNewlineError(line, column) { + // Creating a node manually helps us to point to empty lines. + const node = postcss.rule({ + source: { + start: { line, column, offset: 0 }, + input: new postcss.Input(''), + }, + }); + + report({ + message: messages.expected(primary), + node, + result, + ruleName, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/max-empty-lines/index.js b/node_modules/stylelint/lib/rules/max-empty-lines/index.js new file mode 100644 index 000000000..e68be5554 --- /dev/null +++ b/node_modules/stylelint/lib/rules/max-empty-lines/index.js @@ -0,0 +1,219 @@ +'use strict'; + +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const styleSearch = require('style-search'); +const validateOptions = require('../../utils/validateOptions'); +const { isNumber } = require('../../utils/validateTypes'); + +const ruleName = 'max-empty-lines'; + +const messages = ruleMessages(ruleName, { + expected: (max) => `Expected no more than ${max} empty ${max === 1 ? 'line' : 'lines'}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/max-empty-lines', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + let emptyLines = 0; + let lastIndex = -1; + + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: isNumber, + }, + { + actual: secondaryOptions, + possible: { + ignore: ['comments'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const ignoreComments = optionsMatches(secondaryOptions, 'ignore', 'comments'); + const getChars = replaceEmptyLines.bind(null, primary); + + /** + * 1. walk nodes & replace enterchar + * 2. deal with special case. + */ + if (context.fix) { + root.walk((node) => { + if (node.type === 'comment' && !ignoreComments) { + node.raws.left = getChars(node.raws.left); + node.raws.right = getChars(node.raws.right); + } + + if (node.raws.before) { + node.raws.before = getChars(node.raws.before); + } + }); + + // first node + const firstNodeRawsBefore = root.first && root.first.raws.before; + // root raws + const rootRawsAfter = root.raws.after; + + // not document node + // @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Root'. + if ((root.document && root.document.constructor.name) !== 'Document') { + if (firstNodeRawsBefore) { + root.first.raws.before = getChars(firstNodeRawsBefore, true); + } + + if (rootRawsAfter) { + // when max set 0, should be treated as 1 in this situation. + root.raws.after = replaceEmptyLines(primary === 0 ? 1 : primary, rootRawsAfter, true); + } + } else if (rootRawsAfter) { + // `css in js` or `html` + root.raws.after = replaceEmptyLines(primary === 0 ? 1 : primary, rootRawsAfter); + } + + return; + } + + emptyLines = 0; + lastIndex = -1; + const rootString = root.toString(); + + styleSearch( + { + source: rootString, + target: /\r\n/.test(rootString) ? '\r\n' : '\n', + comments: ignoreComments ? 'skip' : 'check', + }, + (match) => { + checkMatch(rootString, match.startIndex, match.endIndex, root); + }, + ); + + /** + * @param {string} source + * @param {number} matchStartIndex + * @param {number} matchEndIndex + * @param {import('postcss').Root} node + */ + function checkMatch(source, matchStartIndex, matchEndIndex, node) { + const eof = matchEndIndex === source.length; + let problem = false; + + // Additional check for beginning of file + if (!matchStartIndex || lastIndex === matchStartIndex) { + emptyLines++; + } else { + emptyLines = 0; + } + + lastIndex = matchEndIndex; + + if (emptyLines > primary) problem = true; + + if (!eof && !problem) return; + + if (problem) { + report({ + message: messages.expected(primary), + node, + index: matchStartIndex, + result, + ruleName, + }); + } + + // Additional check for end of file + if (eof && primary) { + emptyLines++; + + if (emptyLines > primary && isEofNode(result.root, node)) { + report({ + message: messages.expected(primary), + node, + index: matchEndIndex, + result, + ruleName, + }); + } + } + } + + /** + * @param {number} maxLines + * @param {unknown} str + * @param {boolean?} isSpecialCase + */ + function replaceEmptyLines(maxLines, str, isSpecialCase = false) { + const repeatTimes = isSpecialCase ? maxLines : maxLines + 1; + + if (repeatTimes === 0 || typeof str !== 'string') { + return ''; + } + + const emptyLFLines = '\n'.repeat(repeatTimes); + const emptyCRLFLines = '\r\n'.repeat(repeatTimes); + + return /(?:\r\n)+/.test(str) + ? str.replace(/(\r\n)+/g, ($1) => { + if ($1.length / 2 > repeatTimes) { + return emptyCRLFLines; + } + + return $1; + }) + : str.replace(/(\n)+/g, ($1) => { + if ($1.length > repeatTimes) { + return emptyLFLines; + } + + return $1; + }); + } + }; +}; + +/** + * Checks whether the given node is the last node of file. + * @param {import('stylelint').PostcssResult['root']} document - the document node with `postcss-html` and `postcss-jsx`. + * @param {import('postcss').Root} root - the root node of css + */ +function isEofNode(document, root) { + if (!document || document.constructor.name !== 'Document' || !('type' in document)) { + return true; + } + + // In the `postcss-html` and `postcss-jsx` syntax, checks that there is text after the given node. + let after; + + if (root === document.last) { + after = document.raws && document.raws.codeAfter; + } else { + // @ts-expect-error -- TS2345: Argument of type 'Root' is not assignable to parameter of type 'number | ChildNode'. + const rootIndex = document.index(root); + + const nextNode = document.nodes[rootIndex + 1]; + + after = nextNode && nextNode.raws && nextNode.raws.codeBefore; + } + + return !String(after).trim(); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/max-line-length/index.js b/node_modules/stylelint/lib/rules/max-line-length/index.js new file mode 100644 index 000000000..87aa7c8bc --- /dev/null +++ b/node_modules/stylelint/lib/rules/max-line-length/index.js @@ -0,0 +1,203 @@ +'use strict'; + +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const styleSearch = require('style-search'); +const validateOptions = require('../../utils/validateOptions'); +const { isNumber, isRegExp, isString, assert } = require('../../utils/validateTypes'); + +const ruleName = 'max-line-length'; + +const messages = ruleMessages(ruleName, { + expected: (max) => + `Expected line length to be no more than ${max} ${max === 1 ? 'character' : 'characters'}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/max-line-length', + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: isNumber, + }, + { + actual: secondaryOptions, + possible: { + ignore: ['non-comments', 'comments'], + ignorePattern: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + if (root.source == null) { + throw new Error('The root node must have a source'); + } + + const EXCLUDED_PATTERNS = [ + /url\(\s*(\S.*\S)\s*\)/gi, // allow tab, whitespace in url content + /@import\s+(['"].*['"])/gi, + ]; + + const ignoreNonComments = optionsMatches(secondaryOptions, 'ignore', 'non-comments'); + const ignoreComments = optionsMatches(secondaryOptions, 'ignore', 'comments'); + const rootString = context.fix ? root.toString() : root.source.input.css; + // Array of skipped sub strings, i.e `url(...)`, `@import "..."` + /** @type {Array<[number, number]>} */ + let skippedSubStrings = []; + let skippedSubStringsIndex = 0; + + for (const pattern of EXCLUDED_PATTERNS) { + for (const match of rootString.matchAll(pattern)) { + const subMatch = match[1] || ''; + const startOfSubString = (match.index || 0) + (match[0] || '').indexOf(subMatch); + + skippedSubStrings.push([startOfSubString, startOfSubString + subMatch.length]); + } + } + + skippedSubStrings = skippedSubStrings.sort((a, b) => a[0] - b[0]); + + // Check first line + checkNewline({ endIndex: 0 }); + // Check subsequent lines + styleSearch({ source: rootString, target: ['\n'], comments: 'check' }, (match) => + checkNewline(match), + ); + + /** + * @param {number} index + */ + function complain(index) { + report({ + index, + result, + ruleName, + message: messages.expected(primary), + node: root, + }); + } + + /** + * @param {number} start + * @param {number} end + */ + function tryToPopSubString(start, end) { + const skippedSubString = skippedSubStrings[skippedSubStringsIndex]; + + assert(skippedSubString); + const [startSubString, endSubString] = skippedSubString; + + // Excluded substring does not presented in current line + if (end < startSubString) { + return 0; + } + + // Compute excluded substring size regarding to current line indexes + const excluded = Math.min(end, endSubString) - Math.max(start, startSubString); + + // Current substring is out of range for next lines + if (endSubString <= end) { + skippedSubStringsIndex++; + } + + return excluded; + } + + /** + * @param {import('style-search').StyleSearchMatch | { endIndex: number }} match + */ + function checkNewline(match) { + let nextNewlineIndex = rootString.indexOf('\n', match.endIndex); + + if (rootString[nextNewlineIndex - 1] === '\r') { + nextNewlineIndex -= 1; + } + + // Accommodate last line + if (nextNewlineIndex === -1) { + nextNewlineIndex = rootString.length; + } + + const rawLineLength = nextNewlineIndex - match.endIndex; + const excludedLength = skippedSubStrings[skippedSubStringsIndex] + ? tryToPopSubString(match.endIndex, nextNewlineIndex) + : 0; + const lineText = rootString.slice(match.endIndex, nextNewlineIndex); + + // Case sensitive ignorePattern match + if (optionsMatches(secondaryOptions, 'ignorePattern', lineText)) { + return; + } + + // If the line's length is less than or equal to the specified + // max, ignore it ... So anything below is liable to be complained about. + // **Note that the length of any url arguments or import urls + // are excluded from the calculation.** + if (rawLineLength - excludedLength <= primary) { + return; + } + + const complaintIndex = nextNewlineIndex - 1; + + if (ignoreComments) { + if ('insideComment' in match && match.insideComment) { + return; + } + + // This trimming business is to notice when the line starts a + // comment but that comment is indented, e.g. + // /* something here */ + const nextTwoChars = rootString.slice(match.endIndex).trim().slice(0, 2); + + if (nextTwoChars === '/*' || nextTwoChars === '//') { + return; + } + } + + if (ignoreNonComments) { + if ('insideComment' in match && match.insideComment) { + return complain(complaintIndex); + } + + // This trimming business is to notice when the line starts a + // comment but that comment is indented, e.g. + // /* something here */ + const nextTwoChars = rootString.slice(match.endIndex).trim().slice(0, 2); + + if (nextTwoChars !== '/*' && nextTwoChars !== '//') { + return; + } + + return complain(complaintIndex); + } + + // If there are no spaces besides initial (indent) spaces, ignore it + const lineString = rootString.slice(match.endIndex, nextNewlineIndex); + + if (!lineString.replace(/^\s+/, '').includes(' ')) { + return; + } + + return complain(complaintIndex); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/max-nesting-depth/index.js b/node_modules/stylelint/lib/rules/max-nesting-depth/index.js new file mode 100644 index 000000000..a1211c94f --- /dev/null +++ b/node_modules/stylelint/lib/rules/max-nesting-depth/index.js @@ -0,0 +1,166 @@ +'use strict'; + +const hasBlock = require('../../utils/hasBlock'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const optionsMatches = require('../../utils/optionsMatches'); +const parser = require('postcss-selector-parser'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isAtRule, isDeclaration, isRoot, isRule } = require('../../utils/typeGuards'); +const { isNumber, isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'max-nesting-depth'; + +const messages = ruleMessages(ruleName, { + expected: (depth) => `Expected nesting depth to be no more than ${depth}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/max-nesting-depth', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + /** + * @param {import('postcss').Node} node + */ + const isIgnoreAtRule = (node) => + isAtRule(node) && optionsMatches(secondaryOptions, 'ignoreAtRules', node.name); + + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [isNumber], + }, + { + optional: true, + actual: secondaryOptions, + possible: { + ignore: ['blockless-at-rules', 'pseudo-classes'], + ignoreAtRules: [isString, isRegExp], + ignorePseudoClasses: [isString, isRegExp], + }, + }, + ); + + if (!validOptions) return; + + root.walkRules(checkStatement); + root.walkAtRules(checkStatement); + + /** + * @param {import('postcss').Rule | import('postcss').AtRule} statement + */ + function checkStatement(statement) { + if (isIgnoreAtRule(statement)) { + return; + } + + if (!hasBlock(statement)) { + return; + } + + if (isRule(statement) && !isStandardSyntaxRule(statement)) { + return; + } + + const depth = nestingDepth(statement, 0); + + if (depth > primary) { + report({ + ruleName, + result, + node: statement, + message: messages.expected, + messageArgs: [primary], + }); + } + } + }; + + /** + * @param {import('postcss').Node} node + * @param {number} level + * @returns {number} + */ + function nestingDepth(node, level) { + const parent = node.parent; + + if (!parent) { + return 0; + } + + if (isIgnoreAtRule(parent)) { + return 0; + } + + // The nesting depth level's computation has finished + // when this function, recursively called, receives + // a node that is not nested -- a direct child of the + // root node + if (isRoot(parent) || (isAtRule(parent) && parent.parent && isRoot(parent.parent))) { + return level; + } + + /** + * @param {string} selector + */ + function containsPseudoClassesOnly(selector) { + const normalized = parser().processSync(selector, { lossless: false }); + const selectors = normalized.split(','); + + return selectors.every((sel) => extractPseudoRule(sel)); + } + + /** + * @param {string[]} selectors + * @returns {boolean} + */ + function containsIgnoredPseudoClassesOnly(selectors) { + if (!(secondaryOptions && secondaryOptions.ignorePseudoClasses)) return false; + + return selectors.every((selector) => { + const pseudoRule = extractPseudoRule(selector); + + if (!pseudoRule) return false; + + return optionsMatches(secondaryOptions, 'ignorePseudoClasses', pseudoRule); + }); + } + + if ( + (optionsMatches(secondaryOptions, 'ignore', 'blockless-at-rules') && + isAtRule(node) && + node.every((child) => !isDeclaration(child))) || + (optionsMatches(secondaryOptions, 'ignore', 'pseudo-classes') && + isRule(node) && + containsPseudoClassesOnly(node.selector)) || + (isRule(node) && containsIgnoredPseudoClassesOnly(node.selectors)) + ) { + return nestingDepth(parent, level); + } + + // Unless any of the conditions above apply, we want to + // add 1 to the nesting depth level and then check the parent, + // continuing to add and move up the hierarchy + // until we hit the root node + return nestingDepth(parent, level + 1); + } +}; + +/** + * @param {string} selector + * @returns {string | undefined} + */ +function extractPseudoRule(selector) { + return selector.startsWith('&:') && selector[2] !== ':' ? selector.slice(2) : undefined; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-colon-space-after/index.js b/node_modules/stylelint/lib/rules/media-feature-colon-space-after/index.js new file mode 100644 index 000000000..f456adf0d --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-colon-space-after/index.js @@ -0,0 +1,87 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const mediaFeatureColonSpaceChecker = require('../mediaFeatureColonSpaceChecker'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'media-feature-colon-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected single space after ":"', + rejectedAfter: () => 'Unexpected whitespace after ":"', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-colon-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + /** @type {Map | undefined} */ + let fixData; + + mediaFeatureColonSpaceChecker({ + root, + result, + locationChecker: checker.after, + checkedRuleName: ruleName, + fix: context.fix + ? (atRule, index) => { + const paramColonIndex = index - atRuleParamIndex(atRule); + + fixData = fixData || new Map(); + const colonIndices = fixData.get(atRule) || []; + + colonIndices.push(paramColonIndex); + fixData.set(atRule, colonIndices); + + return true; + } + : null, + }); + + if (fixData) { + for (const [atRule, colonIndices] of fixData.entries()) { + let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; + + for (const index of colonIndices.sort((a, b) => b - a)) { + const beforeColon = params.slice(0, index + 1); + const afterColon = params.slice(index + 1); + + if (primary === 'always') { + params = beforeColon + afterColon.replace(/^\s*/, ' '); + } else if (primary === 'never') { + params = beforeColon + afterColon.replace(/^\s*/, ''); + } + } + + if (atRule.raws.params) { + atRule.raws.params.raw = params; + } else { + atRule.params = params; + } + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-colon-space-before/index.js b/node_modules/stylelint/lib/rules/media-feature-colon-space-before/index.js new file mode 100644 index 000000000..4bdc41b99 --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-colon-space-before/index.js @@ -0,0 +1,87 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const mediaFeatureColonSpaceChecker = require('../mediaFeatureColonSpaceChecker'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'media-feature-colon-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before ":"', + rejectedBefore: () => 'Unexpected whitespace before ":"', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-colon-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + /** @type {Map | undefined} */ + let fixData; + + mediaFeatureColonSpaceChecker({ + root, + result, + locationChecker: checker.before, + checkedRuleName: ruleName, + fix: context.fix + ? (atRule, index) => { + const paramColonIndex = index - atRuleParamIndex(atRule); + + fixData = fixData || new Map(); + const colonIndices = fixData.get(atRule) || []; + + colonIndices.push(paramColonIndex); + fixData.set(atRule, colonIndices); + + return true; + } + : null, + }); + + if (fixData) { + for (const [atRule, colonIndices] of fixData.entries()) { + let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; + + for (const index of colonIndices.sort((a, b) => b - a)) { + const beforeColon = params.slice(0, index); + const afterColon = params.slice(index); + + if (primary === 'always') { + params = beforeColon.replace(/\s*$/, ' ') + afterColon; + } else if (primary === 'never') { + params = beforeColon.replace(/\s*$/, '') + afterColon; + } + } + + if (atRule.raws.params) { + atRule.raws.params.raw = params; + } else { + atRule.params = params; + } + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-allowed-list/index.js b/node_modules/stylelint/lib/rules/media-feature-name-allowed-list/index.js new file mode 100644 index 000000000..9c89fd79d --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-name-allowed-list/index.js @@ -0,0 +1,68 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const findMediaFeatureNames = require('../../utils/findMediaFeatureNames'); +const getAtRuleParams = require('../../utils/getAtRuleParams'); +const isCustomMediaQuery = require('../../utils/isCustomMediaQuery'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'media-feature-name-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (name) => `Unexpected media feature name "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-name-allowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^media$/i, (atRule) => { + findMediaFeatureNames(getAtRuleParams(atRule), (mediaFeatureNameToken) => { + const [, , startIndex, endIndex, { value: featureName }] = mediaFeatureNameToken; + + if (isCustomMediaQuery(featureName)) { + return; + } + + if (matchesStringOrRegExp(featureName, primary)) { + return; + } + + const atRuleIndex = atRuleParamIndex(atRule); + + report({ + message: messages.rejected, + messageArgs: [featureName], + node: atRule, + index: atRuleIndex + startIndex, + endIndex: atRuleIndex + endIndex + 1, + ruleName, + result, + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-case/index.js b/node_modules/stylelint/lib/rules/media-feature-name-case/index.js new file mode 100644 index 000000000..b2befcca1 --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-name-case/index.js @@ -0,0 +1,93 @@ +'use strict'; + +const { mutateIdent } = require('@csstools/css-tokenizer'); + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const findMediaFeatureNames = require('../../utils/findMediaFeatureNames'); +const isCustomMediaQuery = require('../../utils/isCustomMediaQuery'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'media-feature-name-case'; + +const messages = ruleMessages(ruleName, { + expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-name-case', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['lower', 'upper'], + }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^media$/i, (atRule) => { + let hasComments = atRule.raws.params?.raw; + let mediaRule = hasComments ? hasComments : atRule.params; + + let hasFixes = false; + + mediaRule = findMediaFeatureNames(mediaRule, (mediaFeatureNameToken) => { + const [, , startIndex, endIndex, { value: featureName }] = mediaFeatureNameToken; + + if (isCustomMediaQuery(featureName)) { + return; + } + + const expectedFeatureName = + primary === 'lower' ? featureName.toLowerCase() : featureName.toUpperCase(); + + if (featureName === expectedFeatureName) { + return; + } + + if (context.fix) { + mutateIdent(mediaFeatureNameToken, expectedFeatureName); + hasFixes = true; + + return; + } + + const atRuleIndex = atRuleParamIndex(atRule); + + report({ + message: messages.expected(featureName, expectedFeatureName), + node: atRule, + index: atRuleIndex + startIndex, + endIndex: atRuleIndex + endIndex + 1, + ruleName, + result, + }); + }).stringify(); + + if (hasFixes) { + if (hasComments) { + if (atRule.raws.params == null) { + throw new Error('The `AtRuleRaws` node must have a `params` property'); + } + + atRule.raws.params.raw = mediaRule; + } else { + atRule.params = mediaRule; + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-disallowed-list/index.js b/node_modules/stylelint/lib/rules/media-feature-name-disallowed-list/index.js new file mode 100644 index 000000000..62caa3b4a --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-name-disallowed-list/index.js @@ -0,0 +1,68 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const findMediaFeatureNames = require('../../utils/findMediaFeatureNames'); +const getAtRuleParams = require('../../utils/getAtRuleParams'); +const isCustomMediaQuery = require('../../utils/isCustomMediaQuery'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'media-feature-name-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (name) => `Unexpected media feature name "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-name-disallowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^media$/i, (atRule) => { + findMediaFeatureNames(getAtRuleParams(atRule), (mediaFeatureNameToken) => { + const [, , startIndex, endIndex, { value: featureName }] = mediaFeatureNameToken; + + if (isCustomMediaQuery(featureName)) { + return; + } + + if (!matchesStringOrRegExp(featureName, primary)) { + return; + } + + const atRuleIndex = atRuleParamIndex(atRule); + + report({ + message: messages.rejected, + messageArgs: [featureName], + node: atRule, + index: atRuleIndex + startIndex, + endIndex: atRuleIndex + endIndex + 1, + ruleName, + result, + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-no-unknown/index.js b/node_modules/stylelint/lib/rules/media-feature-name-no-unknown/index.js new file mode 100644 index 000000000..897abb612 --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-name-no-unknown/index.js @@ -0,0 +1,80 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const findMediaFeatureNames = require('../../utils/findMediaFeatureNames'); +const getAtRuleParams = require('../../utils/getAtRuleParams'); +const isCustomMediaQuery = require('../../utils/isCustomMediaQuery'); +const { mediaFeatureNames } = require('../../reference/mediaFeatures'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'media-feature-name-no-unknown'; + +const messages = ruleMessages(ruleName, { + rejected: (mediaFeatureName) => `Unexpected unknown media feature name "${mediaFeatureName}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-name-no-unknown', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignoreMediaFeatureNames: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^media$/i, (atRule) => { + findMediaFeatureNames(getAtRuleParams(atRule), (mediaFeatureNameToken) => { + const [, , startIndex, endIndex, { value: featureName }] = mediaFeatureNameToken; + + if (isCustomMediaQuery(featureName)) { + return; + } + + if (optionsMatches(secondaryOptions, 'ignoreMediaFeatureNames', featureName)) { + return; + } + + if (vendor.prefix(featureName) || mediaFeatureNames.has(featureName.toLowerCase())) { + return; + } + + const atRuleIndex = atRuleParamIndex(atRule); + + report({ + message: messages.rejected, + messageArgs: [featureName], + node: atRule, + index: atRuleIndex + startIndex, + endIndex: atRuleIndex + endIndex + 1, + ruleName, + result, + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-no-vendor-prefix/index.js b/node_modules/stylelint/lib/rules/media-feature-name-no-vendor-prefix/index.js new file mode 100644 index 000000000..941f246d8 --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-name-no-vendor-prefix/index.js @@ -0,0 +1,63 @@ +'use strict'; + +const isAutoprefixable = require('../../utils/isAutoprefixable'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'media-feature-name-no-vendor-prefix'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected vendor-prefix', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-name-no-vendor-prefix', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^media$/i, (atRule) => { + const params = atRule.params; + + if (!isAutoprefixable.mediaFeatureName(params)) { + return; + } + + const matches = atRule.toString().match(/(?:min-|max-)?-[a-z-]+device-pixel-ratio/gi); + + if (!matches) { + return; + } + + if (context.fix) { + atRule.params = isAutoprefixable.unprefix(atRule.params); + + return; + } + + for (const match of matches) { + report({ + message: messages.rejected, + node: atRule, + word: match, + result, + ruleName, + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-unit-allowed-list/index.js b/node_modules/stylelint/lib/rules/media-feature-name-unit-allowed-list/index.js new file mode 100644 index 000000000..b8329396b --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-name-unit-allowed-list/index.js @@ -0,0 +1,108 @@ +'use strict'; + +const { TokenType } = require('@csstools/css-tokenizer'); +const { isTokenNode } = require('@csstools/css-parser-algorithms'); +const { + isMediaFeaturePlain, + isMediaFeatureRange, + isMediaQueryInvalid, +} = require('@csstools/media-query-list-parser'); + +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); +const { isString } = require('../../utils/validateTypes'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const parseMediaQuery = require('../../utils/parseMediaQuery'); + +const ruleName = 'media-feature-name-unit-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (unit, name) => `Unexpected unit "${unit}" for name "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-name-unit-allowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [validateObjectWithArrayProps(isString)], + }); + + if (!validOptions) { + return; + } + + const primaryPairs = Object.entries(primary); + const primaryUnitList = (/** @type {string} */ featureName) => { + for (const [name, unit] of primaryPairs) { + if (matchesStringOrRegExp(featureName, name)) return [unit].flat(); + } + + return undefined; + }; + + root.walkAtRules(/^media$/i, (atRule) => { + const mediaQueryList = parseMediaQuery(atRule); + + mediaQueryList.forEach((mediaQuery) => { + if (isMediaQueryInvalid(mediaQuery)) return; + + const initialState = { + mediaFeatureName: '', + /** @type {string[] | undefined} */ + unitList: undefined, + }; + + mediaQuery.walk(({ node, state }) => { + if (!state) return; + + if (isMediaFeaturePlain(node) || isMediaFeatureRange(node)) { + state.mediaFeatureName = node.getName(); + state.unitList = primaryUnitList(state.mediaFeatureName); + + return; + } + + if (!isTokenNode(node)) return; + + const { mediaFeatureName, unitList } = state; + + if (!mediaFeatureName || !unitList) return; + + const [tokenType, , startIndex, endIndex, parsedValue] = node.value; + + if (tokenType !== TokenType.Dimension) { + return; + } + + if (unitList.includes(parsedValue.unit.toLowerCase())) { + return; + } + + const atRuleIndex = atRuleParamIndex(atRule); + + report({ + message: messages.rejected(parsedValue.unit, mediaFeatureName), + node: atRule, + index: atRuleIndex + startIndex, + endIndex: atRuleIndex + endIndex + 1, + result, + ruleName, + }); + }, initialState); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-value-allowed-list/index.js b/node_modules/stylelint/lib/rules/media-feature-name-value-allowed-list/index.js new file mode 100644 index 000000000..01f21865b --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-name-value-allowed-list/index.js @@ -0,0 +1,104 @@ +'use strict'; + +const { sourceIndices } = require('@csstools/css-parser-algorithms'); +const { + isMediaQueryInvalid, + isMediaFeature, + isMediaFeatureValue, +} = require('@csstools/media-query-list-parser'); + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const optionsMatches = require('../../utils/optionsMatches'); +const parseMediaQuery = require('../../utils/parseMediaQuery'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isString, isRegExp } = require('../../utils/validateTypes'); + +const ruleName = 'media-feature-name-value-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (name, value) => `Unexpected value "${value}" for name "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-name-value-allowed-list', +}; + +/** @type {import('stylelint').Rule>>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [validateObjectWithArrayProps(isString, isRegExp)], + }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^media$/i, (atRule) => { + parseMediaQuery(atRule).forEach((mediaQuery) => { + if (isMediaQueryInvalid(mediaQuery)) return; + + const initialState = { + mediaFeatureName: '', + unprefixedMediaFeatureName: '', + }; + + mediaQuery.walk(({ node, state }) => { + if (!state) return; + + if (isMediaFeature(node)) { + state.mediaFeatureName = node.getName(); + state.unprefixedMediaFeatureName = vendor.unprefixed(node.getName()); + + return; + } + + if (!isMediaFeatureValue(node)) return; + + const { mediaFeatureName, unprefixedMediaFeatureName } = state; + + if (!mediaFeatureName || !unprefixedMediaFeatureName) return; + + const componentValues = [node.value].flat(); + const value = componentValues.map((x) => x.toString()).join(''); + + const allowedValuesKey = Object.keys(primary).find((featureName) => + matchesStringOrRegExp(unprefixedMediaFeatureName, featureName), + ); + + if (allowedValuesKey == null) { + return; + } + + if (optionsMatches(primary, allowedValuesKey, value)) { + return; + } + + const atRuleIndex = atRuleParamIndex(atRule); + const [startIndex, endIndex] = sourceIndices(componentValues); + + report({ + index: atRuleIndex + startIndex, + endIndex: atRuleIndex + endIndex + 1, + message: messages.rejected, + messageArgs: [mediaFeatureName, value], + node: atRule, + ruleName, + result, + }); + }, initialState); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-value-no-unknown/index.js b/node_modules/stylelint/lib/rules/media-feature-name-value-no-unknown/index.js new file mode 100644 index 000000000..dc85897b4 --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-name-value-no-unknown/index.js @@ -0,0 +1,277 @@ +'use strict'; + +const { TokenType, NumberType } = require('@csstools/css-tokenizer'); +const { isTokenNode, isFunctionNode, sourceIndices } = require('@csstools/css-parser-algorithms'); +const { + isMediaFeature, + isMediaFeatureValue, + matchesRatioExactly, + isMediaQueryInvalid, +} = require('@csstools/media-query-list-parser'); + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const parseMediaQuery = require('../../utils/parseMediaQuery'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { lengthUnits, resolutionUnits } = require('../../reference/units'); +const { mathFunctions } = require('../../reference/functions'); +const { + mediaFeatureNameAllowedValueKeywords, + mediaFeatureNameAllowedValueTypes, + mediaFeatureNames, +} = require('../../reference/mediaFeatures'); + +const ruleName = 'media-feature-name-value-no-unknown'; + +const messages = ruleMessages(ruleName, { + rejected: (name, value) => `Unexpected unknown media feature value "${value}" for name "${name}"`, +}); + +const HAS_MIN_MAX_PREFIX = /^(?:min|max)-/i; + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-name-value-no-unknown', +}; + +/** @typedef {{ mediaFeatureName: string, mediaFeatureNameRaw: string }} State */ +/** @typedef { (state: State, valuePart: string, start: number, end: number) => void } Reporter */ + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + /** + * Check that a single token value is valid for a given media feature name. + * + * @param {State} state + * @param {import('@csstools/css-tokenizer').CSSToken} token + * @param {Reporter} reporter + * @returns {void} + */ + function checkSingleToken(state, token, reporter) { + const [type, raw, start, end, parsed] = token; + + if (type === TokenType.Ident) { + const supportedKeywords = mediaFeatureNameAllowedValueKeywords.get(state.mediaFeatureName); + + if (supportedKeywords) { + const keyword = vendor.unprefixed(parsed.value.toLowerCase()); + + if (supportedKeywords.has(keyword)) return; + } + + // An ident that isn't expected for the given media feature name + reporter(state, raw, start, end); + + return; + } + + const supportedValueTypes = mediaFeatureNameAllowedValueTypes.get(state.mediaFeatureName); + + if (!supportedValueTypes) { + // The given media feature name doesn't support any single token values. + reporter(state, raw, start, end); + + return; + } + + if (type === TokenType.Number) { + if (parsed.type === NumberType.Integer) { + if ( + // Integer values are valid for types "integer" and "ratio". + supportedValueTypes.has('integer') || + supportedValueTypes.has('ratio') || + // Integer values of "0" are also valid for "length", "resolution" and "mq-boolean". + (parsed.value === 0 && + (supportedValueTypes.has('length') || + supportedValueTypes.has('resolution') || + supportedValueTypes.has('mq-boolean'))) || + // Integer values of "1" are also valid for "mq-boolean". + (parsed.value === 1 && supportedValueTypes.has('mq-boolean')) + ) { + return; + } + + // An integer when the media feature doesn't support integers. + reporter(state, raw, start, end); + + return; + } + + if ( + // Numbers are valid for "ratio". + supportedValueTypes.has('ratio') || + // Numbers with value "0" are also valid for "length". + (parsed.value === 0 && + (supportedValueTypes.has('length') || supportedValueTypes.has('resolution'))) + ) { + return; + } + + // A number when the media feature doesn't support numbers. + reporter(state, raw, start, end); + + return; + } + + if (type === TokenType.Dimension) { + const unit = parsed.unit.toLowerCase(); + + if (supportedValueTypes.has('resolution') && resolutionUnits.has(unit)) return; + + if (supportedValueTypes.has('length') && lengthUnits.has(unit)) return; + + // An unexpected dimension or a media feature that doesn't support dimensions. + reporter(state, raw, start, end); + } + } + + /** + * Check that a function node is valid for a given media feature name. + * + * @param {State} state + * @param {import('@csstools/css-parser-algorithms').FunctionNode} functionNode + * @param {Reporter} reporter + * @returns {void} + */ + function checkFunction(state, functionNode, reporter) { + const functionName = functionNode.getName().toLowerCase(); + + // "env()" can represent any value, it is treated as valid for static analysis. + if (functionName === 'env') return; + + const supportedValueTypes = mediaFeatureNameAllowedValueTypes.get(state.mediaFeatureName); + + if ( + supportedValueTypes && + mathFunctions.has(functionName) && + (supportedValueTypes.has('integer') || + supportedValueTypes.has('length') || + supportedValueTypes.has('ratio') || + supportedValueTypes.has('resolution')) + ) { + return; + } + + // An unexpected function or a media feature that doesn't support types that can be the result of a function. + reporter(state, functionNode.toString(), ...sourceIndices(functionNode)); + } + + /** + * Check that an array of component values is valid for a given media feature name. + * + * @param {State} state + * @param {Array} componentValues + * @param {Reporter} reporter + * @returns {void} + */ + function checkListOfComponentValues(state, componentValues, reporter) { + const supportedValueTypes = mediaFeatureNameAllowedValueTypes.get(state.mediaFeatureName); + + if ( + supportedValueTypes && + supportedValueTypes.has('ratio') && + matchesRatioExactly(componentValues) !== -1 + ) { + return; + } + + // An invalid aspect ratio or a media feature that doesn't support aspect ratios. + reporter( + state, + componentValues.map((x) => x.toString()).join(''), + ...sourceIndices(componentValues), + ); + } + + /** + * @param {State} state + * @param {import('@csstools/media-query-list-parser').MediaFeatureValue} valueNode + * @param {Reporter} reporter + * @returns {void} + */ + function checkMediaFeatureValue(state, valueNode, reporter) { + if (isTokenNode(valueNode.value)) { + checkSingleToken(state, valueNode.value.value, reporter); + + return; + } + + if (isFunctionNode(valueNode.value)) { + checkFunction(state, valueNode.value, reporter); + + return; + } + + if (Array.isArray(valueNode.value)) { + checkListOfComponentValues(state, valueNode.value, reporter); + } + } + + root.walkAtRules(/^media$/i, (atRule) => { + /** + * @type {Reporter} + */ + const reporter = (state, valuePart, start, end) => { + const atRuleParamIndexValue = atRuleParamIndex(atRule); + + report({ + message: messages.rejected, + messageArgs: [state.mediaFeatureNameRaw, valuePart], + index: atRuleParamIndexValue + start, + endIndex: atRuleParamIndexValue + end + 1, + node: atRule, + ruleName, + result, + }); + }; + + /** @type {State} */ + const initialState = { + mediaFeatureName: '', + mediaFeatureNameRaw: '', + }; + + parseMediaQuery(atRule).forEach((mediaQuery) => { + if (isMediaQueryInvalid(mediaQuery)) return; + + mediaQuery.walk(({ node, state }) => { + if (!state) return; + + if (isMediaFeature(node)) { + const mediaFeatureNameRaw = node.getName(); + let mediaFeatureName = vendor.unprefixed(mediaFeatureNameRaw.toLowerCase()); + + // Unknown media feature names are handled by "media-feature-name-no-unknown". + if (!mediaFeatureNames.has(mediaFeatureName)) return; + + mediaFeatureName = mediaFeatureName.replace(HAS_MIN_MAX_PREFIX, ''); + + state.mediaFeatureName = mediaFeatureName; + state.mediaFeatureNameRaw = mediaFeatureNameRaw; + + return; + } + + if (!state.mediaFeatureName || !state.mediaFeatureNameRaw) return; + + if (isMediaFeatureValue(node)) { + checkMediaFeatureValue(state, node, reporter); + } + }, initialState); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-parentheses-space-inside/index.js b/node_modules/stylelint/lib/rules/media-feature-parentheses-space-inside/index.js new file mode 100644 index 000000000..800823b8e --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-parentheses-space-inside/index.js @@ -0,0 +1,112 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); + +const ruleName = 'media-feature-parentheses-space-inside'; + +const messages = ruleMessages(ruleName, { + expectedOpening: 'Expected single space after "("', + rejectedOpening: 'Unexpected whitespace after "("', + expectedClosing: 'Expected single space before ")"', + rejectedClosing: 'Unexpected whitespace before ")"', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-parentheses-space-inside', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^media$/i, (atRule) => { + // If there are comments in the params, the complete string + // will be at atRule.raws.params.raw + const params = (atRule.raws.params && atRule.raws.params.raw) || atRule.params; + const indexBoost = atRuleParamIndex(atRule); + /** @type {Array<{ message: string, index: number }>} */ + const problems = []; + + const parsedParams = valueParser(params).walk((node) => { + if (node.type === 'function') { + const len = valueParser.stringify(node).length; + + if (primary === 'never') { + if (/[ \t]/.test(node.before)) { + if (context.fix) node.before = ''; + + problems.push({ + message: messages.rejectedOpening, + index: node.sourceIndex + 1 + indexBoost, + }); + } + + if (/[ \t]/.test(node.after)) { + if (context.fix) node.after = ''; + + problems.push({ + message: messages.rejectedClosing, + index: node.sourceIndex - 2 + len + indexBoost, + }); + } + } else if (primary === 'always') { + if (node.before === '') { + if (context.fix) node.before = ' '; + + problems.push({ + message: messages.expectedOpening, + index: node.sourceIndex + 1 + indexBoost, + }); + } + + if (node.after === '') { + if (context.fix) node.after = ' '; + + problems.push({ + message: messages.expectedClosing, + index: node.sourceIndex - 2 + len + indexBoost, + }); + } + } + } + }); + + if (problems.length) { + if (context.fix) { + atRule.params = parsedParams.toString(); + + return; + } + + for (const err of problems) { + report({ + message: err.message, + node: atRule, + index: err.index, + result, + ruleName, + }); + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-range-notation/index.js b/node_modules/stylelint/lib/rules/media-feature-range-notation/index.js new file mode 100644 index 000000000..770daafa8 --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-range-notation/index.js @@ -0,0 +1,129 @@ +'use strict'; + +const { TokenType } = require('@csstools/css-tokenizer'); +const { TokenNode, sourceIndices } = require('@csstools/css-parser-algorithms'); +const { + MediaFeatureName, + MediaFeatureRangeNameValue, + isMediaFeature, + isMediaFeaturePlain, + isMediaFeatureRange, + isMediaQueryInvalid, +} = require('@csstools/media-query-list-parser'); + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const parseMediaQuery = require('../../utils/parseMediaQuery'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { rangeTypeMediaFeatureNames } = require('../../reference/mediaFeatures'); + +const ruleName = 'media-feature-range-notation'; + +const messages = ruleMessages(ruleName, { + expected: (primary) => `Expected "${primary}" media feature range notation`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-range-notation', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['prefix', 'context'], + }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^media$/i, (atRule) => { + const mediaQueryList = parseMediaQuery(atRule); + let hasFixes = false; + + mediaQueryList.forEach((mediaQuery) => { + if (isMediaQueryInvalid(mediaQuery)) return; + + mediaQuery.walk(({ node, parent }) => { + // Only look at plain and range notation media features + if (!isMediaFeatureRange(node) && !isMediaFeaturePlain(node)) return; + + // Expected plain notation and received plain notation + if (primary === 'prefix' && isMediaFeaturePlain(node)) return; + + // Expected range notation and received range notation + if (primary === 'context' && isMediaFeatureRange(node)) return; + + const featureName = node.getName(); + const unprefixedMediaFeature = featureName.replace(/^(?:min|max)-/i, ''); + + if (!rangeTypeMediaFeatureNames.has(unprefixedMediaFeature)) return; + + if (context.fix && primary === 'context' && isMediaFeaturePlain(node)) { + if (!isMediaFeature(parent)) return; + + hasFixes = true; + + /** @type {import('@csstools/css-tokenizer').TokenDelim} */ + const operator = /^min-/i.test(featureName) + ? [TokenType.Delim, '>', -1, -1, { value: '>' }] + : [TokenType.Delim, '<', -1, -1, { value: '<' }]; + + parent.feature = new MediaFeatureRangeNameValue( + new MediaFeatureName( + new TokenNode([ + TokenType.Ident, + unprefixedMediaFeature, + -1, + -1, + { value: unprefixedMediaFeature }, + ]), + node.name.before, + node.name.after.length > 0 + ? node.name.after + : [[TokenType.Whitespace, ' ', -1, -1, undefined]], + ), + [operator, [TokenType.Delim, '=', -1, -1, { value: '=' }]], + node.value, + ); + + return; + } + + const [startIndex, endIndex] = sourceIndices(node); + + const atRuleIndex = atRuleParamIndex(atRule); + + report({ + message: messages.expected, + messageArgs: [primary], + node: atRule, + index: atRuleIndex + startIndex - 1, + endIndex: atRuleIndex + endIndex + 1 + 1, + result, + ruleName, + }); + }); + }); + + if (hasFixes) { + const expectedMediaQueryList = mediaQueryList + .map((mediaQuery) => mediaQuery.toString()) + .join(','); + + if (expectedMediaQueryList === atRule.params) return; + + atRule.params = expectedMediaQueryList; + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-range-operator-space-after/index.js b/node_modules/stylelint/lib/rules/media-feature-range-operator-space-after/index.js new file mode 100644 index 000000000..95ba71161 --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-range-operator-space-after/index.js @@ -0,0 +1,104 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const findMediaOperator = require('../findMediaOperator'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'media-feature-range-operator-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected single space after range operator', + rejectedAfter: () => 'Unexpected whitespace after range operator', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-range-operator-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^media$/i, (atRule) => { + /** @type {number[]} */ + const fixOperatorIndices = []; + /** @type {((index: number) => void) | null} */ + const fix = context.fix ? (index) => fixOperatorIndices.push(index) : null; + + findMediaOperator(atRule, (match, params, node) => { + checkAfterOperator(match, params, node, fix); + }); + + if (fixOperatorIndices.length) { + let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; + + for (const index of fixOperatorIndices.sort((a, b) => b - a)) { + const beforeOperator = params.slice(0, index + 1); + const afterOperator = params.slice(index + 1); + + if (primary === 'always') { + params = beforeOperator + afterOperator.replace(/^\s*/, ' '); + } else if (primary === 'never') { + params = beforeOperator + afterOperator.replace(/^\s*/, ''); + } + } + + if (atRule.raws.params) { + atRule.raws.params.raw = params; + } else { + atRule.params = params; + } + } + }); + + /** + * @param {import('style-search').StyleSearchMatch} match + * @param {string} params + * @param {import('postcss').AtRule} node + * @param {((index: number) => void) | null} fix + */ + function checkAfterOperator(match, params, node, fix) { + const endIndex = match.startIndex + match.target.length - 1; + + checker.after({ + source: params, + index: endIndex, + err: (m) => { + if (fix) { + fix(endIndex); + + return; + } + + report({ + message: m, + node, + index: endIndex + atRuleParamIndex(node) + 1, + result, + ruleName, + }); + }, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-range-operator-space-before/index.js b/node_modules/stylelint/lib/rules/media-feature-range-operator-space-before/index.js new file mode 100644 index 000000000..5ddcbfd9c --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-feature-range-operator-space-before/index.js @@ -0,0 +1,104 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const findMediaOperator = require('../findMediaOperator'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'media-feature-range-operator-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before range operator', + rejectedBefore: () => 'Unexpected whitespace before range operator', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-feature-range-operator-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^media$/i, (atRule) => { + /** @type {number[]} */ + const fixOperatorIndices = []; + /** @type {((index: number) => void) | null} */ + const fix = context.fix ? (index) => fixOperatorIndices.push(index) : null; + + findMediaOperator(atRule, (match, params, node) => { + checkBeforeOperator(match, params, node, fix); + }); + + if (fixOperatorIndices.length) { + let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; + + for (const index of fixOperatorIndices.sort((a, b) => b - a)) { + const beforeOperator = params.slice(0, index); + const afterOperator = params.slice(index); + + if (primary === 'always') { + params = beforeOperator.replace(/\s*$/, ' ') + afterOperator; + } else if (primary === 'never') { + params = beforeOperator.replace(/\s*$/, '') + afterOperator; + } + } + + if (atRule.raws.params) { + atRule.raws.params.raw = params; + } else { + atRule.params = params; + } + } + }); + + /** + * @param {import('style-search').StyleSearchMatch} match + * @param {string} params + * @param {import('postcss').AtRule} node + * @param {((index: number) => void) | null} fix + */ + function checkBeforeOperator(match, params, node, fix) { + // The extra `+ 1` is because the match itself contains + // the character before the operator + checker.before({ + source: params, + index: match.startIndex, + err: (m) => { + if (fix) { + fix(match.startIndex); + + return; + } + + report({ + message: m, + node, + index: match.startIndex - 1 + atRuleParamIndex(node), + result, + ruleName, + }); + }, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-query-list-comma-newline-after/index.js b/node_modules/stylelint/lib/rules/media-query-list-comma-newline-after/index.js new file mode 100644 index 000000000..c9c8dcdcb --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-query-list-comma-newline-after/index.js @@ -0,0 +1,93 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const mediaQueryListCommaWhitespaceChecker = require('../mediaQueryListCommaWhitespaceChecker'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'media-query-list-comma-newline-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected newline after ","', + expectedAfterMultiLine: () => 'Expected newline after "," in a multi-line list', + rejectedAfterMultiLine: () => 'Unexpected whitespace after "," in a multi-line list', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-query-list-comma-newline-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line', 'never-multi-line'], + }); + + if (!validOptions) { + return; + } + + // Only check for the newline after the comma, while allowing + // arbitrary indentation after the newline + /** @type {Map | undefined} */ + let fixData; + + mediaQueryListCommaWhitespaceChecker({ + root, + result, + locationChecker: checker.afterOneOnly, + checkedRuleName: ruleName, + allowTrailingComments: primary.startsWith('always'), + fix: context.fix + ? (atRule, index) => { + const paramCommaIndex = index - atRuleParamIndex(atRule); + + fixData = fixData || new Map(); + const commaIndices = fixData.get(atRule) || []; + + commaIndices.push(paramCommaIndex); + fixData.set(atRule, commaIndices); + + return true; + } + : null, + }); + + if (fixData) { + for (const [atRule, commaIndices] of fixData.entries()) { + let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; + + for (const index of commaIndices.sort((a, b) => b - a)) { + const beforeComma = params.slice(0, index + 1); + const afterComma = params.slice(index + 1); + + if (primary.startsWith('always')) { + params = /^\s*\n/.test(afterComma) + ? beforeComma + afterComma.replace(/^[^\S\r\n]*/, '') + : beforeComma + context.newline + afterComma; + } else if (primary.startsWith('never')) { + params = beforeComma + afterComma.replace(/^\s*/, ''); + } + } + + if (atRule.raws.params) { + atRule.raws.params.raw = params; + } else { + atRule.params = params; + } + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-query-list-comma-newline-before/index.js b/node_modules/stylelint/lib/rules/media-query-list-comma-newline-before/index.js new file mode 100644 index 000000000..6b155498d --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-query-list-comma-newline-before/index.js @@ -0,0 +1,47 @@ +'use strict'; + +const mediaQueryListCommaWhitespaceChecker = require('../mediaQueryListCommaWhitespaceChecker'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'media-query-list-comma-newline-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected newline before ","', + expectedBeforeMultiLine: () => 'Expected newline before "," in a multi-line list', + rejectedBeforeMultiLine: () => 'Unexpected whitespace before "," in a multi-line list', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-query-list-comma-newline-before', + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line', 'never-multi-line'], + }); + + if (!validOptions) { + return; + } + + mediaQueryListCommaWhitespaceChecker({ + root, + result, + locationChecker: checker.beforeAllowingIndentation, + checkedRuleName: ruleName, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-query-list-comma-space-after/index.js b/node_modules/stylelint/lib/rules/media-query-list-comma-space-after/index.js new file mode 100644 index 000000000..4eb0d4ac9 --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-query-list-comma-space-after/index.js @@ -0,0 +1,89 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const mediaQueryListCommaWhitespaceChecker = require('../mediaQueryListCommaWhitespaceChecker'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'media-query-list-comma-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected single space after ","', + rejectedAfter: () => 'Unexpected whitespace after ","', + expectedAfterSingleLine: () => 'Expected single space after "," in a single-line list', + rejectedAfterSingleLine: () => 'Unexpected whitespace after "," in a single-line list', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-query-list-comma-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never', 'always-single-line', 'never-single-line'], + }); + + if (!validOptions) { + return; + } + + /** @type {Map | undefined} */ + let fixData; + + mediaQueryListCommaWhitespaceChecker({ + root, + result, + locationChecker: checker.after, + checkedRuleName: ruleName, + fix: context.fix + ? (atRule, index) => { + const paramCommaIndex = index - atRuleParamIndex(atRule); + + fixData = fixData || new Map(); + const commaIndices = fixData.get(atRule) || []; + + commaIndices.push(paramCommaIndex); + fixData.set(atRule, commaIndices); + + return true; + } + : null, + }); + + if (fixData) { + for (const [atRule, commaIndices] of fixData.entries()) { + let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; + + for (const index of commaIndices.sort((a, b) => b - a)) { + const beforeComma = params.slice(0, index + 1); + const afterComma = params.slice(index + 1); + + if (primary.startsWith('always')) { + params = beforeComma + afterComma.replace(/^\s*/, ' '); + } else if (primary.startsWith('never')) { + params = beforeComma + afterComma.replace(/^\s*/, ''); + } + } + + if (atRule.raws.params) { + atRule.raws.params.raw = params; + } else { + atRule.params = params; + } + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-query-list-comma-space-before/index.js b/node_modules/stylelint/lib/rules/media-query-list-comma-space-before/index.js new file mode 100644 index 000000000..b292e117b --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-query-list-comma-space-before/index.js @@ -0,0 +1,89 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const mediaQueryListCommaWhitespaceChecker = require('../mediaQueryListCommaWhitespaceChecker'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'media-query-list-comma-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before ","', + rejectedBefore: () => 'Unexpected whitespace before ","', + expectedBeforeSingleLine: () => 'Expected single space before "," in a single-line list', + rejectedBeforeSingleLine: () => 'Unexpected whitespace before "," in a single-line list', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-query-list-comma-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never', 'always-single-line', 'never-single-line'], + }); + + if (!validOptions) { + return; + } + + /** @type {Map | undefined} */ + let fixData; + + mediaQueryListCommaWhitespaceChecker({ + root, + result, + locationChecker: checker.before, + checkedRuleName: ruleName, + fix: context.fix + ? (atRule, index) => { + const paramCommaIndex = index - atRuleParamIndex(atRule); + + fixData = fixData || new Map(); + const commaIndices = fixData.get(atRule) || []; + + commaIndices.push(paramCommaIndex); + fixData.set(atRule, commaIndices); + + return true; + } + : null, + }); + + if (fixData) { + for (const [atRule, commaIndices] of fixData.entries()) { + let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; + + for (const index of commaIndices.sort((a, b) => b - a)) { + const beforeComma = params.slice(0, index); + const afterComma = params.slice(index); + + if (primary.startsWith('always')) { + params = beforeComma.replace(/\s*$/, ' ') + afterComma; + } else if (primary.startsWith('never')) { + params = beforeComma.replace(/\s*$/, '') + afterComma; + } + } + + if (atRule.raws.params) { + atRule.raws.params.raw = params; + } else { + atRule.params = params; + } + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-query-no-invalid/index.js b/node_modules/stylelint/lib/rules/media-query-no-invalid/index.js new file mode 100644 index 000000000..961cba3b7 --- /dev/null +++ b/node_modules/stylelint/lib/rules/media-query-no-invalid/index.js @@ -0,0 +1,139 @@ +'use strict'; + +const { sourceIndices } = require('@csstools/css-parser-algorithms'); +const { + isMediaQueryInvalid, + isGeneralEnclosed, + isMediaFeaturePlain, + isMediaFeatureRange, + isMediaFeatureBoolean, +} = require('@csstools/media-query-list-parser'); + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const parseMediaQuery = require('../../utils/parseMediaQuery'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const isCustomMediaQuery = require('../../utils/isCustomMediaQuery'); +const { rangeTypeMediaFeatureNames } = require('../../reference/mediaFeatures'); + +const ruleName = 'media-query-no-invalid'; + +const messages = ruleMessages(ruleName, { + rejected: (query) => `Unexpected invalid media query "${query}"`, +}); + +const HAS_MIN_MAX_PREFIX = /^(?:min|max)-/i; + +const meta = { + url: 'https://stylelint.io/user-guide/rules/media-query-no-invalid', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkAtRules(/^media$/i, (atRule) => { + /** @type {Array<{tokens(): Array}>} */ + let invalidNodes = []; + + parseMediaQuery(atRule).forEach((mediaQuery) => { + if (isMediaQueryInvalid(mediaQuery)) { + // Queries that fail to parse are invalid. + invalidNodes.push(mediaQuery); + + return; + } + + mediaQuery.walk(({ node, parent }) => { + // All general enclosed nodes are invalid. + if (isGeneralEnclosed(node)) { + invalidNodes.push(node); + + return; + } + + // Invalid plain media features. + if (isMediaFeaturePlain(node)) { + const name = node.getName(); + + if (isCustomMediaQuery(name)) { + // In a plain context, custom media queries are invalid. + invalidNodes.push(parent); + + return; + } + + return; + } + + // Invalid range media features. + if (isMediaFeatureRange(node)) { + const name = node.getName().toLowerCase(); + + if (isCustomMediaQuery(name)) { + // In a range context, custom media queries are invalid. + invalidNodes.push(parent); + + return; + } + + if (HAS_MIN_MAX_PREFIX.test(name)) { + // In a range context, min- and max- prefixed feature names are invalid. + invalidNodes.push(parent); + + return; + } + + if (!rangeTypeMediaFeatureNames.has(name)) { + // In a range context, non-range typed features are invalid. + invalidNodes.push(parent); + + return; + } + + return; + } + + // Invalid boolean media features. + if (isMediaFeatureBoolean(node)) { + const name = node.getName().toLowerCase(); + + if (HAS_MIN_MAX_PREFIX.test(name)) { + // In a range context, min- and max- prefixed feature names are invalid + invalidNodes.push(parent); + } + } + }); + }); + + if (invalidNodes.length === 0) return; + + const atRuleParamIndexValue = atRuleParamIndex(atRule); + + invalidNodes.forEach((invalidNode) => { + const [start, end] = sourceIndices(invalidNode); + + report({ + message: messages.rejected, + messageArgs: [invalidNode.toString()], + index: atRuleParamIndexValue + start, + endIndex: atRuleParamIndexValue + end + 1, + node: atRule, + ruleName, + result, + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/mediaFeatureColonSpaceChecker.js b/node_modules/stylelint/lib/rules/mediaFeatureColonSpaceChecker.js new file mode 100644 index 000000000..8d72c90a5 --- /dev/null +++ b/node_modules/stylelint/lib/rules/mediaFeatureColonSpaceChecker.js @@ -0,0 +1,51 @@ +'use strict'; + +const atRuleParamIndex = require('../utils/atRuleParamIndex'); +const report = require('../utils/report'); +const styleSearch = require('style-search'); + +/** + * @param {{ + * root: import('postcss').Root, + * locationChecker: (args: { source: string, index: number, err: (message: string) => void }) => void, + * fix: ((node: import('postcss').AtRule, index: number) => boolean) | null, + * result: import('stylelint').PostcssResult, + * checkedRuleName: string, + * }} opts + */ +module.exports = function mediaFeatureColonSpaceChecker(opts) { + opts.root.walkAtRules(/^media$/i, (atRule) => { + const params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; + + styleSearch({ source: params, target: ':' }, (match) => { + checkColon(params, match.startIndex, atRule); + }); + }); + + /** + * @param {string} source + * @param {number} index + * @param {import('postcss').AtRule} node + */ + function checkColon(source, index, node) { + opts.locationChecker({ + source, + index, + err: (message) => { + const colonIndex = index + atRuleParamIndex(node); + + if (opts.fix && opts.fix(node, colonIndex)) { + return; + } + + report({ + message, + node, + index: colonIndex, + result: opts.result, + ruleName: opts.checkedRuleName, + }); + }, + }); + } +}; diff --git a/node_modules/stylelint/lib/rules/mediaQueryListCommaWhitespaceChecker.js b/node_modules/stylelint/lib/rules/mediaQueryListCommaWhitespaceChecker.js new file mode 100644 index 000000000..7c84b1924 --- /dev/null +++ b/node_modules/stylelint/lib/rules/mediaQueryListCommaWhitespaceChecker.js @@ -0,0 +1,71 @@ +'use strict'; + +const styleSearch = require('style-search'); + +const atRuleParamIndex = require('../utils/atRuleParamIndex'); +const report = require('../utils/report'); +const { assertString } = require('../utils/validateTypes'); + +/** + * @param {{ + * root: import('postcss').Root, + * result: import('stylelint').PostcssResult, + * locationChecker: (args: { source: string, index: number, err: (message: string) => void }) => void, + * checkedRuleName: string, + * fix?: ((atRule: import('postcss').AtRule, index: number) => boolean) | null | undefined, + * allowTrailingComments?: boolean, + * }} opts + */ +module.exports = function mediaQueryListCommaWhitespaceChecker(opts) { + opts.root.walkAtRules(/^media$/i, (atRule) => { + const params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; + + styleSearch({ source: params, target: ',' }, (match) => { + let index = match.startIndex; + + if (opts.allowTrailingComments) { + // if there is a comment on the same line at after the comma, check the space after the comment. + let execResult; + + while ((execResult = /^[^\S\r\n]*\/\*([\s\S]*?)\*\//.exec(params.slice(index + 1)))) { + assertString(execResult[0]); + index += execResult[0].length; + } + + if ((execResult = /^([^\S\r\n]*\/\/[\s\S]*?)\r?\n/.exec(params.slice(index + 1)))) { + assertString(execResult[1]); + index += execResult[1].length; + } + } + + checkComma(params, index, atRule); + }); + }); + + /** + * @param {string} source + * @param {number} index + * @param {import('postcss').AtRule} node + */ + function checkComma(source, index, node) { + opts.locationChecker({ + source, + index, + err: (message) => { + const commaIndex = index + atRuleParamIndex(node); + + if (opts.fix && opts.fix(node, commaIndex)) { + return; + } + + report({ + message, + node, + index: commaIndex, + result: opts.result, + ruleName: opts.checkedRuleName, + }); + }, + }); + } +}; diff --git a/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/index.js b/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/index.js new file mode 100644 index 000000000..9b5e82a69 --- /dev/null +++ b/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/index.js @@ -0,0 +1,112 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const findNotContiguousOrRectangular = require('./utils/findNotContiguousOrRectangular'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { assert } = require('../../utils/validateTypes'); + +const ruleName = 'named-grid-areas-no-invalid'; + +const messages = ruleMessages(ruleName, { + expectedToken: () => 'Expected cell token within string', + expectedSameNumber: () => 'Expected same number of cell tokens in each string', + expectedRectangle: (name) => `Expected single filled-in rectangle for "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/named-grid-areas-no-invalid', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkDecls(/^(?:grid|grid-template|grid-template-areas)$/i, (decl) => { + const { value } = decl; + + if (value.toLowerCase().trim() === 'none') return; + + /** @type {Array<{ values: string[], index: number, endIndex: number }>} */ + const areas = []; + let reportSent = false; + + valueParser(value).walk(({ sourceIndex, sourceEndIndex, type, value: tokenValue }) => { + if (type !== 'string') return; + + if (tokenValue === '') { + complain(messages.expectedToken(), sourceIndex, sourceEndIndex); + reportSent = true; + + return; + } + + areas.push({ + values: tokenValue.trim().split(' ').filter(Boolean), + index: sourceIndex, + endIndex: sourceEndIndex, + }); + }); + + if (reportSent) return; + + const [firstArea] = areas; + + if (firstArea === undefined) return; + + const notSameNumberArea = areas.find( + (area) => area.values.length !== firstArea.values.length, + ); + + if (notSameNumberArea !== undefined) { + complain( + messages.expectedSameNumber(), + notSameNumberArea.index, + notSameNumberArea.endIndex, + ); + + return; + } + + const notContiguousOrRectangular = findNotContiguousOrRectangular(areas.map((a) => a.values)); + + for (const name of notContiguousOrRectangular.sort()) { + const area = areas.find((a) => a.values.includes(name)); + + assert(area); + complain(messages.expectedRectangle(name), area.index, area.endIndex); + } + + /** + * @param {string} message + * @param {number} index + * @param {number} endIndex + */ + function complain(message, index, endIndex) { + const start = declarationValueIndex(decl); + + report({ + message, + node: decl, + index: start + index, + endIndex: start + endIndex, + result, + ruleName, + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/utils/findNotContiguousOrRectangular.js b/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/utils/findNotContiguousOrRectangular.js new file mode 100644 index 000000000..340a1d579 --- /dev/null +++ b/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/utils/findNotContiguousOrRectangular.js @@ -0,0 +1,64 @@ +'use strict'; + +const arrayEqual = require('../../../utils/arrayEqual'); + +/** + * + * @param {string[][]} areas + * @param {string} name + * @returns {boolean} + */ +function isContiguousAndRectangular(areas, name) { + const indicesByRow = areas.map((row) => { + const indices = []; + let idx = row.indexOf(name); + + while (idx !== -1) { + indices.push(idx); + idx = row.indexOf(name, idx + 1); + } + + return indices; + }); + + for (let i = 0; i < indicesByRow.length; i++) { + for (let j = i + 1; j < indicesByRow.length; j++) { + const x = indicesByRow[i]; + const y = indicesByRow[j]; + + if ((x && x.length === 0) || (y && y.length === 0)) { + continue; + } + + if (!arrayEqual(x, y)) { + return false; + } + } + } + + return true; +} + +/** + * + * @param {string[][]} areas + * @returns {string[]} + */ +function namedAreas(areas) { + const names = new Set(areas.flat()); + + names.delete('.'); + + return [...names]; +} + +/** + * + * @param {string[][]} areas + * @returns {string[]} + */ +function findNotContiguousOrRectangular(areas) { + return namedAreas(areas).filter((name) => !isContiguousAndRectangular(areas, name)); +} + +module.exports = findNotContiguousOrRectangular; diff --git a/node_modules/stylelint/lib/rules/no-descending-specificity/index.js b/node_modules/stylelint/lib/rules/no-descending-specificity/index.js new file mode 100644 index 000000000..4bbe50b0b --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-descending-specificity/index.js @@ -0,0 +1,168 @@ +'use strict'; + +const resolvedNestedSelector = require('postcss-resolve-nested-selector'); +const { selectorSpecificity: calculate, compare } = require('@csstools/selector-specificity'); + +const findAtRuleContext = require('../../utils/findAtRuleContext'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const { pseudoElements } = require('../../reference/selectors'); +const nodeContextLookup = require('../../utils/nodeContextLookup'); +const optionsMatches = require('../../utils/optionsMatches'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'no-descending-specificity'; + +const messages = ruleMessages(ruleName, { + rejected: (b, a) => `Expected selector "${b}" to come before selector "${a}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-descending-specificity', +}; + +/** @typedef {{ selector: string, specificity: import('@csstools/selector-specificity').Specificity }} Entry */ + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + }, + { + optional: true, + actual: secondaryOptions, + possible: { + ignore: ['selectors-within-list'], + }, + }, + ); + + if (!validOptions) { + return; + } + + const ignoreSelectorsWithinList = optionsMatches( + secondaryOptions, + 'ignore', + 'selectors-within-list', + ); + + const selectorContextLookup = nodeContextLookup(); + + root.walkRules((ruleNode) => { + // Ignore nested property `foo: {};` + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selectors = ruleNode.selectors; + + // Ignores selectors within list of selectors + if (ignoreSelectorsWithinList && selectors.length > 1) { + return; + } + + /** @type {Map} */ + const comparisonContext = selectorContextLookup.getContext( + ruleNode, + findAtRuleContext(ruleNode), + ); + + for (const selector of selectors) { + // Ignore `.selector, { }` + if (selector.trim() === '') { + continue; + } + + // Resolve any nested selectors before checking + for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { + if (!isStandardSyntaxSelector(resolvedSelector)) { + continue; + } + + parseSelector(resolvedSelector, result, ruleNode, (s) => { + checkSelector(resolvedSelector, s, ruleNode, comparisonContext); + }); + } + } + }); + + /** + * @param {string} selector + * @param {import('postcss-selector-parser').Root} selectorNode + * @param {import('postcss').Rule} ruleNode + * @param {Map} comparisonContext + */ + function checkSelector(selector, selectorNode, ruleNode, comparisonContext) { + const referenceSelector = lastCompoundSelectorWithoutPseudoClasses(selectorNode); + + if (!referenceSelector) return; + + const selectorSpecificity = calculate(selectorNode); + const entry = { selector, specificity: selectorSpecificity }; + const priorComparableSelectors = comparisonContext.get(referenceSelector); + + if (!priorComparableSelectors) { + comparisonContext.set(referenceSelector, [entry]); + + return; + } + + for (const priorEntry of priorComparableSelectors) { + if (compare(selectorSpecificity, priorEntry.specificity) < 0) { + report({ + ruleName, + result, + node: ruleNode, + message: messages.rejected, + messageArgs: [selector, priorEntry.selector], + word: selector, + }); + + break; + } + } + + priorComparableSelectors.push(entry); + } + }; +}; + +/** + * @param {import('postcss-selector-parser').Root} selectorNode + * @returns {string | undefined} + */ +function lastCompoundSelectorWithoutPseudoClasses(selectorNode) { + const firstChild = selectorNode.nodes[0]; + + if (!firstChild) return undefined; + + const nodesByCombinator = firstChild.split((node) => node.type === 'combinator'); + const nodesAfterLastCombinator = nodesByCombinator[nodesByCombinator.length - 1]; + + if (!nodesAfterLastCombinator) return undefined; + + const nodesWithoutPseudoClasses = nodesAfterLastCombinator.filter((node) => { + return ( + node.type !== 'pseudo' || + node.value.startsWith('::') || + pseudoElements.has(node.value.replace(/:/g, '')) + ); + }); + + if (nodesWithoutPseudoClasses.length === 0) return undefined; + + return nodesWithoutPseudoClasses.join(''); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-duplicate-at-import-rules/index.js b/node_modules/stylelint/lib/rules/no-duplicate-at-import-rules/index.js new file mode 100644 index 000000000..7ca365e6b --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-duplicate-at-import-rules/index.js @@ -0,0 +1,155 @@ +'use strict'; + +const getAtRuleParams = require('../../utils/getAtRuleParams'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); + +const ruleName = 'no-duplicate-at-import-rules'; + +const messages = ruleMessages(ruleName, { + rejected: (atImport) => `Unexpected duplicate @import rule ${atImport}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-duplicate-at-import-rules', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + /** @type {Record} */ + const imports = {}; + + root.walkAtRules(/^import$/i, (atRule) => { + const [firstParam, ...restParams] = valueParser(getAtRuleParams(atRule)).nodes; + + if (!firstParam) { + return; + } + + // extract uri from url() if exists + const uri = + firstParam.type === 'function' && firstParam.value === 'url' && firstParam.nodes[0] + ? firstParam.nodes[0].value + : firstParam.value; + + const media = listImportConditions(restParams); + + let importedUris = imports[uri]; + const isDuplicate = media.length + ? media.some((q) => importedUris && importedUris.includes(q)) + : importedUris; + + if (isDuplicate) { + report({ + message: messages.rejected, + messageArgs: [uri], + node: atRule, + result, + ruleName, + word: atRule.toString(), + }); + + return; + } + + if (!importedUris) { + importedUris = imports[uri] = []; + } + + importedUris.push(...media); + }); + }; +}; + +/** @typedef { import('postcss-value-parser').Node } Node */ + +/** + * @param {Node | Array} node + * @returns {string} + */ +function stringifyCondition(node) { + // remove whitespace to get a more consistent key + return valueParser.stringify(node).replace(/\s/g, ''); +} + +/** + * List the import conditions found in the prelude of an `@import` rule + * + * @param {Node[]} params + * @returns {Array} + */ +function listImportConditions(params) { + if (!params.length) return []; + + const separator = ' '; + /** @type {Array} */ + const sharedConditions = []; + /** @type {Array} */ + const media = []; + /** @type {Array} */ + let lastMediaQuery = []; + + for (const param of params) { + // remove top level whitespace and comments to get a more consistent key + if (param.type === 'space' || param.type === 'comment') { + continue; + } + + // layer and supports conditions must precede media query conditions + if (!media.length) { + // @import url(...) layer(base) supports(display: flex) + if (param.type === 'function' && (param.value === 'supports' || param.value === 'layer')) { + sharedConditions.push(stringifyCondition(param)); + continue; + } + + // @import url(...) layer + if (param.type === 'word' && param.value === 'layer') { + sharedConditions.push(stringifyCondition(param)); + continue; + } + } + + if (param.type === 'div' && param.value === ',') { + media.push(stringifyCondition(lastMediaQuery)); + lastMediaQuery = []; + continue; + } + + lastMediaQuery.push(param); + } + + if (lastMediaQuery.length) { + media.push(stringifyCondition(lastMediaQuery)); + } + + // Only media query conditions + if (media.length && !sharedConditions.length) { + return media; + } + + // Only layer and supports conditions + if (!media.length && sharedConditions.length) { + return [sharedConditions.join(separator)]; + } + + const sharedConditionsString = sharedConditions.join(separator); + + return media.map((m) => { + return sharedConditionsString + separator + m; + }); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-duplicate-selectors/index.js b/node_modules/stylelint/lib/rules/no-duplicate-selectors/index.js new file mode 100644 index 000000000..a5c8694ad --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-duplicate-selectors/index.js @@ -0,0 +1,178 @@ +'use strict'; + +const resolvedNestedSelector = require('postcss-resolve-nested-selector'); +const selectorParser = require('postcss-selector-parser'); + +const findAtRuleContext = require('../../utils/findAtRuleContext'); +const isKeyframeRule = require('../../utils/isKeyframeRule'); +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const nodeContextLookup = require('../../utils/nodeContextLookup'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isBoolean } = require('../../utils/validateTypes'); + +const ruleName = 'no-duplicate-selectors'; + +const messages = ruleMessages(ruleName, { + rejected: (selector, firstDuplicateLine) => + `Unexpected duplicate selector "${selector}", first used at line ${firstDuplicateLine}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-duplicate-selectors', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + disallowInList: [isBoolean], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const shouldDisallowDuplicateInList = secondaryOptions && secondaryOptions.disallowInList; + + // The top level of this map will be rule sources. + // Each source maps to another map, which maps rule parents to a set of selectors. + // This ensures that selectors are only checked against selectors + // from other rules that share the same parent and the same source. + const selectorContextLookup = nodeContextLookup(); + + root.walkRules((ruleNode) => { + if (isKeyframeRule(ruleNode)) { + return; + } + + const contextSelectorSet = selectorContextLookup.getContext( + ruleNode, + findAtRuleContext(ruleNode), + ); + const resolvedSelectorList = [ + ...new Set( + ruleNode.selectors.flatMap((selector) => resolvedNestedSelector(selector, ruleNode)), + ), + ]; + + const normalizedSelectorList = resolvedSelectorList.map(normalize); + + // Sort the selectors list so that the order of the constituents + // doesn't matter + const sortedSelectorList = [...normalizedSelectorList].sort().join(','); + + if (!ruleNode.source) throw new Error('The rule node must have a source'); + + if (!ruleNode.source.start) throw new Error('The rule source must have a start position'); + + const selectorLine = ruleNode.source.start.line; + + // Complain if the same selector list occurs twice + + let previousDuplicatePosition; + // When `disallowInList` is true, we must parse `sortedSelectorList` into + // list items. + /** @type {string[]} */ + const selectorListParsed = []; + + if (shouldDisallowDuplicateInList) { + parseSelector(sortedSelectorList, result, ruleNode, (selectors) => { + selectors.each((s) => { + const selector = String(s); + + selectorListParsed.push(selector); + + if (contextSelectorSet.get(selector)) { + previousDuplicatePosition = contextSelectorSet.get(selector); + } + }); + }); + } else { + previousDuplicatePosition = contextSelectorSet.get(sortedSelectorList); + } + + if (previousDuplicatePosition) { + // If the selector isn't nested we can use its raw value; otherwise, + // we have to approximate something for the message -- which is close enough + const isNestedSelector = resolvedSelectorList.join(',') !== ruleNode.selectors.join(','); + const selectorForMessage = isNestedSelector + ? resolvedSelectorList.join(', ') + : ruleNode.selector; + + return report({ + result, + ruleName, + node: ruleNode, + message: messages.rejected, + messageArgs: [selectorForMessage, previousDuplicatePosition], + word: selectorForMessage, + }); + } + + const presentedSelectors = new Set(); + const reportedSelectors = new Set(); + + // Or complain if one selector list contains the same selector more than once + for (const selector of ruleNode.selectors) { + const normalized = normalize(selector); + + if (presentedSelectors.has(normalized)) { + if (reportedSelectors.has(normalized)) { + continue; + } + + report({ + result, + ruleName, + node: ruleNode, + message: messages.rejected, + messageArgs: [selector, selectorLine], + word: selector, + }); + reportedSelectors.add(normalized); + } else { + presentedSelectors.add(normalized); + } + } + + if (shouldDisallowDuplicateInList) { + for (const selector of selectorListParsed) { + // [selectorLine] will not really be accurate for multi-line + // selectors, such as "bar" in "foo,\nbar {}". + contextSelectorSet.set(selector, selectorLine); + } + } else { + contextSelectorSet.set(sortedSelectorList, selectorLine); + } + }); + }; +}; + +/** + * @param {string} selector + * @returns {string} + */ +function normalize(selector) { + if (!isStandardSyntaxSelector(selector)) { + return selector; + } + + return selectorParser().processSync(selector, { lossless: false }); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-empty-first-line/index.js b/node_modules/stylelint/lib/rules/no-empty-first-line/index.js new file mode 100644 index 000000000..ee90c6e99 --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-empty-first-line/index.js @@ -0,0 +1,64 @@ +'use strict'; + +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'no-empty-first-line'; +const noEmptyFirstLineTest = /^\s*[\r\n]/; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected empty line', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-empty-first-line', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + // @ts-expect-error -- TS2339: Property 'inline' does not exist on type 'Source'. Property 'lang' does not exist on type 'Source'. + if (!validOptions || root.source.inline || root.source.lang === 'object-literal') { + return; + } + + const rootString = context.fix ? root.toString() : (root.source && root.source.input.css) || ''; + + if (!rootString.trim()) { + return; + } + + if (noEmptyFirstLineTest.test(rootString)) { + if (context.fix) { + if (root.first == null) { + throw new Error('The root node must have the first node.'); + } + + if (root.first.raws.before == null) { + throw new Error('The first node must have spaces before.'); + } + + root.first.raws.before = root.first.raws.before.trimStart(); + + return; + } + + report({ + message: messages.rejected, + node: root, + result, + ruleName, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-empty-source/index.js b/node_modules/stylelint/lib/rules/no-empty-source/index.js new file mode 100644 index 000000000..28b9a422f --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-empty-source/index.js @@ -0,0 +1,44 @@ +'use strict'; + +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'no-empty-source'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected empty source', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-empty-source', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + const rootString = context.fix ? root.toString() : (root.source && root.source.input.css) || ''; + + if (rootString.trim()) { + return; + } + + report({ + message: messages.rejected, + node: root, + result, + ruleName, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-eol-whitespace/index.js b/node_modules/stylelint/lib/rules/no-eol-whitespace/index.js new file mode 100644 index 000000000..9eb58e67e --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-eol-whitespace/index.js @@ -0,0 +1,297 @@ +'use strict'; + +const styleSearch = require('style-search'); + +const isOnlyWhitespace = require('../../utils/isOnlyWhitespace'); +const isStandardSyntaxComment = require('../../utils/isStandardSyntaxComment'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const { isAtRule, isComment, isDeclaration, isRule } = require('../../utils/typeGuards'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'no-eol-whitespace'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected whitespace at end of line', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-eol-whitespace', + fixable: true, + deprecated: true, +}; + +const whitespacesToReject = new Set([' ', '\t']); + +/** + * @param {string} str + * @returns {string} + */ +function fixString(str) { + return str.replace(/[ \t]+$/, ''); +} + +/** + * @param {number} lastEOLIndex + * @param {string} string + * @param {{ ignoreEmptyLines: boolean, isRootFirst: boolean }} options + * @returns {number} + */ +function findErrorStartIndex(lastEOLIndex, string, { ignoreEmptyLines, isRootFirst }) { + const eolWhitespaceIndex = lastEOLIndex - 1; + + // If the character before newline is not whitespace, ignore + if (!whitespacesToReject.has(string.charAt(eolWhitespaceIndex))) { + return -1; + } + + if (ignoreEmptyLines) { + // If there is only whitespace between the previous newline and + // this newline, ignore + const beforeNewlineIndex = string.lastIndexOf('\n', eolWhitespaceIndex); + + if (beforeNewlineIndex >= 0 || isRootFirst) { + const line = string.substring(beforeNewlineIndex, eolWhitespaceIndex); + + if (isOnlyWhitespace(line)) { + return -1; + } + } + } + + return eolWhitespaceIndex; +} + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + }, + { + optional: true, + actual: secondaryOptions, + possible: { + ignore: ['empty-lines'], + }, + }, + ); + + if (!validOptions) { + return; + } + + const ignoreEmptyLines = optionsMatches(secondaryOptions, 'ignore', 'empty-lines'); + + if (context.fix) { + fix(root); + } + + const rootString = context.fix ? root.toString() : (root.source && root.source.input.css) || ''; + + /** + * @param {number} index + */ + const reportFromIndex = (index) => { + report({ + message: messages.rejected, + node: root, + index, + result, + ruleName, + }); + }; + + eachEolWhitespace(rootString, reportFromIndex, true); + + const errorIndex = findErrorStartIndex(rootString.length, rootString, { + ignoreEmptyLines, + isRootFirst: true, + }); + + if (errorIndex > -1) { + reportFromIndex(errorIndex); + } + + /** + * Iterate each whitespace at the end of each line of the given string. + * @param {string} string - the source code string + * @param {(index: number) => void} callback - callback the whitespace index at the end of each line. + * @param {boolean} isRootFirst - set `true` if the given string is the first token of the root. + * @returns {void} + */ + function eachEolWhitespace(string, callback, isRootFirst) { + styleSearch( + { + source: string, + target: ['\n', '\r'], + comments: 'check', + }, + (match) => { + const index = findErrorStartIndex(match.startIndex, string, { + ignoreEmptyLines, + isRootFirst, + }); + + if (index > -1) { + callback(index); + } + }, + ); + } + + /** + * @param {import('postcss').Root} rootNode + */ + function fix(rootNode) { + let isRootFirst = true; + + rootNode.walk((node) => { + fixText( + node.raws.before, + (fixed) => { + node.raws.before = fixed; + }, + isRootFirst, + ); + isRootFirst = false; + + if (isAtRule(node)) { + fixText(node.raws.afterName, (fixed) => { + node.raws.afterName = fixed; + }); + + const rawsParams = node.raws.params; + + if (rawsParams) { + fixText(rawsParams.raw, (fixed) => { + rawsParams.raw = fixed; + }); + } else { + fixText(node.params, (fixed) => { + node.params = fixed; + }); + } + } + + if (isRule(node)) { + const rawsSelector = node.raws.selector; + + if (rawsSelector) { + fixText(rawsSelector.raw, (fixed) => { + rawsSelector.raw = fixed; + }); + } else { + fixText(node.selector, (fixed) => { + node.selector = fixed; + }); + } + } + + if (isAtRule(node) || isRule(node) || isDeclaration(node)) { + fixText(node.raws.between, (fixed) => { + node.raws.between = fixed; + }); + } + + if (isDeclaration(node)) { + const rawsValue = node.raws.value; + + if (rawsValue) { + fixText(rawsValue.raw, (fixed) => { + rawsValue.raw = fixed; + }); + } else { + fixText(node.value, (fixed) => { + node.value = fixed; + }); + } + } + + if (isComment(node)) { + fixText(node.raws.left, (fixed) => { + node.raws.left = fixed; + }); + + if (!isStandardSyntaxComment(node)) { + node.raws.right = node.raws.right && fixString(node.raws.right); + } else { + fixText(node.raws.right, (fixed) => { + node.raws.right = fixed; + }); + } + + fixText(node.text, (fixed) => { + node.text = fixed; + }); + } + + if (isAtRule(node) || isRule(node)) { + fixText(node.raws.after, (fixed) => { + node.raws.after = fixed; + }); + } + }); + + fixText( + rootNode.raws.after, + (fixed) => { + rootNode.raws.after = fixed; + }, + isRootFirst, + ); + + if (typeof rootNode.raws.after === 'string') { + const lastEOL = Math.max( + rootNode.raws.after.lastIndexOf('\n'), + rootNode.raws.after.lastIndexOf('\r'), + ); + + if (lastEOL !== rootNode.raws.after.length - 1) { + rootNode.raws.after = + rootNode.raws.after.slice(0, lastEOL + 1) + + fixString(rootNode.raws.after.slice(lastEOL + 1)); + } + } + } + + /** + * @param {string | undefined} value + * @param {(text: string) => void} fixFn + * @param {boolean} isRootFirst + */ + function fixText(value, fixFn, isRootFirst = false) { + if (!value) { + return; + } + + let fixed = ''; + let lastIndex = 0; + + eachEolWhitespace( + value, + (index) => { + const newlineIndex = index + 1; + + fixed += fixString(value.slice(lastIndex, newlineIndex)); + lastIndex = newlineIndex; + }, + isRootFirst, + ); + + if (lastIndex) { + fixed += value.slice(lastIndex); + fixFn(fixed); + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-extra-semicolons/index.js b/node_modules/stylelint/lib/rules/no-extra-semicolons/index.js new file mode 100644 index 000000000..eba41e3a4 --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-extra-semicolons/index.js @@ -0,0 +1,244 @@ +'use strict'; + +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const styleSearch = require('style-search'); +const validateOptions = require('../../utils/validateOptions'); +const { isAtRule } = require('../../utils/typeGuards'); + +const ruleName = 'no-extra-semicolons'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected extra semicolon', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-extra-semicolons', + fixable: true, + deprecated: true, +}; + +/** + * @param {import('postcss').Node} node + * @returns {number} + */ +function getOffsetByNode(node) { + // @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Document | Container' + if (node.parent && node.parent.document) { + return 0; + } + + const root = node.root(); + + if (!root.source) throw new Error('The root node must have a source'); + + if (!node.source) throw new Error('The node must have a source'); + + if (!node.source.start) throw new Error('The source must have a start position'); + + const string = root.source.input.css; + const nodeColumn = node.source.start.column; + const nodeLine = node.source.start.line; + let line = 1; + let column = 1; + let index = 0; + + for (let i = 0; i < string.length; i++) { + if (column === nodeColumn && nodeLine === line) { + index = i; + break; + } + + if (string[i] === '\n') { + column = 1; + line += 1; + } else { + column += 1; + } + } + + return index; +} + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + if (root.raws.after && root.raws.after.trim().length !== 0) { + const rawAfterRoot = root.raws.after; + + /** @type {number[]} */ + const fixSemiIndices = []; + + styleSearch({ source: rawAfterRoot, target: ';' }, (match) => { + if (context.fix) { + fixSemiIndices.push(match.startIndex); + + return; + } + + if (!root.source) throw new Error('The root node must have a source'); + + complain(root.source.input.css.length - rawAfterRoot.length + match.startIndex); + }); + + // fix + if (fixSemiIndices.length) { + root.raws.after = removeIndices(rawAfterRoot, fixSemiIndices); + } + } + + root.walk((node) => { + if (isAtRule(node) && !isStandardSyntaxAtRule(node)) { + return; + } + + if (node.type === 'rule' && !isStandardSyntaxRule(node)) { + return; + } + + if (node.raws.before && node.raws.before.trim().length !== 0) { + const rawBeforeNode = node.raws.before; + const allowedSemi = 0; + + const rawBeforeIndexStart = 0; + + /** @type {number[]} */ + const fixSemiIndices = []; + + styleSearch({ source: rawBeforeNode, target: ';' }, (match, count) => { + if (count === allowedSemi) { + return; + } + + if (context.fix) { + fixSemiIndices.push(match.startIndex - rawBeforeIndexStart); + + return; + } + + complain(getOffsetByNode(node) - rawBeforeNode.length + match.startIndex); + }); + + // fix + if (fixSemiIndices.length) { + node.raws.before = removeIndices(rawBeforeNode, fixSemiIndices); + } + } + + if (typeof node.raws.after === 'string' && node.raws.after.trim().length !== 0) { + const rawAfterNode = node.raws.after; + + /** + * If the last child is a Less mixin followed by more than one semicolon, + * node.raws.after will be populated with that semicolon. + * Since we ignore Less mixins, exit here + */ + if ( + 'last' in node && + node.last && + node.last.type === 'atrule' && + !isStandardSyntaxAtRule(node.last) + ) { + return; + } + + /** @type {number[]} */ + const fixSemiIndices = []; + + styleSearch({ source: rawAfterNode, target: ';' }, (match) => { + if (context.fix) { + fixSemiIndices.push(match.startIndex); + + return; + } + + const index = + getOffsetByNode(node) + + node.toString().length - + 1 - + rawAfterNode.length + + match.startIndex; + + complain(index); + }); + + // fix + if (fixSemiIndices.length) { + node.raws.after = removeIndices(rawAfterNode, fixSemiIndices); + } + } + + if (typeof node.raws.ownSemicolon === 'string') { + const rawOwnSemicolon = node.raws.ownSemicolon; + const allowedSemi = 0; + + /** @type {number[]} */ + const fixSemiIndices = []; + + styleSearch({ source: rawOwnSemicolon, target: ';' }, (match, count) => { + if (count === allowedSemi) { + return; + } + + if (context.fix) { + fixSemiIndices.push(match.startIndex); + + return; + } + + const index = + getOffsetByNode(node) + + node.toString().length - + rawOwnSemicolon.length + + match.startIndex; + + complain(index); + }); + + // fix + if (fixSemiIndices.length) { + node.raws.ownSemicolon = removeIndices(rawOwnSemicolon, fixSemiIndices); + } + } + }); + + /** + * @param {number} index + */ + function complain(index) { + report({ + message: messages.rejected, + node: root, + index, + result, + ruleName, + }); + } + + /** + * @param {string} str + * @param {number[]} indices + * @returns {string} + */ + function removeIndices(str, indices) { + for (const index of indices.reverse()) { + str = str.slice(0, index) + str.slice(index + 1); + } + + return str; + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-invalid-double-slash-comments/index.js b/node_modules/stylelint/lib/rules/no-invalid-double-slash-comments/index.js new file mode 100644 index 000000000..880587379 --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-invalid-double-slash-comments/index.js @@ -0,0 +1,57 @@ +'use strict'; + +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'no-invalid-double-slash-comments'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected double-slash CSS comment', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-invalid-double-slash-comments', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (decl.prop.startsWith('//')) { + report({ + message: messages.rejected, + node: decl, + result, + ruleName, + word: decl.toString(), + }); + } + }); + + root.walkRules((ruleNode) => { + for (const selector of ruleNode.selectors) { + if (selector.startsWith('//')) { + report({ + message: messages.rejected, + node: ruleNode, + result, + ruleName, + word: ruleNode.toString(), + }); + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-invalid-position-at-import-rule/index.js b/node_modules/stylelint/lib/rules/no-invalid-position-at-import-rule/index.js new file mode 100644 index 000000000..4bc0f2b4a --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-invalid-position-at-import-rule/index.js @@ -0,0 +1,77 @@ +'use strict'; + +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const { isAtRule } = require('../../utils/typeGuards'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'no-invalid-position-at-import-rule'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected invalid position @import rule', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-invalid-position-at-import-rule', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, options) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: options, + possible: { + ignoreAtRules: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + let invalidPosition = false; + + root.walk((node) => { + const nodeName = ('name' in node && node.name && node.name.toLowerCase()) || ''; + + if ( + (isAtRule(node) && + nodeName !== 'charset' && + nodeName !== 'import' && + nodeName !== 'layer' && + !optionsMatches(options, 'ignoreAtRules', node.name) && + isStandardSyntaxAtRule(node)) || + (node.type === 'rule' && isStandardSyntaxRule(node)) + ) { + invalidPosition = true; + + return; + } + + if (isAtRule(node) && nodeName === 'import' && invalidPosition) { + report({ + message: messages.rejected, + node, + result, + ruleName, + word: node.toString(), + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-irregular-whitespace/index.js b/node_modules/stylelint/lib/rules/no-irregular-whitespace/index.js new file mode 100644 index 000000000..2420179d0 --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-irregular-whitespace/index.js @@ -0,0 +1,111 @@ +'use strict'; + +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'no-irregular-whitespace'; + +const messages = ruleMessages(ruleName, { + unexpected: 'Unexpected irregular whitespace', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-irregular-whitespace', +}; + +const IRREGULAR_WHITESPACES = [ + '\u000B', // Line Tabulation (\v) - + '\u000C', // Form Feed (\f) - + '\u00A0', // No-Break Space - + '\u0085', // Next Line + '\u1680', // Ogham Space Mark + '\u180E', // Mongolian Vowel Separator - + '\uFEFF', // Zero Width No-Break Space - + '\u2000', // En Quad + '\u2001', // Em Quad + '\u2002', // En Space - + '\u2003', // Em Space - + '\u2004', // Tree-Per-Em + '\u2005', // Four-Per-Em + '\u2006', // Six-Per-Em + '\u2007', // Figure Space + '\u2008', // Punctuation Space - + '\u2009', // Thin Space + '\u200A', // Hair Space + '\u200B', // Zero Width Space - + '\u2028', // Line Separator + '\u2029', // Paragraph Separator + '\u202F', // Narrow No-Break Space + '\u205F', // Medium Mathematical Space + '\u3000', // Ideographic Space +]; + +const IRREGULAR_WHITESPACES_PATTERN = new RegExp(`([${IRREGULAR_WHITESPACES.join('')}])`); + +/** + * @param {string} str + * @returns {string | null} + */ +const findIrregularWhitespace = (str) => { + const result = IRREGULAR_WHITESPACES_PATTERN.exec(str); + + return (result && result[1]) || null; +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + /** + * @param {import('postcss').Node} node + * @param {string | undefined} value + */ + const validate = (node, value) => { + const issue = value && findIrregularWhitespace(value); + + if (issue) { + report({ + ruleName, + result, + message: messages.unexpected, + node, + word: issue, + }); + } + }; + + root.walkAtRules((atRule) => { + validate(atRule, atRule.name); + validate(atRule, atRule.params); + validate(atRule, atRule.raws.before); + validate(atRule, atRule.raws.after); + validate(atRule, atRule.raws.afterName); + validate(atRule, atRule.raws.between); + }); + + root.walkRules((ruleNode) => { + validate(ruleNode, ruleNode.selector); + validate(ruleNode, ruleNode.raws.before); + validate(ruleNode, ruleNode.raws.after); + validate(ruleNode, ruleNode.raws.between); + }); + + root.walkDecls((decl) => { + validate(decl, decl.prop); + validate(decl, decl.value); + validate(decl, decl.raws.before); + validate(decl, decl.raws.between); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-missing-end-of-source-newline/index.js b/node_modules/stylelint/lib/rules/no-missing-end-of-source-newline/index.js new file mode 100644 index 000000000..10c576afc --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-missing-end-of-source-newline/index.js @@ -0,0 +1,63 @@ +'use strict'; + +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'no-missing-end-of-source-newline'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected missing end-of-source newline', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-missing-end-of-source-newline', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + if (root.source == null) { + throw new Error('The root node must have a source property'); + } + + // @ts-expect-error -- TS2339: Property 'inline' does not exist on type 'Source'. + if (root.source.inline || root.source.lang === 'object-literal') { + return; + } + + const rootString = context.fix ? root.toString() : root.source.input.css; + + if (!rootString.trim() || rootString.endsWith('\n')) { + return; + } + + // Fix + if (context.fix) { + root.raws.after = context.newline; + + return; + } + + report({ + message: messages.rejected, + node: root, + index: rootString.length - 1, + result, + ruleName, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-unknown-animations/index.js b/node_modules/stylelint/lib/rules/no-unknown-animations/index.js new file mode 100644 index 000000000..fe5995c1b --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-unknown-animations/index.js @@ -0,0 +1,72 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const findAnimationName = require('../../utils/findAnimationName'); +const { animationNameKeywords } = require('../../reference/keywords'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'no-unknown-animations'; + +const messages = ruleMessages(ruleName, { + rejected: (animationName) => `Unexpected unknown animation name "${animationName}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-unknown-animations', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + const declaredAnimations = new Set(); + + root.walkAtRules(/(-(moz|webkit)-)?keyframes/i, (atRule) => { + declaredAnimations.add(atRule.params); + }); + + root.walkDecls((decl) => { + if (decl.prop.toLowerCase() === 'animation' || decl.prop.toLowerCase() === 'animation-name') { + const animationNames = findAnimationName(decl.value); + + if (animationNames.length === 0) { + return; + } + + for (const animationNameNode of animationNames) { + if (animationNameKeywords.has(animationNameNode.value.toLowerCase())) { + continue; + } + + if (declaredAnimations.has(animationNameNode.value)) { + continue; + } + + const begin = declarationValueIndex(decl); + + report({ + result, + ruleName, + message: messages.rejected, + messageArgs: [animationNameNode.value], + node: decl, + index: begin + animationNameNode.sourceIndex, + endIndex: begin + animationNameNode.sourceEndIndex, + }); + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-unknown-custom-properties/index.js b/node_modules/stylelint/lib/rules/no-unknown-custom-properties/index.js new file mode 100644 index 000000000..a15965af4 --- /dev/null +++ b/node_modules/stylelint/lib/rules/no-unknown-custom-properties/index.js @@ -0,0 +1,72 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const { isValueFunction } = require('../../utils/typeGuards'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'no-unknown-custom-properties'; + +const messages = ruleMessages(ruleName, { + rejected: (propName) => `Unexpected unknown custom property "${propName}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/no-unknown-custom-properties', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) return; + + /** @type {Set} */ + const declaredCustomProps = new Set(); + + root.walkAtRules(/^property$/i, ({ params }) => { + declaredCustomProps.add(params); + }); + + root.walkDecls(/^--/, ({ prop }) => { + declaredCustomProps.add(prop); + }); + + root.walkDecls((decl) => { + const { value } = decl; + + const parsedValue = valueParser(value); + + parsedValue.walk((node) => { + if (!isValueFunction(node) || node.value !== 'var') return; + + const [firstNode, secondNode] = node.nodes; + + if (!firstNode || declaredCustomProps.has(firstNode.value)) return; + + // Second node (div) indicates fallback exists in all cases + if (secondNode && secondNode.type === 'div') return; + + const startIndex = declarationValueIndex(decl); + + report({ + result, + ruleName, + message: messages.rejected, + messageArgs: [firstNode.value], + node: decl, + index: startIndex + firstNode.sourceIndex, + endIndex: startIndex + firstNode.sourceEndIndex, + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/number-leading-zero/index.js b/node_modules/stylelint/lib/rules/number-leading-zero/index.js new file mode 100644 index 000000000..82ccc2ed7 --- /dev/null +++ b/node_modules/stylelint/lib/rules/number-leading-zero/index.js @@ -0,0 +1,197 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const { isAtRule } = require('../../utils/typeGuards'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'number-leading-zero'; + +const messages = ruleMessages(ruleName, { + expected: 'Expected a leading zero', + rejected: 'Unexpected leading zero', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/number-leading-zero', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + root.walkAtRules((atRule) => { + if (atRule.name.toLowerCase() === 'import') { + return; + } + + check(atRule, atRule.params); + }); + + root.walkDecls((decl) => check(decl, decl.value)); + + /** + * @param {import('postcss').AtRule | import('postcss').Declaration} node + * @param {string} value + */ + function check(node, value) { + /** @type {Array<{ startIndex: number, endIndex: number }>} */ + const neverFixPositions = []; + /** @type {Array<{ index: number }>} */ + const alwaysFixPositions = []; + + // Get out quickly if there are no periods + if (!value.includes('.')) { + return; + } + + valueParser(value).walk((valueNode) => { + // Ignore `url` function + if (valueNode.type === 'function' && valueNode.value.toLowerCase() === 'url') { + return false; + } + + // Ignore strings, comments, etc + if (valueNode.type !== 'word') { + return; + } + + // Check leading zero + if (primary === 'always') { + const match = /(?:\D|^)(\.\d+)/.exec(valueNode.value); + + if (match == null || match[0] == null || match[1] == null) { + return; + } + + // The regexp above consists of 2 capturing groups (or capturing parentheses). + // We need the index of the second group. This makes sanse when we have "-.5" as an input + // for regex. And we need the index of ".5". + const capturingGroupIndex = match[0].length - match[1].length; + + const index = valueNode.sourceIndex + match.index + capturingGroupIndex; + + if (context.fix) { + alwaysFixPositions.unshift({ + index, + }); + + return; + } + + const baseIndex = isAtRule(node) ? atRuleParamIndex(node) : declarationValueIndex(node); + + complain(messages.expected, node, baseIndex + index); + } + + if (primary === 'never') { + const match = /(?:\D|^)(0+)(\.\d+)/.exec(valueNode.value); + + if (match == null || match[0] == null || match[1] == null || match[2] == null) { + return; + } + + // The regexp above consists of 3 capturing groups (or capturing parentheses). + // We need the index of the second group. This makes sanse when we have "-00.5" + // as an input for regex. And we need the index of "00". + const capturingGroupIndex = match[0].length - (match[1].length + match[2].length); + + const index = valueNode.sourceIndex + match.index + capturingGroupIndex; + + if (context.fix) { + neverFixPositions.unshift({ + startIndex: index, + // match[1].length is the length of our matched zero(s) + endIndex: index + match[1].length, + }); + + return; + } + + const baseIndex = isAtRule(node) ? atRuleParamIndex(node) : declarationValueIndex(node); + + complain(messages.rejected, node, baseIndex + index); + } + }); + + if (alwaysFixPositions.length) { + for (const fixPosition of alwaysFixPositions) { + const index = fixPosition.index; + + if (isAtRule(node)) { + node.params = addLeadingZero(node.params, index); + } else { + node.value = addLeadingZero(node.value, index); + } + } + } + + if (neverFixPositions.length) { + for (const fixPosition of neverFixPositions) { + const startIndex = fixPosition.startIndex; + const endIndex = fixPosition.endIndex; + + if (isAtRule(node)) { + node.params = removeLeadingZeros(node.params, startIndex, endIndex); + } else { + node.value = removeLeadingZeros(node.value, startIndex, endIndex); + } + } + } + } + + /** + * @param {string} message + * @param {import('postcss').Node} node + * @param {number} index + */ + function complain(message, node, index) { + report({ + result, + ruleName, + message, + node, + index, + }); + } + }; +}; + +/** + * @param {string} input + * @param {number} index + * @returns {string} + */ +function addLeadingZero(input, index) { + // eslint-disable-next-line prefer-template + return input.slice(0, index) + '0' + input.slice(index); +} + +/** + * @param {string} input + * @param {number} startIndex + * @param {number} endIndex + * @returns {string} + */ +function removeLeadingZeros(input, startIndex, endIndex) { + return input.slice(0, startIndex) + input.slice(endIndex); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/number-max-precision/index.js b/node_modules/stylelint/lib/rules/number-max-precision/index.js new file mode 100644 index 000000000..04bd895a3 --- /dev/null +++ b/node_modules/stylelint/lib/rules/number-max-precision/index.js @@ -0,0 +1,214 @@ +'use strict'; + +const { tokenize, TokenType } = require('@csstools/css-tokenizer'); +const { + isFunctionNode, + isSimpleBlockNode, + isTokenNode, + parseListOfComponentValues, +} = require('@csstools/css-parser-algorithms'); + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getAtRuleParams = require('../../utils/getAtRuleParams'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isNumber, isRegExp, isString } = require('../../utils/validateTypes'); +const validateObjectWithProps = require('../../utils/validateObjectWithProps'); + +const ruleName = 'number-max-precision'; + +const messages = ruleMessages(ruleName, { + expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/number-max-precision', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [isNumber], + }, + { + optional: true, + actual: secondaryOptions, + possible: { + ignoreProperties: [isString, isRegExp], + ignoreUnits: [isString, isRegExp], + insideFunctions: [validateObjectWithProps(isNumber)], + }, + }, + ); + + if (!validOptions) { + return; + } + + /** @type {Map} */ + const insideFunctions = new Map(Object.entries(secondaryOptions?.insideFunctions ?? {})); + + root.walkAtRules((atRule) => { + if (atRule.name.toLowerCase() === 'import') { + return; + } + + check(atRule, atRuleParamIndex, getAtRuleParams(atRule)); + }); + + root.walkDecls((decl) => { + check(decl, declarationValueIndex, getDeclarationValue(decl)); + }); + + /** + * @template {import('postcss').AtRule | import('postcss').Declaration} T + * @param {T} node + * @param {(node: T) => number} getIndex + * @param {string} value + */ + function check(node, getIndex, value) { + // Get out quickly if there are no periods + if (!value.includes('.')) { + return; + } + + const prop = 'prop' in node ? node.prop : undefined; + + if (optionsMatches(secondaryOptions, 'ignoreProperties', prop)) { + return; + } + + parseListOfComponentValues(tokenize({ css: value })).forEach((componentValue) => { + const initialState = { + ignored: false, + precision: primary, + }; + + walker(node, getIndex, componentValue, initialState); + + if (isFunctionNode(componentValue) || isSimpleBlockNode(componentValue)) { + componentValue.walk(({ node: mediaNode, state }) => { + if (!state) return; + + if (state.ignored) return; + + walker(node, getIndex, mediaNode, state); + }, initialState); + } + }); + } + + /** + * @template {import('postcss').AtRule | import('postcss').Declaration} T + * @param {T} node + * @param {(node: T) => number} getIndex + * @param {import('@csstools/css-parser-algorithms').ComponentValue} componentValue + * @param {{ ignored: boolean, precision: number }} state + */ + function walker(node, getIndex, componentValue, state) { + if (isFunctionNode(componentValue)) { + const name = componentValue.getName().toLowerCase(); + + if (name === 'url') { + // postcss-value-parser exposed url token contents as "word" tokens, these were indistinguishable from numeric values in any other function. + // With @csstools/css-tokenizer this is no longer relevant, but we preserve the old condition to avoid breaking changes. + state.ignored = true; + + return; + } + + state.precision = precisionInsideFunction(name, state.precision); + + return; + } + + if (!isTokenNode(componentValue)) { + return; + } + + const [tokenType, raw, startIndex, endIndex, parsedValue] = componentValue.value; + + if ( + tokenType !== TokenType.Number && + tokenType !== TokenType.Dimension && + tokenType !== TokenType.Percentage + ) { + return; + } + + let unitStringLength = 0; + + if (tokenType === TokenType.Dimension) { + const unit = parsedValue.unit; + + unitStringLength = unit.length; + + if (optionsMatches(secondaryOptions, 'ignoreUnits', unit)) { + return; + } + } else if (tokenType === TokenType.Percentage) { + unitStringLength = 1; + + if (optionsMatches(secondaryOptions, 'ignoreUnits', '%')) { + return; + } + } + + const match = /\d*\.(\d+)/.exec(raw); + + if (match == null || match[0] == null || match[1] == null) { + return; + } + + if (match[1].length <= state.precision) { + return; + } + + const nodeIndex = getIndex(node); + + report({ + result, + ruleName, + node, + index: nodeIndex + startIndex, + endIndex: nodeIndex + (endIndex + 1) - unitStringLength, + message: messages.expected, + messageArgs: [parsedValue.value, parsedValue.value.toFixed(state.precision)], + }); + } + + /** + * @param {string} functionName + * @param {number} currentPrecision + * @returns {number} + */ + function precisionInsideFunction(functionName, currentPrecision) { + const precisionForFunction = insideFunctions.get(functionName); + + if (isNumber(precisionForFunction)) return precisionForFunction; + + for (const [name, precision] of insideFunctions) { + if (matchesStringOrRegExp(functionName, name)) { + return precision; + } + } + + return currentPrecision; + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/number-no-trailing-zeros/index.js b/node_modules/stylelint/lib/rules/number-no-trailing-zeros/index.js new file mode 100644 index 000000000..287ce07a4 --- /dev/null +++ b/node_modules/stylelint/lib/rules/number-no-trailing-zeros/index.js @@ -0,0 +1,140 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const { isAtRule } = require('../../utils/typeGuards'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'number-no-trailing-zeros'; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected trailing zero(s)', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/number-no-trailing-zeros', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkAtRules((atRule) => { + if (atRule.name.toLowerCase() === 'import') { + return; + } + + check(atRule, atRule.params); + }); + + root.walkDecls((decl) => check(decl, decl.value)); + + /** + * @param {import('postcss').AtRule | import('postcss').Declaration} node + * @param {string} value + */ + function check(node, value) { + /** @type {Array<{ startIndex: number, endIndex: number }>} */ + const fixPositions = []; + + // Get out quickly if there are no periods + if (!value.includes('.')) { + return; + } + + valueParser(value).walk((valueNode) => { + // Ignore `url` function + if (valueNode.type === 'function' && valueNode.value.toLowerCase() === 'url') { + return false; + } + + // Ignore strings, comments, etc + if (valueNode.type !== 'word') { + return; + } + + const match = /\.(\d{0,100}?)(0+)(?:\D|$)/.exec(valueNode.value); + + // match[1] is any numbers between the decimal and our trailing zero, could be empty + // match[2] is our trailing zero(s) + if (match == null || match[1] == null || match[2] == null) { + return; + } + + // our index is: + // the index of our valueNode + + // the index of our match + + // 1 for our decimal + + // the length of our potential non-zero number match (match[1]) + const index = valueNode.sourceIndex + match.index + 1 + match[1].length; + + // our startIndex is identical to our index except when we have only + // trailing zeros after our decimal. in that case we don't need the decimal + // either so we move our index back by 1. + const startIndex = match[1].length > 0 ? index : index - 1; + + // our end index is our original index + the length of our trailing zeros + const endIndex = index + match[2].length; + + if (context.fix) { + fixPositions.unshift({ + startIndex, + endIndex, + }); + + return; + } + + const baseIndex = isAtRule(node) ? atRuleParamIndex(node) : declarationValueIndex(node); + + report({ + message: messages.rejected, + node, + // this is the index of the _first_ trailing zero + index: baseIndex + index, + result, + ruleName, + }); + }); + + if (fixPositions.length) { + for (const fixPosition of fixPositions) { + const startIndex = fixPosition.startIndex; + const endIndex = fixPosition.endIndex; + + if (isAtRule(node)) { + node.params = removeTrailingZeros(node.params, startIndex, endIndex); + } else { + node.value = removeTrailingZeros(node.value, startIndex, endIndex); + } + } + } + } + }; +}; + +/** + * @param {string} input + * @param {number} startIndex + * @param {number} endIndex + * @returns {string} + */ +function removeTrailingZeros(input, startIndex, endIndex) { + return input.slice(0, startIndex) + input.slice(endIndex); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/property-allowed-list/index.js b/node_modules/stylelint/lib/rules/property-allowed-list/index.js new file mode 100644 index 000000000..c35948309 --- /dev/null +++ b/node_modules/stylelint/lib/rules/property-allowed-list/index.js @@ -0,0 +1,67 @@ +'use strict'; + +const isCustomProperty = require('../../utils/isCustomProperty'); +const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'property-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (property) => `Unexpected property "${property}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/property-allowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + const prop = decl.prop; + + if (!isStandardSyntaxProperty(prop)) { + return; + } + + if (isCustomProperty(prop)) { + return; + } + + // either the prefix or unprefixed version is in the list + if (matchesStringOrRegExp([prop, vendor.unprefixed(prop)], primary)) { + return; + } + + report({ + message: messages.rejected, + messageArgs: [prop], + word: prop, + node: decl, + result, + ruleName, + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/property-case/index.js b/node_modules/stylelint/lib/rules/property-case/index.js new file mode 100644 index 000000000..a52b72b26 --- /dev/null +++ b/node_modules/stylelint/lib/rules/property-case/index.js @@ -0,0 +1,96 @@ +'use strict'; + +const isCustomProperty = require('../../utils/isCustomProperty'); +const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const optionsMatches = require('../../utils/optionsMatches'); +const { isRegExp, isString } = require('../../utils/validateTypes'); +const { isRule } = require('../../utils/typeGuards'); + +const ruleName = 'property-case'; + +const messages = ruleMessages(ruleName, { + expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/property-case', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['lower', 'upper'], + }, + { + actual: secondaryOptions, + possible: { + ignoreSelectors: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + const prop = decl.prop; + + if (!isStandardSyntaxProperty(prop)) { + return; + } + + if (isCustomProperty(prop)) { + return; + } + + const { parent } = decl; + + if (!parent) throw new Error('A parent node must be present'); + + if (isRule(parent)) { + const { selector } = parent; + + if (selector && optionsMatches(secondaryOptions, 'ignoreSelectors', selector)) { + return; + } + } + + const expectedProp = primary === 'lower' ? prop.toLowerCase() : prop.toUpperCase(); + + if (prop === expectedProp) { + return; + } + + if (context.fix) { + decl.prop = expectedProp; + + return; + } + + report({ + message: messages.expected(prop, expectedProp), + word: prop, + node: decl, + ruleName, + result, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/property-disallowed-list/index.js b/node_modules/stylelint/lib/rules/property-disallowed-list/index.js new file mode 100644 index 000000000..f98827897 --- /dev/null +++ b/node_modules/stylelint/lib/rules/property-disallowed-list/index.js @@ -0,0 +1,67 @@ +'use strict'; + +const isCustomProperty = require('../../utils/isCustomProperty'); +const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'property-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (property) => `Unexpected property "${property}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/property-disallowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + const prop = decl.prop; + + if (!isStandardSyntaxProperty(prop)) { + return; + } + + if (isCustomProperty(prop)) { + return; + } + + // either the prefix or unprefixed version is in the list + if (!matchesStringOrRegExp([prop, vendor.unprefixed(prop)], primary)) { + return; + } + + report({ + message: messages.rejected, + messageArgs: [prop], + word: prop, + node: decl, + result, + ruleName, + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/property-no-unknown/index.js b/node_modules/stylelint/lib/rules/property-no-unknown/index.js new file mode 100644 index 000000000..b6b05899e --- /dev/null +++ b/node_modules/stylelint/lib/rules/property-no-unknown/index.js @@ -0,0 +1,120 @@ +'use strict'; + +const isCustomProperty = require('../../utils/isCustomProperty'); +const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); +const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); +const optionsMatches = require('../../utils/optionsMatches'); +const properties = require('known-css-properties').all; +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const { isAtRule, isRule } = require('../../utils/typeGuards'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isBoolean, isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'property-no-unknown'; + +const messages = ruleMessages(ruleName, { + rejected: (property) => `Unexpected unknown property "${property}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/property-no-unknown', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + const allValidProperties = new Set(properties); + + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignoreProperties: [isString, isRegExp], + checkPrefixed: [isBoolean], + ignoreSelectors: [isString, isRegExp], + ignoreAtRules: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const shouldCheckPrefixed = secondaryOptions && secondaryOptions.checkPrefixed; + + root.walkDecls(checkStatement); + + /** + * @param {import('postcss').Declaration} decl + */ + function checkStatement(decl) { + const prop = decl.prop; + + if (!isStandardSyntaxProperty(prop)) { + return; + } + + if (!isStandardSyntaxDeclaration(decl)) { + return; + } + + if (isCustomProperty(prop)) { + return; + } + + if (!shouldCheckPrefixed && vendor.prefix(prop)) { + return; + } + + if (optionsMatches(secondaryOptions, 'ignoreProperties', prop)) { + return; + } + + const parent = decl.parent; + + if ( + parent && + isRule(parent) && + optionsMatches(secondaryOptions, 'ignoreSelectors', parent.selector) + ) { + return; + } + + /** @type {import('postcss').Node | undefined} */ + let node = parent; + + while (node && node.type !== 'root') { + if (isAtRule(node) && optionsMatches(secondaryOptions, 'ignoreAtRules', node.name)) { + return; + } + + node = node.parent; + } + + if (allValidProperties.has(prop.toLowerCase())) { + return; + } + + report({ + message: messages.rejected, + messageArgs: [prop], + node: decl, + result, + ruleName, + word: prop, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/property-no-vendor-prefix/index.js b/node_modules/stylelint/lib/rules/property-no-vendor-prefix/index.js new file mode 100644 index 000000000..3e186ed7f --- /dev/null +++ b/node_modules/stylelint/lib/rules/property-no-vendor-prefix/index.js @@ -0,0 +1,83 @@ +'use strict'; + +const isAutoprefixable = require('../../utils/isAutoprefixable'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'property-no-vendor-prefix'; + +const messages = ruleMessages(ruleName, { + rejected: (property) => `Unexpected vendor-prefix "${property}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/property-no-vendor-prefix', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + optional: true, + actual: secondaryOptions, + possible: { + ignoreProperties: [isString, isRegExp], + }, + }, + ); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + const prop = decl.prop; + const unprefixedProp = vendor.unprefixed(prop); + + //return early if property is to be ignored + if (optionsMatches(secondaryOptions, 'ignoreProperties', unprefixedProp)) { + return; + } + + // Make sure there's a vendor prefix, + // but this isn't a custom property + + if (prop[0] !== '-' || prop[1] === '-') { + return; + } + + if (!isAutoprefixable.property(prop)) { + return; + } + + if (context.fix) { + decl.prop = isAutoprefixable.unprefix(decl.prop); + + return; + } + + report({ + message: messages.rejected, + messageArgs: [prop], + word: prop, + node: decl, + result, + ruleName, + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/rule-empty-line-before/index.js b/node_modules/stylelint/lib/rules/rule-empty-line-before/index.js new file mode 100644 index 000000000..cec5efbf1 --- /dev/null +++ b/node_modules/stylelint/lib/rules/rule-empty-line-before/index.js @@ -0,0 +1,162 @@ +'use strict'; + +const addEmptyLineBefore = require('../../utils/addEmptyLineBefore'); +const getPreviousNonSharedLineCommentNode = require('../../utils/getPreviousNonSharedLineCommentNode'); +const hasEmptyLine = require('../../utils/hasEmptyLine'); +const isAfterSingleLineComment = require('../../utils/isAfterSingleLineComment'); +const isFirstNested = require('../../utils/isFirstNested'); +const isFirstNodeOfRoot = require('../../utils/isFirstNodeOfRoot'); +const isSingleLineString = require('../../utils/isSingleLineString'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const optionsMatches = require('../../utils/optionsMatches'); +const removeEmptyLinesBefore = require('../../utils/removeEmptyLinesBefore'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'rule-empty-line-before'; + +const messages = ruleMessages(ruleName, { + expected: 'Expected empty line before rule', + rejected: 'Unexpected empty line before rule', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/rule-empty-line-before', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['always', 'never', 'always-multi-line', 'never-multi-line'], + }, + { + actual: secondaryOptions, + possible: { + ignore: ['after-comment', 'first-nested', 'inside-block'], + except: [ + 'after-rule', + 'after-single-line-comment', + 'first-nested', + 'inside-block-and-after-rule', + 'inside-block', + ], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const expectation = /** @type {string} */ (primary); + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + // Ignore the first node + if (isFirstNodeOfRoot(ruleNode)) { + return; + } + + // Optionally ignore the expectation if a comment precedes this node + if (optionsMatches(secondaryOptions, 'ignore', 'after-comment')) { + const prevNode = ruleNode.prev(); + + if (prevNode && prevNode.type === 'comment') { + return; + } + } + + // Optionally ignore the node if it is the first nested + if (optionsMatches(secondaryOptions, 'ignore', 'first-nested') && isFirstNested(ruleNode)) { + return; + } + + const isNested = ruleNode.parent && ruleNode.parent.type !== 'root'; + + // Optionally ignore the expectation if inside a block + if (optionsMatches(secondaryOptions, 'ignore', 'inside-block') && isNested) { + return; + } + + // Ignore if the expectation is for multiple and the rule is single-line + if (expectation.includes('multi-line') && isSingleLineString(ruleNode.toString())) { + return; + } + + let expectEmptyLineBefore = expectation.includes('always'); + + // Optionally reverse the expectation if any exceptions apply + if ( + (optionsMatches(secondaryOptions, 'except', 'first-nested') && isFirstNested(ruleNode)) || + (optionsMatches(secondaryOptions, 'except', 'after-rule') && isAfterRule(ruleNode)) || + (optionsMatches(secondaryOptions, 'except', 'inside-block-and-after-rule') && + isNested && + isAfterRule(ruleNode)) || + (optionsMatches(secondaryOptions, 'except', 'after-single-line-comment') && + isAfterSingleLineComment(ruleNode)) || + (optionsMatches(secondaryOptions, 'except', 'inside-block') && isNested) + ) { + expectEmptyLineBefore = !expectEmptyLineBefore; + } + + const hasEmptyLineBefore = hasEmptyLine(ruleNode.raws.before); + + // Return if the expectation is met + if (expectEmptyLineBefore === hasEmptyLineBefore) { + return; + } + + // Fix + if (context.fix) { + const newline = context.newline; + + if (typeof newline !== 'string') { + throw new Error(`The "newline" property must be a string: ${newline}`); + } + + if (expectEmptyLineBefore) { + addEmptyLineBefore(ruleNode, newline); + } else { + removeEmptyLinesBefore(ruleNode, newline); + } + + return; + } + + const message = expectEmptyLineBefore ? messages.expected : messages.rejected; + + report({ + message, + node: ruleNode, + result, + ruleName, + }); + }); + }; +}; + +/** + * @param {import('postcss').Rule} ruleNode + * @returns {boolean} + */ +function isAfterRule(ruleNode) { + const prevNode = getPreviousNonSharedLineCommentNode(ruleNode); + + return prevNode != null && prevNode.type === 'rule'; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/rule-selector-property-disallowed-list/index.js b/node_modules/stylelint/lib/rules/rule-selector-property-disallowed-list/index.js new file mode 100644 index 000000000..da8ed8ecd --- /dev/null +++ b/node_modules/stylelint/lib/rules/rule-selector-property-disallowed-list/index.js @@ -0,0 +1,75 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); +const validateOptions = require('../../utils/validateOptions'); +const { isString, isRegExp } = require('../../utils/validateTypes'); + +const ruleName = 'rule-selector-property-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (selector, property) => `Unexpected property "${property}" for selector "${selector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/rule-selector-property-disallowed-list', +}; + +/** @type {import('stylelint').Rule>>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [validateObjectWithArrayProps(isString, isRegExp)], + }); + + if (!validOptions) { + return; + } + + const selectors = Object.keys(primary); + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selectorKey = selectors.find((selector) => + matchesStringOrRegExp(ruleNode.selector, selector), + ); + + if (!selectorKey) { + return; + } + + const disallowedProperties = primary[selectorKey]; + + if (!disallowedProperties) { + return; + } + + ruleNode.walkDecls((decl) => { + const { prop } = decl; + + if (matchesStringOrRegExp(prop, disallowedProperties)) { + report({ + message: messages.rejected, + messageArgs: [ruleNode.selector, prop], + node: decl, + result, + ruleName, + word: prop, + }); + } + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-anb-no-unmatchable/index.js b/node_modules/stylelint/lib/rules/selector-anb-no-unmatchable/index.js new file mode 100644 index 000000000..c4c494ebd --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-anb-no-unmatchable/index.js @@ -0,0 +1,111 @@ +'use strict'; + +const { parse } = require('css-tree'); +const { + aNPlusBNotationPseudoClasses, + aNPlusBOfSNotationPseudoClasses, +} = require('../../reference/selectors'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); + +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const hasANPlusBNotationPseudoClasses = require('../../utils/hasANPlusBNotationPseudoClasses'); + +const ruleName = 'selector-anb-no-unmatchable'; + +const messages = ruleMessages(ruleName, { + rejected: (pseudoClass) => `Unexpected unmatchable An+B selector "${pseudoClass}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-anb-no-unmatchable', +}; + +function isUnmatchableNth(/** @type {import('css-tree').AnPlusB} */ nth) { + const { a, b } = nth; + + if (a !== null && a !== '0' && a !== '-0') { + return false; + } + + if (b !== null && b !== '0' && b !== '-0') { + return false; + } + + return true; +} + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!hasANPlusBNotationPseudoClasses(ruleNode.selector)) return; + + if (!isStandardSyntaxRule(ruleNode)) return; + + ruleNode.selectors.forEach((selector) => { + let cssTreeSelector; + + try { + cssTreeSelector = parse(selector, { context: 'selector', positions: true }); + } catch (e) { + return; + } + + checkSelector(cssTreeSelector); + }); + + function checkSelector(/** @type {import('css-tree').CssNode} */ selector) { + if (selector.type !== 'Selector') { + return; + } + + selector.children.forEach((selectorChild) => { + if ( + selectorChild.type !== 'PseudoClassSelector' || + (!aNPlusBNotationPseudoClasses.has(selectorChild.name) && + !aNPlusBOfSNotationPseudoClasses.has(selectorChild.name)) + ) { + return; + } + + const pseudoClassSelector = selectorChild; + + if (pseudoClassSelector.children === null) { + return; + } + + pseudoClassSelector.children.forEach((child) => { + if (child.type !== 'Nth' || child.nth.type !== 'AnPlusB') { + return; + } + + if (isUnmatchableNth(child.nth)) { + report({ + message: messages.rejected, + messageArgs: [`:${pseudoClassSelector.name}`], + node: ruleNode, + index: pseudoClassSelector.loc?.start.column, + endIndex: pseudoClassSelector.loc?.end.column, + result, + ruleName, + }); + } + }); + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-brackets-space-inside/index.js b/node_modules/stylelint/lib/rules/selector-attribute-brackets-space-inside/index.js new file mode 100644 index 000000000..2654751b5 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-attribute-brackets-space-inside/index.js @@ -0,0 +1,209 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const styleSearch = require('style-search'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'selector-attribute-brackets-space-inside'; + +const messages = ruleMessages(ruleName, { + expectedOpening: 'Expected single space after "["', + rejectedOpening: 'Unexpected whitespace after "["', + expectedClosing: 'Expected single space before "]"', + rejectedClosing: 'Unexpected whitespace before "]"', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-attribute-brackets-space-inside', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + if (!ruleNode.selector.includes('[')) { + return; + } + + const selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; + + let hasFixed; + const fixedSelector = parseSelector(selector, result, ruleNode, (selectorTree) => { + selectorTree.walkAttributes((attributeNode) => { + const attributeSelectorString = attributeNode.toString(); + + styleSearch({ source: attributeSelectorString, target: '[' }, (match) => { + const nextCharIsSpace = attributeSelectorString[match.startIndex + 1] === ' '; + const index = attributeNode.sourceIndex + match.startIndex + 1; + + if (nextCharIsSpace && primary === 'never') { + if (context.fix) { + hasFixed = true; + fixBefore(attributeNode); + + return; + } + + complain(messages.rejectedOpening, index); + } + + if (!nextCharIsSpace && primary === 'always') { + if (context.fix) { + hasFixed = true; + fixBefore(attributeNode); + + return; + } + + complain(messages.expectedOpening, index); + } + }); + + styleSearch({ source: attributeSelectorString, target: ']' }, (match) => { + const prevCharIsSpace = attributeSelectorString[match.startIndex - 1] === ' '; + const index = attributeNode.sourceIndex + match.startIndex - 1; + + if (prevCharIsSpace && primary === 'never') { + if (context.fix) { + hasFixed = true; + fixAfter(attributeNode); + + return; + } + + complain(messages.rejectedClosing, index); + } + + if (!prevCharIsSpace && primary === 'always') { + if (context.fix) { + hasFixed = true; + fixAfter(attributeNode); + + return; + } + + complain(messages.expectedClosing, index); + } + }); + }); + }); + + if (hasFixed && fixedSelector) { + if (!ruleNode.raws.selector) { + ruleNode.selector = fixedSelector; + } else { + ruleNode.raws.selector.raw = fixedSelector; + } + } + + /** + * @param {string} message + * @param {number} index + */ + function complain(message, index) { + report({ + message, + index, + result, + ruleName, + node: ruleNode, + }); + } + }); + }; + + /** + * @param {import('postcss-selector-parser').Attribute} attributeNode + */ + function fixBefore(attributeNode) { + const spacesAttribute = attributeNode.raws.spaces && attributeNode.raws.spaces.attribute; + const rawAttrBefore = spacesAttribute && spacesAttribute.before; + + /** @type {{ attrBefore: string, setAttrBefore: (fixed: string) => void }} */ + const { attrBefore, setAttrBefore } = rawAttrBefore + ? { + attrBefore: rawAttrBefore, + setAttrBefore(fixed) { + spacesAttribute.before = fixed; + }, + } + : { + attrBefore: + (attributeNode.spaces.attribute && attributeNode.spaces.attribute.before) || '', + setAttrBefore(fixed) { + if (!attributeNode.spaces.attribute) attributeNode.spaces.attribute = {}; + + attributeNode.spaces.attribute.before = fixed; + }, + }; + + if (primary === 'always') { + setAttrBefore(attrBefore.replace(/^\s*/, ' ')); + } else if (primary === 'never') { + setAttrBefore(attrBefore.replace(/^\s*/, '')); + } + } + + /** + * @param {import('postcss-selector-parser').Attribute} attributeNode + */ + function fixAfter(attributeNode) { + const key = attributeNode.operator + ? attributeNode.insensitive + ? 'insensitive' + : 'value' + : 'attribute'; + + const rawSpaces = attributeNode.raws.spaces && attributeNode.raws.spaces[key]; + const rawAfter = rawSpaces && rawSpaces.after; + + const spaces = attributeNode.spaces[key]; + + /** @type {{ after: string, setAfter: (fixed: string) => void }} */ + const { after, setAfter } = rawAfter + ? { + after: rawAfter, + setAfter(fixed) { + rawSpaces.after = fixed; + }, + } + : { + after: (spaces && spaces.after) || '', + setAfter(fixed) { + if (!attributeNode.spaces[key]) attributeNode.spaces[key] = {}; + + // @ts-expect-error -- TS2532: Object is possibly 'undefined'. + attributeNode.spaces[key].after = fixed; + }, + }; + + if (primary === 'always') { + setAfter(after.replace(/\s*$/, ' ')); + } else if (primary === 'never') { + setAfter(after.replace(/\s*$/, '')); + } + } +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-name-disallowed-list/index.js b/node_modules/stylelint/lib/rules/selector-attribute-name-disallowed-list/index.js new file mode 100644 index 000000000..590921acc --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-attribute-name-disallowed-list/index.js @@ -0,0 +1,73 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-attribute-name-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (name) => `Unexpected name "${name}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-attribute-name-disallowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + if (!ruleNode.selector.includes('[')) { + return; + } + + parseSelector(ruleNode.selector, result, ruleNode, (selectorTree) => { + selectorTree.walkAttributes((attributeNode) => { + const attributeName = attributeNode.qualifiedAttribute; + + if (!matchesStringOrRegExp(attributeName, primary)) { + return; + } + + const index = attributeNode.sourceIndex + attributeNode.offsetOf('attribute'); + const endIndex = index + attributeName.length; + + report({ + message: messages.rejected, + messageArgs: [attributeName], + node: ruleNode, + index, + endIndex, + result, + ruleName, + }); + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-operator-allowed-list/index.js b/node_modules/stylelint/lib/rules/selector-attribute-operator-allowed-list/index.js new file mode 100644 index 000000000..3f7c17719 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-attribute-operator-allowed-list/index.js @@ -0,0 +1,76 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-attribute-operator-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (operator) => `Unexpected operator "${operator}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-attribute-operator-allowed-list', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString], + }); + + if (!validOptions) { + return; + } + + const primaryValues = new Set([primary].flat()); + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const { selector } = ruleNode; + + if (!selector.includes('[') || !selector.includes('=')) { + return; + } + + parseSelector(selector, result, ruleNode, (selectorTree) => { + selectorTree.walkAttributes((attributeNode) => { + const { operator } = attributeNode; + + if (!operator || primaryValues.has(operator)) { + return; + } + + const index = attributeNode.sourceIndex + attributeNode.offsetOf('operator'); + const endIndex = index + operator.length; + + report({ + message: messages.rejected, + messageArgs: [operator], + node: ruleNode, + index, + endIndex, + result, + ruleName, + }); + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-operator-disallowed-list/index.js b/node_modules/stylelint/lib/rules/selector-attribute-operator-disallowed-list/index.js new file mode 100644 index 000000000..c472ee33c --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-attribute-operator-disallowed-list/index.js @@ -0,0 +1,76 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-attribute-operator-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (operator) => `Unexpected operator "${operator}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-attribute-operator-disallowed-list', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString], + }); + + if (!validOptions) { + return; + } + + const primaryValues = new Set([primary].flat()); + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const { selector } = ruleNode; + + if (!selector.includes('[') || !selector.includes('=')) { + return; + } + + parseSelector(selector, result, ruleNode, (selectorTree) => { + selectorTree.walkAttributes((attributeNode) => { + const { operator } = attributeNode; + + if (!operator || !primaryValues.has(operator)) { + return; + } + + const index = attributeNode.sourceIndex + attributeNode.offsetOf('operator'); + const endIndex = index + operator.length; + + report({ + message: messages.rejected, + messageArgs: [operator], + node: ruleNode, + index, + endIndex, + result, + ruleName, + }); + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-operator-space-after/index.js b/node_modules/stylelint/lib/rules/selector-attribute-operator-space-after/index.js new file mode 100644 index 000000000..e5c84f2b4 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-attribute-operator-space-after/index.js @@ -0,0 +1,110 @@ +'use strict'; + +const ruleMessages = require('../../utils/ruleMessages'); +const selectorAttributeOperatorSpaceChecker = require('../selectorAttributeOperatorSpaceChecker'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'selector-attribute-operator-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: (operator) => `Expected single space after "${operator}"`, + rejectedAfter: (operator) => `Unexpected whitespace after "${operator}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-attribute-operator-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const checker = whitespaceChecker('space', primary, messages); + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + selectorAttributeOperatorSpaceChecker({ + root, + result, + locationChecker: checker.after, + checkedRuleName: ruleName, + checkBeforeOperator: false, + fix: context.fix + ? (attributeNode) => { + /** @type {{ operatorAfter: string, setOperatorAfter: (fixed: string) => void }} */ + const { operatorAfter, setOperatorAfter } = (() => { + const rawOperator = attributeNode.raws.operator; + + if (rawOperator) { + return { + operatorAfter: rawOperator.slice( + attributeNode.operator ? attributeNode.operator.length : 0, + ), + setOperatorAfter(fixed) { + delete attributeNode.raws.operator; + + if (!attributeNode.raws.spaces) attributeNode.raws.spaces = {}; + + if (!attributeNode.raws.spaces.operator) + attributeNode.raws.spaces.operator = {}; + + attributeNode.raws.spaces.operator.after = fixed; + }, + }; + } + + const rawSpacesOperator = + attributeNode.raws.spaces && attributeNode.raws.spaces.operator; + const rawOperatorAfter = rawSpacesOperator && rawSpacesOperator.after; + + if (rawOperatorAfter) { + return { + operatorAfter: rawOperatorAfter, + setOperatorAfter(fixed) { + rawSpacesOperator.after = fixed; + }, + }; + } + + return { + operatorAfter: + (attributeNode.spaces.operator && attributeNode.spaces.operator.after) || '', + setOperatorAfter(fixed) { + if (!attributeNode.spaces.operator) attributeNode.spaces.operator = {}; + + attributeNode.spaces.operator.after = fixed; + }, + }; + })(); + + if (primary === 'always') { + setOperatorAfter(operatorAfter.replace(/^\s*/, ' ')); + + return true; + } + + if (primary === 'never') { + setOperatorAfter(operatorAfter.replace(/^\s*/, '')); + + return true; + } + + return false; + } + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-operator-space-before/index.js b/node_modules/stylelint/lib/rules/selector-attribute-operator-space-before/index.js new file mode 100644 index 000000000..8ad04b168 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-attribute-operator-space-before/index.js @@ -0,0 +1,86 @@ +'use strict'; + +const ruleMessages = require('../../utils/ruleMessages'); +const selectorAttributeOperatorSpaceChecker = require('../selectorAttributeOperatorSpaceChecker'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'selector-attribute-operator-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: (operator) => `Expected single space before "${operator}"`, + rejectedBefore: (operator) => `Unexpected whitespace before "${operator}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-attribute-operator-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + selectorAttributeOperatorSpaceChecker({ + root, + result, + locationChecker: checker.before, + checkedRuleName: ruleName, + checkBeforeOperator: true, + fix: context.fix + ? (attributeNode) => { + const rawAttr = attributeNode.raws.spaces && attributeNode.raws.spaces.attribute; + const rawAttrAfter = rawAttr && rawAttr.after; + + /** @type {{ attrAfter: string, setAttrAfter: (fixed: string) => void }} */ + const { attrAfter, setAttrAfter } = rawAttrAfter + ? { + attrAfter: rawAttrAfter, + setAttrAfter(fixed) { + rawAttr.after = fixed; + }, + } + : { + attrAfter: + (attributeNode.spaces.attribute && attributeNode.spaces.attribute.after) || '', + setAttrAfter(fixed) { + if (!attributeNode.spaces.attribute) attributeNode.spaces.attribute = {}; + + attributeNode.spaces.attribute.after = fixed; + }, + }; + + if (primary === 'always') { + setAttrAfter(attrAfter.replace(/\s*$/, ' ')); + + return true; + } + + if (primary === 'never') { + setAttrAfter(attrAfter.replace(/\s*$/, '')); + + return true; + } + + return false; + } + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-quotes/index.js b/node_modules/stylelint/lib/rules/selector-attribute-quotes/index.js new file mode 100644 index 000000000..c2bbd671f --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-attribute-quotes/index.js @@ -0,0 +1,118 @@ +'use strict'; + +const getRuleSelector = require('../../utils/getRuleSelector'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isValidIdentifier = require('../../utils/isValidIdentifier'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'selector-attribute-quotes'; + +const messages = ruleMessages(ruleName, { + expected: (value) => `Expected quotes around "${value}"`, + rejected: (value) => `Unexpected quotes around "${value}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-attribute-quotes', + fixable: true, +}; + +const acceptedQuoteMark = '"'; + +/** @type {import('stylelint').Rule<'always' | 'never'>} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const { selector } = ruleNode; + + if (!selector.includes('[') || !selector.includes('=')) { + return; + } + + parseSelector(getRuleSelector(ruleNode), result, ruleNode, (selectorTree) => { + let selectorFixed = false; + + selectorTree.walkAttributes((attributeNode) => { + const { operator, value, quoted } = attributeNode; + + if (!operator || !value) { + return; + } + + if (!quoted && primary === 'always') { + if (context.fix) { + selectorFixed = true; + attributeNode.quoteMark = acceptedQuoteMark; + } else { + complain(messages.expected(value), attributeNode); + } + } + + if (quoted && primary === 'never') { + // some selectors require quotes to be valid; + // we pass in the raw string value, which contains the escape characters + // necessary to check if escaped characters are valid + // see: https://github.com/stylelint/stylelint/issues/4300 + if ( + !attributeNode.raws.value || + !isValidIdentifier(attributeNode.raws.value.slice(1, -1)) + ) { + return; + } + + if (context.fix) { + selectorFixed = true; + attributeNode.quoteMark = null; + } else { + complain(messages.rejected(value), attributeNode); + } + } + }); + + if (selectorFixed) { + ruleNode.selector = selectorTree.toString(); + } + }); + + /** + * @param {string} message + * @param {import('postcss-selector-parser').Attribute} attrNode + */ + function complain(message, attrNode) { + const index = attrNode.sourceIndex + attrNode.offsetOf('value'); + const value = attrNode.raws.value || attrNode.value || ''; + const endIndex = index + value.length; + + report({ + message, + index, + endIndex, + result, + ruleName, + node: ruleNode, + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-class-pattern/index.js b/node_modules/stylelint/lib/rules/selector-class-pattern/index.js new file mode 100644 index 000000000..69c0b83cc --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-class-pattern/index.js @@ -0,0 +1,154 @@ +'use strict'; + +const isKeyframeSelector = require('../../utils/isKeyframeSelector'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const resolveNestedSelector = require('postcss-resolve-nested-selector'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isBoolean, isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-class-pattern'; + +const messages = ruleMessages(ruleName, { + expected: (selector, pattern) => `Expected "${selector}" to match pattern "${pattern}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-class-pattern', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [isRegExp, isString], + }, + { + actual: secondaryOptions, + possible: { + resolveNestedSelectors: [isBoolean], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const shouldResolveNestedSelectors = Boolean( + secondaryOptions && secondaryOptions.resolveNestedSelectors, + ); + + const normalizedPattern = isString(primary) ? new RegExp(primary) : primary; + + root.walkRules((ruleNode) => { + const { selector, selectors } = ruleNode; + + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + if (selectors.some((s) => isKeyframeSelector(s))) { + return; + } + + // Only bother resolving selectors that have an interpolating & + if (shouldResolveNestedSelectors && hasInterpolatingAmpersand(selector)) { + for (const nestedSelector of resolveNestedSelector(selector, ruleNode)) { + if (!isStandardSyntaxSelector(nestedSelector)) { + continue; + } + + parseSelector(nestedSelector, result, ruleNode, (s) => checkSelector(s, ruleNode)); + } + } else { + parseSelector(selector, result, ruleNode, (s) => checkSelector(s, ruleNode)); + } + }); + + /** + * @param {import('postcss-selector-parser').Root} selectorNode + * @param {import('postcss').Rule} ruleNode + */ + function checkSelector(selectorNode, ruleNode) { + selectorNode.walkClasses((classNode) => { + const { value, sourceIndex: index } = classNode; + + if (normalizedPattern.test(value)) { + return; + } + + const selector = String(classNode); + + // TODO: `selector` may be resolved. So, getting its raw value may be pretty hard. + // It means `endIndex` may be inaccurate (though non-standard selectors). + // + // For example, given ".abc { &_x {} }". + // Then, an expected raw `selector` is "&_x", + // but, an actual `selector` is ".abc_x". + const endIndex = index + selector.length; + + report({ + result, + ruleName, + message: messages.expected, + messageArgs: [selector, primary], + node: ruleNode, + index, + endIndex, + }); + }); + } + }; +}; + +/** + * An "interpolating ampersand" means an "&" used to interpolate + * within another simple selector, rather than an "&" that + * stands on its own as a simple selector. + * + * @param {string} selector + * @returns {boolean} + */ +function hasInterpolatingAmpersand(selector) { + for (const [i, char] of Array.from(selector).entries()) { + if (char !== '&') { + continue; + } + + const prevChar = selector.charAt(i - 1); + + if (prevChar && !isCombinator(prevChar)) { + return true; + } + + const nextChar = selector.charAt(i + 1); + + if (nextChar && !isCombinator(nextChar)) { + return true; + } + } + + return false; +} + +/** + * @param {string} x + * @returns {boolean} + */ +function isCombinator(x) { + return /[\s+>~]/.test(x); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-combinator-allowed-list/index.js b/node_modules/stylelint/lib/rules/selector-combinator-allowed-list/index.js new file mode 100644 index 000000000..56d182630 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-combinator-allowed-list/index.js @@ -0,0 +1,84 @@ +'use strict'; + +const isStandardSyntaxCombinator = require('../../utils/isStandardSyntaxCombinator'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-combinator-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (combinator) => `Unexpected combinator "${combinator}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-combinator-allowed-list', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selector = ruleNode.selector; + + parseSelector(selector, result, ruleNode, (fullSelector) => { + fullSelector.walkCombinators((combinatorNode) => { + if (!isStandardSyntaxCombinator(combinatorNode)) { + return; + } + + const { value } = combinatorNode; + const normalizedValue = normalizeCombinator(value); + + if (primary.includes(normalizedValue)) { + return; + } + + const { sourceIndex: index, raws } = combinatorNode; + const endIndex = index + ((raws && raws.value) || value).length; + + report({ + result, + ruleName, + message: messages.rejected, + messageArgs: [normalizedValue], + node: ruleNode, + index, + endIndex, + }); + }); + }); + }); + }; +}; + +/** + * @param {string} value + * @returns {string} + */ +function normalizeCombinator(value) { + return value.replace(/\s+/g, ' '); +} + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-combinator-disallowed-list/index.js b/node_modules/stylelint/lib/rules/selector-combinator-disallowed-list/index.js new file mode 100644 index 000000000..6a5dd87a5 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-combinator-disallowed-list/index.js @@ -0,0 +1,84 @@ +'use strict'; + +const isStandardSyntaxCombinator = require('../../utils/isStandardSyntaxCombinator'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-combinator-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (combinator) => `Unexpected combinator "${combinator}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-combinator-disallowed-list', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selector = ruleNode.selector; + + parseSelector(selector, result, ruleNode, (fullSelector) => { + fullSelector.walkCombinators((combinatorNode) => { + if (!isStandardSyntaxCombinator(combinatorNode)) { + return; + } + + const { value } = combinatorNode; + const normalizedValue = normalizeCombinator(value); + + if (!primary.includes(normalizedValue)) { + return; + } + + const { sourceIndex: index, raws } = combinatorNode; + const endIndex = index + ((raws && raws.value) || value).length; + + report({ + result, + ruleName, + message: messages.rejected, + messageArgs: [normalizedValue], + node: ruleNode, + index, + endIndex, + }); + }); + }); + }); + }; +}; + +/** + * @param {string} value + * @returns {string} + */ +function normalizeCombinator(value) { + return value.replace(/\s+/g, ' '); +} + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-combinator-space-after/index.js b/node_modules/stylelint/lib/rules/selector-combinator-space-after/index.js new file mode 100644 index 000000000..aeb004973 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-combinator-space-after/index.js @@ -0,0 +1,65 @@ +'use strict'; + +const ruleMessages = require('../../utils/ruleMessages'); +const selectorCombinatorSpaceChecker = require('../selectorCombinatorSpaceChecker'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'selector-combinator-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: (combinator) => `Expected single space after "${combinator}"`, + rejectedAfter: (combinator) => `Unexpected whitespace after "${combinator}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-combinator-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + selectorCombinatorSpaceChecker({ + root, + result, + locationChecker: checker.after, + locationType: 'after', + checkedRuleName: ruleName, + fix: context.fix + ? (combinator) => { + if (primary === 'always') { + combinator.spaces.after = ' '; + + return true; + } + + if (primary === 'never') { + combinator.spaces.after = ''; + + return true; + } + + return false; + } + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-combinator-space-before/index.js b/node_modules/stylelint/lib/rules/selector-combinator-space-before/index.js new file mode 100644 index 000000000..ad75dc022 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-combinator-space-before/index.js @@ -0,0 +1,65 @@ +'use strict'; + +const ruleMessages = require('../../utils/ruleMessages'); +const selectorCombinatorSpaceChecker = require('../selectorCombinatorSpaceChecker'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'selector-combinator-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: (combinator) => `Expected single space before "${combinator}"`, + rejectedBefore: (combinator) => `Unexpected whitespace before "${combinator}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-combinator-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + selectorCombinatorSpaceChecker({ + root, + result, + locationChecker: checker.before, + locationType: 'before', + checkedRuleName: ruleName, + fix: context.fix + ? (combinator) => { + if (primary === 'always') { + combinator.spaces.before = ' '; + + return true; + } + + if (primary === 'never') { + combinator.spaces.before = ''; + + return true; + } + + return false; + } + : null, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-descendant-combinator-no-non-space/index.js b/node_modules/stylelint/lib/rules/selector-descendant-combinator-no-non-space/index.js new file mode 100644 index 000000000..a31255e29 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-descendant-combinator-no-non-space/index.js @@ -0,0 +1,95 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'selector-descendant-combinator-no-non-space'; + +const messages = ruleMessages(ruleName, { + rejected: (nonSpaceCharacter) => `Unexpected "${nonSpaceCharacter}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-descendant-combinator-no-non-space', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + let hasFixed = false; + const selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; + + // Return early for selectors containing comments + // TODO: re-enable when parser and stylelint are compatible + if (selector.includes('/*')) return; + + const fixedSelector = parseSelector(selector, result, ruleNode, (fullSelector) => { + fullSelector.walkCombinators((combinatorNode) => { + if (combinatorNode.value !== ' ') { + return; + } + + const value = combinatorNode.toString(); + + if ( + value.includes(' ') || + value.includes('\t') || + value.includes('\n') || + value.includes('\r') + ) { + if (context.fix && /^\s+$/.test(value)) { + hasFixed = true; + + if (!combinatorNode.raws) combinatorNode.raws = {}; + + combinatorNode.raws.value = ' '; + combinatorNode.rawSpaceBefore = combinatorNode.rawSpaceBefore.replace(/^\s+/, ''); + combinatorNode.rawSpaceAfter = combinatorNode.rawSpaceAfter.replace(/\s+$/, ''); + + return; + } + + report({ + result, + ruleName, + message: messages.rejected(value), + node: ruleNode, + index: combinatorNode.sourceIndex, + }); + } + }); + }); + + if (hasFixed && fixedSelector) { + if (!ruleNode.raws.selector) { + ruleNode.selector = fixedSelector; + } else { + ruleNode.raws.selector.raw = fixedSelector; + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-disallowed-list/index.js b/node_modules/stylelint/lib/rules/selector-disallowed-list/index.js new file mode 100644 index 000000000..d71fa3285 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-disallowed-list/index.js @@ -0,0 +1,100 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const report = require('../../utils/report'); +const optionsMatches = require('../../utils/optionsMatches'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString, isBoolean } = require('../../utils/validateTypes'); + +const ruleName = 'selector-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (selector) => `Unexpected selector "${selector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-disallowed-list', +}; + +/** @type {import('stylelint').Rule, { splitList: boolean, ignore: string[] }>} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [isString, isRegExp], + }, + { + actual: secondaryOptions, + possible: { + ignore: ['inside-block'], + splitList: [isBoolean], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const ignoreInsideBlock = optionsMatches(secondaryOptions, 'ignore', 'inside-block'); + const splitList = secondaryOptions && secondaryOptions.splitList; + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + if (ignoreInsideBlock) { + const { parent } = ruleNode; + const isInsideBlock = parent && parent.type !== 'root'; + + if (isInsideBlock) { + return; + } + } + + if (splitList) { + ruleNode.selectors.forEach((selector) => { + if (matchesStringOrRegExp(selector, primary)) { + report({ + result, + ruleName, + message: messages.rejected, + messageArgs: [selector], + node: ruleNode, + word: selector, + }); + } + }); + } else { + const { selector, raws } = ruleNode; + + if (matchesStringOrRegExp(selector, primary)) { + const word = (raws.selector && raws.selector.raw) || selector; + + report({ + result, + ruleName, + message: messages.rejected, + messageArgs: [selector], + node: ruleNode, + word, + }); + } + } + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-id-pattern/index.js b/node_modules/stylelint/lib/rules/selector-id-pattern/index.js new file mode 100644 index 000000000..c89280a78 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-id-pattern/index.js @@ -0,0 +1,64 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-id-pattern'; + +const messages = ruleMessages(ruleName, { + expected: (selector, pattern) => `Expected "${selector}" to match pattern "${pattern}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-id-pattern', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isRegExp, isString], + }); + + if (!validOptions) { + return; + } + + const normalizedPattern = isString(primary) ? new RegExp(primary) : primary; + + root.walkRules(/#/, (ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + parseSelector(ruleNode.selector, result, ruleNode, (fullSelector) => { + fullSelector.walkIds((selectorNode) => { + if (normalizedPattern.test(selectorNode.value)) { + return; + } + + const selector = String(selectorNode); + + report({ + result, + ruleName, + message: messages.expected, + messageArgs: [selector, primary], + node: ruleNode, + word: selector, + }); + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-list-comma-newline-after/index.js b/node_modules/stylelint/lib/rules/selector-list-comma-newline-after/index.js new file mode 100644 index 000000000..5901f32fe --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-list-comma-newline-after/index.js @@ -0,0 +1,122 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const styleSearch = require('style-search'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'selector-list-comma-newline-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected newline after ","', + expectedAfterMultiLine: () => 'Expected newline after "," in a multi-line list', + rejectedAfterMultiLine: () => 'Unexpected whitespace after "," in a multi-line list', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-list-comma-newline-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line', 'never-multi-line'], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + // Get raw selector so we can allow end-of-line comments, e.g. + // a, /* comment */ + // b {} + const selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; + + /** @type {number[]} */ + const fixIndices = []; + + styleSearch( + { + source: selector, + target: ',', + functionArguments: 'skip', + }, + (match) => { + const nextChars = selector.slice(match.endIndex); + + // If there's a // comment, that means there has to be a newline + // ending the comment so we're fine + if (/^\s+\/\//.test(nextChars)) { + return; + } + + // If there are spaces and then a comment begins, look for the newline + const indextoCheckAfter = /^\s+\/\*/.test(nextChars) + ? selector.indexOf('*/', match.endIndex) + 1 + : match.startIndex; + + checker.afterOneOnly({ + source: selector, + index: indextoCheckAfter, + err: (m) => { + if (context.fix) { + fixIndices.push(indextoCheckAfter + 1); + + return; + } + + report({ + message: m, + node: ruleNode, + index: match.startIndex, + result, + ruleName, + }); + }, + }); + }, + ); + + if (fixIndices.length) { + let fixedSelector = selector; + + for (const index of fixIndices.sort((a, b) => b - a)) { + const beforeSelector = fixedSelector.slice(0, index); + let afterSelector = fixedSelector.slice(index); + + if (primary.startsWith('always')) { + afterSelector = context.newline + afterSelector; + } else if (primary.startsWith('never-multi-line')) { + afterSelector = afterSelector.replace(/^\s*/, ''); + } + + fixedSelector = beforeSelector + afterSelector; + } + + if (ruleNode.raws.selector) { + ruleNode.raws.selector.raw = fixedSelector; + } else { + ruleNode.selector = fixedSelector; + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-list-comma-newline-before/index.js b/node_modules/stylelint/lib/rules/selector-list-comma-newline-before/index.js new file mode 100644 index 000000000..becc7c568 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-list-comma-newline-before/index.js @@ -0,0 +1,96 @@ +'use strict'; + +const ruleMessages = require('../../utils/ruleMessages'); +const selectorListCommaWhitespaceChecker = require('../selectorListCommaWhitespaceChecker'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'selector-list-comma-newline-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected newline before ","', + expectedBeforeMultiLine: () => 'Expected newline before "," in a multi-line list', + rejectedBeforeMultiLine: () => 'Unexpected whitespace before "," in a multi-line list', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-list-comma-newline-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line', 'never-multi-line'], + }); + + if (!validOptions) { + return; + } + + /** @type {Map | undefined} */ + let fixData; + + selectorListCommaWhitespaceChecker({ + root, + result, + locationChecker: checker.beforeAllowingIndentation, + checkedRuleName: ruleName, + fix: context.fix + ? (ruleNode, index) => { + fixData = fixData || new Map(); + const commaIndices = fixData.get(ruleNode) || []; + + commaIndices.push(index); + fixData.set(ruleNode, commaIndices); + + return true; + } + : null, + }); + + if (fixData) { + for (const [ruleNode, commaIndices] of fixData.entries()) { + let selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; + + for (const index of commaIndices.sort((a, b) => b - a)) { + let beforeSelector = selector.slice(0, index); + const afterSelector = selector.slice(index); + + if (primary.startsWith('always')) { + const spaceIndex = beforeSelector.search(/\s+$/); + + if (spaceIndex >= 0) { + beforeSelector = + beforeSelector.slice(0, spaceIndex) + + context.newline + + beforeSelector.slice(spaceIndex); + } else { + beforeSelector += context.newline; + } + } else if (primary === 'never-multi-line') { + beforeSelector = beforeSelector.replace(/\s*$/, ''); + } + + selector = beforeSelector + afterSelector; + } + + if (ruleNode.raws.selector) { + ruleNode.raws.selector.raw = selector; + } else { + ruleNode.selector = selector; + } + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-list-comma-space-after/index.js b/node_modules/stylelint/lib/rules/selector-list-comma-space-after/index.js new file mode 100644 index 000000000..c50d70790 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-list-comma-space-after/index.js @@ -0,0 +1,88 @@ +'use strict'; + +const ruleMessages = require('../../utils/ruleMessages'); +const selectorListCommaWhitespaceChecker = require('../selectorListCommaWhitespaceChecker'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'selector-list-comma-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected single space after ","', + rejectedAfter: () => 'Unexpected whitespace after ","', + expectedAfterSingleLine: () => 'Expected single space after "," in a single-line list', + rejectedAfterSingleLine: () => 'Unexpected whitespace after "," in a single-line list', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-list-comma-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never', 'always-single-line', 'never-single-line'], + }); + + if (!validOptions) { + return; + } + + /** @type {Map | undefined} */ + let fixData; + + selectorListCommaWhitespaceChecker({ + root, + result, + locationChecker: checker.after, + checkedRuleName: ruleName, + fix: context.fix + ? (ruleNode, index) => { + fixData = fixData || new Map(); + const commaIndices = fixData.get(ruleNode) || []; + + commaIndices.push(index); + fixData.set(ruleNode, commaIndices); + + return true; + } + : null, + }); + + if (fixData) { + for (const [ruleNode, commaIndices] of fixData.entries()) { + let selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; + + for (const index of commaIndices.sort((a, b) => b - a)) { + const beforeSelector = selector.slice(0, index + 1); + let afterSelector = selector.slice(index + 1); + + if (primary.startsWith('always')) { + afterSelector = afterSelector.replace(/^\s*/, ' '); + } else if (primary.startsWith('never')) { + afterSelector = afterSelector.replace(/^\s*/, ''); + } + + selector = beforeSelector + afterSelector; + } + + if (ruleNode.raws.selector) { + ruleNode.raws.selector.raw = selector; + } else { + ruleNode.selector = selector; + } + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-list-comma-space-before/index.js b/node_modules/stylelint/lib/rules/selector-list-comma-space-before/index.js new file mode 100644 index 000000000..e8e8cbe5b --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-list-comma-space-before/index.js @@ -0,0 +1,88 @@ +'use strict'; + +const ruleMessages = require('../../utils/ruleMessages'); +const selectorListCommaWhitespaceChecker = require('../selectorListCommaWhitespaceChecker'); +const validateOptions = require('../../utils/validateOptions'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'selector-list-comma-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before ","', + rejectedBefore: () => 'Unexpected whitespace before ","', + expectedBeforeSingleLine: () => 'Expected single space before "," in a single-line list', + rejectedBeforeSingleLine: () => 'Unexpected whitespace before "," in a single-line list', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-list-comma-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never', 'always-single-line', 'never-single-line'], + }); + + if (!validOptions) { + return; + } + + /** @type {Map | undefined} */ + let fixData; + + selectorListCommaWhitespaceChecker({ + root, + result, + locationChecker: checker.before, + checkedRuleName: ruleName, + fix: context.fix + ? (ruleNode, index) => { + fixData = fixData || new Map(); + const commaIndices = fixData.get(ruleNode) || []; + + commaIndices.push(index); + fixData.set(ruleNode, commaIndices); + + return true; + } + : null, + }); + + if (fixData) { + for (const [ruleNode, commaIndices] of fixData.entries()) { + let selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; + + for (const index of commaIndices.sort((a, b) => b - a)) { + let beforeSelector = selector.slice(0, index); + const afterSelector = selector.slice(index); + + if (primary.includes('always')) { + beforeSelector = beforeSelector.replace(/\s*$/, ' '); + } else if (primary.includes('never')) { + beforeSelector = beforeSelector.replace(/\s*$/, ''); + } + + selector = beforeSelector + afterSelector; + } + + if (ruleNode.raws.selector) { + ruleNode.raws.selector.raw = selector; + } else { + ruleNode.selector = selector; + } + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-attribute/index.js b/node_modules/stylelint/lib/rules/selector-max-attribute/index.js new file mode 100644 index 000000000..c2579242a --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-max-attribute/index.js @@ -0,0 +1,109 @@ +'use strict'; + +const isContextFunctionalPseudoClass = require('../../utils/isContextFunctionalPseudoClass'); +const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const optionsMatches = require('../../utils/optionsMatches'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const resolvedNestedSelector = require('postcss-resolve-nested-selector'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-max-attribute'; + +const messages = ruleMessages(ruleName, { + expected: (selector, max) => + `Expected "${selector}" to have no more than ${max} attribute ${ + max === 1 ? 'selector' : 'selectors' + }`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-max-attribute', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: isNonNegativeInteger, + }, + { + actual: secondaryOptions, + possible: { + ignoreAttributes: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + /** + * @param {import('postcss-selector-parser').Container} selectorNode + * @param {import('postcss').Rule} ruleNode + */ + function checkSelector(selectorNode, ruleNode) { + const count = selectorNode.reduce((total, childNode) => { + // Only traverse inside actual selectors and context functional pseudo-classes + if (childNode.type === 'selector' || isContextFunctionalPseudoClass(childNode)) { + checkSelector(childNode, ruleNode); + } + + if (childNode.type !== 'attribute') { + // Not an attribute node -> ignore + return total; + } + + if (optionsMatches(secondaryOptions, 'ignoreAttributes', childNode.attribute)) { + // it's an attribute that is supposed to be ignored + return total; + } + + total += 1; + + return total; + }, 0); + + if (selectorNode.type !== 'root' && selectorNode.type !== 'pseudo' && count > primary) { + const selector = selectorNode.toString(); + + report({ + ruleName, + result, + node: ruleNode, + message: messages.expected, + messageArgs: [selector, primary], + word: selector, + }); + } + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + for (const selector of ruleNode.selectors) { + for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { + parseSelector(resolvedSelector, result, ruleNode, (container) => + checkSelector(container, ruleNode), + ); + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-class/index.js b/node_modules/stylelint/lib/rules/selector-max-class/index.js new file mode 100644 index 000000000..63a7a092f --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-max-class/index.js @@ -0,0 +1,84 @@ +'use strict'; + +const isContextFunctionalPseudoClass = require('../../utils/isContextFunctionalPseudoClass'); +const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const resolvedNestedSelector = require('postcss-resolve-nested-selector'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'selector-max-class'; + +const messages = ruleMessages(ruleName, { + expected: (selector, max) => + `Expected "${selector}" to have no more than ${max} ${max === 1 ? 'class' : 'classes'}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-max-class', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: isNonNegativeInteger, + }); + + if (!validOptions) { + return; + } + + /** + * @param {import('postcss-selector-parser').Container} selectorNode + * @param {import('postcss').Rule} ruleNode + */ + function checkSelector(selectorNode, ruleNode) { + const count = selectorNode.reduce((total, childNode) => { + // Only traverse inside actual selectors and context functional pseudo-classes + if (childNode.type === 'selector' || isContextFunctionalPseudoClass(childNode)) { + checkSelector(childNode, ruleNode); + } + + if (childNode.type === 'class') total += 1; + + return total; + }, 0); + + if (selectorNode.type !== 'root' && selectorNode.type !== 'pseudo' && count > primary) { + const selector = selectorNode.toString(); + + report({ + ruleName, + result, + node: ruleNode, + message: messages.expected, + messageArgs: [selector, primary], + word: selector, + }); + } + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + for (const selector of ruleNode.selectors) { + for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { + parseSelector(resolvedSelector, result, ruleNode, (container) => + checkSelector(container, ruleNode), + ); + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-combinators/index.js b/node_modules/stylelint/lib/rules/selector-max-combinators/index.js new file mode 100644 index 000000000..39a34cf64 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-max-combinators/index.js @@ -0,0 +1,85 @@ +'use strict'; + +const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const resolvedNestedSelector = require('postcss-resolve-nested-selector'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'selector-max-combinators'; + +const messages = ruleMessages(ruleName, { + expected: (selector, max) => + `Expected "${selector}" to have no more than ${max} ${ + max === 1 ? 'combinator' : 'combinators' + }`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-max-combinators', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: isNonNegativeInteger, + }); + + if (!validOptions) { + return; + } + + /** + * @param {import('postcss-selector-parser').Container} selectorNode + * @param {import('postcss').Rule} ruleNode + */ + function checkSelector(selectorNode, ruleNode) { + const count = selectorNode.reduce((total, childNode) => { + // Only traverse inside actual selectors + if (childNode.type === 'selector') { + checkSelector(childNode, ruleNode); + } + + if (childNode.type === 'combinator') total += 1; + + return total; + }, 0); + + if (selectorNode.type !== 'root' && selectorNode.type !== 'pseudo' && count > primary) { + const selector = selectorNode.toString(); + + report({ + ruleName, + result, + node: ruleNode, + message: messages.expected, + messageArgs: [selector, primary], + word: selector, + }); + } + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + for (const selector of ruleNode.selectors) { + for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { + parseSelector(resolvedSelector, result, ruleNode, (container) => + checkSelector(container, ruleNode), + ); + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-compound-selectors/index.js b/node_modules/stylelint/lib/rules/selector-max-compound-selectors/index.js new file mode 100644 index 000000000..f12487261 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-max-compound-selectors/index.js @@ -0,0 +1,95 @@ +'use strict'; + +const isContextFunctionalPseudoClass = require('../../utils/isContextFunctionalPseudoClass'); +const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const resolvedNestedSelector = require('postcss-resolve-nested-selector'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'selector-max-compound-selectors'; + +const messages = ruleMessages(ruleName, { + expected: (selector, max) => + `Expected "${selector}" to have no more than ${max} compound ${ + max === 1 ? 'selector' : 'selectors' + }`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-max-compound-selectors', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: isNonNegativeInteger, + }); + + if (!validOptions) { + return; + } + + /** + * Finds actual selectors in selectorNode object and checks them. + * + * @param {import('postcss-selector-parser').Container} selectorNode + * @param {import('postcss').Rule} ruleNode + */ + function checkSelector(selectorNode, ruleNode) { + let compoundCount = 1; + + selectorNode.each((childNode) => { + // Only traverse inside actual selectors and context functional pseudo-classes + if (childNode.type === 'selector' || isContextFunctionalPseudoClass(childNode)) { + checkSelector(childNode, ruleNode); + } + + // Compound selectors are separated by combinators, so increase count when meeting one + if (childNode.type === 'combinator') { + compoundCount++; + } + }); + + if ( + selectorNode.type !== 'root' && + selectorNode.type !== 'pseudo' && + compoundCount > primary + ) { + const selector = selectorNode.toString(); + + report({ + ruleName, + result, + node: ruleNode, + message: messages.expected, + messageArgs: [selector, primary], + word: selector, + }); + } + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + // Using `.selectors` gets us each selector if there is a comma separated set + for (const selector of ruleNode.selectors) { + for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { + // Process each resolved selector with `checkSelector` via postcss-selector-parser + parseSelector(resolvedSelector, result, ruleNode, (s) => checkSelector(s, ruleNode)); + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-empty-lines/index.js b/node_modules/stylelint/lib/rules/selector-max-empty-lines/index.js new file mode 100644 index 000000000..efc4ec661 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-max-empty-lines/index.js @@ -0,0 +1,71 @@ +'use strict'; + +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isNumber } = require('../../utils/validateTypes'); + +const ruleName = 'selector-max-empty-lines'; + +const messages = ruleMessages(ruleName, { + expected: (max) => `Expected no more than ${max} empty ${max === 1 ? 'line' : 'lines'}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-max-empty-lines', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const maxAdjacentNewlines = primary + 1; + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: isNumber, + }); + + if (!validOptions) { + return; + } + + const violatedCRLFNewLinesRegex = new RegExp(`(?:\r\n){${maxAdjacentNewlines + 1},}`); + const violatedLFNewLinesRegex = new RegExp(`\n{${maxAdjacentNewlines + 1},}`); + const allowedLFNewLinesString = context.fix ? '\n'.repeat(maxAdjacentNewlines) : ''; + const allowedCRLFNewLinesString = context.fix ? '\r\n'.repeat(maxAdjacentNewlines) : ''; + + root.walkRules((ruleNode) => { + const selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; + + if (context.fix) { + const newSelectorString = selector + .replace(new RegExp(violatedLFNewLinesRegex, 'gm'), allowedLFNewLinesString) + .replace(new RegExp(violatedCRLFNewLinesRegex, 'gm'), allowedCRLFNewLinesString); + + if (ruleNode.raws.selector) { + ruleNode.raws.selector.raw = newSelectorString; + } else { + ruleNode.selector = newSelectorString; + } + } else if ( + violatedLFNewLinesRegex.test(selector) || + violatedCRLFNewLinesRegex.test(selector) + ) { + report({ + message: messages.expected(primary), + node: ruleNode, + index: 0, + result, + ruleName, + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-id/index.js b/node_modules/stylelint/lib/rules/selector-max-id/index.js new file mode 100644 index 000000000..3bec2417d --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-max-id/index.js @@ -0,0 +1,112 @@ +'use strict'; + +const isContextFunctionalPseudoClass = require('../../utils/isContextFunctionalPseudoClass'); +const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const optionsMatches = require('../../utils/optionsMatches'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const resolvedNestedSelector = require('postcss-resolve-nested-selector'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-max-id'; + +const messages = ruleMessages(ruleName, { + expected: (selector, max) => + `Expected "${selector}" to have no more than ${max} ID ${max === 1 ? 'selector' : 'selectors'}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-max-id', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: isNonNegativeInteger, + }, + { + actual: secondaryOptions, + possible: { + ignoreContextFunctionalPseudoClasses: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + /** + * @param {import('postcss-selector-parser').Container} selectorNode + * @param {import('postcss').Rule} ruleNode + */ + function checkSelector(selectorNode, ruleNode) { + const count = selectorNode.reduce((total, childNode) => { + // Only traverse inside actual selectors and context functional pseudo-classes that are not part of ignored functional pseudo-classes + if ( + childNode.type === 'selector' || + (isContextFunctionalPseudoClass(childNode) && + !isIgnoredContextFunctionalPseudoClass(childNode)) + ) { + checkSelector(childNode, ruleNode); + } + + if (childNode.type === 'id') total += 1; + + return total; + }, 0); + + if (selectorNode.type !== 'root' && selectorNode.type !== 'pseudo' && count > primary) { + const selector = selectorNode.toString(); + + report({ + ruleName, + result, + node: ruleNode, + message: messages.expected, + messageArgs: [selector, primary], + word: selector, + }); + } + } + + /** + * @param {import('postcss-selector-parser').Node} node + * @returns {boolean} + */ + function isIgnoredContextFunctionalPseudoClass(node) { + return ( + node.type === 'pseudo' && + optionsMatches(secondaryOptions, 'ignoreContextFunctionalPseudoClasses', node.value) + ); + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + for (const selector of ruleNode.selectors) { + for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { + parseSelector(resolvedSelector, result, ruleNode, (container) => + checkSelector(container, ruleNode), + ); + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-pseudo-class/index.js b/node_modules/stylelint/lib/rules/selector-max-pseudo-class/index.js new file mode 100644 index 000000000..7a9c56224 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-max-pseudo-class/index.js @@ -0,0 +1,96 @@ +'use strict'; + +const isContextFunctionalPseudoClass = require('../../utils/isContextFunctionalPseudoClass'); +const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const { levelOneAndTwoPseudoElements } = require('../../reference/selectors'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const resolvedNestedSelector = require('postcss-resolve-nested-selector'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'selector-max-pseudo-class'; + +const messages = ruleMessages(ruleName, { + expected: (selector, max) => + `Expected "${selector}" to have no more than ${max} pseudo-${max === 1 ? 'class' : 'classes'}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-max-pseudo-class', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: isNonNegativeInteger, + }); + + if (!validOptions) { + return; + } + + /** + * @param {import('postcss-selector-parser').Container} selectorNode + * @param {import('postcss').Rule} ruleNode + */ + function checkSelector(selectorNode, ruleNode) { + const count = selectorNode.reduce((total, childNode) => { + // Only traverse inside actual selectors and context functional pseudo-classes + if (childNode.type === 'selector' || isContextFunctionalPseudoClass(childNode)) { + checkSelector(childNode, ruleNode); + } + + // Exclude pseudo elements from the count + if ( + childNode.type === 'pseudo' && + (childNode.value.includes('::') || + levelOneAndTwoPseudoElements.has(childNode.value.toLowerCase().slice(1))) + ) { + return total; + } + + if (childNode.type === 'pseudo') { + total += 1; + } + + return total; + }, 0); + + if (count > primary) { + const selector = selectorNode.toString(); + + report({ + ruleName, + result, + node: ruleNode, + message: messages.expected, + messageArgs: [selector, primary], + word: selector, + }); + } + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + for (const selector of ruleNode.selectors) { + for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { + parseSelector(resolvedSelector, result, ruleNode, (selectorTree) => { + checkSelector(selectorTree, ruleNode); + }); + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-specificity/index.js b/node_modules/stylelint/lib/rules/selector-max-specificity/index.js new file mode 100644 index 000000000..cec213d67 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-max-specificity/index.js @@ -0,0 +1,231 @@ +'use strict'; + +const resolvedNestedSelector = require('postcss-resolve-nested-selector'); +const { selectorSpecificity, compare } = require('@csstools/selector-specificity'); + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const { + aNPlusBOfSNotationPseudoClasses, + aNPlusBNotationPseudoClasses, + linguisticPseudoClasses, +} = require('../../reference/selectors'); +const optionsMatches = require('../../utils/optionsMatches'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString, assertNumber } = require('../../utils/validateTypes'); + +const ruleName = 'selector-max-specificity'; + +const messages = ruleMessages(ruleName, { + expected: (selector, max) => `Expected "${selector}" to have a specificity no more than "${max}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-max-specificity', +}; + +/** @typedef {import('@csstools/selector-specificity').Specificity} Specificity */ + +/** + * Return a zero specificity. We need a new instance each time so that it can mutated. + * + * @returns {Specificity} + */ +const zeroSpecificity = () => ({ a: 0, b: 0, c: 0 }); + +/** + * Calculate the sum of given specificities. + * + * @param {Specificity[]} specificities + * @returns {Specificity} + */ +const specificitySum = (specificities) => { + const sum = zeroSpecificity(); + + for (const { a, b, c } of specificities) { + sum.a += a; + sum.b += b; + sum.c += c; + } + + return sum; +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [ + // Check that the max specificity is in the form "a,b,c" + (spec) => isString(spec) && /^\d+,\d+,\d+$/.test(spec), + ], + }, + { + actual: secondaryOptions, + possible: { + ignoreSelectors: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + /** + * Calculate the specificity of a simple selector (type, attribute, class, ID, or pseudos's own value). + * + * @param {import('postcss-selector-parser').Node} node + * @returns {Specificity} + */ + const simpleSpecificity = (node) => { + if (optionsMatches(secondaryOptions, 'ignoreSelectors', node.toString())) { + return zeroSpecificity(); + } + + return selectorSpecificity(node); + }; + + /** + * Calculate the specificity of the most specific direct child. + * + * @param {import('postcss-selector-parser').Container} node + * @returns {Specificity} + */ + const maxChildSpecificity = (node) => + node.reduce((maxSpec, child) => { + const childSpecificity = nodeSpecificity(child); // eslint-disable-line no-use-before-define + + return compare(childSpecificity, maxSpec) > 0 ? childSpecificity : maxSpec; + }, zeroSpecificity()); + + /** + * Calculate the specificity of a pseudo selector including own value and children. + * + * @param {import('postcss-selector-parser').Pseudo} node + * @returns {Specificity} + */ + const pseudoSpecificity = (node) => { + // `node.toString()` includes children which should be processed separately, + // so use `node.value` instead + const ownValue = node.value.toLowerCase(); + + if (ownValue === ':where') { + return zeroSpecificity(); + } + + let ownSpecificity; + + if (optionsMatches(secondaryOptions, 'ignoreSelectors', ownValue)) { + ownSpecificity = zeroSpecificity(); + } else if (aNPlusBOfSNotationPseudoClasses.has(ownValue.replace(/^:/, ''))) { + // TODO: We need to support `` in `ignoreSelectors`. E.g. `:nth-child(even of .foo)`. + return selectorSpecificity(node); + } else { + ownSpecificity = selectorSpecificity(node.clone({ nodes: [] })); + } + + return specificitySum([ownSpecificity, maxChildSpecificity(node)]); + }; + + /** + * @param {import('postcss-selector-parser').Node} node + * @returns {boolean} + */ + const shouldSkipPseudoClassArgument = (node) => { + // postcss-selector-parser includes the arguments to nth-child() functions + // as "tags", so we need to ignore them ourselves. + // The fake-tag's "parent" is actually a selector node, whose parent + // should be the :nth-child pseudo node. + const parentNode = node.parent && node.parent.parent; + + if (parentNode && parentNode.type === 'pseudo' && parentNode.value) { + const pseudoClass = parentNode.value.toLowerCase().replace(/^:/, ''); + + return ( + aNPlusBNotationPseudoClasses.has(pseudoClass) || linguisticPseudoClasses.has(pseudoClass) + ); + } + + return false; + }; + + /** + * Calculate the specificity of a node parsed by `postcss-selector-parser`. + * + * @param {import('postcss-selector-parser').Node} node + * @returns {Specificity} + */ + const nodeSpecificity = (node) => { + if (shouldSkipPseudoClassArgument(node)) { + return zeroSpecificity(); + } + + switch (node.type) { + case 'attribute': + case 'class': + case 'id': + case 'tag': + return simpleSpecificity(node); + case 'pseudo': + return pseudoSpecificity(node); + case 'selector': + // Calculate the sum of all the direct children + return specificitySum(node.map((n) => nodeSpecificity(n))); + default: + return zeroSpecificity(); + } + }; + + const [a, b, c] = primary.split(',').map((s) => Number.parseFloat(s)); + + assertNumber(a); + assertNumber(b); + assertNumber(c); + + const maxSpecificity = { a, b, c }; + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + // Using `.selectors` gets us each selector in the eventuality we have a comma separated set + for (const selector of ruleNode.selectors) { + for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { + // Skip non-standard syntax selectors + if (!isStandardSyntaxSelector(resolvedSelector)) { + continue; + } + + parseSelector(resolvedSelector, result, ruleNode, (selectorTree) => { + // Check if the selector specificity exceeds the allowed maximum + if (compare(maxChildSpecificity(selectorTree), maxSpecificity) > 0) { + report({ + ruleName, + result, + node: ruleNode, + message: messages.expected, + messageArgs: [resolvedSelector, primary], + word: selector, + }); + } + }); + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-type/index.js b/node_modules/stylelint/lib/rules/selector-max-type/index.js new file mode 100644 index 000000000..357ee389b --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-max-type/index.js @@ -0,0 +1,231 @@ +'use strict'; + +const isContextFunctionalPseudoClass = require('../../utils/isContextFunctionalPseudoClass'); +const isKeyframeSelector = require('../../utils/isKeyframeSelector'); +const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); +const isOnlyWhitespace = require('../../utils/isOnlyWhitespace'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const isStandardSyntaxTypeSelector = require('../../utils/isStandardSyntaxTypeSelector'); +const optionsMatches = require('../../utils/optionsMatches'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const resolvedNestedSelector = require('postcss-resolve-nested-selector'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); +const isCustomElement = require('../../utils/isCustomElement'); + +const ruleName = 'selector-max-type'; + +const messages = ruleMessages(ruleName, { + expected: (selector, max) => + `Expected "${selector}" to have no more than ${max} type ${ + max === 1 ? 'selector' : 'selectors' + }`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-max-type', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: isNonNegativeInteger, + }, + { + actual: secondaryOptions, + possible: { + ignore: ['descendant', 'child', 'compounded', 'next-sibling', 'custom-elements'], + ignoreTypes: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const ignoreDescendant = optionsMatches(secondaryOptions, 'ignore', 'descendant'); + const ignoreChild = optionsMatches(secondaryOptions, 'ignore', 'child'); + const ignoreCompounded = optionsMatches(secondaryOptions, 'ignore', 'compounded'); + const ignoreNextSibling = optionsMatches(secondaryOptions, 'ignore', 'next-sibling'); + const ignoreCustomElements = optionsMatches(secondaryOptions, 'ignore', 'custom-elements'); + + /** + * @param {import('postcss-selector-parser').Container} selectorNode + * @param {import('postcss').Rule} ruleNode + */ + function checkSelector(selectorNode, ruleNode) { + const count = selectorNode.reduce((total, childNode) => { + // Only traverse inside actual selectors and context functional pseudo-classes + if (childNode.type === 'selector' || isContextFunctionalPseudoClass(childNode)) { + checkSelector(childNode, ruleNode); + } + + if (optionsMatches(secondaryOptions, 'ignoreTypes', childNode.value)) { + return total; + } + + if (ignoreDescendant && hasDescendantCombinatorBefore(childNode)) { + return total; + } + + if (ignoreChild && hasChildCombinatorBefore(childNode)) { + return total; + } + + if (ignoreCompounded && hasCompoundSelector(childNode)) { + return total; + } + + if (ignoreNextSibling && hasNextSiblingCombinator(childNode)) { + return total; + } + + if (ignoreCustomElements && childNode.value && isCustomElement(childNode.value)) { + return total; + } + + if (childNode.type === 'tag' && !isStandardSyntaxTypeSelector(childNode)) { + return total; + } + + return childNode.type === 'tag' ? total + 1 : total; + }, 0); + + if (selectorNode.type !== 'root' && selectorNode.type !== 'pseudo' && count > primary) { + const selector = selectorNode.toString(); + + report({ + ruleName, + result, + node: ruleNode, + message: messages.expected, + messageArgs: [selector, primary], + word: selector, + }); + } + } + + root.walkRules((ruleNode) => { + const selectors = ruleNode.selectors; + + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + if (selectors.some((s) => isKeyframeSelector(s))) { + return; + } + + for (const selector of ruleNode.selectors) { + for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { + if (!isStandardSyntaxSelector(resolvedSelector)) { + continue; + } + + parseSelector(resolvedSelector, result, ruleNode, (container) => + checkSelector(container, ruleNode), + ); + } + } + }); + }; +}; + +/** @typedef {import('postcss-selector-parser').Node} SelectorNode */ + +/** + * @param {SelectorNode} node + * @returns {boolean} + */ +function hasDescendantCombinatorBefore(node) { + if (!node.parent) return false; + + const nodeIndex = node.parent.nodes.indexOf(node); + + return node.parent.nodes.slice(0, nodeIndex).some((n) => isDescendantCombinator(n)); +} + +/** + * @param {SelectorNode} node + * @returns {boolean} + */ +function hasChildCombinatorBefore(node) { + if (!node.parent) return false; + + const nodeIndex = node.parent.nodes.indexOf(node); + + return node.parent.nodes.slice(0, nodeIndex).some((n) => isChildCombinator(n)); +} + +/** + * @param {SelectorNode} node + * @returns {boolean} + */ +function hasCompoundSelector(node) { + if (node.prev() && !isCombinator(node.prev())) { + return true; + } + + return node.next() && !isCombinator(node.next()); +} + +/** + * @param {SelectorNode} node + * @returns {boolean} + */ +function hasNextSiblingCombinator(node) { + return node.prev() && isNextSiblingCombinator(node.prev()); +} + +/** + * @param {SelectorNode} node + * @returns {boolean} + */ +function isCombinator(node) { + if (!node) return false; + + return node.type === 'combinator'; +} + +/** + * @param {SelectorNode} node + * @returns {boolean} + */ +function isDescendantCombinator(node) { + if (!node) return false; + + return isCombinator(node) && isString(node.value) && isOnlyWhitespace(node.value); +} + +/** + * @param {SelectorNode} node + * @returns {boolean} + */ +function isChildCombinator(node) { + if (!node) return false; + + return isCombinator(node) && node.value === '>'; +} + +/** + * @param {SelectorNode} node + * @returns {boolean} + */ +function isNextSiblingCombinator(node) { + return isCombinator(node) && node.value === '+'; +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-universal/index.js b/node_modules/stylelint/lib/rules/selector-max-universal/index.js new file mode 100644 index 000000000..a0d24942a --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-max-universal/index.js @@ -0,0 +1,118 @@ +'use strict'; + +const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const resolvedNestedSelector = require('postcss-resolve-nested-selector'); +const ruleMessages = require('../../utils/ruleMessages'); +const selectorParser = require('postcss-selector-parser'); +const validateOptions = require('../../utils/validateOptions'); +const optionsMatches = require('../../utils/optionsMatches'); +const { isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-max-universal'; + +const messages = ruleMessages(ruleName, { + expected: (selector, max) => + `Expected "${selector}" to have no more than ${max} universal ${ + max === 1 ? 'selector' : 'selectors' + }`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-max-universal', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: isNonNegativeInteger, + }, + { + actual: secondaryOptions, + possible: { + ignoreAfterCombinators: [isString], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + /** + * @param {import('postcss-selector-parser').Container} selectorNode + * @param {import('postcss').Rule} ruleNode + */ + function checkSelector(selectorNode, ruleNode) { + const count = selectorNode.reduce((total, childNode) => { + // Only traverse inside actual selectors + // All logical combinations will be resolved as nested selector in `postcss-resolve-nested-selector` + if (childNode.type === 'selector') { + checkSelector(childNode, ruleNode); + } + + const prevChildNode = childNode.prev(); + const prevChildNodeValue = prevChildNode && prevChildNode.value; + + if (childNode.type === 'universal') { + if (!optionsMatches(secondaryOptions, 'ignoreAfterCombinators', prevChildNodeValue)) { + total += 1; + } + } + + return total; + }, 0); + + if (selectorNode.type !== 'root' && selectorNode.type !== 'pseudo' && count > primary) { + const selector = selectorNode.toString(); + + report({ + ruleName, + result, + node: ruleNode, + message: messages.expected, + messageArgs: [selector, primary], + word: selector, + }); + } + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + /** @type {string[]} */ + const selectors = []; + + selectorParser() + .astSync(ruleNode.selector) + .walk((node) => { + if (node.type === 'selector') { + selectors.push(String(node).trim()); + } + }); + + for (const selector of selectors) { + for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { + parseSelector(resolvedSelector, result, ruleNode, (container) => + checkSelector(container, ruleNode), + ); + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-nested-pattern/index.js b/node_modules/stylelint/lib/rules/selector-nested-pattern/index.js new file mode 100644 index 000000000..6d10d4fbe --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-nested-pattern/index.js @@ -0,0 +1,77 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isBoolean, isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-nested-pattern'; + +const messages = ruleMessages(ruleName, { + expected: (selector, pattern) => `Expected "${selector}" to match pattern "${pattern}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-nested-pattern', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [isRegExp, isString], + }, + { + actual: secondaryOptions, + possible: { + splitList: [isBoolean], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const normalizedPattern = isString(primary) ? new RegExp(primary) : primary; + const splitList = secondaryOptions && secondaryOptions.splitList; + + root.walkRules((ruleNode) => { + if (ruleNode.parent && ruleNode.parent.type !== 'rule') { + return; + } + + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selectors = splitList ? ruleNode.selectors : [ruleNode.selector]; + + for (const selector of selectors) { + if (normalizedPattern.test(selector)) { + continue; + } + + report({ + result, + ruleName, + message: messages.expected, + messageArgs: [selector, primary], + node: ruleNode, + word: selector, + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-no-qualifying-type/index.js b/node_modules/stylelint/lib/rules/selector-no-qualifying-type/index.js new file mode 100644 index 000000000..b4f8ec46e --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-no-qualifying-type/index.js @@ -0,0 +1,157 @@ +'use strict'; + +const resolvedNestedSelector = require('postcss-resolve-nested-selector'); + +const isKeyframeRule = require('../../utils/isKeyframeRule'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const isStandardSyntaxTypeSelector = require('../../utils/isStandardSyntaxTypeSelector'); +const optionsMatches = require('../../utils/optionsMatches'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'selector-no-qualifying-type'; + +const messages = ruleMessages(ruleName, { + rejected: (selector) => `Unexpected qualifying type selector "${selector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-no-qualifying-type', +}; + +const selectorCharacters = ['#', '.', '[']; + +/** + * @param {string} value + * @returns {boolean} + */ +function isSelectorCharacters(value) { + return selectorCharacters.some((char) => value.includes(char)); +} + +/** + * @param {import('postcss-selector-parser').Tag} node + * @returns {Array} + */ +function getRightNodes(node) { + const result = []; + + /** @type {import('postcss-selector-parser').Node} */ + let rightNode = node; + + while ((rightNode = rightNode.next())) { + if (rightNode.type === 'combinator') { + break; + } + + if (rightNode.type !== 'id' && rightNode.type !== 'class' && rightNode.type !== 'attribute') { + continue; + } + + result.push(rightNode); + } + + return result; +} + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [true], + }, + { + actual: secondaryOptions, + possible: { + ignore: ['attribute', 'class', 'id'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const ignoreId = optionsMatches(secondaryOptions, 'ignore', 'id'); + const ignoreClass = optionsMatches(secondaryOptions, 'ignore', 'class'); + const ignoreAttribute = optionsMatches(secondaryOptions, 'ignore', 'attribute'); + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + if (isKeyframeRule(ruleNode)) { + return; + } + + if (!isSelectorCharacters(ruleNode.selector)) { + return; + } + + /** + * @param {import('postcss-selector-parser').Root} selectorAST + */ + function checkSelector(selectorAST) { + selectorAST.walkTags((tagNode) => { + if (!isStandardSyntaxTypeSelector(tagNode)) return; + + const selectorParent = tagNode.parent; + + if (selectorParent && selectorParent.nodes.length === 1) { + return; + } + + const selectorNodes = getRightNodes(tagNode); + + for (const selectorNode of selectorNodes) { + if ( + (selectorNode.type === 'id' && !ignoreId) || + (selectorNode.type === 'class' && !ignoreClass) || + (selectorNode.type === 'attribute' && !ignoreAttribute) + ) { + const selector = [tagNode, ...selectorNodes].join('').trimStart(); + + complain(selector); + } + } + }); + } + + for (const resolvedSelector of resolvedNestedSelector(ruleNode.selector, ruleNode)) { + if (!isStandardSyntaxSelector(resolvedSelector)) { + continue; + } + + parseSelector(resolvedSelector, result, ruleNode, checkSelector); + } + + /** + * @param {string} selector + */ + function complain(selector) { + report({ + ruleName, + result, + node: ruleNode, + message: messages.rejected, + messageArgs: [selector], + word: selector, + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-no-vendor-prefix/index.js b/node_modules/stylelint/lib/rules/selector-no-vendor-prefix/index.js new file mode 100644 index 000000000..afe591a8f --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-no-vendor-prefix/index.js @@ -0,0 +1,88 @@ +'use strict'; + +const hasPrefix = require('../../utils/hasPrefix'); +const isAutoprefixable = require('../../utils/isAutoprefixable'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const optionsMatches = require('../../utils/optionsMatches'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isString, isRegExp } = require('../../utils/validateTypes'); + +const ruleName = 'selector-no-vendor-prefix'; + +const messages = ruleMessages(ruleName, { + rejected: (selector) => `Unexpected vendor-prefix "${selector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-no-vendor-prefix', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignoreSelectors: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!hasPrefix(ruleNode.selector)) return; + + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selector = ruleNode.selector; + + parseSelector(selector, result, ruleNode, (selectorTree) => { + selectorTree.walkPseudos((pseudoNode) => { + const { value } = pseudoNode; + + if (!isAutoprefixable.selector(value)) { + return; + } + + if (optionsMatches(secondaryOptions, 'ignoreSelectors', value)) { + return; + } + + if (context.fix) { + ruleNode.selector = isAutoprefixable.unprefix(selector); + + return; + } + + report({ + result, + ruleName, + message: messages.rejected, + messageArgs: [value], + node: ruleNode, + word: value, + }); + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-not-notation/index.js b/node_modules/stylelint/lib/rules/selector-not-notation/index.js new file mode 100644 index 000000000..655f365cd --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-not-notation/index.js @@ -0,0 +1,213 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { + isPseudoClass, + isAttribute, + isClassName, + isUniversal, + isIdentifier, + isTag, +} = require('postcss-selector-parser'); +const { assert } = require('../../utils/validateTypes'); + +const ruleName = 'selector-not-notation'; +const messages = ruleMessages(ruleName, { + expected: (type) => `Expected ${type} :not() pseudo-class notation`, +}); +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-not-notation', + fixable: true, +}; + +/** @typedef {import('postcss-selector-parser').Node} Node */ +/** @typedef {import('postcss-selector-parser').Selector} Selector */ +/** @typedef {import('postcss-selector-parser').Pseudo} Pseudo */ + +/** + * @param {Node} node + * @returns {boolean} + */ +const isSimpleSelector = (node) => + isPseudoClass(node) || + isAttribute(node) || + isClassName(node) || + isUniversal(node) || + isIdentifier(node) || + isTag(node); + +/** + * @param {Node} node + * @returns {node is Pseudo} + */ +const isNot = (node) => + isPseudoClass(node) && node.value !== undefined && node.value.toLowerCase() === ':not'; + +/** + * @param {Selector[]} list + * @returns {boolean} + */ +const isSimple = (list) => { + if (list.length > 1) return false; + + assert(list[0], 'list is never empty'); + const [first, second] = list[0].nodes; + + if (!first) return true; + + if (second) return false; + + return isSimpleSelector(first) && !isNot(first); +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['simple', 'complex'], + }); + + if (!validOptions) return; + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) return; + + const selector = ruleNode.selector; + + if (!selector.includes(':not(')) return; + + if (!isStandardSyntaxSelector(selector)) return; + + const fixedSelector = parseSelector(selector, result, ruleNode, (container) => { + container.walkPseudos((pseudo) => { + if (!isNot(pseudo)) return; + + if (primary === 'complex') { + const prev = pseudo.prev(); + const hasConsecutiveNot = prev && isNot(prev); + + if (!hasConsecutiveNot) return; + + if (context.fix) return fixComplex(prev); + } else { + const selectors = pseudo.nodes; + + if (isSimple(selectors)) return; + + const mustFix = + context.fix && + selectors.length > 1 && + selectors[1] && + (selectors[1].nodes.length === 0 || + selectors.every(({ nodes }) => nodes.length === 1)); + + if (mustFix) return fixSimple(pseudo); + } + + assert(pseudo.source && pseudo.source.end); + + report({ + message: messages.expected, + messageArgs: [primary], + node: ruleNode, + index: pseudo.sourceIndex, + endIndex: pseudo.source.end.column, + result, + ruleName, + }); + }); + }); + + if (context.fix && fixedSelector) { + ruleNode.selector = fixedSelector; + } + }); + }; +}; + +/** + * @param {Pseudo} not + * @returns {Node} + */ +const getLastConsecutiveNot = ({ parent, sourceIndex }) => { + assert(parent); + + const nodes = parent.nodes; + const index = nodes.findIndex((node) => node.sourceIndex >= sourceIndex && !isNot(node)); + const node = index === -1 ? nodes[nodes.length - 1] : nodes[index - 1]; + + assert(node); + + return node; +}; + +/** + * @param {Pseudo} not + */ +function fixSimple(not) { + const simpleSelectors = not.nodes + .filter(({ nodes }) => nodes[0] && isSimpleSelector(nodes[0])) + .map((s) => { + assert(s.nodes[0]); + s.nodes[0].rawSpaceBefore = ''; + s.nodes[0].rawSpaceAfter = ''; + + return s; + }); + const firstSelector = simpleSelectors.shift(); + + assert(firstSelector); + assert(not.parent); + + not.empty(); + not.nodes.push(firstSelector); + + for (const s of simpleSelectors) { + const last = getLastConsecutiveNot(not); + + not.parent.insertAfter(last, last.clone({ nodes: [s] })); + } +} + +/** + * @param {Pseudo} previousNot + */ +function fixComplex(previousNot) { + const indentAndTrimRight = (/** @type {Selector[]} */ selectors) => { + for (const s of selectors) { + assert(s.nodes[0]); + s.nodes[0].rawSpaceBefore = ' '; + s.nodes[0].rawSpaceAfter = ''; + } + }; + const [head, ...tail] = previousNot.nodes; + let node = previousNot.next(); + + if (head == null || head.nodes.length === 0) return; + + assert(head.nodes[0]); + head.nodes[0].rawSpaceBefore = ''; + head.nodes[0].rawSpaceAfter = ''; + indentAndTrimRight(tail); + + while (isNot(node)) { + const selectors = node.nodes; + const prev = node; + + indentAndTrimRight(selectors); + previousNot.nodes = previousNot.nodes.concat(selectors); + node = node.next(); + prev.remove(); + } +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-class-allowed-list/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-class-allowed-list/index.js new file mode 100644 index 000000000..92cb6b9b6 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-pseudo-class-allowed-list/index.js @@ -0,0 +1,79 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-pseudo-class-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (selector) => `Unexpected pseudo-class "${selector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-pseudo-class-allowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selector = ruleNode.selector; + + if (!selector.includes(':')) { + return; + } + + parseSelector(selector, result, ruleNode, (selectorTree) => { + selectorTree.walkPseudos((pseudoNode) => { + const value = pseudoNode.value; + + // Ignore pseudo-elements + if (value.slice(0, 2) === '::') { + return; + } + + const name = value.slice(1); + + if (matchesStringOrRegExp(vendor.unprefixed(name), primary)) { + return; + } + + report({ + word: value, + message: messages.rejected, + messageArgs: [value], + node: ruleNode, + result, + ruleName, + }); + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-class-case/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-class-case/index.js new file mode 100644 index 000000000..1aefb07f8 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-pseudo-class-case/index.js @@ -0,0 +1,103 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const { levelOneAndTwoPseudoElements } = require('../../reference/selectors'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'selector-pseudo-class-case'; + +const messages = ruleMessages(ruleName, { + expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-pseudo-class-case', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['lower', 'upper'], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selector = ruleNode.selector; + + if (!selector.includes(':')) { + return; + } + + const fixedSelector = parseSelector( + ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector, + result, + ruleNode, + (selectorTree) => { + selectorTree.walkPseudos((pseudoNode) => { + const pseudo = pseudoNode.value; + + if (!isStandardSyntaxSelector(pseudo)) { + return; + } + + if ( + pseudo.includes('::') || + levelOneAndTwoPseudoElements.has(pseudo.toLowerCase().slice(1)) + ) { + return; + } + + const expectedPseudo = + primary === 'lower' ? pseudo.toLowerCase() : pseudo.toUpperCase(); + + if (pseudo === expectedPseudo) { + return; + } + + if (context.fix) { + pseudoNode.value = expectedPseudo; + + return; + } + + report({ + message: messages.expected(pseudo, expectedPseudo), + node: ruleNode, + index: pseudoNode.sourceIndex, + ruleName, + result, + }); + }); + }, + ); + + if (context.fix && fixedSelector) { + if (ruleNode.raws.selector) { + ruleNode.raws.selector.raw = fixedSelector; + } else { + ruleNode.selector = fixedSelector; + } + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-class-disallowed-list/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-class-disallowed-list/index.js new file mode 100644 index 000000000..21b5a12a6 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-pseudo-class-disallowed-list/index.js @@ -0,0 +1,79 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-pseudo-class-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (selector) => `Unexpected pseudo-class "${selector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-pseudo-class-disallowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selector = ruleNode.selector; + + if (!selector.includes(':')) { + return; + } + + parseSelector(selector, result, ruleNode, (selectorTree) => { + selectorTree.walkPseudos((pseudoNode) => { + const value = pseudoNode.value; + + // Ignore pseudo-elements + if (value.slice(0, 2) === '::') { + return; + } + + const name = value.slice(1); + + if (!matchesStringOrRegExp(vendor.unprefixed(name), primary)) { + return; + } + + report({ + word: value, + message: messages.rejected, + messageArgs: [value], + node: ruleNode, + result, + ruleName, + }); + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-class-no-unknown/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-class-no-unknown/index.js new file mode 100644 index 000000000..3c2b372fb --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-pseudo-class-no-unknown/index.js @@ -0,0 +1,179 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const isCustomSelector = require('../../utils/isCustomSelector'); +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const { + atRulePagePseudoClasses, + levelOneAndTwoPseudoElements, + pseudoClasses, + pseudoElements, + webkitScrollbarPseudoClasses, + webkitScrollbarPseudoElements, +} = require('../../reference/selectors'); +const optionsMatches = require('../../utils/optionsMatches'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isString, isRegExp } = require('../../utils/validateTypes'); +const { isAtRule } = require('../../utils/typeGuards'); + +const ruleName = 'selector-pseudo-class-no-unknown'; + +const messages = ruleMessages(ruleName, { + rejected: (selector) => `Unexpected unknown pseudo-class selector "${selector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-pseudo-class-no-unknown', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignorePseudoClasses: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + /** + * @param {string} selector + * @param {import('postcss').ChildNode} node + */ + function check(selector, node) { + parseSelector(selector, result, node, (selectorTree) => { + selectorTree.walkPseudos((pseudoNode) => { + const value = pseudoNode.value; + + if (!isStandardSyntaxSelector(value)) { + return; + } + + if (isCustomSelector(value)) { + return; + } + + if (value.startsWith('::')) { + return; + } + + const name = value.replace(/^:*/, '').toLowerCase(); + + if (levelOneAndTwoPseudoElements.has(name)) { + return; + } + + if (optionsMatches(secondaryOptions, 'ignorePseudoClasses', pseudoNode.value.slice(1))) { + return; + } + + const hasVendorPrefix = vendor.prefix(name); + let index = null; + + if (isAtRule(node) && node.name === 'page') { + if (atRulePagePseudoClasses.has(name)) { + return; + } + + index = atRuleParamIndex(node) + pseudoNode.sourceIndex; + } else if (pseudoElements.has(name) && !hasVendorPrefix) { + index = pseudoNode.sourceIndex; + } else { + if (hasVendorPrefix || pseudoClasses.has(name)) { + return; + } + + /** @type {import('postcss-selector-parser').Base} */ + let prevPseudoElement = pseudoNode; + + do { + prevPseudoElement = /** @type {import('postcss-selector-parser').Base} */ ( + prevPseudoElement.prev() + ); + + if (prevPseudoElement && prevPseudoElement.value.slice(0, 2) === '::') { + break; + } + } while (prevPseudoElement); + + if (prevPseudoElement) { + const prevPseudoElementValue = prevPseudoElement.value.toLowerCase().slice(2); + + if ( + webkitScrollbarPseudoElements.has(prevPseudoElementValue) && + webkitScrollbarPseudoClasses.has(name) + ) { + return; + } + } + + index = pseudoNode.sourceIndex; + } + + report({ + message: messages.rejected, + messageArgs: [value], + node, + index, + ruleName, + result, + word: value, + }); + }); + }); + } + + root.walk((node) => { + let selector = null; + + if (node.type === 'rule') { + if (!isStandardSyntaxRule(node)) { + return; + } + + selector = node.selector; + } else if (isAtRule(node) && node.name === 'page' && node.params) { + if (!isStandardSyntaxAtRule(node)) { + return; + } + + selector = node.params; + } + + // Return if selector empty, it is meaning node type is not a rule or a at-rule + + if (!selector) { + return; + } + + // Return early before parse if no pseudos for performance + + if (!selector.includes(':')) { + return; + } + + check(selector, node); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-class-parentheses-space-inside/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-class-parentheses-space-inside/index.js new file mode 100644 index 000000000..26ab0c7fb --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-pseudo-class-parentheses-space-inside/index.js @@ -0,0 +1,156 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'selector-pseudo-class-parentheses-space-inside'; + +const messages = ruleMessages(ruleName, { + expectedOpening: 'Expected single space after "("', + rejectedOpening: 'Unexpected whitespace after "("', + expectedClosing: 'Expected single space before ")"', + rejectedClosing: 'Unexpected whitespace before ")"', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-pseudo-class-parentheses-space-inside', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + if (!ruleNode.selector.includes('(')) { + return; + } + + let hasFixed = false; + const selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; + const fixedSelector = parseSelector(selector, result, ruleNode, (selectorTree) => { + selectorTree.walkPseudos((pseudoNode) => { + if (!pseudoNode.length) { + return; + } + + const paramString = pseudoNode.map((node) => String(node)).join(','); + const nextCharIsSpace = paramString.startsWith(' '); + const openIndex = pseudoNode.sourceIndex + pseudoNode.value.length + 1; + + if (nextCharIsSpace && primary === 'never') { + if (context.fix) { + hasFixed = true; + setFirstNodeSpaceBefore(pseudoNode, ''); + } else { + complain(messages.rejectedOpening, openIndex); + } + } + + if (!nextCharIsSpace && primary === 'always') { + if (context.fix) { + hasFixed = true; + setFirstNodeSpaceBefore(pseudoNode, ' '); + } else { + complain(messages.expectedOpening, openIndex); + } + } + + const prevCharIsSpace = paramString.endsWith(' '); + const closeIndex = openIndex + paramString.length - 1; + + if (prevCharIsSpace && primary === 'never') { + if (context.fix) { + hasFixed = true; + setLastNodeSpaceAfter(pseudoNode, ''); + } else { + complain(messages.rejectedClosing, closeIndex); + } + } + + if (!prevCharIsSpace && primary === 'always') { + if (context.fix) { + hasFixed = true; + setLastNodeSpaceAfter(pseudoNode, ' '); + } else { + complain(messages.expectedClosing, closeIndex); + } + } + }); + }); + + if (hasFixed && fixedSelector) { + if (!ruleNode.raws.selector) { + ruleNode.selector = fixedSelector; + } else { + ruleNode.raws.selector.raw = fixedSelector; + } + } + + /** + * @param {string} message + * @param {number} index + */ + function complain(message, index) { + report({ + message, + index, + result, + ruleName, + node: ruleNode, + }); + } + }); + }; +}; + +/** + * @param {import('postcss-selector-parser').Container} node + * @param {string} value + * @returns {void} + */ +function setFirstNodeSpaceBefore(node, value) { + const target = node.first; + + if (target.type === 'selector') { + setFirstNodeSpaceBefore(target, value); + } else { + target.spaces.before = value; + } +} + +/** + * @param {import('postcss-selector-parser').Container} node + * @param {string} value + * @returns {void} + */ +function setLastNodeSpaceAfter(node, value) { + const target = node.last; + + if (target.type === 'selector') { + setLastNodeSpaceAfter(target, value); + } else { + target.spaces.after = value; + } +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-element-allowed-list/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-element-allowed-list/index.js new file mode 100644 index 000000000..db4c02c4f --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-pseudo-element-allowed-list/index.js @@ -0,0 +1,80 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-pseudo-element-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (selector) => `Unexpected pseudo-element "${selector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-pseudo-element-allowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selector = ruleNode.selector; + + if (!selector.includes('::')) { + return; + } + + parseSelector(selector, result, ruleNode, (selectorTree) => { + selectorTree.walkPseudos((pseudoNode) => { + const value = pseudoNode.value; + + // Ignore pseudo-classes + if (value.charAt(1) !== ':') { + return; + } + + const name = value.slice(2); + + if (matchesStringOrRegExp(vendor.unprefixed(name), primary)) { + return; + } + + report({ + index: pseudoNode.sourceIndex, + message: messages.rejected, + messageArgs: [value], + node: ruleNode, + word: value, + result, + ruleName, + }); + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-element-case/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-element-case/index.js new file mode 100644 index 000000000..37cee6b0b --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-pseudo-element-case/index.js @@ -0,0 +1,90 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const { levelOneAndTwoPseudoElements } = require('../../reference/selectors'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const transformSelector = require('../../utils/transformSelector'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'selector-pseudo-element-case'; + +const messages = ruleMessages(ruleName, { + expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-pseudo-element-case', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['lower', 'upper'], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selector = ruleNode.selector; + + if (!selector.includes(':')) { + return; + } + + transformSelector(result, ruleNode, (selectorTree) => { + selectorTree.walkPseudos((pseudoNode) => { + const pseudoElement = pseudoNode.value; + + if (!isStandardSyntaxSelector(pseudoElement)) { + return; + } + + if ( + !pseudoElement.includes('::') && + !levelOneAndTwoPseudoElements.has(pseudoElement.toLowerCase().slice(1)) + ) { + return; + } + + const expectedPseudoElement = + primary === 'lower' ? pseudoElement.toLowerCase() : pseudoElement.toUpperCase(); + + if (pseudoElement === expectedPseudoElement) { + return; + } + + if (context.fix) { + pseudoNode.value = expectedPseudoElement; + + return; + } + + report({ + message: messages.expected(pseudoElement, expectedPseudoElement), + node: ruleNode, + index: pseudoNode.sourceIndex, + ruleName, + result, + }); + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-element-colon-notation/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-element-colon-notation/index.js new file mode 100644 index 000000000..c62c543dc --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-pseudo-element-colon-notation/index.js @@ -0,0 +1,98 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const { levelOneAndTwoPseudoElements } = require('../../reference/selectors'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'selector-pseudo-element-colon-notation'; + +const messages = ruleMessages(ruleName, { + expected: (q) => `Expected ${q} colon pseudo-element notation`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-pseudo-element-colon-notation', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['single', 'double'], + }); + + if (!validOptions) { + return; + } + + let fixedColon = ''; + + if (primary === 'single') { + fixedColon = ':'; + } else if (primary === 'double') { + fixedColon = '::'; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selector = ruleNode.selector; + + // get out early if no pseudo elements or classes + if (!selector.includes(':')) { + return; + } + + const fixedSelector = parseSelector(selector, result, ruleNode, (selectors) => { + selectors.walkPseudos((pseudo) => { + const pseudoElement = pseudo.value.replace(/:/g, ''); + + if (!levelOneAndTwoPseudoElements.has(pseudoElement.toLowerCase())) { + return; + } + + const isDouble = pseudo.value.startsWith('::'); + + if (primary === 'single' && !isDouble) { + return; + } + + if (primary === 'double' && isDouble) { + return; + } + + if (context.fix) { + pseudo.replaceWith(pseudo.clone({ value: fixedColon + pseudoElement })); + + return; + } + + report({ + message: messages.expected(primary), + node: ruleNode, + index: pseudo.sourceIndex, + endIndex: pseudo.sourceIndex + (isDouble ? 2 : 1), + result, + ruleName, + }); + }); + }); + + if (context.fix && fixedSelector) { + ruleNode.selector = fixedSelector; + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-element-disallowed-list/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-element-disallowed-list/index.js new file mode 100644 index 000000000..59d796852 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-pseudo-element-disallowed-list/index.js @@ -0,0 +1,80 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-pseudo-element-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (selector) => `Unexpected pseudo-element "${selector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-pseudo-element-disallowed-list', +}; + +/** @type {import('stylelint').Rule>} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: [isString, isRegExp], + }); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + const selector = ruleNode.selector; + + if (!selector.includes('::')) { + return; + } + + parseSelector(selector, result, ruleNode, (selectorTree) => { + selectorTree.walkPseudos((pseudoNode) => { + const value = pseudoNode.value; + + // Ignore pseudo-classes + if (value.charAt(1) !== ':') { + return; + } + + const name = value.slice(2); + + if (!matchesStringOrRegExp(vendor.unprefixed(name), primary)) { + return; + } + + report({ + index: pseudoNode.sourceIndex, + message: messages.rejected, + messageArgs: [value], + node: ruleNode, + word: value, + result, + ruleName, + }); + }); + }); + }); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-element-no-unknown/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-element-no-unknown/index.js new file mode 100644 index 000000000..30a67571a --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-pseudo-element-no-unknown/index.js @@ -0,0 +1,98 @@ +'use strict'; + +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const { pseudoElements } = require('../../reference/selectors'); +const optionsMatches = require('../../utils/optionsMatches'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isString, isRegExp } = require('../../utils/validateTypes'); + +const ruleName = 'selector-pseudo-element-no-unknown'; + +const messages = ruleMessages(ruleName, { + rejected: (selector) => `Unexpected unknown pseudo-element selector "${selector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-pseudo-element-no-unknown', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignorePseudoElements: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + const selector = ruleNode.selector; + + // Return early before parse if no pseudos for performance + + if (!selector.includes(':')) { + return; + } + + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + parseSelector(selector, result, ruleNode, (selectorTree) => { + selectorTree.walkPseudos((pseudoNode) => { + const value = pseudoNode.value; + + if (!isStandardSyntaxSelector(value)) { + return; + } + + // Ignore pseudo-classes + if (value.slice(0, 2) !== '::') { + return; + } + + if (optionsMatches(secondaryOptions, 'ignorePseudoElements', pseudoNode.value.slice(2))) { + return; + } + + const name = value.slice(2); + + if (vendor.prefix(name) || pseudoElements.has(name.toLowerCase())) { + return; + } + + report({ + message: messages.rejected, + messageArgs: [value], + node: ruleNode, + index: pseudoNode.sourceIndex, + ruleName, + result, + word: value, + }); + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-type-case/index.js b/node_modules/stylelint/lib/rules/selector-type-case/index.js new file mode 100644 index 000000000..58aa4c7e7 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-type-case/index.js @@ -0,0 +1,132 @@ +'use strict'; + +const isKeyframeSelector = require('../../utils/isKeyframeSelector'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isStandardSyntaxTypeSelector = require('../../utils/isStandardSyntaxTypeSelector'); +const optionsMatches = require('../../utils/optionsMatches'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const { isString, isRegExp } = require('../../utils/validateTypes'); +const { mixedCaseSvgTypeSelectors } = require('../../reference/selectors'); + +const ruleName = 'selector-type-case'; + +const messages = ruleMessages(ruleName, { + expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-type-case', + fixable: true, +}; + +const STARTS_A_TAG_NAME_REGEX = /(?:[^.#[:a-zA-Z-]|^)[a-zA-Z]/; +const ANY_UPPER_CASE_REGEX = /[A-Z]/; +const ANY_LOWER_CASE_REGEX = /[a-z]/; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['lower', 'upper'], + }, + { + actual: secondaryOptions, + possible: { + ignoreTypes: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + let hasComments = ruleNode.raws.selector && ruleNode.raws.selector.raw; + const selector = hasComments ? hasComments : ruleNode.selector; + + if (!STARTS_A_TAG_NAME_REGEX.test(selector)) return; + + if (primary === 'lower' && !ANY_UPPER_CASE_REGEX.test(selector)) return; + + if (primary === 'upper' && !ANY_LOWER_CASE_REGEX.test(selector)) return; + + if (!isStandardSyntaxRule(ruleNode)) return; + + const { selectors } = ruleNode; + + if (selectors.some((s) => isKeyframeSelector(s))) { + return; + } + + parseSelector(selector, result, ruleNode, (selectorAST) => { + selectorAST.walkTags((tag) => { + if (!isStandardSyntaxTypeSelector(tag)) { + return; + } + + if (mixedCaseSvgTypeSelectors.has(tag.value)) { + return; + } + + if (optionsMatches(secondaryOptions, 'ignoreTypes', tag.value)) { + return; + } + + const sourceIndex = tag.sourceIndex; + const value = tag.value; + + const expectedValue = primary === 'lower' ? value.toLowerCase() : value.toUpperCase(); + + if (value === expectedValue) { + return; + } + + if (context.fix) { + if (hasComments) { + hasComments = + hasComments.slice(0, sourceIndex) + + expectedValue + + hasComments.slice(sourceIndex + value.length); + + if (ruleNode.raws.selector == null) { + throw new Error('The `raw` property must be present'); + } + + ruleNode.raws.selector.raw = hasComments; + } else { + ruleNode.selector = + ruleNode.selector.slice(0, sourceIndex) + + expectedValue + + ruleNode.selector.slice(sourceIndex + value.length); + } + + return; + } + + report({ + message: messages.expected, + messageArgs: [value, expectedValue], + node: ruleNode, + index: sourceIndex, + ruleName, + result, + }); + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-type-no-unknown/index.js b/node_modules/stylelint/lib/rules/selector-type-no-unknown/index.js new file mode 100644 index 000000000..aa157cdde --- /dev/null +++ b/node_modules/stylelint/lib/rules/selector-type-no-unknown/index.js @@ -0,0 +1,122 @@ +'use strict'; + +const isCustomElement = require('../../utils/isCustomElement'); +const isKeyframeSelector = require('../../utils/isKeyframeSelector'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const isStandardSyntaxTypeSelector = require('../../utils/isStandardSyntaxTypeSelector'); +const { htmlTypeSelectors } = require('../../reference/selectors'); +const mathMLTags = require('mathml-tag-names'); +const optionsMatches = require('../../utils/optionsMatches'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const svgTags = require('svg-tags'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'selector-type-no-unknown'; + +const messages = ruleMessages(ruleName, { + rejected: (selector) => `Unexpected unknown type selector "${selector}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/selector-type-no-unknown', +}; + +const STARTS_A_TAG_NAME_REGEX = /(?:[^.#[:a-zA-Z-]|^)[a-zA-Z]/; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignore: ['custom-elements', 'default-namespace'], + ignoreNamespaces: [isString, isRegExp], + ignoreTypes: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkRules((ruleNode) => { + const { selector } = ruleNode; + + if (!STARTS_A_TAG_NAME_REGEX.test(selector)) return; + + if (!isStandardSyntaxRule(ruleNode)) return; + + const { selectors } = ruleNode; + + if (selectors.some((s) => isKeyframeSelector(s))) { + return; + } + + parseSelector(selector, result, ruleNode, (selectorTree) => { + selectorTree.walkTags((tagNode) => { + if (!isStandardSyntaxTypeSelector(tagNode)) { + return; + } + + if ( + optionsMatches(secondaryOptions, 'ignore', 'custom-elements') && + isCustomElement(tagNode.value) + ) { + return; + } + + if ( + optionsMatches(secondaryOptions, 'ignore', 'default-namespace') && + !(typeof tagNode.namespace === 'string') + ) { + return; + } + + if (optionsMatches(secondaryOptions, 'ignoreNamespaces', tagNode.namespace)) { + return; + } + + if (optionsMatches(secondaryOptions, 'ignoreTypes', tagNode.value)) { + return; + } + + const tagName = tagNode.value; + const tagNameLowerCase = tagName.toLowerCase(); + + if ( + htmlTypeSelectors.has(tagNameLowerCase) || + // SVG tags are case-sensitive + svgTags.includes(tagName) || + mathMLTags.includes(tagNameLowerCase) + ) { + return; + } + + report({ + message: messages.rejected, + messageArgs: [tagName], + node: ruleNode, + index: tagNode.sourceIndex, + ruleName, + result, + word: tagName, + }); + }); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selectorAttributeOperatorSpaceChecker.js b/node_modules/stylelint/lib/rules/selectorAttributeOperatorSpaceChecker.js new file mode 100644 index 000000000..25e36b2e7 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selectorAttributeOperatorSpaceChecker.js @@ -0,0 +1,92 @@ +'use strict'; + +const isStandardSyntaxRule = require('../utils/isStandardSyntaxRule'); +const parseSelector = require('../utils/parseSelector'); +const report = require('../utils/report'); +const styleSearch = require('style-search'); + +/** + * @param {{ + * root: import('postcss').Root, + * result: import('stylelint').PostcssResult, + * locationChecker: (opts: { source: string, index: number, err: (msg: string) => void }) => void, + * checkedRuleName: string, + * checkBeforeOperator: boolean, + * fix: ((attributeNode: import('postcss-selector-parser').Attribute) => boolean) | null, + * }} options + * @returns {void} + */ +module.exports = function selectorAttributeOperatorSpaceChecker(options) { + options.root.walkRules((rule) => { + if (!isStandardSyntaxRule(rule)) { + return; + } + + if (!rule.selector.includes('[') || !rule.selector.includes('=')) { + return; + } + + let hasFixed = false; + const selector = rule.raws.selector ? rule.raws.selector.raw : rule.selector; + + const fixedSelector = parseSelector(selector, options.result, rule, (selectorTree) => { + selectorTree.walkAttributes((attributeNode) => { + const operator = attributeNode.operator; + + if (!operator) { + return; + } + + const attributeNodeString = attributeNode.toString(); + + styleSearch({ source: attributeNodeString, target: operator }, (match) => { + const index = options.checkBeforeOperator ? match.startIndex : match.endIndex - 1; + + checkOperator(attributeNodeString, index, rule, attributeNode, operator); + }); + }); + }); + + if (hasFixed && fixedSelector) { + if (!rule.raws.selector) { + rule.selector = fixedSelector; + } else { + rule.raws.selector.raw = fixedSelector; + } + } + + /** + * @param {string} source + * @param {number} index + * @param {import('postcss').Node} node + * @param {import('postcss-selector-parser').Attribute} attributeNode + * @param {string} operator + */ + function checkOperator(source, index, node, attributeNode, operator) { + options.locationChecker({ + source, + index, + err: (msg) => { + if (options.fix && options.fix(attributeNode)) { + hasFixed = true; + + return; + } + + report({ + message: msg.replace( + options.checkBeforeOperator + ? operator.charAt(0) + : operator.charAt(operator.length - 1), + operator, + ), + node, + index: attributeNode.sourceIndex + index, + result: options.result, + ruleName: options.checkedRuleName, + }); + }, + }); + } + }); +}; diff --git a/node_modules/stylelint/lib/rules/selectorCombinatorSpaceChecker.js b/node_modules/stylelint/lib/rules/selectorCombinatorSpaceChecker.js new file mode 100644 index 000000000..b8f469a84 --- /dev/null +++ b/node_modules/stylelint/lib/rules/selectorCombinatorSpaceChecker.js @@ -0,0 +1,105 @@ +'use strict'; + +const isStandardSyntaxCombinator = require('../utils/isStandardSyntaxCombinator'); +const isStandardSyntaxRule = require('../utils/isStandardSyntaxRule'); +const parseSelector = require('../utils/parseSelector'); +const report = require('../utils/report'); + +/** + * @typedef {(args: { source: string, index: number, errTarget: string, err: (message: string) => void }) => void} LocationChecker + * + * @param {{ + * root: import('postcss').Root, + * result: import('stylelint').PostcssResult, + * locationChecker: LocationChecker, + * locationType: 'before' | 'after', + * checkedRuleName: string, + * fix: ((combinator: import('postcss-selector-parser').Combinator) => boolean) | null, + * }} opts + * @returns {void} + */ +module.exports = function selectorCombinatorSpaceChecker(opts) { + let hasFixed; + + opts.root.walkRules((rule) => { + if (!isStandardSyntaxRule(rule)) { + return; + } + + hasFixed = false; + const selector = rule.raws.selector ? rule.raws.selector.raw : rule.selector; + + const fixedSelector = parseSelector(selector, opts.result, rule, (selectorTree) => { + selectorTree.walkCombinators((node) => { + // Ignore non-standard combinators + if (!isStandardSyntaxCombinator(node)) { + return; + } + + // Ignore spaced descendant combinator + if (/\s/.test(node.value)) { + return; + } + + // Check the exist of node in prev of the combinator. + // in case some that aren't the first begin with combinators (nesting syntax) + if (opts.locationType === 'before' && !node.prev()) { + return; + } + + const parentParentNode = node.parent && node.parent.parent; + + // Ignore pseudo-classes selector like `.foo:nth-child(2n + 1) {}` + if (parentParentNode && parentParentNode.type === 'pseudo') { + return; + } + + const sourceIndex = node.sourceIndex; + const index = + node.value.length > 1 && opts.locationType === 'before' + ? sourceIndex + : sourceIndex + node.value.length - 1; + + check(selector, node, index, rule, sourceIndex); + }); + }); + + if (hasFixed && fixedSelector) { + if (!rule.raws.selector) { + rule.selector = fixedSelector; + } else { + rule.raws.selector.raw = fixedSelector; + } + } + }); + + /** + * @param {string} source + * @param {import('postcss-selector-parser').Combinator} combinator + * @param {number} index + * @param {import('postcss').Node} node + * @param {number} sourceIndex + */ + function check(source, combinator, index, node, sourceIndex) { + opts.locationChecker({ + source, + index, + errTarget: combinator.value, + err: (message) => { + if (opts.fix && opts.fix(combinator)) { + hasFixed = true; + + return; + } + + report({ + message, + node, + index: sourceIndex, + result: opts.result, + ruleName: opts.checkedRuleName, + }); + }, + }); + } +}; diff --git a/node_modules/stylelint/lib/rules/selectorListCommaWhitespaceChecker.js b/node_modules/stylelint/lib/rules/selectorListCommaWhitespaceChecker.js new file mode 100644 index 000000000..432252b4e --- /dev/null +++ b/node_modules/stylelint/lib/rules/selectorListCommaWhitespaceChecker.js @@ -0,0 +1,61 @@ +'use strict'; + +const isStandardSyntaxRule = require('../utils/isStandardSyntaxRule'); +const report = require('../utils/report'); +const styleSearch = require('style-search'); + +/** + * @param {{ + * root: import('postcss').Root, + * result: import('stylelint').PostcssResult, + * locationChecker: (opts: { source: string, index: number, err: (msg: string) => void }) => void, + * checkedRuleName: string, + * fix: ((rule: import('postcss').Rule, index: number) => boolean) | null, + * }} opts + * @returns {void} + */ +module.exports = function selectorListCommaWhitespaceChecker(opts) { + opts.root.walkRules((rule) => { + if (!isStandardSyntaxRule(rule)) { + return; + } + + const selector = rule.raws.selector ? rule.raws.selector.raw : rule.selector; + + styleSearch( + { + source: selector, + target: ',', + functionArguments: 'skip', + }, + (match) => { + checkDelimiter(selector, match.startIndex, rule); + }, + ); + }); + + /** + * @param {string} source + * @param {number} index + * @param {import('postcss').Rule} node + */ + function checkDelimiter(source, index, node) { + opts.locationChecker({ + source, + index, + err: (message) => { + if (opts.fix && opts.fix(node, index)) { + return; + } + + report({ + message, + node, + index, + result: opts.result, + ruleName: opts.checkedRuleName, + }); + }, + }); + } +}; diff --git a/node_modules/stylelint/lib/rules/shorthand-property-no-redundant-values/index.js b/node_modules/stylelint/lib/rules/shorthand-property-no-redundant-values/index.js new file mode 100644 index 000000000..4cde984f6 --- /dev/null +++ b/node_modules/stylelint/lib/rules/shorthand-property-no-redundant-values/index.js @@ -0,0 +1,185 @@ +'use strict'; + +const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); +const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); +const vendor = require('../../utils/vendor'); + +const ruleName = 'shorthand-property-no-redundant-values'; + +const messages = ruleMessages(ruleName, { + rejected: (unexpected, expected) => `Expected "${unexpected}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/shorthand-property-no-redundant-values', + fixable: true, +}; + +const propertiesWithShorthandNotation = new Set([ + 'margin', + 'padding', + 'border-color', + 'border-radius', + 'border-style', + 'border-width', + 'grid-gap', + 'inset', +]); + +const ignoredCharacters = ['+', '*', '/', '(', ')', '$', '@', '--', 'var(']; + +/** + * @param {string} value + * @returns {boolean} + */ +function hasIgnoredCharacters(value) { + return ignoredCharacters.some((char) => value.includes(char)); +} + +/** + * @param {string} property + * @returns {boolean} + */ +function isShorthandProperty(property) { + return propertiesWithShorthandNotation.has(property); +} + +/** + * @param {string} top + * @param {string} right + * @param {string} bottom + * @param {string} left + * @returns {string[]} + */ +function canCondense(top, right, bottom, left) { + const lowerTop = top.toLowerCase(); + const lowerRight = right.toLowerCase(); + const lowerBottom = bottom && bottom.toLowerCase(); + const lowerLeft = left && left.toLowerCase(); + + if (canCondenseToOneValue(lowerTop, lowerRight, lowerBottom, lowerLeft)) { + return [top]; + } + + if (canCondenseToTwoValues(lowerTop, lowerRight, lowerBottom, lowerLeft)) { + return [top, right]; + } + + if (canCondenseToThreeValues(lowerTop, lowerRight, lowerBottom, lowerLeft)) { + return [top, right, bottom]; + } + + return [top, right, bottom, left]; +} + +/** + * @param {string} top + * @param {string} right + * @param {string} bottom + * @param {string} left + * @returns {boolean} + */ +function canCondenseToOneValue(top, right, bottom, left) { + if (top !== right) { + return false; + } + + return (top === bottom && (bottom === left || !left)) || (!bottom && !left); +} + +/** + * @param {string} top + * @param {string} right + * @param {string} bottom + * @param {string} left + * @returns {boolean} + */ +function canCondenseToTwoValues(top, right, bottom, left) { + return (top === bottom && right === left) || (top === bottom && !left && top !== right); +} + +/** + * @param {string} _top + * @param {string} right + * @param {string} _bottom + * @param {string} left + * @returns {boolean} + */ +function canCondenseToThreeValues(_top, right, _bottom, left) { + return right === left; +} + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + if (!isStandardSyntaxDeclaration(decl) || !isStandardSyntaxProperty(decl.prop)) { + return; + } + + const prop = decl.prop; + const value = decl.value; + + const normalizedProp = vendor.unprefixed(prop.toLowerCase()); + + if (hasIgnoredCharacters(value) || !isShorthandProperty(normalizedProp)) { + return; + } + + /** @type {string[]} */ + const valuesToShorthand = []; + + valueParser(value).walk((valueNode) => { + if (valueNode.type !== 'word') { + return; + } + + valuesToShorthand.push(valueParser.stringify(valueNode)); + }); + + if (valuesToShorthand.length <= 1 || valuesToShorthand.length > 4) { + return; + } + + const shortestForm = canCondense( + valuesToShorthand[0] || '', + valuesToShorthand[1] || '', + valuesToShorthand[2] || '', + valuesToShorthand[3] || '', + ); + const shortestFormString = shortestForm.filter(Boolean).join(' '); + const valuesFormString = valuesToShorthand.join(' '); + + if (shortestFormString.toLowerCase() === valuesFormString.toLowerCase()) { + return; + } + + if (context.fix) { + decl.value = decl.value.replace(value, shortestFormString); + } else { + report({ + message: messages.rejected, + messageArgs: [value, shortestFormString], + node: decl, + result, + ruleName, + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/string-no-newline/index.js b/node_modules/stylelint/lib/rules/string-no-newline/index.js new file mode 100644 index 000000000..30c4fe087 --- /dev/null +++ b/node_modules/stylelint/lib/rules/string-no-newline/index.js @@ -0,0 +1,134 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); + +const ruleName = 'string-no-newline'; +const reNewLine = /\r?\n/; + +const messages = ruleMessages(ruleName, { + rejected: 'Unexpected newline in string', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/string-no-newline', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { actual: primary }); + + if (!validOptions) { + return; + } + + root.walk((node) => { + switch (node.type) { + case 'atrule': + checkDeclOrAtRule(node, node.params, atRuleParamIndex); + break; + case 'decl': + checkDeclOrAtRule(node, node.value, declarationValueIndex); + break; + case 'rule': + checkRule(node); + break; + } + }); + + /** + * @param {import('postcss').Rule} ruleNode + * @returns {void} + */ + function checkRule(ruleNode) { + // Get out quickly if there are no new line + if (!reNewLine.test(ruleNode.selector)) { + return; + } + + if (!isStandardSyntaxSelector(ruleNode.selector)) { + return; + } + + parseSelector(ruleNode.selector, result, ruleNode, (selectorTree) => { + selectorTree.walkAttributes((attributeNode) => { + const { value, quoteMark } = attributeNode; + + if (!value || !reNewLine.test(value)) { + return; + } + + const openIndex = [ + // length of our attribute + attributeNode.attribute, + // length of our operator , ie '=' + attributeNode.operator || '', + ].reduce( + (index, str) => index + str.length, + // index of the start of our attribute node in our source + // plus 1 for the opening quotation mark + attributeNode.sourceIndex + 1, + ); + + const valueLength = value.length + (quoteMark || '').length * 2; + + report({ + message: messages.rejected, + node: ruleNode, + index: openIndex, + endIndex: openIndex + valueLength, + result, + ruleName, + }); + }); + }); + } + + /** + * @template {import('postcss').AtRule | import('postcss').Declaration} T + * @param {T} node + * @param {string} value + * @param {(node: T) => number} getIndex + * @returns {void} + */ + function checkDeclOrAtRule(node, value, getIndex) { + // Get out quickly if there are no new line + if (!reNewLine.test(value)) { + return; + } + + valueParser(value).walk((valueNode) => { + if (valueNode.type !== 'string') { + return; + } + + if (!reNewLine.test(valueNode.value)) { + return; + } + + const nodeIndex = getIndex(node); + + report({ + message: messages.rejected, + node, + index: nodeIndex + valueNode.sourceIndex, + endIndex: nodeIndex + valueNode.sourceEndIndex, + result, + ruleName, + }); + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/string-quotes/index.js b/node_modules/stylelint/lib/rules/string-quotes/index.js new file mode 100644 index 000000000..806969957 --- /dev/null +++ b/node_modules/stylelint/lib/rules/string-quotes/index.js @@ -0,0 +1,250 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); +const parseSelector = require('../../utils/parseSelector'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); +const { isBoolean, assertString } = require('../../utils/validateTypes'); +const { isAtRule } = require('../../utils/typeGuards'); + +const ruleName = 'string-quotes'; + +const messages = ruleMessages(ruleName, { + expected: (q) => `Expected ${q} quotes`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/string-quotes', + fixable: true, + deprecated: true, +}; + +const singleQuote = `'`; +const doubleQuote = `"`; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + const correctQuote = primary === 'single' ? singleQuote : doubleQuote; + const erroneousQuote = primary === 'single' ? doubleQuote : singleQuote; + + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['single', 'double'], + }, + { + actual: secondaryOptions, + possible: { + avoidEscape: [isBoolean], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const avoidEscape = + secondaryOptions && secondaryOptions.avoidEscape !== undefined + ? secondaryOptions.avoidEscape + : true; + + root.walk((node) => { + switch (node.type) { + case 'atrule': + checkDeclOrAtRule(node, node.params, atRuleParamIndex); + break; + case 'decl': + checkDeclOrAtRule(node, node.value, declarationValueIndex); + break; + case 'rule': + checkRule(node); + break; + } + }); + + /** + * @param {import('postcss').Rule} ruleNode + * @returns {void} + */ + function checkRule(ruleNode) { + if (!isStandardSyntaxRule(ruleNode)) { + return; + } + + if (!ruleNode.selector.includes('[') || !ruleNode.selector.includes('=')) { + return; + } + + /** @type {number[]} */ + const fixPositions = []; + + parseSelector(ruleNode.selector, result, ruleNode, (selectorTree) => { + let selectorFixed = false; + + selectorTree.walkAttributes((attributeNode) => { + if (!attributeNode.quoted) { + return; + } + + if (attributeNode.quoteMark === correctQuote && avoidEscape) { + assertString(attributeNode.value); + const needsCorrectEscape = attributeNode.value.includes(correctQuote); + const needsOtherEscape = attributeNode.value.includes(erroneousQuote); + + if (needsOtherEscape) { + return; + } + + if (needsCorrectEscape) { + if (context.fix) { + selectorFixed = true; + attributeNode.quoteMark = erroneousQuote; + } else { + report({ + message: messages.expected(primary === 'single' ? 'double' : primary), + node: ruleNode, + index: attributeNode.sourceIndex + attributeNode.offsetOf('value'), + result, + ruleName, + }); + } + } + } + + if (attributeNode.quoteMark === erroneousQuote) { + if (avoidEscape) { + assertString(attributeNode.value); + const needsCorrectEscape = attributeNode.value.includes(correctQuote); + const needsOtherEscape = attributeNode.value.includes(erroneousQuote); + + if (needsOtherEscape) { + if (context.fix) { + selectorFixed = true; + attributeNode.quoteMark = correctQuote; + } else { + report({ + message: messages.expected(primary), + node: ruleNode, + index: attributeNode.sourceIndex + attributeNode.offsetOf('value'), + result, + ruleName, + }); + } + + return; + } + + if (needsCorrectEscape) { + return; + } + } + + if (context.fix) { + selectorFixed = true; + attributeNode.quoteMark = correctQuote; + } else { + report({ + message: messages.expected(primary), + node: ruleNode, + index: attributeNode.sourceIndex + attributeNode.offsetOf('value'), + result, + ruleName, + }); + } + } + }); + + if (selectorFixed) { + ruleNode.selector = selectorTree.toString(); + } + }); + + for (const fixIndex of fixPositions) { + ruleNode.selector = replaceQuote(ruleNode.selector, fixIndex, correctQuote); + } + } + + /** + * @template {import('postcss').AtRule | import('postcss').Declaration} T + * @param {T} node + * @param {string} value + * @param {(node: T) => number} getIndex + * @returns {void} + */ + function checkDeclOrAtRule(node, value, getIndex) { + /** @type {number[]} */ + const fixPositions = []; + + // Get out quickly if there are no erroneous quotes + if (!value.includes(erroneousQuote)) { + return; + } + + if (isAtRule(node) && node.name === 'charset') { + // allow @charset rules to have double quotes, in spite of the configuration + // TODO: @charset should always use double-quotes, see https://github.com/stylelint/stylelint/issues/2788 + return; + } + + valueParser(value).walk((valueNode) => { + if (valueNode.type === 'string' && valueNode.quote === erroneousQuote) { + const needsEscape = valueNode.value.includes(correctQuote); + + if (avoidEscape && needsEscape) { + // don't consider this an error + return; + } + + const openIndex = valueNode.sourceIndex; + + // we currently don't fix escapes + if (context.fix && !needsEscape) { + const closeIndex = openIndex + valueNode.value.length + erroneousQuote.length; + + fixPositions.push(openIndex, closeIndex); + } else { + report({ + message: messages.expected(primary), + node, + index: getIndex(node) + openIndex, + result, + ruleName, + }); + } + } + }); + + for (const fixIndex of fixPositions) { + if (isAtRule(node)) { + node.params = replaceQuote(node.params, fixIndex, correctQuote); + } else { + node.value = replaceQuote(node.value, fixIndex, correctQuote); + } + } + } + }; +}; + +/** + * @param {string} string + * @param {number} index + * @param {string} replace + * @returns {string} + */ +function replaceQuote(string, index, replace) { + return string.substring(0, index) + replace + string.substring(index + replace.length); +} + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/time-min-milliseconds/index.js b/node_modules/stylelint/lib/rules/time-min-milliseconds/index.js new file mode 100644 index 000000000..4a73b4f40 --- /dev/null +++ b/node_modules/stylelint/lib/rules/time-min-milliseconds/index.js @@ -0,0 +1,163 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const { longhandTimeProperties, shorthandTimeProperties } = require('../../reference/properties'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); +const vendor = require('../../utils/vendor'); +const { isNumber } = require('../../utils/validateTypes'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const getDimension = require('../../utils/getDimension'); + +const ruleName = 'time-min-milliseconds'; + +const messages = ruleMessages(ruleName, { + expected: (time) => `Expected a minimum of ${time} milliseconds`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/time-min-milliseconds', +}; + +const DELAY_PROPERTIES = new Set(['animation-delay', 'transition-delay']); + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: isNumber, + }, + { + actual: secondaryOptions, + possible: { + ignore: ['delay'], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + const minimum = primary; + const ignoreDelay = optionsMatches(secondaryOptions, 'ignore', 'delay'); + + root.walkDecls((decl) => { + const propertyName = vendor.unprefixed(decl.prop.toLowerCase()); + const propertyValue = decl.value; + const parsedValue = valueParser(getDeclarationValue(decl)); + let timeValueCount = 0; + + parsedValue.walk((node) => { + const { value, sourceIndex } = node; + const dimension = getDimension(node); + + if ( + longhandTimeProperties.has(propertyName) && + !isIgnoredProperty(propertyName) && + !isAcceptableTime(dimension) + ) { + complain(decl, 0, propertyValue.length); + } + + if (!shorthandTimeProperties.has(propertyName)) return; + + timeValueCount = calcTimeValueCount(dimension, value, timeValueCount); + + if (isAcceptableTime(dimension) || (ignoreDelay && timeValueCount !== 1)) return; + + complain(decl, sourceIndex, value.length); + }); + }); + + /** + * @param {{unit: string | null, number: string | null}} dimension + * @param {string} value + * @param {number} valueTimeCount + * @returns {number} + */ + function calcTimeValueCount(dimension, value, valueTimeCount) { + const { unit } = dimension; + + if (unit !== null) valueTimeCount++; + + if (value === ',') valueTimeCount = 0; + + return valueTimeCount; + } + + /** + * @param {string} propertyName + * @returns {boolean} + */ + function isIgnoredProperty(propertyName) { + if (ignoreDelay && DELAY_PROPERTIES.has(propertyName)) { + return true; + } + + return false; + } + + /** + * @param {import('postcss-value-parser').Dimension | {unit: null, number: null}} dimension + * @returns {boolean} + */ + function isAcceptableTime(dimension) { + const { unit, number } = dimension; + + if (unit === null || number === null) return true; + + const numTime = Number(number); + + if (numTime <= 0) { + return true; + } + + const timeUnit = unit.toLowerCase(); + + if (timeUnit === 'ms' && numTime < minimum) { + return false; + } + + if (timeUnit === 's' && numTime * 1000 < minimum) { + return false; + } + + return true; + } + + /** + * @param {import('postcss').Declaration} decl + * @param {number} offset + * @param {number} length + * @returns {void} + */ + function complain(decl, offset, length) { + const index = declarationValueIndex(decl) + offset; + const endIndex = index + length; + + report({ + result, + ruleName, + message: messages.expected, + messageArgs: [minimum], + index, + endIndex, + node: decl, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/unicode-bom/index.js b/node_modules/stylelint/lib/rules/unicode-bom/index.js new file mode 100644 index 000000000..94063cab9 --- /dev/null +++ b/node_modules/stylelint/lib/rules/unicode-bom/index.js @@ -0,0 +1,68 @@ +'use strict'; + +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); + +const ruleName = 'unicode-bom'; + +const messages = ruleMessages(ruleName, { + expected: 'Expected Unicode BOM', + rejected: 'Unexpected Unicode BOM', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/unicode-bom', + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never'], + }); + + if ( + !validOptions || + !root.source || + // @ts-expect-error -- TS2339: Property 'inline' does not exist on type 'Source'. + root.source.inline || + // @ts-expect-error -- TS2339: Property 'lang' does not exist on type 'Source'. + root.source.lang === 'object-literal' || + // Ignore HTML documents + // @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Root'. + root.document !== undefined + ) { + return; + } + + const { hasBOM } = root.source.input; + + if (primary === 'always' && !hasBOM) { + report({ + result, + ruleName, + message: messages.expected, + node: root, + line: 1, + }); + } + + if (primary === 'never' && hasBOM) { + report({ + result, + ruleName, + message: messages.rejected, + node: root, + line: 1, + }); + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/unit-allowed-list/index.js b/node_modules/stylelint/lib/rules/unit-allowed-list/index.js new file mode 100644 index 000000000..88e5262d6 --- /dev/null +++ b/node_modules/stylelint/lib/rules/unit-allowed-list/index.js @@ -0,0 +1,113 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDimension = require('../../utils/getDimension'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); +const { isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'unit-allowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (unit) => `Unexpected unit "${unit}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/unit-allowed-list', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [isString], + }, + { + optional: true, + actual: secondaryOptions, + possible: { + ignoreFunctions: [isString, isRegExp], + ignoreProperties: [validateObjectWithArrayProps(isString, isRegExp)], + }, + }, + ); + + if (!validOptions) { + return; + } + + const primaryValues = [primary].flat(); + + /** + * @template {import('postcss').AtRule | import('postcss').Declaration} T + * @param {T} node + * @param {string} value + * @param {(node: T) => number} getIndex + * @returns {void} + */ + function check(node, value, getIndex) { + // make sure multiplication operations (*) are divided - not handled + // by postcss-value-parser + value = value.replace(/\*/g, ','); + valueParser(value).walk((valueNode) => { + if (valueNode.type === 'function') { + const valueLowerCase = valueNode.value.toLowerCase(); + + // Ignore wrong units within `url` function + if (valueLowerCase === 'url') { + return false; + } + + if (optionsMatches(secondaryOptions, 'ignoreFunctions', valueLowerCase)) { + return false; + } + } + + const { number, unit } = getDimension(valueNode); + + if (!number || !unit || primaryValues.includes(unit.toLowerCase())) { + return; + } + + if ( + 'prop' in node && + secondaryOptions && + optionsMatches(secondaryOptions.ignoreProperties, unit.toLowerCase(), node.prop) + ) { + return; + } + + const index = getIndex(node); + + report({ + index: index + valueNode.sourceIndex + number.length, + endIndex: index + valueNode.sourceEndIndex, + message: messages.rejected, + messageArgs: [unit], + node, + result, + ruleName, + }); + }); + } + + root.walkAtRules(/^media$/i, (atRule) => check(atRule, atRule.params, atRuleParamIndex)); + root.walkDecls((decl) => check(decl, decl.value, declarationValueIndex)); + }; +}; + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/unit-case/index.js b/node_modules/stylelint/lib/rules/unit-case/index.js new file mode 100644 index 000000000..640383b5b --- /dev/null +++ b/node_modules/stylelint/lib/rules/unit-case/index.js @@ -0,0 +1,134 @@ +'use strict'; + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDimension = require('../../utils/getDimension'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); + +const ruleName = 'unit-case'; + +const messages = ruleMessages(ruleName, { + expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/unit-case', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['lower', 'upper'], + }); + + if (!validOptions) { + return; + } + + /** + * @template {import('postcss').AtRule | import('postcss').Declaration} T + * @param {T} node + * @param {string} checkedValue + * @param {(node: T) => number} getIndex + * @returns {void} + */ + function check(node, checkedValue, getIndex) { + /** @type {Array<{ index: number, endIndex: number, message: string }>} */ + const problems = []; + + /** + * @param {import('postcss-value-parser').Node} valueNode + * @returns {boolean} + */ + function processValue(valueNode) { + const { number, unit } = getDimension(valueNode); + + if (!number || !unit) return false; + + const expectedUnit = primary === 'lower' ? unit.toLowerCase() : unit.toUpperCase(); + + if (unit === expectedUnit) { + return false; + } + + const index = getIndex(node); + + problems.push({ + index: index + valueNode.sourceIndex + number.length, + endIndex: index + valueNode.sourceEndIndex, + message: messages.expected(unit, expectedUnit), + }); + + return true; + } + + const parsedValue = valueParser(checkedValue).walk((valueNode) => { + // Ignore wrong units within `url` function + let needFix = false; + const value = valueNode.value; + + if (valueNode.type === 'function' && value.toLowerCase() === 'url') { + return false; + } + + if (value.includes('*')) { + value.split('*').some((val) => { + return processValue({ + ...valueNode, + sourceIndex: value.indexOf(val) + val.length + 1, + value: val, + }); + }); + } + + needFix = processValue(valueNode); + + if (needFix && context.fix) { + valueNode.value = primary === 'lower' ? value.toLowerCase() : value.toUpperCase(); + } + }); + + if (problems.length) { + if (context.fix) { + if ('name' in node && node.name === 'media') { + node.params = parsedValue.toString(); + } else if ('value' in node) { + node.value = parsedValue.toString(); + } + } else { + for (const err of problems) { + report({ + index: err.index, + endIndex: err.endIndex, + message: err.message, + node, + result, + ruleName, + }); + } + } + } + } + + root.walkAtRules((atRule) => { + if (!/^media$/i.test(atRule.name) && !('variable' in atRule)) { + return; + } + + check(atRule, atRule.params, atRuleParamIndex); + }); + root.walkDecls((decl) => check(decl, decl.value, declarationValueIndex)); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/unit-disallowed-list/index.js b/node_modules/stylelint/lib/rules/unit-disallowed-list/index.js new file mode 100644 index 000000000..602eb7d4c --- /dev/null +++ b/node_modules/stylelint/lib/rules/unit-disallowed-list/index.js @@ -0,0 +1,226 @@ +'use strict'; + +const { TokenType, tokenize, NumberType } = require('@csstools/css-tokenizer'); +const { + isFunctionNode, + isSimpleBlockNode, + isTokenNode, + parseListOfComponentValues, +} = require('@csstools/css-parser-algorithms'); +const { parseFromTokens, isMediaFeature } = require('@csstools/media-query-list-parser'); + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getAtRuleParams = require('../../utils/getAtRuleParams'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const hasDimension = require('../../utils/hasDimension'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); +const validateOptions = require('../../utils/validateOptions'); +const { isRegExp, isString } = require('../../utils/validateTypes'); +const isUnicodeRangeDescriptor = require('../../utils/isUnicodeRangeDescriptor'); + +const ruleName = 'unit-disallowed-list'; + +const messages = ruleMessages(ruleName, { + rejected: (unit) => `Unexpected unit "${unit}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/unit-disallowed-list', +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: [isString], + }, + { + optional: true, + actual: secondaryOptions, + possible: { + ignoreFunctions: [isString, isRegExp], + ignoreProperties: [validateObjectWithArrayProps(isString, isRegExp)], + ignoreMediaFeatureNames: [validateObjectWithArrayProps(isString, isRegExp)], + }, + }, + ); + + if (!validOptions) { + return; + } + + const primaryValues = [primary].flat(); + + /** + * Ignore wrong units within `url` function + * Ignore units within function that match `ignoreFunctions` option + * + * @param {import('@csstools/css-parser-algorithms').ComponentValue} componentValue + * @returns {boolean} + */ + function componentValueIsIgnored(componentValue) { + if (!isFunctionNode(componentValue)) { + return false; + } + + const name = componentValue.getName().toLowerCase(); + + return name === 'url' || optionsMatches(secondaryOptions, 'ignoreFunctions', name); + } + + /** + * @template {import('postcss').AtRule | import('postcss').Declaration} T + * @param {T} node + * @param {(node: T) => number} getIndex + * @param {import('@csstools/css-parser-algorithms').ComponentValue} componentValue + * @param {string} input + * @param {Record | undefined} options + * @returns {void} + */ + function check(node, getIndex, componentValue, input, options) { + if (!isTokenNode(componentValue)) return; + + if (componentValue.value[0] !== TokenType.Dimension) return; + + const [, , , endIndex, { unit }] = componentValue.value; + + const lowerCaseUnit = unit.toLowerCase(); + + if (!primaryValues.includes(lowerCaseUnit)) { + return; + } + + // The unit has an ignore option for the specific input + if (options && optionsMatches(options, lowerCaseUnit, input)) return; + + const startIndex = getIndex(node) + (endIndex + 1) - unit.length; + + report({ + index: startIndex, + endIndex: startIndex + unit.length, + message: messages.rejected, + messageArgs: [unit], + node, + result, + ruleName, + }); + } + + root.walkAtRules(/^media$/i, (atRule) => { + const params = getAtRuleParams(atRule); + + if (!hasDimension(params)) return; + + parseFromTokens(tokenizeWithoutPercentages(params)).forEach((mediaQuery) => { + /** @type {{ mediaFeatureName: string | undefined }} */ + const initialState = { + mediaFeatureName: undefined, + }; + + mediaQuery.walk(({ node, state }) => { + if (!state) return; + + if (isMediaFeature(node)) { + state.mediaFeatureName = node.getName().toLowerCase(); + } + + if (!state.mediaFeatureName) return; + + if (!isTokenNode(node)) return; + + check( + atRule, + atRuleParamIndex, + node, + state.mediaFeatureName, + secondaryOptions?.ignoreMediaFeatureNames, + ); + }, initialState); + }); + }); + + root.walkDecls((decl) => { + if (isUnicodeRangeDescriptor(decl)) return; + + const value = getDeclarationValue(decl); + + if (!hasDimension(value)) return; + + parseListOfComponentValues(tokenizeWithoutPercentages(value)).forEach((componentValue) => { + if (isTokenNode(componentValue)) { + check( + decl, + declarationValueIndex, + componentValue, + decl.prop, + secondaryOptions?.ignoreProperties, + ); + + return; + } + + if (!isFunctionNode(componentValue) && !isSimpleBlockNode(componentValue)) return; + + const initialState = { + ignored: componentValueIsIgnored(componentValue), + }; + + componentValue.walk(({ node, state }) => { + if (!state) return; + + if (state.ignored) return; + + if (isTokenNode(node)) { + check(decl, declarationValueIndex, node, decl.prop, secondaryOptions?.ignoreProperties); + + return; + } + + if (componentValueIsIgnored(node)) { + state.ignored = true; + } + }, initialState); + }); + }); + }; +}; + +/** + * In the CSS syntax percentages are a different token type than dimensions. + * For CSS authors however this distinction doesn't make sense, so we convert + * percentage tokens to dimension tokens with a unit of "%". + * + * Percentage tokens also aren't valid in media queries. + * Converting percentage tokens to dimension tokens simplifies any code checking for units. + * + * @param {string} css + * @returns {Array} + */ +function tokenizeWithoutPercentages(css) { + return tokenize({ css }).map((x) => { + if (x[0] !== TokenType.Percentage) return x; + + return [ + TokenType.Dimension, + x[1], + x[2], + x[3], + { value: x[4].value, unit: '%', type: NumberType.Number }, + ]; + }); +} + +rule.primaryOptionArray = true; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/unit-no-unknown/index.js b/node_modules/stylelint/lib/rules/unit-no-unknown/index.js new file mode 100644 index 000000000..b85252768 --- /dev/null +++ b/node_modules/stylelint/lib/rules/unit-no-unknown/index.js @@ -0,0 +1,214 @@ +'use strict'; + +const { tokenize, TokenType } = require('@csstools/css-tokenizer'); +const { + isFunctionNode, + isSimpleBlockNode, + isTokenNode, + parseListOfComponentValues, +} = require('@csstools/css-parser-algorithms'); +const { isMediaFeature, parseFromTokens } = require('@csstools/media-query-list-parser'); + +const atRuleParamIndex = require('../../utils/atRuleParamIndex'); +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getAtRuleParams = require('../../utils/getAtRuleParams'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const hasDimension = require('../../utils/hasDimension'); +const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); +const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const isUnicodeRangeDescriptor = require('../../utils/isUnicodeRangeDescriptor'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isRegExp, isString } = require('../../utils/validateTypes'); +const units = new Set(require('../../reference/units').units); // a copy that is safe to mutate + +// `x` as a resolution unit is very often a typo for `px`. +// By removing it from the set of known units, we can catch those typos. +// Intentional `x` units are supported by manually checking these in specific functions or properties. +units.delete('x'); + +const ruleName = 'unit-no-unknown'; + +const messages = ruleMessages(ruleName, { + rejected: (unit) => `Unexpected unknown unit "${unit}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/unit-no-unknown', +}; + +const RESOLUTION_MEDIA_FEATURE_NAME = /^(?:min-|max-)?resolution$/i; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + actual: secondaryOptions, + possible: { + ignoreUnits: [isString, isRegExp], + ignoreFunctions: [isString, isRegExp], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + /** + * @param {string} value + */ + const tokenizeIfValueMightContainUnknownUnits = (value) => { + if (!hasDimension(value)) return; + + const tokens = tokenize({ css: value }); + const hasUnknownUnits = tokens.some((token) => { + return token[0] === TokenType.Dimension && !units.has(token[4].unit.toLowerCase()); + }); + + if (!hasUnknownUnits) return; + + return tokens; + }; + + /** + * @template {import('postcss').AtRule | import('postcss').Declaration} T + * @param {T} node + * @param {(node: T) => number} getIndex + * @param {import('@csstools/css-parser-algorithms').FunctionNode | import('@csstools/css-parser-algorithms').TokenNode} componentValue + * @param {{ ignored: boolean, allowX: boolean }} state + */ + const check = (node, getIndex, componentValue, state) => { + if (isFunctionNode(componentValue)) { + const name = componentValue.getName(); + const nameLowerCase = name.toLowerCase(); + + if (nameLowerCase === 'url' || optionsMatches(secondaryOptions, 'ignoreFunctions', name)) { + state.ignored = true; + + return; + } + + if (vendor.unprefixed(nameLowerCase) === 'image-set') { + state.allowX = true; + + return; + } + + return; + } + + const [tokenType, , , endIndex, tokenValue] = componentValue.value; + + if (tokenType !== TokenType.Dimension) return; + + if (optionsMatches(secondaryOptions, 'ignoreUnits', tokenValue.unit)) return; + + const unit = tokenValue.unit.toLowerCase(); + + if (unit === 'x' && state.allowX) return; + + if (units.has(unit) && unit !== 'x') return; + + const startIndex = getIndex(node) + (endIndex + 1) - unit.length; + + report({ + message: messages.rejected, + messageArgs: [tokenValue.unit], + node, + index: startIndex, + endIndex: startIndex + unit.length, + result, + ruleName, + }); + }; + + root.walkAtRules(/^media$/i, (atRule) => { + if (!isStandardSyntaxAtRule(atRule)) return; + + const params = getAtRuleParams(atRule); + + const tokens = tokenizeIfValueMightContainUnknownUnits(params); + + if (!tokens) return; + + parseFromTokens(tokens).forEach((mediaQuery) => { + const initialState = { + ignored: false, + allowX: false, + }; + + mediaQuery.walk(({ node, state }) => { + if (!state) return; + + if (state.ignored) return; + + if (isMediaFeature(node)) { + const name = node.getName(); + + if (RESOLUTION_MEDIA_FEATURE_NAME.test(name)) { + state.allowX = true; + } + } else if (isFunctionNode(node) || isTokenNode(node)) { + check(atRule, atRuleParamIndex, node, state); + } + }, initialState); + }); + }); + + root.walkDecls((decl) => { + if (!isStandardSyntaxDeclaration(decl)) return; + + if (isUnicodeRangeDescriptor(decl)) return; + + const value = getDeclarationValue(decl); + + if (!isStandardSyntaxValue(value)) return; + + const tokens = tokenizeIfValueMightContainUnknownUnits(value); + + if (!tokens) return; + + const isImageResolutionProp = decl.prop.toLowerCase() === 'image-resolution'; + + parseListOfComponentValues(tokens).forEach((componentValue) => { + const initialState = { + ignored: false, + allowX: isImageResolutionProp, + }; + + if (isFunctionNode(componentValue) || isTokenNode(componentValue)) { + check(decl, declarationValueIndex, componentValue, initialState); + } + + if (!isFunctionNode(componentValue) && !isSimpleBlockNode(componentValue)) { + return; + } + + componentValue.walk(({ node, state }) => { + if (!state) return; + + if (state.ignored) return; + + if (isFunctionNode(node) || isTokenNode(node)) { + check(decl, declarationValueIndex, node, state); + } + }, initialState); + }); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-keyword-case/index.js b/node_modules/stylelint/lib/rules/value-keyword-case/index.js new file mode 100644 index 000000000..43e11633f --- /dev/null +++ b/node_modules/stylelint/lib/rules/value-keyword-case/index.js @@ -0,0 +1,248 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const getDimension = require('../../utils/getDimension'); +const isCounterIncrementCustomIdentValue = require('../../utils/isCounterIncrementCustomIdentValue'); +const isCounterResetCustomIdentValue = require('../../utils/isCounterResetCustomIdentValue'); +const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); +const { + animationNameKeywords, + animationShorthandKeywords, + camelCaseKeywords, + fontFamilyKeywords, + fontShorthandKeywords, + gridAreaKeywords, + gridColumnKeywords, + gridRowKeywords, + listStyleShorthandKeywords, + listStyleTypeKeywords, + systemColorsKeywords, +} = require('../../reference/keywords'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueParser = require('postcss-value-parser'); +const { isBoolean, isRegExp, isString } = require('../../utils/validateTypes'); + +const ruleName = 'value-keyword-case'; + +const messages = ruleMessages(ruleName, { + expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/value-keyword-case', + fixable: true, +}; + +// Operators are interpreted as "words" by the value parser, so we want to make sure to ignore them. +const ignoredCharacters = new Set(['+', '-', '/', '*', '%']); +const gridRowProps = new Set(['grid-row', 'grid-row-start', 'grid-row-end']); +const gridColumnProps = new Set(['grid-column', 'grid-column-start', 'grid-column-end']); + +const mapLowercaseKeywordsToCamelCase = new Map(); + +for (const func of camelCaseKeywords) { + mapLowercaseKeywordsToCamelCase.set(func.toLowerCase(), func); +} + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { + actual: primary, + possible: ['lower', 'upper'], + }, + { + actual: secondaryOptions, + possible: { + ignoreProperties: [isString, isRegExp], + ignoreKeywords: [isString, isRegExp], + ignoreFunctions: [isString, isRegExp], + camelCaseSvgKeywords: [isBoolean], + }, + optional: true, + }, + ); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + const prop = decl.prop; + const propLowerCase = decl.prop.toLowerCase(); + const value = decl.value; + + if (!isStandardSyntaxValue(value)) return; + + const parsed = valueParser(getDeclarationValue(decl)); + + let needFix = false; + + parsed.walk((node) => { + const keyword = node.value; + const valueLowerCase = keyword.toLowerCase(); + + // Ignore system colors + if (systemColorsKeywords.has(valueLowerCase)) { + return; + } + + // Ignore keywords within `url` and `var` function + if ( + node.type === 'function' && + (valueLowerCase === 'url' || + valueLowerCase === 'var' || + valueLowerCase === 'counter' || + valueLowerCase === 'counters' || + valueLowerCase === 'attr') + ) { + return false; + } + + // ignore keywords within ignoreFunctions functions + + if ( + node.type === 'function' && + optionsMatches(secondaryOptions, 'ignoreFunctions', keyword) + ) { + return false; + } + + const { unit } = getDimension(node); + + // Ignore css variables, and hex values, and math operators, and sass interpolation + if ( + node.type !== 'word' || + !isStandardSyntaxValue(keyword) || + value.includes('#') || + ignoredCharacters.has(keyword) || + unit + ) { + return; + } + + if ( + propLowerCase === 'animation' && + !animationShorthandKeywords.has(valueLowerCase) && + !animationNameKeywords.has(valueLowerCase) + ) { + return; + } + + if (propLowerCase === 'animation-name' && !animationNameKeywords.has(valueLowerCase)) { + return; + } + + if ( + propLowerCase === 'font' && + !fontShorthandKeywords.has(valueLowerCase) && + !fontFamilyKeywords.has(valueLowerCase) + ) { + return; + } + + if (propLowerCase === 'font-family' && !fontFamilyKeywords.has(valueLowerCase)) { + return; + } + + if ( + propLowerCase === 'counter-increment' && + isCounterIncrementCustomIdentValue(valueLowerCase) + ) { + return; + } + + if (propLowerCase === 'counter-reset' && isCounterResetCustomIdentValue(valueLowerCase)) { + return; + } + + if (gridRowProps.has(propLowerCase) && !gridRowKeywords.has(valueLowerCase)) { + return; + } + + if (gridColumnProps.has(propLowerCase) && !gridColumnKeywords.has(valueLowerCase)) { + return; + } + + if (propLowerCase === 'grid-area' && !gridAreaKeywords.has(valueLowerCase)) { + return; + } + + if ( + propLowerCase === 'list-style' && + !listStyleShorthandKeywords.has(valueLowerCase) && + !listStyleTypeKeywords.has(valueLowerCase) + ) { + return; + } + + if (propLowerCase === 'list-style-type' && !listStyleTypeKeywords.has(valueLowerCase)) { + return; + } + + if (optionsMatches(secondaryOptions, 'ignoreKeywords', keyword)) { + return; + } + + if (optionsMatches(secondaryOptions, 'ignoreProperties', prop)) { + return; + } + + const keywordLowerCase = keyword.toLocaleLowerCase(); + let expectedKeyword = null; + + /** @type {boolean} */ + const camelCaseSvgKeywords = + (secondaryOptions && secondaryOptions.camelCaseSvgKeywords) || false; + + if ( + primary === 'lower' && + mapLowercaseKeywordsToCamelCase.has(keywordLowerCase) && + camelCaseSvgKeywords + ) { + expectedKeyword = mapLowercaseKeywordsToCamelCase.get(keywordLowerCase); + } else if (primary === 'lower') { + expectedKeyword = keyword.toLowerCase(); + } else { + expectedKeyword = keyword.toUpperCase(); + } + + if (keyword === expectedKeyword) { + return; + } + + if (context.fix) { + needFix = true; + node.value = expectedKeyword; + + return; + } + + report({ + message: messages.expected, + messageArgs: [keyword, expectedKeyword], + node: decl, + index: declarationValueIndex(decl) + node.sourceIndex, + result, + ruleName, + }); + }); + + if (context.fix && needFix) { + decl.value = parsed.toString(); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-list-comma-newline-after/index.js b/node_modules/stylelint/lib/rules/value-list-comma-newline-after/index.js new file mode 100644 index 000000000..87dcb697a --- /dev/null +++ b/node_modules/stylelint/lib/rules/value-list-comma-newline-after/index.js @@ -0,0 +1,104 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const valueListCommaWhitespaceChecker = require('../valueListCommaWhitespaceChecker'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'value-list-comma-newline-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected newline after ","', + expectedAfterMultiLine: () => 'Expected newline after "," in a multi-line list', + rejectedAfterMultiLine: () => 'Unexpected whitespace after "," in a multi-line list', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/value-list-comma-newline-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line', 'never-multi-line'], + }); + + if (!validOptions) { + return; + } + + /** @type {Map | undefined} */ + let fixData; + + valueListCommaWhitespaceChecker({ + root, + result, + locationChecker: checker.afterOneOnly, + checkedRuleName: ruleName, + fix: context.fix + ? (declNode, index) => { + const valueIndex = declarationValueIndex(declNode); + + if (index <= valueIndex) { + return false; + } + + fixData = fixData || new Map(); + const commaIndices = fixData.get(declNode) || []; + + commaIndices.push(index); + fixData.set(declNode, commaIndices); + + return true; + } + : null, + determineIndex: (declString, match) => { + const nextChars = declString.substring(match.endIndex, declString.length); + + // If there's a // comment, that means there has to be a newline + // ending the comment so we're fine + if (/^[ \t]*\/\//.test(nextChars)) { + return false; + } + + // If there are spaces and then a comment begins, look for the newline + return /^[ \t]*\/\*/.test(nextChars) + ? declString.indexOf('*/', match.endIndex) + 1 + : match.startIndex; + }, + }); + + if (fixData) { + for (const [decl, commaIndices] of fixData.entries()) { + for (const index of commaIndices.sort((a, b) => a - b).reverse()) { + const value = getDeclarationValue(decl); + const valueIndex = index - declarationValueIndex(decl); + const beforeValue = value.slice(0, valueIndex + 1); + let afterValue = value.slice(valueIndex + 1); + + if (primary.startsWith('always')) { + afterValue = context.newline + afterValue; + } else if (primary.startsWith('never-multi-line')) { + afterValue = afterValue.replace(/^\s*/, ''); + } + + setDeclarationValue(decl, beforeValue + afterValue); + } + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-list-comma-newline-before/index.js b/node_modules/stylelint/lib/rules/value-list-comma-newline-before/index.js new file mode 100644 index 000000000..1285b33cc --- /dev/null +++ b/node_modules/stylelint/lib/rules/value-list-comma-newline-before/index.js @@ -0,0 +1,47 @@ +'use strict'; + +const ruleMessages = require('../../utils/ruleMessages'); +const validateOptions = require('../../utils/validateOptions'); +const valueListCommaWhitespaceChecker = require('../valueListCommaWhitespaceChecker'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'value-list-comma-newline-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected newline before ","', + expectedBeforeMultiLine: () => 'Expected newline before "," in a multi-line list', + rejectedBeforeMultiLine: () => 'Unexpected whitespace before "," in a multi-line list', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/value-list-comma-newline-before', + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary) => { + const checker = whitespaceChecker('newline', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'always-multi-line', 'never-multi-line'], + }); + + if (!validOptions) { + return; + } + + valueListCommaWhitespaceChecker({ + root, + result, + locationChecker: checker.beforeAllowingIndentation, + checkedRuleName: ruleName, + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-list-comma-space-after/index.js b/node_modules/stylelint/lib/rules/value-list-comma-space-after/index.js new file mode 100644 index 000000000..8674a4d20 --- /dev/null +++ b/node_modules/stylelint/lib/rules/value-list-comma-space-after/index.js @@ -0,0 +1,91 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const valueListCommaWhitespaceChecker = require('../valueListCommaWhitespaceChecker'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'value-list-comma-space-after'; + +const messages = ruleMessages(ruleName, { + expectedAfter: () => 'Expected single space after ","', + rejectedAfter: () => 'Unexpected whitespace after ","', + expectedAfterSingleLine: () => 'Expected single space after "," in a single-line list', + rejectedAfterSingleLine: () => 'Unexpected whitespace after "," in a single-line list', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/value-list-comma-space-after', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never', 'always-single-line', 'never-single-line'], + }); + + if (!validOptions) { + return; + } + + /** @type {Map | undefined} */ + let fixData; + + valueListCommaWhitespaceChecker({ + root, + result, + locationChecker: checker.after, + checkedRuleName: ruleName, + fix: context.fix + ? (declNode, index) => { + const valueIndex = declarationValueIndex(declNode); + + if (index <= valueIndex) { + return false; + } + + fixData = fixData || new Map(); + const commaIndices = fixData.get(declNode) || []; + + commaIndices.push(index); + fixData.set(declNode, commaIndices); + + return true; + } + : null, + }); + + if (fixData) { + for (const [decl, commaIndices] of fixData.entries()) { + for (const index of commaIndices.sort((a, b) => b - a)) { + const value = getDeclarationValue(decl); + const valueIndex = index - declarationValueIndex(decl); + const beforeValue = value.slice(0, valueIndex + 1); + let afterValue = value.slice(valueIndex + 1); + + if (primary.startsWith('always')) { + afterValue = afterValue.replace(/^\s*/, ' '); + } else if (primary.startsWith('never')) { + afterValue = afterValue.replace(/^\s*/, ''); + } + + setDeclarationValue(decl, beforeValue + afterValue); + } + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-list-comma-space-before/index.js b/node_modules/stylelint/lib/rules/value-list-comma-space-before/index.js new file mode 100644 index 000000000..46ff6c50a --- /dev/null +++ b/node_modules/stylelint/lib/rules/value-list-comma-space-before/index.js @@ -0,0 +1,91 @@ +'use strict'; + +const declarationValueIndex = require('../../utils/declarationValueIndex'); +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const valueListCommaWhitespaceChecker = require('../valueListCommaWhitespaceChecker'); +const whitespaceChecker = require('../../utils/whitespaceChecker'); + +const ruleName = 'value-list-comma-space-before'; + +const messages = ruleMessages(ruleName, { + expectedBefore: () => 'Expected single space before ","', + rejectedBefore: () => 'Unexpected whitespace before ","', + expectedBeforeSingleLine: () => 'Unexpected whitespace before "," in a single-line list', + rejectedBeforeSingleLine: () => 'Unexpected whitespace before "," in a single-line list', +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/value-list-comma-space-before', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const checker = whitespaceChecker('space', primary, messages); + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: ['always', 'never', 'always-single-line', 'never-single-line'], + }); + + if (!validOptions) { + return; + } + + /** @type {Map | undefined} */ + let fixData; + + valueListCommaWhitespaceChecker({ + root, + result, + locationChecker: checker.before, + checkedRuleName: ruleName, + fix: context.fix + ? (declNode, index) => { + const valueIndex = declarationValueIndex(declNode); + + if (index <= valueIndex) { + return false; + } + + fixData = fixData || new Map(); + const commaIndices = fixData.get(declNode) || []; + + commaIndices.push(index); + fixData.set(declNode, commaIndices); + + return true; + } + : null, + }); + + if (fixData) { + for (const [decl, commaIndices] of fixData.entries()) { + for (const index of commaIndices.sort((a, b) => b - a)) { + const value = getDeclarationValue(decl); + const valueIndex = index - declarationValueIndex(decl); + let beforeValue = value.slice(0, valueIndex); + const afterValue = value.slice(valueIndex); + + if (primary.startsWith('always')) { + beforeValue = beforeValue.replace(/\s*$/, ' '); + } else if (primary.startsWith('never')) { + beforeValue = beforeValue.replace(/\s*$/, ''); + } + + setDeclarationValue(decl, beforeValue + afterValue); + } + } + } + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-list-max-empty-lines/index.js b/node_modules/stylelint/lib/rules/value-list-max-empty-lines/index.js new file mode 100644 index 000000000..08fbbb262 --- /dev/null +++ b/node_modules/stylelint/lib/rules/value-list-max-empty-lines/index.js @@ -0,0 +1,66 @@ +'use strict'; + +const getDeclarationValue = require('../../utils/getDeclarationValue'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const { isNumber } = require('../../utils/validateTypes'); + +const ruleName = 'value-list-max-empty-lines'; + +const messages = ruleMessages(ruleName, { + expected: (max) => `Expected no more than ${max} empty ${max === 1 ? 'line' : 'lines'}`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/value-list-max-empty-lines', + fixable: true, + deprecated: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, _secondaryOptions, context) => { + const maxAdjacentNewlines = primary + 1; + + return (root, result) => { + const validOptions = validateOptions(result, ruleName, { + actual: primary, + possible: isNumber, + }); + + if (!validOptions) { + return; + } + + const violatedCRLFNewLinesRegex = new RegExp(`(?:\r\n){${maxAdjacentNewlines + 1},}`); + const violatedLFNewLinesRegex = new RegExp(`\n{${maxAdjacentNewlines + 1},}`); + const allowedLFNewLinesString = context.fix ? '\n'.repeat(maxAdjacentNewlines) : ''; + const allowedCRLFNewLinesString = context.fix ? '\r\n'.repeat(maxAdjacentNewlines) : ''; + + root.walkDecls((decl) => { + const value = getDeclarationValue(decl); + + if (context.fix) { + const newValueString = value + .replace(new RegExp(violatedLFNewLinesRegex, 'gm'), allowedLFNewLinesString) + .replace(new RegExp(violatedCRLFNewLinesRegex, 'gm'), allowedCRLFNewLinesString); + + setDeclarationValue(decl, newValueString); + } else if (violatedLFNewLinesRegex.test(value) || violatedCRLFNewLinesRegex.test(value)) { + report({ + message: messages.expected(primary), + node: decl, + index: 0, + result, + ruleName, + }); + } + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-no-vendor-prefix/index.js b/node_modules/stylelint/lib/rules/value-no-vendor-prefix/index.js new file mode 100644 index 000000000..98452948b --- /dev/null +++ b/node_modules/stylelint/lib/rules/value-no-vendor-prefix/index.js @@ -0,0 +1,95 @@ +'use strict'; + +const valueParser = require('postcss-value-parser'); + +const hasPrefix = require('../../utils/hasPrefix'); +const isAutoprefixable = require('../../utils/isAutoprefixable'); +const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); +const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); +const optionsMatches = require('../../utils/optionsMatches'); +const report = require('../../utils/report'); +const ruleMessages = require('../../utils/ruleMessages'); +const setDeclarationValue = require('../../utils/setDeclarationValue'); +const validateOptions = require('../../utils/validateOptions'); +const vendor = require('../../utils/vendor'); +const { isString } = require('../../utils/validateTypes'); + +const ruleName = 'value-no-vendor-prefix'; + +const messages = ruleMessages(ruleName, { + rejected: (value) => `Unexpected vendor-prefix "${value}"`, +}); + +const meta = { + url: 'https://stylelint.io/user-guide/rules/value-no-vendor-prefix', + fixable: true, +}; + +/** @type {import('stylelint').Rule} */ +const rule = (primary, secondaryOptions, context) => { + return (root, result) => { + const validOptions = validateOptions( + result, + ruleName, + { actual: primary }, + { + optional: true, + actual: secondaryOptions, + possible: { + ignoreValues: [isString], + }, + }, + ); + + if (!validOptions) { + return; + } + + root.walkDecls((decl) => { + const { value } = decl; + + if (!hasPrefix(value)) return; + + if (!isStandardSyntaxDeclaration(decl) || !isStandardSyntaxProperty(decl.prop)) { + return; + } + + if (optionsMatches(secondaryOptions, 'ignoreValues', vendor.unprefixed(value))) { + return; + } + + const parsedValue = valueParser(value); + + parsedValue.walk((node) => { + if (!isAutoprefixable.propertyValue(node.value)) { + return; + } + + if (context.fix) { + node.value = isAutoprefixable.unprefix(node.value); + + return; + } + + const startIndex = decl.prop.length + (decl.raws.between || '').length + node.sourceIndex; + + report({ + message: messages.rejected, + messageArgs: [node.value], + node: decl, + index: startIndex, + endIndex: startIndex + node.value.length, + result, + ruleName, + }); + }); + + setDeclarationValue(decl, parsedValue.toString()); + }); + }; +}; + +rule.ruleName = ruleName; +rule.messages = messages; +rule.meta = meta; +module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/valueListCommaWhitespaceChecker.js b/node_modules/stylelint/lib/rules/valueListCommaWhitespaceChecker.js new file mode 100644 index 000000000..b537a6799 --- /dev/null +++ b/node_modules/stylelint/lib/rules/valueListCommaWhitespaceChecker.js @@ -0,0 +1,71 @@ +'use strict'; + +const isStandardSyntaxDeclaration = require('../utils/isStandardSyntaxDeclaration'); +const isStandardSyntaxProperty = require('../utils/isStandardSyntaxProperty'); +const report = require('../utils/report'); +const styleSearch = require('style-search'); + +/** + * @param {{ + * root: import('postcss').Root, + * result: import('stylelint').PostcssResult, + * locationChecker: (opts: { source: string, index: number, err: (msg: string) => void }) => void, + * checkedRuleName: string, + * fix?: ((node: import('postcss').Declaration, index: number) => boolean) | null, + * determineIndex?: (declString: string, match: import('style-search').StyleSearchMatch) => number | false, + * }} opts + */ +module.exports = function valueListCommaWhitespaceChecker(opts) { + opts.root.walkDecls((decl) => { + if (!isStandardSyntaxDeclaration(decl) || !isStandardSyntaxProperty(decl.prop)) { + return; + } + + const declString = decl.toString(); + + styleSearch( + { + source: declString, + target: ',', + functionArguments: 'skip', + }, + (match) => { + const indexToCheckAfter = opts.determineIndex + ? opts.determineIndex(declString, match) + : match.startIndex; + + if (indexToCheckAfter === false) { + return; + } + + checkComma(declString, indexToCheckAfter, decl); + }, + ); + }); + + /** + * @param {string} source + * @param {number} index + * @param {import('postcss').Declaration} node + * @returns {void} + */ + function checkComma(source, index, node) { + opts.locationChecker({ + source, + index, + err: (message) => { + if (opts.fix && opts.fix(node, index)) { + return; + } + + report({ + message, + node, + index, + result: opts.result, + ruleName: opts.checkedRuleName, + }); + }, + }); + } +}; diff --git a/node_modules/stylelint/lib/standalone.js b/node_modules/stylelint/lib/standalone.js new file mode 100644 index 000000000..a7ed9058a --- /dev/null +++ b/node_modules/stylelint/lib/standalone.js @@ -0,0 +1,325 @@ +'use strict'; + +const debug = require('debug')('stylelint:standalone'); +const fastGlob = require('fast-glob'); +const fs = require('fs'); +const globby = require('globby'); +const normalizePath = require('normalize-path'); +const path = require('path'); + +const createStylelint = require('./createStylelint'); +const createPartialStylelintResult = require('./createPartialStylelintResult'); +const filterFilePaths = require('./utils/filterFilePaths'); +const formatters = require('./formatters'); +const getConfigForFile = require('./getConfigForFile'); +const getFileIgnorer = require('./utils/getFileIgnorer'); +const getFormatterOptionsText = require('./utils/getFormatterOptionsText'); +const lintSource = require('./lintSource'); +const NoFilesFoundError = require('./utils/noFilesFoundError'); +const AllFilesIgnoredError = require('./utils/allFilesIgnoredError'); +const { assert } = require('./utils/validateTypes'); +const prepareReturnValue = require('./prepareReturnValue'); + +const ALWAYS_IGNORED_GLOBS = ['**/node_modules/**']; +const writeFileAtomic = require('write-file-atomic'); + +/** @typedef {import('stylelint').Formatter} Formatter */ +/** @typedef {import('stylelint').FormatterType} FormatterType */ + +/** + * @type {import('stylelint')['lint']} + */ +async function standalone({ + allowEmptyInput, + cache, + cacheLocation, + cacheStrategy, + code, + codeFilename, + config, + configBasedir, + configFile, + customSyntax, + cwd = process.cwd(), + disableDefaultIgnores, + files, + fix, + formatter, + globbyOptions, + ignoreDisables, + ignorePath, + ignorePattern, + maxWarnings, + quiet, + quietDeprecationWarnings = false, + reportDescriptionlessDisables, + reportInvalidScopeDisables, + reportNeedlessDisables, +}) { + const startTime = Date.now(); + + const isValidCode = typeof code === 'string'; + + if ((!files && !isValidCode) || (files && (code || isValidCode))) { + return Promise.reject( + new Error('You must pass stylelint a `files` glob or a `code` string, though not both'), + ); + } + + // The ignorer will be used to filter file paths after the glob is checked, + // before any files are actually read + + /** @type {import('ignore').Ignore} */ + let ignorer; + + try { + ignorer = getFileIgnorer({ cwd, ignorePath, ignorePattern }); + } catch (error) { + return Promise.reject(error); + } + + /** @type {Formatter} */ + let formatterFunction; + + try { + formatterFunction = getFormatterFunction(formatter); + } catch (error) { + return Promise.reject(error); + } + + const stylelint = createStylelint({ + cacheLocation, + cacheStrategy, + config, + configFile, + configBasedir, + cwd, + ignoreDisables, + ignorePath, + reportNeedlessDisables, + reportInvalidScopeDisables, + reportDescriptionlessDisables, + customSyntax, + fix, + quiet, + quietDeprecationWarnings, + }); + + if (!files) { + const absoluteCodeFilename = + codeFilename !== undefined && !path.isAbsolute(codeFilename) + ? path.join(cwd, codeFilename) + : codeFilename; + + // if file is ignored, return nothing + if ( + absoluteCodeFilename && + !filterFilePaths(ignorer, [path.relative(cwd, absoluteCodeFilename)]).length + ) { + return prepareReturnValue([], maxWarnings, formatterFunction, cwd); + } + + let stylelintResult; + + try { + const postcssResult = await lintSource(stylelint, { + code, + codeFilename: absoluteCodeFilename, + }); + + stylelintResult = createPartialStylelintResult(postcssResult); + } catch (error) { + stylelintResult = handleError(error); + } + + const postcssResult = stylelintResult._postcssResult; + const returnValue = prepareReturnValue([stylelintResult], maxWarnings, formatterFunction, cwd); + + const autofix = fix ?? config?.fix ?? false; + + if (autofix && postcssResult && !postcssResult.stylelint.ignored) { + returnValue.output = + !postcssResult.stylelint.disableWritingFix && postcssResult.opts + ? // If we're fixing, the output should be the fixed code + postcssResult.root.toString(postcssResult.opts.syntax) + : // If the writing of the fix is disabled, the input code is returned as-is + code; + } + + return returnValue; + } + + let fileList = [files].flat().map((entry) => { + const globCWD = (globbyOptions && globbyOptions.cwd) || cwd; + const absolutePath = !path.isAbsolute(entry) + ? path.join(globCWD, entry) + : path.normalize(entry); + + if (fs.existsSync(absolutePath)) { + // This path points to a file. Return an escaped path to avoid globbing + return fastGlob.escapePath(normalizePath(entry)); + } + + return entry; + }); + + if (!disableDefaultIgnores) { + fileList = fileList.concat(ALWAYS_IGNORED_GLOBS.map((glob) => `!${glob}`)); + } + + // do not cache if config is explicitly overridden by option + const useCache = cache ?? config?.cache ?? false; + + if (!useCache) { + stylelint._fileCache.destroy(); + } + + const effectiveGlobbyOptions = { + cwd, + ...(globbyOptions || {}), + absolute: true, + }; + + const globCWD = effectiveGlobbyOptions.cwd; + + let filePaths = await globby(fileList, effectiveGlobbyOptions); + // Record the length of filePaths before ignore operation + // Prevent prompting "No files matching the pattern 'xx' were found." when .stylelintignore ignore all input files + const filePathsLengthBeforeIgnore = filePaths.length; + + // The ignorer filter needs to check paths relative to cwd + filePaths = filterFilePaths( + ignorer, + filePaths.map((p) => path.relative(globCWD, p)), + ); + + let stylelintResults; + + if (filePaths.length) { + let absoluteFilePaths = filePaths.map((filePath) => { + const absoluteFilepath = !path.isAbsolute(filePath) + ? path.join(globCWD, filePath) + : path.normalize(filePath); + + return absoluteFilepath; + }); + + const getStylelintResults = absoluteFilePaths.map(async (absoluteFilepath) => { + debug(`Processing ${absoluteFilepath}`); + + try { + const postcssResult = await lintSource(stylelint, { + filePath: absoluteFilepath, + cache: useCache, + }); + + if ( + (postcssResult.stylelint.stylelintError || postcssResult.stylelint.stylelintWarning) && + useCache + ) { + debug(`${absoluteFilepath} contains linting errors and will not be cached.`); + stylelint._fileCache.removeEntry(absoluteFilepath); + } + + /** + * If we're fixing, save the file with changed code + */ + if ( + postcssResult.root && + postcssResult.opts && + !postcssResult.stylelint.ignored && + fix && + !postcssResult.stylelint.disableWritingFix + ) { + const fixedCss = postcssResult.root.toString(postcssResult.opts.syntax); + + if ( + postcssResult.root && + postcssResult.root.source && + postcssResult.root.source.input.css !== fixedCss + ) { + await writeFileAtomic(absoluteFilepath, fixedCss); + } + } + + return createPartialStylelintResult(postcssResult); + } catch (error) { + // On any error, we should not cache the lint result + stylelint._fileCache.removeEntry(absoluteFilepath); + + return handleError(error); + } + }); + + stylelintResults = await Promise.all(getStylelintResults); + } else if (allowEmptyInput ?? config?.allowEmptyInput ?? (await canAllowEmptyInput(stylelint))) { + stylelintResults = await Promise.all([]); + } else if (filePathsLengthBeforeIgnore) { + // All input files ignored + stylelintResults = await Promise.reject(new AllFilesIgnoredError()); + } else { + stylelintResults = await Promise.reject(new NoFilesFoundError(fileList)); + } + + if (useCache) { + stylelint._fileCache.reconcile(); + } + + const result = prepareReturnValue(stylelintResults, maxWarnings, formatterFunction, cwd); + + debug(`Linting complete in ${Date.now() - startTime}ms`); + + return result; +} + +/** + * @param {FormatterType | Formatter | undefined} selected + * @returns {Formatter} + */ +function getFormatterFunction(selected) { + if (typeof selected === 'string') { + const formatterFunction = formatters[selected]; + + if (formatterFunction === undefined) { + const formattersText = getFormatterOptionsText(', ', '"'); + + throw new Error(`You must use a valid formatter option: ${formattersText} or a function`); + } + + return formatterFunction; + } + + if (typeof selected === 'function') { + return selected; + } + + assert(formatters.json); + + return formatters.json; +} + +/** + * @typedef {import('stylelint').CssSyntaxError} CssSyntaxError + * + * @param {unknown} error + * @return {import('stylelint').LintResult} + */ +function handleError(error) { + if (error instanceof Error && error.name === 'CssSyntaxError') { + return createPartialStylelintResult(undefined, /** @type {CssSyntaxError} */ (error)); + } + + throw error; +} + +/** + * @param {import('stylelint').InternalApi} stylelint + * @returns {Promise} + */ +async function canAllowEmptyInput(stylelint) { + const config = await getConfigForFile(stylelint); + + return Boolean(config?.config?.allowEmptyInput); +} + +module.exports = standalone; diff --git a/node_modules/stylelint/lib/utils/FileCache.js b/node_modules/stylelint/lib/utils/FileCache.js new file mode 100644 index 000000000..e59503912 --- /dev/null +++ b/node_modules/stylelint/lib/utils/FileCache.js @@ -0,0 +1,92 @@ +'use strict'; + +const debug = require('debug')('stylelint:file-cache'); +const fileEntryCache = require('file-entry-cache'); +const path = require('path'); + +const pkg = require('../../package.json'); +const getCacheFile = require('./getCacheFile'); +const hash = require('./hash'); +const { + DEFAULT_CACHE_LOCATION, + CACHE_STRATEGY_METADATA, + CACHE_STRATEGY_CONTENT, + DEFAULT_CACHE_STRATEGY, +} = require('../constants'); + +/** @typedef {import('file-entry-cache').FileDescriptor["meta"] & { hashOfConfig?: string }} CacheMetadata */ + +class FileCache { + constructor( + cacheLocation = DEFAULT_CACHE_LOCATION, + cacheStrategy = DEFAULT_CACHE_STRATEGY, + cwd = process.cwd(), + ) { + if (![CACHE_STRATEGY_METADATA, CACHE_STRATEGY_CONTENT].includes(cacheStrategy)) { + throw new Error( + `"${cacheStrategy}" cache strategy is unsupported. Specify either "${CACHE_STRATEGY_METADATA}" or "${CACHE_STRATEGY_CONTENT}"`, + ); + } + + const cacheFile = path.resolve(getCacheFile(cacheLocation, cwd)); + const useCheckSum = cacheStrategy === CACHE_STRATEGY_CONTENT; + + debug(`Cache file is created at ${cacheFile}`); + this._fileCache = fileEntryCache.create(cacheFile, undefined, useCheckSum); + this._hashOfConfig = ''; + } + + /** + * @param {import('stylelint').Config} config + */ + calcHashOfConfig(config) { + if (this._hashOfConfig) return; + + const stylelintVersion = pkg.version; + const configString = JSON.stringify(config || {}); + + this._hashOfConfig = hash(`${stylelintVersion}_${configString}`); + } + + /** + * @param {string} absoluteFilepath + * @return {boolean} + */ + hasFileChanged(absoluteFilepath) { + // Get file descriptor compares current metadata against cached + // one and stores the result to "changed" prop.w + const descriptor = this._fileCache.getFileDescriptor(absoluteFilepath); + /** @type {CacheMetadata} */ + const meta = descriptor.meta || {}; + const changed = descriptor.changed || meta.hashOfConfig !== this._hashOfConfig; + + if (!changed) { + debug(`Skip linting ${absoluteFilepath}. File hasn't changed.`); + } + + // Mutate file descriptor object and store config hash to each file. + // Running lint with different config should invalidate the cache. + if (meta.hashOfConfig !== this._hashOfConfig) { + meta.hashOfConfig = this._hashOfConfig; + } + + return changed; + } + + reconcile() { + this._fileCache.reconcile(); + } + + destroy() { + this._fileCache.destroy(); + } + + /** + * @param {string} absoluteFilepath + */ + removeEntry(absoluteFilepath) { + this._fileCache.removeEntry(absoluteFilepath); + } +} + +module.exports = FileCache; diff --git a/node_modules/stylelint/lib/utils/addEmptyLineAfter.js b/node_modules/stylelint/lib/utils/addEmptyLineAfter.js new file mode 100644 index 000000000..afcd00eb7 --- /dev/null +++ b/node_modules/stylelint/lib/utils/addEmptyLineAfter.js @@ -0,0 +1,28 @@ +'use strict'; + +/** + * Add an empty line after a node. Mutates the node. + * + * @template {import('postcss').Rule | import('postcss').AtRule} T + * @param {T} node + * @param {string} newline + * @returns {T} + */ +module.exports = function addEmptyLineAfter(node, newline) { + const { raws } = node; + + if (typeof raws.after !== 'string') { + return node; + } + + const spaces = raws.after.split(';'); + const after = spaces[spaces.length - 1] || ''; + + if (!/\r?\n/.test(after)) { + raws.after += newline.repeat(2); + } else { + raws.after = raws.after.replace(/(\r?\n)/, `${newline}$1`); + } + + return node; +}; diff --git a/node_modules/stylelint/lib/utils/addEmptyLineBefore.js b/node_modules/stylelint/lib/utils/addEmptyLineBefore.js new file mode 100644 index 000000000..68a53891f --- /dev/null +++ b/node_modules/stylelint/lib/utils/addEmptyLineBefore.js @@ -0,0 +1,23 @@ +'use strict'; + +/** + * Add an empty line before a node. Mutates the node. + * + * @template {import('postcss').ChildNode} T + * @param {T} node + * @param {string} newline + * @returns {T} + */ +module.exports = function addEmptyLineBefore(node, newline) { + const { raws } = node; + + if (typeof raws.before !== 'string') { + return node; + } + + raws.before = !/\r?\n/.test(raws.before) + ? newline.repeat(2) + raws.before + : raws.before.replace(/(\r?\n)/, `${newline}$1`); + + return node; +}; diff --git a/node_modules/stylelint/lib/utils/allFilesIgnoredError.js b/node_modules/stylelint/lib/utils/allFilesIgnoredError.js new file mode 100644 index 000000000..d1a3a47ce --- /dev/null +++ b/node_modules/stylelint/lib/utils/allFilesIgnoredError.js @@ -0,0 +1,11 @@ +'use strict'; + +class AllFilesIgnoredError extends Error { + constructor() { + super(); + + this.message = `All input files were ignored because of the ignore pattern. Either change your input, ignore pattern or use "--allow-empty-input" to allow no inputs`; + } +} + +module.exports = AllFilesIgnoredError; diff --git a/node_modules/stylelint/lib/utils/arrayEqual.js b/node_modules/stylelint/lib/utils/arrayEqual.js new file mode 100644 index 000000000..fae0e5a70 --- /dev/null +++ b/node_modules/stylelint/lib/utils/arrayEqual.js @@ -0,0 +1,16 @@ +'use strict'; + +/** + * Tests if two arrays are equal. + * + * @param {unknown} a + * @param {unknown} b + * @returns {boolean} + */ +module.exports = function arrayEqual(a, b) { + if (!Array.isArray(a) || !Array.isArray(b)) return false; + + if (a.length !== b.length) return false; + + return a.every((elem, index) => elem === b[index]); +}; diff --git a/node_modules/stylelint/lib/utils/atRuleParamIndex.js b/node_modules/stylelint/lib/utils/atRuleParamIndex.js new file mode 100644 index 000000000..a820dc9fa --- /dev/null +++ b/node_modules/stylelint/lib/utils/atRuleParamIndex.js @@ -0,0 +1,16 @@ +'use strict'; + +/** + * @param {import('postcss').AtRule} atRule + * @returns {number} + */ +module.exports = function atRuleParamIndex(atRule) { + // Initial 1 is for the `@` + let index = 1 + atRule.name.length; + + if (atRule.raws.afterName) { + index += atRule.raws.afterName.length; + } + + return index; +}; diff --git a/node_modules/stylelint/lib/utils/beforeBlockString.js b/node_modules/stylelint/lib/utils/beforeBlockString.js new file mode 100644 index 000000000..3ae78306b --- /dev/null +++ b/node_modules/stylelint/lib/utils/beforeBlockString.js @@ -0,0 +1,29 @@ +'use strict'; + +const { isAtRule, isRule } = require('./typeGuards'); + +/** + * @param {import('postcss').Container} statement + * @returns {string} + */ +module.exports = function beforeBlockString(statement, { noRawBefore } = { noRawBefore: false }) { + let result = ''; + + const before = statement.raws.before || ''; + + if (!noRawBefore) { + result += before; + } + + if (isRule(statement)) { + result += statement.selector; + } else if (isAtRule(statement)) { + result += `@${statement.name}${statement.raws.afterName || ''}${statement.params}`; + } else { + return ''; + } + + result += statement.raws.between || ''; + + return result; +}; diff --git a/node_modules/stylelint/lib/utils/blockString.js b/node_modules/stylelint/lib/utils/blockString.js new file mode 100644 index 000000000..6ebd81a41 --- /dev/null +++ b/node_modules/stylelint/lib/utils/blockString.js @@ -0,0 +1,21 @@ +'use strict'; + +const beforeBlockString = require('./beforeBlockString'); +const hasBlock = require('./hasBlock'); +const rawNodeString = require('./rawNodeString'); + +/** + * Return a CSS statement's block -- the string that starts and `{` and ends with `}`. + * + * If the statement has no block (e.g. `@import url(foo.css);`), returns an empty string. + * + * @param {import('postcss').Container} statement + * @returns {string} + */ +module.exports = function blockString(statement) { + if (!hasBlock(statement)) { + return ''; + } + + return rawNodeString(statement).slice(beforeBlockString(statement).length); +}; diff --git a/node_modules/stylelint/lib/utils/blurInterpolation.js b/node_modules/stylelint/lib/utils/blurInterpolation.js new file mode 100644 index 000000000..4225c7df5 --- /dev/null +++ b/node_modules/stylelint/lib/utils/blurInterpolation.js @@ -0,0 +1,10 @@ +'use strict'; + +/** + * @param {string} source + * + * @returns {string} + */ +module.exports = function blurInterpolation(source, blurChar = ' ') { + return source.replace(/[#@{}]+/g, blurChar); +}; diff --git a/node_modules/stylelint/lib/utils/checkAgainstRule.js b/node_modules/stylelint/lib/utils/checkAgainstRule.js new file mode 100644 index 000000000..8d72ef2ab --- /dev/null +++ b/node_modules/stylelint/lib/utils/checkAgainstRule.js @@ -0,0 +1,57 @@ +'use strict'; + +const Result = require('postcss/lib/result').default; + +const normalizeRuleSettings = require('../normalizeRuleSettings'); +const { isPlainObject } = require('./validateTypes'); +const getStylelintRule = require('./getStylelintRule'); + +/** + * @type {import('stylelint').Utils['checkAgainstRule']} + */ +module.exports = function checkAgainstRule(options, callback) { + if (!isPlainObject(options)) throw new Error('Expected an options object'); + + if (!callback) throw new Error('Expected a callback function'); + + const { ruleName, ruleSettings, root, result, context = {} } = options; + + if (!ruleName) throw new Error('Expected a "ruleName" option'); + + const rule = getStylelintRule(ruleName, result && result.stylelint.config); + + if (!rule) throw new Error(`Rule "${ruleName}" does not exist`); + + if (!ruleSettings) throw new Error('Expected a "ruleSettings" option'); + + if (!root) throw new Error('Expected a "root" option'); + + const settings = normalizeRuleSettings(ruleSettings, rule); + + if (!settings) { + return; + } + + const tmpPostcssResult = new Result( + // NOTE: The first argument is unused, so passing `undefined` raises no problems. + // But this PostCSS's behavior may change in the future. + // @ts-expect-error -- TS2345: Argument of type 'undefined' is not assignable to parameter of type 'Processor'. + undefined, + undefined, + undefined, + ); + + const [primary, secondary] = settings; + const ruleFunc = rule(primary, secondary || {}, context); + + ruleFunc( + root, + + // NOTE: This temporary PostCSS result doesn't have a property for Stylelint use. + // Problems may occur if some rules use the property. + // @ts-expect-error -- TS2345: Argument of type 'Result' is not assignable to parameter of type 'PostcssResult'. + tmpPostcssResult, + ); + + for (const warning of tmpPostcssResult.warnings()) callback(warning); +}; diff --git a/node_modules/stylelint/lib/utils/checkInvalidCLIOptions.js b/node_modules/stylelint/lib/utils/checkInvalidCLIOptions.js new file mode 100644 index 000000000..2ef66bfb0 --- /dev/null +++ b/node_modules/stylelint/lib/utils/checkInvalidCLIOptions.js @@ -0,0 +1,104 @@ +'use strict'; + +const EOL = require('os').EOL; +const levenshtein = require('fastest-levenshtein'); +const { red, cyan } = require('picocolors'); + +/** + * @param {{ [key: string]: { alias?: string } }} allowedOptions + * @return {string[]} + */ +const buildAllowedOptions = (allowedOptions) => { + const options = Object.keys(allowedOptions); + + for (const { alias } of Object.values(allowedOptions)) { + if (alias) { + options.push(alias); + } + } + + options.sort(); + + return options; +}; + +/** + * @param {string[]} all + * @param {string} invalid + * @return {null|string} + */ +const suggest = (all, invalid) => { + const maxThreshold = 10; + + for (let threshold = 1; threshold <= maxThreshold; threshold++) { + const suggestion = all.find((option) => levenshtein.distance(option, invalid) <= threshold); + + if (suggestion) { + return suggestion; + } + } + + return null; +}; + +/** + * Converts a string to kebab case. + * For example, `kebabCase('oneTwoThree') === 'one-two-three'`. + * @param {string} opt + * @returns {string} + */ +const kebabCase = (opt) => { + const matches = opt.match(/[A-Z]?[a-z]+|[A-Z]|[0-9]+/g); + + if (matches) { + return matches.map((s) => s.toLowerCase()).join('-'); + } + + return ''; +}; + +/** + * @param {string} opt + * @return {string} + */ +const cliOption = (opt) => { + if (opt.length === 1) { + return `"-${opt}"`; + } + + return `"--${kebabCase(opt)}"`; +}; + +/** + * @param {string} invalid + * @param {string|null} suggestion + * @return {string} + */ +const buildMessageLine = (invalid, suggestion) => { + let line = `Invalid option ${red(cliOption(invalid))}.`; + + if (suggestion) { + line += ` Did you mean ${cyan(cliOption(suggestion))}?`; + } + + return line + EOL; +}; + +/** + * @param {{ [key: string]: any }} allowedOptions + * @param {{ [key: string]: any }} inputOptions + * @return {string} + */ +module.exports = function checkInvalidCLIOptions(allowedOptions, inputOptions) { + const allOptions = buildAllowedOptions(allowedOptions); + + return Object.keys(inputOptions) + .filter((opt) => !allOptions.includes(opt)) + .map((opt) => kebabCase(opt)) + .reduce((msg, invalid) => { + // NOTE: No suggestion for shortcut options because it's too difficult + const suggestion = invalid.length >= 2 ? suggest(allOptions, invalid) : null; + + return msg + buildMessageLine(invalid, suggestion); + }, ''); +}; diff --git a/node_modules/stylelint/lib/utils/configurationComment.js b/node_modules/stylelint/lib/utils/configurationComment.js new file mode 100644 index 000000000..035809464 --- /dev/null +++ b/node_modules/stylelint/lib/utils/configurationComment.js @@ -0,0 +1,73 @@ +'use strict'; + +const { assertString } = require('./validateTypes'); + +const DISABLE_COMMAND = '-disable'; +const DISABLE_LINE_COMMAND = '-disable-line'; +const DISABLE_NEXT_LINE_COMMAND = '-disable-next-line'; +const ENABLE_COMMAND = '-enable'; + +const ALL_COMMANDS = new Set([ + DISABLE_COMMAND, + DISABLE_LINE_COMMAND, + DISABLE_NEXT_LINE_COMMAND, + ENABLE_COMMAND, +]); + +const DEFAULT_CONFIGURATION_COMMENT = 'stylelint'; + +/** @typedef {import('postcss').Comment} Comment */ + +/** + * Extract a command from a given comment. + * + * @param {Comment} comment + * @param {string} [configurationComment] + * @returns {string} + */ +function extractConfigurationComment( + comment, + configurationComment = DEFAULT_CONFIGURATION_COMMENT, +) { + const [command] = comment.text.split(/\s/, 1); + + assertString(command); + + return command.replace(configurationComment, ''); +} + +/** + * Tests if the given comment is a Stylelint command. + * + * @param {Comment} comment + * @param {string} [configurationComment] + * @returns {boolean} + */ +function isConfigurationComment(comment, configurationComment = DEFAULT_CONFIGURATION_COMMENT) { + const command = extractConfigurationComment(comment, configurationComment); + + return command !== undefined && ALL_COMMANDS.has(command); +} + +/** + * Get full stylelint command + * + * @param {string} command + * @param {string} [configurationComment] + * @returns {string} + */ +function getConfigurationComment(command, configurationComment = DEFAULT_CONFIGURATION_COMMENT) { + return `${configurationComment}${command}`; +} + +module.exports = { + DEFAULT_CONFIGURATION_COMMENT, + DISABLE_COMMAND, + DISABLE_LINE_COMMAND, + DISABLE_NEXT_LINE_COMMAND, + ENABLE_COMMAND, + + extractConfigurationComment, + getConfigurationComment, + isConfigurationComment, +}; diff --git a/node_modules/stylelint/lib/utils/configurationError.js b/node_modules/stylelint/lib/utils/configurationError.js new file mode 100644 index 000000000..2d662ba06 --- /dev/null +++ b/node_modules/stylelint/lib/utils/configurationError.js @@ -0,0 +1,17 @@ +'use strict'; + +/** @typedef {Error & { code: number }} ConfigurationError */ + +/** + * Create configurationError from text and set CLI exit code. + * + * @param {string} text + * @returns {ConfigurationError} + */ +module.exports = function configurationError(text) { + const err = /** @type {ConfigurationError} */ (new Error(text)); + + err.code = 78; + + return err; +}; diff --git a/node_modules/stylelint/lib/utils/containsString.js b/node_modules/stylelint/lib/utils/containsString.js new file mode 100644 index 000000000..7ee37c4d7 --- /dev/null +++ b/node_modules/stylelint/lib/utils/containsString.js @@ -0,0 +1,54 @@ +'use strict'; + +const { isString } = require('./validateTypes'); + +/** @typedef {false | { match: string, pattern: string, substring: string }} ReturnValue */ + +/** + * Checks if a string contains a value. The comparison value can be a string or + * an array of strings. + * + * Any strings starting and ending with `/` are ignored. Use the + * matchesStringOrRegExp() util to match regexes. + * + * @template {unknown} T + * @param {string} input + * @param {T | T[]} comparison + * @returns {ReturnValue} + */ +module.exports = function containsString(input, comparison) { + if (!Array.isArray(comparison)) { + return testAgainstString(input, comparison); + } + + for (const comparisonItem of comparison) { + const testResult = testAgainstString(input, comparisonItem); + + if (testResult) { + return testResult; + } + } + + return false; +}; + +/** + * @param {string} value + * @param {unknown} comparison + * @returns {ReturnValue} + */ +function testAgainstString(value, comparison) { + if (!comparison) return false; + + if (!isString(comparison)) return false; + + if (comparison.startsWith('/') && comparison.endsWith('/')) { + return false; + } + + if (value.includes(comparison)) { + return { match: value, pattern: comparison, substring: comparison }; + } + + return false; +} diff --git a/node_modules/stylelint/lib/utils/createMapWithSet.js b/node_modules/stylelint/lib/utils/createMapWithSet.js new file mode 100644 index 000000000..37c26910f --- /dev/null +++ b/node_modules/stylelint/lib/utils/createMapWithSet.js @@ -0,0 +1,21 @@ +'use strict'; + +/** + * Create a map with unique sets of values from a record. + * + * @template T + * @param {Record} record + * @returns {Map>} + */ +module.exports = function createMapWithSet(record) { + /** @type {Map>} */ + const map = new Map(); + + for (const [key, value] of Object.entries(record)) { + const list = Array.isArray(value) ? value : [value]; + + map.set(key, new Set(list)); + } + + return map; +}; diff --git a/node_modules/stylelint/lib/utils/declarationValueIndex.js b/node_modules/stylelint/lib/utils/declarationValueIndex.js new file mode 100644 index 000000000..308c305ea --- /dev/null +++ b/node_modules/stylelint/lib/utils/declarationValueIndex.js @@ -0,0 +1,28 @@ +'use strict'; + +const { isObject, isString } = require('./validateTypes'); + +/** + * Get the index of a declaration's value + * + * @param {import('postcss').Declaration} decl + * @returns {number} + */ +module.exports = function declarationValueIndex(decl) { + const raws = decl.raws; + const prop = raws.prop; + + return [ + isObject(prop) && 'prefix' in prop && prop.prefix, + (isObject(prop) && 'raw' in prop && prop.raw) || decl.prop, + isObject(prop) && 'suffix' in prop && prop.suffix, + raws.between || ':', + raws.value && 'prefix' in raws.value && raws.value.prefix, + ].reduce((/** @type {number} */ count, str) => { + if (isString(str)) { + return count + str.length; + } + + return count; + }, 0); +}; diff --git a/node_modules/stylelint/lib/utils/eachDeclarationBlock.js b/node_modules/stylelint/lib/utils/eachDeclarationBlock.js new file mode 100644 index 000000000..25f2b6930 --- /dev/null +++ b/node_modules/stylelint/lib/utils/eachDeclarationBlock.js @@ -0,0 +1,61 @@ +'use strict'; + +const { isRoot, isAtRule, isRule } = require('./typeGuards'); + +/** @typedef {import('postcss').Root} Root */ +/** @typedef {import('postcss').Root} Document */ +/** @typedef {import('postcss').Node} PostcssNode */ +/** @typedef {import('postcss').Container} PostcssContainerNode */ +/** @typedef {import('postcss').Declaration} Declaration */ +/** @typedef {(callbackFn: (decl: Declaration, index: number, decls: Declaration[]) => void) => void} EachDeclaration */ + +/** + * @param {PostcssNode} node + * @returns {node is PostcssContainerNode} + */ +function isContainerNode(node) { + return isRule(node) || isAtRule(node) || isRoot(node); +} + +/** + * In order to accommodate nested blocks (postcss-nested), + * we need to run a shallow loop (instead of eachDecl() or eachRule(), + * which loop recursively) and allow each nested block to accumulate + * its own list of properties -- so that a property in a nested rule + * does not conflict with the same property in the parent rule + * executes a provided function once for each declaration block. + * + * @param {Root | Document} root - root element of file. + * @param {(eachDecl: EachDeclaration) => void} callback - Function to execute for each declaration block + * + * @returns {void} + */ +module.exports = function eachDeclarationBlock(root, callback) { + /** + * @param {PostcssNode} statement + * + * @returns {void} + */ + function each(statement) { + if (!isContainerNode(statement)) return; + + if (statement.nodes && statement.nodes.length) { + /** @type {Declaration[]} */ + const decls = []; + + for (const node of statement.nodes) { + if (node.type === 'decl') { + decls.push(node); + } + + each(node); + } + + if (decls.length) { + callback(decls.forEach.bind(decls)); + } + } + } + + each(root); +}; diff --git a/node_modules/stylelint/lib/utils/filterFilePaths.js b/node_modules/stylelint/lib/utils/filterFilePaths.js new file mode 100644 index 000000000..2055a558b --- /dev/null +++ b/node_modules/stylelint/lib/utils/filterFilePaths.js @@ -0,0 +1,19 @@ +'use strict'; + +const { isPathValid } = require('ignore').default; + +/** + * @param {import('ignore').Ignore} ignorer + * @param {string[]} filePaths + * @returns {string[]} + */ +module.exports = function filterFilePaths(ignorer, filePaths) { + const validForIgnore = filePaths.filter(isPathValid); + // Paths which starts with `..` are not valid for `ignore`, e. g. `../style.css` + const notValidForIgnore = new Set(filePaths.filter((p) => !validForIgnore.includes(p))); + + const filteredByIgnore = new Set(ignorer.filter(validForIgnore)); + + // Preserving files order, while removing paths which were filtered by `ignore` + return filePaths.filter((p) => notValidForIgnore.has(p) || filteredByIgnore.has(p)); +}; diff --git a/node_modules/stylelint/lib/utils/findAnimationName.js b/node_modules/stylelint/lib/utils/findAnimationName.js new file mode 100644 index 000000000..d74325544 --- /dev/null +++ b/node_modules/stylelint/lib/utils/findAnimationName.js @@ -0,0 +1,75 @@ +'use strict'; + +const getDimension = require('./getDimension'); +const isStandardSyntaxValue = require('./isStandardSyntaxValue'); +const isVariable = require('./isVariable'); +const { animationShorthandKeywords, basicKeywords } = require('../reference/keywords'); +const postcssValueParser = require('postcss-value-parser'); + +/** @typedef {import('postcss-value-parser').Node} Node */ + +/** + * Get the animation name within an `animation` shorthand property value. + * + * @param {string} value + * + * @returns {Node[]} + */ +module.exports = function findAnimationName(value) { + /** @type {Node[]} */ + const animationNames = []; + + const valueNodes = postcssValueParser(value); + const { nodes } = valueNodes; + + // Handle `inherit`, `initial` and etc + if (nodes.length === 1 && nodes[0] && basicKeywords.has(nodes[0].value.toLowerCase())) { + return [nodes[0]]; + } + + let shouldBeIgnored = false; + + valueNodes.walk((valueNode) => { + if (shouldBeIgnored) return; + + if (valueNode.type === 'function') { + return false; + } + + if (valueNode.type !== 'word') { + return; + } + + const valueLowerCase = valueNode.value.toLowerCase(); + + // Ignore non-standard syntax + if (!isStandardSyntaxValue(valueLowerCase)) { + // Cannot find animation name if shorthand has non-standard syntax value (#5532) + shouldBeIgnored = true; + animationNames.length = 0; // clears animationNames + + return; + } + + // Ignore variables + if (isVariable(valueLowerCase)) { + return; + } + + // Ignore keywords for other animation parts + if (animationShorthandKeywords.has(valueLowerCase)) { + return; + } + + // Ignore numbers with units + const { unit } = getDimension(valueNode); + + if (unit || unit === '') { + return; + } + + animationNames.push(valueNode); + }); + + return animationNames; +}; diff --git a/node_modules/stylelint/lib/utils/findAtRuleContext.js b/node_modules/stylelint/lib/utils/findAtRuleContext.js new file mode 100644 index 000000000..08f2dba29 --- /dev/null +++ b/node_modules/stylelint/lib/utils/findAtRuleContext.js @@ -0,0 +1,29 @@ +'use strict'; + +const { isAtRule, isRule } = require('./typeGuards'); + +/** + * Find the at-rule in which a rule is nested. + * + * Returns `null` if the rule is not nested within an at-rule. + * + * @param {import('postcss').Rule} rule + * @returns {null | import('postcss').AtRule} + */ +module.exports = function findAtRuleContext(rule) { + const parent = rule.parent; + + if (!parent) { + return null; + } + + if (isAtRule(parent)) { + return parent; + } + + if (isRule(parent)) { + return findAtRuleContext(parent); + } + + return null; +}; diff --git a/node_modules/stylelint/lib/utils/findFontFamily.js b/node_modules/stylelint/lib/utils/findFontFamily.js new file mode 100644 index 000000000..a19260d1e --- /dev/null +++ b/node_modules/stylelint/lib/utils/findFontFamily.js @@ -0,0 +1,130 @@ +'use strict'; + +const postcssValueParser = require('postcss-value-parser'); + +const isNumbery = require('./isNumbery'); +const isStandardSyntaxValue = require('./isStandardSyntaxValue'); +const isValidFontSize = require('./isValidFontSize'); +const isVariable = require('./isVariable'); +const { assert } = require('./validateTypes'); +const { + basicKeywords, + fontFamilyKeywords, + fontShorthandKeywords, +} = require('../reference/keywords'); + +const nodeTypesToCheck = new Set(['word', 'string', 'space', 'div']); + +/** @typedef {import('postcss-value-parser').Node} Node */ + +/** + * + * @param {Node} firstNode + * @param {Node} secondNode + * @param {string | null} charactersBetween + * + * @returns {Node} + */ +function joinValueNodes(firstNode, secondNode, charactersBetween) { + firstNode.value = firstNode.value + charactersBetween + secondNode.value; + + return firstNode; +} + +/** + * Get the font-families within a `font` shorthand property value. + * + * @param {string} value + * @returns {Node[]} Collection font-family nodes + */ +module.exports = function findFontFamily(value) { + /** @type {Node[]} */ + const fontFamilies = []; + + const valueNodes = postcssValueParser(value); + const { nodes: children } = valueNodes; + + // Handle `inherit`, `initial` and etc + if (children.length === 1 && children[0] && basicKeywords.has(children[0].value.toLowerCase())) { + return [children[0]]; + } + + let needMergeNodesByValue = false; + /** @type {string | null} */ + let mergeCharacters = null; + + valueNodes.walk((valueNode, index, nodes) => { + if (valueNode.type === 'function') { + return false; + } + + if (!nodeTypesToCheck.has(valueNode.type)) { + return; + } + + const valueLowerCase = valueNode.value.toLowerCase(); + + // Ignore non standard syntax + if (!isStandardSyntaxValue(valueLowerCase)) { + return; + } + + // Ignore variables + if (isVariable(valueLowerCase)) { + return; + } + + // Ignore keywords for other font parts + if (fontShorthandKeywords.has(valueLowerCase) && !fontFamilyKeywords.has(valueLowerCase)) { + return; + } + + // Ignore font-sizes + if (isValidFontSize(valueNode.value)) { + return; + } + + const prevNode = nodes[index - 1]; + const prevPrevNode = nodes[index - 2]; + + // Ignore anything come after a /, because it's a line-height + if (prevNode && prevNode.value === '/' && prevPrevNode && isValidFontSize(prevPrevNode.value)) { + return; + } + + // Ignore number values + if (isNumbery(valueLowerCase)) { + return; + } + + // Detect when a space or comma is dividing a list of font-families, and save the joining character. + if ( + (valueNode.type === 'space' || (valueNode.type === 'div' && valueNode.value !== ',')) && + fontFamilies.length !== 0 + ) { + needMergeNodesByValue = true; + mergeCharacters = valueNode.value; + + return; + } + + if (valueNode.type === 'space' || valueNode.type === 'div') { + return; + } + + const fontFamily = valueNode; + + if (needMergeNodesByValue) { + const lastFontFamily = fontFamilies[fontFamilies.length - 1]; + + assert(lastFontFamily); + joinValueNodes(lastFontFamily, fontFamily, mergeCharacters); + needMergeNodesByValue = false; + mergeCharacters = null; + } else { + fontFamilies.push(fontFamily); + } + }); + + return fontFamilies; +}; diff --git a/node_modules/stylelint/lib/utils/findMediaFeatureNames.js b/node_modules/stylelint/lib/utils/findMediaFeatureNames.js new file mode 100644 index 000000000..cee19e39c --- /dev/null +++ b/node_modules/stylelint/lib/utils/findMediaFeatureNames.js @@ -0,0 +1,144 @@ +'use strict'; + +const { TokenType, isToken, stringify, tokenize } = require('@csstools/css-tokenizer'); +const { + isTokenNode, + parseCommaSeparatedListOfComponentValues, + isSimpleBlockNode, +} = require('@csstools/css-parser-algorithms'); +const { + isGeneralEnclosed, + isMediaFeature, + isMediaQueryInvalid, + parseFromTokens, +} = require('@csstools/media-query-list-parser'); + +/** @typedef {Array} MediaQueryList */ +/** @typedef {import('@csstools/css-tokenizer').TokenIdent} TokenIdent */ +/** @typedef {{ stringify: () => string }} MediaQuerySerializer */ + +const rangeFeatureOperator = /[<>=]/; + +/** + * Search a CSS string for Media Feature names. + * For every found name, invoke the callback, passing the token + * as an argument. + * + * Found tokens are mutable and modifications made to them will be reflected in the output. + * + * This function supports some non-standard syntaxes like SCSS variables and interpolation. + * + * @param {string} mediaQueryParams + * @param {(mediaFeatureName: TokenIdent) => void} callback + * + * @returns {MediaQuerySerializer} + */ +module.exports = function findMediaFeatureNames(mediaQueryParams, callback) { + const tokens = tokenize({ css: mediaQueryParams }); + const list = parseCommaSeparatedListOfComponentValues(tokens); + + const mediaQueryConditions = list.flatMap((listItem) => { + return listItem.flatMap((componentValue) => { + if ( + !isSimpleBlockNode(componentValue) || + componentValue.startToken[0] !== TokenType.OpenParen + ) { + return []; + } + + const blockTokens = componentValue.tokens(); + + const mediaQueryList = parseFromTokens(blockTokens, { + preserveInvalidMediaQueries: true, + }); + + return mediaQueryList.filter((mediaQuery) => { + return !isMediaQueryInvalid(mediaQuery); + }); + }); + }); + + mediaQueryConditions.forEach((mediaQuery) => { + mediaQuery.walk(({ node }) => { + if (isMediaFeature(node)) { + const token = node.getNameToken(); + + if (token[0] !== TokenType.Ident) return; + + callback(token); + } + + if (isGeneralEnclosed(node)) { + topLevelTokenNodes(node).forEach((token, i, topLevelTokens) => { + if (token[0] !== TokenType.Ident) { + return; + } + + const nextToken = topLevelTokens[i + 1]; + const prevToken = topLevelTokens[i - 1]; + + if ( + // Media Feature + (!prevToken && nextToken && nextToken[0] === TokenType.Colon) || + // Range Feature + (nextToken && + nextToken[0] === TokenType.Delim && + rangeFeatureOperator.test(nextToken[4].value)) || + // Range Feature + (prevToken && + prevToken[0] === TokenType.Delim && + rangeFeatureOperator.test(prevToken[4].value)) + ) { + callback(token); + } + }); + } + }); + }); + + // Serializing takes time/resources and not all callers will use this. + // By returning an object with a stringify method, we can avoid doing + // this work when it's not needed. + return { + stringify() { + return stringify(...tokens); + }, + }; +}; + +/** @param {import('@csstools/media-query-list-parser').GeneralEnclosed} node */ +function topLevelTokenNodes(node) { + const components = node.value.value; + + if (isToken(components) || components.length === 0 || isToken(components[0])) { + return []; + } + + /** @type {Array} */ + const relevantTokens = []; + + // To consume the next token if it is a scss variable + let lastWasDollarSign = false; + + components.forEach((component) => { + // Only preserve top level tokens (idents, delims, ...) + // Discard all blocks, functions, ... + if (component && isTokenNode(component)) { + if (component.value[0] === TokenType.Delim && component.value[4].value === '$') { + lastWasDollarSign = true; + + return; + } + + if (lastWasDollarSign) { + lastWasDollarSign = false; + + return; + } + + relevantTokens.push(component.value); + } + }); + + return relevantTokens; +} diff --git a/node_modules/stylelint/lib/utils/functionArgumentsSearch.js b/node_modules/stylelint/lib/utils/functionArgumentsSearch.js new file mode 100644 index 000000000..cfec24284 --- /dev/null +++ b/node_modules/stylelint/lib/utils/functionArgumentsSearch.js @@ -0,0 +1,43 @@ +'use strict'; + +const balancedMatch = require('balanced-match'); +const valueParser = require('postcss-value-parser'); + +const { assert, isString, isRegExp } = require('./validateTypes'); + +/** + * Search a CSS string for functions by name. + * For every match, invoke the callback, passing the function's + * "argument(s) string" (whatever is inside the parentheses) + * as an argument. + * + * Callback will be called once for every matching function found, + * with the function's "argument(s) string" and its starting index + * as the arguments. + * + * @param {string} source + * @param {string | RegExp} functionName + * @param {(expression: string, expressionIndex: number, funcNode: valueParser.FunctionNode) => void} callback + * @returns {valueParser.ParsedValue} + */ +module.exports = function functionArgumentsSearch(source, functionName, callback) { + return valueParser(source).walk((node) => { + if (node.type !== 'function') return; + + const { value } = node; + + if (isString(functionName) && value !== functionName) return; + + if (isRegExp(functionName) && !functionName.test(node.value)) return; + + const parensMatch = balancedMatch('(', ')', source.slice(node.sourceIndex)); + + assert(parensMatch); + + const expression = parensMatch.body; + const parenLength = 1; // == '(' + const expressionIndex = node.sourceIndex + value.length + parenLength; + + callback(expression, expressionIndex, node); + }); +}; diff --git a/node_modules/stylelint/lib/utils/getAtRuleParams.js b/node_modules/stylelint/lib/utils/getAtRuleParams.js new file mode 100644 index 000000000..93f5ad0b8 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getAtRuleParams.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * @param {import('postcss').AtRule} atRule + * @returns {string} + */ +module.exports = function getAtRuleParams(atRule) { + return atRule.raws.params?.raw ?? atRule.params; +}; diff --git a/node_modules/stylelint/lib/utils/getCacheFile.js b/node_modules/stylelint/lib/utils/getCacheFile.js new file mode 100644 index 000000000..08d91a369 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getCacheFile.js @@ -0,0 +1,52 @@ +'use strict'; + +const fs = require('fs'); +const hash = require('./hash'); +const path = require('path'); + +/** + * Return the cacheFile to be used by stylelint, based on whether the provided parameter is + * a directory or looks like a directory (ends in `path.sep`), in which case the file + * name will be `cacheFile/.cache_hashOfCWD`. + * + * If cacheFile points to a file or looks like a file, then it will just use that file. + * + * @param {string} cacheFile - The name of file to be used to store the cache + * @param {string} cwd - Current working directory. Used for tests + * @returns {string} Resolved path to the cache file + */ +module.exports = function getCacheFile(cacheFile, cwd) { + /* + * Make sure path separators are normalized for environment/os. + * Also, keep trailing path separator if present. + */ + cacheFile = path.normalize(cacheFile); + + const resolvedCacheFile = path.resolve(cwd, cacheFile); + // If the last character passed is a path separator, we assume is a directory. + const looksLikeADirectory = cacheFile[cacheFile.length - 1] === path.sep; + + /** + * Return the default cache file name when provided parameter is a directory. + * @returns {string} - Resolved path to the cacheFile + */ + function getCacheFileForDirectory() { + return path.join(resolvedCacheFile, `.stylelintcache_${hash(cwd)}`); + } + + let fileStats; + + try { + fileStats = fs.lstatSync(resolvedCacheFile); + } catch { + fileStats = null; + } + + if (looksLikeADirectory || (fileStats && fileStats.isDirectory())) { + // Return path to provided directory with generated file name. + return getCacheFileForDirectory(); + } + + // Return normalized path to cache file. + return resolvedCacheFile; +}; diff --git a/node_modules/stylelint/lib/utils/getDeclarationValue.js b/node_modules/stylelint/lib/utils/getDeclarationValue.js new file mode 100644 index 000000000..f6ff980f7 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getDeclarationValue.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * @param {import('postcss').Declaration} decl + * @returns {string} + */ +module.exports = function getDeclarationValue(decl) { + const raws = decl.raws; + + return (raws.value && raws.value.raw) || decl.value; +}; diff --git a/node_modules/stylelint/lib/utils/getDimension.js b/node_modules/stylelint/lib/utils/getDimension.js new file mode 100644 index 000000000..2cacd79f1 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getDimension.js @@ -0,0 +1,63 @@ +'use strict'; + +const blurInterpolation = require('./blurInterpolation'); +const isStandardSyntaxValue = require('./isStandardSyntaxValue'); +const valueParser = require('postcss-value-parser'); + +/** + * Get Dimension from value node; + * `unit` and `number` return null if neither is found + * + * @param {import('postcss-value-parser').Node} node + * + * @returns {{unit: null, number: null} | valueParser.Dimension} + */ +module.exports = function getDimension(node) { + if (!node || !node.value) { + return { + unit: null, + number: null, + }; + } + + // Ignore non-word nodes + if (node.type !== 'word') { + return { + unit: null, + number: null, + }; + } + + // Ignore non standard syntax + if (!isStandardSyntaxValue(node.value)) { + return { + unit: null, + number: null, + }; + } + + // Ignore HEX + if (node.value.startsWith('#')) { + return { + unit: null, + number: null, + }; + } + + // Remove non standard stuff + const value = blurInterpolation(node.value, '') + // ignore hack unit + .replace('\\0', '') + .replace('\\9', ''); + + const parsedUnit = valueParser.unit(value); + + if (!parsedUnit) { + return { + unit: null, + number: null, + }; + } + + return parsedUnit; +}; diff --git a/node_modules/stylelint/lib/utils/getFileIgnorer.js b/node_modules/stylelint/lib/utils/getFileIgnorer.js new file mode 100644 index 000000000..6c22ab48f --- /dev/null +++ b/node_modules/stylelint/lib/utils/getFileIgnorer.js @@ -0,0 +1,43 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const { default: ignore } = require('ignore'); + +const { DEFAULT_IGNORE_FILENAME } = require('../constants'); +const isPathNotFoundError = require('./isPathNotFoundError'); + +/** + * @typedef {import('stylelint').LinterOptions} LinterOptions + * + * @param {Pick & { cwd: string }} options + * @return {import('ignore').Ignore} + */ +module.exports = function getFileIgnorer({ ignorePath, ignorePattern, cwd }) { + const ignorer = ignore(); + const ignorePaths = [ignorePath || []].flat(); + + if (ignorePaths.length === 0) { + ignorePaths.push(DEFAULT_IGNORE_FILENAME); + } + + for (const ignoreFilePath of ignorePaths) { + const absoluteIgnoreFilePath = path.isAbsolute(ignoreFilePath) + ? ignoreFilePath + : path.resolve(cwd, ignoreFilePath); + + try { + const ignoreText = fs.readFileSync(absoluteIgnoreFilePath, 'utf8'); + + ignorer.add(ignoreText); + } catch (readError) { + if (!isPathNotFoundError(readError)) { + throw readError; + } + } + } + + if (ignorePattern) ignorer.add(ignorePattern); + + return ignorer; +}; diff --git a/node_modules/stylelint/lib/utils/getFormatterOptionsText.js b/node_modules/stylelint/lib/utils/getFormatterOptionsText.js new file mode 100644 index 000000000..c2f0a1374 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getFormatterOptionsText.js @@ -0,0 +1,14 @@ +'use strict'; + +const formatters = require('../formatters'); + +/** + * @param {string} separator + * @param {string} [quote] + * @returns {string} + */ +module.exports = function getFormatterOptionsText(separator, quote = '') { + return Object.keys(formatters) + .map((name) => `${quote}${name}${quote}`) + .join(separator); +}; diff --git a/node_modules/stylelint/lib/utils/getImportantPosition.js b/node_modules/stylelint/lib/utils/getImportantPosition.js new file mode 100644 index 000000000..be52d5958 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getImportantPosition.js @@ -0,0 +1,17 @@ +'use strict'; + +/** + * Returns a position of `!important` (or `! important` including whitespaces) + * from the specified CSS source code. If not found, returns `undefined`. + * + * @param {string} source + * @returns {{ index: number, endIndex: number } | undefined} + */ +module.exports = function getImportantPosition(source) { + const pattern = /!\s*important\b/gi; + const match = pattern.exec(source); + + if (!match) return; + + return { index: match.index, endIndex: pattern.lastIndex }; +}; diff --git a/node_modules/stylelint/lib/utils/getModulePath.js b/node_modules/stylelint/lib/utils/getModulePath.js new file mode 100644 index 000000000..873b7a9e6 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getModulePath.js @@ -0,0 +1,34 @@ +'use strict'; + +const configurationError = require('./configurationError'); +const globalModules = require('global-modules'); +const resolveFrom = require('resolve-from'); + +/** + * @param {string} basedir + * @param {string} lookup + * @param {string} [cwd] + * @return {string} + */ +module.exports = function getModulePath(basedir, lookup, cwd = process.cwd()) { + // 1. Try to resolve from the provided directory + // 2. Try to resolve from `cwd` or `process.cwd()` + // 3. Try to resolve from global `node_modules` directory + let path = resolveFrom.silent(basedir, lookup); + + if (!path) { + path = resolveFrom.silent(cwd, lookup); + } + + if (!path) { + path = resolveFrom.silent(globalModules, lookup); + } + + if (!path) { + throw configurationError( + `Could not find "${lookup}". Do you need the "configBasedir" or "--config-basedir" option?`, + ); + } + + return path; +}; diff --git a/node_modules/stylelint/lib/utils/getNextNonSharedLineCommentNode.js b/node_modules/stylelint/lib/utils/getNextNonSharedLineCommentNode.js new file mode 100644 index 000000000..c93cd9190 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getNextNonSharedLineCommentNode.js @@ -0,0 +1,36 @@ +'use strict'; + +/** @typedef {import('postcss').Node} Node */ + +/** + * @param {Node | void} node + */ +function getNodeLine(node) { + return node && node.source && node.source.start && node.source.start.line; +} + +/** + * @param {Node | void} node + * @returns {Node | void} + */ +module.exports = function getNextNonSharedLineCommentNode(node) { + if (node === undefined) { + return undefined; + } + + /** @type {Node | void} */ + const nextNode = node.next(); + + if (!nextNode || nextNode.type !== 'comment') { + return nextNode; + } + + if ( + getNodeLine(node) === getNodeLine(nextNode) || + getNodeLine(nextNode) === getNodeLine(nextNode.next()) + ) { + return getNextNonSharedLineCommentNode(nextNode); + } + + return nextNode; +}; diff --git a/node_modules/stylelint/lib/utils/getOsEol.js b/node_modules/stylelint/lib/utils/getOsEol.js new file mode 100644 index 000000000..6303f0b18 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getOsEol.js @@ -0,0 +1,11 @@ +'use strict'; + +const os = require('os'); + +// This function simply provides roundabout way of getting os.EOL +// so we can mock this for Jest tests +function getOsEl() { + return os.EOL; +} + +module.exports = getOsEl; diff --git a/node_modules/stylelint/lib/utils/getPreviousNonSharedLineCommentNode.js b/node_modules/stylelint/lib/utils/getPreviousNonSharedLineCommentNode.js new file mode 100644 index 000000000..6528dd7e3 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getPreviousNonSharedLineCommentNode.js @@ -0,0 +1,38 @@ +'use strict'; + +/** @typedef {import('postcss').Node} Node */ + +/** + * @param {Node} node + */ +function getNodeLine(node) { + return node.source && node.source.start && node.source.start.line; +} + +/** + * @param {Node | undefined} node + * @returns {Node | undefined} + */ +module.exports = function getPreviousNonSharedLineCommentNode(node) { + if (node === undefined) { + return undefined; + } + + const previousNode = node.prev(); + + if (!previousNode || previousNode.type !== 'comment') { + return previousNode; + } + + if (getNodeLine(node) === getNodeLine(previousNode)) { + return getPreviousNonSharedLineCommentNode(previousNode); + } + + const previousNode2 = previousNode.prev(); + + if (previousNode2 && getNodeLine(previousNode) === getNodeLine(previousNode2)) { + return getPreviousNonSharedLineCommentNode(previousNode); + } + + return previousNode; +}; diff --git a/node_modules/stylelint/lib/utils/getRuleSelector.js b/node_modules/stylelint/lib/utils/getRuleSelector.js new file mode 100644 index 000000000..ab84445b3 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getRuleSelector.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * @param {import('postcss').Rule} ruleNode + * @returns {string} + */ +module.exports = function getRuleSelector(ruleNode) { + const raws = ruleNode.raws; + + return (raws.selector && raws.selector.raw) || ruleNode.selector; +}; diff --git a/node_modules/stylelint/lib/utils/getSchemeFromUrl.js b/node_modules/stylelint/lib/utils/getSchemeFromUrl.js new file mode 100644 index 000000000..fc0d8c6e7 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getSchemeFromUrl.js @@ -0,0 +1,39 @@ +'use strict'; + +const { URL } = require('url'); + +/** + * Get unit from value node + * + * Returns `null` if the unit is not found. + * + * @param {string} urlString + */ +module.exports = function getSchemeFromUrl(urlString) { + let protocol = null; + + try { + protocol = new URL(urlString).protocol; + } catch { + return null; + } + + if (protocol === null || typeof protocol === 'undefined') { + return null; + } + + const scheme = protocol.slice(0, -1); // strip trailing `:` + + // The URL spec does not require a scheme to be followed by `//`, but checking + // for it allows this rule to differentiate : urls from + // : urls. `data:` scheme urls are an exception to this rule. + const slashIndex = protocol.length; + const expectedSlashes = urlString.slice(slashIndex, slashIndex + 2); + const isSchemeLessUrl = expectedSlashes !== '//' && scheme !== 'data'; + + if (isSchemeLessUrl) { + return null; + } + + return scheme; +}; diff --git a/node_modules/stylelint/lib/utils/getStylelintRule.js b/node_modules/stylelint/lib/utils/getStylelintRule.js new file mode 100644 index 000000000..401cf5a52 --- /dev/null +++ b/node_modules/stylelint/lib/utils/getStylelintRule.js @@ -0,0 +1,10 @@ +const rules = require('../rules'); + +/** + * @param {string} ruleName + * @param {import('stylelint').Config | undefined} [config] + * @returns {import('stylelint').Rule | undefined} + */ +module.exports = function getStylelintRule(ruleName, config) { + return rules[ruleName] || (config && config.pluginFunctions && config.pluginFunctions[ruleName]); +}; diff --git a/node_modules/stylelint/lib/utils/hasANPlusBNotationPseudoClasses.js b/node_modules/stylelint/lib/utils/hasANPlusBNotationPseudoClasses.js new file mode 100644 index 000000000..41a367a59 --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasANPlusBNotationPseudoClasses.js @@ -0,0 +1,22 @@ +'use strict'; + +const { + aNPlusBNotationPseudoClasses, + aNPlusBOfSNotationPseudoClasses, +} = require('../reference/selectors'); + +const classes = [ + ...aNPlusBNotationPseudoClasses.values(), + ...aNPlusBOfSNotationPseudoClasses.values(), +].join('|'); +const HAS_A_N_PLUS_B_NOTATION_PSEUDO_CLASSES = new RegExp(`\\b:(?:${classes})\\(`, 'i'); + +/** + * Check if a selector contains any pseudo class function that might contain an An+B notation + * + * @param {string} selector + * @returns {boolean} + */ +module.exports = function hasANPlusBNotationPseudoClasses(selector) { + return HAS_A_N_PLUS_B_NOTATION_PSEUDO_CLASSES.test(selector); +}; diff --git a/node_modules/stylelint/lib/utils/hasBlock.js b/node_modules/stylelint/lib/utils/hasBlock.js new file mode 100644 index 000000000..09e3b1f21 --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasBlock.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Check if a statement has an block (empty or otherwise). + * + * @param {import('postcss').Container} statement + * @return {boolean} True if `statement` has a block (empty or otherwise) + */ +module.exports = function hasBlock(statement) { + return statement.nodes !== undefined; +}; diff --git a/node_modules/stylelint/lib/utils/hasColorFunction.js b/node_modules/stylelint/lib/utils/hasColorFunction.js new file mode 100644 index 000000000..2c6cac09f --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasColorFunction.js @@ -0,0 +1,15 @@ +'use strict'; + +const { colorFunctions } = require('../reference/functions'); + +const HAS_COLOR_FUNCTION = new RegExp(`\\b(?:${[...colorFunctions.values()].join('|')})\\(`, 'i'); + +/** + * Check if a value contains any standard CSS color function + * + * @param {string} value + * @returns {boolean} + */ +module.exports = function hasColorFunction(value) { + return HAS_COLOR_FUNCTION.test(value); +}; diff --git a/node_modules/stylelint/lib/utils/hasDimension.js b/node_modules/stylelint/lib/utils/hasDimension.js new file mode 100644 index 000000000..14d3ea1a6 --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasDimension.js @@ -0,0 +1,13 @@ +'use strict'; + +const HAS_DIMENSION_LIKE_VALUES = /\d[%\w-]/; + +/** + * Check if a value contains any dimension-like values. + * + * @param {string} value + * @returns {boolean} + */ +module.exports = function hasDimension(value) { + return HAS_DIMENSION_LIKE_VALUES.test(value); +}; diff --git a/node_modules/stylelint/lib/utils/hasEmptyBlock.js b/node_modules/stylelint/lib/utils/hasEmptyBlock.js new file mode 100644 index 000000000..eb7076967 --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasEmptyBlock.js @@ -0,0 +1,13 @@ +'use strict'; + +const hasBlock = require('./hasBlock'); + +/** + * Check if a statement has an empty block. + * + * @param {import('postcss').Rule | import('postcss').AtRule} statement - postcss rule or at-rule node + * @return {boolean} True if the statement has a block and it is empty + */ +module.exports = function hasEmptyBlock(statement) { + return hasBlock(statement) && statement.nodes.length === 0; +}; diff --git a/node_modules/stylelint/lib/utils/hasEmptyLine.js b/node_modules/stylelint/lib/utils/hasEmptyLine.js new file mode 100644 index 000000000..64a7898ac --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasEmptyLine.js @@ -0,0 +1,15 @@ +'use strict'; + +const HAS_EMPTY_LINE = /\n[\r\t ]*\n/; + +/** + * Check if a string contains at least one empty line + * + * @param {string | undefined} string + * @returns {boolean} + */ +module.exports = function hasEmptyLine(string) { + if (string === '' || string === undefined) return false; + + return HAS_EMPTY_LINE.test(string); +}; diff --git a/node_modules/stylelint/lib/utils/hasInterpolation.js b/node_modules/stylelint/lib/utils/hasInterpolation.js new file mode 100644 index 000000000..4329a7fc6 --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasInterpolation.js @@ -0,0 +1,26 @@ +'use strict'; + +const hasLessInterpolation = require('../utils/hasLessInterpolation'); +const hasPsvInterpolation = require('../utils/hasPsvInterpolation'); +const hasScssInterpolation = require('../utils/hasScssInterpolation'); +const hasTplInterpolation = require('../utils/hasTplInterpolation'); + +/** + * Check whether a string has interpolation + * + * @param {string} string + * @return {boolean} If `true`, a string has interpolation + */ +module.exports = function hasInterpolation(string) { + // SCSS or Less interpolation + if ( + hasLessInterpolation(string) || + hasScssInterpolation(string) || + hasTplInterpolation(string) || + hasPsvInterpolation(string) + ) { + return true; + } + + return false; +}; diff --git a/node_modules/stylelint/lib/utils/hasLessInterpolation.js b/node_modules/stylelint/lib/utils/hasLessInterpolation.js new file mode 100644 index 000000000..8477c706b --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasLessInterpolation.js @@ -0,0 +1,13 @@ +'use strict'; + +const HAS_LESS_INTERPOLATION = /@\{.+?\}/; + +/** + * Check whether a string has less interpolation + * + * @param {string} string + * @return {boolean} If `true`, a string has less interpolation + */ +module.exports = function hasLessInterpolation(string) { + return HAS_LESS_INTERPOLATION.test(string); +}; diff --git a/node_modules/stylelint/lib/utils/hasNamedColor.js b/node_modules/stylelint/lib/utils/hasNamedColor.js new file mode 100644 index 000000000..01f17317f --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasNamedColor.js @@ -0,0 +1,17 @@ +'use strict'; + +const { namedColorsKeywords } = require('../reference/keywords'); + +const HAS_NAMED_COLOR = new RegExp(`\\b(?:${[...namedColorsKeywords.values()].join('|')})\\b`, 'i'); + +/** + * Check if a value contains any standard CSS named color + * + * `transparent` and `currentcolor` are not named colors + * + * @param {string} value + * @returns {boolean} + */ +module.exports = function hasNamedColor(value) { + return HAS_NAMED_COLOR.test(value); +}; diff --git a/node_modules/stylelint/lib/utils/hasPrefix.js b/node_modules/stylelint/lib/utils/hasPrefix.js new file mode 100644 index 000000000..07023ca6d --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasPrefix.js @@ -0,0 +1,15 @@ +'use strict'; + +const { prefixes } = require('../reference/prefixes'); + +const HAS_PREFIX_REGEX = new RegExp(`(?:${[...prefixes].join('|')})`, 'i'); + +/** + * Check if a string contains any prefix + * + * @param {string} string + * @returns {boolean} + */ +module.exports = function hasPrefix(string) { + return HAS_PREFIX_REGEX.test(string); +}; diff --git a/node_modules/stylelint/lib/utils/hasPsvInterpolation.js b/node_modules/stylelint/lib/utils/hasPsvInterpolation.js new file mode 100644 index 000000000..2ab3c9dde --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasPsvInterpolation.js @@ -0,0 +1,12 @@ +'use strict'; + +const HAS_PSV_INTERPOLATION = /\$\(.+?\)/; + +/** + * Check whether a string has postcss-simple-vars interpolation + * + * @param {string} string + */ +module.exports = function hasPsvInterpolation(string) { + return HAS_PSV_INTERPOLATION.test(string); +}; diff --git a/node_modules/stylelint/lib/utils/hasScssInterpolation.js b/node_modules/stylelint/lib/utils/hasScssInterpolation.js new file mode 100644 index 000000000..c2d970fe2 --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasScssInterpolation.js @@ -0,0 +1,12 @@ +'use strict'; + +const HAS_SCSS_INTERPOLATION = /#\{.+?\}/; + +/** + * Check whether a string has scss interpolation + * + * @param {string} string + */ +module.exports = function hasScssInterpolation(string) { + return HAS_SCSS_INTERPOLATION.test(string); +}; diff --git a/node_modules/stylelint/lib/utils/hasTplInterpolation.js b/node_modules/stylelint/lib/utils/hasTplInterpolation.js new file mode 100644 index 000000000..0cd4fbfb9 --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasTplInterpolation.js @@ -0,0 +1,13 @@ +'use strict'; + +const HAS_TPL_INTERPOLATION = /\{.+?\}/; + +/** + * Check whether a string has JS template literal interpolation or HTML-like template + * + * @param {string} string + * @return {boolean} If `true`, a string has template literal interpolation + */ +module.exports = function hasTplInterpolation(string) { + return HAS_TPL_INTERPOLATION.test(string); +}; diff --git a/node_modules/stylelint/lib/utils/hasValidHex.js b/node_modules/stylelint/lib/utils/hasValidHex.js new file mode 100644 index 000000000..f2d5fc33b --- /dev/null +++ b/node_modules/stylelint/lib/utils/hasValidHex.js @@ -0,0 +1,13 @@ +'use strict'; + +const HAS_VALID_HEX = /#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})(?:$|[^\da-f])/i; + +/** + * Check if a value contains a valid 3, 4, 6 or 8 digit hex + * + * @param {string} value + * @returns {boolean} + */ +module.exports = function hasValidHex(value) { + return HAS_VALID_HEX.test(value); +}; diff --git a/node_modules/stylelint/lib/utils/hash.js b/node_modules/stylelint/lib/utils/hash.js new file mode 100644 index 000000000..200578f26 --- /dev/null +++ b/node_modules/stylelint/lib/utils/hash.js @@ -0,0 +1,12 @@ +'use strict'; + +const murmur = require('imurmurhash'); + +/** + * hash the given string + * @param {string} str the string to hash + * @returns {string} the hash + */ +module.exports = function hash(str) { + return murmur(str).result().toString(36); +}; diff --git a/node_modules/stylelint/lib/utils/isAfterComment.js b/node_modules/stylelint/lib/utils/isAfterComment.js new file mode 100644 index 000000000..eb3a8b53b --- /dev/null +++ b/node_modules/stylelint/lib/utils/isAfterComment.js @@ -0,0 +1,16 @@ +'use strict'; + +const isSharedLineComment = require('./isSharedLineComment'); + +/** + * @param {import('postcss').Node} node + */ +module.exports = function isAfterComment(node) { + const previousNode = node.prev(); + + if (!previousNode || previousNode.type !== 'comment') { + return false; + } + + return !isSharedLineComment(previousNode); +}; diff --git a/node_modules/stylelint/lib/utils/isAfterSingleLineComment.js b/node_modules/stylelint/lib/utils/isAfterSingleLineComment.js new file mode 100644 index 000000000..71364a8c0 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isAfterSingleLineComment.js @@ -0,0 +1,22 @@ +'use strict'; + +const isSharedLineComment = require('./isSharedLineComment'); + +/** + * @param {import('postcss').Node} node + */ +function isAfterSingleLineComment(node) { + const prevNode = node.prev(); + + return ( + prevNode !== undefined && + prevNode.type === 'comment' && + !isSharedLineComment(prevNode) && + prevNode.source && + prevNode.source.start && + prevNode.source.end && + prevNode.source.start.line === prevNode.source.end.line + ); +} + +module.exports = isAfterSingleLineComment; diff --git a/node_modules/stylelint/lib/utils/isAfterStandardPropertyDeclaration.js b/node_modules/stylelint/lib/utils/isAfterStandardPropertyDeclaration.js new file mode 100644 index 000000000..e118b4346 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isAfterStandardPropertyDeclaration.js @@ -0,0 +1,20 @@ +'use strict'; + +const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode'); +const isCustomProperty = require('./isCustomProperty'); +const isStandardSyntaxDeclaration = require('./isStandardSyntaxDeclaration'); +const { isDeclaration } = require('./typeGuards'); + +/** + * @param {import('postcss').Node} node + */ +module.exports = function isAfterStandardPropertyDeclaration(node) { + const prevNode = getPreviousNonSharedLineCommentNode(node); + + return ( + prevNode !== undefined && + isDeclaration(prevNode) && + isStandardSyntaxDeclaration(prevNode) && + !isCustomProperty(prevNode.prop || '') + ); +}; diff --git a/node_modules/stylelint/lib/utils/isAutoprefixable.js b/node_modules/stylelint/lib/utils/isAutoprefixable.js new file mode 100644 index 000000000..2e1618b4d --- /dev/null +++ b/node_modules/stylelint/lib/utils/isAutoprefixable.js @@ -0,0 +1,339 @@ +'use strict'; + +const vendor = require('./vendor'); + +/** + * Extract each list using the internal API of Autoprefixer 10.2.5. + * + * @see https://github.com/postcss/autoprefixer/tree/10.2.5 + * + * @example + * const autoprefixer = require('autoprefixer'); + * const Browsers = require('autoprefixer/lib/browsers'); + * const Prefixes = require('autoprefixer/lib/prefixes'); + * const utils = require('autoprefixer/lib/utils'); + * + * const prefixes = new Prefixes(autoprefixer.data.prefixes, new Browsers(autoprefixer.data.browsers, [])); + */ + +/** + * @example + * Object.keys(prefixes.remove).filter((s) => s.startsWith('@')); + */ +const AT_RULES = new Set([ + '@-khtml-keyframes', + '@-moz-keyframes', + '@-ms-keyframes', + '@-ms-viewport', + '@-o-keyframes', + '@-o-viewport', + '@-webkit-keyframes', + '@resolution', +]); + +/** + * @example + * prefixes.remove.selectors.map((s) => s.prefixed); + */ +const SELECTORS = new Set([ + ':-moz-any-link', + ':-moz-full-screen', + ':-moz-placeholder', + ':-moz-placeholder-shown', + ':-moz-read-only', + ':-moz-read-write', + ':-ms-fullscreen', + ':-ms-input-placeholder', + ':-webkit-any-link', + ':-webkit-full-screen', + '::-moz-placeholder', + '::-moz-selection', + '::-ms-input-placeholder', + '::-webkit-backdrop', + '::-webkit-input-placeholder', +]); + +/** + * @example + * Object.entries(autoprefixer.data.prefixes) + * .filter(([key, value]) => !value.selector && !value.props && !key.startsWith('@')) + * .map(([key, value]) => key); + */ +const PROPERTIES = new Set([ + 'align-content', + 'align-items', + 'align-self', + 'animation', + 'animation-delay', + 'animation-direction', + 'animation-duration', + 'animation-fill-mode', + 'animation-iteration-count', + 'animation-name', + 'animation-play-state', + 'animation-timing-function', + 'appearance', + 'backdrop-filter', + 'backface-visibility', + 'background-clip', + 'background-origin', + 'background-size', + 'border-block-end', + 'border-block-start', + 'border-bottom-left-radius', + 'border-bottom-right-radius', + 'border-image', + 'border-inline-end', + 'border-inline-start', + 'border-radius', + 'border-top-left-radius', + 'border-top-right-radius', + 'box-decoration-break', + 'box-shadow', + 'box-sizing', + 'break-after', + 'break-before', + 'break-inside', + 'clip-path', + 'color-adjust', + 'column-count', + 'column-fill', + 'column-gap', + 'column-rule', + 'column-rule-color', + 'column-rule-style', + 'column-rule-width', + 'column-span', + 'column-width', + 'columns', + 'filter', + 'flex', + 'flex-basis', + 'flex-direction', + 'flex-flow', + 'flex-grow', + 'flex-shrink', + 'flex-wrap', + 'flow-from', + 'flow-into', + 'font-feature-settings', + 'font-kerning', + 'font-language-override', + 'font-variant-ligatures', + 'grid-area', + 'grid-column', + 'grid-column-align', + 'grid-column-end', + 'grid-column-start', + 'grid-row', + 'grid-row-align', + 'grid-row-end', + 'grid-row-start', + 'grid-template', + 'grid-template-areas', + 'grid-template-columns', + 'grid-template-rows', + 'hyphens', + 'image-rendering', + 'justify-content', + 'margin-block-end', + 'margin-block-start', + 'margin-inline-end', + 'margin-inline-start', + 'mask', + 'mask-border', + 'mask-border-outset', + 'mask-border-repeat', + 'mask-border-slice', + 'mask-border-source', + 'mask-border-width', + 'mask-clip', + 'mask-composite', + 'mask-image', + 'mask-origin', + 'mask-position', + 'mask-repeat', + 'mask-size', + 'object-fit', + 'object-position', + 'order', + 'overscroll-behavior', + 'padding-block-end', + 'padding-block-start', + 'padding-inline-end', + 'padding-inline-start', + 'perspective', + 'perspective-origin', + 'place-self', + 'region-fragment', + 'scroll-snap-coordinate', + 'scroll-snap-destination', + 'scroll-snap-points-x', + 'scroll-snap-points-y', + 'scroll-snap-type', + 'shape-image-threshold', + 'shape-margin', + 'shape-outside', + 'tab-size', + 'text-align-last', + 'text-decoration', + 'text-decoration-color', + 'text-decoration-line', + 'text-decoration-skip', + 'text-decoration-skip-ink', + 'text-decoration-style', + 'text-emphasis', + 'text-emphasis-color', + 'text-emphasis-position', + 'text-emphasis-style', + 'text-orientation', + 'text-overflow', + 'text-size-adjust', + 'text-spacing', + 'touch-action', + 'transform', + 'transform-origin', + 'transform-style', + 'transition', + 'transition-delay', + 'transition-duration', + 'transition-property', + 'transition-timing-function', + 'user-select', + 'writing-mode', +]); + +/** + * @example + * Object.values(prefixes.remove) + * .filter((p) => Array.isArray(p.values)) + * .flatMap((p) => p.values) + * .map((p) => utils.removeNote(p.prefixed)) // normalize '-webkit- old' + * .filter((p) => !p.endsWith('-')); // remove '-webkit-' only + * + * @see https://github.com/stylelint/stylelint/pull/5312/files#r636018013 + */ +const PROPERTY_VALUES = new Set([ + '-moz-available', + '-moz-box', + '-moz-calc', + '-moz-crisp-edges', + '-moz-element', + '-moz-fit-content', + '-moz-grab', + '-moz-grabbing', + '-moz-inline-box', + '-moz-isolate', + '-moz-isolate-override', + '-moz-linear-gradient', + '-moz-max-content', + '-moz-min-content', + '-moz-plaintext', + '-moz-radial-gradient', + '-moz-repeating-linear-gradient', + '-moz-repeating-radial-gradient', + '-moz-zoom-in', + '-moz-zoom-out', + '-ms-flexbox', + '-ms-grid', + '-ms-inline-flexbox', + '-ms-inline-grid', + '-ms-linear-gradient', + '-ms-radial-gradient', + '-ms-repeating-linear-gradient', + '-ms-repeating-radial-gradient', + '-o-linear-gradient', + '-o-pixelated', + '-o-radial-gradient', + '-o-repeating-linear-gradient', + '-o-repeating-radial-gradient', + '-webkit-box', + '-webkit-calc', + '-webkit-cross-fade', + '-webkit-fill-available', + '-webkit-filter', + '-webkit-fit-content', + '-webkit-flex', + '-webkit-grab', + '-webkit-grabbing', + '-webkit-image-set', + '-webkit-inline-box', + '-webkit-inline-flex', + '-webkit-isolate', + '-webkit-linear-gradient', + '-webkit-max-content', + '-webkit-min-content', + '-webkit-optimize-contrast', + '-webkit-radial-gradient', + '-webkit-repeating-linear-gradient', + '-webkit-repeating-radial-gradient', + '-webkit-sticky', + '-webkit-zoom-in', + '-webkit-zoom-out', +]); + +/** + * Most identifier types have to be looked up in a unique way, + * so we're exposing special functions for each. + */ +module.exports = { + /** + * @param {string} identifier + * @returns {boolean} + */ + atRuleName(identifier) { + return AT_RULES.has(`@${identifier.toLowerCase()}`); + }, + + /** + * @param {string} identifier + * @returns {boolean} + */ + selector(identifier) { + return SELECTORS.has(identifier.toLowerCase()); + }, + + /** + * @param {string} identifier + * @returns {boolean} + */ + mediaFeatureName(identifier) { + return identifier.toLowerCase().includes('device-pixel-ratio'); + }, + + /** + * @param {string} identifier + * @returns {boolean} + */ + property(identifier) { + const ident = identifier.toLowerCase(); + + // HACK: `interpolation-mode` does not exist. This is an IE extension for `image-rendering`. + // See + if (ident === '-ms-interpolation-mode') { + return true; + } + + if (vendor.prefix(ident).length === 0) { + return false; + } + + return PROPERTIES.has(vendor.unprefixed(ident)); + }, + + /** + * @param {string} value + * @returns {boolean} + */ + propertyValue(value) { + return PROPERTY_VALUES.has(value.toLowerCase()); + }, + + /** + * @param {string} value + * @returns {string} + */ + unprefix(value) { + return value.replace(/-\w+-/, ''); + }, +}; diff --git a/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterBlocklessAtRule.js b/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterBlocklessAtRule.js new file mode 100644 index 000000000..1f9e3bb8d --- /dev/null +++ b/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterBlocklessAtRule.js @@ -0,0 +1,23 @@ +'use strict'; + +const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode'); +const hasBlock = require('./hasBlock'); +const { isAtRule } = require('./typeGuards'); + +/** + * @param {import('postcss').AtRule} atRule + * @returns {boolean} + */ +module.exports = function isBlocklessAtRuleAfterBlocklessAtRule(atRule) { + if (atRule.type !== 'atrule') { + return false; + } + + const previousNode = getPreviousNonSharedLineCommentNode(atRule); + + if (previousNode === undefined) { + return false; + } + + return isAtRule(previousNode) && !hasBlock(previousNode) && !hasBlock(atRule); +}; diff --git a/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterSameNameBlocklessAtRule.js b/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterSameNameBlocklessAtRule.js new file mode 100644 index 000000000..503d8739c --- /dev/null +++ b/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterSameNameBlocklessAtRule.js @@ -0,0 +1,23 @@ +'use strict'; + +const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode'); +const isBlocklessAtRuleAfterBlocklessAtRule = require('./isBlocklessAtRuleAfterBlocklessAtRule'); +const { isAtRule } = require('./typeGuards'); + +/** + * @param {import('postcss').AtRule} atRule + * @returns {boolean} + */ +module.exports = function isBlocklessAtRuleAfterSameNameBlocklessAtRule(atRule) { + if (!isBlocklessAtRuleAfterBlocklessAtRule(atRule)) { + return false; + } + + const previousNode = getPreviousNonSharedLineCommentNode(atRule); + + if (previousNode && isAtRule(previousNode)) { + return previousNode.name === atRule.name; + } + + return false; +}; diff --git a/node_modules/stylelint/lib/utils/isContextFunctionalPseudoClass.js b/node_modules/stylelint/lib/utils/isContextFunctionalPseudoClass.js new file mode 100644 index 000000000..c4d024666 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isContextFunctionalPseudoClass.js @@ -0,0 +1,26 @@ +'use strict'; + +const { + aNPlusBOfSNotationPseudoClasses, + logicalCombinationsPseudoClasses, +} = require('../reference/selectors'); + +/** + * Check whether a node is a context-functional pseudo-class (i.e. either a logical combination + * or a 'aNPlusBOfSNotationPseudoClasses' / tree-structural pseudo-class) + * + * @param {import('postcss-selector-parser').Node} node - postcss-selector-parser node (of type pseudo) + * @return {node is import('postcss-selector-parser').Pseudo} If `true`, the node is a context-functional pseudo-class + */ +module.exports = function isContextFunctionalPseudoClass(node) { + if (node.type === 'pseudo') { + const normalisedParentName = node.value.toLowerCase().replace(/:+/, ''); + + return ( + logicalCombinationsPseudoClasses.has(normalisedParentName) || + aNPlusBOfSNotationPseudoClasses.has(normalisedParentName) + ); + } + + return false; +}; diff --git a/node_modules/stylelint/lib/utils/isCounterIncrementCustomIdentValue.js b/node_modules/stylelint/lib/utils/isCounterIncrementCustomIdentValue.js new file mode 100644 index 000000000..ee425bf05 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isCounterIncrementCustomIdentValue.js @@ -0,0 +1,21 @@ +'use strict'; + +const { counterIncrementKeywords } = require('../reference/keywords'); + +/** + * Check value is a custom ident + * + * @param {string} value + */ +module.exports = function isCounterIncrementCustomIdentValue(value) { + const valueLowerCase = value.toLowerCase(); + + if ( + counterIncrementKeywords.has(valueLowerCase) || + Number.isFinite(Number.parseInt(valueLowerCase, 10)) + ) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isCounterResetCustomIdentValue.js b/node_modules/stylelint/lib/utils/isCounterResetCustomIdentValue.js new file mode 100644 index 000000000..2afc9f3fa --- /dev/null +++ b/node_modules/stylelint/lib/utils/isCounterResetCustomIdentValue.js @@ -0,0 +1,21 @@ +'use strict'; + +const { counterResetKeywords } = require('../reference/keywords'); + +/** + * Check value is a custom ident + * + * @param {string} value + */ +module.exports = function isCounterResetCustomIdentValue(value) { + const valueLowerCase = value.toLowerCase(); + + if ( + counterResetKeywords.has(valueLowerCase) || + Number.isFinite(Number.parseInt(valueLowerCase, 10)) + ) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isCustomElement.js b/node_modules/stylelint/lib/utils/isCustomElement.js new file mode 100644 index 000000000..e777249cf --- /dev/null +++ b/node_modules/stylelint/lib/utils/isCustomElement.js @@ -0,0 +1,41 @@ +'use strict'; + +const { htmlTypeSelectors } = require('../reference/selectors'); +const mathMLTags = require('mathml-tag-names'); +const svgTags = require('svg-tags'); + +/** + * Check whether a type selector is a custom element + * + * @param {string} selector + * @returns {boolean} + */ +module.exports = function isCustomElement(selector) { + if (!/^[a-z]/.test(selector)) { + return false; + } + + if (!selector.includes('-')) { + return false; + } + + const selectorLowerCase = selector.toLowerCase(); + + if (selectorLowerCase !== selector) { + return false; + } + + if (svgTags.includes(selectorLowerCase)) { + return false; + } + + if (htmlTypeSelectors.has(selectorLowerCase)) { + return false; + } + + if (mathMLTags.includes(selectorLowerCase)) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isCustomFunction.js b/node_modules/stylelint/lib/utils/isCustomFunction.js new file mode 100644 index 000000000..0f0f0b1e9 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isCustomFunction.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Check whether a function is custom / user-defined + * https://github.com/w3c/css-houdini-drafts/issues/1007 + * @param {string} func + * @returns {boolean} + */ +module.exports = function isCustomFunction(func) { + return func.startsWith('--'); +}; diff --git a/node_modules/stylelint/lib/utils/isCustomMediaQuery.js b/node_modules/stylelint/lib/utils/isCustomMediaQuery.js new file mode 100644 index 000000000..18a068618 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isCustomMediaQuery.js @@ -0,0 +1,10 @@ +'use strict'; + +/** + * Check whether a media query is a custom + * @param {string} mediaQuery + * @returns {boolean} + */ +module.exports = function isCustomMediaQuery(mediaQuery) { + return mediaQuery.startsWith('--'); +}; diff --git a/node_modules/stylelint/lib/utils/isCustomProperty.js b/node_modules/stylelint/lib/utils/isCustomProperty.js new file mode 100644 index 000000000..b4a33c7c2 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isCustomProperty.js @@ -0,0 +1,10 @@ +'use strict'; + +/** + * Check whether a property is a custom one + * @param {string} property + * @returns {boolean} + */ +module.exports = function isCustomProperty(property) { + return property.startsWith('--'); +}; diff --git a/node_modules/stylelint/lib/utils/isCustomSelector.js b/node_modules/stylelint/lib/utils/isCustomSelector.js new file mode 100644 index 000000000..4cc3c86c9 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isCustomSelector.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Check whether a selector is a custom one + * + * @param {string} selector + * @returns {boolean} + */ +module.exports = function isCustomSelector(selector) { + return selector.startsWith(':--'); +}; diff --git a/node_modules/stylelint/lib/utils/isFirstNested.js b/node_modules/stylelint/lib/utils/isFirstNested.js new file mode 100644 index 000000000..56c55275c --- /dev/null +++ b/node_modules/stylelint/lib/utils/isFirstNested.js @@ -0,0 +1,85 @@ +'use strict'; + +const { isComment, isDocument, isRoot, hasSource } = require('./typeGuards'); + +/** + * @param {import('postcss').Node} statement + * @returns {boolean} + */ +module.exports = function isFirstNested(statement) { + const parentNode = statement.parent; + + if (parentNode === undefined) { + return false; + } + + if (isRoot(parentNode) && !isInDocument(parentNode)) { + return false; + } + + if (statement === parentNode.first) { + return true; + } + + /* + * Search for the statement in the parent's nodes, ignoring comment + * nodes on the same line as the parent's opening brace. + */ + + const parentNodes = parentNode.nodes; + + if (!parentNodes) { + return false; + } + + const firstNode = parentNodes[0]; + + if (!firstNode) { + return false; + } + + if ( + !isComment(firstNode) || + (typeof firstNode.raws.before === 'string' && firstNode.raws.before.includes('\n')) + ) { + return false; + } + + if (!hasSource(firstNode) || !firstNode.source.start) { + return false; + } + + const openingBraceLine = firstNode.source.start.line; + + if (!firstNode.source.end || openingBraceLine !== firstNode.source.end.line) { + return false; + } + + for (const [index, node] of parentNodes.entries()) { + if (index === 0) { + continue; + } + + if (node === statement) { + return true; + } + + if ( + !isComment(node) || + (hasSource(node) && node.source.end && node.source.end.line !== openingBraceLine) + ) { + return false; + } + } + + /* istanbul ignore next: Should always return in the loop */ + return false; +}; + +/** + * @param {import('postcss').Node} node + * @returns {boolean} + */ +function isInDocument({ parent }) { + return Boolean(parent && isDocument(parent)); +} diff --git a/node_modules/stylelint/lib/utils/isFirstNodeOfRoot.js b/node_modules/stylelint/lib/utils/isFirstNodeOfRoot.js new file mode 100644 index 000000000..dbdf4911f --- /dev/null +++ b/node_modules/stylelint/lib/utils/isFirstNodeOfRoot.js @@ -0,0 +1,19 @@ +'use strict'; + +const { isRoot } = require('./typeGuards'); + +/** + * @param {import('postcss').Node} node + * @returns {boolean} + */ +module.exports = function isFirstNodeOfRoot(node) { + if (isRoot(node)) return false; + + const parentNode = node.parent; + + if (!parentNode) { + return false; + } + + return isRoot(parentNode) && node === parentNode.first; +}; diff --git a/node_modules/stylelint/lib/utils/isKeyframeRule.js b/node_modules/stylelint/lib/utils/isKeyframeRule.js new file mode 100644 index 000000000..015ea4eca --- /dev/null +++ b/node_modules/stylelint/lib/utils/isKeyframeRule.js @@ -0,0 +1,19 @@ +'use strict'; + +const { isAtRule } = require('./typeGuards'); + +/** + * Check if a rule is a keyframe one + * + * @param {import('postcss').Rule} rule + * @returns {boolean} + */ +module.exports = function isKeyframeRule(rule) { + const parent = rule.parent; + + if (!parent) { + return false; + } + + return isAtRule(parent) && parent.name.toLowerCase() === 'keyframes'; +}; diff --git a/node_modules/stylelint/lib/utils/isKeyframeSelector.js b/node_modules/stylelint/lib/utils/isKeyframeSelector.js new file mode 100644 index 000000000..70ca5d64d --- /dev/null +++ b/node_modules/stylelint/lib/utils/isKeyframeSelector.js @@ -0,0 +1,22 @@ +'use strict'; + +const { keyframeSelectorKeywords } = require('../reference/keywords'); + +/** + * Check whether a string is a keyframe selector. + * + * @param {string} selector + * @returns {boolean} + */ +module.exports = function isKeyframeSelector(selector) { + if (keyframeSelectorKeywords.has(selector)) { + return true; + } + + // Percentages + if (/^(?:\d+|\d*\.\d+)%$/.test(selector)) { + return true; + } + + return false; +}; diff --git a/node_modules/stylelint/lib/utils/isMathFunction.js b/node_modules/stylelint/lib/utils/isMathFunction.js new file mode 100644 index 000000000..e91775875 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isMathFunction.js @@ -0,0 +1,13 @@ +'use strict'; + +const { mathFunctions } = require('../reference/functions'); + +/** + * Check whether a node is math function + * + * @param {import('postcss-value-parser').Node} node postcss-value-parser node + * @return {boolean} If `true`, the node is math function + */ +module.exports = function isMathFunction(node) { + return node.type === 'function' && mathFunctions.has(node.value.toLowerCase()); +}; diff --git a/node_modules/stylelint/lib/utils/isNonNegativeInteger.js b/node_modules/stylelint/lib/utils/isNonNegativeInteger.js new file mode 100644 index 000000000..044467e08 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isNonNegativeInteger.js @@ -0,0 +1,8 @@ +'use strict'; + +/** + * @param {unknown} value + */ +module.exports = function isNonNegativeInteger(value) { + return Number.isInteger(value) && typeof value === 'number' && value >= 0; +}; diff --git a/node_modules/stylelint/lib/utils/isNumbery.js b/node_modules/stylelint/lib/utils/isNumbery.js new file mode 100644 index 000000000..ceb31542d --- /dev/null +++ b/node_modules/stylelint/lib/utils/isNumbery.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Check whether it's a number or a number-like string: + * i.e. when coerced to a number it == itself. + * + * @param {string | number} value + */ +module.exports = function isNumbery(value) { + return value.toString().trim().length !== 0 && Number(value) == value; // eslint-disable-line eqeqeq +}; diff --git a/node_modules/stylelint/lib/utils/isOnlyWhitespace.js b/node_modules/stylelint/lib/utils/isOnlyWhitespace.js new file mode 100644 index 000000000..d8ddf00b0 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isOnlyWhitespace.js @@ -0,0 +1,19 @@ +'use strict'; + +const isWhitespace = require('./isWhitespace'); + +/** + * Returns a Boolean indicating whether the input string is only whitespace. + * + * @param {string} input + * @returns {boolean} + */ +module.exports = function isOnlyWhitespace(input) { + for (const element of input) { + if (!isWhitespace(element)) { + return false; + } + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isPathNotFoundError.js b/node_modules/stylelint/lib/utils/isPathNotFoundError.js new file mode 100644 index 000000000..a95c35368 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isPathNotFoundError.js @@ -0,0 +1,11 @@ +'use strict'; + +const util = require('util'); + +/** + * @param {unknown} error + * @returns {error is NodeJS.ErrnoException} + */ +module.exports = function isPathNotFoundError(error) { + return util.types.isNativeError(error) && 'code' in error && error.code === 'ENOENT'; +}; diff --git a/node_modules/stylelint/lib/utils/isScssVariable.js b/node_modules/stylelint/lib/utils/isScssVariable.js new file mode 100644 index 000000000..f7012e629 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isScssVariable.js @@ -0,0 +1,21 @@ +'use strict'; + +/** + * Check whether a property is SCSS variable + * + * @param {string} property + * @returns {boolean} + */ +module.exports = function isScssVariable(property) { + // SCSS var (e.g. $var: x), list (e.g. $list: (x)) or map (e.g. $map: (key:value)) + if (property.startsWith('$')) { + return true; + } + + // SCSS var within a namespace (e.g. namespace.$var: x) + if (property.includes('.$')) { + return true; + } + + return false; +}; diff --git a/node_modules/stylelint/lib/utils/isSharedLineComment.js b/node_modules/stylelint/lib/utils/isSharedLineComment.js new file mode 100644 index 000000000..14ab57d86 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isSharedLineComment.js @@ -0,0 +1,56 @@ +'use strict'; + +const getNextNonSharedLineCommentNode = require('./getNextNonSharedLineCommentNode'); +const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode'); +const { isRoot, isComment } = require('./typeGuards'); + +/** @typedef {import('postcss').Node} PostcssNode */ + +/** + * + * @param {PostcssNode | void} a + * @param {PostcssNode | void} b + */ +function nodesShareLines(a, b) { + const endLine = a && a.source && a.source.end && a.source.end.line; + const startLine = b && b.source && b.source.start && b.source.start.line; + + return endLine === startLine; +} + +/** + * @param {PostcssNode} node + * @returns {boolean} + */ +module.exports = function isSharedLineComment(node) { + if (!isComment(node)) { + return false; + } + + const previousNonSharedLineCommentNode = getPreviousNonSharedLineCommentNode(node); + + if (nodesShareLines(previousNonSharedLineCommentNode, node)) { + return true; + } + + const nextNonSharedLineCommentNode = getNextNonSharedLineCommentNode(node); + + if (nextNonSharedLineCommentNode && nodesShareLines(node, nextNonSharedLineCommentNode)) { + return true; + } + + const parentNode = node.parent; + + // It's a first child and located on the same line as block start + if ( + parentNode !== undefined && + !isRoot(parentNode) && + parentNode.index(node) === 0 && + node.raws.before !== undefined && + !node.raws.before.includes('\n') + ) { + return true; + } + + return false; +}; diff --git a/node_modules/stylelint/lib/utils/isSingleLineString.js b/node_modules/stylelint/lib/utils/isSingleLineString.js new file mode 100644 index 000000000..152be8cc9 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isSingleLineString.js @@ -0,0 +1,12 @@ +'use strict'; + +/** + * Check if a string is a single line (i.e. does not contain + * any newline characters). + * + * @param {string} input + * @return {boolean} + */ +module.exports = function isSingleLineString(input) { + return !/[\n\r]/.test(input); +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxAtRule.js b/node_modules/stylelint/lib/utils/isStandardSyntaxAtRule.js new file mode 100644 index 000000000..7ee34c2f2 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxAtRule.js @@ -0,0 +1,29 @@ +'use strict'; + +/** + * Check whether a at-rule is standard + * + * @param {import('postcss').AtRule | import('postcss-less').AtRule} atRule postcss at-rule node + * @return {boolean} If `true`, the declaration is standard + */ +module.exports = function isStandardSyntaxAtRule(atRule) { + // Ignore scss `@content` inside mixins + if (!atRule.nodes && atRule.params === '') { + return false; + } + + // Ignore Less mixins + if ('mixin' in atRule && atRule.mixin) { + return false; + } + + // Ignore Less detached ruleset `@detached-ruleset: { background: red; }; .top { @detached-ruleset(); }` + if ( + ('variable' in atRule && atRule.variable) || + (!atRule.nodes && atRule.raws.afterName === '' && atRule.params[0] === '(') + ) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxColorFunction.js b/node_modules/stylelint/lib/utils/isStandardSyntaxColorFunction.js new file mode 100644 index 000000000..aab06273d --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxColorFunction.js @@ -0,0 +1,26 @@ +'use strict'; + +const isStandardSyntaxFunction = require('./isStandardSyntaxFunction'); + +/** + * Check whether a function is standard syntax color function + * + * @param {import('postcss-value-parser').FunctionNode} node + * @returns {boolean} + */ +module.exports = function isStandardSyntaxColorFunction(node) { + if (!isStandardSyntaxFunction(node)) return false; + + // scss can accept a #hex, or $var variables and we need to check all nested fn nodes + for (const fnNode of node.nodes) { + if (fnNode.type === 'function') return isStandardSyntaxColorFunction(fnNode); + + if ( + fnNode.type === 'word' && + (fnNode.value.startsWith('#') || fnNode.value.startsWith('$') || fnNode.value.includes('.$')) + ) + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxCombinator.js b/node_modules/stylelint/lib/utils/isStandardSyntaxCombinator.js new file mode 100644 index 000000000..171096dd3 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxCombinator.js @@ -0,0 +1,34 @@ +'use strict'; + +/** + * Check whether a combinator is standard + * + * @param {import('postcss-selector-parser').Combinator} node postcss-selector-parser node (of type combinator) + * @return {boolean} If `true`, the combinator is standard + */ +module.exports = function isStandardSyntaxCombinator(node) { + // if it's not a combinator, then it's not a standard combinator + if (node.type !== 'combinator') { + return false; + } + + // Ignore reference combinators like `/deep/` + if (node.value.startsWith('/') || node.value.endsWith('/')) { + return false; + } + + // ignore the combinators that are the first or last node in their container + if (node.parent !== undefined && node.parent !== null) { + const parent = node.parent; + + if (node === parent.first) { + return false; + } + + if (node === parent.last) { + return false; + } + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxComment.js b/node_modules/stylelint/lib/utils/isStandardSyntaxComment.js new file mode 100644 index 000000000..0687814da --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxComment.js @@ -0,0 +1,15 @@ +'use strict'; + +/** + * @param {import('postcss').Comment} comment + * @returns {boolean} + */ +module.exports = function isStandardSyntaxComment(comment) { + // We check both here because the Sass parser uses `raws.inline` to indicate + // inline comments, while the Less parser uses `inline`. + if ('inline' in comment) return false; + + if ('inline' in comment.raws) return false; + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxDeclaration.js b/node_modules/stylelint/lib/utils/isStandardSyntaxDeclaration.js new file mode 100644 index 000000000..e258a7d89 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxDeclaration.js @@ -0,0 +1,58 @@ +'use strict'; + +const isScssVariable = require('./isScssVariable'); +const { isRule } = require('./typeGuards'); + +/** + * Check whether a declaration is standard + * + * @param {import('postcss').Declaration | import('postcss-less').Declaration} decl + */ +module.exports = function isStandardSyntaxDeclaration(decl) { + const prop = decl.prop; + const parent = decl.parent; + + // SCSS var; covers map and list declarations + if (isScssVariable(prop)) { + return false; + } + + // Less var (e.g. @var: x), but exclude variable interpolation (e.g. @{var}) + if (prop[0] === '@' && prop[1] !== '{') { + return false; + } + + // Less map declaration + if (parent && parent.type === 'atrule' && parent.raws.afterName === ':') { + return false; + } + + // Less map (e.g. #my-map() { myprop: red; }) + if ( + parent && + isRule(parent) && + parent.selector && + parent.selector.startsWith('#') && + parent.selector.endsWith('()') + ) { + return false; + } + + // Sass nested properties (e.g. border: { style: solid; color: red; }) + if ( + parent && + isRule(parent) && + parent.selector && + parent.selector[parent.selector.length - 1] === ':' && + parent.selector.substring(0, 2) !== '--' + ) { + return false; + } + + // Less &:extend + if ('extend' in decl && decl.extend) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxFunction.js b/node_modules/stylelint/lib/utils/isStandardSyntaxFunction.js new file mode 100644 index 000000000..5c1e29adf --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxFunction.js @@ -0,0 +1,30 @@ +'use strict'; + +/** + * Check whether a function is standard + * + * @param {import('postcss-value-parser').Node} node + * @returns {boolean} + */ +module.exports = function isStandardSyntaxFunction(node) { + // Function nodes without names are things in parentheses like Sass lists + if (!node.value) { + return false; + } + + if (node.value.startsWith('#{')) { + return false; + } + + // CSS-in-JS interpolation + if (node.value.startsWith('${')) { + return false; + } + + // CSS-in-JS syntax + if (node.value.startsWith('`')) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxHexColor.js b/node_modules/stylelint/lib/utils/isStandardSyntaxHexColor.js new file mode 100644 index 000000000..71a7581a9 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxHexColor.js @@ -0,0 +1,16 @@ +'use strict'; + +/** + * Check whether a hex color is standard + * + * @param {string} hex + * @returns {boolean} + */ +module.exports = function isStandardSyntaxHexColor(hex) { + // Less map usage (e.g. .myclass { color: #colors[somecolor]; }) + if (hex.includes('[')) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxKeyframesName.js b/node_modules/stylelint/lib/utils/isStandardSyntaxKeyframesName.js new file mode 100644 index 000000000..934620e97 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxKeyframesName.js @@ -0,0 +1,17 @@ +'use strict'; + +const hasInterpolation = require('./hasInterpolation'); + +/** + * Check whether a keyframes name is standard + * + * @param {string} keyframesName + * @returns {boolean} + */ +module.exports = function isStandardSyntaxKeyframesName(keyframesName) { + if (hasInterpolation(keyframesName)) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxMathFunction.js b/node_modules/stylelint/lib/utils/isStandardSyntaxMathFunction.js new file mode 100644 index 000000000..cb13e9bd5 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxMathFunction.js @@ -0,0 +1,21 @@ +'use strict'; + +/** + * Check whether a math function is standard + * + * @param {string} mathFunction + * @returns {boolean} + */ +module.exports = function isStandardSyntaxMathFunction(mathFunction) { + // SCSS variable + if (mathFunction.includes('$')) { + return false; + } + + // Less variable + if (mathFunction.includes('@')) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeature.js b/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeature.js new file mode 100644 index 000000000..6b6a86724 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeature.js @@ -0,0 +1,26 @@ +'use strict'; + +const hasInterpolation = require('../utils/hasInterpolation'); + +/** + * Check whether a media feature is standard + * + * @param {string} mediaFeature + * @returns {boolean} + */ +module.exports = function isStandardSyntaxMediaFeature(mediaFeature) { + // Remove outside parens + mediaFeature = mediaFeature.slice(1, -1); + + // Parentheticals used for non-standard operations e.g. ($var - 10) + if (mediaFeature.includes('(')) { + return false; + } + + // SCSS or Less interpolation + if (hasInterpolation(mediaFeature)) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeatureName.js b/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeatureName.js new file mode 100644 index 000000000..9022b18d1 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeatureName.js @@ -0,0 +1,16 @@ +'use strict'; + +/** + * Check whether a media feature name is standard + * + * @param {string} mediaFeatureName + * @returns {boolean} + */ +module.exports = function isStandardSyntaxMediaFeatureName(mediaFeatureName) { + // SCSS interpolation + if (/#\{.+?\}|\$.+/.test(mediaFeatureName)) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxProperty.js b/node_modules/stylelint/lib/utils/isStandardSyntaxProperty.js new file mode 100644 index 000000000..373f681b1 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxProperty.js @@ -0,0 +1,34 @@ +'use strict'; + +const hasInterpolation = require('../utils/hasInterpolation'); +const isScssVariable = require('./isScssVariable'); + +/** + * Check whether a property is standard + * + * @param {string} property + * @returns {boolean} + */ +module.exports = function isStandardSyntaxProperty(property) { + // SCSS var + if (isScssVariable(property)) { + return false; + } + + // Less var (e.g. @var: x) + if (property.startsWith('@')) { + return false; + } + + // Less append property value with space (e.g. transform+_: scale(2)) + if (property.endsWith('+') || property.endsWith('+_')) { + return false; + } + + // SCSS or Less interpolation + if (hasInterpolation(property)) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxRule.js b/node_modules/stylelint/lib/utils/isStandardSyntaxRule.js new file mode 100644 index 000000000..995d36879 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxRule.js @@ -0,0 +1,26 @@ +'use strict'; + +const isStandardSyntaxSelector = require('../utils/isStandardSyntaxSelector'); + +/** + * Check whether a Node is a standard rule + * + * @param {import('postcss').Rule | import('postcss-less').Rule} rule + * @returns {boolean} + */ +module.exports = function isStandardSyntaxRule(rule) { + if (rule.type !== 'rule') { + return false; + } + + // Ignore Less &:extend rule + if ('extend' in rule && rule.extend) { + return false; + } + + if (!isStandardSyntaxSelector(rule.selector)) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxSelector.js b/node_modules/stylelint/lib/utils/isStandardSyntaxSelector.js new file mode 100644 index 000000000..0e6e3af73 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxSelector.js @@ -0,0 +1,58 @@ +'use strict'; + +const hasInterpolation = require('../utils/hasInterpolation'); + +/** + * Check whether a selector is standard + * + * @param {string} selector + * @returns {boolean} + */ +module.exports = function isStandardSyntaxSelector(selector) { + // SCSS or Less interpolation + if (hasInterpolation(selector)) { + return false; + } + + // SCSS placeholder selectors + if (selector.startsWith('%')) { + return false; + } + + // SCSS nested properties + if (selector.endsWith(':')) { + return false; + } + + // Less :extend() + if (/:extend(?:\(.*?\))?/.test(selector)) { + return false; + } + + // Less mixin with resolved nested selectors (e.g. .foo().bar or .foo(@a, @b)[bar]) + if (/\.[\w-]+\(.*\).+/.test(selector)) { + return false; + } + + // Less non-outputting mixin definition (e.g. .mixin() {}) + if (selector.endsWith(')') && !selector.includes(':')) { + return false; + } + + // Less Parametric mixins (e.g. .mixin(@variable: x) {}) + if (/\(@.*\)$/.test(selector)) { + return false; + } + + // ERB template tags + if (selector.includes('<%') || selector.includes('%>')) { + return false; + } + + // SCSS and Less comments + if (selector.includes('//')) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxTypeSelector.js b/node_modules/stylelint/lib/utils/isStandardSyntaxTypeSelector.js new file mode 100644 index 000000000..c415cb469 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxTypeSelector.js @@ -0,0 +1,58 @@ +'use strict'; + +const { + aNPlusBNotationPseudoClasses, + aNPlusBOfSNotationPseudoClasses, + linguisticPseudoClasses, + shadowTreePseudoElements, +} = require('../reference/selectors'); + +/** + * Check whether a type selector is standard + * + * @param {import('postcss-selector-parser').Tag} node postcss-selector-parser node (of type tag) + * @return {boolean} If `true`, the type selector is standard + */ +module.exports = function isStandardSyntaxTypeSelector(node) { + // postcss-selector-parser includes the arguments to nth-child() functions + // as "tags", so we need to ignore them ourselves. + // The fake-tag's "parent" is actually a selector node, whose parent + // should be the :nth-child pseudo node. + if (!node.parent || !node.parent.parent) { + return false; + } + + const _node$parent$parent = node.parent.parent; + const parentType = _node$parent$parent.type; + const parentValue = _node$parent$parent.value; + + if (parentValue) { + const normalisedParentName = parentValue.toLowerCase().replace(/:+/, ''); + + if ( + parentType === 'pseudo' && + (aNPlusBNotationPseudoClasses.has(normalisedParentName) || + aNPlusBOfSNotationPseudoClasses.has(normalisedParentName) || + linguisticPseudoClasses.has(normalisedParentName) || + shadowTreePseudoElements.has(normalisedParentName)) + ) { + return false; + } + } + + // &-bar is a nesting selector combined with a suffix + if (node.prev() && node.prev().type === 'nesting') { + return false; + } + + if (node.value.startsWith('%')) { + return false; + } + + // Reference combinators like `/deep/` + if (node.value.startsWith('/') && node.value.endsWith('/')) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxUrl.js b/node_modules/stylelint/lib/utils/isStandardSyntaxUrl.js new file mode 100644 index 000000000..6b5bf0ca5 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxUrl.js @@ -0,0 +1,51 @@ +'use strict'; + +const hasLessInterpolation = require('../utils/hasLessInterpolation'); +const hasPsvInterpolation = require('../utils/hasPsvInterpolation'); +const hasScssInterpolation = require('../utils/hasScssInterpolation'); +const hasTplInterpolation = require('../utils/hasTplInterpolation'); + +const IS_LESS_VARIABLE_IN_URL = /^@@?[\w-]+$/; +const IS_SCSS_VARIABLE_IN_URL = /^[$\s\w+\-,./*'"]+$/; + +/** + * Check whether a URL is standard + * + * @param {string} url + * @returns {boolean} + */ +module.exports = function isStandardSyntaxUrl(url) { + if (url.length === 0) { + return true; + } + + // Sass interpolation works anywhere + if (hasScssInterpolation(url) || hasTplInterpolation(url) || hasPsvInterpolation(url)) { + return false; + } + + // Inside `'` and `"` work only LESS interpolation + if ((url.startsWith(`'`) && url.endsWith(`'`)) || (url.startsWith(`"`) && url.endsWith(`"`))) { + if (hasLessInterpolation(url)) { + return false; + } + + return true; + } + + // Less variable works only at the beginning + // Check is less variable, allow use '@url/some/path' + // https://github.com/less/less.js/blob/3.x/lib/less/parser/parser.js#L547 + if (url.startsWith('@') && IS_LESS_VARIABLE_IN_URL.test(url)) { + return false; + } + + // In url without quotes scss variable can be everywhere + // But in this case it is allowed to use only specific characters + // Also forbidden "/" at the end of url + if (url.includes('$') && IS_SCSS_VARIABLE_IN_URL.test(url) && !url.endsWith('/')) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxValue.js b/node_modules/stylelint/lib/utils/isStandardSyntaxValue.js new file mode 100644 index 000000000..54d75474c --- /dev/null +++ b/node_modules/stylelint/lib/utils/isStandardSyntaxValue.js @@ -0,0 +1,52 @@ +'use strict'; + +const hasInterpolation = require('../utils/hasInterpolation'); + +/** + * Check whether a value is standard + * + * @param {string} value + * @returns {boolean} + */ +module.exports = function isStandardSyntaxValue(value) { + let normalizedValue = value; + + // Ignore operators before variables (example -$variable) + if (/^[-+*/]/.test(value.charAt(0))) { + normalizedValue = normalizedValue.slice(1); + } + + // SCSS variable (example $variable) + if (normalizedValue.startsWith('$')) { + return false; + } + + // SCSS namespace (example namespace.$variable) + if (/^.+\.\$/.test(value)) { + return false; + } + + // SCSS namespace (example namespace.function-name()) + if (/^.+\.[-\w]+\(/.test(value)) { + return false; + } + + // Less variable + if (normalizedValue.startsWith('@')) { + return false; + } + + // SCSS or Less interpolation + if (hasInterpolation(normalizedValue)) { + return false; + } + + // WebExtension replacement keyword used by Chrome/Firefox + // more information: https://developer.chrome.com/extensions/i18n + // and https://github.com/stylelint/stylelint/issues/4707 + if (/__MSG_\S+__/.test(value)) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isUnicodeRangeDescriptor.js b/node_modules/stylelint/lib/utils/isUnicodeRangeDescriptor.js new file mode 100644 index 000000000..8718a9c22 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isUnicodeRangeDescriptor.js @@ -0,0 +1,26 @@ +'use strict'; + +const { isAtRule } = require('./typeGuards'); + +const IS_UNICODE_RANGE = /^unicode-range$/i; +const IS_AT_FONT_FACE = /^font-face$/i; + +/** + * Check whether a declaration is the `unicode-range` descriptor of an `@font-face` rule. + * + * @param {import('postcss').Declaration} decl + * @returns {boolean} + */ +module.exports = function isUnicodeRangeDescriptor(decl) { + if (!IS_UNICODE_RANGE.test(decl.prop)) { + return false; + } + + const parent = decl.parent; + + if (!parent || !isAtRule(parent)) { + return false; + } + + return IS_AT_FONT_FACE.test(parent.name); +}; diff --git a/node_modules/stylelint/lib/utils/isValidFontSize.js b/node_modules/stylelint/lib/utils/isValidFontSize.js new file mode 100644 index 000000000..eff6f2801 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isValidFontSize.js @@ -0,0 +1,39 @@ +'use strict'; + +const { fontSizeKeywords } = require('../reference/keywords'); +const { lengthUnits } = require('../reference/units'); +const valueParser = require('postcss-value-parser'); + +/** + * Check if a word is a font-size value. + * + * @param {string} word + * @returns {boolean} + */ +module.exports = function isValidFontSize(word) { + if (!word) { + return false; + } + + if (fontSizeKeywords.has(word)) { + return true; + } + + const numberUnit = valueParser.unit(word); + + if (!numberUnit) { + return false; + } + + const unit = numberUnit.unit; + + if (unit === '%') { + return true; + } + + if (lengthUnits.has(unit.toLowerCase())) { + return true; + } + + return false; +}; diff --git a/node_modules/stylelint/lib/utils/isValidHex.js b/node_modules/stylelint/lib/utils/isValidHex.js new file mode 100644 index 000000000..b6de64091 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isValidHex.js @@ -0,0 +1,13 @@ +'use strict'; + +const IS_VALID_HEX = /^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i; + +/** + * Check if a value is a valid 3, 4, 6 or 8 digit hex + * + * @param {string} value + * @returns {boolean} + */ +module.exports = function isValidHex(value) { + return IS_VALID_HEX.test(value); +}; diff --git a/node_modules/stylelint/lib/utils/isValidIdentifier.js b/node_modules/stylelint/lib/utils/isValidIdentifier.js new file mode 100644 index 000000000..036e48565 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isValidIdentifier.js @@ -0,0 +1,41 @@ +'use strict'; + +const ISO_10646_CHARACTERS = /\\[0-9a-f]{1,6}(\\r\\n|[ \t\r\n\f])?/gi; +const SINGLE_ESCAPED_CHARACTERS = /\\./g; +const NON_WORD_OR_DASH = /[^\w-]/; +const DIGIT = /\d/; + +/** + * Returns whether a string is a valid CSS identifier + * (i.e. only alphanumeric characters, `-`, and `_`; + * does not have a leading digit, leading dash followed by digit, or two leading dashes) + * furthermore, any escaped or ISO 10646 characters are allowed. + * @see https://www.w3.org/TR/CSS2/syndata.html#value-def-identifier + * @param {string} ident + * @returns {boolean} + */ +module.exports = function isValidIdentifier(ident) { + if (!ident || ident.trim() === '') { + return false; + } + + // trims, removes ISO 10646 characters, and singly-escaped characters + const trimmedIdent = ident + .trim() + .replace(ISO_10646_CHARACTERS, '') + .replace(SINGLE_ESCAPED_CHARACTERS, ''); + + if (NON_WORD_OR_DASH.test(trimmedIdent)) { + return false; + } + + if (DIGIT.test(trimmedIdent.charAt(0))) { + return false; + } + + if (trimmedIdent.charAt(0) === '-' && DIGIT.test(trimmedIdent.charAt(1))) { + return false; + } + + return true; +}; diff --git a/node_modules/stylelint/lib/utils/isVariable.js b/node_modules/stylelint/lib/utils/isVariable.js new file mode 100644 index 000000000..76d6b3c9a --- /dev/null +++ b/node_modules/stylelint/lib/utils/isVariable.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Check whether a word is a variable i.e var(--custom-property). + * + * @param {string} word + * @returns {boolean} + */ +module.exports = function isVariable(word) { + return word.toLowerCase().startsWith('var('); +}; diff --git a/node_modules/stylelint/lib/utils/isWhitespace.js b/node_modules/stylelint/lib/utils/isWhitespace.js new file mode 100644 index 000000000..c88ec1958 --- /dev/null +++ b/node_modules/stylelint/lib/utils/isWhitespace.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Check if a character is whitespace. + * + * @param {string} char + * @returns {boolean} + */ +module.exports = function isWhitespace(char) { + return [' ', '\n', '\t', '\r', '\f'].includes(char); +}; diff --git a/node_modules/stylelint/lib/utils/matchesStringOrRegExp.js b/node_modules/stylelint/lib/utils/matchesStringOrRegExp.js new file mode 100644 index 000000000..5d33bd2a9 --- /dev/null +++ b/node_modules/stylelint/lib/utils/matchesStringOrRegExp.js @@ -0,0 +1,89 @@ +'use strict'; + +/** + * Compares a string to a second value that, if it fits a certain convention, + * is converted to a regular expression before the comparison. + * If it doesn't fit the convention, then two strings are compared. + * + * Any strings starting and ending with `/` are interpreted + * as regular expressions. + * + * @param {string | Array} input + * @param {string | RegExp | Array} comparison + * + * @returns {false | {match: string, pattern: (string | RegExp), substring: string}} + */ +module.exports = function matchesStringOrRegExp(input, comparison) { + if (!Array.isArray(input)) { + return testAgainstStringOrRegExpOrArray(input, comparison); + } + + for (const inputItem of input) { + const testResult = testAgainstStringOrRegExpOrArray(inputItem, comparison); + + if (testResult) { + return testResult; + } + } + + return false; +}; + +/** + * @param {string} value + * @param {string | RegExp | Array} comparison + */ +function testAgainstStringOrRegExpOrArray(value, comparison) { + if (!Array.isArray(comparison)) { + return testAgainstStringOrRegExp(value, comparison); + } + + for (const comparisonItem of comparison) { + const testResult = testAgainstStringOrRegExp(value, comparisonItem); + + if (testResult) { + return testResult; + } + } + + return false; +} + +/** + * @param {string} value + * @param {string | RegExp} comparison + */ +function testAgainstStringOrRegExp(value, comparison) { + // If it's a RegExp, test directly + if (comparison instanceof RegExp) { + const match = value.match(comparison); + + return match ? { match: value, pattern: comparison, substring: match[0] || '' } : false; + } + + // Check if it's RegExp in a string + const firstComparisonChar = comparison[0]; + const lastComparisonChar = comparison[comparison.length - 1]; + const secondToLastComparisonChar = comparison[comparison.length - 2]; + + const comparisonIsRegex = + firstComparisonChar === '/' && + (lastComparisonChar === '/' || + (secondToLastComparisonChar === '/' && lastComparisonChar === 'i')); + + const hasCaseInsensitiveFlag = comparisonIsRegex && lastComparisonChar === 'i'; + + // If so, create a new RegExp from it + if (comparisonIsRegex) { + const valueMatch = hasCaseInsensitiveFlag + ? value.match(new RegExp(comparison.slice(1, -2), 'i')) + : value.match(new RegExp(comparison.slice(1, -1))); + + return valueMatch + ? { match: value, pattern: comparison, substring: valueMatch[0] || '' } + : false; + } + + // Otherwise, it's a string. Do a strict comparison + return value === comparison ? { match: value, pattern: comparison, substring: value } : false; +} diff --git a/node_modules/stylelint/lib/utils/nextNonCommentNode.js b/node_modules/stylelint/lib/utils/nextNonCommentNode.js new file mode 100644 index 000000000..ac4d07401 --- /dev/null +++ b/node_modules/stylelint/lib/utils/nextNonCommentNode.js @@ -0,0 +1,20 @@ +'use strict'; + +/** @typedef {import('postcss').Node} PostcssNode */ + +/** + * Get the next non-comment node in a PostCSS AST + * at or after a given node. + * + * @param {PostcssNode | void} startNode + * @returns {PostcssNode | null} + */ +module.exports = function nextNonCommentNode(startNode) { + if (!startNode || !startNode.next) return null; + + if (startNode.type === 'comment') { + return nextNonCommentNode(startNode.next()); + } + + return startNode; +}; diff --git a/node_modules/stylelint/lib/utils/noFilesFoundError.js b/node_modules/stylelint/lib/utils/noFilesFoundError.js new file mode 100644 index 000000000..e3300be1b --- /dev/null +++ b/node_modules/stylelint/lib/utils/noFilesFoundError.js @@ -0,0 +1,20 @@ +'use strict'; + +class NoFilesFoundError extends Error { + /** + * @param {string|string[]} fileList + */ + constructor(fileList) { + super(); + + if (typeof fileList === 'string') { + fileList = [fileList]; + } + + const pattern = fileList.filter((i) => !i.startsWith('!')).join(', '); + + this.message = `No files matching the pattern "${pattern}" were found.`; + } +} + +module.exports = NoFilesFoundError; diff --git a/node_modules/stylelint/lib/utils/nodeContextLookup.js b/node_modules/stylelint/lib/utils/nodeContextLookup.js new file mode 100644 index 000000000..e18d64f22 --- /dev/null +++ b/node_modules/stylelint/lib/utils/nodeContextLookup.js @@ -0,0 +1,43 @@ +'use strict'; + +/** + * Create a collection of Maps that serve to contextualize a given node. + * This is useful to ensure that you only compare nodes that share a certain + * context. + * + * All nodes are initially contextualized by their input source. + * From there, you can contextualize them however you want. + * + * For a usage example, see `selector-no-descending-specificity`. + */ +module.exports = function nodeContextLookup() { + const contextMap = new Map(); + + return { + /** + * @param {import('postcss').Node} node + * @param {any[]} subContexts + * @returns {Map} + */ + getContext(node, ...subContexts) { + if (!node.source) throw new Error('The node source must be present'); + + const nodeSource = node.source.input.from; + const baseContext = creativeGetMap(contextMap, nodeSource); + + return subContexts.reduce((result, context) => creativeGetMap(result, context), baseContext); + }, + }; +}; + +/** + * @param {Map} someMap + * @param {any} someThing + */ +function creativeGetMap(someMap, someThing) { + if (!someMap.has(someThing)) { + someMap.set(someThing, new Map()); + } + + return someMap.get(someThing); +} diff --git a/node_modules/stylelint/lib/utils/optionsMatches.js b/node_modules/stylelint/lib/utils/optionsMatches.js new file mode 100644 index 000000000..f911c3004 --- /dev/null +++ b/node_modules/stylelint/lib/utils/optionsMatches.js @@ -0,0 +1,22 @@ +'use strict'; + +const matchesStringOrRegExp = require('./matchesStringOrRegExp'); + +/** + * Check if an options object's propertyName contains a user-defined string or + * regex that matches the passed in input. + * + * @param {{ [x: string]: any; }} options + * @param {string} propertyName + * @param {unknown} input + * + * @returns {boolean} + */ +module.exports = function optionsMatches(options, propertyName, input) { + return Boolean( + options && + options[propertyName] && + typeof input === 'string' && + matchesStringOrRegExp(input, options[propertyName]), + ); +}; diff --git a/node_modules/stylelint/lib/utils/parseMediaQuery.js b/node_modules/stylelint/lib/utils/parseMediaQuery.js new file mode 100644 index 000000000..0d0dcb1b5 --- /dev/null +++ b/node_modules/stylelint/lib/utils/parseMediaQuery.js @@ -0,0 +1,16 @@ +'use strict'; + +const { parse } = require('@csstools/media-query-list-parser'); +const getAtRuleParams = require('./getAtRuleParams'); + +/** + * @param {import('postcss').AtRule} atRule + * @returns {ReturnType} + */ +module.exports = function parseMediaQuery(atRule) { + const mediaQueries = parse(getAtRuleParams(atRule), { + preserveInvalidMediaQueries: true, + }); + + return mediaQueries; +}; diff --git a/node_modules/stylelint/lib/utils/parseSelector.js b/node_modules/stylelint/lib/utils/parseSelector.js new file mode 100644 index 000000000..eba611c36 --- /dev/null +++ b/node_modules/stylelint/lib/utils/parseSelector.js @@ -0,0 +1,20 @@ +'use strict'; + +const selectorParser = require('postcss-selector-parser'); + +/** + * @param {string} selector + * @param {import('stylelint').PostcssResult} result + * @param {import('postcss').Node} node + * @param {(root: import('postcss-selector-parser').Root) => void} callback + * @returns {string | undefined} + */ +module.exports = function parseSelector(selector, result, node, callback) { + try { + return selectorParser(callback).processSync(selector); + } catch (err) { + result.warn(`Cannot parse selector (${err})`, { node, stylelintType: 'parseError' }); + + return undefined; + } +}; diff --git a/node_modules/stylelint/lib/utils/pluralize.js b/node_modules/stylelint/lib/utils/pluralize.js new file mode 100644 index 000000000..48644272d --- /dev/null +++ b/node_modules/stylelint/lib/utils/pluralize.js @@ -0,0 +1,12 @@ +'use strict'; + +/** + * Returns the plural form of the given word. + * + * @param {string} singular + * @param {number} count + * @returns {string} + */ +module.exports = function pluralize(singular, count) { + return count === 1 ? singular : `${singular}s`; +}; diff --git a/node_modules/stylelint/lib/utils/putIfAbsent.js b/node_modules/stylelint/lib/utils/putIfAbsent.js new file mode 100644 index 000000000..94057000c --- /dev/null +++ b/node_modules/stylelint/lib/utils/putIfAbsent.js @@ -0,0 +1,22 @@ +'use strict'; + +/** + * If `map` already has the given `key`, returns its value. Otherwise, calls + * `callback`, adds the result to `map` at `key`, and then returns it. + * + * @template K + * @template V + * @param {Map} map + * @param {K} key + * @param {() => V} callback + * @returns {V} + */ +module.exports = function putIfAbsent(map, key, callback) { + if (map.has(key)) return /** @type {V} */ (map.get(key)); + + const value = callback(); + + map.set(key, value); + + return value; +}; diff --git a/node_modules/stylelint/lib/utils/rawNodeString.js b/node_modules/stylelint/lib/utils/rawNodeString.js new file mode 100644 index 000000000..efb0e7c8f --- /dev/null +++ b/node_modules/stylelint/lib/utils/rawNodeString.js @@ -0,0 +1,20 @@ +'use strict'; + +/** + * Stringify PostCSS node including its raw "before" string. + * + * @param {import('postcss').Node} node + * + * @returns {string} + */ +module.exports = function rawNodeString(node) { + let result = ''; + + if (node.raws.before) { + result += node.raws.before; + } + + result += node.toString(); + + return result; +}; diff --git a/node_modules/stylelint/lib/utils/removeEmptyLinesAfter.js b/node_modules/stylelint/lib/utils/removeEmptyLinesAfter.js new file mode 100644 index 000000000..d1e8bdf8d --- /dev/null +++ b/node_modules/stylelint/lib/utils/removeEmptyLinesAfter.js @@ -0,0 +1,15 @@ +'use strict'; + +/** + * Remove empty lines before a node. Mutates the node. + * + * @template {import('postcss').Rule | import('postcss').AtRule} T + * @param {T} node + * @param {string} newline + * @returns {T} + */ +module.exports = function removeEmptyLinesAfter(node, newline) { + node.raws.after = node.raws.after ? node.raws.after.replace(/(\r?\n\s*\n)+/g, newline) : ''; + + return node; +}; diff --git a/node_modules/stylelint/lib/utils/removeEmptyLinesBefore.js b/node_modules/stylelint/lib/utils/removeEmptyLinesBefore.js new file mode 100644 index 000000000..7312419bc --- /dev/null +++ b/node_modules/stylelint/lib/utils/removeEmptyLinesBefore.js @@ -0,0 +1,15 @@ +'use strict'; + +/** + * Remove empty lines before a node. Mutates the node. + * + * @template {import('postcss').Node} T + * @param {T} node + * @param {string} newline + * @returns {T} + */ +module.exports = function removeEmptyLinesBefore(node, newline) { + node.raws.before = node.raws.before ? node.raws.before.replace(/(\r?\n\s*\n)+/g, newline) : ''; + + return node; +}; diff --git a/node_modules/stylelint/lib/utils/report.js b/node_modules/stylelint/lib/utils/report.js new file mode 100644 index 000000000..c9a7e814a --- /dev/null +++ b/node_modules/stylelint/lib/utils/report.js @@ -0,0 +1,146 @@ +'use strict'; + +/** + * Report a problem. + * + * This function accounts for `disabledRanges` attached to the result. + * That is, if the reported problem is within a disabledRange, + * it is ignored. Otherwise, it is attached to the result as a + * postcss warning. + * + * It also accounts for the rule's severity. + * + * You *must* pass *either* a node or a line number. + * + * @type {import('stylelint').Utils['report']} + */ +module.exports = function report(problem) { + const { ruleName, result, message, messageArgs, line, node, index, endIndex, word, severity } = + problem; + + result.stylelint = result.stylelint || { + ruleSeverities: {}, + customMessages: {}, + ruleMetadata: {}, + }; + + const ruleSeverity = + severity || (result.stylelint.ruleSeverities && result.stylelint.ruleSeverities[ruleName]); + + // In quiet mode, mere warnings are ignored + if (result.stylelint.quiet && ruleSeverity !== 'error') { + return; + } + + const { start } = (node && node.rangeBy({ index, endIndex })) || {}; + + // If a line is not passed, use the node.rangeBy method to get the + // line number that the complaint pertains to + const startLine = line || (start && start.line); + + if (!startLine) { + throw new Error('You must pass either a node or a line number'); + } + + const { ignoreDisables } = result.stylelint.config || {}; + + if (result.stylelint.disabledRanges) { + const ranges = + result.stylelint.disabledRanges[ruleName] || result.stylelint.disabledRanges.all || []; + + for (const range of ranges) { + if ( + // If the problem is within a disabledRange, + // and that disabledRange's rules include this one, + // do not register a warning + range.start <= startLine && + (range.end === undefined || range.end >= startLine) && + (!range.rules || range.rules.includes(ruleName)) + ) { + // Collect disabled warnings + // Used to report `needlessDisables` in subsequent processing. + const disabledWarnings = + result.stylelint.disabledWarnings || (result.stylelint.disabledWarnings = []); + + disabledWarnings.push({ + rule: ruleName, + line: startLine, + }); + + if (!ignoreDisables) { + return; + } + + break; + } + } + } + + if (!result.stylelint.stylelintError && ruleSeverity === 'error') { + result.stylelint.stylelintError = true; + } + + if (!result.stylelint.stylelintWarning && ruleSeverity === 'warning') { + result.stylelint.stylelintWarning = true; + } + + /** @type {import('stylelint').WarningOptions} */ + const warningProperties = { + severity: ruleSeverity, + rule: ruleName, + }; + + if (node) { + warningProperties.node = node; + } + + if (problem.start) { + warningProperties.start = problem.start; + } else if (index) { + warningProperties.index = index; + } + + if (problem.end) { + warningProperties.end = problem.end; + } else if (endIndex) { + warningProperties.endIndex = endIndex; + } + + if (word) { + warningProperties.word = word; + } + + const { customMessages } = result.stylelint; + const warningMessage = buildWarningMessage( + (customMessages && customMessages[ruleName]) || message, + messageArgs, + ); + + result.warn(warningMessage, warningProperties); +}; + +/** + * @param {import('stylelint').RuleMessage} message + * @param {import('stylelint').Problem['messageArgs']} messageArgs + * @returns {string} + */ +function buildWarningMessage(message, messageArgs) { + const args = messageArgs || []; + + if (typeof message === 'string') { + return printfLike(message, ...args); + } + + return message(...args); +} + +/** + * @param {string} format + * @param {Array} args + * @returns {string} + */ +function printfLike(format, ...args) { + return args.reduce((/** @type {string} */ result, arg) => { + return result.replace(/%[ds]/, String(arg)); + }, format); +} diff --git a/node_modules/stylelint/lib/utils/ruleMessages.js b/node_modules/stylelint/lib/utils/ruleMessages.js new file mode 100644 index 000000000..765fe4da1 --- /dev/null +++ b/node_modules/stylelint/lib/utils/ruleMessages.js @@ -0,0 +1,20 @@ +'use strict'; + +/** + * @type {import('stylelint').Utils['ruleMessages']} + */ +module.exports = function ruleMessages(ruleName, messages) { + /** @type {import('stylelint').RuleMessages} */ + const newMessages = {}; + + for (const [messageId, messageText] of Object.entries(messages)) { + if (typeof messageText === 'string') { + newMessages[messageId] = `${messageText} (${ruleName})`; + } else { + newMessages[messageId] = (...args) => `${messageText(...args)} (${ruleName})`; + } + } + + // @ts-expect-error -- TS2322: Type 'RuleMessages' is not assignable to type 'R'. + return newMessages; +}; diff --git a/node_modules/stylelint/lib/utils/setAtRuleParams.js b/node_modules/stylelint/lib/utils/setAtRuleParams.js new file mode 100644 index 000000000..eaf17c877 --- /dev/null +++ b/node_modules/stylelint/lib/utils/setAtRuleParams.js @@ -0,0 +1,20 @@ +'use strict'; + +/** @typedef {import('postcss').AtRule} AtRule */ + +/** + * @param {AtRule} atRule + * @param {string} params + * @returns {AtRule} The atRulearation that was passed in. + */ +module.exports = function setAtRuleParams(atRule, params) { + const raws = atRule.raws; + + if (raws.params) { + raws.params.raw = params; + } else { + atRule.params = params; + } + + return atRule; +}; diff --git a/node_modules/stylelint/lib/utils/setDeclarationValue.js b/node_modules/stylelint/lib/utils/setDeclarationValue.js new file mode 100644 index 000000000..57b5fecf6 --- /dev/null +++ b/node_modules/stylelint/lib/utils/setDeclarationValue.js @@ -0,0 +1,20 @@ +'use strict'; + +/** @typedef {import('postcss').Declaration} Declaration */ + +/** + * @param {Declaration} decl + * @param {string} value + * @returns {Declaration} The declaration that was passed in. + */ +module.exports = function setDeclarationValue(decl, value) { + const raws = decl.raws; + + if (raws.value) { + raws.value.raw = value; + } else { + decl.value = value; + } + + return decl; +}; diff --git a/node_modules/stylelint/lib/utils/transformSelector.js b/node_modules/stylelint/lib/utils/transformSelector.js new file mode 100644 index 000000000..abc8d77fa --- /dev/null +++ b/node_modules/stylelint/lib/utils/transformSelector.js @@ -0,0 +1,19 @@ +'use strict'; + +const selectorParser = require('postcss-selector-parser'); + +/** + * @param {import('stylelint').PostcssResult} result + * @param {import('postcss').Rule} node + * @param {(root: import('postcss-selector-parser').Root) => void} callback + * @returns {string | undefined} + */ +module.exports = function transformSelector(result, node, callback) { + try { + return selectorParser(callback).processSync(node, { updateSelector: true }); + } catch { + result.warn('Cannot parse selector', { node, stylelintType: 'parseError' }); + + return undefined; + } +}; diff --git a/node_modules/stylelint/lib/utils/typeGuards.js b/node_modules/stylelint/lib/utils/typeGuards.js new file mode 100644 index 000000000..705cccef7 --- /dev/null +++ b/node_modules/stylelint/lib/utils/typeGuards.js @@ -0,0 +1,68 @@ +'use strict'; + +/** @typedef {import('postcss').Node} Node */ +/** @typedef {import('postcss').Source} NodeSource */ + +/** + * @param {Node} node + * @returns {node is import('postcss').Root} + */ +module.exports.isRoot = function isRoot(node) { + return node.type === 'root'; +}; + +/** + * @param {Node} node + * @returns {node is import('postcss').Rule} + */ +module.exports.isRule = function isRule(node) { + return node.type === 'rule'; +}; + +/** + * @param {Node} node + * @returns {node is import('postcss').AtRule} + */ +module.exports.isAtRule = function isAtRule(node) { + return node.type === 'atrule'; +}; + +/** + * @param {Node} node + * @returns {node is import('postcss').Comment} + */ +module.exports.isComment = function isComment(node) { + return node.type === 'comment'; +}; + +/** + * @param {Node} node + * @returns {node is import('postcss').Declaration} + */ +module.exports.isDeclaration = function isDeclaration(node) { + return node.type === 'decl'; +}; + +/** + * @param {Node} node + * @returns {node is import('postcss').Document} + */ +module.exports.isDocument = function isDocument(node) { + return node.type === 'document'; +}; + +/** + * @param {import('postcss-value-parser').Node} node + * @returns {node is import('postcss-value-parser').FunctionNode} + */ +module.exports.isValueFunction = function isValueFunction(node) { + return node.type === 'function'; +}; + +/** + * @param {Node} node + * @returns {node is (Node & {source: NodeSource})} + */ +module.exports.hasSource = function hasSource(node) { + return Boolean(node.source); +}; diff --git a/node_modules/stylelint/lib/utils/uniteSets.js b/node_modules/stylelint/lib/utils/uniteSets.js new file mode 100644 index 000000000..6c089bd8c --- /dev/null +++ b/node_modules/stylelint/lib/utils/uniteSets.js @@ -0,0 +1,8 @@ +/** + * Unite two or more sets + * + * @param {Iterable[]} args + */ +module.exports = function uniteSets(...args) { + return new Set([...args].reduce((result, set) => [...result, ...set], [])); +}; diff --git a/node_modules/stylelint/lib/utils/validateObjectWithArrayProps.js b/node_modules/stylelint/lib/utils/validateObjectWithArrayProps.js new file mode 100644 index 000000000..f1eb71cd1 --- /dev/null +++ b/node_modules/stylelint/lib/utils/validateObjectWithArrayProps.js @@ -0,0 +1,31 @@ +'use strict'; + +const { isPlainObject } = require('./validateTypes'); + +/** + * Check whether the variable is an object and all its properties are one or more values + * that satisfy the specified validator(s): + * + * @example + * ignoreProperties = { + * value1: ["item11", "item12", "item13"], + * value2: "item2", + * }; + * validateObjectWithArrayProps(isString)(ignoreProperties); + * //=> true + * + * @typedef {(value: unknown) => boolean} Validator + * @param {...Validator} validators + * @returns {Validator} + */ +module.exports = function validateObjectWithArrayProps(...validators) { + return (value) => { + if (!isPlainObject(value)) { + return false; + } + + return Object.values(value) + .flat() + .every((item) => validators.some((v) => v(item))); + }; +}; diff --git a/node_modules/stylelint/lib/utils/validateObjectWithProps.js b/node_modules/stylelint/lib/utils/validateObjectWithProps.js new file mode 100644 index 000000000..36c124644 --- /dev/null +++ b/node_modules/stylelint/lib/utils/validateObjectWithProps.js @@ -0,0 +1,28 @@ +'use strict'; + +const { isPlainObject } = require('./validateTypes'); + +/** + * Check whether the variable is an object and all its properties agree with the provided validator. + * + * @example + * config = { + * value1: 1, + * value2: 2, + * value3: 3, + * }; + * validateObjectWithProps(isNumber)(config); + * //=> true + * + * @param {(value: unknown) => boolean} validator + * @returns {(value: unknown) => boolean} + */ +module.exports = (validator) => (value) => { + if (!isPlainObject(value)) { + return false; + } + + return Object.values(value).every((item) => { + return validator(item); + }); +}; diff --git a/node_modules/stylelint/lib/utils/validateOptions.js b/node_modules/stylelint/lib/utils/validateOptions.js new file mode 100644 index 000000000..37f738c6c --- /dev/null +++ b/node_modules/stylelint/lib/utils/validateOptions.js @@ -0,0 +1,174 @@ +'use strict'; + +const arrayEqual = require('./arrayEqual'); +const { isPlainObject } = require('./validateTypes'); + +const IGNORED_OPTIONS = new Set(['severity', 'message', 'reportDisables', 'disableFix']); + +/** @typedef {import('stylelint').RuleOptions} RuleOptions */ +/** @typedef {import('stylelint').RuleOptionsPossible} RuleOptionsPossible */ + +/** + * @type {import('stylelint').Utils['validateOptions']} + */ +module.exports = function validateOptions(result, ruleName, ...optionDescriptions) { + let noErrors = true; + + for (const optionDescription of optionDescriptions) { + validate(optionDescription, ruleName, complain); + } + + /** + * @param {string} message + */ + function complain(message) { + noErrors = false; + result.warn(message, { + stylelintType: 'invalidOption', + }); + result.stylelint = result.stylelint || { + disabledRanges: {}, + ruleSeverities: {}, + customMessages: {}, + ruleMetadata: {}, + }; + result.stylelint.stylelintError = true; + } + + return noErrors; +}; + +/** + * @param {RuleOptions} opts + * @param {string} ruleName + * @param {(message: string) => void} complain + */ +function validate(opts, ruleName, complain) { + const possible = opts.possible; + const actual = opts.actual; + const optional = opts.optional; + + if (actual === false && !ruleName.startsWith('report')) { + return complain( + `Invalid option value "false" for rule "${ruleName}". Are you trying to disable this rule? If so use "null" instead`, + ); + } + + if (actual === null || arrayEqual(actual, [null])) { + return; + } + + const nothingPossible = + possible === undefined || (Array.isArray(possible) && possible.length === 0); + + if (nothingPossible && actual === true) { + return; + } + + if (actual === undefined) { + if (nothingPossible || optional) { + return; + } + + complain(`Expected option value for rule "${ruleName}"`); + + return; + } + + if (nothingPossible) { + if (optional) { + complain( + `Incorrect configuration for rule "${ruleName}". Rule should have "possible" values for options validation`, + ); + + return; + } + + complain(`Unexpected option value ${stringify(actual)} for rule "${ruleName}"`); + + return; + } + + if (typeof possible === 'function') { + if (!possible(actual)) { + complain(`Invalid option ${stringify(actual)} for rule "${ruleName}"`); + } + + return; + } + + // If `possible` is an array instead of an object ... + if (Array.isArray(possible)) { + for (const a of [actual].flat()) { + if (isValid(possible, a)) { + continue; + } + + complain(`Invalid option value ${stringify(a)} for rule "${ruleName}"`); + } + + return; + } + + // If actual is NOT an object ... + if (!isPlainObject(actual) || typeof actual !== 'object' || actual === null) { + complain( + `Invalid option value ${stringify(actual)} for rule "${ruleName}": should be an object`, + ); + + return; + } + + for (const [optionName, optionValue] of Object.entries(actual)) { + if (IGNORED_OPTIONS.has(optionName)) { + continue; + } + + const possibleValue = possible && possible[optionName]; + + if (!possibleValue) { + complain(`Invalid option name "${optionName}" for rule "${ruleName}"`); + + continue; + } + + for (const a of [optionValue].flat()) { + if (isValid(possibleValue, a)) { + continue; + } + + complain(`Invalid value ${stringify(a)} for option "${optionName}" of rule "${ruleName}"`); + } + } +} + +/** + * @param {RuleOptionsPossible | RuleOptionsPossible[]} possible + * @param {unknown} actual + * @returns {boolean} + */ +function isValid(possible, actual) { + for (const possibility of [possible].flat()) { + if (typeof possibility === 'function' && possibility(actual)) { + return true; + } + + if (actual === possibility) { + return true; + } + } + + return false; +} + +/** + * @param {unknown} value + * @returns {string} + */ +function stringify(value) { + if (typeof value === 'string') { + return `"${value}"`; + } + + return `"${JSON.stringify(value)}"`; +} diff --git a/node_modules/stylelint/lib/utils/validateTypes.js b/node_modules/stylelint/lib/utils/validateTypes.js new file mode 100644 index 000000000..5372bcadf --- /dev/null +++ b/node_modules/stylelint/lib/utils/validateTypes.js @@ -0,0 +1,138 @@ +'use strict'; + +const { isPlainObject: _isPlainObject } = require('is-plain-object'); + +/** + * Checks if the value is a boolean or a Boolean object. + * @param {unknown} value + * @returns {value is boolean} + */ +function isBoolean(value) { + return typeof value === 'boolean' || value instanceof Boolean; +} + +/** + * Checks if the value is a function or a Function object. + * @param {unknown} value + * @returns {value is Function} + */ +function isFunction(value) { + return typeof value === 'function' || value instanceof Function; +} + +/** + * Checks if the value is *nullish*. + * @see https://developer.mozilla.org/en-US/docs/Glossary/Nullish + * @param {unknown} value + * @returns {value is null | undefined} + */ +function isNullish(value) { + return value == null; +} + +/** + * Checks if the value is a number or a Number object. + * @param {unknown} value + * @returns {value is number} + */ +function isNumber(value) { + return typeof value === 'number' || value instanceof Number; +} + +/** + * Checks if the value is an object. + * @param {unknown} value + * @returns {value is object} + */ +function isObject(value) { + return value !== null && typeof value === 'object'; +} + +/** + * Checks if the value is a regular expression. + * @param {unknown} value + * @returns {value is RegExp} + */ +function isRegExp(value) { + return value instanceof RegExp; +} + +/** + * Checks if the value is a string or a String object. + * @param {unknown} value + * @returns {value is string} + */ +function isString(value) { + return typeof value === 'string' || value instanceof String; +} + +/** + * Checks if the value is a plain object. + * @param {unknown} value + * @returns {value is Record} + */ +function isPlainObject(value) { + return _isPlainObject(value); +} + +/** + * Assert that the value is truthy. + * @param {unknown} value + * @param {string} [message] + * @returns {asserts value} + */ +function assert(value, message = undefined) { + if (message) { + // eslint-disable-next-line no-console + console.assert(value, message); + } else { + // eslint-disable-next-line no-console + console.assert(value); + } +} + +/** + * Assert that the value is a function or a Function object. + * @param {unknown} value + * @returns {asserts value is Function} + */ +function assertFunction(value) { + // eslint-disable-next-line no-console + console.assert(isFunction(value), `"${value}" must be a function`); +} + +/** + * Assert that the value is a number or a Number object. + * @param {unknown} value + * @returns {asserts value is number} + */ +function assertNumber(value) { + // eslint-disable-next-line no-console + console.assert(isNumber(value), `"${value}" must be a number`); +} + +/** + * Assert that the value is a string or a String object. + * @param {unknown} value + * @returns {asserts value is string} + */ +function assertString(value) { + // eslint-disable-next-line no-console + console.assert(isString(value), `"${value}" must be a string`); +} + +module.exports = { + isBoolean, + isFunction, + isNullish, + isNumber, + isObject, + isRegExp, + isString, + isPlainObject, + + assert, + assertFunction, + assertNumber, + assertString, +}; diff --git a/node_modules/stylelint/lib/utils/vendor.js b/node_modules/stylelint/lib/utils/vendor.js new file mode 100644 index 000000000..304182cc8 --- /dev/null +++ b/node_modules/stylelint/lib/utils/vendor.js @@ -0,0 +1,45 @@ +'use strict'; + +/** + * Contains helpers for working with vendor prefixes. + * + * Copied from https://github.com/postcss/postcss/commit/777c55b5d2a10605313a4972888f4f32005f5ac2 + * + * @namespace vendor + */ +module.exports = { + /** + * Returns the vendor prefix extracted from an input string. + * + * @param {string} prop String with or without vendor prefix. + * + * @return {string} vendor prefix or empty string + * + * @example + * vendor.prefix('-moz-tab-size') //=> '-moz-' + * vendor.prefix('tab-size') //=> '' + */ + prefix(prop) { + const match = prop.match(/^(-\w+-)/); + + if (match) { + return match[0] || ''; + } + + return ''; + }, + + /** + * Returns the input string stripped of its vendor prefix. + * + * @param {string} prop String with or without vendor prefix. + * + * @return {string} String name without vendor prefixes. + * + * @example + * vendor.unprefixed('-moz-tab-size') //=> 'tab-size' + */ + unprefixed(prop) { + return prop.replace(/^-\w+-/, ''); + }, +}; diff --git a/node_modules/stylelint/lib/utils/whitespaceChecker.js b/node_modules/stylelint/lib/utils/whitespaceChecker.js new file mode 100644 index 000000000..cf72eecf4 --- /dev/null +++ b/node_modules/stylelint/lib/utils/whitespaceChecker.js @@ -0,0 +1,340 @@ +'use strict'; + +const configurationError = require('./configurationError'); +const isSingleLineString = require('./isSingleLineString'); +const isWhitespace = require('./isWhitespace'); +const { assertFunction, isNullish } = require('./validateTypes'); + +/** + * @typedef {(message: string) => string} MessageFunction + */ + +/** + * @typedef {Object} Messages + * @property {MessageFunction} [expectedBefore] + * @property {MessageFunction} [rejectedBefore] + * @property {MessageFunction} [expectedAfter] + * @property {MessageFunction} [rejectedAfter] + * @property {MessageFunction} [expectedBeforeSingleLine] + * @property {MessageFunction} [rejectedBeforeSingleLine] + * @property {MessageFunction} [expectedBeforeMultiLine] + * @property {MessageFunction} [rejectedBeforeMultiLine] + * @property {MessageFunction} [expectedAfterSingleLine] + * @property {MessageFunction} [rejectedAfterSingleLine] + * @property {MessageFunction} [expectedAfterMultiLine] + * @property {MessageFunction} [rejectedAfterMultiLine] + */ + +/** + * @typedef {Object} WhitespaceCheckerArgs + * @property {string} source - The source string + * @property {number} index - The index of the character to check before + * @property {(message: string) => void} err - If a problem is found, this callback + * will be invoked with the relevant warning message. + * Typically this callback will report() the problem. + * @property {string} [errTarget] - If a problem is found, this string + * will be sent to the relevant warning message. + * @property {string} [lineCheckStr] - Single- and multi-line checkers + * will use this string to determine whether they should proceed, + * i.e. if this string is one line only, single-line checkers will check, + * multi-line checkers will ignore. + * If none is passed, they will use `source`. + * @property {boolean} [onlyOneChar=false] - Only check *one* character before. + * By default, "always-*" checks will look for the `targetWhitespace` one + * before and then ensure there is no whitespace two before. This option + * bypasses that second check. + * @property {boolean} [allowIndentation=false] - Allow arbitrary indentation + * between the `targetWhitespace` (almost definitely a newline) and the `index`. + * With this option, the checker will see if a newline *begins* the whitespace before + * the `index`. + */ + +/** + * @typedef {(args: WhitespaceCheckerArgs) => void} WhitespaceChecker + */ + +/** + * @typedef {{ + * before: WhitespaceChecker, + * beforeAllowingIndentation: WhitespaceChecker, + * after: WhitespaceChecker, + * afterOneOnly: WhitespaceChecker, + * }} WhitespaceCheckers + */ + +/** + * Create a whitespaceChecker, which exposes the following functions: + * - `before()` + * - `beforeAllowingIndentation()` + * - `after()` + * - `afterOneOnly()` + * + * @param {"space" | "newline"} targetWhitespace - This is a keyword instead + * of the actual character (e.g. " ") in order to accommodate + * different styles of newline ("\n" vs "\r\n") + * @param {"always" | "never" | "always-single-line" | "always-multi-line" | "never-single-line" | "never-multi-line"} expectation + * @param {Messages} messages - An object of message functions; + * calling `before*()` or `after*()` and the `expectation` that is passed + * determines which message functions are required + * + * @returns {WhitespaceCheckers} The checker, with its exposed checking functions + */ +module.exports = function whitespaceChecker(targetWhitespace, expectation, messages) { + // Keep track of active arguments in order to avoid passing + // too much stuff around, making signatures long and confusing. + // This variable gets reset anytime a checking function is called. + /** @type {WhitespaceCheckerArgs} */ + let activeArgs; + + /** + * Check for whitespace *before* a character. + * @type {WhitespaceChecker} + */ + function before({ + source, + index, + err, + errTarget, + lineCheckStr, + onlyOneChar = false, + allowIndentation = false, + }) { + activeArgs = { + source, + index, + err, + errTarget, + onlyOneChar, + allowIndentation, + }; + + switch (expectation) { + case 'always': + expectBefore(); + break; + case 'never': + rejectBefore(); + break; + case 'always-single-line': + if (!isSingleLineString(lineCheckStr || source)) { + return; + } + + expectBefore(messages.expectedBeforeSingleLine); + break; + case 'never-single-line': + if (!isSingleLineString(lineCheckStr || source)) { + return; + } + + rejectBefore(messages.rejectedBeforeSingleLine); + break; + case 'always-multi-line': + if (isSingleLineString(lineCheckStr || source)) { + return; + } + + expectBefore(messages.expectedBeforeMultiLine); + break; + case 'never-multi-line': + if (isSingleLineString(lineCheckStr || source)) { + return; + } + + rejectBefore(messages.rejectedBeforeMultiLine); + break; + default: + throw configurationError(`Unknown expectation "${expectation}"`); + } + } + + /** + * Check for whitespace *after* a character. + * @type {WhitespaceChecker} + */ + function after({ source, index, err, errTarget, lineCheckStr, onlyOneChar = false }) { + activeArgs = { source, index, err, errTarget, onlyOneChar }; + + switch (expectation) { + case 'always': + expectAfter(); + break; + case 'never': + rejectAfter(); + break; + case 'always-single-line': + if (!isSingleLineString(lineCheckStr || source)) { + return; + } + + expectAfter(messages.expectedAfterSingleLine); + break; + case 'never-single-line': + if (!isSingleLineString(lineCheckStr || source)) { + return; + } + + rejectAfter(messages.rejectedAfterSingleLine); + break; + case 'always-multi-line': + if (isSingleLineString(lineCheckStr || source)) { + return; + } + + expectAfter(messages.expectedAfterMultiLine); + break; + case 'never-multi-line': + if (isSingleLineString(lineCheckStr || source)) { + return; + } + + rejectAfter(messages.rejectedAfterMultiLine); + break; + default: + throw configurationError(`Unknown expectation "${expectation}"`); + } + } + + /** + * @type {WhitespaceChecker} + */ + function beforeAllowingIndentation(obj) { + before({ ...obj, allowIndentation: true }); + } + + function expectBefore(messageFunc = messages.expectedBefore) { + if (activeArgs.allowIndentation) { + expectBeforeAllowingIndentation(messageFunc); + + return; + } + + const _activeArgs = activeArgs; + const source = _activeArgs.source; + const index = _activeArgs.index; + + const oneCharBefore = source[index - 1]; + const twoCharsBefore = source[index - 2]; + + if (isNullish(oneCharBefore)) { + return; + } + + if ( + targetWhitespace === 'space' && + oneCharBefore === ' ' && + (activeArgs.onlyOneChar || isNullish(twoCharsBefore) || !isWhitespace(twoCharsBefore)) + ) { + return; + } + + assertFunction(messageFunc); + activeArgs.err(messageFunc(activeArgs.errTarget || source.charAt(index))); + } + + function expectBeforeAllowingIndentation(messageFunc = messages.expectedBefore) { + const _activeArgs2 = activeArgs; + const source = _activeArgs2.source; + const index = _activeArgs2.index; + const err = _activeArgs2.err; + + const expectedChar = targetWhitespace === 'newline' ? '\n' : undefined; + let i = index - 1; + + while (source[i] !== expectedChar) { + if (source[i] === '\t' || source[i] === ' ') { + i--; + continue; + } + + assertFunction(messageFunc); + err(messageFunc(activeArgs.errTarget || source.charAt(index))); + + return; + } + } + + function rejectBefore(messageFunc = messages.rejectedBefore) { + const _activeArgs3 = activeArgs; + const source = _activeArgs3.source; + const index = _activeArgs3.index; + + const oneCharBefore = source[index - 1]; + + if (!isNullish(oneCharBefore) && isWhitespace(oneCharBefore)) { + assertFunction(messageFunc); + activeArgs.err(messageFunc(activeArgs.errTarget || source.charAt(index))); + } + } + + /** + * @type {WhitespaceChecker} + */ + function afterOneOnly(obj) { + after({ ...obj, onlyOneChar: true }); + } + + function expectAfter(messageFunc = messages.expectedAfter) { + const _activeArgs4 = activeArgs; + const source = _activeArgs4.source; + const index = _activeArgs4.index; + + const oneCharAfter = source[index + 1]; + const twoCharsAfter = source[index + 2]; + const threeCharsAfter = source[index + 3]; + + if (isNullish(oneCharAfter)) { + return; + } + + if (targetWhitespace === 'newline') { + // If index is followed by a Windows CR-LF ... + if ( + oneCharAfter === '\r' && + twoCharsAfter === '\n' && + (activeArgs.onlyOneChar || isNullish(threeCharsAfter) || !isWhitespace(threeCharsAfter)) + ) { + return; + } + + // If index is followed by a Unix LF ... + if ( + oneCharAfter === '\n' && + (activeArgs.onlyOneChar || isNullish(twoCharsAfter) || !isWhitespace(twoCharsAfter)) + ) { + return; + } + } + + if ( + targetWhitespace === 'space' && + oneCharAfter === ' ' && + (activeArgs.onlyOneChar || isNullish(twoCharsAfter) || !isWhitespace(twoCharsAfter)) + ) { + return; + } + + assertFunction(messageFunc); + activeArgs.err(messageFunc(activeArgs.errTarget || source.charAt(index))); + } + + function rejectAfter(messageFunc = messages.rejectedAfter) { + const _activeArgs5 = activeArgs; + const source = _activeArgs5.source; + const index = _activeArgs5.index; + + const oneCharAfter = source[index + 1]; + + if (!isNullish(oneCharAfter) && isWhitespace(oneCharAfter)) { + assertFunction(messageFunc); + activeArgs.err(messageFunc(activeArgs.errTarget || source.charAt(index))); + } + } + + return { + before, + beforeAllowingIndentation, + after, + afterOneOnly, + }; +}; diff --git a/node_modules/stylelint/lib/validateDisableSettings.js b/node_modules/stylelint/lib/validateDisableSettings.js new file mode 100644 index 000000000..9f093b40c --- /dev/null +++ b/node_modules/stylelint/lib/validateDisableSettings.js @@ -0,0 +1,79 @@ +'use strict'; + +const validateOptions = require('./utils/validateOptions'); +const { isRegExp, isString } = require('./utils/validateTypes'); + +/** + * @typedef {import('stylelint').PostcssResult} PostcssResult + * @typedef {import('stylelint').DisableOptions} DisableOptions + * @typedef {import('stylelint').DisablePropertyName} DisablePropertyName + * @typedef {import('stylelint').StylelintPostcssResult} StylelintPostcssResult + */ + +/** + * Validates that the stylelint config for `result` has a valid disable field + * named `field`, and returns the result in normalized form as well as a + * `StylelintPostcssResult` for convenience. + * + * Returns `null` if no disables should be reported, and automatically reports + * an invalid configuration. If this returns non-`null`, it guarantees that + * `result._postcssResult` is defined as well. + * + * @param {PostcssResult | undefined} result + * @param {DisablePropertyName} field + * @return {[boolean, Required, StylelintPostcssResult] | null} + */ +module.exports = function validateDisableSettings(result, field) { + // Files with `CssSyntaxError`s don't have `_postcssResult`s. + if (!result) return null; + + const stylelintResult = result.stylelint; + + // Files with linting errors may not have configs associated with them. + if (!stylelintResult.config) return null; + + const rawSettings = stylelintResult.config[field]; + + /** @type {boolean} */ + let enabled; + /** @type {DisableOptions} */ + let options; + + if (Array.isArray(rawSettings)) { + enabled = rawSettings[0]; + options = rawSettings[1] || {}; + } else { + enabled = rawSettings || false; + options = {}; + } + + const validOptions = validateOptions( + result, + field, + { + actual: enabled, + possible: [true, false], + }, + { + actual: options, + possible: { + except: [isString, isRegExp], + }, + }, + ); + + if (!validOptions) return null; + + // If the check is disabled with no exceptions, there's no reason to run + // it at all. + if (!enabled && !options.except) return null; + + return [ + enabled, + { + except: options.except || [], + severity: options.severity || stylelintResult.config.defaultSeverity || 'error', + }, + stylelintResult, + ]; +}; diff --git a/node_modules/stylelint/lib/writeOutputFile.js b/node_modules/stylelint/lib/writeOutputFile.js new file mode 100644 index 000000000..d77ee36d7 --- /dev/null +++ b/node_modules/stylelint/lib/writeOutputFile.js @@ -0,0 +1,17 @@ +'use strict'; + +const path = require('path'); +const { mkdir } = require('fs').promises; +const stripAnsi = require('strip-ansi'); +const writeFileAtomic = require('write-file-atomic'); + +/** + * @param {string} content + * @param {string} filePath + * @returns {Promise} + */ +module.exports = async function writeOutputFile(content, filePath) { + await mkdir(path.dirname(filePath), { recursive: true }); + + await writeFileAtomic(path.normalize(filePath), stripAnsi(content)); +}; diff --git a/node_modules/stylelint/package.json b/node_modules/stylelint/package.json new file mode 100644 index 000000000..79df8a893 --- /dev/null +++ b/node_modules/stylelint/package.json @@ -0,0 +1,224 @@ +{ + "name": "stylelint", + "version": "15.10.1", + "description": "A mighty CSS linter that helps you avoid errors and enforce conventions.", + "keywords": [ + "css-in-js", + "css", + "less", + "lint", + "linter", + "markdown", + "sass", + "scss", + "stylelint", + "sugarss" + ], + "homepage": "https://stylelint.io", + "repository": "stylelint/stylelint", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stylelint" + }, + "license": "MIT", + "author": "stylelint", + "main": "lib/index.js", + "types": "types/stylelint/index.d.ts", + "bin": { + "stylelint": "bin/stylelint.mjs" + }, + "files": [ + "bin/**/*.js", + "bin/**/*.mjs", + "lib/**/*.js", + "lib/**/*.mjs", + "!**/__tests__/**", + "!lib/testUtils/**", + "types/stylelint/index.d.ts" + ], + "scripts": { + "benchmark-rule": "node scripts/benchmark-rule.mjs", + "format": "prettier . --write --cache", + "lint": "npm-run-all --parallel --continue-on-error lint:*", + "lint:formatting": "prettier . --check --cache", + "lint:js": "eslint . --cache --max-warnings=0 --ext .js,.mjs", + "lint:md": "remark . --quiet --frail", + "lint:types": "tsc", + "prepare": "husky install && patch-package", + "release": "np --no-release-draft", + "pretest": "npm run lint", + "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", + "test-coverage": "npm test --ignore-scripts -- --coverage", + "test-only": "npm test --ignore-scripts", + "version": "changeset version", + "postversion": "git restore package.json", + "watch": "npm test --ignore-scripts -- --watch", + "changelog-to-github-release": "remark --quiet --use ./scripts/remark-changelog-to-github-release.mjs CHANGELOG.md" + }, + "lint-staged": { + "*.{js,mjs}": "eslint --cache --fix", + "*.{js,json,md,mjs,ts,yml}": "prettier --write" + }, + "prettier": "@stylelint/prettier-config", + "eslintConfig": { + "extends": [ + "stylelint", + "stylelint/jest" + ], + "overrides": [ + { + "files": [ + "**/*.mjs" + ], + "plugins": [ + "eslint-plugin-import" + ], + "rules": { + "import/extensions": [ + "error", + "ignorePackages" + ] + } + } + ], + "globals": { + "__dirname": true, + "module": true, + "require": true, + "testRule": true + }, + "root": true + }, + "remarkConfig": { + "plugins": [ + "@stylelint/remark-preset" + ] + }, + "jest": { + "clearMocks": true, + "collectCoverage": false, + "collectCoverageFrom": [ + "lib/**/*.{js,mjs}", + "!lib/**/{__tests__,testUtils}/**/*.{js,mjs}" + ], + "coverageDirectory": "./.coverage/", + "coverageProvider": "v8", + "coverageReporters": [ + "lcov", + "text-summary" + ], + "coverageThreshold": { + "global": { + "branches": 75, + "functions": 75, + "lines": 75, + "statements": 75 + } + }, + "moduleNameMapper": { + "^stylelint$": "/lib/index.js", + "stylelint/lib/utils/getOsEol": "/lib/utils/getOsEol.js" + }, + "preset": "jest-preset-stylelint", + "roots": [ + "lib", + "system-tests" + ], + "testEnvironment": "node", + "testRegex": ".*\\.test\\.m?js$|rules/.*/__tests__/.*\\.m?js$", + "watchPlugins": [ + "jest-watch-typeahead/filename", + "jest-watch-typeahead/testname" + ] + }, + "dependencies": { + "@csstools/css-parser-algorithms": "^2.3.0", + "@csstools/css-tokenizer": "^2.1.1", + "@csstools/media-query-list-parser": "^2.1.2", + "@csstools/selector-specificity": "^3.0.0", + "balanced-match": "^2.0.0", + "colord": "^2.9.3", + "cosmiconfig": "^8.2.0", + "css-functions-list": "^3.1.0", + "css-tree": "^2.3.1", + "debug": "^4.3.4", + "fast-glob": "^3.3.0", + "fastest-levenshtein": "^1.0.16", + "file-entry-cache": "^6.0.1", + "global-modules": "^2.0.0", + "globby": "^11.1.0", + "globjoin": "^0.1.4", + "html-tags": "^3.3.1", + "ignore": "^5.2.4", + "import-lazy": "^4.0.0", + "imurmurhash": "^0.1.4", + "is-plain-object": "^5.0.0", + "known-css-properties": "^0.27.0", + "mathml-tag-names": "^2.1.3", + "meow": "^10.1.5", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.24", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-safe-parser": "^6.0.0", + "postcss-selector-parser": "^6.0.13", + "postcss-value-parser": "^4.2.0", + "resolve-from": "^5.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "style-search": "^0.1.0", + "supports-hyperlinks": "^3.0.0", + "svg-tags": "^1.0.0", + "table": "^6.8.1", + "write-file-atomic": "^5.0.1" + }, + "devDependencies": { + "@changesets/cli": "^2.26.2", + "@changesets/get-github-info": "^0.5.2", + "@jest/globals": "^29.5.0", + "@stylelint/prettier-config": "^2.0.0", + "@stylelint/remark-preset": "^4.0.0", + "@types/balanced-match": "^1.0.2", + "@types/css-tree": "^2.3.1", + "@types/debug": "^4.1.8", + "@types/file-entry-cache": "^5.0.2", + "@types/global-modules": "^2.0.0", + "@types/globjoin": "^0.1.0", + "@types/imurmurhash": "^0.1.1", + "@types/micromatch": "^4.0.2", + "@types/normalize-path": "^3.0.0", + "@types/postcss-less": "^4.0.2", + "@types/postcss-resolve-nested-selector": "^0.1.0", + "@types/postcss-safe-parser": "^5.0.1", + "@types/style-search": "^0.1.3", + "@types/svg-tags": "^1.0.0", + "@types/write-file-atomic": "^4.0.0", + "benchmark": "^2.1.4", + "common-tags": "^1.8.2", + "deepmerge": "^4.3.1", + "eslint": "^8.44.0", + "eslint-config-stylelint": "^19.0.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-jest": "^27.2.2", + "husky": "^8.0.3", + "jest": "^29.5.0", + "jest-preset-stylelint": "^6.1.0", + "jest-watch-typeahead": "^2.2.2", + "lint-staged": "^13.2.3", + "np": "^8.0.4", + "npm-run-all": "^4.1.5", + "patch-package": "^7.0.0", + "postcss-html": "^1.5.0", + "postcss-import": "^15.1.0", + "postcss-less": "^6.0.0", + "postcss-sass": "^0.5.0", + "postcss-scss": "^4.0.6", + "remark-cli": "^11.0.0", + "sugarss": "^4.0.1", + "typescript": "^5.1.6" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + } +} diff --git a/node_modules/stylelint/types/stylelint/index.d.ts b/node_modules/stylelint/types/stylelint/index.d.ts new file mode 100644 index 000000000..2641dfc8a --- /dev/null +++ b/node_modules/stylelint/types/stylelint/index.d.ts @@ -0,0 +1,639 @@ +import type * as PostCSS from 'postcss'; +import type { GlobbyOptions } from 'globby'; +import type { cosmiconfig, TransformSync as CosmiconfigTransformSync } from 'cosmiconfig'; + +type ConfigExtends = string | string[]; +type ConfigPlugins = string | stylelint.Plugin | (string | stylelint.Plugin)[]; +type ConfigIgnoreFiles = string | string[]; + +type ConfigRules = { + [ruleName: string]: stylelint.ConfigRuleSettings; +}; +type ConfigOverride = Omit & { + files: string | string[]; +}; + +type DisableSettings = stylelint.ConfigRuleSettings; + +// A meta-type that returns a union over all properties of `T` whose values +// have type `U`. +type PropertyNamesOfType = { + [K in keyof T]-?: T[K] extends U ? K : never; +}[keyof T]; + +type FileCache = { + calcHashOfConfig: (config: stylelint.Config) => void; + hasFileChanged: (absoluteFilepath: string) => boolean; + reconcile: () => void; + destroy: () => void; + removeEntry: (absoluteFilepath: string) => void; +}; + +type EmptyResult = { + root: { + nodes?: undefined; + source: { + lang?: undefined; + input: { + file?: string; + }; + }; + }; + messages: PostCSS.Message[]; + opts: undefined; +}; + +// Note: With strict function types enabled, function signatures are checked contravariantly. +// This means that it would not be possible for rule authors to narrow the message function +// parameters to e.g. just `string`. Declaring the type for rule message functions through +// method declarations tricks TypeScript into bivariant signature checking. More details can +// be found here: https://stackoverflow.com/questions/52667959/what-is-the-purpose-of-bivariancehack-in-typescript-types. +// and in the original discussion: https://github.com/stylelint/stylelint/pull/6147#issuecomment-1155337016. +type RuleMessageFunc = { + bivariance(...args: (string | number | boolean | RegExp)[]): string; +}['bivariance']; + +type RuleOptionsPossibleFunc = (value: unknown) => boolean; + +type DisableReportEntry = { + source?: string; + ranges: stylelint.DisableReportRange[]; +}; + +declare namespace stylelint { + /** + * Rule severity. + */ + type Severity = 'warning' | 'error'; + + /** + * A Stylelint plugin. + */ + type Plugin = { default?: { ruleName: string; rule: Rule } } | { ruleName: string; rule: Rule }; + + /** @internal */ + type ConfigRuleSettings = + | null + | undefined + | NonNullable + | [NonNullable] + | [NonNullable, O]; + + /** @internal */ + type DisableOptions = { + except?: (string | RegExp)[]; + severity?: Severity; + }; + + /** + * Configuration. + */ + type Config = { + extends?: ConfigExtends; + plugins?: ConfigPlugins; + pluginFunctions?: { + [pluginName: string]: Rule; + }; + ignoreFiles?: ConfigIgnoreFiles; + ignorePatterns?: string; + rules?: ConfigRules; + quiet?: boolean; + defaultSeverity?: Severity; + ignoreDisables?: DisableSettings; + reportNeedlessDisables?: DisableSettings; + reportInvalidScopeDisables?: DisableSettings; + reportDescriptionlessDisables?: DisableSettings; + configurationComment?: string; + overrides?: ConfigOverride[]; + customSyntax?: CustomSyntax; + allowEmptyInput?: boolean; + cache?: boolean; + fix?: boolean; + }; + + /** @internal */ + type DisablePropertyName = PropertyNamesOfType; + + /** @internal */ + type CosmiconfigResult = (ReturnType & { config: Config }) | null; + + /** @internal */ + type DisabledRange = { + comment: PostCSS.Comment; + start: number; + strictStart: boolean; + end?: number; + strictEnd?: boolean; + rules?: string[]; + description?: string; + }; + + /** @internal */ + type DisabledRangeObject = { + [ruleName: string]: DisabledRange[]; + }; + + /** @internal */ + type DisabledWarning = { line: number; rule: string }; + + /** @internal */ + type StylelintPostcssResult = { + ruleSeverities: { [ruleName: string]: Severity }; + customMessages: { [ruleName: string]: RuleMessage }; + ruleMetadata: { [ruleName: string]: Partial }; + quiet?: boolean; + disabledRanges: DisabledRangeObject; + disabledWarnings?: DisabledWarning[]; + ignored?: boolean; + stylelintError?: boolean; + stylelintWarning?: boolean; + disableWritingFix?: boolean; + config?: Config; + }; + + /** @internal */ + type WarningOptions = PostCSS.WarningOptions & { + stylelintType?: string; + severity?: Severity; + rule?: string; + }; + + /** @internal */ + type PostcssResult = (PostCSS.Result | EmptyResult) & { + stylelint: StylelintPostcssResult; + warn(message: string, options?: WarningOptions): void; + }; + + /** @internal */ + type Formatter = (results: LintResult[], returnValue: LinterResult) => string; + + /** @internal */ + type FormatterType = 'compact' | 'github' | 'json' | 'string' | 'tap' | 'unix' | 'verbose'; + + /** @internal */ + type CustomSyntax = string | PostCSS.Syntax; + + /** @internal */ + type RuleMessage = string | RuleMessageFunc; + + /** @internal */ + type RuleMessages = { [message: string]: RuleMessage }; + + /** @internal */ + type RuleOptionsPossible = boolean | number | string | RuleOptionsPossibleFunc; + + /** @internal */ + type RuleOptions = { + actual: unknown; + possible?: + | RuleOptionsPossibleFunc + | RuleOptionsPossible[] + | Record; + optional?: boolean; + }; + + /** + * A rule context. + */ + type RuleContext = { + configurationComment?: string | undefined; + fix?: boolean | undefined; + newline?: string | undefined; + }; + + /** @internal */ + type RuleBase

= ( + primaryOption: P, + secondaryOptions: Record, + context: RuleContext, + ) => (root: PostCSS.Root, result: PostcssResult) => Promise | void; + + /** @internal */ + type RuleMeta = { + url: string; + deprecated?: boolean; + fixable?: boolean; + }; + + /** + * A rule. + */ + type Rule

= RuleBase & { + ruleName: string; + messages: RuleMessages; + primaryOptionArray?: boolean; + meta?: RuleMeta; + }; + + /** @internal */ + type GetPostcssOptions = { + code?: string; + codeFilename?: string; + filePath?: string; + customSyntax?: CustomSyntax; + }; + + /** @internal */ + type GetLintSourceOptions = GetPostcssOptions & { + existingPostcssResult?: PostCSS.Result; + cache?: boolean; + }; + + /** + * Linter options. + */ + type LinterOptions = { + files?: string | string[]; + globbyOptions?: GlobbyOptions; + cache?: boolean; + cacheLocation?: string; + cacheStrategy?: string; + code?: string; + codeFilename?: string; + config?: Config; + configFile?: string; + configBasedir?: string; + /** + * The working directory to resolve files from. Defaults to the + * current working directory. + */ + cwd?: string; + ignoreDisables?: boolean; + ignorePath?: string | string[]; + ignorePattern?: string[]; + reportDescriptionlessDisables?: boolean; + reportNeedlessDisables?: boolean; + reportInvalidScopeDisables?: boolean; + maxWarnings?: number; + customSyntax?: CustomSyntax; + formatter?: FormatterType | Formatter; + disableDefaultIgnores?: boolean; + fix?: boolean; + allowEmptyInput?: boolean; + quiet?: boolean; + quietDeprecationWarnings?: boolean; + }; + + /** + * A CSS syntax error. + */ + type CssSyntaxError = { + file?: string; + input: { + column: number; + file?: string; + line: number; + source: string; + }; + /** + * The line of the inclusive start position of the error. + */ + line: number; + /** + * The column of the inclusive start position of the error. + */ + column: number; + /** + * The line of the exclusive end position of the error. + */ + endLine?: number; + /** + * The column of the exclusive end position of the error. + */ + endColumn?: number; + message: string; + name: string; + reason: string; + source: string; + }; + + /** + * A lint warning. + */ + type Warning = { + /** + * The line of the inclusive start position of the warning. + */ + line: number; + /** + * The column of the inclusive start position of the warning. + */ + column: number; + /** + * The line of the exclusive end position of the warning. + */ + endLine?: number; + /** + * The column of the exclusive end position of the warning. + */ + endColumn?: number; + rule: string; + severity: Severity; + text: string; + stylelintType?: string; + }; + + /** + * A lint result. + */ + type LintResult = { + source?: string; + deprecations: { + text: string; + reference?: string; + }[]; + invalidOptionWarnings: { + text: string; + }[]; + parseErrors: (PostCSS.Warning & { stylelintType: string })[]; + errored?: boolean; + warnings: Warning[]; + ignored?: boolean; + /** + * Internal use only. Do not use or rely on this property. It may + * change at any time. + * @internal + */ + _postcssResult?: PostcssResult; + }; + + /** @internal */ + type DisableReportRange = { + rule: string; + start: number; + end?: number; + }; + + /** + * A linter result. + */ + type LinterResult = { + /** + * The working directory from which the linter was run when the + * results were generated. + */ + cwd: string; + results: LintResult[]; + errored: boolean; + output: any; + maxWarningsExceeded?: { + maxWarnings: number; + foundWarnings: number; + }; + reportedDisables: DisableOptionsReport; + descriptionlessDisables?: DisableOptionsReport; + needlessDisables?: DisableOptionsReport; + invalidScopeDisables?: DisableOptionsReport; + /** + * Each rule metadata by name. + */ + ruleMetadata: { [ruleName: string]: Partial }; + }; + + /** + * A lint problem. + */ + type Problem = { + ruleName: string; + result: PostcssResult; + message: RuleMessage; + messageArgs?: Parameters | undefined; + node: PostCSS.Node; + /** + * The inclusive start index of the problem, relative to the node's + * source text. + */ + index?: number; + /** + * The exclusive end index of the problem, relative to the node's + * source text. + */ + endIndex?: number; + /** + * The inclusive start position of the problem, relative to the + * node's source text. If provided, this will be used instead of + * `index`. + */ + start?: { + line: number; + column: number; + }; + /** + * The exclusive end position of the problem, relative to the + * node's source text. If provided, this will be used instead of + * `endIndex`. + */ + end?: { + line: number; + column: number; + }; + word?: string; + line?: number; + /** + * Optional severity override for the problem. + */ + severity?: Severity; + }; + + /** @internal */ + type ShorthandProperties = + | 'animation' + | 'background' + | 'border' + | 'border-block-end' + | 'border-block-start' + | 'border-bottom' + | 'border-color' + | 'border-image' + | 'border-inline-end' + | 'border-inline-start' + | 'border-left' + | 'border-radius' + | 'border-right' + | 'border-style' + | 'border-top' + | 'border-width' + | 'column-rule' + | 'columns' + | 'flex' + | 'flex-flow' + | 'font' + | 'grid' + | 'grid-area' + | 'grid-column' + | 'grid-gap' + | 'grid-row' + | 'grid-template' + | 'inset' + | 'list-style' + | 'margin' + | 'mask' + | 'outline' + | 'padding' + | 'text-decoration' + | 'text-emphasis' + | 'transition'; + + /** @internal */ + type LonghandSubPropertiesOfShorthandProperties = ReadonlyMap< + ShorthandProperties, + ReadonlySet + >; + + /** + * Utility functions. + */ + type Utils = { + /** + * Report a problem. + * + * This function accounts for `disabledRanges` attached to the result. + * That is, if the reported problem is within a disabledRange, + * it is ignored. Otherwise, it is attached to the result as a + * postcss warning. + * + * It also accounts for the rule's severity. + * + * You *must* pass *either* a node or a line number. + * + * @param problem - A problem + */ + report: (problem: Problem) => void; + + /** + * Given an object of problem messages, return another + * that provides the same messages postfixed with the rule + * that has been violated. + * + * @param ruleName - A rule name + * @param messages - An object whose keys are message identifiers + * and values are either message strings or functions that return message strings + * @returns New message object, whose messages will be marked with the rule name + */ + ruleMessages: ( + ruleName: string, + messages: T, + ) => R; + + /** + * Validate a rule's options. + * + * See existing rules for examples. + * + * @param result - PostCSS result + * @param ruleName - A rule name + * @param optionDescriptions - Each optionDescription can have the following properties: + * - `actual` (required): the actual passed option value or object. + * - `possible` (required): a schema representation of what values are + * valid for those options. `possible` should be an object if the + * options are an object, with corresponding keys; if the options are not an + * object, `possible` isn't, either. All `possible` value representations + * should be **arrays of either values or functions**. Values are === checked + * against `actual`. Functions are fed `actual` as an argument and their + * return value is interpreted: truthy = valid, falsy = invalid. + * - `optional` (optional): If this is `true`, `actual` can be undefined. + * @returns Whether or not the options are valid (`true` = valid) + */ + validateOptions: ( + result: PostcssResult, + ruleName: string, + ...optionDescriptions: RuleOptions[] + ) => boolean; + + /** + * Useful for third-party code (e.g. plugins) to run a PostCSS Root + * against a specific rule and do something with the warnings. + */ + checkAgainstRule: ( + options: { + ruleName: string; + ruleSettings: ConfigRuleSettings; + root: PostCSS.Root; + result?: PostcssResult; + context?: RuleContext; + }, + callback: (warning: PostCSS.Warning) => void, + ) => void; + }; + + /** + * Internal use only. Do not use or rely on this type. It may change at + * any time. + * @internal + */ + type InternalApi = { + _options: LinterOptions & { cwd: string }; + _extendExplorer: ReturnType; + _specifiedConfigCache: Map>; + _postcssResultCache: Map; + _fileCache: FileCache; + }; + + type DisableOptionsReport = DisableReportEntry[]; + + type PostcssPluginOptions = Omit | Config; +} + +type PublicApi = PostCSS.PluginCreator & { + /** + * Runs Stylelint with the given options and returns a Promise that + * resolves to the results. + * + * @param options - A lint options object + * @returns A lint result + */ + lint: (options: stylelint.LinterOptions) => Promise; + + /** + * Available rules. + */ + rules: { [k: string]: stylelint.Rule }; + + /** + * Result report formatters by name. + */ + formatters: { [k: string]: stylelint.Formatter }; + + /** + * Creates a Stylelint plugin. + */ + createPlugin: (ruleName: string, rule: stylelint.Rule) => stylelint.Plugin; + + /** + * The Stylelint "internal API" is passed among functions + * so that methods on a Stylelint instance can invoke + * each other while sharing options and caches. + * + * @internal + */ + _createLinter: (options: stylelint.LinterOptions) => stylelint.InternalApi; + + /** + * Resolves the effective configuration for a given file. Resolves to + * `undefined` if no config is found. + * + * @param filePath - The path to the file to get the config for. + * @param options - The options to use when creating the Stylelint instance. + * @returns A resolved config or `undefined`. + */ + resolveConfig: ( + filePath: string, + options?: Pick, + ) => Promise; + + /** + * Utility functions. + */ + utils: stylelint.Utils; + + /** + * Reference objects. + */ + reference: { + longhandSubPropertiesOfShorthandProperties: stylelint.LonghandSubPropertiesOfShorthandProperties; + }; +}; + +declare const stylelint: PublicApi; + +export = stylelint; diff --git a/node_modules/supports-color/browser.js b/node_modules/supports-color/browser.js new file mode 100644 index 000000000..62afa3a74 --- /dev/null +++ b/node_modules/supports-color/browser.js @@ -0,0 +1,5 @@ +'use strict'; +module.exports = { + stdout: false, + stderr: false +}; diff --git a/node_modules/supports-color/index.js b/node_modules/supports-color/index.js new file mode 100644 index 000000000..1704131bd --- /dev/null +++ b/node_modules/supports-color/index.js @@ -0,0 +1,131 @@ +'use strict'; +const os = require('os'); +const hasFlag = require('has-flag'); + +const env = process.env; + +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + forceColor = false; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = true; +} +if ('FORCE_COLOR' in env) { + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} + +function supportsColor(stream) { + if (forceColor === false) { + return 0; + } + + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + + if (stream && !stream.isTTY && forceColor !== true) { + return 0; + } + + const min = forceColor ? 1 : 0; + + if (process.platform === 'win32') { + // Node.js 7.5.0 is the first version of Node.js to include a patch to + // libuv that enables 256 color output on Windows. Anything earlier and it + // won't work. However, here we target Node.js 8 at minimum as it is an LTS + // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows + // release that supports 256 colors. Windows 10 build 14931 is the first release + // that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(process.versions.node.split('.')[0]) >= 8 && + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + if (env.TERM === 'dumb') { + return min; + } + + return min; +} + +function getSupportLevel(stream) { + const level = supportsColor(stream); + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) +}; diff --git a/node_modules/supports-color/license b/node_modules/supports-color/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/supports-color/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/supports-color/package.json b/node_modules/supports-color/package.json new file mode 100644 index 000000000..ad199f5cd --- /dev/null +++ b/node_modules/supports-color/package.json @@ -0,0 +1,53 @@ +{ + "name": "supports-color", + "version": "5.5.0", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": "chalk/supports-color", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "browser.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "dependencies": { + "has-flag": "^3.0.0" + }, + "devDependencies": { + "ava": "^0.25.0", + "import-fresh": "^2.0.0", + "xo": "^0.20.0" + }, + "browser": "browser.js" +} diff --git a/node_modules/supports-color/readme.md b/node_modules/supports-color/readme.md new file mode 100644 index 000000000..f6e401957 --- /dev/null +++ b/node_modules/supports-color/readme.md @@ -0,0 +1,66 @@ +# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) + +> Detect whether a terminal supports color + + +## Install + +``` +$ npm install supports-color +``` + + +## Usage + +```js +const supportsColor = require('supports-color'); + +if (supportsColor.stdout) { + console.log('Terminal stdout supports color'); +} + +if (supportsColor.stdout.has256) { + console.log('Terminal stdout supports 256 colors'); +} + +if (supportsColor.stderr.has16m) { + console.log('Terminal stderr supports 16 million colors (truecolor)'); +} +``` + + +## API + +Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. + +The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: + +- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) +- `.level = 2` and `.has256 = true`: 256 color support +- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) + + +## Info + +It obeys the `--color` and `--no-color` CLI flags. + +Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. + +Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. + + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/node_modules/supports-hyperlinks/browser.js b/node_modules/supports-hyperlinks/browser.js new file mode 100644 index 000000000..b01363056 --- /dev/null +++ b/node_modules/supports-hyperlinks/browser.js @@ -0,0 +1,8 @@ +'use strict'; +module.exports = { + stdin: false, + stderr: false, + supportsHyperlink: function () { // eslint-disable-line object-shorthand + return false; + } +}; diff --git a/node_modules/supports-hyperlinks/index.d.ts b/node_modules/supports-hyperlinks/index.d.ts new file mode 100644 index 000000000..286f5784c --- /dev/null +++ b/node_modules/supports-hyperlinks/index.d.ts @@ -0,0 +1,5 @@ +export function supportsHyperlink(stream: { + isTTY?: boolean | undefined; +}): boolean; +export declare const stdout: boolean; +export declare const stderr: boolean; diff --git a/node_modules/supports-hyperlinks/index.js b/node_modules/supports-hyperlinks/index.js new file mode 100644 index 000000000..01b68c0f2 --- /dev/null +++ b/node_modules/supports-hyperlinks/index.js @@ -0,0 +1,117 @@ +'use strict'; +const supportsColor = require('supports-color'); +const hasFlag = require('has-flag'); + +/** +@param {string} versionString +@returns {{ major: number, minor: number, patch: number }} +*/ +function parseVersion(versionString) { + if (/^\d{3,4}$/.test(versionString)) { + // Env var doesn't always use dots. example: 4601 => 46.1.0 + const m = /(\d{1,2})(\d{2})/.exec(versionString) || []; + return { + major: 0, + minor: parseInt(m[1], 10), + patch: parseInt(m[2], 10) + }; + } + + const versions = (versionString || '').split('.').map(n => parseInt(n, 10)); + return { + major: versions[0], + minor: versions[1], + patch: versions[2] + }; +} + +/** +@param {{ isTTY?: boolean | undefined }} stream +@returns {boolean} +*/ +function supportsHyperlink(stream) { + const { + CI, + FORCE_HYPERLINK, + NETLIFY, + TEAMCITY_VERSION, + TERM_PROGRAM, + TERM_PROGRAM_VERSION, + VTE_VERSION + } = process.env; + + if (FORCE_HYPERLINK) { + return !(FORCE_HYPERLINK.length > 0 && parseInt(FORCE_HYPERLINK, 10) === 0); + } + + if (hasFlag('no-hyperlink') || hasFlag('no-hyperlinks') || hasFlag('hyperlink=false') || hasFlag('hyperlink=never')) { + return false; + } + + if (hasFlag('hyperlink=true') || hasFlag('hyperlink=always')) { + return true; + } + + // Netlify does not run a TTY, it does not need `supportsColor` check + if (NETLIFY) { + return true; + } + + // If they specify no colors, they probably don't want hyperlinks. + if (!supportsColor.supportsColor(stream)) { + return false; + } + + if (stream && !stream.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return false; + } + + if (CI) { + return false; + } + + if (TEAMCITY_VERSION) { + return false; + } + + if (TERM_PROGRAM) { + const version = parseVersion(TERM_PROGRAM_VERSION || ''); + + switch (TERM_PROGRAM) { + case 'iTerm.app': + if (version.major === 3) { + return version.minor >= 1; + } + + return version.major > 3; + case 'WezTerm': + return version.major >= 20200620; + case 'vscode': + // eslint-disable-next-line no-mixed-operators + return version.major > 1 || version.major === 1 && version.minor >= 72; + // No default + } + } + + if (VTE_VERSION) { + // 0.50.0 was supposed to support hyperlinks, but throws a segfault + if (VTE_VERSION === '0.50.0') { + return false; + } + + const version = parseVersion(VTE_VERSION); + return version.major > 0 || version.minor >= 50; + } + + return false; +} + +module.exports = { + supportsHyperlink, + stdout: supportsHyperlink(process.stdout), + stderr: supportsHyperlink(process.stderr) +}; diff --git a/node_modules/supports-hyperlinks/license b/node_modules/supports-hyperlinks/license new file mode 100644 index 000000000..32a380af3 --- /dev/null +++ b/node_modules/supports-hyperlinks/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) James Talmage (github.com/jamestalmage) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/supports-hyperlinks/node_modules/has-flag/index.d.ts b/node_modules/supports-hyperlinks/node_modules/has-flag/index.d.ts new file mode 100644 index 000000000..a0a48c891 --- /dev/null +++ b/node_modules/supports-hyperlinks/node_modules/has-flag/index.d.ts @@ -0,0 +1,39 @@ +/** +Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag. + +@param flag - CLI flag to look for. The `--` prefix is optional. +@param argv - CLI arguments. Default: `process.argv`. +@returns Whether the flag exists. + +@example +``` +// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow + +// foo.ts +import hasFlag = require('has-flag'); + +hasFlag('unicorn'); +//=> true + +hasFlag('--unicorn'); +//=> true + +hasFlag('f'); +//=> true + +hasFlag('-f'); +//=> true + +hasFlag('foo=bar'); +//=> true + +hasFlag('foo'); +//=> false + +hasFlag('rainbow'); +//=> false +``` +*/ +declare function hasFlag(flag: string, argv?: string[]): boolean; + +export = hasFlag; diff --git a/node_modules/supports-hyperlinks/node_modules/has-flag/index.js b/node_modules/supports-hyperlinks/node_modules/has-flag/index.js new file mode 100644 index 000000000..b6f80b1f8 --- /dev/null +++ b/node_modules/supports-hyperlinks/node_modules/has-flag/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = (flag, argv = process.argv) => { + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +}; diff --git a/node_modules/supports-hyperlinks/node_modules/has-flag/license b/node_modules/supports-hyperlinks/node_modules/has-flag/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/supports-hyperlinks/node_modules/has-flag/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/supports-hyperlinks/node_modules/has-flag/package.json b/node_modules/supports-hyperlinks/node_modules/has-flag/package.json new file mode 100644 index 000000000..a9cba4b85 --- /dev/null +++ b/node_modules/supports-hyperlinks/node_modules/has-flag/package.json @@ -0,0 +1,46 @@ +{ + "name": "has-flag", + "version": "4.0.0", + "description": "Check if argv has a specific flag", + "license": "MIT", + "repository": "sindresorhus/has-flag", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "has", + "check", + "detect", + "contains", + "find", + "flag", + "cli", + "command-line", + "argv", + "process", + "arg", + "args", + "argument", + "arguments", + "getopt", + "minimist", + "optimist" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/supports-hyperlinks/node_modules/has-flag/readme.md b/node_modules/supports-hyperlinks/node_modules/has-flag/readme.md new file mode 100644 index 000000000..3f72dff29 --- /dev/null +++ b/node_modules/supports-hyperlinks/node_modules/has-flag/readme.md @@ -0,0 +1,89 @@ +# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) + +> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag + +Correctly stops looking after an `--` argument terminator. + +--- + +

+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + + +## Install + +``` +$ npm install has-flag +``` + + +## Usage + +```js +// foo.js +const hasFlag = require('has-flag'); + +hasFlag('unicorn'); +//=> true + +hasFlag('--unicorn'); +//=> true + +hasFlag('f'); +//=> true + +hasFlag('-f'); +//=> true + +hasFlag('foo=bar'); +//=> true + +hasFlag('foo'); +//=> false + +hasFlag('rainbow'); +//=> false +``` + +``` +$ node foo.js -f --unicorn --foo=bar -- --rainbow +``` + + +## API + +### hasFlag(flag, [argv]) + +Returns a boolean for whether the flag exists. + +#### flag + +Type: `string` + +CLI flag to look for. The `--` prefix is optional. + +#### argv + +Type: `string[]`
+Default: `process.argv` + +CLI arguments. + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/supports-hyperlinks/node_modules/supports-color/browser.js b/node_modules/supports-hyperlinks/node_modules/supports-color/browser.js new file mode 100644 index 000000000..62afa3a74 --- /dev/null +++ b/node_modules/supports-hyperlinks/node_modules/supports-color/browser.js @@ -0,0 +1,5 @@ +'use strict'; +module.exports = { + stdout: false, + stderr: false +}; diff --git a/node_modules/supports-hyperlinks/node_modules/supports-color/index.js b/node_modules/supports-hyperlinks/node_modules/supports-color/index.js new file mode 100644 index 000000000..6fada390f --- /dev/null +++ b/node_modules/supports-hyperlinks/node_modules/supports-color/index.js @@ -0,0 +1,135 @@ +'use strict'; +const os = require('os'); +const tty = require('tty'); +const hasFlag = require('has-flag'); + +const {env} = process; + +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false') || + hasFlag('color=never')) { + forceColor = 0; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = 1; +} + +if ('FORCE_COLOR' in env) { + if (env.FORCE_COLOR === 'true') { + forceColor = 1; + } else if (env.FORCE_COLOR === 'false') { + forceColor = 0; + } else { + forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); + } +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} + +function supportsColor(haveStream, streamIsTTY) { + if (forceColor === 0) { + return 0; + } + + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + + if (haveStream && !streamIsTTY && forceColor === undefined) { + return 0; + } + + const min = forceColor || 0; + + if (env.TERM === 'dumb') { + return min; + } + + if (process.platform === 'win32') { + // Windows 10 build 10586 is the first Windows release that supports 256 colors. + // Windows 10 build 14931 is the first release that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + return min; +} + +function getSupportLevel(stream) { + const level = supportsColor(stream, stream && stream.isTTY); + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) +}; diff --git a/node_modules/supports-hyperlinks/node_modules/supports-color/license b/node_modules/supports-hyperlinks/node_modules/supports-color/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/supports-hyperlinks/node_modules/supports-color/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/supports-hyperlinks/node_modules/supports-color/package.json b/node_modules/supports-hyperlinks/node_modules/supports-color/package.json new file mode 100644 index 000000000..f7182edce --- /dev/null +++ b/node_modules/supports-hyperlinks/node_modules/supports-color/package.json @@ -0,0 +1,53 @@ +{ + "name": "supports-color", + "version": "7.2.0", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": "chalk/supports-color", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "browser.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "dependencies": { + "has-flag": "^4.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "import-fresh": "^3.0.0", + "xo": "^0.24.0" + }, + "browser": "browser.js" +} diff --git a/node_modules/supports-hyperlinks/node_modules/supports-color/readme.md b/node_modules/supports-hyperlinks/node_modules/supports-color/readme.md new file mode 100644 index 000000000..365422858 --- /dev/null +++ b/node_modules/supports-hyperlinks/node_modules/supports-color/readme.md @@ -0,0 +1,76 @@ +# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) + +> Detect whether a terminal supports color + + +## Install + +``` +$ npm install supports-color +``` + + +## Usage + +```js +const supportsColor = require('supports-color'); + +if (supportsColor.stdout) { + console.log('Terminal stdout supports color'); +} + +if (supportsColor.stdout.has256) { + console.log('Terminal stdout supports 256 colors'); +} + +if (supportsColor.stderr.has16m) { + console.log('Terminal stderr supports 16 million colors (truecolor)'); +} +``` + + +## API + +Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. + +The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: + +- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) +- `.level = 2` and `.has256 = true`: 256 color support +- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) + + +## Info + +It obeys the `--color` and `--no-color` CLI flags. + +For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. + +Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. + + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- diff --git a/node_modules/supports-hyperlinks/package.json b/node_modules/supports-hyperlinks/package.json new file mode 100644 index 000000000..1108eac1d --- /dev/null +++ b/node_modules/supports-hyperlinks/package.json @@ -0,0 +1,51 @@ +{ + "name": "supports-hyperlinks", + "version": "3.0.0", + "description": "Detect if your terminal emulator supports hyperlinks", + "license": "MIT", + "repository": "jamestalmage/supports-hyperlinks", + "author": { + "name": "James Talmage", + "email": "james@talmage.io", + "url": "github.com/jamestalmage" + }, + "engines": { + "node": ">=14.18" + }, + "scripts": { + "prepublishOnly": "npm run create-types", + "test": "xo && nyc ava && tsc", + "create-types": "tsc --project declaration.tsconfig.json" + }, + "files": [ + "index.js", + "index.d.ts", + "browser.js" + ], + "browser": "browser.js", + "keywords": [ + "link", + "terminal", + "hyperlink", + "cli" + ], + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "devDependencies": { + "@tsconfig/node14": "^1.0.3", + "@types/supports-color": "^8.1.1", + "ava": "^2.2.0", + "codecov": "^3.5.0", + "nyc": "^14.1.1", + "typescript": "^4.9.5", + "xo": "^0.24.0" + }, + "nyc": { + "reporter": [ + "lcov", + "text" + ] + } +} diff --git a/node_modules/supports-hyperlinks/readme.md b/node_modules/supports-hyperlinks/readme.md new file mode 100644 index 000000000..ec833ac5a --- /dev/null +++ b/node_modules/supports-hyperlinks/readme.md @@ -0,0 +1,48 @@ +# supports-hyperlinks [![Build Status](https://travis-ci.org/jamestalmage/supports-hyperlinks.svg?branch=master)](https://travis-ci.org/jamestalmage/supports-hyperlinks) [![codecov](https://codecov.io/gh/jamestalmage/supports-hyperlinks/badge.svg?branch=master)](https://codecov.io/gh/jamestalmage/supports-hyperlinks?branch=master) + +> Detect whether a terminal emulator supports hyperlinks + +Terminal emulators are [starting to support hyperlinks](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda). While many terminals have long detected URL's and linkified them, allowing you to Command-Click or Control-Click them to open a browser, you were forced to print the long unsightly URL's on the screen. As of spring 2017 [a few terminals](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) began supporting HTML like links, where the link text and destination could be specified separately. + +This module allows you to detect if hyperlinks are supported in the current Terminal. + +As this is a new development, we anticipate the list of supported Terminals to grow rapidly. Please open an issue or submit a PR as new Terminals implement support. + +## Install + +``` +$ npm install supports-hyperlinks +``` + + +## Usage + +```js +const supportsHyperlinks = require('supports-hyperlinks'); + +if (supportsHyperlinks.stdout) { + console.log('Terminal stdout supports hyperlinks'); +} + +if (supportsHyperlinks.stderr) { + console.log('Terminal stderr supports hyperlinks'); +} +``` + +## API + +Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is a `boolean`, indicating whether or not hyperlinks are supported. + +## Info + +Obeys the `--no-hyperlinks`, `--hyperlink=always`, and `--hyperlink=never` CLI flags. + +Can be overridden by the user with the flags `--hyperlinks=always` and `--no-hyperlinks`. For situations where using those flags are not possible, add the environment variable `FORCE_HYPERLINK=1` to forcefully enable hyperlinks or `FORCE_HYPERLINK=0` to forcefully disable. The use of `FORCE_HYPERLINK` overrides all other hyperlink support checks. + +## Related + + * [`hyperlinker`](https://github.com/jamestalmage/hyperlinker): Write hyperlinks for the Terminal. + +## License + +MIT © [James Talmage](https://github.com/jamestalmage) diff --git a/node_modules/svg-tags/LICENSE b/node_modules/svg-tags/LICENSE new file mode 100644 index 000000000..2fe39398b --- /dev/null +++ b/node_modules/svg-tags/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Athan Reines. + +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. \ No newline at end of file diff --git a/node_modules/svg-tags/README.md b/node_modules/svg-tags/README.md new file mode 100644 index 000000000..9e3429d2a --- /dev/null +++ b/node_modules/svg-tags/README.md @@ -0,0 +1,99 @@ +SVG Tags +======== +[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url] + +> List of standard SVG tags. + +List built from the [SVG 1.1 specification](http://www.w3.org/TR/SVG/eltindex.html). + + +## Installation + +``` bash +$ npm install svg-tags --save +``` + + +## Usage + +The module is simply a JSON array, so use as you would a normal JavaScript array. + +``` javascript +var tags = require( 'svg-tags' ); + +console.log( JSON.stringify( tags ) ); +/** +* Returns: +* [ 'a', 'altGlyph', ... ] +*/ + +console.log( tags.indexOf( 'desc' ) ); +// Returns [index] +``` + +## Examples + +To run the example code from the top-level application directory, + +``` bash +$ node ./examples/index.js +``` + + +## Tests + +### Unit + +Unit tests use the [Mocha](http://visionmedia.github.io/mocha) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory: + +``` bash +$ make test +``` + +All new feature development should have corresponding unit tests to validate correct functionality. + + +### Test Coverage + +This repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory: + +``` bash +$ make test-cov +``` + +Istanbul creates a `./reports/coverage` directory. To access an HTML version of the report, + +``` bash +$ open reports/coverage/lcov-report/index.html +``` + + +## License + +[MIT license](http://opensource.org/licenses/MIT). + + +--- +## Copyright + +Copyright © 2014. Athan Reines. + + + +[npm-image]: http://img.shields.io/npm/v/svg-tags.svg +[npm-url]: https://npmjs.org/package/svg-tags + +[travis-image]: http://img.shields.io/travis/element-io/svg-tags/master.svg +[travis-url]: https://travis-ci.org/element-io/svg-tags + +[coveralls-image]: https://img.shields.io/coveralls/element-io/svg-tags/master.svg +[coveralls-url]: https://coveralls.io/r/element-io/svg-tags?branch=master + +[dependencies-image]: http://img.shields.io/david/element-io/svg-tags.svg +[dependencies-url]: https://david-dm.org/element-io/svg-tags + +[dev-dependencies-image]: http://img.shields.io/david/dev/element-io/svg-tags.svg +[dev-dependencies-url]: https://david-dm.org/dev/element-io/svg-tags + +[github-issues-image]: http://img.shields.io/github/issues/element-io/svg-tags.svg +[github-issues-url]: https://github.com/element-io/svg-tags/issues \ No newline at end of file diff --git a/node_modules/svg-tags/lib/index.js b/node_modules/svg-tags/lib/index.js new file mode 100644 index 000000000..a7e9270ce --- /dev/null +++ b/node_modules/svg-tags/lib/index.js @@ -0,0 +1 @@ +module.exports = require( './svg-tags.json' ); \ No newline at end of file diff --git a/node_modules/svg-tags/lib/svg-tags.json b/node_modules/svg-tags/lib/svg-tags.json new file mode 100644 index 000000000..d9eea5de0 --- /dev/null +++ b/node_modules/svg-tags/lib/svg-tags.json @@ -0,0 +1,82 @@ +[ + "a", + "altGlyph", + "altGlyphDef", + "altGlyphItem", + "animate", + "animateColor", + "animateMotion", + "animateTransform", + "circle", + "clipPath", + "color-profile", + "cursor", + "defs", + "desc", + "ellipse", + "feBlend", + "feColorMatrix", + "feComponentTransfer", + "feComposite", + "feConvolveMatrix", + "feDiffuseLighting", + "feDisplacementMap", + "feDistantLight", + "feFlood", + "feFuncA", + "feFuncB", + "feFuncG", + "feFuncR", + "feGaussianBlur", + "feImage", + "feMerge", + "feMergeNode", + "feMorphology", + "feOffset", + "fePointLight", + "feSpecularLighting", + "feSpotLight", + "feTile", + "feTurbulence", + "filter", + "font", + "font-face", + "font-face-format", + "font-face-name", + "font-face-src", + "font-face-uri", + "foreignObject", + "g", + "glyph", + "glyphRef", + "hkern", + "image", + "line", + "linearGradient", + "marker", + "mask", + "metadata", + "missing-glyph", + "mpath", + "path", + "pattern", + "polygon", + "polyline", + "radialGradient", + "rect", + "script", + "set", + "stop", + "style", + "svg", + "switch", + "symbol", + "text", + "textPath", + "title", + "tref", + "tspan", + "use", + "view", + "vkern" +] \ No newline at end of file diff --git a/node_modules/svg-tags/package.json b/node_modules/svg-tags/package.json new file mode 100644 index 000000000..604d49a4b --- /dev/null +++ b/node_modules/svg-tags/package.json @@ -0,0 +1,46 @@ +{ + "name": "svg-tags", + "version": "1.0.0", + "description": "List of standard SVG tags.", + "author": { + "name": "Athan Reines", + "email": "kgryte@gmail.com" + }, + "contributors": [ + { + "name": "Athan Reines", + "email": "kgryte@gmail.com" + } + ], + "scripts": { + "test": "./node_modules/.bin/mocha", + "test-cov": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec", + "coveralls": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls" + }, + "main": "./lib", + "repository": { + "type": "git", + "url": "git://github.com/element-io/svg-tags.git" + }, + "keywords": [ + "svg", + "tags", + "w3c" + ], + "bugs": { + "url": "https://github.com/element-io/svg-tags/issues" + }, + "dependencies": {}, + "devDependencies": { + "chai": "1.x.x", + "coveralls": "^2.11.1", + "istanbul": "^0.3.0", + "mocha": "1.x.x" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/MIT" + } + ] +} diff --git a/node_modules/table/LICENSE b/node_modules/table/LICENSE new file mode 100644 index 000000000..6c41d45cd --- /dev/null +++ b/node_modules/table/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2018, Gajus Kuizinas (http://gajus.com/) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Gajus Kuizinas (http://gajus.com/) nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL ANUARY BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/table/README.md b/node_modules/table/README.md new file mode 100644 index 000000000..a0f514746 --- /dev/null +++ b/node_modules/table/README.md @@ -0,0 +1,837 @@ + +# Table + +> Produces a string that represents array data in a text table. + +[![Github action status](https://github.com/gajus/table/actions/workflows/main.yml/badge.svg)](https://github.com/gajus/table/actions) +[![Coveralls](https://img.shields.io/coveralls/gajus/table.svg?style=flat-square)](https://coveralls.io/github/gajus/table) +[![NPM version](http://img.shields.io/npm/v/table.svg?style=flat-square)](https://www.npmjs.org/package/table) +[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical) +[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social&label=Follow)](https://twitter.com/kuizinas) + +* [Table](#table) + * [Features](#table-features) + * [Install](#table-install) + * [Usage](#table-usage) + * [API](#table-api) + * [table](#table-api-table-1) + * [createStream](#table-api-createstream) + * [getBorderCharacters](#table-api-getbordercharacters) + + +![Demo of table displaying a list of missions to the Moon.](./.README/demo.png) + + +## Features + +* Works with strings containing [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) characters. +* Works with strings containing [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code). +* Configurable border characters. +* Configurable content alignment per column. +* Configurable content padding per column. +* Configurable column width. +* Text wrapping. + + +## Install + +```bash +npm install table +``` + +[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/gajus) +[![Become a Patron](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/gajus) + + + +## Usage + +```js +import { table } from 'table'; + +// Using commonjs? +// const { table } = require('table'); + +const data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +console.log(table(data)); +``` + +``` +╔════╤════╤════╗ +║ 0A │ 0B │ 0C ║ +╟────┼────┼────╢ +║ 1A │ 1B │ 1C ║ +╟────┼────┼────╢ +║ 2A │ 2B │ 2C ║ +╚════╧════╧════╝ + +``` + + + +## API + + +### table + +Returns the string in the table format + +**Parameters:** +- **_data_:** The data to display + - Type: `any[][]` + - Required: `true` + +- **_config_:** Table configuration + - Type: `object` + - Required: `false` + + +##### config.border + +Type: `{ [type: string]: string }`\ +Default: `honeywell` [template](#getbordercharacters) + +Custom borders. The keys are any of: +- `topLeft`, `topRight`, `topBody`,`topJoin` +- `bottomLeft`, `bottomRight`, `bottomBody`, `bottomJoin` +- `joinLeft`, `joinRight`, `joinBody`, `joinJoin` +- `bodyLeft`, `bodyRight`, `bodyJoin` +- `headerJoin` + +```js +const data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +const config = { + border: { + topBody: `─`, + topJoin: `┬`, + topLeft: `┌`, + topRight: `┐`, + + bottomBody: `─`, + bottomJoin: `┴`, + bottomLeft: `└`, + bottomRight: `┘`, + + bodyLeft: `│`, + bodyRight: `│`, + bodyJoin: `│`, + + joinBody: `─`, + joinLeft: `├`, + joinRight: `┤`, + joinJoin: `┼` + } +}; + +console.log(table(data, config)); +``` + +``` +┌────┬────┬────┐ +│ 0A │ 0B │ 0C │ +├────┼────┼────┤ +│ 1A │ 1B │ 1C │ +├────┼────┼────┤ +│ 2A │ 2B │ 2C │ +└────┴────┴────┘ +``` + + +##### config.drawVerticalLine + +Type: `(lineIndex: number, columnCount: number) => boolean`\ +Default: `() => true` + +It is used to tell whether to draw a vertical line. This callback is called for each vertical border of the table. +If the table has `n` columns, then the `index` parameter is alternatively received all numbers in range `[0, n]` inclusively. + +```js +const data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'], + ['3A', '3B', '3C'], + ['4A', '4B', '4C'] +]; + +const config = { + drawVerticalLine: (lineIndex, columnCount) => { + return lineIndex === 0 || lineIndex === columnCount; + } +}; + +console.log(table(data, config)); + +``` + +``` +╔════════════╗ +║ 0A 0B 0C ║ +╟────────────╢ +║ 1A 1B 1C ║ +╟────────────╢ +║ 2A 2B 2C ║ +╟────────────╢ +║ 3A 3B 3C ║ +╟────────────╢ +║ 4A 4B 4C ║ +╚════════════╝ + +``` + + +##### config.drawHorizontalLine + +Type: `(lineIndex: number, rowCount: number) => boolean`\ +Default: `() => true` + +It is used to tell whether to draw a horizontal line. This callback is called for each horizontal border of the table. +If the table has `n` rows, then the `index` parameter is alternatively received all numbers in range `[0, n]` inclusively. +If the table has `n` rows and contains the header, then the range will be `[0, n+1]` inclusively. + +```js +const data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'], + ['3A', '3B', '3C'], + ['4A', '4B', '4C'] +]; + +const config = { + drawHorizontalLine: (lineIndex, rowCount) => { + return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount - 1 || lineIndex === rowCount; + } +}; + +console.log(table(data, config)); + +``` + +``` +╔════╤════╤════╗ +║ 0A │ 0B │ 0C ║ +╟────┼────┼────╢ +║ 1A │ 1B │ 1C ║ +║ 2A │ 2B │ 2C ║ +║ 3A │ 3B │ 3C ║ +╟────┼────┼────╢ +║ 4A │ 4B │ 4C ║ +╚════╧════╧════╝ + +``` + + +##### config.singleLine + +Type: `boolean`\ +Default: `false` + +If `true`, horizontal lines inside the table are not drawn. This option also overrides the `config.drawHorizontalLine` if specified. + +```js +const data = [ + ['-rw-r--r--', '1', 'pandorym', 'staff', '1529', 'May 23 11:25', 'LICENSE'], + ['-rw-r--r--', '1', 'pandorym', 'staff', '16327', 'May 23 11:58', 'README.md'], + ['drwxr-xr-x', '76', 'pandorym', 'staff', '2432', 'May 23 12:02', 'dist'], + ['drwxr-xr-x', '634', 'pandorym', 'staff', '20288', 'May 23 11:54', 'node_modules'], + ['-rw-r--r--', '1,', 'pandorym', 'staff', '525688', 'May 23 11:52', 'package-lock.json'], + ['-rw-r--r--@', '1', 'pandorym', 'staff', '2440', 'May 23 11:25', 'package.json'], + ['drwxr-xr-x', '27', 'pandorym', 'staff', '864', 'May 23 11:25', 'src'], + ['drwxr-xr-x', '20', 'pandorym', 'staff', '640', 'May 23 11:25', 'test'], +]; + +const config = { + singleLine: true +}; + +console.log(table(data, config)); +``` + +``` +╔═════════════╤═════╤══════════╤═══════╤════════╤══════════════╤═══════════════════╗ +║ -rw-r--r-- │ 1 │ pandorym │ staff │ 1529 │ May 23 11:25 │ LICENSE ║ +║ -rw-r--r-- │ 1 │ pandorym │ staff │ 16327 │ May 23 11:58 │ README.md ║ +║ drwxr-xr-x │ 76 │ pandorym │ staff │ 2432 │ May 23 12:02 │ dist ║ +║ drwxr-xr-x │ 634 │ pandorym │ staff │ 20288 │ May 23 11:54 │ node_modules ║ +║ -rw-r--r-- │ 1, │ pandorym │ staff │ 525688 │ May 23 11:52 │ package-lock.json ║ +║ -rw-r--r--@ │ 1 │ pandorym │ staff │ 2440 │ May 23 11:25 │ package.json ║ +║ drwxr-xr-x │ 27 │ pandorym │ staff │ 864 │ May 23 11:25 │ src ║ +║ drwxr-xr-x │ 20 │ pandorym │ staff │ 640 │ May 23 11:25 │ test ║ +╚═════════════╧═════╧══════════╧═══════╧════════╧══════════════╧═══════════════════╝ +``` + + + +##### config.columns + +Type: `Column[] | { [columnIndex: number]: Column }` + +Column specific configurations. + + +###### config.columns[*].width + +Type: `number`\ +Default: the maximum cell widths of the column + +Column width (excluding the paddings). + +```js + +const data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +const config = { + columns: { + 1: { width: 10 } + } +}; + +console.log(table(data, config)); +``` + +``` +╔════╤════════════╤════╗ +║ 0A │ 0B │ 0C ║ +╟────┼────────────┼────╢ +║ 1A │ 1B │ 1C ║ +╟────┼────────────┼────╢ +║ 2A │ 2B │ 2C ║ +╚════╧════════════╧════╝ +``` + + +###### config.columns[*].alignment + +Type: `'center' | 'justify' | 'left' | 'right'`\ +Default: `'left'` + +Cell content horizontal alignment + +```js +const data = [ + ['0A', '0B', '0C', '0D 0E 0F'], + ['1A', '1B', '1C', '1D 1E 1F'], + ['2A', '2B', '2C', '2D 2E 2F'], +]; + +const config = { + columnDefault: { + width: 10, + }, + columns: [ + { alignment: 'left' }, + { alignment: 'center' }, + { alignment: 'right' }, + { alignment: 'justify' } + ], +}; + +console.log(table(data, config)); +``` + +``` +╔════════════╤════════════╤════════════╤════════════╗ +║ 0A │ 0B │ 0C │ 0D 0E 0F ║ +╟────────────┼────────────┼────────────┼────────────╢ +║ 1A │ 1B │ 1C │ 1D 1E 1F ║ +╟────────────┼────────────┼────────────┼────────────╢ +║ 2A │ 2B │ 2C │ 2D 2E 2F ║ +╚════════════╧════════════╧════════════╧════════════╝ +``` + + +###### config.columns[*].verticalAlignment + +Type: `'top' | 'middle' | 'bottom'`\ +Default: `'top'` + +Cell content vertical alignment + +```js +const data = [ + ['A', 'B', 'C', 'DEF'], +]; + +const config = { + columnDefault: { + width: 1, + }, + columns: [ + { verticalAlignment: 'top' }, + { verticalAlignment: 'middle' }, + { verticalAlignment: 'bottom' }, + ], +}; + +console.log(table(data, config)); +``` + +``` +╔═══╤═══╤═══╤═══╗ +║ A │ │ │ D ║ +║ │ B │ │ E ║ +║ │ │ C │ F ║ +╚═══╧═══╧═══╧═══╝ +``` + + +###### config.columns[*].paddingLeft + +Type: `number`\ +Default: `1` + +The number of whitespaces used to pad the content on the left. + + +###### config.columns[*].paddingRight + +Type: `number`\ +Default: `1` + +The number of whitespaces used to pad the content on the right. + +The `paddingLeft` and `paddingRight` options do not count on the column width. So the column has `width = 5`, `paddingLeft = 2` and `paddingRight = 2` will have the total width is `9`. + + +```js +const data = [ + ['0A', 'AABBCC', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +const config = { + columns: [ + { + paddingLeft: 3 + }, + { + width: 2, + paddingRight: 3 + } + ] +}; + +console.log(table(data, config)); +``` + +``` +╔══════╤══════╤════╗ +║ 0A │ AA │ 0C ║ +║ │ BB │ ║ +║ │ CC │ ║ +╟──────┼──────┼────╢ +║ 1A │ 1B │ 1C ║ +╟──────┼──────┼────╢ +║ 2A │ 2B │ 2C ║ +╚══════╧══════╧════╝ +``` + + +###### config.columns[*].truncate + +Type: `number`\ +Default: `Infinity` + +The number of characters is which the content will be truncated. +To handle a content that overflows the container width, `table` package implements [text wrapping](#config.columns[*].wrapWord). However, sometimes you may want to truncate content that is too long to be displayed in the table. + +```js +const data = [ + ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] +]; + +const config = { + columns: [ + { + width: 20, + truncate: 100 + } + ] +}; + +console.log(table(data, config)); +``` + +``` +╔══════════════════════╗ +║ Lorem ipsum dolor si ║ +║ t amet, consectetur ║ +║ adipiscing elit. Pha ║ +║ sellus pulvinar nibh ║ +║ sed mauris convall… ║ +╚══════════════════════╝ +``` + + +###### config.columns[*].wrapWord + +Type: `boolean`\ +Default: `false` + +The `table` package implements auto text wrapping, i.e., text that has the width greater than the container width will be separated into multiple lines at the nearest space or one of the special characters: `\|/_.,;-`. + +When `wrapWord` is `false`: + +```js +const data = [ + ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] +]; + +const config = { + columns: [ { width: 20 } ] +}; + +console.log(table(data, config)); +``` + +``` +╔══════════════════════╗ +║ Lorem ipsum dolor si ║ +║ t amet, consectetur ║ +║ adipiscing elit. Pha ║ +║ sellus pulvinar nibh ║ +║ sed mauris convallis ║ +║ dapibus. Nunc venena ║ +║ tis tempus nulla sit ║ +║ amet viverra. ║ +╚══════════════════════╝ +``` + +When `wrapWord` is `true`: + +``` +╔══════════════════════╗ +║ Lorem ipsum dolor ║ +║ sit amet, ║ +║ consectetur ║ +║ adipiscing elit. ║ +║ Phasellus pulvinar ║ +║ nibh sed mauris ║ +║ convallis dapibus. ║ +║ Nunc venenatis ║ +║ tempus nulla sit ║ +║ amet viverra. ║ +╚══════════════════════╝ + +``` + + + +##### config.columnDefault + +Type: `Column`\ +Default: `{}` + +The default configuration for all columns. Column-specific settings will overwrite the default values. + + + +##### config.header + +Type: `object` + +Header configuration. + +*Deprecated in favor of the new spanning cells API.* + +The header configuration inherits the most of the column's, except: +- `content` **{string}**: the header content. +- `width:` calculate based on the content width automatically. +- `alignment:` `center` be default. +- `verticalAlignment:` is not supported. +- `config.border.topJoin` will be `config.border.topBody` for prettier. + +```js +const data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'], + ]; + +const config = { + columnDefault: { + width: 10, + }, + header: { + alignment: 'center', + content: 'THE HEADER\nThis is the table about something', + }, +} + +console.log(table(data, config)); +``` + +``` +╔══════════════════════════════════════╗ +║ THE HEADER ║ +║ This is the table about something ║ +╟────────────┬────────────┬────────────╢ +║ 0A │ 0B │ 0C ║ +╟────────────┼────────────┼────────────╢ +║ 1A │ 1B │ 1C ║ +╟────────────┼────────────┼────────────╢ +║ 2A │ 2B │ 2C ║ +╚════════════╧════════════╧════════════╝ +``` + + + +##### config.spanningCells + +Type: `SpanningCellConfig[]` + +Spanning cells configuration. + +The configuration should be straightforward: just specify an array of minimal cell configurations including the position of top-left cell +and the number of columns and/or rows will be expanded from it. + +The content of overlap cells will be ignored to make the `data` shape be consistent. + +By default, the configuration of column that the top-left cell belongs to will be applied to the whole spanning cell, except: +* The `width` will be summed up of all spanning columns. +* The `paddingRight` will be received from the right-most column intentionally. + +Advances customized column-like styles can be configurable to each spanning cell to overwrite the default behavior. + +```js +const data = [ + ['Test Coverage Report', '', '', '', '', ''], + ['Module', 'Component', 'Test Cases', 'Failures', 'Durations', 'Success Rate'], + ['Services', 'User', '50', '30', '3m 7s', '60.0%'], + ['', 'Payment', '100', '80', '7m 15s', '80.0%'], + ['Subtotal', '', '150', '110', '10m 22s', '73.3%'], + ['Controllers', 'User', '24', '18', '1m 30s', '75.0%'], + ['', 'Payment', '30', '24', '50s', '80.0%'], + ['Subtotal', '', '54', '42', '2m 20s', '77.8%'], + ['Total', '', '204', '152', '12m 42s', '74.5%'], +]; + +const config = { + columns: [ + { alignment: 'center', width: 12 }, + { alignment: 'center', width: 10 }, + { alignment: 'right' }, + { alignment: 'right' }, + { alignment: 'right' }, + { alignment: 'right' } + ], + spanningCells: [ + { col: 0, row: 0, colSpan: 6 }, + { col: 0, row: 2, rowSpan: 2, verticalAlignment: 'middle'}, + { col: 0, row: 4, colSpan: 2, alignment: 'right'}, + { col: 0, row: 5, rowSpan: 2, verticalAlignment: 'middle'}, + { col: 0, row: 7, colSpan: 2, alignment: 'right' }, + { col: 0, row: 8, colSpan: 2, alignment: 'right' } + ], +}; + +console.log(table(data, config)); +``` + +``` +╔══════════════════════════════════════════════════════════════════════════════╗ +║ Test Coverage Report ║ +╟──────────────┬────────────┬────────────┬──────────┬───────────┬──────────────╢ +║ Module │ Component │ Test Cases │ Failures │ Durations │ Success Rate ║ +╟──────────────┼────────────┼────────────┼──────────┼───────────┼──────────────╢ +║ │ User │ 50 │ 30 │ 3m 7s │ 60.0% ║ +║ Services ├────────────┼────────────┼──────────┼───────────┼──────────────╢ +║ │ Payment │ 100 │ 80 │ 7m 15s │ 80.0% ║ +╟──────────────┴────────────┼────────────┼──────────┼───────────┼──────────────╢ +║ Subtotal │ 150 │ 110 │ 10m 22s │ 73.3% ║ +╟──────────────┬────────────┼────────────┼──────────┼───────────┼──────────────╢ +║ │ User │ 24 │ 18 │ 1m 30s │ 75.0% ║ +║ Controllers ├────────────┼────────────┼──────────┼───────────┼──────────────╢ +║ │ Payment │ 30 │ 24 │ 50s │ 80.0% ║ +╟──────────────┴────────────┼────────────┼──────────┼───────────┼──────────────╢ +║ Subtotal │ 54 │ 42 │ 2m 20s │ 77.8% ║ +╟───────────────────────────┼────────────┼──────────┼───────────┼──────────────╢ +║ Total │ 204 │ 152 │ 12m 42s │ 74.5% ║ +╚═══════════════════════════╧════════════╧══════════╧═══════════╧══════════════╝ +``` + + + +### createStream + +`table` package exports `createStream` function used to draw a table and append rows. + +**Parameter:** + - _**config:**_ the same as `table`'s, except `config.columnDefault.width` and `config.columnCount` must be provided. + + +```js +import { createStream } from 'table'; + +const config = { + columnDefault: { + width: 50 + }, + columnCount: 1 +}; + +const stream = createStream(config); + +setInterval(() => { + stream.write([new Date()]); +}, 500); +``` + +![Streaming current date.](./.README/api/stream/streaming.gif) + +`table` package uses ANSI escape codes to overwrite the output of the last line when a new row is printed. + +The underlying implementation is explained in this [Stack Overflow answer](http://stackoverflow.com/a/32938658/368691). + +Streaming supports all of the configuration properties and functionality of a static table (such as auto text wrapping, alignment and padding), e.g. + +```js +import { createStream } from 'table'; + +import _ from 'lodash'; + +const config = { + columnDefault: { + width: 50 + }, + columnCount: 3, + columns: [ + { + width: 10, + alignment: 'right' + }, + { alignment: 'center' }, + { width: 10 } + + ] +}; + +const stream = createStream(config); + +let i = 0; + +setInterval(() => { + let random; + + random = _.sample('abcdefghijklmnopqrstuvwxyz', _.random(1, 30)).join(''); + + stream.write([i++, new Date(), random]); +}, 500); +``` + +![Streaming random data.](./.README/api/stream/streaming-random.gif) + + + +### getBorderCharacters + +**Parameter:** + - **_template_** + - Type: `'honeywell' | 'norc' | 'ramac' | 'void'` + - Required: `true` + +You can load one of the predefined border templates using `getBorderCharacters` function. + +```js +import { table, getBorderCharacters } from 'table'; + +const data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +const config = { + border: getBorderCharacters(`name of the template`) +}; + +console.log(table(data, config)); +``` + +``` +# honeywell + +╔════╤════╤════╗ +║ 0A │ 0B │ 0C ║ +╟────┼────┼────╢ +║ 1A │ 1B │ 1C ║ +╟────┼────┼────╢ +║ 2A │ 2B │ 2C ║ +╚════╧════╧════╝ + +# norc + +┌────┬────┬────┐ +│ 0A │ 0B │ 0C │ +├────┼────┼────┤ +│ 1A │ 1B │ 1C │ +├────┼────┼────┤ +│ 2A │ 2B │ 2C │ +└────┴────┴────┘ + +# ramac (ASCII; for use in terminals that do not support Unicode characters) + ++----+----+----+ +| 0A | 0B | 0C | +|----|----|----| +| 1A | 1B | 1C | +|----|----|----| +| 2A | 2B | 2C | ++----+----+----+ + +# void (no borders; see "borderless table" section of the documentation) + + 0A 0B 0C + + 1A 1B 1C + + 2A 2B 2C + +``` + +Raise [an issue](https://github.com/gajus/table/issues) if you'd like to contribute a new border template. + + +#### Borderless Table + +Simply using `void` border character template creates a table with a lot of unnecessary spacing. + +To create a more pleasant to the eye table, reset the padding and remove the joining rows, e.g. + +```js + +const output = table(data, { + border: getBorderCharacters('void'), + columnDefault: { + paddingLeft: 0, + paddingRight: 1 + }, + drawHorizontalLine: () => false + } +); + +console.log(output); +``` + +``` +0A 0B 0C +1A 1B 1C +2A 2B 2C +``` + diff --git a/node_modules/table/dist/src/alignSpanningCell.d.ts b/node_modules/table/dist/src/alignSpanningCell.d.ts new file mode 100644 index 000000000..a1b6e29d9 --- /dev/null +++ b/node_modules/table/dist/src/alignSpanningCell.d.ts @@ -0,0 +1,7 @@ +import type { SpanningCellContext } from './spanningCellManager'; +import type { RangeConfig } from './types/internal'; +/** + * Fill content into all cells in range in order to calculate total height + */ +export declare const wrapRangeContent: (rangeConfig: RangeConfig, rangeWidth: number, context: SpanningCellContext) => string[]; +export declare const alignVerticalRangeContent: (range: RangeConfig, content: string[], context: SpanningCellContext) => string[]; diff --git a/node_modules/table/dist/src/alignSpanningCell.js b/node_modules/table/dist/src/alignSpanningCell.js new file mode 100644 index 000000000..de2ec7780 --- /dev/null +++ b/node_modules/table/dist/src/alignSpanningCell.js @@ -0,0 +1,48 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.alignVerticalRangeContent = exports.wrapRangeContent = void 0; +const string_width_1 = __importDefault(require("string-width")); +const alignString_1 = require("./alignString"); +const mapDataUsingRowHeights_1 = require("./mapDataUsingRowHeights"); +const padTableData_1 = require("./padTableData"); +const truncateTableData_1 = require("./truncateTableData"); +const utils_1 = require("./utils"); +const wrapCell_1 = require("./wrapCell"); +/** + * Fill content into all cells in range in order to calculate total height + */ +const wrapRangeContent = (rangeConfig, rangeWidth, context) => { + const { topLeft, paddingRight, paddingLeft, truncate, wrapWord, alignment } = rangeConfig; + const originalContent = context.rows[topLeft.row][topLeft.col]; + const contentWidth = rangeWidth - paddingLeft - paddingRight; + return (0, wrapCell_1.wrapCell)((0, truncateTableData_1.truncateString)(originalContent, truncate), contentWidth, wrapWord).map((line) => { + const alignedLine = (0, alignString_1.alignString)(line, contentWidth, alignment); + return (0, padTableData_1.padString)(alignedLine, paddingLeft, paddingRight); + }); +}; +exports.wrapRangeContent = wrapRangeContent; +const alignVerticalRangeContent = (range, content, context) => { + const { rows, drawHorizontalLine, rowHeights } = context; + const { topLeft, bottomRight, verticalAlignment } = range; + // They are empty before calculateRowHeights function run + if (rowHeights.length === 0) { + return []; + } + const totalCellHeight = (0, utils_1.sumArray)(rowHeights.slice(topLeft.row, bottomRight.row + 1)); + const totalBorderHeight = bottomRight.row - topLeft.row; + const hiddenHorizontalBorderCount = (0, utils_1.sequence)(topLeft.row + 1, bottomRight.row).filter((horizontalBorderIndex) => { + return !drawHorizontalLine(horizontalBorderIndex, rows.length); + }).length; + const availableRangeHeight = totalCellHeight + totalBorderHeight - hiddenHorizontalBorderCount; + return (0, mapDataUsingRowHeights_1.padCellVertically)(content, availableRangeHeight, verticalAlignment).map((line) => { + if (line.length === 0) { + return ' '.repeat((0, string_width_1.default)(content[0])); + } + return line; + }); +}; +exports.alignVerticalRangeContent = alignVerticalRangeContent; +//# sourceMappingURL=alignSpanningCell.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/alignSpanningCell.js.map b/node_modules/table/dist/src/alignSpanningCell.js.map new file mode 100644 index 000000000..9d44671d0 --- /dev/null +++ b/node_modules/table/dist/src/alignSpanningCell.js.map @@ -0,0 +1 @@ +{"version":3,"file":"alignSpanningCell.js","sourceRoot":"","sources":["../../src/alignSpanningCell.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AACvC,+CAEuB;AACvB,qEAEkC;AAClC,iDAEwB;AAIxB,2DAE6B;AAI7B,mCAEiB;AACjB,yCAEoB;AAEpB;;GAEG;AACI,MAAM,gBAAgB,GAAG,CAAC,WAAwB,EAAE,UAAkB,EAAE,OAA4B,EAAY,EAAE;IACvH,MAAM,EAAC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,S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AAM,CAAC,CAAC,qBAAqB,EAAE,EAAE;QAC9G,OAAO,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC,MAAM,CAAC;IAEV,MAAM,oBAAoB,GAAG,eAAe,GAAG,iBAAiB,GAAG,2BAA2B,CAAC;IAE/F,OAAO,IAAA,0CAAiB,EAAC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACtF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,OAAO,GAAG,CAAC,MAAM,CAAC,IAAA,sBAAW,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5C;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAxBW,QAAA,yBAAyB,6BAwBpC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/alignString.d.ts b/node_modules/table/dist/src/alignString.d.ts new file mode 100644 index 000000000..459fa7ea9 --- /dev/null +++ b/node_modules/table/dist/src/alignString.d.ts @@ -0,0 +1,6 @@ +import type { Alignment } from './types/api'; +/** + * Pads a string to the left and/or right to position the subject + * text in a desired alignment within a container. + */ +export declare const alignString: (subject: string, containerWidth: number, alignment: Alignment) => string; diff --git a/node_modules/table/dist/src/alignString.js b/node_modules/table/dist/src/alignString.js new file mode 100644 index 000000000..a15231a28 --- /dev/null +++ b/node_modules/table/dist/src/alignString.js @@ -0,0 +1,60 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.alignString = void 0; +const string_width_1 = __importDefault(require("string-width")); +const utils_1 = require("./utils"); +const alignLeft = (subject, width) => { + return subject + ' '.repeat(width); +}; +const alignRight = (subject, width) => { + return ' '.repeat(width) + subject; +}; +const alignCenter = (subject, width) => { + return ' '.repeat(Math.floor(width / 2)) + subject + ' '.repeat(Math.ceil(width / 2)); +}; +const alignJustify = (subject, width) => { + const spaceSequenceCount = (0, utils_1.countSpaceSequence)(subject); + if (spaceSequenceCount === 0) { + return alignLeft(subject, width); + } + const addingSpaces = (0, utils_1.distributeUnevenly)(width, spaceSequenceCount); + if (Math.max(...addingSpaces) > 3) { + return alignLeft(subject, width); + } + let spaceSequenceIndex = 0; + return subject.replace(/\s+/g, (groupSpace) => { + return groupSpace + ' '.repeat(addingSpaces[spaceSequenceIndex++]); + }); +}; +/** + * Pads a string to the left and/or right to position the subject + * text in a desired alignment within a container. + */ +const alignString = (subject, containerWidth, alignment) => { + const subjectWidth = (0, string_width_1.default)(subject); + if (subjectWidth === containerWidth) { + return subject; + } + if (subjectWidth > containerWidth) { + throw new Error('Subject parameter value width cannot be greater than the container width.'); + } + if (subjectWidth === 0) { + return ' '.repeat(containerWidth); + } + const availableWidth = containerWidth - subjectWidth; + if (alignment === 'left') { + return alignLeft(subject, availableWidth); + } + if (alignment === 'right') { + return alignRight(subject, availableWidth); + } + if (alignment === 'justify') { + return alignJustify(subject, availableWidth); + } + return alignCenter(subject, availableWidth); +}; +exports.alignString = alignString; +//# sourceMappingURL=alignString.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/alignString.js.map b/node_modules/table/dist/src/alignString.js.map new file mode 100644 index 000000000..8324952e3 --- /dev/null +++ b/node_modules/table/dist/src/alignString.js.map @@ -0,0 +1 @@ +{"version":3,"file":"alignString.js","sourceRoot":"","sources":["../../src/alignString.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AAIvC,mCAEiB;AAEjB,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC3D,OAAO,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IA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AO,OAAO,CAAC;KAChB;IAED,IAAI,YAAY,GAAG,cAAc,EAAE;QACjC,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;KAC9F;IAED,IAAI,YAAY,KAAK,CAAC,EAAE;QACtB,OAAO,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;KACnC;IAED,MAAM,cAAc,GAAG,cAAc,GAAG,YAAY,CAAC;IAErD,IAAI,SAAS,KAAK,MAAM,EAAE;QACxB,OAAO,SAAS,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC3C;IAED,IAAI,SAAS,KAAK,OAAO,EAAE;QACzB,OAAO,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC5C;IAED,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,OAAO,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC9C;IAED,OAAO,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AAC9C,CAAC,CAAC;AA9BW,QAAA,WAAW,eA8BtB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/alignTableData.d.ts b/node_modules/table/dist/src/alignTableData.d.ts new file mode 100644 index 000000000..73314d83b --- /dev/null +++ b/node_modules/table/dist/src/alignTableData.d.ts @@ -0,0 +1,2 @@ +import type { BaseConfig, Row } from './types/internal'; +export declare const alignTableData: (rows: Row[], config: BaseConfig) => Row[]; diff --git a/node_modules/table/dist/src/alignTableData.js b/node_modules/table/dist/src/alignTableData.js new file mode 100644 index 000000000..942cb3b79 --- /dev/null +++ b/node_modules/table/dist/src/alignTableData.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.alignTableData = void 0; +const alignString_1 = require("./alignString"); +const alignTableData = (rows, config) => { + return rows.map((row, rowIndex) => { + return row.map((cell, cellIndex) => { + var _a; + const { width, alignment } = config.columns[cellIndex]; + const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex, + row: rowIndex }, { mapped: true }); + if (containingRange) { + return cell; + } + return (0, alignString_1.alignString)(cell, width, alignment); + }); + }); +}; +exports.alignTableData = alignTableData; +//# sourceMappingURL=alignTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/alignTableData.js.map b/node_modules/table/dist/src/alignTableData.js.map new file mode 100644 index 000000000..c7a9ba3d4 --- /dev/null +++ b/node_modules/table/dist/src/alignTableData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"alignTableData.js","sourceRoot":"","sources":["../../src/alignTableData.ts"],"names":[],"mappings":";;;AAAA,+CAEuB;AAMhB,MAAM,cAAc,GAAG,CAAC,IAAW,EAAE,MAAkB,EAAS,EAAE;IACvE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;QAChC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;;YACjC,MAAM,EAAC,KAAK,EAAE,SAAS,EAAC,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAErD,MAAM,eAAe,GAAG,MAAA,MAAM,CAAC,mBAAmB,0CAAE,kBAAkB,CAAC,EAAC,GAAG,EAAE,SAAS;gBACpF,GAAG,EAAE,QAAQ,EAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;YAClC,IAAI,eAAe,EAAE;gBACnB,OAAO,IAAI,CAAC;aACb;YAED,OAAO,IAAA,yBAAW,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAdW,QAAA,cAAc,kBAczB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateCellHeight.d.ts b/node_modules/table/dist/src/calculateCellHeight.d.ts new file mode 100644 index 000000000..76fd7f1e7 --- /dev/null +++ b/node_modules/table/dist/src/calculateCellHeight.d.ts @@ -0,0 +1,4 @@ +/** + * Calculates height of cell content in regard to its width and word wrapping. + */ +export declare const calculateCellHeight: (value: string, columnWidth: number, useWrapWord?: boolean) => number; diff --git a/node_modules/table/dist/src/calculateCellHeight.js b/node_modules/table/dist/src/calculateCellHeight.js new file mode 100644 index 000000000..010c41f07 --- /dev/null +++ b/node_modules/table/dist/src/calculateCellHeight.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.calculateCellHeight = void 0; +const wrapCell_1 = require("./wrapCell"); +/** + * Calculates height of cell content in regard to its width and word wrapping. + */ +const calculateCellHeight = (value, columnWidth, useWrapWord = false) => { + return (0, wrapCell_1.wrapCell)(value, columnWidth, useWrapWord).length; +}; +exports.calculateCellHeight = calculateCellHeight; +//# sourceMappingURL=calculateCellHeight.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateCellHeight.js.map b/node_modules/table/dist/src/calculateCellHeight.js.map new file mode 100644 index 000000000..61af12108 --- /dev/null +++ b/node_modules/table/dist/src/calculateCellHeight.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calculateCellHeight.js","sourceRoot":"","sources":["../../src/calculateCellHeight.ts"],"names":[],"mappings":";;;AAAA,yCAEoB;AAEpB;;GAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAE,WAAmB,EAAE,WAAW,GAAG,KAAK,EAAU,EAAE;IACrG,OAAO,IAAA,mBAAQ,EAAC,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC;AAC1D,CAAC,CAAC;AAFW,QAAA,mBAAmB,uBAE9B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts b/node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts new file mode 100644 index 000000000..d1de524b6 --- /dev/null +++ b/node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts @@ -0,0 +1,7 @@ +import type { SpanningCellConfig } from './types/api'; +import type { Row, Cell } from './types/internal'; +export declare const calculateMaximumCellWidth: (cell: Cell) => number; +/** + * Produces an array of values that describe the largest value length (width) in every column. + */ +export declare const calculateMaximumColumnWidths: (rows: Row[], spanningCellConfigs?: SpanningCellConfig[]) => number[]; diff --git a/node_modules/table/dist/src/calculateMaximumColumnWidths.js b/node_modules/table/dist/src/calculateMaximumColumnWidths.js new file mode 100644 index 000000000..5b677ed9d --- /dev/null +++ b/node_modules/table/dist/src/calculateMaximumColumnWidths.js @@ -0,0 +1,36 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.calculateMaximumColumnWidths = exports.calculateMaximumCellWidth = void 0; +const string_width_1 = __importDefault(require("string-width")); +const utils_1 = require("./utils"); +const calculateMaximumCellWidth = (cell) => { + return Math.max(...cell.split('\n').map(string_width_1.default)); +}; +exports.calculateMaximumCellWidth = calculateMaximumCellWidth; +/** + * Produces an array of values that describe the largest value length (width) in every column. + */ +const calculateMaximumColumnWidths = (rows, spanningCellConfigs = []) => { + const columnWidths = new Array(rows[0].length).fill(0); + const rangeCoordinates = spanningCellConfigs.map(utils_1.calculateRangeCoordinate); + const isSpanningCell = (rowIndex, columnIndex) => { + return rangeCoordinates.some((rangeCoordinate) => { + return (0, utils_1.isCellInRange)({ col: columnIndex, + row: rowIndex }, rangeCoordinate); + }); + }; + rows.forEach((row, rowIndex) => { + row.forEach((cell, cellIndex) => { + if (isSpanningCell(rowIndex, cellIndex)) { + return; + } + columnWidths[cellIndex] = Math.max(columnWidths[cellIndex], (0, exports.calculateMaximumCellWidth)(cell)); + }); + }); + return columnWidths; +}; +exports.calculateMaximumColumnWidths = calculateMaximumColumnWidths; +//# sourceMappingURL=calculateMaximumColumnWidths.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateMaximumColumnWidths.js.map b/node_modules/table/dist/src/calculateMaximumColumnWidths.js.map new file mode 100644 index 000000000..5cb01fc2e --- /dev/null +++ b/node_modules/table/dist/src/calculateMaximumColumnWidths.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calculateMaximumColumnWidths.js","sourceRoot":"","sources":["../../src/calculateMaximumColumnWidths.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AAQvC,mCAEiB;AAEV,MAAM,yBAAyB,GAAG,CAAC,IAAU,EAAU,EAAE;IAC9D,OAAO,IAAI,CAAC,GAAG,CACb,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,sBAAW,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC;AAJW,QAAA,yBAAyB,6BAIpC;AAEF;;GAEG;AACI,MAAM,4BAA4B,GAAG,CAAC,IAAW,EAAE,sBAA4C,EAAE,EAAY,EAAE;IACpH,MAAM,YAAY,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,GAAG,CAAC,gCAAwB,CAAC,CAAC;IAC3E,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,WAAmB,EAAW,EAAE;QACxE,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;YAC/C,OAAO,IAAA,qBAAa,EAAC,EAAC,GAAG,EAAE,WAAW;gBACpC,GAAG,EAAE,QAAQ,EAAC,EAAE,eAAe,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;QAC7B,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;YAC9B,IAAI,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE;gBACvC,OAAO;aACR;YACD,YAAY,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,IAAA,iCAAyB,EAAC,IAAI,CAAC,CAAC,CAAC;QAC/F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AApBW,QAAA,4BAA4B,gCAoBvC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateOutputColumnWidths.d.ts b/node_modules/table/dist/src/calculateOutputColumnWidths.d.ts new file mode 100644 index 000000000..f16bb54ef --- /dev/null +++ b/node_modules/table/dist/src/calculateOutputColumnWidths.d.ts @@ -0,0 +1,2 @@ +import type { TableConfig } from './types/internal'; +export declare const calculateOutputColumnWidths: (config: TableConfig) => number[]; diff --git a/node_modules/table/dist/src/calculateOutputColumnWidths.js b/node_modules/table/dist/src/calculateOutputColumnWidths.js new file mode 100644 index 000000000..7a4192973 --- /dev/null +++ b/node_modules/table/dist/src/calculateOutputColumnWidths.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.calculateOutputColumnWidths = void 0; +const calculateOutputColumnWidths = (config) => { + return config.columns.map((col) => { + return col.paddingLeft + col.width + col.paddingRight; + }); +}; +exports.calculateOutputColumnWidths = calculateOutputColumnWidths; +//# sourceMappingURL=calculateOutputColumnWidths.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateOutputColumnWidths.js.map b/node_modules/table/dist/src/calculateOutputColumnWidths.js.map new file mode 100644 index 000000000..dafe77481 --- /dev/null +++ b/node_modules/table/dist/src/calculateOutputColumnWidths.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calculateOutputColumnWidths.js","sourceRoot":"","sources":["../../src/calculateOutputColumnWidths.ts"],"names":[],"mappings":";;;AAIO,MAAM,2BAA2B,GAAG,CAAC,MAAmB,EAAY,EAAE;IAC3E,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,OAAO,GAAG,CAAC,WAAW,GAAG,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAJW,QAAA,2BAA2B,+BAItC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateRowHeights.d.ts b/node_modules/table/dist/src/calculateRowHeights.d.ts new file mode 100644 index 000000000..27c9183a6 --- /dev/null +++ b/node_modules/table/dist/src/calculateRowHeights.d.ts @@ -0,0 +1,5 @@ +import type { BaseConfig, Row } from './types/internal'; +/** + * Produces an array of values that describe the largest value length (height) in every row. + */ +export declare const calculateRowHeights: (rows: Row[], config: BaseConfig) => number[]; diff --git a/node_modules/table/dist/src/calculateRowHeights.js b/node_modules/table/dist/src/calculateRowHeights.js new file mode 100644 index 000000000..72ec05a48 --- /dev/null +++ b/node_modules/table/dist/src/calculateRowHeights.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.calculateRowHeights = void 0; +const calculateCellHeight_1 = require("./calculateCellHeight"); +const utils_1 = require("./utils"); +/** + * Produces an array of values that describe the largest value length (height) in every row. + */ +const calculateRowHeights = (rows, config) => { + const rowHeights = []; + for (const [rowIndex, row] of rows.entries()) { + let rowHeight = 1; + row.forEach((cell, cellIndex) => { + var _a; + const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex, + row: rowIndex }); + if (!containingRange) { + const cellHeight = (0, calculateCellHeight_1.calculateCellHeight)(cell, config.columns[cellIndex].width, config.columns[cellIndex].wrapWord); + rowHeight = Math.max(rowHeight, cellHeight); + return; + } + const { topLeft, bottomRight, height } = containingRange; + // bottom-most cell of a range needs to contain all remain lines of spanning cells + if (rowIndex === bottomRight.row) { + const totalOccupiedSpanningCellHeight = (0, utils_1.sumArray)(rowHeights.slice(topLeft.row)); + const totalHorizontalBorderHeight = bottomRight.row - topLeft.row; + const totalHiddenHorizontalBorderHeight = (0, utils_1.sequence)(topLeft.row + 1, bottomRight.row).filter((horizontalBorderIndex) => { + var _a; + /* istanbul ignore next */ + return !((_a = config.drawHorizontalLine) === null || _a === void 0 ? void 0 : _a.call(config, horizontalBorderIndex, rows.length)); + }).length; + const cellHeight = height - totalOccupiedSpanningCellHeight - totalHorizontalBorderHeight + totalHiddenHorizontalBorderHeight; + rowHeight = Math.max(rowHeight, cellHeight); + } + // otherwise, just depend on other sibling cell heights in the row + }); + rowHeights.push(rowHeight); + } + return rowHeights; +}; +exports.calculateRowHeights = calculateRowHeights; +//# sourceMappingURL=calculateRowHeights.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateRowHeights.js.map b/node_modules/table/dist/src/calculateRowHeights.js.map new file mode 100644 index 000000000..1a7a2d96a --- /dev/null +++ b/node_modules/table/dist/src/calculateRowHeights.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calculateRowHeights.js","sourceRoot":"","sources":["../../src/calculateRowHeights.ts"],"names":[],"mappings":";;;AAAA,+DAE+B;AAK/B,mCAGiB;AAEjB;;GAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,IAAW,EAAE,MAAkB,EAAY,EAAE;IAC/E,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,KAAK,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;QAC5C,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;;YAC9B,MAAM,eAAe,GAAG,MAAA,MAAM,CAAC,mBAAmB,0CAAE,kBAAkB,CAAC,EAAC,GAAG,EAAE,SAAS;gBACpF,GAAG,EAAE,QAAQ,EAAC,CAAC,CAAC;YAElB,IAAI,CAAC,eAAe,EAAE;gBACpB,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;gBAClH,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;gBAE5C,OAAO;aACR;YACD,MAAM,EAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAC,GAAG,eAAe,CAAC;YAEvD,kFAAkF;YAClF,IAAI,QAAQ,KAAK,WAAW,CAAC,GAAG,EAAE;gBAChC,MAAM,+BAA+B,GAAG,IAAA,gBAAQ,EAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;gBAChF,MAAM,2BAA2B,GAAG,WAAW,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;gBAClE,MAAM,iCAAiC,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,GAAG,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,qBAAqB,EAAE,EAAE;;oBACpH,0BAA0B;oBAC1B,OAAO,CAAC,CAAA,MAAA,MAAM,CAAC,kBAAkB,+CAAzB,MAAM,EAAsB,qBAAqB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA,CAAC;gBAC1E,CAAC,CAAC,CAAC,MAAM,CAAC;gBAEV,MAAM,UAAU,GAAG,MAAM,GAAG,+BAA+B,GAAG,2BAA2B,GAAG,iCAAiC,CAAC;gBAC9H,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;aAC7C;YAED,kEAAkE;QACpE,CAAC,CAAC,CAAC;QAEH,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAC5B;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAtCW,QAAA,mBAAmB,uBAsC9B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateSpanningCellWidth.d.ts b/node_modules/table/dist/src/calculateSpanningCellWidth.d.ts new file mode 100644 index 000000000..8a2820ddb --- /dev/null +++ b/node_modules/table/dist/src/calculateSpanningCellWidth.d.ts @@ -0,0 +1,3 @@ +import type { SpanningCellParameters } from './spanningCellManager'; +import type { RangeConfig } from './types/internal'; +export declare const calculateSpanningCellWidth: (rangeConfig: RangeConfig, dependencies: SpanningCellParameters) => number; diff --git a/node_modules/table/dist/src/calculateSpanningCellWidth.js b/node_modules/table/dist/src/calculateSpanningCellWidth.js new file mode 100644 index 000000000..fc8866c03 --- /dev/null +++ b/node_modules/table/dist/src/calculateSpanningCellWidth.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.calculateSpanningCellWidth = void 0; +const utils_1 = require("./utils"); +const calculateSpanningCellWidth = (rangeConfig, dependencies) => { + const { columnsConfig, drawVerticalLine } = dependencies; + const { topLeft, bottomRight } = rangeConfig; + const totalWidth = (0, utils_1.sumArray)(columnsConfig.slice(topLeft.col, bottomRight.col + 1).map(({ width }) => { + return width; + })); + const totalPadding = topLeft.col === bottomRight.col ? + columnsConfig[topLeft.col].paddingRight + + columnsConfig[bottomRight.col].paddingLeft : + (0, utils_1.sumArray)(columnsConfig + .slice(topLeft.col, bottomRight.col + 1) + .map(({ paddingLeft, paddingRight }) => { + return paddingLeft + paddingRight; + })); + const totalBorderWidths = bottomRight.col - topLeft.col; + const totalHiddenVerticalBorders = (0, utils_1.sequence)(topLeft.col + 1, bottomRight.col).filter((verticalBorderIndex) => { + return !drawVerticalLine(verticalBorderIndex, columnsConfig.length); + }).length; + return totalWidth + totalPadding + totalBorderWidths - totalHiddenVerticalBorders; +}; +exports.calculateSpanningCellWidth = calculateSpanningCellWidth; +//# sourceMappingURL=calculateSpanningCellWidth.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateSpanningCellWidth.js.map b/node_modules/table/dist/src/calculateSpanningCellWidth.js.map new file mode 100644 index 000000000..b0de977a0 --- /dev/null +++ b/node_modules/table/dist/src/calculateSpanningCellWidth.js.map @@ -0,0 +1 @@ +{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AAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC,MAAM,CAAC;IAEV,OAAO,UAAU,GAAG,YAAY,GAAG,iBAAiB,GAAG,0BAA0B,CAAC;AACpF,CAAC,CAAC;AA5BW,QAAA,0BAA0B,8BA4BrC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/createStream.d.ts b/node_modules/table/dist/src/createStream.d.ts new file mode 100644 index 000000000..9c2df8eb5 --- /dev/null +++ b/node_modules/table/dist/src/createStream.d.ts @@ -0,0 +1,2 @@ +import type { StreamUserConfig, WritableStream } from './types/api'; +export declare const createStream: (userConfig: StreamUserConfig) => WritableStream; diff --git a/node_modules/table/dist/src/createStream.js b/node_modules/table/dist/src/createStream.js new file mode 100644 index 000000000..d526161df --- /dev/null +++ b/node_modules/table/dist/src/createStream.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createStream = void 0; +const alignTableData_1 = require("./alignTableData"); +const calculateRowHeights_1 = require("./calculateRowHeights"); +const drawBorder_1 = require("./drawBorder"); +const drawRow_1 = require("./drawRow"); +const makeStreamConfig_1 = require("./makeStreamConfig"); +const mapDataUsingRowHeights_1 = require("./mapDataUsingRowHeights"); +const padTableData_1 = require("./padTableData"); +const stringifyTableData_1 = require("./stringifyTableData"); +const truncateTableData_1 = require("./truncateTableData"); +const utils_1 = require("./utils"); +const prepareData = (data, config) => { + let rows = (0, stringifyTableData_1.stringifyTableData)(data); + rows = (0, truncateTableData_1.truncateTableData)(rows, (0, utils_1.extractTruncates)(config)); + const rowHeights = (0, calculateRowHeights_1.calculateRowHeights)(rows, config); + rows = (0, mapDataUsingRowHeights_1.mapDataUsingRowHeights)(rows, rowHeights, config); + rows = (0, alignTableData_1.alignTableData)(rows, config); + rows = (0, padTableData_1.padTableData)(rows, config); + return rows; +}; +const create = (row, columnWidths, config) => { + const rows = prepareData([row], config); + const body = rows.map((literalRow) => { + return (0, drawRow_1.drawRow)(literalRow, config); + }).join(''); + let output; + output = ''; + output += (0, drawBorder_1.drawBorderTop)(columnWidths, config); + output += body; + output += (0, drawBorder_1.drawBorderBottom)(columnWidths, config); + output = output.trimEnd(); + process.stdout.write(output); +}; +const append = (row, columnWidths, config) => { + const rows = prepareData([row], config); + const body = rows.map((literalRow) => { + return (0, drawRow_1.drawRow)(literalRow, config); + }).join(''); + let output = ''; + const bottom = (0, drawBorder_1.drawBorderBottom)(columnWidths, config); + if (bottom !== '\n') { + output = '\r\u001B[K'; + } + output += (0, drawBorder_1.drawBorderJoin)(columnWidths, config); + output += body; + output += bottom; + output = output.trimEnd(); + process.stdout.write(output); +}; +const createStream = (userConfig) => { + const config = (0, makeStreamConfig_1.makeStreamConfig)(userConfig); + const columnWidths = Object.values(config.columns).map((column) => { + return column.width + column.paddingLeft + column.paddingRight; + }); + let empty = true; + return { + write: (row) => { + if (row.length !== config.columnCount) { + throw new Error('Row cell count does not match the config.columnCount.'); + } + if (empty) { + empty = false; + create(row, columnWidths, config); + } + else { + append(row, columnWidths, config); + } + }, + }; +}; +exports.createStream = createStream; +//# sourceMappingURL=createStream.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/createStream.js.map b/node_modules/table/dist/src/createStream.js.map new file mode 100644 index 000000000..7ec269cff --- /dev/null +++ b/node_modules/table/dist/src/createStream.js.map @@ -0,0 +1 @@ +{"version":3,"file":"createStream.js","sourceRoot":"","sources":["../../src/createStream.ts"],"names":[],"mappings":";;;AAAA,qDAE0B;AAC1B,+DAE+B;AAC/B,6CAIsB;AACtB,uCAEmB;AACnB,yDAE4B;AAC5B,qEAEkC;AAClC,iDAEwB;AACxB,6DAE8B;AAC9B,2DAE6B;AAQ7B,mCAEiB;AAEjB,MAAM,WAAW,GAAG,CAAC,IAAW,EAAE,MAAoB,EAAE,EAAE;IACxD,IAAI,IAAI,GAAG,IAAA,uCAAkB,EAAC,IAAI,CAAC,CAAC;IAEpC,IAAI,GAAG,IAAA,qCAAiB,EAAC,IAAI,EAAE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AAM,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;aACnC;iBAAM;gBACL,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;aACnC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,YAAY,gBAwBvB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/drawBorder.d.ts b/node_modules/table/dist/src/drawBorder.d.ts new file mode 100644 index 000000000..82b4dc54e --- /dev/null +++ b/node_modules/table/dist/src/drawBorder.d.ts @@ -0,0 +1,34 @@ +import type { SpanningCellManager } from './spanningCellManager'; +import type { BorderConfig, DrawVerticalLine } from './types/api'; +import type { SeparatorGetter } from './types/internal'; +declare type Separator = { + readonly left: string; + readonly right: string; + readonly body: string; + readonly bodyJoinOuter?: string; + readonly bodyJoinInner?: string; + readonly join: string; + readonly joinUp?: string; + readonly joinDown?: string; + readonly joinLeft?: string; + readonly joinRight?: string; +}; +export declare const drawBorderSegments: (columnWidths: number[], parameters: Parameters[1]) => string[]; +export declare const createSeparatorGetter: (dependencies: Parameters[1]) => (verticalBorderIndex: number, columnCount: number) => string; +export declare const drawBorder: (columnWidths: number[], parameters: Omit & { + separator: Separator; +}) => string; +export declare const drawBorderTop: (columnWidths: number[], parameters: DrawBorderParameters) => string; +export declare const drawBorderJoin: (columnWidths: number[], parameters: DrawBorderParameters) => string; +export declare const drawBorderBottom: (columnWidths: number[], parameters: DrawBorderParameters) => string; +export declare type BorderGetterParameters = { + border: BorderConfig; + drawVerticalLine: DrawVerticalLine; + spanningCellManager?: SpanningCellManager; + rowCount?: number; +}; +export declare type DrawBorderParameters = Omit & { + horizontalBorderIndex?: number; +}; +export declare const createTableBorderGetter: (columnWidths: number[], parameters: BorderGetterParameters) => SeparatorGetter; +export {}; diff --git a/node_modules/table/dist/src/drawBorder.js b/node_modules/table/dist/src/drawBorder.js new file mode 100644 index 000000000..81ede5063 --- /dev/null +++ b/node_modules/table/dist/src/drawBorder.js @@ -0,0 +1,202 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createTableBorderGetter = exports.drawBorderBottom = exports.drawBorderJoin = exports.drawBorderTop = exports.drawBorder = exports.createSeparatorGetter = exports.drawBorderSegments = void 0; +const drawContent_1 = require("./drawContent"); +const drawBorderSegments = (columnWidths, parameters) => { + const { separator, horizontalBorderIndex, spanningCellManager } = parameters; + return columnWidths.map((columnWidth, columnIndex) => { + const normalSegment = separator.body.repeat(columnWidth); + if (horizontalBorderIndex === undefined) { + return normalSegment; + } + /* istanbul ignore next */ + const range = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.getContainingRange({ col: columnIndex, + row: horizontalBorderIndex }); + if (!range) { + return normalSegment; + } + const { topLeft } = range; + // draw border segments as usual for top border of spanning cell + if (horizontalBorderIndex === topLeft.row) { + return normalSegment; + } + // if for first column/row of spanning cell, just skip + if (columnIndex !== topLeft.col) { + return ''; + } + return range.extractBorderContent(horizontalBorderIndex); + }); +}; +exports.drawBorderSegments = drawBorderSegments; +const createSeparatorGetter = (dependencies) => { + const { separator, spanningCellManager, horizontalBorderIndex, rowCount } = dependencies; + // eslint-disable-next-line complexity + return (verticalBorderIndex, columnCount) => { + const inSameRange = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.inSameRange; + if (horizontalBorderIndex !== undefined && inSameRange) { + const topCell = { col: verticalBorderIndex, + row: horizontalBorderIndex - 1 }; + const leftCell = { col: verticalBorderIndex - 1, + row: horizontalBorderIndex }; + const oppositeCell = { col: verticalBorderIndex - 1, + row: horizontalBorderIndex - 1 }; + const currentCell = { col: verticalBorderIndex, + row: horizontalBorderIndex }; + const pairs = [ + [oppositeCell, topCell], + [topCell, currentCell], + [currentCell, leftCell], + [leftCell, oppositeCell], + ]; + // left side of horizontal border + if (verticalBorderIndex === 0) { + if (inSameRange(currentCell, topCell) && separator.bodyJoinOuter) { + return separator.bodyJoinOuter; + } + return separator.left; + } + // right side of horizontal border + if (verticalBorderIndex === columnCount) { + if (inSameRange(oppositeCell, leftCell) && separator.bodyJoinOuter) { + return separator.bodyJoinOuter; + } + return separator.right; + } + // top horizontal border + if (horizontalBorderIndex === 0) { + if (inSameRange(currentCell, leftCell)) { + return separator.body; + } + return separator.join; + } + // bottom horizontal border + if (horizontalBorderIndex === rowCount) { + if (inSameRange(topCell, oppositeCell)) { + return separator.body; + } + return separator.join; + } + const sameRangeCount = pairs.map((pair) => { + return inSameRange(...pair); + }).filter(Boolean).length; + // four cells are belongs to different spanning cells + if (sameRangeCount === 0) { + return separator.join; + } + // belong to one spanning cell + if (sameRangeCount === 4) { + return ''; + } + // belongs to two spanning cell + if (sameRangeCount === 2) { + if (inSameRange(...pairs[1]) && inSameRange(...pairs[3]) && separator.bodyJoinInner) { + return separator.bodyJoinInner; + } + return separator.body; + } + /* istanbul ignore next */ + if (sameRangeCount === 1) { + if (!separator.joinRight || !separator.joinLeft || !separator.joinUp || !separator.joinDown) { + throw new Error(`Can not get border separator for position [${horizontalBorderIndex}, ${verticalBorderIndex}]`); + } + if (inSameRange(...pairs[0])) { + return separator.joinDown; + } + if (inSameRange(...pairs[1])) { + return separator.joinLeft; + } + if (inSameRange(...pairs[2])) { + return separator.joinUp; + } + return separator.joinRight; + } + /* istanbul ignore next */ + throw new Error('Invalid case'); + } + if (verticalBorderIndex === 0) { + return separator.left; + } + if (verticalBorderIndex === columnCount) { + return separator.right; + } + return separator.join; + }; +}; +exports.createSeparatorGetter = createSeparatorGetter; +const drawBorder = (columnWidths, parameters) => { + const borderSegments = (0, exports.drawBorderSegments)(columnWidths, parameters); + const { drawVerticalLine, horizontalBorderIndex, spanningCellManager } = parameters; + return (0, drawContent_1.drawContent)({ + contents: borderSegments, + drawSeparator: drawVerticalLine, + elementType: 'border', + rowIndex: horizontalBorderIndex, + separatorGetter: (0, exports.createSeparatorGetter)(parameters), + spanningCellManager, + }) + '\n'; +}; +exports.drawBorder = drawBorder; +const drawBorderTop = (columnWidths, parameters) => { + const { border } = parameters; + const result = (0, exports.drawBorder)(columnWidths, { + ...parameters, + separator: { + body: border.topBody, + join: border.topJoin, + left: border.topLeft, + right: border.topRight, + }, + }); + if (result === '\n') { + return ''; + } + return result; +}; +exports.drawBorderTop = drawBorderTop; +const drawBorderJoin = (columnWidths, parameters) => { + const { border } = parameters; + return (0, exports.drawBorder)(columnWidths, { + ...parameters, + separator: { + body: border.joinBody, + bodyJoinInner: border.bodyJoin, + bodyJoinOuter: border.bodyLeft, + join: border.joinJoin, + joinDown: border.joinMiddleDown, + joinLeft: border.joinMiddleLeft, + joinRight: border.joinMiddleRight, + joinUp: border.joinMiddleUp, + left: border.joinLeft, + right: border.joinRight, + }, + }); +}; +exports.drawBorderJoin = drawBorderJoin; +const drawBorderBottom = (columnWidths, parameters) => { + const { border } = parameters; + return (0, exports.drawBorder)(columnWidths, { + ...parameters, + separator: { + body: border.bottomBody, + join: border.bottomJoin, + left: border.bottomLeft, + right: border.bottomRight, + }, + }); +}; +exports.drawBorderBottom = drawBorderBottom; +const createTableBorderGetter = (columnWidths, parameters) => { + return (index, size) => { + const drawBorderParameters = { ...parameters, + horizontalBorderIndex: index }; + if (index === 0) { + return (0, exports.drawBorderTop)(columnWidths, drawBorderParameters); + } + else if (index === size) { + return (0, exports.drawBorderBottom)(columnWidths, drawBorderParameters); + } + return (0, exports.drawBorderJoin)(columnWidths, drawBorderParameters); + }; +}; +exports.createTableBorderGetter = createTableBorderGetter; +//# sourceMappingURL=drawBorder.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/drawBorder.js.map b/node_modules/table/dist/src/drawBorder.js.map new file mode 100644 index 000000000..c14af9b97 --- /dev/null +++ b/node_modules/table/dist/src/drawBorder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"drawBorder.js","sourceRoot":"","sources":["../../src/drawBorder.ts"],"names":[],"mappings":";;;AAAA,+CAEuB;AA0BhB,MAAM,kBAAkB,GAAG,CAAC,YAAsB,EAAE,UAA4C,EAAY,EAAE;I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AAC,UAAU;YACvB,IAAI,EAAE,MAAM,CAAC,UAAU;YACvB,IAAI,EAAE,MAAM,CAAC,UAAU;YACvB,KAAK,EAAE,MAAM,CAAC,WAAW;SAC1B;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAZW,QAAA,gBAAgB,oBAY3B;AAaK,MAAM,uBAAuB,GAAG,CAAC,YAAsB,EAAE,UAAkC,EAAmB,EAAE;IACrH,OAAO,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;QACrC,MAAM,oBAAoB,GAAyB,EAAC,GAAG,UAAU;YAC/D,qBAAqB,EAAE,KAAK,EAAC,CAAC;QAEhC,IAAI,KAAK,KAAK,CAAC,EAAE;YACf,OAAO,IAAA,qBAAa,EAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;SAC1D;aAAM,IAAI,KAAK,KAAK,IAAI,EAAE;YACzB,OAAO,IAAA,wBAAgB,EAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;SAC7D;QAED,OAAO,IAAA,sBAAc,EAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;IAC5D,CAAC,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,uBAAuB,2BAalC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/drawContent.d.ts b/node_modules/table/dist/src/drawContent.d.ts new file mode 100644 index 000000000..3ac2f8cea --- /dev/null +++ b/node_modules/table/dist/src/drawContent.d.ts @@ -0,0 +1,14 @@ +import type { SpanningCellManager } from './spanningCellManager'; +/** + * Shared function to draw horizontal borders, rows or the entire table + */ +declare type DrawContentParameters = { + contents: string[]; + drawSeparator: (index: number, size: number) => boolean; + separatorGetter: (index: number, size: number) => string; + spanningCellManager?: SpanningCellManager; + rowIndex?: number; + elementType?: 'border' | 'cell' | 'row'; +}; +export declare const drawContent: (parameters: DrawContentParameters) => string; +export {}; diff --git a/node_modules/table/dist/src/drawContent.js b/node_modules/table/dist/src/drawContent.js new file mode 100644 index 000000000..98d494ea9 --- /dev/null +++ b/node_modules/table/dist/src/drawContent.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.drawContent = void 0; +const drawContent = (parameters) => { + const { contents, separatorGetter, drawSeparator, spanningCellManager, rowIndex, elementType } = parameters; + const contentSize = contents.length; + const result = []; + if (drawSeparator(0, contentSize)) { + result.push(separatorGetter(0, contentSize)); + } + contents.forEach((content, contentIndex) => { + if (!elementType || elementType === 'border' || elementType === 'row') { + result.push(content); + } + if (elementType === 'cell' && rowIndex === undefined) { + result.push(content); + } + if (elementType === 'cell' && rowIndex !== undefined) { + /* istanbul ignore next */ + const containingRange = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.getContainingRange({ col: contentIndex, + row: rowIndex }); + // when drawing content row, just add a cell when it is a normal cell + // or belongs to first column of spanning cell + if (!containingRange || contentIndex === containingRange.topLeft.col) { + result.push(content); + } + } + // Only append the middle separator if the content is not the last + if (contentIndex + 1 < contentSize && drawSeparator(contentIndex + 1, contentSize)) { + const separator = separatorGetter(contentIndex + 1, contentSize); + if (elementType === 'cell' && rowIndex !== undefined) { + const currentCell = { col: contentIndex + 1, + row: rowIndex }; + /* istanbul ignore next */ + const containingRange = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.getContainingRange(currentCell); + if (!containingRange || containingRange.topLeft.col === currentCell.col) { + result.push(separator); + } + } + else { + result.push(separator); + } + } + }); + if (drawSeparator(contentSize, contentSize)) { + result.push(separatorGetter(contentSize, contentSize)); + } + return result.join(''); +}; +exports.drawContent = drawContent; +//# sourceMappingURL=drawContent.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/drawContent.js.map b/node_modules/table/dist/src/drawContent.js.map new file mode 100644 index 000000000..991c2a5d7 --- /dev/null +++ b/node_modules/table/dist/src/drawContent.js.map @@ -0,0 +1 @@ +{"version":3,"file":"drawContent.js","sourceRoot":"","sources":["../../src/drawContent.ts"],"names":[],"mappings":";;;AAmBO,MAAM,WAAW,GAAG,CAA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GAAG,CAAC,EAAE,WAAW,CAAC,CAAC;YAEjE,IAAI,WAAW,KAAK,MAAM,IAAI,QAAQ,KAAK,SAAS,EAAE;gBACpD,MAAM,WAAW,GAAoB,EAAC,GAAG,EAAE,YAAY,GAAG,CAAC;oBACzD,GAAG,EAAE,QAAQ,EAAC,CAAC;gBACjB,0BAA0B;gBAC1B,MAAM,eAAe,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;gBAC7E,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,KAAK,WAAW,CAAC,GAAG,EAAE;oBACvE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;iBACxB;aACF;iBAAM;gBACL,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aACxB;SACF;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,aAAa,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE;QAC3C,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;KACxD;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC,CAAC;AArDW,QAAA,WAAW,eAqDtB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/drawRow.d.ts b/node_modules/table/dist/src/drawRow.d.ts new file mode 100644 index 000000000..c0238a8d8 --- /dev/null +++ b/node_modules/table/dist/src/drawRow.d.ts @@ -0,0 +1,10 @@ +import type { SpanningCellManager } from './spanningCellManager'; +import type { DrawVerticalLine } from './types/api'; +import type { BodyBorderConfig, Row } from './types/internal'; +export declare type DrawRowConfig = { + border: BodyBorderConfig; + drawVerticalLine: DrawVerticalLine; + spanningCellManager?: SpanningCellManager; + rowIndex?: number; +}; +export declare const drawRow: (row: Row, config: DrawRowConfig) => string; diff --git a/node_modules/table/dist/src/drawRow.js b/node_modules/table/dist/src/drawRow.js new file mode 100644 index 000000000..a86a27901 --- /dev/null +++ b/node_modules/table/dist/src/drawRow.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.drawRow = void 0; +const drawContent_1 = require("./drawContent"); +const drawRow = (row, config) => { + const { border, drawVerticalLine, rowIndex, spanningCellManager } = config; + return (0, drawContent_1.drawContent)({ + contents: row, + drawSeparator: drawVerticalLine, + elementType: 'cell', + rowIndex, + separatorGetter: (index, columnCount) => { + if (index === 0) { + return border.bodyLeft; + } + if (index === columnCount) { + return border.bodyRight; + } + return border.bodyJoin; + }, + spanningCellManager, + }) + '\n'; +}; +exports.drawRow = drawRow; +//# sourceMappingURL=drawRow.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/drawRow.js.map b/node_modules/table/dist/src/drawRow.js.map new file mode 100644 index 000000000..ca3c5bd94 --- /dev/null +++ b/node_modules/table/dist/src/drawRow.js.map @@ -0,0 +1 @@ +{"version":3,"file":"drawRow.js","sourceRoot":"","sources":["../../src/drawRow.ts"],"names":[],"mappings":";;;AAAA,+CAEuB;AAmBhB,MAAM,OAAO,GAAG,CAAC,GAAQ,EAAE,MAAqB,EAAU,EAAE;IACjE,MAAM,EAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,mBAAmB,EAAC,GAAG,MAAM,CAAC;IAEzE,OAAO,IAAA,yBAAW,EAAC;QACjB,QAAQ,EAAE,GAAG;QACb,aAAa,EAAE,gBAAgB;QAC/B,WAAW,EAAE,MAAM;QACnB,QAAQ;QACR,eAAe,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;YACtC,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,OAAO,MAAM,CAAC,QAAQ,CAAC;aACxB;YAED,IAAI,KAAK,KAAK,WAAW,EAAE;gBACzB,OAAO,MAAM,CAAC,SAAS,CAAC;aACzB;YAED,OAAO,MAAM,CAAC,QAAQ,CAAC;QACzB,CAAC;QACD,mBAAmB;KACpB,CAAC,GAAG,IAAI,CAAC;AACZ,CAAC,CAAC;AArBW,QAAA,OAAO,WAqBlB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/drawTable.d.ts b/node_modules/table/dist/src/drawTable.d.ts new file mode 100644 index 000000000..f234f3049 --- /dev/null +++ b/node_modules/table/dist/src/drawTable.d.ts @@ -0,0 +1,2 @@ +import type { TableConfig, Row } from './types/internal'; +export declare const drawTable: (rows: Row[], outputColumnWidths: number[], rowHeights: number[], config: TableConfig) => string; diff --git a/node_modules/table/dist/src/drawTable.js b/node_modules/table/dist/src/drawTable.js new file mode 100644 index 000000000..dab8f987e --- /dev/null +++ b/node_modules/table/dist/src/drawTable.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.drawTable = void 0; +const drawBorder_1 = require("./drawBorder"); +const drawContent_1 = require("./drawContent"); +const drawRow_1 = require("./drawRow"); +const utils_1 = require("./utils"); +const drawTable = (rows, outputColumnWidths, rowHeights, config) => { + const { drawHorizontalLine, singleLine, } = config; + const contents = (0, utils_1.groupBySizes)(rows, rowHeights).map((group, groupIndex) => { + return group.map((row) => { + return (0, drawRow_1.drawRow)(row, { ...config, + rowIndex: groupIndex }); + }).join(''); + }); + return (0, drawContent_1.drawContent)({ contents, + drawSeparator: (index, size) => { + // Top/bottom border + if (index === 0 || index === size) { + return drawHorizontalLine(index, size); + } + return !singleLine && drawHorizontalLine(index, size); + }, + elementType: 'row', + rowIndex: -1, + separatorGetter: (0, drawBorder_1.createTableBorderGetter)(outputColumnWidths, { ...config, + rowCount: contents.length }), + spanningCellManager: config.spanningCellManager }); +}; +exports.drawTable = drawTable; +//# sourceMappingURL=drawTable.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/drawTable.js.map b/node_modules/table/dist/src/drawTable.js.map new file mode 100644 index 000000000..882d6e378 --- /dev/null +++ b/node_modules/table/dist/src/drawTable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"drawTable.js","sourceRoot":"","sources":["../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node_modules/table/dist/src/generated/validators.d.ts b/node_modules/table/dist/src/generated/validators.d.ts new file mode 100644 index 000000000..bec42e4a4 --- /dev/null +++ b/node_modules/table/dist/src/generated/validators.d.ts @@ -0,0 +1,13 @@ +declare function validate43(data: any, { instancePath, parentData, parentDataProperty, rootData }?: { + instancePath?: string | undefined; + parentData: any; + parentDataProperty: any; + rootData?: any; +}): boolean; +declare function validate86(data: any, { instancePath, parentData, parentDataProperty, rootData }?: { + instancePath?: string | undefined; + parentData: any; + parentDataProperty: any; + rootData?: any; +}): boolean; +export { validate43 as _config_json, validate86 as _streamConfig_json }; diff --git a/node_modules/table/dist/src/generated/validators.js b/node_modules/table/dist/src/generated/validators.js new file mode 100644 index 000000000..6e5fc6675 --- /dev/null +++ b/node_modules/table/dist/src/generated/validators.js @@ -0,0 +1,2694 @@ +"use strict"; +exports["config.json"] = validate43; +const schema13 = { + "$id": "config.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "border": { + "$ref": "shared.json#/definitions/borders" + }, + "header": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "alignment": { + "$ref": "shared.json#/definitions/alignment" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "integer" + }, + "paddingLeft": { + "type": "integer" + }, + "paddingRight": { + "type": "integer" + } + }, + "required": ["content"], + "additionalProperties": false + }, + "columns": { + "$ref": "shared.json#/definitions/columns" + }, + "columnDefault": { + "$ref": "shared.json#/definitions/column" + }, + "drawVerticalLine": { + "typeof": "function" + }, + "drawHorizontalLine": { + "typeof": "function" + }, + "singleLine": { + "typeof": "boolean" + }, + "spanningCells": { + "type": "array", + "items": { + "type": "object", + "properties": { + "col": { + "type": "integer", + "minimum": 0 + }, + "row": { + "type": "integer", + "minimum": 0 + }, + "colSpan": { + "type": "integer", + "minimum": 1 + }, + "rowSpan": { + "type": "integer", + "minimum": 1 + }, + "alignment": { + "$ref": "shared.json#/definitions/alignment" + }, + "verticalAlignment": { + "$ref": "shared.json#/definitions/verticalAlignment" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "integer" + }, + "paddingLeft": { + "type": "integer" + }, + "paddingRight": { + "type": "integer" + } + }, + "required": ["row", "col"], + "additionalProperties": false + } + } + }, + "additionalProperties": false +}; +const schema15 = { + "type": "object", + "properties": { + "topBody": { + "$ref": "#/definitions/border" + }, + "topJoin": { + "$ref": "#/definitions/border" + }, + "topLeft": { + "$ref": "#/definitions/border" + }, + "topRight": { + "$ref": "#/definitions/border" + }, + "bottomBody": { + "$ref": "#/definitions/border" + }, + "bottomJoin": { + "$ref": "#/definitions/border" + }, + "bottomLeft": { + "$ref": "#/definitions/border" + }, + "bottomRight": { + "$ref": "#/definitions/border" + }, + "bodyLeft": { + "$ref": "#/definitions/border" + }, + "bodyRight": { + "$ref": "#/definitions/border" + }, + "bodyJoin": { + "$ref": "#/definitions/border" + }, + "headerJoin": { + "$ref": "#/definitions/border" + }, + "joinBody": { + "$ref": "#/definitions/border" + }, + "joinLeft": { + "$ref": "#/definitions/border" + }, + "joinRight": { + "$ref": "#/definitions/border" + }, + "joinJoin": { + "$ref": "#/definitions/border" + }, + "joinMiddleUp": { + "$ref": "#/definitions/border" + }, + "joinMiddleDown": { + "$ref": "#/definitions/border" + }, + "joinMiddleLeft": { + "$ref": "#/definitions/border" + }, + "joinMiddleRight": { + "$ref": "#/definitions/border" + } + }, + "additionalProperties": false +}; +const func8 = Object.prototype.hasOwnProperty; +const schema16 = { + "type": "string" +}; +function validate46(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + let vErrors = null; + let errors = 0; + if (typeof data !== "string") { + const err0 = { + instancePath, + schemaPath: "#/type", + keyword: "type", + params: { + type: "string" + }, + message: "must be string" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + validate46.errors = vErrors; + return errors === 0; +} +function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!(func8.call(schema15.properties, key0))) { + const err0 = { + instancePath, + schemaPath: "#/additionalProperties", + keyword: "additionalProperties", + params: { + additionalProperty: key0 + }, + message: "must NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + } + if (data.topBody !== undefined) { + if (!(validate46(data.topBody, { + instancePath: instancePath + "/topBody", + parentData: data, + parentDataProperty: "topBody", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.topJoin !== undefined) { + if (!(validate46(data.topJoin, { + instancePath: instancePath + "/topJoin", + parentData: data, + parentDataProperty: "topJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.topLeft !== undefined) { + if (!(validate46(data.topLeft, { + instancePath: instancePath + "/topLeft", + parentData: data, + parentDataProperty: "topLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.topRight !== undefined) { + if (!(validate46(data.topRight, { + instancePath: instancePath + "/topRight", + parentData: data, + parentDataProperty: "topRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomBody !== undefined) { + if (!(validate46(data.bottomBody, { + instancePath: instancePath + "/bottomBody", + parentData: data, + parentDataProperty: "bottomBody", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomJoin !== undefined) { + if (!(validate46(data.bottomJoin, { + instancePath: instancePath + "/bottomJoin", + parentData: data, + parentDataProperty: "bottomJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomLeft !== undefined) { + if (!(validate46(data.bottomLeft, { + instancePath: instancePath + "/bottomLeft", + parentData: data, + parentDataProperty: "bottomLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomRight !== undefined) { + if (!(validate46(data.bottomRight, { + instancePath: instancePath + "/bottomRight", + parentData: data, + parentDataProperty: "bottomRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bodyLeft !== undefined) { + if (!(validate46(data.bodyLeft, { + instancePath: instancePath + "/bodyLeft", + parentData: data, + parentDataProperty: "bodyLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bodyRight !== undefined) { + if (!(validate46(data.bodyRight, { + instancePath: instancePath + "/bodyRight", + parentData: data, + parentDataProperty: "bodyRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bodyJoin !== undefined) { + if (!(validate46(data.bodyJoin, { + instancePath: instancePath + "/bodyJoin", + parentData: data, + parentDataProperty: "bodyJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.headerJoin !== undefined) { + if (!(validate46(data.headerJoin, { + instancePath: instancePath + "/headerJoin", + parentData: data, + parentDataProperty: "headerJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinBody !== undefined) { + if (!(validate46(data.joinBody, { + instancePath: instancePath + "/joinBody", + parentData: data, + parentDataProperty: "joinBody", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinLeft !== undefined) { + if (!(validate46(data.joinLeft, { + instancePath: instancePath + "/joinLeft", + parentData: data, + parentDataProperty: "joinLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinRight !== undefined) { + if (!(validate46(data.joinRight, { + instancePath: instancePath + "/joinRight", + parentData: data, + parentDataProperty: "joinRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinJoin !== undefined) { + if (!(validate46(data.joinJoin, { + instancePath: instancePath + "/joinJoin", + parentData: data, + parentDataProperty: "joinJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinMiddleUp !== undefined) { + if (!(validate46(data.joinMiddleUp, { + instancePath: instancePath + "/joinMiddleUp", + parentData: data, + parentDataProperty: "joinMiddleUp", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinMiddleDown !== undefined) { + if (!(validate46(data.joinMiddleDown, { + instancePath: instancePath + "/joinMiddleDown", + parentData: data, + parentDataProperty: "joinMiddleDown", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinMiddleLeft !== undefined) { + if (!(validate46(data.joinMiddleLeft, { + instancePath: instancePath + "/joinMiddleLeft", + parentData: data, + parentDataProperty: "joinMiddleLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinMiddleRight !== undefined) { + if (!(validate46(data.joinMiddleRight, { + instancePath: instancePath + "/joinMiddleRight", + parentData: data, + parentDataProperty: "joinMiddleRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + } + else { + const err1 = { + instancePath, + schemaPath: "#/type", + keyword: "type", + params: { + type: "object" + }, + message: "must be object" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + validate45.errors = vErrors; + return errors === 0; +} +const schema17 = { + "type": "string", + "enum": ["left", "right", "center", "justify"] +}; +const func0 = require("ajv/dist/runtime/equal").default; +function validate68(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + let vErrors = null; + let errors = 0; + if (typeof data !== "string") { + const err0 = { + instancePath, + schemaPath: "#/type", + keyword: "type", + params: { + type: "string" + }, + message: "must be string" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + if (!((((data === "left") || (data === "right")) || (data === "center")) || (data === "justify"))) { + const err1 = { + instancePath, + schemaPath: "#/enum", + keyword: "enum", + params: { + allowedValues: schema17.enum + }, + message: "must be equal to one of the allowed values" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + validate68.errors = vErrors; + return errors === 0; +} +const schema18 = { + "oneOf": [{ + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false + }, { + "type": "array", + "items": { + "$ref": "#/definitions/column" + } + }] +}; +const pattern0 = new RegExp("^[0-9]+$", "u"); +const schema19 = { + "type": "object", + "properties": { + "alignment": { + "$ref": "#/definitions/alignment" + }, + "verticalAlignment": { + "$ref": "#/definitions/verticalAlignment" + }, + "width": { + "type": "integer", + "minimum": 1 + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "integer" + }, + "paddingLeft": { + "type": "integer" + }, + "paddingRight": { + "type": "integer" + } + }, + "additionalProperties": false +}; +function validate72(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + let vErrors = null; + let errors = 0; + if (typeof data !== "string") { + const err0 = { + instancePath, + schemaPath: "#/type", + keyword: "type", + params: { + type: "string" + }, + message: "must be string" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + if (!((((data === "left") || (data === "right")) || (data === "center")) || (data === "justify"))) { + const err1 = { + instancePath, + schemaPath: "#/enum", + keyword: "enum", + params: { + allowedValues: schema17.enum + }, + message: "must be equal to one of the allowed values" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + validate72.errors = vErrors; + return errors === 0; +} +const schema21 = { + "type": "string", + "enum": ["top", "middle", "bottom"] +}; +function validate74(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + let vErrors = null; + let errors = 0; + if (typeof data !== "string") { + const err0 = { + instancePath, + schemaPath: "#/type", + keyword: "type", + params: { + type: "string" + }, + message: "must be string" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + if (!(((data === "top") || (data === "middle")) || (data === "bottom"))) { + const err1 = { + instancePath, + schemaPath: "#/enum", + keyword: "enum", + params: { + allowedValues: schema21.enum + }, + message: "must be equal to one of the allowed values" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + validate74.errors = vErrors; + return errors === 0; +} +function validate71(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!(((((((key0 === "alignment") || (key0 === "verticalAlignment")) || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { + const err0 = { + instancePath, + schemaPath: "#/additionalProperties", + keyword: "additionalProperties", + params: { + additionalProperty: key0 + }, + message: "must NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + } + if (data.alignment !== undefined) { + if (!(validate72(data.alignment, { + instancePath: instancePath + "/alignment", + parentData: data, + parentDataProperty: "alignment", + rootData + }))) { + vErrors = vErrors === null ? validate72.errors : vErrors.concat(validate72.errors); + errors = vErrors.length; + } + } + if (data.verticalAlignment !== undefined) { + if (!(validate74(data.verticalAlignment, { + instancePath: instancePath + "/verticalAlignment", + parentData: data, + parentDataProperty: "verticalAlignment", + rootData + }))) { + vErrors = vErrors === null ? validate74.errors : vErrors.concat(validate74.errors); + errors = vErrors.length; + } + } + if (data.width !== undefined) { + let data2 = data.width; + if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) { + const err1 = { + instancePath: instancePath + "/width", + schemaPath: "#/properties/width/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + if ((typeof data2 == "number") && (isFinite(data2))) { + if (data2 < 1 || isNaN(data2)) { + const err2 = { + instancePath: instancePath + "/width", + schemaPath: "#/properties/width/minimum", + keyword: "minimum", + params: { + comparison: ">=", + limit: 1 + }, + message: "must be >= 1" + }; + if (vErrors === null) { + vErrors = [err2]; + } + else { + vErrors.push(err2); + } + errors++; + } + } + } + if (data.wrapWord !== undefined) { + if (typeof data.wrapWord !== "boolean") { + const err3 = { + instancePath: instancePath + "/wrapWord", + schemaPath: "#/properties/wrapWord/type", + keyword: "type", + params: { + type: "boolean" + }, + message: "must be boolean" + }; + if (vErrors === null) { + vErrors = [err3]; + } + else { + vErrors.push(err3); + } + errors++; + } + } + if (data.truncate !== undefined) { + let data4 = data.truncate; + if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) { + const err4 = { + instancePath: instancePath + "/truncate", + schemaPath: "#/properties/truncate/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err4]; + } + else { + vErrors.push(err4); + } + errors++; + } + } + if (data.paddingLeft !== undefined) { + let data5 = data.paddingLeft; + if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) { + const err5 = { + instancePath: instancePath + "/paddingLeft", + schemaPath: "#/properties/paddingLeft/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err5]; + } + else { + vErrors.push(err5); + } + errors++; + } + } + if (data.paddingRight !== undefined) { + let data6 = data.paddingRight; + if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) { + const err6 = { + instancePath: instancePath + "/paddingRight", + schemaPath: "#/properties/paddingRight/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err6]; + } + else { + vErrors.push(err6); + } + errors++; + } + } + } + else { + const err7 = { + instancePath, + schemaPath: "#/type", + keyword: "type", + params: { + type: "object" + }, + message: "must be object" + }; + if (vErrors === null) { + vErrors = [err7]; + } + else { + vErrors.push(err7); + } + errors++; + } + validate71.errors = vErrors; + return errors === 0; +} +function validate70(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + let passing0 = null; + const _errs1 = errors; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!(pattern0.test(key0))) { + const err0 = { + instancePath, + schemaPath: "#/oneOf/0/additionalProperties", + keyword: "additionalProperties", + params: { + additionalProperty: key0 + }, + message: "must NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + } + for (const key1 in data) { + if (pattern0.test(key1)) { + if (!(validate71(data[key1], { + instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), + parentData: data, + parentDataProperty: key1, + rootData + }))) { + vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); + errors = vErrors.length; + } + } + } + } + else { + const err1 = { + instancePath, + schemaPath: "#/oneOf/0/type", + keyword: "type", + params: { + type: "object" + }, + message: "must be object" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + var _valid0 = _errs1 === errors; + if (_valid0) { + valid0 = true; + passing0 = 0; + } + const _errs5 = errors; + if (Array.isArray(data)) { + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + if (!(validate71(data[i0], { + instancePath: instancePath + "/" + i0, + parentData: data, + parentDataProperty: i0, + rootData + }))) { + vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); + errors = vErrors.length; + } + } + } + else { + const err2 = { + instancePath, + schemaPath: "#/oneOf/1/type", + keyword: "type", + params: { + type: "array" + }, + message: "must be array" + }; + if (vErrors === null) { + vErrors = [err2]; + } + else { + vErrors.push(err2); + } + errors++; + } + var _valid0 = _errs5 === errors; + if (_valid0 && valid0) { + valid0 = false; + passing0 = [passing0, 1]; + } + else { + if (_valid0) { + valid0 = true; + passing0 = 1; + } + } + if (!valid0) { + const err3 = { + instancePath, + schemaPath: "#/oneOf", + keyword: "oneOf", + params: { + passingSchemas: passing0 + }, + message: "must match exactly one schema in oneOf" + }; + if (vErrors === null) { + vErrors = [err3]; + } + else { + vErrors.push(err3); + } + errors++; + } + else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } + else { + vErrors = null; + } + } + } + validate70.errors = vErrors; + return errors === 0; +} +function validate79(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!(((((((key0 === "alignment") || (key0 === "verticalAlignment")) || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { + const err0 = { + instancePath, + schemaPath: "#/additionalProperties", + keyword: "additionalProperties", + params: { + additionalProperty: key0 + }, + message: "must NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + } + if (data.alignment !== undefined) { + if (!(validate72(data.alignment, { + instancePath: instancePath + "/alignment", + parentData: data, + parentDataProperty: "alignment", + rootData + }))) { + vErrors = vErrors === null ? validate72.errors : vErrors.concat(validate72.errors); + errors = vErrors.length; + } + } + if (data.verticalAlignment !== undefined) { + if (!(validate74(data.verticalAlignment, { + instancePath: instancePath + "/verticalAlignment", + parentData: data, + parentDataProperty: "verticalAlignment", + rootData + }))) { + vErrors = vErrors === null ? validate74.errors : vErrors.concat(validate74.errors); + errors = vErrors.length; + } + } + if (data.width !== undefined) { + let data2 = data.width; + if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) { + const err1 = { + instancePath: instancePath + "/width", + schemaPath: "#/properties/width/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + if ((typeof data2 == "number") && (isFinite(data2))) { + if (data2 < 1 || isNaN(data2)) { + const err2 = { + instancePath: instancePath + "/width", + schemaPath: "#/properties/width/minimum", + keyword: "minimum", + params: { + comparison: ">=", + limit: 1 + }, + message: "must be >= 1" + }; + if (vErrors === null) { + vErrors = [err2]; + } + else { + vErrors.push(err2); + } + errors++; + } + } + } + if (data.wrapWord !== undefined) { + if (typeof data.wrapWord !== "boolean") { + const err3 = { + instancePath: instancePath + "/wrapWord", + schemaPath: "#/properties/wrapWord/type", + keyword: "type", + params: { + type: "boolean" + }, + message: "must be boolean" + }; + if (vErrors === null) { + vErrors = [err3]; + } + else { + vErrors.push(err3); + } + errors++; + } + } + if (data.truncate !== undefined) { + let data4 = data.truncate; + if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) { + const err4 = { + instancePath: instancePath + "/truncate", + schemaPath: "#/properties/truncate/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err4]; + } + else { + vErrors.push(err4); + } + errors++; + } + } + if (data.paddingLeft !== undefined) { + let data5 = data.paddingLeft; + if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) { + const err5 = { + instancePath: instancePath + "/paddingLeft", + schemaPath: "#/properties/paddingLeft/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err5]; + } + else { + vErrors.push(err5); + } + errors++; + } + } + if (data.paddingRight !== undefined) { + let data6 = data.paddingRight; + if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) { + const err6 = { + instancePath: instancePath + "/paddingRight", + schemaPath: "#/properties/paddingRight/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err6]; + } + else { + vErrors.push(err6); + } + errors++; + } + } + } + else { + const err7 = { + instancePath, + schemaPath: "#/type", + keyword: "type", + params: { + type: "object" + }, + message: "must be object" + }; + if (vErrors === null) { + vErrors = [err7]; + } + else { + vErrors.push(err7); + } + errors++; + } + validate79.errors = vErrors; + return errors === 0; +} +function validate84(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + let vErrors = null; + let errors = 0; + if (typeof data !== "string") { + const err0 = { + instancePath, + schemaPath: "#/type", + keyword: "type", + params: { + type: "string" + }, + message: "must be string" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + if (!(((data === "top") || (data === "middle")) || (data === "bottom"))) { + const err1 = { + instancePath, + schemaPath: "#/enum", + keyword: "enum", + params: { + allowedValues: schema21.enum + }, + message: "must be equal to one of the allowed values" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + validate84.errors = vErrors; + return errors === 0; +} +function validate43(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + /*# sourceURL="config.json" */ ; + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!((((((((key0 === "border") || (key0 === "header")) || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "drawVerticalLine")) || (key0 === "drawHorizontalLine")) || (key0 === "singleLine")) || (key0 === "spanningCells"))) { + const err0 = { + instancePath, + schemaPath: "#/additionalProperties", + keyword: "additionalProperties", + params: { + additionalProperty: key0 + }, + message: "must NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + } + if (data.border !== undefined) { + if (!(validate45(data.border, { + instancePath: instancePath + "/border", + parentData: data, + parentDataProperty: "border", + rootData + }))) { + vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors); + errors = vErrors.length; + } + } + if (data.header !== undefined) { + let data1 = data.header; + if (data1 && typeof data1 == "object" && !Array.isArray(data1)) { + if (data1.content === undefined) { + const err1 = { + instancePath: instancePath + "/header", + schemaPath: "#/properties/header/required", + keyword: "required", + params: { + missingProperty: "content" + }, + message: "must have required property '" + "content" + "'" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + for (const key1 in data1) { + if (!((((((key1 === "content") || (key1 === "alignment")) || (key1 === "wrapWord")) || (key1 === "truncate")) || (key1 === "paddingLeft")) || (key1 === "paddingRight"))) { + const err2 = { + instancePath: instancePath + "/header", + schemaPath: "#/properties/header/additionalProperties", + keyword: "additionalProperties", + params: { + additionalProperty: key1 + }, + message: "must NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err2]; + } + else { + vErrors.push(err2); + } + errors++; + } + } + if (data1.content !== undefined) { + if (typeof data1.content !== "string") { + const err3 = { + instancePath: instancePath + "/header/content", + schemaPath: "#/properties/header/properties/content/type", + keyword: "type", + params: { + type: "string" + }, + message: "must be string" + }; + if (vErrors === null) { + vErrors = [err3]; + } + else { + vErrors.push(err3); + } + errors++; + } + } + if (data1.alignment !== undefined) { + if (!(validate68(data1.alignment, { + instancePath: instancePath + "/header/alignment", + parentData: data1, + parentDataProperty: "alignment", + rootData + }))) { + vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors); + errors = vErrors.length; + } + } + if (data1.wrapWord !== undefined) { + if (typeof data1.wrapWord !== "boolean") { + const err4 = { + instancePath: instancePath + "/header/wrapWord", + schemaPath: "#/properties/header/properties/wrapWord/type", + keyword: "type", + params: { + type: "boolean" + }, + message: "must be boolean" + }; + if (vErrors === null) { + vErrors = [err4]; + } + else { + vErrors.push(err4); + } + errors++; + } + } + if (data1.truncate !== undefined) { + let data5 = data1.truncate; + if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) { + const err5 = { + instancePath: instancePath + "/header/truncate", + schemaPath: "#/properties/header/properties/truncate/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err5]; + } + else { + vErrors.push(err5); + } + errors++; + } + } + if (data1.paddingLeft !== undefined) { + let data6 = data1.paddingLeft; + if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) { + const err6 = { + instancePath: instancePath + "/header/paddingLeft", + schemaPath: "#/properties/header/properties/paddingLeft/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err6]; + } + else { + vErrors.push(err6); + } + errors++; + } + } + if (data1.paddingRight !== undefined) { + let data7 = data1.paddingRight; + if (!(((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7))) && (isFinite(data7)))) { + const err7 = { + instancePath: instancePath + "/header/paddingRight", + schemaPath: "#/properties/header/properties/paddingRight/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err7]; + } + else { + vErrors.push(err7); + } + errors++; + } + } + } + else { + const err8 = { + instancePath: instancePath + "/header", + schemaPath: "#/properties/header/type", + keyword: "type", + params: { + type: "object" + }, + message: "must be object" + }; + if (vErrors === null) { + vErrors = [err8]; + } + else { + vErrors.push(err8); + } + errors++; + } + } + if (data.columns !== undefined) { + if (!(validate70(data.columns, { + instancePath: instancePath + "/columns", + parentData: data, + parentDataProperty: "columns", + rootData + }))) { + vErrors = vErrors === null ? validate70.errors : vErrors.concat(validate70.errors); + errors = vErrors.length; + } + } + if (data.columnDefault !== undefined) { + if (!(validate79(data.columnDefault, { + instancePath: instancePath + "/columnDefault", + parentData: data, + parentDataProperty: "columnDefault", + rootData + }))) { + vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors); + errors = vErrors.length; + } + } + if (data.drawVerticalLine !== undefined) { + if (typeof data.drawVerticalLine != "function") { + const err9 = { + instancePath: instancePath + "/drawVerticalLine", + schemaPath: "#/properties/drawVerticalLine/typeof", + keyword: "typeof", + params: {}, + message: "must pass \"typeof\" keyword validation" + }; + if (vErrors === null) { + vErrors = [err9]; + } + else { + vErrors.push(err9); + } + errors++; + } + } + if (data.drawHorizontalLine !== undefined) { + if (typeof data.drawHorizontalLine != "function") { + const err10 = { + instancePath: instancePath + "/drawHorizontalLine", + schemaPath: "#/properties/drawHorizontalLine/typeof", + keyword: "typeof", + params: {}, + message: "must pass \"typeof\" keyword validation" + }; + if (vErrors === null) { + vErrors = [err10]; + } + else { + vErrors.push(err10); + } + errors++; + } + } + if (data.singleLine !== undefined) { + if (typeof data.singleLine != "boolean") { + const err11 = { + instancePath: instancePath + "/singleLine", + schemaPath: "#/properties/singleLine/typeof", + keyword: "typeof", + params: {}, + message: "must pass \"typeof\" keyword validation" + }; + if (vErrors === null) { + vErrors = [err11]; + } + else { + vErrors.push(err11); + } + errors++; + } + } + if (data.spanningCells !== undefined) { + let data13 = data.spanningCells; + if (Array.isArray(data13)) { + const len0 = data13.length; + for (let i0 = 0; i0 < len0; i0++) { + let data14 = data13[i0]; + if (data14 && typeof data14 == "object" && !Array.isArray(data14)) { + if (data14.row === undefined) { + const err12 = { + instancePath: instancePath + "/spanningCells/" + i0, + schemaPath: "#/properties/spanningCells/items/required", + keyword: "required", + params: { + missingProperty: "row" + }, + message: "must have required property '" + "row" + "'" + }; + if (vErrors === null) { + vErrors = [err12]; + } + else { + vErrors.push(err12); + } + errors++; + } + if (data14.col === undefined) { + const err13 = { + instancePath: instancePath + "/spanningCells/" + i0, + schemaPath: "#/properties/spanningCells/items/required", + keyword: "required", + params: { + missingProperty: "col" + }, + message: "must have required property '" + "col" + "'" + }; + if (vErrors === null) { + vErrors = [err13]; + } + else { + vErrors.push(err13); + } + errors++; + } + for (const key2 in data14) { + if (!(func8.call(schema13.properties.spanningCells.items.properties, key2))) { + const err14 = { + instancePath: instancePath + "/spanningCells/" + i0, + schemaPath: "#/properties/spanningCells/items/additionalProperties", + keyword: "additionalProperties", + params: { + additionalProperty: key2 + }, + message: "must NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err14]; + } + else { + vErrors.push(err14); + } + errors++; + } + } + if (data14.col !== undefined) { + let data15 = data14.col; + if (!(((typeof data15 == "number") && (!(data15 % 1) && !isNaN(data15))) && (isFinite(data15)))) { + const err15 = { + instancePath: instancePath + "/spanningCells/" + i0 + "/col", + schemaPath: "#/properties/spanningCells/items/properties/col/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err15]; + } + else { + vErrors.push(err15); + } + errors++; + } + if ((typeof data15 == "number") && (isFinite(data15))) { + if (data15 < 0 || isNaN(data15)) { + const err16 = { + instancePath: instancePath + "/spanningCells/" + i0 + "/col", + schemaPath: "#/properties/spanningCells/items/properties/col/minimum", + keyword: "minimum", + params: { + comparison: ">=", + limit: 0 + }, + message: "must be >= 0" + }; + if (vErrors === null) { + vErrors = [err16]; + } + else { + vErrors.push(err16); + } + errors++; + } + } + } + if (data14.row !== undefined) { + let data16 = data14.row; + if (!(((typeof data16 == "number") && (!(data16 % 1) && !isNaN(data16))) && (isFinite(data16)))) { + const err17 = { + instancePath: instancePath + "/spanningCells/" + i0 + "/row", + schemaPath: "#/properties/spanningCells/items/properties/row/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err17]; + } + else { + vErrors.push(err17); + } + errors++; + } + if ((typeof data16 == "number") && (isFinite(data16))) { + if (data16 < 0 || isNaN(data16)) { + const err18 = { + instancePath: instancePath + "/spanningCells/" + i0 + "/row", + schemaPath: "#/properties/spanningCells/items/properties/row/minimum", + keyword: "minimum", + params: { + comparison: ">=", + limit: 0 + }, + message: "must be >= 0" + }; + if (vErrors === null) { + vErrors = [err18]; + } + else { + vErrors.push(err18); + } + errors++; + } + } + } + if (data14.colSpan !== undefined) { + let data17 = data14.colSpan; + if (!(((typeof data17 == "number") && (!(data17 % 1) && !isNaN(data17))) && (isFinite(data17)))) { + const err19 = { + instancePath: instancePath + "/spanningCells/" + i0 + "/colSpan", + schemaPath: "#/properties/spanningCells/items/properties/colSpan/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err19]; + } + else { + vErrors.push(err19); + } + errors++; + } + if ((typeof data17 == "number") && (isFinite(data17))) { + if (data17 < 1 || isNaN(data17)) { + const err20 = { + instancePath: instancePath + "/spanningCells/" + i0 + "/colSpan", + schemaPath: "#/properties/spanningCells/items/properties/colSpan/minimum", + keyword: "minimum", + params: { + comparison: ">=", + limit: 1 + }, + message: "must be >= 1" + }; + if (vErrors === null) { + vErrors = [err20]; + } + else { + vErrors.push(err20); + } + errors++; + } + } + } + if (data14.rowSpan !== undefined) { + let data18 = data14.rowSpan; + if (!(((typeof data18 == "number") && (!(data18 % 1) && !isNaN(data18))) && (isFinite(data18)))) { + const err21 = { + instancePath: instancePath + "/spanningCells/" + i0 + "/rowSpan", + schemaPath: "#/properties/spanningCells/items/properties/rowSpan/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err21]; + } + else { + vErrors.push(err21); + } + errors++; + } + if ((typeof data18 == "number") && (isFinite(data18))) { + if (data18 < 1 || isNaN(data18)) { + const err22 = { + instancePath: instancePath + "/spanningCells/" + i0 + "/rowSpan", + schemaPath: "#/properties/spanningCells/items/properties/rowSpan/minimum", + keyword: "minimum", + params: { + comparison: ">=", + limit: 1 + }, + message: "must be >= 1" + }; + if (vErrors === null) { + vErrors = [err22]; + } + else { + vErrors.push(err22); + } + errors++; + } + } + } + if (data14.alignment !== undefined) { + if (!(validate68(data14.alignment, { + instancePath: instancePath + "/spanningCells/" + i0 + "/alignment", + parentData: data14, + parentDataProperty: "alignment", + rootData + }))) { + vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors); + errors = vErrors.length; + } + } + if (data14.verticalAlignment !== undefined) { + if (!(validate84(data14.verticalAlignment, { + instancePath: instancePath + "/spanningCells/" + i0 + "/verticalAlignment", + parentData: data14, + parentDataProperty: "verticalAlignment", + rootData + }))) { + vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors); + errors = vErrors.length; + } + } + if (data14.wrapWord !== undefined) { + if (typeof data14.wrapWord !== "boolean") { + const err23 = { + instancePath: instancePath + "/spanningCells/" + i0 + "/wrapWord", + schemaPath: "#/properties/spanningCells/items/properties/wrapWord/type", + keyword: "type", + params: { + type: "boolean" + }, + message: "must be boolean" + }; + if (vErrors === null) { + vErrors = [err23]; + } + else { + vErrors.push(err23); + } + errors++; + } + } + if (data14.truncate !== undefined) { + let data22 = data14.truncate; + if (!(((typeof data22 == "number") && (!(data22 % 1) && !isNaN(data22))) && (isFinite(data22)))) { + const err24 = { + instancePath: instancePath + "/spanningCells/" + i0 + "/truncate", + schemaPath: "#/properties/spanningCells/items/properties/truncate/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err24]; + } + else { + vErrors.push(err24); + } + errors++; + } + } + if (data14.paddingLeft !== undefined) { + let data23 = data14.paddingLeft; + if (!(((typeof data23 == "number") && (!(data23 % 1) && !isNaN(data23))) && (isFinite(data23)))) { + const err25 = { + instancePath: instancePath + "/spanningCells/" + i0 + "/paddingLeft", + schemaPath: "#/properties/spanningCells/items/properties/paddingLeft/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err25]; + } + else { + vErrors.push(err25); + } + errors++; + } + } + if (data14.paddingRight !== undefined) { + let data24 = data14.paddingRight; + if (!(((typeof data24 == "number") && (!(data24 % 1) && !isNaN(data24))) && (isFinite(data24)))) { + const err26 = { + instancePath: instancePath + "/spanningCells/" + i0 + "/paddingRight", + schemaPath: "#/properties/spanningCells/items/properties/paddingRight/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err26]; + } + else { + vErrors.push(err26); + } + errors++; + } + } + } + else { + const err27 = { + instancePath: instancePath + "/spanningCells/" + i0, + schemaPath: "#/properties/spanningCells/items/type", + keyword: "type", + params: { + type: "object" + }, + message: "must be object" + }; + if (vErrors === null) { + vErrors = [err27]; + } + else { + vErrors.push(err27); + } + errors++; + } + } + } + else { + const err28 = { + instancePath: instancePath + "/spanningCells", + schemaPath: "#/properties/spanningCells/type", + keyword: "type", + params: { + type: "array" + }, + message: "must be array" + }; + if (vErrors === null) { + vErrors = [err28]; + } + else { + vErrors.push(err28); + } + errors++; + } + } + } + else { + const err29 = { + instancePath, + schemaPath: "#/type", + keyword: "type", + params: { + type: "object" + }, + message: "must be object" + }; + if (vErrors === null) { + vErrors = [err29]; + } + else { + vErrors.push(err29); + } + errors++; + } + validate43.errors = vErrors; + return errors === 0; +} +exports["streamConfig.json"] = validate86; +const schema24 = { + "$id": "streamConfig.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "border": { + "$ref": "shared.json#/definitions/borders" + }, + "columns": { + "$ref": "shared.json#/definitions/columns" + }, + "columnDefault": { + "$ref": "shared.json#/definitions/column" + }, + "columnCount": { + "type": "integer", + "minimum": 1 + }, + "drawVerticalLine": { + "typeof": "function" + } + }, + "required": ["columnDefault", "columnCount"], + "additionalProperties": false +}; +function validate87(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!(func8.call(schema15.properties, key0))) { + const err0 = { + instancePath, + schemaPath: "#/additionalProperties", + keyword: "additionalProperties", + params: { + additionalProperty: key0 + }, + message: "must NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + } + if (data.topBody !== undefined) { + if (!(validate46(data.topBody, { + instancePath: instancePath + "/topBody", + parentData: data, + parentDataProperty: "topBody", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.topJoin !== undefined) { + if (!(validate46(data.topJoin, { + instancePath: instancePath + "/topJoin", + parentData: data, + parentDataProperty: "topJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.topLeft !== undefined) { + if (!(validate46(data.topLeft, { + instancePath: instancePath + "/topLeft", + parentData: data, + parentDataProperty: "topLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.topRight !== undefined) { + if (!(validate46(data.topRight, { + instancePath: instancePath + "/topRight", + parentData: data, + parentDataProperty: "topRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomBody !== undefined) { + if (!(validate46(data.bottomBody, { + instancePath: instancePath + "/bottomBody", + parentData: data, + parentDataProperty: "bottomBody", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomJoin !== undefined) { + if (!(validate46(data.bottomJoin, { + instancePath: instancePath + "/bottomJoin", + parentData: data, + parentDataProperty: "bottomJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomLeft !== undefined) { + if (!(validate46(data.bottomLeft, { + instancePath: instancePath + "/bottomLeft", + parentData: data, + parentDataProperty: "bottomLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bottomRight !== undefined) { + if (!(validate46(data.bottomRight, { + instancePath: instancePath + "/bottomRight", + parentData: data, + parentDataProperty: "bottomRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bodyLeft !== undefined) { + if (!(validate46(data.bodyLeft, { + instancePath: instancePath + "/bodyLeft", + parentData: data, + parentDataProperty: "bodyLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bodyRight !== undefined) { + if (!(validate46(data.bodyRight, { + instancePath: instancePath + "/bodyRight", + parentData: data, + parentDataProperty: "bodyRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.bodyJoin !== undefined) { + if (!(validate46(data.bodyJoin, { + instancePath: instancePath + "/bodyJoin", + parentData: data, + parentDataProperty: "bodyJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.headerJoin !== undefined) { + if (!(validate46(data.headerJoin, { + instancePath: instancePath + "/headerJoin", + parentData: data, + parentDataProperty: "headerJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinBody !== undefined) { + if (!(validate46(data.joinBody, { + instancePath: instancePath + "/joinBody", + parentData: data, + parentDataProperty: "joinBody", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinLeft !== undefined) { + if (!(validate46(data.joinLeft, { + instancePath: instancePath + "/joinLeft", + parentData: data, + parentDataProperty: "joinLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinRight !== undefined) { + if (!(validate46(data.joinRight, { + instancePath: instancePath + "/joinRight", + parentData: data, + parentDataProperty: "joinRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinJoin !== undefined) { + if (!(validate46(data.joinJoin, { + instancePath: instancePath + "/joinJoin", + parentData: data, + parentDataProperty: "joinJoin", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinMiddleUp !== undefined) { + if (!(validate46(data.joinMiddleUp, { + instancePath: instancePath + "/joinMiddleUp", + parentData: data, + parentDataProperty: "joinMiddleUp", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinMiddleDown !== undefined) { + if (!(validate46(data.joinMiddleDown, { + instancePath: instancePath + "/joinMiddleDown", + parentData: data, + parentDataProperty: "joinMiddleDown", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinMiddleLeft !== undefined) { + if (!(validate46(data.joinMiddleLeft, { + instancePath: instancePath + "/joinMiddleLeft", + parentData: data, + parentDataProperty: "joinMiddleLeft", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + if (data.joinMiddleRight !== undefined) { + if (!(validate46(data.joinMiddleRight, { + instancePath: instancePath + "/joinMiddleRight", + parentData: data, + parentDataProperty: "joinMiddleRight", + rootData + }))) { + vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); + errors = vErrors.length; + } + } + } + else { + const err1 = { + instancePath, + schemaPath: "#/type", + keyword: "type", + params: { + type: "object" + }, + message: "must be object" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + validate87.errors = vErrors; + return errors === 0; +} +function validate109(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + let vErrors = null; + let errors = 0; + const _errs0 = errors; + let valid0 = false; + let passing0 = null; + const _errs1 = errors; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!(pattern0.test(key0))) { + const err0 = { + instancePath, + schemaPath: "#/oneOf/0/additionalProperties", + keyword: "additionalProperties", + params: { + additionalProperty: key0 + }, + message: "must NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + } + for (const key1 in data) { + if (pattern0.test(key1)) { + if (!(validate71(data[key1], { + instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), + parentData: data, + parentDataProperty: key1, + rootData + }))) { + vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); + errors = vErrors.length; + } + } + } + } + else { + const err1 = { + instancePath, + schemaPath: "#/oneOf/0/type", + keyword: "type", + params: { + type: "object" + }, + message: "must be object" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + var _valid0 = _errs1 === errors; + if (_valid0) { + valid0 = true; + passing0 = 0; + } + const _errs5 = errors; + if (Array.isArray(data)) { + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + if (!(validate71(data[i0], { + instancePath: instancePath + "/" + i0, + parentData: data, + parentDataProperty: i0, + rootData + }))) { + vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); + errors = vErrors.length; + } + } + } + else { + const err2 = { + instancePath, + schemaPath: "#/oneOf/1/type", + keyword: "type", + params: { + type: "array" + }, + message: "must be array" + }; + if (vErrors === null) { + vErrors = [err2]; + } + else { + vErrors.push(err2); + } + errors++; + } + var _valid0 = _errs5 === errors; + if (_valid0 && valid0) { + valid0 = false; + passing0 = [passing0, 1]; + } + else { + if (_valid0) { + valid0 = true; + passing0 = 1; + } + } + if (!valid0) { + const err3 = { + instancePath, + schemaPath: "#/oneOf", + keyword: "oneOf", + params: { + passingSchemas: passing0 + }, + message: "must match exactly one schema in oneOf" + }; + if (vErrors === null) { + vErrors = [err3]; + } + else { + vErrors.push(err3); + } + errors++; + } + else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } + else { + vErrors = null; + } + } + } + validate109.errors = vErrors; + return errors === 0; +} +function validate113(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + for (const key0 in data) { + if (!(((((((key0 === "alignment") || (key0 === "verticalAlignment")) || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { + const err0 = { + instancePath, + schemaPath: "#/additionalProperties", + keyword: "additionalProperties", + params: { + additionalProperty: key0 + }, + message: "must NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + } + if (data.alignment !== undefined) { + if (!(validate72(data.alignment, { + instancePath: instancePath + "/alignment", + parentData: data, + parentDataProperty: "alignment", + rootData + }))) { + vErrors = vErrors === null ? validate72.errors : vErrors.concat(validate72.errors); + errors = vErrors.length; + } + } + if (data.verticalAlignment !== undefined) { + if (!(validate74(data.verticalAlignment, { + instancePath: instancePath + "/verticalAlignment", + parentData: data, + parentDataProperty: "verticalAlignment", + rootData + }))) { + vErrors = vErrors === null ? validate74.errors : vErrors.concat(validate74.errors); + errors = vErrors.length; + } + } + if (data.width !== undefined) { + let data2 = data.width; + if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) { + const err1 = { + instancePath: instancePath + "/width", + schemaPath: "#/properties/width/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + if ((typeof data2 == "number") && (isFinite(data2))) { + if (data2 < 1 || isNaN(data2)) { + const err2 = { + instancePath: instancePath + "/width", + schemaPath: "#/properties/width/minimum", + keyword: "minimum", + params: { + comparison: ">=", + limit: 1 + }, + message: "must be >= 1" + }; + if (vErrors === null) { + vErrors = [err2]; + } + else { + vErrors.push(err2); + } + errors++; + } + } + } + if (data.wrapWord !== undefined) { + if (typeof data.wrapWord !== "boolean") { + const err3 = { + instancePath: instancePath + "/wrapWord", + schemaPath: "#/properties/wrapWord/type", + keyword: "type", + params: { + type: "boolean" + }, + message: "must be boolean" + }; + if (vErrors === null) { + vErrors = [err3]; + } + else { + vErrors.push(err3); + } + errors++; + } + } + if (data.truncate !== undefined) { + let data4 = data.truncate; + if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) { + const err4 = { + instancePath: instancePath + "/truncate", + schemaPath: "#/properties/truncate/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err4]; + } + else { + vErrors.push(err4); + } + errors++; + } + } + if (data.paddingLeft !== undefined) { + let data5 = data.paddingLeft; + if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) { + const err5 = { + instancePath: instancePath + "/paddingLeft", + schemaPath: "#/properties/paddingLeft/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err5]; + } + else { + vErrors.push(err5); + } + errors++; + } + } + if (data.paddingRight !== undefined) { + let data6 = data.paddingRight; + if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) { + const err6 = { + instancePath: instancePath + "/paddingRight", + schemaPath: "#/properties/paddingRight/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err6]; + } + else { + vErrors.push(err6); + } + errors++; + } + } + } + else { + const err7 = { + instancePath, + schemaPath: "#/type", + keyword: "type", + params: { + type: "object" + }, + message: "must be object" + }; + if (vErrors === null) { + vErrors = [err7]; + } + else { + vErrors.push(err7); + } + errors++; + } + validate113.errors = vErrors; + return errors === 0; +} +function validate86(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { + /*# sourceURL="streamConfig.json" */ ; + let vErrors = null; + let errors = 0; + if (data && typeof data == "object" && !Array.isArray(data)) { + if (data.columnDefault === undefined) { + const err0 = { + instancePath, + schemaPath: "#/required", + keyword: "required", + params: { + missingProperty: "columnDefault" + }, + message: "must have required property '" + "columnDefault" + "'" + }; + if (vErrors === null) { + vErrors = [err0]; + } + else { + vErrors.push(err0); + } + errors++; + } + if (data.columnCount === undefined) { + const err1 = { + instancePath, + schemaPath: "#/required", + keyword: "required", + params: { + missingProperty: "columnCount" + }, + message: "must have required property '" + "columnCount" + "'" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + for (const key0 in data) { + if (!(((((key0 === "border") || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "columnCount")) || (key0 === "drawVerticalLine"))) { + const err2 = { + instancePath, + schemaPath: "#/additionalProperties", + keyword: "additionalProperties", + params: { + additionalProperty: key0 + }, + message: "must NOT have additional properties" + }; + if (vErrors === null) { + vErrors = [err2]; + } + else { + vErrors.push(err2); + } + errors++; + } + } + if (data.border !== undefined) { + if (!(validate87(data.border, { + instancePath: instancePath + "/border", + parentData: data, + parentDataProperty: "border", + rootData + }))) { + vErrors = vErrors === null ? validate87.errors : vErrors.concat(validate87.errors); + errors = vErrors.length; + } + } + if (data.columns !== undefined) { + if (!(validate109(data.columns, { + instancePath: instancePath + "/columns", + parentData: data, + parentDataProperty: "columns", + rootData + }))) { + vErrors = vErrors === null ? validate109.errors : vErrors.concat(validate109.errors); + errors = vErrors.length; + } + } + if (data.columnDefault !== undefined) { + if (!(validate113(data.columnDefault, { + instancePath: instancePath + "/columnDefault", + parentData: data, + parentDataProperty: "columnDefault", + rootData + }))) { + vErrors = vErrors === null ? validate113.errors : vErrors.concat(validate113.errors); + errors = vErrors.length; + } + } + if (data.columnCount !== undefined) { + let data3 = data.columnCount; + if (!(((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3))) && (isFinite(data3)))) { + const err3 = { + instancePath: instancePath + "/columnCount", + schemaPath: "#/properties/columnCount/type", + keyword: "type", + params: { + type: "integer" + }, + message: "must be integer" + }; + if (vErrors === null) { + vErrors = [err3]; + } + else { + vErrors.push(err3); + } + errors++; + } + if ((typeof data3 == "number") && (isFinite(data3))) { + if (data3 < 1 || isNaN(data3)) { + const err4 = { + instancePath: instancePath + "/columnCount", + schemaPath: "#/properties/columnCount/minimum", + keyword: "minimum", + params: { + comparison: ">=", + limit: 1 + }, + message: "must be >= 1" + }; + if (vErrors === null) { + vErrors = [err4]; + } + else { + vErrors.push(err4); + } + errors++; + } + } + } + if (data.drawVerticalLine !== undefined) { + if (typeof data.drawVerticalLine != "function") { + const err5 = { + instancePath: instancePath + "/drawVerticalLine", + schemaPath: "#/properties/drawVerticalLine/typeof", + keyword: "typeof", + params: {}, + message: "must pass \"typeof\" keyword validation" + }; + if (vErrors === null) { + vErrors = [err5]; + } + else { + vErrors.push(err5); + } + errors++; + } + } + } + else { + const err6 = { + instancePath, + schemaPath: "#/type", + keyword: "type", + params: { + type: "object" + }, + message: "must be object" + }; + if (vErrors === null) { + vErrors = [err6]; + } + else { + vErrors.push(err6); + } + errors++; + } + validate86.errors = vErrors; + return errors === 0; +} +//# sourceMappingURL=validators.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/generated/validators.js.map b/node_modules/table/dist/src/generated/validators.js.map new file mode 100644 index 000000000..0436fc2ed --- /dev/null +++ b/node_modules/table/dist/src/generated/validators.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/generated/validators.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,CAAC,aAAa,CAAC,GAAG,UAAU,CAAC;AACpC,MAAM,QAAQ,GAAG;IACb,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,yCAAyC;IACpD,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE;QACV,QAAQ,EAAE;YACN,MAAM,EAAE,kCAAkC;SAC7C;QACD,QAAQ,EAAE;YACN,MAAM,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M,KAAK,CAAC,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/getBorderCharacters.d.ts b/node_modules/table/dist/src/getBorderCharacters.d.ts new file mode 100644 index 000000000..334489bcf --- /dev/null +++ b/node_modules/table/dist/src/getBorderCharacters.d.ts @@ -0,0 +1,2 @@ +import type { BorderConfig } from './types/api'; +export declare const getBorderCharacters: (name: string) => BorderConfig; diff --git a/node_modules/table/dist/src/getBorderCharacters.js b/node_modules/table/dist/src/getBorderCharacters.js new file mode 100644 index 000000000..24b2612ce --- /dev/null +++ b/node_modules/table/dist/src/getBorderCharacters.js @@ -0,0 +1,105 @@ +"use strict"; +/* eslint-disable sort-keys-fix/sort-keys-fix */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getBorderCharacters = void 0; +const getBorderCharacters = (name) => { + if (name === 'honeywell') { + return { + topBody: '═', + topJoin: '╤', + topLeft: '╔', + topRight: '╗', + bottomBody: '═', + bottomJoin: '╧', + bottomLeft: '╚', + bottomRight: '╝', + bodyLeft: '║', + bodyRight: '║', + bodyJoin: '│', + headerJoin: '┬', + joinBody: '─', + joinLeft: '╟', + joinRight: '╢', + joinJoin: '┼', + joinMiddleDown: '┬', + joinMiddleUp: '┴', + joinMiddleLeft: '┤', + joinMiddleRight: '├', + }; + } + if (name === 'norc') { + return { + topBody: '─', + topJoin: '┬', + topLeft: '┌', + topRight: '┐', + bottomBody: '─', + bottomJoin: '┴', + bottomLeft: '└', + bottomRight: '┘', + bodyLeft: '│', + bodyRight: '│', + bodyJoin: '│', + headerJoin: '┬', + joinBody: '─', + joinLeft: '├', + joinRight: '┤', + joinJoin: '┼', + joinMiddleDown: '┬', + joinMiddleUp: '┴', + joinMiddleLeft: '┤', + joinMiddleRight: '├', + }; + } + if (name === 'ramac') { + return { + topBody: '-', + topJoin: '+', + topLeft: '+', + topRight: '+', + bottomBody: '-', + bottomJoin: '+', + bottomLeft: '+', + bottomRight: '+', + bodyLeft: '|', + bodyRight: '|', + bodyJoin: '|', + headerJoin: '+', + joinBody: '-', + joinLeft: '|', + joinRight: '|', + joinJoin: '|', + joinMiddleDown: '+', + joinMiddleUp: '+', + joinMiddleLeft: '+', + joinMiddleRight: '+', + }; + } + if (name === 'void') { + return { + topBody: '', + topJoin: '', + topLeft: '', + topRight: '', + bottomBody: '', + bottomJoin: '', + bottomLeft: '', + bottomRight: '', + bodyLeft: '', + bodyRight: '', + bodyJoin: '', + headerJoin: '', + joinBody: '', + joinLeft: '', + joinRight: '', + joinJoin: '', + joinMiddleDown: '', + joinMiddleUp: '', + joinMiddleLeft: '', + joinMiddleRight: '', + }; + } + throw new Error('Unknown border template "' + name + '".'); +}; +exports.getBorderCharacters = getBorderCharacters; +//# sourceMappingURL=getBorderCharacters.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/getBorderCharacters.js.map b/node_modules/table/dist/src/getBorderCharacters.js.map new file mode 100644 index 000000000..848b993e1 --- /dev/null +++ b/node_modules/table/dist/src/getBorderCharacters.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getBorderCharacters.js","sourceRoot":"","sources":["../../src/getBorderCharacters.ts"],"names":[],"mappings":";AAAA,gDAAgD;;;AAMzC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAgB,EAAE;IAChE,IAAI,IAAI,KAAK,WAAW,EAAE;QACxB,OAAO;YACL,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,GAAG;YACZ,QAAQ,EAAE,GAAG;YAEb,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,WAAW,EAAE,GAAG;YAEhB,QAAQ,EAAE,GAAG;YACb,SAAS,EAAE,GAAG;YACd,QAAQ,EAAE,GAAG;YACb,UAAU,EAAE,GAAG;YAEf,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,GAAG;YACb,SAAS,EAAE,GAAG;YACd,QAAQ,EAAE,GAAG;YACb,cAAc,EAAE,GAAG;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,EAAE;YACX,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;YAEZ,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,EAAE;YACd,WAAW,EAAE,EAAE;YAEf,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,EAAE;YAEd,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,cAAc,EAAE,EAAE;YAClB,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,EAAE;SACpB,CAAC;KACH;IAED,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AAC7D,CAAC,CAAC;AAlHW,QAAA,mBAAmB,uBAkH9B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/index.d.ts b/node_modules/table/dist/src/index.d.ts new file mode 100644 index 000000000..7ac2d57d9 --- /dev/null +++ b/node_modules/table/dist/src/index.d.ts @@ -0,0 +1,5 @@ +import { createStream } from './createStream'; +import { getBorderCharacters } from './getBorderCharacters'; +import { table } from './table'; +export { table, createStream, getBorderCharacters, }; +export * from './types/api'; diff --git a/node_modules/table/dist/src/index.js b/node_modules/table/dist/src/index.js new file mode 100644 index 000000000..6271ec689 --- /dev/null +++ b/node_modules/table/dist/src/index.js @@ -0,0 +1,21 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getBorderCharacters = exports.createStream = exports.table = void 0; +const createStream_1 = require("./createStream"); +Object.defineProperty(exports, "createStream", { enumerable: true, get: function () { return createStream_1.createStream; } }); +const getBorderCharacters_1 = require("./getBorderCharacters"); +Object.defineProperty(exports, "getBorderCharacters", { enumerable: true, get: function () { return getBorderCharacters_1.getBorderCharacters; } }); +const table_1 = require("./table"); +Object.defineProperty(exports, "table", { enumerable: true, get: function () { return table_1.table; } }); +__exportStar(require("./types/api"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/index.js.map b/node_modules/table/dist/src/index.js.map new file mode 100644 index 000000000..93443068c --- /dev/null +++ b/node_modules/table/dist/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,iDAEwB;AAUtB,6FAXA,2BAAY,OAWA;AATd,+DAE+B;AAQ7B,oGATA,yCAAmB,OASA;AAPrB,mCAEiB;AAGf,sFAJA,aAAK,OAIA;AAKP,8CAA4B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/injectHeaderConfig.d.ts b/node_modules/table/dist/src/injectHeaderConfig.d.ts new file mode 100644 index 000000000..8acf70718 --- /dev/null +++ b/node_modules/table/dist/src/injectHeaderConfig.d.ts @@ -0,0 +1,3 @@ +import type { SpanningCellConfig, TableUserConfig } from './types/api'; +import type { Row } from './types/internal'; +export declare const injectHeaderConfig: (rows: Row[], config: TableUserConfig) => [Row[], SpanningCellConfig[]]; diff --git a/node_modules/table/dist/src/injectHeaderConfig.js b/node_modules/table/dist/src/injectHeaderConfig.js new file mode 100644 index 000000000..2e82d1253 --- /dev/null +++ b/node_modules/table/dist/src/injectHeaderConfig.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.injectHeaderConfig = void 0; +const injectHeaderConfig = (rows, config) => { + var _a; + let spanningCellConfig = (_a = config.spanningCells) !== null && _a !== void 0 ? _a : []; + const headerConfig = config.header; + const adjustedRows = [...rows]; + if (headerConfig) { + spanningCellConfig = spanningCellConfig.map(({ row, ...rest }) => { + return { ...rest, + row: row + 1 }; + }); + const { content, ...headerStyles } = headerConfig; + spanningCellConfig.unshift({ alignment: 'center', + col: 0, + colSpan: rows[0].length, + paddingLeft: 1, + paddingRight: 1, + row: 0, + wrapWord: false, + ...headerStyles }); + adjustedRows.unshift([content, ...Array.from({ length: rows[0].length - 1 }).fill('')]); + } + return [adjustedRows, + spanningCellConfig]; +}; +exports.injectHeaderConfig = injectHeaderConfig; +//# sourceMappingURL=injectHeaderConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/injectHeaderConfig.js.map b/node_modules/table/dist/src/injectHeaderConfig.js.map new file mode 100644 index 000000000..29eead974 --- /dev/null +++ b/node_modules/table/dist/src/injectHeaderConfig.js.map @@ -0,0 +1 @@ +{"version":3,"file":"injectHeaderConfig.js","sourceRoot":"","sources":["../../src/injectHeaderConfig.ts"],"names":[],"mappings":";;;AAQO,MAAM,kBAAkB,GAAG,CAAC,IAAW,EAAE,MAAuB,EAAiC,EAAE;;IACxG,IAAI,kBAAkB,GAAG,MAAA,MAAM,CAAC,aAAa,mCAAI,EAAE,CAAC;IACpD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAE/B,IAAI,YAAY,EAAE;QAChB,kBAAkB,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAC,GAAG,EAAE,GAAG,IAAI,EAAC,EAAE,EAAE;YAC7D,OAAO,EAAC,GAAG,IAAI;gBACb,GAAG,EAAE,GAAG,GAAG,CAAC,EAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM,EAAC,OAAO,EAAE,GAAG,YAAY,EAAC,GAAG,YAAY,CAAC;QAEhD,kBAAkB,CAAC,OAAO,CAAC,EAAC,SAAS,EAAE,QAAQ;YAC7C,GAAG,EAAE,CAAC;YACN,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM;YACvB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,KAAK;YACf,GAAG,YAAY,EAAC,CAAC,CAAC;QAEpB,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,CAAS,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC/F;IAED,OAAO,CAAC,YAAY;QAClB,kBAAkB,CAAC,CAAC;AACxB,CAAC,CAAC;AA3BW,QAAA,kBAAkB,sBA2B7B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/makeRangeConfig.d.ts b/node_modules/table/dist/src/makeRangeConfig.d.ts new file mode 100644 index 000000000..b2d2c336a --- /dev/null +++ b/node_modules/table/dist/src/makeRangeConfig.d.ts @@ -0,0 +1,3 @@ +import type { SpanningCellConfig } from './types/api'; +import type { ColumnConfig, RangeConfig } from './types/internal'; +export declare const makeRangeConfig: (spanningCellConfig: SpanningCellConfig, columnsConfig: ColumnConfig[]) => RangeConfig; diff --git a/node_modules/table/dist/src/makeRangeConfig.js b/node_modules/table/dist/src/makeRangeConfig.js new file mode 100644 index 000000000..2acd824c1 --- /dev/null +++ b/node_modules/table/dist/src/makeRangeConfig.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeRangeConfig = void 0; +const utils_1 = require("./utils"); +const makeRangeConfig = (spanningCellConfig, columnsConfig) => { + var _a; + const { topLeft, bottomRight } = (0, utils_1.calculateRangeCoordinate)(spanningCellConfig); + const cellConfig = { + ...columnsConfig[topLeft.col], + ...spanningCellConfig, + paddingRight: (_a = spanningCellConfig.paddingRight) !== null && _a !== void 0 ? _a : columnsConfig[bottomRight.col].paddingRight, + }; + return { ...cellConfig, + bottomRight, + topLeft }; +}; +exports.makeRangeConfig = makeRangeConfig; +//# sourceMappingURL=makeRangeConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/makeRangeConfig.js.map b/node_modules/table/dist/src/makeRangeConfig.js.map new file mode 100644 index 000000000..c37642ee7 --- /dev/null +++ b/node_modules/table/dist/src/makeRangeConfig.js.map @@ -0,0 +1 @@ +{"version":3,"file":"makeRangeConfig.js","sourceRoot":"","sources":["../../src/makeRangeConfig.ts"],"names":[],"mappings":";;;AAMA,mCAEiB;AAEV,MAAM,eAAe,GAAG,CAAC,kBAAsC,EAAE,aAA6B,EAAe,EAAE;;IACpH,MAAM,EAAC,OAAO,EAAE,WAAW,EAAC,GAAG,IAAA,gCAAwB,EAAC,kBAAkB,CAAC,CAAC;IAE5E,MAAM,UAAU,GAA6B;QAC3C,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC;QAC7B,GAAG,kBAAkB;QACrB,YAAY,EACV,MAAA,kBAAkB,CAAC,YAAY,mCAC/B,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,YAAY;KAC9C,CAAC;IAEF,OAAO,EAAC,GAAG,UAAU;QACnB,WAAW;QACX,OAAO,EAAC,CAAC;AACb,CAAC,CAAC;AAdW,QAAA,eAAe,mBAc1B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/makeStreamConfig.d.ts b/node_modules/table/dist/src/makeStreamConfig.d.ts new file mode 100644 index 000000000..cdd1f0452 --- /dev/null +++ b/node_modules/table/dist/src/makeStreamConfig.d.ts @@ -0,0 +1,7 @@ +import type { StreamUserConfig } from './types/api'; +import type { StreamConfig } from './types/internal'; +/** + * Makes a new configuration object out of the userConfig object + * using default values for the missing configuration properties. + */ +export declare const makeStreamConfig: (config: StreamUserConfig) => StreamConfig; diff --git a/node_modules/table/dist/src/makeStreamConfig.js b/node_modules/table/dist/src/makeStreamConfig.js new file mode 100644 index 000000000..227b5795c --- /dev/null +++ b/node_modules/table/dist/src/makeStreamConfig.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeStreamConfig = void 0; +const utils_1 = require("./utils"); +const validateConfig_1 = require("./validateConfig"); +/** + * Creates a configuration for every column using default + * values for the missing configuration properties. + */ +const makeColumnsConfig = (columnCount, columns = {}, columnDefault) => { + return Array.from({ length: columnCount }).map((_, index) => { + return { + alignment: 'left', + paddingLeft: 1, + paddingRight: 1, + truncate: Number.POSITIVE_INFINITY, + verticalAlignment: 'top', + wrapWord: false, + ...columnDefault, + ...columns[index], + }; + }); +}; +/** + * Makes a new configuration object out of the userConfig object + * using default values for the missing configuration properties. + */ +const makeStreamConfig = (config) => { + (0, validateConfig_1.validateConfig)('streamConfig.json', config); + if (config.columnDefault.width === undefined) { + throw new Error('Must provide config.columnDefault.width when creating a stream.'); + } + return { + drawVerticalLine: () => { + return true; + }, + ...config, + border: (0, utils_1.makeBorderConfig)(config.border), + columns: makeColumnsConfig(config.columnCount, config.columns, config.columnDefault), + }; +}; +exports.makeStreamConfig = makeStreamConfig; +//# sourceMappingURL=makeStreamConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/makeStreamConfig.js.map b/node_modules/table/dist/src/makeStreamConfig.js.map new file mode 100644 index 000000000..715a3fe04 --- /dev/null +++ b/node_modules/table/dist/src/makeStreamConfig.js.map @@ -0,0 +1 @@ +{"version":3,"file":"makeStreamConfig.js","sourceRoot":"","sources":["../../src/makeStreamConfig.ts"],"names":[],"mappings":";;;AASA,mCAEiB;AACjB,qDAE0B;AAE1B;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,WAAmB,EAC5C,UAAuC,EAAE,EACzC,aAAgD,EAAkB,EAAE;IACpE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,WAAW,EAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QACxD,OAAO;YACL,SAAS,EAAE,MAAM;YACjB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,QAAQ,EAAE,MAAM,CAAC,iBAAiB;YAClC,iBAAiB,EAAE,KAAK;YACxB,QAAQ,EAAE,KAAK;YACf,GAAG,aAAa;YAChB,GAAG,OAAO,CAAC,KAAK,CAAC;SAClB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,gBAAgB,GAAG,CAAC,MAAwB,EAAgB,EAAE;IACzE,IAAA,+BAAc,EAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAE5C,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,KAAK,SAAS,EAAE;QAC5C,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;KACpF;IAED,OAAO;QACL,gBAAgB,EAAE,GAAG,EAAE;YACrB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,GAAG,MAAM;QACT,MAAM,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,MAAM,CAAC;QACvC,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,CAAC;KACrF,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,gBAAgB,oBAe3B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/makeTableConfig.d.ts b/node_modules/table/dist/src/makeTableConfig.d.ts new file mode 100644 index 000000000..599c018e1 --- /dev/null +++ b/node_modules/table/dist/src/makeTableConfig.d.ts @@ -0,0 +1,7 @@ +import type { SpanningCellConfig, TableUserConfig } from './types/api'; +import type { Row, TableConfig } from './types/internal'; +/** + * Makes a new configuration object out of the userConfig object + * using default values for the missing configuration properties. + */ +export declare const makeTableConfig: (rows: Row[], config?: TableUserConfig, injectedSpanningCellConfig?: SpanningCellConfig[] | undefined) => TableConfig; diff --git a/node_modules/table/dist/src/makeTableConfig.js b/node_modules/table/dist/src/makeTableConfig.js new file mode 100644 index 000000000..8b858aea3 --- /dev/null +++ b/node_modules/table/dist/src/makeTableConfig.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeTableConfig = void 0; +const calculateMaximumColumnWidths_1 = require("./calculateMaximumColumnWidths"); +const spanningCellManager_1 = require("./spanningCellManager"); +const utils_1 = require("./utils"); +const validateConfig_1 = require("./validateConfig"); +const validateSpanningCellConfig_1 = require("./validateSpanningCellConfig"); +/** + * Creates a configuration for every column using default + * values for the missing configuration properties. + */ +const makeColumnsConfig = (rows, columns, columnDefault, spanningCellConfigs) => { + const columnWidths = (0, calculateMaximumColumnWidths_1.calculateMaximumColumnWidths)(rows, spanningCellConfigs); + return rows[0].map((_, columnIndex) => { + return { + alignment: 'left', + paddingLeft: 1, + paddingRight: 1, + truncate: Number.POSITIVE_INFINITY, + verticalAlignment: 'top', + width: columnWidths[columnIndex], + wrapWord: false, + ...columnDefault, + ...columns === null || columns === void 0 ? void 0 : columns[columnIndex], + }; + }); +}; +/** + * Makes a new configuration object out of the userConfig object + * using default values for the missing configuration properties. + */ +const makeTableConfig = (rows, config = {}, injectedSpanningCellConfig) => { + var _a, _b, _c, _d, _e; + (0, validateConfig_1.validateConfig)('config.json', config); + (0, validateSpanningCellConfig_1.validateSpanningCellConfig)(rows, (_a = config.spanningCells) !== null && _a !== void 0 ? _a : []); + const spanningCellConfigs = (_b = injectedSpanningCellConfig !== null && injectedSpanningCellConfig !== void 0 ? injectedSpanningCellConfig : config.spanningCells) !== null && _b !== void 0 ? _b : []; + const columnsConfig = makeColumnsConfig(rows, config.columns, config.columnDefault, spanningCellConfigs); + const drawVerticalLine = (_c = config.drawVerticalLine) !== null && _c !== void 0 ? _c : (() => { + return true; + }); + const drawHorizontalLine = (_d = config.drawHorizontalLine) !== null && _d !== void 0 ? _d : (() => { + return true; + }); + return { + ...config, + border: (0, utils_1.makeBorderConfig)(config.border), + columns: columnsConfig, + drawHorizontalLine, + drawVerticalLine, + singleLine: (_e = config.singleLine) !== null && _e !== void 0 ? _e : false, + spanningCellManager: (0, spanningCellManager_1.createSpanningCellManager)({ + columnsConfig, + drawHorizontalLine, + drawVerticalLine, + rows, + spanningCellConfigs, + }), + }; +}; +exports.makeTableConfig = makeTableConfig; +//# sourceMappingURL=makeTableConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/makeTableConfig.js.map b/node_modules/table/dist/src/makeTableConfig.js.map new file mode 100644 index 000000000..11617bf6c --- /dev/null +++ b/node_modules/table/dist/src/makeTableConfig.js.map @@ -0,0 +1 @@ +{"version":3,"file":"makeTableConfig.js","sourceRoot":"","sources":["../../src/makeTableConfig.ts"],"names":[],"mappings":";;;AAAA,iFAEwC;AACxC,+DAE+B;AAS/B,mCAEiB;AACjB,qDAE0B;AAC1B,6EAEsC;AAEtC;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,IAAW,EACpC,OAAqC,EACrC,aAAgC,EAChC,mBAA0C,EAAkB,EAAE;IAC9D,MAAM,YAAY,GAAG,IAAA,2DAA4B,EAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAE7E,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE;QACpC,OAAO;YACL,SAAS,EAAE,MAAM;YACjB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,QAAQ,EAAE,MAAM,CAAC,iBAAiB;YAClC,iBAAiB,EAAE,KAAK;YACxB,KAAK,EAAE,YAAY,CAAC,WAAW,CAAC;YAChC,QAAQ,EAAE,KAAK;YACf,GAAG,aAAa;YAChB,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,WAAW,CAAC;SAC1B,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;GAGG;AAEI,MAAM,eAAe,GAAG,CAAC,IAAW,EAAE,SAA0B,EAAE,EAAE,0BAAiD,EAAe,EAAE;;IAC3I,IAAA,+BAAc,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACtC,IAAA,uDAA0B,EAAC,IAAI,EAAE,MAAA,MAAM,CAAC,aAAa,mCAAI,EAAE,CAAC,CAAC;IAE7D,MAAM,mBAAmB,GAAG,MAAA,0BAA0B,aAA1B,0BAA0B,cAA1B,0BAA0B,GAAI,MAAM,CAAC,aAAa,mCAAI,EAAE,CAAC;IAErF,MAAM,aAAa,GAAG,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;IAEzG,MAAM,gBAAgB,GAAG,MAAA,MAAM,CAAC,gBAAgB,mCAAI,CAAC,GAAG,EAAE;QACxD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IACH,MAAM,kBAAkB,GAAG,MAAA,MAAM,CAAC,kBAAkB,mCAAI,CAAC,GAAG,EAAE;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,MAAM;QACT,MAAM,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,MAAM,CAAC;QACvC,OAAO,EAAE,aAAa;QACtB,kBAAkB;QAClB,gBAAgB;QAChB,UAAU,EAAE,MAAA,MAAM,CAAC,UAAU,mCAAI,KAAK;QACtC,mBAAmB,EAAE,IAAA,+CAAyB,EAAC;YAC7C,aAAa;YACb,kBAAkB;YAClB,gBAAgB;YAChB,IAAI;YACJ,mBAAmB;SACpB,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,eAAe,mBA8B1B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/mapDataUsingRowHeights.d.ts b/node_modules/table/dist/src/mapDataUsingRowHeights.d.ts new file mode 100644 index 000000000..1508e905d --- /dev/null +++ b/node_modules/table/dist/src/mapDataUsingRowHeights.d.ts @@ -0,0 +1,4 @@ +import type { VerticalAlignment } from './types/api'; +import type { BaseConfig, Row } from './types/internal'; +export declare const padCellVertically: (lines: string[], rowHeight: number, verticalAlignment: VerticalAlignment) => string[]; +export declare const mapDataUsingRowHeights: (unmappedRows: Row[], rowHeights: number[], config: BaseConfig) => Row[]; diff --git a/node_modules/table/dist/src/mapDataUsingRowHeights.js b/node_modules/table/dist/src/mapDataUsingRowHeights.js new file mode 100644 index 000000000..c13003dc8 --- /dev/null +++ b/node_modules/table/dist/src/mapDataUsingRowHeights.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mapDataUsingRowHeights = exports.padCellVertically = void 0; +const utils_1 = require("./utils"); +const wrapCell_1 = require("./wrapCell"); +const createEmptyStrings = (length) => { + return new Array(length).fill(''); +}; +const padCellVertically = (lines, rowHeight, verticalAlignment) => { + const availableLines = rowHeight - lines.length; + if (verticalAlignment === 'top') { + return [...lines, ...createEmptyStrings(availableLines)]; + } + if (verticalAlignment === 'bottom') { + return [...createEmptyStrings(availableLines), ...lines]; + } + return [ + ...createEmptyStrings(Math.floor(availableLines / 2)), + ...lines, + ...createEmptyStrings(Math.ceil(availableLines / 2)), + ]; +}; +exports.padCellVertically = padCellVertically; +const mapDataUsingRowHeights = (unmappedRows, rowHeights, config) => { + const nColumns = unmappedRows[0].length; + const mappedRows = unmappedRows.map((unmappedRow, unmappedRowIndex) => { + const outputRowHeight = rowHeights[unmappedRowIndex]; + const outputRow = Array.from({ length: outputRowHeight }, () => { + return new Array(nColumns).fill(''); + }); + unmappedRow.forEach((cell, cellIndex) => { + var _a; + const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex, + row: unmappedRowIndex }); + if (containingRange) { + containingRange.extractCellContent(unmappedRowIndex).forEach((cellLine, cellLineIndex) => { + outputRow[cellLineIndex][cellIndex] = cellLine; + }); + return; + } + const cellLines = (0, wrapCell_1.wrapCell)(cell, config.columns[cellIndex].width, config.columns[cellIndex].wrapWord); + const paddedCellLines = (0, exports.padCellVertically)(cellLines, outputRowHeight, config.columns[cellIndex].verticalAlignment); + paddedCellLines.forEach((cellLine, cellLineIndex) => { + outputRow[cellLineIndex][cellIndex] = cellLine; + }); + }); + return outputRow; + }); + return (0, utils_1.flatten)(mappedRows); +}; +exports.mapDataUsingRowHeights = mapDataUsingRowHeights; +//# sourceMappingURL=mapDataUsingRowHeights.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/mapDataUsingRowHeights.js.map b/node_modules/table/dist/src/mapDataUsingRowHeights.js.map new file mode 100644 index 000000000..7bbe0f86c --- /dev/null +++ b/node_modules/table/dist/src/mapDataUsingRowHeights.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mapDataUsingRowHeights.js","sourceRoot":"","sources":["../../src/mapDataUsingRowHeights.ts"],"names":[],"mappings":";;;AAOA,mCAEiB;AACjB,yCAEoB;AAEpB,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC5C,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC;AAEK,MAAM,iBAAiB,GAAG,CAAC,KAAe,EAAE,SAAiB,EAAE,iBAAoC,EAAY,EAAE;IACtH,MAAM,cAAc,GAAG,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;IAEhD,IAAI,iBAAiB,KAAK,KAAK,EAAE;QAC/B,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC;KAC1D;IAED,IAAI,iBAAiB,KAAK,QAAQ,EAAE;QAClC,OAAO,CAAC,GAAG,kBAAkB,CAAC,cAAc,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC;KAC1D;IAED,OAAO;QACL,GAAG,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;QACr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S,CAAC,CAAC,QAAQ,CAAC,CAAC;YAEtG,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,SAAS,EAAE,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,iBAAiB,CAAC,CAAC;YAEnH,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE;gBAClD,SAAS,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC;YACjD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,eAAO,EAAC,UAAU,CAAC,CAAC;AAC7B,CAAC,CAAC;AAhCW,QAAA,sBAAsB,0BAgCjC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/padTableData.d.ts b/node_modules/table/dist/src/padTableData.d.ts new file mode 100644 index 000000000..6bb73366c --- /dev/null +++ b/node_modules/table/dist/src/padTableData.d.ts @@ -0,0 +1,3 @@ +import type { BaseConfig, Row } from './types/internal'; +export declare const padString: (input: string, paddingLeft: number, paddingRight: number) => string; +export declare const padTableData: (rows: Row[], config: BaseConfig) => Row[]; diff --git a/node_modules/table/dist/src/padTableData.js b/node_modules/table/dist/src/padTableData.js new file mode 100644 index 000000000..38580f82c --- /dev/null +++ b/node_modules/table/dist/src/padTableData.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.padTableData = exports.padString = void 0; +const padString = (input, paddingLeft, paddingRight) => { + return ' '.repeat(paddingLeft) + input + ' '.repeat(paddingRight); +}; +exports.padString = padString; +const padTableData = (rows, config) => { + return rows.map((cells, rowIndex) => { + return cells.map((cell, cellIndex) => { + var _a; + const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex, + row: rowIndex }, { mapped: true }); + if (containingRange) { + return cell; + } + const { paddingLeft, paddingRight } = config.columns[cellIndex]; + return (0, exports.padString)(cell, paddingLeft, paddingRight); + }); + }); +}; +exports.padTableData = padTableData; +//# sourceMappingURL=padTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/padTableData.js.map b/node_modules/table/dist/src/padTableData.js.map new file mode 100644 index 000000000..2cf9c94c1 --- /dev/null +++ b/node_modules/table/dist/src/padTableData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"padTableData.js","sourceRoot":"","sources":["../../src/padTableData.ts"],"names":[],"mappings":";;;AAKO,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,WAAmB,EAAE,YAAoB,EAAU,EAAE;IAC5F,OAAO,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACpE,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,MAAM,YAAY,GAAG,CAAC,IAAW,EAAE,MAAkB,EAAS,EAAE;IACrE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAClC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;;YACnC,MAAM,eAAe,GAAG,MAAA,MAAM,CAAC,mBAAmB,0CAAE,kBAAkB,CAAC,EAAC,GAAG,EAAE,SAAS;gBACpF,GAAG,EAAE,QAAQ,EAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;YAClC,IAAI,eAAe,EAAE;gBACnB,OAAO,IAAI,CAAC;aACb;YAED,MAAM,EAAC,WAAW,EAAE,YAAY,EAAC,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAE9D,OAAO,IAAA,iBAAS,EAAC,IAAI,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAdW,QAAA,YAAY,gBAcvB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/schemas/config.json b/node_modules/table/dist/src/schemas/config.json new file mode 100644 index 000000000..cccb5ac1b --- /dev/null +++ b/node_modules/table/dist/src/schemas/config.json @@ -0,0 +1,95 @@ +{ + "$id": "config.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "border": { + "$ref": "shared.json#/definitions/borders" + }, + "header": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "alignment": { + "$ref": "shared.json#/definitions/alignment" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "integer" + }, + "paddingLeft": { + "type": "integer" + }, + "paddingRight": { + "type": "integer" + } + }, + "required": ["content"], + "additionalProperties": false + }, + "columns": { + "$ref": "shared.json#/definitions/columns" + }, + "columnDefault": { + "$ref": "shared.json#/definitions/column" + }, + "drawVerticalLine": { + "typeof": "function" + }, + "drawHorizontalLine": { + "typeof": "function" + }, + "singleLine": { + "typeof": "boolean" + }, + "spanningCells": { + "type": "array", + "items": { + "type": "object", + "properties": { + "col": { + "type": "integer", + "minimum": 0 + }, + "row": { + "type": "integer", + "minimum": 0 + }, + "colSpan": { + "type": "integer", + "minimum": 1 + }, + "rowSpan": { + "type": "integer", + "minimum": 1 + }, + "alignment": { + "$ref": "shared.json#/definitions/alignment" + }, + "verticalAlignment": { + "$ref": "shared.json#/definitions/verticalAlignment" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "integer" + }, + "paddingLeft": { + "type": "integer" + }, + "paddingRight": { + "type": "integer" + } + }, + "required": ["row", "col"], + "additionalProperties": false + } + } + }, + "additionalProperties": false +} diff --git a/node_modules/table/dist/src/schemas/shared.json b/node_modules/table/dist/src/schemas/shared.json new file mode 100644 index 000000000..52a2d3a64 --- /dev/null +++ b/node_modules/table/dist/src/schemas/shared.json @@ -0,0 +1,139 @@ +{ + "$id": "shared.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "columns": { + "oneOf": [ + { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/column" + } + } + ] + }, + "column": { + "type": "object", + "properties": { + "alignment": { + "$ref": "#/definitions/alignment" + }, + "verticalAlignment": { + "$ref": "#/definitions/verticalAlignment" + }, + "width": { + "type": "integer", + "minimum": 1 + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "integer" + }, + "paddingLeft": { + "type": "integer" + }, + "paddingRight": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "borders": { + "type": "object", + "properties": { + "topBody": { + "$ref": "#/definitions/border" + }, + "topJoin": { + "$ref": "#/definitions/border" + }, + "topLeft": { + "$ref": "#/definitions/border" + }, + "topRight": { + "$ref": "#/definitions/border" + }, + "bottomBody": { + "$ref": "#/definitions/border" + }, + "bottomJoin": { + "$ref": "#/definitions/border" + }, + "bottomLeft": { + "$ref": "#/definitions/border" + }, + "bottomRight": { + "$ref": "#/definitions/border" + }, + "bodyLeft": { + "$ref": "#/definitions/border" + }, + "bodyRight": { + "$ref": "#/definitions/border" + }, + "bodyJoin": { + "$ref": "#/definitions/border" + }, + "headerJoin": { + "$ref": "#/definitions/border" + }, + "joinBody": { + "$ref": "#/definitions/border" + }, + "joinLeft": { + "$ref": "#/definitions/border" + }, + "joinRight": { + "$ref": "#/definitions/border" + }, + "joinJoin": { + "$ref": "#/definitions/border" + }, + "joinMiddleUp": { + "$ref": "#/definitions/border" + }, + "joinMiddleDown": { + "$ref": "#/definitions/border" + }, + "joinMiddleLeft": { + "$ref": "#/definitions/border" + }, + "joinMiddleRight": { + "$ref": "#/definitions/border" + } + }, + "additionalProperties": false + }, + "border": { + "type": "string" + }, + "alignment": { + "type": "string", + "enum": [ + "left", + "right", + "center", + "justify" + ] + }, + "verticalAlignment": { + "type": "string", + "enum": [ + "top", + "middle", + "bottom" + ] + } + } +} diff --git a/node_modules/table/dist/src/schemas/streamConfig.json b/node_modules/table/dist/src/schemas/streamConfig.json new file mode 100644 index 000000000..94d351401 --- /dev/null +++ b/node_modules/table/dist/src/schemas/streamConfig.json @@ -0,0 +1,25 @@ +{ + "$id": "streamConfig.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "border": { + "$ref": "shared.json#/definitions/borders" + }, + "columns": { + "$ref": "shared.json#/definitions/columns" + }, + "columnDefault": { + "$ref": "shared.json#/definitions/column" + }, + "columnCount": { + "type": "integer", + "minimum": 1 + }, + "drawVerticalLine": { + "typeof": "function" + } + }, + "required": ["columnDefault", "columnCount"], + "additionalProperties": false +} diff --git a/node_modules/table/dist/src/spanningCellManager.d.ts b/node_modules/table/dist/src/spanningCellManager.d.ts new file mode 100644 index 000000000..a865f6a01 --- /dev/null +++ b/node_modules/table/dist/src/spanningCellManager.d.ts @@ -0,0 +1,21 @@ +import type { DrawHorizontalLine, DrawVerticalLine, SpanningCellConfig } from './types/api'; +import type { CellCoordinates, ColumnConfig, ResolvedRangeConfig, Row } from './types/internal'; +export declare type SpanningCellManager = { + getContainingRange: (cell: CellCoordinates, options?: { + mapped: true; + }) => ResolvedRangeConfig | undefined; + inSameRange: (cell1: CellCoordinates, cell2: CellCoordinates) => boolean; + rowHeights: number[]; + setRowHeights: (rowHeights: number[]) => void; +}; +export declare type SpanningCellParameters = { + spanningCellConfigs: SpanningCellConfig[]; + rows: Row[]; + columnsConfig: ColumnConfig[]; + drawVerticalLine: DrawVerticalLine; + drawHorizontalLine: DrawHorizontalLine; +}; +export declare type SpanningCellContext = SpanningCellParameters & { + rowHeights: number[]; +}; +export declare const createSpanningCellManager: (parameters: SpanningCellParameters) => SpanningCellManager; diff --git a/node_modules/table/dist/src/spanningCellManager.js b/node_modules/table/dist/src/spanningCellManager.js new file mode 100644 index 000000000..d74345dd8 --- /dev/null +++ b/node_modules/table/dist/src/spanningCellManager.js @@ -0,0 +1,86 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createSpanningCellManager = void 0; +const alignSpanningCell_1 = require("./alignSpanningCell"); +const calculateSpanningCellWidth_1 = require("./calculateSpanningCellWidth"); +const makeRangeConfig_1 = require("./makeRangeConfig"); +const utils_1 = require("./utils"); +const findRangeConfig = (cell, rangeConfigs) => { + return rangeConfigs.find((rangeCoordinate) => { + return (0, utils_1.isCellInRange)(cell, rangeCoordinate); + }); +}; +const getContainingRange = (rangeConfig, context) => { + const width = (0, calculateSpanningCellWidth_1.calculateSpanningCellWidth)(rangeConfig, context); + const wrappedContent = (0, alignSpanningCell_1.wrapRangeContent)(rangeConfig, width, context); + const alignedContent = (0, alignSpanningCell_1.alignVerticalRangeContent)(rangeConfig, wrappedContent, context); + const getCellContent = (rowIndex) => { + const { topLeft } = rangeConfig; + const { drawHorizontalLine, rowHeights } = context; + const totalWithinHorizontalBorderHeight = rowIndex - topLeft.row; + const totalHiddenHorizontalBorderHeight = (0, utils_1.sequence)(topLeft.row + 1, rowIndex).filter((index) => { + /* istanbul ignore next */ + return !(drawHorizontalLine === null || drawHorizontalLine === void 0 ? void 0 : drawHorizontalLine(index, rowHeights.length)); + }).length; + const offset = (0, utils_1.sumArray)(rowHeights.slice(topLeft.row, rowIndex)) + totalWithinHorizontalBorderHeight - totalHiddenHorizontalBorderHeight; + return alignedContent.slice(offset, offset + rowHeights[rowIndex]); + }; + const getBorderContent = (borderIndex) => { + const { topLeft } = rangeConfig; + const offset = (0, utils_1.sumArray)(context.rowHeights.slice(topLeft.row, borderIndex)) + (borderIndex - topLeft.row - 1); + return alignedContent[offset]; + }; + return { + ...rangeConfig, + extractBorderContent: getBorderContent, + extractCellContent: getCellContent, + height: wrappedContent.length, + width, + }; +}; +const inSameRange = (cell1, cell2, ranges) => { + const range1 = findRangeConfig(cell1, ranges); + const range2 = findRangeConfig(cell2, ranges); + if (range1 && range2) { + return (0, utils_1.areCellEqual)(range1.topLeft, range2.topLeft); + } + return false; +}; +const hashRange = (range) => { + const { row, col } = range.topLeft; + return `${row}/${col}`; +}; +const createSpanningCellManager = (parameters) => { + const { spanningCellConfigs, columnsConfig } = parameters; + const ranges = spanningCellConfigs.map((config) => { + return (0, makeRangeConfig_1.makeRangeConfig)(config, columnsConfig); + }); + const rangeCache = {}; + let rowHeights = []; + return { getContainingRange: (cell, options) => { + var _a; + const originalRow = (options === null || options === void 0 ? void 0 : options.mapped) ? (0, utils_1.findOriginalRowIndex)(rowHeights, cell.row) : cell.row; + const range = findRangeConfig({ ...cell, + row: originalRow }, ranges); + if (!range) { + return undefined; + } + if (rowHeights.length === 0) { + return getContainingRange(range, { ...parameters, + rowHeights }); + } + const hash = hashRange(range); + (_a = rangeCache[hash]) !== null && _a !== void 0 ? _a : (rangeCache[hash] = getContainingRange(range, { ...parameters, + rowHeights })); + return rangeCache[hash]; + }, + inSameRange: (cell1, cell2) => { + return inSameRange(cell1, cell2, ranges); + }, + rowHeights, + setRowHeights: (_rowHeights) => { + rowHeights = _rowHeights; + } }; +}; +exports.createSpanningCellManager = createSpanningCellManager; +//# sourceMappingURL=spanningCellManager.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/spanningCellManager.js.map b/node_modules/table/dist/src/spanningCellManager.js.map new file mode 100644 index 000000000..4c58a5da6 --- /dev/null +++ b/node_modules/table/dist/src/spanningCellManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spanningCellManager.js","sourceRoot":"","sources":["../../src/spanningCellManager.ts"],"names":[],"mappings":";;;AAAA,2DAE6B;AAC7B,6EAEsC;AACtC,uDAE2B;AAa3B,mCAIiB;AAqBjB,MAAM,eAAe,GAAG,CAAC,IAAqB,EAAE,YAA2B,EAA2B,EAAE;IACtG,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;QAC3C,OAAO,IAAA,qBAAa,EAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,WAAwB,EAAE,OAA4B,EAAmC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I,UAAU,GAAa,EAAE,CAAC;IAE9B,OAAO,EAAC,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;;YAC5C,MAAM,WAAW,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAC,CAAC,CAAC,IAAA,4BAAoB,EAAC,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;YAE5F,MAAM,KAAK,GAAG,eAAe,CAAC,EAAC,GAAG,IAAI;gBACpC,GAAG,EAAE,WAAW,EAAC,EAAE,MAAM,CAAC,CAAC;YAC7B,IAAI,CAAC,KAAK,EAAE;gBACV,OAAO,SAAS,CAAC;aAClB;YAED,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC3B,OAAO,kBAAkB,CAAC,KAAK,EAAE,EAAC,GAAG,UAAU;oBAC7C,UAAU,EAAC,CAAC,CAAC;aAChB;YAED,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;YAC9B,MAAA,UAAU,CAAC,IAAI,qCAAf,UAAU,CAAC,IAAI,IAAM,kBAAkB,CAAC,KAAK,EAAE,EAAC,GAAG,UAAU;gBAC3D,UAAU,EAAC,CAAC,EAAC;YAEf,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QACD,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC5B,OAAO,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;QACD,UAAU;QACV,aAAa,EAAE,CAAC,WAAqB,EAAE,EAAE;YACvC,UAAU,GAAG,WAAW,CAAC;QAC3B,CAAC,EAAC,CAAC;AACL,CAAC,CAAC;AArCW,QAAA,yBAAyB,6BAqCpC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/stringifyTableData.d.ts b/node_modules/table/dist/src/stringifyTableData.d.ts new file mode 100644 index 000000000..5c1270bec --- /dev/null +++ b/node_modules/table/dist/src/stringifyTableData.d.ts @@ -0,0 +1,2 @@ +import type { Row } from './types/internal'; +export declare const stringifyTableData: (rows: unknown[][]) => Row[]; diff --git a/node_modules/table/dist/src/stringifyTableData.js b/node_modules/table/dist/src/stringifyTableData.js new file mode 100644 index 000000000..177141ace --- /dev/null +++ b/node_modules/table/dist/src/stringifyTableData.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stringifyTableData = void 0; +const utils_1 = require("./utils"); +const stringifyTableData = (rows) => { + return rows.map((cells) => { + return cells.map((cell) => { + return (0, utils_1.normalizeString)(String(cell)); + }); + }); +}; +exports.stringifyTableData = stringifyTableData; +//# sourceMappingURL=stringifyTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/stringifyTableData.js.map b/node_modules/table/dist/src/stringifyTableData.js.map new file mode 100644 index 000000000..84a4b1257 --- /dev/null +++ b/node_modules/table/dist/src/stringifyTableData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stringifyTableData.js","sourceRoot":"","sources":["../../src/stringifyTableData.ts"],"names":[],"mappings":";;;AAGA,mCAEiB;AAEV,MAAM,kBAAkB,GAAG,CAAC,IAAiB,EAAS,EAAE;IAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACxB,OAAO,IAAA,uBAAe,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/table.d.ts b/node_modules/table/dist/src/table.d.ts new file mode 100644 index 000000000..db1b39707 --- /dev/null +++ b/node_modules/table/dist/src/table.d.ts @@ -0,0 +1,2 @@ +import type { TableUserConfig } from './types/api'; +export declare const table: (data: unknown[][], userConfig?: TableUserConfig) => string; diff --git a/node_modules/table/dist/src/table.js b/node_modules/table/dist/src/table.js new file mode 100644 index 000000000..0a8622728 --- /dev/null +++ b/node_modules/table/dist/src/table.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.table = void 0; +const alignTableData_1 = require("./alignTableData"); +const calculateOutputColumnWidths_1 = require("./calculateOutputColumnWidths"); +const calculateRowHeights_1 = require("./calculateRowHeights"); +const drawTable_1 = require("./drawTable"); +const injectHeaderConfig_1 = require("./injectHeaderConfig"); +const makeTableConfig_1 = require("./makeTableConfig"); +const mapDataUsingRowHeights_1 = require("./mapDataUsingRowHeights"); +const padTableData_1 = require("./padTableData"); +const stringifyTableData_1 = require("./stringifyTableData"); +const truncateTableData_1 = require("./truncateTableData"); +const utils_1 = require("./utils"); +const validateTableData_1 = require("./validateTableData"); +const table = (data, userConfig = {}) => { + (0, validateTableData_1.validateTableData)(data); + let rows = (0, stringifyTableData_1.stringifyTableData)(data); + const [injectedRows, injectedSpanningCellConfig] = (0, injectHeaderConfig_1.injectHeaderConfig)(rows, userConfig); + const config = (0, makeTableConfig_1.makeTableConfig)(injectedRows, userConfig, injectedSpanningCellConfig); + rows = (0, truncateTableData_1.truncateTableData)(injectedRows, (0, utils_1.extractTruncates)(config)); + const rowHeights = (0, calculateRowHeights_1.calculateRowHeights)(rows, config); + config.spanningCellManager.setRowHeights(rowHeights); + rows = (0, mapDataUsingRowHeights_1.mapDataUsingRowHeights)(rows, rowHeights, config); + rows = (0, alignTableData_1.alignTableData)(rows, config); + rows = (0, padTableData_1.padTableData)(rows, config); + const outputColumnWidths = (0, calculateOutputColumnWidths_1.calculateOutputColumnWidths)(config); + return (0, drawTable_1.drawTable)(rows, outputColumnWidths, rowHeights, config); +}; +exports.table = table; +//# sourceMappingURL=table.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/table.js.map b/node_modules/table/dist/src/table.js.map new file mode 100644 index 000000000..bb03676b8 --- /dev/null +++ b/node_modules/table/dist/src/table.js.map @@ -0,0 +1 @@ +{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/table.ts"],"names":[],"mappings":";;;AAAA,qDAE0B;AAC1B,+EAEuC;AACvC,+DAE+B;AAC/B,2CAEqB;AACrB,6DAE8B;AAC9B,uDAE2B;AAC3B,qEAEkC;AAClC,iDAEwB;AACxB,6DAE8B;AAC9B,2DAE6B;AAI7B,mCAEiB;AACjB,2DAE6B;AAEtB,MAAM,KAAK,GAAG,CAAC,IAAiB,EAAE,aAA8B,EAAE,EAAU,EAAE;IACnF,IAAA,qCAAiB,EAAC,IAAI,CAAC,CAAC;IAExB,IAAI,IAAI,GAAG,IAAA,uCAAkB,EAAC,IAAI,CAAC,CAAC;IAEpC,MAAM,CAAC,YAAY,EAAE,0BAA0B,CAAC,GAAG,IAAA,uCAAkB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAExF,MAAM,MAAM,GAAG,IAAA,iCAAe,EAAC,YAAY,EAAE,UAAU,EAAE,0BAA0B,CAAC,CAAC;IAErF,IAAI,GAAG,IAAA,qCAAiB,EAAC,YAAY,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC,CAAC;IAEjE,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAErD,MAAM,CAAC,mBAAmB,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAErD,IAAI,GAAG,IAAA,+CAAsB,EAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,GAAG,IAAA,2BAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAElC,MAAM,kBAAkB,GAAG,IAAA,yDAA2B,EAAC,MAAM,CAAC,CAAC;IAE/D,OAAO,IAAA,qBAAS,EAAC,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC;AAtBW,QAAA,KAAK,SAsBhB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/truncateTableData.d.ts b/node_modules/table/dist/src/truncateTableData.d.ts new file mode 100644 index 000000000..e88e1ad57 --- /dev/null +++ b/node_modules/table/dist/src/truncateTableData.d.ts @@ -0,0 +1,6 @@ +import type { Row } from './types/internal'; +export declare const truncateString: (input: string, length: number) => string; +/** + * @todo Make it work with ASCII content. + */ +export declare const truncateTableData: (rows: Row[], truncates: number[]) => Row[]; diff --git a/node_modules/table/dist/src/truncateTableData.js b/node_modules/table/dist/src/truncateTableData.js new file mode 100644 index 000000000..1f7980fd5 --- /dev/null +++ b/node_modules/table/dist/src/truncateTableData.js @@ -0,0 +1,24 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.truncateTableData = exports.truncateString = void 0; +const lodash_truncate_1 = __importDefault(require("lodash.truncate")); +const truncateString = (input, length) => { + return (0, lodash_truncate_1.default)(input, { length, + omission: '…' }); +}; +exports.truncateString = truncateString; +/** + * @todo Make it work with ASCII content. + */ +const truncateTableData = (rows, truncates) => { + return rows.map((cells) => { + return cells.map((cell, cellIndex) => { + return (0, exports.truncateString)(cell, truncates[cellIndex]); + }); + }); +}; +exports.truncateTableData = truncateTableData; +//# sourceMappingURL=truncateTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/truncateTableData.js.map b/node_modules/table/dist/src/truncateTableData.js.map new file mode 100644 index 000000000..921869f68 --- /dev/null +++ b/node_modules/table/dist/src/truncateTableData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"truncateTableData.js","sourceRoot":"","sources":["../../src/truncateTableData.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAuC;AAKhC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,MAAc,EAAU,EAAE;IACtE,OAAO,IAAA,yBAAQ,EAAC,KAAK,EAAE,EAAC,MAAM;QAC5B,QAAQ,EAAE,GAAG,EAAC,CAAC,CAAC;AACpB,CAAC,CAAC;AAHW,QAAA,cAAc,kBAGzB;AAEF;;GAEG;AACI,MAAM,iBAAiB,GAAG,CAAC,IAAW,EAAE,SAAmB,EAAS,EAAE;IAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;YACnC,OAAO,IAAA,sBAAc,EAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AANW,QAAA,iBAAiB,qBAM5B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/types/api.d.ts b/node_modules/table/dist/src/types/api.d.ts new file mode 100644 index 000000000..f76c51e05 --- /dev/null +++ b/node_modules/table/dist/src/types/api.d.ts @@ -0,0 +1,130 @@ +export declare type DrawLinePredicate = (index: number, size: number) => boolean; +export declare type DrawVerticalLine = DrawLinePredicate; +export declare type DrawHorizontalLine = DrawLinePredicate; +export declare type BorderUserConfig = { + readonly topLeft?: string; + readonly topRight?: string; + readonly topBody?: string; + readonly topJoin?: string; + readonly bottomLeft?: string; + readonly bottomRight?: string; + readonly bottomBody?: string; + readonly bottomJoin?: string; + readonly joinLeft?: string; + readonly joinRight?: string; + readonly joinBody?: string; + readonly joinJoin?: string; + readonly joinMiddleUp?: string; + readonly joinMiddleDown?: string; + readonly joinMiddleLeft?: string; + readonly joinMiddleRight?: string; + readonly headerJoin?: string; + readonly bodyRight?: string; + readonly bodyLeft?: string; + readonly bodyJoin?: string; +}; +export declare type BorderConfig = Required; +export declare type Alignment = 'center' | 'justify' | 'left' | 'right'; +export declare type VerticalAlignment = 'bottom' | 'middle' | 'top'; +export declare type CellUserConfig = { + /** + * Cell content horizontal alignment (default: left) + */ + readonly alignment?: Alignment; + /** + * Cell content vertical alignment (default: top) + */ + readonly verticalAlignment?: VerticalAlignment; + /** + * Number of characters are which the content will be truncated (default: Infinity) + */ + readonly truncate?: number; + /** + * Cell content padding width left (default: 1) + */ + readonly paddingLeft?: number; + /** + * Cell content padding width right (default: 1) + */ + readonly paddingRight?: number; + /** + * If true, the text is broken at the nearest space or one of the special characters: "\|/_.,;-" + */ + readonly wrapWord?: boolean; +}; +export declare type ColumnUserConfig = CellUserConfig & { + /** + * Column width (default: auto calculation based on the cell content) + */ + readonly width?: number; +}; +/** + * @deprecated Use spanning cell API instead + */ +export declare type HeaderUserConfig = Omit & { + readonly content: string; +}; +export declare type BaseUserConfig = { + /** + * Custom border + */ + readonly border?: BorderUserConfig; + /** + * Default values for all columns. Column specific settings overwrite the default values. + */ + readonly columnDefault?: ColumnUserConfig; + /** + * Column specific configuration. + */ + readonly columns?: Indexable; + /** + * Used to tell whether to draw a vertical line. + * This callback is called for each non-content line of the table. + * The default behavior is to always return true. + */ + readonly drawVerticalLine?: DrawVerticalLine; +}; +export declare type TableUserConfig = BaseUserConfig & { + /** + * The header configuration + */ + readonly header?: HeaderUserConfig; + /** + * Used to tell whether to draw a horizontal line. + * This callback is called for each non-content line of the table. + * The default behavior is to always return true. + */ + readonly drawHorizontalLine?: DrawHorizontalLine; + /** + * Horizontal lines inside the table are not drawn. + */ + readonly singleLine?: boolean; + readonly spanningCells?: SpanningCellConfig[]; +}; +export declare type SpanningCellConfig = CellUserConfig & { + readonly row: number; + readonly col: number; + readonly rowSpan?: number; + readonly colSpan?: number; +}; +export declare type StreamUserConfig = BaseUserConfig & { + /** + * The number of columns + */ + readonly columnCount: number; + /** + * Default values for all columns. Column specific settings overwrite the default values. + */ + readonly columnDefault: ColumnUserConfig & { + /** + * The default width for each column + */ + readonly width: number; + }; +}; +export declare type WritableStream = { + readonly write: (rows: string[]) => void; +}; +export declare type Indexable = { + readonly [index: number]: T; +}; diff --git a/node_modules/table/dist/src/types/api.js b/node_modules/table/dist/src/types/api.js new file mode 100644 index 000000000..57bf49a1d --- /dev/null +++ b/node_modules/table/dist/src/types/api.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=api.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/types/api.js.map b/node_modules/table/dist/src/types/api.js.map new file mode 100644 index 000000000..f396fdb60 --- /dev/null +++ b/node_modules/table/dist/src/types/api.js.map @@ -0,0 +1 @@ +{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/types/api.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/table/dist/src/types/internal.d.ts b/node_modules/table/dist/src/types/internal.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/node_modules/table/dist/src/types/internal.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/table/dist/src/types/internal.js b/node_modules/table/dist/src/types/internal.js new file mode 100644 index 000000000..f8a3d3e79 --- /dev/null +++ b/node_modules/table/dist/src/types/internal.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=internal.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/types/internal.js.map b/node_modules/table/dist/src/types/internal.js.map new file mode 100644 index 000000000..b612aad96 --- /dev/null +++ b/node_modules/table/dist/src/types/internal.js.map @@ -0,0 +1 @@ +{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/types/internal.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/table/dist/src/utils.d.ts b/node_modules/table/dist/src/utils.d.ts new file mode 100644 index 000000000..a165ace57 --- /dev/null +++ b/node_modules/table/dist/src/utils.d.ts @@ -0,0 +1,10 @@ +import type { SpanningCellConfig } from './types/api'; +import type { BaseConfig, CellCoordinates, RangeCoordinate } from './types/internal'; +export declare const sequence: (start: number, end: number) => number[]; +export declare const sumArray: (array: number[]) => number; +export declare const extractTruncates: (config: BaseConfig) => number[]; +export declare const flatten: (array: T[][]) => T[]; +export declare const findOriginalRowIndex: (mappedRowHeights: number[], mappedRowIndex: number) => number; +export declare const calculateRangeCoordinate: (spanningCellConfig: SpanningCellConfig) => RangeCoordinate; +export declare const areCellEqual: (cell1: CellCoordinates, cell2: CellCoordinates) => boolean; +export declare const isCellInRange: (cell: CellCoordinates, { topLeft, bottomRight }: RangeCoordinate) => boolean; diff --git a/node_modules/table/dist/src/utils.js b/node_modules/table/dist/src/utils.js new file mode 100644 index 000000000..f2f25b03b --- /dev/null +++ b/node_modules/table/dist/src/utils.js @@ -0,0 +1,143 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isCellInRange = exports.areCellEqual = exports.calculateRangeCoordinate = exports.findOriginalRowIndex = exports.flatten = exports.extractTruncates = exports.sumArray = exports.sequence = exports.distributeUnevenly = exports.countSpaceSequence = exports.groupBySizes = exports.makeBorderConfig = exports.splitAnsi = exports.normalizeString = void 0; +const slice_ansi_1 = __importDefault(require("slice-ansi")); +const string_width_1 = __importDefault(require("string-width")); +const strip_ansi_1 = __importDefault(require("strip-ansi")); +const getBorderCharacters_1 = require("./getBorderCharacters"); +/** + * Converts Windows-style newline to Unix-style + * + * @internal + */ +const normalizeString = (input) => { + return input.replace(/\r\n/g, '\n'); +}; +exports.normalizeString = normalizeString; +/** + * Splits ansi string by newlines + * + * @internal + */ +const splitAnsi = (input) => { + const lengths = (0, strip_ansi_1.default)(input).split('\n').map(string_width_1.default); + const result = []; + let startIndex = 0; + lengths.forEach((length) => { + result.push(length === 0 ? '' : (0, slice_ansi_1.default)(input, startIndex, startIndex + length)); + // Plus 1 for the newline character itself + startIndex += length + 1; + }); + return result; +}; +exports.splitAnsi = splitAnsi; +/** + * Merges user provided border characters with the default border ("honeywell") characters. + * + * @internal + */ +const makeBorderConfig = (border) => { + return { + ...(0, getBorderCharacters_1.getBorderCharacters)('honeywell'), + ...border, + }; +}; +exports.makeBorderConfig = makeBorderConfig; +/** + * Groups the array into sub-arrays by sizes. + * + * @internal + * @example + * groupBySizes(['a', 'b', 'c', 'd', 'e'], [2, 1, 2]) = [ ['a', 'b'], ['c'], ['d', 'e'] ] + */ +const groupBySizes = (array, sizes) => { + let startIndex = 0; + return sizes.map((size) => { + const group = array.slice(startIndex, startIndex + size); + startIndex += size; + return group; + }); +}; +exports.groupBySizes = groupBySizes; +/** + * Counts the number of continuous spaces in a string + * + * @internal + * @example + * countGroupSpaces('a bc de f') = 3 + */ +const countSpaceSequence = (input) => { + var _a, _b; + return (_b = (_a = input.match(/\s+/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; +}; +exports.countSpaceSequence = countSpaceSequence; +/** + * Creates the non-increasing number array given sum and length + * whose the difference between maximum and minimum is not greater than 1 + * + * @internal + * @example + * distributeUnevenly(6, 3) = [2, 2, 2] + * distributeUnevenly(8, 3) = [3, 3, 2] + */ +const distributeUnevenly = (sum, length) => { + const result = Array.from({ length }).fill(Math.floor(sum / length)); + return result.map((element, index) => { + return element + (index < sum % length ? 1 : 0); + }); +}; +exports.distributeUnevenly = distributeUnevenly; +const sequence = (start, end) => { + return Array.from({ length: end - start + 1 }, (_, index) => { + return index + start; + }); +}; +exports.sequence = sequence; +const sumArray = (array) => { + return array.reduce((accumulator, element) => { + return accumulator + element; + }, 0); +}; +exports.sumArray = sumArray; +const extractTruncates = (config) => { + return config.columns.map(({ truncate }) => { + return truncate; + }); +}; +exports.extractTruncates = extractTruncates; +const flatten = (array) => { + return [].concat(...array); +}; +exports.flatten = flatten; +const findOriginalRowIndex = (mappedRowHeights, mappedRowIndex) => { + const rowIndexMapping = (0, exports.flatten)(mappedRowHeights.map((height, index) => { + return Array.from({ length: height }, () => { + return index; + }); + })); + return rowIndexMapping[mappedRowIndex]; +}; +exports.findOriginalRowIndex = findOriginalRowIndex; +const calculateRangeCoordinate = (spanningCellConfig) => { + const { row, col, colSpan = 1, rowSpan = 1 } = spanningCellConfig; + return { bottomRight: { col: col + colSpan - 1, + row: row + rowSpan - 1 }, + topLeft: { col, + row } }; +}; +exports.calculateRangeCoordinate = calculateRangeCoordinate; +const areCellEqual = (cell1, cell2) => { + return cell1.row === cell2.row && cell1.col === cell2.col; +}; +exports.areCellEqual = areCellEqual; +const isCellInRange = (cell, { topLeft, bottomRight }) => { + return (topLeft.row <= cell.row && + cell.row <= bottomRight.row && + topLeft.col <= cell.col && + cell.col <= bottomRight.col); +}; +exports.isCellInRange = isCellInRange; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/utils.js.map b/node_modules/table/dist/src/utils.js.map new file mode 100644 index 000000000..dee117356 --- /dev/null +++ b/node_modules/table/dist/src/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAC/B,gEAAuC;AACvC,4DAAmC;AACnC,+DAE+B;AAY/B;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAAC,KAAa,EAAU,EAAE;IACvD,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B;AAEF;;;;GAIG;AACI,MAAM,SAAS,GAAG,CAAC,KAAa,EAAY,EAAE;IACnD,MAAM,OAAO,GAAG,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,sBAAW,CAAC,CAAC;IAE9D,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,UAAU,GAAG,CAAC,CAAC;IAEnB,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACzB,MAAM,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC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AI,WAAW,CAAC,GAAG;QAC3B,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG;QACvB,IAAI,CAAC,GAAG,IAAI,WAAW,CAAC,GAAG,CAC5B,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,aAAa,iBAOxB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/validateConfig.d.ts b/node_modules/table/dist/src/validateConfig.d.ts new file mode 100644 index 000000000..e050cad84 --- /dev/null +++ b/node_modules/table/dist/src/validateConfig.d.ts @@ -0,0 +1,2 @@ +import type { TableUserConfig } from './types/api'; +export declare const validateConfig: (schemaId: 'config.json' | 'streamConfig.json', config: TableUserConfig) => void; diff --git a/node_modules/table/dist/src/validateConfig.js b/node_modules/table/dist/src/validateConfig.js new file mode 100644 index 000000000..2df152ea8 --- /dev/null +++ b/node_modules/table/dist/src/validateConfig.js @@ -0,0 +1,27 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateConfig = void 0; +const validators_1 = __importDefault(require("./generated/validators")); +const validateConfig = (schemaId, config) => { + const validate = validators_1.default[schemaId]; + if (!validate(config) && validate.errors) { + // eslint-disable-next-line promise/prefer-await-to-callbacks + const errors = validate.errors.map((error) => { + return { + message: error.message, + params: error.params, + schemaPath: error.schemaPath, + }; + }); + /* eslint-disable no-console */ + console.log('config', config); + console.log('errors', errors); + /* eslint-enable no-console */ + throw new Error('Invalid config.'); + } +}; +exports.validateConfig = validateConfig; +//# sourceMappingURL=validateConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/validateConfig.js.map b/node_modules/table/dist/src/validateConfig.js.map new file mode 100644 index 000000000..db240b390 --- /dev/null +++ b/node_modules/table/dist/src/validateConfig.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validateConfig.js","sourceRoot":"","sources":["../../src/validateConfig.ts"],"names":[],"mappings":";;;;;;AAIA,wEAAgD;AAKzC,MAAM,cAAc,GAAG,CAAC,QAA6C,EAAE,MAAuB,EAAQ,EAAE;IAC7G,MAAM,QAAQ,GAAG,oBAAU,CAAC,QAAQ,CAAqB,CAAC;IAC1D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,EAAE;QACxC,6DAA6D;QAC7D,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAkB,EAAE,EAAE;YACxD,OAAO;gBACL,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,+BAA+B;QAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9B,8BAA8B;QAE9B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACpC;AACH,CAAC,CAAC;AAnBW,QAAA,cAAc,kBAmBzB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/validateSpanningCellConfig.d.ts b/node_modules/table/dist/src/validateSpanningCellConfig.d.ts new file mode 100644 index 000000000..d04bd3429 --- /dev/null +++ b/node_modules/table/dist/src/validateSpanningCellConfig.d.ts @@ -0,0 +1,3 @@ +import type { SpanningCellConfig } from './types/api'; +import type { Row } from './types/internal'; +export declare const validateSpanningCellConfig: (rows: Row[], configs: SpanningCellConfig[]) => void; diff --git a/node_modules/table/dist/src/validateSpanningCellConfig.js b/node_modules/table/dist/src/validateSpanningCellConfig.js new file mode 100644 index 000000000..e2859ad24 --- /dev/null +++ b/node_modules/table/dist/src/validateSpanningCellConfig.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateSpanningCellConfig = void 0; +const utils_1 = require("./utils"); +const inRange = (start, end, value) => { + return start <= value && value <= end; +}; +const validateSpanningCellConfig = (rows, configs) => { + const [nRow, nCol] = [rows.length, rows[0].length]; + configs.forEach((config, configIndex) => { + const { colSpan, rowSpan } = config; + if (colSpan === undefined && rowSpan === undefined) { + throw new Error(`Expect at least colSpan or rowSpan is provided in config.spanningCells[${configIndex}]`); + } + if (colSpan !== undefined && colSpan < 1) { + throw new Error(`Expect colSpan is not equal zero, instead got: ${colSpan} in config.spanningCells[${configIndex}]`); + } + if (rowSpan !== undefined && rowSpan < 1) { + throw new Error(`Expect rowSpan is not equal zero, instead got: ${rowSpan} in config.spanningCells[${configIndex}]`); + } + }); + const rangeCoordinates = configs.map(utils_1.calculateRangeCoordinate); + rangeCoordinates.forEach(({ topLeft, bottomRight }, rangeIndex) => { + if (!inRange(0, nCol - 1, topLeft.col) || + !inRange(0, nRow - 1, topLeft.row) || + !inRange(0, nCol - 1, bottomRight.col) || + !inRange(0, nRow - 1, bottomRight.row)) { + throw new Error(`Some cells in config.spanningCells[${rangeIndex}] are out of the table`); + } + }); + const configOccupy = Array.from({ length: nRow }, () => { + return Array.from({ length: nCol }); + }); + rangeCoordinates.forEach(({ topLeft, bottomRight }, rangeIndex) => { + (0, utils_1.sequence)(topLeft.row, bottomRight.row).forEach((row) => { + (0, utils_1.sequence)(topLeft.col, bottomRight.col).forEach((col) => { + if (configOccupy[row][col] !== undefined) { + throw new Error(`Spanning cells in config.spanningCells[${configOccupy[row][col]}] and config.spanningCells[${rangeIndex}] are overlap each other`); + } + configOccupy[row][col] = rangeIndex; + }); + }); + }); +}; +exports.validateSpanningCellConfig = validateSpanningCellConfig; +//# sourceMappingURL=validateSpanningCellConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/validateSpanningCellConfig.js.map b/node_modules/table/dist/src/validateSpanningCellConfig.js.map new file mode 100644 index 000000000..d5097be45 --- /dev/null +++ b/node_modules/table/dist/src/validateSpanningCellConfig.js.map @@ -0,0 +1 @@ +{"version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CAAC,CAAC;AACL,CAAC,CAAC;AAzCW,QAAA,0BAA0B,8BAyCrC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/validateTableData.d.ts b/node_modules/table/dist/src/validateTableData.d.ts new file mode 100644 index 000000000..84dac05a8 --- /dev/null +++ b/node_modules/table/dist/src/validateTableData.d.ts @@ -0,0 +1 @@ +export declare const validateTableData: (rows: unknown[][]) => void; diff --git a/node_modules/table/dist/src/validateTableData.js b/node_modules/table/dist/src/validateTableData.js new file mode 100644 index 000000000..a85e80755 --- /dev/null +++ b/node_modules/table/dist/src/validateTableData.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateTableData = void 0; +const utils_1 = require("./utils"); +const validateTableData = (rows) => { + if (!Array.isArray(rows)) { + throw new TypeError('Table data must be an array.'); + } + if (rows.length === 0) { + throw new Error('Table must define at least one row.'); + } + if (rows[0].length === 0) { + throw new Error('Table must define at least one column.'); + } + const columnNumber = rows[0].length; + for (const row of rows) { + if (!Array.isArray(row)) { + throw new TypeError('Table row data must be an array.'); + } + if (row.length !== columnNumber) { + throw new Error('Table must have a consistent number of cells.'); + } + for (const cell of row) { + // eslint-disable-next-line no-control-regex + if (/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test((0, utils_1.normalizeString)(String(cell)))) { + throw new Error('Table data must not contain control characters.'); + } + } + } +}; +exports.validateTableData = validateTableData; +//# sourceMappingURL=validateTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/validateTableData.js.map b/node_modules/table/dist/src/validateTableData.js.map new file mode 100644 index 000000000..568fb10bb --- /dev/null +++ b/node_modules/table/dist/src/validateTableData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validateTableData.js","sourceRoot":"","sources":["../../src/validateTableData.ts"],"names":[],"mappings":";;;AAAA,mCAEiB;AAEV,MAAM,iBAAiB,GAAG,CAAC,IAAiB,EAAQ,EAAE;IAC3D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACxB,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAC;KACrD;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KACxD;IAED,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;KAC3D;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAEpC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACvB,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC,CAAC;SACzD;QAED,IAAI,GAAG,CAAC,MAAM,KAAK,YAAY,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;SAClE;QAED,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE;YACtB,4CAA4C;YAC5C,IAAI,0CAA0C,CAAC,IAAI,CAAC,IAAA,uBAAe,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;gBAClF,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;aACpE;SACF;KACF;AACH,CAAC,CAAC;AA/BW,QAAA,iBAAiB,qBA+B5B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapCell.d.ts b/node_modules/table/dist/src/wrapCell.d.ts new file mode 100644 index 000000000..52d7299ba --- /dev/null +++ b/node_modules/table/dist/src/wrapCell.d.ts @@ -0,0 +1,8 @@ +/** + * Wrap a single cell value into a list of lines + * + * Always wraps on newlines, for the remainder uses either word or string wrapping + * depending on user configuration. + * + */ +export declare const wrapCell: (cellValue: string, cellWidth: number, useWrapWord: boolean) => string[]; diff --git a/node_modules/table/dist/src/wrapCell.js b/node_modules/table/dist/src/wrapCell.js new file mode 100644 index 000000000..b2ce8de0d --- /dev/null +++ b/node_modules/table/dist/src/wrapCell.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.wrapCell = void 0; +const utils_1 = require("./utils"); +const wrapString_1 = require("./wrapString"); +const wrapWord_1 = require("./wrapWord"); +/** + * Wrap a single cell value into a list of lines + * + * Always wraps on newlines, for the remainder uses either word or string wrapping + * depending on user configuration. + * + */ +const wrapCell = (cellValue, cellWidth, useWrapWord) => { + // First split on literal newlines + const cellLines = (0, utils_1.splitAnsi)(cellValue); + // Then iterate over the list and word-wrap every remaining line if necessary. + for (let lineNr = 0; lineNr < cellLines.length;) { + let lineChunks; + if (useWrapWord) { + lineChunks = (0, wrapWord_1.wrapWord)(cellLines[lineNr], cellWidth); + } + else { + lineChunks = (0, wrapString_1.wrapString)(cellLines[lineNr], cellWidth); + } + // Replace our original array element with whatever the wrapping returned + cellLines.splice(lineNr, 1, ...lineChunks); + lineNr += lineChunks.length; + } + return cellLines; +}; +exports.wrapCell = wrapCell; +//# sourceMappingURL=wrapCell.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapCell.js.map b/node_modules/table/dist/src/wrapCell.js.map new file mode 100644 index 000000000..9ce0736ec --- /dev/null +++ b/node_modules/table/dist/src/wrapCell.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wrapCell.js","sourceRoot":"","sources":["../../src/wrapCell.ts"],"names":[],"mappings":";;;AAAA,mCAEiB;AACjB,6CAEsB;AACtB,yCAEoB;AAEpB;;;;;;GAMG;AACI,MAAM,QAAQ,GAAG,CAAC,SAAiB,EAAE,SAAiB,EAAE,WAAoB,EAAY,EAAE;IAC/F,kCAAkC;IAClC,MAAM,SAAS,GAAG,IAAA,iBAAS,EAAC,SAAS,CAAC,CAAC;IAEvC,8EAA8E;IAC9E,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG;QAC/C,IAAI,UAAU,CAAC;QAEf,IAAI,WAAW,EAAE;YACf,UAAU,GAAG,IAAA,mBAAQ,EAAC,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;SACrD;aAAM;YACL,UAAU,GAAG,IAAA,uBAAU,EAAC,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;SACvD;QAED,yEAAyE;QACzE,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC;QAC3C,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC;KAC7B;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AApBW,QAAA,QAAQ,YAoBnB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapString.d.ts b/node_modules/table/dist/src/wrapString.d.ts new file mode 100644 index 000000000..849e17473 --- /dev/null +++ b/node_modules/table/dist/src/wrapString.d.ts @@ -0,0 +1,9 @@ +/** + * Creates an array of strings split into groups the length of size. + * This function works with strings that contain ASCII characters. + * + * wrapText is different from would-be "chunk" implementation + * in that whitespace characters that occur on a chunk size limit are trimmed. + * + */ +export declare const wrapString: (subject: string, size: number) => string[]; diff --git a/node_modules/table/dist/src/wrapString.js b/node_modules/table/dist/src/wrapString.js new file mode 100644 index 000000000..b09bd1736 --- /dev/null +++ b/node_modules/table/dist/src/wrapString.js @@ -0,0 +1,27 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.wrapString = void 0; +const slice_ansi_1 = __importDefault(require("slice-ansi")); +const string_width_1 = __importDefault(require("string-width")); +/** + * Creates an array of strings split into groups the length of size. + * This function works with strings that contain ASCII characters. + * + * wrapText is different from would-be "chunk" implementation + * in that whitespace characters that occur on a chunk size limit are trimmed. + * + */ +const wrapString = (subject, size) => { + let subjectSlice = subject; + const chunks = []; + do { + chunks.push((0, slice_ansi_1.default)(subjectSlice, 0, size)); + subjectSlice = (0, slice_ansi_1.default)(subjectSlice, size).trim(); + } while ((0, string_width_1.default)(subjectSlice)); + return chunks; +}; +exports.wrapString = wrapString; +//# sourceMappingURL=wrapString.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapString.js.map b/node_modules/table/dist/src/wrapString.js.map new file mode 100644 index 000000000..c1c2a5bdd --- /dev/null +++ b/node_modules/table/dist/src/wrapString.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wrapString.js","sourceRoot":"","sources":["../../src/wrapString.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAC/B,gEAAuC;AAEvC;;;;;;;GAOG;AACI,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,IAAY,EAAY,EAAE;IACpE,IAAI,YAAY,GAAG,OAAO,CAAC;IAE3B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,GAAG;QACD,MAAM,CAAC,IAAI,CAAC,IAAA,oBAAK,EAAC,YAAY,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QAE1C,YAAY,GAAG,IAAA,oBAAK,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;KACjD,QAAQ,IAAA,sBAAW,EAAC,YAAY,CAAC,EAAE;IAEpC,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapWord.d.ts b/node_modules/table/dist/src/wrapWord.d.ts new file mode 100644 index 000000000..083da4d4e --- /dev/null +++ b/node_modules/table/dist/src/wrapWord.d.ts @@ -0,0 +1 @@ +export declare const wrapWord: (input: string, size: number) => string[]; diff --git a/node_modules/table/dist/src/wrapWord.js b/node_modules/table/dist/src/wrapWord.js new file mode 100644 index 000000000..7571aa6e5 --- /dev/null +++ b/node_modules/table/dist/src/wrapWord.js @@ -0,0 +1,42 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.wrapWord = void 0; +const slice_ansi_1 = __importDefault(require("slice-ansi")); +const strip_ansi_1 = __importDefault(require("strip-ansi")); +const calculateStringLengths = (input, size) => { + let subject = (0, strip_ansi_1.default)(input); + const chunks = []; + // https://regex101.com/r/gY5kZ1/1 + const re = new RegExp('(^.{1,' + String(Math.max(size, 1)) + '}(\\s+|$))|(^.{1,' + String(Math.max(size - 1, 1)) + '}(\\\\|/|_|\\.|,|;|-))'); + do { + let chunk; + const match = re.exec(subject); + if (match) { + chunk = match[0]; + subject = subject.slice(chunk.length); + const trimmedLength = chunk.trim().length; + const offset = chunk.length - trimmedLength; + chunks.push([trimmedLength, offset]); + } + else { + chunk = subject.slice(0, size); + subject = subject.slice(size); + chunks.push([chunk.length, 0]); + } + } while (subject.length); + return chunks; +}; +const wrapWord = (input, size) => { + const result = []; + let startIndex = 0; + calculateStringLengths(input, size).forEach(([length, offset]) => { + result.push((0, slice_ansi_1.default)(input, startIndex, startIndex + length)); + startIndex += length + offset; + }); + return result; +}; +exports.wrapWord = wrapWord; +//# sourceMappingURL=wrapWord.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapWord.js.map b/node_modules/table/dist/src/wrapWord.js.map new file mode 100644 index 000000000..fc61519df --- /dev/null +++ b/node_modules/table/dist/src/wrapWord.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wrapWord.js","sourceRoot":"","sources":["../../src/wrapWord.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAC/B,4DAAmC;AAEnC,MAAM,sBAAsB,GAAG,CAAC,KAAa,EAAE,IAAY,EAA0C,EAAE;IACrG,IAAI,OAAO,GAAG,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC;IAE/B,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,kCAAkC;IAClC,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,QAAQ,GA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AAC,IAAA,oBAAK,EAAC,KAAK,EAAE,UAAU,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC;QAE3D,UAAU,IAAI,MAAM,GAAG,MAAM,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAXW,QAAA,QAAQ,YAWnB"} \ No newline at end of file diff --git a/node_modules/table/package.json b/node_modules/table/package.json new file mode 100644 index 000000000..f33a18890 --- /dev/null +++ b/node_modules/table/package.json @@ -0,0 +1,77 @@ +{ + "author": { + "email": "gajus@gajus.com", + "name": "Gajus Kuizinas", + "url": "http://gajus.com" + }, + "dependencies": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "description": "Formats data into a string table.", + "devDependencies": { + "@types/chai": "^4.2.16", + "@types/lodash.mapvalues": "^4.6.6", + "@types/lodash.truncate": "^4.4.6", + "@types/mocha": "^9.0.0", + "@types/node": "^14.14.37", + "@types/sinon": "^10.0.0", + "@types/slice-ansi": "^4.0.0", + "ajv-cli": "^5.0.0", + "ajv-keywords": "^5.0.0", + "chai": "^4.2.0", + "chalk": "^4.1.0", + "coveralls": "^3.1.0", + "eslint": "^7.32.0", + "eslint-config-canonical": "^25.0.0", + "gitdown": "^3.1.4", + "husky": "^4.3.6", + "js-beautify": "^1.14.0", + "lodash.mapvalues": "^4.6.0", + "mkdirp": "^1.0.4", + "mocha": "^8.2.1", + "nyc": "^15.1.0", + "semantic-release": "^17.3.1", + "sinon": "^12.0.1", + "ts-node": "^9.1.1", + "typescript": "4.5.2" + }, + "engines": { + "node": ">=10.0.0" + }, + "husky": { + "hooks": { + "post-commit": "npm run create-readme && git add README.md && git commit -m 'docs: generate docs' --no-verify", + "pre-commit": "npm run build && npm run lint && npm run test" + } + }, + "keywords": [ + "ascii", + "text", + "table", + "align", + "ansi" + ], + "license": "BSD-3-Clause", + "main": "./dist/src/index.js", + "files": [ + "dist/src/" + ], + "name": "table", + "repository": { + "type": "git", + "url": "https://github.com/gajus/table" + }, + "scripts": { + "prebuild": "rm -fr ./src/generated && mkdirp ./src/generated", + "build": "npm run create-validators && tsc", + "create-readme": "gitdown ./.README/README.md --output-file ./README.md", + "create-validators": "ajv compile --all-errors --inline-refs=false -s src/schemas/config -s src/schemas/streamConfig -r src/schemas/shared -c ajv-keywords/dist/keywords/typeof -o | js-beautify > ./src/generated/validators.js", + "lint": "eslint ./src ./test", + "test": "nyc mocha && nyc check-coverage --lines 95" + }, + "version": "6.8.1" +} diff --git a/node_modules/to-regex-range/LICENSE b/node_modules/to-regex-range/LICENSE new file mode 100644 index 000000000..7cccaf9e3 --- /dev/null +++ b/node_modules/to-regex-range/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/to-regex-range/README.md b/node_modules/to-regex-range/README.md new file mode 100644 index 000000000..38887dafa --- /dev/null +++ b/node_modules/to-regex-range/README.md @@ -0,0 +1,305 @@ +# to-regex-range [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/to-regex-range.svg?style=flat)](https://www.npmjs.com/package/to-regex-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/to-regex-range.svg?style=flat)](https://npmjs.org/package/to-regex-range) [![NPM total downloads](https://img.shields.io/npm/dt/to-regex-range.svg?style=flat)](https://npmjs.org/package/to-regex-range) [![Linux Build Status](https://img.shields.io/travis/micromatch/to-regex-range.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/to-regex-range) + +> Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save to-regex-range +``` + +
+What does this do? + +
+ +This libary generates the `source` string to be passed to `new RegExp()` for matching a range of numbers. + +**Example** + +```js +const toRegexRange = require('to-regex-range'); +const regex = new RegExp(toRegexRange('15', '95')); +``` + +A string is returned so that you can do whatever you need with it before passing it to `new RegExp()` (like adding `^` or `$` boundaries, defining flags, or combining it another string). + +
+ +
+ +
+Why use this library? + +
+ +### Convenience + +Creating regular expressions for matching numbers gets deceptively complicated pretty fast. + +For example, let's say you need a validation regex for matching part of a user-id, postal code, social security number, tax id, etc: + +* regex for matching `1` => `/1/` (easy enough) +* regex for matching `1` through `5` => `/[1-5]/` (not bad...) +* regex for matching `1` or `5` => `/(1|5)/` (still easy...) +* regex for matching `1` through `50` => `/([1-9]|[1-4][0-9]|50)/` (uh-oh...) +* regex for matching `1` through `55` => `/([1-9]|[1-4][0-9]|5[0-5])/` (no prob, I can do this...) +* regex for matching `1` through `555` => `/([1-9]|[1-9][0-9]|[1-4][0-9]{2}|5[0-4][0-9]|55[0-5])/` (maybe not...) +* regex for matching `0001` through `5555` => `/(0{3}[1-9]|0{2}[1-9][0-9]|0[1-9][0-9]{2}|[1-4][0-9]{3}|5[0-4][0-9]{2}|55[0-4][0-9]|555[0-5])/` (okay, I get the point!) + +The numbers are contrived, but they're also really basic. In the real world you might need to generate a regex on-the-fly for validation. + +**Learn more** + +If you're interested in learning more about [character classes](http://www.regular-expressions.info/charclass.html) and other regex features, I personally have always found [regular-expressions.info](http://www.regular-expressions.info/charclass.html) to be pretty useful. + +### Heavily tested + +As of April 07, 2019, this library runs [>1m test assertions](./test/test.js) against generated regex-ranges to provide brute-force verification that results are correct. + +Tests run in ~280ms on my MacBook Pro, 2.5 GHz Intel Core i7. + +### Optimized + +Generated regular expressions are optimized: + +* duplicate sequences and character classes are reduced using quantifiers +* smart enough to use `?` conditionals when number(s) or range(s) can be positive or negative +* uses fragment caching to avoid processing the same exact string more than once + +
+ +
+ +## Usage + +Add this library to your javascript application with the following line of code + +```js +const toRegexRange = require('to-regex-range'); +``` + +The main export is a function that takes two integers: the `min` value and `max` value (formatted as strings or numbers). + +```js +const source = toRegexRange('15', '95'); +//=> 1[5-9]|[2-8][0-9]|9[0-5] + +const regex = new RegExp(`^${source}$`); +console.log(regex.test('14')); //=> false +console.log(regex.test('50')); //=> true +console.log(regex.test('94')); //=> true +console.log(regex.test('96')); //=> false +``` + +## Options + +### options.capture + +**Type**: `boolean` + +**Deafault**: `undefined` + +Wrap the returned value in parentheses when there is more than one regex condition. Useful when you're dynamically generating ranges. + +```js +console.log(toRegexRange('-10', '10')); +//=> -[1-9]|-?10|[0-9] + +console.log(toRegexRange('-10', '10', { capture: true })); +//=> (-[1-9]|-?10|[0-9]) +``` + +### options.shorthand + +**Type**: `boolean` + +**Deafault**: `undefined` + +Use the regex shorthand for `[0-9]`: + +```js +console.log(toRegexRange('0', '999999')); +//=> [0-9]|[1-9][0-9]{1,5} + +console.log(toRegexRange('0', '999999', { shorthand: true })); +//=> \d|[1-9]\d{1,5} +``` + +### options.relaxZeros + +**Type**: `boolean` + +**Default**: `true` + +This option relaxes matching for leading zeros when when ranges are zero-padded. + +```js +const source = toRegexRange('-0010', '0010'); +const regex = new RegExp(`^${source}$`); +console.log(regex.test('-10')); //=> true +console.log(regex.test('-010')); //=> true +console.log(regex.test('-0010')); //=> true +console.log(regex.test('10')); //=> true +console.log(regex.test('010')); //=> true +console.log(regex.test('0010')); //=> true +``` + +When `relaxZeros` is false, matching is strict: + +```js +const source = toRegexRange('-0010', '0010', { relaxZeros: false }); +const regex = new RegExp(`^${source}$`); +console.log(regex.test('-10')); //=> false +console.log(regex.test('-010')); //=> false +console.log(regex.test('-0010')); //=> true +console.log(regex.test('10')); //=> false +console.log(regex.test('010')); //=> false +console.log(regex.test('0010')); //=> true +``` + +## Examples + +| **Range** | **Result** | **Compile time** | +| --- | --- | --- | +| `toRegexRange(-10, 10)` | `-[1-9]\|-?10\|[0-9]` | _132μs_ | +| `toRegexRange(-100, -10)` | `-1[0-9]\|-[2-9][0-9]\|-100` | _50μs_ | +| `toRegexRange(-100, 100)` | `-[1-9]\|-?[1-9][0-9]\|-?100\|[0-9]` | _42μs_ | +| `toRegexRange(001, 100)` | `0{0,2}[1-9]\|0?[1-9][0-9]\|100` | _109μs_ | +| `toRegexRange(001, 555)` | `0{0,2}[1-9]\|0?[1-9][0-9]\|[1-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _51μs_ | +| `toRegexRange(0010, 1000)` | `0{0,2}1[0-9]\|0{0,2}[2-9][0-9]\|0?[1-9][0-9]{2}\|1000` | _31μs_ | +| `toRegexRange(1, 50)` | `[1-9]\|[1-4][0-9]\|50` | _24μs_ | +| `toRegexRange(1, 55)` | `[1-9]\|[1-4][0-9]\|5[0-5]` | _23μs_ | +| `toRegexRange(1, 555)` | `[1-9]\|[1-9][0-9]\|[1-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _30μs_ | +| `toRegexRange(1, 5555)` | `[1-9]\|[1-9][0-9]{1,2}\|[1-4][0-9]{3}\|5[0-4][0-9]{2}\|55[0-4][0-9]\|555[0-5]` | _43μs_ | +| `toRegexRange(111, 555)` | `11[1-9]\|1[2-9][0-9]\|[2-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _38μs_ | +| `toRegexRange(29, 51)` | `29\|[34][0-9]\|5[01]` | _24μs_ | +| `toRegexRange(31, 877)` | `3[1-9]\|[4-9][0-9]\|[1-7][0-9]{2}\|8[0-6][0-9]\|87[0-7]` | _32μs_ | +| `toRegexRange(5, 5)` | `5` | _8μs_ | +| `toRegexRange(5, 6)` | `5\|6` | _11μs_ | +| `toRegexRange(1, 2)` | `1\|2` | _6μs_ | +| `toRegexRange(1, 5)` | `[1-5]` | _15μs_ | +| `toRegexRange(1, 10)` | `[1-9]\|10` | _22μs_ | +| `toRegexRange(1, 100)` | `[1-9]\|[1-9][0-9]\|100` | _25μs_ | +| `toRegexRange(1, 1000)` | `[1-9]\|[1-9][0-9]{1,2}\|1000` | _31μs_ | +| `toRegexRange(1, 10000)` | `[1-9]\|[1-9][0-9]{1,3}\|10000` | _34μs_ | +| `toRegexRange(1, 100000)` | `[1-9]\|[1-9][0-9]{1,4}\|100000` | _36μs_ | +| `toRegexRange(1, 1000000)` | `[1-9]\|[1-9][0-9]{1,5}\|1000000` | _42μs_ | +| `toRegexRange(1, 10000000)` | `[1-9]\|[1-9][0-9]{1,6}\|10000000` | _42μs_ | + +## Heads up! + +**Order of arguments** + +When the `min` is larger than the `max`, values will be flipped to create a valid range: + +```js +toRegexRange('51', '29'); +``` + +Is effectively flipped to: + +```js +toRegexRange('29', '51'); +//=> 29|[3-4][0-9]|5[0-1] +``` + +**Steps / increments** + +This library does not support steps (increments). A pr to add support would be welcome. + +## History + +### v2.0.0 - 2017-04-21 + +**New features** + +Adds support for zero-padding! + +### v1.0.0 + +**Optimizations** + +Repeating ranges are now grouped using quantifiers. rocessing time is roughly the same, but the generated regex is much smaller, which should result in faster matching. + +## Attribution + +Inspired by the python library [range-regex](https://github.com/dimka665/range-regex). + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used by micromatch.") +* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") +* [repeat-element](https://www.npmjs.com/package/repeat-element): Create an array by repeating the given value n times. | [homepage](https://github.com/jonschlinkert/repeat-element "Create an array by repeating the given value n times.") +* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string "Repeat the given string n times. Fastest implementation for repeating a string.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 63 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [doowb](https://github.com/doowb) | +| 2 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +Please consider supporting me on Patreon, or [start your own Patreon page](https://patreon.com/invite/bxpbvm)! + + + + + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 07, 2019._ \ No newline at end of file diff --git a/node_modules/to-regex-range/index.js b/node_modules/to-regex-range/index.js new file mode 100644 index 000000000..77fbaced1 --- /dev/null +++ b/node_modules/to-regex-range/index.js @@ -0,0 +1,288 @@ +/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +const isNumber = require('is-number'); + +const toRegexRange = (min, max, options) => { + if (isNumber(min) === false) { + throw new TypeError('toRegexRange: expected the first argument to be a number'); + } + + if (max === void 0 || min === max) { + return String(min); + } + + if (isNumber(max) === false) { + throw new TypeError('toRegexRange: expected the second argument to be a number.'); + } + + let opts = { relaxZeros: true, ...options }; + if (typeof opts.strictZeros === 'boolean') { + opts.relaxZeros = opts.strictZeros === false; + } + + let relax = String(opts.relaxZeros); + let shorthand = String(opts.shorthand); + let capture = String(opts.capture); + let wrap = String(opts.wrap); + let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; + + if (toRegexRange.cache.hasOwnProperty(cacheKey)) { + return toRegexRange.cache[cacheKey].result; + } + + let a = Math.min(min, max); + let b = Math.max(min, max); + + if (Math.abs(a - b) === 1) { + let result = min + '|' + max; + if (opts.capture) { + return `(${result})`; + } + if (opts.wrap === false) { + return result; + } + return `(?:${result})`; + } + + let isPadded = hasPadding(min) || hasPadding(max); + let state = { min, max, a, b }; + let positives = []; + let negatives = []; + + if (isPadded) { + state.isPadded = isPadded; + state.maxLen = String(state.max).length; + } + + if (a < 0) { + let newMin = b < 0 ? Math.abs(b) : 1; + negatives = splitToPatterns(newMin, Math.abs(a), state, opts); + a = state.a = 0; + } + + if (b >= 0) { + positives = splitToPatterns(a, b, state, opts); + } + + state.negatives = negatives; + state.positives = positives; + state.result = collatePatterns(negatives, positives, opts); + + if (opts.capture === true) { + state.result = `(${state.result})`; + } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { + state.result = `(?:${state.result})`; + } + + toRegexRange.cache[cacheKey] = state; + return state.result; +}; + +function collatePatterns(neg, pos, options) { + let onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; + let onlyPositive = filterPatterns(pos, neg, '', false, options) || []; + let intersected = filterPatterns(neg, pos, '-?', true, options) || []; + let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join('|'); +} + +function splitToRanges(min, max) { + let nines = 1; + let zeros = 1; + + let stop = countNines(min, nines); + let stops = new Set([max]); + + while (min <= stop && stop <= max) { + stops.add(stop); + nines += 1; + stop = countNines(min, nines); + } + + stop = countZeros(max + 1, zeros) - 1; + + while (min < stop && stop <= max) { + stops.add(stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; + } + + stops = [...stops]; + stops.sort(compare); + return stops; +} + +/** + * Convert a range to a regex pattern + * @param {Number} `start` + * @param {Number} `stop` + * @return {String} + */ + +function rangeToPattern(start, stop, options) { + if (start === stop) { + return { pattern: start, count: [], digits: 0 }; + } + + let zipped = zip(start, stop); + let digits = zipped.length; + let pattern = ''; + let count = 0; + + for (let i = 0; i < digits; i++) { + let [startDigit, stopDigit] = zipped[i]; + + if (startDigit === stopDigit) { + pattern += startDigit; + + } else if (startDigit !== '0' || stopDigit !== '9') { + pattern += toCharacterClass(startDigit, stopDigit, options); + + } else { + count++; + } + } + + if (count) { + pattern += options.shorthand === true ? '\\d' : '[0-9]'; + } + + return { pattern, count: [count], digits }; +} + +function splitToPatterns(min, max, tok, options) { + let ranges = splitToRanges(min, max); + let tokens = []; + let start = min; + let prev; + + for (let i = 0; i < ranges.length; i++) { + let max = ranges[i]; + let obj = rangeToPattern(String(start), String(max), options); + let zeros = ''; + + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.count.length > 1) { + prev.count.pop(); + } + + prev.count.push(obj.count[0]); + prev.string = prev.pattern + toQuantifier(prev.count); + start = max + 1; + continue; + } + + if (tok.isPadded) { + zeros = padZeros(max, tok, options); + } + + obj.string = zeros + obj.pattern + toQuantifier(obj.count); + tokens.push(obj); + start = max + 1; + prev = obj; + } + + return tokens; +} + +function filterPatterns(arr, comparison, prefix, intersection, options) { + let result = []; + + for (let ele of arr) { + let { string } = ele; + + // only push if _both_ are negative... + if (!intersection && !contains(comparison, 'string', string)) { + result.push(prefix + string); + } + + // or _both_ are positive + if (intersection && contains(comparison, 'string', string)) { + result.push(prefix + string); + } + } + return result; +} + +/** + * Zip strings + */ + +function zip(a, b) { + let arr = []; + for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); + return arr; +} + +function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; +} + +function contains(arr, key, val) { + return arr.some(ele => ele[key] === val); +} + +function countNines(min, len) { + return Number(String(min).slice(0, -len) + '9'.repeat(len)); +} + +function countZeros(integer, zeros) { + return integer - (integer % Math.pow(10, zeros)); +} + +function toQuantifier(digits) { + let [start = 0, stop = ''] = digits; + if (stop || start > 1) { + return `{${start + (stop ? ',' + stop : '')}}`; + } + return ''; +} + +function toCharacterClass(a, b, options) { + return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; +} + +function hasPadding(str) { + return /^-?(0+)\d/.test(str); +} + +function padZeros(value, tok, options) { + if (!tok.isPadded) { + return value; + } + + let diff = Math.abs(tok.maxLen - String(value).length); + let relax = options.relaxZeros !== false; + + switch (diff) { + case 0: + return ''; + case 1: + return relax ? '0?' : '0'; + case 2: + return relax ? '0{0,2}' : '00'; + default: { + return relax ? `0{0,${diff}}` : `0{${diff}}`; + } + } +} + +/** + * Cache + */ + +toRegexRange.cache = {}; +toRegexRange.clearCache = () => (toRegexRange.cache = {}); + +/** + * Expose `toRegexRange` + */ + +module.exports = toRegexRange; diff --git a/node_modules/to-regex-range/package.json b/node_modules/to-regex-range/package.json new file mode 100644 index 000000000..4ef194f35 --- /dev/null +++ b/node_modules/to-regex-range/package.json @@ -0,0 +1,88 @@ +{ + "name": "to-regex-range", + "description": "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.", + "version": "5.0.1", + "homepage": "https://github.com/micromatch/to-regex-range", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Rouven Weßling (www.rouvenwessling.de)" + ], + "repository": "micromatch/to-regex-range", + "bugs": { + "url": "https://github.com/micromatch/to-regex-range/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=8.0" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "is-number": "^7.0.0" + }, + "devDependencies": { + "fill-range": "^6.0.0", + "gulp-format-md": "^2.0.0", + "mocha": "^6.0.2", + "text-table": "^0.2.0", + "time-diff": "^0.3.1" + }, + "keywords": [ + "bash", + "date", + "expand", + "expansion", + "expression", + "glob", + "match", + "match date", + "match number", + "match numbers", + "match year", + "matches", + "matching", + "number", + "numbers", + "numerical", + "range", + "ranges", + "regex", + "regexp", + "regular", + "regular expression", + "sequence" + ], + "verb": { + "layout": "default", + "toc": false, + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "helpers": { + "examples": { + "displayName": "examples" + } + }, + "related": { + "list": [ + "expand-range", + "fill-range", + "micromatch", + "repeat-element", + "repeat-string" + ] + } + } +} diff --git a/node_modules/trim-newlines/index.d.ts b/node_modules/trim-newlines/index.d.ts new file mode 100644 index 000000000..0aa9fbd53 --- /dev/null +++ b/node_modules/trim-newlines/index.d.ts @@ -0,0 +1,42 @@ +declare const trimNewlines: { + /** + Trim from the start and end of a string. + + @example + ```js + import trimNewlines from 'trim-newlines'; + + trimNewlines('\n🦄\r\n'); + //=> '🦄' + ``` + */ + (string: string): string; + + /** + Trim from the start of a string. + + @example + ```js + import trimNewlines from 'trim-newlines'; + + trimNewlines.start('\n🦄\r\n'); + //=> '🦄\r\n' + ``` + */ + start(string: string): string; + + /** + Trim from the end of a string. + + @example + ```js + import trimNewlines from 'trim-newlines'; + + trimNewlines.end('\n🦄\r\n'); + //=> '\n🦄' + ``` + */ + end(string: string): string; +}; + +export default trimNewlines; diff --git a/node_modules/trim-newlines/index.js b/node_modules/trim-newlines/index.js new file mode 100644 index 000000000..628f96a7e --- /dev/null +++ b/node_modules/trim-newlines/index.js @@ -0,0 +1,35 @@ +export default function trimNewlines(string) { + let start = 0; + let end = string.length; + + while (start < end && (string[start] === '\r' || string[start] === '\n')) { + start++; + } + + while (end > start && (string[end - 1] === '\r' || string[end - 1] === '\n')) { + end--; + } + + return (start > 0 || end < string.length) ? string.slice(start, end) : string; +} + +trimNewlines.start = string => { + const end = string.length; + let start = 0; + + while (start < end && (string[start] === '\r' || string[start] === '\n')) { + start++; + } + + return start > 0 ? string.slice(start, end) : string; +}; + +trimNewlines.end = string => { + let end = string.length; + + while (end > 0 && (string[end - 1] === '\r' || string[end - 1] === '\n')) { + end--; + } + + return end < string.length ? string.slice(0, end) : string; +}; diff --git a/node_modules/trim-newlines/license b/node_modules/trim-newlines/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/trim-newlines/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/trim-newlines/package.json b/node_modules/trim-newlines/package.json new file mode 100644 index 000000000..d22341198 --- /dev/null +++ b/node_modules/trim-newlines/package.json @@ -0,0 +1,46 @@ +{ + "name": "trim-newlines", + "version": "4.1.1", + "description": "Trim newlines from the start and/or end of a string", + "license": "MIT", + "repository": "sindresorhus/trim-newlines", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "trim", + "newline", + "newlines", + "linebreak", + "lf", + "crlf", + "left", + "right", + "start", + "end", + "string", + "remove", + "delete", + "strip" + ], + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.39.1" + } +} diff --git a/node_modules/trim-newlines/readme.md b/node_modules/trim-newlines/readme.md new file mode 100644 index 000000000..2b8561b1b --- /dev/null +++ b/node_modules/trim-newlines/readme.md @@ -0,0 +1,55 @@ +# trim-newlines + +> Trim [newlines](https://en.wikipedia.org/wiki/Newline) from the start and/or end of a string + +## Install + +``` +$ npm install trim-newlines +``` + +## Usage + +```js +import trimNewlines from 'trim-newlines'; + +trimNewlines('\n🦄\r\n'); +//=> '🦄' + +trimNewlines.start('\n🦄\r\n'); +//=> '🦄\r\n' + +trimNewlines.end('\n🦄\r\n'); +//=> '\n🦄' +``` + +## API + +### trimNewlines(string) + +Trim from the start and end of a string. + +### trimNewlines.start(string) + +Trim from the start of a string. + +### trimNewlines.end(string) + +Trim from the end of a string. + +## Related + +- [trim-left](https://github.com/sindresorhus/trim-left) - Similar to `String#trim()` but removes only whitespace on the left +- [trim-right](https://github.com/sindresorhus/trim-right) - Similar to `String#trim()` but removes only whitespace on the right. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/type-fest/base.d.ts b/node_modules/type-fest/base.d.ts new file mode 100644 index 000000000..99bebb001 --- /dev/null +++ b/node_modules/type-fest/base.d.ts @@ -0,0 +1,42 @@ +// Types that are compatible with all supported TypeScript versions. +// It's shared between all TypeScript version-specific definitions. + +// Basic +export * from './source/primitive'; +export * from './source/typed-array'; +export * from './source/basic'; +export * from './source/observable-like'; + +// Utilities +export {Except} from './source/except'; +export {Mutable} from './source/mutable'; +export {Merge} from './source/merge'; +export {MergeExclusive} from './source/merge-exclusive'; +export {RequireAtLeastOne} from './source/require-at-least-one'; +export {RequireExactlyOne} from './source/require-exactly-one'; +export {PartialDeep} from './source/partial-deep'; +export {ReadonlyDeep} from './source/readonly-deep'; +export {LiteralUnion} from './source/literal-union'; +export {Promisable} from './source/promisable'; +export {Opaque} from './source/opaque'; +export {SetOptional} from './source/set-optional'; +export {SetRequired} from './source/set-required'; +export {ValueOf} from './source/value-of'; +export {PromiseValue} from './source/promise-value'; +export {AsyncReturnType} from './source/async-return-type'; +export {ConditionalExcept} from './source/conditional-except'; +export {ConditionalKeys} from './source/conditional-keys'; +export {ConditionalPick} from './source/conditional-pick'; +export {UnionToIntersection} from './source/union-to-intersection'; +export {Stringified} from './source/stringified'; +export {FixedLengthArray} from './source/fixed-length-array'; +export {IterableElement} from './source/iterable-element'; +export {Entry} from './source/entry'; +export {Entries} from './source/entries'; +export {SetReturnType} from './source/set-return-type'; +export {Asyncify} from './source/asyncify'; +export {Simplify} from './source/simplify'; + +// Miscellaneous +export {PackageJson} from './source/package-json'; +export {TsConfigJson} from './source/tsconfig-json'; diff --git a/node_modules/type-fest/index.d.ts b/node_modules/type-fest/index.d.ts new file mode 100644 index 000000000..206261c21 --- /dev/null +++ b/node_modules/type-fest/index.d.ts @@ -0,0 +1,2 @@ +// These are all the basic types that's compatible with all supported TypeScript versions. +export * from './base'; diff --git a/node_modules/type-fest/license b/node_modules/type-fest/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/type-fest/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/type-fest/package.json b/node_modules/type-fest/package.json new file mode 100644 index 000000000..af4fe1432 --- /dev/null +++ b/node_modules/type-fest/package.json @@ -0,0 +1,58 @@ +{ + "name": "type-fest", + "version": "1.4.0", + "description": "A collection of essential TypeScript types", + "license": "(MIT OR CC0-1.0)", + "repository": "sindresorhus/type-fest", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && tsd && tsc" + }, + "files": [ + "index.d.ts", + "base.d.ts", + "source", + "ts41" + ], + "keywords": [ + "typescript", + "ts", + "types", + "utility", + "util", + "utilities", + "omit", + "merge", + "json" + ], + "devDependencies": { + "@sindresorhus/tsconfig": "~0.7.0", + "expect-type": "^0.11.0", + "tsd": "^0.14.0", + "typescript": "^4.1.3", + "xo": "^0.36.1" + }, + "types": "./index.d.ts", + "typesVersions": { + ">=4.1": { + "*": [ + "ts41/*" + ] + } + }, + "xo": { + "rules": { + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/indent": "off", + "node/no-unsupported-features/es-builtins": "off" + } + } +} diff --git a/node_modules/type-fest/readme.md b/node_modules/type-fest/readme.md new file mode 100644 index 000000000..32269262f --- /dev/null +++ b/node_modules/type-fest/readme.md @@ -0,0 +1,794 @@ + +
+
+ +[![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://giphy.com/gifs/illustration-rainbow-unicorn-26AHG5KGFxSkUWw1i) +[![npm dependents](https://badgen.net/npm/dependents/type-fest)](https://www.npmjs.com/package/type-fest?activeTab=dependents) +[![npm downloads](https://badgen.net/npm/dt/type-fest)](https://www.npmjs.com/package/type-fest) +[![Docs](https://paka.dev/badges/v0/cute.svg)](https://paka.dev/npm/type-fest) + +Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +Either add this package as a dependency or copy-paste the needed types. No credit required. 👌 + +PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first. + +## Install + +``` +$ npm install type-fest +``` + +*Requires TypeScript >=3.8* + +## Usage + +```ts +import {Except} from 'type-fest'; + +type Foo = { + unicorn: string; + rainbow: boolean; +}; + +type FooWithoutRainbow = Except; +//=> {unicorn: string} +``` + +## API + +Click the type names for complete docs. + +### Basic + +- [`Primitive`](source/primitive.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). +- [`Class`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +- [`TypedArray`](source/typed-array.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. +- [`JsonObject`](source/basic.d.ts) - Matches a JSON object. +- [`JsonArray`](source/basic.d.ts) - Matches a JSON array. +- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value. +- [`ObservableLike`](source/observable-like.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). + +### Utilities + +- [`Except`](source/except.d.ts) - Create a type from an object type without certain keys. This is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). +- [`Mutable`](source/mutable.d.ts) - Create a type that strips `readonly` from all or some of an object's keys. The inverse of `Readonly`. +- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type. +- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys. +- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys. +- [`RequireExactlyOne`](source/require-exactly-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more. +- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) if you only need one level deep. +- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) if you only need one level deep. +- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). +- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`. +- [`Opaque`](source/opaque.d.ts) - Create an [opaque type](https://codemix.com/opaque-types-in-javascript/). +- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional. +- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required. +- [`ValueOf`](source/value-of.d.ts) - Create a union of the given object's values, and optionally specify which keys to get the values from. +- [`PromiseValue`](source/promise-value.d.ts) - Returns the type that is wrapped inside a `Promise`. +- [`AsyncReturnType`](source/async-return-type.d.ts) - Unwrap the return type of a function that returns a `Promise`. +- [`ConditionalKeys`](source/conditional-keys.d.ts) - Extract keys from a shape where values extend the given `Condition` type. +- [`ConditionalPick`](source/conditional-pick.d.ts) - Like `Pick` except it selects properties from a shape where the values extend the given `Condition` type. +- [`ConditionalExcept`](source/conditional-except.d.ts) - Like `Omit` except it removes properties from a shape where the values extend the given `Condition` type. +- [`UnionToIntersection`](source/union-to-intersection.d.ts) - Convert a union type to an intersection type. +- [`Stringified`](source/stringified.d.ts) - Create a type with the keys of the given type changed to `string` type. +- [`FixedLengthArray`](source/fixed-length-array.d.ts) - Create a type that represents an array of the given type and length. +- [`IterableElement`](source/iterable-element.d.ts) - Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator. +- [`Entry`](source/entry.d.ts) - Create a type that represents the type of an entry of a collection. +- [`Entries`](source/entries.d.ts) - Create a type that represents the type of the entries of a collection. +- [`SetReturnType`](source/set-return-type.d.ts) - Create a function type with a return type of your choice and the same parameters as the given function type. +- [`Asyncify`](source/asyncify.d.ts) - Create an async version of the given function type. +- [`Includes`](ts41/includes.ts) - Returns a boolean for whether the given array includes the given item. +- [`Simplify`](source/simplify.d.ts) - Flatten the type output to improve type hints shown in editors. + +### Template literal types + +*Note:* These require [TypeScript 4.1 or newer](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#template-literal-types). + +- [`CamelCase`](ts41/camel-case.d.ts) – Convert a string literal to camel-case (`fooBar`). +- [`CamelCasedProperties`](ts41/camel-cased-properties.d.ts) – Convert object properties to camel-case (`fooBar`). +- [`CamelCasedPropertiesDeep`](ts41/camel-cased-properties-deep.d.ts) – Convert object properties to camel-case recursively (`fooBar`). +- [`KebabCase`](ts41/kebab-case.d.ts) – Convert a string literal to kebab-case (`foo-bar`). +- [`KebabCasedProperties`](ts41/kebab-cased-properties.d.ts) – Convert a object properties to kebab-case recursively (`foo-bar`). +- [`KebabCasedPropertiesDeep`](ts41/kebab-cased-properties-deep.d.ts) – Convert object properties to kebab-case (`foo-bar`). +- [`PascalCase`](ts41/pascal-case.d.ts) – Converts a string literal to pascal-case (`FooBar`) +- [`PascalCasedProperties`](ts41/pascal-cased-properties.d.ts) – Converts object properties to pascal-case (`FooBar`) +- [`PascalCasedPropertiesDeep`](ts41/pascal-cased-properties-deep.d.ts) – Converts object properties to pascal-case (`FooBar`) +- [`SnakeCase`](ts41/snake-case.d.ts) – Convert a string literal to snake-case (`foo_bar`). +- [`SnakeCasedProperties`](ts41/snake-cased-properties-deep.d.ts) – Convert object properties to snake-case (`foo_bar`). +- [`SnakeCasedPropertiesDeep`](ts41/snake-cased-properties-deep.d.ts) – Convert object properties to snake-case recursively (`foo_bar`). +- [`ScreamingSnakeCase`](ts41/screaming-snake-case.d.ts) - Convert a string literal to screaming-snake-case (`FOO_BAR`). +- [`DelimiterCase`](ts41/delimiter-case.d.ts) – Convert a string literal to a custom string delimiter casing. +- [`DelimiterCasedProperties`](ts41/delimiter-cased-properties.d.ts) – Convert object properties to a custom string delimiter casing. +- [`DelimiterCasedPropertiesDeep`](ts41/delimiter-cased-properties-deep.d.ts) – Convert object properties to a custom string delimiter casing recursively. +- [`Split`](ts41/split.d.ts) - Represents an array of strings split using a given character or character set. +- [`Trim`](ts41/trim.d.ts) - Remove leading and trailing spaces from a string. +- [`Get`](ts41/get.d.ts) - Get a deeply-nested property from an object using a key path, like [Lodash's `.get()`](https://lodash.com/docs/latest#get) function. +- [`LastArrayElement`](ts41/last-array-element.d.ts) - Extracts the type of the last element of an array. + +### Miscellaneous + +- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). +- [`TsConfigJson`](source/tsconfig-json.d.ts) - Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 4.4). + +## Declined types + +*If we decline a type addition, we will make sure to document the better solution here.* + +- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The PR author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider. +- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary` vs `Record`) from [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now. +- [`ExtractProperties` and `ExtractMethods`](https://github.com/sindresorhus/type-fest/pull/4) - The types violate the single responsibility principle. Instead, refine your types into more granular type hierarchies. + +## Tips + +### Related + +- [typed-query-selector](https://github.com/g-plane/typed-query-selector) - Enhances `document.querySelector` and `document.querySelectorAll` with a template literal type that matches element types returned from an HTML element query selector. + +### Built-in types + +There are many advanced types most users don't know about. + +- [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) - Make all properties in `T` optional. +
+ + Example + + + [Playground](https://www.typescriptlang.org/play/#code/JYOwLgpgTgZghgYwgAgHIHsAmEDC6QzADmyA3gLABQyycADnanALYQBcyAzmFKEQNxUaddFDAcQAV2YAjaIMoBfKlQQAbOJ05osEAIIMAQpOBrsUMkOR1eANziRkCfISKSoD4Pg4ZseAsTIALyW1DS0DEysHADkvvoMMQA0VsKi4sgAzAAMuVaKClY2wPaOknSYDrguADwA0sgQAB6QIJjaANYQAJ7oMDp+LsQAfAAUXd0cdUnI9mo+uv6uANp1ALoAlKHhyGAAFsCcAHTOAW4eYF4gyxNrwbNwago0ypRWp66jH8QcAApwYmAjxq8SWIy2FDCNDA3ToKFBQyIdR69wmfQG1TOhShyBgomQX3w3GQE2Q6IA8jIAFYQBBgI4TTiEs5bTQYsFInrLTbbHZOIlgZDlSqQABqj0kKBC3yINx6a2xfOQwH6o2FVXFaklwSCIUkbQghBAEEwENSfNOlykEGefNe5uhB2O6sgS3GPRmLogmslG1tLxUOKgEDA7hAuydtteryAA) + + ```ts + interface NodeConfig { + appName: string; + port: number; + } + + class NodeAppBuilder { + private configuration: NodeConfig = { + appName: 'NodeApp', + port: 3000 + }; + + private updateConfig(key: Key, value: NodeConfig[Key]) { + this.configuration[key] = value; + } + + config(config: Partial) { + type NodeConfigKey = keyof NodeConfig; + + for (const key of Object.keys(config) as NodeConfigKey[]) { + const updateValue = config[key]; + + if (updateValue === undefined) { + continue; + } + + this.updateConfig(key, updateValue); + } + + return this; + } + } + + // `Partial`` allows us to provide only a part of the + // NodeConfig interface. + new NodeAppBuilder().config({appName: 'ToDoApp'}); + ``` +
+ +- [`Required`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1408-L1413) - Make all properties in `T` required. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-AFzADOUckA5gNxUaIYjA4ckvGG07c+g6gF8KQkAgCuEFFDA5O6gEbEwUbLm2ESwABQIixACJIoSdgCUYAR3Vg4MACYAPGYuFvYAfACU5Ko0APRxwADKMBD+wFAAFuh2Vv7OSBlYGdmc8ABu8LHKsRyGxqY4oQT21pTCIHQMjOwA5DAAHgACxAAOjDAAdChYxL0ANLHUouKSMH0AEmAAhJhY6ozpAJ77GTCMjMCiV0ToSAb7UJPPC9WRgrEJwAAqR6MwSRQPFGUFocDgRHYxnEfGAowh-zgUCOwF6KwkUl6tXqJhCeEsxDaS1AXSYfUGI3GUxmc0WSneQA) + + ```ts + interface ContactForm { + email?: string; + message?: string; + } + + function submitContactForm(formData: Required) { + // Send the form data to the server. + } + + submitContactForm({ + email: 'ex@mple.com', + message: 'Hi! Could you tell me more about…', + }); + + // TypeScript error: missing property 'message' + submitContactForm({ + email: 'ex@mple.com', + }); + ``` +
+ +- [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) - Make all properties in `T` readonly. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+RWIcA5JSC+kWdCepQ+v3RYCU3RInzRMCGwlpC19NYBW1Ye08R1AA) + + ```ts + enum LogLevel { + Off, + Debug, + Error, + Fatal + }; + + interface LoggerConfig { + name: string; + level: LogLevel; + } + + class Logger { + config: Readonly; + + constructor({name, level}: LoggerConfig) { + this.config = {name, level}; + Object.freeze(this.config); + } + } + + const config: LoggerConfig = { + name: 'MyApp', + level: LogLevel.Debug + }; + + const logger = new Logger(config); + + // TypeScript Error: cannot assign to read-only property. + logger.config.level = LogLevel.Error; + + // We are able to edit config variable as we please. + config.level = LogLevel.Error; + ``` +
+ +- [`Pick`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1422-L1427) - From `T`, pick a set of properties whose keys are in the union `K`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+wfbcAGsAHi3kgBpgEtGy4AAfG54BWfqAPnZm4AAlZUj4MAkMA8GAGB4vEgfMlLLw6CwPBA8PYRmMgZVgAC6CgmI4cIommQELwICh8RBgKZKvALh1ur0bHQABR5PYMui0Wk7em2ADaAF0AJS0AASABUALIAGQAogR+Mp3CROCAFBBwVC2ikBpj5CgBIqGjizLA5TAFdAmalImAuqlBRoVQh5HBgEy1eDWfs7J5cjzGYKhroVfpDEhHM4MV6GRR5NN0JrtnRg6BVirTFBeHAKYmYY6QNpdB73LmCJZBlSAXAubtvczeSmQMNSuMbmKNgBlHFgPEUNwusBIPAAQlS1xetTmxT0SDoESgdD0C4aACtHMwxytLrohawgA) + + ```ts + interface Article { + title: string; + thumbnail: string; + content: string; + } + + // Creates new type out of the `Article` interface composed + // from the Articles' two properties: `title` and `thumbnail`. + // `ArticlePreview = {title: string; thumbnail: string}` + type ArticlePreview = Pick; + + // Render a list of articles using only title and description. + function renderArticlePreviews(previews: ArticlePreview[]): HTMLElement { + const articles = document.createElement('div'); + + for (const preview of previews) { + // Append preview to the articles. + } + + return articles; + } + + const articles = renderArticlePreviews([ + { + title: 'TypeScript tutorial!', + thumbnail: '/assets/ts.jpg' + } + ]); + ``` +
+ +- [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434) - Construct a type with a set of properties `K` of type `T`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA) + + ```ts + // Positions of employees in our company. + type MemberPosition = 'intern' | 'developer' | 'tech-lead'; + + // Interface describing properties of a single employee. + interface Employee { + firstName: string; + lastName: string; + yearsOfExperience: number; + } + + // Create an object that has all possible `MemberPosition` values set as keys. + // Those keys will store a collection of Employees of the same position. + const team: Record = { + intern: [], + developer: [], + 'tech-lead': [], + }; + + // Our team has decided to help John with his dream of becoming Software Developer. + team.intern.push({ + firstName: 'John', + lastName: 'Doe', + yearsOfExperience: 0 + }); + + // `Record` forces you to initialize all of the property keys. + // TypeScript Error: "tech-lead" property is missing + const teamEmpty: Record = { + intern: null, + developer: null, + }; + ``` +
+ +- [`Exclude`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1436-L1439) - Exclude from `T` those types that are assignable to `U`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+QRBhZhYJaAKAOkjogEkQZAQ4X2QAdwALCFbaemRgXmQtFjhOMFwq9K6ULuB0lk6U+HYwZAxJnQaYFhAEMGB8ZCIIMAAFOjAANR2IK0HGWISklIAedCgsKDwCYgAbQA5M9gQBdVzFQJ+JhiSRQMiUYYwayZCC4VHPCzmSzAspCYEBWxgFhQAZwKC+FpgJ43VwARgADH4ZFQSWSBjcZPJyPtDsdTvxKWBvr8rD1DCZoJ5HPopaYoK4EPhCEQmGKcKriLCtrhgEYkVQVT5Nr4fmZLLZtMBbFZgT0wGBqES6ghbHBIJqoBKFdBWQpjfh+DQbhY2tqiHVsbjLMVkAB+ZAAZiZaeQTHOVxu9ySjxNaujNwDVHNvzqbBGkBAdPoAfkQA) + + ```ts + interface ServerConfig { + port: null | string | number; + } + + type RequestHandler = (request: Request, response: Response) => void; + + // Exclude `null` type from `null | string | number`. + // In case the port is equal to `null`, we will use default value. + function getPortValue(port: Exclude): number { + if (typeof port === 'string') { + return parseInt(port, 10); + } + + return port; + } + + function startServer(handler: RequestHandler, config: ServerConfig): void { + const server = require('http').createServer(handler); + + const port = config.port === null ? 3000 : getPortValue(config.port); + server.listen(port); + } + ``` +
+ +- [`Extract`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1441-L1444) - Extract from `T` those types that are assignable to `U`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+BxEeAAHY1NgKAwoIKy0grr4DByEUpgccpgMaXgAaxBerCzi+B9-ZulygDouFHRsU1z8kKMYE1RhaqgAHkt4AHkWACt4EAAPbVRgLLWNgBp9gGlBs8uQa6yAUUuYPQwdgNpKM7nh7mMML4CgA+R5WABqUAgpDeVxuhxO1he0jsXGh8EoOBO9COx3BQPo2PBADckaR6IjkSA6PBqTgsMBzPsicdrEC7OJWXSQNwYvFEgAVTS9JLXODpeDpKBZFg4GCoWa8VACIJykAKiQWKy2YQOAioYikCg0OEMDyhRSy4DyxS24KhAAMjyi6gS8AAwjh5OD0iBFHAkJoEOksC1mnkMJq8gUQKDNttKPlnfrwYp3J5XfBHXqoKpfYkAOI4ansTxaeDADmoRSCCBYAbxhC6TDx6rwYHIRX5bScjA4bLJwoDmDwDkfbA9JMrVMVdM1TN69LgkTgwgkchUahqIA) + + ```ts + declare function uniqueId(): number; + + const ID = Symbol('ID'); + + interface Person { + [ID]: number; + name: string; + age: number; + } + + // Allows changing the person data as long as the property key is of string type. + function changePersonData< + Obj extends Person, + Key extends Extract, + Value extends Obj[Key] + > (obj: Obj, key: Key, value: Value): void { + obj[key] = value; + } + + // Tiny Andrew was born. + const andrew = { + [ID]: uniqueId(), + name: 'Andrew', + age: 0, + }; + + // Cool, we're fine with that. + changePersonData(andrew, 'name', 'Pony'); + + // Goverment didn't like the fact that you wanted to change your identity. + changePersonData(andrew, ID, uniqueId()); + ``` +
+ +- [`NonNullable`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1446-L1449) - Exclude `null` and `undefined` from `T`. +
+ + Example + + Works with strictNullChecks set to true. (Read more here) + + [Playground](https://typescript-play.js.org/?target=6#code/C4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA) + + ```ts + type PortNumber = string | number | null; + + /** Part of a class definition that is used to build a server */ + class ServerBuilder { + portNumber!: NonNullable; + + port(this: ServerBuilder, port: PortNumber): ServerBuilder { + if (port == null) { + this.portNumber = 8000; + } else { + this.portNumber = port; + } + + return this; + } + } + + const serverBuilder = new ServerBuilder(); + + serverBuilder + .port('8000') // portNumber = '8000' + .port(null) // portNumber = 8000 + .port(3000); // portNumber = 3000 + + // TypeScript error + serverBuilder.portNumber = null; + ``` +
+ +- [`Parameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1451-L1454) - Obtain the parameters of a function type in a tuple. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/GYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeygJmThgOYgcGFYcbhqApCJsyhtpWXcR1cnEePBoeDAABVPzgbTixFeFd8uEsClADcIxGiygIFkSEOT3SmTc2VydQeRx+ZxwF2QQ34gkEwDgsnSuFmMBKiAADEDjIhYk1Qm0OlSYABqZnYka4xA1DJZHJYkGc7yCbyeRA+CAIZCzNAYbA4CIAdxg2zJwVCkWirjwMswuEaACYmCCgA) + + ```ts + function shuffle(input: any[]): void { + // Mutate array randomly changing its' elements indexes. + } + + function callNTimes any> (func: Fn, callCount: number) { + // Type that represents the type of the received function parameters. + type FunctionParameters = Parameters; + + return function (...args: FunctionParameters) { + for (let i = 0; i < callCount; i++) { + func(...args); + } + } + } + + const shuffleTwice = callNTimes(shuffle, 2); + ``` +
+ +- [`ConstructorParameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1456-L1459) - Obtain the parameters of a constructor function type in a tuple. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECCBOAXAlqApgWQPYBM0mgG8AoaaFRENALmgkXmQDsBzAblOmCycTV4D8teo1YdO3JiICuwRFngAKClWENmLAJRFOZRAAtkEAHQq00ALzlklNBzIBfYk+KhIMAJJTEYJsDQAwmDA+mgAPAAq0GgAHnxMODCKTGgA7tCKxllg8CwQtL4AngDaALraFgB80EWa1SRkAA6MAG5gfNAB4FABPDJyCrQR9tDNyG0dwMGhtBhgjWEiGgA00F70vv4RhY3hEZXVVinpc42KmuJkkv3y8Bly8EPaDWTkhiZd7r3e8LK3llwGCMXGQWGhEOsfH5zJlsrl8p0+gw-goAAo5MAAW3BaHgEEilU0tEhmzQ212BJ0ry4SOg+kg+gBBiMximIGA0nAfAQLGk2N4EAAEgzYcYcnkLsRdDTvNEYkYUKwSdCme9WdM0MYwYhFPSIPpJdTkAAzDKxBUaZX+aAAQgsVmkCTQxuYaBw2ng4Ok8CYcotSu8pMur09iG9vuObxZnx6SN+AyUWTF8MN0CcZE4Ywm5jZHK5aB5fP4iCFIqT4oRRTKRLo6lYVNeAHpG50wOzOe1zHr9NLQ+HoABybsD4HOKXXRA1JCoKhBELmI5pNaB6Fz0KKBAodDYPAgSUTmqYsAALx4m5nC6nW9nGq14KtaEUA9gR9PvuNCjQ9BgACNvcwNBtAcLiAA) + + ```ts + class ArticleModel { + title: string; + content?: string; + + constructor(title: string) { + this.title = title; + } + } + + class InstanceCache any)> { + private ClassConstructor: T; + private cache: Map> = new Map(); + + constructor (ctr: T) { + this.ClassConstructor = ctr; + } + + getInstance (...args: ConstructorParameters): InstanceType { + const hash = this.calculateArgumentsHash(...args); + + const existingInstance = this.cache.get(hash); + if (existingInstance !== undefined) { + return existingInstance; + } + + return new this.ClassConstructor(...args); + } + + private calculateArgumentsHash(...args: any[]): string { + // Calculate hash. + return 'hash'; + } + } + + const articleCache = new InstanceCache(ArticleModel); + const amazonArticle = articleCache.getInstance('Amazon forests burining!'); + ``` +
+ +- [`ReturnType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1461-L1464) – Obtain the return type of a function type. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) + + ```ts + /** Provides every element of the iterable `iter` into the `callback` function and stores the results in an array. */ + function mapIter< + Elem, + Func extends (elem: Elem) => any, + Ret extends ReturnType + >(iter: Iterable, callback: Func): Ret[] { + const mapped: Ret[] = []; + + for (const elem of iter) { + mapped.push(callback(elem)); + } + + return mapped; + } + + const setObject: Set = new Set(); + const mapObject: Map = new Map(); + + mapIter(setObject, (value: string) => value.indexOf('Foo')); // number[] + + mapIter(mapObject, ([key, value]: [number, string]) => { + return key % 2 === 0 ? value : 'Odd'; + }); // string[] + ``` +
+ +- [`InstanceType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1466-L1469) – Obtain the instance type of a constructor function type. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) + + ```ts + class IdleService { + doNothing (): void {} + } + + class News { + title: string; + content: string; + + constructor(title: string, content: string) { + this.title = title; + this.content = content; + } + } + + const instanceCounter: Map = new Map(); + + interface Constructor { + new(...args: any[]): any; + } + + // Keep track how many instances of `Constr` constructor have been created. + function getInstance< + Constr extends Constructor, + Args extends ConstructorParameters + >(constructor: Constr, ...args: Args): InstanceType { + let count = instanceCounter.get(constructor) || 0; + + const instance = new constructor(...args); + + instanceCounter.set(constructor, count + 1); + + console.log(`Created ${count + 1} instances of ${Constr.name} class`); + + return instance; + } + + + const idleService = getInstance(IdleService); + // Will log: `Created 1 instances of IdleService class` + const newsEntry = getInstance(News, 'New ECMAScript proposals!', 'Last month...'); + // Will log: `Created 1 instances of News class` + ``` +
+ +- [`Omit`](https://github.com/microsoft/TypeScript/blob/71af02f7459dc812e85ac31365bfe23daf14b4e4/src/lib/es5.d.ts#L1446) – Constructs a type by picking all properties from T and then removing K. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgIImAWzgG2QbwChlks4BzCAVShwC5kBnMKUcgbmKYAcIFgIjBs1YgOXMpSFMWbANoBdTiW5woFddwAW0kfKWEAvoUIB6U8gDCUCHEiNkICAHdkYAJ69kz4GC3JcPG4oAHteKDABBxCYNAxsPFBIWEQUCAAPJG4wZABySUFcgJAAEzMLXNV1ck0dIuCw6EjBADpy5AB1FAQ4EGQAV0YUP2AHDy8wEOQbUugmBLwtEIA3OcmQnEjuZBgQqE7gAGtgZAhwKHdkHFGwNvGUdDIcAGUliIBJEF3kAF5kAHlML4ADyPBIAGjyBUYRQAPnkqho4NoYQA+TiEGD9EAISIhPozErQMG4AASK2gn2+AApek9pCSXm8wFSQooAJQMUkAFQAsgAZACiOAgmDOOSIJAQ+OYyGl4DgoDmf2QJRCCH6YvALQQNjsEGFovF1NyJWAy1y7OUyHMyE+yRAuFImG4Iq1YDswHxbRINjA-SgfXlHqVUE4xiAA) + + ```ts + interface Animal { + imageUrl: string; + species: string; + images: string[]; + paragraphs: string[]; + } + + // Creates new type with all properties of the `Animal` interface + // except 'images' and 'paragraphs' properties. We can use this + // type to render small hover tooltip for a wiki entry list. + type AnimalShortInfo = Omit; + + function renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement { + const container = document.createElement('div'); + // Internal implementation. + return container; + } + ``` +
+ +- [`Uppercase`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#template-literal-types) - Transforms every character in a string into uppercase. +
+ + Example + + + ```ts + type T = Uppercase<'hello'>; // 'HELLO' + + type T2 = Uppercase<'foo' | 'bar'>; // 'FOO' | 'BAR' + + type T3 = Uppercase<`aB${S}`>; + type T4 = T30<'xYz'>; // 'ABXYZ' + + type T5 = Uppercase; // string + type T6 = Uppercase; // any + type T7 = Uppercase; // never + type T8 = Uppercase<42>; // Error, type 'number' does not satisfy the constraint 'string' + ``` +
+ +- [`Lowercase`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#template-literal-types) - Transforms every character in a string into lowercase. +
+ + Example + + + ```ts + type T = Lowercase<'HELLO'>; // 'hello' + + type T2 = Lowercase<'FOO' | 'BAR'>; // 'foo' | 'bar' + + type T3 = Lowercase<`aB${S}`>; + type T4 = T32<'xYz'>; // 'abxyz' + + type T5 = Lowercase; // string + type T6 = Lowercase; // any + type T7 = Lowercase; // never + type T8 = Lowercase<42>; // Error, type 'number' does not satisfy the constraint 'string' + ``` +
+ +- [`Capitalize`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#template-literal-types) - Transforms the first character in a string into uppercase. +
+ + Example + + + ```ts + type T = Capitalize<'hello'>; // 'Hello' + + type T2 = Capitalize<'foo' | 'bar'>; // 'Foo' | 'Bar' + + type T3 = Capitalize<`aB${S}`>; + type T4 = T32<'xYz'>; // 'ABxYz' + + type T5 = Capitalize; // string + type T6 = Capitalize; // any + type T7 = Capitalize; // never + type T8 = Capitalize<42>; // Error, type 'number' does not satisfy the constraint 'string' + ``` +
+ +- [`Uncapitalize`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#template-literal-types) - Transforms the first character in a string into lowercase. +
+ + Example + + + ```ts + type T = Uncapitalize<'Hello'>; // 'hello' + + type T2 = Uncapitalize<'Foo' | 'Bar'>; // 'foo' | 'bar' + + type T3 = Uncapitalize<`AB${S}`>; + type T4 = T30<'xYz'>; // 'aBxYz' + + type T5 = Uncapitalize; // string + type T6 = Uncapitalize; // any + type T7 = Uncapitalize; // never + type T8 = Uncapitalize<42>; // Error, type 'number' does not satisfy the constraint 'string' + ``` +
+ +You can find some examples in the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/advanced-types.html#predefined-conditional-types). + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Jarek Radosz](https://github.com/CvX) +- [Dimitri Benin](https://github.com/BendingBender) +- [Pelle Wessman](https://github.com/voxpelli) + +## License + +(MIT OR CC0-1.0) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/type-fest/source/async-return-type.d.ts b/node_modules/type-fest/source/async-return-type.d.ts new file mode 100644 index 000000000..1f2c46aaa --- /dev/null +++ b/node_modules/type-fest/source/async-return-type.d.ts @@ -0,0 +1,25 @@ +import {PromiseValue} from './promise-value'; + +type AsyncFunction = (...args: any[]) => Promise; + +/** +Unwrap the return type of a function that returns a `Promise`. + +There has been [discussion](https://github.com/microsoft/TypeScript/pull/35998) about implementing this type in TypeScript. + +@example +```ts +import {AsyncReturnType} from 'type-fest'; +import {asyncFunction} from 'api'; + +// This type resolves to the unwrapped return type of `asyncFunction`. +type Value = AsyncReturnType; + +async function doSomething(value: Value) {} + +asyncFunction().then(value => doSomething(value)); +``` + +@category Utilities +*/ +export type AsyncReturnType = PromiseValue>; diff --git a/node_modules/type-fest/source/asyncify.d.ts b/node_modules/type-fest/source/asyncify.d.ts new file mode 100644 index 000000000..e88d99053 --- /dev/null +++ b/node_modules/type-fest/source/asyncify.d.ts @@ -0,0 +1,33 @@ +import {PromiseValue} from './promise-value'; +import {SetReturnType} from './set-return-type'; + +/** +Create an async version of the given function type, by boxing the return type in `Promise` while keeping the same parameter types. + +Use-case: You have two functions, one synchronous and one asynchronous that do the same thing. Instead of having to duplicate the type definition, you can use `Asyncify` to reuse the synchronous type. + +@example +``` +import {Asyncify} from 'type-fest'; + +// Synchronous function. +function getFooSync(someArg: SomeType): Foo { + // … +} + +type AsyncifiedFooGetter = Asyncify; +//=> type AsyncifiedFooGetter = (someArg: SomeType) => Promise; + +// Same as `getFooSync` but asynchronous. +const getFooAsync: AsyncifiedFooGetter = (someArg) => { + // TypeScript now knows that `someArg` is `SomeType` automatically. + // It also knows that this function must return `Promise`. + // If you have `@typescript-eslint/promise-function-async` linter rule enabled, it will even report that "Functions that return promises must be async.". + + // … +} +``` + +@category Utilities +*/ +export type Asyncify any> = SetReturnType>>>; diff --git a/node_modules/type-fest/source/basic.d.ts b/node_modules/type-fest/source/basic.d.ts new file mode 100644 index 000000000..322aa0ad9 --- /dev/null +++ b/node_modules/type-fest/source/basic.d.ts @@ -0,0 +1,32 @@ +// TODO: Remove the `= unknown` sometime in the future when most users are on TS 3.5 as it's now the default +/** +Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). + +@category Basic +*/ +export type Class = new(...arguments_: Arguments) => T; + +/** +Matches a JSON object. + +This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`. + +@category Basic +*/ +export type JsonObject = {[Key in string]?: JsonValue}; + +/** +Matches a JSON array. + +@category Basic +*/ +export interface JsonArray extends Array {} +// TODO: Make it this when targeting TypeScript 4.1: +// export type JsonArray = JsonValue[]; + +/** +Matches any valid JSON value. + +@category Basic +*/ +export type JsonValue = string | number | boolean | null | JsonObject | JsonArray; diff --git a/node_modules/type-fest/source/conditional-except.d.ts b/node_modules/type-fest/source/conditional-except.d.ts new file mode 100644 index 000000000..79295aea8 --- /dev/null +++ b/node_modules/type-fest/source/conditional-except.d.ts @@ -0,0 +1,45 @@ +import {Except} from './except'; +import {ConditionalKeys} from './conditional-keys'; + +/** +Exclude keys from a shape that matches the given `Condition`. + +This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties. + +@example +``` +import {Primitive, ConditionalExcept} from 'type-fest'; + +class Awesome { + name: string; + successes: number; + failures: bigint; + + run() {} +} + +type ExceptPrimitivesFromAwesome = ConditionalExcept; +//=> {run: () => void} +``` + +@example +``` +import {ConditionalExcept} from 'type-fest'; + +interface Example { + a: string; + b: string | number; + c: () => void; + d: {}; +} + +type NonStringKeysOnly = ConditionalExcept; +//=> {b: string | number; c: () => void; d: {}} +``` + +@category Utilities +*/ +export type ConditionalExcept = Except< + Base, + ConditionalKeys +>; diff --git a/node_modules/type-fest/source/conditional-keys.d.ts b/node_modules/type-fest/source/conditional-keys.d.ts new file mode 100644 index 000000000..a422fd83a --- /dev/null +++ b/node_modules/type-fest/source/conditional-keys.d.ts @@ -0,0 +1,45 @@ +/** +Extract the keys from a type where the value type of the key extends the given `Condition`. + +Internally this is used for the `ConditionalPick` and `ConditionalExcept` types. + +@example +``` +import {ConditionalKeys} from 'type-fest'; + +interface Example { + a: string; + b: string | number; + c?: string; + d: {}; +} + +type StringKeysOnly = ConditionalKeys; +//=> 'a' +``` + +To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below. + +@example +``` +type StringKeysAndUndefined = ConditionalKeys; +//=> 'a' | 'c' +``` + +@category Utilities +*/ +export type ConditionalKeys = NonNullable< + // Wrap in `NonNullable` to strip away the `undefined` type from the produced union. + { + // Map through all the keys of the given base type. + [Key in keyof Base]: + // Pick only keys with types extending the given `Condition` type. + Base[Key] extends Condition + // Retain this key since the condition passes. + ? Key + // Discard this key since the condition fails. + : never; + + // Convert the produced object into a union type of the keys which passed the conditional test. + }[keyof Base] +>; diff --git a/node_modules/type-fest/source/conditional-pick.d.ts b/node_modules/type-fest/source/conditional-pick.d.ts new file mode 100644 index 000000000..5e1472a2e --- /dev/null +++ b/node_modules/type-fest/source/conditional-pick.d.ts @@ -0,0 +1,44 @@ +import {ConditionalKeys} from './conditional-keys'; + +/** +Pick keys from the shape that matches the given `Condition`. + +This is useful when you want to create a new type from a specific subset of an existing type. For example, you might want to pick all the primitive properties from a class and form a new automatically derived type. + +@example +``` +import {Primitive, ConditionalPick} from 'type-fest'; + +class Awesome { + name: string; + successes: number; + failures: bigint; + + run() {} +} + +type PickPrimitivesFromAwesome = ConditionalPick; +//=> {name: string; successes: number; failures: bigint} +``` + +@example +``` +import {ConditionalPick} from 'type-fest'; + +interface Example { + a: string; + b: string | number; + c: () => void; + d: {}; +} + +type StringKeysOnly = ConditionalPick; +//=> {a: string} +``` + +@category Utilities +*/ +export type ConditionalPick = Pick< + Base, + ConditionalKeys +>; diff --git a/node_modules/type-fest/source/entries.d.ts b/node_modules/type-fest/source/entries.d.ts new file mode 100644 index 000000000..a48fa1e03 --- /dev/null +++ b/node_modules/type-fest/source/entries.d.ts @@ -0,0 +1,59 @@ +import {ArrayEntry, MapEntry, ObjectEntry, SetEntry} from './entry'; + +type ArrayEntries = Array>; +type MapEntries = Array>; +type ObjectEntries = Array>; +type SetEntries> = Array>; + +/** +Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entries` type will return the type of that collection's entries. + +For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable. + +@see `Entry` if you want to just access the type of a single entry. + +@example +``` +import {Entries} from 'type-fest'; + +interface Example { + someKey: number; +} + +const manipulatesEntries = (examples: Entries) => examples.map(example => [ + // Does some arbitrary processing on the key (with type information available) + example[0].toUpperCase(), + + // Does some arbitrary processing on the value (with type information available) + example[1].toFixed() +]); + +const example: Example = {someKey: 1}; +const entries = Object.entries(example) as Entries; +const output = manipulatesEntries(entries); + +// Objects +const objectExample = {a: 1}; +const objectEntries: Entries = [['a', 1]]; + +// Arrays +const arrayExample = ['a', 1]; +const arrayEntries: Entries = [[0, 'a'], [1, 1]]; + +// Maps +const mapExample = new Map([['a', 1]]); +const mapEntries: Entries = [['a', 1]]; + +// Sets +const setExample = new Set(['a', 1]); +const setEntries: Entries = [['a', 'a'], [1, 1]]; +``` + +@category Utilities +*/ +export type Entries = + BaseType extends Map ? MapEntries + : BaseType extends Set ? SetEntries + : BaseType extends unknown[] ? ArrayEntries + : BaseType extends object ? ObjectEntries + : never; diff --git a/node_modules/type-fest/source/entry.d.ts b/node_modules/type-fest/source/entry.d.ts new file mode 100644 index 000000000..869e51e62 --- /dev/null +++ b/node_modules/type-fest/source/entry.d.ts @@ -0,0 +1,62 @@ +type MapKey = BaseType extends Map ? KeyType : never; +type MapValue = BaseType extends Map ? ValueType : never; + +export type ArrayEntry = [number, BaseType[number]]; +export type MapEntry = [MapKey, MapValue]; +export type ObjectEntry = [keyof BaseType, BaseType[keyof BaseType]]; +export type SetEntry = BaseType extends Set ? [ItemType, ItemType] : never; + +/** +Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entry` type will return the type of that collection's entry. + +For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable. + +@see `Entries` if you want to just access the type of the array of entries (which is the return of the `.entries()` method). + +@example +``` +import {Entry} from 'type-fest'; + +interface Example { + someKey: number; +} + +const manipulatesEntry = (example: Entry) => [ + // Does some arbitrary processing on the key (with type information available) + example[0].toUpperCase(), + + // Does some arbitrary processing on the value (with type information available) + example[1].toFixed(), +]; + +const example: Example = {someKey: 1}; +const entry = Object.entries(example)[0] as Entry; +const output = manipulatesEntry(entry); + +// Objects +const objectExample = {a: 1}; +const objectEntry: Entry = ['a', 1]; + +// Arrays +const arrayExample = ['a', 1]; +const arrayEntryString: Entry = [0, 'a']; +const arrayEntryNumber: Entry = [1, 1]; + +// Maps +const mapExample = new Map([['a', 1]]); +const mapEntry: Entry = ['a', 1]; + +// Sets +const setExample = new Set(['a', 1]); +const setEntryString: Entry = ['a', 'a']; +const setEntryNumber: Entry = [1, 1]; +``` + +@category Utilities +*/ +export type Entry = + BaseType extends Map ? MapEntry + : BaseType extends Set ? SetEntry + : BaseType extends unknown[] ? ArrayEntry + : BaseType extends object ? ObjectEntry + : never; diff --git a/node_modules/type-fest/source/except.d.ts b/node_modules/type-fest/source/except.d.ts new file mode 100644 index 000000000..ad542580c --- /dev/null +++ b/node_modules/type-fest/source/except.d.ts @@ -0,0 +1,24 @@ +/** +Create a type from an object type without certain keys. + +This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically. + +This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)). + +@example +``` +import {Except} from 'type-fest'; + +type Foo = { + a: number; + b: string; + c: boolean; +}; + +type FooWithoutA = Except; +//=> {b: string}; +``` + +@category Utilities +*/ +export type Except = Pick>; diff --git a/node_modules/type-fest/source/fixed-length-array.d.ts b/node_modules/type-fest/source/fixed-length-array.d.ts new file mode 100644 index 000000000..e7711e479 --- /dev/null +++ b/node_modules/type-fest/source/fixed-length-array.d.ts @@ -0,0 +1,40 @@ +/** +Methods to exclude. +*/ +type ArrayLengthMutationKeys = 'splice' | 'push' | 'pop' | 'shift' | 'unshift'; + +/** +Create a type that represents an array of the given type and length. The array's length and the `Array` prototype methods that manipulate its length are excluded in the resulting type. + +Please participate in [this issue](https://github.com/microsoft/TypeScript/issues/26223) if you want to have a similiar type built into TypeScript. + +Use-cases: +- Declaring fixed-length tuples or arrays with a large number of items. +- Creating a range union (for example, `0 | 1 | 2 | 3 | 4` from the keys of such a type) without having to resort to recursive types. +- Creating an array of coordinates with a static length, for example, length of 3 for a 3D vector. + +@example +``` +import {FixedLengthArray} from 'type-fest'; + +type FencingTeam = FixedLengthArray; + +const guestFencingTeam: FencingTeam = ['Josh', 'Michael', 'Robert']; + +const homeFencingTeam: FencingTeam = ['George', 'John']; +//=> error TS2322: Type string[] is not assignable to type 'FencingTeam' + +guestFencingTeam.push('Sam'); +//=> error TS2339: Property 'push' does not exist on type 'FencingTeam' +``` + +@category Utilities +*/ +export type FixedLengthArray = Pick< + ArrayPrototype, + Exclude +> & { + [index: number]: Element; + [Symbol.iterator]: () => IterableIterator; + readonly length: Length; +}; diff --git a/node_modules/type-fest/source/iterable-element.d.ts b/node_modules/type-fest/source/iterable-element.d.ts new file mode 100644 index 000000000..f53a3f5d0 --- /dev/null +++ b/node_modules/type-fest/source/iterable-element.d.ts @@ -0,0 +1,48 @@ +/** +Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator. + +This can be useful, for example, if you want to get the type that is yielded in a generator function. Often the return type of those functions are not specified. + +This type works with both `Iterable`s and `AsyncIterable`s, so it can be use with synchronous and asynchronous generators. + +Here is an example of `IterableElement` in action with a generator function: + +@example +``` +function * iAmGenerator() { + yield 1; + yield 2; +} + +type MeNumber = IterableElement> +``` + +And here is an example with an async generator: + +@example +``` +async function * iAmGeneratorAsync() { + yield 'hi'; + yield true; +} + +type MeStringOrBoolean = IterableElement> +``` + +Many types in JavaScript/TypeScript are iterables. This type works on all types that implement those interfaces. For example, `Array`, `Set`, `Map`, `stream.Readable`, etc. + +An example with an array of strings: + +@example +``` +type MeString = IterableElement +``` + +@category Utilities +*/ +export type IterableElement = + TargetIterable extends Iterable ? + ElementType : + TargetIterable extends AsyncIterable ? + ElementType : + never; diff --git a/node_modules/type-fest/source/literal-union.d.ts b/node_modules/type-fest/source/literal-union.d.ts new file mode 100644 index 000000000..3544bf66c --- /dev/null +++ b/node_modules/type-fest/source/literal-union.d.ts @@ -0,0 +1,35 @@ +import {Primitive} from './primitive'; + +/** +Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. + +Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals. + +This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore. + +@example +``` +import {LiteralUnion} from 'type-fest'; + +// Before + +type Pet = 'dog' | 'cat' | string; + +const pet: Pet = ''; +// Start typing in your TypeScript-enabled IDE. +// You **will not** get auto-completion for `dog` and `cat` literals. + +// After + +type Pet2 = LiteralUnion<'dog' | 'cat', string>; + +const pet: Pet2 = ''; +// You **will** get auto-completion for `dog` and `cat` literals. +``` + +@category Utilities + */ +export type LiteralUnion< + LiteralType, + BaseType extends Primitive +> = LiteralType | (BaseType & {_?: never}); diff --git a/node_modules/type-fest/source/merge-exclusive.d.ts b/node_modules/type-fest/source/merge-exclusive.d.ts new file mode 100644 index 000000000..47d922144 --- /dev/null +++ b/node_modules/type-fest/source/merge-exclusive.d.ts @@ -0,0 +1,41 @@ +// Helper type. Not useful on its own. +type Without = {[KeyType in Exclude]?: never}; + +/** +Create a type that has mutually exclusive keys. + +This type was inspired by [this comment](https://github.com/Microsoft/TypeScript/issues/14094#issuecomment-373782604). + +This type works with a helper type, called `Without`. `Without` produces a type that has only keys from `FirstType` which are not present on `SecondType` and sets the value type for these keys to `never`. This helper type is then used in `MergeExclusive` to remove keys from either `FirstType` or `SecondType`. + +@example +``` +import {MergeExclusive} from 'type-fest'; + +interface ExclusiveVariation1 { + exclusive1: boolean; +} + +interface ExclusiveVariation2 { + exclusive2: string; +} + +type ExclusiveOptions = MergeExclusive; + +let exclusiveOptions: ExclusiveOptions; + +exclusiveOptions = {exclusive1: true}; +//=> Works +exclusiveOptions = {exclusive2: 'hi'}; +//=> Works +exclusiveOptions = {exclusive1: true, exclusive2: 'hi'}; +//=> Error +``` + +@category Utilities +*/ +export type MergeExclusive = + (FirstType | SecondType) extends object ? + (Without & SecondType) | (Without & FirstType) : + FirstType | SecondType; + diff --git a/node_modules/type-fest/source/merge.d.ts b/node_modules/type-fest/source/merge.d.ts new file mode 100644 index 000000000..d6371f1b6 --- /dev/null +++ b/node_modules/type-fest/source/merge.d.ts @@ -0,0 +1,27 @@ +import {Except} from './except'; +import {Simplify} from './simplify'; + +type Merge_ = Except> & SecondType; + +/** +Merge two types into a new type. Keys of the second type overrides keys of the first type. + +@example +``` +import {Merge} from 'type-fest'; + +type Foo = { + a: number; + b: string; +}; + +type Bar = { + b: number; +}; + +const ab: Merge = {a: 1, b: 2}; +``` + +@category Utilities +*/ +export type Merge = Simplify>; diff --git a/node_modules/type-fest/source/mutable.d.ts b/node_modules/type-fest/source/mutable.d.ts new file mode 100644 index 000000000..852dece56 --- /dev/null +++ b/node_modules/type-fest/source/mutable.d.ts @@ -0,0 +1,40 @@ +import {Except} from './except'; +import {Simplify} from './simplify'; + +/** +Create a type that strips `readonly` from all or some of an object's keys. Inverse of `Readonly`. + +This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509), or to define a single model where the only thing that changes is whether or not some of the keys are mutable. + +@example +``` +import {Mutable} from 'type-fest'; + +type Foo = { + readonly a: number; + readonly b: readonly string[]; // To show that only the mutability status of the properties, not their values, are affected. + readonly c: boolean; +}; + +const mutableFoo: Mutable = {a: 1, b: ['2'], c: true}; +mutableFoo.a = 3; +mutableFoo.b[0] = 'new value'; // Will still fail as the value of property "b" is still a readonly type. +mutableFoo.b = ['something']; // Will work as the "b" property itself is no longer readonly. + +type SomeMutable = Mutable; +// type SomeMutable = { +// readonly a: number; +// b: readonly string[]; // It's now mutable. The type of the property remains unaffected. +// c: boolean; // It's now mutable. +// } +``` + +@category Utilities +*/ +export type Mutable = + Simplify< + // Pick just the keys that are not mutable from the base type. + Except & + // Pick the keys that should be mutable from the base type and make them mutable by removing the `readonly` modifier from the key. + {-readonly [KeyType in keyof Pick]: Pick[KeyType]} + >; diff --git a/node_modules/type-fest/source/observable-like.d.ts b/node_modules/type-fest/source/observable-like.d.ts new file mode 100644 index 000000000..9b2e35b3b --- /dev/null +++ b/node_modules/type-fest/source/observable-like.d.ts @@ -0,0 +1,15 @@ +declare global { + interface SymbolConstructor { + readonly observable: symbol; + } +} + +/** +Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). + +@category Basic +*/ +export interface ObservableLike { + subscribe(observer: (value: unknown) => void): void; + [Symbol.observable](): ObservableLike; +} diff --git a/node_modules/type-fest/source/opaque.d.ts b/node_modules/type-fest/source/opaque.d.ts new file mode 100644 index 000000000..f22cb248a --- /dev/null +++ b/node_modules/type-fest/source/opaque.d.ts @@ -0,0 +1,67 @@ +/** +Create an opaque type, which hides its internal details from the public, and can only be created by being used explicitly. + +The generic type parameter can be anything. It doesn't have to be an object. + +[Read more about opaque types.](https://codemix.com/opaque-types-in-javascript/) + +There have been several discussions about adding this feature to TypeScript via the `opaque type` operator, similar to how Flow does it. Unfortunately, nothing has (yet) moved forward: + - [Microsoft/TypeScript#15408](https://github.com/Microsoft/TypeScript/issues/15408) + - [Microsoft/TypeScript#15807](https://github.com/Microsoft/TypeScript/issues/15807) + +@example +``` +import {Opaque} from 'type-fest'; + +type AccountNumber = Opaque; +type AccountBalance = Opaque; + +// The Token parameter allows the compiler to differentiate between types, whereas "unknown" will not. For example, consider the following structures: +type ThingOne = Opaque; +type ThingTwo = Opaque; + +// To the compiler, these types are allowed to be cast to each other as they have the same underlying type. They are both `string & { __opaque__: unknown }`. +// To avoid this behaviour, you would instead pass the "Token" parameter, like so. +type NewThingOne = Opaque; +type NewThingTwo = Opaque; + +// Now they're completely separate types, so the following will fail to compile. +function createNewThingOne (): NewThingOne { + // As you can see, casting from a string is still allowed. However, you may not cast NewThingOne to NewThingTwo, and vice versa. + return 'new thing one' as NewThingOne; +} + +// This will fail to compile, as they are fundamentally different types. +const thingTwo = createNewThingOne() as NewThingTwo; + +// Here's another example of opaque typing. +function createAccountNumber(): AccountNumber { + return 2 as AccountNumber; +} + +function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance { + return 4 as AccountBalance; +} + +// This will compile successfully. +getMoneyForAccount(createAccountNumber()); + +// But this won't, because it has to be explicitly passed as an `AccountNumber` type. +getMoneyForAccount(2); + +// You can use opaque values like they aren't opaque too. +const accountNumber = createAccountNumber(); + +// This will not compile successfully. +const newAccountNumber = accountNumber + 2; + +// As a side note, you can (and should) use recursive types for your opaque types to make them stronger and hopefully easier to type. +type Person = { + id: Opaque; + name: string; +}; +``` + +@category Utilities +*/ +export type Opaque = Type & {readonly __opaque__: Token}; diff --git a/node_modules/type-fest/source/package-json.d.ts b/node_modules/type-fest/source/package-json.d.ts new file mode 100644 index 000000000..bb985bffb --- /dev/null +++ b/node_modules/type-fest/source/package-json.d.ts @@ -0,0 +1,645 @@ +import {LiteralUnion} from './literal-union'; + +declare namespace PackageJson { + /** + A person who has been involved in creating or maintaining the package. + */ + export type Person = + | string + | { + name: string; + url?: string; + email?: string; + }; + + export type BugsLocation = + | string + | { + /** + The URL to the package's issue tracker. + */ + url?: string; + + /** + The email address to which issues should be reported. + */ + email?: string; + }; + + export interface DirectoryLocations { + [directoryType: string]: unknown; + + /** + Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder. + */ + bin?: string; + + /** + Location for Markdown files. + */ + doc?: string; + + /** + Location for example scripts. + */ + example?: string; + + /** + Location for the bulk of the library. + */ + lib?: string; + + /** + Location for man pages. Sugar to generate a `man` array by walking the folder. + */ + man?: string; + + /** + Location for test files. + */ + test?: string; + } + + export type Scripts = { + /** + Run **before** the package is published (Also run on local `npm install` without any arguments). + */ + prepublish?: string; + + /** + Run both **before** the package is packed and published, and on local `npm install` without any arguments. This is run **after** `prepublish`, but **before** `prepublishOnly`. + */ + prepare?: string; + + /** + Run **before** the package is prepared and packed, **only** on `npm publish`. + */ + prepublishOnly?: string; + + /** + Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies). + */ + prepack?: string; + + /** + Run **after** the tarball has been generated and moved to its final destination. + */ + postpack?: string; + + /** + Run **after** the package is published. + */ + publish?: string; + + /** + Run **after** the package is published. + */ + postpublish?: string; + + /** + Run **before** the package is installed. + */ + preinstall?: string; + + /** + Run **after** the package is installed. + */ + install?: string; + + /** + Run **after** the package is installed and after `install`. + */ + postinstall?: string; + + /** + Run **before** the package is uninstalled and before `uninstall`. + */ + preuninstall?: string; + + /** + Run **before** the package is uninstalled. + */ + uninstall?: string; + + /** + Run **after** the package is uninstalled. + */ + postuninstall?: string; + + /** + Run **before** bump the package version and before `version`. + */ + preversion?: string; + + /** + Run **before** bump the package version. + */ + version?: string; + + /** + Run **after** bump the package version. + */ + postversion?: string; + + /** + Run with the `npm test` command, before `test`. + */ + pretest?: string; + + /** + Run with the `npm test` command. + */ + test?: string; + + /** + Run with the `npm test` command, after `test`. + */ + posttest?: string; + + /** + Run with the `npm stop` command, before `stop`. + */ + prestop?: string; + + /** + Run with the `npm stop` command. + */ + stop?: string; + + /** + Run with the `npm stop` command, after `stop`. + */ + poststop?: string; + + /** + Run with the `npm start` command, before `start`. + */ + prestart?: string; + + /** + Run with the `npm start` command. + */ + start?: string; + + /** + Run with the `npm start` command, after `start`. + */ + poststart?: string; + + /** + Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + prerestart?: string; + + /** + Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + restart?: string; + + /** + Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + postrestart?: string; + } & Record; + + /** + Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL. + */ + export type Dependency = Record; + + /** + Conditions which provide a way to resolve a package entry point based on the environment. + */ + export type ExportCondition = LiteralUnion< + | 'import' + | 'require' + | 'node' + | 'deno' + | 'browser' + | 'electron' + | 'react-native' + | 'default', + string + >; + + /** + Entry points of a module, optionally with conditions and subpath exports. + */ + export type Exports = + | string + | string[] + | {[key in ExportCondition]: Exports} + | {[key: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style + + export interface NonStandardEntryPoints { + /** + An ECMAScript module ID that is the primary entry point to the program. + */ + module?: string; + + /** + A module ID with untranspiled code that is the primary entry point to the program. + */ + esnext?: + | string + | { + [moduleName: string]: string | undefined; + main?: string; + browser?: string; + }; + + /** + A hint to JavaScript bundlers or component tools when packaging modules for client side use. + */ + browser?: + | string + | Record; + + /** + Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused. + + [Read more.](https://webpack.js.org/guides/tree-shaking/) + */ + sideEffects?: boolean | string[]; + } + + export interface TypeScriptConfiguration { + /** + Location of the bundled TypeScript declaration file. + */ + types?: string; + + /** + Version selection map of TypeScript. + */ + typesVersions?: Record>; + + /** + Location of the bundled TypeScript declaration file. Alias of `types`. + */ + typings?: string; + } + + /** + An alternative configuration for Yarn workspaces. + */ + export interface WorkspaceConfig { + /** + An array of workspace pattern strings which contain the workspace packages. + */ + packages?: WorkspacePattern[]; + + /** + Designed to solve the problem of packages which break when their `node_modules` are moved to the root workspace directory - a process known as hoisting. For these packages, both within your workspace, and also some that have been installed via `node_modules`, it is important to have a mechanism for preventing the default Yarn workspace behavior. By adding workspace pattern strings here, Yarn will resume non-workspace behavior for any package which matches the defined patterns. + + [Read more](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) + */ + nohoist?: WorkspacePattern[]; + } + + /** + A workspace pattern points to a directory or group of directories which contain packages that should be included in the workspace installation process. + + The patterns are handled with [minimatch](https://github.com/isaacs/minimatch). + + @example + `docs` → Include the docs directory and install its dependencies. + `packages/*` → Include all nested directories within the packages directory, like `packages/cli` and `packages/core`. + */ + type WorkspacePattern = string; + + export interface YarnConfiguration { + /** + Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/). + + Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run `yarn install` once to install all of them in a single pass. + + Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces. + */ + workspaces?: WorkspacePattern[] | WorkspaceConfig; + + /** + If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`. + + Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an app), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line. + */ + flat?: boolean; + + /** + Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file. + */ + resolutions?: Dependency; + } + + export interface JSPMConfiguration { + /** + JSPM configuration. + */ + jspm?: PackageJson; + } + + /** + Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Containing standard npm properties. + */ + export interface PackageJsonStandard { + /** + The name of the package. + */ + name?: string; + + /** + Package version, parseable by [`node-semver`](https://github.com/npm/node-semver). + */ + version?: string; + + /** + Package description, listed in `npm search`. + */ + description?: string; + + /** + Keywords associated with package, listed in `npm search`. + */ + keywords?: string[]; + + /** + The URL to the package's homepage. + */ + homepage?: LiteralUnion<'.', string>; + + /** + The URL to the package's issue tracker and/or the email address to which issues should be reported. + */ + bugs?: BugsLocation; + + /** + The license for the package. + */ + license?: string; + + /** + The licenses for the package. + */ + licenses?: Array<{ + type?: string; + url?: string; + }>; + + author?: Person; + + /** + A list of people who contributed to the package. + */ + contributors?: Person[]; + + /** + A list of people who maintain the package. + */ + maintainers?: Person[]; + + /** + The files included in the package. + */ + files?: string[]; + + /** + Resolution algorithm for importing ".js" files from the package's scope. + + [Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field) + */ + type?: 'module' | 'commonjs'; + + /** + The module ID that is the primary entry point to the program. + */ + main?: string; + + /** + Standard entry points of the package, with enhanced support for ECMAScript Modules. + + [Read more.](https://nodejs.org/api/esm.html#esm_package_entry_points) + */ + exports?: Exports; + + /** + The executable files that should be installed into the `PATH`. + */ + bin?: + | string + | Record; + + /** + Filenames to put in place for the `man` program to find. + */ + man?: string | string[]; + + /** + Indicates the structure of the package. + */ + directories?: DirectoryLocations; + + /** + Location for the code repository. + */ + repository?: + | string + | { + type: string; + url: string; + + /** + Relative path to package.json if it is placed in non-root directory (for example if it is part of a monorepo). + + [Read more.](https://github.com/npm/rfcs/blob/latest/implemented/0010-monorepo-subdirectory-declaration.md) + */ + directory?: string; + }; + + /** + Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point. + */ + scripts?: Scripts; + + /** + Is used to set configuration parameters used in package scripts that persist across upgrades. + */ + config?: Record; + + /** + The dependencies of the package. + */ + dependencies?: Dependency; + + /** + Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling. + */ + devDependencies?: Dependency; + + /** + Dependencies that are skipped if they fail to install. + */ + optionalDependencies?: Dependency; + + /** + Dependencies that will usually be required by the package user directly or via another dependency. + */ + peerDependencies?: Dependency; + + /** + Indicate peer dependencies that are optional. + */ + peerDependenciesMeta?: Record; + + /** + Package names that are bundled when the package is published. + */ + bundledDependencies?: string[]; + + /** + Alias of `bundledDependencies`. + */ + bundleDependencies?: string[]; + + /** + Engines that this package runs on. + */ + engines?: { + [EngineName in 'npm' | 'node' | string]: string; + }; + + /** + @deprecated + */ + engineStrict?: boolean; + + /** + Operating systems the module runs on. + */ + os?: Array>; + + /** + CPU architectures the module runs on. + */ + cpu?: Array>; + + /** + If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally. + + @deprecated + */ + preferGlobal?: boolean; + + /** + If set to `true`, then npm will refuse to publish it. + */ + private?: boolean; + + /** + A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default. + */ + publishConfig?: PublishConfig; + + /** + Describes and notifies consumers of a package's monetary support information. + + [Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md) + */ + funding?: string | { + /** + The type of funding. + */ + type?: LiteralUnion< + | 'github' + | 'opencollective' + | 'patreon' + | 'individual' + | 'foundation' + | 'corporation', + string + >; + + /** + The URL to the funding page. + */ + url: string; + }; + } + + export interface PublishConfig { + /** + Additional, less common properties from the [npm docs on `publishConfig`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig). + */ + [additionalProperties: string]: unknown; + + /** + When publishing scoped packages, the access level defaults to restricted. If you want your scoped package to be publicly viewable (and installable) set `--access=public`. The only valid values for access are public and restricted. Unscoped packages always have an access level of public. + */ + access?: 'public' | 'restricted'; + + /** + The base URL of the npm registry. + + Default: `'https://registry.npmjs.org/'` + */ + registry?: string; + + /** + The tag to publish the package under. + + Default: `'latest'` + */ + tag?: string; + } +} + +/** +Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn. + +@category Miscellaneous +*/ +export type PackageJson = +PackageJson.PackageJsonStandard & +PackageJson.NonStandardEntryPoints & +PackageJson.TypeScriptConfiguration & +PackageJson.YarnConfiguration & +PackageJson.JSPMConfiguration; diff --git a/node_modules/type-fest/source/partial-deep.d.ts b/node_modules/type-fest/source/partial-deep.d.ts new file mode 100644 index 000000000..572b77cab --- /dev/null +++ b/node_modules/type-fest/source/partial-deep.d.ts @@ -0,0 +1,74 @@ +import {Primitive} from './primitive'; + +/** +Create a type from another type with all keys and nested keys set to optional. + +Use-cases: +- Merging a default settings/config object with another object, the second object would be a deep partial of the default object. +- Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test. + +@example +``` +import {PartialDeep} from 'type-fest'; + +const settings: Settings = { + textEditor: { + fontSize: 14; + fontColor: '#000000'; + fontWeight: 400; + } + autocomplete: false; + autosave: true; +}; + +const applySavedSettings = (savedSettings: PartialDeep) => { + return {...settings, ...savedSettings}; +} + +settings = applySavedSettings({textEditor: {fontWeight: 500}}); +``` + +@category Utilities +*/ +export type PartialDeep = T extends Primitive + ? Partial + : T extends Map + ? PartialMapDeep + : T extends Set + ? PartialSetDeep + : T extends ReadonlyMap + ? PartialReadonlyMapDeep + : T extends ReadonlySet + ? PartialReadonlySetDeep + : T extends ((...arguments: any[]) => unknown) + ? T | undefined + : T extends object + ? PartialObjectDeep + : unknown; + +/** +Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialMapDeep extends Map, PartialDeep> {} + +/** +Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialSetDeep extends Set> {} + +/** +Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialReadonlyMapDeep extends ReadonlyMap, PartialDeep> {} + +/** +Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialReadonlySetDeep extends ReadonlySet> {} + +/** +Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`. +*/ +type PartialObjectDeep = { + [KeyType in keyof ObjectType]?: PartialDeep +}; diff --git a/node_modules/type-fest/source/primitive.d.ts b/node_modules/type-fest/source/primitive.d.ts new file mode 100644 index 000000000..5ad7a0b89 --- /dev/null +++ b/node_modules/type-fest/source/primitive.d.ts @@ -0,0 +1,13 @@ +/** +Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). + +@category Basic +*/ +export type Primitive = + | null + | undefined + | string + | number + | boolean + | symbol + | bigint; diff --git a/node_modules/type-fest/source/promisable.d.ts b/node_modules/type-fest/source/promisable.d.ts new file mode 100644 index 000000000..e26395931 --- /dev/null +++ b/node_modules/type-fest/source/promisable.d.ts @@ -0,0 +1,25 @@ +/** +Create a type that represents either the value or the value wrapped in `PromiseLike`. + +Use-cases: +- A function accepts a callback that may either return a value synchronously or may return a promised value. +- This type could be the return type of `Promise#then()`, `Promise#catch()`, and `Promise#finally()` callbacks. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394) if you want to have this type as a built-in in TypeScript. + +@example +``` +import {Promisable} from 'type-fest'; + +async function logger(getLogEntry: () => Promisable): Promise { + const entry = await getLogEntry(); + console.log(entry); +} + +logger(() => 'foo'); +logger(() => Promise.resolve('bar')); + +@category Utilities +``` +*/ +export type Promisable = T | PromiseLike; diff --git a/node_modules/type-fest/source/promise-value.d.ts b/node_modules/type-fest/source/promise-value.d.ts new file mode 100644 index 000000000..b81e31fca --- /dev/null +++ b/node_modules/type-fest/source/promise-value.d.ts @@ -0,0 +1,29 @@ +/** +Returns the type that is wrapped inside a `Promise` type. +If the type is a nested Promise, it is unwrapped recursively until a non-Promise type is obtained. +If the type is not a `Promise`, the type itself is returned. + +@example +``` +import {PromiseValue} from 'type-fest'; + +type AsyncData = Promise; +let asyncData: PromiseValue = Promise.resolve('ABC'); + +type Data = PromiseValue; +let data: Data = await asyncData; + +// Here's an example that shows how this type reacts to non-Promise types. +type SyncData = PromiseValue; +let syncData: SyncData = getSyncData(); + +// Here's an example that shows how this type reacts to recursive Promise types. +type RecursiveAsyncData = Promise >; +let recursiveAsyncData: PromiseValue = Promise.resolve(Promise.resolve('ABC')); +``` + +@category Utilities +*/ +export type PromiseValue = PromiseType extends Promise + ? { 0: PromiseValue; 1: Value }[PromiseType extends Promise ? 0 : 1] + : Otherwise; diff --git a/node_modules/type-fest/source/readonly-deep.d.ts b/node_modules/type-fest/source/readonly-deep.d.ts new file mode 100644 index 000000000..e70cf7291 --- /dev/null +++ b/node_modules/type-fest/source/readonly-deep.d.ts @@ -0,0 +1,61 @@ +import {Primitive} from './primitive'; + +/** +Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively. + +This is useful when a deeply nested structure needs to be exposed as completely immutable, for example, an imported JSON module or when receiving an API response that is passed around. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/13923) if you want to have this type as a built-in in TypeScript. + +@example +``` +// data.json +{ + "foo": ["bar"] +} + +// main.ts +import {ReadonlyDeep} from 'type-fest'; +import dataJson = require('./data.json'); + +const data: ReadonlyDeep = dataJson; + +export default data; + +// test.ts +import data from './main'; + +data.foo.push('bar'); +//=> error TS2339: Property 'push' does not exist on type 'readonly string[]' +``` + +@category Utilities +*/ +export type ReadonlyDeep = T extends Primitive | ((...arguments: any[]) => unknown) + ? T + : T extends ReadonlyMap + ? ReadonlyMapDeep + : T extends ReadonlySet + ? ReadonlySetDeep + : T extends object + ? ReadonlyObjectDeep + : unknown; + +/** +Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +interface ReadonlyMapDeep + extends ReadonlyMap, ReadonlyDeep> {} + +/** +Same as `ReadonlyDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +interface ReadonlySetDeep + extends ReadonlySet> {} + +/** +Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +type ReadonlyObjectDeep = { + readonly [KeyType in keyof ObjectType]: ReadonlyDeep +}; diff --git a/node_modules/type-fest/source/require-at-least-one.d.ts b/node_modules/type-fest/source/require-at-least-one.d.ts new file mode 100644 index 000000000..59a06dcc3 --- /dev/null +++ b/node_modules/type-fest/source/require-at-least-one.d.ts @@ -0,0 +1,35 @@ +import {Except} from './except'; + +/** +Create a type that requires at least one of the given keys. The remaining keys are kept as is. + +@example +``` +import {RequireAtLeastOne} from 'type-fest'; + +type Responder = { + text?: () => string; + json?: () => string; + + secure?: boolean; +}; + +const responder: RequireAtLeastOne = { + json: () => '{"message": "ok"}', + secure: true +}; +``` + +@category Utilities +*/ +export type RequireAtLeastOne< + ObjectType, + KeysType extends keyof ObjectType = keyof ObjectType +> = { + // For each `Key` in `KeysType` make a mapped type: + [Key in KeysType]-?: Required> & // 1. Make `Key`'s type required + // 2. Make all other keys in `KeysType` optional + Partial>>; +}[KeysType] & + // 3. Add the remaining keys not in `KeysType` + Except; diff --git a/node_modules/type-fest/source/require-exactly-one.d.ts b/node_modules/type-fest/source/require-exactly-one.d.ts new file mode 100644 index 000000000..fc01aecc9 --- /dev/null +++ b/node_modules/type-fest/source/require-exactly-one.d.ts @@ -0,0 +1,37 @@ +// TODO: Remove this when we target TypeScript >=3.5. +type _Omit = Pick>; + +/** +Create a type that requires exactly one of the given keys and disallows more. The remaining keys are kept as is. + +Use-cases: +- Creating interfaces for components that only need one of the keys to display properly. +- Declaring generic keys in a single place for a single use-case that gets narrowed down via `RequireExactlyOne`. + +The caveat with `RequireExactlyOne` is that TypeScript doesn't always know at compile time every key that will exist at runtime. Therefore `RequireExactlyOne` can't do anything to prevent extra keys it doesn't know about. + +@example +``` +import {RequireExactlyOne} from 'type-fest'; + +type Responder = { + text: () => string; + json: () => string; + secure: boolean; +}; + +const responder: RequireExactlyOne = { + // Adding a `text` key here would cause a compile error. + + json: () => '{"message": "ok"}', + secure: true +}; +``` + +@category Utilities +*/ +export type RequireExactlyOne = + {[Key in KeysType]: ( + Required> & + Partial, never>> + )}[KeysType] & _Omit; diff --git a/node_modules/type-fest/source/set-optional.d.ts b/node_modules/type-fest/source/set-optional.d.ts new file mode 100644 index 000000000..32604ce0a --- /dev/null +++ b/node_modules/type-fest/source/set-optional.d.ts @@ -0,0 +1,35 @@ +import {Except} from './except'; +import {Simplify} from './simplify'; + +/** +Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type. + +Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional. + +@example +``` +import {SetOptional} from 'type-fest'; + +type Foo = { + a: number; + b?: string; + c: boolean; +} + +type SomeOptional = SetOptional; +// type SomeOptional = { +// a: number; +// b?: string; // Was already optional and still is. +// c?: boolean; // Is now optional. +// } +``` + +@category Utilities +*/ +export type SetOptional = + Simplify< + // Pick just the keys that are readonly from the base type. + Except & + // Pick the keys that should be mutable from the base type and make them mutable. + Partial> + >; diff --git a/node_modules/type-fest/source/set-required.d.ts b/node_modules/type-fest/source/set-required.d.ts new file mode 100644 index 000000000..7f25da657 --- /dev/null +++ b/node_modules/type-fest/source/set-required.d.ts @@ -0,0 +1,35 @@ +import {Except} from './except'; +import {Simplify} from './simplify'; + +/** +Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type. + +Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required. + +@example +``` +import {SetRequired} from 'type-fest'; + +type Foo = { + a?: number; + b: string; + c?: boolean; +} + +type SomeRequired = SetRequired; +// type SomeRequired = { +// a?: number; +// b: string; // Was already required and still is. +// c: boolean; // Is now required. +// } +``` + +@category Utilities +*/ +export type SetRequired = + Simplify< + // Pick just the keys that are optional from the base type. + Except & + // Pick the keys that should be required from the base type and make them required. + Required> + >; diff --git a/node_modules/type-fest/source/set-return-type.d.ts b/node_modules/type-fest/source/set-return-type.d.ts new file mode 100644 index 000000000..6d198d0a9 --- /dev/null +++ b/node_modules/type-fest/source/set-return-type.d.ts @@ -0,0 +1,31 @@ +type IsAny = 0 extends (1 & T) ? true : false; // https://stackoverflow.com/a/49928360/3406963 +type IsNever = [T] extends [never] ? true : false; +type IsUnknown = IsNever extends false ? T extends unknown ? unknown extends T ? IsAny extends false ? true : false : false : false : false; + +/** +Create a function type with a return type of your choice and the same parameters as the given function type. + +Use-case: You want to define a wrapped function that returns something different while receiving the same parameters. For example, you might want to wrap a function that can throw an error into one that will return `undefined` instead. + +@example +``` +import {SetReturnType} from 'type-fest'; + +type MyFunctionThatCanThrow = (foo: SomeType, bar: unknown) => SomeOtherType; + +type MyWrappedFunction = SetReturnType; +//=> type MyWrappedFunction = (foo: SomeType, bar: unknown) => SomeOtherType | undefined; +``` + +@category Utilities +*/ +export type SetReturnType any, TypeToReturn> = + // Just using `Parameters` isn't ideal because it doesn't handle the `this` fake parameter. + Fn extends (this: infer ThisArg, ...args: infer Arguments) => any ? ( + // If a function did not specify the `this` fake parameter, it will be inferred to `unknown`. + // We want to detect this situation just to display a friendlier type upon hovering on an IntelliSense-powered IDE. + IsUnknown extends true ? (...args: Arguments) => TypeToReturn : (this: ThisArg, ...args: Arguments) => TypeToReturn + ) : ( + // This part should be unreachable, but we make it meaningful just in case… + (...args: Parameters) => TypeToReturn + ); diff --git a/node_modules/type-fest/source/simplify.d.ts b/node_modules/type-fest/source/simplify.d.ts new file mode 100644 index 000000000..32558b7bd --- /dev/null +++ b/node_modules/type-fest/source/simplify.d.ts @@ -0,0 +1,24 @@ +/** +Flatten the type output to improve type hints shown in editors. + +@example +``` +import {Simplify} from 'type-fest'; + +type PositionProps = { + top: number; + left: number; +}; + +type SizeProps = { + width: number; + height: number; +}; + +// In your editor, hovering over `Props` will show a flattened object with all the properties. +type Props = Simplify; +``` + +@category Utilities +*/ +export type Simplify = {[KeyType in keyof T]: T[KeyType]}; diff --git a/node_modules/type-fest/source/stringified.d.ts b/node_modules/type-fest/source/stringified.d.ts new file mode 100644 index 000000000..308733109 --- /dev/null +++ b/node_modules/type-fest/source/stringified.d.ts @@ -0,0 +1,23 @@ +/** +Create a type with the keys of the given type changed to `string` type. + +Use-case: Changing interface values to strings in order to use them in a form model. + +@example +``` +import {Stringified} from 'type-fest'; + +type Car { + model: string; + speed: number; +} + +const carForm: Stringified = { + model: 'Foo', + speed: '101' +}; +``` + +@category Utilities +*/ +export type Stringified = {[KeyType in keyof ObjectType]: string}; diff --git a/node_modules/type-fest/source/tsconfig-json.d.ts b/node_modules/type-fest/source/tsconfig-json.d.ts new file mode 100644 index 000000000..9faa5c93d --- /dev/null +++ b/node_modules/type-fest/source/tsconfig-json.d.ts @@ -0,0 +1,1095 @@ +declare namespace TsConfigJson { + namespace CompilerOptions { + export type JSX = + | 'preserve' + | 'react' + | 'react-jsx' + | 'react-jsxdev' + | 'react-native'; + + export type Module = + | 'CommonJS' + | 'AMD' + | 'System' + | 'UMD' + | 'ES6' + | 'ES2015' + | 'ES2020' + | 'ESNext' + | 'None' + // Lowercase alternatives + | 'commonjs' + | 'amd' + | 'system' + | 'umd' + | 'es6' + | 'es2015' + | 'es2020' + | 'esnext' + | 'none'; + + export type NewLine = + | 'CRLF' + | 'LF' + // Lowercase alternatives + | 'crlf' + | 'lf'; + + export type Target = + | 'ES3' + | 'ES5' + | 'ES6' + | 'ES2015' + | 'ES2016' + | 'ES2017' + | 'ES2018' + | 'ES2019' + | 'ES2020' + | 'ES2021' + | 'ESNext' + // Lowercase alternatives + | 'es3' + | 'es5' + | 'es6' + | 'es2015' + | 'es2016' + | 'es2017' + | 'es2018' + | 'es2019' + | 'es2020' + | 'es2021' + | 'esnext'; + + export type Lib = + | 'ES5' + | 'ES6' + | 'ES7' + | 'ES2015' + | 'ES2015.Collection' + | 'ES2015.Core' + | 'ES2015.Generator' + | 'ES2015.Iterable' + | 'ES2015.Promise' + | 'ES2015.Proxy' + | 'ES2015.Reflect' + | 'ES2015.Symbol.WellKnown' + | 'ES2015.Symbol' + | 'ES2016' + | 'ES2016.Array.Include' + | 'ES2017' + | 'ES2017.Intl' + | 'ES2017.Object' + | 'ES2017.SharedMemory' + | 'ES2017.String' + | 'ES2017.TypedArrays' + | 'ES2018' + | 'ES2018.AsyncGenerator' + | 'ES2018.AsyncIterable' + | 'ES2018.Intl' + | 'ES2018.Promise' + | 'ES2018.Regexp' + | 'ES2019' + | 'ES2019.Array' + | 'ES2019.Object' + | 'ES2019.String' + | 'ES2019.Symbol' + | 'ES2020' + | 'ES2020.BigInt' + | 'ES2020.Promise' + | 'ES2020.String' + | 'ES2020.Symbol.WellKnown' + | 'ES2020.SharedMemory' + | 'ES2020.Intl' + | 'ES2021' + | 'ES2021.Promise' + | 'ES2021.String' + | 'ES2021.WeakRef' + | 'ESNext' + | 'ESNext.Array' + | 'ESNext.AsyncIterable' + | 'ESNext.BigInt' + | 'ESNext.Intl' + | 'ESNext.Promise' + | 'ESNext.String' + | 'ESNext.Symbol' + | 'ESNext.WeakRef' + | 'DOM' + | 'DOM.Iterable' + | 'ScriptHost' + | 'WebWorker' + | 'WebWorker.ImportScripts' + | 'WebWorker.Iterable' + // Lowercase alternatives + | 'es5' + | 'es6' + | 'es7' + | 'es2015' + | 'es2015.collection' + | 'es2015.core' + | 'es2015.generator' + | 'es2015.iterable' + | 'es2015.promise' + | 'es2015.proxy' + | 'es2015.reflect' + | 'es2015.symbol.wellknown' + | 'es2015.symbol' + | 'es2016' + | 'es2016.array.include' + | 'es2017' + | 'es2017.intl' + | 'es2017.object' + | 'es2017.sharedmemory' + | 'es2017.string' + | 'es2017.typedarrays' + | 'es2018' + | 'es2018.asyncgenerator' + | 'es2018.asynciterable' + | 'es2018.intl' + | 'es2018.promise' + | 'es2018.regexp' + | 'es2019' + | 'es2019.array' + | 'es2019.object' + | 'es2019.string' + | 'es2019.symbol' + | 'es2020' + | 'es2020.bigint' + | 'es2020.promise' + | 'es2020.string' + | 'es2020.symbol.wellknown' + | 'es2020.sharedmemory' + | 'es2020.intl' + | 'es2021' + | 'es2021.promise' + | 'es2021.string' + | 'es2021.weakref' + | 'esnext' + | 'esnext.array' + | 'esnext.asynciterable' + | 'esnext.bigint' + | 'esnext.intl' + | 'esnext.promise' + | 'esnext.string' + | 'esnext.symbol' + | 'esnext.weakref' + | 'dom' + | 'dom.iterable' + | 'scripthost' + | 'webworker' + | 'webworker.importscripts' + | 'webworker.iterable'; + + export interface Plugin { + [key: string]: unknown; + /** + Plugin name. + */ + name?: string; + } + + export type ImportsNotUsedAsValues = + | 'remove' + | 'preserve' + | 'error'; + + export type FallbackPolling = + | 'fixedPollingInterval' + | 'priorityPollingInterval' + | 'dynamicPriorityPolling' + | 'fixedInterval' + | 'priorityInterval' + | 'dynamicPriority' + | 'fixedChunkSize'; + + export type WatchDirectory = + | 'useFsEvents' + | 'fixedPollingInterval' + | 'dynamicPriorityPolling' + | 'fixedChunkSizePolling'; + + export type WatchFile = + | 'fixedPollingInterval' + | 'priorityPollingInterval' + | 'dynamicPriorityPolling' + | 'useFsEvents' + | 'useFsEventsOnParentDirectory' + | 'fixedChunkSizePolling'; + + } + + export interface CompilerOptions { + /** + The character set of the input files. + + @default 'utf8' + */ + charset?: string; + + /** + Enables building for project references. + + @default true + */ + composite?: boolean; + + /** + Generates corresponding d.ts files. + + @default false + */ + declaration?: boolean; + + /** + Specify output directory for generated declaration files. + + Requires TypeScript version 2.0 or later. + */ + declarationDir?: string; + + /** + Show diagnostic information. + + @default false + */ + diagnostics?: boolean; + + /** + Reduce the number of projects loaded automatically by TypeScript. + + Requires TypeScript version 4.0 or later. + + @default false + */ + disableReferencedProjectLoad?: boolean; + + /** + Enforces using indexed accessors for keys declared using an indexed type. + + Requires TypeScript version 4.2 or later. + + @default false + */ + noPropertyAccessFromIndexSignature?: boolean; + + /** + Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. + + @default false + */ + emitBOM?: boolean; + + /** + Only emit `.d.ts` declaration files. + + @default false + */ + emitDeclarationOnly?: boolean; + + /** + Differentiate between undefined and not present when type checking. + + Requires TypeScript version 4.4 or later. + + @default false + */ + exactOptionalPropertyTypes?: boolean; + + /** + Enable incremental compilation. + + @default `composite` + */ + incremental?: boolean; + + /** + Specify file to store incremental compilation information. + + @default '.tsbuildinfo' + */ + tsBuildInfoFile?: string; + + /** + Emit a single file with source maps instead of having a separate file. + + @default false + */ + inlineSourceMap?: boolean; + + /** + Emit the source alongside the sourcemaps within a single file. + + Requires `--inlineSourceMap` to be set. + + @default false + */ + inlineSources?: boolean; + + /** + Specify what JSX code is generated. + + @default 'preserve' + */ + jsx?: CompilerOptions.JSX; + + /** + Specifies the object invoked for `createElement` and `__spread` when targeting `'react'` JSX emit. + + @default 'React' + */ + reactNamespace?: string; + + /** + Specify the JSX factory function to use when targeting React JSX emit, e.g. `React.createElement` or `h`. + + Requires TypeScript version 2.1 or later. + + @default 'React.createElement' + */ + jsxFactory?: string; + + /** + Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. + + Requires TypeScript version 4.0 or later. + + @default 'React.Fragment' + */ + jsxFragmentFactory?: string; + + /** + Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`. + + Requires TypeScript version 4.1 or later. + + @default 'react' + */ + jsxImportSource?: string; + + /** + Print names of files part of the compilation. + + @default false + */ + listFiles?: boolean; + + /** + Specifies the location where debugger should locate map files instead of generated locations. + */ + mapRoot?: string; + + /** + Specify module code generation: 'None', 'CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015' or 'ESNext'. Only 'AMD' and 'System' can be used in conjunction with `--outFile`. 'ES6' and 'ES2015' values may be used when targeting 'ES5' or lower. + + @default ['ES3', 'ES5'].includes(target) ? 'CommonJS' : 'ES6' + */ + module?: CompilerOptions.Module; + + /** + Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6). + + @default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node' + */ + moduleResolution?: 'classic' | 'node'; + + /** + Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix). + + Default: Platform specific + */ + newLine?: CompilerOptions.NewLine; + + /** + Do not emit output. + + @default false + */ + noEmit?: boolean; + + /** + Do not generate custom helper functions like `__extends` in compiled output. + + @default false + */ + noEmitHelpers?: boolean; + + /** + Do not emit outputs if any type checking errors were reported. + + @default false + */ + noEmitOnError?: boolean; + + /** + Warn on expressions and declarations with an implied 'any' type. + + @default false + */ + noImplicitAny?: boolean; + + /** + Raise error on 'this' expressions with an implied any type. + + @default false + */ + noImplicitThis?: boolean; + + /** + Report errors on unused locals. + + Requires TypeScript version 2.0 or later. + + @default false + */ + noUnusedLocals?: boolean; + + /** + Report errors on unused parameters. + + Requires TypeScript version 2.0 or later. + + @default false + */ + noUnusedParameters?: boolean; + + /** + Do not include the default library file (lib.d.ts). + + @default false + */ + noLib?: boolean; + + /** + Do not add triple-slash references or module import targets to the list of compiled files. + + @default false + */ + noResolve?: boolean; + + /** + Disable strict checking of generic signatures in function types. + + @default false + */ + noStrictGenericChecks?: boolean; + + /** + @deprecated use `skipLibCheck` instead. + */ + skipDefaultLibCheck?: boolean; + + /** + Skip type checking of declaration files. + + Requires TypeScript version 2.0 or later. + + @default false + */ + skipLibCheck?: boolean; + + /** + Concatenate and emit output to single file. + */ + outFile?: string; + + /** + Redirect output structure to the directory. + */ + outDir?: string; + + /** + Do not erase const enum declarations in generated code. + + @default false + */ + preserveConstEnums?: boolean; + + /** + Do not resolve symlinks to their real path; treat a symlinked file like a real one. + + @default false + */ + preserveSymlinks?: boolean; + + /** + Keep outdated console output in watch mode instead of clearing the screen. + + @default false + */ + preserveWatchOutput?: boolean; + + /** + Stylize errors and messages using color and context (experimental). + + @default true // Unless piping to another program or redirecting output to a file. + */ + pretty?: boolean; + + /** + Do not emit comments to output. + + @default false + */ + removeComments?: boolean; + + /** + Specifies the root directory of input files. + + Use to control the output directory structure with `--outDir`. + */ + rootDir?: string; + + /** + Unconditionally emit imports for unresolved files. + + @default false + */ + isolatedModules?: boolean; + + /** + Generates corresponding '.map' file. + + @default false + */ + sourceMap?: boolean; + + /** + Specifies the location where debugger should locate TypeScript files instead of source locations. + */ + sourceRoot?: string; + + /** + Suppress excess property checks for object literals. + + @default false + */ + suppressExcessPropertyErrors?: boolean; + + /** + Suppress noImplicitAny errors for indexing objects lacking index signatures. + + @default false + */ + suppressImplicitAnyIndexErrors?: boolean; + + /** + Do not emit declarations for code that has an `@internal` annotation. + */ + stripInternal?: boolean; + + /** + Specify ECMAScript target version. + + @default 'es3' + */ + target?: CompilerOptions.Target; + + /** + Default catch clause variables as `unknown` instead of `any`. + + Requires TypeScript version 4.4 or later. + + @default false + */ + useUnknownInCatchVariables?: boolean; + + /** + Watch input files. + + @default false + */ + watch?: boolean; + + /** + Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. + + Requires TypeScript version 3.8 or later. + */ + fallbackPolling?: CompilerOptions.FallbackPolling; + + /** + Specify the strategy for watching directories under systems that lack recursive file-watching functionality. + + Requires TypeScript version 3.8 or later. + + @default 'useFsEvents' + */ + watchDirectory?: CompilerOptions.WatchDirectory; + + /** + Specify the strategy for watching individual files. + + Requires TypeScript version 3.8 or later. + + @default 'useFsEvents' + */ + watchFile?: CompilerOptions.WatchFile; + + /** + Enables experimental support for ES7 decorators. + + @default false + */ + experimentalDecorators?: boolean; + + /** + Emit design-type metadata for decorated declarations in source. + + @default false + */ + emitDecoratorMetadata?: boolean; + + /** + Do not report errors on unused labels. + + @default false + */ + allowUnusedLabels?: boolean; + + /** + Report error when not all code paths in function return a value. + + @default false + */ + noImplicitReturns?: boolean; + + /** + Add `undefined` to a type when accessed using an index. + + Requires TypeScript version 4.1 or later. + + @default false + */ + noUncheckedIndexedAccess?: boolean; + + /** + Report errors for fallthrough cases in switch statement. + + @default false + */ + noFallthroughCasesInSwitch?: boolean; + + /** + Ensure overriding members in derived classes are marked with an override modifier. + + @default false + */ + noImplicitOverride?: boolean; + + /** + Do not report errors on unreachable code. + + @default false + */ + allowUnreachableCode?: boolean; + + /** + Disallow inconsistently-cased references to the same file. + + @default false + */ + forceConsistentCasingInFileNames?: boolean; + + /** + Emit a v8 CPU profile of the compiler run for debugging. + + Requires TypeScript version 3.7 or later. + + @default 'profile.cpuprofile' + */ + generateCpuProfile?: string; + + /** + Base directory to resolve non-relative module names. + */ + baseUrl?: string; + + /** + Specify path mapping to be computed relative to baseUrl option. + */ + paths?: Record; + + /** + List of TypeScript language server plugins to load. + + Requires TypeScript version 2.3 or later. + */ + plugins?: CompilerOptions.Plugin[]; + + /** + Specify list of root directories to be used when resolving modules. + */ + rootDirs?: string[]; + + /** + Specify list of directories for type definition files to be included. + + Requires TypeScript version 2.0 or later. + */ + typeRoots?: string[]; + + /** + Type declaration files to be included in compilation. + + Requires TypeScript version 2.0 or later. + */ + types?: string[]; + + /** + Enable tracing of the name resolution process. + + @default false + */ + traceResolution?: boolean; + + /** + Allow javascript files to be compiled. + + @default false + */ + allowJs?: boolean; + + /** + Do not truncate error messages. + + @default false + */ + noErrorTruncation?: boolean; + + /** + Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + + @default module === 'system' || esModuleInterop + */ + allowSyntheticDefaultImports?: boolean; + + /** + Do not emit `'use strict'` directives in module output. + + @default false + */ + noImplicitUseStrict?: boolean; + + /** + Enable to list all emitted files. + + Requires TypeScript version 2.0 or later. + + @default false + */ + listEmittedFiles?: boolean; + + /** + Disable size limit for JavaScript project. + + Requires TypeScript version 2.0 or later. + + @default false + */ + disableSizeLimit?: boolean; + + /** + List of library files to be included in the compilation. + + Requires TypeScript version 2.0 or later. + */ + lib?: CompilerOptions.Lib[]; + + /** + Enable strict null checks. + + Requires TypeScript version 2.0 or later. + + @default false + */ + strictNullChecks?: boolean; + + /** + The maximum dependency depth to search under `node_modules` and load JavaScript files. Only applicable with `--allowJs`. + + @default 0 + */ + maxNodeModuleJsDepth?: number; + + /** + Import emit helpers (e.g. `__extends`, `__rest`, etc..) from tslib. + + Requires TypeScript version 2.1 or later. + + @default false + */ + importHelpers?: boolean; + + /** + Specify emit/checking behavior for imports that are only used for types. + + @default 'remove' + */ + importsNotUsedAsValues?: CompilerOptions.ImportsNotUsedAsValues; + + /** + Parse in strict mode and emit `'use strict'` for each source file. + + Requires TypeScript version 2.1 or later. + + @default false + */ + alwaysStrict?: boolean; + + /** + Enable all strict type checking options. + + Requires TypeScript version 2.3 or later. + + @default false + */ + strict?: boolean; + + /** + Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions. + + @default false + */ + strictBindCallApply?: boolean; + + /** + Provide full support for iterables in `for-of`, spread, and destructuring when targeting `ES5` or `ES3`. + + Requires TypeScript version 2.3 or later. + + @default false + */ + downlevelIteration?: boolean; + + /** + Report errors in `.js` files. + + Requires TypeScript version 2.3 or later. + + @default false + */ + checkJs?: boolean; + + /** + Disable bivariant parameter checking for function types. + + Requires TypeScript version 2.6 or later. + + @default false + */ + strictFunctionTypes?: boolean; + + /** + Ensure non-undefined class properties are initialized in the constructor. + + Requires TypeScript version 2.7 or later. + + @default false + */ + strictPropertyInitialization?: boolean; + + /** + Emit `__importStar` and `__importDefault` helpers for runtime Babel ecosystem compatibility and enable `--allowSyntheticDefaultImports` for typesystem compatibility. + + Requires TypeScript version 2.7 or later. + + @default false + */ + esModuleInterop?: boolean; + + /** + Allow accessing UMD globals from modules. + + @default false + */ + allowUmdGlobalAccess?: boolean; + + /** + Resolve `keyof` to string valued property names only (no numbers or symbols). + + Requires TypeScript version 2.9 or later. + + @default false + */ + keyofStringsOnly?: boolean; + + /** + Emit ECMAScript standard class fields. + + Requires TypeScript version 3.7 or later. + + @default false + */ + useDefineForClassFields?: boolean; + + /** + Generates a sourcemap for each corresponding `.d.ts` file. + + Requires TypeScript version 2.9 or later. + + @default false + */ + declarationMap?: boolean; + + /** + Include modules imported with `.json` extension. + + Requires TypeScript version 2.9 or later. + + @default false + */ + resolveJsonModule?: boolean; + + /** + Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it. + + Requires TypeScript version 3.8 or later. + + @default false + */ + assumeChangesOnlyAffectDirectDependencies?: boolean; + + /** + Output more detailed compiler performance information after building. + + @default false + */ + extendedDiagnostics?: boolean; + + /** + Print names of files that are part of the compilation and then stop processing. + + @default false + */ + listFilesOnly?: boolean; + + /** + Disable preferring source files instead of declaration files when referencing composite projects. + + @default true if composite, false otherwise + */ + disableSourceOfProjectReferenceRedirect?: boolean; + + /** + Opt a project out of multi-project reference checking when editing. + + Requires TypeScript version 3.8 or later. + + @default false + */ + disableSolutionSearching?: boolean; + + /** + Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation. + + Requires TypeScript version 4.2 or later. + + @default false + */ + explainFiles?: boolean; + } + + /** + Auto type (.d.ts) acquisition options for this project. + + Requires TypeScript version 2.1 or later. + */ + export interface TypeAcquisition { + /** + Enable auto type acquisition. + */ + enable?: boolean; + + /** + Specifies a list of type declarations to be included in auto type acquisition. For example, `['jquery', 'lodash']`. + */ + include?: string[]; + + /** + Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`. + */ + exclude?: string[]; + } + + export interface References { + /** + A normalized path on disk. + */ + path: string; + + /** + The path as the user originally wrote it. + */ + originalPath?: string; + + /** + True if the output of this reference should be prepended to the output of this project. + + Only valid for `--outFile` compilations. + */ + prepend?: boolean; + + /** + True if it is intended that this reference form a circularity. + */ + circular?: boolean; + } +} + +/** +Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7). + +@category Miscellaneous +*/ +export interface TsConfigJson { + /** + Instructs the TypeScript compiler how to compile `.ts` files. + */ + compilerOptions?: TsConfigJson.CompilerOptions; + + /** + Auto type (.d.ts) acquisition options for this project. + + Requires TypeScript version 2.1 or later. + */ + typeAcquisition?: TsConfigJson.TypeAcquisition; + + /** + Enable Compile-on-Save for this project. + */ + compileOnSave?: boolean; + + /** + Path to base configuration file to inherit from. + + Requires TypeScript version 2.1 or later. + */ + extends?: string; + + /** + If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included. + */ + files?: string[]; + + /** + Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property. + + Glob patterns require TypeScript version 2.0 or later. + */ + exclude?: string[]; + + /** + Specifies a list of glob patterns that match files to be included in compilation. + + If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. + + Requires TypeScript version 2.0 or later. + */ + include?: string[]; + + /** + Referenced projects. + + Requires TypeScript version 3.0 or later. + */ + references?: TsConfigJson.References[]; +} diff --git a/node_modules/type-fest/source/typed-array.d.ts b/node_modules/type-fest/source/typed-array.d.ts new file mode 100644 index 000000000..a6a1d92fc --- /dev/null +++ b/node_modules/type-fest/source/typed-array.d.ts @@ -0,0 +1,19 @@ +/// + +/** +Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. + +@category Basic +*/ +export type TypedArray = + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Float32Array + | Float64Array + | BigInt64Array + | BigUint64Array; diff --git a/node_modules/type-fest/source/union-to-intersection.d.ts b/node_modules/type-fest/source/union-to-intersection.d.ts new file mode 100644 index 000000000..4c1d94bc6 --- /dev/null +++ b/node_modules/type-fest/source/union-to-intersection.d.ts @@ -0,0 +1,60 @@ +/** +Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types). + +Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153). + +@example +``` +import {UnionToIntersection} from 'type-fest'; + +type Union = {the(): void} | {great(arg: string): void} | {escape: boolean}; + +type Intersection = UnionToIntersection; +//=> {the(): void; great(arg: string): void; escape: boolean}; +``` + +A more applicable example which could make its way into your library code follows. + +@example +``` +import {UnionToIntersection} from 'type-fest'; + +class CommandOne { + commands: { + a1: () => undefined, + b1: () => undefined, + } +} + +class CommandTwo { + commands: { + a2: (argA: string) => undefined, + b2: (argB: string) => undefined, + } +} + +const union = [new CommandOne(), new CommandTwo()].map(instance => instance.commands); +type Union = typeof union; +//=> {a1(): void; b1(): void} | {a2(argA: string): void; b2(argB: string): void} + +type Intersection = UnionToIntersection; +//=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void} +``` + +@category Utilities +*/ +export type UnionToIntersection = ( + // `extends unknown` is always going to be the case and is used to convert the + // `Union` into a [distributive conditional + // type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types). + Union extends unknown + // The union type is used as the only argument to a function since the union + // of function arguments is an intersection. + ? (distributedUnion: Union) => void + // This won't happen. + : never + // Infer the `Intersection` type since TypeScript represents the positional + // arguments of unions of functions as an intersection of the union. + ) extends ((mergedIntersection: infer Intersection) => void) + ? Intersection + : never; diff --git a/node_modules/type-fest/source/utilities.d.ts b/node_modules/type-fest/source/utilities.d.ts new file mode 100644 index 000000000..8d60ccde0 --- /dev/null +++ b/node_modules/type-fest/source/utilities.d.ts @@ -0,0 +1,5 @@ +export type UpperCaseCharacters = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z'; + +export type WordSeparators = '-' | '_' | ' '; + +export type StringDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'; diff --git a/node_modules/type-fest/source/value-of.d.ts b/node_modules/type-fest/source/value-of.d.ts new file mode 100644 index 000000000..a5c696bdd --- /dev/null +++ b/node_modules/type-fest/source/value-of.d.ts @@ -0,0 +1,42 @@ +/** +Create a union of the given object's values, and optionally specify which keys to get the values from. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31438) if you want to have this type as a built-in in TypeScript. + +@example +``` +// data.json +{ + 'foo': 1, + 'bar': 2, + 'biz': 3 +} + +// main.ts +import {ValueOf} from 'type-fest'; +import data = require('./data.json'); + +export function getData(name: string): ValueOf { + return data[name]; +} + +export function onlyBar(name: string): ValueOf { + return data[name]; +} + +// file.ts +import {getData, onlyBar} from './main'; + +getData('foo'); +//=> 1 + +onlyBar('foo'); +//=> TypeError ... + +onlyBar('bar'); +//=> 2 +``` + +@category Utilities +*/ +export type ValueOf = ObjectType[ValueType]; diff --git a/node_modules/type-fest/ts41/camel-case.d.ts b/node_modules/type-fest/ts41/camel-case.d.ts new file mode 100644 index 000000000..b5c10cd58 --- /dev/null +++ b/node_modules/type-fest/ts41/camel-case.d.ts @@ -0,0 +1,72 @@ +import {WordSeparators} from '../source/utilities'; +import {Split} from './utilities'; + +/** +Step by step takes the first item in an array literal, formats it and adds it to a string literal, and then recursively appends the remainder. + +Only to be used by `CamelCaseStringArray<>`. + +@see CamelCaseStringArray +*/ +type InnerCamelCaseStringArray = + Parts extends [`${infer FirstPart}`, ...infer RemainingParts] + ? FirstPart extends undefined + ? '' + : FirstPart extends '' + ? InnerCamelCaseStringArray + : `${PreviousPart extends '' ? FirstPart : Capitalize}${InnerCamelCaseStringArray}` + : ''; + +/** +Starts fusing the output of `Split<>`, an array literal of strings, into a camel-cased string literal. + +It's separate from `InnerCamelCaseStringArray<>` to keep a clean API outwards to the rest of the code. + +@see Split +*/ +type CamelCaseStringArray = + Parts extends [`${infer FirstPart}`, ...infer RemainingParts] + ? Uncapitalize<`${FirstPart}${InnerCamelCaseStringArray}`> + : never; + +/** +Convert a string literal to camel-case. + +This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result. + +@example +``` +import {CamelCase} from 'type-fest'; + +// Simple + +const someVariable: CamelCase<'foo-bar'> = 'fooBar'; + +// Advanced + +type CamelCasedProperties = { + [K in keyof T as CamelCase]: T[K] +}; + +interface RawOptions { + 'dry-run': boolean; + 'full_family_name': string; + foo: number; + BAR: string; + QUZ_QUX: number; + 'OTHER-FIELD': boolean; +} + +const dbResult: CamelCasedProperties = { + dryRun: true, + fullFamilyName: 'bar.js', + foo: 123, + bar: 'foo', + quzQux: 6, + otherField: false +}; +``` + +@category Template Literals +*/ +export type CamelCase = K extends string ? K extends Uppercase ? CamelCaseStringArray, WordSeparators>> : CamelCaseStringArray> : K; diff --git a/node_modules/type-fest/ts41/camel-cased-properties-deep.d.ts b/node_modules/type-fest/ts41/camel-cased-properties-deep.d.ts new file mode 100644 index 000000000..015057e9e --- /dev/null +++ b/node_modules/type-fest/ts41/camel-cased-properties-deep.d.ts @@ -0,0 +1,50 @@ +import {CamelCase} from './camel-case'; + +/** +Convert object properties to camel case recursively. + +This can be useful when, for example, converting some API types from a different style. + +@see CamelCasedProperties +@see CamelCase + +@example +``` +interface User { + UserId: number; + UserName: string; +} + +interface UserWithFriends { + UserInfo: User; + UserFriends: User[]; +} + +const result: CamelCasedPropertiesDeep = { + userInfo: { + userId: 1, + userName: 'Tom', + }, + userFriends: [ + { + userId: 2, + userName: 'Jerry', + }, + { + userId: 3, + userName: 'Spike', + }, + ], +}; +``` + +@category Template Literals +*/ +export type CamelCasedPropertiesDeep = Value extends Function + ? Value + : Value extends Array + ? Array> + : Value extends Set + ? Set> : { + [K in keyof Value as CamelCase]: CamelCasedPropertiesDeep; + }; diff --git a/node_modules/type-fest/ts41/camel-cased-properties.d.ts b/node_modules/type-fest/ts41/camel-cased-properties.d.ts new file mode 100644 index 000000000..8bbb53c1f --- /dev/null +++ b/node_modules/type-fest/ts41/camel-cased-properties.d.ts @@ -0,0 +1,32 @@ +import {CamelCase} from './camel-case'; + +/** +Convert object properties to camel case but not recursively. + +This can be useful when, for example, converting some API types from a different style. + +@see CamelCasedPropertiesDeep +@see CamelCase + +@example +``` +interface User { + UserId: number; + UserName: string; +} + +const result: CamelCasedProperties = { + userId: 1, + userName: 'Tom', +}; +``` + +@category Template Literals +*/ +export type CamelCasedProperties = Value extends Function + ? Value + : Value extends Array + ? Value + : { + [K in keyof Value as CamelCase]: Value[K]; + }; diff --git a/node_modules/type-fest/ts41/delimiter-case.d.ts b/node_modules/type-fest/ts41/delimiter-case.d.ts new file mode 100644 index 000000000..ea15bd32f --- /dev/null +++ b/node_modules/type-fest/ts41/delimiter-case.d.ts @@ -0,0 +1,88 @@ +import {UpperCaseCharacters, WordSeparators} from '../source/utilities'; + +/** +Unlike a simpler split, this one includes the delimiter splitted on in the resulting array literal. This is to enable splitting on, for example, upper-case characters. + +@category Template Literals +*/ +export type SplitIncludingDelimiters = + Source extends '' ? [] : + Source extends `${infer FirstPart}${Delimiter}${infer SecondPart}` ? + ( + Source extends `${FirstPart}${infer UsedDelimiter}${SecondPart}` + ? UsedDelimiter extends Delimiter + ? Source extends `${infer FirstPart}${UsedDelimiter}${infer SecondPart}` + ? [...SplitIncludingDelimiters, UsedDelimiter, ...SplitIncludingDelimiters] + : never + : never + : never + ) : + [Source]; + +/** +Format a specific part of the splitted string literal that `StringArrayToDelimiterCase<>` fuses together, ensuring desired casing. + +@see StringArrayToDelimiterCase +*/ +type StringPartToDelimiterCase = + StringPart extends UsedWordSeparators ? Delimiter : + StringPart extends UsedUpperCaseCharacters ? `${Delimiter}${Lowercase}` : + StringPart; + +/** +Takes the result of a splitted string literal and recursively concatenates it together into the desired casing. + +It receives `UsedWordSeparators` and `UsedUpperCaseCharacters` as input to ensure it's fully encapsulated. + +@see SplitIncludingDelimiters +*/ +type StringArrayToDelimiterCase = + Parts extends [`${infer FirstPart}`, ...infer RemainingParts] + ? `${StringPartToDelimiterCase}${StringArrayToDelimiterCase}` + : ''; + +/** +Convert a string literal to a custom string delimiter casing. + +This can be useful when, for example, converting a camel-cased object property to an oddly cased one. + +@see KebabCase +@see SnakeCase + +@example +``` +import {DelimiterCase} from 'type-fest'; + +// Simple + +const someVariable: DelimiterCase<'fooBar', '#'> = 'foo#bar'; + +// Advanced + +type OddlyCasedProperties = { + [K in keyof T as DelimiterCase]: T[K] +}; + +interface SomeOptions { + dryRun: boolean; + includeFile: string; + foo: number; +} + +const rawCliOptions: OddlyCasedProperties = { + 'dry#run': true, + 'include#file': 'bar.js', + foo: 123 +}; +``` + +@category Template Literals +*/ +export type DelimiterCase = Value extends string + ? StringArrayToDelimiterCase< + SplitIncludingDelimiters, + WordSeparators, + UpperCaseCharacters, + Delimiter + > + : Value; diff --git a/node_modules/type-fest/ts41/delimiter-cased-properties-deep.d.ts b/node_modules/type-fest/ts41/delimiter-cased-properties-deep.d.ts new file mode 100644 index 000000000..f8589462c --- /dev/null +++ b/node_modules/type-fest/ts41/delimiter-cased-properties-deep.d.ts @@ -0,0 +1,56 @@ +import {DelimiterCase} from './delimiter-case'; + +/** +Convert object properties to delimiter case recursively. + +This can be useful when, for example, converting some API types from a different style. + +@see DelimiterCase +@see DelimiterCasedProperties + +@example +``` +interface User { + userId: number; + userName: string; +} + +interface UserWithFriends { + userInfo: User; + userFriends: User[]; +} + +const result: DelimiterCasedPropertiesDeep = { + 'user-info': { + 'user-id': 1, + 'user-name': 'Tom', + }, + 'user-friends': [ + { + 'user-id': 2, + 'user-name': 'Jerry', + }, + { + 'user-id': 3, + 'user-name': 'Spike', + }, + ], +}; +``` + +@category Template Literals +*/ +export type DelimiterCasedPropertiesDeep< + Value, + Delimiter extends string +> = Value extends Function + ? Value + : Value extends Array + ? Array> + : Value extends Set + ? Set> : { + [K in keyof Value as DelimiterCase< + K, + Delimiter + >]: DelimiterCasedPropertiesDeep; + }; diff --git a/node_modules/type-fest/ts41/delimiter-cased-properties.d.ts b/node_modules/type-fest/ts41/delimiter-cased-properties.d.ts new file mode 100644 index 000000000..a4c89b092 --- /dev/null +++ b/node_modules/type-fest/ts41/delimiter-cased-properties.d.ts @@ -0,0 +1,33 @@ +import {DelimiterCase} from './delimiter-case'; + +/** +Convert object properties to delimiter case but not recursively. + +This can be useful when, for example, converting some API types from a different style. + +@see DelimiterCase +@see DelimiterCasedPropertiesDeep + +@example +``` +interface User { + userId: number; + userName: string; +} + +const result: DelimiterCasedProperties = { + 'user-id': 1, + 'user-name': 'Tom', +}; +``` + +@category Template Literals +*/ +export type DelimiterCasedProperties< + Value, + Delimiter extends string +> = Value extends Function + ? Value + : Value extends Array + ? Value + : { [K in keyof Value as DelimiterCase]: Value[K] }; diff --git a/node_modules/type-fest/ts41/get.d.ts b/node_modules/type-fest/ts41/get.d.ts new file mode 100644 index 000000000..f12a886f6 --- /dev/null +++ b/node_modules/type-fest/ts41/get.d.ts @@ -0,0 +1,135 @@ +import {Split} from './utilities'; +import {StringDigit} from '../source/utilities'; + +/** +Like the `Get` type but receives an array of strings as a path parameter. +*/ +type GetWithPath = + Keys extends [] + ? BaseType + : Keys extends [infer Head, ...infer Tail] + ? GetWithPath>, Extract> + : never; + +/** +Splits a dot-prop style path into a tuple comprised of the properties in the path. Handles square-bracket notation. + +@example +``` +ToPath<'foo.bar.baz'> +//=> ['foo', 'bar', 'baz'] + +ToPath<'foo[0].bar.baz'> +//=> ['foo', '0', 'bar', 'baz'] +``` +*/ +type ToPath = Split, '.'>; + +/** +Replaces square-bracketed dot notation with dots, for example, `foo[0].bar` -> `foo.0.bar`. +*/ +type FixPathSquareBrackets = + Path extends `${infer Head}[${infer Middle}]${infer Tail}` + ? `${Head}.${Middle}${FixPathSquareBrackets}` + : Path; + +/** +Returns true if `LongString` is made up out of `Substring` repeated 0 or more times. + +@example +``` +ConsistsOnlyOf<'aaa', 'a'> //=> true +ConsistsOnlyOf<'ababab', 'ab'> //=> true +ConsistsOnlyOf<'aBa', 'a'> //=> false +ConsistsOnlyOf<'', 'a'> //=> true +``` +*/ +type ConsistsOnlyOf = + LongString extends '' + ? true + : LongString extends `${Substring}${infer Tail}` + ? ConsistsOnlyOf + : false; + +/** +Convert a type which may have number keys to one with string keys, making it possible to index using strings retrieved from template types. + +@example +``` +type WithNumbers = {foo: string; 0: boolean}; +type WithStrings = WithStringKeys; + +type WithNumbersKeys = keyof WithNumbers; +//=> 'foo' | 0 +type WithStringsKeys = keyof WithStrings; +//=> 'foo' | '0' +``` +*/ +type WithStringKeys> = { + [Key in `${Extract}`]: BaseType[Key] +}; + +/** +Get a property of an object or array. Works when indexing arrays using number-literal-strings, for example, `PropertyOf = number`, and when indexing objects with number keys. + +Note: +- Returns `unknown` if `Key` is not a property of `BaseType`, since TypeScript uses structural typing, and it cannot be guaranteed that extra properties unknown to the type system will exist at runtime. +- Returns `undefined` from nullish values, to match the behaviour of most deep-key libraries like `lodash`, `dot-prop`, etc. +*/ +type PropertyOf = + BaseType extends null | undefined + ? undefined + : Key extends keyof BaseType + ? BaseType[Key] + : BaseType extends [] | [unknown, ...unknown[]] + ? unknown // It's a tuple, but `Key` did not extend `keyof BaseType`. So the index is out of bounds. + : BaseType extends { + [n: number]: infer Item; + length: number; // Note: This is needed to avoid being too lax with records types using number keys like `{0: string; 1: boolean}`. + } + ? ( + ConsistsOnlyOf extends true + ? Item + : unknown + ) + : Key extends keyof WithStringKeys + ? WithStringKeys[Key] + : unknown; + +// This works by first splitting the path based on `.` and `[...]` characters into a tuple of string keys. Then it recursively uses the head key to get the next property of the current object, until there are no keys left. Number keys extract the item type from arrays, or are converted to strings to extract types from tuples and dictionaries with number keys. +/** +Get a deeply-nested property from an object using a key path, like Lodash's `.get()` function. + +Use-case: Retrieve a property from deep inside an API response or some other complex object. + +@example +``` +import {Get} from 'type-fest'; +import * as lodash from 'lodash'; + +const get = (object: BaseType, path: Path): Get => + lodash.get(object, path); + +interface ApiResponse { + hits: { + hits: Array<{ + _id: string + _source: { + name: Array<{ + given: string[] + family: string + }> + birthDate: string + } + }> + } +} + +const getName = (apiResponse: ApiResponse) => + get(apiResponse, 'hits.hits[0]._source.name'); + //=> Array<{given: string[]; family: string}> +``` + +@category Template Literals +*/ +export type Get = GetWithPath>; diff --git a/node_modules/type-fest/ts41/includes.d.ts b/node_modules/type-fest/ts41/includes.d.ts new file mode 100644 index 000000000..0d8338054 --- /dev/null +++ b/node_modules/type-fest/ts41/includes.d.ts @@ -0,0 +1,31 @@ +/** +Returns a boolean for whether given two types are equal. + +@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650 +*/ +type IsEqual = + (() => G extends T ? 1 : 2) extends + (() => G extends U ? 1 : 2) + ? true + : false; + +/** +Returns a boolean for whether the given array includes the given item. + +This can be useful if another type wants to make a decision based on whether the array includes that item. + +@example +``` +import {Includes} from 'type-fest'; + +type hasRed = Includes; +``` + +@category Utilities +*/ +export type Includes = + IsEqual extends true + ? true + : Value extends [Value[0], ...infer rest] + ? Includes + : false; diff --git a/node_modules/type-fest/ts41/index.d.ts b/node_modules/type-fest/ts41/index.d.ts new file mode 100644 index 000000000..58cf08bbe --- /dev/null +++ b/node_modules/type-fest/ts41/index.d.ts @@ -0,0 +1,25 @@ +// These are all the basic types that's compatible with all supported TypeScript versions. +export * from '../base'; + +// These are special types that require at least TypeScript 4.1. +export {CamelCase} from './camel-case'; +export {CamelCasedProperties} from './camel-cased-properties'; +export {CamelCasedPropertiesDeep} from './camel-cased-properties-deep'; +export {KebabCase} from './kebab-case'; +export {KebabCasedProperties} from './kebab-cased-properties'; +export {KebabCasedPropertiesDeep} from './kebab-cased-properties-deep'; +export {PascalCase} from './pascal-case'; +export {PascalCasedProperties} from './pascal-cased-properties'; +export {PascalCasedPropertiesDeep} from './pascal-cased-properties-deep'; +export {SnakeCase} from './snake-case'; +export {SnakeCasedProperties} from './snake-cased-properties'; +export {SnakeCasedPropertiesDeep} from './snake-cased-properties-deep'; +export {ScreamingSnakeCase} from './screaming-snake-case'; +export {DelimiterCase} from './delimiter-case'; +export {DelimiterCasedProperties} from './delimiter-cased-properties'; +export {DelimiterCasedPropertiesDeep} from './delimiter-cased-properties-deep'; +export {Split} from './split'; +export {Trim} from './trim'; +export {Includes} from './includes'; +export {Get} from './get'; +export {LastArrayElement} from './last-array-element'; diff --git a/node_modules/type-fest/ts41/kebab-case.d.ts b/node_modules/type-fest/ts41/kebab-case.d.ts new file mode 100644 index 000000000..b3185c125 --- /dev/null +++ b/node_modules/type-fest/ts41/kebab-case.d.ts @@ -0,0 +1,37 @@ +import {DelimiterCase} from './delimiter-case'; + +/** +Convert a string literal to kebab-case. + +This can be useful when, for example, converting a camel-cased object property to a kebab-cased CSS class name or a command-line flag. + +@example +``` +import {KebabCase} from 'type-fest'; + +// Simple + +const someVariable: KebabCase<'fooBar'> = 'foo-bar'; + +// Advanced + +type KebabCasedProperties = { + [K in keyof T as KebabCase]: T[K] +}; + +interface CliOptions { + dryRun: boolean; + includeFile: string; + foo: number; +} + +const rawCliOptions: KebabCasedProperties = { + 'dry-run': true, + 'include-file': 'bar.js', + foo: 123 +}; +``` + +@category Template Literals +*/ +export type KebabCase = DelimiterCase; diff --git a/node_modules/type-fest/ts41/kebab-cased-properties-deep.d.ts b/node_modules/type-fest/ts41/kebab-cased-properties-deep.d.ts new file mode 100644 index 000000000..e7af08506 --- /dev/null +++ b/node_modules/type-fest/ts41/kebab-cased-properties-deep.d.ts @@ -0,0 +1,43 @@ +import {DelimiterCasedPropertiesDeep} from './delimiter-cased-properties-deep'; + +/** +Convert object properties to kebab case recursively. + +This can be useful when, for example, converting some API types from a different style. + +@see KebabCase +@see KebabCasedProperties + +@example +``` +interface User { + userId: number; + userName: string; +} + +interface UserWithFriends { + userInfo: User; + userFriends: User[]; +} + +const result: KebabCasedPropertiesDeep = { + 'user-info': { + 'user-id': 1, + 'user-name': 'Tom', + }, + 'user-friends': [ + { + 'user-id': 2, + 'user-name': 'Jerry', + }, + { + 'user-id': 3, + 'user-name': 'Spike', + }, + ], +}; +``` + +@category Template Literals +*/ +export type KebabCasedPropertiesDeep = DelimiterCasedPropertiesDeep; diff --git a/node_modules/type-fest/ts41/kebab-cased-properties.d.ts b/node_modules/type-fest/ts41/kebab-cased-properties.d.ts new file mode 100644 index 000000000..2529d76be --- /dev/null +++ b/node_modules/type-fest/ts41/kebab-cased-properties.d.ts @@ -0,0 +1,26 @@ +import {DelimiterCasedProperties} from './delimiter-cased-properties'; + +/** +Convert object properties to kebab case but not recursively. + +This can be useful when, for example, converting some API types from a different style. + +@see KebabCase +@see KebabCasedPropertiesDeep + +@example +``` +interface User { + userId: number; + userName: string; +} + +const result: KebabCasedProperties = { + 'user-id': 1, + 'user-name': 'Tom', +}; +``` + +@category Template Literals +*/ +export type KebabCasedProperties = DelimiterCasedProperties; diff --git a/node_modules/type-fest/ts41/last-array-element.d.ts b/node_modules/type-fest/ts41/last-array-element.d.ts new file mode 100644 index 000000000..d181be733 --- /dev/null +++ b/node_modules/type-fest/ts41/last-array-element.d.ts @@ -0,0 +1,25 @@ +/** +Extracts the type of the last element of an array. + +Use-case: Defining the return type of functions that extract the last element of an array, for example [`lodash.last`](https://lodash.com/docs/4.17.15#last). + +@example +``` +import {LastArrayElement} from 'type-fest'; + +declare function lastOf(array: V): LastArrayElement; + +const array = ['foo', 2]; + +typeof lastOf(array); +//=> number +``` + +@category Template Literals +*/ +export type LastArrayElement = + ValueType extends [infer ElementType] + ? ElementType + : ValueType extends [infer _, ...infer Tail] + ? LastArrayElement + : never; diff --git a/node_modules/type-fest/ts41/pascal-case.d.ts b/node_modules/type-fest/ts41/pascal-case.d.ts new file mode 100644 index 000000000..518cc6b44 --- /dev/null +++ b/node_modules/type-fest/ts41/pascal-case.d.ts @@ -0,0 +1,37 @@ +import {CamelCase} from './camel-case'; + +/** +Converts a string literal to pascal-case. + +@example +``` +import {PascalCase} from 'type-fest'; + +// Simple + +const someVariable: PascalCase<'foo-bar'> = 'FooBar'; + +// Advanced + +type PascalCaseProps = { + [K in keyof T as PascalCase]: T[K] +}; + +interface RawOptions { + 'dry-run': boolean; + 'full_family_name': string; + foo: number; +} + +const dbResult: CamelCasedProperties = { + DryRun: true, + FullFamilyName: 'bar.js', + Foo: 123 +}; +``` + +@category Template Literals +*/ +export type PascalCase = CamelCase extends string + ? Capitalize> + : CamelCase; diff --git a/node_modules/type-fest/ts41/pascal-cased-properties-deep.d.ts b/node_modules/type-fest/ts41/pascal-cased-properties-deep.d.ts new file mode 100644 index 000000000..87c02f33e --- /dev/null +++ b/node_modules/type-fest/ts41/pascal-cased-properties-deep.d.ts @@ -0,0 +1,50 @@ +import {PascalCase} from './pascal-case'; + +/** +Convert object properties to pascal case recursively. + +This can be useful when, for example, converting some API types from a different style. + +@see PascalCase +@see PascalCasedProperties + +@example +``` +interface User { + userId: number; + userName: string; +} + +interface UserWithFriends { + userInfo: User; + userFriends: User[]; +} + +const result: PascalCasedPropertiesDeep = { + UserInfo: { + UserId: 1, + UserName: 'Tom', + }, + UserFriends: [ + { + UserId: 2, + UserName: 'Jerry', + }, + { + UserId: 3, + UserName: 'Spike', + }, + ], +}; +``` + +@category Template Literals +*/ +export type PascalCasedPropertiesDeep = Value extends Function + ? Value + : Value extends Array + ? Array> + : Value extends Set + ? Set> : { + [K in keyof Value as PascalCase]: PascalCasedPropertiesDeep; + }; diff --git a/node_modules/type-fest/ts41/pascal-cased-properties.d.ts b/node_modules/type-fest/ts41/pascal-cased-properties.d.ts new file mode 100644 index 000000000..14bae5e7b --- /dev/null +++ b/node_modules/type-fest/ts41/pascal-cased-properties.d.ts @@ -0,0 +1,30 @@ +import {PascalCase} from './pascal-case'; + +/** +Convert object properties to pascal case but not recursively. + +This can be useful when, for example, converting some API types from a different style. + +@see PascalCase +@see PascalCasedPropertiesDeep + +@example +``` +interface User { + userId: number; + userName: string; +} + +const result: PascalCasedProperties = { + UserId: 1, + UserName: 'Tom', +}; +``` + +@category Template Literals +*/ +export type PascalCasedProperties = Value extends Function + ? Value + : Value extends Array + ? Value + : { [K in keyof Value as PascalCase]: Value[K] }; diff --git a/node_modules/type-fest/ts41/screaming-snake-case.d.ts b/node_modules/type-fest/ts41/screaming-snake-case.d.ts new file mode 100644 index 000000000..69569ba53 --- /dev/null +++ b/node_modules/type-fest/ts41/screaming-snake-case.d.ts @@ -0,0 +1,32 @@ +import {SplitIncludingDelimiters} from './delimiter-case'; +import {SnakeCase} from './snake-case'; +import {Includes} from './includes'; + +/** +Returns a boolean for whether the string is screaming snake case. +*/ +type IsScreamingSnakeCase = Value extends Uppercase + ? Includes, '_'>, '_'> extends true + ? true + : false + : false; + +/** +Convert a string literal to screaming-snake-case. + +This can be useful when, for example, converting a camel-cased object property to a screaming-snake-cased SQL column name. + +@example +``` +import {ScreamingSnakeCase} from 'type-fest'; + +const someVariable: ScreamingSnakeCase<'fooBar'> = 'FOO_BAR'; +``` + +@category Template Literals +*/ +export type ScreamingSnakeCase = Value extends string + ? IsScreamingSnakeCase extends true + ? Value + : Uppercase> + : Value; diff --git a/node_modules/type-fest/ts41/snake-case.d.ts b/node_modules/type-fest/ts41/snake-case.d.ts new file mode 100644 index 000000000..851d43fcc --- /dev/null +++ b/node_modules/type-fest/ts41/snake-case.d.ts @@ -0,0 +1,37 @@ +import {DelimiterCase} from './delimiter-case'; + +/** +Convert a string literal to snake-case. + +This can be useful when, for example, converting a camel-cased object property to a snake-cased SQL column name. + +@example +``` +import {SnakeCase} from 'type-fest'; + +// Simple + +const someVariable: SnakeCase<'fooBar'> = 'foo_bar'; + +// Advanced + +type SnakeCasedProperties = { + [K in keyof T as SnakeCase]: T[K] +}; + +interface ModelProps { + isHappy: boolean; + fullFamilyName: string; + foo: number; +} + +const dbResult: SnakeCasedProperties = { + 'is_happy': true, + 'full_family_name': 'Carla Smith', + foo: 123 +}; +``` + +@category Template Literals +*/ +export type SnakeCase = DelimiterCase; diff --git a/node_modules/type-fest/ts41/snake-cased-properties-deep.d.ts b/node_modules/type-fest/ts41/snake-cased-properties-deep.d.ts new file mode 100644 index 000000000..7133a0f15 --- /dev/null +++ b/node_modules/type-fest/ts41/snake-cased-properties-deep.d.ts @@ -0,0 +1,43 @@ +import {DelimiterCasedPropertiesDeep} from './delimiter-cased-properties-deep'; + +/** +Convert object properties to snake case recursively. + +This can be useful when, for example, converting some API types from a different style. + +@see SnakeCase +@see SnakeCasedProperties + +@example +``` +interface User { + userId: number; + userName: string; +} + +interface UserWithFriends { + userInfo: User; + userFriends: User[]; +} + +const result: SnakeCasedPropertiesDeep = { + user_info: { + user_id: 1, + user_name: 'Tom', + }, + user_friends: [ + { + user_id: 2, + user_name: 'Jerry', + }, + { + user_id: 3, + user_name: 'Spike', + }, + ], +}; +``` + +@category Template Literals +*/ +export type SnakeCasedPropertiesDeep = DelimiterCasedPropertiesDeep; diff --git a/node_modules/type-fest/ts41/snake-cased-properties.d.ts b/node_modules/type-fest/ts41/snake-cased-properties.d.ts new file mode 100644 index 000000000..fc3011ea8 --- /dev/null +++ b/node_modules/type-fest/ts41/snake-cased-properties.d.ts @@ -0,0 +1,26 @@ +import {DelimiterCasedProperties} from './delimiter-cased-properties'; + +/** +Convert object properties to snake case but not recursively. + +This can be useful when, for example, converting some API types from a different style. + +@see SnakeCase +@see SnakeCasedPropertiesDeep + +@example +``` +interface User { + userId: number; + userName: string; +} + +const result: SnakeCasedProperties = { + user_id: 1, + user_name: 'Tom', +}; +``` + +@category Template Literals +*/ +export type SnakeCasedProperties = DelimiterCasedProperties; diff --git a/node_modules/type-fest/ts41/split.d.ts b/node_modules/type-fest/ts41/split.d.ts new file mode 100644 index 000000000..7039af8fb --- /dev/null +++ b/node_modules/type-fest/ts41/split.d.ts @@ -0,0 +1,28 @@ +/** +Represents an array of strings split using a given character or character set. + +Use-case: Defining the return type of a method like `String.prototype.split`. + +@example +``` +import {Split} from 'type-fest'; + +declare function split(string: S, separator: D): Split; + +type Item = 'foo' | 'bar' | 'baz' | 'waldo'; +const items = 'foo,bar,baz,waldo'; +let array: Item[]; + +array = split(items, ','); +``` + +@category Template Literals +*/ +export type Split< + S extends string, + Delimiter extends string +> = S extends `${infer Head}${Delimiter}${infer Tail}` + ? [Head, ...Split] + : S extends Delimiter + ? [] + : [S]; diff --git a/node_modules/type-fest/ts41/trim.d.ts b/node_modules/type-fest/ts41/trim.d.ts new file mode 100644 index 000000000..a226cf266 --- /dev/null +++ b/node_modules/type-fest/ts41/trim.d.ts @@ -0,0 +1,24 @@ +/** +Remove spaces from the left side. +*/ +type TrimLeft = V extends ` ${infer R}` ? TrimLeft : V; + +/** +Remove spaces from the right side. +*/ +type TrimRight = V extends `${infer R} ` ? TrimRight : V; + +/** +Remove leading and trailing spaces from a string. + +@example +``` +import {Trim} from 'type-fest'; + +Trim<' foo '> +//=> 'foo' +``` + +@category Template Literals +*/ +export type Trim = TrimLeft>; diff --git a/node_modules/type-fest/ts41/utilities.d.ts b/node_modules/type-fest/ts41/utilities.d.ts new file mode 100644 index 000000000..f82e362fb --- /dev/null +++ b/node_modules/type-fest/ts41/utilities.d.ts @@ -0,0 +1,8 @@ +/** +Recursively split a string literal into two parts on the first occurence of the given string, returning an array literal of all the separate parts. +*/ +export type Split = + string extends S ? string[] : + S extends '' ? [] : + S extends `${infer T}${D}${infer U}` ? [T, ...Split] : + [S]; diff --git a/node_modules/uri-js/LICENSE b/node_modules/uri-js/LICENSE new file mode 100755 index 000000000..9338bde8e --- /dev/null +++ b/node_modules/uri-js/LICENSE @@ -0,0 +1,11 @@ +Copyright 2011 Gary Court. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY GARY COURT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Gary Court. diff --git a/node_modules/uri-js/README.md b/node_modules/uri-js/README.md new file mode 100755 index 000000000..43e648bba --- /dev/null +++ b/node_modules/uri-js/README.md @@ -0,0 +1,203 @@ +# URI.js + +URI.js is an [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt) compliant, scheme extendable URI parsing/validating/resolving library for all JavaScript environments (browsers, Node.js, etc). +It is also compliant with the IRI ([RFC 3987](http://www.ietf.org/rfc/rfc3987.txt)), IDNA ([RFC 5890](http://www.ietf.org/rfc/rfc5890.txt)), IPv6 Address ([RFC 5952](http://www.ietf.org/rfc/rfc5952.txt)), IPv6 Zone Identifier ([RFC 6874](http://www.ietf.org/rfc/rfc6874.txt)) specifications. + +URI.js has an extensive test suite, and works in all (Node.js, web) environments. It weighs in at 6.4kb (gzipped, 17kb deflated). + +## API + +### Parsing + + URI.parse("uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body"); + //returns: + //{ + // scheme : "uri", + // userinfo : "user:pass", + // host : "example.com", + // port : 123, + // path : "/one/two.three", + // query : "q1=a1&q2=a2", + // fragment : "body" + //} + +### Serializing + + URI.serialize({scheme : "http", host : "example.com", fragment : "footer"}) === "http://example.com/#footer" + +### Resolving + + URI.resolve("uri://a/b/c/d?q", "../../g") === "uri://a/g" + +### Normalizing + + URI.normalize("HTTP://ABC.com:80/%7Esmith/home.html") === "http://abc.com/~smith/home.html" + +### Comparison + + URI.equal("example://a/b/c/%7Bfoo%7D", "eXAMPLE://a/./b/../b/%63/%7bfoo%7d") === true + +### IP Support + + //IPv4 normalization + URI.normalize("//192.068.001.000") === "//192.68.1.0" + + //IPv6 normalization + URI.normalize("//[2001:0:0DB8::0:0001]") === "//[2001:0:db8::1]" + + //IPv6 zone identifier support + URI.parse("//[2001:db8::7%25en1]"); + //returns: + //{ + // host : "2001:db8::7%en1" + //} + +### IRI Support + + //convert IRI to URI + URI.serialize(URI.parse("http://examplé.org/rosé")) === "http://xn--exampl-gva.org/ros%C3%A9" + //convert URI to IRI + URI.serialize(URI.parse("http://xn--exampl-gva.org/ros%C3%A9"), {iri:true}) === "http://examplé.org/rosé" + +### Options + +All of the above functions can accept an additional options argument that is an object that can contain one or more of the following properties: + +* `scheme` (string) + + Indicates the scheme that the URI should be treated as, overriding the URI's normal scheme parsing behavior. + +* `reference` (string) + + If set to `"suffix"`, it indicates that the URI is in the suffix format, and the validator will use the option's `scheme` property to determine the URI's scheme. + +* `tolerant` (boolean, false) + + If set to `true`, the parser will relax URI resolving rules. + +* `absolutePath` (boolean, false) + + If set to `true`, the serializer will not resolve a relative `path` component. + +* `iri` (boolean, false) + + If set to `true`, the serializer will unescape non-ASCII characters as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). + +* `unicodeSupport` (boolean, false) + + If set to `true`, the parser will unescape non-ASCII characters in the parsed output as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). + +* `domainHost` (boolean, false) + + If set to `true`, the library will treat the `host` component as a domain name, and convert IDNs (International Domain Names) as per [RFC 5891](http://www.ietf.org/rfc/rfc5891.txt). + +## Scheme Extendable + +URI.js supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_scheme) dependent processing rules. Currently, URI.js has built in support for the following schemes: + +* http \[[RFC 2616](http://www.ietf.org/rfc/rfc2616.txt)\] +* https \[[RFC 2818](http://www.ietf.org/rfc/rfc2818.txt)\] +* ws \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\] +* wss \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\] +* mailto \[[RFC 6068](http://www.ietf.org/rfc/rfc6068.txt)\] +* urn \[[RFC 2141](http://www.ietf.org/rfc/rfc2141.txt)\] +* urn:uuid \[[RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)\] + +### HTTP/HTTPS Support + + URI.equal("HTTP://ABC.COM:80", "http://abc.com/") === true + URI.equal("https://abc.com", "HTTPS://ABC.COM:443/") === true + +### WS/WSS Support + + URI.parse("wss://example.com/foo?bar=baz"); + //returns: + //{ + // scheme : "wss", + // host: "example.com", + // resourceName: "/foo?bar=baz", + // secure: true, + //} + + URI.equal("WS://ABC.COM:80/chat#one", "ws://abc.com/chat") === true + +### Mailto Support + + URI.parse("mailto:alpha@example.com,bravo@example.com?subject=SUBSCRIBE&body=Sign%20me%20up!"); + //returns: + //{ + // scheme : "mailto", + // to : ["alpha@example.com", "bravo@example.com"], + // subject : "SUBSCRIBE", + // body : "Sign me up!" + //} + + URI.serialize({ + scheme : "mailto", + to : ["alpha@example.com"], + subject : "REMOVE", + body : "Please remove me", + headers : { + cc : "charlie@example.com" + } + }) === "mailto:alpha@example.com?cc=charlie@example.com&subject=REMOVE&body=Please%20remove%20me" + +### URN Support + + URI.parse("urn:example:foo"); + //returns: + //{ + // scheme : "urn", + // nid : "example", + // nss : "foo", + //} + +#### URN UUID Support + + URI.parse("urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"); + //returns: + //{ + // scheme : "urn", + // nid : "uuid", + // uuid : "f81d4fae-7dec-11d0-a765-00a0c91e6bf6", + //} + +## Usage + +To load in a browser, use the following tag: + + + +To load in a CommonJS/Module environment, first install with npm/yarn by running on the command line: + + npm install uri-js + # OR + yarn add uri-js + +Then, in your code, load it using: + + const URI = require("uri-js"); + +If you are writing your code in ES6+ (ESNEXT) or TypeScript, you would load it using: + + import * as URI from "uri-js"; + +Or you can load just what you need using named exports: + + import { parse, serialize, resolve, resolveComponents, normalize, equal, removeDotSegments, pctEncChar, pctDecChars, escapeComponent, unescapeComponent } from "uri-js"; + +## Breaking changes + +### Breaking changes from 3.x + +URN parsing has been completely changed to better align with the specification. Scheme is now always `urn`, but has two new properties: `nid` which contains the Namspace Identifier, and `nss` which contains the Namespace Specific String. The `nss` property will be removed by higher order scheme handlers, such as the UUID URN scheme handler. + +The UUID of a URN can now be found in the `uuid` property. + +### Breaking changes from 2.x + +URI validation has been removed as it was slow, exposed a vulnerabilty, and was generally not useful. + +### Breaking changes from 1.x + +The `errors` array on parsed components is now an `error` string. diff --git a/node_modules/uri-js/dist/es5/uri.all.d.ts b/node_modules/uri-js/dist/es5/uri.all.d.ts new file mode 100755 index 000000000..da51e2352 --- /dev/null +++ b/node_modules/uri-js/dist/es5/uri.all.d.ts @@ -0,0 +1,59 @@ +export interface URIComponents { + scheme?: string; + userinfo?: string; + host?: string; + port?: number | string; + path?: string; + query?: string; + fragment?: string; + reference?: string; + error?: string; +} +export interface URIOptions { + scheme?: string; + reference?: string; + tolerant?: boolean; + absolutePath?: boolean; + iri?: boolean; + unicodeSupport?: boolean; + domainHost?: boolean; +} +export interface URISchemeHandler { + scheme: string; + parse(components: ParentComponents, options: Options): Components; + serialize(components: Components, options: Options): ParentComponents; + unicodeSupport?: boolean; + domainHost?: boolean; + absolutePath?: boolean; +} +export interface URIRegExps { + NOT_SCHEME: RegExp; + NOT_USERINFO: RegExp; + NOT_HOST: RegExp; + NOT_PATH: RegExp; + NOT_PATH_NOSCHEME: RegExp; + NOT_QUERY: RegExp; + NOT_FRAGMENT: RegExp; + ESCAPE: RegExp; + UNRESERVED: RegExp; + OTHER_CHARS: RegExp; + PCT_ENCODED: RegExp; + IPV4ADDRESS: RegExp; + IPV6ADDRESS: RegExp; +} +export declare const SCHEMES: { + [scheme: string]: URISchemeHandler; +}; +export declare function pctEncChar(chr: string): string; +export declare function pctDecChars(str: string): string; +export declare function parse(uriString: string, options?: URIOptions): URIComponents; +export declare function removeDotSegments(input: string): string; +export declare function serialize(components: URIComponents, options?: URIOptions): string; +export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; +export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; +export declare function normalize(uri: string, options?: URIOptions): string; +export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; +export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; +export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; +export declare function escapeComponent(str: string, options?: URIOptions): string; +export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/node_modules/uri-js/dist/es5/uri.all.js b/node_modules/uri-js/dist/es5/uri.all.js new file mode 100755 index 000000000..0706116fe --- /dev/null +++ b/node_modules/uri-js/dist/es5/uri.all.js @@ -0,0 +1,1443 @@ +/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.URI = global.URI || {}))); +}(this, (function (exports) { 'use strict'; + +function merge() { + for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { + sets[_key] = arguments[_key]; + } + + if (sets.length > 1) { + sets[0] = sets[0].slice(0, -1); + var xl = sets.length - 1; + for (var x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } else { + return sets[0]; + } +} +function subexp(str) { + return "(?:" + str + ")"; +} +function typeOf(o) { + return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); +} +function toUpperCase(str) { + return str.toUpperCase(); +} +function toArray(obj) { + return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; +} +function assign(target, source) { + var obj = target; + if (source) { + for (var key in source) { + obj[key] = source[key]; + } + } + return obj; +} + +function buildExps(isIRI) { + var ALPHA$$ = "[A-Za-z]", + CR$ = "[\\x0D]", + DIGIT$$ = "[0-9]", + DQUOTE$$ = "[\\x22]", + HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), + //case-insensitive + LF$$ = "[\\x0A]", + SP$$ = "[\\x20]", + PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), + //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", + SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", + RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), + UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", + //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", + //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), + SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), + USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), + DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), + DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), + //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), + H16$ = subexp(HEXDIG$$ + "{1,4}"), + LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), + IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), + // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), + // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), + //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), + //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), + //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), + //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), + //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), + //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), + //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), + ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), + //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), + //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), + //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), + IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), + //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), + HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), + PORT$ = subexp(DIGIT$$ + "*"), + AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), + PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), + SEGMENT$ = subexp(PCHAR$ + "*"), + SEGMENT_NZ$ = subexp(PCHAR$ + "+"), + SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), + PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), + PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), + //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), + //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), + //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", + PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), + FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), + HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), + RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), + ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), + GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", + SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +var URI_PROTOCOL = buildExps(false); + +var IRI_PROTOCOL = buildExps(true); + +var slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); + + + + + + + + + + + + + +var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } +}; + +/** Highest positive signed 32-bit float value */ + +var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +var base = 36; +var tMin = 1; +var tMax = 26; +var skew = 38; +var damp = 700; +var initialBias = 72; +var initialN = 128; // 0x80 +var delimiter = '-'; // '\x2D' + +/** Regular expressions */ +var regexPunycode = /^xn--/; +var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars +var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +var errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +var baseMinusTMin = base - tMin; +var floor = Math.floor; +var stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error$1(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, fn) { + var result = []; + var length = array.length; + while (length--) { + result[length] = fn(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ +function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +var ucs2encode = function ucs2encode(array) { + return String.fromCodePoint.apply(String, toConsumableArray(array)); +}; + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +var basicToDigit = function basicToDigit(codePoint) { + if (codePoint - 0x30 < 0x0A) { + return codePoint - 0x16; + } + if (codePoint - 0x41 < 0x1A) { + return codePoint - 0x41; + } + if (codePoint - 0x61 < 0x1A) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +var digitToBasic = function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +var adapt = function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +var decode = function decode(input) { + // Don't use UCS-2. + var output = []; + var inputLength = input.length; + var i = 0; + var n = initialN; + var bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + var basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (var j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error$1('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + var oldi = i; + for (var w = 1, k = base;; /* no condition */k += base) { + + if (index >= inputLength) { + error$1('invalid-input'); + } + + var digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error$1('overflow'); + } + + i += digit * w; + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + + if (digit < t) { + break; + } + + var baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error$1('overflow'); + } + + w *= baseMinusT; + } + + var out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error$1('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + } + + return String.fromCodePoint.apply(String, output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +var encode = function encode(input) { + var output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + var inputLength = input.length; + + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; + + // Handle the basic code points. + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _currentValue2 = _step.value; + + if (_currentValue2 < 0x80) { + output.push(stringFromCharCode(_currentValue2)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var basicLength = output.length; + var handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + var m = maxInt; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var currentValue = _step2.value; + + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error$1('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _currentValue = _step3.value; + + if (_currentValue < n && ++delta > maxInt) { + error$1('overflow'); + } + if (_currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for (var k = base;; /* no condition */k += base) { + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (q < t) { + break; + } + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + ++delta; + ++n; + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +var toUnicode = function toUnicode(input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +var toASCII = function toASCII(input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +var punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +var SCHEMES = {}; +function pctEncChar(chr) { + var c = chr.charCodeAt(0); + var e = void 0; + if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); + return e; +} +function pctDecChars(str) { + var newStr = ""; + var i = 0; + var il = str.length; + while (i < il) { + var c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } else if (c >= 194 && c < 224) { + if (il - i >= 6) { + var c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); + } else { + newStr += str.substr(i, 6); + } + i += 6; + } else if (c >= 224) { + if (il - i >= 9) { + var _c = parseInt(str.substr(i + 4, 2), 16); + var c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); + } else { + newStr += str.substr(i, 9); + } + i += 9; + } else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; +} +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(protocol.UNRESERVED) ? str : decStr; + } + if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; +} + +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; +} +function _normalizeIPv4(host, protocol) { + var matches = host.match(protocol.IPV4ADDRESS) || []; + + var _matches = slicedToArray(matches, 2), + address = _matches[1]; + + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } else { + return host; + } +} +function _normalizeIPv6(host, protocol) { + var matches = host.match(protocol.IPV6ADDRESS) || []; + + var _matches2 = slicedToArray(matches, 3), + address = _matches2[1], + zone = _matches2[2]; + + if (address) { + var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), + _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), + last = _address$toLowerCase$2[0], + first = _address$toLowerCase$2[1]; + + var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + var lastFields = last.split(":").map(_stripLeadingZeros); + var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + var fieldCount = isLastFieldIPv4Address ? 7 : 8; + var lastFieldsStart = lastFields.length - fieldCount; + var fields = Array(fieldCount); + for (var x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + var allZeroFields = fields.reduce(function (acc, field, index) { + if (!field || field === "0") { + var lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } else { + acc.push({ index: index, length: 1 }); + } + } + return acc; + }, []); + var longestZeroFields = allZeroFields.sort(function (a, b) { + return b.length - a.length; + })[0]; + var newHost = void 0; + if (longestZeroFields && longestZeroFields.length > 1) { + var newFirst = fields.slice(0, longestZeroFields.index); + var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } else { + return host; + } +} +var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; +function parse(uriString) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var components = {}; + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + var matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } else { + //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; + components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; + components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; + //fix port number + if (isNaN(components.port)) { + components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } else if (components.scheme === undefined) { + components.reference = "relative"; + } else if (components.fragment === undefined) { + components.reference = "absolute"; + } else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } else { + components.error = components.error || "URI can not be parsed."; + } + return components; +} + +function _recomposeAuthority(components, options) { + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { + return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; + })); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} + +var RDS1 = /^\.\.?\//; +var RDS2 = /^\/\.(\/|$)/; +var RDS3 = /^\/\.\.(\/|$)/; +var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +function removeDotSegments(input) { + var output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } else if (input === "." || input === "..") { + input = ""; + } else { + var im = input.match(RDS5); + if (im) { + var s = im[0]; + input = input.slice(s.length); + output.push(s); + } else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} + +function serialize(components) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) {} + //TODO: normalize IPv6 address as per RFC 5952 + + //if host component is a domain name + else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { + //convert IDN via punycode + try { + components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } + } + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + var authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + var s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} + +function resolveComponents(base, relative) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var skipNormalization = arguments[3]; + + var target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } else { + target.query = base.query; + } + } else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } else if (!base.path) { + target.path = relative.path; + } else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative.fragment; + return target; +} + +function resolve(baseURI, relativeURI, options) { + var schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); +} + +function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); + } + return uri; +} + +function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} + +function escapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); +} + +function unescapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); +} + +var handler = { + scheme: "http", + domainHost: true, + parse: function parse(components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function serialize(components, options) { + var secure = String(components.scheme).toLowerCase() === "https"; + //normalize the default port + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; + +var handler$1 = { + scheme: "https", + domainHost: handler.domainHost, + parse: handler.parse, + serialize: handler.serialize +}; + +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +var handler$2 = { + scheme: "ws", + domainHost: true, + parse: function parse(components, options) { + var wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function serialize(wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + var _wsComponents$resourc = wsComponents.resourceName.split('?'), + _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), + path = _wsComponents$resourc2[0], + query = _wsComponents$resourc2[1]; + + wsComponents.path = path && path !== '/' ? path : undefined; + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; + +var handler$3 = { + scheme: "wss", + domainHost: handler$2.domainHost, + parse: handler$2.parse, + serialize: handler$2.serialize +}; + +var O = {}; +var isIRI = true; +//RFC 3986 +var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +var UNRESERVED = new RegExp(UNRESERVED$$, "g"); +var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +var NOT_HFVALUE = NOT_HFNAME; +function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(UNRESERVED) ? str : decStr; +} +var handler$4 = { + scheme: "mailto", + parse: function parse$$1(components, options) { + var mailtoComponents = components; + var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + var unknownHeaders = false; + var headers = {}; + var hfields = mailtoComponents.query.split("&"); + for (var x = 0, xl = hfields.length; x < xl; ++x) { + var hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + var toAddrs = hfield[1].split(","); + for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { + to.push(toAddrs[_x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { + var addr = to[_x2].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[_x2] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function serialize$$1(mailtoComponents, options) { + var components = mailtoComponents; + var to = toArray(mailtoComponents.to); + if (to) { + for (var x = 0, xl = to.length; x < xl; ++x) { + var toAddr = String(to[x]); + var atIdx = toAddr.lastIndexOf("@"); + var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + var domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); + } catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + var headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) headers["body"] = mailtoComponents.body; + var fields = []; + for (var name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } +}; + +var URN_PARSE = /^([^\:]+)\:(.*)/; +//RFC 2141 +var handler$5 = { + scheme: "urn", + parse: function parse$$1(components, options) { + var matches = components.path && components.path.match(URN_PARSE); + var urnComponents = components; + if (matches) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = matches[1].toLowerCase(); + var nss = matches[2]; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function serialize$$1(urnComponents, options) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = urnComponents.nid; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + var uriComponents = urnComponents; + var nss = urnComponents.nss; + uriComponents.path = (nid || options.nid) + ":" + nss; + return uriComponents; + } +}; + +var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +//RFC 4122 +var handler$6 = { + scheme: "urn:uuid", + parse: function parse(urnComponents, options) { + var uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function serialize(uuidComponents, options) { + var urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + } +}; + +SCHEMES[handler.scheme] = handler; +SCHEMES[handler$1.scheme] = handler$1; +SCHEMES[handler$2.scheme] = handler$2; +SCHEMES[handler$3.scheme] = handler$3; +SCHEMES[handler$4.scheme] = handler$4; +SCHEMES[handler$5.scheme] = handler$5; +SCHEMES[handler$6.scheme] = handler$6; + +exports.SCHEMES = SCHEMES; +exports.pctEncChar = pctEncChar; +exports.pctDecChars = pctDecChars; +exports.parse = parse; +exports.removeDotSegments = removeDotSegments; +exports.serialize = serialize; +exports.resolveComponents = resolveComponents; +exports.resolve = resolve; +exports.normalize = normalize; +exports.equal = equal; +exports.escapeComponent = escapeComponent; +exports.unescapeComponent = unescapeComponent; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=uri.all.js.map diff --git a/node_modules/uri-js/dist/es5/uri.all.js.map b/node_modules/uri-js/dist/es5/uri.all.js.map new file mode 100755 index 000000000..5b30c4e22 --- /dev/null +++ b/node_modules/uri-js/dist/es5/uri.all.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uri.all.js","sources":["../../src/index.ts","../../src/schemes/urn-uuid.ts","../../src/schemes/urn.ts","../../src/schemes/mailto.ts","../../src/schemes/wss.ts","../../src/schemes/ws.ts","../../src/schemes/https.ts","../../src/schemes/http.ts","../../src/uri.ts","../../node_modules/punycode/punycode.es6.js","../../src/regexps-iri.ts","../../src/regexps-uri.ts","../../src/util.ts"],"sourcesContent":["import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","export function merge(...sets:Array):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}"],"names":["SCHEMES","uuid","scheme","urn","mailto","wss","ws","https","http","urnComponents","nss","uuidComponents","toLowerCase","options","error","tolerant","match","UUID","undefined","handler","uriComponents","path","nid","schemeHandler","serialize","urnScheme","parse","matches","components","URN_PARSE","query","fields","join","length","push","name","replace","PCT_ENCODED","decodeUnreserved","toUpperCase","NOT_HFNAME","pctEncChar","headers","NOT_HFVALUE","O","mailtoComponents","body","subject","to","x","localPart","domain","iri","e","punycode","toASCII","unescapeComponent","toUnicode","toAddr","slice","atIdx","NOT_LOCAL_PART","lastIndexOf","String","xl","toArray","addr","unicodeSupport","split","unknownHeaders","hfield","toAddrs","hfields","decStr","UNRESERVED","str","pctDecChars","RegExp","merge","UNRESERVED$$","SOME_DELIMS$$","ATEXT$$","VCHAR$$","PCT_ENCODED$","QTEXT$$","subexp","HEXDIG$$","isIRI","domainHost","wsComponents","fragment","resourceName","secure","port","isSecure","host","toString","URI_PROTOCOL","IRI_PROTOCOL","ESCAPE","escapeComponent","uriA","uriB","typeOf","equal","uri","normalize","resolveComponents","baseURI","schemelessOptions","relativeURI","assign","resolve","target","relative","base","userinfo","removeDotSegments","charAt","skipNormalization","uriTokens","s","authority","absolutePath","reference","_recomposeAuthority","protocol","IPV6ADDRESS","test","output","Error","input","im","RDS5","pop","RDS3","RDS2","RDS1","$1","$2","_normalizeIPv6","_normalizeIPv4","_","uriString","isNaN","indexOf","parseInt","NO_MATCH_IS_UNDEFINED","URI_PARSE","newHost","zone","newFirst","newLast","longestZeroFields","index","b","a","allZeroFields","sort","acc","lastLongest","field","reduce","fieldCount","isLastFieldIPv4Address","firstFields","lastFields","lastFieldsStart","Array","IPV4ADDRESS","last","map","_stripLeadingZeros","first","address","reverse","NOT_FRAGMENT","NOT_QUERY","NOT_PATH","NOT_PATH_NOSCHEME","NOT_HOST","NOT_USERINFO","NOT_SCHEME","_normalizeComponentEncoding","newStr","substr","i","fromCharCode","c","c2","c3","il","chr","charCodeAt","encode","decode","ucs2encode","ucs2decode","regexNonASCII","string","mapDomain","regexPunycode","n","delta","handledCPCount","adapt","handledCPCountPlusOne","basicLength","stringFromCharCode","digitToBasic","q","floor","qMinusT","baseMinusT","t","k","bias","tMin","tMax","currentValue","maxInt","m","inputLength","delimiter","initialBias","initialN","fromCodePoint","splice","out","oldi","w","digit","basicToDigit","basic","j","baseMinusTMin","skew","numPoints","firstTime","damp","flag","codePoint","array","value","extra","counter","result","encoded","labels","fn","regexSeparators","parts","RangeError","errors","type","Math","buildExps","IPV6ADDRESS$","ZONEID$","IPV4ADDRESS$","RESERVED$$","SUB_DELIMS$$","IPRIVATE$$","ALPHA$$","DIGIT$$","AUTHORITY_REF$","USERINFO$","HOST$","PORT$","SAMEDOC_REF$","FRAGMENT$","ABSOLUTE_REF$","SCHEME$","PATH_ABEMPTY$","PATH_ABSOLUTE$","PATH_ROOTLESS$","PATH_EMPTY$","QUERY$","RELATIVE_REF$","PATH_NOSCHEME$","GENERIC_REF$","ABSOLUTE_URI$","HIER_PART$","URI_REFERENCE$","URI$","RELATIVE$","RELATIVE_PART$","AUTHORITY$","PCHAR$","PATH$","SEGMENT_NZ$","SEGMENT_NZ_NC$","SEGMENT$","IP_LITERAL$","REG_NAME$","IPV6ADDRZ_RELAXED$","IPVFUTURE$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","H16$","LS32$","DEC_OCTET_RELAXED$","DEC_OCTET$","UCSCHAR$$","GEN_DELIMS$$","SP$$","DQUOTE$$","CR$","obj","key","source","setInterval","call","prototype","o","Object","shift","sets"],"mappings":";;;;;;;AYAA,SAAA8E,KAAA,GAAA;sCAAyBsP,IAAzB;YAAA;;;QACKA,KAAKnS,MAAL,GAAc,CAAlB,EAAqB;aACf,CAAL,IAAUmS,KAAK,CAAL,EAAQzQ,KAAR,CAAc,CAAd,EAAiB,CAAC,CAAlB,CAAV;YACMK,KAAKoQ,KAAKnS,MAAL,GAAc,CAAzB;aACK,IAAIgB,IAAI,CAAb,EAAgBA,IAAIe,EAApB,EAAwB,EAAEf,CAA1B,EAA6B;iBACvBA,CAAL,IAAUmR,KAAKnR,CAAL,EAAQU,KAAR,CAAc,CAAd,EAAiB,CAAC,CAAlB,CAAV;;aAEIK,EAAL,IAAWoQ,KAAKpQ,EAAL,EAASL,KAAT,CAAe,CAAf,CAAX;eACOyQ,KAAKpS,IAAL,CAAU,EAAV,CAAP;KAPD,MAQO;eACCoS,KAAK,CAAL,CAAP;;;AAIF,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AKN,MAAb,IAAuBM,OAAvB;AAEA,AACAR,QAAQO,UAAML,MAAd,IAAwBK,SAAxB;AAEA,AACAP,QAAQM,UAAGJ,MAAX,IAAqBI,SAArB;AAEA,AACAN,QAAQK,UAAIH,MAAZ,IAAsBG,SAAtB;AAEA,AACAL,QAAQI,UAAOF,MAAf,IAAyBE,SAAzB;AAEA,AACAJ,QAAQG,UAAID,MAAZ,IAAsBC,SAAtB;AAEA,AACAH,QAAQC,UAAKC,MAAb,IAAuBD,SAAvB,CAEA;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/es5/uri.all.min.d.ts b/node_modules/uri-js/dist/es5/uri.all.min.d.ts new file mode 100755 index 000000000..da51e2352 --- /dev/null +++ b/node_modules/uri-js/dist/es5/uri.all.min.d.ts @@ -0,0 +1,59 @@ +export interface URIComponents { + scheme?: string; + userinfo?: string; + host?: string; + port?: number | string; + path?: string; + query?: string; + fragment?: string; + reference?: string; + error?: string; +} +export interface URIOptions { + scheme?: string; + reference?: string; + tolerant?: boolean; + absolutePath?: boolean; + iri?: boolean; + unicodeSupport?: boolean; + domainHost?: boolean; +} +export interface URISchemeHandler { + scheme: string; + parse(components: ParentComponents, options: Options): Components; + serialize(components: Components, options: Options): ParentComponents; + unicodeSupport?: boolean; + domainHost?: boolean; + absolutePath?: boolean; +} +export interface URIRegExps { + NOT_SCHEME: RegExp; + NOT_USERINFO: RegExp; + NOT_HOST: RegExp; + NOT_PATH: RegExp; + NOT_PATH_NOSCHEME: RegExp; + NOT_QUERY: RegExp; + NOT_FRAGMENT: RegExp; + ESCAPE: RegExp; + UNRESERVED: RegExp; + OTHER_CHARS: RegExp; + PCT_ENCODED: RegExp; + IPV4ADDRESS: RegExp; + IPV6ADDRESS: RegExp; +} +export declare const SCHEMES: { + [scheme: string]: URISchemeHandler; +}; +export declare function pctEncChar(chr: string): string; +export declare function pctDecChars(str: string): string; +export declare function parse(uriString: string, options?: URIOptions): URIComponents; +export declare function removeDotSegments(input: string): string; +export declare function serialize(components: URIComponents, options?: URIOptions): string; +export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; +export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; +export declare function normalize(uri: string, options?: URIOptions): string; +export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; +export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; +export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; +export declare function escapeComponent(str: string, options?: URIOptions): string; +export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/node_modules/uri-js/dist/es5/uri.all.min.js b/node_modules/uri-js/dist/es5/uri.all.min.js new file mode 100755 index 000000000..fcd845862 --- /dev/null +++ b/node_modules/uri-js/dist/es5/uri.all.min.js @@ -0,0 +1,3 @@ +/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.URI=e.URI||{})}(this,function(e){"use strict";function r(){for(var e=arguments.length,r=Array(e),n=0;n1){r[0]=r[0].slice(0,-1);for(var t=r.length-1,o=1;o1&&(t=n[0]+"@",e=n[1]),e=e.replace(j,"."),t+f(e.split("."),r).join(".")}function p(e){for(var r=[],n=0,t=e.length;n=55296&&o<=56319&&n>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function d(e){for(var r="",n=0,t=e.length;n=194&&o<224){if(t-n>=6){var a=parseInt(e.substr(n+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(n,6);n+=6}else if(o>=224){if(t-n>=9){var i=parseInt(e.substr(n+4,2),16),u=parseInt(e.substr(n+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&u)}else r+=e.substr(n,9);n+=9}else r+=e.substr(n,3),n+=3}return r}function l(e,r){function n(e){var n=d(e);return n.match(r.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_SCHEME,"")),e.userinfo!==undefined&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,n).replace(r.NOT_USERINFO,h).replace(r.PCT_ENCODED,o)),e.host!==undefined&&(e.host=String(e.host).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_HOST,h).replace(r.PCT_ENCODED,o)),e.path!==undefined&&(e.path=String(e.path).replace(r.PCT_ENCODED,n).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,h).replace(r.PCT_ENCODED,o)),e.query!==undefined&&(e.query=String(e.query).replace(r.PCT_ENCODED,n).replace(r.NOT_QUERY,h).replace(r.PCT_ENCODED,o)),e.fragment!==undefined&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,n).replace(r.NOT_FRAGMENT,h).replace(r.PCT_ENCODED,o)),e}function m(e){return e.replace(/^0*(.*)/,"$1")||"0"}function g(e,r){var n=e.match(r.IPV4ADDRESS)||[],t=T(n,2),o=t[1];return o?o.split(".").map(m).join("."):e}function v(e,r){var n=e.match(r.IPV6ADDRESS)||[],t=T(n,3),o=t[1],a=t[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),u=T(i,2),s=u[0],f=u[1],c=f?f.split(":").map(m):[],p=s.split(":").map(m),h=r.IPV4ADDRESS.test(p[p.length-1]),d=h?7:8,l=p.length-d,v=Array(d),E=0;E1){var A=v.slice(0,y.index),D=v.slice(y.index+y.length);S=A.join(":")+"::"+D.join(":")}else S=v.join(":");return a&&(S+="%"+a),S}return e}function E(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n={},t=!1!==r.iri?R:F;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(K);if(o){W?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||undefined,n.userinfo=-1!==e.indexOf("@")?o[3]:undefined,n.host=-1!==e.indexOf("//")?o[4]:undefined,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:undefined,n.fragment=-1!==e.indexOf("#")?o[8]:undefined,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined)),n.host&&(n.host=v(g(n.host,t),t)),n.scheme!==undefined||n.userinfo!==undefined||n.host!==undefined||n.port!==undefined||n.path||n.query!==undefined?n.scheme===undefined?n.reference="relative":n.fragment===undefined?n.reference="absolute":n.reference="uri":n.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");var a=J[(r.scheme||n.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)l(n,t);else{if(n.host&&(r.domainHost||a&&a.domainHost))try{n.host=B.toASCII(n.host.replace(t.PCT_ENCODED,d).toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+i}l(n,F)}a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}function C(e,r){var n=!1!==r.iri?R:F,t=[];return e.userinfo!==undefined&&(t.push(e.userinfo),t.push("@")),e.host!==undefined&&t.push(v(g(String(e.host),n),n).replace(n.IPV6ADDRESS,function(e,r,n){return"["+r+(n?"%25"+n:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):undefined}function y(e){for(var r=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(ee))e=e.replace(ee,"/");else if(e.match(re))e=e.replace(re,"/"),r.pop();else if("."===e||".."===e)e="";else{var n=e.match(ne);if(!n)throw new Error("Unexpected dot segment condition");var t=n[0];e=e.slice(t.length),r.push(t)}return r.join("")}function S(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.iri?R:F,t=[],o=J[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(n.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?B.toUnicode(e.host):B.toASCII(e.host.replace(n.PCT_ENCODED,d).toLowerCase())}catch(u){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+u}l(e,n),"suffix"!==r.reference&&e.scheme&&(t.push(e.scheme),t.push(":"));var a=C(e,r);if(a!==undefined&&("suffix"!==r.reference&&t.push("//"),t.push(a),e.path&&"/"!==e.path.charAt(0)&&t.push("/")),e.path!==undefined){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=y(i)),a===undefined&&(i=i.replace(/^\/\//,"/%2F")),t.push(i)}return e.query!==undefined&&(t.push("?"),t.push(e.query)),e.fragment!==undefined&&(t.push("#"),t.push(e.fragment)),t.join("")}function A(e,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},t=arguments[3],o={};return t||(e=E(S(e,n),n),r=E(S(r,n),n)),n=n||{},!n.tolerant&&r.scheme?(o.scheme=r.scheme,o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined?(o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.path?("/"===r.path.charAt(0)?o.path=y(r.path):(e.userinfo===undefined&&e.host===undefined&&e.port===undefined||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:o.path=r.path:o.path="/"+r.path,o.path=y(o.path)),o.query=r.query):(o.path=e.path,r.query!==undefined?o.query=r.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=r.fragment,o}function D(e,r,n){var t=i({scheme:"null"},n);return S(A(E(e,t),E(r,t),t,!0),t)}function w(e,r){return"string"==typeof e?e=S(E(e,r),r):"object"===t(e)&&(e=E(S(e,r),r)),e}function b(e,r,n){return"string"==typeof e?e=S(E(e,n),n):"object"===t(e)&&(e=S(e,n)),"string"==typeof r?r=S(E(r,n),n):"object"===t(r)&&(r=S(r,n)),e===r}function x(e,r){return e&&e.toString().replace(r&&r.iri?R.ESCAPE:F.ESCAPE,h)}function O(e,r){return e&&e.toString().replace(r&&r.iri?R.PCT_ENCODED:F.PCT_ENCODED,d)}function N(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function I(e){var r=d(e);return r.match(he)?r:e}var F=u(!1),R=u(!0),T=function(){function e(e,r){var n=[],t=!0,o=!1,a=undefined;try{for(var i,u=e[Symbol.iterator]();!(t=(i=u.next()).done)&&(n.push(i.value),!r||n.length!==r);t=!0);}catch(s){o=!0,a=s}finally{try{!t&&u["return"]&&u["return"]()}finally{if(o)throw a}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(e){if(Array.isArray(e)){for(var r=0,n=Array(e.length);r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,L=String.fromCharCode,$=function(e){return String.fromCodePoint.apply(String,_(e))},M=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36},V=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},k=function(e,r,n){var t=0;for(e=n?z(e/700):e>>1,e+=z(e/r);e>455;t+=36)e=z(e/35);return z(t+36*e/(e+38))},Z=function(e){var r=[],n=e.length,t=0,o=128,a=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var u=0;u=128&&s("not-basic"),r.push(e.charCodeAt(u));for(var f=i>0?i+1:0;f=n&&s("invalid-input");var d=M(e.charCodeAt(f++));(d>=36||d>z((P-t)/p))&&s("overflow"),t+=d*p;var l=h<=a?1:h>=a+26?26:h-a;if(dz(P/m)&&s("overflow"),p*=m}var g=r.length+1;a=k(t-c,g,0==c),z(t/g)>P-o&&s("overflow"),o+=z(t/g),t%=g,r.splice(t++,0,o)}return String.fromCodePoint.apply(String,r)},G=function(e){var r=[];e=p(e);var n=e.length,t=128,o=0,a=72,i=!0,u=!1,f=undefined;try{for(var c,h=e[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;d<128&&r.push(L(d))}}catch(U){u=!0,f=U}finally{try{!i&&h["return"]&&h["return"]()}finally{if(u)throw f}}var l=r.length,m=l;for(l&&r.push("-");m=t&&Az((P-o)/D)&&s("overflow"),o+=(g-t)*D,t=g;var w=!0,b=!1,x=undefined;try{for(var O,N=e[Symbol.iterator]();!(w=(O=N.next()).done);w=!0){var I=O.value;if(IP&&s("overflow"),I==t){for(var F=o,R=36;;R+=36){var T=R<=a?1:R>=a+26?26:R-a;if(FA-Z\\x5E-\\x7E]",'[\\"\\\\]'),he=new RegExp(se,"g"),de=new RegExp(ce,"g"),le=new RegExp(r("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',pe),"g"),me=new RegExp(r("[^]",se,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ge=me,ve={scheme:"mailto",parse:function(e,r){var n=e,t=n.to=n.path?n.path.split(","):[];if(n.path=undefined,n.query){for(var o=!1,a={},i=n.query.split("&"),u=0,s=i.length;u):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n"]} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/index.d.ts b/node_modules/uri-js/dist/esnext/index.d.ts new file mode 100755 index 000000000..f6be76034 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/index.d.ts @@ -0,0 +1 @@ +export * from "./uri"; diff --git a/node_modules/uri-js/dist/esnext/index.js b/node_modules/uri-js/dist/esnext/index.js new file mode 100755 index 000000000..e3531b5b6 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/index.js @@ -0,0 +1,17 @@ +import { SCHEMES } from "./uri"; +import http from "./schemes/http"; +SCHEMES[http.scheme] = http; +import https from "./schemes/https"; +SCHEMES[https.scheme] = https; +import ws from "./schemes/ws"; +SCHEMES[ws.scheme] = ws; +import wss from "./schemes/wss"; +SCHEMES[wss.scheme] = wss; +import mailto from "./schemes/mailto"; +SCHEMES[mailto.scheme] = mailto; +import urn from "./schemes/urn"; +SCHEMES[urn.scheme] = urn; +import uuid from "./schemes/urn-uuid"; +SCHEMES[uuid.scheme] = uuid; +export * from "./uri"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/index.js.map b/node_modules/uri-js/dist/esnext/index.js.map new file mode 100755 index 000000000..0971f6ebc --- /dev/null +++ b/node_modules/uri-js/dist/esnext/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AAE9B,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9B,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AAExB,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAEhC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,cAAc,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.d.ts b/node_modules/uri-js/dist/esnext/regexps-iri.d.ts new file mode 100755 index 000000000..c91cdacbc --- /dev/null +++ b/node_modules/uri-js/dist/esnext/regexps-iri.d.ts @@ -0,0 +1,3 @@ +import { URIRegExps } from "./uri"; +declare const _default: URIRegExps; +export default _default; diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.js b/node_modules/uri-js/dist/esnext/regexps-iri.js new file mode 100755 index 000000000..34e7de989 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/regexps-iri.js @@ -0,0 +1,3 @@ +import { buildExps } from "./regexps-uri"; +export default buildExps(true); +//# sourceMappingURL=regexps-iri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.js.map b/node_modules/uri-js/dist/esnext/regexps-iri.js.map new file mode 100755 index 000000000..2269c580c --- /dev/null +++ b/node_modules/uri-js/dist/esnext/regexps-iri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regexps-iri.js","sourceRoot":"","sources":["../../src/regexps-iri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAe,SAAS,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.d.ts b/node_modules/uri-js/dist/esnext/regexps-uri.d.ts new file mode 100755 index 000000000..6096bda5c --- /dev/null +++ b/node_modules/uri-js/dist/esnext/regexps-uri.d.ts @@ -0,0 +1,4 @@ +import { URIRegExps } from "./uri"; +export declare function buildExps(isIRI: boolean): URIRegExps; +declare const _default: URIRegExps; +export default _default; diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.js b/node_modules/uri-js/dist/esnext/regexps-uri.js new file mode 100755 index 000000000..1cc659f13 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/regexps-uri.js @@ -0,0 +1,42 @@ +import { merge, subexp } from "./util"; +export function buildExps(isIRI) { + const ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive + LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +export default buildExps(false); +//# sourceMappingURL=regexps-uri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.js.map b/node_modules/uri-js/dist/esnext/regexps-uri.js.map new file mode 100755 index 000000000..cb028b804 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/regexps-uri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regexps-uri.js","sourceRoot":"","sources":["../../src/regexps-uri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,K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d.ts new file mode 100755 index 000000000..fe5b2f354 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/http.d.ts @@ -0,0 +1,3 @@ +import { URISchemeHandler } from "../uri"; +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js b/node_modules/uri-js/dist/esnext/schemes/http.js new file mode 100755 index 000000000..6abf0fe6e --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/http.js @@ -0,0 +1,28 @@ +const handler = { + scheme: "http", + domainHost: true, + parse: function (components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function (components, options) { + const secure = String(components.scheme).toLowerCase() === "https"; + //normalize the default port + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; +export default handler; +//# sourceMappingURL=http.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js.map b/node_modules/uri-js/dist/esnext/schemes/http.js.map new file mode 100755 index 000000000..82118970c --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/http.js.map @@ -0,0 +1 @@ +{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/schemes/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,MAAM;IAEf,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,qBAAqB;QACrB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6BAA6B,CAAC;SACrE;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,SAAS,EAAG,UAAU,UAAwB,EAAE,OAAkB;QACjE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;QAEnE,4BAA4B;QAC5B,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,EAAE,EAAE;YACtE,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC;SAC5B;QAED,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;SACtB;QAED,mDAAmD;QACnD,oEAAoE;QACpE,wBAAwB;QAExB,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/https.d.ts b/node_modules/uri-js/dist/esnext/schemes/https.d.ts new file mode 100755 index 000000000..fe5b2f354 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/https.d.ts @@ -0,0 +1,3 @@ +import { URISchemeHandler } from "../uri"; +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/https.js b/node_modules/uri-js/dist/esnext/schemes/https.js new file mode 100755 index 000000000..ec4b6e76d --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/https.js @@ -0,0 +1,9 @@ +import http from "./http"; +const handler = { + scheme: "https", + domainHost: http.domainHost, + parse: http.parse, + serialize: http.serialize +}; +export default handler; +//# sourceMappingURL=https.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/https.js.map b/node_modules/uri-js/dist/esnext/schemes/https.js.map new file mode 100755 index 000000000..385b8efea --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/https.js.map @@ -0,0 +1 @@ +{"version":3,"file":"https.js","sourceRoot":"","sources":["../../../src/schemes/https.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,OAAO;IAChB,UAAU,EAAG,IAAI,CAAC,UAAU;IAC5B,KAAK,EAAG,IAAI,CAAC,KAAK;IAClB,SAAS,EAAG,IAAI,CAAC,SAAS;CAC1B,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts b/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts new file mode 100755 index 000000000..e2aefc2af --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts @@ -0,0 +1,12 @@ +import { URISchemeHandler, URIComponents } from "../uri"; +export interface MailtoHeaders { + [hfname: string]: string; +} +export interface MailtoComponents extends URIComponents { + to: Array; + headers?: MailtoHeaders; + subject?: string; + body?: string; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.js b/node_modules/uri-js/dist/esnext/schemes/mailto.js new file mode 100755 index 000000000..2553713cd --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/mailto.js @@ -0,0 +1,148 @@ +import { pctEncChar, pctDecChars, unescapeComponent } from "../uri"; +import punycode from "punycode"; +import { merge, subexp, toUpperCase, toArray } from "../util"; +const O = {}; +const isIRI = true; +//RFC 3986 +const UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +const HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +const PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +const ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +const QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +const VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +const DOT_ATOM_TEXT$ = subexp(ATEXT$$ + "+" + subexp("\\." + ATEXT$$ + "+") + "*"); +const QUOTED_PAIR$ = subexp("\\\\" + VCHAR$$); +const QCONTENT$ = subexp(QTEXT$$ + "|" + QUOTED_PAIR$); +const QUOTED_STRING$ = subexp('\\"' + QCONTENT$ + "*" + '\\"'); +//RFC 6068 +const DTEXT_NO_OBS$$ = "[\\x21-\\x5A\\x5E-\\x7E]"; //%d33-90 / %d94-126 +const SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +const QCHAR$ = subexp(UNRESERVED$$ + "|" + PCT_ENCODED$ + "|" + SOME_DELIMS$$); +const DOMAIN$ = subexp(DOT_ATOM_TEXT$ + "|" + "\\[" + DTEXT_NO_OBS$$ + "*" + "\\]"); +const LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + "|" + QUOTED_STRING$); +const ADDR_SPEC$ = subexp(LOCAL_PART$ + "\\@" + DOMAIN$); +const TO$ = subexp(ADDR_SPEC$ + subexp("\\," + ADDR_SPEC$) + "*"); +const HFNAME$ = subexp(QCHAR$ + "*"); +const HFVALUE$ = HFNAME$; +const HFIELD$ = subexp(HFNAME$ + "\\=" + HFVALUE$); +const HFIELDS2$ = subexp(HFIELD$ + subexp("\\&" + HFIELD$) + "*"); +const HFIELDS$ = subexp("\\?" + HFIELDS2$); +const MAILTO_URI = new RegExp("^mailto\\:" + TO$ + "?" + HFIELDS$ + "?$"); +const UNRESERVED = new RegExp(UNRESERVED$$, "g"); +const PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +const NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +const NOT_DOMAIN = new RegExp(merge("[^]", ATEXT$$, "[\\.]", "[\\[]", DTEXT_NO_OBS$$, "[\\]]"), "g"); +const NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +const NOT_HFVALUE = NOT_HFNAME; +const TO = new RegExp("^" + TO$ + "$"); +const HFIELDS = new RegExp("^" + HFIELDS2$ + "$"); +function decodeUnreserved(str) { + const decStr = pctDecChars(str); + return (!decStr.match(UNRESERVED) ? str : decStr); +} +const handler = { + scheme: "mailto", + parse: function (components, options) { + const mailtoComponents = components; + const to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(",") : []); + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + let unknownHeaders = false; + const headers = {}; + const hfields = mailtoComponents.query.split("&"); + for (let x = 0, xl = hfields.length; x < xl; ++x) { + const hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + const toAddrs = hfield[1].split(","); + for (let x = 0, xl = toAddrs.length; x < xl; ++x) { + to.push(toAddrs[x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) + mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (let x = 0, xl = to.length; x < xl; ++x) { + const addr = to[x].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } + catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } + else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[x] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function (mailtoComponents, options) { + const components = mailtoComponents; + const to = toArray(mailtoComponents.to); + if (to) { + for (let x = 0, xl = to.length; x < xl; ++x) { + const toAddr = String(to[x]); + const atIdx = toAddr.lastIndexOf("@"); + const localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + let domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain)); + } + catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + const headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) + headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) + headers["body"] = mailtoComponents.body; + const fields = []; + for (const name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + + "=" + + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } +}; +export default handler; +//# sourceMappingURL=mailto.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.js.map b/node_modules/uri-js/dist/esnext/schemes/mailto.js.map new file mode 100755 index 000000000..82dba9a16 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/mailto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mailto.js","sourceRoot":"","sources":["../../../src/schemes/mailto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAa9D,MAAM,CAAC,GAAiB,EAAE,CAAC;AAC3B,MAAM,KAAK,GAAG,IAAI,CAAC;AAEnB,UAAU;AACV,MAAM,YAAY,GAAG,wBAAwB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,2EAA2E,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;AACjJ,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAE,kBAAkB;AACnD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,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,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC;oBAC7G,GAAG;oBACH,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,CACvH,CAAC;aACF;SACD;QACD,IAAI,MAAM,CAAC,MAAM,EAAE;YAClB,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACpC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts new file mode 100755 index 000000000..e75f2e793 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts @@ -0,0 +1,7 @@ +import { URISchemeHandler, URIOptions } from "../uri"; +import { URNComponents } from "./urn"; +export interface UUIDComponents extends URNComponents { + uuid?: string; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js new file mode 100755 index 000000000..d1fce4955 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js @@ -0,0 +1,23 @@ +const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/; +//RFC 4122 +const handler = { + scheme: "urn:uuid", + parse: function (urnComponents, options) { + const uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function (uuidComponents, options) { + const urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + }, +}; +export default handler; +//# sourceMappingURL=urn-uuid.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map new file mode 100755 index 000000000..3b7a8b3ae --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map @@ -0,0 +1 @@ +{"version":3,"file":"urn-uuid.js","sourceRoot":"","sources":["../../../src/schemes/urn-uuid.ts"],"names":[],"mappings":"AAQA,MAAM,IAAI,GAAG,0DAA0D,CAAC;AACxE,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,UAAU;AACV,MAAM,OAAO,GAA+D;IAC3E,MAAM,EAAG,UAAU;IAEnB,KAAK,EAAG,UAAU,aAA2B,EAAE,OAAkB;QAChE,MAAM,cAAc,GAAG,aAA+B,CAAC;QACvD,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC;QACzC,cAAc,CAAC,GAAG,GAAG,SAAS,CAAC;QAE/B,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE;YACpF,cAAc,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,IAAI,oBAAoB,CAAC;SACpE;QAED,OAAO,cAAc,CAAC;IACvB,CAAC;IAED,SAAS,EAAG,UAAU,cAA6B,EAAE,OAAkB;QACtE,MAAM,aAAa,GAAG,cAA+B,CAAC;QACtD,gBAAgB;QAChB,aAAa,CAAC,GAAG,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9D,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.d.ts b/node_modules/uri-js/dist/esnext/schemes/urn.d.ts new file mode 100755 index 000000000..7e0c2fba6 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/urn.d.ts @@ -0,0 +1,10 @@ +import { URISchemeHandler, URIComponents, URIOptions } from "../uri"; +export interface URNComponents extends URIComponents { + nid?: string; + nss?: string; +} +export interface URNOptions extends URIOptions { + nid?: string; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.js b/node_modules/uri-js/dist/esnext/schemes/urn.js new file mode 100755 index 000000000..5d3f10aa0 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/urn.js @@ -0,0 +1,49 @@ +import { SCHEMES } from "../uri"; +const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})"; +const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})"; +const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]"; +const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)"; +const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$"); +const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$"); +const URN_PARSE = /^([^\:]+)\:(.*)/; +const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g; +//RFC 2141 +const handler = { + scheme: "urn", + parse: function (components, options) { + const matches = components.path && components.path.match(URN_PARSE); + let urnComponents = components; + if (matches) { + const scheme = options.scheme || urnComponents.scheme || "urn"; + const nid = matches[1].toLowerCase(); + const nss = matches[2]; + const urnScheme = `${scheme}:${options.nid || nid}`; + const schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } + else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function (urnComponents, options) { + const scheme = options.scheme || urnComponents.scheme || "urn"; + const nid = urnComponents.nid; + const urnScheme = `${scheme}:${options.nid || nid}`; + const schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + const uriComponents = urnComponents; + const nss = urnComponents.nss; + uriComponents.path = `${nid || options.nid}:${nss}`; + return uriComponents; + }, +}; +export default handler; +//# sourceMappingURL=urn.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.js.map b/node_modules/uri-js/dist/esnext/schemes/urn.js.map new file mode 100755 index 000000000..ea43b0beb --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/urn.js.map @@ -0,0 +1 @@ +{"version":3,"file":"urn.js","sourceRoot":"","sources":["../../../src/schemes/urn.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,OAAO,EAAE,MAAM,QAAQ,CAAC;AAW7C,MAAM,IAAI,GAAG,qCAAqC,CAAC;AACnD,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAC7C,MAAM,OAAO,GAAG,mEAAmE,CAAC;AACpF,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,GAAG,GAAG,OAAO,GAAG,KAAK,CAAC;AAC7D,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACjE,MAAM,SAAS,GAAG,iBAAiB,CAAC;AACpC,MAAM,YAAY,GAAG,iDAAiD,CAAC;AAEvE,UAAU;AACV,MAAM,OAAO,GAA8C;IAC1D,MAAM,EAAG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CAAC;QAEzC,IAAI,aAAa,EAAE;YAClB,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,aAAa,EAAE,OAAO,CAAkB,CAAC;SACjF;QAED,MAAM,aAAa,GAAG,aAA8B,CAAC;QACrD,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC9B,aAAa,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QAEpD,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.d.ts b/node_modules/uri-js/dist/esnext/schemes/ws.d.ts new file mode 100755 index 000000000..47f4835b2 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/ws.d.ts @@ -0,0 +1,7 @@ +import { URISchemeHandler, URIComponents } from "../uri"; +export interface WSComponents extends URIComponents { + resourceName?: string; + secure?: boolean; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.js b/node_modules/uri-js/dist/esnext/schemes/ws.js new file mode 100755 index 000000000..9277f035a --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/ws.js @@ -0,0 +1,41 @@ +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +const handler = { + scheme: "ws", + domainHost: true, + parse: function (components, options) { + const wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function (wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws'); + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + const [path, query] = wsComponents.resourceName.split('?'); + wsComponents.path = (path && path !== '/' ? path : undefined); + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; +export default handler; +//# sourceMappingURL=ws.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.js.map b/node_modules/uri-js/dist/esnext/schemes/ws.js.map new file mode 100755 index 000000000..186818ccd --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/ws.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../../src/schemes/ws.ts"],"names":[],"mappings":"AAOA,kBAAkB,YAAyB;IAC1C,OAAO,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC;AAC7H,CAAC;AAED,UAAU;AACV,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,IAAI;IAEb,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,YAAY,GAAG,UAA0B,CAAC;QAEhD,oCAAoC;QACpC,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;QAE7C,wBAAwB;QACxB,YAAY,CAAC,YAAY,GAAG,CAAC,YAAY,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9G,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;QAC9B,YAAY,CAAC,KAAK,GAAG,SAAS,CAAC;QAE/B,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,SAAS,EAAG,UAAU,YAAyB,EAAE,OAAkB;QAClE,4BAA4B;QAC5B,IAAI,YAAY,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,KAAK,EAAE,EAAE;YAC1F,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;SAC9B;QAED,mCAAmC;QACnC,IAAI,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,EAAE;YAC7C,YAAY,CAAC,MAAM,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC3D,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC;SAChC;QAED,qCAAqC;QACrC,IAAI,YAAY,CAAC,YAAY,EAAE;YAC9B,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3D,YAAY,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC9D,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;YAC3B,YAAY,CAAC,YAAY,GAAG,SAAS,CAAC;SACtC;QAED,2BAA2B;QAC3B,YAAY,CAAC,QAAQ,GAAG,SAAS,CAAC;QAElC,OAAO,YAAY,CAAC;IACrB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.d.ts b/node_modules/uri-js/dist/esnext/schemes/wss.d.ts new file mode 100755 index 000000000..fe5b2f354 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/wss.d.ts @@ -0,0 +1,3 @@ +import { URISchemeHandler } from "../uri"; +declare const handler: URISchemeHandler; +export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.js b/node_modules/uri-js/dist/esnext/schemes/wss.js new file mode 100755 index 000000000..d1e22ccd6 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/wss.js @@ -0,0 +1,9 @@ +import ws from "./ws"; +const handler = { + scheme: "wss", + domainHost: ws.domainHost, + parse: ws.parse, + serialize: ws.serialize +}; +export default handler; +//# sourceMappingURL=wss.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.js.map b/node_modules/uri-js/dist/esnext/schemes/wss.js.map new file mode 100755 index 000000000..e19006d94 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/schemes/wss.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wss.js","sourceRoot":"","sources":["../../../src/schemes/wss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,MAAM,CAAC;AAEtB,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,KAAK;IACd,UAAU,EAAG,EAAE,CAAC,UAAU;IAC1B,KAAK,EAAG,EAAE,CAAC,KAAK;IAChB,SAAS,EAAG,EAAE,CAAC,SAAS;CACxB,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/uri.d.ts b/node_modules/uri-js/dist/esnext/uri.d.ts new file mode 100755 index 000000000..da51e2352 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/uri.d.ts @@ -0,0 +1,59 @@ +export interface URIComponents { + scheme?: string; + userinfo?: string; + host?: string; + port?: number | string; + path?: string; + query?: string; + fragment?: string; + reference?: string; + error?: string; +} +export interface URIOptions { + scheme?: string; + reference?: string; + tolerant?: boolean; + absolutePath?: boolean; + iri?: boolean; + unicodeSupport?: boolean; + domainHost?: boolean; +} +export interface URISchemeHandler { + scheme: string; + parse(components: ParentComponents, options: Options): Components; + serialize(components: Components, options: Options): ParentComponents; + unicodeSupport?: boolean; + domainHost?: boolean; + absolutePath?: boolean; +} +export interface URIRegExps { + NOT_SCHEME: RegExp; + NOT_USERINFO: RegExp; + NOT_HOST: RegExp; + NOT_PATH: RegExp; + NOT_PATH_NOSCHEME: RegExp; + NOT_QUERY: RegExp; + NOT_FRAGMENT: RegExp; + ESCAPE: RegExp; + UNRESERVED: RegExp; + OTHER_CHARS: RegExp; + PCT_ENCODED: RegExp; + IPV4ADDRESS: RegExp; + IPV6ADDRESS: RegExp; +} +export declare const SCHEMES: { + [scheme: string]: URISchemeHandler; +}; +export declare function pctEncChar(chr: string): string; +export declare function pctDecChars(str: string): string; +export declare function parse(uriString: string, options?: URIOptions): URIComponents; +export declare function removeDotSegments(input: string): string; +export declare function serialize(components: URIComponents, options?: URIOptions): string; +export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; +export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; +export declare function normalize(uri: string, options?: URIOptions): string; +export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; +export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; +export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; +export declare function escapeComponent(str: string, options?: URIOptions): string; +export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/node_modules/uri-js/dist/esnext/uri.js b/node_modules/uri-js/dist/esnext/uri.js new file mode 100755 index 000000000..659ce2651 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/uri.js @@ -0,0 +1,480 @@ +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +import URI_PROTOCOL from "./regexps-uri"; +import IRI_PROTOCOL from "./regexps-iri"; +import punycode from "punycode"; +import { toUpperCase, typeOf, assign } from "./util"; +export const SCHEMES = {}; +export function pctEncChar(chr) { + const c = chr.charCodeAt(0); + let e; + if (c < 16) + e = "%0" + c.toString(16).toUpperCase(); + else if (c < 128) + e = "%" + c.toString(16).toUpperCase(); + else if (c < 2048) + e = "%" + ((c >> 6) | 192).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); + else + e = "%" + ((c >> 12) | 224).toString(16).toUpperCase() + "%" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); + return e; +} +export function pctDecChars(str) { + let newStr = ""; + let i = 0; + const il = str.length; + while (i < il) { + const c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } + else if (c >= 194 && c < 224) { + if ((il - i) >= 6) { + const c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + } + else { + newStr += str.substr(i, 6); + } + i += 6; + } + else if (c >= 224) { + if ((il - i) >= 9) { + const c2 = parseInt(str.substr(i + 4, 2), 16); + const c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + } + else { + newStr += str.substr(i, 9); + } + i += 9; + } + else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; +} +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + const decStr = pctDecChars(str); + return (!decStr.match(protocol.UNRESERVED) ? str : decStr); + } + if (components.scheme) + components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) + components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) + components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) + components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) + components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) + components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; +} +; +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; +} +function _normalizeIPv4(host, protocol) { + const matches = host.match(protocol.IPV4ADDRESS) || []; + const [, address] = matches; + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } + else { + return host; + } +} +function _normalizeIPv6(host, protocol) { + const matches = host.match(protocol.IPV6ADDRESS) || []; + const [, address, zone] = matches; + if (address) { + const [last, first] = address.toLowerCase().split('::').reverse(); + const firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + const lastFields = last.split(":").map(_stripLeadingZeros); + const isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + const fieldCount = isLastFieldIPv4Address ? 7 : 8; + const lastFieldsStart = lastFields.length - fieldCount; + const fields = Array(fieldCount); + for (let x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + const allZeroFields = fields.reduce((acc, field, index) => { + if (!field || field === "0") { + const lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } + else { + acc.push({ index, length: 1 }); + } + } + return acc; + }, []); + const longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0]; + let newHost; + if (longestZeroFields && longestZeroFields.length > 1) { + const newFirst = fields.slice(0, longestZeroFields.index); + const newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } + else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } + else { + return host; + } +} +const URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +const NO_MATCH_IS_UNDEFINED = ("").match(/(){0}/)[1] === undefined; +export function parse(uriString, options = {}) { + const components = {}; + const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); + if (options.reference === "suffix") + uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + const matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } + else { //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = (uriString.indexOf("@") !== -1 ? matches[3] : undefined); + components.host = (uriString.indexOf("//") !== -1 ? matches[4] : undefined); + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = (uriString.indexOf("?") !== -1 ? matches[7] : undefined); + components.fragment = (uriString.indexOf("#") !== -1 ? matches[8] : undefined); + //fix port number + if (isNaN(components.port)) { + components.port = (uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined); + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } + else if (components.scheme === undefined) { + components.reference = "relative"; + } + else if (components.fragment === undefined) { + components.reference = "absolute"; + } + else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } + catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } + else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } + else { + components.error = components.error || "URI can not be parsed."; + } + return components; +} +; +function _recomposeAuthority(components, options) { + const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); + const uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => "[" + $1 + ($2 ? "%25" + $2 : "") + "]")); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} +; +const RDS1 = /^\.\.?\//; +const RDS2 = /^\/\.(\/|$)/; +const RDS3 = /^\/\.\.(\/|$)/; +const RDS4 = /^\.\.?$/; +const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +export function removeDotSegments(input) { + const output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } + else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } + else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } + else if (input === "." || input === "..") { + input = ""; + } + else { + const im = input.match(RDS5); + if (im) { + const s = im[0]; + input = input.slice(s.length); + output.push(s); + } + else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} +; +export function serialize(components, options = {}) { + const protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL); + const uriTokens = []; + //find scheme handler + const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) + schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) { + //TODO: normalize IPv6 address as per RFC 5952 + } + //if host component is a domain name + else if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) { + //convert IDN via punycode + try { + components.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host)); + } + catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } + } + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + const authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + let s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} +; +export function resolveComponents(base, relative, options = {}, skipNormalization) { + const target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } + else { + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } + else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } + else { + target.query = base.query; + } + } + else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } + else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } + else if (!base.path) { + target.path = relative.path; + } + else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative.fragment; + return target; +} +; +export function resolve(baseURI, relativeURI, options) { + const schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); +} +; +export function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } + else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); + } + return uri; +} +; +export function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } + else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } + else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} +; +export function escapeComponent(str, options) { + return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar); +} +; +export function unescapeComponent(str, options) { + return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars); +} +; +//# sourceMappingURL=uri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/uri.js.map b/node_modules/uri-js/dist/esnext/uri.js.map new file mode 100755 index 000000000..2e72ab18d --- /dev/null +++ b/node_modules/uri-js/dist/esnext/uri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../src/uri.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAiDrD,MAAM,CAAC,MAAM,OAAO,GAAsC,EAAE,CAAC;AAE7D,MAAM,qBAAqB,GAAU;IACpC,MAAM,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,CAAQ,CAAC;IAEb,IAAI,CAAC,GAAG,EAAE;QAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/C,IAAI,CAAC,GAAG,GAAG;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;SACpD,IAAI,CAAC,GAAG,IAAI;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,GA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AO,CAAC,CAAC;KAChD;SAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;QACrC,IAAI,GAAG,SAAS,CAAgB,IAAI,EAAE,OAAO,CAAC,CAAC;KAC/C;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC7B,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;KAChD;SAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;QACrC,IAAI,GAAG,SAAS,CAAgB,IAAI,EAAE,OAAO,CAAC,CAAC;KAC/C;IAED,OAAO,IAAI,KAAK,IAAI,CAAC;AACtB,CAAC;AAAA,CAAC;AAEF,MAAM,0BAA0B,GAAU,EAAE,OAAmB;IAC9D,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;AAC1H,CAAC;AAAA,CAAC;AAEF,MAAM,4BAA4B,GAAU,EAAE,OAAmB;IAChE,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC;AACrI,CAAC;AAAA,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/util.d.ts b/node_modules/uri-js/dist/esnext/util.d.ts new file mode 100755 index 000000000..7c1285754 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/util.d.ts @@ -0,0 +1,6 @@ +export declare function merge(...sets: Array): string; +export declare function subexp(str: string): string; +export declare function typeOf(o: any): string; +export declare function toUpperCase(str: string): string; +export declare function toArray(obj: any): Array; +export declare function assign(target: object, source: any): any; diff --git a/node_modules/uri-js/dist/esnext/util.js b/node_modules/uri-js/dist/esnext/util.js new file mode 100755 index 000000000..072711efd --- /dev/null +++ b/node_modules/uri-js/dist/esnext/util.js @@ -0,0 +1,36 @@ +export function merge(...sets) { + if (sets.length > 1) { + sets[0] = sets[0].slice(0, -1); + const xl = sets.length - 1; + for (let x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } + else { + return sets[0]; + } +} +export function subexp(str) { + return "(?:" + str + ")"; +} +export function typeOf(o) { + return o === undefined ? "undefined" : (o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase()); +} +export function toUpperCase(str) { + return str.toUpperCase(); +} +export function toArray(obj) { + return obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : []; +} +export function assign(target, source) { + const obj = target; + if (source) { + for (const key in source) { + obj[key] = source[key]; + } + } + return obj; +} +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/util.js.map b/node_modules/uri-js/dist/esnext/util.js.map new file mode 100755 index 000000000..05d9df021 --- /dev/null +++ b/node_modules/uri-js/dist/esnext/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,IAAkB;IAC1C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QA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IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvM,CAAC;AAGD,MAAM,iBAAiB,MAAc,EAAE,MAAW;IACjD,MAAM,GAAG,GAAG,MAAa,CAAC;IAC1B,IAAI,MAAM,EAAE;QACX,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACzB,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;SACvB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/package.json b/node_modules/uri-js/package.json new file mode 100755 index 000000000..de95d91aa --- /dev/null +++ b/node_modules/uri-js/package.json @@ -0,0 +1,77 @@ +{ + "name": "uri-js", + "version": "4.4.1", + "description": "An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.", + "main": "dist/es5/uri.all.js", + "types": "dist/es5/uri.all.d.ts", + "directories": { + "test": "tests" + }, + "files": [ + "dist", + "package.json", + "yarn.lock", + "README.md", + "CHANGELOG", + "LICENSE" + ], + "scripts": { + "build:esnext": "tsc", + "build:es5": "rollup -c && cp dist/esnext/uri.d.ts dist/es5/uri.all.d.ts && npm run build:es5:fix-sourcemap", + "build:es5:fix-sourcemap": "sorcery -i dist/es5/uri.all.js", + "build:es5:min": "uglifyjs dist/es5/uri.all.js --support-ie8 --output dist/es5/uri.all.min.js --in-source-map dist/es5/uri.all.js.map --source-map uri.all.min.js.map --comments --compress --mangle --pure-funcs merge subexp && mv uri.all.min.js.map dist/es5/ && cp dist/es5/uri.all.d.ts dist/es5/uri.all.min.d.ts", + "build": "npm run build:esnext && npm run build:es5 && npm run build:es5:min", + "clean": "rm -rf dist", + "test": "mocha -u mocha-qunit-ui dist/es5/uri.all.js tests/tests.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/garycourt/uri-js" + }, + "keywords": [ + "URI", + "IRI", + "IDN", + "URN", + "UUID", + "HTTP", + "HTTPS", + "WS", + "WSS", + "MAILTO", + "RFC3986", + "RFC3987", + "RFC5891", + "RFC2616", + "RFC2818", + "RFC2141", + "RFC4122", + "RFC4291", + "RFC5952", + "RFC6068", + "RFC6455", + "RFC6874" + ], + "author": "Gary Court ", + "license": "BSD-2-Clause", + "bugs": { + "url": "https://github.com/garycourt/uri-js/issues" + }, + "homepage": "https://github.com/garycourt/uri-js", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-plugin-external-helpers": "^6.22.0", + "babel-preset-latest": "^6.24.1", + "mocha": "^8.2.1", + "mocha-qunit-ui": "^0.1.3", + "rollup": "^0.41.6", + "rollup-plugin-babel": "^2.7.1", + "rollup-plugin-node-resolve": "^2.0.0", + "sorcery": "^0.10.0", + "typescript": "^2.8.1", + "uglify-js": "^2.8.14" + }, + "dependencies": { + "punycode": "^2.1.0" + } +} diff --git a/node_modules/uri-js/yarn.lock b/node_modules/uri-js/yarn.lock new file mode 100755 index 000000000..3c42ded12 --- /dev/null +++ b/node_modules/uri-js/yarn.lock @@ -0,0 +1,2558 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +anymatch@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== + dependencies: + micromatch "^2.1.5" + normalize-path "^2.0.0" + +anymatch@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" + integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= + dependencies: + arr-flatten "^1.0.1" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +async-each@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" + integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + +atob@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +babel-cli@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" + integrity sha1-UCq1SHTX24itALiHoGODzgPQAvE= + dependencies: + babel-core "^6.26.0" + babel-polyfill "^6.26.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + commander "^2.11.0" + convert-source-map "^1.5.0" + fs-readdir-recursive "^1.0.0" + glob "^7.1.2" + lodash "^4.17.4" + output-file-sync "^1.1.2" + path-is-absolute "^1.0.1" + slash "^1.0.0" + source-map "^0.5.6" + v8flags "^2.1.1" + optionalDependencies: + chokidar "^1.6.1" + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@6: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.0" + debug "^2.6.8" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.7" + slash "^1.0.0" + source-map "^0.5.6" + +babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-external-helpers@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + dependencies: + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-plugin-transform-es2015-classes@^6.24.1, babel-plugin-transform-es2015-classes@^6.9.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-polyfill@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= + dependencies: + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" + +babel-preset-es2015@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.24.1" + babel-plugin-transform-es2015-classes "^6.24.1" + babel-plugin-transform-es2015-computed-properties "^6.24.1" + babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.24.1" + babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.24.1" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-plugin-transform-es2015-modules-systemjs "^6.24.1" + babel-plugin-transform-es2015-modules-umd "^6.24.1" + babel-plugin-transform-es2015-object-super "^6.24.1" + babel-plugin-transform-es2015-parameters "^6.24.1" + babel-plugin-transform-es2015-shorthand-properties "^6.24.1" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.24.1" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.24.1" + babel-plugin-transform-regenerator "^6.24.1" + +babel-preset-es2016@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2016/-/babel-preset-es2016-6.24.1.tgz#f900bf93e2ebc0d276df9b8ab59724ebfd959f8b" + dependencies: + babel-plugin-transform-exponentiation-operator "^6.24.1" + +babel-preset-es2017@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2017/-/babel-preset-es2017-6.24.1.tgz#597beadfb9f7f208bcfd8a12e9b2b29b8b2f14d1" + dependencies: + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.24.1" + +babel-preset-latest@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-latest/-/babel-preset-latest-6.24.1.tgz#677de069154a7485c2d25c577c02f624b85b85e8" + dependencies: + babel-preset-es2015 "^6.24.1" + babel-preset-es2016 "^6.24.1" + babel-preset-es2017 "^6.24.1" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +binary-extensions@^1.0.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" + integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== + +binary-extensions@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" + integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== + +bindings@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browser-resolve@^1.11.0: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +buffer-crc32@^0.2.5: + version "0.2.13" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + +builtin-modules@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.0.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" + integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chokidar@3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" + integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.5.0" + optionalDependencies: + fsevents "~2.1.2" + +chokidar@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +commander@^2.11.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +convert-source-map@^1.5.0, convert-source-map@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" + integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + dependencies: + safe-buffer "~5.1.1" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js@^2.4.0, core-js@^2.5.0: + version "2.6.12" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" + integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +debug@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1" + integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== + dependencies: + ms "2.1.2" + +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +decamelize@^1.0.0, decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= + dependencies: + repeating "^2.0.0" + +diff@4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +es6-promise@^3.1.2: + version "3.3.1" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +escape-string-regexp@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +estree-walker@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= + dependencies: + is-posix-bracket "^0.1.0" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= + dependencies: + fill-range "^2.1.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= + dependencies: + is-extglob "^1.0.0" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +for-in@^1.0.1, for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= + dependencies: + for-in "^1.0.1" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs-readdir-recursive@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" + integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^1.0.0: + version "1.2.13" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" + integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== + dependencies: + bindings "^1.5.0" + nan "^2.12.1" + +fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= + dependencies: + is-glob "^2.0.0" + +glob-parent@~5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" + integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== + dependencies: + is-glob "^4.0.1" + +glob@7.1.6, glob@^7.1.2, glob@^7.1.3: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== + +graceful-fs@^4.1.11, graceful-fs@^4.1.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +graceful-fs@^4.1.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +invariant@^2.2.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + dependencies: + binary-extensions "^1.0.0" + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-finite@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" + integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= + dependencies: + is-extglob "^1.0.0" + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + +js-yaml@3.14.0: + version "3.14.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" + integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash@^4.17.4: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + +log-symbols@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920" + integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA== + dependencies: + chalk "^4.0.0" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +math-random@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" + integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== + +micromatch@^2.1.5: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +micromatch@^3.1.10: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0, minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +mixin-deep@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@^0.5.1: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + dependencies: + minimist "^1.2.5" + +mocha-qunit-ui@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/mocha-qunit-ui/-/mocha-qunit-ui-0.1.3.tgz#e3e1ff1dac33222b10cef681efd7f82664141ea9" + +mocha@^8.2.1: + version "8.2.1" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.2.1.tgz#f2fa68817ed0e53343d989df65ccd358bc3a4b39" + integrity sha512-cuLBVfyFfFqbNR0uUKbDGXKGk+UDFe6aR4os78XIrMQpZl/nv7JYHcvP5MFIAb374b2zFXsdgEGwmzMtP0Xg8w== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.4.3" + debug "4.2.0" + diff "4.0.2" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.1.6" + growl "1.10.5" + he "1.2.0" + js-yaml "3.14.0" + log-symbols "4.0.0" + minimatch "3.0.4" + ms "2.1.2" + nanoid "3.1.12" + serialize-javascript "5.0.1" + strip-json-comments "3.1.1" + supports-color "7.2.0" + which "2.0.2" + wide-align "1.1.3" + workerpool "6.0.2" + yargs "13.3.2" + yargs-parser "13.1.2" + yargs-unparser "2.0.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +nan@^2.12.1: + version "2.14.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" + integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== + +nanoid@3.1.12: + version "3.1.12" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.12.tgz#6f7736c62e8d39421601e4a0c77623a97ea69654" + integrity sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +normalize-path@^2.0.0, normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +output-file-sync@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" + integrity sha1-0KM+7+YaIF+suQCS6CZZjVJFznY= + dependencies: + graceful-fs "^4.1.4" + mkdirp "^0.5.1" + object-assign "^4.1.0" + +p-limit@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= + +private@^0.1.6, private@^0.1.7, private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +punycode@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + +randomatic@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" + integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +readable-stream@^2.0.2: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +readdirp@~3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" + integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== + dependencies: + picomatch "^2.2.1" + +regenerate@^1.2.1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" + +regenerator-runtime@^0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== + dependencies: + is-equal-shallow "^0.1.3" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.5.2, repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= + dependencies: + is-finite "^1.0.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.1.6: + version "1.6.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.6.0.tgz#0fbd21278b27b4004481c395349e7aba60a9ff5c" + dependencies: + path-parse "^1.0.5" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@^2.5.2: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + dependencies: + glob "^7.1.3" + +rollup-plugin-babel@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57" + dependencies: + babel-core "6" + babel-plugin-transform-es2015-classes "^6.9.0" + object-assign "^4.1.0" + rollup-pluginutils "^1.5.0" + +rollup-plugin-node-resolve@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.1.1.tgz#cbb783b0d15b02794d58915350b2f0d902b8ddc8" + dependencies: + browser-resolve "^1.11.0" + builtin-modules "^1.1.0" + resolve "^1.1.6" + +rollup-pluginutils@^1.5.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" + dependencies: + estree-walker "^0.2.1" + minimatch "^3.0.2" + +rollup@^0.41.6: + version "0.41.6" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a" + dependencies: + source-map-support "^0.4.0" + +safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +sander@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/sander/-/sander-0.5.1.tgz#741e245e231f07cafb6fdf0f133adfa216a502ad" + dependencies: + es6-promise "^3.1.2" + graceful-fs "^4.1.3" + mkdirp "^0.5.1" + rimraf "^2.5.2" + +serialize-javascript@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4" + integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA== + dependencies: + randombytes "^2.1.0" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +sorcery@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/sorcery/-/sorcery-0.10.0.tgz#8ae90ad7d7cb05fc59f1ab0c637845d5c15a52b7" + dependencies: + buffer-crc32 "^0.2.5" + minimist "^1.2.0" + sander "^0.5.0" + sourcemap-codec "^1.3.0" + +source-map-resolve@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.4.0, source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +sourcemap-codec@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz#c8fd92d91889e902a07aee392bdd2c5863958ba2" + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +"string-width@^1.0.2 || 2": + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0, string-width@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@7.2.0, supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + +typescript@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.1.tgz#6160e4f8f195d5ba81d4876f9c0cc1fbc0820624" + +uglify-js@^2.8.14: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +union-value@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +user-home@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + integrity sha1-K1viOjK2Onyd640PKNSFcko98ZA= + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +v8flags@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" + integrity sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ= + dependencies: + user-home "^1.1.1" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +wide-align@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +workerpool@6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.0.2.tgz#e241b43d8d033f1beb52c7851069456039d1d438" + integrity sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q== + +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +y18n@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" + integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== + +yargs-parser@13.1.2, yargs-parser@^13.1.2: + version "13.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" + integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@13.3.2: + version "13.3.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" + integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.2" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/node_modules/util-deprecate/History.md b/node_modules/util-deprecate/History.md new file mode 100644 index 000000000..acc867537 --- /dev/null +++ b/node_modules/util-deprecate/History.md @@ -0,0 +1,16 @@ + +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + +1.0.1 / 2014-11-25 +================== + + * browser: use `console.warn()` for deprecation calls + * browser: more jsdocs + +1.0.0 / 2014-04-30 +================== + + * initial commit diff --git a/node_modules/util-deprecate/LICENSE b/node_modules/util-deprecate/LICENSE new file mode 100644 index 000000000..6a60e8c22 --- /dev/null +++ b/node_modules/util-deprecate/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/util-deprecate/README.md b/node_modules/util-deprecate/README.md new file mode 100644 index 000000000..75622fa7c --- /dev/null +++ b/node_modules/util-deprecate/README.md @@ -0,0 +1,53 @@ +util-deprecate +============== +### The Node.js `util.deprecate()` function with browser support + +In Node.js, this module simply re-exports the `util.deprecate()` function. + +In the web browser (i.e. via browserify), a browser-specific implementation +of the `util.deprecate()` function is used. + + +## API + +A `deprecate()` function is the only thing exposed by this module. + +``` javascript +// setup: +exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); + + +// users see: +foo(); +// foo() is deprecated, use bar() instead +foo(); +foo(); +``` + + +## License + +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/util-deprecate/browser.js b/node_modules/util-deprecate/browser.js new file mode 100644 index 000000000..549ae2f06 --- /dev/null +++ b/node_modules/util-deprecate/browser.js @@ -0,0 +1,67 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/node_modules/util-deprecate/node.js b/node_modules/util-deprecate/node.js new file mode 100644 index 000000000..5e6fcff5d --- /dev/null +++ b/node_modules/util-deprecate/node.js @@ -0,0 +1,6 @@ + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = require('util').deprecate; diff --git a/node_modules/util-deprecate/package.json b/node_modules/util-deprecate/package.json new file mode 100644 index 000000000..2e79f89a9 --- /dev/null +++ b/node_modules/util-deprecate/package.json @@ -0,0 +1,27 @@ +{ + "name": "util-deprecate", + "version": "1.0.2", + "description": "The Node.js `util.deprecate()` function with browser support", + "main": "node.js", + "browser": "browser.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" + }, + "keywords": [ + "util", + "deprecate", + "browserify", + "browser", + "node" + ], + "author": "Nathan Rajlich (http://n8.io/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "homepage": "https://github.com/TooTallNate/util-deprecate" +} diff --git a/node_modules/validate-npm-package-license/LICENSE b/node_modules/validate-npm-package-license/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/node_modules/validate-npm-package-license/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/validate-npm-package-license/README.md b/node_modules/validate-npm-package-license/README.md new file mode 100644 index 000000000..702bc7b4f --- /dev/null +++ b/node_modules/validate-npm-package-license/README.md @@ -0,0 +1,113 @@ +validate-npm-package-license +============================ + +Give me a string and I'll tell you if it's a valid npm package license string. + +```javascript +var valid = require('validate-npm-package-license'); +``` + +SPDX license identifiers are valid license strings: + +```javascript + +var assert = require('assert'); +var validSPDXExpression = { + validForNewPackages: true, + validForOldPackages: true, + spdx: true +}; + +assert.deepEqual(valid('MIT'), validSPDXExpression); +assert.deepEqual(valid('BSD-2-Clause'), validSPDXExpression); +assert.deepEqual(valid('Apache-2.0'), validSPDXExpression); +assert.deepEqual(valid('ISC'), validSPDXExpression); +``` +The function will return a warning and suggestion for nearly-correct license identifiers: + +```javascript +assert.deepEqual( + valid('Apache 2.0'), + { + validForOldPackages: false, + validForNewPackages: false, + warnings: [ + 'license should be ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + + '"UNLICENSED", or ' + + '"SEE LICENSE IN "', + 'license is similar to the valid expression "Apache-2.0"' + ] + } +); +``` + +SPDX expressions are valid, too ... + +```javascript +// Simple SPDX license expression for dual licensing +assert.deepEqual( + valid('(GPL-3.0-only OR BSD-2-Clause)'), + validSPDXExpression +); +``` + +... except if they contain `LicenseRef`: + +```javascript +var warningAboutLicenseRef = { + validForOldPackages: false, + validForNewPackages: false, + spdx: true, + warnings: [ + 'license should be ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + + '"UNLICENSED", or ' + + '"SEE LICENSE IN "', + ] +}; + +assert.deepEqual( + valid('LicenseRef-Made-Up'), + warningAboutLicenseRef +); + +assert.deepEqual( + valid('(MIT OR LicenseRef-Made-Up)'), + warningAboutLicenseRef +); +``` + +If you can't describe your licensing terms with standardized SPDX identifiers, put the terms in a file in the package and point users there: + +```javascript +assert.deepEqual( + valid('SEE LICENSE IN LICENSE.txt'), + { + validForNewPackages: true, + validForOldPackages: true, + inFile: 'LICENSE.txt' + } +); + +assert.deepEqual( + valid('SEE LICENSE IN license.md'), + { + validForNewPackages: true, + validForOldPackages: true, + inFile: 'license.md' + } +); +``` + +If there aren't any licensing terms, use `UNLICENSED`: + +```javascript +var unlicensed = { + validForNewPackages: true, + validForOldPackages: true, + unlicensed: true +}; +assert.deepEqual(valid('UNLICENSED'), unlicensed); +assert.deepEqual(valid('UNLICENCED'), unlicensed); +``` diff --git a/node_modules/validate-npm-package-license/index.js b/node_modules/validate-npm-package-license/index.js new file mode 100644 index 000000000..35eaa7325 --- /dev/null +++ b/node_modules/validate-npm-package-license/index.js @@ -0,0 +1,86 @@ +var parse = require('spdx-expression-parse'); +var correct = require('spdx-correct'); + +var genericWarning = ( + 'license should be ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + + '"UNLICENSED", or ' + + '"SEE LICENSE IN "' +); + +var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/; + +function startsWith(prefix, string) { + return string.slice(0, prefix.length) === prefix; +} + +function usesLicenseRef(ast) { + if (ast.hasOwnProperty('license')) { + var license = ast.license; + return ( + startsWith('LicenseRef', license) || + startsWith('DocumentRef', license) + ); + } else { + return ( + usesLicenseRef(ast.left) || + usesLicenseRef(ast.right) + ); + } +} + +module.exports = function(argument) { + var ast; + + try { + ast = parse(argument); + } catch (e) { + var match + if ( + argument === 'UNLICENSED' || + argument === 'UNLICENCED' + ) { + return { + validForOldPackages: true, + validForNewPackages: true, + unlicensed: true + }; + } else if (match = fileReferenceRE.exec(argument)) { + return { + validForOldPackages: true, + validForNewPackages: true, + inFile: match[1] + }; + } else { + var result = { + validForOldPackages: false, + validForNewPackages: false, + warnings: [genericWarning] + }; + if (argument.trim().length !== 0) { + var corrected = correct(argument); + if (corrected) { + result.warnings.push( + 'license is similar to the valid expression "' + corrected + '"' + ); + } + } + return result; + } + } + + if (usesLicenseRef(ast)) { + return { + validForNewPackages: false, + validForOldPackages: false, + spdx: true, + warnings: [genericWarning] + }; + } else { + return { + validForNewPackages: true, + validForOldPackages: true, + spdx: true + }; + } +}; diff --git a/node_modules/validate-npm-package-license/package.json b/node_modules/validate-npm-package-license/package.json new file mode 100644 index 000000000..9e92af4f4 --- /dev/null +++ b/node_modules/validate-npm-package-license/package.json @@ -0,0 +1,28 @@ +{ + "name": "validate-npm-package-license", + "description": "Give me a string and I'll tell you if it's a valid npm package license string", + "version": "3.0.4", + "author": "Kyle E. Mitchell (https://kemitchell.com)", + "contributors": [ + "Mark Stacey " + ], + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + }, + "devDependencies": { + "defence-cli": "^2.0.1", + "replace-require-self": "^1.0.0" + }, + "keywords": [ + "license", + "npm", + "package", + "validation" + ], + "license": "Apache-2.0", + "repository": "kemitchell/validate-npm-package-license.js", + "scripts": { + "test": "defence README.md | replace-require-self | node" + } +} diff --git a/node_modules/which/CHANGELOG.md b/node_modules/which/CHANGELOG.md new file mode 100644 index 000000000..3d83d2694 --- /dev/null +++ b/node_modules/which/CHANGELOG.md @@ -0,0 +1,152 @@ +# Changes + + +## 1.3.1 + +* update deps +* update travis + +## v1.3.0 + +* Add nothrow option to which.sync +* update tap + +## v1.2.14 + +* appveyor: drop node 5 and 0.x +* travis-ci: add node 6, drop 0.x + +## v1.2.13 + +* test: Pass missing option to pass on windows +* update tap +* update isexe to 2.0.0 +* neveragain.tech pledge request + +## v1.2.12 + +* Removed unused require + +## v1.2.11 + +* Prevent changelog script from being included in package + +## v1.2.10 + +* Use env.PATH only, not env.Path + +## v1.2.9 + +* fix for paths starting with ../ +* Remove unused `is-absolute` module + +## v1.2.8 + +* bullet items in changelog that contain (but don't start with) # + +## v1.2.7 + +* strip 'update changelog' changelog entries out of changelog + +## v1.2.6 + +* make the changelog bulleted + +## v1.2.5 + +* make a changelog, and keep it up to date +* don't include tests in package +* Properly handle relative-path executables +* appveyor +* Attach error code to Not Found error +* Make tests pass on Windows + +## v1.2.4 + +* Fix typo + +## v1.2.3 + +* update isexe, fix regression in pathExt handling + +## v1.2.2 + +* update deps, use isexe module, test windows + +## v1.2.1 + +* Sometimes windows PATH entries are quoted +* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode. +* doc cli + +## v1.2.0 + +* Add support for opt.all and -as cli flags +* test the bin +* update travis +* Allow checking for multiple programs in bin/which +* tap 2 + +## v1.1.2 + +* travis +* Refactored and fixed undefined error on Windows +* Support strict mode + +## v1.1.1 + +* test +g exes against secondary groups, if available +* Use windows exe semantics on cygwin & msys +* cwd should be first in path on win32, not last +* Handle lower-case 'env.Path' on Windows +* Update docs +* use single-quotes + +## v1.1.0 + +* Add tests, depend on is-absolute + +## v1.0.9 + +* which.js: root is allowed to execute files owned by anyone + +## v1.0.8 + +* don't use graceful-fs + +## v1.0.7 + +* add license to package.json + +## v1.0.6 + +* isc license + +## 1.0.5 + +* Awful typo + +## 1.0.4 + +* Test for path absoluteness properly +* win: Allow '' as a pathext if cmd has a . in it + +## 1.0.3 + +* Remove references to execPath +* Make `which.sync()` work on Windows by honoring the PATHEXT variable. +* Make `isExe()` always return true on Windows. +* MIT + +## 1.0.2 + +* Only files can be exes + +## 1.0.1 + +* Respect the PATHEXT env for win32 support +* should 0755 the bin +* binary +* guts +* package +* 1st diff --git a/node_modules/which/LICENSE b/node_modules/which/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/which/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +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. diff --git a/node_modules/which/README.md b/node_modules/which/README.md new file mode 100644 index 000000000..8c0b0cbf7 --- /dev/null +++ b/node_modules/which/README.md @@ -0,0 +1,51 @@ +# which + +Like the unix `which` utility. + +Finds the first instance of a specified executable in the PATH +environment variable. Does not cache the results, so `hash -r` is not +needed when the PATH changes. + +## USAGE + +```javascript +var which = require('which') + +// async usage +which('node', function (er, resolvedPath) { + // er is returned if no "node" is found on the PATH + // if it is found, then the absolute path to the exec is returned +}) + +// sync usage +// throws if not found +var resolved = which.sync('node') + +// if nothrow option is used, returns null if not found +resolved = which.sync('node', {nothrow: true}) + +// Pass options to override the PATH and PATHEXT environment vars. +which('node', { path: someOtherPath }, function (er, resolved) { + if (er) + throw er + console.log('found at %j', resolved) +}) +``` + +## CLI USAGE + +Same as the BSD `which(1)` binary. + +``` +usage: which [-as] program ... +``` + +## OPTIONS + +You may pass an options object as the second argument. + +- `path`: Use instead of the `PATH` environment variable. +- `pathExt`: Use instead of the `PATHEXT` environment variable. +- `all`: Return all matches, instead of just the first one. Note that + this means the function returns an array of strings instead of a + single string. diff --git a/node_modules/which/bin/which b/node_modules/which/bin/which new file mode 100755 index 000000000..7cee3729e --- /dev/null +++ b/node_modules/which/bin/which @@ -0,0 +1,52 @@ +#!/usr/bin/env node +var which = require("../") +if (process.argv.length < 3) + usage() + +function usage () { + console.error('usage: which [-as] program ...') + process.exit(1) +} + +var all = false +var silent = false +var dashdash = false +var args = process.argv.slice(2).filter(function (arg) { + if (dashdash || !/^-/.test(arg)) + return true + + if (arg === '--') { + dashdash = true + return false + } + + var flags = arg.substr(1).split('') + for (var f = 0; f < flags.length; f++) { + var flag = flags[f] + switch (flag) { + case 's': + silent = true + break + case 'a': + all = true + break + default: + console.error('which: illegal option -- ' + flag) + usage() + } + } + return false +}) + +process.exit(args.reduce(function (pv, current) { + try { + var f = which.sync(current, { all: all }) + if (all) + f = f.join('\n') + if (!silent) + console.log(f) + return pv; + } catch (e) { + return 1; + } +}, 0)) diff --git a/node_modules/which/package.json b/node_modules/which/package.json new file mode 100644 index 000000000..51be376f6 --- /dev/null +++ b/node_modules/which/package.json @@ -0,0 +1,30 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "which", + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", + "version": "1.3.1", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" + }, + "main": "which.js", + "bin": "./bin/which", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.6.2", + "tap": "^12.0.1" + }, + "scripts": { + "test": "tap test/*.js --cov", + "changelog": "bash gen-changelog.sh", + "postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}" + }, + "files": [ + "which.js", + "bin/which" + ] +} diff --git a/node_modules/which/which.js b/node_modules/which/which.js new file mode 100644 index 000000000..4347f91a1 --- /dev/null +++ b/node_modules/which/which.js @@ -0,0 +1,135 @@ +module.exports = which +which.sync = whichSync + +var isWindows = process.platform === 'win32' || + process.env.OSTYPE === 'cygwin' || + process.env.OSTYPE === 'msys' + +var path = require('path') +var COLON = isWindows ? ';' : ':' +var isexe = require('isexe') + +function getNotFoundError (cmd) { + var er = new Error('not found: ' + cmd) + er.code = 'ENOENT' + + return er +} + +function getPathInfo (cmd, opt) { + var colon = opt.colon || COLON + var pathEnv = opt.path || process.env.PATH || '' + var pathExt = [''] + + pathEnv = pathEnv.split(colon) + + var pathExtExe = '' + if (isWindows) { + pathEnv.unshift(process.cwd()) + pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') + pathExt = pathExtExe.split(colon) + + + // Always test the cmd itself first. isexe will check to make sure + // it's found in the pathExt set. + if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') + pathExt.unshift('') + } + + // If it has a slash, then we don't bother searching the pathenv. + // just check the file itself, and that's it. + if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) + pathEnv = [''] + + return { + env: pathEnv, + ext: pathExt, + extExe: pathExtExe + } +} + +function which (cmd, opt, cb) { + if (typeof opt === 'function') { + cb = opt + opt = {} + } + + var info = getPathInfo(cmd, opt) + var pathEnv = info.env + var pathExt = info.ext + var pathExtExe = info.extExe + var found = [] + + ;(function F (i, l) { + if (i === l) { + if (opt.all && found.length) + return cb(null, found) + else + return cb(getNotFoundError(cmd)) + } + + var pathPart = pathEnv[i] + if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') + pathPart = pathPart.slice(1, -1) + + var p = path.join(pathPart, cmd) + if (!pathPart && (/^\.[\\\/]/).test(cmd)) { + p = cmd.slice(0, 2) + p + } + ;(function E (ii, ll) { + if (ii === ll) return F(i + 1, l) + var ext = pathExt[ii] + isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { + if (!er && is) { + if (opt.all) + found.push(p + ext) + else + return cb(null, p + ext) + } + return E(ii + 1, ll) + }) + })(0, pathExt.length) + })(0, pathEnv.length) +} + +function whichSync (cmd, opt) { + opt = opt || {} + + var info = getPathInfo(cmd, opt) + var pathEnv = info.env + var pathExt = info.ext + var pathExtExe = info.extExe + var found = [] + + for (var i = 0, l = pathEnv.length; i < l; i ++) { + var pathPart = pathEnv[i] + if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') + pathPart = pathPart.slice(1, -1) + + var p = path.join(pathPart, cmd) + if (!pathPart && /^\.[\\\/]/.test(cmd)) { + p = cmd.slice(0, 2) + p + } + for (var j = 0, ll = pathExt.length; j < ll; j ++) { + var cur = p + pathExt[j] + var is + try { + is = isexe.sync(cur, { pathExt: pathExtExe }) + if (is) { + if (opt.all) + found.push(cur) + else + return cur + } + } catch (ex) {} + } + } + + if (opt.all && found.length) + return found + + if (opt.nothrow) + return null + + throw getNotFoundError(cmd) +} diff --git a/node_modules/wrappy/LICENSE b/node_modules/wrappy/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/wrappy/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +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. diff --git a/node_modules/wrappy/README.md b/node_modules/wrappy/README.md new file mode 100644 index 000000000..98eab2522 --- /dev/null +++ b/node_modules/wrappy/README.md @@ -0,0 +1,36 @@ +# wrappy + +Callback wrapping utility + +## USAGE + +```javascript +var wrappy = require("wrappy") + +// var wrapper = wrappy(wrapperFunction) + +// make sure a cb is called only once +// See also: http://npm.im/once for this specific use case +var once = wrappy(function (cb) { + var called = false + return function () { + if (called) return + called = true + return cb.apply(this, arguments) + } +}) + +function printBoo () { + console.log('boo') +} +// has some rando property +printBoo.iAmBooPrinter = true + +var onlyPrintOnce = once(printBoo) + +onlyPrintOnce() // prints 'boo' +onlyPrintOnce() // does nothing + +// random property is retained! +assert.equal(onlyPrintOnce.iAmBooPrinter, true) +``` diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json new file mode 100644 index 000000000..130752046 --- /dev/null +++ b/node_modules/wrappy/package.json @@ -0,0 +1,29 @@ +{ + "name": "wrappy", + "version": "1.0.2", + "description": "Callback wrapping utility", + "main": "wrappy.js", + "files": [ + "wrappy.js" + ], + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^2.3.1" + }, + "scripts": { + "test": "tap --coverage test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/wrappy" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/wrappy/issues" + }, + "homepage": "https://github.com/npm/wrappy" +} diff --git a/node_modules/wrappy/wrappy.js b/node_modules/wrappy/wrappy.js new file mode 100644 index 000000000..bb7e7d6fc --- /dev/null +++ b/node_modules/wrappy/wrappy.js @@ -0,0 +1,33 @@ +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} diff --git a/node_modules/write-file-atomic/LICENSE.md b/node_modules/write-file-atomic/LICENSE.md new file mode 100644 index 000000000..95e65a770 --- /dev/null +++ b/node_modules/write-file-atomic/LICENSE.md @@ -0,0 +1,6 @@ +Copyright (c) 2015, Rebecca Turner + +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. + diff --git a/node_modules/write-file-atomic/README.md b/node_modules/write-file-atomic/README.md new file mode 100644 index 000000000..2d9ef6024 --- /dev/null +++ b/node_modules/write-file-atomic/README.md @@ -0,0 +1,91 @@ +write-file-atomic +----------------- + +This is an extension for node's `fs.writeFile` that makes its operation +atomic and allows you set ownership (uid/gid of the file). + +### `writeFileAtomic(filename, data, [options], [callback])` + +#### Description: + +Atomically and asynchronously writes data to a file, replacing the file if it already +exists. data can be a string or a buffer. + +#### Options: +* filename **String** +* data **String** | **Buffer** +* options **Object** | **String** + * chown **Object** default, uid & gid of existing file, if any + * uid **Number** + * gid **Number** + * encoding **String** | **Null** default = 'utf8' + * fsync **Boolean** default = true + * mode **Number** default, from existing file, if any + * tmpfileCreated **Function** called when the tmpfile is created +* callback **Function** + +#### Usage: + +```js +var writeFileAtomic = require('write-file-atomic') +writeFileAtomic(filename, data, [options], [callback]) +``` + +The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`. +Note that `require('worker_threads').threadId` is used in addition to `process.pid` if running inside of a worker thread. +If writeFile completes successfully then, if passed the **chown** option it will change +the ownership of the file. Finally it renames the file back to the filename you specified. If +it encounters errors at any of these steps it will attempt to unlink the temporary file and then +pass the error back to the caller. +If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Writes to different files are still executed in parallel. + +If provided, the **chown** option requires both **uid** and **gid** properties or else +you'll get an error. If **chown** is not specified it will default to using +the owner of the previous file. To prevent chown from being ran you can +also pass `false`, in which case the file will be created with the current user's credentials. + +If **mode** is not specified, it will default to using the permissions from +an existing file, if any. Expicitly setting this to `false` remove this default, resulting +in a file created with the system default permissions. + +If options is a String, it's assumed to be the **encoding** option. The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'. + +If the **fsync** option is **false**, writeFile will skip the final fsync call. + +If the **tmpfileCreated** option is specified it will be called with the name of the tmpfile when created. + +Example: + +```javascript +writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) { + if (err) throw err; + console.log('It\'s saved!'); +}); +``` + +This function also supports async/await: + +```javascript +(async () => { + try { + await writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}); + console.log('It\'s saved!'); + } catch (err) { + console.error(err); + process.exit(1); + } +})(); +``` + +### `writeFileAtomicSync(filename, data, [options])` + +#### Description: + +The synchronous version of **writeFileAtomic**. + +#### Usage: +```js +var writeFileAtomicSync = require('write-file-atomic').sync +writeFileAtomicSync(filename, data, [options]) +``` + diff --git a/node_modules/write-file-atomic/lib/index.js b/node_modules/write-file-atomic/lib/index.js new file mode 100644 index 000000000..6013894cd --- /dev/null +++ b/node_modules/write-file-atomic/lib/index.js @@ -0,0 +1,267 @@ +'use strict' +module.exports = writeFile +module.exports.sync = writeFileSync +module.exports._getTmpname = getTmpname // for testing +module.exports._cleanupOnExit = cleanupOnExit + +const fs = require('fs') +const MurmurHash3 = require('imurmurhash') +const { onExit } = require('signal-exit') +const path = require('path') +const { promisify } = require('util') +const activeFiles = {} + +// if we run inside of a worker_thread, `process.pid` is not unique +/* istanbul ignore next */ +const threadId = (function getId () { + try { + const workerThreads = require('worker_threads') + + /// if we are in main thread, this is set to `0` + return workerThreads.threadId + } catch (e) { + // worker_threads are not available, fallback to 0 + return 0 + } +})() + +let invocations = 0 +function getTmpname (filename) { + return filename + '.' + + MurmurHash3(__filename) + .hash(String(process.pid)) + .hash(String(threadId)) + .hash(String(++invocations)) + .result() +} + +function cleanupOnExit (tmpfile) { + return () => { + try { + fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) + } catch { + // ignore errors + } + } +} + +function serializeActiveFile (absoluteName) { + return new Promise(resolve => { + // make a queue if it doesn't already exist + if (!activeFiles[absoluteName]) { + activeFiles[absoluteName] = [] + } + + activeFiles[absoluteName].push(resolve) // add this job to the queue + if (activeFiles[absoluteName].length === 1) { + resolve() + } // kick off the first one + }) +} + +// https://github.com/isaacs/node-graceful-fs/blob/master/polyfills.js#L315-L342 +function isChownErrOk (err) { + if (err.code === 'ENOSYS') { + return true + } + + const nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (err.code === 'EINVAL' || err.code === 'EPERM') { + return true + } + } + + return false +} + +async function writeFileAsync (filename, data, options = {}) { + if (typeof options === 'string') { + options = { encoding: options } + } + + let fd + let tmpfile + /* istanbul ignore next -- The closure only gets called when onExit triggers */ + const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) + const absoluteName = path.resolve(filename) + + try { + await serializeActiveFile(absoluteName) + const truename = await promisify(fs.realpath)(filename).catch(() => filename) + tmpfile = getTmpname(truename) + + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + const stats = await promisify(fs.stat)(truename).catch(() => {}) + if (stats) { + if (options.mode == null) { + options.mode = stats.mode + } + + if (options.chown == null && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } + } + + fd = await promisify(fs.open)(tmpfile, 'w', options.mode) + if (options.tmpfileCreated) { + await options.tmpfileCreated(tmpfile) + } + if (ArrayBuffer.isView(data)) { + await promisify(fs.write)(fd, data, 0, data.length, 0) + } else if (data != null) { + await promisify(fs.write)(fd, String(data), 0, String(options.encoding || 'utf8')) + } + + if (options.fsync !== false) { + await promisify(fs.fsync)(fd) + } + + await promisify(fs.close)(fd) + fd = null + + if (options.chown) { + await promisify(fs.chown)(tmpfile, options.chown.uid, options.chown.gid).catch(err => { + if (!isChownErrOk(err)) { + throw err + } + }) + } + + if (options.mode) { + await promisify(fs.chmod)(tmpfile, options.mode).catch(err => { + if (!isChownErrOk(err)) { + throw err + } + }) + } + + await promisify(fs.rename)(tmpfile, truename) + } finally { + if (fd) { + await promisify(fs.close)(fd).catch( + /* istanbul ignore next */ + () => {} + ) + } + removeOnExitHandler() + await promisify(fs.unlink)(tmpfile).catch(() => {}) + activeFiles[absoluteName].shift() // remove the element added by serializeSameFile + if (activeFiles[absoluteName].length > 0) { + activeFiles[absoluteName][0]() // start next job if one is pending + } else { + delete activeFiles[absoluteName] + } + } +} + +async function writeFile (filename, data, options, callback) { + if (options instanceof Function) { + callback = options + options = {} + } + + const promise = writeFileAsync(filename, data, options) + if (callback) { + try { + const result = await promise + return callback(result) + } catch (err) { + return callback(err) + } + } + + return promise +} + +function writeFileSync (filename, data, options) { + if (typeof options === 'string') { + options = { encoding: options } + } else if (!options) { + options = {} + } + try { + filename = fs.realpathSync(filename) + } catch (ex) { + // it's ok, it'll happen on a not yet existing file + } + const tmpfile = getTmpname(filename) + + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + try { + const stats = fs.statSync(filename) + options = Object.assign({}, options) + if (!options.mode) { + options.mode = stats.mode + } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } catch (ex) { + // ignore stat errors + } + } + + let fd + const cleanup = cleanupOnExit(tmpfile) + const removeOnExitHandler = onExit(cleanup) + + let threw = true + try { + fd = fs.openSync(tmpfile, 'w', options.mode || 0o666) + if (options.tmpfileCreated) { + options.tmpfileCreated(tmpfile) + } + if (ArrayBuffer.isView(data)) { + fs.writeSync(fd, data, 0, data.length, 0) + } else if (data != null) { + fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) + } + if (options.fsync !== false) { + fs.fsyncSync(fd) + } + + fs.closeSync(fd) + fd = null + + if (options.chown) { + try { + fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) + } catch (err) { + if (!isChownErrOk(err)) { + throw err + } + } + } + + if (options.mode) { + try { + fs.chmodSync(tmpfile, options.mode) + } catch (err) { + if (!isChownErrOk(err)) { + throw err + } + } + } + + fs.renameSync(tmpfile, filename) + threw = false + } finally { + if (fd) { + try { + fs.closeSync(fd) + } catch (ex) { + // ignore close errors at this stage, error may have closed fd already. + } + } + removeOnExitHandler() + if (threw) { + cleanup() + } + } +} diff --git a/node_modules/write-file-atomic/package.json b/node_modules/write-file-atomic/package.json new file mode 100644 index 000000000..54d58d7ee --- /dev/null +++ b/node_modules/write-file-atomic/package.json @@ -0,0 +1,57 @@ +{ + "name": "write-file-atomic", + "version": "5.0.1", + "description": "Write files in an atomic fashion w/configurable ownership", + "main": "./lib/index.js", + "scripts": { + "test": "tap", + "posttest": "npm run lint", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "lintfix": "npm run lint -- --fix", + "snap": "tap", + "template-oss-apply": "template-oss-apply --force" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/write-file-atomic.git" + }, + "keywords": [ + "writeFile", + "atomic" + ], + "author": "GitHub Inc.", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/write-file-atomic/issues" + }, + "homepage": "https://github.com/npm/write-file-atomic", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" + }, + "devDependencies": { + "@npmcli/eslint-config": "^4.0.0", + "@npmcli/template-oss": "4.14.1", + "tap": "^16.0.1" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "windowsCI": false, + "version": "4.14.1", + "publish": "true" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node_modules/yallist/LICENSE b/node_modules/yallist/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/yallist/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +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. diff --git a/node_modules/yallist/README.md b/node_modules/yallist/README.md new file mode 100644 index 000000000..f58610186 --- /dev/null +++ b/node_modules/yallist/README.md @@ -0,0 +1,204 @@ +# yallist + +Yet Another Linked List + +There are many doubly-linked list implementations like it, but this +one is mine. + +For when an array would be too big, and a Map can't be iterated in +reverse order. + + +[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) + +## basic usage + +```javascript +var yallist = require('yallist') +var myList = yallist.create([1, 2, 3]) +myList.push('foo') +myList.unshift('bar') +// of course pop() and shift() are there, too +console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] +myList.forEach(function (k) { + // walk the list head to tail +}) +myList.forEachReverse(function (k, index, list) { + // walk the list tail to head +}) +var myDoubledList = myList.map(function (k) { + return k + k +}) +// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] +// mapReverse is also a thing +var myDoubledListReverse = myList.mapReverse(function (k) { + return k + k +}) // ['foofoo', 6, 4, 2, 'barbar'] + +var reduced = myList.reduce(function (set, entry) { + set += entry + return set +}, 'start') +console.log(reduced) // 'startfoo123bar' +``` + +## api + +The whole API is considered "public". + +Functions with the same name as an Array method work more or less the +same way. + +There's reverse versions of most things because that's the point. + +### Yallist + +Default export, the class that holds and manages a list. + +Call it with either a forEach-able (like an array) or a set of +arguments, to initialize the list. + +The Array-ish methods all act like you'd expect. No magic length, +though, so if you change that it won't automatically prune or add +empty spots. + +### Yallist.create(..) + +Alias for Yallist function. Some people like factories. + +#### yallist.head + +The first node in the list + +#### yallist.tail + +The last node in the list + +#### yallist.length + +The number of nodes in the list. (Change this at your peril. It is +not magic like Array length.) + +#### yallist.toArray() + +Convert the list to an array. + +#### yallist.forEach(fn, [thisp]) + +Call a function on each item in the list. + +#### yallist.forEachReverse(fn, [thisp]) + +Call a function on each item in the list, in reverse order. + +#### yallist.get(n) + +Get the data at position `n` in the list. If you use this a lot, +probably better off just using an Array. + +#### yallist.getReverse(n) + +Get the data at position `n`, counting from the tail. + +#### yallist.map(fn, thisp) + +Create a new Yallist with the result of calling the function on each +item. + +#### yallist.mapReverse(fn, thisp) + +Same as `map`, but in reverse. + +#### yallist.pop() + +Get the data from the list tail, and remove the tail from the list. + +#### yallist.push(item, ...) + +Insert one or more items to the tail of the list. + +#### yallist.reduce(fn, initialValue) + +Like Array.reduce. + +#### yallist.reduceReverse + +Like Array.reduce, but in reverse. + +#### yallist.reverse + +Reverse the list in place. + +#### yallist.shift() + +Get the data from the list head, and remove the head from the list. + +#### yallist.slice([from], [to]) + +Just like Array.slice, but returns a new Yallist. + +#### yallist.sliceReverse([from], [to]) + +Just like yallist.slice, but the result is returned in reverse. + +#### yallist.toArray() + +Create an array representation of the list. + +#### yallist.toArrayReverse() + +Create a reversed array representation of the list. + +#### yallist.unshift(item, ...) + +Insert one or more items to the head of the list. + +#### yallist.unshiftNode(node) + +Move a Node object to the front of the list. (That is, pull it out of +wherever it lives, and make it the new head.) + +If the node belongs to a different list, then that list will remove it +first. + +#### yallist.pushNode(node) + +Move a Node object to the end of the list. (That is, pull it out of +wherever it lives, and make it the new tail.) + +If the node belongs to a list already, then that list will remove it +first. + +#### yallist.removeNode(node) + +Remove a node from the list, preserving referential integrity of head +and tail and other nodes. + +Will throw an error if you try to have a list remove a node that +doesn't belong to it. + +### Yallist.Node + +The class that holds the data and is actually the list. + +Call with `var n = new Node(value, previousNode, nextNode)` + +Note that if you do direct operations on Nodes themselves, it's very +easy to get into weird states where the list is broken. Be careful :) + +#### node.next + +The next node in the list. + +#### node.prev + +The previous node in the list. + +#### node.value + +The data the node contains. + +#### node.list + +The list to which this node belongs. (Null if it does not belong to +any list.) diff --git a/node_modules/yallist/iterator.js b/node_modules/yallist/iterator.js new file mode 100644 index 000000000..d41c97a19 --- /dev/null +++ b/node_modules/yallist/iterator.js @@ -0,0 +1,8 @@ +'use strict' +module.exports = function (Yallist) { + Yallist.prototype[Symbol.iterator] = function* () { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value + } + } +} diff --git a/node_modules/yallist/package.json b/node_modules/yallist/package.json new file mode 100644 index 000000000..8a083867d --- /dev/null +++ b/node_modules/yallist/package.json @@ -0,0 +1,29 @@ +{ + "name": "yallist", + "version": "4.0.0", + "description": "Yet Another Linked List", + "main": "yallist.js", + "directories": { + "test": "test" + }, + "files": [ + "yallist.js", + "iterator.js" + ], + "dependencies": {}, + "devDependencies": { + "tap": "^12.1.0" + }, + "scripts": { + "test": "tap test/*.js --100", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/yallist.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC" +} diff --git a/node_modules/yallist/yallist.js b/node_modules/yallist/yallist.js new file mode 100644 index 000000000..4e83ab1c5 --- /dev/null +++ b/node_modules/yallist/yallist.js @@ -0,0 +1,426 @@ +'use strict' +module.exports = Yallist + +Yallist.Node = Node +Yallist.create = Yallist + +function Yallist (list) { + var self = this + if (!(self instanceof Yallist)) { + self = new Yallist() + } + + self.tail = null + self.head = null + self.length = 0 + + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item) + }) + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]) + } + } + + return self +} + +Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list') + } + + var next = node.next + var prev = node.prev + + if (next) { + next.prev = prev + } + + if (prev) { + prev.next = next + } + + if (node === this.head) { + this.head = next + } + if (node === this.tail) { + this.tail = prev + } + + node.list.length-- + node.next = null + node.prev = null + node.list = null + + return next +} + +Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var head = this.head + node.list = this + node.next = head + if (head) { + head.prev = node + } + + this.head = node + if (!this.tail) { + this.tail = node + } + this.length++ +} + +Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var tail = this.tail + node.list = this + node.prev = tail + if (tail) { + tail.next = node + } + + this.tail = node + if (!this.head) { + this.head = node + } + this.length++ +} + +Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.pop = function () { + if (!this.tail) { + return undefined + } + + var res = this.tail.value + this.tail = this.tail.prev + if (this.tail) { + this.tail.next = null + } else { + this.head = null + } + this.length-- + return res +} + +Yallist.prototype.shift = function () { + if (!this.head) { + return undefined + } + + var res = this.head.value + this.head = this.head.next + if (this.head) { + this.head.prev = null + } else { + this.tail = null + } + this.length-- + return res +} + +Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this) + walker = walker.next + } +} + +Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this) + walker = walker.prev + } +} + +Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.head; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.next + } + return res +} + +Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.prev + } + return res +} + +Yallist.prototype.reduce = function (fn, initial) { + var acc + var walker = this.head + if (arguments.length > 1) { + acc = initial + } else if (this.head) { + walker = this.head.next + acc = this.head.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i) + walker = walker.next + } + + return acc +} + +Yallist.prototype.reduceReverse = function (fn, initial) { + var acc + var walker = this.tail + if (arguments.length > 1) { + acc = initial + } else if (this.tail) { + walker = this.tail.prev + acc = this.tail.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i) + walker = walker.prev + } + + return acc +} + +Yallist.prototype.toArray = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value + walker = walker.next + } + return arr +} + +Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value + walker = walker.prev + } + return arr +} + +Yallist.prototype.slice = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.splice = function (start, deleteCount, ...nodes) { + if (start > this.length) { + start = this.length - 1 + } + if (start < 0) { + start = this.length + start; + } + + for (var i = 0, walker = this.head; walker !== null && i < start; i++) { + walker = walker.next + } + + var ret = [] + for (var i = 0; walker && i < deleteCount; i++) { + ret.push(walker.value) + walker = this.removeNode(walker) + } + if (walker === null) { + walker = this.tail + } + + if (walker !== this.head && walker !== this.tail) { + walker = walker.prev + } + + for (var i = 0; i < nodes.length; i++) { + walker = insert(this, walker, nodes[i]) + } + return ret; +} + +Yallist.prototype.reverse = function () { + var head = this.head + var tail = this.tail + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev + walker.prev = walker.next + walker.next = p + } + this.head = tail + this.tail = head + return this +} + +function insert (self, node, value) { + var inserted = node === self.head ? + new Node(value, null, node, self) : + new Node(value, node, node.next, self) + + if (inserted.next === null) { + self.tail = inserted + } + if (inserted.prev === null) { + self.head = inserted + } + + self.length++ + + return inserted +} + +function push (self, item) { + self.tail = new Node(item, self.tail, null, self) + if (!self.head) { + self.head = self.tail + } + self.length++ +} + +function unshift (self, item) { + self.head = new Node(item, null, self.head, self) + if (!self.tail) { + self.tail = self.head + } + self.length++ +} + +function Node (value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list) + } + + this.list = list + this.value = value + + if (prev) { + prev.next = this + this.prev = prev + } else { + this.prev = null + } + + if (next) { + next.prev = this + this.next = next + } else { + this.next = null + } +} + +try { + // add if support for Symbol.iterator is present + require('./iterator.js')(Yallist) +} catch (er) {} diff --git a/node_modules/yargs-parser/CHANGELOG.md b/node_modules/yargs-parser/CHANGELOG.md new file mode 100644 index 000000000..2aad0acbd --- /dev/null +++ b/node_modules/yargs-parser/CHANGELOG.md @@ -0,0 +1,263 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [20.2.9](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.8...yargs-parser-v20.2.9) (2021-06-20) + + +### Bug Fixes + +* **build:** fixed automated release pipeline ([1fe9135](https://www.github.com/yargs/yargs-parser/commit/1fe9135884790a083615419b2861683e2597dac3)) + +### [20.2.8](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.7...yargs-parser-v20.2.8) (2021-06-20) + + +### Bug Fixes + +* **locale:** Turkish camelize and decamelize issues with toLocaleLowerCase/toLocaleUpperCase ([2617303](https://www.github.com/yargs/yargs-parser/commit/261730383e02448562f737b94bbd1f164aed5143)) +* **perf:** address slow parse when using unknown-options-as-args ([#394](https://www.github.com/yargs/yargs-parser/issues/394)) ([441f059](https://www.github.com/yargs/yargs-parser/commit/441f059d585d446551068ad213db79ac91daf83a)) +* **string-utils:** detect [0,1] ranged values as numbers ([#388](https://www.github.com/yargs/yargs-parser/issues/388)) ([efcc32c](https://www.github.com/yargs/yargs-parser/commit/efcc32c2d6b09aba31abfa2db9bd947befe5586b)) + +### [20.2.7](https://www.github.com/yargs/yargs-parser/compare/v20.2.6...v20.2.7) (2021-03-10) + + +### Bug Fixes + +* **deno:** force release for Deno ([6687c97](https://www.github.com/yargs/yargs-parser/commit/6687c972d0f3ca7865a97908dde3080b05f8b026)) + +### [20.2.6](https://www.github.com/yargs/yargs-parser/compare/v20.2.5...v20.2.6) (2021-02-22) + + +### Bug Fixes + +* **populate--:** -- should always be array ([#354](https://www.github.com/yargs/yargs-parser/issues/354)) ([585ae8f](https://www.github.com/yargs/yargs-parser/commit/585ae8ffad74cc02974f92d788e750137fd65146)) + +### [20.2.5](https://www.github.com/yargs/yargs-parser/compare/v20.2.4...v20.2.5) (2021-02-13) + + +### Bug Fixes + +* do not lowercase camel cased string ([#348](https://www.github.com/yargs/yargs-parser/issues/348)) ([5f4da1f](https://www.github.com/yargs/yargs-parser/commit/5f4da1f17d9d50542d2aaa206c9806ce3e320335)) + +### [20.2.4](https://www.github.com/yargs/yargs-parser/compare/v20.2.3...v20.2.4) (2020-11-09) + + +### Bug Fixes + +* **deno:** address import issues in Deno ([#339](https://www.github.com/yargs/yargs-parser/issues/339)) ([3b54e5e](https://www.github.com/yargs/yargs-parser/commit/3b54e5eef6e9a7b7c6eec7c12bab3ba3b8ba8306)) + +### [20.2.3](https://www.github.com/yargs/yargs-parser/compare/v20.2.2...v20.2.3) (2020-10-16) + + +### Bug Fixes + +* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#336](https://www.github.com/yargs/yargs-parser/issues/336)) ([3ae7242](https://www.github.com/yargs/yargs-parser/commit/3ae7242040ff876d28dabded60ac226e00150c88)) + +### [20.2.2](https://www.github.com/yargs/yargs-parser/compare/v20.2.1...v20.2.2) (2020-10-14) + + +### Bug Fixes + +* **exports:** node 13.0-13.6 require a string fallback ([#333](https://www.github.com/yargs/yargs-parser/issues/333)) ([291aeda](https://www.github.com/yargs/yargs-parser/commit/291aeda06b685b7a015d83bdf2558e180b37388d)) + +### [20.2.1](https://www.github.com/yargs/yargs-parser/compare/v20.2.0...v20.2.1) (2020-10-01) + + +### Bug Fixes + +* **deno:** update types for deno ^1.4.0 ([#330](https://www.github.com/yargs/yargs-parser/issues/330)) ([0ab92e5](https://www.github.com/yargs/yargs-parser/commit/0ab92e50b090f11196334c048c9c92cecaddaf56)) + +## [20.2.0](https://www.github.com/yargs/yargs-parser/compare/v20.1.0...v20.2.0) (2020-09-21) + + +### Features + +* **string-utils:** export looksLikeNumber helper ([#324](https://www.github.com/yargs/yargs-parser/issues/324)) ([c8580a2](https://www.github.com/yargs/yargs-parser/commit/c8580a2327b55f6342acecb6e72b62963d506750)) + + +### Bug Fixes + +* **unknown-options-as-args:** convert positionals that look like numbers ([#326](https://www.github.com/yargs/yargs-parser/issues/326)) ([f85ebb4](https://www.github.com/yargs/yargs-parser/commit/f85ebb4face9d4b0f56147659404cbe0002f3dad)) + +## [20.1.0](https://www.github.com/yargs/yargs-parser/compare/v20.0.0...v20.1.0) (2020-09-20) + + +### Features + +* adds parse-positional-numbers configuration ([#321](https://www.github.com/yargs/yargs-parser/issues/321)) ([9cec00a](https://www.github.com/yargs/yargs-parser/commit/9cec00a622251292ffb7dce6f78f5353afaa0d4c)) + + +### Bug Fixes + +* **build:** update release-please; make labels kick off builds ([#323](https://www.github.com/yargs/yargs-parser/issues/323)) ([09f448b](https://www.github.com/yargs/yargs-parser/commit/09f448b4cd66e25d2872544718df46dab8af062a)) + +## [20.0.0](https://www.github.com/yargs/yargs-parser/compare/v19.0.4...v20.0.0) (2020-09-09) + + +### ⚠ BREAKING CHANGES + +* do not ship type definitions (#318) + +### Bug Fixes + +* only strip camel case if hyphenated ([#316](https://www.github.com/yargs/yargs-parser/issues/316)) ([95a9e78](https://www.github.com/yargs/yargs-parser/commit/95a9e785127b9bbf2d1db1f1f808ca1fb100e82a)), closes [#315](https://www.github.com/yargs/yargs-parser/issues/315) + + +### Code Refactoring + +* do not ship type definitions ([#318](https://www.github.com/yargs/yargs-parser/issues/318)) ([8fbd56f](https://www.github.com/yargs/yargs-parser/commit/8fbd56f1d0b6c44c30fca62708812151ca0ce330)) + +### [19.0.4](https://www.github.com/yargs/yargs-parser/compare/v19.0.3...v19.0.4) (2020-08-27) + + +### Bug Fixes + +* **build:** fixing publication ([#310](https://www.github.com/yargs/yargs-parser/issues/310)) ([5d3c6c2](https://www.github.com/yargs/yargs-parser/commit/5d3c6c29a9126248ba601920d9cf87c78e161ff5)) + +### [19.0.3](https://www.github.com/yargs/yargs-parser/compare/v19.0.2...v19.0.3) (2020-08-27) + + +### Bug Fixes + +* **build:** switch to action for publish ([#308](https://www.github.com/yargs/yargs-parser/issues/308)) ([5c2f305](https://www.github.com/yargs/yargs-parser/commit/5c2f30585342bcd8aaf926407c863099d256d174)) + +### [19.0.2](https://www.github.com/yargs/yargs-parser/compare/v19.0.1...v19.0.2) (2020-08-27) + + +### Bug Fixes + +* **types:** envPrefix should be optional ([#305](https://www.github.com/yargs/yargs-parser/issues/305)) ([ae3f180](https://www.github.com/yargs/yargs-parser/commit/ae3f180e14df2de2fd962145f4518f9aa0e76523)) + +### [19.0.1](https://www.github.com/yargs/yargs-parser/compare/v19.0.0...v19.0.1) (2020-08-09) + + +### Bug Fixes + +* **build:** push tag created for deno ([2186a14](https://www.github.com/yargs/yargs-parser/commit/2186a14989749887d56189867602e39e6679f8b0)) + +## [19.0.0](https://www.github.com/yargs/yargs-parser/compare/v18.1.3...v19.0.0) (2020-08-09) + + +### ⚠ BREAKING CHANGES + +* adds support for ESM and Deno (#295) +* **ts:** projects using `@types/yargs-parser` may see variations in type definitions. +* drops Node 6. begin following Node.js LTS schedule (#278) + +### Features + +* adds support for ESM and Deno ([#295](https://www.github.com/yargs/yargs-parser/issues/295)) ([195bc4a](https://www.github.com/yargs/yargs-parser/commit/195bc4a7f20c2a8f8e33fbb6ba96ef6e9a0120a1)) +* expose camelCase and decamelize helpers ([#296](https://www.github.com/yargs/yargs-parser/issues/296)) ([39154ce](https://www.github.com/yargs/yargs-parser/commit/39154ceb5bdcf76b5f59a9219b34cedb79b67f26)) +* **deps:** update to latest camelcase/decamelize ([#281](https://www.github.com/yargs/yargs-parser/issues/281)) ([8931ab0](https://www.github.com/yargs/yargs-parser/commit/8931ab08f686cc55286f33a95a83537da2be5516)) + + +### Bug Fixes + +* boolean numeric short option ([#294](https://www.github.com/yargs/yargs-parser/issues/294)) ([f600082](https://www.github.com/yargs/yargs-parser/commit/f600082c959e092076caf420bbbc9d7a231e2418)) +* raise permission error for Deno if config load fails ([#298](https://www.github.com/yargs/yargs-parser/issues/298)) ([1174e2b](https://www.github.com/yargs/yargs-parser/commit/1174e2b3f0c845a1cd64e14ffc3703e730567a84)) +* **deps:** update dependency decamelize to v3 ([#274](https://www.github.com/yargs/yargs-parser/issues/274)) ([4d98698](https://www.github.com/yargs/yargs-parser/commit/4d98698bc6767e84ec54a0842908191739be73b7)) +* **types:** switch back to using Partial types ([#293](https://www.github.com/yargs/yargs-parser/issues/293)) ([bdc80ba](https://www.github.com/yargs/yargs-parser/commit/bdc80ba59fa13bc3025ce0a85e8bad9f9da24ea7)) + + +### Build System + +* drops Node 6. begin following Node.js LTS schedule ([#278](https://www.github.com/yargs/yargs-parser/issues/278)) ([9014ed7](https://www.github.com/yargs/yargs-parser/commit/9014ed722a32768b96b829e65a31705db5c1458a)) + + +### Code Refactoring + +* **ts:** move index.js to TypeScript ([#292](https://www.github.com/yargs/yargs-parser/issues/292)) ([f78d2b9](https://www.github.com/yargs/yargs-parser/commit/f78d2b97567ac4828624406e420b4047c710b789)) + +### [18.1.3](https://www.github.com/yargs/yargs-parser/compare/v18.1.2...v18.1.3) (2020-04-16) + + +### Bug Fixes + +* **setArg:** options using camel-case and dot-notation populated twice ([#268](https://www.github.com/yargs/yargs-parser/issues/268)) ([f7e15b9](https://www.github.com/yargs/yargs-parser/commit/f7e15b9800900b9856acac1a830a5f35847be73e)) + +### [18.1.2](https://www.github.com/yargs/yargs-parser/compare/v18.1.1...v18.1.2) (2020-03-26) + + +### Bug Fixes + +* **array, nargs:** support -o=--value and --option=--value format ([#262](https://www.github.com/yargs/yargs-parser/issues/262)) ([41d3f81](https://www.github.com/yargs/yargs-parser/commit/41d3f8139e116706b28de9b0de3433feb08d2f13)) + +### [18.1.1](https://www.github.com/yargs/yargs-parser/compare/v18.1.0...v18.1.1) (2020-03-16) + + +### Bug Fixes + +* \_\_proto\_\_ will now be replaced with \_\_\_proto\_\_\_ in parse ([#258](https://www.github.com/yargs/yargs-parser/issues/258)), patching a potential +prototype pollution vulnerability. This was reported by the Snyk Security Research Team.([63810ca](https://www.github.com/yargs/yargs-parser/commit/63810ca1ae1a24b08293a4d971e70e058c7a41e2)) + +## [18.1.0](https://www.github.com/yargs/yargs-parser/compare/v18.0.0...v18.1.0) (2020-03-07) + + +### Features + +* introduce single-digit boolean aliases ([#255](https://www.github.com/yargs/yargs-parser/issues/255)) ([9c60265](https://www.github.com/yargs/yargs-parser/commit/9c60265fd7a03cb98e6df3e32c8c5e7508d9f56f)) + +## [18.0.0](https://www.github.com/yargs/yargs-parser/compare/v17.1.0...v18.0.0) (2020-03-02) + + +### ⚠ BREAKING CHANGES + +* the narg count is now enforced when parsing arrays. + +### Features + +* NaN can now be provided as a value for nargs, indicating "at least" one value is expected for array ([#251](https://www.github.com/yargs/yargs-parser/issues/251)) ([9db4be8](https://www.github.com/yargs/yargs-parser/commit/9db4be81417a2c7097128db34d86fe70ef4af70c)) + +## [17.1.0](https://www.github.com/yargs/yargs-parser/compare/v17.0.1...v17.1.0) (2020-03-01) + + +### Features + +* introduce greedy-arrays config, for specifying whether arrays consume multiple positionals ([#249](https://www.github.com/yargs/yargs-parser/issues/249)) ([60e880a](https://www.github.com/yargs/yargs-parser/commit/60e880a837046314d89fa4725f923837fd33a9eb)) + +### [17.0.1](https://www.github.com/yargs/yargs-parser/compare/v17.0.0...v17.0.1) (2020-02-29) + + +### Bug Fixes + +* normalized keys were not enumerable ([#247](https://www.github.com/yargs/yargs-parser/issues/247)) ([57119f9](https://www.github.com/yargs/yargs-parser/commit/57119f9f17cf27499bd95e61c2f72d18314f11ba)) + +## [17.0.0](https://www.github.com/yargs/yargs-parser/compare/v16.1.0...v17.0.0) (2020-02-10) + + +### ⚠ BREAKING CHANGES + +* this reverts parsing behavior of booleans to that of yargs@14 +* objects used during parsing are now created with a null +prototype. There may be some scenarios where this change in behavior +leaks externally. + +### Features + +* boolean arguments will not be collected into an implicit array ([#236](https://www.github.com/yargs/yargs-parser/issues/236)) ([34c4e19](https://www.github.com/yargs/yargs-parser/commit/34c4e19bae4e7af63e3cb6fa654a97ed476e5eb5)) +* introduce nargs-eats-options config option ([#246](https://www.github.com/yargs/yargs-parser/issues/246)) ([d50822a](https://www.github.com/yargs/yargs-parser/commit/d50822ac10e1b05f2e9643671ca131ac251b6732)) + + +### Bug Fixes + +* address bugs with "uknown-options-as-args" ([bc023e3](https://www.github.com/yargs/yargs-parser/commit/bc023e3b13e20a118353f9507d1c999bf388a346)) +* array should take precedence over nargs, but enforce nargs ([#243](https://www.github.com/yargs/yargs-parser/issues/243)) ([4cbc188](https://www.github.com/yargs/yargs-parser/commit/4cbc188b7abb2249529a19c090338debdad2fe6c)) +* support keys that collide with object prototypes ([#234](https://www.github.com/yargs/yargs-parser/issues/234)) ([1587b6d](https://www.github.com/yargs/yargs-parser/commit/1587b6d91db853a9109f1be6b209077993fee4de)) +* unknown options terminated with digits now handled by unknown-options-as-args ([#238](https://www.github.com/yargs/yargs-parser/issues/238)) ([d36cdfa](https://www.github.com/yargs/yargs-parser/commit/d36cdfa854254d7c7e0fe1d583818332ac46c2a5)) + +## [16.1.0](https://www.github.com/yargs/yargs-parser/compare/v16.0.0...v16.1.0) (2019-11-01) + + +### ⚠ BREAKING CHANGES + +* populate error if incompatible narg/count or array/count options are used (#191) + +### Features + +* options that have had their default value used are now tracked ([#211](https://www.github.com/yargs/yargs-parser/issues/211)) ([a525234](https://www.github.com/yargs/yargs-parser/commit/a525234558c847deedd73f8792e0a3b77b26e2c0)) +* populate error if incompatible narg/count or array/count options are used ([#191](https://www.github.com/yargs/yargs-parser/issues/191)) ([84a401f](https://www.github.com/yargs/yargs-parser/commit/84a401f0fa3095e0a19661670d1570d0c3b9d3c9)) + + +### Reverts + +* revert 16.0.0 CHANGELOG entry ([920320a](https://www.github.com/yargs/yargs-parser/commit/920320ad9861bbfd58eda39221ae211540fc1daf)) diff --git a/node_modules/yargs-parser/LICENSE.txt b/node_modules/yargs-parser/LICENSE.txt new file mode 100644 index 000000000..836440bef --- /dev/null +++ b/node_modules/yargs-parser/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, Contributors + +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. diff --git a/node_modules/yargs-parser/README.md b/node_modules/yargs-parser/README.md new file mode 100644 index 000000000..261484076 --- /dev/null +++ b/node_modules/yargs-parser/README.md @@ -0,0 +1,518 @@ +# yargs-parser + +![ci](https://github.com/yargs/yargs-parser/workflows/ci/badge.svg) +[![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser) +[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) +![nycrc config on GitHub](https://img.shields.io/nycrc/yargs/yargs-parser) + +The mighty option parser used by [yargs](https://github.com/yargs/yargs). + +visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions. + + + +## Example + +```sh +npm i yargs-parser --save +``` + +```js +const argv = require('yargs-parser')(process.argv.slice(2)) +console.log(argv) +``` + +```console +$ node example.js --foo=33 --bar hello +{ _: [], foo: 33, bar: 'hello' } +``` + +_or parse a string!_ + +```js +const argv = require('yargs-parser')('--foo=99 --bar=33') +console.log(argv) +``` + +```console +{ _: [], foo: 99, bar: 33 } +``` + +Convert an array of mixed types before passing to `yargs-parser`: + +```js +const parse = require('yargs-parser') +parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string +parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings +``` + +## Deno Example + +As of `v19` `yargs-parser` supports [Deno](https://github.com/denoland/deno): + +```typescript +import parser from "https://deno.land/x/yargs_parser/deno.ts"; + +const argv = parser('--foo=99 --bar=9987930', { + string: ['bar'] +}) +console.log(argv) +``` + +## ESM Example + +As of `v19` `yargs-parser` supports ESM (_both in Node.js and in the browser_): + +**Node.js:** + +```js +import parser from 'yargs-parser' + +const argv = parser('--foo=99 --bar=9987930', { + string: ['bar'] +}) +console.log(argv) +``` + +**Browsers:** + +```html + + + + +``` + +## API + +### parser(args, opts={}) + +Parses command line arguments returning a simple mapping of keys and values. + +**expects:** + +* `args`: a string or array of strings representing the options to parse. +* `opts`: provide a set of hints indicating how `args` should be parsed: + * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`. + * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.
+ Indicate that keys should be parsed as an array and coerced to booleans / numbers:
+ `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`. + * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`. + * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided + (or throws an error). For arrays the function is called only once for the entire array:
+ `{coerce: {foo: function (arg) {return modifiedArg}}}`. + * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). + * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:
+ `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`. + * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). + * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`. + * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`. + * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed. + * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`. + * `opts.normalize`: `path.normalize()` will be applied to values set to this key. + * `opts.number`: keys should be treated as numbers. + * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). + +**returns:** + +* `obj`: an object representing the parsed value of `args` + * `key/value`: key value pairs for each argument and their aliases. + * `_`: an array representing the positional arguments. + * [optional] `--`: an array with arguments after the end-of-options flag `--`. + +### require('yargs-parser').detailed(args, opts={}) + +Parses a command line string, returning detailed information required by the +yargs engine. + +**expects:** + +* `args`: a string or array of strings representing options to parse. +* `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`. + +**returns:** + +* `argv`: an object representing the parsed value of `args` + * `key/value`: key value pairs for each argument and their aliases. + * `_`: an array representing the positional arguments. + * [optional] `--`: an array with arguments after the end-of-options flag `--`. +* `error`: populated with an error object if an exception occurred during parsing. +* `aliases`: the inferred list of aliases built by combining lists in `opts.alias`. +* `newAliases`: any new aliases added via camel-case expansion: + * `boolean`: `{ fooBar: true }` +* `defaulted`: any new argument created by `opts.default`, no aliases included. + * `boolean`: `{ foo: true }` +* `configuration`: given by default settings and `opts.configuration`. + + + +### Configuration + +The yargs-parser applies several automated transformations on the keys provided +in `args`. These features can be turned on and off using the `configuration` field +of `opts`. + +```js +var parsed = parser(['--no-dice'], { + configuration: { + 'boolean-negation': false + } +}) +``` + +### short option groups + +* default: `true`. +* key: `short-option-groups`. + +Should a group of short-options be treated as boolean flags? + +```console +$ node example.js -abc +{ _: [], a: true, b: true, c: true } +``` + +_if disabled:_ + +```console +$ node example.js -abc +{ _: [], abc: true } +``` + +### camel-case expansion + +* default: `true`. +* key: `camel-case-expansion`. + +Should hyphenated arguments be expanded into camel-case aliases? + +```console +$ node example.js --foo-bar +{ _: [], 'foo-bar': true, fooBar: true } +``` + +_if disabled:_ + +```console +$ node example.js --foo-bar +{ _: [], 'foo-bar': true } +``` + +### dot-notation + +* default: `true` +* key: `dot-notation` + +Should keys that contain `.` be treated as objects? + +```console +$ node example.js --foo.bar +{ _: [], foo: { bar: true } } +``` + +_if disabled:_ + +```console +$ node example.js --foo.bar +{ _: [], "foo.bar": true } +``` + +### parse numbers + +* default: `true` +* key: `parse-numbers` + +Should keys that look like numbers be treated as such? + +```console +$ node example.js --foo=99.3 +{ _: [], foo: 99.3 } +``` + +_if disabled:_ + +```console +$ node example.js --foo=99.3 +{ _: [], foo: "99.3" } +``` + +### parse positional numbers + +* default: `true` +* key: `parse-positional-numbers` + +Should positional keys that look like numbers be treated as such. + +```console +$ node example.js 99.3 +{ _: [99.3] } +``` + +_if disabled:_ + +```console +$ node example.js 99.3 +{ _: ['99.3'] } +``` + +### boolean negation + +* default: `true` +* key: `boolean-negation` + +Should variables prefixed with `--no` be treated as negations? + +```console +$ node example.js --no-foo +{ _: [], foo: false } +``` + +_if disabled:_ + +```console +$ node example.js --no-foo +{ _: [], "no-foo": true } +``` + +### combine arrays + +* default: `false` +* key: `combine-arrays` + +Should arrays be combined when provided by both command line arguments and +a configuration file. + +### duplicate arguments array + +* default: `true` +* key: `duplicate-arguments-array` + +Should arguments be coerced into an array when duplicated: + +```console +$ node example.js -x 1 -x 2 +{ _: [], x: [1, 2] } +``` + +_if disabled:_ + +```console +$ node example.js -x 1 -x 2 +{ _: [], x: 2 } +``` + +### flatten duplicate arrays + +* default: `true` +* key: `flatten-duplicate-arrays` + +Should array arguments be coerced into a single array when duplicated: + +```console +$ node example.js -x 1 2 -x 3 4 +{ _: [], x: [1, 2, 3, 4] } +``` + +_if disabled:_ + +```console +$ node example.js -x 1 2 -x 3 4 +{ _: [], x: [[1, 2], [3, 4]] } +``` + +### greedy arrays + +* default: `true` +* key: `greedy-arrays` + +Should arrays consume more than one positional argument following their flag. + +```console +$ node example --arr 1 2 +{ _: [], arr: [1, 2] } +``` + +_if disabled:_ + +```console +$ node example --arr 1 2 +{ _: [2], arr: [1] } +``` + +**Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.** + +### nargs eats options + +* default: `false` +* key: `nargs-eats-options` + +Should nargs consume dash options as well as positional arguments. + +### negation prefix + +* default: `no-` +* key: `negation-prefix` + +The prefix to use for negated boolean variables. + +```console +$ node example.js --no-foo +{ _: [], foo: false } +``` + +_if set to `quux`:_ + +```console +$ node example.js --quuxfoo +{ _: [], foo: false } +``` + +### populate -- + +* default: `false`. +* key: `populate--` + +Should unparsed flags be stored in `--` or `_`. + +_If disabled:_ + +```console +$ node example.js a -b -- x y +{ _: [ 'a', 'x', 'y' ], b: true } +``` + +_If enabled:_ + +```console +$ node example.js a -b -- x y +{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true } +``` + +### set placeholder key + +* default: `false`. +* key: `set-placeholder-key`. + +Should a placeholder be added for keys not set via the corresponding CLI argument? + +_If disabled:_ + +```console +$ node example.js -a 1 -c 2 +{ _: [], a: 1, c: 2 } +``` + +_If enabled:_ + +```console +$ node example.js -a 1 -c 2 +{ _: [], a: 1, b: undefined, c: 2 } +``` + +### halt at non-option + +* default: `false`. +* key: `halt-at-non-option`. + +Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line. + +_If disabled:_ + +```console +$ node example.js -a run b -x y +{ _: [ 'b' ], a: 'run', x: 'y' } +``` + +_If enabled:_ + +```console +$ node example.js -a run b -x y +{ _: [ 'b', '-x', 'y' ], a: 'run' } +``` + +### strip aliased + +* default: `false` +* key: `strip-aliased` + +Should aliases be removed before returning results? + +_If disabled:_ + +```console +$ node example.js --test-field 1 +{ _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 } +``` + +_If enabled:_ + +```console +$ node example.js --test-field 1 +{ _: [], 'test-field': 1, testField: 1 } +``` + +### strip dashed + +* default: `false` +* key: `strip-dashed` + +Should dashed keys be removed before returning results? This option has no effect if +`camel-case-expansion` is disabled. + +_If disabled:_ + +```console +$ node example.js --test-field 1 +{ _: [], 'test-field': 1, testField: 1 } +``` + +_If enabled:_ + +```console +$ node example.js --test-field 1 +{ _: [], testField: 1 } +``` + +### unknown options as args + +* default: `false` +* key: `unknown-options-as-args` + +Should unknown options be treated like regular arguments? An unknown option is one that is not +configured in `opts`. + +_If disabled_ + +```console +$ node example.js --unknown-option --known-option 2 --string-option --unknown-option2 +{ _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true } +``` + +_If enabled_ + +```console +$ node example.js --unknown-option --known-option 2 --string-option --unknown-option2 +{ _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' } +``` + +## Supported Node.js Versions + +Libraries in this ecosystem make a best effort to track +[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a +post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). + +## Special Thanks + +The yargs project evolves from optimist and minimist. It owes its +existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/ + +## License + +ISC diff --git a/node_modules/yargs-parser/browser.js b/node_modules/yargs-parser/browser.js new file mode 100644 index 000000000..241202c7e --- /dev/null +++ b/node_modules/yargs-parser/browser.js @@ -0,0 +1,29 @@ +// Main entrypoint for ESM web browser environments. Avoids using Node.js +// specific libraries, such as "path". +// +// TODO: figure out reasonable web equivalents for "resolve", "normalize", etc. +import { camelCase, decamelize, looksLikeNumber } from './build/lib/string-utils.js' +import { YargsParser } from './build/lib/yargs-parser.js' +const parser = new YargsParser({ + cwd: () => { return '' }, + format: (str, arg) => { return str.replace('%s', arg) }, + normalize: (str) => { return str }, + resolve: (str) => { return str }, + require: () => { + throw Error('loading config from files not currently supported in browser') + }, + env: () => {} +}) + +const yargsParser = function Parser (args, opts) { + const result = parser.parse(args.slice(), opts) + return result.argv +} +yargsParser.detailed = function (args, opts) { + return parser.parse(args.slice(), opts) +} +yargsParser.camelCase = camelCase +yargsParser.decamelize = decamelize +yargsParser.looksLikeNumber = looksLikeNumber + +export default yargsParser diff --git a/node_modules/yargs-parser/build/index.cjs b/node_modules/yargs-parser/build/index.cjs new file mode 100644 index 000000000..33b5ebd49 --- /dev/null +++ b/node_modules/yargs-parser/build/index.cjs @@ -0,0 +1,1042 @@ +'use strict'; + +var util = require('util'); +var fs = require('fs'); +var path = require('path'); + +function camelCase(str) { + const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase(); + if (!isCamelCase) { + str = str.toLowerCase(); + } + if (str.indexOf('-') === -1 && str.indexOf('_') === -1) { + return str; + } + else { + let camelcase = ''; + let nextChrUpper = false; + const leadingHyphens = str.match(/^-+/); + for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) { + let chr = str.charAt(i); + if (nextChrUpper) { + nextChrUpper = false; + chr = chr.toUpperCase(); + } + if (i !== 0 && (chr === '-' || chr === '_')) { + nextChrUpper = true; + } + else if (chr !== '-' && chr !== '_') { + camelcase += chr; + } + } + return camelcase; + } +} +function decamelize(str, joinString) { + const lowercase = str.toLowerCase(); + joinString = joinString || '-'; + let notCamelcase = ''; + for (let i = 0; i < str.length; i++) { + const chrLower = lowercase.charAt(i); + const chrString = str.charAt(i); + if (chrLower !== chrString && i > 0) { + notCamelcase += `${joinString}${lowercase.charAt(i)}`; + } + else { + notCamelcase += chrString; + } + } + return notCamelcase; +} +function looksLikeNumber(x) { + if (x === null || x === undefined) + return false; + if (typeof x === 'number') + return true; + if (/^0x[0-9a-f]+$/i.test(x)) + return true; + if (/^0[^.]/.test(x)) + return false; + return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + +function tokenizeArgString(argString) { + if (Array.isArray(argString)) { + return argString.map(e => typeof e !== 'string' ? e + '' : e); + } + argString = argString.trim(); + let i = 0; + let prevC = null; + let c = null; + let opening = null; + const args = []; + for (let ii = 0; ii < argString.length; ii++) { + prevC = c; + c = argString.charAt(ii); + if (c === ' ' && !opening) { + if (!(prevC === ' ')) { + i++; + } + continue; + } + if (c === opening) { + opening = null; + } + else if ((c === "'" || c === '"') && !opening) { + opening = c; + } + if (!args[i]) + args[i] = ''; + args[i] += c; + } + return args; +} + +var DefaultValuesForTypeKey; +(function (DefaultValuesForTypeKey) { + DefaultValuesForTypeKey["BOOLEAN"] = "boolean"; + DefaultValuesForTypeKey["STRING"] = "string"; + DefaultValuesForTypeKey["NUMBER"] = "number"; + DefaultValuesForTypeKey["ARRAY"] = "array"; +})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); + +let mixin; +class YargsParser { + constructor(_mixin) { + mixin = _mixin; + } + parse(argsInput, options) { + const opts = Object.assign({ + alias: undefined, + array: undefined, + boolean: undefined, + config: undefined, + configObjects: undefined, + configuration: undefined, + coerce: undefined, + count: undefined, + default: undefined, + envPrefix: undefined, + narg: undefined, + normalize: undefined, + string: undefined, + number: undefined, + __: undefined, + key: undefined + }, options); + const args = tokenizeArgString(argsInput); + const aliases = combineAliases(Object.assign(Object.create(null), opts.alias)); + const configuration = Object.assign({ + 'boolean-negation': true, + 'camel-case-expansion': true, + 'combine-arrays': false, + 'dot-notation': true, + 'duplicate-arguments-array': true, + 'flatten-duplicate-arrays': true, + 'greedy-arrays': true, + 'halt-at-non-option': false, + 'nargs-eats-options': false, + 'negation-prefix': 'no-', + 'parse-numbers': true, + 'parse-positional-numbers': true, + 'populate--': false, + 'set-placeholder-key': false, + 'short-option-groups': true, + 'strip-aliased': false, + 'strip-dashed': false, + 'unknown-options-as-args': false + }, opts.configuration); + const defaults = Object.assign(Object.create(null), opts.default); + const configObjects = opts.configObjects || []; + const envPrefix = opts.envPrefix; + const notFlagsOption = configuration['populate--']; + const notFlagsArgv = notFlagsOption ? '--' : '_'; + const newAliases = Object.create(null); + const defaulted = Object.create(null); + const __ = opts.__ || mixin.format; + const flags = { + aliases: Object.create(null), + arrays: Object.create(null), + bools: Object.create(null), + strings: Object.create(null), + numbers: Object.create(null), + counts: Object.create(null), + normalize: Object.create(null), + configs: Object.create(null), + nargs: Object.create(null), + coercions: Object.create(null), + keys: [] + }; + const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; + const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)'); + [].concat(opts.array || []).filter(Boolean).forEach(function (opt) { + const key = typeof opt === 'object' ? opt.key : opt; + const assignment = Object.keys(opt).map(function (key) { + const arrayFlagKeys = { + boolean: 'bools', + string: 'strings', + number: 'numbers' + }; + return arrayFlagKeys[key]; + }).filter(Boolean).pop(); + if (assignment) { + flags[assignment][key] = true; + } + flags.arrays[key] = true; + flags.keys.push(key); + }); + [].concat(opts.boolean || []).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + flags.keys.push(key); + }); + [].concat(opts.string || []).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + flags.keys.push(key); + }); + [].concat(opts.number || []).filter(Boolean).forEach(function (key) { + flags.numbers[key] = true; + flags.keys.push(key); + }); + [].concat(opts.count || []).filter(Boolean).forEach(function (key) { + flags.counts[key] = true; + flags.keys.push(key); + }); + [].concat(opts.normalize || []).filter(Boolean).forEach(function (key) { + flags.normalize[key] = true; + flags.keys.push(key); + }); + if (typeof opts.narg === 'object') { + Object.entries(opts.narg).forEach(([key, value]) => { + if (typeof value === 'number') { + flags.nargs[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.coerce === 'object') { + Object.entries(opts.coerce).forEach(([key, value]) => { + if (typeof value === 'function') { + flags.coercions[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.config !== 'undefined') { + if (Array.isArray(opts.config) || typeof opts.config === 'string') { + [].concat(opts.config).filter(Boolean).forEach(function (key) { + flags.configs[key] = true; + }); + } + else if (typeof opts.config === 'object') { + Object.entries(opts.config).forEach(([key, value]) => { + if (typeof value === 'boolean' || typeof value === 'function') { + flags.configs[key] = value; + } + }); + } + } + extendAliases(opts.key, aliases, opts.default, flags.arrays); + Object.keys(defaults).forEach(function (key) { + (flags.aliases[key] || []).forEach(function (alias) { + defaults[alias] = defaults[key]; + }); + }); + let error = null; + checkConfiguration(); + let notFlags = []; + const argv = Object.assign(Object.create(null), { _: [] }); + const argvReturn = {}; + for (let i = 0; i < args.length; i++) { + const arg = args[i]; + const truncatedArg = arg.replace(/^-{3,}/, '---'); + let broken; + let key; + let letters; + let m; + let next; + let value; + if (arg !== '--' && isUnknownOptionAsArg(arg)) { + pushPositional(arg); + } + else if (truncatedArg.match(/---+(=|$)/)) { + pushPositional(arg); + continue; + } + else if (arg.match(/^--.+=/) || (!configuration['short-option-groups'] && arg.match(/^-.+=/))) { + m = arg.match(/^--?([^=]+)=([\s\S]*)$/); + if (m !== null && Array.isArray(m) && m.length >= 3) { + if (checkAllAliases(m[1], flags.arrays)) { + i = eatArray(i, m[1], args, m[2]); + } + else if (checkAllAliases(m[1], flags.nargs) !== false) { + i = eatNargs(i, m[1], args, m[2]); + } + else { + setArg(m[1], m[2]); + } + } + } + else if (arg.match(negatedBoolean) && configuration['boolean-negation']) { + m = arg.match(negatedBoolean); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false); + } + } + else if (arg.match(/^--.+/) || (!configuration['short-option-groups'] && arg.match(/^-[^-]+/))) { + m = arg.match(/^--?(.+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (checkAllAliases(key, flags.arrays)) { + i = eatArray(i, key, args); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + i = eatNargs(i, key, args); + } + else { + next = args[i + 1]; + if (next !== undefined && (!next.match(/^-/) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + } + else if (arg.match(/^-.\..+=/)) { + m = arg.match(/^-([^=]+)=([\s\S]*)$/); + if (m !== null && Array.isArray(m) && m.length >= 3) { + setArg(m[1], m[2]); + } + } + else if (arg.match(/^-.\..+/) && !arg.match(negative)) { + next = args[i + 1]; + m = arg.match(/^-(.\..+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (next !== undefined && !next.match(/^-/) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { + letters = arg.slice(1, -1).split(''); + broken = false; + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (letters[j + 1] && letters[j + 1] === '=') { + value = arg.slice(j + 3); + key = letters[j]; + if (checkAllAliases(key, flags.arrays)) { + i = eatArray(i, key, args, value); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + i = eatNargs(i, key, args, value); + } + else { + setArg(key, value); + } + broken = true; + break; + } + if (next === '-') { + setArg(letters[j], next); + continue; + } + if (/[A-Za-z]/.test(letters[j]) && + /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && + checkAllAliases(next, flags.bools) === false) { + setArg(letters[j], next); + broken = true; + break; + } + if (letters[j + 1] && letters[j + 1].match(/\W/)) { + setArg(letters[j], next); + broken = true; + break; + } + else { + setArg(letters[j], defaultValue(letters[j])); + } + } + key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (checkAllAliases(key, flags.arrays)) { + i = eatArray(i, key, args); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + i = eatNargs(i, key, args); + } + else { + next = args[i + 1]; + if (next !== undefined && (!/^(-|--)[^-]/.test(next) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + } + else if (arg.match(/^-[0-9]$/) && + arg.match(negative) && + checkAllAliases(arg.slice(1), flags.bools)) { + key = arg.slice(1); + setArg(key, defaultValue(key)); + } + else if (arg === '--') { + notFlags = args.slice(i + 1); + break; + } + else if (configuration['halt-at-non-option']) { + notFlags = args.slice(i); + break; + } + else { + pushPositional(arg); + } + } + applyEnvVars(argv, true); + applyEnvVars(argv, false); + setConfig(argv); + setConfigObjects(); + applyDefaultsAndAliases(argv, flags.aliases, defaults, true); + applyCoercions(argv); + if (configuration['set-placeholder-key']) + setPlaceholderKeys(argv); + Object.keys(flags.counts).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) + setArg(key, 0); + }); + if (notFlagsOption && notFlags.length) + argv[notFlagsArgv] = []; + notFlags.forEach(function (key) { + argv[notFlagsArgv].push(key); + }); + if (configuration['camel-case-expansion'] && configuration['strip-dashed']) { + Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => { + delete argv[key]; + }); + } + if (configuration['strip-aliased']) { + [].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => { + if (configuration['camel-case-expansion'] && alias.includes('-')) { + delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')]; + } + delete argv[alias]; + }); + } + function pushPositional(arg) { + const maybeCoercedNumber = maybeCoerceNumber('_', arg); + if (typeof maybeCoercedNumber === 'string' || typeof maybeCoercedNumber === 'number') { + argv._.push(maybeCoercedNumber); + } + } + function eatNargs(i, key, args, argAfterEqualSign) { + let ii; + let toEat = checkAllAliases(key, flags.nargs); + toEat = typeof toEat !== 'number' || isNaN(toEat) ? 1 : toEat; + if (toEat === 0) { + if (!isUndefined(argAfterEqualSign)) { + error = Error(__('Argument unexpected for: %s', key)); + } + setArg(key, defaultValue(key)); + return i; + } + let available = isUndefined(argAfterEqualSign) ? 0 : 1; + if (configuration['nargs-eats-options']) { + if (args.length - (i + 1) + available < toEat) { + error = Error(__('Not enough arguments following: %s', key)); + } + available = toEat; + } + else { + for (ii = i + 1; ii < args.length; ii++) { + if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii])) + available++; + else + break; + } + if (available < toEat) + error = Error(__('Not enough arguments following: %s', key)); + } + let consumed = Math.min(available, toEat); + if (!isUndefined(argAfterEqualSign) && consumed > 0) { + setArg(key, argAfterEqualSign); + consumed--; + } + for (ii = i + 1; ii < (consumed + i + 1); ii++) { + setArg(key, args[ii]); + } + return (i + consumed); + } + function eatArray(i, key, args, argAfterEqualSign) { + let argsToSet = []; + let next = argAfterEqualSign || args[i + 1]; + const nargsCount = checkAllAliases(key, flags.nargs); + if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) { + argsToSet.push(true); + } + else if (isUndefined(next) || + (isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) { + if (defaults[key] !== undefined) { + const defVal = defaults[key]; + argsToSet = Array.isArray(defVal) ? defVal : [defVal]; + } + } + else { + if (!isUndefined(argAfterEqualSign)) { + argsToSet.push(processValue(key, argAfterEqualSign)); + } + for (let ii = i + 1; ii < args.length; ii++) { + if ((!configuration['greedy-arrays'] && argsToSet.length > 0) || + (nargsCount && typeof nargsCount === 'number' && argsToSet.length >= nargsCount)) + break; + next = args[ii]; + if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) + break; + i = ii; + argsToSet.push(processValue(key, next)); + } + } + if (typeof nargsCount === 'number' && ((nargsCount && argsToSet.length < nargsCount) || + (isNaN(nargsCount) && argsToSet.length === 0))) { + error = Error(__('Not enough arguments following: %s', key)); + } + setArg(key, argsToSet); + return i; + } + function setArg(key, val) { + if (/-/.test(key) && configuration['camel-case-expansion']) { + const alias = key.split('.').map(function (prop) { + return camelCase(prop); + }).join('.'); + addNewAlias(key, alias); + } + const value = processValue(key, val); + const splitKey = key.split('.'); + setKey(argv, splitKey, value); + if (flags.aliases[key]) { + flags.aliases[key].forEach(function (x) { + const keyProperties = x.split('.'); + setKey(argv, keyProperties, value); + }); + } + if (splitKey.length > 1 && configuration['dot-notation']) { + (flags.aliases[splitKey[0]] || []).forEach(function (x) { + let keyProperties = x.split('.'); + const a = [].concat(splitKey); + a.shift(); + keyProperties = keyProperties.concat(a); + if (!(flags.aliases[key] || []).includes(keyProperties.join('.'))) { + setKey(argv, keyProperties, value); + } + }); + } + if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { + const keys = [key].concat(flags.aliases[key] || []); + keys.forEach(function (key) { + Object.defineProperty(argvReturn, key, { + enumerable: true, + get() { + return val; + }, + set(value) { + val = typeof value === 'string' ? mixin.normalize(value) : value; + } + }); + }); + } + } + function addNewAlias(key, alias) { + if (!(flags.aliases[key] && flags.aliases[key].length)) { + flags.aliases[key] = [alias]; + newAliases[alias] = true; + } + if (!(flags.aliases[alias] && flags.aliases[alias].length)) { + addNewAlias(alias, key); + } + } + function processValue(key, val) { + if (typeof val === 'string' && + (val[0] === "'" || val[0] === '"') && + val[val.length - 1] === val[0]) { + val = val.substring(1, val.length - 1); + } + if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { + if (typeof val === 'string') + val = val === 'true'; + } + let value = Array.isArray(val) + ? val.map(function (v) { return maybeCoerceNumber(key, v); }) + : maybeCoerceNumber(key, val); + if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { + value = increment(); + } + if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { + if (Array.isArray(val)) + value = val.map((val) => { return mixin.normalize(val); }); + else + value = mixin.normalize(val); + } + return value; + } + function maybeCoerceNumber(key, value) { + if (!configuration['parse-positional-numbers'] && key === '_') + return value; + if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { + const shouldCoerceNumber = looksLikeNumber(value) && configuration['parse-numbers'] && (Number.isSafeInteger(Math.floor(parseFloat(`${value}`)))); + if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) { + value = Number(value); + } + } + return value; + } + function setConfig(argv) { + const configLookup = Object.create(null); + applyDefaultsAndAliases(configLookup, flags.aliases, defaults); + Object.keys(flags.configs).forEach(function (configKey) { + const configPath = argv[configKey] || configLookup[configKey]; + if (configPath) { + try { + let config = null; + const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath); + const resolveConfig = flags.configs[configKey]; + if (typeof resolveConfig === 'function') { + try { + config = resolveConfig(resolvedConfigPath); + } + catch (e) { + config = e; + } + if (config instanceof Error) { + error = config; + return; + } + } + else { + config = mixin.require(resolvedConfigPath); + } + setConfigObject(config); + } + catch (ex) { + if (ex.name === 'PermissionDenied') + error = ex; + else if (argv[configKey]) + error = Error(__('Invalid JSON config file: %s', configPath)); + } + } + }); + } + function setConfigObject(config, prev) { + Object.keys(config).forEach(function (key) { + const value = config[key]; + const fullKey = prev ? prev + '.' + key : key; + if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) { + setConfigObject(value, fullKey); + } + else { + if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) { + setArg(fullKey, value); + } + } + }); + } + function setConfigObjects() { + if (typeof configObjects !== 'undefined') { + configObjects.forEach(function (configObject) { + setConfigObject(configObject); + }); + } + } + function applyEnvVars(argv, configOnly) { + if (typeof envPrefix === 'undefined') + return; + const prefix = typeof envPrefix === 'string' ? envPrefix : ''; + const env = mixin.env(); + Object.keys(env).forEach(function (envVar) { + if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) { + const keys = envVar.split('__').map(function (key, i) { + if (i === 0) { + key = key.substring(prefix.length); + } + return camelCase(key); + }); + if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) { + setArg(keys.join('.'), env[envVar]); + } + } + }); + } + function applyCoercions(argv) { + let coerce; + const applied = new Set(); + Object.keys(argv).forEach(function (key) { + if (!applied.has(key)) { + coerce = checkAllAliases(key, flags.coercions); + if (typeof coerce === 'function') { + try { + const value = maybeCoerceNumber(key, coerce(argv[key])); + ([].concat(flags.aliases[key] || [], key)).forEach(ali => { + applied.add(ali); + argv[ali] = value; + }); + } + catch (err) { + error = err; + } + } + } + }); + } + function setPlaceholderKeys(argv) { + flags.keys.forEach((key) => { + if (~key.indexOf('.')) + return; + if (typeof argv[key] === 'undefined') + argv[key] = undefined; + }); + return argv; + } + function applyDefaultsAndAliases(obj, aliases, defaults, canLog = false) { + Object.keys(defaults).forEach(function (key) { + if (!hasKey(obj, key.split('.'))) { + setKey(obj, key.split('.'), defaults[key]); + if (canLog) + defaulted[key] = true; + (aliases[key] || []).forEach(function (x) { + if (hasKey(obj, x.split('.'))) + return; + setKey(obj, x.split('.'), defaults[key]); + }); + } + }); + } + function hasKey(obj, keys) { + let o = obj; + if (!configuration['dot-notation']) + keys = [keys.join('.')]; + keys.slice(0, -1).forEach(function (key) { + o = (o[key] || {}); + }); + const key = keys[keys.length - 1]; + if (typeof o !== 'object') + return false; + else + return key in o; + } + function setKey(obj, keys, value) { + let o = obj; + if (!configuration['dot-notation']) + keys = [keys.join('.')]; + keys.slice(0, -1).forEach(function (key) { + key = sanitizeKey(key); + if (typeof o === 'object' && o[key] === undefined) { + o[key] = {}; + } + if (typeof o[key] !== 'object' || Array.isArray(o[key])) { + if (Array.isArray(o[key])) { + o[key].push({}); + } + else { + o[key] = [o[key], {}]; + } + o = o[key][o[key].length - 1]; + } + else { + o = o[key]; + } + }); + const key = sanitizeKey(keys[keys.length - 1]); + const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays); + const isValueArray = Array.isArray(value); + let duplicate = configuration['duplicate-arguments-array']; + if (!duplicate && checkAllAliases(key, flags.nargs)) { + duplicate = true; + if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) { + o[key] = undefined; + } + } + if (value === increment()) { + o[key] = increment(o[key]); + } + else if (Array.isArray(o[key])) { + if (duplicate && isTypeArray && isValueArray) { + o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]); + } + else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { + o[key] = value; + } + else { + o[key] = o[key].concat([value]); + } + } + else if (o[key] === undefined && isTypeArray) { + o[key] = isValueArray ? value : [value]; + } + else if (duplicate && !(o[key] === undefined || + checkAllAliases(key, flags.counts) || + checkAllAliases(key, flags.bools))) { + o[key] = [o[key], value]; + } + else { + o[key] = value; + } + } + function extendAliases(...args) { + args.forEach(function (obj) { + Object.keys(obj || {}).forEach(function (key) { + if (flags.aliases[key]) + return; + flags.aliases[key] = [].concat(aliases[key] || []); + flags.aliases[key].concat(key).forEach(function (x) { + if (/-/.test(x) && configuration['camel-case-expansion']) { + const c = camelCase(x); + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + flags.aliases[key].concat(key).forEach(function (x) { + if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) { + const c = decamelize(x, '-'); + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + flags.aliases[key].forEach(function (x) { + flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + }); + } + function checkAllAliases(key, flag) { + const toCheck = [].concat(flags.aliases[key] || [], key); + const keys = Object.keys(flag); + const setAlias = toCheck.find(key => keys.includes(key)); + return setAlias ? flag[setAlias] : false; + } + function hasAnyFlag(key) { + const flagsKeys = Object.keys(flags); + const toCheck = [].concat(flagsKeys.map(k => flags[k])); + return toCheck.some(function (flag) { + return Array.isArray(flag) ? flag.includes(key) : flag[key]; + }); + } + function hasFlagsMatching(arg, ...patterns) { + const toCheck = [].concat(...patterns); + return toCheck.some(function (pattern) { + const match = arg.match(pattern); + return match && hasAnyFlag(match[1]); + }); + } + function hasAllShortFlags(arg) { + if (arg.match(negative) || !arg.match(/^-[^-]+/)) { + return false; + } + let hasAllFlags = true; + let next; + const letters = arg.slice(1).split(''); + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (!hasAnyFlag(letters[j])) { + hasAllFlags = false; + break; + } + if ((letters[j + 1] && letters[j + 1] === '=') || + next === '-' || + (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || + (letters[j + 1] && letters[j + 1].match(/\W/))) { + break; + } + } + return hasAllFlags; + } + function isUnknownOptionAsArg(arg) { + return configuration['unknown-options-as-args'] && isUnknownOption(arg); + } + function isUnknownOption(arg) { + arg = arg.replace(/^-{3,}/, '--'); + if (arg.match(negative)) { + return false; + } + if (hasAllShortFlags(arg)) { + return false; + } + const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; + const normalFlag = /^-+([^=]+?)$/; + const flagEndingInHyphen = /^-+([^=]+?)-$/; + const flagEndingInDigits = /^-+([^=]+?\d+)$/; + const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; + return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters); + } + function defaultValue(key) { + if (!checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts) && + `${key}` in defaults) { + return defaults[key]; + } + else { + return defaultForType(guessType(key)); + } + } + function defaultForType(type) { + const def = { + [DefaultValuesForTypeKey.BOOLEAN]: true, + [DefaultValuesForTypeKey.STRING]: '', + [DefaultValuesForTypeKey.NUMBER]: undefined, + [DefaultValuesForTypeKey.ARRAY]: [] + }; + return def[type]; + } + function guessType(key) { + let type = DefaultValuesForTypeKey.BOOLEAN; + if (checkAllAliases(key, flags.strings)) + type = DefaultValuesForTypeKey.STRING; + else if (checkAllAliases(key, flags.numbers)) + type = DefaultValuesForTypeKey.NUMBER; + else if (checkAllAliases(key, flags.bools)) + type = DefaultValuesForTypeKey.BOOLEAN; + else if (checkAllAliases(key, flags.arrays)) + type = DefaultValuesForTypeKey.ARRAY; + return type; + } + function isUndefined(num) { + return num === undefined; + } + function checkConfiguration() { + Object.keys(flags.counts).find(key => { + if (checkAllAliases(key, flags.arrays)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key)); + return true; + } + else if (checkAllAliases(key, flags.nargs)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key)); + return true; + } + return false; + }); + } + return { + aliases: Object.assign({}, flags.aliases), + argv: Object.assign(argvReturn, argv), + configuration: configuration, + defaulted: Object.assign({}, defaulted), + error: error, + newAliases: Object.assign({}, newAliases) + }; + } +} +function combineAliases(aliases) { + const aliasArrays = []; + const combined = Object.create(null); + let change = true; + Object.keys(aliases).forEach(function (key) { + aliasArrays.push([].concat(aliases[key], key)); + }); + while (change) { + change = false; + for (let i = 0; i < aliasArrays.length; i++) { + for (let ii = i + 1; ii < aliasArrays.length; ii++) { + const intersect = aliasArrays[i].filter(function (v) { + return aliasArrays[ii].indexOf(v) !== -1; + }); + if (intersect.length) { + aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]); + aliasArrays.splice(ii, 1); + change = true; + break; + } + } + } + } + aliasArrays.forEach(function (aliasArray) { + aliasArray = aliasArray.filter(function (v, i, self) { + return self.indexOf(v) === i; + }); + const lastAlias = aliasArray.pop(); + if (lastAlias !== undefined && typeof lastAlias === 'string') { + combined[lastAlias] = aliasArray; + } + }); + return combined; +} +function increment(orig) { + return orig !== undefined ? orig + 1 : 1; +} +function sanitizeKey(key) { + if (key === '__proto__') + return '___proto___'; + return key; +} + +const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION) + ? Number(process.env.YARGS_MIN_NODE_VERSION) + : 10; +if (process && process.version) { + const major = Number(process.version.match(/v([^.]+)/)[1]); + if (major < minNodeVersion) { + throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); + } +} +const env = process ? process.env : {}; +const parser = new YargsParser({ + cwd: process.cwd, + env: () => { + return env; + }, + format: util.format, + normalize: path.normalize, + resolve: path.resolve, + require: (path) => { + if (typeof require !== 'undefined') { + return require(path); + } + else if (path.match(/\.json$/)) { + return fs.readFileSync(path, 'utf8'); + } + else { + throw Error('only .json config files are supported in ESM'); + } + } +}); +const yargsParser = function Parser(args, opts) { + const result = parser.parse(args.slice(), opts); + return result.argv; +}; +yargsParser.detailed = function (args, opts) { + return parser.parse(args.slice(), opts); +}; +yargsParser.camelCase = camelCase; +yargsParser.decamelize = decamelize; +yargsParser.looksLikeNumber = looksLikeNumber; + +module.exports = yargsParser; diff --git a/node_modules/yargs-parser/build/lib/index.js b/node_modules/yargs-parser/build/lib/index.js new file mode 100644 index 000000000..cc5078890 --- /dev/null +++ b/node_modules/yargs-parser/build/lib/index.js @@ -0,0 +1,59 @@ +/** + * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js + * CJS and ESM environments. + * + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +import { format } from 'util'; +import { readFileSync } from 'fs'; +import { normalize, resolve } from 'path'; +import { camelCase, decamelize, looksLikeNumber } from './string-utils.js'; +import { YargsParser } from './yargs-parser.js'; +// See https://github.com/yargs/yargs-parser#supported-nodejs-versions for our +// version support policy. The YARGS_MIN_NODE_VERSION is used for testing only. +const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION) + ? Number(process.env.YARGS_MIN_NODE_VERSION) + : 10; +if (process && process.version) { + const major = Number(process.version.match(/v([^.]+)/)[1]); + if (major < minNodeVersion) { + throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); + } +} +// Creates a yargs-parser instance using Node.js standard libraries: +const env = process ? process.env : {}; +const parser = new YargsParser({ + cwd: process.cwd, + env: () => { + return env; + }, + format, + normalize, + resolve, + // TODO: figure out a way to combine ESM and CJS coverage, such that + // we can exercise all the lines below: + require: (path) => { + if (typeof require !== 'undefined') { + return require(path); + } + else if (path.match(/\.json$/)) { + return readFileSync(path, 'utf8'); + } + else { + throw Error('only .json config files are supported in ESM'); + } + } +}); +const yargsParser = function Parser(args, opts) { + const result = parser.parse(args.slice(), opts); + return result.argv; +}; +yargsParser.detailed = function (args, opts) { + return parser.parse(args.slice(), opts); +}; +yargsParser.camelCase = camelCase; +yargsParser.decamelize = decamelize; +yargsParser.looksLikeNumber = looksLikeNumber; +export default yargsParser; diff --git a/node_modules/yargs-parser/build/lib/string-utils.js b/node_modules/yargs-parser/build/lib/string-utils.js new file mode 100644 index 000000000..4e8bd996e --- /dev/null +++ b/node_modules/yargs-parser/build/lib/string-utils.js @@ -0,0 +1,65 @@ +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +export function camelCase(str) { + // Handle the case where an argument is provided as camel case, e.g., fooBar. + // by ensuring that the string isn't already mixed case: + const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase(); + if (!isCamelCase) { + str = str.toLowerCase(); + } + if (str.indexOf('-') === -1 && str.indexOf('_') === -1) { + return str; + } + else { + let camelcase = ''; + let nextChrUpper = false; + const leadingHyphens = str.match(/^-+/); + for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) { + let chr = str.charAt(i); + if (nextChrUpper) { + nextChrUpper = false; + chr = chr.toUpperCase(); + } + if (i !== 0 && (chr === '-' || chr === '_')) { + nextChrUpper = true; + } + else if (chr !== '-' && chr !== '_') { + camelcase += chr; + } + } + return camelcase; + } +} +export function decamelize(str, joinString) { + const lowercase = str.toLowerCase(); + joinString = joinString || '-'; + let notCamelcase = ''; + for (let i = 0; i < str.length; i++) { + const chrLower = lowercase.charAt(i); + const chrString = str.charAt(i); + if (chrLower !== chrString && i > 0) { + notCamelcase += `${joinString}${lowercase.charAt(i)}`; + } + else { + notCamelcase += chrString; + } + } + return notCamelcase; +} +export function looksLikeNumber(x) { + if (x === null || x === undefined) + return false; + // if loaded from config, may already be a number. + if (typeof x === 'number') + return true; + // hexadecimal. + if (/^0x[0-9a-f]+$/i.test(x)) + return true; + // don't treat 0123 as a number; as it drops the leading '0'. + if (/^0[^.]/.test(x)) + return false; + return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} diff --git a/node_modules/yargs-parser/build/lib/tokenize-arg-string.js b/node_modules/yargs-parser/build/lib/tokenize-arg-string.js new file mode 100644 index 000000000..5e732efe0 --- /dev/null +++ b/node_modules/yargs-parser/build/lib/tokenize-arg-string.js @@ -0,0 +1,40 @@ +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +// take an un-split argv string and tokenize it. +export function tokenizeArgString(argString) { + if (Array.isArray(argString)) { + return argString.map(e => typeof e !== 'string' ? e + '' : e); + } + argString = argString.trim(); + let i = 0; + let prevC = null; + let c = null; + let opening = null; + const args = []; + for (let ii = 0; ii < argString.length; ii++) { + prevC = c; + c = argString.charAt(ii); + // split on spaces unless we're in quotes. + if (c === ' ' && !opening) { + if (!(prevC === ' ')) { + i++; + } + continue; + } + // don't split the string if we're in matching + // opening or closing single and double quotes. + if (c === opening) { + opening = null; + } + else if ((c === "'" || c === '"') && !opening) { + opening = c; + } + if (!args[i]) + args[i] = ''; + args[i] += c; + } + return args; +} diff --git a/node_modules/yargs-parser/build/lib/yargs-parser-types.js b/node_modules/yargs-parser/build/lib/yargs-parser-types.js new file mode 100644 index 000000000..63b7c313a --- /dev/null +++ b/node_modules/yargs-parser/build/lib/yargs-parser-types.js @@ -0,0 +1,12 @@ +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +export var DefaultValuesForTypeKey; +(function (DefaultValuesForTypeKey) { + DefaultValuesForTypeKey["BOOLEAN"] = "boolean"; + DefaultValuesForTypeKey["STRING"] = "string"; + DefaultValuesForTypeKey["NUMBER"] = "number"; + DefaultValuesForTypeKey["ARRAY"] = "array"; +})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); diff --git a/node_modules/yargs-parser/build/lib/yargs-parser.js b/node_modules/yargs-parser/build/lib/yargs-parser.js new file mode 100644 index 000000000..828a440dd --- /dev/null +++ b/node_modules/yargs-parser/build/lib/yargs-parser.js @@ -0,0 +1,1037 @@ +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +import { tokenizeArgString } from './tokenize-arg-string.js'; +import { DefaultValuesForTypeKey } from './yargs-parser-types.js'; +import { camelCase, decamelize, looksLikeNumber } from './string-utils.js'; +let mixin; +export class YargsParser { + constructor(_mixin) { + mixin = _mixin; + } + parse(argsInput, options) { + const opts = Object.assign({ + alias: undefined, + array: undefined, + boolean: undefined, + config: undefined, + configObjects: undefined, + configuration: undefined, + coerce: undefined, + count: undefined, + default: undefined, + envPrefix: undefined, + narg: undefined, + normalize: undefined, + string: undefined, + number: undefined, + __: undefined, + key: undefined + }, options); + // allow a string argument to be passed in rather + // than an argv array. + const args = tokenizeArgString(argsInput); + // aliases might have transitive relationships, normalize this. + const aliases = combineAliases(Object.assign(Object.create(null), opts.alias)); + const configuration = Object.assign({ + 'boolean-negation': true, + 'camel-case-expansion': true, + 'combine-arrays': false, + 'dot-notation': true, + 'duplicate-arguments-array': true, + 'flatten-duplicate-arrays': true, + 'greedy-arrays': true, + 'halt-at-non-option': false, + 'nargs-eats-options': false, + 'negation-prefix': 'no-', + 'parse-numbers': true, + 'parse-positional-numbers': true, + 'populate--': false, + 'set-placeholder-key': false, + 'short-option-groups': true, + 'strip-aliased': false, + 'strip-dashed': false, + 'unknown-options-as-args': false + }, opts.configuration); + const defaults = Object.assign(Object.create(null), opts.default); + const configObjects = opts.configObjects || []; + const envPrefix = opts.envPrefix; + const notFlagsOption = configuration['populate--']; + const notFlagsArgv = notFlagsOption ? '--' : '_'; + const newAliases = Object.create(null); + const defaulted = Object.create(null); + // allow a i18n handler to be passed in, default to a fake one (util.format). + const __ = opts.__ || mixin.format; + const flags = { + aliases: Object.create(null), + arrays: Object.create(null), + bools: Object.create(null), + strings: Object.create(null), + numbers: Object.create(null), + counts: Object.create(null), + normalize: Object.create(null), + configs: Object.create(null), + nargs: Object.create(null), + coercions: Object.create(null), + keys: [] + }; + const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; + const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)'); + [].concat(opts.array || []).filter(Boolean).forEach(function (opt) { + const key = typeof opt === 'object' ? opt.key : opt; + // assign to flags[bools|strings|numbers] + const assignment = Object.keys(opt).map(function (key) { + const arrayFlagKeys = { + boolean: 'bools', + string: 'strings', + number: 'numbers' + }; + return arrayFlagKeys[key]; + }).filter(Boolean).pop(); + // assign key to be coerced + if (assignment) { + flags[assignment][key] = true; + } + flags.arrays[key] = true; + flags.keys.push(key); + }); + [].concat(opts.boolean || []).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + flags.keys.push(key); + }); + [].concat(opts.string || []).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + flags.keys.push(key); + }); + [].concat(opts.number || []).filter(Boolean).forEach(function (key) { + flags.numbers[key] = true; + flags.keys.push(key); + }); + [].concat(opts.count || []).filter(Boolean).forEach(function (key) { + flags.counts[key] = true; + flags.keys.push(key); + }); + [].concat(opts.normalize || []).filter(Boolean).forEach(function (key) { + flags.normalize[key] = true; + flags.keys.push(key); + }); + if (typeof opts.narg === 'object') { + Object.entries(opts.narg).forEach(([key, value]) => { + if (typeof value === 'number') { + flags.nargs[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.coerce === 'object') { + Object.entries(opts.coerce).forEach(([key, value]) => { + if (typeof value === 'function') { + flags.coercions[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.config !== 'undefined') { + if (Array.isArray(opts.config) || typeof opts.config === 'string') { + ; + [].concat(opts.config).filter(Boolean).forEach(function (key) { + flags.configs[key] = true; + }); + } + else if (typeof opts.config === 'object') { + Object.entries(opts.config).forEach(([key, value]) => { + if (typeof value === 'boolean' || typeof value === 'function') { + flags.configs[key] = value; + } + }); + } + } + // create a lookup table that takes into account all + // combinations of aliases: {f: ['foo'], foo: ['f']} + extendAliases(opts.key, aliases, opts.default, flags.arrays); + // apply default values to all aliases. + Object.keys(defaults).forEach(function (key) { + (flags.aliases[key] || []).forEach(function (alias) { + defaults[alias] = defaults[key]; + }); + }); + let error = null; + checkConfiguration(); + let notFlags = []; + const argv = Object.assign(Object.create(null), { _: [] }); + // TODO(bcoe): for the first pass at removing object prototype we didn't + // remove all prototypes from objects returned by this API, we might want + // to gradually move towards doing so. + const argvReturn = {}; + for (let i = 0; i < args.length; i++) { + const arg = args[i]; + const truncatedArg = arg.replace(/^-{3,}/, '---'); + let broken; + let key; + let letters; + let m; + let next; + let value; + // any unknown option (except for end-of-options, "--") + if (arg !== '--' && isUnknownOptionAsArg(arg)) { + pushPositional(arg); + // ---, ---=, ----, etc, + } + else if (truncatedArg.match(/---+(=|$)/)) { + // options without key name are invalid. + pushPositional(arg); + continue; + // -- separated by = + } + else if (arg.match(/^--.+=/) || (!configuration['short-option-groups'] && arg.match(/^-.+=/))) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + m = arg.match(/^--?([^=]+)=([\s\S]*)$/); + // arrays format = '--f=a b c' + if (m !== null && Array.isArray(m) && m.length >= 3) { + if (checkAllAliases(m[1], flags.arrays)) { + i = eatArray(i, m[1], args, m[2]); + } + else if (checkAllAliases(m[1], flags.nargs) !== false) { + // nargs format = '--f=monkey washing cat' + i = eatNargs(i, m[1], args, m[2]); + } + else { + setArg(m[1], m[2]); + } + } + } + else if (arg.match(negatedBoolean) && configuration['boolean-negation']) { + m = arg.match(negatedBoolean); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false); + } + // -- separated by space. + } + else if (arg.match(/^--.+/) || (!configuration['short-option-groups'] && arg.match(/^-[^-]+/))) { + m = arg.match(/^--?(.+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (checkAllAliases(key, flags.arrays)) { + // array format = '--foo a b c' + i = eatArray(i, key, args); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '--foo a b c' + // should be truthy even if: flags.nargs[key] === 0 + i = eatNargs(i, key, args); + } + else { + next = args[i + 1]; + if (next !== undefined && (!next.match(/^-/) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + // dot-notation flag separated by '='. + } + else if (arg.match(/^-.\..+=/)) { + m = arg.match(/^-([^=]+)=([\s\S]*)$/); + if (m !== null && Array.isArray(m) && m.length >= 3) { + setArg(m[1], m[2]); + } + // dot-notation flag separated by space. + } + else if (arg.match(/^-.\..+/) && !arg.match(negative)) { + next = args[i + 1]; + m = arg.match(/^-(.\..+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (next !== undefined && !next.match(/^-/) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { + letters = arg.slice(1, -1).split(''); + broken = false; + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (letters[j + 1] && letters[j + 1] === '=') { + value = arg.slice(j + 3); + key = letters[j]; + if (checkAllAliases(key, flags.arrays)) { + // array format = '-f=a b c' + i = eatArray(i, key, args, value); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '-f=monkey washing cat' + i = eatNargs(i, key, args, value); + } + else { + setArg(key, value); + } + broken = true; + break; + } + if (next === '-') { + setArg(letters[j], next); + continue; + } + // current letter is an alphabetic character and next value is a number + if (/[A-Za-z]/.test(letters[j]) && + /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && + checkAllAliases(next, flags.bools) === false) { + setArg(letters[j], next); + broken = true; + break; + } + if (letters[j + 1] && letters[j + 1].match(/\W/)) { + setArg(letters[j], next); + broken = true; + break; + } + else { + setArg(letters[j], defaultValue(letters[j])); + } + } + key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (checkAllAliases(key, flags.arrays)) { + // array format = '-f a b c' + i = eatArray(i, key, args); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '-f a b c' + // should be truthy even if: flags.nargs[key] === 0 + i = eatNargs(i, key, args); + } + else { + next = args[i + 1]; + if (next !== undefined && (!/^(-|--)[^-]/.test(next) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + } + else if (arg.match(/^-[0-9]$/) && + arg.match(negative) && + checkAllAliases(arg.slice(1), flags.bools)) { + // single-digit boolean alias, e.g: xargs -0 + key = arg.slice(1); + setArg(key, defaultValue(key)); + } + else if (arg === '--') { + notFlags = args.slice(i + 1); + break; + } + else if (configuration['halt-at-non-option']) { + notFlags = args.slice(i); + break; + } + else { + pushPositional(arg); + } + } + // order of precedence: + // 1. command line arg + // 2. value from env var + // 3. value from config file + // 4. value from config objects + // 5. configured default value + applyEnvVars(argv, true); // special case: check env vars that point to config file + applyEnvVars(argv, false); + setConfig(argv); + setConfigObjects(); + applyDefaultsAndAliases(argv, flags.aliases, defaults, true); + applyCoercions(argv); + if (configuration['set-placeholder-key']) + setPlaceholderKeys(argv); + // for any counts either not in args or without an explicit default, set to 0 + Object.keys(flags.counts).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) + setArg(key, 0); + }); + // '--' defaults to undefined. + if (notFlagsOption && notFlags.length) + argv[notFlagsArgv] = []; + notFlags.forEach(function (key) { + argv[notFlagsArgv].push(key); + }); + if (configuration['camel-case-expansion'] && configuration['strip-dashed']) { + Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => { + delete argv[key]; + }); + } + if (configuration['strip-aliased']) { + ; + [].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => { + if (configuration['camel-case-expansion'] && alias.includes('-')) { + delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')]; + } + delete argv[alias]; + }); + } + // Push argument into positional array, applying numeric coercion: + function pushPositional(arg) { + const maybeCoercedNumber = maybeCoerceNumber('_', arg); + if (typeof maybeCoercedNumber === 'string' || typeof maybeCoercedNumber === 'number') { + argv._.push(maybeCoercedNumber); + } + } + // how many arguments should we consume, based + // on the nargs option? + function eatNargs(i, key, args, argAfterEqualSign) { + let ii; + let toEat = checkAllAliases(key, flags.nargs); + // NaN has a special meaning for the array type, indicating that one or + // more values are expected. + toEat = typeof toEat !== 'number' || isNaN(toEat) ? 1 : toEat; + if (toEat === 0) { + if (!isUndefined(argAfterEqualSign)) { + error = Error(__('Argument unexpected for: %s', key)); + } + setArg(key, defaultValue(key)); + return i; + } + let available = isUndefined(argAfterEqualSign) ? 0 : 1; + if (configuration['nargs-eats-options']) { + // classic behavior, yargs eats positional and dash arguments. + if (args.length - (i + 1) + available < toEat) { + error = Error(__('Not enough arguments following: %s', key)); + } + available = toEat; + } + else { + // nargs will not consume flag arguments, e.g., -abc, --foo, + // and terminates when one is observed. + for (ii = i + 1; ii < args.length; ii++) { + if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii])) + available++; + else + break; + } + if (available < toEat) + error = Error(__('Not enough arguments following: %s', key)); + } + let consumed = Math.min(available, toEat); + if (!isUndefined(argAfterEqualSign) && consumed > 0) { + setArg(key, argAfterEqualSign); + consumed--; + } + for (ii = i + 1; ii < (consumed + i + 1); ii++) { + setArg(key, args[ii]); + } + return (i + consumed); + } + // if an option is an array, eat all non-hyphenated arguments + // following it... YUM! + // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"] + function eatArray(i, key, args, argAfterEqualSign) { + let argsToSet = []; + let next = argAfterEqualSign || args[i + 1]; + // If both array and nargs are configured, enforce the nargs count: + const nargsCount = checkAllAliases(key, flags.nargs); + if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) { + argsToSet.push(true); + } + else if (isUndefined(next) || + (isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) { + // for keys without value ==> argsToSet remains an empty [] + // set user default value, if available + if (defaults[key] !== undefined) { + const defVal = defaults[key]; + argsToSet = Array.isArray(defVal) ? defVal : [defVal]; + } + } + else { + // value in --option=value is eaten as is + if (!isUndefined(argAfterEqualSign)) { + argsToSet.push(processValue(key, argAfterEqualSign)); + } + for (let ii = i + 1; ii < args.length; ii++) { + if ((!configuration['greedy-arrays'] && argsToSet.length > 0) || + (nargsCount && typeof nargsCount === 'number' && argsToSet.length >= nargsCount)) + break; + next = args[ii]; + if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) + break; + i = ii; + argsToSet.push(processValue(key, next)); + } + } + // If both array and nargs are configured, create an error if less than + // nargs positionals were found. NaN has special meaning, indicating + // that at least one value is required (more are okay). + if (typeof nargsCount === 'number' && ((nargsCount && argsToSet.length < nargsCount) || + (isNaN(nargsCount) && argsToSet.length === 0))) { + error = Error(__('Not enough arguments following: %s', key)); + } + setArg(key, argsToSet); + return i; + } + function setArg(key, val) { + if (/-/.test(key) && configuration['camel-case-expansion']) { + const alias = key.split('.').map(function (prop) { + return camelCase(prop); + }).join('.'); + addNewAlias(key, alias); + } + const value = processValue(key, val); + const splitKey = key.split('.'); + setKey(argv, splitKey, value); + // handle populating aliases of the full key + if (flags.aliases[key]) { + flags.aliases[key].forEach(function (x) { + const keyProperties = x.split('.'); + setKey(argv, keyProperties, value); + }); + } + // handle populating aliases of the first element of the dot-notation key + if (splitKey.length > 1 && configuration['dot-notation']) { + ; + (flags.aliases[splitKey[0]] || []).forEach(function (x) { + let keyProperties = x.split('.'); + // expand alias with nested objects in key + const a = [].concat(splitKey); + a.shift(); // nuke the old key. + keyProperties = keyProperties.concat(a); + // populate alias only if is not already an alias of the full key + // (already populated above) + if (!(flags.aliases[key] || []).includes(keyProperties.join('.'))) { + setKey(argv, keyProperties, value); + } + }); + } + // Set normalize getter and setter when key is in 'normalize' but isn't an array + if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { + const keys = [key].concat(flags.aliases[key] || []); + keys.forEach(function (key) { + Object.defineProperty(argvReturn, key, { + enumerable: true, + get() { + return val; + }, + set(value) { + val = typeof value === 'string' ? mixin.normalize(value) : value; + } + }); + }); + } + } + function addNewAlias(key, alias) { + if (!(flags.aliases[key] && flags.aliases[key].length)) { + flags.aliases[key] = [alias]; + newAliases[alias] = true; + } + if (!(flags.aliases[alias] && flags.aliases[alias].length)) { + addNewAlias(alias, key); + } + } + function processValue(key, val) { + // strings may be quoted, clean this up as we assign values. + if (typeof val === 'string' && + (val[0] === "'" || val[0] === '"') && + val[val.length - 1] === val[0]) { + val = val.substring(1, val.length - 1); + } + // handle parsing boolean arguments --foo=true --bar false. + if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { + if (typeof val === 'string') + val = val === 'true'; + } + let value = Array.isArray(val) + ? val.map(function (v) { return maybeCoerceNumber(key, v); }) + : maybeCoerceNumber(key, val); + // increment a count given as arg (either no value or value parsed as boolean) + if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { + value = increment(); + } + // Set normalized value when key is in 'normalize' and in 'arrays' + if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { + if (Array.isArray(val)) + value = val.map((val) => { return mixin.normalize(val); }); + else + value = mixin.normalize(val); + } + return value; + } + function maybeCoerceNumber(key, value) { + if (!configuration['parse-positional-numbers'] && key === '_') + return value; + if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { + const shouldCoerceNumber = looksLikeNumber(value) && configuration['parse-numbers'] && (Number.isSafeInteger(Math.floor(parseFloat(`${value}`)))); + if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) { + value = Number(value); + } + } + return value; + } + // set args from config.json file, this should be + // applied last so that defaults can be applied. + function setConfig(argv) { + const configLookup = Object.create(null); + // expand defaults/aliases, in-case any happen to reference + // the config.json file. + applyDefaultsAndAliases(configLookup, flags.aliases, defaults); + Object.keys(flags.configs).forEach(function (configKey) { + const configPath = argv[configKey] || configLookup[configKey]; + if (configPath) { + try { + let config = null; + const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath); + const resolveConfig = flags.configs[configKey]; + if (typeof resolveConfig === 'function') { + try { + config = resolveConfig(resolvedConfigPath); + } + catch (e) { + config = e; + } + if (config instanceof Error) { + error = config; + return; + } + } + else { + config = mixin.require(resolvedConfigPath); + } + setConfigObject(config); + } + catch (ex) { + // Deno will receive a PermissionDenied error if an attempt is + // made to load config without the --allow-read flag: + if (ex.name === 'PermissionDenied') + error = ex; + else if (argv[configKey]) + error = Error(__('Invalid JSON config file: %s', configPath)); + } + } + }); + } + // set args from config object. + // it recursively checks nested objects. + function setConfigObject(config, prev) { + Object.keys(config).forEach(function (key) { + const value = config[key]; + const fullKey = prev ? prev + '.' + key : key; + // if the value is an inner object and we have dot-notation + // enabled, treat inner objects in config the same as + // heavily nested dot notations (foo.bar.apple). + if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) { + // if the value is an object but not an array, check nested object + setConfigObject(value, fullKey); + } + else { + // setting arguments via CLI takes precedence over + // values within the config file. + if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) { + setArg(fullKey, value); + } + } + }); + } + // set all config objects passed in opts + function setConfigObjects() { + if (typeof configObjects !== 'undefined') { + configObjects.forEach(function (configObject) { + setConfigObject(configObject); + }); + } + } + function applyEnvVars(argv, configOnly) { + if (typeof envPrefix === 'undefined') + return; + const prefix = typeof envPrefix === 'string' ? envPrefix : ''; + const env = mixin.env(); + Object.keys(env).forEach(function (envVar) { + if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) { + // get array of nested keys and convert them to camel case + const keys = envVar.split('__').map(function (key, i) { + if (i === 0) { + key = key.substring(prefix.length); + } + return camelCase(key); + }); + if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) { + setArg(keys.join('.'), env[envVar]); + } + } + }); + } + function applyCoercions(argv) { + let coerce; + const applied = new Set(); + Object.keys(argv).forEach(function (key) { + if (!applied.has(key)) { // If we haven't already coerced this option via one of its aliases + coerce = checkAllAliases(key, flags.coercions); + if (typeof coerce === 'function') { + try { + const value = maybeCoerceNumber(key, coerce(argv[key])); + ([].concat(flags.aliases[key] || [], key)).forEach(ali => { + applied.add(ali); + argv[ali] = value; + }); + } + catch (err) { + error = err; + } + } + } + }); + } + function setPlaceholderKeys(argv) { + flags.keys.forEach((key) => { + // don't set placeholder keys for dot notation options 'foo.bar'. + if (~key.indexOf('.')) + return; + if (typeof argv[key] === 'undefined') + argv[key] = undefined; + }); + return argv; + } + function applyDefaultsAndAliases(obj, aliases, defaults, canLog = false) { + Object.keys(defaults).forEach(function (key) { + if (!hasKey(obj, key.split('.'))) { + setKey(obj, key.split('.'), defaults[key]); + if (canLog) + defaulted[key] = true; + (aliases[key] || []).forEach(function (x) { + if (hasKey(obj, x.split('.'))) + return; + setKey(obj, x.split('.'), defaults[key]); + }); + } + }); + } + function hasKey(obj, keys) { + let o = obj; + if (!configuration['dot-notation']) + keys = [keys.join('.')]; + keys.slice(0, -1).forEach(function (key) { + o = (o[key] || {}); + }); + const key = keys[keys.length - 1]; + if (typeof o !== 'object') + return false; + else + return key in o; + } + function setKey(obj, keys, value) { + let o = obj; + if (!configuration['dot-notation']) + keys = [keys.join('.')]; + keys.slice(0, -1).forEach(function (key) { + // TODO(bcoe): in the next major version of yargs, switch to + // Object.create(null) for dot notation: + key = sanitizeKey(key); + if (typeof o === 'object' && o[key] === undefined) { + o[key] = {}; + } + if (typeof o[key] !== 'object' || Array.isArray(o[key])) { + // ensure that o[key] is an array, and that the last item is an empty object. + if (Array.isArray(o[key])) { + o[key].push({}); + } + else { + o[key] = [o[key], {}]; + } + // we want to update the empty object at the end of the o[key] array, so set o to that object + o = o[key][o[key].length - 1]; + } + else { + o = o[key]; + } + }); + // TODO(bcoe): in the next major version of yargs, switch to + // Object.create(null) for dot notation: + const key = sanitizeKey(keys[keys.length - 1]); + const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays); + const isValueArray = Array.isArray(value); + let duplicate = configuration['duplicate-arguments-array']; + // nargs has higher priority than duplicate + if (!duplicate && checkAllAliases(key, flags.nargs)) { + duplicate = true; + if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) { + o[key] = undefined; + } + } + if (value === increment()) { + o[key] = increment(o[key]); + } + else if (Array.isArray(o[key])) { + if (duplicate && isTypeArray && isValueArray) { + o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]); + } + else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { + o[key] = value; + } + else { + o[key] = o[key].concat([value]); + } + } + else if (o[key] === undefined && isTypeArray) { + o[key] = isValueArray ? value : [value]; + } + else if (duplicate && !(o[key] === undefined || + checkAllAliases(key, flags.counts) || + checkAllAliases(key, flags.bools))) { + o[key] = [o[key], value]; + } + else { + o[key] = value; + } + } + // extend the aliases list with inferred aliases. + function extendAliases(...args) { + args.forEach(function (obj) { + Object.keys(obj || {}).forEach(function (key) { + // short-circuit if we've already added a key + // to the aliases array, for example it might + // exist in both 'opts.default' and 'opts.key'. + if (flags.aliases[key]) + return; + flags.aliases[key] = [].concat(aliases[key] || []); + // For "--option-name", also set argv.optionName + flags.aliases[key].concat(key).forEach(function (x) { + if (/-/.test(x) && configuration['camel-case-expansion']) { + const c = camelCase(x); + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + // For "--optionName", also set argv['option-name'] + flags.aliases[key].concat(key).forEach(function (x) { + if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) { + const c = decamelize(x, '-'); + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + flags.aliases[key].forEach(function (x) { + flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + }); + } + function checkAllAliases(key, flag) { + const toCheck = [].concat(flags.aliases[key] || [], key); + const keys = Object.keys(flag); + const setAlias = toCheck.find(key => keys.includes(key)); + return setAlias ? flag[setAlias] : false; + } + function hasAnyFlag(key) { + const flagsKeys = Object.keys(flags); + const toCheck = [].concat(flagsKeys.map(k => flags[k])); + return toCheck.some(function (flag) { + return Array.isArray(flag) ? flag.includes(key) : flag[key]; + }); + } + function hasFlagsMatching(arg, ...patterns) { + const toCheck = [].concat(...patterns); + return toCheck.some(function (pattern) { + const match = arg.match(pattern); + return match && hasAnyFlag(match[1]); + }); + } + // based on a simplified version of the short flag group parsing logic + function hasAllShortFlags(arg) { + // if this is a negative number, or doesn't start with a single hyphen, it's not a short flag group + if (arg.match(negative) || !arg.match(/^-[^-]+/)) { + return false; + } + let hasAllFlags = true; + let next; + const letters = arg.slice(1).split(''); + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (!hasAnyFlag(letters[j])) { + hasAllFlags = false; + break; + } + if ((letters[j + 1] && letters[j + 1] === '=') || + next === '-' || + (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || + (letters[j + 1] && letters[j + 1].match(/\W/))) { + break; + } + } + return hasAllFlags; + } + function isUnknownOptionAsArg(arg) { + return configuration['unknown-options-as-args'] && isUnknownOption(arg); + } + function isUnknownOption(arg) { + arg = arg.replace(/^-{3,}/, '--'); + // ignore negative numbers + if (arg.match(negative)) { + return false; + } + // if this is a short option group and all of them are configured, it isn't unknown + if (hasAllShortFlags(arg)) { + return false; + } + // e.g. '--count=2' + const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; + // e.g. '-a' or '--arg' + const normalFlag = /^-+([^=]+?)$/; + // e.g. '-a-' + const flagEndingInHyphen = /^-+([^=]+?)-$/; + // e.g. '-abc123' + const flagEndingInDigits = /^-+([^=]+?\d+)$/; + // e.g. '-a/usr/local' + const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; + // check the different types of flag styles, including negatedBoolean, a pattern defined near the start of the parse method + return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters); + } + // make a best effort to pick a default value + // for an option based on name and type. + function defaultValue(key) { + if (!checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts) && + `${key}` in defaults) { + return defaults[key]; + } + else { + return defaultForType(guessType(key)); + } + } + // return a default value, given the type of a flag., + function defaultForType(type) { + const def = { + [DefaultValuesForTypeKey.BOOLEAN]: true, + [DefaultValuesForTypeKey.STRING]: '', + [DefaultValuesForTypeKey.NUMBER]: undefined, + [DefaultValuesForTypeKey.ARRAY]: [] + }; + return def[type]; + } + // given a flag, enforce a default type. + function guessType(key) { + let type = DefaultValuesForTypeKey.BOOLEAN; + if (checkAllAliases(key, flags.strings)) + type = DefaultValuesForTypeKey.STRING; + else if (checkAllAliases(key, flags.numbers)) + type = DefaultValuesForTypeKey.NUMBER; + else if (checkAllAliases(key, flags.bools)) + type = DefaultValuesForTypeKey.BOOLEAN; + else if (checkAllAliases(key, flags.arrays)) + type = DefaultValuesForTypeKey.ARRAY; + return type; + } + function isUndefined(num) { + return num === undefined; + } + // check user configuration settings for inconsistencies + function checkConfiguration() { + // count keys should not be set as array/narg + Object.keys(flags.counts).find(key => { + if (checkAllAliases(key, flags.arrays)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key)); + return true; + } + else if (checkAllAliases(key, flags.nargs)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key)); + return true; + } + return false; + }); + } + return { + aliases: Object.assign({}, flags.aliases), + argv: Object.assign(argvReturn, argv), + configuration: configuration, + defaulted: Object.assign({}, defaulted), + error: error, + newAliases: Object.assign({}, newAliases) + }; + } +} +// if any aliases reference each other, we should +// merge them together. +function combineAliases(aliases) { + const aliasArrays = []; + const combined = Object.create(null); + let change = true; + // turn alias lookup hash {key: ['alias1', 'alias2']} into + // a simple array ['key', 'alias1', 'alias2'] + Object.keys(aliases).forEach(function (key) { + aliasArrays.push([].concat(aliases[key], key)); + }); + // combine arrays until zero changes are + // made in an iteration. + while (change) { + change = false; + for (let i = 0; i < aliasArrays.length; i++) { + for (let ii = i + 1; ii < aliasArrays.length; ii++) { + const intersect = aliasArrays[i].filter(function (v) { + return aliasArrays[ii].indexOf(v) !== -1; + }); + if (intersect.length) { + aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]); + aliasArrays.splice(ii, 1); + change = true; + break; + } + } + } + } + // map arrays back to the hash-lookup (de-dupe while + // we're at it). + aliasArrays.forEach(function (aliasArray) { + aliasArray = aliasArray.filter(function (v, i, self) { + return self.indexOf(v) === i; + }); + const lastAlias = aliasArray.pop(); + if (lastAlias !== undefined && typeof lastAlias === 'string') { + combined[lastAlias] = aliasArray; + } + }); + return combined; +} +// this function should only be called when a count is given as an arg +// it is NOT called to set a default value +// thus we can start the count at 1 instead of 0 +function increment(orig) { + return orig !== undefined ? orig + 1 : 1; +} +// TODO(bcoe): in the next major version of yargs, switch to +// Object.create(null) for dot notation: +function sanitizeKey(key) { + if (key === '__proto__') + return '___proto___'; + return key; +} diff --git a/node_modules/yargs-parser/package.json b/node_modules/yargs-parser/package.json new file mode 100644 index 000000000..f97aa9e5d --- /dev/null +++ b/node_modules/yargs-parser/package.json @@ -0,0 +1,87 @@ +{ + "name": "yargs-parser", + "version": "20.2.9", + "description": "the mighty option parser used by yargs", + "main": "build/index.cjs", + "exports": { + ".": [ + { + "import": "./build/lib/index.js", + "require": "./build/index.cjs" + }, + "./build/index.cjs" + ] + }, + "type": "module", + "module": "./build/lib/index.js", + "scripts": { + "check": "standardx '**/*.ts' && standardx '**/*.js' && standardx '**/*.cjs'", + "fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js' && standardx --fix '**/*.cjs'", + "pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs", + "test": "c8 --reporter=text --reporter=html mocha test/*.cjs", + "test:browser": "start-server-and-test 'serve ./ -p 8080' http://127.0.0.1:8080/package.json 'node ./test/browser/yargs-test.cjs'", + "pretest:typescript": "npm run pretest", + "test:typescript": "c8 mocha ./build/test/typescript/*.js", + "coverage": "c8 report --check-coverage", + "precompile": "rimraf build", + "compile": "tsc", + "postcompile": "npm run build:cjs", + "build:cjs": "rollup -c", + "prepare": "npm run compile" + }, + "repository": { + "type": "git", + "url": "https://github.com/yargs/yargs-parser.git" + }, + "keywords": [ + "argument", + "parser", + "yargs", + "command", + "cli", + "parsing", + "option", + "args", + "argument" + ], + "author": "Ben Coe ", + "license": "ISC", + "devDependencies": { + "@types/chai": "^4.2.11", + "@types/mocha": "^8.0.0", + "@types/node": "^14.0.0", + "@typescript-eslint/eslint-plugin": "^3.10.1", + "@typescript-eslint/parser": "^3.10.1", + "@wessberg/rollup-plugin-ts": "^1.2.28", + "c8": "^7.3.0", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "eslint": "^7.0.0", + "eslint-plugin-import": "^2.20.1", + "eslint-plugin-node": "^11.0.0", + "gts": "^3.0.0", + "mocha": "^9.0.0", + "puppeteer": "^10.0.0", + "rimraf": "^3.0.2", + "rollup": "^2.22.1", + "rollup-plugin-cleanup": "^3.1.1", + "serve": "^12.0.0", + "standardx": "^7.0.0", + "start-server-and-test": "^1.11.2", + "ts-transform-default-export": "^1.0.2", + "typescript": "^4.0.0" + }, + "files": [ + "browser.js", + "build", + "!*.d.ts" + ], + "engines": { + "node": ">=10" + }, + "standardx": { + "ignore": [ + "build" + ] + } +} diff --git a/node_modules/yocto-queue/index.d.ts b/node_modules/yocto-queue/index.d.ts new file mode 100644 index 000000000..9541986b4 --- /dev/null +++ b/node_modules/yocto-queue/index.d.ts @@ -0,0 +1,56 @@ +declare class Queue implements Iterable { + /** + The size of the queue. + */ + readonly size: number; + + /** + Tiny queue data structure. + + The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow. + + @example + ``` + import Queue = require('yocto-queue'); + + const queue = new Queue(); + + queue.enqueue('🦄'); + queue.enqueue('🌈'); + + console.log(queue.size); + //=> 2 + + console.log(...queue); + //=> '🦄 🌈' + + console.log(queue.dequeue()); + //=> '🦄' + + console.log(queue.dequeue()); + //=> '🌈' + ``` + */ + constructor(); + + [Symbol.iterator](): IterableIterator; + + /** + Add a value to the queue. + */ + enqueue(value: ValueType): void; + + /** + Remove the next value in the queue. + + @returns The removed value or `undefined` if the queue is empty. + */ + dequeue(): ValueType | undefined; + + /** + Clear the queue. + */ + clear(): void; +} + +export = Queue; diff --git a/node_modules/yocto-queue/index.js b/node_modules/yocto-queue/index.js new file mode 100644 index 000000000..2f3e6dcd7 --- /dev/null +++ b/node_modules/yocto-queue/index.js @@ -0,0 +1,68 @@ +class Node { + /// value; + /// next; + + constructor(value) { + this.value = value; + + // TODO: Remove this when targeting Node.js 12. + this.next = undefined; + } +} + +class Queue { + // TODO: Use private class fields when targeting Node.js 12. + // #_head; + // #_tail; + // #_size; + + constructor() { + this.clear(); + } + + enqueue(value) { + const node = new Node(value); + + if (this._head) { + this._tail.next = node; + this._tail = node; + } else { + this._head = node; + this._tail = node; + } + + this._size++; + } + + dequeue() { + const current = this._head; + if (!current) { + return; + } + + this._head = this._head.next; + this._size--; + return current.value; + } + + clear() { + this._head = undefined; + this._tail = undefined; + this._size = 0; + } + + get size() { + return this._size; + } + + * [Symbol.iterator]() { + let current = this._head; + + while (current) { + yield current.value; + current = current.next; + } + } +} + +module.exports = Queue; diff --git a/node_modules/yocto-queue/license b/node_modules/yocto-queue/license new file mode 100644 index 000000000..fa7ceba3e --- /dev/null +++ b/node_modules/yocto-queue/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/yocto-queue/package.json b/node_modules/yocto-queue/package.json new file mode 100644 index 000000000..71a91017b --- /dev/null +++ b/node_modules/yocto-queue/package.json @@ -0,0 +1,43 @@ +{ + "name": "yocto-queue", + "version": "0.1.0", + "description": "Tiny queue data structure", + "license": "MIT", + "repository": "sindresorhus/yocto-queue", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "queue", + "data", + "structure", + "algorithm", + "queues", + "queuing", + "list", + "array", + "linkedlist", + "fifo", + "enqueue", + "dequeue", + "data-structure" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.13.1", + "xo": "^0.35.0" + } +} diff --git a/node_modules/yocto-queue/readme.md b/node_modules/yocto-queue/readme.md new file mode 100644 index 000000000..c72fefc48 --- /dev/null +++ b/node_modules/yocto-queue/readme.md @@ -0,0 +1,64 @@ +# yocto-queue [![](https://badgen.net/bundlephobia/minzip/yocto-queue)](https://bundlephobia.com/result?p=yocto-queue) + +> Tiny queue data structure + +You should use this package instead of an array if you do a lot of `Array#push()` and `Array#shift()` on large arrays, since `Array#shift()` has [linear time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(N)%E2%80%94Linear%20Time) *O(n)* while `Queue#dequeue()` has [constant time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(1)%20%E2%80%94%20Constant%20Time) *O(1)*. That makes a huge difference for large arrays. + +> A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is an ordered list of elements where an element is inserted at the end of the queue and is removed from the front of the queue. A queue works based on the first-in, first-out ([FIFO](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics))) principle. + +## Install + +``` +$ npm install yocto-queue +``` + +## Usage + +```js +const Queue = require('yocto-queue'); + +const queue = new Queue(); + +queue.enqueue('🦄'); +queue.enqueue('🌈'); + +console.log(queue.size); +//=> 2 + +console.log(...queue); +//=> '🦄 🌈' + +console.log(queue.dequeue()); +//=> '🦄' + +console.log(queue.dequeue()); +//=> '🌈' +``` + +## API + +### `queue = new Queue()` + +The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow. + +#### `.enqueue(value)` + +Add a value to the queue. + +#### `.dequeue()` + +Remove the next value in the queue. + +Returns the removed value or `undefined` if the queue is empty. + +#### `.clear()` + +Clear the queue. + +#### `.size` + +The size of the queue. + +## Related + +- [quick-lru](https://github.com/sindresorhus/quick-lru) - Simple “Least Recently Used” (LRU) cache diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..fdb81005f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2073 @@ +{ + "name": "bioconductor.org", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "bioconductor.org", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "stylelint": "^15.10.1", + "stylelint-config-standard": "^34.0.0", + "stylelint-config-standard-scss": "^10.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.3.0.tgz", + "integrity": "sha512-dTKSIHHWc0zPvcS5cqGP+/TPFUJB0ekJ9dGKvMAFoNuBFhDPBt9OMGNZiIA5vTiNdGHHBeScYPXIGBMnVOahsA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^2.1.1" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.1.1.tgz", + "integrity": "sha512-GbrTj2Z8MCTUv+52GE0RbFGM527xuXZ0Xa5g0Z+YN573uveS4G0qi6WNOMyz3yrFM/jaILTTwJ0+umx81EzqfA==", + "dev": true, + "engines": { + "node": "^14 || ^16 || >=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + }, + "node_modules/@csstools/media-query-list-parser": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.2.tgz", + "integrity": "sha512-M8cFGGwl866o6++vIY7j1AKuq9v57cf+dGepScwCcbut9ypJNr4Cj+LLTWligYUZ0uyhEoJDKt5lvyBfh2L3ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^2.3.0", + "@csstools/css-tokenizer": "^2.1.1" + } + }, + "node_modules/@csstools/selector-specificity": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.0.0.tgz", + "integrity": "sha512-hBI9tfBtuPIi885ZsZ32IMEU/5nlZH/KOVYJCOh7gyMxaVLGmLedYqFN6Ui1LXkI8JlC8IsuC0rF0btcRZKd5g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "postcss-selector-parser": "^6.0.13" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/minimist": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "dev": true + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "dev": true + }, + "node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-2.0.0.tgz", + "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/brace-expansion/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/camelcase-keys": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-7.0.2.tgz", + "integrity": "sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==", + "dev": true, + "dependencies": { + "camelcase": "^6.3.0", + "map-obj": "^4.1.0", + "quick-lru": "^5.1.1", + "type-fest": "^1.2.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/colord": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", + "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cosmiconfig": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", + "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", + "dev": true, + "dependencies": { + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + } + }, + "node_modules/css-functions-list": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.0.tgz", + "integrity": "sha512-d/jBMPyYybkkLVypgtGv12R+pIFw4/f/IHtCTxWpZc8ofTYOPigIgmA6vu5rMHartZC+WuXhBUHfnyNUIQSYrg==", + "dev": true, + "engines": { + "node": ">=12.22" + } + }, + "node_modules/css-tree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", + "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dev": true, + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", + "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "dependencies": { + "global-prefix": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globjoin": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/globjoin/-/globjoin-0.1.4.tgz", + "integrity": "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==", + "dev": true + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/html-tags": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz", + "integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/known-css-properties": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.27.0.tgz", + "integrity": "sha512-uMCj6+hZYDoffuvAJjFAPz56E9uoowFHmTkqRtRq5WyC5Q6Cu/fTZKNQpX/RbzChBYLLl3lo8CjFZBAZXq9qFg==", + "dev": true + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mathml-tag-names": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", + "integrity": "sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdn-data": { + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", + "dev": true + }, + "node_modules/meow": { + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.5.tgz", + "integrity": "sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==", + "dev": true, + "dependencies": { + "@types/minimist": "^1.2.2", + "camelcase-keys": "^7.0.0", + "decamelize": "^5.0.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.2", + "read-pkg-up": "^8.0.0", + "redent": "^4.0.0", + "trim-newlines": "^4.0.2", + "type-fest": "^1.2.2", + "yargs-parser": "^20.2.9" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.4.25", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.25.tgz", + "integrity": "sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-media-query-parser": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", + "integrity": "sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==", + "dev": true + }, + "node_modules/postcss-resolve-nested-selector": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", + "integrity": "sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw==", + "dev": true + }, + "node_modules/postcss-safe-parser": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz", + "integrity": "sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==", + "dev": true, + "engines": { + "node": ">=12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.3.3" + } + }, + "node_modules/postcss-scss": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.6.tgz", + "integrity": "sha512-rLDPhJY4z/i4nVFZ27j9GqLxj1pwxE80eAzUNRMXtcpipFYIeowerzBgG3yJhMtObGEXidtIgbUpQ3eLDsf5OQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss-scss" + } + ], + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.4.19" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", + "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-6.0.0.tgz", + "integrity": "sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-8.0.0.tgz", + "integrity": "sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==", + "dev": true, + "dependencies": { + "find-up": "^5.0.0", + "read-pkg": "^6.0.0", + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/redent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", + "integrity": "sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==", + "dev": true, + "dependencies": { + "indent-string": "^5.0.0", + "strip-indent": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/signal-exit": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", + "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/slice-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", + "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", + "dev": true + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", + "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", + "dev": true, + "dependencies": { + "min-indent": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/style-search": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", + "integrity": "sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==", + "dev": true + }, + "node_modules/stylelint": { + "version": "15.10.1", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.10.1.tgz", + "integrity": "sha512-CYkzYrCFfA/gnOR+u9kJ1PpzwG10WLVnoxHDuBA/JiwGqdM9+yx9+ou6SE/y9YHtfv1mcLo06fdadHTOx4gBZQ==", + "dev": true, + "dependencies": { + "@csstools/css-parser-algorithms": "^2.3.0", + "@csstools/css-tokenizer": "^2.1.1", + "@csstools/media-query-list-parser": "^2.1.2", + "@csstools/selector-specificity": "^3.0.0", + "balanced-match": "^2.0.0", + "colord": "^2.9.3", + "cosmiconfig": "^8.2.0", + "css-functions-list": "^3.1.0", + "css-tree": "^2.3.1", + "debug": "^4.3.4", + "fast-glob": "^3.3.0", + "fastest-levenshtein": "^1.0.16", + "file-entry-cache": "^6.0.1", + "global-modules": "^2.0.0", + "globby": "^11.1.0", + "globjoin": "^0.1.4", + "html-tags": "^3.3.1", + "ignore": "^5.2.4", + "import-lazy": "^4.0.0", + "imurmurhash": "^0.1.4", + "is-plain-object": "^5.0.0", + "known-css-properties": "^0.27.0", + "mathml-tag-names": "^2.1.3", + "meow": "^10.1.5", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.24", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-safe-parser": "^6.0.0", + "postcss-selector-parser": "^6.0.13", + "postcss-value-parser": "^4.2.0", + "resolve-from": "^5.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "style-search": "^0.1.0", + "supports-hyperlinks": "^3.0.0", + "svg-tags": "^1.0.0", + "table": "^6.8.1", + "write-file-atomic": "^5.0.1" + }, + "bin": { + "stylelint": "bin/stylelint.mjs" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stylelint" + } + }, + "node_modules/stylelint-config-recommended": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-13.0.0.tgz", + "integrity": "sha512-EH+yRj6h3GAe/fRiyaoO2F9l9Tgg50AOFhaszyfov9v6ayXJ1IkSHwTxd7lB48FmOeSGDPLjatjO11fJpmarkQ==", + "dev": true, + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "stylelint": "^15.10.0" + } + }, + "node_modules/stylelint-config-recommended-scss": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-12.0.0.tgz", + "integrity": "sha512-5Bb2mlGy6WLa30oNeKpZvavv2lowJUsUJO25+OA68GFTemlwd1zbFsL7q0bReKipOSU3sG47hKneZ6Nd+ctrFA==", + "dev": true, + "dependencies": { + "postcss-scss": "^4.0.6", + "stylelint-config-recommended": "^12.0.0", + "stylelint-scss": "^5.0.0" + }, + "peerDependencies": { + "postcss": "^8.3.3", + "stylelint": "^15.5.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + } + } + }, + "node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", + "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", + "dev": true, + "peerDependencies": { + "stylelint": "^15.5.0" + } + }, + "node_modules/stylelint-config-standard": { + "version": "34.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-34.0.0.tgz", + "integrity": "sha512-u0VSZnVyW9VSryBG2LSO+OQTjN7zF9XJaAJRX/4EwkmU0R2jYwmBSN10acqZisDitS0CLiEiGjX7+Hrq8TAhfQ==", + "dev": true, + "dependencies": { + "stylelint-config-recommended": "^13.0.0" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "stylelint": "^15.10.0" + } + }, + "node_modules/stylelint-config-standard-scss": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-10.0.0.tgz", + "integrity": "sha512-bChBEo1p3xUVWh/wenJI+josoMk21f2yuLDGzGjmKYcALfl2u3DFltY+n4UHswYiXghqXaA8mRh+bFy/q1hQlg==", + "dev": true, + "dependencies": { + "stylelint-config-recommended-scss": "^12.0.0", + "stylelint-config-standard": "^33.0.0" + }, + "peerDependencies": { + "postcss": "^8.3.3", + "stylelint": "^15.5.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + } + } + }, + "node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", + "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", + "dev": true, + "peerDependencies": { + "stylelint": "^15.5.0" + } + }, + "node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard": { + "version": "33.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-33.0.0.tgz", + "integrity": "sha512-eyxnLWoXImUn77+ODIuW9qXBDNM+ALN68L3wT1lN2oNspZ7D9NVGlNHb2QCUn4xDug6VZLsh0tF8NyoYzkgTzg==", + "dev": true, + "dependencies": { + "stylelint-config-recommended": "^12.0.0" + }, + "peerDependencies": { + "stylelint": "^15.5.0" + } + }, + "node_modules/stylelint-scss": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-5.0.1.tgz", + "integrity": "sha512-n87iCRZrr2J7//I/QFsDXxFLnHKw633U4qvWZ+mOW6KDAp/HLj06H+6+f9zOuTYy+MdGdTuCSDROCpQIhw5fvQ==", + "dev": true, + "dependencies": { + "postcss-media-query-parser": "^0.2.3", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-selector-parser": "^6.0.13", + "postcss-value-parser": "^4.2.0" + }, + "peerDependencies": { + "stylelint": "^14.5.1 || ^15.0.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-hyperlinks": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", + "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/supports-hyperlinks/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/svg-tags": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz", + "integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==", + "dev": true + }, + "node_modules/table": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", + "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", + "dev": true, + "dependencies": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/trim-newlines": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-4.1.1.tgz", + "integrity": "sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 000000000..0bf27d7ea --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "bioconductor.org", + "version": "1.0.0", + "description": "[CloudFront](https://aws.amazon.com/cloudfront/) is a content delivery network (CDN). The idea is that if a user in say, Singapore hits our web site, the files she requested will be cached in a location near her and her next access (or that of any other user in that area) will be faster.", + "main": "index.js", + "directories": { + "lib": "lib" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "stylelint": "^15.10.1", + "stylelint-config-standard": "^34.0.0", + "stylelint-config-standard-scss": "^10.0.0" + } +} From 34ed720fa575b1328d6dafe674e0c8c36bb18608 Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 11 Jul 2023 14:57:35 +0100 Subject: [PATCH 036/156] added node modules to gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b3baf8649..4965ac9e9 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,5 @@ assets/help/workflows/* workflows_tmp/ content/help/workflows/* postgresql_password -manifest/* \ No newline at end of file +manifest/* +node_modules/ \ No newline at end of file From 54a52dc922107c76be7cfedad38c4d542a712efd Mon Sep 17 00:00:00 2001 From: bp289 Date: Tue, 11 Jul 2023 14:59:39 +0100 Subject: [PATCH 037/156] removed node modules --- node_modules/.bin/cssesc | 1 - node_modules/.bin/js-yaml | 1 - node_modules/.bin/nanoid | 1 - node_modules/.bin/rimraf | 1 - node_modules/.bin/semver | 1 - node_modules/.bin/stylelint | 1 - node_modules/.bin/which | 1 - node_modules/.package-lock.json | 2063 ---- node_modules/@babel/code-frame/LICENSE | 22 - node_modules/@babel/code-frame/README.md | 19 - node_modules/@babel/code-frame/lib/index.js | 142 - .../@babel/code-frame/lib/index.js.map | 1 - node_modules/@babel/code-frame/package.json | 28 - .../helper-validator-identifier/LICENSE | 22 - .../helper-validator-identifier/README.md | 19 - .../lib/identifier.js | 70 - .../lib/identifier.js.map | 1 - .../helper-validator-identifier/lib/index.js | 57 - .../lib/index.js.map | 1 - .../lib/keyword.js | 35 - .../lib/keyword.js.map | 1 - .../helper-validator-identifier/package.json | 28 - .../scripts/generate-identifier-regex.js | 75 - node_modules/@babel/highlight/LICENSE | 22 - node_modules/@babel/highlight/README.md | 19 - node_modules/@babel/highlight/lib/index.js | 96 - .../@babel/highlight/lib/index.js.map | 1 - node_modules/@babel/highlight/package.json | 30 - .../css-parser-algorithms/CHANGELOG.md | 53 - .../css-parser-algorithms/LICENSE.md | 20 - .../@csstools/css-parser-algorithms/README.md | 115 - .../consume-component-block-function.d.ts | 118 - .../css-parser-algorithms/dist/index.cjs | 1 - .../css-parser-algorithms/dist/index.d.ts | 10 - .../css-parser-algorithms/dist/index.mjs | 1 - .../dist/interfaces/context.d.ts | 4 - ...ma-separated-list-of-component-values.d.ts | 5 - .../dist/parse/parse-component-value.d.ts | 4 - .../parse/parse-list-of-component-values.d.ts | 5 - .../dist/util/component-value-type.d.ts | 7 - .../dist/util/node-ancestry.d.ts | 7 - .../dist/util/replace-component-values.d.ts | 2 - .../dist/util/source-indices.d.ts | 9 - .../dist/util/stringify.d.ts | 2 - .../dist/util/type-predicates.d.ts | 6 - .../css-parser-algorithms/package.json | 72 - .../@csstools/css-tokenizer/CHANGELOG.md | 28 - .../@csstools/css-tokenizer/LICENSE.md | 20 - .../@csstools/css-tokenizer/README.md | 108 - .../four-code-points-would-start-cdo.d.ts | 3 - .../dist/checks/matches-url-ident.d.ts | 2 - .../three-code-points-would-start-cdc.d.ts | 3 - ...ode-points-would-start-ident-sequence.d.ts | 3 - .../three-code-points-would-start-number.d.ts | 3 - .../two-code-points-are-valid-escape.d.ts | 3 - .../checks/two-code-points-start-comment.d.ts | 3 - .../dist/code-points/code-points.d.ts | 78 - .../dist/code-points/ranges.d.ts | 12 - .../css-tokenizer/dist/consume/bad-url.d.ts | 3 - .../css-tokenizer/dist/consume/comment.d.ts | 4 - .../dist/consume/escaped-code-point.d.ts | 3 - .../dist/consume/hash-token.d.ts | 4 - .../dist/consume/ident-like-token.d.ts | 4 - .../dist/consume/ident-sequence.d.ts | 3 - .../css-tokenizer/dist/consume/number.d.ts | 4 - .../dist/consume/numeric-token.d.ts | 4 - .../dist/consume/string-token.d.ts | 4 - .../css-tokenizer/dist/consume/url-token.d.ts | 4 - .../dist/consume/whitespace-token.d.ts | 4 - .../@csstools/css-tokenizer/dist/index.cjs | 1 - .../@csstools/css-tokenizer/dist/index.d.ts | 9 - .../@csstools/css-tokenizer/dist/index.mjs | 1 - .../dist/interfaces/code-point-reader.d.ts | 10 - .../dist/interfaces/context.d.ts | 4 - .../css-tokenizer/dist/interfaces/error.d.ts | 9 - .../css-tokenizer/dist/interfaces/token.d.ts | 128 - .../@csstools/css-tokenizer/dist/reader.d.ts | 13 - .../css-tokenizer/dist/stringify.d.ts | 2 - .../css-tokenizer/dist/tokenizer.d.ts | 19 - .../css-tokenizer/dist/util/clone-tokens.d.ts | 2 - .../css-tokenizer/dist/util/mutations.d.ts | 2 - .../@csstools/css-tokenizer/package.json | 67 - .../media-query-list-parser/CHANGELOG.md | 64 - .../media-query-list-parser/LICENSE.md | 20 - .../media-query-list-parser/README.md | 61 - .../media-query-list-parser/dist/index.cjs | 1 - .../media-query-list-parser/dist/index.d.ts | 23 - .../media-query-list-parser/dist/index.mjs | 1 - .../dist/nodes/custom-media.d.ts | 44 - .../dist/nodes/general-enclosed.d.ts | 25 - .../dist/nodes/media-and.d.ts | 23 - .../dist/nodes/media-condition-list.d.ts | 50 - .../dist/nodes/media-condition.d.ts | 24 - .../dist/nodes/media-feature-boolean.d.ts | 27 - .../dist/nodes/media-feature-comparison.d.ts | 17 - .../dist/nodes/media-feature-name.d.ts | 24 - .../dist/nodes/media-feature-plain.d.ts | 42 - .../dist/nodes/media-feature-range.d.ts | 124 - .../dist/nodes/media-feature-value.d.ts | 31 - .../dist/nodes/media-feature.d.ts | 45 - .../dist/nodes/media-in-parens.d.ts | 41 - .../dist/nodes/media-not.d.ts | 32 - .../dist/nodes/media-or.d.ts | 32 - .../dist/nodes/media-query-modifier.d.ts | 6 - .../dist/nodes/media-query.d.ts | 83 - .../dist/nodes/media-type.d.ts | 24 - .../dist/parser/parse-custom-media.d.ts | 8 - .../dist/parser/parse-media-query.d.ts | 24 - .../dist/parser/parse.d.ts | 8 - .../dist/util/clone-media-query.d.ts | 2 - .../dist/util/component-value-is.d.ts | 5 - .../dist/util/node-type.d.ts | 22 - .../dist/util/to-lower-case-a-z.d.ts | 1 - .../dist/util/type-predicates.d.ts | 37 - .../media-query-list-parser/package.json | 74 - .../selector-specificity/CHANGELOG.md | 63 - .../@csstools/selector-specificity/LICENSE.md | 18 - .../@csstools/selector-specificity/README.md | 57 - .../selector-specificity/dist/index.cjs | 1 - .../selector-specificity/dist/index.d.ts | 8 - .../selector-specificity/dist/index.mjs | 1 - .../dist/to-lower-case-a-z.d.ts | 1 - .../selector-specificity/package.json | 75 - node_modules/@nodelib/fs.scandir/LICENSE | 21 - node_modules/@nodelib/fs.scandir/README.md | 171 - .../@nodelib/fs.scandir/out/adapters/fs.d.ts | 20 - .../@nodelib/fs.scandir/out/adapters/fs.js | 19 - .../@nodelib/fs.scandir/out/constants.d.ts | 4 - .../@nodelib/fs.scandir/out/constants.js | 17 - .../@nodelib/fs.scandir/out/index.d.ts | 12 - node_modules/@nodelib/fs.scandir/out/index.js | 26 - .../fs.scandir/out/providers/async.d.ts | 7 - .../fs.scandir/out/providers/async.js | 104 - .../fs.scandir/out/providers/common.d.ts | 1 - .../fs.scandir/out/providers/common.js | 13 - .../fs.scandir/out/providers/sync.d.ts | 5 - .../@nodelib/fs.scandir/out/providers/sync.js | 54 - .../@nodelib/fs.scandir/out/settings.d.ts | 20 - .../@nodelib/fs.scandir/out/settings.js | 24 - .../@nodelib/fs.scandir/out/types/index.d.ts | 20 - .../@nodelib/fs.scandir/out/types/index.js | 2 - .../@nodelib/fs.scandir/out/utils/fs.d.ts | 2 - .../@nodelib/fs.scandir/out/utils/fs.js | 19 - .../@nodelib/fs.scandir/out/utils/index.d.ts | 2 - .../@nodelib/fs.scandir/out/utils/index.js | 5 - node_modules/@nodelib/fs.scandir/package.json | 44 - node_modules/@nodelib/fs.stat/LICENSE | 21 - node_modules/@nodelib/fs.stat/README.md | 126 - .../@nodelib/fs.stat/out/adapters/fs.d.ts | 13 - .../@nodelib/fs.stat/out/adapters/fs.js | 17 - node_modules/@nodelib/fs.stat/out/index.d.ts | 12 - node_modules/@nodelib/fs.stat/out/index.js | 26 - .../@nodelib/fs.stat/out/providers/async.d.ts | 4 - .../@nodelib/fs.stat/out/providers/async.js | 36 - .../@nodelib/fs.stat/out/providers/sync.d.ts | 3 - .../@nodelib/fs.stat/out/providers/sync.js | 23 - .../@nodelib/fs.stat/out/settings.d.ts | 16 - node_modules/@nodelib/fs.stat/out/settings.js | 16 - .../@nodelib/fs.stat/out/types/index.d.ts | 4 - .../@nodelib/fs.stat/out/types/index.js | 2 - node_modules/@nodelib/fs.stat/package.json | 37 - node_modules/@nodelib/fs.walk/LICENSE | 21 - node_modules/@nodelib/fs.walk/README.md | 215 - node_modules/@nodelib/fs.walk/out/index.d.ts | 14 - node_modules/@nodelib/fs.walk/out/index.js | 34 - .../@nodelib/fs.walk/out/providers/async.d.ts | 12 - .../@nodelib/fs.walk/out/providers/async.js | 30 - .../@nodelib/fs.walk/out/providers/index.d.ts | 4 - .../@nodelib/fs.walk/out/providers/index.js | 9 - .../fs.walk/out/providers/stream.d.ts | 12 - .../@nodelib/fs.walk/out/providers/stream.js | 34 - .../@nodelib/fs.walk/out/providers/sync.d.ts | 10 - .../@nodelib/fs.walk/out/providers/sync.js | 14 - .../@nodelib/fs.walk/out/readers/async.d.ts | 30 - .../@nodelib/fs.walk/out/readers/async.js | 97 - .../@nodelib/fs.walk/out/readers/common.d.ts | 7 - .../@nodelib/fs.walk/out/readers/common.js | 31 - .../@nodelib/fs.walk/out/readers/reader.d.ts | 6 - .../@nodelib/fs.walk/out/readers/reader.js | 11 - .../@nodelib/fs.walk/out/readers/sync.d.ts | 15 - .../@nodelib/fs.walk/out/readers/sync.js | 59 - .../@nodelib/fs.walk/out/settings.d.ts | 30 - node_modules/@nodelib/fs.walk/out/settings.js | 26 - .../@nodelib/fs.walk/out/types/index.d.ts | 8 - .../@nodelib/fs.walk/out/types/index.js | 2 - node_modules/@nodelib/fs.walk/package.json | 44 - node_modules/@types/minimist/LICENSE | 21 - node_modules/@types/minimist/README.md | 16 - node_modules/@types/minimist/index.d.ts | 95 - node_modules/@types/minimist/package.json | 40 - .../@types/normalize-package-data/LICENSE | 21 - .../@types/normalize-package-data/README.md | 66 - .../@types/normalize-package-data/index.d.ts | 46 - .../normalize-package-data/package.json | 25 - node_modules/ajv/.runkit_example.js | 23 - node_modules/ajv/LICENSE | 22 - node_modules/ajv/README.md | 207 - node_modules/ajv/dist/2019.d.ts | 19 - node_modules/ajv/dist/2019.js | 59 - node_modules/ajv/dist/2019.js.map | 1 - node_modules/ajv/dist/2020.d.ts | 19 - node_modules/ajv/dist/2020.js | 53 - node_modules/ajv/dist/2020.js.map | 1 - node_modules/ajv/dist/ajv.d.ts | 18 - node_modules/ajv/dist/ajv.js | 48 - node_modules/ajv/dist/ajv.js.map | 1 - .../ajv/dist/compile/codegen/code.d.ts | 40 - node_modules/ajv/dist/compile/codegen/code.js | 155 - .../ajv/dist/compile/codegen/code.js.map | 1 - .../ajv/dist/compile/codegen/index.d.ts | 79 - .../ajv/dist/compile/codegen/index.js | 697 -- .../ajv/dist/compile/codegen/index.js.map | 1 - .../ajv/dist/compile/codegen/scope.d.ts | 79 - .../ajv/dist/compile/codegen/scope.js | 143 - .../ajv/dist/compile/codegen/scope.js.map | 1 - node_modules/ajv/dist/compile/errors.d.ts | 13 - node_modules/ajv/dist/compile/errors.js | 123 - node_modules/ajv/dist/compile/errors.js.map | 1 - node_modules/ajv/dist/compile/index.d.ts | 80 - node_modules/ajv/dist/compile/index.js | 242 - node_modules/ajv/dist/compile/index.js.map | 1 - node_modules/ajv/dist/compile/jtd/parse.d.ts | 4 - node_modules/ajv/dist/compile/jtd/parse.js | 350 - .../ajv/dist/compile/jtd/parse.js.map | 1 - .../ajv/dist/compile/jtd/serialize.d.ts | 4 - .../ajv/dist/compile/jtd/serialize.js | 229 - .../ajv/dist/compile/jtd/serialize.js.map | 1 - node_modules/ajv/dist/compile/jtd/types.d.ts | 6 - node_modules/ajv/dist/compile/jtd/types.js | 14 - .../ajv/dist/compile/jtd/types.js.map | 1 - node_modules/ajv/dist/compile/names.d.ts | 20 - node_modules/ajv/dist/compile/names.js | 28 - node_modules/ajv/dist/compile/names.js.map | 1 - node_modules/ajv/dist/compile/ref_error.d.ts | 6 - node_modules/ajv/dist/compile/ref_error.js | 12 - .../ajv/dist/compile/ref_error.js.map | 1 - node_modules/ajv/dist/compile/resolve.d.ts | 12 - node_modules/ajv/dist/compile/resolve.js | 155 - node_modules/ajv/dist/compile/resolve.js.map | 1 - node_modules/ajv/dist/compile/rules.d.ts | 28 - node_modules/ajv/dist/compile/rules.js | 26 - node_modules/ajv/dist/compile/rules.js.map | 1 - node_modules/ajv/dist/compile/util.d.ts | 40 - node_modules/ajv/dist/compile/util.js | 178 - node_modules/ajv/dist/compile/util.js.map | 1 - .../dist/compile/validate/applicability.d.ts | 6 - .../dist/compile/validate/applicability.js | 19 - .../compile/validate/applicability.js.map | 1 - .../ajv/dist/compile/validate/boolSchema.d.ts | 4 - .../ajv/dist/compile/validate/boolSchema.js | 50 - .../dist/compile/validate/boolSchema.js.map | 1 - .../ajv/dist/compile/validate/dataType.d.ts | 17 - .../ajv/dist/compile/validate/dataType.js | 202 - .../ajv/dist/compile/validate/dataType.js.map | 1 - .../ajv/dist/compile/validate/defaults.d.ts | 2 - .../ajv/dist/compile/validate/defaults.js | 35 - .../ajv/dist/compile/validate/defaults.js.map | 1 - .../ajv/dist/compile/validate/index.d.ts | 42 - .../ajv/dist/compile/validate/index.js | 520 - .../ajv/dist/compile/validate/index.js.map | 1 - .../ajv/dist/compile/validate/keyword.d.ts | 8 - .../ajv/dist/compile/validate/keyword.js | 124 - .../ajv/dist/compile/validate/keyword.js.map | 1 - .../ajv/dist/compile/validate/subschema.d.ts | 47 - .../ajv/dist/compile/validate/subschema.js | 81 - .../dist/compile/validate/subschema.js.map | 1 - node_modules/ajv/dist/core.d.ts | 173 - node_modules/ajv/dist/core.js | 617 -- node_modules/ajv/dist/core.js.map | 1 - node_modules/ajv/dist/jtd.d.ts | 47 - node_modules/ajv/dist/jtd.js | 70 - node_modules/ajv/dist/jtd.js.map | 1 - node_modules/ajv/dist/refs/data.json | 13 - .../dist/refs/json-schema-2019-09/index.d.ts | 2 - .../dist/refs/json-schema-2019-09/index.js | 28 - .../refs/json-schema-2019-09/index.js.map | 1 - .../json-schema-2019-09/meta/applicator.json | 53 - .../json-schema-2019-09/meta/content.json | 17 - .../refs/json-schema-2019-09/meta/core.json | 57 - .../refs/json-schema-2019-09/meta/format.json | 14 - .../json-schema-2019-09/meta/meta-data.json | 37 - .../json-schema-2019-09/meta/validation.json | 90 - .../dist/refs/json-schema-2019-09/schema.json | 39 - .../dist/refs/json-schema-2020-12/index.d.ts | 2 - .../dist/refs/json-schema-2020-12/index.js | 30 - .../refs/json-schema-2020-12/index.js.map | 1 - .../json-schema-2020-12/meta/applicator.json | 48 - .../json-schema-2020-12/meta/content.json | 17 - .../refs/json-schema-2020-12/meta/core.json | 51 - .../meta/format-annotation.json | 14 - .../json-schema-2020-12/meta/meta-data.json | 37 - .../json-schema-2020-12/meta/unevaluated.json | 15 - .../json-schema-2020-12/meta/validation.json | 90 - .../dist/refs/json-schema-2020-12/schema.json | 55 - .../ajv/dist/refs/json-schema-draft-06.json | 137 - .../ajv/dist/refs/json-schema-draft-07.json | 151 - .../ajv/dist/refs/json-schema-secure.json | 88 - node_modules/ajv/dist/refs/jtd-schema.d.ts | 3 - node_modules/ajv/dist/refs/jtd-schema.js | 118 - node_modules/ajv/dist/refs/jtd-schema.js.map | 1 - node_modules/ajv/dist/runtime/equal.d.ts | 6 - node_modules/ajv/dist/runtime/equal.js | 7 - node_modules/ajv/dist/runtime/equal.js.map | 1 - node_modules/ajv/dist/runtime/parseJson.d.ts | 18 - node_modules/ajv/dist/runtime/parseJson.js | 184 - .../ajv/dist/runtime/parseJson.js.map | 1 - node_modules/ajv/dist/runtime/quote.d.ts | 5 - node_modules/ajv/dist/runtime/quote.js | 30 - node_modules/ajv/dist/runtime/quote.js.map | 1 - node_modules/ajv/dist/runtime/re2.d.ts | 6 - node_modules/ajv/dist/runtime/re2.js | 6 - node_modules/ajv/dist/runtime/re2.js.map | 1 - node_modules/ajv/dist/runtime/timestamp.d.ts | 5 - node_modules/ajv/dist/runtime/timestamp.js | 42 - .../ajv/dist/runtime/timestamp.js.map | 1 - node_modules/ajv/dist/runtime/ucs2length.d.ts | 5 - node_modules/ajv/dist/runtime/ucs2length.js | 24 - .../ajv/dist/runtime/ucs2length.js.map | 1 - node_modules/ajv/dist/runtime/uri.d.ts | 6 - node_modules/ajv/dist/runtime/uri.js | 6 - node_modules/ajv/dist/runtime/uri.js.map | 1 - .../ajv/dist/runtime/validation_error.d.ts | 7 - .../ajv/dist/runtime/validation_error.js | 11 - .../ajv/dist/runtime/validation_error.js.map | 1 - node_modules/ajv/dist/standalone/index.d.ts | 6 - node_modules/ajv/dist/standalone/index.js | 90 - node_modules/ajv/dist/standalone/index.js.map | 1 - .../ajv/dist/standalone/instance.d.ts | 12 - node_modules/ajv/dist/standalone/instance.js | 35 - .../ajv/dist/standalone/instance.js.map | 1 - node_modules/ajv/dist/types/index.d.ts | 183 - node_modules/ajv/dist/types/index.js | 3 - node_modules/ajv/dist/types/index.js.map | 1 - node_modules/ajv/dist/types/json-schema.d.ts | 125 - node_modules/ajv/dist/types/json-schema.js | 3 - .../ajv/dist/types/json-schema.js.map | 1 - node_modules/ajv/dist/types/jtd-schema.d.ts | 174 - node_modules/ajv/dist/types/jtd-schema.js | 3 - node_modules/ajv/dist/types/jtd-schema.js.map | 1 - .../applicator/additionalItems.d.ts | 8 - .../applicator/additionalItems.js | 49 - .../applicator/additionalItems.js.map | 1 - .../applicator/additionalProperties.d.ts | 6 - .../applicator/additionalProperties.js | 106 - .../applicator/additionalProperties.js.map | 1 - .../dist/vocabularies/applicator/allOf.d.ts | 3 - .../ajv/dist/vocabularies/applicator/allOf.js | 23 - .../dist/vocabularies/applicator/allOf.js.map | 1 - .../dist/vocabularies/applicator/anyOf.d.ts | 4 - .../ajv/dist/vocabularies/applicator/anyOf.js | 12 - .../dist/vocabularies/applicator/anyOf.js.map | 1 - .../vocabularies/applicator/contains.d.ts | 7 - .../dist/vocabularies/applicator/contains.js | 95 - .../vocabularies/applicator/contains.js.map | 1 - .../vocabularies/applicator/dependencies.d.ts | 21 - .../vocabularies/applicator/dependencies.js | 85 - .../applicator/dependencies.js.map | 1 - .../applicator/dependentSchemas.d.ts | 3 - .../applicator/dependentSchemas.js | 11 - .../applicator/dependentSchemas.js.map | 1 - .../ajv/dist/vocabularies/applicator/if.d.ts | 6 - .../ajv/dist/vocabularies/applicator/if.js | 66 - .../dist/vocabularies/applicator/if.js.map | 1 - .../dist/vocabularies/applicator/index.d.ts | 13 - .../ajv/dist/vocabularies/applicator/index.js | 44 - .../dist/vocabularies/applicator/index.js.map | 1 - .../dist/vocabularies/applicator/items.d.ts | 5 - .../ajv/dist/vocabularies/applicator/items.js | 52 - .../dist/vocabularies/applicator/items.js.map | 1 - .../vocabularies/applicator/items2020.d.ts | 6 - .../dist/vocabularies/applicator/items2020.js | 30 - .../vocabularies/applicator/items2020.js.map | 1 - .../ajv/dist/vocabularies/applicator/not.d.ts | 4 - .../ajv/dist/vocabularies/applicator/not.js | 26 - .../dist/vocabularies/applicator/not.js.map | 1 - .../dist/vocabularies/applicator/oneOf.d.ts | 6 - .../ajv/dist/vocabularies/applicator/oneOf.js | 60 - .../dist/vocabularies/applicator/oneOf.js.map | 1 - .../applicator/patternProperties.d.ts | 3 - .../applicator/patternProperties.js | 75 - .../applicator/patternProperties.js.map | 1 - .../vocabularies/applicator/prefixItems.d.ts | 3 - .../vocabularies/applicator/prefixItems.js | 12 - .../applicator/prefixItems.js.map | 1 - .../vocabularies/applicator/properties.d.ts | 3 - .../vocabularies/applicator/properties.js | 54 - .../vocabularies/applicator/properties.js.map | 1 - .../applicator/propertyNames.d.ts | 6 - .../vocabularies/applicator/propertyNames.js | 38 - .../applicator/propertyNames.js.map | 1 - .../vocabularies/applicator/thenElse.d.ts | 3 - .../dist/vocabularies/applicator/thenElse.js | 13 - .../vocabularies/applicator/thenElse.js.map | 1 - node_modules/ajv/dist/vocabularies/code.d.ts | 17 - node_modules/ajv/dist/vocabularies/code.js | 131 - .../ajv/dist/vocabularies/code.js.map | 1 - .../ajv/dist/vocabularies/core/id.d.ts | 3 - node_modules/ajv/dist/vocabularies/core/id.js | 10 - .../ajv/dist/vocabularies/core/id.js.map | 1 - .../ajv/dist/vocabularies/core/index.d.ts | 3 - .../ajv/dist/vocabularies/core/index.js | 16 - .../ajv/dist/vocabularies/core/index.js.map | 1 - .../ajv/dist/vocabularies/core/ref.d.ts | 8 - .../ajv/dist/vocabularies/core/ref.js | 122 - .../ajv/dist/vocabularies/core/ref.js.map | 1 - .../vocabularies/discriminator/index.d.ts | 5 - .../dist/vocabularies/discriminator/index.js | 100 - .../vocabularies/discriminator/index.js.map | 1 - .../vocabularies/discriminator/types.d.ts | 10 - .../dist/vocabularies/discriminator/types.js | 9 - .../vocabularies/discriminator/types.js.map | 1 - .../ajv/dist/vocabularies/draft2020.d.ts | 3 - .../ajv/dist/vocabularies/draft2020.js | 23 - .../ajv/dist/vocabularies/draft2020.js.map | 1 - .../ajv/dist/vocabularies/draft7.d.ts | 3 - node_modules/ajv/dist/vocabularies/draft7.js | 17 - .../ajv/dist/vocabularies/draft7.js.map | 1 - .../vocabularies/dynamic/dynamicAnchor.d.ts | 5 - .../vocabularies/dynamic/dynamicAnchor.js | 30 - .../vocabularies/dynamic/dynamicAnchor.js.map | 1 - .../dist/vocabularies/dynamic/dynamicRef.d.ts | 5 - .../dist/vocabularies/dynamic/dynamicRef.js | 51 - .../vocabularies/dynamic/dynamicRef.js.map | 1 - .../ajv/dist/vocabularies/dynamic/index.d.ts | 3 - .../ajv/dist/vocabularies/dynamic/index.js | 9 - .../dist/vocabularies/dynamic/index.js.map | 1 - .../vocabularies/dynamic/recursiveAnchor.d.ts | 3 - .../vocabularies/dynamic/recursiveAnchor.js | 16 - .../dynamic/recursiveAnchor.js.map | 1 - .../vocabularies/dynamic/recursiveRef.d.ts | 3 - .../dist/vocabularies/dynamic/recursiveRef.js | 10 - .../vocabularies/dynamic/recursiveRef.js.map | 1 - .../ajv/dist/vocabularies/errors.d.ts | 9 - node_modules/ajv/dist/vocabularies/errors.js | 3 - .../ajv/dist/vocabularies/errors.js.map | 1 - .../ajv/dist/vocabularies/format/format.d.ts | 8 - .../ajv/dist/vocabularies/format/format.js | 92 - .../dist/vocabularies/format/format.js.map | 1 - .../ajv/dist/vocabularies/format/index.d.ts | 3 - .../ajv/dist/vocabularies/format/index.js | 6 - .../ajv/dist/vocabularies/format/index.js.map | 1 - .../dist/vocabularies/jtd/discriminator.d.ts | 6 - .../dist/vocabularies/jtd/discriminator.js | 71 - .../vocabularies/jtd/discriminator.js.map | 1 - .../ajv/dist/vocabularies/jtd/elements.d.ts | 5 - .../ajv/dist/vocabularies/jtd/elements.js | 24 - .../ajv/dist/vocabularies/jtd/elements.js.map | 1 - .../ajv/dist/vocabularies/jtd/enum.d.ts | 6 - .../ajv/dist/vocabularies/jtd/enum.js | 43 - .../ajv/dist/vocabularies/jtd/enum.js.map | 1 - .../ajv/dist/vocabularies/jtd/error.d.ts | 9 - .../ajv/dist/vocabularies/jtd/error.js | 20 - .../ajv/dist/vocabularies/jtd/error.js.map | 1 - .../ajv/dist/vocabularies/jtd/index.d.ts | 10 - .../ajv/dist/vocabularies/jtd/index.js | 29 - .../ajv/dist/vocabularies/jtd/index.js.map | 1 - .../ajv/dist/vocabularies/jtd/metadata.d.ts | 5 - .../ajv/dist/vocabularies/jtd/metadata.js | 25 - .../ajv/dist/vocabularies/jtd/metadata.js.map | 1 - .../ajv/dist/vocabularies/jtd/nullable.d.ts | 4 - .../ajv/dist/vocabularies/jtd/nullable.js | 22 - .../ajv/dist/vocabularies/jtd/nullable.js.map | 1 - .../vocabularies/jtd/optionalProperties.d.ts | 3 - .../vocabularies/jtd/optionalProperties.js | 15 - .../jtd/optionalProperties.js.map | 1 - .../ajv/dist/vocabularies/jtd/properties.d.ts | 22 - .../ajv/dist/vocabularies/jtd/properties.js | 149 - .../dist/vocabularies/jtd/properties.js.map | 1 - .../ajv/dist/vocabularies/jtd/ref.d.ts | 4 - node_modules/ajv/dist/vocabularies/jtd/ref.js | 67 - .../ajv/dist/vocabularies/jtd/ref.js.map | 1 - .../ajv/dist/vocabularies/jtd/type.d.ts | 10 - .../ajv/dist/vocabularies/jtd/type.js | 69 - .../ajv/dist/vocabularies/jtd/type.js.map | 1 - .../ajv/dist/vocabularies/jtd/union.d.ts | 3 - .../ajv/dist/vocabularies/jtd/union.js | 12 - .../ajv/dist/vocabularies/jtd/union.js.map | 1 - .../ajv/dist/vocabularies/jtd/values.d.ts | 5 - .../ajv/dist/vocabularies/jtd/values.js | 51 - .../ajv/dist/vocabularies/jtd/values.js.map | 1 - .../ajv/dist/vocabularies/metadata.d.ts | 3 - .../ajv/dist/vocabularies/metadata.js | 18 - .../ajv/dist/vocabularies/metadata.js.map | 1 - node_modules/ajv/dist/vocabularies/next.d.ts | 3 - node_modules/ajv/dist/vocabularies/next.js | 8 - .../ajv/dist/vocabularies/next.js.map | 1 - .../dist/vocabularies/unevaluated/index.d.ts | 3 - .../dist/vocabularies/unevaluated/index.js | 7 - .../vocabularies/unevaluated/index.js.map | 1 - .../unevaluated/unevaluatedItems.d.ts | 6 - .../unevaluated/unevaluatedItems.js | 40 - .../unevaluated/unevaluatedItems.js.map | 1 - .../unevaluated/unevaluatedProperties.d.ts | 6 - .../unevaluated/unevaluatedProperties.js | 65 - .../unevaluated/unevaluatedProperties.js.map | 1 - .../dist/vocabularies/validation/const.d.ts | 6 - .../ajv/dist/vocabularies/validation/const.js | 25 - .../dist/vocabularies/validation/const.js.map | 1 - .../validation/dependentRequired.d.ts | 5 - .../validation/dependentRequired.js | 12 - .../validation/dependentRequired.js.map | 1 - .../dist/vocabularies/validation/enum.d.ts | 8 - .../ajv/dist/vocabularies/validation/enum.js | 48 - .../dist/vocabularies/validation/enum.js.map | 1 - .../dist/vocabularies/validation/index.d.ts | 16 - .../ajv/dist/vocabularies/validation/index.js | 33 - .../dist/vocabularies/validation/index.js.map | 1 - .../validation/limitContains.d.ts | 3 - .../vocabularies/validation/limitContains.js | 15 - .../validation/limitContains.js.map | 1 - .../vocabularies/validation/limitItems.d.ts | 3 - .../vocabularies/validation/limitItems.js | 24 - .../vocabularies/validation/limitItems.js.map | 1 - .../vocabularies/validation/limitLength.d.ts | 3 - .../vocabularies/validation/limitLength.js | 27 - .../validation/limitLength.js.map | 1 - .../vocabularies/validation/limitNumber.d.ts | 11 - .../vocabularies/validation/limitNumber.js | 27 - .../validation/limitNumber.js.map | 1 - .../validation/limitProperties.d.ts | 3 - .../validation/limitProperties.js | 24 - .../validation/limitProperties.js.map | 1 - .../vocabularies/validation/multipleOf.d.ts | 8 - .../vocabularies/validation/multipleOf.js | 26 - .../vocabularies/validation/multipleOf.js.map | 1 - .../dist/vocabularies/validation/pattern.d.ts | 8 - .../dist/vocabularies/validation/pattern.js | 24 - .../vocabularies/validation/pattern.js.map | 1 - .../vocabularies/validation/required.d.ts | 8 - .../dist/vocabularies/validation/required.js | 79 - .../vocabularies/validation/required.js.map | 1 - .../vocabularies/validation/uniqueItems.d.ts | 9 - .../vocabularies/validation/uniqueItems.js | 64 - .../validation/uniqueItems.js.map | 1 - node_modules/ajv/lib/2019.ts | 80 - node_modules/ajv/lib/2020.ts | 74 - node_modules/ajv/lib/ajv.ts | 69 - node_modules/ajv/lib/compile/codegen/code.ts | 168 - node_modules/ajv/lib/compile/codegen/index.ts | 832 -- node_modules/ajv/lib/compile/codegen/scope.ts | 215 - node_modules/ajv/lib/compile/errors.ts | 184 - node_modules/ajv/lib/compile/index.ts | 324 - node_modules/ajv/lib/compile/jtd/parse.ts | 411 - node_modules/ajv/lib/compile/jtd/serialize.ts | 266 - node_modules/ajv/lib/compile/jtd/types.ts | 16 - node_modules/ajv/lib/compile/names.ts | 27 - node_modules/ajv/lib/compile/ref_error.ts | 13 - node_modules/ajv/lib/compile/resolve.ts | 149 - node_modules/ajv/lib/compile/rules.ts | 50 - node_modules/ajv/lib/compile/util.ts | 213 - .../ajv/lib/compile/validate/applicability.ts | 22 - .../ajv/lib/compile/validate/boolSchema.ts | 47 - .../ajv/lib/compile/validate/dataType.ts | 229 - .../ajv/lib/compile/validate/defaults.ts | 32 - .../ajv/lib/compile/validate/index.ts | 582 - .../ajv/lib/compile/validate/keyword.ts | 171 - .../ajv/lib/compile/validate/subschema.ts | 135 - node_modules/ajv/lib/core.ts | 887 -- node_modules/ajv/lib/jtd.ts | 131 - node_modules/ajv/lib/refs/data.json | 13 - .../ajv/lib/refs/json-schema-2019-09/index.ts | 28 - .../json-schema-2019-09/meta/applicator.json | 53 - .../json-schema-2019-09/meta/content.json | 17 - .../refs/json-schema-2019-09/meta/core.json | 57 - .../refs/json-schema-2019-09/meta/format.json | 14 - .../json-schema-2019-09/meta/meta-data.json | 37 - .../json-schema-2019-09/meta/validation.json | 90 - .../lib/refs/json-schema-2019-09/schema.json | 39 - .../ajv/lib/refs/json-schema-2020-12/index.ts | 30 - .../json-schema-2020-12/meta/applicator.json | 48 - .../json-schema-2020-12/meta/content.json | 17 - .../refs/json-schema-2020-12/meta/core.json | 51 - .../meta/format-annotation.json | 14 - .../json-schema-2020-12/meta/meta-data.json | 37 - .../json-schema-2020-12/meta/unevaluated.json | 15 - .../json-schema-2020-12/meta/validation.json | 90 - .../lib/refs/json-schema-2020-12/schema.json | 55 - .../ajv/lib/refs/json-schema-draft-06.json | 137 - .../ajv/lib/refs/json-schema-draft-07.json | 151 - .../ajv/lib/refs/json-schema-secure.json | 88 - node_modules/ajv/lib/refs/jtd-schema.ts | 130 - node_modules/ajv/lib/runtime/equal.ts | 7 - node_modules/ajv/lib/runtime/parseJson.ts | 176 - node_modules/ajv/lib/runtime/quote.ts | 31 - node_modules/ajv/lib/runtime/re2.ts | 6 - node_modules/ajv/lib/runtime/timestamp.ts | 46 - node_modules/ajv/lib/runtime/ucs2length.ts | 20 - node_modules/ajv/lib/runtime/uri.ts | 6 - .../ajv/lib/runtime/validation_error.ts | 13 - node_modules/ajv/lib/standalone/index.ts | 100 - node_modules/ajv/lib/standalone/instance.ts | 36 - node_modules/ajv/lib/types/index.ts | 240 - node_modules/ajv/lib/types/json-schema.ts | 187 - node_modules/ajv/lib/types/jtd-schema.ts | 273 - .../applicator/additionalItems.ts | 56 - .../applicator/additionalProperties.ts | 118 - .../ajv/lib/vocabularies/applicator/allOf.ts | 22 - .../ajv/lib/vocabularies/applicator/anyOf.ts | 14 - .../lib/vocabularies/applicator/contains.ts | 109 - .../vocabularies/applicator/dependencies.ts | 112 - .../applicator/dependentSchemas.ts | 11 - .../ajv/lib/vocabularies/applicator/if.ts | 80 - .../ajv/lib/vocabularies/applicator/index.ts | 53 - .../ajv/lib/vocabularies/applicator/items.ts | 59 - .../lib/vocabularies/applicator/items2020.ts | 36 - .../ajv/lib/vocabularies/applicator/not.ts | 38 - .../ajv/lib/vocabularies/applicator/oneOf.ts | 82 - .../applicator/patternProperties.ts | 91 - .../vocabularies/applicator/prefixItems.ts | 12 - .../lib/vocabularies/applicator/properties.ts | 57 - .../vocabularies/applicator/propertyNames.ts | 50 - .../lib/vocabularies/applicator/thenElse.ts | 13 - node_modules/ajv/lib/vocabularies/code.ts | 168 - node_modules/ajv/lib/vocabularies/core/id.ts | 10 - .../ajv/lib/vocabularies/core/index.ts | 16 - node_modules/ajv/lib/vocabularies/core/ref.ts | 129 - .../lib/vocabularies/discriminator/index.ts | 110 - .../lib/vocabularies/discriminator/types.ts | 12 - .../ajv/lib/vocabularies/draft2020.ts | 23 - node_modules/ajv/lib/vocabularies/draft7.ts | 17 - .../lib/vocabularies/dynamic/dynamicAnchor.ts | 31 - .../lib/vocabularies/dynamic/dynamicRef.ts | 51 - .../ajv/lib/vocabularies/dynamic/index.ts | 9 - .../vocabularies/dynamic/recursiveAnchor.ts | 14 - .../lib/vocabularies/dynamic/recursiveRef.ts | 10 - node_modules/ajv/lib/vocabularies/errors.ts | 18 - .../ajv/lib/vocabularies/format/format.ts | 120 - .../ajv/lib/vocabularies/format/index.ts | 6 - .../ajv/lib/vocabularies/jtd/discriminator.ts | 89 - .../ajv/lib/vocabularies/jtd/elements.ts | 32 - node_modules/ajv/lib/vocabularies/jtd/enum.ts | 45 - .../ajv/lib/vocabularies/jtd/error.ts | 23 - .../ajv/lib/vocabularies/jtd/index.ts | 37 - .../ajv/lib/vocabularies/jtd/metadata.ts | 24 - .../ajv/lib/vocabularies/jtd/nullable.ts | 21 - .../vocabularies/jtd/optionalProperties.ts | 15 - .../ajv/lib/vocabularies/jtd/properties.ts | 184 - node_modules/ajv/lib/vocabularies/jtd/ref.ts | 76 - node_modules/ajv/lib/vocabularies/jtd/type.ts | 75 - .../ajv/lib/vocabularies/jtd/union.ts | 12 - .../ajv/lib/vocabularies/jtd/values.ts | 58 - node_modules/ajv/lib/vocabularies/metadata.ts | 17 - node_modules/ajv/lib/vocabularies/next.ts | 8 - .../ajv/lib/vocabularies/unevaluated/index.ts | 7 - .../unevaluated/unevaluatedItems.ts | 47 - .../unevaluated/unevaluatedProperties.ts | 85 - .../ajv/lib/vocabularies/validation/const.ts | 28 - .../validation/dependentRequired.ts | 23 - .../ajv/lib/vocabularies/validation/enum.ts | 54 - .../ajv/lib/vocabularies/validation/index.ts | 49 - .../vocabularies/validation/limitContains.ts | 16 - .../lib/vocabularies/validation/limitItems.ts | 26 - .../vocabularies/validation/limitLength.ts | 30 - .../vocabularies/validation/limitNumber.ts | 42 - .../validation/limitProperties.ts | 26 - .../lib/vocabularies/validation/multipleOf.ts | 34 - .../lib/vocabularies/validation/pattern.ts | 28 - .../lib/vocabularies/validation/required.ts | 98 - .../vocabularies/validation/uniqueItems.ts | 79 - node_modules/ajv/package.json | 126 - node_modules/ansi-regex/index.d.ts | 37 - node_modules/ansi-regex/index.js | 10 - node_modules/ansi-regex/license | 9 - node_modules/ansi-regex/package.json | 55 - node_modules/ansi-regex/readme.md | 78 - node_modules/ansi-styles/index.js | 165 - node_modules/ansi-styles/license | 9 - node_modules/ansi-styles/package.json | 56 - node_modules/ansi-styles/readme.md | 147 - node_modules/argparse/CHANGELOG.md | 216 - node_modules/argparse/LICENSE | 254 - node_modules/argparse/README.md | 84 - node_modules/argparse/argparse.js | 3707 ------- node_modules/argparse/lib/sub.js | 67 - node_modules/argparse/lib/textwrap.js | 440 - node_modules/argparse/package.json | 31 - node_modules/array-union/index.d.ts | 25 - node_modules/array-union/index.js | 5 - node_modules/array-union/license | 9 - node_modules/array-union/package.json | 38 - node_modules/array-union/readme.md | 34 - node_modules/arrify/index.js | 8 - node_modules/arrify/license | 21 - node_modules/arrify/package.json | 33 - node_modules/arrify/readme.md | 36 - node_modules/astral-regex/index.d.ts | 28 - node_modules/astral-regex/index.js | 6 - node_modules/astral-regex/license | 9 - node_modules/astral-regex/package.json | 33 - node_modules/astral-regex/readme.md | 46 - .../balanced-match/.github/FUNDING.yml | 2 - node_modules/balanced-match/LICENSE.md | 21 - node_modules/balanced-match/README.md | 97 - node_modules/balanced-match/index.js | 64 - node_modules/balanced-match/package.json | 52 - node_modules/brace-expansion/LICENSE | 21 - node_modules/brace-expansion/README.md | 129 - node_modules/brace-expansion/index.js | 201 - .../balanced-match/.github/FUNDING.yml | 2 - .../node_modules/balanced-match/LICENSE.md | 21 - .../node_modules/balanced-match/README.md | 97 - .../node_modules/balanced-match/index.js | 62 - .../node_modules/balanced-match/package.json | 48 - node_modules/brace-expansion/package.json | 47 - node_modules/braces/CHANGELOG.md | 184 - node_modules/braces/LICENSE | 21 - node_modules/braces/README.md | 593 - node_modules/braces/index.js | 170 - node_modules/braces/lib/compile.js | 57 - node_modules/braces/lib/constants.js | 57 - node_modules/braces/lib/expand.js | 113 - node_modules/braces/lib/parse.js | 333 - node_modules/braces/lib/stringify.js | 32 - node_modules/braces/lib/utils.js | 112 - node_modules/braces/package.json | 77 - node_modules/callsites/index.d.ts | 96 - node_modules/callsites/index.js | 13 - node_modules/callsites/license | 9 - node_modules/callsites/package.json | 39 - node_modules/callsites/readme.md | 48 - node_modules/camelcase-keys/index.d.ts | 192 - node_modules/camelcase-keys/index.js | 77 - node_modules/camelcase-keys/license | 9 - node_modules/camelcase-keys/package.json | 75 - node_modules/camelcase-keys/readme.md | 125 - node_modules/camelcase/index.d.ts | 103 - node_modules/camelcase/index.js | 113 - node_modules/camelcase/license | 9 - node_modules/camelcase/package.json | 44 - node_modules/camelcase/readme.md | 144 - node_modules/chalk/index.js | 228 - node_modules/chalk/index.js.flow | 93 - node_modules/chalk/license | 9 - node_modules/chalk/package.json | 71 - node_modules/chalk/readme.md | 314 - node_modules/chalk/templates.js | 128 - node_modules/chalk/types/index.d.ts | 97 - node_modules/color-convert/CHANGELOG.md | 54 - node_modules/color-convert/LICENSE | 21 - node_modules/color-convert/README.md | 68 - node_modules/color-convert/conversions.js | 868 -- node_modules/color-convert/index.js | 78 - node_modules/color-convert/package.json | 46 - node_modules/color-convert/route.js | 97 - node_modules/color-name/.eslintrc.json | 43 - node_modules/color-name/.npmignore | 107 - node_modules/color-name/LICENSE | 8 - node_modules/color-name/README.md | 11 - node_modules/color-name/index.js | 152 - node_modules/color-name/package.json | 25 - node_modules/color-name/test.js | 7 - node_modules/colord/CHANGELOG.md | 188 - node_modules/colord/LICENSE.md | 21 - node_modules/colord/README.md | 1053 -- node_modules/colord/colord.d.ts | 103 - node_modules/colord/constants.d.ts | 10 - node_modules/colord/extend.d.ts | 4 - node_modules/colord/helpers.d.ts | 20 - node_modules/colord/index.d.ts | 5 - node_modules/colord/index.js | 1 - node_modules/colord/index.mjs | 1 - node_modules/colord/package.json | 210 - node_modules/colord/parse.d.ts | 8 - node_modules/colord/plugins/a11y.d.ts | 38 - node_modules/colord/plugins/a11y.js | 1 - node_modules/colord/plugins/a11y.mjs | 1 - node_modules/colord/plugins/cmyk.d.ts | 24 - node_modules/colord/plugins/cmyk.js | 1 - node_modules/colord/plugins/cmyk.mjs | 1 - node_modules/colord/plugins/harmonies.d.ts | 16 - node_modules/colord/plugins/harmonies.js | 1 - node_modules/colord/plugins/harmonies.mjs | 1 - node_modules/colord/plugins/hwb.d.ts | 23 - node_modules/colord/plugins/hwb.js | 1 - node_modules/colord/plugins/hwb.mjs | 1 - node_modules/colord/plugins/lab.d.ts | 23 - node_modules/colord/plugins/lab.js | 1 - node_modules/colord/plugins/lab.mjs | 1 - node_modules/colord/plugins/lch.d.ts | 24 - node_modules/colord/plugins/lch.js | 1 - node_modules/colord/plugins/lch.mjs | 1 - node_modules/colord/plugins/minify.d.ts | 20 - node_modules/colord/plugins/minify.js | 1 - node_modules/colord/plugins/minify.mjs | 1 - node_modules/colord/plugins/mix.d.ts | 27 - node_modules/colord/plugins/mix.js | 1 - node_modules/colord/plugins/mix.mjs | 1 - node_modules/colord/plugins/names.d.ts | 19 - node_modules/colord/plugins/names.js | 1 - node_modules/colord/plugins/names.mjs | 1 - node_modules/colord/plugins/xyz.d.ts | 14 - node_modules/colord/plugins/xyz.js | 1 - node_modules/colord/plugins/xyz.mjs | 1 - node_modules/colord/random.d.ts | 2 - node_modules/colord/types.d.ts | 67 - node_modules/concat-map/.travis.yml | 4 - node_modules/concat-map/LICENSE | 18 - node_modules/concat-map/README.markdown | 62 - node_modules/concat-map/example/map.js | 6 - node_modules/concat-map/index.js | 13 - node_modules/concat-map/package.json | 43 - node_modules/concat-map/test/map.js | 39 - node_modules/cosmiconfig/LICENSE | 22 - node_modules/cosmiconfig/README.md | 688 -- node_modules/cosmiconfig/dist/Explorer.d.ts | 15 - .../cosmiconfig/dist/Explorer.d.ts.map | 1 - node_modules/cosmiconfig/dist/Explorer.js | 129 - node_modules/cosmiconfig/dist/Explorer.js.map | 1 - .../cosmiconfig/dist/ExplorerBase.d.ts | 21 - .../cosmiconfig/dist/ExplorerBase.d.ts.map | 1 - node_modules/cosmiconfig/dist/ExplorerBase.js | 152 - .../cosmiconfig/dist/ExplorerBase.js.map | 1 - .../cosmiconfig/dist/ExplorerSync.d.ts | 15 - .../cosmiconfig/dist/ExplorerSync.d.ts.map | 1 - node_modules/cosmiconfig/dist/ExplorerSync.js | 129 - .../cosmiconfig/dist/ExplorerSync.js.map | 1 - .../cosmiconfig/dist/cacheWrapper.d.ts | 5 - .../cosmiconfig/dist/cacheWrapper.d.ts.map | 1 - node_modules/cosmiconfig/dist/cacheWrapper.js | 32 - .../cosmiconfig/dist/cacheWrapper.js.map | 1 - .../cosmiconfig/dist/canUseDynamicImport.d.ts | 3 - .../dist/canUseDynamicImport.d.ts.map | 1 - .../cosmiconfig/dist/canUseDynamicImport.js | 23 - .../dist/canUseDynamicImport.js.map | 1 - .../cosmiconfig/dist/getDirectory.d.ts | 4 - .../cosmiconfig/dist/getDirectory.d.ts.map | 1 - node_modules/cosmiconfig/dist/getDirectory.js | 38 - .../cosmiconfig/dist/getDirectory.js.map | 1 - .../cosmiconfig/dist/getPropertyByPath.d.ts | 5 - .../dist/getPropertyByPath.d.ts.map | 1 - .../cosmiconfig/dist/getPropertyByPath.js | 28 - .../cosmiconfig/dist/getPropertyByPath.js.map | 1 - node_modules/cosmiconfig/dist/index.d.ts | 56 - node_modules/cosmiconfig/dist/index.d.ts.map | 1 - node_modules/cosmiconfig/dist/index.js | 157 - node_modules/cosmiconfig/dist/index.js.map | 1 - node_modules/cosmiconfig/dist/loaders.d.ts | 4 - .../cosmiconfig/dist/loaders.d.ts.map | 1 - node_modules/cosmiconfig/dist/loaders.js | 72 - node_modules/cosmiconfig/dist/loaders.js.map | 1 - node_modules/cosmiconfig/dist/readFile.d.ts | 7 - .../cosmiconfig/dist/readFile.d.ts.map | 1 - node_modules/cosmiconfig/dist/readFile.js | 56 - node_modules/cosmiconfig/dist/readFile.js.map | 1 - node_modules/cosmiconfig/dist/types.d.ts | 24 - node_modules/cosmiconfig/dist/types.d.ts.map | 1 - node_modules/cosmiconfig/dist/types.js | 6 - node_modules/cosmiconfig/dist/types.js.map | 1 - node_modules/cosmiconfig/package.json | 130 - node_modules/css-functions-list/CHANGELOG.md | 53 - node_modules/css-functions-list/LICENSE.md | 18 - node_modules/css-functions-list/README.md | 64 - .../css-functions-list/cjs/index.d.ts | 6 - .../css-functions-list/cjs/index.d.ts.map | 1 - node_modules/css-functions-list/cjs/index.js | 11 - .../css-functions-list/cjs/index.js.map | 1 - .../css-functions-list/cjs/index.json | 622 -- .../css-functions-list/cjs/package.json | 1 - .../css-functions-list/esm/index.d.ts | 6 - .../css-functions-list/esm/index.d.ts.map | 1 - node_modules/css-functions-list/esm/index.js | 9 - .../css-functions-list/esm/index.js.map | 1 - .../css-functions-list/esm/index.json | 622 -- .../css-functions-list/esm/package.json | 1 - node_modules/css-functions-list/package.json | 88 - node_modules/css-tree/LICENSE | 19 - node_modules/css-tree/README.md | 193 - .../css-tree/cjs/convertor/create.cjs | 32 - node_modules/css-tree/cjs/convertor/index.cjs | 8 - node_modules/css-tree/cjs/data-patch.cjs | 7 - node_modules/css-tree/cjs/data.cjs | 99 - .../cjs/definition-syntax/SyntaxError.cjs | 16 - .../cjs/definition-syntax/generate.cjs | 135 - .../css-tree/cjs/definition-syntax/index.cjs | 13 - .../css-tree/cjs/definition-syntax/parse.cjs | 588 - .../cjs/definition-syntax/tokenizer.cjs | 56 - .../css-tree/cjs/definition-syntax/walk.cjs | 56 - .../css-tree/cjs/generator/create.cjs | 103 - node_modules/css-tree/cjs/generator/index.cjs | 8 - .../css-tree/cjs/generator/sourceMap.cjs | 96 - .../css-tree/cjs/generator/token-before.cjs | 170 - node_modules/css-tree/cjs/index.cjs | 63 - node_modules/css-tree/cjs/lexer/Lexer.cjs | 470 - node_modules/css-tree/cjs/lexer/error.cjs | 128 - .../css-tree/cjs/lexer/generic-an-plus-b.cjs | 235 - .../css-tree/cjs/lexer/generic-const.cjs | 12 - .../css-tree/cjs/lexer/generic-urange.cjs | 149 - node_modules/css-tree/cjs/lexer/generic.cjs | 573 - node_modules/css-tree/cjs/lexer/index.cjs | 7 - .../css-tree/cjs/lexer/match-graph.cjs | 459 - node_modules/css-tree/cjs/lexer/match.cjs | 632 -- .../css-tree/cjs/lexer/prepare-tokens.cjs | 54 - node_modules/css-tree/cjs/lexer/search.cjs | 65 - node_modules/css-tree/cjs/lexer/structure.cjs | 168 - node_modules/css-tree/cjs/lexer/trace.cjs | 73 - node_modules/css-tree/cjs/lexer/units.cjs | 38 - .../css-tree/cjs/parser/SyntaxError.cjs | 69 - node_modules/css-tree/cjs/parser/create.cjs | 336 - node_modules/css-tree/cjs/parser/index.cjs | 8 - .../css-tree/cjs/parser/parse-selector.cjs | 8 - node_modules/css-tree/cjs/parser/sequence.cjs | 47 - .../css-tree/cjs/syntax/atrule/font-face.cjs | 12 - .../css-tree/cjs/syntax/atrule/import.cjs | 37 - .../css-tree/cjs/syntax/atrule/index.cjs | 19 - .../css-tree/cjs/syntax/atrule/media.cjs | 16 - .../css-tree/cjs/syntax/atrule/nest.cjs | 16 - .../css-tree/cjs/syntax/atrule/page.cjs | 16 - .../css-tree/cjs/syntax/atrule/supports.cjs | 77 - .../css-tree/cjs/syntax/config/generator.cjs | 9 - .../css-tree/cjs/syntax/config/lexer.cjs | 12 - .../css-tree/cjs/syntax/config/mix.cjs | 119 - .../cjs/syntax/config/parser-selector.cjs | 19 - .../css-tree/cjs/syntax/config/parser.cjs | 34 - .../css-tree/cjs/syntax/config/walker.cjs | 9 - node_modules/css-tree/cjs/syntax/create.cjs | 57 - .../cjs/syntax/function/expression.cjs | 11 - .../css-tree/cjs/syntax/function/var.cjs | 43 - node_modules/css-tree/cjs/syntax/index.cjs | 14 - .../css-tree/cjs/syntax/node/AnPlusB.cjs | 293 - .../css-tree/cjs/syntax/node/Atrule.cjs | 103 - .../cjs/syntax/node/AtrulePrelude.cjs | 52 - .../cjs/syntax/node/AttributeSelector.cjs | 148 - .../css-tree/cjs/syntax/node/Block.cjs | 96 - .../css-tree/cjs/syntax/node/Brackets.cjs | 38 - node_modules/css-tree/cjs/syntax/node/CDC.cjs | 26 - node_modules/css-tree/cjs/syntax/node/CDO.cjs | 26 - .../cjs/syntax/node/ClassSelector.cjs | 31 - .../css-tree/cjs/syntax/node/Combinator.cjs | 61 - .../css-tree/cjs/syntax/node/Comment.cjs | 40 - .../css-tree/cjs/syntax/node/Condition.cjs | 127 - .../css-tree/cjs/syntax/node/Declaration.cjs | 166 - .../cjs/syntax/node/DeclarationList.cjs | 62 - .../css-tree/cjs/syntax/node/Dimension.cjs | 30 - .../css-tree/cjs/syntax/node/Feature.cjs | 78 - .../css-tree/cjs/syntax/node/FeatureRange.cjs | 114 - .../css-tree/cjs/syntax/node/Function.cjs | 45 - .../cjs/syntax/node/GeneralEnclosed.cjs | 51 - .../css-tree/cjs/syntax/node/Hash.cjs | 30 - .../css-tree/cjs/syntax/node/IdSelector.cjs | 33 - .../css-tree/cjs/syntax/node/Identifier.cjs | 25 - .../cjs/syntax/node/MediaCondition.cjs | 70 - .../css-tree/cjs/syntax/node/MediaFeature.cjs | 76 - .../cjs/syntax/node/MediaFeatureRange.cjs | 11 - .../css-tree/cjs/syntax/node/MediaQuery.cjs | 61 - .../cjs/syntax/node/MediaQueryList.cjs | 41 - .../cjs/syntax/node/NestingSelector.cjs | 29 - node_modules/css-tree/cjs/syntax/node/Nth.cjs | 54 - .../css-tree/cjs/syntax/node/Number.cjs | 25 - .../css-tree/cjs/syntax/node/Operator.cjs | 28 - .../css-tree/cjs/syntax/node/Parentheses.cjs | 38 - .../css-tree/cjs/syntax/node/Percentage.cjs | 25 - .../cjs/syntax/node/PseudoClassSelector.cjs | 65 - .../cjs/syntax/node/PseudoElementSelector.cjs | 67 - .../css-tree/cjs/syntax/node/Ratio.cjs | 67 - node_modules/css-tree/cjs/syntax/node/Raw.cjs | 48 - .../css-tree/cjs/syntax/node/Rule.cjs | 58 - .../css-tree/cjs/syntax/node/Selector.cjs | 39 - .../css-tree/cjs/syntax/node/SelectorList.cjs | 43 - .../css-tree/cjs/syntax/node/String.cjs | 26 - .../css-tree/cjs/syntax/node/StyleSheet.cjs | 83 - .../css-tree/cjs/syntax/node/TypeSelector.cjs | 59 - .../css-tree/cjs/syntax/node/UnicodeRange.cjs | 158 - node_modules/css-tree/cjs/syntax/node/Url.cjs | 54 - .../css-tree/cjs/syntax/node/Value.cjs | 26 - .../css-tree/cjs/syntax/node/WhiteSpace.cjs | 34 - .../cjs/syntax/node/common/feature-range.cjs | 112 - .../cjs/syntax/node/common/feature.cjs | 76 - .../cjs/syntax/node/index-generate.cjs | 87 - .../cjs/syntax/node/index-parse-selector.cjs | 37 - .../css-tree/cjs/syntax/node/index-parse.cjs | 87 - .../css-tree/cjs/syntax/node/index.cjs | 87 - .../css-tree/cjs/syntax/pseudo/index.cjs | 54 - .../cjs/syntax/scope/atrulePrelude.cjs | 9 - .../css-tree/cjs/syntax/scope/default.cjs | 76 - .../css-tree/cjs/syntax/scope/index.cjs | 11 - .../css-tree/cjs/syntax/scope/selector.cjs | 88 - .../css-tree/cjs/syntax/scope/value.cjs | 29 - .../cjs/tokenizer/OffsetToLocation.cjs | 91 - .../css-tree/cjs/tokenizer/TokenStream.cjs | 264 - .../css-tree/cjs/tokenizer/adopt-buffer.cjs | 13 - .../cjs/tokenizer/char-code-definitions.cjs | 231 - node_modules/css-tree/cjs/tokenizer/index.cjs | 554 - node_modules/css-tree/cjs/tokenizer/names.cjs | 31 - node_modules/css-tree/cjs/tokenizer/types.cjs | 57 - node_modules/css-tree/cjs/tokenizer/utils.cjs | 261 - node_modules/css-tree/cjs/utils/List.cjs | 473 - node_modules/css-tree/cjs/utils/clone.cjs | 25 - .../cjs/utils/create-custom-error.cjs | 18 - node_modules/css-tree/cjs/utils/ident.cjs | 102 - node_modules/css-tree/cjs/utils/index.cjs | 20 - node_modules/css-tree/cjs/utils/names.cjs | 113 - node_modules/css-tree/cjs/utils/string.cjs | 99 - node_modules/css-tree/cjs/utils/url.cjs | 108 - node_modules/css-tree/cjs/version.cjs | 5 - node_modules/css-tree/cjs/walker/create.cjs | 291 - node_modules/css-tree/cjs/walker/index.cjs | 8 - node_modules/css-tree/data/patch.json | 725 -- node_modules/css-tree/dist/csstree.esm.js | 11 - node_modules/css-tree/dist/csstree.js | 11 - node_modules/css-tree/dist/data.cjs | 1145 -- node_modules/css-tree/dist/data.js | 1145 -- node_modules/css-tree/dist/version.cjs | 1 - node_modules/css-tree/dist/version.js | 1 - node_modules/css-tree/lib/convertor/create.js | 28 - node_modules/css-tree/lib/convertor/index.js | 4 - node_modules/css-tree/lib/data-patch.js | 6 - node_modules/css-tree/lib/data.js | 97 - .../lib/definition-syntax/SyntaxError.js | 12 - .../lib/definition-syntax/generate.js | 131 - .../css-tree/lib/definition-syntax/index.js | 4 - .../css-tree/lib/definition-syntax/parse.js | 584 - .../lib/definition-syntax/tokenizer.js | 52 - .../css-tree/lib/definition-syntax/walk.js | 52 - node_modules/css-tree/lib/generator/create.js | 98 - node_modules/css-tree/lib/generator/index.js | 4 - .../css-tree/lib/generator/sourceMap.js | 92 - .../css-tree/lib/generator/token-before.js | 182 - node_modules/css-tree/lib/index.js | 30 - node_modules/css-tree/lib/lexer/Lexer.js | 464 - node_modules/css-tree/lib/lexer/error.js | 123 - .../css-tree/lib/lexer/generic-an-plus-b.js | 238 - .../css-tree/lib/lexer/generic-const.js | 8 - .../css-tree/lib/lexer/generic-urange.js | 151 - node_modules/css-tree/lib/lexer/generic.js | 606 -- node_modules/css-tree/lib/lexer/index.js | 1 - .../css-tree/lib/lexer/match-graph.js | 456 - node_modules/css-tree/lib/lexer/match.js | 630 -- .../css-tree/lib/lexer/prepare-tokens.js | 50 - node_modules/css-tree/lib/lexer/search.js | 61 - node_modules/css-tree/lib/lexer/structure.js | 164 - node_modules/css-tree/lib/lexer/trace.js | 66 - node_modules/css-tree/lib/lexer/units.js | 27 - .../css-tree/lib/parser/SyntaxError.js | 65 - node_modules/css-tree/lib/parser/create.js | 346 - node_modules/css-tree/lib/parser/index.js | 4 - .../css-tree/lib/parser/parse-selector.js | 4 - node_modules/css-tree/lib/parser/sequence.js | 43 - .../css-tree/lib/syntax/atrule/font-face.js | 8 - .../css-tree/lib/syntax/atrule/import.js | 39 - .../css-tree/lib/syntax/atrule/index.js | 15 - .../css-tree/lib/syntax/atrule/media.js | 12 - .../css-tree/lib/syntax/atrule/nest.js | 12 - .../css-tree/lib/syntax/atrule/page.js | 12 - .../css-tree/lib/syntax/atrule/supports.js | 80 - .../css-tree/lib/syntax/config/generator.js | 5 - .../css-tree/lib/syntax/config/lexer.js | 8 - .../css-tree/lib/syntax/config/mix.js | 115 - .../lib/syntax/config/parser-selector.js | 15 - .../css-tree/lib/syntax/config/parser.js | 30 - .../css-tree/lib/syntax/config/walker.js | 5 - node_modules/css-tree/lib/syntax/create.js | 54 - .../lib/syntax/function/expression.js | 7 - .../css-tree/lib/syntax/function/var.js | 39 - node_modules/css-tree/lib/syntax/index.js | 10 - .../css-tree/lib/syntax/node/AnPlusB.js | 292 - .../css-tree/lib/syntax/node/Atrule.js | 100 - .../css-tree/lib/syntax/node/AtrulePrelude.js | 47 - .../lib/syntax/node/AttributeSelector.js | 147 - .../css-tree/lib/syntax/node/Block.js | 95 - .../css-tree/lib/syntax/node/Brackets.js | 35 - node_modules/css-tree/lib/syntax/node/CDC.js | 19 - node_modules/css-tree/lib/syntax/node/CDO.js | 19 - .../css-tree/lib/syntax/node/ClassSelector.js | 24 - .../css-tree/lib/syntax/node/Combinator.js | 54 - .../css-tree/lib/syntax/node/Comment.js | 33 - .../css-tree/lib/syntax/node/Declaration.js | 165 - .../lib/syntax/node/DeclarationList.js | 62 - .../css-tree/lib/syntax/node/Dimension.js | 23 - .../css-tree/lib/syntax/node/Function.js | 41 - node_modules/css-tree/lib/syntax/node/Hash.js | 23 - .../css-tree/lib/syntax/node/IdSelector.js | 26 - .../css-tree/lib/syntax/node/Identifier.js | 18 - .../css-tree/lib/syntax/node/MediaFeature.js | 77 - .../css-tree/lib/syntax/node/MediaQuery.js | 60 - .../lib/syntax/node/MediaQueryList.js | 34 - .../lib/syntax/node/NestingSelector.js | 22 - node_modules/css-tree/lib/syntax/node/Nth.js | 47 - .../css-tree/lib/syntax/node/Number.js | 18 - .../css-tree/lib/syntax/node/Operator.js | 21 - .../css-tree/lib/syntax/node/Parentheses.js | 34 - .../css-tree/lib/syntax/node/Percentage.js | 18 - .../lib/syntax/node/PseudoClassSelector.js | 63 - .../lib/syntax/node/PseudoElementSelector.js | 64 - .../css-tree/lib/syntax/node/Ratio.js | 59 - node_modules/css-tree/lib/syntax/node/Raw.js | 41 - node_modules/css-tree/lib/syntax/node/Rule.js | 51 - .../css-tree/lib/syntax/node/Selector.js | 32 - .../css-tree/lib/syntax/node/SelectorList.js | 35 - .../css-tree/lib/syntax/node/String.js | 19 - .../css-tree/lib/syntax/node/StyleSheet.js | 82 - .../css-tree/lib/syntax/node/TypeSelector.js | 52 - .../css-tree/lib/syntax/node/UnicodeRange.js | 156 - node_modules/css-tree/lib/syntax/node/Url.js | 52 - .../css-tree/lib/syntax/node/Value.js | 19 - .../css-tree/lib/syntax/node/WhiteSpace.js | 27 - .../lib/syntax/node/index-generate.js | 41 - .../lib/syntax/node/index-parse-selector.js | 16 - .../css-tree/lib/syntax/node/index-parse.js | 41 - .../css-tree/lib/syntax/node/index.js | 41 - .../css-tree/lib/syntax/pseudo/index.js | 50 - .../lib/syntax/scope/atrulePrelude.js | 5 - .../css-tree/lib/syntax/scope/default.js | 85 - .../css-tree/lib/syntax/scope/index.js | 3 - .../css-tree/lib/syntax/scope/selector.js | 94 - .../css-tree/lib/syntax/scope/value.js | 25 - .../lib/tokenizer/OffsetToLocation.js | 87 - .../css-tree/lib/tokenizer/TokenStream.js | 272 - .../css-tree/lib/tokenizer/adopt-buffer.js | 9 - .../lib/tokenizer/char-code-definitions.js | 207 - node_modules/css-tree/lib/tokenizer/index.js | 513 - node_modules/css-tree/lib/tokenizer/names.js | 27 - node_modules/css-tree/lib/tokenizer/types.js | 28 - node_modules/css-tree/lib/tokenizer/utils.js | 254 - node_modules/css-tree/lib/utils/List.js | 469 - node_modules/css-tree/lib/utils/clone.js | 21 - .../css-tree/lib/utils/create-custom-error.js | 14 - node_modules/css-tree/lib/utils/ident.js | 101 - node_modules/css-tree/lib/utils/index.js | 6 - node_modules/css-tree/lib/utils/names.js | 106 - node_modules/css-tree/lib/utils/string.js | 99 - node_modules/css-tree/lib/utils/url.js | 108 - node_modules/css-tree/lib/version.js | 5 - node_modules/css-tree/lib/walker/create.js | 287 - node_modules/css-tree/lib/walker/index.js | 4 - node_modules/css-tree/package.json | 126 - node_modules/cssesc/LICENSE-MIT.txt | 20 - node_modules/cssesc/README.md | 201 - node_modules/cssesc/bin/cssesc | 116 - node_modules/cssesc/cssesc.js | 110 - node_modules/cssesc/man/cssesc.1 | 70 - node_modules/cssesc/package.json | 51 - node_modules/debug/LICENSE | 20 - node_modules/debug/README.md | 481 - node_modules/debug/package.json | 59 - node_modules/debug/src/browser.js | 269 - node_modules/debug/src/common.js | 274 - node_modules/debug/src/index.js | 10 - node_modules/debug/src/node.js | 263 - node_modules/decamelize-keys/index.js | 19 - node_modules/decamelize-keys/license | 21 - .../node_modules/decamelize/index.js | 13 - .../node_modules/decamelize/license | 21 - .../node_modules/decamelize/package.json | 38 - .../node_modules/decamelize/readme.md | 48 - .../node_modules/map-obj/index.js | 13 - .../node_modules/map-obj/license | 21 - .../node_modules/map-obj/package.json | 36 - .../node_modules/map-obj/readme.md | 29 - node_modules/decamelize-keys/package.json | 63 - node_modules/decamelize-keys/readme.md | 69 - node_modules/decamelize/index.d.ts | 59 - node_modules/decamelize/index.js | 65 - node_modules/decamelize/license | 9 - node_modules/decamelize/package.json | 40 - node_modules/decamelize/readme.md | 92 - node_modules/dir-glob/index.js | 75 - node_modules/dir-glob/license | 9 - node_modules/dir-glob/package.json | 38 - node_modules/dir-glob/readme.md | 76 - node_modules/emoji-regex/LICENSE-MIT.txt | 20 - node_modules/emoji-regex/README.md | 73 - node_modules/emoji-regex/es2015/index.js | 6 - node_modules/emoji-regex/es2015/text.js | 6 - node_modules/emoji-regex/index.d.ts | 23 - node_modules/emoji-regex/index.js | 6 - node_modules/emoji-regex/package.json | 50 - node_modules/emoji-regex/text.js | 6 - node_modules/error-ex/LICENSE | 21 - node_modules/error-ex/README.md | 144 - node_modules/error-ex/index.js | 141 - node_modules/error-ex/package.json | 46 - node_modules/escape-string-regexp/index.js | 11 - node_modules/escape-string-regexp/license | 21 - .../escape-string-regexp/package.json | 41 - node_modules/escape-string-regexp/readme.md | 27 - node_modules/fast-deep-equal/LICENSE | 21 - node_modules/fast-deep-equal/README.md | 96 - node_modules/fast-deep-equal/es6/index.d.ts | 2 - node_modules/fast-deep-equal/es6/index.js | 72 - node_modules/fast-deep-equal/es6/react.d.ts | 2 - node_modules/fast-deep-equal/es6/react.js | 79 - node_modules/fast-deep-equal/index.d.ts | 4 - node_modules/fast-deep-equal/index.js | 46 - node_modules/fast-deep-equal/package.json | 61 - node_modules/fast-deep-equal/react.d.ts | 2 - node_modules/fast-deep-equal/react.js | 53 - node_modules/fast-glob/LICENSE | 21 - node_modules/fast-glob/README.md | 859 -- node_modules/fast-glob/out/index.d.ts | 40 - node_modules/fast-glob/out/index.js | 102 - .../fast-glob/out/managers/tasks.d.ts | 22 - node_modules/fast-glob/out/managers/tasks.js | 110 - .../fast-glob/out/providers/async.d.ts | 9 - node_modules/fast-glob/out/providers/async.js | 23 - .../fast-glob/out/providers/filters/deep.d.ts | 16 - .../fast-glob/out/providers/filters/deep.js | 62 - .../out/providers/filters/entry.d.ts | 16 - .../fast-glob/out/providers/filters/entry.js | 63 - .../out/providers/filters/error.d.ts | 8 - .../fast-glob/out/providers/filters/error.js | 15 - .../out/providers/matchers/matcher.d.ts | 33 - .../out/providers/matchers/matcher.js | 45 - .../out/providers/matchers/partial.d.ts | 4 - .../out/providers/matchers/partial.js | 38 - .../fast-glob/out/providers/provider.d.ts | 19 - .../fast-glob/out/providers/provider.js | 48 - .../fast-glob/out/providers/stream.d.ts | 11 - .../fast-glob/out/providers/stream.js | 31 - .../fast-glob/out/providers/sync.d.ts | 9 - node_modules/fast-glob/out/providers/sync.js | 23 - .../out/providers/transformers/entry.d.ts | 8 - .../out/providers/transformers/entry.js | 26 - node_modules/fast-glob/out/readers/async.d.ts | 10 - node_modules/fast-glob/out/readers/async.js | 35 - .../fast-glob/out/readers/reader.d.ts | 15 - node_modules/fast-glob/out/readers/reader.js | 33 - .../fast-glob/out/readers/stream.d.ts | 14 - node_modules/fast-glob/out/readers/stream.js | 55 - node_modules/fast-glob/out/readers/sync.d.ts | 12 - node_modules/fast-glob/out/readers/sync.js | 43 - node_modules/fast-glob/out/settings.d.ts | 164 - node_modules/fast-glob/out/settings.js | 57 - node_modules/fast-glob/out/types/index.d.ts | 31 - node_modules/fast-glob/out/types/index.js | 2 - node_modules/fast-glob/out/utils/array.d.ts | 2 - node_modules/fast-glob/out/utils/array.js | 22 - node_modules/fast-glob/out/utils/errno.d.ts | 2 - node_modules/fast-glob/out/utils/errno.js | 7 - node_modules/fast-glob/out/utils/fs.d.ts | 4 - node_modules/fast-glob/out/utils/fs.js | 19 - node_modules/fast-glob/out/utils/index.d.ts | 8 - node_modules/fast-glob/out/utils/index.js | 17 - node_modules/fast-glob/out/utils/path.d.ts | 13 - node_modules/fast-glob/out/utils/path.js | 68 - node_modules/fast-glob/out/utils/pattern.d.ts | 47 - node_modules/fast-glob/out/utils/pattern.js | 188 - node_modules/fast-glob/out/utils/stream.d.ts | 4 - node_modules/fast-glob/out/utils/stream.js | 17 - node_modules/fast-glob/out/utils/string.d.ts | 2 - node_modules/fast-glob/out/utils/string.js | 11 - node_modules/fast-glob/package.json | 81 - .../fastest-levenshtein/.eslintrc.json | 30 - node_modules/fastest-levenshtein/.prettierrc | 4 - node_modules/fastest-levenshtein/.travis.yml | 21 - node_modules/fastest-levenshtein/LICENSE.md | 21 - node_modules/fastest-levenshtein/README.md | 57 - node_modules/fastest-levenshtein/bench.js | 96 - node_modules/fastest-levenshtein/esm/mod.d.ts | 4 - .../fastest-levenshtein/esm/mod.d.ts.map | 1 - node_modules/fastest-levenshtein/esm/mod.js | 138 - node_modules/fastest-levenshtein/mod.d.ts | 3 - node_modules/fastest-levenshtein/mod.js | 142 - node_modules/fastest-levenshtein/package.json | 72 - node_modules/fastest-levenshtein/test.js | 55 - node_modules/fastest-levenshtein/test.ts | 67 - node_modules/fastq/.github/dependabot.yml | 11 - node_modules/fastq/.github/workflows/ci.yml | 50 - node_modules/fastq/LICENSE | 13 - node_modules/fastq/README.md | 309 - node_modules/fastq/bench.js | 66 - node_modules/fastq/example.js | 14 - node_modules/fastq/example.mjs | 11 - node_modules/fastq/index.d.ts | 37 - node_modules/fastq/package.json | 52 - node_modules/fastq/queue.js | 289 - node_modules/fastq/test/example.ts | 81 - node_modules/fastq/test/promise.js | 248 - node_modules/fastq/test/test.js | 566 - node_modules/fastq/test/tsconfig.json | 11 - node_modules/file-entry-cache/LICENSE | 22 - node_modules/file-entry-cache/README.md | 112 - node_modules/file-entry-cache/cache.js | 291 - node_modules/file-entry-cache/changelog.md | 163 - node_modules/file-entry-cache/package.json | 80 - node_modules/fill-range/LICENSE | 21 - node_modules/fill-range/README.md | 237 - node_modules/fill-range/index.js | 249 - node_modules/fill-range/package.json | 69 - node_modules/find-up/index.d.ts | 138 - node_modules/find-up/index.js | 89 - node_modules/find-up/license | 9 - node_modules/find-up/package.json | 54 - node_modules/find-up/readme.md | 151 - node_modules/flat-cache/LICENSE | 22 - node_modules/flat-cache/README.md | 73 - node_modules/flat-cache/changelog.md | 328 - node_modules/flat-cache/package.json | 84 - node_modules/flat-cache/src/cache.js | 197 - node_modules/flat-cache/src/del.js | 13 - node_modules/flat-cache/src/utils.js | 44 - node_modules/flatted/LICENSE | 15 - node_modules/flatted/README.md | 111 - node_modules/flatted/cjs/index.js | 99 - node_modules/flatted/cjs/package.json | 1 - node_modules/flatted/es.js | 2 - node_modules/flatted/esm.js | 2 - node_modules/flatted/esm/index.js | 94 - node_modules/flatted/index.js | 135 - node_modules/flatted/min.js | 2 - node_modules/flatted/package.json | 63 - node_modules/flatted/php/flatted.php | 156 - node_modules/flatted/types.d.ts | 62 - node_modules/fs.realpath/LICENSE | 43 - node_modules/fs.realpath/README.md | 33 - node_modules/fs.realpath/index.js | 66 - node_modules/fs.realpath/old.js | 303 - node_modules/fs.realpath/package.json | 26 - node_modules/function-bind/.editorconfig | 20 - node_modules/function-bind/.eslintrc | 15 - node_modules/function-bind/.jscs.json | 176 - node_modules/function-bind/.npmignore | 22 - node_modules/function-bind/.travis.yml | 168 - node_modules/function-bind/LICENSE | 20 - node_modules/function-bind/README.md | 48 - node_modules/function-bind/implementation.js | 52 - node_modules/function-bind/index.js | 5 - node_modules/function-bind/package.json | 63 - node_modules/function-bind/test/.eslintrc | 9 - node_modules/function-bind/test/index.js | 252 - node_modules/glob-parent/CHANGELOG.md | 110 - node_modules/glob-parent/LICENSE | 15 - node_modules/glob-parent/README.md | 137 - node_modules/glob-parent/index.js | 42 - node_modules/glob-parent/package.json | 48 - node_modules/glob/LICENSE | 21 - node_modules/glob/README.md | 378 - node_modules/glob/common.js | 238 - node_modules/glob/glob.js | 790 -- node_modules/glob/package.json | 55 - node_modules/glob/sync.js | 486 - node_modules/global-modules/LICENSE | 21 - node_modules/global-modules/README.md | 87 - node_modules/global-modules/index.js | 29 - node_modules/global-modules/package.json | 66 - node_modules/global-prefix/LICENSE | 21 - node_modules/global-prefix/README.md | 92 - node_modules/global-prefix/index.js | 85 - node_modules/global-prefix/package.json | 50 - node_modules/globby/gitignore.js | 120 - node_modules/globby/index.d.ts | 186 - node_modules/globby/index.js | 181 - node_modules/globby/license | 9 - node_modules/globby/package.json | 82 - node_modules/globby/readme.md | 170 - node_modules/globby/stream-utils.js | 46 - node_modules/globjoin/CHANGELOG.md | 14 - node_modules/globjoin/LICENSE | 22 - node_modules/globjoin/README.md | 54 - node_modules/globjoin/index.js | 43 - node_modules/globjoin/package.json | 37 - node_modules/hard-rejection/index.d.ts | 15 - node_modules/hard-rejection/index.js | 25 - node_modules/hard-rejection/license | 9 - node_modules/hard-rejection/package.json | 47 - node_modules/hard-rejection/readme.md | 77 - node_modules/hard-rejection/register.js | 2 - node_modules/has-flag/index.js | 8 - node_modules/has-flag/license | 9 - node_modules/has-flag/package.json | 44 - node_modules/has-flag/readme.md | 70 - node_modules/has/LICENSE-MIT | 22 - node_modules/has/README.md | 18 - node_modules/has/package.json | 48 - node_modules/has/src/index.js | 5 - node_modules/has/test/index.js | 10 - node_modules/hosted-git-info/LICENSE | 13 - node_modules/hosted-git-info/README.md | 133 - node_modules/hosted-git-info/git-host-info.js | 184 - node_modules/hosted-git-info/git-host.js | 110 - node_modules/hosted-git-info/index.js | 237 - node_modules/hosted-git-info/package.json | 51 - node_modules/html-tags/html-tags-void.json | 17 - node_modules/html-tags/html-tags.json | 120 - node_modules/html-tags/index.d.ts | 136 - node_modules/html-tags/index.js | 2 - node_modules/html-tags/license | 9 - node_modules/html-tags/package.json | 48 - node_modules/html-tags/readme.md | 35 - node_modules/html-tags/void.d.ts | 33 - node_modules/html-tags/void.js | 2 - node_modules/ignore/LICENSE-MIT | 21 - node_modules/ignore/README.md | 412 - node_modules/ignore/index.d.ts | 61 - node_modules/ignore/index.js | 618 -- node_modules/ignore/legacy.js | 539 - node_modules/ignore/package.json | 73 - node_modules/import-fresh/index.d.ts | 30 - node_modules/import-fresh/index.js | 33 - node_modules/import-fresh/license | 9 - .../node_modules/resolve-from/index.js | 47 - .../node_modules/resolve-from/license | 9 - .../node_modules/resolve-from/package.json | 34 - .../node_modules/resolve-from/readme.md | 72 - node_modules/import-fresh/package.json | 43 - node_modules/import-fresh/readme.md | 48 - node_modules/import-lazy/index.d.ts | 26 - node_modules/import-lazy/index.js | 27 - node_modules/import-lazy/license | 9 - node_modules/import-lazy/package.json | 40 - node_modules/import-lazy/readme.md | 57 - node_modules/imurmurhash/README.md | 122 - node_modules/imurmurhash/imurmurhash.js | 138 - node_modules/imurmurhash/imurmurhash.min.js | 12 - node_modules/imurmurhash/package.json | 40 - node_modules/indent-string/index.d.ts | 38 - node_modules/indent-string/index.js | 38 - node_modules/indent-string/license | 9 - node_modules/indent-string/package.json | 40 - node_modules/indent-string/readme.md | 73 - node_modules/inflight/LICENSE | 15 - node_modules/inflight/README.md | 37 - node_modules/inflight/inflight.js | 54 - node_modules/inflight/package.json | 29 - node_modules/inherits/LICENSE | 16 - node_modules/inherits/README.md | 42 - node_modules/inherits/inherits.js | 9 - node_modules/inherits/inherits_browser.js | 27 - node_modules/inherits/package.json | 29 - node_modules/ini/LICENSE | 15 - node_modules/ini/README.md | 102 - node_modules/ini/ini.js | 206 - node_modules/ini/package.json | 33 - node_modules/is-arrayish/.editorconfig | 18 - node_modules/is-arrayish/.istanbul.yml | 4 - node_modules/is-arrayish/.npmignore | 5 - node_modules/is-arrayish/.travis.yml | 17 - node_modules/is-arrayish/LICENSE | 21 - node_modules/is-arrayish/README.md | 16 - node_modules/is-arrayish/index.js | 10 - node_modules/is-arrayish/package.json | 34 - node_modules/is-core-module/.eslintrc | 18 - node_modules/is-core-module/.nycrc | 9 - node_modules/is-core-module/CHANGELOG.md | 166 - node_modules/is-core-module/LICENSE | 20 - node_modules/is-core-module/README.md | 40 - node_modules/is-core-module/core.json | 158 - node_modules/is-core-module/index.js | 69 - node_modules/is-core-module/package.json | 73 - node_modules/is-core-module/test/index.js | 133 - node_modules/is-extglob/LICENSE | 21 - node_modules/is-extglob/README.md | 107 - node_modules/is-extglob/index.js | 20 - node_modules/is-extglob/package.json | 69 - .../is-fullwidth-code-point/index.d.ts | 17 - node_modules/is-fullwidth-code-point/index.js | 50 - node_modules/is-fullwidth-code-point/license | 9 - .../is-fullwidth-code-point/package.json | 42 - .../is-fullwidth-code-point/readme.md | 39 - node_modules/is-glob/LICENSE | 21 - node_modules/is-glob/README.md | 206 - node_modules/is-glob/index.js | 150 - node_modules/is-glob/package.json | 81 - node_modules/is-number/LICENSE | 21 - node_modules/is-number/README.md | 187 - node_modules/is-number/index.js | 18 - node_modules/is-number/package.json | 82 - node_modules/is-plain-obj/index.js | 7 - node_modules/is-plain-obj/license | 21 - node_modules/is-plain-obj/package.json | 36 - node_modules/is-plain-obj/readme.md | 35 - node_modules/is-plain-object/LICENSE | 21 - node_modules/is-plain-object/README.md | 125 - .../is-plain-object/dist/is-plain-object.js | 38 - .../is-plain-object/dist/is-plain-object.mjs | 34 - .../is-plain-object/is-plain-object.d.ts | 1 - node_modules/is-plain-object/package.json | 85 - node_modules/isexe/.npmignore | 2 - node_modules/isexe/LICENSE | 15 - node_modules/isexe/README.md | 51 - node_modules/isexe/index.js | 57 - node_modules/isexe/mode.js | 41 - node_modules/isexe/package.json | 31 - node_modules/isexe/test/basic.js | 221 - node_modules/isexe/windows.js | 42 - node_modules/js-tokens/CHANGELOG.md | 151 - node_modules/js-tokens/LICENSE | 21 - node_modules/js-tokens/README.md | 240 - node_modules/js-tokens/index.js | 23 - node_modules/js-tokens/package.json | 30 - node_modules/js-yaml/CHANGELOG.md | 616 -- node_modules/js-yaml/LICENSE | 21 - node_modules/js-yaml/README.md | 246 - node_modules/js-yaml/bin/js-yaml.js | 126 - node_modules/js-yaml/dist/js-yaml.js | 3874 ------- node_modules/js-yaml/dist/js-yaml.min.js | 2 - node_modules/js-yaml/dist/js-yaml.mjs | 3851 ------- node_modules/js-yaml/index.js | 47 - node_modules/js-yaml/lib/common.js | 59 - node_modules/js-yaml/lib/dumper.js | 965 -- node_modules/js-yaml/lib/exception.js | 55 - node_modules/js-yaml/lib/loader.js | 1727 --- node_modules/js-yaml/lib/schema.js | 121 - node_modules/js-yaml/lib/schema/core.js | 11 - node_modules/js-yaml/lib/schema/default.js | 22 - node_modules/js-yaml/lib/schema/failsafe.js | 17 - node_modules/js-yaml/lib/schema/json.js | 19 - node_modules/js-yaml/lib/snippet.js | 101 - node_modules/js-yaml/lib/type.js | 66 - node_modules/js-yaml/lib/type/binary.js | 125 - node_modules/js-yaml/lib/type/bool.js | 35 - node_modules/js-yaml/lib/type/float.js | 97 - node_modules/js-yaml/lib/type/int.js | 156 - node_modules/js-yaml/lib/type/map.js | 8 - node_modules/js-yaml/lib/type/merge.js | 12 - node_modules/js-yaml/lib/type/null.js | 35 - node_modules/js-yaml/lib/type/omap.js | 44 - node_modules/js-yaml/lib/type/pairs.js | 53 - node_modules/js-yaml/lib/type/seq.js | 8 - node_modules/js-yaml/lib/type/set.js | 29 - node_modules/js-yaml/lib/type/str.js | 8 - node_modules/js-yaml/lib/type/timestamp.js | 88 - node_modules/js-yaml/package.json | 66 - .../CHANGELOG.md | 50 - .../json-parse-even-better-errors/LICENSE.md | 25 - .../json-parse-even-better-errors/README.md | 96 - .../json-parse-even-better-errors/index.js | 121 - .../package.json | 33 - .../json-schema-traverse/.eslintrc.yml | 27 - .../json-schema-traverse/.github/FUNDING.yml | 2 - .../.github/workflows/build.yml | 28 - .../.github/workflows/publish.yml | 27 - node_modules/json-schema-traverse/LICENSE | 21 - node_modules/json-schema-traverse/README.md | 95 - node_modules/json-schema-traverse/index.d.ts | 40 - node_modules/json-schema-traverse/index.js | 93 - .../json-schema-traverse/package.json | 43 - .../json-schema-traverse/spec/.eslintrc.yml | 6 - .../spec/fixtures/schema.js | 125 - .../json-schema-traverse/spec/index.spec.js | 171 - node_modules/kind-of/CHANGELOG.md | 160 - node_modules/kind-of/LICENSE | 21 - node_modules/kind-of/README.md | 367 - node_modules/kind-of/index.js | 129 - node_modules/kind-of/package.json | 88 - node_modules/known-css-properties/LICENSE | 21 - node_modules/known-css-properties/README.md | 48 - .../known-css-properties/data/all.json | 1219 --- node_modules/known-css-properties/index.d.ts | 3 - node_modules/known-css-properties/index.js | 1 - .../known-css-properties/package.json | 56 - node_modules/lines-and-columns/LICENSE | 21 - node_modules/lines-and-columns/README.md | 33 - .../lines-and-columns/build/index.d.ts | 13 - node_modules/lines-and-columns/build/index.js | 62 - node_modules/lines-and-columns/package.json | 49 - node_modules/locate-path/index.d.ts | 83 - node_modules/locate-path/index.js | 68 - node_modules/locate-path/license | 9 - node_modules/locate-path/package.json | 46 - node_modules/locate-path/readme.md | 125 - node_modules/lodash.truncate/LICENSE | 47 - node_modules/lodash.truncate/README.md | 18 - node_modules/lodash.truncate/index.js | 632 -- node_modules/lodash.truncate/package.json | 17 - node_modules/lru-cache/LICENSE | 15 - node_modules/lru-cache/README.md | 166 - node_modules/lru-cache/index.js | 334 - node_modules/lru-cache/package.json | 34 - node_modules/map-obj/index.d.ts | 151 - node_modules/map-obj/index.js | 68 - node_modules/map-obj/license | 9 - node_modules/map-obj/package.json | 43 - node_modules/map-obj/readme.md | 105 - node_modules/mathml-tag-names/index.json | 204 - node_modules/mathml-tag-names/license | 22 - node_modules/mathml-tag-names/package.json | 74 - node_modules/mathml-tag-names/readme.md | 103 - node_modules/mdn-data/CHANGELOG.md | 66 - node_modules/mdn-data/LICENSE | 116 - node_modules/mdn-data/README.md | 62 - node_modules/mdn-data/api/index.js | 3 - node_modules/mdn-data/api/inheritance.json | 2681 ----- .../mdn-data/api/inheritance.schema.json | 31 - node_modules/mdn-data/css/at-rules.json | 620 -- .../mdn-data/css/at-rules.schema.json | 131 - node_modules/mdn-data/css/definitions.json | 78 - node_modules/mdn-data/css/index.js | 8 - node_modules/mdn-data/css/properties.json | 9626 ----------------- .../mdn-data/css/properties.schema.json | 412 - node_modules/mdn-data/css/readme.md | 32 - node_modules/mdn-data/css/selectors.json | 1044 -- .../mdn-data/css/selectors.schema.json | 36 - node_modules/mdn-data/css/syntaxes.json | 866 -- .../mdn-data/css/syntaxes.schema.json | 15 - node_modules/mdn-data/css/types.json | 265 - node_modules/mdn-data/css/types.schema.json | 32 - node_modules/mdn-data/css/units.json | 213 - node_modules/mdn-data/css/units.schema.json | 28 - node_modules/mdn-data/index.js | 5 - node_modules/mdn-data/l10n/css.json | 1714 --- node_modules/mdn-data/l10n/index.js | 3 - node_modules/mdn-data/package.json | 38 - node_modules/meow/index.d.ts | 317 - node_modules/meow/index.js | 247 - node_modules/meow/license | 9 - node_modules/meow/package.json | 76 - node_modules/meow/readme.md | 321 - node_modules/merge2/LICENSE | 21 - node_modules/merge2/README.md | 144 - node_modules/merge2/index.js | 144 - node_modules/merge2/package.json | 43 - node_modules/micromatch/LICENSE | 21 - node_modules/micromatch/README.md | 1011 -- node_modules/micromatch/index.js | 467 - node_modules/micromatch/package.json | 119 - node_modules/min-indent/index.js | 10 - node_modules/min-indent/license | 22 - node_modules/min-indent/package.json | 38 - node_modules/min-indent/readme.md | 41 - node_modules/minimatch/LICENSE | 15 - node_modules/minimatch/README.md | 230 - node_modules/minimatch/minimatch.js | 947 -- node_modules/minimatch/package.json | 33 - node_modules/minimist-options/index.d.ts | 55 - node_modules/minimist-options/index.js | 117 - node_modules/minimist-options/license | 21 - node_modules/minimist-options/package.json | 34 - node_modules/minimist-options/readme.md | 112 - node_modules/ms/index.js | 162 - node_modules/ms/license.md | 21 - node_modules/ms/package.json | 37 - node_modules/ms/readme.md | 60 - node_modules/nanoid/LICENSE | 20 - node_modules/nanoid/README.md | 39 - node_modules/nanoid/async/index.browser.cjs | 34 - node_modules/nanoid/async/index.browser.js | 34 - node_modules/nanoid/async/index.cjs | 35 - node_modules/nanoid/async/index.d.ts | 56 - node_modules/nanoid/async/index.js | 35 - node_modules/nanoid/async/index.native.js | 26 - node_modules/nanoid/async/package.json | 12 - node_modules/nanoid/bin/nanoid.cjs | 55 - node_modules/nanoid/index.browser.cjs | 34 - node_modules/nanoid/index.browser.js | 34 - node_modules/nanoid/index.cjs | 45 - node_modules/nanoid/index.d.ts | 91 - node_modules/nanoid/index.js | 45 - node_modules/nanoid/nanoid.js | 1 - node_modules/nanoid/non-secure/index.cjs | 21 - node_modules/nanoid/non-secure/index.d.ts | 33 - node_modules/nanoid/non-secure/index.js | 21 - node_modules/nanoid/non-secure/package.json | 6 - node_modules/nanoid/package.json | 66 - node_modules/nanoid/url-alphabet/index.cjs | 3 - node_modules/nanoid/url-alphabet/index.js | 3 - node_modules/nanoid/url-alphabet/package.json | 6 - node_modules/normalize-package-data/AUTHORS | 4 - node_modules/normalize-package-data/LICENSE | 15 - node_modules/normalize-package-data/README.md | 108 - .../lib/extract_description.js | 22 - .../normalize-package-data/lib/fixer.js | 474 - .../lib/make_warning.js | 22 - .../normalize-package-data/lib/normalize.js | 48 - .../normalize-package-data/lib/safe_format.js | 11 - .../normalize-package-data/lib/typos.json | 25 - .../lib/warning_messages.json | 30 - .../normalize-package-data/package.json | 41 - node_modules/normalize-path/LICENSE | 21 - node_modules/normalize-path/README.md | 127 - node_modules/normalize-path/index.js | 35 - node_modules/normalize-path/package.json | 77 - node_modules/once/LICENSE | 15 - node_modules/once/README.md | 79 - node_modules/once/once.js | 42 - node_modules/once/package.json | 33 - node_modules/p-limit/index.d.ts | 42 - node_modules/p-limit/index.js | 71 - node_modules/p-limit/license | 9 - node_modules/p-limit/package.json | 52 - node_modules/p-limit/readme.md | 101 - node_modules/p-locate/index.d.ts | 53 - node_modules/p-locate/index.js | 50 - node_modules/p-locate/license | 9 - node_modules/p-locate/package.json | 54 - node_modules/p-locate/readme.md | 93 - node_modules/parent-module/index.js | 37 - node_modules/parent-module/license | 9 - node_modules/parent-module/package.json | 46 - node_modules/parent-module/readme.md | 67 - node_modules/parse-json/index.js | 54 - node_modules/parse-json/license | 9 - node_modules/parse-json/package.json | 45 - node_modules/parse-json/readme.md | 119 - node_modules/path-exists/index.d.ts | 28 - node_modules/path-exists/index.js | 23 - node_modules/path-exists/license | 9 - node_modules/path-exists/package.json | 39 - node_modules/path-exists/readme.md | 52 - node_modules/path-is-absolute/index.js | 20 - node_modules/path-is-absolute/license | 21 - node_modules/path-is-absolute/package.json | 43 - node_modules/path-is-absolute/readme.md | 59 - node_modules/path-type/index.d.ts | 51 - node_modules/path-type/index.js | 43 - node_modules/path-type/license | 9 - node_modules/path-type/package.json | 45 - node_modules/path-type/readme.md | 72 - node_modules/picocolors/LICENSE | 15 - node_modules/picocolors/README.md | 21 - node_modules/picocolors/package.json | 25 - node_modules/picocolors/picocolors.browser.js | 4 - node_modules/picocolors/picocolors.d.ts | 5 - node_modules/picocolors/picocolors.js | 58 - node_modules/picocolors/types.ts | 30 - node_modules/picomatch/CHANGELOG.md | 136 - node_modules/picomatch/LICENSE | 21 - node_modules/picomatch/README.md | 708 -- node_modules/picomatch/index.js | 3 - node_modules/picomatch/lib/constants.js | 179 - node_modules/picomatch/lib/parse.js | 1091 -- node_modules/picomatch/lib/picomatch.js | 342 - node_modules/picomatch/lib/scan.js | 391 - node_modules/picomatch/lib/utils.js | 64 - node_modules/picomatch/package.json | 81 - .../postcss-media-query-parser/CHANGELOG.md | 20 - .../postcss-media-query-parser/README.md | 173 - .../postcss-media-query-parser/dist/index.js | 43 - .../dist/nodes/Container.js | 94 - .../dist/nodes/Node.js | 18 - .../dist/parsers.js | 367 - .../postcss-media-query-parser/package.json | 60 - .../postcss-resolve-nested-selector/LICENSE | 21 - .../postcss-resolve-nested-selector/README.md | 65 - .../postcss-resolve-nested-selector/index.js | 25 - .../package.json | 20 - node_modules/postcss-safe-parser/LICENSE | 20 - node_modules/postcss-safe-parser/README.md | 34 - .../postcss-safe-parser/lib/safe-parse.js | 12 - .../postcss-safe-parser/lib/safe-parser.js | 99 - node_modules/postcss-safe-parser/package.json | 26 - node_modules/postcss-scss/LICENSE | 20 - node_modules/postcss-scss/README.md | 23 - .../postcss-scss/lib/nested-declaration.js | 12 - node_modules/postcss-scss/lib/scss-parse.js | 12 - node_modules/postcss-scss/lib/scss-parser.js | 201 - .../postcss-scss/lib/scss-stringifier.js | 51 - .../postcss-scss/lib/scss-stringify.js | 6 - .../postcss-scss/lib/scss-syntax.d.ts | 4 - node_modules/postcss-scss/lib/scss-syntax.js | 4 - node_modules/postcss-scss/lib/scss-syntax.mjs | 6 - .../postcss-scss/lib/scss-tokenize.js | 335 - node_modules/postcss-scss/package.json | 47 - node_modules/postcss-selector-parser/API.md | 872 -- .../postcss-selector-parser/CHANGELOG.md | 525 - .../postcss-selector-parser/LICENSE-MIT | 22 - .../postcss-selector-parser/README.md | 49 - .../postcss-selector-parser/dist/index.js | 17 - .../postcss-selector-parser/dist/parser.js | 1012 -- .../postcss-selector-parser/dist/processor.js | 170 - .../dist/selectors/attribute.js | 448 - .../dist/selectors/className.js | 50 - .../dist/selectors/combinator.js | 21 - .../dist/selectors/comment.js | 21 - .../dist/selectors/constructors.js | 65 - .../dist/selectors/container.js | 308 - .../dist/selectors/guards.js | 58 - .../dist/selectors/id.js | 25 - .../dist/selectors/index.js | 21 - .../dist/selectors/namespace.js | 80 - .../dist/selectors/nesting.js | 22 - .../dist/selectors/node.js | 192 - .../dist/selectors/pseudo.js | 26 - .../dist/selectors/root.js | 44 - .../dist/selectors/selector.js | 21 - .../dist/selectors/string.js | 21 - .../dist/selectors/tag.js | 21 - .../dist/selectors/types.js | 28 - .../dist/selectors/universal.js | 22 - .../dist/sortAscending.js | 11 - .../dist/tokenTypes.js | 70 - .../postcss-selector-parser/dist/tokenize.js | 239 - .../dist/util/ensureObject.js | 17 - .../dist/util/getProp.js | 18 - .../dist/util/index.js | 13 - .../dist/util/stripComments.js | 21 - .../dist/util/unesc.js | 76 - .../postcss-selector-parser/package.json | 79 - .../postcss-selector-parser.d.ts | 555 - node_modules/postcss-value-parser/LICENSE | 22 - node_modules/postcss-value-parser/README.md | 263 - .../postcss-value-parser/lib/index.d.ts | 177 - .../postcss-value-parser/lib/index.js | 28 - .../postcss-value-parser/lib/parse.js | 321 - .../postcss-value-parser/lib/stringify.js | 48 - node_modules/postcss-value-parser/lib/unit.js | 120 - node_modules/postcss-value-parser/lib/walk.js | 22 - .../postcss-value-parser/package.json | 58 - node_modules/postcss/LICENSE | 20 - node_modules/postcss/README.md | 44 - node_modules/postcss/lib/at-rule.d.ts | 115 - node_modules/postcss/lib/at-rule.js | 25 - node_modules/postcss/lib/comment.d.ts | 67 - node_modules/postcss/lib/comment.js | 13 - node_modules/postcss/lib/container.d.ts | 451 - node_modules/postcss/lib/container.js | 439 - .../postcss/lib/css-syntax-error.d.ts | 248 - node_modules/postcss/lib/css-syntax-error.js | 100 - node_modules/postcss/lib/declaration.d.ts | 146 - node_modules/postcss/lib/declaration.js | 24 - node_modules/postcss/lib/document.d.ts | 63 - node_modules/postcss/lib/document.js | 33 - node_modules/postcss/lib/fromJSON.d.ts | 9 - node_modules/postcss/lib/fromJSON.js | 54 - node_modules/postcss/lib/input.d.ts | 194 - node_modules/postcss/lib/input.js | 248 - node_modules/postcss/lib/lazy-result.d.ts | 185 - node_modules/postcss/lib/lazy-result.js | 550 - node_modules/postcss/lib/list.d.ts | 57 - node_modules/postcss/lib/list.js | 58 - node_modules/postcss/lib/map-generator.js | 338 - node_modules/postcss/lib/no-work-result.d.ts | 46 - node_modules/postcss/lib/no-work-result.js | 135 - node_modules/postcss/lib/node.d.ts | 536 - node_modules/postcss/lib/node.js | 381 - node_modules/postcss/lib/parse.d.ts | 9 - node_modules/postcss/lib/parse.js | 42 - node_modules/postcss/lib/parser.js | 603 -- node_modules/postcss/lib/postcss.d.mts | 72 - node_modules/postcss/lib/postcss.d.ts | 441 - node_modules/postcss/lib/postcss.js | 101 - node_modules/postcss/lib/postcss.mjs | 30 - node_modules/postcss/lib/previous-map.d.ts | 81 - node_modules/postcss/lib/previous-map.js | 142 - node_modules/postcss/lib/processor.d.ts | 111 - node_modules/postcss/lib/processor.js | 67 - node_modules/postcss/lib/result.d.ts | 206 - node_modules/postcss/lib/result.js | 42 - node_modules/postcss/lib/root.d.ts | 82 - node_modules/postcss/lib/root.js | 61 - node_modules/postcss/lib/rule.d.ts | 113 - node_modules/postcss/lib/rule.js | 27 - node_modules/postcss/lib/stringifier.d.ts | 46 - node_modules/postcss/lib/stringifier.js | 353 - node_modules/postcss/lib/stringify.d.ts | 9 - node_modules/postcss/lib/stringify.js | 11 - node_modules/postcss/lib/symbols.js | 5 - .../postcss/lib/terminal-highlight.js | 70 - node_modules/postcss/lib/tokenize.js | 266 - node_modules/postcss/lib/warn-once.js | 13 - node_modules/postcss/lib/warning.d.ts | 147 - node_modules/postcss/lib/warning.js | 37 - node_modules/postcss/package.json | 88 - node_modules/punycode/LICENSE-MIT.txt | 20 - node_modules/punycode/README.md | 126 - node_modules/punycode/package.json | 58 - node_modules/punycode/punycode.es6.js | 444 - node_modules/punycode/punycode.js | 443 - node_modules/queue-microtask/LICENSE | 20 - node_modules/queue-microtask/README.md | 90 - node_modules/queue-microtask/index.d.ts | 2 - node_modules/queue-microtask/index.js | 9 - node_modules/queue-microtask/package.json | 55 - node_modules/quick-lru/index.d.ts | 97 - node_modules/quick-lru/index.js | 123 - node_modules/quick-lru/license | 9 - node_modules/quick-lru/package.json | 43 - node_modules/quick-lru/readme.md | 111 - node_modules/read-pkg-up/index.d.ts | 77 - node_modules/read-pkg-up/index.js | 27 - node_modules/read-pkg-up/license | 9 - node_modules/read-pkg-up/package.json | 61 - node_modules/read-pkg-up/readme.md | 74 - node_modules/read-pkg/index.d.ts | 59 - node_modules/read-pkg/index.js | 26 - node_modules/read-pkg/license | 9 - node_modules/read-pkg/package.json | 52 - node_modules/read-pkg/readme.md | 72 - node_modules/redent/index.d.ts | 23 - node_modules/redent/index.js | 6 - node_modules/redent/license | 9 - node_modules/redent/package.json | 47 - node_modules/redent/readme.md | 65 - node_modules/require-from-string/index.js | 34 - node_modules/require-from-string/license | 21 - node_modules/require-from-string/package.json | 28 - node_modules/require-from-string/readme.md | 56 - node_modules/resolve-from/index.d.ts | 31 - node_modules/resolve-from/index.js | 47 - node_modules/resolve-from/license | 9 - node_modules/resolve-from/package.json | 36 - node_modules/resolve-from/readme.md | 72 - node_modules/reusify/.coveralls.yml | 1 - node_modules/reusify/.travis.yml | 28 - node_modules/reusify/LICENSE | 22 - node_modules/reusify/README.md | 145 - .../benchmarks/createNoCodeFunction.js | 30 - node_modules/reusify/benchmarks/fib.js | 13 - .../reusify/benchmarks/reuseNoCodeFunction.js | 38 - node_modules/reusify/package.json | 45 - node_modules/reusify/reusify.js | 33 - node_modules/reusify/test.js | 66 - node_modules/rimraf/CHANGELOG.md | 65 - node_modules/rimraf/LICENSE | 15 - node_modules/rimraf/README.md | 101 - node_modules/rimraf/bin.js | 68 - node_modules/rimraf/package.json | 32 - node_modules/rimraf/rimraf.js | 360 - node_modules/run-parallel/LICENSE | 20 - node_modules/run-parallel/README.md | 85 - node_modules/run-parallel/index.js | 51 - node_modules/run-parallel/package.json | 58 - node_modules/semver/LICENSE | 15 - node_modules/semver/README.md | 637 -- node_modules/semver/bin/semver.js | 197 - node_modules/semver/classes/comparator.js | 141 - node_modules/semver/classes/index.js | 5 - node_modules/semver/classes/range.js | 539 - node_modules/semver/classes/semver.js | 302 - node_modules/semver/functions/clean.js | 6 - node_modules/semver/functions/cmp.js | 52 - node_modules/semver/functions/coerce.js | 52 - .../semver/functions/compare-build.js | 7 - .../semver/functions/compare-loose.js | 3 - node_modules/semver/functions/compare.js | 5 - node_modules/semver/functions/diff.js | 65 - node_modules/semver/functions/eq.js | 3 - node_modules/semver/functions/gt.js | 3 - node_modules/semver/functions/gte.js | 3 - node_modules/semver/functions/inc.js | 19 - node_modules/semver/functions/lt.js | 3 - node_modules/semver/functions/lte.js | 3 - node_modules/semver/functions/major.js | 3 - node_modules/semver/functions/minor.js | 3 - node_modules/semver/functions/neq.js | 3 - node_modules/semver/functions/parse.js | 16 - node_modules/semver/functions/patch.js | 3 - node_modules/semver/functions/prerelease.js | 6 - node_modules/semver/functions/rcompare.js | 3 - node_modules/semver/functions/rsort.js | 3 - node_modules/semver/functions/satisfies.js | 10 - node_modules/semver/functions/sort.js | 3 - node_modules/semver/functions/valid.js | 6 - node_modules/semver/index.js | 89 - node_modules/semver/internal/constants.js | 35 - node_modules/semver/internal/debug.js | 9 - node_modules/semver/internal/identifiers.js | 23 - node_modules/semver/internal/parse-options.js | 15 - node_modules/semver/internal/re.js | 212 - node_modules/semver/package.json | 87 - node_modules/semver/preload.js | 2 - node_modules/semver/range.bnf | 16 - node_modules/semver/ranges/gtr.js | 4 - node_modules/semver/ranges/intersects.js | 7 - node_modules/semver/ranges/ltr.js | 4 - node_modules/semver/ranges/max-satisfying.js | 25 - node_modules/semver/ranges/min-satisfying.js | 24 - node_modules/semver/ranges/min-version.js | 61 - node_modules/semver/ranges/outside.js | 80 - node_modules/semver/ranges/simplify.js | 47 - node_modules/semver/ranges/subset.js | 247 - node_modules/semver/ranges/to-comparators.js | 8 - node_modules/semver/ranges/valid.js | 11 - node_modules/signal-exit/LICENSE.txt | 16 - node_modules/signal-exit/README.md | 51 - .../signal-exit/dist/cjs/browser.d.ts | 12 - .../signal-exit/dist/cjs/browser.d.ts.map | 1 - node_modules/signal-exit/dist/cjs/browser.js | 10 - .../signal-exit/dist/cjs/browser.js.map | 1 - node_modules/signal-exit/dist/cjs/index.d.ts | 37 - .../signal-exit/dist/cjs/index.d.ts.map | 1 - node_modules/signal-exit/dist/cjs/index.js | 272 - .../signal-exit/dist/cjs/index.js.map | 1 - .../signal-exit/dist/cjs/package.json | 3 - .../signal-exit/dist/cjs/signals.d.ts | 29 - .../signal-exit/dist/cjs/signals.d.ts.map | 1 - node_modules/signal-exit/dist/cjs/signals.js | 42 - .../signal-exit/dist/cjs/signals.js.map | 1 - .../signal-exit/dist/mjs/browser.d.ts | 12 - .../signal-exit/dist/mjs/browser.d.ts.map | 1 - node_modules/signal-exit/dist/mjs/browser.js | 4 - .../signal-exit/dist/mjs/browser.js.map | 1 - node_modules/signal-exit/dist/mjs/index.d.ts | 37 - .../signal-exit/dist/mjs/index.d.ts.map | 1 - node_modules/signal-exit/dist/mjs/index.js | 268 - .../signal-exit/dist/mjs/index.js.map | 1 - .../signal-exit/dist/mjs/package.json | 3 - .../signal-exit/dist/mjs/signals.d.ts | 29 - .../signal-exit/dist/mjs/signals.d.ts.map | 1 - node_modules/signal-exit/dist/mjs/signals.js | 39 - .../signal-exit/dist/mjs/signals.js.map | 1 - node_modules/signal-exit/package.json | 106 - node_modules/slash/index.d.ts | 25 - node_modules/slash/index.js | 11 - node_modules/slash/license | 9 - node_modules/slash/package.json | 35 - node_modules/slash/readme.md | 44 - node_modules/slice-ansi/index.js | 103 - node_modules/slice-ansi/license | 10 - .../node_modules/ansi-styles/index.d.ts | 345 - .../node_modules/ansi-styles/index.js | 163 - .../node_modules/ansi-styles/license | 9 - .../node_modules/ansi-styles/package.json | 56 - .../node_modules/ansi-styles/readme.md | 152 - .../node_modules/color-convert/CHANGELOG.md | 54 - .../node_modules/color-convert/LICENSE | 21 - .../node_modules/color-convert/README.md | 68 - .../node_modules/color-convert/conversions.js | 839 -- .../node_modules/color-convert/index.js | 81 - .../node_modules/color-convert/package.json | 48 - .../node_modules/color-convert/route.js | 97 - .../node_modules/color-name/LICENSE | 8 - .../node_modules/color-name/README.md | 11 - .../node_modules/color-name/index.js | 152 - .../node_modules/color-name/package.json | 28 - node_modules/slice-ansi/package.json | 52 - node_modules/slice-ansi/readme.md | 66 - node_modules/source-map-js/CHANGELOG.md | 320 - node_modules/source-map-js/LICENSE | 28 - node_modules/source-map-js/README.md | 758 -- node_modules/source-map-js/lib/array-set.js | 121 - node_modules/source-map-js/lib/base64-vlq.js | 140 - node_modules/source-map-js/lib/base64.js | 67 - .../source-map-js/lib/binary-search.js | 111 - .../source-map-js/lib/mapping-list.js | 79 - node_modules/source-map-js/lib/quick-sort.js | 132 - .../source-map-js/lib/source-map-consumer.js | 1184 -- .../source-map-js/lib/source-map-generator.js | 425 - node_modules/source-map-js/lib/source-node.js | 413 - node_modules/source-map-js/lib/util.js | 594 - node_modules/source-map-js/package.json | 71 - node_modules/source-map-js/source-map.d.ts | 115 - node_modules/source-map-js/source-map.js | 8 - node_modules/spdx-correct/LICENSE | 202 - node_modules/spdx-correct/README.md | 22 - node_modules/spdx-correct/index.js | 386 - node_modules/spdx-correct/package.json | 32 - node_modules/spdx-exceptions/README.md | 36 - node_modules/spdx-exceptions/index.json | 40 - node_modules/spdx-exceptions/package.json | 17 - node_modules/spdx-expression-parse/AUTHORS | 4 - node_modules/spdx-expression-parse/LICENSE | 22 - node_modules/spdx-expression-parse/README.md | 91 - node_modules/spdx-expression-parse/index.js | 8 - .../spdx-expression-parse/package.json | 39 - node_modules/spdx-expression-parse/parse.js | 138 - node_modules/spdx-expression-parse/scan.js | 131 - node_modules/spdx-license-ids/README.md | 52 - node_modules/spdx-license-ids/deprecated.json | 27 - node_modules/spdx-license-ids/index.json | 507 - node_modules/spdx-license-ids/package.json | 39 - node_modules/string-width/index.d.ts | 29 - node_modules/string-width/index.js | 47 - node_modules/string-width/license | 9 - node_modules/string-width/package.json | 56 - node_modules/string-width/readme.md | 50 - node_modules/strip-ansi/index.d.ts | 17 - node_modules/strip-ansi/index.js | 4 - node_modules/strip-ansi/license | 9 - node_modules/strip-ansi/package.json | 54 - node_modules/strip-ansi/readme.md | 46 - node_modules/strip-indent/index.d.ts | 19 - node_modules/strip-indent/index.js | 13 - node_modules/strip-indent/license | 9 - node_modules/strip-indent/package.json | 45 - node_modules/strip-indent/readme.md | 48 - node_modules/style-search/.npmignore | 1 - node_modules/style-search/CHANGELOG.md | 5 - node_modules/style-search/LICENSE | 13 - node_modules/style-search/README.md | 96 - node_modules/style-search/circle.yml | 5 - node_modules/style-search/index.js | 203 - node_modules/style-search/package.json | 27 - node_modules/style-search/test.js | 467 - .../stylelint-config-recommended-scss/LICENSE | 21 - .../README.md | 53 - .../index.js | 36 - .../stylelint-config-recommended/LICENSE | 21 - .../stylelint-config-recommended/README.md | 51 - .../stylelint-config-recommended/index.js | 48 - .../stylelint-config-recommended/package.json | 67 - .../package.json | 55 - .../stylelint-config-recommended/LICENSE | 21 - .../stylelint-config-recommended/README.md | 51 - .../stylelint-config-recommended/index.js | 49 - .../stylelint-config-recommended/package.json | 70 - .../stylelint-config-standard-scss/LICENSE | 21 - .../stylelint-config-standard-scss/README.md | 50 - .../stylelint-config-standard-scss/index.js | 67 - .../stylelint-config-recommended/LICENSE | 21 - .../stylelint-config-recommended/README.md | 51 - .../stylelint-config-recommended/index.js | 48 - .../stylelint-config-recommended/package.json | 67 - .../stylelint-config-standard/LICENSE | 20 - .../stylelint-config-standard/README.md | 128 - .../stylelint-config-standard/index.js | 120 - .../stylelint-config-standard/package.json | 70 - .../package.json | 54 - .../stylelint-config-standard/LICENSE | 20 - .../stylelint-config-standard/README.md | 128 - .../stylelint-config-standard/index.js | 120 - .../stylelint-config-standard/package.json | 73 - node_modules/stylelint-scss/LICENSE | 21 - node_modules/stylelint-scss/README.md | 359 - node_modules/stylelint-scss/package.json | 59 - node_modules/stylelint-scss/src/index.js | 11 - .../at-each-key-value-single-line/README.md | 105 - .../at-each-key-value-single-line/index.js | 128 - .../README.md | 74 - .../index.js | 62 - .../README.md | 131 - .../index.js | 48 - .../rules/at-else-empty-line-before/README.md | 69 - .../rules/at-else-empty-line-before/index.js | 61 - .../README.md | 58 - .../index.js | 60 - .../README.md | 47 - .../at-extend-no-missing-placeholder/index.js | 46 - .../at-function-named-arguments/README.md | 131 - .../at-function-named-arguments/index.js | 131 - .../README.md | 50 - .../index.js | 57 - .../src/rules/at-function-pattern/README.md | 29 - .../src/rules/at-function-pattern/index.js | 62 - .../README.md | 60 - .../index.js | 134 - .../at-if-closing-brace-space-after/README.md | 100 - .../at-if-closing-brace-space-after/index.js | 108 - .../src/rules/at-if-no-null/README.md | 44 - .../src/rules/at-if-no-null/index.js | 62 - .../README.md | 59 - .../index.js | 67 - .../README.md | 70 - .../index.js | 85 - .../README.md | 78 - .../index.js | 89 - .../at-import-partial-extension/README.md | 118 - .../at-import-partial-extension/index.js | 107 - .../README.md | 47 - .../index.js | 68 - .../rules/at-mixin-named-arguments/README.md | 102 - .../rules/at-mixin-named-arguments/index.js | 125 - .../README.md | 58 - .../index.js | 57 - .../src/rules/at-mixin-pattern/README.md | 29 - .../src/rules/at-mixin-pattern/index.js | 62 - .../README.md | 43 - .../index.js | 82 - .../src/rules/at-rule-no-unknown/README.md | 76 - .../src/rules/at-rule-no-unknown/index.js | 102 - .../rules/at-use-no-unnamespaced/README.md | 25 - .../src/rules/at-use-no-unnamespaced/index.js | 42 - .../src/rules/comment-no-empty/README.md | 67 - .../src/rules/comment-no-empty/index.js | 53 - .../src/rules/comment-no-loud/README.md | 33 - .../src/rules/comment-no-loud/index.js | 53 - .../README.md | 68 - .../index.js | 80 - .../declaration-nested-properties/README.md | 153 - .../declaration-nested-properties/index.js | 168 - .../dimension-no-non-numeric-values/README.md | 93 - .../dimension-no-non-numeric-values/index.js | 150 - .../README.md | 85 - .../index.js | 123 - .../README.md | 139 - .../index.js | 120 - .../README.md | 73 - .../index.js | 51 - .../rules/dollar-variable-default/README.md | 25 - .../rules/dollar-variable-default/index.js | 71 - .../README.md | 185 - .../dollar-variable-empty-line-after/index.js | 251 - .../README.md | 229 - .../index.js | 176 - .../dollar-variable-first-in-block/README.md | 202 - .../dollar-variable-first-in-block/index.js | 125 - .../README.md | 111 - .../index.js | 148 - .../README.md | 24 - .../index.js | 44 - .../rules/dollar-variable-pattern/README.md | 73 - .../rules/dollar-variable-pattern/index.js | 77 - .../README.md | 203 - .../index.js | 151 - .../double-slash-comment-inline/README.md | 110 - .../double-slash-comment-inline/index.js | 97 - .../README.md | 60 - .../index.js | 80 - .../rules/function-color-relative/README.md | 83 - .../rules/function-color-relative/index.js | 82 - .../src/rules/function-no-unknown/README.md | 64 - .../src/rules/function-no-unknown/index.js | 133 - .../README.md | 46 - .../index.js | 84 - .../README.md | 46 - .../index.js | 88 - .../stylelint-scss/src/rules/index.js | 65 - .../src/rules/map-keys-quotes/README.md | 26 - .../src/rules/map-keys-quotes/index.js | 101 - .../README.md | 104 - .../index.js | 109 - .../src/rules/no-dollar-variables/README.md | 38 - .../src/rules/no-dollar-variables/index.js | 46 - .../no-duplicate-dollar-variables/README.md | 212 - .../no-duplicate-dollar-variables/index.js | 194 - .../src/rules/no-duplicate-mixins/README.md | 83 - .../src/rules/no-duplicate-mixins/index.js | 57 - .../rules/no-global-function-names/README.md | 31 - .../rules/no-global-function-names/index.js | 203 - .../rules/operator-no-newline-after/README.md | 54 - .../rules/operator-no-newline-after/index.js | 82 - .../operator-no-newline-before/README.md | 55 - .../rules/operator-no-newline-before/index.js | 82 - .../src/rules/operator-no-unspaced/README.md | 100 - .../src/rules/operator-no-unspaced/index.js | 308 - .../src/rules/partial-no-import/README.md | 69 - .../src/rules/partial-no-import/index.js | 89 - .../percent-placeholder-pattern/README.md | 57 - .../percent-placeholder-pattern/index.js | 101 - .../rules/selector-nest-combinators/README.md | 221 - .../rules/selector-nest-combinators/index.js | 165 - .../README.md | 115 - .../index.js | 92 - .../selector-no-union-class-name/README.md | 46 - .../selector-no-union-class-name/index.js | 103 - .../src/utils/addEmptyLineBefore.js | 15 - .../src/utils/atRuleBaseName.js | 11 - .../src/utils/atRuleParamIndex.js | 18 - .../src/utils/beforeBlockString.js | 39 - .../stylelint-scss/src/utils/blockString.js | 22 - .../src/utils/configurationError.js | 15 - .../src/utils/declarationValueIndex.js | 15 - .../stylelint-scss/src/utils/eachRoot.js | 18 - .../src/utils/findCommentsInRaws.js | 241 - .../stylelint-scss/src/utils/functions.js | 257 - .../stylelint-scss/src/utils/hasBlock.js | 11 - .../stylelint-scss/src/utils/hasEmptyLine.js | 11 - .../src/utils/hasInterpolatingAmpersand.js | 32 - .../src/utils/hasInterpolation.js | 22 - .../src/utils/hasLessInterpolation.js | 11 - .../src/utils/hasNestedSibling.js | 13 - .../src/utils/hasPsvInterpolation.js | 10 - .../src/utils/hasScssInterpolation.js | 10 - .../src/utils/hasTplInterpolation.js | 11 - .../src/utils/isCustomPropertySet.js | 19 - .../src/utils/isInlineComment.js | 20 - .../src/utils/isNativeCssFunction.js | 94 - .../src/utils/isSingleLineString.js | 12 - .../src/utils/isStandardRule.js | 65 - .../src/utils/isStandardSelector.js | 23 - .../src/utils/isStandardSyntaxProperty.js | 33 - .../src/utils/isStandardSyntaxSelector.js | 38 - .../stylelint-scss/src/utils/isType.js | 12 - .../stylelint-scss/src/utils/isWhitespace.js | 11 - .../src/utils/matchesStringOrRegExp.js | 94 - .../src/utils/moduleNamespace.js | 62 - .../stylelint-scss/src/utils/namespace.js | 7 - .../src/utils/optionsHaveException.js | 14 - .../src/utils/optionsHaveIgnored.js | 14 - .../src/utils/optionsMatches.js | 22 - .../src/utils/parseFunctionArguments.js | 79 - .../src/utils/parseNestedPropRoot.js | 96 - .../stylelint-scss/src/utils/parseSelector.js | 11 - .../stylelint-scss/src/utils/rawNodeString.js | 19 - .../src/utils/removeEmptyLinesBefore.js | 11 - .../stylelint-scss/src/utils/ruleUrl.js | 17 - .../src/utils/sassValueParser/index.js | 1021 -- .../stylelint-scss/src/utils/validateTypes.js | 44 - .../src/utils/whitespaceChecker.js | 338 - node_modules/stylelint/LICENSE | 20 - node_modules/stylelint/README.md | 103 - node_modules/stylelint/bin/stylelint.mjs | 5 - .../stylelint/lib/assignDisabledRanges.js | 417 - node_modules/stylelint/lib/augmentConfig.js | 440 - node_modules/stylelint/lib/cli.mjs | 639 -- node_modules/stylelint/lib/constants.js | 25 - .../lib/createPartialStylelintResult.js | 109 - node_modules/stylelint/lib/createPlugin.js | 11 - node_modules/stylelint/lib/createStylelint.js | 35 - .../stylelint/lib/descriptionlessDisables.js | 61 - .../lib/formatters/calcSeverityCounts.js | 21 - .../lib/formatters/compactFormatter.js | 23 - .../lib/formatters/githubFormatter.js | 51 - .../stylelint/lib/formatters/index.js | 16 - .../stylelint/lib/formatters/jsonFormatter.js | 20 - .../lib/formatters/preprocessWarnings.js | 74 - .../lib/formatters/stringFormatter.js | 276 - .../stylelint/lib/formatters/tapFormatter.js | 52 - .../stylelint/lib/formatters/terminalLink.js | 23 - .../stylelint/lib/formatters/unixFormatter.js | 34 - .../lib/formatters/verboseFormatter.js | 149 - .../stylelint/lib/getConfigForFile.js | 75 - .../stylelint/lib/getPostcssResult.js | 142 - node_modules/stylelint/lib/index.js | 35 - .../stylelint/lib/invalidScopeDisables.js | 47 - node_modules/stylelint/lib/isPathIgnored.js | 44 - .../stylelint/lib/lintPostcssResult.js | 151 - node_modules/stylelint/lib/lintSource.js | 146 - .../stylelint/lib/needlessDisables.js | 101 - .../stylelint/lib/normalizeAllRuleSettings.js | 33 - .../stylelint/lib/normalizeRuleSettings.js | 58 - node_modules/stylelint/lib/postcssPlugin.js | 45 - .../stylelint/lib/prepareReturnValue.js | 75 - node_modules/stylelint/lib/printConfig.js | 42 - .../stylelint/lib/reference/atKeywords.js | 57 - .../stylelint/lib/reference/functions.js | 59 - .../stylelint/lib/reference/keywords.js | 505 - .../stylelint/lib/reference/mediaFeatures.js | 115 - .../stylelint/lib/reference/prefixes.js | 5 - .../stylelint/lib/reference/properties.js | 399 - .../stylelint/lib/reference/selectors.js | 320 - node_modules/stylelint/lib/reference/units.js | 87 - node_modules/stylelint/lib/reportDisables.js | 64 - .../stylelint/lib/reportUnknownRuleNames.js | 76 - node_modules/stylelint/lib/resolveConfig.js | 39 - .../stylelint/lib/resolveCustomFormatter.js | 16 - .../lib/rules/alpha-value-notation/index.js | 227 - .../lib/rules/annotation-no-unknown/index.js | 90 - .../lib/rules/at-rule-allowed-list/index.js | 62 - .../rules/at-rule-disallowed-list/index.js | 62 - .../rules/at-rule-empty-line-before/index.js | 173 - .../lib/rules/at-rule-name-case/index.js | 67 - .../rules/at-rule-name-newline-after/index.js | 45 - .../rules/at-rule-name-space-after/index.js | 53 - .../lib/rules/at-rule-no-unknown/index.js | 75 - .../rules/at-rule-no-vendor-prefix/index.js | 65 - .../at-rule-property-required-list/index.js | 86 - .../at-rule-semicolon-newline-after/index.js | 84 - .../at-rule-semicolon-space-before/index.js | 68 - .../lib/rules/atRuleNameSpaceChecker.js | 55 - .../index.js | 129 - .../index.js | 152 - .../index.js | 132 - .../block-closing-brace-space-after/index.js | 96 - .../block-closing-brace-space-before/index.js | 109 - .../lib/rules/block-no-empty/index.js | 117 - .../index.js | 182 - .../index.js | 120 - .../block-opening-brace-space-after/index.js | 116 - .../block-opening-brace-space-before/index.js | 139 - .../rules/color-function-notation/index.js | 163 - .../lib/rules/color-hex-alpha/index.js | 89 - .../lib/rules/color-hex-case/index.js | 97 - .../lib/rules/color-hex-length/index.js | 148 - .../lib/rules/color-named/colordUtils.js | 108 - .../stylelint/lib/rules/color-named/index.js | 184 - .../stylelint/lib/rules/color-no-hex/index.js | 78 - .../lib/rules/color-no-invalid-hex/index.js | 74 - .../rules/comment-empty-line-before/index.js | 133 - .../lib/rules/comment-no-empty/index.js | 51 - .../lib/rules/comment-pattern/index.js | 53 - .../rules/comment-whitespace-inside/index.js | 141 - .../comment-word-disallowed-list/index.js | 65 - .../lib/rules/custom-media-pattern/index.js | 66 - .../index.js | 143 - .../index.js | 88 - .../rules/custom-property-pattern/index.js | 99 - .../declaration-bang-space-after/index.js | 91 - .../declaration-bang-space-before/index.js | 92 - .../index.js | 84 - .../index.js | 277 - .../index.js | 294 - .../index.js | 72 - .../index.js | 107 - .../index.js | 74 - .../index.js | 97 - .../index.js | 104 - .../index.js | 64 - .../index.js | 146 - .../declaration-colon-newline-after/index.js | 97 - .../declaration-colon-space-after/index.js | 73 - .../declaration-colon-space-before/index.js | 72 - .../declaration-empty-line-before/index.js | 155 - .../rules/declaration-no-important/index.js | 52 - .../declaration-property-max-values/index.js | 78 - .../index.js | 113 - .../index.js | 95 - .../index.js | 70 - .../index.js | 70 - .../index.js | 166 - .../lib/rules/declarationBangSpaceChecker.js | 60 - .../lib/rules/declarationColonSpaceChecker.js | 57 - .../stylelint/lib/rules/findMediaOperator.js | 30 - .../rules/font-family-name-quotes/index.js | 269 - .../font-family-no-duplicate-names/index.js | 122 - .../index.js | 120 - .../lib/rules/font-weight-notation/index.js | 214 - .../lib/rules/function-allowed-list/index.js | 71 - .../index.js | 381 - .../function-comma-newline-after/index.js | 60 - .../function-comma-newline-before/index.js | 60 - .../rules/function-comma-space-after/index.js | 61 - .../function-comma-space-before/index.js | 61 - .../rules/function-disallowed-list/index.js | 71 - .../index.js | 140 - .../rules/function-max-empty-lines/index.js | 113 - .../lib/rules/function-name-case/index.js | 120 - .../lib/rules/function-no-unknown/index.js | 110 - .../index.js | 276 - .../index.js | 175 - .../function-url-no-scheme-relative/index.js | 52 - .../lib/rules/function-url-quotes/index.js | 195 - .../function-url-scheme-allowed-list/index.js | 72 - .../index.js | 72 - .../rules/function-whitespace-after/index.js | 194 - .../lib/rules/functionCommaSpaceChecker.js | 123 - .../lib/rules/functionCommaSpaceFix.js | 49 - .../lib/rules/hue-degree-notation/index.js | 151 - .../lib/rules/import-notation/index.js | 126 - .../stylelint/lib/rules/indentation/index.js | 733 -- node_modules/stylelint/lib/rules/index.js | 378 - .../index.js | 65 - .../index.js | 54 - .../rules/keyframe-selector-notation/index.js | 164 - .../lib/rules/keyframes-name-pattern/index.js | 64 - .../lib/rules/length-zero-no-unit/index.js | 227 - .../stylelint/lib/rules/linebreaks/index.js | 132 - .../lib/rules/max-empty-lines/index.js | 219 - .../lib/rules/max-line-length/index.js | 203 - .../lib/rules/max-nesting-depth/index.js | 166 - .../media-feature-colon-space-after/index.js | 87 - .../media-feature-colon-space-before/index.js | 87 - .../media-feature-name-allowed-list/index.js | 68 - .../rules/media-feature-name-case/index.js | 93 - .../index.js | 68 - .../media-feature-name-no-unknown/index.js | 80 - .../index.js | 63 - .../index.js | 108 - .../index.js | 104 - .../index.js | 277 - .../index.js | 112 - .../media-feature-range-notation/index.js | 129 - .../index.js | 104 - .../index.js | 104 - .../index.js | 93 - .../index.js | 47 - .../index.js | 89 - .../index.js | 89 - .../lib/rules/media-query-no-invalid/index.js | 139 - .../rules/mediaFeatureColonSpaceChecker.js | 51 - .../mediaQueryListCommaWhitespaceChecker.js | 71 - .../named-grid-areas-no-invalid/index.js | 112 - .../utils/findNotContiguousOrRectangular.js | 64 - .../rules/no-descending-specificity/index.js | 168 - .../no-duplicate-at-import-rules/index.js | 155 - .../lib/rules/no-duplicate-selectors/index.js | 178 - .../lib/rules/no-empty-first-line/index.js | 64 - .../lib/rules/no-empty-source/index.js | 44 - .../lib/rules/no-eol-whitespace/index.js | 297 - .../lib/rules/no-extra-semicolons/index.js | 244 - .../no-invalid-double-slash-comments/index.js | 57 - .../index.js | 77 - .../rules/no-irregular-whitespace/index.js | 111 - .../no-missing-end-of-source-newline/index.js | 63 - .../lib/rules/no-unknown-animations/index.js | 72 - .../no-unknown-custom-properties/index.js | 72 - .../lib/rules/number-leading-zero/index.js | 197 - .../lib/rules/number-max-precision/index.js | 214 - .../rules/number-no-trailing-zeros/index.js | 140 - .../lib/rules/property-allowed-list/index.js | 67 - .../lib/rules/property-case/index.js | 96 - .../rules/property-disallowed-list/index.js | 67 - .../lib/rules/property-no-unknown/index.js | 120 - .../rules/property-no-vendor-prefix/index.js | 83 - .../lib/rules/rule-empty-line-before/index.js | 162 - .../index.js | 75 - .../selector-anb-no-unmatchable/index.js | 111 - .../index.js | 209 - .../index.js | 73 - .../index.js | 76 - .../index.js | 76 - .../index.js | 110 - .../index.js | 86 - .../rules/selector-attribute-quotes/index.js | 118 - .../lib/rules/selector-class-pattern/index.js | 154 - .../selector-combinator-allowed-list/index.js | 84 - .../index.js | 84 - .../selector-combinator-space-after/index.js | 65 - .../selector-combinator-space-before/index.js | 65 - .../index.js | 95 - .../rules/selector-disallowed-list/index.js | 100 - .../lib/rules/selector-id-pattern/index.js | 64 - .../index.js | 122 - .../index.js | 96 - .../selector-list-comma-space-after/index.js | 88 - .../selector-list-comma-space-before/index.js | 88 - .../lib/rules/selector-max-attribute/index.js | 109 - .../lib/rules/selector-max-class/index.js | 84 - .../rules/selector-max-combinators/index.js | 85 - .../selector-max-compound-selectors/index.js | 95 - .../rules/selector-max-empty-lines/index.js | 71 - .../lib/rules/selector-max-id/index.js | 112 - .../rules/selector-max-pseudo-class/index.js | 96 - .../rules/selector-max-specificity/index.js | 231 - .../lib/rules/selector-max-type/index.js | 231 - .../lib/rules/selector-max-universal/index.js | 118 - .../rules/selector-nested-pattern/index.js | 77 - .../selector-no-qualifying-type/index.js | 157 - .../rules/selector-no-vendor-prefix/index.js | 88 - .../lib/rules/selector-not-notation/index.js | 213 - .../index.js | 79 - .../rules/selector-pseudo-class-case/index.js | 103 - .../index.js | 79 - .../selector-pseudo-class-no-unknown/index.js | 179 - .../index.js | 156 - .../index.js | 80 - .../selector-pseudo-element-case/index.js | 90 - .../index.js | 98 - .../index.js | 80 - .../index.js | 98 - .../lib/rules/selector-type-case/index.js | 132 - .../rules/selector-type-no-unknown/index.js | 122 - .../selectorAttributeOperatorSpaceChecker.js | 92 - .../rules/selectorCombinatorSpaceChecker.js | 105 - .../selectorListCommaWhitespaceChecker.js | 61 - .../index.js | 185 - .../lib/rules/string-no-newline/index.js | 134 - .../lib/rules/string-quotes/index.js | 250 - .../lib/rules/time-min-milliseconds/index.js | 163 - .../stylelint/lib/rules/unicode-bom/index.js | 68 - .../lib/rules/unit-allowed-list/index.js | 113 - .../stylelint/lib/rules/unit-case/index.js | 134 - .../lib/rules/unit-disallowed-list/index.js | 226 - .../lib/rules/unit-no-unknown/index.js | 214 - .../lib/rules/value-keyword-case/index.js | 248 - .../value-list-comma-newline-after/index.js | 104 - .../value-list-comma-newline-before/index.js | 47 - .../value-list-comma-space-after/index.js | 91 - .../value-list-comma-space-before/index.js | 91 - .../rules/value-list-max-empty-lines/index.js | 66 - .../lib/rules/value-no-vendor-prefix/index.js | 95 - .../rules/valueListCommaWhitespaceChecker.js | 71 - node_modules/stylelint/lib/standalone.js | 325 - node_modules/stylelint/lib/utils/FileCache.js | 92 - .../stylelint/lib/utils/addEmptyLineAfter.js | 28 - .../stylelint/lib/utils/addEmptyLineBefore.js | 23 - .../lib/utils/allFilesIgnoredError.js | 11 - .../stylelint/lib/utils/arrayEqual.js | 16 - .../stylelint/lib/utils/atRuleParamIndex.js | 16 - .../stylelint/lib/utils/beforeBlockString.js | 29 - .../stylelint/lib/utils/blockString.js | 21 - .../stylelint/lib/utils/blurInterpolation.js | 10 - .../stylelint/lib/utils/checkAgainstRule.js | 57 - .../lib/utils/checkInvalidCLIOptions.js | 104 - .../lib/utils/configurationComment.js | 73 - .../stylelint/lib/utils/configurationError.js | 17 - .../stylelint/lib/utils/containsString.js | 54 - .../stylelint/lib/utils/createMapWithSet.js | 21 - .../lib/utils/declarationValueIndex.js | 28 - .../lib/utils/eachDeclarationBlock.js | 61 - .../stylelint/lib/utils/filterFilePaths.js | 19 - .../stylelint/lib/utils/findAnimationName.js | 75 - .../stylelint/lib/utils/findAtRuleContext.js | 29 - .../stylelint/lib/utils/findFontFamily.js | 130 - .../lib/utils/findMediaFeatureNames.js | 144 - .../lib/utils/functionArgumentsSearch.js | 43 - .../stylelint/lib/utils/getAtRuleParams.js | 9 - .../stylelint/lib/utils/getCacheFile.js | 52 - .../lib/utils/getDeclarationValue.js | 11 - .../stylelint/lib/utils/getDimension.js | 63 - .../stylelint/lib/utils/getFileIgnorer.js | 43 - .../lib/utils/getFormatterOptionsText.js | 14 - .../lib/utils/getImportantPosition.js | 17 - .../stylelint/lib/utils/getModulePath.js | 34 - .../utils/getNextNonSharedLineCommentNode.js | 36 - node_modules/stylelint/lib/utils/getOsEol.js | 11 - .../getPreviousNonSharedLineCommentNode.js | 38 - .../stylelint/lib/utils/getRuleSelector.js | 11 - .../stylelint/lib/utils/getSchemeFromUrl.js | 39 - .../stylelint/lib/utils/getStylelintRule.js | 10 - .../utils/hasANPlusBNotationPseudoClasses.js | 22 - node_modules/stylelint/lib/utils/hasBlock.js | 11 - .../stylelint/lib/utils/hasColorFunction.js | 15 - .../stylelint/lib/utils/hasDimension.js | 13 - .../stylelint/lib/utils/hasEmptyBlock.js | 13 - .../stylelint/lib/utils/hasEmptyLine.js | 15 - .../stylelint/lib/utils/hasInterpolation.js | 26 - .../lib/utils/hasLessInterpolation.js | 13 - .../stylelint/lib/utils/hasNamedColor.js | 17 - node_modules/stylelint/lib/utils/hasPrefix.js | 15 - .../lib/utils/hasPsvInterpolation.js | 12 - .../lib/utils/hasScssInterpolation.js | 12 - .../lib/utils/hasTplInterpolation.js | 13 - .../stylelint/lib/utils/hasValidHex.js | 13 - node_modules/stylelint/lib/utils/hash.js | 12 - .../stylelint/lib/utils/isAfterComment.js | 16 - .../lib/utils/isAfterSingleLineComment.js | 22 - .../isAfterStandardPropertyDeclaration.js | 20 - .../stylelint/lib/utils/isAutoprefixable.js | 339 - .../isBlocklessAtRuleAfterBlocklessAtRule.js | 23 - ...klessAtRuleAfterSameNameBlocklessAtRule.js | 23 - .../utils/isContextFunctionalPseudoClass.js | 26 - .../isCounterIncrementCustomIdentValue.js | 21 - .../utils/isCounterResetCustomIdentValue.js | 21 - .../stylelint/lib/utils/isCustomElement.js | 41 - .../stylelint/lib/utils/isCustomFunction.js | 11 - .../stylelint/lib/utils/isCustomMediaQuery.js | 10 - .../stylelint/lib/utils/isCustomProperty.js | 10 - .../stylelint/lib/utils/isCustomSelector.js | 11 - .../stylelint/lib/utils/isFirstNested.js | 85 - .../stylelint/lib/utils/isFirstNodeOfRoot.js | 19 - .../stylelint/lib/utils/isKeyframeRule.js | 19 - .../stylelint/lib/utils/isKeyframeSelector.js | 22 - .../stylelint/lib/utils/isMathFunction.js | 13 - .../lib/utils/isNonNegativeInteger.js | 8 - node_modules/stylelint/lib/utils/isNumbery.js | 11 - .../stylelint/lib/utils/isOnlyWhitespace.js | 19 - .../lib/utils/isPathNotFoundError.js | 11 - .../stylelint/lib/utils/isScssVariable.js | 21 - .../lib/utils/isSharedLineComment.js | 56 - .../stylelint/lib/utils/isSingleLineString.js | 12 - .../lib/utils/isStandardSyntaxAtRule.js | 29 - .../utils/isStandardSyntaxColorFunction.js | 26 - .../lib/utils/isStandardSyntaxCombinator.js | 34 - .../lib/utils/isStandardSyntaxComment.js | 15 - .../lib/utils/isStandardSyntaxDeclaration.js | 58 - .../lib/utils/isStandardSyntaxFunction.js | 30 - .../lib/utils/isStandardSyntaxHexColor.js | 16 - .../utils/isStandardSyntaxKeyframesName.js | 17 - .../lib/utils/isStandardSyntaxMathFunction.js | 21 - .../lib/utils/isStandardSyntaxMediaFeature.js | 26 - .../utils/isStandardSyntaxMediaFeatureName.js | 16 - .../lib/utils/isStandardSyntaxProperty.js | 34 - .../lib/utils/isStandardSyntaxRule.js | 26 - .../lib/utils/isStandardSyntaxSelector.js | 58 - .../lib/utils/isStandardSyntaxTypeSelector.js | 58 - .../lib/utils/isStandardSyntaxUrl.js | 51 - .../lib/utils/isStandardSyntaxValue.js | 52 - .../lib/utils/isUnicodeRangeDescriptor.js | 26 - .../stylelint/lib/utils/isValidFontSize.js | 39 - .../stylelint/lib/utils/isValidHex.js | 13 - .../stylelint/lib/utils/isValidIdentifier.js | 41 - .../stylelint/lib/utils/isVariable.js | 11 - .../stylelint/lib/utils/isWhitespace.js | 11 - .../lib/utils/matchesStringOrRegExp.js | 89 - .../stylelint/lib/utils/nextNonCommentNode.js | 20 - .../stylelint/lib/utils/noFilesFoundError.js | 20 - .../stylelint/lib/utils/nodeContextLookup.js | 43 - .../stylelint/lib/utils/optionsMatches.js | 22 - .../stylelint/lib/utils/parseMediaQuery.js | 16 - .../stylelint/lib/utils/parseSelector.js | 20 - node_modules/stylelint/lib/utils/pluralize.js | 12 - .../stylelint/lib/utils/putIfAbsent.js | 22 - .../stylelint/lib/utils/rawNodeString.js | 20 - .../lib/utils/removeEmptyLinesAfter.js | 15 - .../lib/utils/removeEmptyLinesBefore.js | 15 - node_modules/stylelint/lib/utils/report.js | 146 - .../stylelint/lib/utils/ruleMessages.js | 20 - .../stylelint/lib/utils/setAtRuleParams.js | 20 - .../lib/utils/setDeclarationValue.js | 20 - .../stylelint/lib/utils/transformSelector.js | 19 - .../stylelint/lib/utils/typeGuards.js | 68 - node_modules/stylelint/lib/utils/uniteSets.js | 8 - .../lib/utils/validateObjectWithArrayProps.js | 31 - .../lib/utils/validateObjectWithProps.js | 28 - .../stylelint/lib/utils/validateOptions.js | 174 - .../stylelint/lib/utils/validateTypes.js | 138 - node_modules/stylelint/lib/utils/vendor.js | 45 - .../stylelint/lib/utils/whitespaceChecker.js | 340 - .../stylelint/lib/validateDisableSettings.js | 79 - node_modules/stylelint/lib/writeOutputFile.js | 17 - node_modules/stylelint/package.json | 224 - .../stylelint/types/stylelint/index.d.ts | 639 -- node_modules/supports-color/browser.js | 5 - node_modules/supports-color/index.js | 131 - node_modules/supports-color/license | 9 - node_modules/supports-color/package.json | 53 - node_modules/supports-color/readme.md | 66 - node_modules/supports-hyperlinks/browser.js | 8 - node_modules/supports-hyperlinks/index.d.ts | 5 - node_modules/supports-hyperlinks/index.js | 117 - node_modules/supports-hyperlinks/license | 9 - .../node_modules/has-flag/index.d.ts | 39 - .../node_modules/has-flag/index.js | 8 - .../node_modules/has-flag/license | 9 - .../node_modules/has-flag/package.json | 46 - .../node_modules/has-flag/readme.md | 89 - .../node_modules/supports-color/browser.js | 5 - .../node_modules/supports-color/index.js | 135 - .../node_modules/supports-color/license | 9 - .../node_modules/supports-color/package.json | 53 - .../node_modules/supports-color/readme.md | 76 - node_modules/supports-hyperlinks/package.json | 51 - node_modules/supports-hyperlinks/readme.md | 48 - node_modules/svg-tags/LICENSE | 21 - node_modules/svg-tags/README.md | 99 - node_modules/svg-tags/lib/index.js | 1 - node_modules/svg-tags/lib/svg-tags.json | 82 - node_modules/svg-tags/package.json | 46 - node_modules/table/LICENSE | 24 - node_modules/table/README.md | 837 -- .../table/dist/src/alignSpanningCell.d.ts | 7 - .../table/dist/src/alignSpanningCell.js | 48 - .../table/dist/src/alignSpanningCell.js.map | 1 - node_modules/table/dist/src/alignString.d.ts | 6 - node_modules/table/dist/src/alignString.js | 60 - .../table/dist/src/alignString.js.map | 1 - .../table/dist/src/alignTableData.d.ts | 2 - node_modules/table/dist/src/alignTableData.js | 20 - .../table/dist/src/alignTableData.js.map | 1 - .../table/dist/src/calculateCellHeight.d.ts | 4 - .../table/dist/src/calculateCellHeight.js | 12 - .../table/dist/src/calculateCellHeight.js.map | 1 - .../src/calculateMaximumColumnWidths.d.ts | 7 - .../dist/src/calculateMaximumColumnWidths.js | 36 - .../src/calculateMaximumColumnWidths.js.map | 1 - .../dist/src/calculateOutputColumnWidths.d.ts | 2 - .../dist/src/calculateOutputColumnWidths.js | 10 - .../src/calculateOutputColumnWidths.js.map | 1 - .../table/dist/src/calculateRowHeights.d.ts | 5 - .../table/dist/src/calculateRowHeights.js | 42 - .../table/dist/src/calculateRowHeights.js.map | 1 - .../dist/src/calculateSpanningCellWidth.d.ts | 3 - .../dist/src/calculateSpanningCellWidth.js | 26 - .../src/calculateSpanningCellWidth.js.map | 1 - node_modules/table/dist/src/createStream.d.ts | 2 - node_modules/table/dist/src/createStream.js | 74 - .../table/dist/src/createStream.js.map | 1 - node_modules/table/dist/src/drawBorder.d.ts | 34 - node_modules/table/dist/src/drawBorder.js | 202 - node_modules/table/dist/src/drawBorder.js.map | 1 - node_modules/table/dist/src/drawContent.d.ts | 14 - node_modules/table/dist/src/drawContent.js | 51 - .../table/dist/src/drawContent.js.map | 1 - node_modules/table/dist/src/drawRow.d.ts | 10 - node_modules/table/dist/src/drawRow.js | 25 - node_modules/table/dist/src/drawRow.js.map | 1 - node_modules/table/dist/src/drawTable.d.ts | 2 - node_modules/table/dist/src/drawTable.js | 31 - node_modules/table/dist/src/drawTable.js.map | 1 - .../table/dist/src/generated/validators.d.ts | 13 - .../table/dist/src/generated/validators.js | 2694 ----- .../dist/src/generated/validators.js.map | 1 - .../table/dist/src/getBorderCharacters.d.ts | 2 - .../table/dist/src/getBorderCharacters.js | 105 - .../table/dist/src/getBorderCharacters.js.map | 1 - node_modules/table/dist/src/index.d.ts | 5 - node_modules/table/dist/src/index.js | 21 - node_modules/table/dist/src/index.js.map | 1 - .../table/dist/src/injectHeaderConfig.d.ts | 3 - .../table/dist/src/injectHeaderConfig.js | 29 - .../table/dist/src/injectHeaderConfig.js.map | 1 - .../table/dist/src/makeRangeConfig.d.ts | 3 - .../table/dist/src/makeRangeConfig.js | 18 - .../table/dist/src/makeRangeConfig.js.map | 1 - .../table/dist/src/makeStreamConfig.d.ts | 7 - .../table/dist/src/makeStreamConfig.js | 43 - .../table/dist/src/makeStreamConfig.js.map | 1 - .../table/dist/src/makeTableConfig.d.ts | 7 - .../table/dist/src/makeTableConfig.js | 62 - .../table/dist/src/makeTableConfig.js.map | 1 - .../dist/src/mapDataUsingRowHeights.d.ts | 4 - .../table/dist/src/mapDataUsingRowHeights.js | 52 - .../dist/src/mapDataUsingRowHeights.js.map | 1 - node_modules/table/dist/src/padTableData.d.ts | 3 - node_modules/table/dist/src/padTableData.js | 23 - .../table/dist/src/padTableData.js.map | 1 - .../table/dist/src/schemas/config.json | 95 - .../table/dist/src/schemas/shared.json | 139 - .../table/dist/src/schemas/streamConfig.json | 25 - .../table/dist/src/spanningCellManager.d.ts | 21 - .../table/dist/src/spanningCellManager.js | 86 - .../table/dist/src/spanningCellManager.js.map | 1 - .../table/dist/src/stringifyTableData.d.ts | 2 - .../table/dist/src/stringifyTableData.js | 13 - .../table/dist/src/stringifyTableData.js.map | 1 - node_modules/table/dist/src/table.d.ts | 2 - node_modules/table/dist/src/table.js | 31 - node_modules/table/dist/src/table.js.map | 1 - .../table/dist/src/truncateTableData.d.ts | 6 - .../table/dist/src/truncateTableData.js | 24 - .../table/dist/src/truncateTableData.js.map | 1 - node_modules/table/dist/src/types/api.d.ts | 130 - node_modules/table/dist/src/types/api.js | 3 - node_modules/table/dist/src/types/api.js.map | 1 - .../table/dist/src/types/internal.d.ts | 1 - node_modules/table/dist/src/types/internal.js | 3 - .../table/dist/src/types/internal.js.map | 1 - node_modules/table/dist/src/utils.d.ts | 10 - node_modules/table/dist/src/utils.js | 143 - node_modules/table/dist/src/utils.js.map | 1 - .../table/dist/src/validateConfig.d.ts | 2 - node_modules/table/dist/src/validateConfig.js | 27 - .../table/dist/src/validateConfig.js.map | 1 - .../dist/src/validateSpanningCellConfig.d.ts | 3 - .../dist/src/validateSpanningCellConfig.js | 46 - .../src/validateSpanningCellConfig.js.map | 1 - .../table/dist/src/validateTableData.d.ts | 1 - .../table/dist/src/validateTableData.js | 32 - .../table/dist/src/validateTableData.js.map | 1 - node_modules/table/dist/src/wrapCell.d.ts | 8 - node_modules/table/dist/src/wrapCell.js | 33 - node_modules/table/dist/src/wrapCell.js.map | 1 - node_modules/table/dist/src/wrapString.d.ts | 9 - node_modules/table/dist/src/wrapString.js | 27 - node_modules/table/dist/src/wrapString.js.map | 1 - node_modules/table/dist/src/wrapWord.d.ts | 1 - node_modules/table/dist/src/wrapWord.js | 42 - node_modules/table/dist/src/wrapWord.js.map | 1 - node_modules/table/package.json | 77 - node_modules/to-regex-range/LICENSE | 21 - node_modules/to-regex-range/README.md | 305 - node_modules/to-regex-range/index.js | 288 - node_modules/to-regex-range/package.json | 88 - node_modules/trim-newlines/index.d.ts | 42 - node_modules/trim-newlines/index.js | 35 - node_modules/trim-newlines/license | 9 - node_modules/trim-newlines/package.json | 46 - node_modules/trim-newlines/readme.md | 55 - node_modules/type-fest/base.d.ts | 42 - node_modules/type-fest/index.d.ts | 2 - node_modules/type-fest/license | 9 - node_modules/type-fest/package.json | 58 - node_modules/type-fest/readme.md | 794 -- .../type-fest/source/async-return-type.d.ts | 25 - node_modules/type-fest/source/asyncify.d.ts | 33 - node_modules/type-fest/source/basic.d.ts | 32 - .../type-fest/source/conditional-except.d.ts | 45 - .../type-fest/source/conditional-keys.d.ts | 45 - .../type-fest/source/conditional-pick.d.ts | 44 - node_modules/type-fest/source/entries.d.ts | 59 - node_modules/type-fest/source/entry.d.ts | 62 - node_modules/type-fest/source/except.d.ts | 24 - .../type-fest/source/fixed-length-array.d.ts | 40 - .../type-fest/source/iterable-element.d.ts | 48 - .../type-fest/source/literal-union.d.ts | 35 - .../type-fest/source/merge-exclusive.d.ts | 41 - node_modules/type-fest/source/merge.d.ts | 27 - node_modules/type-fest/source/mutable.d.ts | 40 - .../type-fest/source/observable-like.d.ts | 15 - node_modules/type-fest/source/opaque.d.ts | 67 - .../type-fest/source/package-json.d.ts | 645 -- .../type-fest/source/partial-deep.d.ts | 74 - node_modules/type-fest/source/primitive.d.ts | 13 - node_modules/type-fest/source/promisable.d.ts | 25 - .../type-fest/source/promise-value.d.ts | 29 - .../type-fest/source/readonly-deep.d.ts | 61 - .../source/require-at-least-one.d.ts | 35 - .../type-fest/source/require-exactly-one.d.ts | 37 - .../type-fest/source/set-optional.d.ts | 35 - .../type-fest/source/set-required.d.ts | 35 - .../type-fest/source/set-return-type.d.ts | 31 - node_modules/type-fest/source/simplify.d.ts | 24 - .../type-fest/source/stringified.d.ts | 23 - .../type-fest/source/tsconfig-json.d.ts | 1095 -- .../type-fest/source/typed-array.d.ts | 19 - .../source/union-to-intersection.d.ts | 60 - node_modules/type-fest/source/utilities.d.ts | 5 - node_modules/type-fest/source/value-of.d.ts | 42 - node_modules/type-fest/ts41/camel-case.d.ts | 72 - .../ts41/camel-cased-properties-deep.d.ts | 50 - .../ts41/camel-cased-properties.d.ts | 32 - .../type-fest/ts41/delimiter-case.d.ts | 88 - .../ts41/delimiter-cased-properties-deep.d.ts | 56 - .../ts41/delimiter-cased-properties.d.ts | 33 - node_modules/type-fest/ts41/get.d.ts | 135 - node_modules/type-fest/ts41/includes.d.ts | 31 - node_modules/type-fest/ts41/index.d.ts | 25 - node_modules/type-fest/ts41/kebab-case.d.ts | 37 - .../ts41/kebab-cased-properties-deep.d.ts | 43 - .../ts41/kebab-cased-properties.d.ts | 26 - .../type-fest/ts41/last-array-element.d.ts | 25 - node_modules/type-fest/ts41/pascal-case.d.ts | 37 - .../ts41/pascal-cased-properties-deep.d.ts | 50 - .../ts41/pascal-cased-properties.d.ts | 30 - .../type-fest/ts41/screaming-snake-case.d.ts | 32 - node_modules/type-fest/ts41/snake-case.d.ts | 37 - .../ts41/snake-cased-properties-deep.d.ts | 43 - .../ts41/snake-cased-properties.d.ts | 26 - node_modules/type-fest/ts41/split.d.ts | 28 - node_modules/type-fest/ts41/trim.d.ts | 24 - node_modules/type-fest/ts41/utilities.d.ts | 8 - node_modules/uri-js/LICENSE | 11 - node_modules/uri-js/README.md | 203 - node_modules/uri-js/dist/es5/uri.all.d.ts | 59 - node_modules/uri-js/dist/es5/uri.all.js | 1443 --- node_modules/uri-js/dist/es5/uri.all.js.map | 1 - node_modules/uri-js/dist/es5/uri.all.min.d.ts | 59 - node_modules/uri-js/dist/es5/uri.all.min.js | 3 - .../uri-js/dist/es5/uri.all.min.js.map | 1 - node_modules/uri-js/dist/esnext/index.d.ts | 1 - node_modules/uri-js/dist/esnext/index.js | 17 - node_modules/uri-js/dist/esnext/index.js.map | 1 - .../uri-js/dist/esnext/regexps-iri.d.ts | 3 - .../uri-js/dist/esnext/regexps-iri.js | 3 - .../uri-js/dist/esnext/regexps-iri.js.map | 1 - .../uri-js/dist/esnext/regexps-uri.d.ts | 4 - .../uri-js/dist/esnext/regexps-uri.js | 42 - .../uri-js/dist/esnext/regexps-uri.js.map | 1 - .../uri-js/dist/esnext/schemes/http.d.ts | 3 - .../uri-js/dist/esnext/schemes/http.js | 28 - .../uri-js/dist/esnext/schemes/http.js.map | 1 - .../uri-js/dist/esnext/schemes/https.d.ts | 3 - .../uri-js/dist/esnext/schemes/https.js | 9 - .../uri-js/dist/esnext/schemes/https.js.map | 1 - .../uri-js/dist/esnext/schemes/mailto.d.ts | 12 - .../uri-js/dist/esnext/schemes/mailto.js | 148 - .../uri-js/dist/esnext/schemes/mailto.js.map | 1 - .../uri-js/dist/esnext/schemes/urn-uuid.d.ts | 7 - .../uri-js/dist/esnext/schemes/urn-uuid.js | 23 - .../dist/esnext/schemes/urn-uuid.js.map | 1 - .../uri-js/dist/esnext/schemes/urn.d.ts | 10 - .../uri-js/dist/esnext/schemes/urn.js | 49 - .../uri-js/dist/esnext/schemes/urn.js.map | 1 - .../uri-js/dist/esnext/schemes/ws.d.ts | 7 - node_modules/uri-js/dist/esnext/schemes/ws.js | 41 - .../uri-js/dist/esnext/schemes/ws.js.map | 1 - .../uri-js/dist/esnext/schemes/wss.d.ts | 3 - .../uri-js/dist/esnext/schemes/wss.js | 9 - .../uri-js/dist/esnext/schemes/wss.js.map | 1 - node_modules/uri-js/dist/esnext/uri.d.ts | 59 - node_modules/uri-js/dist/esnext/uri.js | 480 - node_modules/uri-js/dist/esnext/uri.js.map | 1 - node_modules/uri-js/dist/esnext/util.d.ts | 6 - node_modules/uri-js/dist/esnext/util.js | 36 - node_modules/uri-js/dist/esnext/util.js.map | 1 - node_modules/uri-js/package.json | 77 - node_modules/uri-js/yarn.lock | 2558 ----- node_modules/util-deprecate/History.md | 16 - node_modules/util-deprecate/LICENSE | 24 - node_modules/util-deprecate/README.md | 53 - node_modules/util-deprecate/browser.js | 67 - node_modules/util-deprecate/node.js | 6 - node_modules/util-deprecate/package.json | 27 - .../validate-npm-package-license/LICENSE | 202 - .../validate-npm-package-license/README.md | 113 - .../validate-npm-package-license/index.js | 86 - .../validate-npm-package-license/package.json | 28 - node_modules/which/CHANGELOG.md | 152 - node_modules/which/LICENSE | 15 - node_modules/which/README.md | 51 - node_modules/which/bin/which | 52 - node_modules/which/package.json | 30 - node_modules/which/which.js | 135 - node_modules/wrappy/LICENSE | 15 - node_modules/wrappy/README.md | 36 - node_modules/wrappy/package.json | 29 - node_modules/wrappy/wrappy.js | 33 - node_modules/write-file-atomic/LICENSE.md | 6 - node_modules/write-file-atomic/README.md | 91 - node_modules/write-file-atomic/lib/index.js | 267 - node_modules/write-file-atomic/package.json | 57 - node_modules/yallist/LICENSE | 15 - node_modules/yallist/README.md | 204 - node_modules/yallist/iterator.js | 8 - node_modules/yallist/package.json | 29 - node_modules/yallist/yallist.js | 426 - node_modules/yargs-parser/CHANGELOG.md | 263 - node_modules/yargs-parser/LICENSE.txt | 14 - node_modules/yargs-parser/README.md | 518 - node_modules/yargs-parser/browser.js | 29 - node_modules/yargs-parser/build/index.cjs | 1042 -- node_modules/yargs-parser/build/lib/index.js | 59 - .../yargs-parser/build/lib/string-utils.js | 65 - .../build/lib/tokenize-arg-string.js | 40 - .../build/lib/yargs-parser-types.js | 12 - .../yargs-parser/build/lib/yargs-parser.js | 1037 -- node_modules/yargs-parser/package.json | 87 - node_modules/yocto-queue/index.d.ts | 56 - node_modules/yocto-queue/index.js | 68 - node_modules/yocto-queue/license | 9 - node_modules/yocto-queue/package.json | 43 - node_modules/yocto-queue/readme.md | 64 - 2952 files changed, 256295 deletions(-) delete mode 120000 node_modules/.bin/cssesc delete mode 120000 node_modules/.bin/js-yaml delete mode 120000 node_modules/.bin/nanoid delete mode 120000 node_modules/.bin/rimraf delete mode 120000 node_modules/.bin/semver delete mode 120000 node_modules/.bin/stylelint delete mode 120000 node_modules/.bin/which delete mode 100644 node_modules/.package-lock.json delete mode 100644 node_modules/@babel/code-frame/LICENSE delete mode 100644 node_modules/@babel/code-frame/README.md delete mode 100644 node_modules/@babel/code-frame/lib/index.js delete mode 100644 node_modules/@babel/code-frame/lib/index.js.map delete mode 100644 node_modules/@babel/code-frame/package.json delete mode 100644 node_modules/@babel/helper-validator-identifier/LICENSE delete mode 100644 node_modules/@babel/helper-validator-identifier/README.md delete mode 100644 node_modules/@babel/helper-validator-identifier/lib/identifier.js delete mode 100644 node_modules/@babel/helper-validator-identifier/lib/identifier.js.map delete mode 100644 node_modules/@babel/helper-validator-identifier/lib/index.js delete mode 100644 node_modules/@babel/helper-validator-identifier/lib/index.js.map delete mode 100644 node_modules/@babel/helper-validator-identifier/lib/keyword.js delete mode 100644 node_modules/@babel/helper-validator-identifier/lib/keyword.js.map delete mode 100644 node_modules/@babel/helper-validator-identifier/package.json delete mode 100644 node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js delete mode 100644 node_modules/@babel/highlight/LICENSE delete mode 100644 node_modules/@babel/highlight/README.md delete mode 100644 node_modules/@babel/highlight/lib/index.js delete mode 100644 node_modules/@babel/highlight/lib/index.js.map delete mode 100644 node_modules/@babel/highlight/package.json delete mode 100644 node_modules/@csstools/css-parser-algorithms/CHANGELOG.md delete mode 100644 node_modules/@csstools/css-parser-algorithms/LICENSE.md delete mode 100644 node_modules/@csstools/css-parser-algorithms/README.md delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/index.cjs delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/index.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/index.mjs delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/interfaces/context.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/parse/parse-component-value.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/component-value-type.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/node-ancestry.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/replace-component-values.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/source-indices.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/stringify.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/type-predicates.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/package.json delete mode 100644 node_modules/@csstools/css-tokenizer/CHANGELOG.md delete mode 100644 node_modules/@csstools/css-tokenizer/LICENSE.md delete mode 100644 node_modules/@csstools/css-tokenizer/README.md delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/matches-url-ident.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/code-points/code-points.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/code-points/ranges.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/bad-url.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/comment.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/escaped-code-point.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/hash-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/ident-like-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/ident-sequence.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/number.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/numeric-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/string-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/url-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/whitespace-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/index.cjs delete mode 100644 node_modules/@csstools/css-tokenizer/dist/index.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/index.mjs delete mode 100644 node_modules/@csstools/css-tokenizer/dist/interfaces/code-point-reader.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/interfaces/context.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/interfaces/error.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/interfaces/token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/reader.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/stringify.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/tokenizer.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/util/clone-tokens.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/util/mutations.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/package.json delete mode 100644 node_modules/@csstools/media-query-list-parser/CHANGELOG.md delete mode 100644 node_modules/@csstools/media-query-list-parser/LICENSE.md delete mode 100644 node_modules/@csstools/media-query-list-parser/README.md delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/index.cjs delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/index.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/index.mjs delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/custom-media.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/package.json delete mode 100644 node_modules/@csstools/selector-specificity/CHANGELOG.md delete mode 100644 node_modules/@csstools/selector-specificity/LICENSE.md delete mode 100644 node_modules/@csstools/selector-specificity/README.md delete mode 100644 node_modules/@csstools/selector-specificity/dist/index.cjs delete mode 100644 node_modules/@csstools/selector-specificity/dist/index.d.ts delete mode 100644 node_modules/@csstools/selector-specificity/dist/index.mjs delete mode 100644 node_modules/@csstools/selector-specificity/dist/to-lower-case-a-z.d.ts delete mode 100644 node_modules/@csstools/selector-specificity/package.json delete mode 100644 node_modules/@nodelib/fs.scandir/LICENSE delete mode 100644 node_modules/@nodelib/fs.scandir/README.md delete mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/constants.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/constants.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/index.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/index.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/settings.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/settings.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.js delete mode 100644 node_modules/@nodelib/fs.scandir/package.json delete mode 100644 node_modules/@nodelib/fs.stat/LICENSE delete mode 100644 node_modules/@nodelib/fs.stat/README.md delete mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts delete mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.js delete mode 100644 node_modules/@nodelib/fs.stat/out/index.d.ts delete mode 100644 node_modules/@nodelib/fs.stat/out/index.js delete mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.d.ts delete mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.js delete mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.d.ts delete mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.js delete mode 100644 node_modules/@nodelib/fs.stat/out/settings.d.ts delete mode 100644 node_modules/@nodelib/fs.stat/out/settings.js delete mode 100644 node_modules/@nodelib/fs.stat/out/types/index.d.ts delete mode 100644 node_modules/@nodelib/fs.stat/out/types/index.js delete mode 100644 node_modules/@nodelib/fs.stat/package.json delete mode 100644 node_modules/@nodelib/fs.walk/LICENSE delete mode 100644 node_modules/@nodelib/fs.walk/README.md delete mode 100644 node_modules/@nodelib/fs.walk/out/index.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/index.js delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.js delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.js delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.js delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.js delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.js delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.js delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.js delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.js delete mode 100644 node_modules/@nodelib/fs.walk/out/settings.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/settings.js delete mode 100644 node_modules/@nodelib/fs.walk/out/types/index.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/types/index.js delete mode 100644 node_modules/@nodelib/fs.walk/package.json delete mode 100755 node_modules/@types/minimist/LICENSE delete mode 100755 node_modules/@types/minimist/README.md delete mode 100755 node_modules/@types/minimist/index.d.ts delete mode 100755 node_modules/@types/minimist/package.json delete mode 100755 node_modules/@types/normalize-package-data/LICENSE delete mode 100755 node_modules/@types/normalize-package-data/README.md delete mode 100755 node_modules/@types/normalize-package-data/index.d.ts delete mode 100755 node_modules/@types/normalize-package-data/package.json delete mode 100644 node_modules/ajv/.runkit_example.js delete mode 100644 node_modules/ajv/LICENSE delete mode 100644 node_modules/ajv/README.md delete mode 100644 node_modules/ajv/dist/2019.d.ts delete mode 100644 node_modules/ajv/dist/2019.js delete mode 100644 node_modules/ajv/dist/2019.js.map delete mode 100644 node_modules/ajv/dist/2020.d.ts delete mode 100644 node_modules/ajv/dist/2020.js delete mode 100644 node_modules/ajv/dist/2020.js.map delete mode 100644 node_modules/ajv/dist/ajv.d.ts delete mode 100644 node_modules/ajv/dist/ajv.js delete mode 100644 node_modules/ajv/dist/ajv.js.map delete mode 100644 node_modules/ajv/dist/compile/codegen/code.d.ts delete mode 100644 node_modules/ajv/dist/compile/codegen/code.js delete mode 100644 node_modules/ajv/dist/compile/codegen/code.js.map delete mode 100644 node_modules/ajv/dist/compile/codegen/index.d.ts delete mode 100644 node_modules/ajv/dist/compile/codegen/index.js delete mode 100644 node_modules/ajv/dist/compile/codegen/index.js.map delete mode 100644 node_modules/ajv/dist/compile/codegen/scope.d.ts delete mode 100644 node_modules/ajv/dist/compile/codegen/scope.js delete mode 100644 node_modules/ajv/dist/compile/codegen/scope.js.map delete mode 100644 node_modules/ajv/dist/compile/errors.d.ts delete mode 100644 node_modules/ajv/dist/compile/errors.js delete mode 100644 node_modules/ajv/dist/compile/errors.js.map delete mode 100644 node_modules/ajv/dist/compile/index.d.ts delete mode 100644 node_modules/ajv/dist/compile/index.js delete mode 100644 node_modules/ajv/dist/compile/index.js.map delete mode 100644 node_modules/ajv/dist/compile/jtd/parse.d.ts delete mode 100644 node_modules/ajv/dist/compile/jtd/parse.js delete mode 100644 node_modules/ajv/dist/compile/jtd/parse.js.map delete mode 100644 node_modules/ajv/dist/compile/jtd/serialize.d.ts delete mode 100644 node_modules/ajv/dist/compile/jtd/serialize.js delete mode 100644 node_modules/ajv/dist/compile/jtd/serialize.js.map delete mode 100644 node_modules/ajv/dist/compile/jtd/types.d.ts delete mode 100644 node_modules/ajv/dist/compile/jtd/types.js delete mode 100644 node_modules/ajv/dist/compile/jtd/types.js.map delete mode 100644 node_modules/ajv/dist/compile/names.d.ts delete mode 100644 node_modules/ajv/dist/compile/names.js delete mode 100644 node_modules/ajv/dist/compile/names.js.map delete mode 100644 node_modules/ajv/dist/compile/ref_error.d.ts delete mode 100644 node_modules/ajv/dist/compile/ref_error.js delete mode 100644 node_modules/ajv/dist/compile/ref_error.js.map delete mode 100644 node_modules/ajv/dist/compile/resolve.d.ts delete mode 100644 node_modules/ajv/dist/compile/resolve.js delete mode 100644 node_modules/ajv/dist/compile/resolve.js.map delete mode 100644 node_modules/ajv/dist/compile/rules.d.ts delete mode 100644 node_modules/ajv/dist/compile/rules.js delete mode 100644 node_modules/ajv/dist/compile/rules.js.map delete mode 100644 node_modules/ajv/dist/compile/util.d.ts delete mode 100644 node_modules/ajv/dist/compile/util.js delete mode 100644 node_modules/ajv/dist/compile/util.js.map delete mode 100644 node_modules/ajv/dist/compile/validate/applicability.d.ts delete mode 100644 node_modules/ajv/dist/compile/validate/applicability.js delete mode 100644 node_modules/ajv/dist/compile/validate/applicability.js.map delete mode 100644 node_modules/ajv/dist/compile/validate/boolSchema.d.ts delete mode 100644 node_modules/ajv/dist/compile/validate/boolSchema.js delete mode 100644 node_modules/ajv/dist/compile/validate/boolSchema.js.map delete mode 100644 node_modules/ajv/dist/compile/validate/dataType.d.ts delete mode 100644 node_modules/ajv/dist/compile/validate/dataType.js delete mode 100644 node_modules/ajv/dist/compile/validate/dataType.js.map delete mode 100644 node_modules/ajv/dist/compile/validate/defaults.d.ts delete mode 100644 node_modules/ajv/dist/compile/validate/defaults.js delete mode 100644 node_modules/ajv/dist/compile/validate/defaults.js.map delete mode 100644 node_modules/ajv/dist/compile/validate/index.d.ts delete mode 100644 node_modules/ajv/dist/compile/validate/index.js delete mode 100644 node_modules/ajv/dist/compile/validate/index.js.map delete mode 100644 node_modules/ajv/dist/compile/validate/keyword.d.ts delete mode 100644 node_modules/ajv/dist/compile/validate/keyword.js delete mode 100644 node_modules/ajv/dist/compile/validate/keyword.js.map delete mode 100644 node_modules/ajv/dist/compile/validate/subschema.d.ts delete mode 100644 node_modules/ajv/dist/compile/validate/subschema.js delete mode 100644 node_modules/ajv/dist/compile/validate/subschema.js.map delete mode 100644 node_modules/ajv/dist/core.d.ts delete mode 100644 node_modules/ajv/dist/core.js delete mode 100644 node_modules/ajv/dist/core.js.map delete mode 100644 node_modules/ajv/dist/jtd.d.ts delete mode 100644 node_modules/ajv/dist/jtd.js delete mode 100644 node_modules/ajv/dist/jtd.js.map delete mode 100644 node_modules/ajv/dist/refs/data.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts delete mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/index.js delete mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map delete mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2019-09/schema.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts delete mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/index.js delete mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map delete mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-2020-12/schema.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-draft-06.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-draft-07.json delete mode 100644 node_modules/ajv/dist/refs/json-schema-secure.json delete mode 100644 node_modules/ajv/dist/refs/jtd-schema.d.ts delete mode 100644 node_modules/ajv/dist/refs/jtd-schema.js delete mode 100644 node_modules/ajv/dist/refs/jtd-schema.js.map delete mode 100644 node_modules/ajv/dist/runtime/equal.d.ts delete mode 100644 node_modules/ajv/dist/runtime/equal.js delete mode 100644 node_modules/ajv/dist/runtime/equal.js.map delete mode 100644 node_modules/ajv/dist/runtime/parseJson.d.ts delete mode 100644 node_modules/ajv/dist/runtime/parseJson.js delete mode 100644 node_modules/ajv/dist/runtime/parseJson.js.map delete mode 100644 node_modules/ajv/dist/runtime/quote.d.ts delete mode 100644 node_modules/ajv/dist/runtime/quote.js delete mode 100644 node_modules/ajv/dist/runtime/quote.js.map delete mode 100644 node_modules/ajv/dist/runtime/re2.d.ts delete mode 100644 node_modules/ajv/dist/runtime/re2.js delete mode 100644 node_modules/ajv/dist/runtime/re2.js.map delete mode 100644 node_modules/ajv/dist/runtime/timestamp.d.ts delete mode 100644 node_modules/ajv/dist/runtime/timestamp.js delete mode 100644 node_modules/ajv/dist/runtime/timestamp.js.map delete mode 100644 node_modules/ajv/dist/runtime/ucs2length.d.ts delete mode 100644 node_modules/ajv/dist/runtime/ucs2length.js delete mode 100644 node_modules/ajv/dist/runtime/ucs2length.js.map delete mode 100644 node_modules/ajv/dist/runtime/uri.d.ts delete mode 100644 node_modules/ajv/dist/runtime/uri.js delete mode 100644 node_modules/ajv/dist/runtime/uri.js.map delete mode 100644 node_modules/ajv/dist/runtime/validation_error.d.ts delete mode 100644 node_modules/ajv/dist/runtime/validation_error.js delete mode 100644 node_modules/ajv/dist/runtime/validation_error.js.map delete mode 100644 node_modules/ajv/dist/standalone/index.d.ts delete mode 100644 node_modules/ajv/dist/standalone/index.js delete mode 100644 node_modules/ajv/dist/standalone/index.js.map delete mode 100644 node_modules/ajv/dist/standalone/instance.d.ts delete mode 100644 node_modules/ajv/dist/standalone/instance.js delete mode 100644 node_modules/ajv/dist/standalone/instance.js.map delete mode 100644 node_modules/ajv/dist/types/index.d.ts delete mode 100644 node_modules/ajv/dist/types/index.js delete mode 100644 node_modules/ajv/dist/types/index.js.map delete mode 100644 node_modules/ajv/dist/types/json-schema.d.ts delete mode 100644 node_modules/ajv/dist/types/json-schema.js delete mode 100644 node_modules/ajv/dist/types/json-schema.js.map delete mode 100644 node_modules/ajv/dist/types/jtd-schema.d.ts delete mode 100644 node_modules/ajv/dist/types/jtd-schema.js delete mode 100644 node_modules/ajv/dist/types/jtd-schema.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/additionalItems.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/allOf.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/allOf.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/anyOf.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/contains.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/contains.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/contains.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/dependencies.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/if.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/if.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/if.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/index.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/index.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/index.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/items.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/items.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/items.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/items2020.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/items2020.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/not.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/not.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/not.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/oneOf.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/patternProperties.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/prefixItems.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/properties.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/properties.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/properties.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/propertyNames.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/thenElse.js delete mode 100644 node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/code.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/code.js delete mode 100644 node_modules/ajv/dist/vocabularies/code.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/core/id.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/core/id.js delete mode 100644 node_modules/ajv/dist/vocabularies/core/id.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/core/index.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/core/index.js delete mode 100644 node_modules/ajv/dist/vocabularies/core/index.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/core/ref.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/core/ref.js delete mode 100644 node_modules/ajv/dist/vocabularies/core/ref.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/discriminator/index.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/discriminator/index.js delete mode 100644 node_modules/ajv/dist/vocabularies/discriminator/index.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/discriminator/types.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/discriminator/types.js delete mode 100644 node_modules/ajv/dist/vocabularies/discriminator/types.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/draft2020.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/draft2020.js delete mode 100644 node_modules/ajv/dist/vocabularies/draft2020.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/draft7.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/draft7.js delete mode 100644 node_modules/ajv/dist/vocabularies/draft7.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/index.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/index.js delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/index.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js delete mode 100644 node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/errors.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/errors.js delete mode 100644 node_modules/ajv/dist/vocabularies/errors.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/format/format.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/format/format.js delete mode 100644 node_modules/ajv/dist/vocabularies/format/format.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/format/index.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/format/index.js delete mode 100644 node_modules/ajv/dist/vocabularies/format/index.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/discriminator.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/elements.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/elements.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/elements.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/enum.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/enum.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/enum.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/error.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/error.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/error.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/index.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/index.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/index.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/metadata.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/metadata.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/nullable.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/nullable.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/properties.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/properties.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/properties.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/ref.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/ref.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/ref.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/type.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/type.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/type.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/union.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/union.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/union.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/values.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/values.js delete mode 100644 node_modules/ajv/dist/vocabularies/jtd/values.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/metadata.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/metadata.js delete mode 100644 node_modules/ajv/dist/vocabularies/metadata.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/next.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/next.js delete mode 100644 node_modules/ajv/dist/vocabularies/next.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/index.js delete mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/index.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js delete mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js delete mode 100644 node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/const.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/const.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/const.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/dependentRequired.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/enum.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/enum.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/enum.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/index.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/index.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/index.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitContains.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitContains.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitItems.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitItems.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitLength.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitLength.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitNumber.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitProperties.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/multipleOf.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/pattern.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/pattern.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/pattern.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/required.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/required.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/required.js.map delete mode 100644 node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts delete mode 100644 node_modules/ajv/dist/vocabularies/validation/uniqueItems.js delete mode 100644 node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map delete mode 100644 node_modules/ajv/lib/2019.ts delete mode 100644 node_modules/ajv/lib/2020.ts delete mode 100644 node_modules/ajv/lib/ajv.ts delete mode 100644 node_modules/ajv/lib/compile/codegen/code.ts delete mode 100644 node_modules/ajv/lib/compile/codegen/index.ts delete mode 100644 node_modules/ajv/lib/compile/codegen/scope.ts delete mode 100644 node_modules/ajv/lib/compile/errors.ts delete mode 100644 node_modules/ajv/lib/compile/index.ts delete mode 100644 node_modules/ajv/lib/compile/jtd/parse.ts delete mode 100644 node_modules/ajv/lib/compile/jtd/serialize.ts delete mode 100644 node_modules/ajv/lib/compile/jtd/types.ts delete mode 100644 node_modules/ajv/lib/compile/names.ts delete mode 100644 node_modules/ajv/lib/compile/ref_error.ts delete mode 100644 node_modules/ajv/lib/compile/resolve.ts delete mode 100644 node_modules/ajv/lib/compile/rules.ts delete mode 100644 node_modules/ajv/lib/compile/util.ts delete mode 100644 node_modules/ajv/lib/compile/validate/applicability.ts delete mode 100644 node_modules/ajv/lib/compile/validate/boolSchema.ts delete mode 100644 node_modules/ajv/lib/compile/validate/dataType.ts delete mode 100644 node_modules/ajv/lib/compile/validate/defaults.ts delete mode 100644 node_modules/ajv/lib/compile/validate/index.ts delete mode 100644 node_modules/ajv/lib/compile/validate/keyword.ts delete mode 100644 node_modules/ajv/lib/compile/validate/subschema.ts delete mode 100644 node_modules/ajv/lib/core.ts delete mode 100644 node_modules/ajv/lib/jtd.ts delete mode 100644 node_modules/ajv/lib/refs/data.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/index.ts delete mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2019-09/schema.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/index.ts delete mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-2020-12/schema.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-draft-06.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-draft-07.json delete mode 100644 node_modules/ajv/lib/refs/json-schema-secure.json delete mode 100644 node_modules/ajv/lib/refs/jtd-schema.ts delete mode 100644 node_modules/ajv/lib/runtime/equal.ts delete mode 100644 node_modules/ajv/lib/runtime/parseJson.ts delete mode 100644 node_modules/ajv/lib/runtime/quote.ts delete mode 100644 node_modules/ajv/lib/runtime/re2.ts delete mode 100644 node_modules/ajv/lib/runtime/timestamp.ts delete mode 100644 node_modules/ajv/lib/runtime/ucs2length.ts delete mode 100644 node_modules/ajv/lib/runtime/uri.ts delete mode 100644 node_modules/ajv/lib/runtime/validation_error.ts delete mode 100644 node_modules/ajv/lib/standalone/index.ts delete mode 100644 node_modules/ajv/lib/standalone/instance.ts delete mode 100644 node_modules/ajv/lib/types/index.ts delete mode 100644 node_modules/ajv/lib/types/json-schema.ts delete mode 100644 node_modules/ajv/lib/types/jtd-schema.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/allOf.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/anyOf.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/contains.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/dependencies.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/if.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/index.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/items.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/items2020.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/not.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/oneOf.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/properties.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts delete mode 100644 node_modules/ajv/lib/vocabularies/applicator/thenElse.ts delete mode 100644 node_modules/ajv/lib/vocabularies/code.ts delete mode 100644 node_modules/ajv/lib/vocabularies/core/id.ts delete mode 100644 node_modules/ajv/lib/vocabularies/core/index.ts delete mode 100644 node_modules/ajv/lib/vocabularies/core/ref.ts delete mode 100644 node_modules/ajv/lib/vocabularies/discriminator/index.ts delete mode 100644 node_modules/ajv/lib/vocabularies/discriminator/types.ts delete mode 100644 node_modules/ajv/lib/vocabularies/draft2020.ts delete mode 100644 node_modules/ajv/lib/vocabularies/draft7.ts delete mode 100644 node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts delete mode 100644 node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts delete mode 100644 node_modules/ajv/lib/vocabularies/dynamic/index.ts delete mode 100644 node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts delete mode 100644 node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts delete mode 100644 node_modules/ajv/lib/vocabularies/errors.ts delete mode 100644 node_modules/ajv/lib/vocabularies/format/format.ts delete mode 100644 node_modules/ajv/lib/vocabularies/format/index.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/discriminator.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/elements.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/enum.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/error.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/index.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/metadata.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/nullable.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/properties.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/ref.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/type.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/union.ts delete mode 100644 node_modules/ajv/lib/vocabularies/jtd/values.ts delete mode 100644 node_modules/ajv/lib/vocabularies/metadata.ts delete mode 100644 node_modules/ajv/lib/vocabularies/next.ts delete mode 100644 node_modules/ajv/lib/vocabularies/unevaluated/index.ts delete mode 100644 node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts delete mode 100644 node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/const.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/enum.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/index.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/limitContains.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/limitItems.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/limitLength.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/limitNumber.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/limitProperties.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/multipleOf.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/pattern.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/required.ts delete mode 100644 node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts delete mode 100644 node_modules/ajv/package.json delete mode 100644 node_modules/ansi-regex/index.d.ts delete mode 100644 node_modules/ansi-regex/index.js delete mode 100644 node_modules/ansi-regex/license delete mode 100644 node_modules/ansi-regex/package.json delete mode 100644 node_modules/ansi-regex/readme.md delete mode 100644 node_modules/ansi-styles/index.js delete mode 100644 node_modules/ansi-styles/license delete mode 100644 node_modules/ansi-styles/package.json delete mode 100644 node_modules/ansi-styles/readme.md delete mode 100644 node_modules/argparse/CHANGELOG.md delete mode 100644 node_modules/argparse/LICENSE delete mode 100644 node_modules/argparse/README.md delete mode 100644 node_modules/argparse/argparse.js delete mode 100644 node_modules/argparse/lib/sub.js delete mode 100644 node_modules/argparse/lib/textwrap.js delete mode 100644 node_modules/argparse/package.json delete mode 100644 node_modules/array-union/index.d.ts delete mode 100644 node_modules/array-union/index.js delete mode 100644 node_modules/array-union/license delete mode 100644 node_modules/array-union/package.json delete mode 100644 node_modules/array-union/readme.md delete mode 100644 node_modules/arrify/index.js delete mode 100644 node_modules/arrify/license delete mode 100644 node_modules/arrify/package.json delete mode 100644 node_modules/arrify/readme.md delete mode 100644 node_modules/astral-regex/index.d.ts delete mode 100644 node_modules/astral-regex/index.js delete mode 100644 node_modules/astral-regex/license delete mode 100644 node_modules/astral-regex/package.json delete mode 100644 node_modules/astral-regex/readme.md delete mode 100644 node_modules/balanced-match/.github/FUNDING.yml delete mode 100644 node_modules/balanced-match/LICENSE.md delete mode 100644 node_modules/balanced-match/README.md delete mode 100644 node_modules/balanced-match/index.js delete mode 100644 node_modules/balanced-match/package.json delete mode 100644 node_modules/brace-expansion/LICENSE delete mode 100644 node_modules/brace-expansion/README.md delete mode 100644 node_modules/brace-expansion/index.js delete mode 100644 node_modules/brace-expansion/node_modules/balanced-match/.github/FUNDING.yml delete mode 100644 node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md delete mode 100644 node_modules/brace-expansion/node_modules/balanced-match/README.md delete mode 100644 node_modules/brace-expansion/node_modules/balanced-match/index.js delete mode 100644 node_modules/brace-expansion/node_modules/balanced-match/package.json delete mode 100644 node_modules/brace-expansion/package.json delete mode 100644 node_modules/braces/CHANGELOG.md delete mode 100644 node_modules/braces/LICENSE delete mode 100644 node_modules/braces/README.md delete mode 100644 node_modules/braces/index.js delete mode 100644 node_modules/braces/lib/compile.js delete mode 100644 node_modules/braces/lib/constants.js delete mode 100644 node_modules/braces/lib/expand.js delete mode 100644 node_modules/braces/lib/parse.js delete mode 100644 node_modules/braces/lib/stringify.js delete mode 100644 node_modules/braces/lib/utils.js delete mode 100644 node_modules/braces/package.json delete mode 100644 node_modules/callsites/index.d.ts delete mode 100644 node_modules/callsites/index.js delete mode 100644 node_modules/callsites/license delete mode 100644 node_modules/callsites/package.json delete mode 100644 node_modules/callsites/readme.md delete mode 100644 node_modules/camelcase-keys/index.d.ts delete mode 100644 node_modules/camelcase-keys/index.js delete mode 100644 node_modules/camelcase-keys/license delete mode 100644 node_modules/camelcase-keys/package.json delete mode 100644 node_modules/camelcase-keys/readme.md delete mode 100644 node_modules/camelcase/index.d.ts delete mode 100644 node_modules/camelcase/index.js delete mode 100644 node_modules/camelcase/license delete mode 100644 node_modules/camelcase/package.json delete mode 100644 node_modules/camelcase/readme.md delete mode 100644 node_modules/chalk/index.js delete mode 100644 node_modules/chalk/index.js.flow delete mode 100644 node_modules/chalk/license delete mode 100644 node_modules/chalk/package.json delete mode 100644 node_modules/chalk/readme.md delete mode 100644 node_modules/chalk/templates.js delete mode 100644 node_modules/chalk/types/index.d.ts delete mode 100644 node_modules/color-convert/CHANGELOG.md delete mode 100644 node_modules/color-convert/LICENSE delete mode 100644 node_modules/color-convert/README.md delete mode 100644 node_modules/color-convert/conversions.js delete mode 100644 node_modules/color-convert/index.js delete mode 100644 node_modules/color-convert/package.json delete mode 100644 node_modules/color-convert/route.js delete mode 100644 node_modules/color-name/.eslintrc.json delete mode 100644 node_modules/color-name/.npmignore delete mode 100644 node_modules/color-name/LICENSE delete mode 100644 node_modules/color-name/README.md delete mode 100644 node_modules/color-name/index.js delete mode 100644 node_modules/color-name/package.json delete mode 100644 node_modules/color-name/test.js delete mode 100644 node_modules/colord/CHANGELOG.md delete mode 100644 node_modules/colord/LICENSE.md delete mode 100644 node_modules/colord/README.md delete mode 100644 node_modules/colord/colord.d.ts delete mode 100644 node_modules/colord/constants.d.ts delete mode 100644 node_modules/colord/extend.d.ts delete mode 100644 node_modules/colord/helpers.d.ts delete mode 100644 node_modules/colord/index.d.ts delete mode 100644 node_modules/colord/index.js delete mode 100644 node_modules/colord/index.mjs delete mode 100644 node_modules/colord/package.json delete mode 100644 node_modules/colord/parse.d.ts delete mode 100644 node_modules/colord/plugins/a11y.d.ts delete mode 100644 node_modules/colord/plugins/a11y.js delete mode 100644 node_modules/colord/plugins/a11y.mjs delete mode 100644 node_modules/colord/plugins/cmyk.d.ts delete mode 100644 node_modules/colord/plugins/cmyk.js delete mode 100644 node_modules/colord/plugins/cmyk.mjs delete mode 100644 node_modules/colord/plugins/harmonies.d.ts delete mode 100644 node_modules/colord/plugins/harmonies.js delete mode 100644 node_modules/colord/plugins/harmonies.mjs delete mode 100644 node_modules/colord/plugins/hwb.d.ts delete mode 100644 node_modules/colord/plugins/hwb.js delete mode 100644 node_modules/colord/plugins/hwb.mjs delete mode 100644 node_modules/colord/plugins/lab.d.ts delete mode 100644 node_modules/colord/plugins/lab.js delete mode 100644 node_modules/colord/plugins/lab.mjs delete mode 100644 node_modules/colord/plugins/lch.d.ts delete mode 100644 node_modules/colord/plugins/lch.js delete mode 100644 node_modules/colord/plugins/lch.mjs delete mode 100644 node_modules/colord/plugins/minify.d.ts delete mode 100644 node_modules/colord/plugins/minify.js delete mode 100644 node_modules/colord/plugins/minify.mjs delete mode 100644 node_modules/colord/plugins/mix.d.ts delete mode 100644 node_modules/colord/plugins/mix.js delete mode 100644 node_modules/colord/plugins/mix.mjs delete mode 100644 node_modules/colord/plugins/names.d.ts delete mode 100644 node_modules/colord/plugins/names.js delete mode 100644 node_modules/colord/plugins/names.mjs delete mode 100644 node_modules/colord/plugins/xyz.d.ts delete mode 100644 node_modules/colord/plugins/xyz.js delete mode 100644 node_modules/colord/plugins/xyz.mjs delete mode 100644 node_modules/colord/random.d.ts delete mode 100644 node_modules/colord/types.d.ts delete mode 100644 node_modules/concat-map/.travis.yml delete mode 100644 node_modules/concat-map/LICENSE delete mode 100644 node_modules/concat-map/README.markdown delete mode 100644 node_modules/concat-map/example/map.js delete mode 100644 node_modules/concat-map/index.js delete mode 100644 node_modules/concat-map/package.json delete mode 100644 node_modules/concat-map/test/map.js delete mode 100644 node_modules/cosmiconfig/LICENSE delete mode 100644 node_modules/cosmiconfig/README.md delete mode 100644 node_modules/cosmiconfig/dist/Explorer.d.ts delete mode 100644 node_modules/cosmiconfig/dist/Explorer.d.ts.map delete mode 100644 node_modules/cosmiconfig/dist/Explorer.js delete mode 100644 node_modules/cosmiconfig/dist/Explorer.js.map delete mode 100644 node_modules/cosmiconfig/dist/ExplorerBase.d.ts delete mode 100644 node_modules/cosmiconfig/dist/ExplorerBase.d.ts.map delete mode 100644 node_modules/cosmiconfig/dist/ExplorerBase.js delete mode 100644 node_modules/cosmiconfig/dist/ExplorerBase.js.map delete mode 100644 node_modules/cosmiconfig/dist/ExplorerSync.d.ts delete mode 100644 node_modules/cosmiconfig/dist/ExplorerSync.d.ts.map delete mode 100644 node_modules/cosmiconfig/dist/ExplorerSync.js delete mode 100644 node_modules/cosmiconfig/dist/ExplorerSync.js.map delete mode 100644 node_modules/cosmiconfig/dist/cacheWrapper.d.ts delete mode 100644 node_modules/cosmiconfig/dist/cacheWrapper.d.ts.map delete mode 100644 node_modules/cosmiconfig/dist/cacheWrapper.js delete mode 100644 node_modules/cosmiconfig/dist/cacheWrapper.js.map delete mode 100644 node_modules/cosmiconfig/dist/canUseDynamicImport.d.ts delete mode 100644 node_modules/cosmiconfig/dist/canUseDynamicImport.d.ts.map delete mode 100644 node_modules/cosmiconfig/dist/canUseDynamicImport.js delete mode 100644 node_modules/cosmiconfig/dist/canUseDynamicImport.js.map delete mode 100644 node_modules/cosmiconfig/dist/getDirectory.d.ts delete mode 100644 node_modules/cosmiconfig/dist/getDirectory.d.ts.map delete mode 100644 node_modules/cosmiconfig/dist/getDirectory.js delete mode 100644 node_modules/cosmiconfig/dist/getDirectory.js.map delete mode 100644 node_modules/cosmiconfig/dist/getPropertyByPath.d.ts delete mode 100644 node_modules/cosmiconfig/dist/getPropertyByPath.d.ts.map delete mode 100644 node_modules/cosmiconfig/dist/getPropertyByPath.js delete mode 100644 node_modules/cosmiconfig/dist/getPropertyByPath.js.map delete mode 100644 node_modules/cosmiconfig/dist/index.d.ts delete mode 100644 node_modules/cosmiconfig/dist/index.d.ts.map delete mode 100644 node_modules/cosmiconfig/dist/index.js delete mode 100644 node_modules/cosmiconfig/dist/index.js.map delete mode 100644 node_modules/cosmiconfig/dist/loaders.d.ts delete mode 100644 node_modules/cosmiconfig/dist/loaders.d.ts.map delete mode 100644 node_modules/cosmiconfig/dist/loaders.js delete mode 100644 node_modules/cosmiconfig/dist/loaders.js.map delete mode 100644 node_modules/cosmiconfig/dist/readFile.d.ts delete mode 100644 node_modules/cosmiconfig/dist/readFile.d.ts.map delete mode 100644 node_modules/cosmiconfig/dist/readFile.js delete mode 100644 node_modules/cosmiconfig/dist/readFile.js.map delete mode 100644 node_modules/cosmiconfig/dist/types.d.ts delete mode 100644 node_modules/cosmiconfig/dist/types.d.ts.map delete mode 100644 node_modules/cosmiconfig/dist/types.js delete mode 100644 node_modules/cosmiconfig/dist/types.js.map delete mode 100644 node_modules/cosmiconfig/package.json delete mode 100644 node_modules/css-functions-list/CHANGELOG.md delete mode 100644 node_modules/css-functions-list/LICENSE.md delete mode 100644 node_modules/css-functions-list/README.md delete mode 100644 node_modules/css-functions-list/cjs/index.d.ts delete mode 100644 node_modules/css-functions-list/cjs/index.d.ts.map delete mode 100644 node_modules/css-functions-list/cjs/index.js delete mode 100644 node_modules/css-functions-list/cjs/index.js.map delete mode 100644 node_modules/css-functions-list/cjs/index.json delete mode 100644 node_modules/css-functions-list/cjs/package.json delete mode 100644 node_modules/css-functions-list/esm/index.d.ts delete mode 100644 node_modules/css-functions-list/esm/index.d.ts.map delete mode 100644 node_modules/css-functions-list/esm/index.js delete mode 100644 node_modules/css-functions-list/esm/index.js.map delete mode 100644 node_modules/css-functions-list/esm/index.json delete mode 100644 node_modules/css-functions-list/esm/package.json delete mode 100644 node_modules/css-functions-list/package.json delete mode 100644 node_modules/css-tree/LICENSE delete mode 100644 node_modules/css-tree/README.md delete mode 100644 node_modules/css-tree/cjs/convertor/create.cjs delete mode 100644 node_modules/css-tree/cjs/convertor/index.cjs delete mode 100644 node_modules/css-tree/cjs/data-patch.cjs delete mode 100644 node_modules/css-tree/cjs/data.cjs delete mode 100644 node_modules/css-tree/cjs/definition-syntax/SyntaxError.cjs delete mode 100644 node_modules/css-tree/cjs/definition-syntax/generate.cjs delete mode 100644 node_modules/css-tree/cjs/definition-syntax/index.cjs delete mode 100644 node_modules/css-tree/cjs/definition-syntax/parse.cjs delete mode 100644 node_modules/css-tree/cjs/definition-syntax/tokenizer.cjs delete mode 100644 node_modules/css-tree/cjs/definition-syntax/walk.cjs delete mode 100644 node_modules/css-tree/cjs/generator/create.cjs delete mode 100644 node_modules/css-tree/cjs/generator/index.cjs delete mode 100644 node_modules/css-tree/cjs/generator/sourceMap.cjs delete mode 100644 node_modules/css-tree/cjs/generator/token-before.cjs delete mode 100644 node_modules/css-tree/cjs/index.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/Lexer.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/error.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/generic-an-plus-b.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/generic-const.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/generic-urange.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/generic.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/index.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/match-graph.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/match.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/prepare-tokens.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/search.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/structure.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/trace.cjs delete mode 100644 node_modules/css-tree/cjs/lexer/units.cjs delete mode 100644 node_modules/css-tree/cjs/parser/SyntaxError.cjs delete mode 100644 node_modules/css-tree/cjs/parser/create.cjs delete mode 100644 node_modules/css-tree/cjs/parser/index.cjs delete mode 100644 node_modules/css-tree/cjs/parser/parse-selector.cjs delete mode 100644 node_modules/css-tree/cjs/parser/sequence.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/atrule/font-face.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/atrule/import.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/atrule/index.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/atrule/media.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/atrule/nest.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/atrule/page.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/atrule/supports.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/config/generator.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/config/lexer.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/config/mix.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/config/parser-selector.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/config/parser.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/config/walker.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/create.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/function/expression.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/function/var.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/index.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/AnPlusB.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Atrule.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/AtrulePrelude.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/AttributeSelector.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Block.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Brackets.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/CDC.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/CDO.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/ClassSelector.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Combinator.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Comment.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Condition.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Declaration.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/DeclarationList.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Dimension.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Feature.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/FeatureRange.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Function.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/GeneralEnclosed.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Hash.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/IdSelector.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Identifier.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/MediaCondition.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/MediaFeature.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/MediaFeatureRange.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/MediaQuery.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/MediaQueryList.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/NestingSelector.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Nth.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Number.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Operator.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Parentheses.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Percentage.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/PseudoClassSelector.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/PseudoElementSelector.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Ratio.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Raw.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Rule.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Selector.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/SelectorList.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/String.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/StyleSheet.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/TypeSelector.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/UnicodeRange.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Url.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/Value.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/WhiteSpace.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/common/feature-range.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/common/feature.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/index-generate.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/index-parse-selector.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/index-parse.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/node/index.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/pseudo/index.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/scope/atrulePrelude.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/scope/default.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/scope/index.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/scope/selector.cjs delete mode 100644 node_modules/css-tree/cjs/syntax/scope/value.cjs delete mode 100644 node_modules/css-tree/cjs/tokenizer/OffsetToLocation.cjs delete mode 100644 node_modules/css-tree/cjs/tokenizer/TokenStream.cjs delete mode 100644 node_modules/css-tree/cjs/tokenizer/adopt-buffer.cjs delete mode 100644 node_modules/css-tree/cjs/tokenizer/char-code-definitions.cjs delete mode 100644 node_modules/css-tree/cjs/tokenizer/index.cjs delete mode 100644 node_modules/css-tree/cjs/tokenizer/names.cjs delete mode 100644 node_modules/css-tree/cjs/tokenizer/types.cjs delete mode 100644 node_modules/css-tree/cjs/tokenizer/utils.cjs delete mode 100644 node_modules/css-tree/cjs/utils/List.cjs delete mode 100644 node_modules/css-tree/cjs/utils/clone.cjs delete mode 100644 node_modules/css-tree/cjs/utils/create-custom-error.cjs delete mode 100644 node_modules/css-tree/cjs/utils/ident.cjs delete mode 100644 node_modules/css-tree/cjs/utils/index.cjs delete mode 100644 node_modules/css-tree/cjs/utils/names.cjs delete mode 100644 node_modules/css-tree/cjs/utils/string.cjs delete mode 100644 node_modules/css-tree/cjs/utils/url.cjs delete mode 100644 node_modules/css-tree/cjs/version.cjs delete mode 100644 node_modules/css-tree/cjs/walker/create.cjs delete mode 100644 node_modules/css-tree/cjs/walker/index.cjs delete mode 100644 node_modules/css-tree/data/patch.json delete mode 100644 node_modules/css-tree/dist/csstree.esm.js delete mode 100644 node_modules/css-tree/dist/csstree.js delete mode 100644 node_modules/css-tree/dist/data.cjs delete mode 100644 node_modules/css-tree/dist/data.js delete mode 100644 node_modules/css-tree/dist/version.cjs delete mode 100644 node_modules/css-tree/dist/version.js delete mode 100644 node_modules/css-tree/lib/convertor/create.js delete mode 100644 node_modules/css-tree/lib/convertor/index.js delete mode 100644 node_modules/css-tree/lib/data-patch.js delete mode 100755 node_modules/css-tree/lib/data.js delete mode 100644 node_modules/css-tree/lib/definition-syntax/SyntaxError.js delete mode 100644 node_modules/css-tree/lib/definition-syntax/generate.js delete mode 100644 node_modules/css-tree/lib/definition-syntax/index.js delete mode 100644 node_modules/css-tree/lib/definition-syntax/parse.js delete mode 100644 node_modules/css-tree/lib/definition-syntax/tokenizer.js delete mode 100644 node_modules/css-tree/lib/definition-syntax/walk.js delete mode 100644 node_modules/css-tree/lib/generator/create.js delete mode 100644 node_modules/css-tree/lib/generator/index.js delete mode 100644 node_modules/css-tree/lib/generator/sourceMap.js delete mode 100644 node_modules/css-tree/lib/generator/token-before.js delete mode 100644 node_modules/css-tree/lib/index.js delete mode 100644 node_modules/css-tree/lib/lexer/Lexer.js delete mode 100644 node_modules/css-tree/lib/lexer/error.js delete mode 100644 node_modules/css-tree/lib/lexer/generic-an-plus-b.js delete mode 100644 node_modules/css-tree/lib/lexer/generic-const.js delete mode 100644 node_modules/css-tree/lib/lexer/generic-urange.js delete mode 100644 node_modules/css-tree/lib/lexer/generic.js delete mode 100644 node_modules/css-tree/lib/lexer/index.js delete mode 100644 node_modules/css-tree/lib/lexer/match-graph.js delete mode 100644 node_modules/css-tree/lib/lexer/match.js delete mode 100644 node_modules/css-tree/lib/lexer/prepare-tokens.js delete mode 100644 node_modules/css-tree/lib/lexer/search.js delete mode 100644 node_modules/css-tree/lib/lexer/structure.js delete mode 100644 node_modules/css-tree/lib/lexer/trace.js delete mode 100644 node_modules/css-tree/lib/lexer/units.js delete mode 100644 node_modules/css-tree/lib/parser/SyntaxError.js delete mode 100644 node_modules/css-tree/lib/parser/create.js delete mode 100644 node_modules/css-tree/lib/parser/index.js delete mode 100644 node_modules/css-tree/lib/parser/parse-selector.js delete mode 100644 node_modules/css-tree/lib/parser/sequence.js delete mode 100644 node_modules/css-tree/lib/syntax/atrule/font-face.js delete mode 100644 node_modules/css-tree/lib/syntax/atrule/import.js delete mode 100644 node_modules/css-tree/lib/syntax/atrule/index.js delete mode 100644 node_modules/css-tree/lib/syntax/atrule/media.js delete mode 100644 node_modules/css-tree/lib/syntax/atrule/nest.js delete mode 100644 node_modules/css-tree/lib/syntax/atrule/page.js delete mode 100644 node_modules/css-tree/lib/syntax/atrule/supports.js delete mode 100644 node_modules/css-tree/lib/syntax/config/generator.js delete mode 100644 node_modules/css-tree/lib/syntax/config/lexer.js delete mode 100644 node_modules/css-tree/lib/syntax/config/mix.js delete mode 100644 node_modules/css-tree/lib/syntax/config/parser-selector.js delete mode 100644 node_modules/css-tree/lib/syntax/config/parser.js delete mode 100644 node_modules/css-tree/lib/syntax/config/walker.js delete mode 100644 node_modules/css-tree/lib/syntax/create.js delete mode 100644 node_modules/css-tree/lib/syntax/function/expression.js delete mode 100644 node_modules/css-tree/lib/syntax/function/var.js delete mode 100644 node_modules/css-tree/lib/syntax/index.js delete mode 100644 node_modules/css-tree/lib/syntax/node/AnPlusB.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Atrule.js delete mode 100644 node_modules/css-tree/lib/syntax/node/AtrulePrelude.js delete mode 100644 node_modules/css-tree/lib/syntax/node/AttributeSelector.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Block.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Brackets.js delete mode 100644 node_modules/css-tree/lib/syntax/node/CDC.js delete mode 100644 node_modules/css-tree/lib/syntax/node/CDO.js delete mode 100644 node_modules/css-tree/lib/syntax/node/ClassSelector.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Combinator.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Comment.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Declaration.js delete mode 100644 node_modules/css-tree/lib/syntax/node/DeclarationList.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Dimension.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Function.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Hash.js delete mode 100644 node_modules/css-tree/lib/syntax/node/IdSelector.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Identifier.js delete mode 100644 node_modules/css-tree/lib/syntax/node/MediaFeature.js delete mode 100644 node_modules/css-tree/lib/syntax/node/MediaQuery.js delete mode 100644 node_modules/css-tree/lib/syntax/node/MediaQueryList.js delete mode 100644 node_modules/css-tree/lib/syntax/node/NestingSelector.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Nth.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Number.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Operator.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Parentheses.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Percentage.js delete mode 100644 node_modules/css-tree/lib/syntax/node/PseudoClassSelector.js delete mode 100644 node_modules/css-tree/lib/syntax/node/PseudoElementSelector.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Ratio.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Raw.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Rule.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Selector.js delete mode 100644 node_modules/css-tree/lib/syntax/node/SelectorList.js delete mode 100644 node_modules/css-tree/lib/syntax/node/String.js delete mode 100644 node_modules/css-tree/lib/syntax/node/StyleSheet.js delete mode 100644 node_modules/css-tree/lib/syntax/node/TypeSelector.js delete mode 100644 node_modules/css-tree/lib/syntax/node/UnicodeRange.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Url.js delete mode 100644 node_modules/css-tree/lib/syntax/node/Value.js delete mode 100644 node_modules/css-tree/lib/syntax/node/WhiteSpace.js delete mode 100644 node_modules/css-tree/lib/syntax/node/index-generate.js delete mode 100644 node_modules/css-tree/lib/syntax/node/index-parse-selector.js delete mode 100644 node_modules/css-tree/lib/syntax/node/index-parse.js delete mode 100644 node_modules/css-tree/lib/syntax/node/index.js delete mode 100644 node_modules/css-tree/lib/syntax/pseudo/index.js delete mode 100644 node_modules/css-tree/lib/syntax/scope/atrulePrelude.js delete mode 100644 node_modules/css-tree/lib/syntax/scope/default.js delete mode 100644 node_modules/css-tree/lib/syntax/scope/index.js delete mode 100644 node_modules/css-tree/lib/syntax/scope/selector.js delete mode 100644 node_modules/css-tree/lib/syntax/scope/value.js delete mode 100644 node_modules/css-tree/lib/tokenizer/OffsetToLocation.js delete mode 100644 node_modules/css-tree/lib/tokenizer/TokenStream.js delete mode 100644 node_modules/css-tree/lib/tokenizer/adopt-buffer.js delete mode 100644 node_modules/css-tree/lib/tokenizer/char-code-definitions.js delete mode 100644 node_modules/css-tree/lib/tokenizer/index.js delete mode 100644 node_modules/css-tree/lib/tokenizer/names.js delete mode 100644 node_modules/css-tree/lib/tokenizer/types.js delete mode 100644 node_modules/css-tree/lib/tokenizer/utils.js delete mode 100644 node_modules/css-tree/lib/utils/List.js delete mode 100644 node_modules/css-tree/lib/utils/clone.js delete mode 100644 node_modules/css-tree/lib/utils/create-custom-error.js delete mode 100644 node_modules/css-tree/lib/utils/ident.js delete mode 100644 node_modules/css-tree/lib/utils/index.js delete mode 100644 node_modules/css-tree/lib/utils/names.js delete mode 100644 node_modules/css-tree/lib/utils/string.js delete mode 100644 node_modules/css-tree/lib/utils/url.js delete mode 100644 node_modules/css-tree/lib/version.js delete mode 100644 node_modules/css-tree/lib/walker/create.js delete mode 100644 node_modules/css-tree/lib/walker/index.js delete mode 100644 node_modules/css-tree/package.json delete mode 100644 node_modules/cssesc/LICENSE-MIT.txt delete mode 100644 node_modules/cssesc/README.md delete mode 100755 node_modules/cssesc/bin/cssesc delete mode 100644 node_modules/cssesc/cssesc.js delete mode 100644 node_modules/cssesc/man/cssesc.1 delete mode 100644 node_modules/cssesc/package.json delete mode 100644 node_modules/debug/LICENSE delete mode 100644 node_modules/debug/README.md delete mode 100644 node_modules/debug/package.json delete mode 100644 node_modules/debug/src/browser.js delete mode 100644 node_modules/debug/src/common.js delete mode 100644 node_modules/debug/src/index.js delete mode 100644 node_modules/debug/src/node.js delete mode 100644 node_modules/decamelize-keys/index.js delete mode 100644 node_modules/decamelize-keys/license delete mode 100644 node_modules/decamelize-keys/node_modules/decamelize/index.js delete mode 100644 node_modules/decamelize-keys/node_modules/decamelize/license delete mode 100644 node_modules/decamelize-keys/node_modules/decamelize/package.json delete mode 100644 node_modules/decamelize-keys/node_modules/decamelize/readme.md delete mode 100644 node_modules/decamelize-keys/node_modules/map-obj/index.js delete mode 100644 node_modules/decamelize-keys/node_modules/map-obj/license delete mode 100644 node_modules/decamelize-keys/node_modules/map-obj/package.json delete mode 100644 node_modules/decamelize-keys/node_modules/map-obj/readme.md delete mode 100644 node_modules/decamelize-keys/package.json delete mode 100644 node_modules/decamelize-keys/readme.md delete mode 100644 node_modules/decamelize/index.d.ts delete mode 100644 node_modules/decamelize/index.js delete mode 100644 node_modules/decamelize/license delete mode 100644 node_modules/decamelize/package.json delete mode 100644 node_modules/decamelize/readme.md delete mode 100644 node_modules/dir-glob/index.js delete mode 100644 node_modules/dir-glob/license delete mode 100644 node_modules/dir-glob/package.json delete mode 100644 node_modules/dir-glob/readme.md delete mode 100644 node_modules/emoji-regex/LICENSE-MIT.txt delete mode 100644 node_modules/emoji-regex/README.md delete mode 100644 node_modules/emoji-regex/es2015/index.js delete mode 100644 node_modules/emoji-regex/es2015/text.js delete mode 100644 node_modules/emoji-regex/index.d.ts delete mode 100644 node_modules/emoji-regex/index.js delete mode 100644 node_modules/emoji-regex/package.json delete mode 100644 node_modules/emoji-regex/text.js delete mode 100644 node_modules/error-ex/LICENSE delete mode 100644 node_modules/error-ex/README.md delete mode 100644 node_modules/error-ex/index.js delete mode 100644 node_modules/error-ex/package.json delete mode 100644 node_modules/escape-string-regexp/index.js delete mode 100644 node_modules/escape-string-regexp/license delete mode 100644 node_modules/escape-string-regexp/package.json delete mode 100644 node_modules/escape-string-regexp/readme.md delete mode 100644 node_modules/fast-deep-equal/LICENSE delete mode 100644 node_modules/fast-deep-equal/README.md delete mode 100644 node_modules/fast-deep-equal/es6/index.d.ts delete mode 100644 node_modules/fast-deep-equal/es6/index.js delete mode 100644 node_modules/fast-deep-equal/es6/react.d.ts delete mode 100644 node_modules/fast-deep-equal/es6/react.js delete mode 100644 node_modules/fast-deep-equal/index.d.ts delete mode 100644 node_modules/fast-deep-equal/index.js delete mode 100644 node_modules/fast-deep-equal/package.json delete mode 100644 node_modules/fast-deep-equal/react.d.ts delete mode 100644 node_modules/fast-deep-equal/react.js delete mode 100644 node_modules/fast-glob/LICENSE delete mode 100644 node_modules/fast-glob/README.md delete mode 100644 node_modules/fast-glob/out/index.d.ts delete mode 100644 node_modules/fast-glob/out/index.js delete mode 100644 node_modules/fast-glob/out/managers/tasks.d.ts delete mode 100644 node_modules/fast-glob/out/managers/tasks.js delete mode 100644 node_modules/fast-glob/out/providers/async.d.ts delete mode 100644 node_modules/fast-glob/out/providers/async.js delete mode 100644 node_modules/fast-glob/out/providers/filters/deep.d.ts delete mode 100644 node_modules/fast-glob/out/providers/filters/deep.js delete mode 100644 node_modules/fast-glob/out/providers/filters/entry.d.ts delete mode 100644 node_modules/fast-glob/out/providers/filters/entry.js delete mode 100644 node_modules/fast-glob/out/providers/filters/error.d.ts delete mode 100644 node_modules/fast-glob/out/providers/filters/error.js delete mode 100644 node_modules/fast-glob/out/providers/matchers/matcher.d.ts delete mode 100644 node_modules/fast-glob/out/providers/matchers/matcher.js delete mode 100644 node_modules/fast-glob/out/providers/matchers/partial.d.ts delete mode 100644 node_modules/fast-glob/out/providers/matchers/partial.js delete mode 100644 node_modules/fast-glob/out/providers/provider.d.ts delete mode 100644 node_modules/fast-glob/out/providers/provider.js delete mode 100644 node_modules/fast-glob/out/providers/stream.d.ts delete mode 100644 node_modules/fast-glob/out/providers/stream.js delete mode 100644 node_modules/fast-glob/out/providers/sync.d.ts delete mode 100644 node_modules/fast-glob/out/providers/sync.js delete mode 100644 node_modules/fast-glob/out/providers/transformers/entry.d.ts delete mode 100644 node_modules/fast-glob/out/providers/transformers/entry.js delete mode 100644 node_modules/fast-glob/out/readers/async.d.ts delete mode 100644 node_modules/fast-glob/out/readers/async.js delete mode 100644 node_modules/fast-glob/out/readers/reader.d.ts delete mode 100644 node_modules/fast-glob/out/readers/reader.js delete mode 100644 node_modules/fast-glob/out/readers/stream.d.ts delete mode 100644 node_modules/fast-glob/out/readers/stream.js delete mode 100644 node_modules/fast-glob/out/readers/sync.d.ts delete mode 100644 node_modules/fast-glob/out/readers/sync.js delete mode 100644 node_modules/fast-glob/out/settings.d.ts delete mode 100644 node_modules/fast-glob/out/settings.js delete mode 100644 node_modules/fast-glob/out/types/index.d.ts delete mode 100644 node_modules/fast-glob/out/types/index.js delete mode 100644 node_modules/fast-glob/out/utils/array.d.ts delete mode 100644 node_modules/fast-glob/out/utils/array.js delete mode 100644 node_modules/fast-glob/out/utils/errno.d.ts delete mode 100644 node_modules/fast-glob/out/utils/errno.js delete mode 100644 node_modules/fast-glob/out/utils/fs.d.ts delete mode 100644 node_modules/fast-glob/out/utils/fs.js delete mode 100644 node_modules/fast-glob/out/utils/index.d.ts delete mode 100644 node_modules/fast-glob/out/utils/index.js delete mode 100644 node_modules/fast-glob/out/utils/path.d.ts delete mode 100644 node_modules/fast-glob/out/utils/path.js delete mode 100644 node_modules/fast-glob/out/utils/pattern.d.ts delete mode 100644 node_modules/fast-glob/out/utils/pattern.js delete mode 100644 node_modules/fast-glob/out/utils/stream.d.ts delete mode 100644 node_modules/fast-glob/out/utils/stream.js delete mode 100644 node_modules/fast-glob/out/utils/string.d.ts delete mode 100644 node_modules/fast-glob/out/utils/string.js delete mode 100644 node_modules/fast-glob/package.json delete mode 100644 node_modules/fastest-levenshtein/.eslintrc.json delete mode 100644 node_modules/fastest-levenshtein/.prettierrc delete mode 100644 node_modules/fastest-levenshtein/.travis.yml delete mode 100644 node_modules/fastest-levenshtein/LICENSE.md delete mode 100644 node_modules/fastest-levenshtein/README.md delete mode 100644 node_modules/fastest-levenshtein/bench.js delete mode 100644 node_modules/fastest-levenshtein/esm/mod.d.ts delete mode 100644 node_modules/fastest-levenshtein/esm/mod.d.ts.map delete mode 100644 node_modules/fastest-levenshtein/esm/mod.js delete mode 100644 node_modules/fastest-levenshtein/mod.d.ts delete mode 100644 node_modules/fastest-levenshtein/mod.js delete mode 100644 node_modules/fastest-levenshtein/package.json delete mode 100644 node_modules/fastest-levenshtein/test.js delete mode 100644 node_modules/fastest-levenshtein/test.ts delete mode 100644 node_modules/fastq/.github/dependabot.yml delete mode 100644 node_modules/fastq/.github/workflows/ci.yml delete mode 100644 node_modules/fastq/LICENSE delete mode 100644 node_modules/fastq/README.md delete mode 100644 node_modules/fastq/bench.js delete mode 100644 node_modules/fastq/example.js delete mode 100644 node_modules/fastq/example.mjs delete mode 100644 node_modules/fastq/index.d.ts delete mode 100644 node_modules/fastq/package.json delete mode 100644 node_modules/fastq/queue.js delete mode 100644 node_modules/fastq/test/example.ts delete mode 100644 node_modules/fastq/test/promise.js delete mode 100644 node_modules/fastq/test/test.js delete mode 100644 node_modules/fastq/test/tsconfig.json delete mode 100644 node_modules/file-entry-cache/LICENSE delete mode 100644 node_modules/file-entry-cache/README.md delete mode 100644 node_modules/file-entry-cache/cache.js delete mode 100644 node_modules/file-entry-cache/changelog.md delete mode 100644 node_modules/file-entry-cache/package.json delete mode 100644 node_modules/fill-range/LICENSE delete mode 100644 node_modules/fill-range/README.md delete mode 100644 node_modules/fill-range/index.js delete mode 100644 node_modules/fill-range/package.json delete mode 100644 node_modules/find-up/index.d.ts delete mode 100644 node_modules/find-up/index.js delete mode 100644 node_modules/find-up/license delete mode 100644 node_modules/find-up/package.json delete mode 100644 node_modules/find-up/readme.md delete mode 100644 node_modules/flat-cache/LICENSE delete mode 100644 node_modules/flat-cache/README.md delete mode 100644 node_modules/flat-cache/changelog.md delete mode 100644 node_modules/flat-cache/package.json delete mode 100644 node_modules/flat-cache/src/cache.js delete mode 100644 node_modules/flat-cache/src/del.js delete mode 100644 node_modules/flat-cache/src/utils.js delete mode 100644 node_modules/flatted/LICENSE delete mode 100644 node_modules/flatted/README.md delete mode 100644 node_modules/flatted/cjs/index.js delete mode 100644 node_modules/flatted/cjs/package.json delete mode 100644 node_modules/flatted/es.js delete mode 100644 node_modules/flatted/esm.js delete mode 100644 node_modules/flatted/esm/index.js delete mode 100644 node_modules/flatted/index.js delete mode 100644 node_modules/flatted/min.js delete mode 100644 node_modules/flatted/package.json delete mode 100644 node_modules/flatted/php/flatted.php delete mode 100644 node_modules/flatted/types.d.ts delete mode 100644 node_modules/fs.realpath/LICENSE delete mode 100644 node_modules/fs.realpath/README.md delete mode 100644 node_modules/fs.realpath/index.js delete mode 100644 node_modules/fs.realpath/old.js delete mode 100644 node_modules/fs.realpath/package.json delete mode 100644 node_modules/function-bind/.editorconfig delete mode 100644 node_modules/function-bind/.eslintrc delete mode 100644 node_modules/function-bind/.jscs.json delete mode 100644 node_modules/function-bind/.npmignore delete mode 100644 node_modules/function-bind/.travis.yml delete mode 100644 node_modules/function-bind/LICENSE delete mode 100644 node_modules/function-bind/README.md delete mode 100644 node_modules/function-bind/implementation.js delete mode 100644 node_modules/function-bind/index.js delete mode 100644 node_modules/function-bind/package.json delete mode 100644 node_modules/function-bind/test/.eslintrc delete mode 100644 node_modules/function-bind/test/index.js delete mode 100644 node_modules/glob-parent/CHANGELOG.md delete mode 100644 node_modules/glob-parent/LICENSE delete mode 100644 node_modules/glob-parent/README.md delete mode 100644 node_modules/glob-parent/index.js delete mode 100644 node_modules/glob-parent/package.json delete mode 100644 node_modules/glob/LICENSE delete mode 100644 node_modules/glob/README.md delete mode 100644 node_modules/glob/common.js delete mode 100644 node_modules/glob/glob.js delete mode 100644 node_modules/glob/package.json delete mode 100644 node_modules/glob/sync.js delete mode 100644 node_modules/global-modules/LICENSE delete mode 100644 node_modules/global-modules/README.md delete mode 100644 node_modules/global-modules/index.js delete mode 100644 node_modules/global-modules/package.json delete mode 100644 node_modules/global-prefix/LICENSE delete mode 100644 node_modules/global-prefix/README.md delete mode 100644 node_modules/global-prefix/index.js delete mode 100644 node_modules/global-prefix/package.json delete mode 100644 node_modules/globby/gitignore.js delete mode 100644 node_modules/globby/index.d.ts delete mode 100644 node_modules/globby/index.js delete mode 100644 node_modules/globby/license delete mode 100644 node_modules/globby/package.json delete mode 100644 node_modules/globby/readme.md delete mode 100644 node_modules/globby/stream-utils.js delete mode 100644 node_modules/globjoin/CHANGELOG.md delete mode 100644 node_modules/globjoin/LICENSE delete mode 100644 node_modules/globjoin/README.md delete mode 100644 node_modules/globjoin/index.js delete mode 100644 node_modules/globjoin/package.json delete mode 100644 node_modules/hard-rejection/index.d.ts delete mode 100644 node_modules/hard-rejection/index.js delete mode 100644 node_modules/hard-rejection/license delete mode 100644 node_modules/hard-rejection/package.json delete mode 100644 node_modules/hard-rejection/readme.md delete mode 100644 node_modules/hard-rejection/register.js delete mode 100644 node_modules/has-flag/index.js delete mode 100644 node_modules/has-flag/license delete mode 100644 node_modules/has-flag/package.json delete mode 100644 node_modules/has-flag/readme.md delete mode 100644 node_modules/has/LICENSE-MIT delete mode 100644 node_modules/has/README.md delete mode 100644 node_modules/has/package.json delete mode 100644 node_modules/has/src/index.js delete mode 100644 node_modules/has/test/index.js delete mode 100644 node_modules/hosted-git-info/LICENSE delete mode 100644 node_modules/hosted-git-info/README.md delete mode 100644 node_modules/hosted-git-info/git-host-info.js delete mode 100644 node_modules/hosted-git-info/git-host.js delete mode 100644 node_modules/hosted-git-info/index.js delete mode 100644 node_modules/hosted-git-info/package.json delete mode 100644 node_modules/html-tags/html-tags-void.json delete mode 100644 node_modules/html-tags/html-tags.json delete mode 100644 node_modules/html-tags/index.d.ts delete mode 100644 node_modules/html-tags/index.js delete mode 100644 node_modules/html-tags/license delete mode 100644 node_modules/html-tags/package.json delete mode 100644 node_modules/html-tags/readme.md delete mode 100644 node_modules/html-tags/void.d.ts delete mode 100644 node_modules/html-tags/void.js delete mode 100644 node_modules/ignore/LICENSE-MIT delete mode 100644 node_modules/ignore/README.md delete mode 100644 node_modules/ignore/index.d.ts delete mode 100644 node_modules/ignore/index.js delete mode 100644 node_modules/ignore/legacy.js delete mode 100644 node_modules/ignore/package.json delete mode 100644 node_modules/import-fresh/index.d.ts delete mode 100644 node_modules/import-fresh/index.js delete mode 100644 node_modules/import-fresh/license delete mode 100644 node_modules/import-fresh/node_modules/resolve-from/index.js delete mode 100644 node_modules/import-fresh/node_modules/resolve-from/license delete mode 100644 node_modules/import-fresh/node_modules/resolve-from/package.json delete mode 100644 node_modules/import-fresh/node_modules/resolve-from/readme.md delete mode 100644 node_modules/import-fresh/package.json delete mode 100644 node_modules/import-fresh/readme.md delete mode 100644 node_modules/import-lazy/index.d.ts delete mode 100644 node_modules/import-lazy/index.js delete mode 100644 node_modules/import-lazy/license delete mode 100644 node_modules/import-lazy/package.json delete mode 100644 node_modules/import-lazy/readme.md delete mode 100644 node_modules/imurmurhash/README.md delete mode 100644 node_modules/imurmurhash/imurmurhash.js delete mode 100644 node_modules/imurmurhash/imurmurhash.min.js delete mode 100644 node_modules/imurmurhash/package.json delete mode 100644 node_modules/indent-string/index.d.ts delete mode 100644 node_modules/indent-string/index.js delete mode 100644 node_modules/indent-string/license delete mode 100644 node_modules/indent-string/package.json delete mode 100644 node_modules/indent-string/readme.md delete mode 100644 node_modules/inflight/LICENSE delete mode 100644 node_modules/inflight/README.md delete mode 100644 node_modules/inflight/inflight.js delete mode 100644 node_modules/inflight/package.json delete mode 100644 node_modules/inherits/LICENSE delete mode 100644 node_modules/inherits/README.md delete mode 100644 node_modules/inherits/inherits.js delete mode 100644 node_modules/inherits/inherits_browser.js delete mode 100644 node_modules/inherits/package.json delete mode 100644 node_modules/ini/LICENSE delete mode 100644 node_modules/ini/README.md delete mode 100644 node_modules/ini/ini.js delete mode 100644 node_modules/ini/package.json delete mode 100644 node_modules/is-arrayish/.editorconfig delete mode 100644 node_modules/is-arrayish/.istanbul.yml delete mode 100644 node_modules/is-arrayish/.npmignore delete mode 100644 node_modules/is-arrayish/.travis.yml delete mode 100644 node_modules/is-arrayish/LICENSE delete mode 100644 node_modules/is-arrayish/README.md delete mode 100644 node_modules/is-arrayish/index.js delete mode 100644 node_modules/is-arrayish/package.json delete mode 100644 node_modules/is-core-module/.eslintrc delete mode 100644 node_modules/is-core-module/.nycrc delete mode 100644 node_modules/is-core-module/CHANGELOG.md delete mode 100644 node_modules/is-core-module/LICENSE delete mode 100644 node_modules/is-core-module/README.md delete mode 100644 node_modules/is-core-module/core.json delete mode 100644 node_modules/is-core-module/index.js delete mode 100644 node_modules/is-core-module/package.json delete mode 100644 node_modules/is-core-module/test/index.js delete mode 100644 node_modules/is-extglob/LICENSE delete mode 100644 node_modules/is-extglob/README.md delete mode 100644 node_modules/is-extglob/index.js delete mode 100644 node_modules/is-extglob/package.json delete mode 100644 node_modules/is-fullwidth-code-point/index.d.ts delete mode 100644 node_modules/is-fullwidth-code-point/index.js delete mode 100644 node_modules/is-fullwidth-code-point/license delete mode 100644 node_modules/is-fullwidth-code-point/package.json delete mode 100644 node_modules/is-fullwidth-code-point/readme.md delete mode 100644 node_modules/is-glob/LICENSE delete mode 100644 node_modules/is-glob/README.md delete mode 100644 node_modules/is-glob/index.js delete mode 100644 node_modules/is-glob/package.json delete mode 100644 node_modules/is-number/LICENSE delete mode 100644 node_modules/is-number/README.md delete mode 100644 node_modules/is-number/index.js delete mode 100644 node_modules/is-number/package.json delete mode 100644 node_modules/is-plain-obj/index.js delete mode 100644 node_modules/is-plain-obj/license delete mode 100644 node_modules/is-plain-obj/package.json delete mode 100644 node_modules/is-plain-obj/readme.md delete mode 100644 node_modules/is-plain-object/LICENSE delete mode 100644 node_modules/is-plain-object/README.md delete mode 100644 node_modules/is-plain-object/dist/is-plain-object.js delete mode 100644 node_modules/is-plain-object/dist/is-plain-object.mjs delete mode 100644 node_modules/is-plain-object/is-plain-object.d.ts delete mode 100644 node_modules/is-plain-object/package.json delete mode 100644 node_modules/isexe/.npmignore delete mode 100644 node_modules/isexe/LICENSE delete mode 100644 node_modules/isexe/README.md delete mode 100644 node_modules/isexe/index.js delete mode 100644 node_modules/isexe/mode.js delete mode 100644 node_modules/isexe/package.json delete mode 100644 node_modules/isexe/test/basic.js delete mode 100644 node_modules/isexe/windows.js delete mode 100644 node_modules/js-tokens/CHANGELOG.md delete mode 100644 node_modules/js-tokens/LICENSE delete mode 100644 node_modules/js-tokens/README.md delete mode 100644 node_modules/js-tokens/index.js delete mode 100644 node_modules/js-tokens/package.json delete mode 100644 node_modules/js-yaml/CHANGELOG.md delete mode 100644 node_modules/js-yaml/LICENSE delete mode 100644 node_modules/js-yaml/README.md delete mode 100755 node_modules/js-yaml/bin/js-yaml.js delete mode 100644 node_modules/js-yaml/dist/js-yaml.js delete mode 100644 node_modules/js-yaml/dist/js-yaml.min.js delete mode 100644 node_modules/js-yaml/dist/js-yaml.mjs delete mode 100644 node_modules/js-yaml/index.js delete mode 100644 node_modules/js-yaml/lib/common.js delete mode 100644 node_modules/js-yaml/lib/dumper.js delete mode 100644 node_modules/js-yaml/lib/exception.js delete mode 100644 node_modules/js-yaml/lib/loader.js delete mode 100644 node_modules/js-yaml/lib/schema.js delete mode 100644 node_modules/js-yaml/lib/schema/core.js delete mode 100644 node_modules/js-yaml/lib/schema/default.js delete mode 100644 node_modules/js-yaml/lib/schema/failsafe.js delete mode 100644 node_modules/js-yaml/lib/schema/json.js delete mode 100644 node_modules/js-yaml/lib/snippet.js delete mode 100644 node_modules/js-yaml/lib/type.js delete mode 100644 node_modules/js-yaml/lib/type/binary.js delete mode 100644 node_modules/js-yaml/lib/type/bool.js delete mode 100644 node_modules/js-yaml/lib/type/float.js delete mode 100644 node_modules/js-yaml/lib/type/int.js delete mode 100644 node_modules/js-yaml/lib/type/map.js delete mode 100644 node_modules/js-yaml/lib/type/merge.js delete mode 100644 node_modules/js-yaml/lib/type/null.js delete mode 100644 node_modules/js-yaml/lib/type/omap.js delete mode 100644 node_modules/js-yaml/lib/type/pairs.js delete mode 100644 node_modules/js-yaml/lib/type/seq.js delete mode 100644 node_modules/js-yaml/lib/type/set.js delete mode 100644 node_modules/js-yaml/lib/type/str.js delete mode 100644 node_modules/js-yaml/lib/type/timestamp.js delete mode 100644 node_modules/js-yaml/package.json delete mode 100644 node_modules/json-parse-even-better-errors/CHANGELOG.md delete mode 100644 node_modules/json-parse-even-better-errors/LICENSE.md delete mode 100644 node_modules/json-parse-even-better-errors/README.md delete mode 100644 node_modules/json-parse-even-better-errors/index.js delete mode 100644 node_modules/json-parse-even-better-errors/package.json delete mode 100644 node_modules/json-schema-traverse/.eslintrc.yml delete mode 100644 node_modules/json-schema-traverse/.github/FUNDING.yml delete mode 100644 node_modules/json-schema-traverse/.github/workflows/build.yml delete mode 100644 node_modules/json-schema-traverse/.github/workflows/publish.yml delete mode 100644 node_modules/json-schema-traverse/LICENSE delete mode 100644 node_modules/json-schema-traverse/README.md delete mode 100644 node_modules/json-schema-traverse/index.d.ts delete mode 100644 node_modules/json-schema-traverse/index.js delete mode 100644 node_modules/json-schema-traverse/package.json delete mode 100644 node_modules/json-schema-traverse/spec/.eslintrc.yml delete mode 100644 node_modules/json-schema-traverse/spec/fixtures/schema.js delete mode 100644 node_modules/json-schema-traverse/spec/index.spec.js delete mode 100644 node_modules/kind-of/CHANGELOG.md delete mode 100644 node_modules/kind-of/LICENSE delete mode 100644 node_modules/kind-of/README.md delete mode 100644 node_modules/kind-of/index.js delete mode 100644 node_modules/kind-of/package.json delete mode 100644 node_modules/known-css-properties/LICENSE delete mode 100644 node_modules/known-css-properties/README.md delete mode 100644 node_modules/known-css-properties/data/all.json delete mode 100644 node_modules/known-css-properties/index.d.ts delete mode 100644 node_modules/known-css-properties/index.js delete mode 100644 node_modules/known-css-properties/package.json delete mode 100644 node_modules/lines-and-columns/LICENSE delete mode 100644 node_modules/lines-and-columns/README.md delete mode 100644 node_modules/lines-and-columns/build/index.d.ts delete mode 100644 node_modules/lines-and-columns/build/index.js delete mode 100644 node_modules/lines-and-columns/package.json delete mode 100644 node_modules/locate-path/index.d.ts delete mode 100644 node_modules/locate-path/index.js delete mode 100644 node_modules/locate-path/license delete mode 100644 node_modules/locate-path/package.json delete mode 100644 node_modules/locate-path/readme.md delete mode 100644 node_modules/lodash.truncate/LICENSE delete mode 100644 node_modules/lodash.truncate/README.md delete mode 100644 node_modules/lodash.truncate/index.js delete mode 100644 node_modules/lodash.truncate/package.json delete mode 100644 node_modules/lru-cache/LICENSE delete mode 100644 node_modules/lru-cache/README.md delete mode 100644 node_modules/lru-cache/index.js delete mode 100644 node_modules/lru-cache/package.json delete mode 100644 node_modules/map-obj/index.d.ts delete mode 100644 node_modules/map-obj/index.js delete mode 100644 node_modules/map-obj/license delete mode 100644 node_modules/map-obj/package.json delete mode 100644 node_modules/map-obj/readme.md delete mode 100644 node_modules/mathml-tag-names/index.json delete mode 100644 node_modules/mathml-tag-names/license delete mode 100644 node_modules/mathml-tag-names/package.json delete mode 100644 node_modules/mathml-tag-names/readme.md delete mode 100644 node_modules/mdn-data/CHANGELOG.md delete mode 100644 node_modules/mdn-data/LICENSE delete mode 100644 node_modules/mdn-data/README.md delete mode 100644 node_modules/mdn-data/api/index.js delete mode 100644 node_modules/mdn-data/api/inheritance.json delete mode 100644 node_modules/mdn-data/api/inheritance.schema.json delete mode 100644 node_modules/mdn-data/css/at-rules.json delete mode 100644 node_modules/mdn-data/css/at-rules.schema.json delete mode 100644 node_modules/mdn-data/css/definitions.json delete mode 100644 node_modules/mdn-data/css/index.js delete mode 100644 node_modules/mdn-data/css/properties.json delete mode 100644 node_modules/mdn-data/css/properties.schema.json delete mode 100644 node_modules/mdn-data/css/readme.md delete mode 100644 node_modules/mdn-data/css/selectors.json delete mode 100644 node_modules/mdn-data/css/selectors.schema.json delete mode 100644 node_modules/mdn-data/css/syntaxes.json delete mode 100644 node_modules/mdn-data/css/syntaxes.schema.json delete mode 100644 node_modules/mdn-data/css/types.json delete mode 100644 node_modules/mdn-data/css/types.schema.json delete mode 100644 node_modules/mdn-data/css/units.json delete mode 100644 node_modules/mdn-data/css/units.schema.json delete mode 100644 node_modules/mdn-data/index.js delete mode 100644 node_modules/mdn-data/l10n/css.json delete mode 100644 node_modules/mdn-data/l10n/index.js delete mode 100644 node_modules/mdn-data/package.json delete mode 100644 node_modules/meow/index.d.ts delete mode 100644 node_modules/meow/index.js delete mode 100644 node_modules/meow/license delete mode 100644 node_modules/meow/package.json delete mode 100644 node_modules/meow/readme.md delete mode 100644 node_modules/merge2/LICENSE delete mode 100644 node_modules/merge2/README.md delete mode 100644 node_modules/merge2/index.js delete mode 100644 node_modules/merge2/package.json delete mode 100755 node_modules/micromatch/LICENSE delete mode 100644 node_modules/micromatch/README.md delete mode 100644 node_modules/micromatch/index.js delete mode 100644 node_modules/micromatch/package.json delete mode 100644 node_modules/min-indent/index.js delete mode 100644 node_modules/min-indent/license delete mode 100644 node_modules/min-indent/package.json delete mode 100644 node_modules/min-indent/readme.md delete mode 100644 node_modules/minimatch/LICENSE delete mode 100644 node_modules/minimatch/README.md delete mode 100644 node_modules/minimatch/minimatch.js delete mode 100644 node_modules/minimatch/package.json delete mode 100644 node_modules/minimist-options/index.d.ts delete mode 100644 node_modules/minimist-options/index.js delete mode 100644 node_modules/minimist-options/license delete mode 100644 node_modules/minimist-options/package.json delete mode 100644 node_modules/minimist-options/readme.md delete mode 100644 node_modules/ms/index.js delete mode 100644 node_modules/ms/license.md delete mode 100644 node_modules/ms/package.json delete mode 100644 node_modules/ms/readme.md delete mode 100644 node_modules/nanoid/LICENSE delete mode 100644 node_modules/nanoid/README.md delete mode 100644 node_modules/nanoid/async/index.browser.cjs delete mode 100644 node_modules/nanoid/async/index.browser.js delete mode 100644 node_modules/nanoid/async/index.cjs delete mode 100644 node_modules/nanoid/async/index.d.ts delete mode 100644 node_modules/nanoid/async/index.js delete mode 100644 node_modules/nanoid/async/index.native.js delete mode 100644 node_modules/nanoid/async/package.json delete mode 100755 node_modules/nanoid/bin/nanoid.cjs delete mode 100644 node_modules/nanoid/index.browser.cjs delete mode 100644 node_modules/nanoid/index.browser.js delete mode 100644 node_modules/nanoid/index.cjs delete mode 100644 node_modules/nanoid/index.d.ts delete mode 100644 node_modules/nanoid/index.js delete mode 100644 node_modules/nanoid/nanoid.js delete mode 100644 node_modules/nanoid/non-secure/index.cjs delete mode 100644 node_modules/nanoid/non-secure/index.d.ts delete mode 100644 node_modules/nanoid/non-secure/index.js delete mode 100644 node_modules/nanoid/non-secure/package.json delete mode 100644 node_modules/nanoid/package.json delete mode 100644 node_modules/nanoid/url-alphabet/index.cjs delete mode 100644 node_modules/nanoid/url-alphabet/index.js delete mode 100644 node_modules/nanoid/url-alphabet/package.json delete mode 100644 node_modules/normalize-package-data/AUTHORS delete mode 100644 node_modules/normalize-package-data/LICENSE delete mode 100644 node_modules/normalize-package-data/README.md delete mode 100644 node_modules/normalize-package-data/lib/extract_description.js delete mode 100644 node_modules/normalize-package-data/lib/fixer.js delete mode 100644 node_modules/normalize-package-data/lib/make_warning.js delete mode 100644 node_modules/normalize-package-data/lib/normalize.js delete mode 100644 node_modules/normalize-package-data/lib/safe_format.js delete mode 100644 node_modules/normalize-package-data/lib/typos.json delete mode 100644 node_modules/normalize-package-data/lib/warning_messages.json delete mode 100644 node_modules/normalize-package-data/package.json delete mode 100644 node_modules/normalize-path/LICENSE delete mode 100644 node_modules/normalize-path/README.md delete mode 100644 node_modules/normalize-path/index.js delete mode 100644 node_modules/normalize-path/package.json delete mode 100644 node_modules/once/LICENSE delete mode 100644 node_modules/once/README.md delete mode 100644 node_modules/once/once.js delete mode 100644 node_modules/once/package.json delete mode 100644 node_modules/p-limit/index.d.ts delete mode 100644 node_modules/p-limit/index.js delete mode 100644 node_modules/p-limit/license delete mode 100644 node_modules/p-limit/package.json delete mode 100644 node_modules/p-limit/readme.md delete mode 100644 node_modules/p-locate/index.d.ts delete mode 100644 node_modules/p-locate/index.js delete mode 100644 node_modules/p-locate/license delete mode 100644 node_modules/p-locate/package.json delete mode 100644 node_modules/p-locate/readme.md delete mode 100644 node_modules/parent-module/index.js delete mode 100644 node_modules/parent-module/license delete mode 100644 node_modules/parent-module/package.json delete mode 100644 node_modules/parent-module/readme.md delete mode 100644 node_modules/parse-json/index.js delete mode 100644 node_modules/parse-json/license delete mode 100644 node_modules/parse-json/package.json delete mode 100644 node_modules/parse-json/readme.md delete mode 100644 node_modules/path-exists/index.d.ts delete mode 100644 node_modules/path-exists/index.js delete mode 100644 node_modules/path-exists/license delete mode 100644 node_modules/path-exists/package.json delete mode 100644 node_modules/path-exists/readme.md delete mode 100644 node_modules/path-is-absolute/index.js delete mode 100644 node_modules/path-is-absolute/license delete mode 100644 node_modules/path-is-absolute/package.json delete mode 100644 node_modules/path-is-absolute/readme.md delete mode 100644 node_modules/path-type/index.d.ts delete mode 100644 node_modules/path-type/index.js delete mode 100644 node_modules/path-type/license delete mode 100644 node_modules/path-type/package.json delete mode 100644 node_modules/path-type/readme.md delete mode 100644 node_modules/picocolors/LICENSE delete mode 100644 node_modules/picocolors/README.md delete mode 100644 node_modules/picocolors/package.json delete mode 100644 node_modules/picocolors/picocolors.browser.js delete mode 100644 node_modules/picocolors/picocolors.d.ts delete mode 100644 node_modules/picocolors/picocolors.js delete mode 100644 node_modules/picocolors/types.ts delete mode 100644 node_modules/picomatch/CHANGELOG.md delete mode 100644 node_modules/picomatch/LICENSE delete mode 100644 node_modules/picomatch/README.md delete mode 100644 node_modules/picomatch/index.js delete mode 100644 node_modules/picomatch/lib/constants.js delete mode 100644 node_modules/picomatch/lib/parse.js delete mode 100644 node_modules/picomatch/lib/picomatch.js delete mode 100644 node_modules/picomatch/lib/scan.js delete mode 100644 node_modules/picomatch/lib/utils.js delete mode 100644 node_modules/picomatch/package.json delete mode 100644 node_modules/postcss-media-query-parser/CHANGELOG.md delete mode 100644 node_modules/postcss-media-query-parser/README.md delete mode 100644 node_modules/postcss-media-query-parser/dist/index.js delete mode 100644 node_modules/postcss-media-query-parser/dist/nodes/Container.js delete mode 100644 node_modules/postcss-media-query-parser/dist/nodes/Node.js delete mode 100644 node_modules/postcss-media-query-parser/dist/parsers.js delete mode 100644 node_modules/postcss-media-query-parser/package.json delete mode 100644 node_modules/postcss-resolve-nested-selector/LICENSE delete mode 100644 node_modules/postcss-resolve-nested-selector/README.md delete mode 100644 node_modules/postcss-resolve-nested-selector/index.js delete mode 100644 node_modules/postcss-resolve-nested-selector/package.json delete mode 100644 node_modules/postcss-safe-parser/LICENSE delete mode 100644 node_modules/postcss-safe-parser/README.md delete mode 100644 node_modules/postcss-safe-parser/lib/safe-parse.js delete mode 100644 node_modules/postcss-safe-parser/lib/safe-parser.js delete mode 100644 node_modules/postcss-safe-parser/package.json delete mode 100644 node_modules/postcss-scss/LICENSE delete mode 100644 node_modules/postcss-scss/README.md delete mode 100644 node_modules/postcss-scss/lib/nested-declaration.js delete mode 100644 node_modules/postcss-scss/lib/scss-parse.js delete mode 100644 node_modules/postcss-scss/lib/scss-parser.js delete mode 100644 node_modules/postcss-scss/lib/scss-stringifier.js delete mode 100644 node_modules/postcss-scss/lib/scss-stringify.js delete mode 100644 node_modules/postcss-scss/lib/scss-syntax.d.ts delete mode 100644 node_modules/postcss-scss/lib/scss-syntax.js delete mode 100644 node_modules/postcss-scss/lib/scss-syntax.mjs delete mode 100644 node_modules/postcss-scss/lib/scss-tokenize.js delete mode 100644 node_modules/postcss-scss/package.json delete mode 100644 node_modules/postcss-selector-parser/API.md delete mode 100644 node_modules/postcss-selector-parser/CHANGELOG.md delete mode 100644 node_modules/postcss-selector-parser/LICENSE-MIT delete mode 100644 node_modules/postcss-selector-parser/README.md delete mode 100644 node_modules/postcss-selector-parser/dist/index.js delete mode 100644 node_modules/postcss-selector-parser/dist/parser.js delete mode 100644 node_modules/postcss-selector-parser/dist/processor.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/attribute.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/className.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/combinator.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/comment.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/constructors.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/container.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/guards.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/id.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/index.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/namespace.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/nesting.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/node.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/pseudo.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/root.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/selector.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/string.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/tag.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/types.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/universal.js delete mode 100644 node_modules/postcss-selector-parser/dist/sortAscending.js delete mode 100644 node_modules/postcss-selector-parser/dist/tokenTypes.js delete mode 100644 node_modules/postcss-selector-parser/dist/tokenize.js delete mode 100644 node_modules/postcss-selector-parser/dist/util/ensureObject.js delete mode 100644 node_modules/postcss-selector-parser/dist/util/getProp.js delete mode 100644 node_modules/postcss-selector-parser/dist/util/index.js delete mode 100644 node_modules/postcss-selector-parser/dist/util/stripComments.js delete mode 100644 node_modules/postcss-selector-parser/dist/util/unesc.js delete mode 100644 node_modules/postcss-selector-parser/package.json delete mode 100644 node_modules/postcss-selector-parser/postcss-selector-parser.d.ts delete mode 100644 node_modules/postcss-value-parser/LICENSE delete mode 100644 node_modules/postcss-value-parser/README.md delete mode 100644 node_modules/postcss-value-parser/lib/index.d.ts delete mode 100644 node_modules/postcss-value-parser/lib/index.js delete mode 100644 node_modules/postcss-value-parser/lib/parse.js delete mode 100644 node_modules/postcss-value-parser/lib/stringify.js delete mode 100644 node_modules/postcss-value-parser/lib/unit.js delete mode 100644 node_modules/postcss-value-parser/lib/walk.js delete mode 100644 node_modules/postcss-value-parser/package.json delete mode 100644 node_modules/postcss/LICENSE delete mode 100644 node_modules/postcss/README.md delete mode 100644 node_modules/postcss/lib/at-rule.d.ts delete mode 100644 node_modules/postcss/lib/at-rule.js delete mode 100644 node_modules/postcss/lib/comment.d.ts delete mode 100644 node_modules/postcss/lib/comment.js delete mode 100644 node_modules/postcss/lib/container.d.ts delete mode 100644 node_modules/postcss/lib/container.js delete mode 100644 node_modules/postcss/lib/css-syntax-error.d.ts delete mode 100644 node_modules/postcss/lib/css-syntax-error.js delete mode 100644 node_modules/postcss/lib/declaration.d.ts delete mode 100644 node_modules/postcss/lib/declaration.js delete mode 100644 node_modules/postcss/lib/document.d.ts delete mode 100644 node_modules/postcss/lib/document.js delete mode 100644 node_modules/postcss/lib/fromJSON.d.ts delete mode 100644 node_modules/postcss/lib/fromJSON.js delete mode 100644 node_modules/postcss/lib/input.d.ts delete mode 100644 node_modules/postcss/lib/input.js delete mode 100644 node_modules/postcss/lib/lazy-result.d.ts delete mode 100644 node_modules/postcss/lib/lazy-result.js delete mode 100644 node_modules/postcss/lib/list.d.ts delete mode 100644 node_modules/postcss/lib/list.js delete mode 100644 node_modules/postcss/lib/map-generator.js delete mode 100644 node_modules/postcss/lib/no-work-result.d.ts delete mode 100644 node_modules/postcss/lib/no-work-result.js delete mode 100644 node_modules/postcss/lib/node.d.ts delete mode 100644 node_modules/postcss/lib/node.js delete mode 100644 node_modules/postcss/lib/parse.d.ts delete mode 100644 node_modules/postcss/lib/parse.js delete mode 100644 node_modules/postcss/lib/parser.js delete mode 100644 node_modules/postcss/lib/postcss.d.mts delete mode 100644 node_modules/postcss/lib/postcss.d.ts delete mode 100644 node_modules/postcss/lib/postcss.js delete mode 100644 node_modules/postcss/lib/postcss.mjs delete mode 100644 node_modules/postcss/lib/previous-map.d.ts delete mode 100644 node_modules/postcss/lib/previous-map.js delete mode 100644 node_modules/postcss/lib/processor.d.ts delete mode 100644 node_modules/postcss/lib/processor.js delete mode 100644 node_modules/postcss/lib/result.d.ts delete mode 100644 node_modules/postcss/lib/result.js delete mode 100644 node_modules/postcss/lib/root.d.ts delete mode 100644 node_modules/postcss/lib/root.js delete mode 100644 node_modules/postcss/lib/rule.d.ts delete mode 100644 node_modules/postcss/lib/rule.js delete mode 100644 node_modules/postcss/lib/stringifier.d.ts delete mode 100644 node_modules/postcss/lib/stringifier.js delete mode 100644 node_modules/postcss/lib/stringify.d.ts delete mode 100644 node_modules/postcss/lib/stringify.js delete mode 100644 node_modules/postcss/lib/symbols.js delete mode 100644 node_modules/postcss/lib/terminal-highlight.js delete mode 100644 node_modules/postcss/lib/tokenize.js delete mode 100644 node_modules/postcss/lib/warn-once.js delete mode 100644 node_modules/postcss/lib/warning.d.ts delete mode 100644 node_modules/postcss/lib/warning.js delete mode 100755 node_modules/postcss/package.json delete mode 100644 node_modules/punycode/LICENSE-MIT.txt delete mode 100644 node_modules/punycode/README.md delete mode 100644 node_modules/punycode/package.json delete mode 100644 node_modules/punycode/punycode.es6.js delete mode 100644 node_modules/punycode/punycode.js delete mode 100755 node_modules/queue-microtask/LICENSE delete mode 100644 node_modules/queue-microtask/README.md delete mode 100644 node_modules/queue-microtask/index.d.ts delete mode 100644 node_modules/queue-microtask/index.js delete mode 100644 node_modules/queue-microtask/package.json delete mode 100644 node_modules/quick-lru/index.d.ts delete mode 100644 node_modules/quick-lru/index.js delete mode 100644 node_modules/quick-lru/license delete mode 100644 node_modules/quick-lru/package.json delete mode 100644 node_modules/quick-lru/readme.md delete mode 100644 node_modules/read-pkg-up/index.d.ts delete mode 100644 node_modules/read-pkg-up/index.js delete mode 100644 node_modules/read-pkg-up/license delete mode 100644 node_modules/read-pkg-up/package.json delete mode 100644 node_modules/read-pkg-up/readme.md delete mode 100644 node_modules/read-pkg/index.d.ts delete mode 100644 node_modules/read-pkg/index.js delete mode 100644 node_modules/read-pkg/license delete mode 100644 node_modules/read-pkg/package.json delete mode 100644 node_modules/read-pkg/readme.md delete mode 100644 node_modules/redent/index.d.ts delete mode 100644 node_modules/redent/index.js delete mode 100644 node_modules/redent/license delete mode 100644 node_modules/redent/package.json delete mode 100644 node_modules/redent/readme.md delete mode 100644 node_modules/require-from-string/index.js delete mode 100644 node_modules/require-from-string/license delete mode 100644 node_modules/require-from-string/package.json delete mode 100644 node_modules/require-from-string/readme.md delete mode 100644 node_modules/resolve-from/index.d.ts delete mode 100644 node_modules/resolve-from/index.js delete mode 100644 node_modules/resolve-from/license delete mode 100644 node_modules/resolve-from/package.json delete mode 100644 node_modules/resolve-from/readme.md delete mode 100644 node_modules/reusify/.coveralls.yml delete mode 100644 node_modules/reusify/.travis.yml delete mode 100644 node_modules/reusify/LICENSE delete mode 100644 node_modules/reusify/README.md delete mode 100644 node_modules/reusify/benchmarks/createNoCodeFunction.js delete mode 100644 node_modules/reusify/benchmarks/fib.js delete mode 100644 node_modules/reusify/benchmarks/reuseNoCodeFunction.js delete mode 100644 node_modules/reusify/package.json delete mode 100644 node_modules/reusify/reusify.js delete mode 100644 node_modules/reusify/test.js delete mode 100644 node_modules/rimraf/CHANGELOG.md delete mode 100644 node_modules/rimraf/LICENSE delete mode 100644 node_modules/rimraf/README.md delete mode 100755 node_modules/rimraf/bin.js delete mode 100644 node_modules/rimraf/package.json delete mode 100644 node_modules/rimraf/rimraf.js delete mode 100644 node_modules/run-parallel/LICENSE delete mode 100644 node_modules/run-parallel/README.md delete mode 100644 node_modules/run-parallel/index.js delete mode 100644 node_modules/run-parallel/package.json delete mode 100644 node_modules/semver/LICENSE delete mode 100644 node_modules/semver/README.md delete mode 100755 node_modules/semver/bin/semver.js delete mode 100644 node_modules/semver/classes/comparator.js delete mode 100644 node_modules/semver/classes/index.js delete mode 100644 node_modules/semver/classes/range.js delete mode 100644 node_modules/semver/classes/semver.js delete mode 100644 node_modules/semver/functions/clean.js delete mode 100644 node_modules/semver/functions/cmp.js delete mode 100644 node_modules/semver/functions/coerce.js delete mode 100644 node_modules/semver/functions/compare-build.js delete mode 100644 node_modules/semver/functions/compare-loose.js delete mode 100644 node_modules/semver/functions/compare.js delete mode 100644 node_modules/semver/functions/diff.js delete mode 100644 node_modules/semver/functions/eq.js delete mode 100644 node_modules/semver/functions/gt.js delete mode 100644 node_modules/semver/functions/gte.js delete mode 100644 node_modules/semver/functions/inc.js delete mode 100644 node_modules/semver/functions/lt.js delete mode 100644 node_modules/semver/functions/lte.js delete mode 100644 node_modules/semver/functions/major.js delete mode 100644 node_modules/semver/functions/minor.js delete mode 100644 node_modules/semver/functions/neq.js delete mode 100644 node_modules/semver/functions/parse.js delete mode 100644 node_modules/semver/functions/patch.js delete mode 100644 node_modules/semver/functions/prerelease.js delete mode 100644 node_modules/semver/functions/rcompare.js delete mode 100644 node_modules/semver/functions/rsort.js delete mode 100644 node_modules/semver/functions/satisfies.js delete mode 100644 node_modules/semver/functions/sort.js delete mode 100644 node_modules/semver/functions/valid.js delete mode 100644 node_modules/semver/index.js delete mode 100644 node_modules/semver/internal/constants.js delete mode 100644 node_modules/semver/internal/debug.js delete mode 100644 node_modules/semver/internal/identifiers.js delete mode 100644 node_modules/semver/internal/parse-options.js delete mode 100644 node_modules/semver/internal/re.js delete mode 100644 node_modules/semver/package.json delete mode 100644 node_modules/semver/preload.js delete mode 100644 node_modules/semver/range.bnf delete mode 100644 node_modules/semver/ranges/gtr.js delete mode 100644 node_modules/semver/ranges/intersects.js delete mode 100644 node_modules/semver/ranges/ltr.js delete mode 100644 node_modules/semver/ranges/max-satisfying.js delete mode 100644 node_modules/semver/ranges/min-satisfying.js delete mode 100644 node_modules/semver/ranges/min-version.js delete mode 100644 node_modules/semver/ranges/outside.js delete mode 100644 node_modules/semver/ranges/simplify.js delete mode 100644 node_modules/semver/ranges/subset.js delete mode 100644 node_modules/semver/ranges/to-comparators.js delete mode 100644 node_modules/semver/ranges/valid.js delete mode 100644 node_modules/signal-exit/LICENSE.txt delete mode 100644 node_modules/signal-exit/README.md delete mode 100644 node_modules/signal-exit/dist/cjs/browser.d.ts delete mode 100644 node_modules/signal-exit/dist/cjs/browser.d.ts.map delete mode 100644 node_modules/signal-exit/dist/cjs/browser.js delete mode 100644 node_modules/signal-exit/dist/cjs/browser.js.map delete mode 100644 node_modules/signal-exit/dist/cjs/index.d.ts delete mode 100644 node_modules/signal-exit/dist/cjs/index.d.ts.map delete mode 100644 node_modules/signal-exit/dist/cjs/index.js delete mode 100644 node_modules/signal-exit/dist/cjs/index.js.map delete mode 100644 node_modules/signal-exit/dist/cjs/package.json delete mode 100644 node_modules/signal-exit/dist/cjs/signals.d.ts delete mode 100644 node_modules/signal-exit/dist/cjs/signals.d.ts.map delete mode 100644 node_modules/signal-exit/dist/cjs/signals.js delete mode 100644 node_modules/signal-exit/dist/cjs/signals.js.map delete mode 100644 node_modules/signal-exit/dist/mjs/browser.d.ts delete mode 100644 node_modules/signal-exit/dist/mjs/browser.d.ts.map delete mode 100644 node_modules/signal-exit/dist/mjs/browser.js delete mode 100644 node_modules/signal-exit/dist/mjs/browser.js.map delete mode 100644 node_modules/signal-exit/dist/mjs/index.d.ts delete mode 100644 node_modules/signal-exit/dist/mjs/index.d.ts.map delete mode 100644 node_modules/signal-exit/dist/mjs/index.js delete mode 100644 node_modules/signal-exit/dist/mjs/index.js.map delete mode 100644 node_modules/signal-exit/dist/mjs/package.json delete mode 100644 node_modules/signal-exit/dist/mjs/signals.d.ts delete mode 100644 node_modules/signal-exit/dist/mjs/signals.d.ts.map delete mode 100644 node_modules/signal-exit/dist/mjs/signals.js delete mode 100644 node_modules/signal-exit/dist/mjs/signals.js.map delete mode 100644 node_modules/signal-exit/package.json delete mode 100644 node_modules/slash/index.d.ts delete mode 100644 node_modules/slash/index.js delete mode 100644 node_modules/slash/license delete mode 100644 node_modules/slash/package.json delete mode 100644 node_modules/slash/readme.md delete mode 100755 node_modules/slice-ansi/index.js delete mode 100644 node_modules/slice-ansi/license delete mode 100644 node_modules/slice-ansi/node_modules/ansi-styles/index.d.ts delete mode 100644 node_modules/slice-ansi/node_modules/ansi-styles/index.js delete mode 100644 node_modules/slice-ansi/node_modules/ansi-styles/license delete mode 100644 node_modules/slice-ansi/node_modules/ansi-styles/package.json delete mode 100644 node_modules/slice-ansi/node_modules/ansi-styles/readme.md delete mode 100644 node_modules/slice-ansi/node_modules/color-convert/CHANGELOG.md delete mode 100644 node_modules/slice-ansi/node_modules/color-convert/LICENSE delete mode 100644 node_modules/slice-ansi/node_modules/color-convert/README.md delete mode 100644 node_modules/slice-ansi/node_modules/color-convert/conversions.js delete mode 100644 node_modules/slice-ansi/node_modules/color-convert/index.js delete mode 100644 node_modules/slice-ansi/node_modules/color-convert/package.json delete mode 100644 node_modules/slice-ansi/node_modules/color-convert/route.js delete mode 100644 node_modules/slice-ansi/node_modules/color-name/LICENSE delete mode 100644 node_modules/slice-ansi/node_modules/color-name/README.md delete mode 100644 node_modules/slice-ansi/node_modules/color-name/index.js delete mode 100644 node_modules/slice-ansi/node_modules/color-name/package.json delete mode 100644 node_modules/slice-ansi/package.json delete mode 100644 node_modules/slice-ansi/readme.md delete mode 100644 node_modules/source-map-js/CHANGELOG.md delete mode 100644 node_modules/source-map-js/LICENSE delete mode 100644 node_modules/source-map-js/README.md delete mode 100644 node_modules/source-map-js/lib/array-set.js delete mode 100644 node_modules/source-map-js/lib/base64-vlq.js delete mode 100644 node_modules/source-map-js/lib/base64.js delete mode 100644 node_modules/source-map-js/lib/binary-search.js delete mode 100644 node_modules/source-map-js/lib/mapping-list.js delete mode 100644 node_modules/source-map-js/lib/quick-sort.js delete mode 100644 node_modules/source-map-js/lib/source-map-consumer.js delete mode 100644 node_modules/source-map-js/lib/source-map-generator.js delete mode 100644 node_modules/source-map-js/lib/source-node.js delete mode 100644 node_modules/source-map-js/lib/util.js delete mode 100644 node_modules/source-map-js/package.json delete mode 100644 node_modules/source-map-js/source-map.d.ts delete mode 100644 node_modules/source-map-js/source-map.js delete mode 100644 node_modules/spdx-correct/LICENSE delete mode 100644 node_modules/spdx-correct/README.md delete mode 100644 node_modules/spdx-correct/index.js delete mode 100644 node_modules/spdx-correct/package.json delete mode 100644 node_modules/spdx-exceptions/README.md delete mode 100644 node_modules/spdx-exceptions/index.json delete mode 100644 node_modules/spdx-exceptions/package.json delete mode 100644 node_modules/spdx-expression-parse/AUTHORS delete mode 100644 node_modules/spdx-expression-parse/LICENSE delete mode 100644 node_modules/spdx-expression-parse/README.md delete mode 100644 node_modules/spdx-expression-parse/index.js delete mode 100644 node_modules/spdx-expression-parse/package.json delete mode 100644 node_modules/spdx-expression-parse/parse.js delete mode 100644 node_modules/spdx-expression-parse/scan.js delete mode 100644 node_modules/spdx-license-ids/README.md delete mode 100644 node_modules/spdx-license-ids/deprecated.json delete mode 100644 node_modules/spdx-license-ids/index.json delete mode 100644 node_modules/spdx-license-ids/package.json delete mode 100644 node_modules/string-width/index.d.ts delete mode 100644 node_modules/string-width/index.js delete mode 100644 node_modules/string-width/license delete mode 100644 node_modules/string-width/package.json delete mode 100644 node_modules/string-width/readme.md delete mode 100644 node_modules/strip-ansi/index.d.ts delete mode 100644 node_modules/strip-ansi/index.js delete mode 100644 node_modules/strip-ansi/license delete mode 100644 node_modules/strip-ansi/package.json delete mode 100644 node_modules/strip-ansi/readme.md delete mode 100644 node_modules/strip-indent/index.d.ts delete mode 100644 node_modules/strip-indent/index.js delete mode 100644 node_modules/strip-indent/license delete mode 100644 node_modules/strip-indent/package.json delete mode 100644 node_modules/strip-indent/readme.md delete mode 100644 node_modules/style-search/.npmignore delete mode 100644 node_modules/style-search/CHANGELOG.md delete mode 100644 node_modules/style-search/LICENSE delete mode 100644 node_modules/style-search/README.md delete mode 100644 node_modules/style-search/circle.yml delete mode 100644 node_modules/style-search/index.js delete mode 100644 node_modules/style-search/package.json delete mode 100644 node_modules/style-search/test.js delete mode 100644 node_modules/stylelint-config-recommended-scss/LICENSE delete mode 100644 node_modules/stylelint-config-recommended-scss/README.md delete mode 100644 node_modules/stylelint-config-recommended-scss/index.js delete mode 100644 node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/LICENSE delete mode 100644 node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/README.md delete mode 100644 node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/index.js delete mode 100644 node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/package.json delete mode 100644 node_modules/stylelint-config-recommended-scss/package.json delete mode 100644 node_modules/stylelint-config-recommended/LICENSE delete mode 100644 node_modules/stylelint-config-recommended/README.md delete mode 100644 node_modules/stylelint-config-recommended/index.js delete mode 100644 node_modules/stylelint-config-recommended/package.json delete mode 100644 node_modules/stylelint-config-standard-scss/LICENSE delete mode 100644 node_modules/stylelint-config-standard-scss/README.md delete mode 100644 node_modules/stylelint-config-standard-scss/index.js delete mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/LICENSE delete mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/README.md delete mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/index.js delete mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/package.json delete mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/LICENSE delete mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/README.md delete mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/index.js delete mode 100644 node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/package.json delete mode 100644 node_modules/stylelint-config-standard-scss/package.json delete mode 100644 node_modules/stylelint-config-standard/LICENSE delete mode 100644 node_modules/stylelint-config-standard/README.md delete mode 100644 node_modules/stylelint-config-standard/index.js delete mode 100644 node_modules/stylelint-config-standard/package.json delete mode 100644 node_modules/stylelint-scss/LICENSE delete mode 100644 node_modules/stylelint-scss/README.md delete mode 100644 node_modules/stylelint-scss/package.json delete mode 100644 node_modules/stylelint-scss/src/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-else-empty-line-before/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-else-empty-line-before/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-function-named-arguments/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-function-named-arguments/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-function-pattern/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-function-pattern/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-if-no-null/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-if-no-null/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-import-partial-extension/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-import-partial-extension/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-pattern/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-mixin-pattern/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-rule-no-unknown/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-rule-no-unknown/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/comment-no-empty/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/comment-no-empty/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/comment-no-loud/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/comment-no-loud/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/declaration-nested-properties/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/declaration-nested-properties/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-default/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-default/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-pattern/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/dollar-variable-pattern/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/double-slash-comment-inline/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/double-slash-comment-inline/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/function-color-relative/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/function-color-relative/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/function-no-unknown/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/function-no-unknown/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/map-keys-quotes/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/map-keys-quotes/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/no-dollar-variables/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/no-dollar-variables/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/no-duplicate-mixins/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/no-duplicate-mixins/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/no-global-function-names/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/no-global-function-names/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/operator-no-newline-after/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/operator-no-newline-after/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/operator-no-newline-before/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/operator-no-newline-before/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/operator-no-unspaced/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/operator-no-unspaced/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/partial-no-import/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/partial-no-import/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/selector-nest-combinators/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/selector-nest-combinators/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/index.js delete mode 100644 node_modules/stylelint-scss/src/rules/selector-no-union-class-name/README.md delete mode 100644 node_modules/stylelint-scss/src/rules/selector-no-union-class-name/index.js delete mode 100644 node_modules/stylelint-scss/src/utils/addEmptyLineBefore.js delete mode 100644 node_modules/stylelint-scss/src/utils/atRuleBaseName.js delete mode 100644 node_modules/stylelint-scss/src/utils/atRuleParamIndex.js delete mode 100644 node_modules/stylelint-scss/src/utils/beforeBlockString.js delete mode 100644 node_modules/stylelint-scss/src/utils/blockString.js delete mode 100644 node_modules/stylelint-scss/src/utils/configurationError.js delete mode 100644 node_modules/stylelint-scss/src/utils/declarationValueIndex.js delete mode 100644 node_modules/stylelint-scss/src/utils/eachRoot.js delete mode 100644 node_modules/stylelint-scss/src/utils/findCommentsInRaws.js delete mode 100644 node_modules/stylelint-scss/src/utils/functions.js delete mode 100644 node_modules/stylelint-scss/src/utils/hasBlock.js delete mode 100644 node_modules/stylelint-scss/src/utils/hasEmptyLine.js delete mode 100644 node_modules/stylelint-scss/src/utils/hasInterpolatingAmpersand.js delete mode 100644 node_modules/stylelint-scss/src/utils/hasInterpolation.js delete mode 100644 node_modules/stylelint-scss/src/utils/hasLessInterpolation.js delete mode 100644 node_modules/stylelint-scss/src/utils/hasNestedSibling.js delete mode 100644 node_modules/stylelint-scss/src/utils/hasPsvInterpolation.js delete mode 100644 node_modules/stylelint-scss/src/utils/hasScssInterpolation.js delete mode 100644 node_modules/stylelint-scss/src/utils/hasTplInterpolation.js delete mode 100644 node_modules/stylelint-scss/src/utils/isCustomPropertySet.js delete mode 100644 node_modules/stylelint-scss/src/utils/isInlineComment.js delete mode 100644 node_modules/stylelint-scss/src/utils/isNativeCssFunction.js delete mode 100644 node_modules/stylelint-scss/src/utils/isSingleLineString.js delete mode 100644 node_modules/stylelint-scss/src/utils/isStandardRule.js delete mode 100644 node_modules/stylelint-scss/src/utils/isStandardSelector.js delete mode 100644 node_modules/stylelint-scss/src/utils/isStandardSyntaxProperty.js delete mode 100644 node_modules/stylelint-scss/src/utils/isStandardSyntaxSelector.js delete mode 100644 node_modules/stylelint-scss/src/utils/isType.js delete mode 100644 node_modules/stylelint-scss/src/utils/isWhitespace.js delete mode 100644 node_modules/stylelint-scss/src/utils/matchesStringOrRegExp.js delete mode 100644 node_modules/stylelint-scss/src/utils/moduleNamespace.js delete mode 100644 node_modules/stylelint-scss/src/utils/namespace.js delete mode 100644 node_modules/stylelint-scss/src/utils/optionsHaveException.js delete mode 100644 node_modules/stylelint-scss/src/utils/optionsHaveIgnored.js delete mode 100644 node_modules/stylelint-scss/src/utils/optionsMatches.js delete mode 100644 node_modules/stylelint-scss/src/utils/parseFunctionArguments.js delete mode 100644 node_modules/stylelint-scss/src/utils/parseNestedPropRoot.js delete mode 100644 node_modules/stylelint-scss/src/utils/parseSelector.js delete mode 100644 node_modules/stylelint-scss/src/utils/rawNodeString.js delete mode 100644 node_modules/stylelint-scss/src/utils/removeEmptyLinesBefore.js delete mode 100644 node_modules/stylelint-scss/src/utils/ruleUrl.js delete mode 100644 node_modules/stylelint-scss/src/utils/sassValueParser/index.js delete mode 100644 node_modules/stylelint-scss/src/utils/validateTypes.js delete mode 100644 node_modules/stylelint-scss/src/utils/whitespaceChecker.js delete mode 100644 node_modules/stylelint/LICENSE delete mode 100644 node_modules/stylelint/README.md delete mode 100755 node_modules/stylelint/bin/stylelint.mjs delete mode 100644 node_modules/stylelint/lib/assignDisabledRanges.js delete mode 100644 node_modules/stylelint/lib/augmentConfig.js delete mode 100644 node_modules/stylelint/lib/cli.mjs delete mode 100644 node_modules/stylelint/lib/constants.js delete mode 100644 node_modules/stylelint/lib/createPartialStylelintResult.js delete mode 100644 node_modules/stylelint/lib/createPlugin.js delete mode 100644 node_modules/stylelint/lib/createStylelint.js delete mode 100644 node_modules/stylelint/lib/descriptionlessDisables.js delete mode 100644 node_modules/stylelint/lib/formatters/calcSeverityCounts.js delete mode 100644 node_modules/stylelint/lib/formatters/compactFormatter.js delete mode 100644 node_modules/stylelint/lib/formatters/githubFormatter.js delete mode 100644 node_modules/stylelint/lib/formatters/index.js delete mode 100644 node_modules/stylelint/lib/formatters/jsonFormatter.js delete mode 100644 node_modules/stylelint/lib/formatters/preprocessWarnings.js delete mode 100644 node_modules/stylelint/lib/formatters/stringFormatter.js delete mode 100644 node_modules/stylelint/lib/formatters/tapFormatter.js delete mode 100644 node_modules/stylelint/lib/formatters/terminalLink.js delete mode 100644 node_modules/stylelint/lib/formatters/unixFormatter.js delete mode 100644 node_modules/stylelint/lib/formatters/verboseFormatter.js delete mode 100644 node_modules/stylelint/lib/getConfigForFile.js delete mode 100644 node_modules/stylelint/lib/getPostcssResult.js delete mode 100644 node_modules/stylelint/lib/index.js delete mode 100644 node_modules/stylelint/lib/invalidScopeDisables.js delete mode 100644 node_modules/stylelint/lib/isPathIgnored.js delete mode 100644 node_modules/stylelint/lib/lintPostcssResult.js delete mode 100644 node_modules/stylelint/lib/lintSource.js delete mode 100644 node_modules/stylelint/lib/needlessDisables.js delete mode 100644 node_modules/stylelint/lib/normalizeAllRuleSettings.js delete mode 100644 node_modules/stylelint/lib/normalizeRuleSettings.js delete mode 100644 node_modules/stylelint/lib/postcssPlugin.js delete mode 100644 node_modules/stylelint/lib/prepareReturnValue.js delete mode 100644 node_modules/stylelint/lib/printConfig.js delete mode 100644 node_modules/stylelint/lib/reference/atKeywords.js delete mode 100644 node_modules/stylelint/lib/reference/functions.js delete mode 100644 node_modules/stylelint/lib/reference/keywords.js delete mode 100644 node_modules/stylelint/lib/reference/mediaFeatures.js delete mode 100644 node_modules/stylelint/lib/reference/prefixes.js delete mode 100644 node_modules/stylelint/lib/reference/properties.js delete mode 100644 node_modules/stylelint/lib/reference/selectors.js delete mode 100644 node_modules/stylelint/lib/reference/units.js delete mode 100644 node_modules/stylelint/lib/reportDisables.js delete mode 100644 node_modules/stylelint/lib/reportUnknownRuleNames.js delete mode 100644 node_modules/stylelint/lib/resolveConfig.js delete mode 100644 node_modules/stylelint/lib/resolveCustomFormatter.js delete mode 100644 node_modules/stylelint/lib/rules/alpha-value-notation/index.js delete mode 100644 node_modules/stylelint/lib/rules/annotation-no-unknown/index.js delete mode 100644 node_modules/stylelint/lib/rules/at-rule-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/at-rule-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/at-rule-empty-line-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/at-rule-name-case/index.js delete mode 100644 node_modules/stylelint/lib/rules/at-rule-name-newline-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/at-rule-name-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/at-rule-no-unknown/index.js delete mode 100644 node_modules/stylelint/lib/rules/at-rule-no-vendor-prefix/index.js delete mode 100644 node_modules/stylelint/lib/rules/at-rule-property-required-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/at-rule-semicolon-newline-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/at-rule-semicolon-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js delete mode 100644 node_modules/stylelint/lib/rules/block-closing-brace-empty-line-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/block-closing-brace-newline-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/block-closing-brace-newline-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/block-closing-brace-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/block-closing-brace-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/block-no-empty/index.js delete mode 100644 node_modules/stylelint/lib/rules/block-opening-brace-newline-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/block-opening-brace-newline-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/block-opening-brace-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/block-opening-brace-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/color-function-notation/index.js delete mode 100644 node_modules/stylelint/lib/rules/color-hex-alpha/index.js delete mode 100644 node_modules/stylelint/lib/rules/color-hex-case/index.js delete mode 100644 node_modules/stylelint/lib/rules/color-hex-length/index.js delete mode 100644 node_modules/stylelint/lib/rules/color-named/colordUtils.js delete mode 100644 node_modules/stylelint/lib/rules/color-named/index.js delete mode 100644 node_modules/stylelint/lib/rules/color-no-hex/index.js delete mode 100644 node_modules/stylelint/lib/rules/color-no-invalid-hex/index.js delete mode 100644 node_modules/stylelint/lib/rules/comment-empty-line-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/comment-no-empty/index.js delete mode 100644 node_modules/stylelint/lib/rules/comment-pattern/index.js delete mode 100644 node_modules/stylelint/lib/rules/comment-whitespace-inside/index.js delete mode 100644 node_modules/stylelint/lib/rules/comment-word-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/custom-media-pattern/index.js delete mode 100644 node_modules/stylelint/lib/rules/custom-property-empty-line-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/custom-property-no-missing-var-function/index.js delete mode 100644 node_modules/stylelint/lib/rules/custom-property-pattern/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-bang-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-bang-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-block-no-duplicate-custom-properties/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-block-no-duplicate-properties/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-block-no-redundant-longhand-properties/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-block-semicolon-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-block-semicolon-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-block-single-line-max-declarations/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-block-trailing-semicolon/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-colon-newline-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-colon-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-colon-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-empty-line-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-no-important/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-property-max-values/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-property-unit-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-property-unit-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-property-value-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-property-value-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/declaration-property-value-no-unknown/index.js delete mode 100644 node_modules/stylelint/lib/rules/declarationBangSpaceChecker.js delete mode 100644 node_modules/stylelint/lib/rules/declarationColonSpaceChecker.js delete mode 100644 node_modules/stylelint/lib/rules/findMediaOperator.js delete mode 100644 node_modules/stylelint/lib/rules/font-family-name-quotes/index.js delete mode 100644 node_modules/stylelint/lib/rules/font-family-no-duplicate-names/index.js delete mode 100644 node_modules/stylelint/lib/rules/font-family-no-missing-generic-family-keyword/index.js delete mode 100644 node_modules/stylelint/lib/rules/font-weight-notation/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-calc-no-unspaced-operator/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-comma-newline-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-comma-newline-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-comma-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-comma-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-linear-gradient-no-nonstandard-direction/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-max-empty-lines/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-name-case/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-no-unknown/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-parentheses-newline-inside/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-parentheses-space-inside/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-url-no-scheme-relative/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-url-quotes/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-url-scheme-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-url-scheme-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/function-whitespace-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/functionCommaSpaceChecker.js delete mode 100644 node_modules/stylelint/lib/rules/functionCommaSpaceFix.js delete mode 100644 node_modules/stylelint/lib/rules/hue-degree-notation/index.js delete mode 100644 node_modules/stylelint/lib/rules/import-notation/index.js delete mode 100644 node_modules/stylelint/lib/rules/indentation/index.js delete mode 100644 node_modules/stylelint/lib/rules/index.js delete mode 100644 node_modules/stylelint/lib/rules/keyframe-block-no-duplicate-selectors/index.js delete mode 100644 node_modules/stylelint/lib/rules/keyframe-declaration-no-important/index.js delete mode 100644 node_modules/stylelint/lib/rules/keyframe-selector-notation/index.js delete mode 100644 node_modules/stylelint/lib/rules/keyframes-name-pattern/index.js delete mode 100644 node_modules/stylelint/lib/rules/length-zero-no-unit/index.js delete mode 100644 node_modules/stylelint/lib/rules/linebreaks/index.js delete mode 100644 node_modules/stylelint/lib/rules/max-empty-lines/index.js delete mode 100644 node_modules/stylelint/lib/rules/max-line-length/index.js delete mode 100644 node_modules/stylelint/lib/rules/max-nesting-depth/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-colon-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-colon-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-name-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-name-case/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-name-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-name-no-unknown/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-name-no-vendor-prefix/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-name-unit-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-name-value-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-name-value-no-unknown/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-parentheses-space-inside/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-range-notation/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-range-operator-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-feature-range-operator-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-query-list-comma-newline-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-query-list-comma-newline-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-query-list-comma-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-query-list-comma-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/media-query-no-invalid/index.js delete mode 100644 node_modules/stylelint/lib/rules/mediaFeatureColonSpaceChecker.js delete mode 100644 node_modules/stylelint/lib/rules/mediaQueryListCommaWhitespaceChecker.js delete mode 100644 node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/index.js delete mode 100644 node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/utils/findNotContiguousOrRectangular.js delete mode 100644 node_modules/stylelint/lib/rules/no-descending-specificity/index.js delete mode 100644 node_modules/stylelint/lib/rules/no-duplicate-at-import-rules/index.js delete mode 100644 node_modules/stylelint/lib/rules/no-duplicate-selectors/index.js delete mode 100644 node_modules/stylelint/lib/rules/no-empty-first-line/index.js delete mode 100644 node_modules/stylelint/lib/rules/no-empty-source/index.js delete mode 100644 node_modules/stylelint/lib/rules/no-eol-whitespace/index.js delete mode 100644 node_modules/stylelint/lib/rules/no-extra-semicolons/index.js delete mode 100644 node_modules/stylelint/lib/rules/no-invalid-double-slash-comments/index.js delete mode 100644 node_modules/stylelint/lib/rules/no-invalid-position-at-import-rule/index.js delete mode 100644 node_modules/stylelint/lib/rules/no-irregular-whitespace/index.js delete mode 100644 node_modules/stylelint/lib/rules/no-missing-end-of-source-newline/index.js delete mode 100644 node_modules/stylelint/lib/rules/no-unknown-animations/index.js delete mode 100644 node_modules/stylelint/lib/rules/no-unknown-custom-properties/index.js delete mode 100644 node_modules/stylelint/lib/rules/number-leading-zero/index.js delete mode 100644 node_modules/stylelint/lib/rules/number-max-precision/index.js delete mode 100644 node_modules/stylelint/lib/rules/number-no-trailing-zeros/index.js delete mode 100644 node_modules/stylelint/lib/rules/property-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/property-case/index.js delete mode 100644 node_modules/stylelint/lib/rules/property-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/property-no-unknown/index.js delete mode 100644 node_modules/stylelint/lib/rules/property-no-vendor-prefix/index.js delete mode 100644 node_modules/stylelint/lib/rules/rule-empty-line-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/rule-selector-property-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-anb-no-unmatchable/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-attribute-brackets-space-inside/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-attribute-name-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-attribute-operator-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-attribute-operator-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-attribute-operator-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-attribute-operator-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-attribute-quotes/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-class-pattern/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-combinator-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-combinator-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-combinator-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-combinator-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-descendant-combinator-no-non-space/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-id-pattern/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-list-comma-newline-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-list-comma-newline-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-list-comma-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-list-comma-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-max-attribute/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-max-class/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-max-combinators/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-max-compound-selectors/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-max-empty-lines/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-max-id/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-max-pseudo-class/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-max-specificity/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-max-type/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-max-universal/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-nested-pattern/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-no-qualifying-type/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-no-vendor-prefix/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-not-notation/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-class-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-class-case/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-class-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-class-no-unknown/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-class-parentheses-space-inside/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-element-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-element-case/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-element-colon-notation/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-element-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-pseudo-element-no-unknown/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-type-case/index.js delete mode 100644 node_modules/stylelint/lib/rules/selector-type-no-unknown/index.js delete mode 100644 node_modules/stylelint/lib/rules/selectorAttributeOperatorSpaceChecker.js delete mode 100644 node_modules/stylelint/lib/rules/selectorCombinatorSpaceChecker.js delete mode 100644 node_modules/stylelint/lib/rules/selectorListCommaWhitespaceChecker.js delete mode 100644 node_modules/stylelint/lib/rules/shorthand-property-no-redundant-values/index.js delete mode 100644 node_modules/stylelint/lib/rules/string-no-newline/index.js delete mode 100644 node_modules/stylelint/lib/rules/string-quotes/index.js delete mode 100644 node_modules/stylelint/lib/rules/time-min-milliseconds/index.js delete mode 100644 node_modules/stylelint/lib/rules/unicode-bom/index.js delete mode 100644 node_modules/stylelint/lib/rules/unit-allowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/unit-case/index.js delete mode 100644 node_modules/stylelint/lib/rules/unit-disallowed-list/index.js delete mode 100644 node_modules/stylelint/lib/rules/unit-no-unknown/index.js delete mode 100644 node_modules/stylelint/lib/rules/value-keyword-case/index.js delete mode 100644 node_modules/stylelint/lib/rules/value-list-comma-newline-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/value-list-comma-newline-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/value-list-comma-space-after/index.js delete mode 100644 node_modules/stylelint/lib/rules/value-list-comma-space-before/index.js delete mode 100644 node_modules/stylelint/lib/rules/value-list-max-empty-lines/index.js delete mode 100644 node_modules/stylelint/lib/rules/value-no-vendor-prefix/index.js delete mode 100644 node_modules/stylelint/lib/rules/valueListCommaWhitespaceChecker.js delete mode 100644 node_modules/stylelint/lib/standalone.js delete mode 100644 node_modules/stylelint/lib/utils/FileCache.js delete mode 100644 node_modules/stylelint/lib/utils/addEmptyLineAfter.js delete mode 100644 node_modules/stylelint/lib/utils/addEmptyLineBefore.js delete mode 100644 node_modules/stylelint/lib/utils/allFilesIgnoredError.js delete mode 100644 node_modules/stylelint/lib/utils/arrayEqual.js delete mode 100644 node_modules/stylelint/lib/utils/atRuleParamIndex.js delete mode 100644 node_modules/stylelint/lib/utils/beforeBlockString.js delete mode 100644 node_modules/stylelint/lib/utils/blockString.js delete mode 100644 node_modules/stylelint/lib/utils/blurInterpolation.js delete mode 100644 node_modules/stylelint/lib/utils/checkAgainstRule.js delete mode 100644 node_modules/stylelint/lib/utils/checkInvalidCLIOptions.js delete mode 100644 node_modules/stylelint/lib/utils/configurationComment.js delete mode 100644 node_modules/stylelint/lib/utils/configurationError.js delete mode 100644 node_modules/stylelint/lib/utils/containsString.js delete mode 100644 node_modules/stylelint/lib/utils/createMapWithSet.js delete mode 100644 node_modules/stylelint/lib/utils/declarationValueIndex.js delete mode 100644 node_modules/stylelint/lib/utils/eachDeclarationBlock.js delete mode 100644 node_modules/stylelint/lib/utils/filterFilePaths.js delete mode 100644 node_modules/stylelint/lib/utils/findAnimationName.js delete mode 100644 node_modules/stylelint/lib/utils/findAtRuleContext.js delete mode 100644 node_modules/stylelint/lib/utils/findFontFamily.js delete mode 100644 node_modules/stylelint/lib/utils/findMediaFeatureNames.js delete mode 100644 node_modules/stylelint/lib/utils/functionArgumentsSearch.js delete mode 100644 node_modules/stylelint/lib/utils/getAtRuleParams.js delete mode 100644 node_modules/stylelint/lib/utils/getCacheFile.js delete mode 100644 node_modules/stylelint/lib/utils/getDeclarationValue.js delete mode 100644 node_modules/stylelint/lib/utils/getDimension.js delete mode 100644 node_modules/stylelint/lib/utils/getFileIgnorer.js delete mode 100644 node_modules/stylelint/lib/utils/getFormatterOptionsText.js delete mode 100644 node_modules/stylelint/lib/utils/getImportantPosition.js delete mode 100644 node_modules/stylelint/lib/utils/getModulePath.js delete mode 100644 node_modules/stylelint/lib/utils/getNextNonSharedLineCommentNode.js delete mode 100644 node_modules/stylelint/lib/utils/getOsEol.js delete mode 100644 node_modules/stylelint/lib/utils/getPreviousNonSharedLineCommentNode.js delete mode 100644 node_modules/stylelint/lib/utils/getRuleSelector.js delete mode 100644 node_modules/stylelint/lib/utils/getSchemeFromUrl.js delete mode 100644 node_modules/stylelint/lib/utils/getStylelintRule.js delete mode 100644 node_modules/stylelint/lib/utils/hasANPlusBNotationPseudoClasses.js delete mode 100644 node_modules/stylelint/lib/utils/hasBlock.js delete mode 100644 node_modules/stylelint/lib/utils/hasColorFunction.js delete mode 100644 node_modules/stylelint/lib/utils/hasDimension.js delete mode 100644 node_modules/stylelint/lib/utils/hasEmptyBlock.js delete mode 100644 node_modules/stylelint/lib/utils/hasEmptyLine.js delete mode 100644 node_modules/stylelint/lib/utils/hasInterpolation.js delete mode 100644 node_modules/stylelint/lib/utils/hasLessInterpolation.js delete mode 100644 node_modules/stylelint/lib/utils/hasNamedColor.js delete mode 100644 node_modules/stylelint/lib/utils/hasPrefix.js delete mode 100644 node_modules/stylelint/lib/utils/hasPsvInterpolation.js delete mode 100644 node_modules/stylelint/lib/utils/hasScssInterpolation.js delete mode 100644 node_modules/stylelint/lib/utils/hasTplInterpolation.js delete mode 100644 node_modules/stylelint/lib/utils/hasValidHex.js delete mode 100644 node_modules/stylelint/lib/utils/hash.js delete mode 100644 node_modules/stylelint/lib/utils/isAfterComment.js delete mode 100644 node_modules/stylelint/lib/utils/isAfterSingleLineComment.js delete mode 100644 node_modules/stylelint/lib/utils/isAfterStandardPropertyDeclaration.js delete mode 100644 node_modules/stylelint/lib/utils/isAutoprefixable.js delete mode 100644 node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterBlocklessAtRule.js delete mode 100644 node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterSameNameBlocklessAtRule.js delete mode 100644 node_modules/stylelint/lib/utils/isContextFunctionalPseudoClass.js delete mode 100644 node_modules/stylelint/lib/utils/isCounterIncrementCustomIdentValue.js delete mode 100644 node_modules/stylelint/lib/utils/isCounterResetCustomIdentValue.js delete mode 100644 node_modules/stylelint/lib/utils/isCustomElement.js delete mode 100644 node_modules/stylelint/lib/utils/isCustomFunction.js delete mode 100644 node_modules/stylelint/lib/utils/isCustomMediaQuery.js delete mode 100644 node_modules/stylelint/lib/utils/isCustomProperty.js delete mode 100644 node_modules/stylelint/lib/utils/isCustomSelector.js delete mode 100644 node_modules/stylelint/lib/utils/isFirstNested.js delete mode 100644 node_modules/stylelint/lib/utils/isFirstNodeOfRoot.js delete mode 100644 node_modules/stylelint/lib/utils/isKeyframeRule.js delete mode 100644 node_modules/stylelint/lib/utils/isKeyframeSelector.js delete mode 100644 node_modules/stylelint/lib/utils/isMathFunction.js delete mode 100644 node_modules/stylelint/lib/utils/isNonNegativeInteger.js delete mode 100644 node_modules/stylelint/lib/utils/isNumbery.js delete mode 100644 node_modules/stylelint/lib/utils/isOnlyWhitespace.js delete mode 100644 node_modules/stylelint/lib/utils/isPathNotFoundError.js delete mode 100644 node_modules/stylelint/lib/utils/isScssVariable.js delete mode 100644 node_modules/stylelint/lib/utils/isSharedLineComment.js delete mode 100644 node_modules/stylelint/lib/utils/isSingleLineString.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxAtRule.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxColorFunction.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxCombinator.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxComment.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxDeclaration.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxFunction.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxHexColor.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxKeyframesName.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxMathFunction.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeature.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeatureName.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxProperty.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxRule.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxSelector.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxTypeSelector.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxUrl.js delete mode 100644 node_modules/stylelint/lib/utils/isStandardSyntaxValue.js delete mode 100644 node_modules/stylelint/lib/utils/isUnicodeRangeDescriptor.js delete mode 100644 node_modules/stylelint/lib/utils/isValidFontSize.js delete mode 100644 node_modules/stylelint/lib/utils/isValidHex.js delete mode 100644 node_modules/stylelint/lib/utils/isValidIdentifier.js delete mode 100644 node_modules/stylelint/lib/utils/isVariable.js delete mode 100644 node_modules/stylelint/lib/utils/isWhitespace.js delete mode 100644 node_modules/stylelint/lib/utils/matchesStringOrRegExp.js delete mode 100644 node_modules/stylelint/lib/utils/nextNonCommentNode.js delete mode 100644 node_modules/stylelint/lib/utils/noFilesFoundError.js delete mode 100644 node_modules/stylelint/lib/utils/nodeContextLookup.js delete mode 100644 node_modules/stylelint/lib/utils/optionsMatches.js delete mode 100644 node_modules/stylelint/lib/utils/parseMediaQuery.js delete mode 100644 node_modules/stylelint/lib/utils/parseSelector.js delete mode 100644 node_modules/stylelint/lib/utils/pluralize.js delete mode 100644 node_modules/stylelint/lib/utils/putIfAbsent.js delete mode 100644 node_modules/stylelint/lib/utils/rawNodeString.js delete mode 100644 node_modules/stylelint/lib/utils/removeEmptyLinesAfter.js delete mode 100644 node_modules/stylelint/lib/utils/removeEmptyLinesBefore.js delete mode 100644 node_modules/stylelint/lib/utils/report.js delete mode 100644 node_modules/stylelint/lib/utils/ruleMessages.js delete mode 100644 node_modules/stylelint/lib/utils/setAtRuleParams.js delete mode 100644 node_modules/stylelint/lib/utils/setDeclarationValue.js delete mode 100644 node_modules/stylelint/lib/utils/transformSelector.js delete mode 100644 node_modules/stylelint/lib/utils/typeGuards.js delete mode 100644 node_modules/stylelint/lib/utils/uniteSets.js delete mode 100644 node_modules/stylelint/lib/utils/validateObjectWithArrayProps.js delete mode 100644 node_modules/stylelint/lib/utils/validateObjectWithProps.js delete mode 100644 node_modules/stylelint/lib/utils/validateOptions.js delete mode 100644 node_modules/stylelint/lib/utils/validateTypes.js delete mode 100644 node_modules/stylelint/lib/utils/vendor.js delete mode 100644 node_modules/stylelint/lib/utils/whitespaceChecker.js delete mode 100644 node_modules/stylelint/lib/validateDisableSettings.js delete mode 100644 node_modules/stylelint/lib/writeOutputFile.js delete mode 100644 node_modules/stylelint/package.json delete mode 100644 node_modules/stylelint/types/stylelint/index.d.ts delete mode 100644 node_modules/supports-color/browser.js delete mode 100644 node_modules/supports-color/index.js delete mode 100644 node_modules/supports-color/license delete mode 100644 node_modules/supports-color/package.json delete mode 100644 node_modules/supports-color/readme.md delete mode 100644 node_modules/supports-hyperlinks/browser.js delete mode 100644 node_modules/supports-hyperlinks/index.d.ts delete mode 100644 node_modules/supports-hyperlinks/index.js delete mode 100644 node_modules/supports-hyperlinks/license delete mode 100644 node_modules/supports-hyperlinks/node_modules/has-flag/index.d.ts delete mode 100644 node_modules/supports-hyperlinks/node_modules/has-flag/index.js delete mode 100644 node_modules/supports-hyperlinks/node_modules/has-flag/license delete mode 100644 node_modules/supports-hyperlinks/node_modules/has-flag/package.json delete mode 100644 node_modules/supports-hyperlinks/node_modules/has-flag/readme.md delete mode 100644 node_modules/supports-hyperlinks/node_modules/supports-color/browser.js delete mode 100644 node_modules/supports-hyperlinks/node_modules/supports-color/index.js delete mode 100644 node_modules/supports-hyperlinks/node_modules/supports-color/license delete mode 100644 node_modules/supports-hyperlinks/node_modules/supports-color/package.json delete mode 100644 node_modules/supports-hyperlinks/node_modules/supports-color/readme.md delete mode 100644 node_modules/supports-hyperlinks/package.json delete mode 100644 node_modules/supports-hyperlinks/readme.md delete mode 100644 node_modules/svg-tags/LICENSE delete mode 100644 node_modules/svg-tags/README.md delete mode 100644 node_modules/svg-tags/lib/index.js delete mode 100644 node_modules/svg-tags/lib/svg-tags.json delete mode 100644 node_modules/svg-tags/package.json delete mode 100644 node_modules/table/LICENSE delete mode 100644 node_modules/table/README.md delete mode 100644 node_modules/table/dist/src/alignSpanningCell.d.ts delete mode 100644 node_modules/table/dist/src/alignSpanningCell.js delete mode 100644 node_modules/table/dist/src/alignSpanningCell.js.map delete mode 100644 node_modules/table/dist/src/alignString.d.ts delete mode 100644 node_modules/table/dist/src/alignString.js delete mode 100644 node_modules/table/dist/src/alignString.js.map delete mode 100644 node_modules/table/dist/src/alignTableData.d.ts delete mode 100644 node_modules/table/dist/src/alignTableData.js delete mode 100644 node_modules/table/dist/src/alignTableData.js.map delete mode 100644 node_modules/table/dist/src/calculateCellHeight.d.ts delete mode 100644 node_modules/table/dist/src/calculateCellHeight.js delete mode 100644 node_modules/table/dist/src/calculateCellHeight.js.map delete mode 100644 node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts delete mode 100644 node_modules/table/dist/src/calculateMaximumColumnWidths.js delete mode 100644 node_modules/table/dist/src/calculateMaximumColumnWidths.js.map delete mode 100644 node_modules/table/dist/src/calculateOutputColumnWidths.d.ts delete mode 100644 node_modules/table/dist/src/calculateOutputColumnWidths.js delete mode 100644 node_modules/table/dist/src/calculateOutputColumnWidths.js.map delete mode 100644 node_modules/table/dist/src/calculateRowHeights.d.ts delete mode 100644 node_modules/table/dist/src/calculateRowHeights.js delete mode 100644 node_modules/table/dist/src/calculateRowHeights.js.map delete mode 100644 node_modules/table/dist/src/calculateSpanningCellWidth.d.ts delete mode 100644 node_modules/table/dist/src/calculateSpanningCellWidth.js delete mode 100644 node_modules/table/dist/src/calculateSpanningCellWidth.js.map delete mode 100644 node_modules/table/dist/src/createStream.d.ts delete mode 100644 node_modules/table/dist/src/createStream.js delete mode 100644 node_modules/table/dist/src/createStream.js.map delete mode 100644 node_modules/table/dist/src/drawBorder.d.ts delete mode 100644 node_modules/table/dist/src/drawBorder.js delete mode 100644 node_modules/table/dist/src/drawBorder.js.map delete mode 100644 node_modules/table/dist/src/drawContent.d.ts delete mode 100644 node_modules/table/dist/src/drawContent.js delete mode 100644 node_modules/table/dist/src/drawContent.js.map delete mode 100644 node_modules/table/dist/src/drawRow.d.ts delete mode 100644 node_modules/table/dist/src/drawRow.js delete mode 100644 node_modules/table/dist/src/drawRow.js.map delete mode 100644 node_modules/table/dist/src/drawTable.d.ts delete mode 100644 node_modules/table/dist/src/drawTable.js delete mode 100644 node_modules/table/dist/src/drawTable.js.map delete mode 100644 node_modules/table/dist/src/generated/validators.d.ts delete mode 100644 node_modules/table/dist/src/generated/validators.js delete mode 100644 node_modules/table/dist/src/generated/validators.js.map delete mode 100644 node_modules/table/dist/src/getBorderCharacters.d.ts delete mode 100644 node_modules/table/dist/src/getBorderCharacters.js delete mode 100644 node_modules/table/dist/src/getBorderCharacters.js.map delete mode 100644 node_modules/table/dist/src/index.d.ts delete mode 100644 node_modules/table/dist/src/index.js delete mode 100644 node_modules/table/dist/src/index.js.map delete mode 100644 node_modules/table/dist/src/injectHeaderConfig.d.ts delete mode 100644 node_modules/table/dist/src/injectHeaderConfig.js delete mode 100644 node_modules/table/dist/src/injectHeaderConfig.js.map delete mode 100644 node_modules/table/dist/src/makeRangeConfig.d.ts delete mode 100644 node_modules/table/dist/src/makeRangeConfig.js delete mode 100644 node_modules/table/dist/src/makeRangeConfig.js.map delete mode 100644 node_modules/table/dist/src/makeStreamConfig.d.ts delete mode 100644 node_modules/table/dist/src/makeStreamConfig.js delete mode 100644 node_modules/table/dist/src/makeStreamConfig.js.map delete mode 100644 node_modules/table/dist/src/makeTableConfig.d.ts delete mode 100644 node_modules/table/dist/src/makeTableConfig.js delete mode 100644 node_modules/table/dist/src/makeTableConfig.js.map delete mode 100644 node_modules/table/dist/src/mapDataUsingRowHeights.d.ts delete mode 100644 node_modules/table/dist/src/mapDataUsingRowHeights.js delete mode 100644 node_modules/table/dist/src/mapDataUsingRowHeights.js.map delete mode 100644 node_modules/table/dist/src/padTableData.d.ts delete mode 100644 node_modules/table/dist/src/padTableData.js delete mode 100644 node_modules/table/dist/src/padTableData.js.map delete mode 100644 node_modules/table/dist/src/schemas/config.json delete mode 100644 node_modules/table/dist/src/schemas/shared.json delete mode 100644 node_modules/table/dist/src/schemas/streamConfig.json delete mode 100644 node_modules/table/dist/src/spanningCellManager.d.ts delete mode 100644 node_modules/table/dist/src/spanningCellManager.js delete mode 100644 node_modules/table/dist/src/spanningCellManager.js.map delete mode 100644 node_modules/table/dist/src/stringifyTableData.d.ts delete mode 100644 node_modules/table/dist/src/stringifyTableData.js delete mode 100644 node_modules/table/dist/src/stringifyTableData.js.map delete mode 100644 node_modules/table/dist/src/table.d.ts delete mode 100644 node_modules/table/dist/src/table.js delete mode 100644 node_modules/table/dist/src/table.js.map delete mode 100644 node_modules/table/dist/src/truncateTableData.d.ts delete mode 100644 node_modules/table/dist/src/truncateTableData.js delete mode 100644 node_modules/table/dist/src/truncateTableData.js.map delete mode 100644 node_modules/table/dist/src/types/api.d.ts delete mode 100644 node_modules/table/dist/src/types/api.js delete mode 100644 node_modules/table/dist/src/types/api.js.map delete mode 100644 node_modules/table/dist/src/types/internal.d.ts delete mode 100644 node_modules/table/dist/src/types/internal.js delete mode 100644 node_modules/table/dist/src/types/internal.js.map delete mode 100644 node_modules/table/dist/src/utils.d.ts delete mode 100644 node_modules/table/dist/src/utils.js delete mode 100644 node_modules/table/dist/src/utils.js.map delete mode 100644 node_modules/table/dist/src/validateConfig.d.ts delete mode 100644 node_modules/table/dist/src/validateConfig.js delete mode 100644 node_modules/table/dist/src/validateConfig.js.map delete mode 100644 node_modules/table/dist/src/validateSpanningCellConfig.d.ts delete mode 100644 node_modules/table/dist/src/validateSpanningCellConfig.js delete mode 100644 node_modules/table/dist/src/validateSpanningCellConfig.js.map delete mode 100644 node_modules/table/dist/src/validateTableData.d.ts delete mode 100644 node_modules/table/dist/src/validateTableData.js delete mode 100644 node_modules/table/dist/src/validateTableData.js.map delete mode 100644 node_modules/table/dist/src/wrapCell.d.ts delete mode 100644 node_modules/table/dist/src/wrapCell.js delete mode 100644 node_modules/table/dist/src/wrapCell.js.map delete mode 100644 node_modules/table/dist/src/wrapString.d.ts delete mode 100644 node_modules/table/dist/src/wrapString.js delete mode 100644 node_modules/table/dist/src/wrapString.js.map delete mode 100644 node_modules/table/dist/src/wrapWord.d.ts delete mode 100644 node_modules/table/dist/src/wrapWord.js delete mode 100644 node_modules/table/dist/src/wrapWord.js.map delete mode 100644 node_modules/table/package.json delete mode 100644 node_modules/to-regex-range/LICENSE delete mode 100644 node_modules/to-regex-range/README.md delete mode 100644 node_modules/to-regex-range/index.js delete mode 100644 node_modules/to-regex-range/package.json delete mode 100644 node_modules/trim-newlines/index.d.ts delete mode 100644 node_modules/trim-newlines/index.js delete mode 100644 node_modules/trim-newlines/license delete mode 100644 node_modules/trim-newlines/package.json delete mode 100644 node_modules/trim-newlines/readme.md delete mode 100644 node_modules/type-fest/base.d.ts delete mode 100644 node_modules/type-fest/index.d.ts delete mode 100644 node_modules/type-fest/license delete mode 100644 node_modules/type-fest/package.json delete mode 100644 node_modules/type-fest/readme.md delete mode 100644 node_modules/type-fest/source/async-return-type.d.ts delete mode 100644 node_modules/type-fest/source/asyncify.d.ts delete mode 100644 node_modules/type-fest/source/basic.d.ts delete mode 100644 node_modules/type-fest/source/conditional-except.d.ts delete mode 100644 node_modules/type-fest/source/conditional-keys.d.ts delete mode 100644 node_modules/type-fest/source/conditional-pick.d.ts delete mode 100644 node_modules/type-fest/source/entries.d.ts delete mode 100644 node_modules/type-fest/source/entry.d.ts delete mode 100644 node_modules/type-fest/source/except.d.ts delete mode 100644 node_modules/type-fest/source/fixed-length-array.d.ts delete mode 100644 node_modules/type-fest/source/iterable-element.d.ts delete mode 100644 node_modules/type-fest/source/literal-union.d.ts delete mode 100644 node_modules/type-fest/source/merge-exclusive.d.ts delete mode 100644 node_modules/type-fest/source/merge.d.ts delete mode 100644 node_modules/type-fest/source/mutable.d.ts delete mode 100644 node_modules/type-fest/source/observable-like.d.ts delete mode 100644 node_modules/type-fest/source/opaque.d.ts delete mode 100644 node_modules/type-fest/source/package-json.d.ts delete mode 100644 node_modules/type-fest/source/partial-deep.d.ts delete mode 100644 node_modules/type-fest/source/primitive.d.ts delete mode 100644 node_modules/type-fest/source/promisable.d.ts delete mode 100644 node_modules/type-fest/source/promise-value.d.ts delete mode 100644 node_modules/type-fest/source/readonly-deep.d.ts delete mode 100644 node_modules/type-fest/source/require-at-least-one.d.ts delete mode 100644 node_modules/type-fest/source/require-exactly-one.d.ts delete mode 100644 node_modules/type-fest/source/set-optional.d.ts delete mode 100644 node_modules/type-fest/source/set-required.d.ts delete mode 100644 node_modules/type-fest/source/set-return-type.d.ts delete mode 100644 node_modules/type-fest/source/simplify.d.ts delete mode 100644 node_modules/type-fest/source/stringified.d.ts delete mode 100644 node_modules/type-fest/source/tsconfig-json.d.ts delete mode 100644 node_modules/type-fest/source/typed-array.d.ts delete mode 100644 node_modules/type-fest/source/union-to-intersection.d.ts delete mode 100644 node_modules/type-fest/source/utilities.d.ts delete mode 100644 node_modules/type-fest/source/value-of.d.ts delete mode 100644 node_modules/type-fest/ts41/camel-case.d.ts delete mode 100644 node_modules/type-fest/ts41/camel-cased-properties-deep.d.ts delete mode 100644 node_modules/type-fest/ts41/camel-cased-properties.d.ts delete mode 100644 node_modules/type-fest/ts41/delimiter-case.d.ts delete mode 100644 node_modules/type-fest/ts41/delimiter-cased-properties-deep.d.ts delete mode 100644 node_modules/type-fest/ts41/delimiter-cased-properties.d.ts delete mode 100644 node_modules/type-fest/ts41/get.d.ts delete mode 100644 node_modules/type-fest/ts41/includes.d.ts delete mode 100644 node_modules/type-fest/ts41/index.d.ts delete mode 100644 node_modules/type-fest/ts41/kebab-case.d.ts delete mode 100644 node_modules/type-fest/ts41/kebab-cased-properties-deep.d.ts delete mode 100644 node_modules/type-fest/ts41/kebab-cased-properties.d.ts delete mode 100644 node_modules/type-fest/ts41/last-array-element.d.ts delete mode 100644 node_modules/type-fest/ts41/pascal-case.d.ts delete mode 100644 node_modules/type-fest/ts41/pascal-cased-properties-deep.d.ts delete mode 100644 node_modules/type-fest/ts41/pascal-cased-properties.d.ts delete mode 100644 node_modules/type-fest/ts41/screaming-snake-case.d.ts delete mode 100644 node_modules/type-fest/ts41/snake-case.d.ts delete mode 100644 node_modules/type-fest/ts41/snake-cased-properties-deep.d.ts delete mode 100644 node_modules/type-fest/ts41/snake-cased-properties.d.ts delete mode 100644 node_modules/type-fest/ts41/split.d.ts delete mode 100644 node_modules/type-fest/ts41/trim.d.ts delete mode 100644 node_modules/type-fest/ts41/utilities.d.ts delete mode 100755 node_modules/uri-js/LICENSE delete mode 100755 node_modules/uri-js/README.md delete mode 100755 node_modules/uri-js/dist/es5/uri.all.d.ts delete mode 100755 node_modules/uri-js/dist/es5/uri.all.js delete mode 100755 node_modules/uri-js/dist/es5/uri.all.js.map delete mode 100755 node_modules/uri-js/dist/es5/uri.all.min.d.ts delete mode 100755 node_modules/uri-js/dist/es5/uri.all.min.js delete mode 100755 node_modules/uri-js/dist/es5/uri.all.min.js.map delete mode 100755 node_modules/uri-js/dist/esnext/index.d.ts delete mode 100755 node_modules/uri-js/dist/esnext/index.js delete mode 100755 node_modules/uri-js/dist/esnext/index.js.map delete mode 100755 node_modules/uri-js/dist/esnext/regexps-iri.d.ts delete mode 100755 node_modules/uri-js/dist/esnext/regexps-iri.js delete mode 100755 node_modules/uri-js/dist/esnext/regexps-iri.js.map delete mode 100755 node_modules/uri-js/dist/esnext/regexps-uri.d.ts delete mode 100755 node_modules/uri-js/dist/esnext/regexps-uri.js delete mode 100755 node_modules/uri-js/dist/esnext/regexps-uri.js.map delete mode 100755 node_modules/uri-js/dist/esnext/schemes/http.d.ts delete mode 100755 node_modules/uri-js/dist/esnext/schemes/http.js delete mode 100755 node_modules/uri-js/dist/esnext/schemes/http.js.map delete mode 100755 node_modules/uri-js/dist/esnext/schemes/https.d.ts delete mode 100755 node_modules/uri-js/dist/esnext/schemes/https.js delete mode 100755 node_modules/uri-js/dist/esnext/schemes/https.js.map delete mode 100755 node_modules/uri-js/dist/esnext/schemes/mailto.d.ts delete mode 100755 node_modules/uri-js/dist/esnext/schemes/mailto.js delete mode 100755 node_modules/uri-js/dist/esnext/schemes/mailto.js.map delete mode 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts delete mode 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js delete mode 100755 node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map delete mode 100755 node_modules/uri-js/dist/esnext/schemes/urn.d.ts delete mode 100755 node_modules/uri-js/dist/esnext/schemes/urn.js delete mode 100755 node_modules/uri-js/dist/esnext/schemes/urn.js.map delete mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.d.ts delete mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.js delete mode 100755 node_modules/uri-js/dist/esnext/schemes/ws.js.map delete mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.d.ts delete mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.js delete mode 100755 node_modules/uri-js/dist/esnext/schemes/wss.js.map delete mode 100755 node_modules/uri-js/dist/esnext/uri.d.ts delete mode 100755 node_modules/uri-js/dist/esnext/uri.js delete mode 100755 node_modules/uri-js/dist/esnext/uri.js.map delete mode 100755 node_modules/uri-js/dist/esnext/util.d.ts delete mode 100755 node_modules/uri-js/dist/esnext/util.js delete mode 100755 node_modules/uri-js/dist/esnext/util.js.map delete mode 100755 node_modules/uri-js/package.json delete mode 100755 node_modules/uri-js/yarn.lock delete mode 100644 node_modules/util-deprecate/History.md delete mode 100644 node_modules/util-deprecate/LICENSE delete mode 100644 node_modules/util-deprecate/README.md delete mode 100644 node_modules/util-deprecate/browser.js delete mode 100644 node_modules/util-deprecate/node.js delete mode 100644 node_modules/util-deprecate/package.json delete mode 100644 node_modules/validate-npm-package-license/LICENSE delete mode 100644 node_modules/validate-npm-package-license/README.md delete mode 100644 node_modules/validate-npm-package-license/index.js delete mode 100644 node_modules/validate-npm-package-license/package.json delete mode 100644 node_modules/which/CHANGELOG.md delete mode 100644 node_modules/which/LICENSE delete mode 100644 node_modules/which/README.md delete mode 100755 node_modules/which/bin/which delete mode 100644 node_modules/which/package.json delete mode 100644 node_modules/which/which.js delete mode 100644 node_modules/wrappy/LICENSE delete mode 100644 node_modules/wrappy/README.md delete mode 100644 node_modules/wrappy/package.json delete mode 100644 node_modules/wrappy/wrappy.js delete mode 100644 node_modules/write-file-atomic/LICENSE.md delete mode 100644 node_modules/write-file-atomic/README.md delete mode 100644 node_modules/write-file-atomic/lib/index.js delete mode 100644 node_modules/write-file-atomic/package.json delete mode 100644 node_modules/yallist/LICENSE delete mode 100644 node_modules/yallist/README.md delete mode 100644 node_modules/yallist/iterator.js delete mode 100644 node_modules/yallist/package.json delete mode 100644 node_modules/yallist/yallist.js delete mode 100644 node_modules/yargs-parser/CHANGELOG.md delete mode 100644 node_modules/yargs-parser/LICENSE.txt delete mode 100644 node_modules/yargs-parser/README.md delete mode 100644 node_modules/yargs-parser/browser.js delete mode 100644 node_modules/yargs-parser/build/index.cjs delete mode 100644 node_modules/yargs-parser/build/lib/index.js delete mode 100644 node_modules/yargs-parser/build/lib/string-utils.js delete mode 100644 node_modules/yargs-parser/build/lib/tokenize-arg-string.js delete mode 100644 node_modules/yargs-parser/build/lib/yargs-parser-types.js delete mode 100644 node_modules/yargs-parser/build/lib/yargs-parser.js delete mode 100644 node_modules/yargs-parser/package.json delete mode 100644 node_modules/yocto-queue/index.d.ts delete mode 100644 node_modules/yocto-queue/index.js delete mode 100644 node_modules/yocto-queue/license delete mode 100644 node_modules/yocto-queue/package.json delete mode 100644 node_modules/yocto-queue/readme.md diff --git a/node_modules/.bin/cssesc b/node_modules/.bin/cssesc deleted file mode 120000 index 487b68908..000000000 --- a/node_modules/.bin/cssesc +++ /dev/null @@ -1 +0,0 @@ -../cssesc/bin/cssesc \ No newline at end of file diff --git a/node_modules/.bin/js-yaml b/node_modules/.bin/js-yaml deleted file mode 120000 index 9dbd010d4..000000000 --- a/node_modules/.bin/js-yaml +++ /dev/null @@ -1 +0,0 @@ -../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/node_modules/.bin/nanoid b/node_modules/.bin/nanoid deleted file mode 120000 index e2be547bc..000000000 --- a/node_modules/.bin/nanoid +++ /dev/null @@ -1 +0,0 @@ -../nanoid/bin/nanoid.cjs \ No newline at end of file diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a49d..000000000 --- a/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver deleted file mode 120000 index 5aaadf42c..000000000 --- a/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver.js \ No newline at end of file diff --git a/node_modules/.bin/stylelint b/node_modules/.bin/stylelint deleted file mode 120000 index df47b6f4e..000000000 --- a/node_modules/.bin/stylelint +++ /dev/null @@ -1 +0,0 @@ -../stylelint/bin/stylelint.mjs \ No newline at end of file diff --git a/node_modules/.bin/which b/node_modules/.bin/which deleted file mode 120000 index f62471c85..000000000 --- a/node_modules/.bin/which +++ /dev/null @@ -1 +0,0 @@ -../which/bin/which \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json deleted file mode 100644 index 2e8333dc6..000000000 --- a/node_modules/.package-lock.json +++ /dev/null @@ -1,2063 +0,0 @@ -{ - "name": "bioconductor.org", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/@babel/code-frame": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@csstools/css-parser-algorithms": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.3.0.tgz", - "integrity": "sha512-dTKSIHHWc0zPvcS5cqGP+/TPFUJB0ekJ9dGKvMAFoNuBFhDPBt9OMGNZiIA5vTiNdGHHBeScYPXIGBMnVOahsA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": "^14 || ^16 || >=18" - }, - "peerDependencies": { - "@csstools/css-tokenizer": "^2.1.1" - } - }, - "node_modules/@csstools/css-tokenizer": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.1.1.tgz", - "integrity": "sha512-GbrTj2Z8MCTUv+52GE0RbFGM527xuXZ0Xa5g0Z+YN573uveS4G0qi6WNOMyz3yrFM/jaILTTwJ0+umx81EzqfA==", - "dev": true, - "engines": { - "node": "^14 || ^16 || >=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - }, - "node_modules/@csstools/media-query-list-parser": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.2.tgz", - "integrity": "sha512-M8cFGGwl866o6++vIY7j1AKuq9v57cf+dGepScwCcbut9ypJNr4Cj+LLTWligYUZ0uyhEoJDKt5lvyBfh2L3ZQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": "^14 || ^16 || >=18" - }, - "peerDependencies": { - "@csstools/css-parser-algorithms": "^2.3.0", - "@csstools/css-tokenizer": "^2.1.1" - } - }, - "node_modules/@csstools/selector-specificity": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.0.0.tgz", - "integrity": "sha512-hBI9tfBtuPIi885ZsZ32IMEU/5nlZH/KOVYJCOh7gyMxaVLGmLedYqFN6Ui1LXkI8JlC8IsuC0rF0btcRZKd5g==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": "^14 || ^16 || >=18" - }, - "peerDependencies": { - "postcss-selector-parser": "^6.0.13" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@types/minimist": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", - "dev": true - }, - "node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", - "dev": true - }, - "node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/balanced-match": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-2.0.0.tgz", - "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/brace-expansion/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/camelcase-keys": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-7.0.2.tgz", - "integrity": "sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==", - "dev": true, - "dependencies": { - "camelcase": "^6.3.0", - "map-obj": "^4.1.0", - "quick-lru": "^5.1.1", - "type-fest": "^1.2.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/colord": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", - "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/cosmiconfig": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", - "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", - "dev": true, - "dependencies": { - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - } - }, - "node_modules/css-functions-list": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.0.tgz", - "integrity": "sha512-d/jBMPyYybkkLVypgtGv12R+pIFw4/f/IHtCTxWpZc8ofTYOPigIgmA6vu5rMHartZC+WuXhBUHfnyNUIQSYrg==", - "dev": true, - "engines": { - "node": ">=12.22" - } - }, - "node_modules/css-tree": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", - "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", - "dev": true, - "dependencies": { - "mdn-data": "2.0.30", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" - } - }, - "node_modules/cssesc": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", - "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "dev": true, - "bin": { - "cssesc": "bin/cssesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decamelize": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", - "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decamelize-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", - "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", - "dev": true, - "dependencies": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decamelize-keys/node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decamelize-keys/node_modules/map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", - "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fastest-levenshtein": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", - "dev": true, - "engines": { - "node": ">= 4.9.1" - } - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", - "dev": true, - "dependencies": { - "global-prefix": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "dev": true, - "dependencies": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globjoin": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/globjoin/-/globjoin-0.1.4.tgz", - "integrity": "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==", - "dev": true - }, - "node_modules/hard-rejection": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", - "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/hosted-git-info": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", - "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/html-tags": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz", - "integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-fresh/node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/import-lazy": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", - "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "node_modules/is-core-module": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", - "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/known-css-properties": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.27.0.tgz", - "integrity": "sha512-uMCj6+hZYDoffuvAJjFAPz56E9uoowFHmTkqRtRq5WyC5Q6Cu/fTZKNQpX/RbzChBYLLl3lo8CjFZBAZXq9qFg==", - "dev": true - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/map-obj": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", - "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mathml-tag-names": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", - "integrity": "sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/mdn-data": { - "version": "2.0.30", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", - "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", - "dev": true - }, - "node_modules/meow": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.5.tgz", - "integrity": "sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==", - "dev": true, - "dependencies": { - "@types/minimist": "^1.2.2", - "camelcase-keys": "^7.0.0", - "decamelize": "^5.0.0", - "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.1.0", - "minimist-options": "4.1.0", - "normalize-package-data": "^3.0.2", - "read-pkg-up": "^8.0.0", - "redent": "^4.0.0", - "trim-newlines": "^4.0.2", - "type-fest": "^1.2.2", - "yargs-parser": "^20.2.9" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/min-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist-options": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "dev": true, - "dependencies": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0", - "kind-of": "^6.0.3" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/normalize-package-data": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", - "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/postcss": { - "version": "8.4.25", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.25.tgz", - "integrity": "sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.6", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-media-query-parser": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", - "integrity": "sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==", - "dev": true - }, - "node_modules/postcss-resolve-nested-selector": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", - "integrity": "sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw==", - "dev": true - }, - "node_modules/postcss-safe-parser": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz", - "integrity": "sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==", - "dev": true, - "engines": { - "node": ">=12.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - "peerDependencies": { - "postcss": "^8.3.3" - } - }, - "node_modules/postcss-scss": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.6.tgz", - "integrity": "sha512-rLDPhJY4z/i4nVFZ27j9GqLxj1pwxE80eAzUNRMXtcpipFYIeowerzBgG3yJhMtObGEXidtIgbUpQ3eLDsf5OQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss-scss" - } - ], - "engines": { - "node": ">=12.0" - }, - "peerDependencies": { - "postcss": "^8.4.19" - } - }, - "node_modules/postcss-selector-parser": { - "version": "6.0.13", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", - "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", - "dev": true, - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "dev": true - }, - "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-6.0.0.tgz", - "integrity": "sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==", - "dev": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^3.0.2", - "parse-json": "^5.2.0", - "type-fest": "^1.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-8.0.0.tgz", - "integrity": "sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==", - "dev": true, - "dependencies": { - "find-up": "^5.0.0", - "read-pkg": "^6.0.0", - "type-fest": "^1.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/redent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", - "integrity": "sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==", - "dev": true, - "dependencies": { - "indent-string": "^5.0.0", - "strip-indent": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/signal-exit": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", - "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/spdx-correct": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", - "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", - "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", - "dev": true - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", - "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", - "dev": true, - "dependencies": { - "min-indent": "^1.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/style-search": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", - "integrity": "sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==", - "dev": true - }, - "node_modules/stylelint": { - "version": "15.10.1", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.10.1.tgz", - "integrity": "sha512-CYkzYrCFfA/gnOR+u9kJ1PpzwG10WLVnoxHDuBA/JiwGqdM9+yx9+ou6SE/y9YHtfv1mcLo06fdadHTOx4gBZQ==", - "dev": true, - "dependencies": { - "@csstools/css-parser-algorithms": "^2.3.0", - "@csstools/css-tokenizer": "^2.1.1", - "@csstools/media-query-list-parser": "^2.1.2", - "@csstools/selector-specificity": "^3.0.0", - "balanced-match": "^2.0.0", - "colord": "^2.9.3", - "cosmiconfig": "^8.2.0", - "css-functions-list": "^3.1.0", - "css-tree": "^2.3.1", - "debug": "^4.3.4", - "fast-glob": "^3.3.0", - "fastest-levenshtein": "^1.0.16", - "file-entry-cache": "^6.0.1", - "global-modules": "^2.0.0", - "globby": "^11.1.0", - "globjoin": "^0.1.4", - "html-tags": "^3.3.1", - "ignore": "^5.2.4", - "import-lazy": "^4.0.0", - "imurmurhash": "^0.1.4", - "is-plain-object": "^5.0.0", - "known-css-properties": "^0.27.0", - "mathml-tag-names": "^2.1.3", - "meow": "^10.1.5", - "micromatch": "^4.0.5", - "normalize-path": "^3.0.0", - "picocolors": "^1.0.0", - "postcss": "^8.4.24", - "postcss-resolve-nested-selector": "^0.1.1", - "postcss-safe-parser": "^6.0.0", - "postcss-selector-parser": "^6.0.13", - "postcss-value-parser": "^4.2.0", - "resolve-from": "^5.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "style-search": "^0.1.0", - "supports-hyperlinks": "^3.0.0", - "svg-tags": "^1.0.0", - "table": "^6.8.1", - "write-file-atomic": "^5.0.1" - }, - "bin": { - "stylelint": "bin/stylelint.mjs" - }, - "engines": { - "node": "^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/stylelint" - } - }, - "node_modules/stylelint-config-recommended": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-13.0.0.tgz", - "integrity": "sha512-EH+yRj6h3GAe/fRiyaoO2F9l9Tgg50AOFhaszyfov9v6ayXJ1IkSHwTxd7lB48FmOeSGDPLjatjO11fJpmarkQ==", - "dev": true, - "engines": { - "node": "^14.13.1 || >=16.0.0" - }, - "peerDependencies": { - "stylelint": "^15.10.0" - } - }, - "node_modules/stylelint-config-recommended-scss": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-12.0.0.tgz", - "integrity": "sha512-5Bb2mlGy6WLa30oNeKpZvavv2lowJUsUJO25+OA68GFTemlwd1zbFsL7q0bReKipOSU3sG47hKneZ6Nd+ctrFA==", - "dev": true, - "dependencies": { - "postcss-scss": "^4.0.6", - "stylelint-config-recommended": "^12.0.0", - "stylelint-scss": "^5.0.0" - }, - "peerDependencies": { - "postcss": "^8.3.3", - "stylelint": "^15.5.0" - }, - "peerDependenciesMeta": { - "postcss": { - "optional": true - } - } - }, - "node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", - "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", - "dev": true, - "peerDependencies": { - "stylelint": "^15.5.0" - } - }, - "node_modules/stylelint-config-standard": { - "version": "34.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-34.0.0.tgz", - "integrity": "sha512-u0VSZnVyW9VSryBG2LSO+OQTjN7zF9XJaAJRX/4EwkmU0R2jYwmBSN10acqZisDitS0CLiEiGjX7+Hrq8TAhfQ==", - "dev": true, - "dependencies": { - "stylelint-config-recommended": "^13.0.0" - }, - "engines": { - "node": "^14.13.1 || >=16.0.0" - }, - "peerDependencies": { - "stylelint": "^15.10.0" - } - }, - "node_modules/stylelint-config-standard-scss": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-10.0.0.tgz", - "integrity": "sha512-bChBEo1p3xUVWh/wenJI+josoMk21f2yuLDGzGjmKYcALfl2u3DFltY+n4UHswYiXghqXaA8mRh+bFy/q1hQlg==", - "dev": true, - "dependencies": { - "stylelint-config-recommended-scss": "^12.0.0", - "stylelint-config-standard": "^33.0.0" - }, - "peerDependencies": { - "postcss": "^8.3.3", - "stylelint": "^15.5.0" - }, - "peerDependenciesMeta": { - "postcss": { - "optional": true - } - } - }, - "node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", - "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", - "dev": true, - "peerDependencies": { - "stylelint": "^15.5.0" - } - }, - "node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard": { - "version": "33.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-33.0.0.tgz", - "integrity": "sha512-eyxnLWoXImUn77+ODIuW9qXBDNM+ALN68L3wT1lN2oNspZ7D9NVGlNHb2QCUn4xDug6VZLsh0tF8NyoYzkgTzg==", - "dev": true, - "dependencies": { - "stylelint-config-recommended": "^12.0.0" - }, - "peerDependencies": { - "stylelint": "^15.5.0" - } - }, - "node_modules/stylelint-scss": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-5.0.1.tgz", - "integrity": "sha512-n87iCRZrr2J7//I/QFsDXxFLnHKw633U4qvWZ+mOW6KDAp/HLj06H+6+f9zOuTYy+MdGdTuCSDROCpQIhw5fvQ==", - "dev": true, - "dependencies": { - "postcss-media-query-parser": "^0.2.3", - "postcss-resolve-nested-selector": "^0.1.1", - "postcss-selector-parser": "^6.0.13", - "postcss-value-parser": "^4.2.0" - }, - "peerDependencies": { - "stylelint": "^14.5.1 || ^15.0.0" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/supports-hyperlinks": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", - "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">=14.18" - } - }, - "node_modules/supports-hyperlinks/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-hyperlinks/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/svg-tags": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz", - "integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==", - "dev": true - }, - "node_modules/table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/trim-newlines": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-4.1.1.tgz", - "integrity": "sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/write-file-atomic": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", - "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/node_modules/@babel/code-frame/LICENSE b/node_modules/@babel/code-frame/LICENSE deleted file mode 100644 index f31575ec7..000000000 --- a/node_modules/@babel/code-frame/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/code-frame/README.md b/node_modules/@babel/code-frame/README.md deleted file mode 100644 index 08cacb047..000000000 --- a/node_modules/@babel/code-frame/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/code-frame - -> Generate errors that contain a code frame that point to source locations. - -See our website [@babel/code-frame](https://babeljs.io/docs/en/babel-code-frame) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/code-frame -``` - -or using yarn: - -```sh -yarn add @babel/code-frame --dev -``` diff --git a/node_modules/@babel/code-frame/lib/index.js b/node_modules/@babel/code-frame/lib/index.js deleted file mode 100644 index cf70a04ea..000000000 --- a/node_modules/@babel/code-frame/lib/index.js +++ /dev/null @@ -1,142 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.codeFrameColumns = codeFrameColumns; -exports.default = _default; -var _highlight = require("@babel/highlight"); -let deprecationWarningShown = false; -function getDefs(chalk) { - return { - gutter: chalk.grey, - marker: chalk.red.bold, - message: chalk.red.bold - }; -} -const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; -function getMarkerLines(loc, source, opts) { - const startLoc = Object.assign({ - column: 0, - line: -1 - }, loc.start); - const endLoc = Object.assign({}, startLoc, loc.end); - const { - linesAbove = 2, - linesBelow = 3 - } = opts || {}; - const startLine = startLoc.line; - const startColumn = startLoc.column; - const endLine = endLoc.line; - const endColumn = endLoc.column; - let start = Math.max(startLine - (linesAbove + 1), 0); - let end = Math.min(source.length, endLine + linesBelow); - if (startLine === -1) { - start = 0; - } - if (endLine === -1) { - end = source.length; - } - const lineDiff = endLine - startLine; - const markerLines = {}; - if (lineDiff) { - for (let i = 0; i <= lineDiff; i++) { - const lineNumber = i + startLine; - if (!startColumn) { - markerLines[lineNumber] = true; - } else if (i === 0) { - const sourceLength = source[lineNumber - 1].length; - markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; - } else if (i === lineDiff) { - markerLines[lineNumber] = [0, endColumn]; - } else { - const sourceLength = source[lineNumber - i].length; - markerLines[lineNumber] = [0, sourceLength]; - } - } - } else { - if (startColumn === endColumn) { - if (startColumn) { - markerLines[startLine] = [startColumn, 0]; - } else { - markerLines[startLine] = true; - } - } else { - markerLines[startLine] = [startColumn, endColumn - startColumn]; - } - } - return { - start, - end, - markerLines - }; -} -function codeFrameColumns(rawLines, loc, opts = {}) { - const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts); - const chalk = (0, _highlight.getChalk)(opts); - const defs = getDefs(chalk); - const maybeHighlight = (chalkFn, string) => { - return highlighted ? chalkFn(string) : string; - }; - const lines = rawLines.split(NEWLINE); - const { - start, - end, - markerLines - } = getMarkerLines(loc, lines, opts); - const hasColumns = loc.start && typeof loc.start.column === "number"; - const numberMaxWidth = String(end).length; - const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines; - let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => { - const number = start + 1 + index; - const paddedNumber = ` ${number}`.slice(-numberMaxWidth); - const gutter = ` ${paddedNumber} |`; - const hasMarker = markerLines[number]; - const lastMarkerLine = !markerLines[number + 1]; - if (hasMarker) { - let markerLine = ""; - if (Array.isArray(hasMarker)) { - const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); - const numberOfMarkers = hasMarker[1] || 1; - markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); - if (lastMarkerLine && opts.message) { - markerLine += " " + maybeHighlight(defs.message, opts.message); - } - } - return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); - } else { - return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`; - } - }).join("\n"); - if (opts.message && !hasColumns) { - frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; - } - if (highlighted) { - return chalk.reset(frame); - } else { - return frame; - } -} -function _default(rawLines, lineNumber, colNumber, opts = {}) { - if (!deprecationWarningShown) { - deprecationWarningShown = true; - const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; - if (process.emitWarning) { - process.emitWarning(message, "DeprecationWarning"); - } else { - const deprecationError = new Error(message); - deprecationError.name = "DeprecationWarning"; - console.warn(new Error(message)); - } - } - colNumber = Math.max(colNumber, 0); - const location = { - start: { - column: colNumber, - line: lineNumber - } - }; - return codeFrameColumns(rawLines, location, opts); -} - -//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/code-frame/lib/index.js.map b/node_modules/@babel/code-frame/lib/index.js.map deleted file mode 100644 index 68d399e1c..000000000 --- a/node_modules/@babel/code-frame/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_highlight","require","deprecationWarningShown","getDefs","chalk","gutter","grey","marker","red","bold","message","NEWLINE","getMarkerLines","loc","source","opts","startLoc","Object","assign","column","line","start","endLoc","end","linesAbove","linesBelow","startLine","startColumn","endLine","endColumn","Math","max","min","length","lineDiff","markerLines","i","lineNumber","sourceLength","codeFrameColumns","rawLines","highlighted","highlightCode","forceColor","shouldHighlight","getChalk","defs","maybeHighlight","chalkFn","string","lines","split","hasColumns","numberMaxWidth","String","highlightedLines","highlight","frame","slice","map","index","number","paddedNumber","hasMarker","lastMarkerLine","markerLine","Array","isArray","markerSpacing","replace","numberOfMarkers","repeat","join","reset","_default","colNumber","process","emitWarning","deprecationError","Error","name","console","warn","location"],"sources":["../src/index.ts"],"sourcesContent":["import highlight, { shouldHighlight, getChalk } from \"@babel/highlight\";\n\ntype Chalk = ReturnType;\n\nlet deprecationWarningShown = false;\n\ntype Location = {\n column: number;\n line: number;\n};\n\ntype NodeLocation = {\n end?: Location;\n start: Location;\n};\n\nexport interface Options {\n /** Syntax highlight the code as JavaScript for terminals. default: false */\n highlightCode?: boolean;\n /** The number of lines to show above the error. default: 2 */\n linesAbove?: number;\n /** The number of lines to show below the error. default: 3 */\n linesBelow?: number;\n /**\n * Forcibly syntax highlight the code as JavaScript (for non-terminals);\n * overrides highlightCode.\n * default: false\n */\n forceColor?: boolean;\n /**\n * Pass in a string to be displayed inline (if possible) next to the\n * highlighted location in the code. If it can't be positioned inline,\n * it will be placed above the code frame.\n * default: nothing\n */\n message?: string;\n}\n\n/**\n * Chalk styles for code frame token types.\n */\nfunction getDefs(chalk: Chalk) {\n return {\n gutter: chalk.grey,\n marker: chalk.red.bold,\n message: chalk.red.bold,\n };\n}\n\n/**\n * RegExp to test for newlines in terminal.\n */\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * Extract what lines should be marked and highlighted.\n */\n\ntype MarkerLines = Record;\n\nfunction getMarkerLines(\n loc: NodeLocation,\n source: Array,\n opts: Options,\n): {\n start: number;\n end: number;\n markerLines: MarkerLines;\n} {\n const startLoc: Location = {\n column: 0,\n line: -1,\n ...loc.start,\n };\n const endLoc: Location = {\n ...startLoc,\n ...loc.end,\n };\n const { linesAbove = 2, linesBelow = 3 } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines: MarkerLines = {};\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n\n return { start, end, markerLines };\n}\n\nexport function codeFrameColumns(\n rawLines: string,\n loc: NodeLocation,\n opts: Options = {},\n): string {\n const highlighted =\n (opts.highlightCode || opts.forceColor) && shouldHighlight(opts);\n const chalk = getChalk(opts);\n const defs = getDefs(chalk);\n const maybeHighlight = (chalkFn: Chalk, string: string) => {\n return highlighted ? chalkFn(string) : string;\n };\n const lines = rawLines.split(NEWLINE);\n const { start, end, markerLines } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n\n const numberMaxWidth = String(end).length;\n\n const highlightedLines = highlighted ? highlight(rawLines, opts) : rawLines;\n\n let frame = highlightedLines\n .split(NEWLINE, end)\n .slice(start, end)\n .map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} |`;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line\n .slice(0, Math.max(hasMarker[0] - 1, 0))\n .replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n\n markerLine = [\n \"\\n \",\n maybeHighlight(defs.gutter, gutter.replace(/\\d/g, \" \")),\n \" \",\n markerSpacing,\n maybeHighlight(defs.marker, \"^\").repeat(numberOfMarkers),\n ].join(\"\");\n\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + maybeHighlight(defs.message, opts.message);\n }\n }\n return [\n maybeHighlight(defs.marker, \">\"),\n maybeHighlight(defs.gutter, gutter),\n line.length > 0 ? ` ${line}` : \"\",\n markerLine,\n ].join(\"\");\n } else {\n return ` ${maybeHighlight(defs.gutter, gutter)}${\n line.length > 0 ? ` ${line}` : \"\"\n }`;\n }\n })\n .join(\"\\n\");\n\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n\n if (highlighted) {\n return chalk.reset(frame);\n } else {\n return frame;\n }\n}\n\n/**\n * Create a code frame, adding line numbers, code highlighting, and pointing to a given position.\n */\n\nexport default function (\n rawLines: string,\n lineNumber: number,\n colNumber?: number | null,\n opts: Options = {},\n): string {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n\n const message =\n \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n\n if (process.emitWarning) {\n // A string is directly supplied to emitWarning, because when supplying an\n // Error object node throws in the tests because of different contexts\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n\n colNumber = Math.max(colNumber, 0);\n\n const location: NodeLocation = {\n start: { column: colNumber, line: lineNumber },\n };\n\n return codeFrameColumns(rawLines, location, opts);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAIA,IAAIC,uBAAuB,GAAG,KAAK;AAqCnC,SAASC,OAAOA,CAACC,KAAY,EAAE;EAC7B,OAAO;IACLC,MAAM,EAAED,KAAK,CAACE,IAAI;IAClBC,MAAM,EAAEH,KAAK,CAACI,GAAG,CAACC,IAAI;IACtBC,OAAO,EAAEN,KAAK,CAACI,GAAG,CAACC;EACrB,CAAC;AACH;AAMA,MAAME,OAAO,GAAG,yBAAyB;AAQzC,SAASC,cAAcA,CACrBC,GAAiB,EACjBC,MAAqB,EACrBC,IAAa,EAKb;EACA,MAAMC,QAAkB,GAAAC,MAAA,CAAAC,MAAA;IACtBC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE,CAAC;EAAC,GACLP,GAAG,CAACQ,KAAK,CACb;EACD,MAAMC,MAAgB,GAAAL,MAAA,CAAAC,MAAA,KACjBF,QAAQ,EACRH,GAAG,CAACU,GAAG,CACX;EACD,MAAM;IAAEC,UAAU,GAAG,CAAC;IAAEC,UAAU,GAAG;EAAE,CAAC,GAAGV,IAAI,IAAI,CAAC,CAAC;EACrD,MAAMW,SAAS,GAAGV,QAAQ,CAACI,IAAI;EAC/B,MAAMO,WAAW,GAAGX,QAAQ,CAACG,MAAM;EACnC,MAAMS,O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,WAAW,EAAE;MAGvBD,OAAO,CAACC,WAAW,CAACnE,OAAO,EAAE,oBAAoB,CAAC;IACpD,CAAC,MAAM;MACL,MAAMoE,gBAAgB,GAAG,IAAIC,KAAK,CAACrE,OAAO,CAAC;MAC3CoE,gBAAgB,CAACE,IAAI,GAAG,oBAAoB;MAC5CC,OAAO,CAACC,IAAI,CAAC,IAAIH,KAAK,CAACrE,OAAO,CAAC,CAAC;IAClC;EACF;EAEAiE,SAAS,GAAG7C,IAAI,CAACC,GAAG,CAAC4C,SAAS,EAAE,CAAC,CAAC;EAElC,MAAMQ,QAAsB,GAAG;IAC7B9D,KAAK,EAAE;MAAEF,MAAM,EAAEwD,SAAS;MAAEvD,IAAI,EAAEiB;IAAW;EAC/C,CAAC;EAED,OAAOE,gBAAgB,CAACC,QAAQ,EAAE2C,QAAQ,EAAEpE,IAAI,CAAC;AACnD"} \ No newline at end of file diff --git a/node_modules/@babel/code-frame/package.json b/node_modules/@babel/code-frame/package.json deleted file mode 100644 index cc71339e1..000000000 --- a/node_modules/@babel/code-frame/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@babel/code-frame", - "version": "7.22.5", - "description": "Generate errors that contain a code frame that point to source locations.", - "author": "The Babel Team (https://babel.dev/team)", - "homepage": "https://babel.dev/docs/en/next/babel-code-frame", - "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-code-frame" - }, - "main": "./lib/index.js", - "dependencies": { - "@babel/highlight": "^7.22.5" - }, - "devDependencies": { - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "type": "commonjs" -} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/LICENSE b/node_modules/@babel/helper-validator-identifier/LICENSE deleted file mode 100644 index f31575ec7..000000000 --- a/node_modules/@babel/helper-validator-identifier/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/helper-validator-identifier/README.md b/node_modules/@babel/helper-validator-identifier/README.md deleted file mode 100644 index 4f704c428..000000000 --- a/node_modules/@babel/helper-validator-identifier/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-validator-identifier - -> Validate identifier/keywords name - -See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/babel-helper-validator-identifier) for more information. - -## Install - -Using npm: - -```sh -npm install --save @babel/helper-validator-identifier -``` - -or using yarn: - -```sh -yarn add @babel/helper-validator-identifier -``` diff --git a/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/node_modules/@babel/helper-validator-identifier/lib/identifier.js deleted file mode 100644 index cd1f4500a..000000000 --- a/node_modules/@babel/helper-validator-identifier/lib/identifier.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isIdentifierChar = isIdentifierChar; -exports.isIdentifierName = isIdentifierName; -exports.isIdentifierStart = isIdentifierStart; -let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; -let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; -const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; -const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191]; -const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; -function isInAstralSet(code, set) { - let pos = 0x10000; - for (let i = 0, length = set.length; i < length; i += 2) { - pos += set[i]; - if (pos > code) return false; - pos += set[i + 1]; - if (pos >= code) return true; - } - return false; -} -function isIdentifierStart(code) { - if (code < 65) return code === 36; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); - } - return isInAstralSet(code, astralIdentifierStartCodes); -} -function isIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code <= 90) return true; - if (code < 97) return code === 95; - if (code <= 122) return true; - if (code <= 0xffff) { - return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); - } - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} -function isIdentifierName(name) { - let isFirst = true; - for (let i = 0; i < name.length; i++) { - let cp = name.charCodeAt(i); - if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) { - const trail = name.charCodeAt(++i); - if ((trail & 0xfc00) === 0xdc00) { - cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); - } - } - if (isFirst) { - isFirst = false; - if (!isIdentifierStart(cp)) { - return false; - } - } else if (!isIdentifierChar(cp)) { - return false; - } - } - return !isFirst; -} - -//# sourceMappingURL=identifier.js.map diff --git a/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map b/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map deleted file mode 100644 index dd0449ddc..000000000 --- a/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["nonASCIIidentifierStartChars","nonASCIIidentifierChars","nonASCIIidentifierStart","RegExp","nonASCIIidentifier","astralIdentifierStartCodes","astralIdentifierCodes","isInAstralSet","code","set","pos","i","length","isIdentifierStart","test","String","fromCharCode","isIdentifierChar","isIdentifierName","name","isFirst","cp","charCodeAt","trail"],"sources":["../src/identifier.ts"],"sourcesContent":["import * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n"],"mappings":";;;;;;;;AAWA,IAAIA,4BAA4B,GAAG,8qIAA8qI;AAEjtI,IAAIC,uBAAuB,GAAG,mkFAAmkF;AAEjmF,MAAMC,uBAAuB,GAAG,IAAIC,MAAM,CACxC,GAAG,GAAGH,4BAA4B,GAAG,GACvC,CAAC;AACD,MAAMI,kBAAkB,GAAG,IAAID,MAAM,CACnC,GAAG,GAAGH,4BAA4B,GAAGC,uBAAuB,GAAG,GACjE,CAAC;AAEDD,4BAA4B,GAAGC,uBAAuB,GAAG,IAAI;AAQ7D,MAAMI,0BAA0B,GAAG,CAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,E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OAAO;AACjB"} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/lib/index.js b/node_modules/@babel/helper-validator-identifier/lib/index.js deleted file mode 100644 index c677cea19..000000000 --- a/node_modules/@babel/helper-validator-identifier/lib/index.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "isIdentifierChar", { - enumerable: true, - get: function () { - return _identifier.isIdentifierChar; - } -}); -Object.defineProperty(exports, "isIdentifierName", { - enumerable: true, - get: function () { - return _identifier.isIdentifierName; - } -}); -Object.defineProperty(exports, "isIdentifierStart", { - enumerable: true, - get: function () { - return _identifier.isIdentifierStart; - } -}); -Object.defineProperty(exports, "isKeyword", { - enumerable: true, - get: function () { - return _keyword.isKeyword; - } -}); -Object.defineProperty(exports, "isReservedWord", { - enumerable: true, - get: function () { - return _keyword.isReservedWord; - } -}); -Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictBindOnlyReservedWord; - } -}); -Object.defineProperty(exports, "isStrictBindReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictBindReservedWord; - } -}); -Object.defineProperty(exports, "isStrictReservedWord", { - enumerable: true, - get: function () { - return _keyword.isStrictReservedWord; - } -}); -var _identifier = require("./identifier"); -var _keyword = require("./keyword"); - -//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-validator-identifier/lib/index.js.map b/node_modules/@babel/helper-validator-identifier/lib/index.js.map deleted file mode 100644 index cc9ad3d91..000000000 --- a/node_modules/@babel/helper-validator-identifier/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_identifier","require","_keyword"],"sources":["../src/index.ts"],"sourcesContent":["export {\n isIdentifierName,\n isIdentifierChar,\n isIdentifierStart,\n} from \"./identifier\";\nexport {\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"./keyword\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA"} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/node_modules/@babel/helper-validator-identifier/lib/keyword.js deleted file mode 100644 index 054cf8474..000000000 --- a/node_modules/@babel/helper-validator-identifier/lib/keyword.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isKeyword = isKeyword; -exports.isReservedWord = isReservedWord; -exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; -exports.isStrictBindReservedWord = isStrictBindReservedWord; -exports.isStrictReservedWord = isStrictReservedWord; -const reservedWords = { - keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], - strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], - strictBind: ["eval", "arguments"] -}; -const keywords = new Set(reservedWords.keyword); -const reservedWordsStrictSet = new Set(reservedWords.strict); -const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); -function isReservedWord(word, inModule) { - return inModule && word === "await" || word === "enum"; -} -function isStrictReservedWord(word, inModule) { - return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); -} -function isStrictBindOnlyReservedWord(word) { - return reservedWordsStrictBindSet.has(word); -} -function isStrictBindReservedWord(word, inModule) { - return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); -} -function isKeyword(word) { - return keywords.has(word); -} - -//# sourceMappingURL=keyword.js.map diff --git a/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map b/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map deleted file mode 100644 index 52a9e991c..000000000 --- a/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["reservedWords","keyword","strict","strictBind","keywords","Set","reservedWordsStrictSet","reservedWordsStrictBindSet","isReservedWord","word","inModule","isStrictReservedWord","has","isStrictBindOnlyReservedWord","isStrictBindReservedWord","isKeyword"],"sources":["../src/keyword.ts"],"sourcesContent":["const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n"],"mappings":";;;;;;;;;;AAAA,MAAMA,aAAa,GAAG;EACpBC,OAAO,EAAE,CACP,OAAO,EACP,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,EACT,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,QAAQ,CACT;EACDC,MAAM,EAAE,CACN,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,CACR;EACDC,UAAU,EAAE,CAAC,MAAM,EAAE,WAAW;AAClC,CAAC;AACD,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAACL,aAAa,CAACC,OAAO,CAAC;AAC/C,MAAMK,sBAAsB,GAAG,IAAID,GAAG,CAACL,aAAa,CAACE,MAAM,CAAC;AAC5D,MAAMK,0BAA0B,GAAG,IAAIF,GAAG,CAACL,aAAa,CAACG,UAAU,CAAC;AAK7D,SAASK,cAAcA,CAACC,IAAY,EAAEC,QAAiB,EAAW;EACvE,OAAQA,QAAQ,IAAID,IAAI,KAAK,OAAO,IAAKA,IAAI,KAAK,MAAM;AAC1D;AAOO,SAASE,oBAAoBA,CAACF,IAAY,EAAEC,QAAiB,EAAW;EAC7E,OAAOF,cAAc,CAACC,IAAI,EAAEC,QAAQ,CAAC,IAAIJ,sBAAsB,CAACM,GAAG,CAACH,IAAI,CAAC;AAC3E;AAMO,SAASI,4BAA4BA,CAACJ,IAAY,EAAW;EAClE,OAAOF,0BAA0B,CAACK,GAAG,CAACH,IAAI,CAAC;AAC7C;AAOO,SAASK,wBAAwBA,CACtCL,IAAY,EACZC,QAAiB,EACR;EACT,OACEC,oBAAoB,CAACF,IAAI,EAAEC,QAAQ,CAAC,IAAIG,4BAA4B,CAACJ,IAAI,CAAC;AAE9E;AAEO,SAASM,SAASA,CAACN,IAAY,EAAW;EAC/C,OAAOL,QAAQ,CAACQ,GAAG,CAACH,IAAI,CAAC;AAC3B"} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/package.json b/node_modules/@babel/helper-validator-identifier/package.json deleted file mode 100644 index 7579010dc..000000000 --- a/node_modules/@babel/helper-validator-identifier/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@babel/helper-validator-identifier", - "version": "7.22.5", - "description": "Validate identifier/keywords name", - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-helper-validator-identifier" - }, - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "main": "./lib/index.js", - "exports": { - ".": "./lib/index.js", - "./package.json": "./package.json" - }, - "devDependencies": { - "@unicode/unicode-15.0.0": "^1.3.1", - "charcodes": "^0.2.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "author": "The Babel Team (https://babel.dev/team)", - "type": "commonjs" -} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js b/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js deleted file mode 100644 index aca8710b2..000000000 --- a/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; - -// Always use the latest available version of Unicode! -// https://tc39.github.io/ecma262/#sec-conformance -const version = "15.0.0"; - -const start = require("@unicode/unicode-" + - version + - "/Binary_Property/ID_Start/code-points.js").filter(function (ch) { - return ch > 0x7f; -}); -let last = -1; -const cont = [0x200c, 0x200d].concat( - require("@unicode/unicode-" + - version + - "/Binary_Property/ID_Continue/code-points.js").filter(function (ch) { - return ch > 0x7f && search(start, ch, last + 1) == -1; - }) -); - -function search(arr, ch, starting) { - for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) { - if (arr[i] === ch) return i; - } - return -1; -} - -function pad(str, width) { - while (str.length < width) str = "0" + str; - return str; -} - -function esc(code) { - const hex = code.toString(16); - if (hex.length <= 2) return "\\x" + pad(hex, 2); - else return "\\u" + pad(hex, 4); -} - -function generate(chars) { - const astral = []; - let re = ""; - for (let i = 0, at = 0x10000; i < chars.length; i++) { - const from = chars[i]; - let to = from; - while (i < chars.length - 1 && chars[i + 1] == to + 1) { - i++; - to++; - } - if (to <= 0xffff) { - if (from == to) re += esc(from); - else if (from + 1 == to) re += esc(from) + esc(to); - else re += esc(from) + "-" + esc(to); - } else { - astral.push(from - at, to - from); - at = to; - } - } - return { nonASCII: re, astral: astral }; -} - -const startData = generate(start); -const contData = generate(cont); - -console.log("/* prettier-ignore */"); -console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";'); -console.log("/* prettier-ignore */"); -console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";'); -console.log("/* prettier-ignore */"); -console.log( - "const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";" -); -console.log("/* prettier-ignore */"); -console.log( - "const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";" -); diff --git a/node_modules/@babel/highlight/LICENSE b/node_modules/@babel/highlight/LICENSE deleted file mode 100644 index f31575ec7..000000000 --- a/node_modules/@babel/highlight/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/highlight/README.md b/node_modules/@babel/highlight/README.md deleted file mode 100644 index f8887ad2c..000000000 --- a/node_modules/@babel/highlight/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/highlight - -> Syntax highlight JavaScript strings for output in terminals. - -See our website [@babel/highlight](https://babeljs.io/docs/en/babel-highlight) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/highlight -``` - -or using yarn: - -```sh -yarn add @babel/highlight --dev -``` diff --git a/node_modules/@babel/highlight/lib/index.js b/node_modules/@babel/highlight/lib/index.js deleted file mode 100644 index 60bd83510..000000000 --- a/node_modules/@babel/highlight/lib/index.js +++ /dev/null @@ -1,96 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = highlight; -exports.getChalk = getChalk; -exports.shouldHighlight = shouldHighlight; -var _jsTokens = require("js-tokens"); -var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); -var _chalk = require("chalk"); -const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); -function getDefs(chalk) { - return { - keyword: chalk.cyan, - capitalized: chalk.yellow, - jsxIdentifier: chalk.yellow, - punctuator: chalk.yellow, - number: chalk.magenta, - string: chalk.green, - regex: chalk.magenta, - comment: chalk.grey, - invalid: chalk.white.bgRed.bold - }; -} -const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; -const BRACKET = /^[()[\]{}]$/; -let tokenize; -{ - const JSX_TAG = /^[a-z][\w-]*$/i; - const getTokenType = function (token, offset, text) { - if (token.type === "name") { - if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) { - return "keyword"; - } - if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) == " colorize(str)).join("\n"); - } else { - highlighted += value; - } - } - return highlighted; -} -function shouldHighlight(options) { - return !!_chalk.supportsColor || options.forceColor; -} -function getChalk(options) { - return options.forceColor ? new _chalk.constructor({ - enabled: true, - level: 1 - }) : _chalk; -} -function highlight(code, options = {}) { - if (code !== "" && shouldHighlight(options)) { - const chalk = getChalk(options); - const defs = getDefs(chalk); - return highlightTokens(defs, code); - } else { - return code; - } -} - -//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/highlight/lib/index.js.map b/node_modules/@babel/highlight/lib/index.js.map deleted file mode 100644 index f39fafe9c..000000000 --- a/node_modules/@babel/highlight/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"names":["_jsTokens","require","_helperValidatorIdentifier","_chalk","sometimesKeywords","Set","getDefs","chalk","keyword","cyan","capitalized","yellow","jsxIdentifier","punctuator","number","magenta","string","green","regex","comment","grey","invalid","white","bgRed","bold","NEWLINE","BRACKET","tokenize","JSX_TAG","getTokenType","token","offset","text","type","isKeyword","value","isStrictReservedWord","has","test","slice","toLowerCase","match","jsTokens","default","exec","matchToToken","index","highlightTokens","defs","highlighted","colorize","split","map","str","join","shouldHighlight","options","Chalk","supportsColor","forceColor","getChalk","constructor","enabled","level","highlight","code"],"sources":["../src/index.ts"],"sourcesContent":["/// \n\nimport type { Token as JSToken, JSXToken } from \"js-tokens\";\nimport jsTokens from \"js-tokens\";\n\nimport {\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\nimport Chalk from \"chalk\";\n\ntype ChalkClass = ReturnType;\n\n/**\n * Names that are always allowed as identifiers, but also appear as keywords\n * within certain syntactic productions.\n *\n * https://tc39.es/ecma262/#sec-keywords-and-reserved-words\n *\n * `target` has been omitted since it is very likely going to be a false\n * positive.\n */\nconst sometimesKeywords = new Set([\"as\", \"async\", \"from\", \"get\", \"of\", \"set\"]);\n\ntype InternalTokenType =\n | \"keyword\"\n | \"capitalized\"\n | \"jsxIdentifier\"\n | \"punctuator\"\n | \"number\"\n | \"string\"\n | \"regex\"\n | \"comment\"\n | \"invalid\";\n\ntype Token = {\n type: InternalTokenType | \"uncolored\";\n value: string;\n};\n/**\n * Chalk styles for token types.\n */\nfunction getDefs(chalk: ChalkClass): Record {\n return {\n keyword: chalk.cyan,\n capitalized: chalk.yellow,\n jsxIdentifier: chalk.yellow,\n punctuator: chalk.yellow,\n number: chalk.magenta,\n string: chalk.green,\n regex: chalk.magenta,\n comment: chalk.grey,\n invalid: chalk.white.bgRed.bold,\n };\n}\n\n/**\n * RegExp to test for newlines in terminal.\n */\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * RegExp to test for the three types of brackets.\n */\nconst BRACKET = /^[()[\\]{}]$/;\n\nlet tokenize: (\n text: string,\n) => Generator<{ type: InternalTokenType | \"uncolored\"; value: string }>;\n\nif (process.env.BABEL_8_BREAKING) {\n /**\n * Get the type of token, specifying punctuator type.\n */\n const getTokenType = function (\n token: JSToken | JSXToken,\n ): InternalTokenType | \"uncolored\" {\n if (token.type === \"IdentifierName\") {\n if (\n isKeyword(token.value) ||\n isStrictReservedWord(token.value, true) ||\n sometimesKeywords.has(token.value)\n ) {\n return \"keyword\";\n }\n\n if (token.value[0] !== token.value[0].toLowerCase()) {\n return \"capitalized\";\n }\n }\n\n if (token.type === \"Punctuator\" && BRACKET.test(token.value)) {\n return \"uncolored\";\n }\n\n if (token.type === \"Invalid\" && token.value === \"@\") {\n return \"punctuator\";\n }\n\n switch (token.type) {\n case \"NumericLiteral\":\n return \"number\";\n\n case \"StringLiteral\":\n case \"JSXString\":\n case \"NoSubstitutionTemplate\":\n return \"string\";\n\n case \"RegularExpressionLiteral\":\n return \"regex\";\n\n case \"Punctuator\":\n case \"JSXPunctuator\":\n return \"punctuator\";\n\n case \"MultiLineComment\":\n case \"SingleLineComment\":\n return \"comment\";\n\n case \"Invalid\":\n case \"JSXInvalid\":\n return \"invalid\";\n\n case \"JSXIdentifier\":\n return \"jsxIdentifier\";\n\n default:\n return \"uncolored\";\n }\n };\n\n /**\n * Turn a string of JS into an array of objects.\n */\n tokenize = function* (text: string): Generator {\n for (const token of jsTokens(text, { jsx: true })) {\n switch (token.type) {\n case \"TemplateHead\":\n yield { type: \"string\", value: token.value.slice(0, -2) };\n yield { type: \"punctuator\", value: \"${\" };\n break;\n\n case \"TemplateMiddle\":\n yield { type: \"punctuator\", value: \"}\" };\n yield { type: \"string\", value: token.value.slice(1, -2) };\n yield { type: \"punctuator\", value: \"${\" };\n break;\n\n case \"TemplateTail\":\n yield { type: \"punctuator\", value: \"}\" };\n yield { type: \"string\", value: token.value.slice(1) };\n break;\n\n default:\n yield {\n type: getTokenType(token),\n value: token.value,\n };\n }\n }\n };\n} else {\n /**\n * RegExp to test for what seems to be a JSX tag name.\n */\n const JSX_TAG = /^[a-z][\\w-]*$/i;\n\n // The token here is defined in js-tokens@4. However we don't bother\n // typing it since the whole block will be removed in Babel 8\n const getTokenType = function (token: any, offset: number, text: string) {\n if (token.type === \"name\") {\n if (\n isKeyword(token.value) ||\n isStrictReservedWord(token.value, true) ||\n sometimesKeywords.has(token.value)\n ) {\n return \"keyword\";\n }\n\n if (\n JSX_TAG.test(token.value) &&\n (text[offset - 1] === \"<\" || text.slice(offset - 2, offset) == \", text: string) {\n let highlighted = \"\";\n\n for (const { type, value } of tokenize(text)) {\n const colorize = defs[type];\n if (colorize) {\n highlighted += value\n .split(NEWLINE)\n .map(str => colorize(str))\n .join(\"\\n\");\n } else {\n highlighted += value;\n }\n }\n\n return highlighted;\n}\n\n/**\n * Highlight `text` using the token definitions in `defs`.\n */\n\ntype Options = {\n forceColor?: boolean;\n};\n\n/**\n * Whether the code should be highlighted given the passed options.\n */\nexport function shouldHighlight(options: Options): boolean {\n return !!Chalk.supportsColor || options.forceColor;\n}\n\n/**\n * The Chalk instance that should be used given the passed options.\n */\nexport function getChalk(options: Options) {\n return options.forceColor\n ? new Chalk.constructor({ enabled: true, level: 1 })\n : Chalk;\n}\n\n/**\n * Highlight `code`.\n */\nexport default function highlight(code: string, options: Options = {}): string {\n if (code !== \"\" && shouldHighlight(options)) {\n const chalk = getChalk(options);\n const defs = getDefs(chalk);\n return highlightTokens(defs, code);\n } else {\n return code;\n }\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,0BAAA,GAAAD,OAAA;AAIA,IAAAE,MAAA,GAAAF,OAAA;AAaA,MAAMG,iBAAiB,GAAG,IAAIC,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAoB9E,SAASC,OAAOA,CAACC,KAAiB,EAAyC;EACzE,OAAO;IACLC,OAAO,EAAED,KAAK,CAACE,IAAI;IACnBC,WAAW,EAAEH,KAAK,CAACI,MAAM;IACzBC,aAAa,EAAEL,KAAK,CAACI,MAAM;IAC3BE,UAAU,EAAEN,KAAK,CAACI,MAAM;IACxBG,MAAM,EAAEP,KAAK,CAACQ,OAAO;IACrBC,MAAM,EAAET,KAAK,CAACU,KAAK;IACnBC,KAAK,EAAEX,KAAK,CAACQ,OAAO;IACpBI,OAAO,EAAEZ,KAAK,CAACa,IAAI;IACnBC,OAAO,EAAEd,KAAK,CAACe,KAAK,CAACC,KAAK,CAACC;EAC7B,CAAC;AACH;AAKA,MAAMC,OAAO,GAA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AAMjD,KAAK,GAAGqD,QAAQ,CAACJ,OAAO,CAAC;IAC/B,MAAMR,IAAI,GAAG1C,OAAO,CAACC,KAAK,CAAC;IAC3B,OAAOwC,eAAe,CAACC,IAAI,EAAEiB,IAAI,CAAC;EACpC,CAAC,MAAM;IACL,OAAOA,IAAI;EACb;AACF"} \ No newline at end of file diff --git a/node_modules/@babel/highlight/package.json b/node_modules/@babel/highlight/package.json deleted file mode 100644 index 21220e73f..000000000 --- a/node_modules/@babel/highlight/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "@babel/highlight", - "version": "7.22.5", - "description": "Syntax highlight JavaScript strings for output in terminals.", - "author": "The Babel Team (https://babel.dev/team)", - "homepage": "https://babel.dev/docs/en/next/babel-highlight", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-highlight" - }, - "main": "./lib/index.js", - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "devDependencies": { - "@types/chalk": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "type": "commonjs" -} \ No newline at end of file diff --git a/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md b/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md deleted file mode 100644 index 5bf94441a..000000000 --- a/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md +++ /dev/null @@ -1,53 +0,0 @@ -# Changes to CSS Parser Algorithms - -### 2.3.0 - -_July 3, 2023_ - -- Add `sourceIndices` helper function. - -This makes it easier to get the start and end indices of a node in the source string. -This function accepts any node that can be converted into an array of tokens. - -### 2.2.0 - -_June 1, 2023_ - -- Add `state` to `walk` methods. - -This makes it possible pass down information from a parent structure to children. -e.g. you can set `entry.state.isInCalcExpression = true` for `calc((10 + 5) / 2)` when walking the `FunctionNode` for `calc`. - -### 2.1.1 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) - -### 2.1.0 - -_March 25, 2023_ - -- Add `replaceComponentValues` utility function. -- Add `stringify` utility function. - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 19, 2023_ - -- Fix: Removes `UnclosedFunctionNode` and `UnclosedSimpleBlockNode`. (breaking) -- Change the `ParseError` interface, this is now a subclass of `Error` (breaking) -- Change `nameTokenValue` in `FunctionNode` to `getName` (breaking) -- Fix: Do not discard empty items in comma separated lists. - -### 1.0.0 - -_November 14, 2022_ - -- Initial version diff --git a/node_modules/@csstools/css-parser-algorithms/LICENSE.md b/node_modules/@csstools/css-parser-algorithms/LICENSE.md deleted file mode 100644 index af5411fa2..000000000 --- a/node_modules/@csstools/css-parser-algorithms/LICENSE.md +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright 2022 Romain Menke, Antonio Laguna - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@csstools/css-parser-algorithms/README.md b/node_modules/@csstools/css-parser-algorithms/README.md deleted file mode 100644 index b63c2ce39..000000000 --- a/node_modules/@csstools/css-parser-algorithms/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# CSS Parser Algorithms - -[npm version][npm-url] -[Build Status][cli-url] -[Discord][discord] - -Implemented from : https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/ - -## Usage - -Add [CSS Parser Algorithms] to your project: - -```bash -npm install @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev -``` - -[CSS Parser Algorithms] only accepts tokenized CSS. -It must be used together with `@csstools/css-tokenizer`. - - -```js -import { tokenizer, TokenType } from '@csstools/css-tokenizer'; -import { parseComponentValue } from '@csstools/css-parser-algorithms'; - -const myCSS = `@media only screen and (min-width: 768rem) { - .foo { - content: 'Some content!' !important; - } -} -`; - -const t = tokenizer({ - css: myCSS, -}); - -const tokens = []; - -{ - while (!t.endOfFile()) { - tokens.push(t.nextToken()); - } - - tokens.push(t.nextToken()); // EOF-token -} - -const options = { - onParseError: ((err) => { - throw err; - }), -}; - -const result = parseComponentValue(tokens, options); - -console.log(result); -``` - -### Available functions - -- [`parseComponentValue`](https://www.w3.org/TR/css-syntax-3/#parse-component-value) -- [`parseListOfComponentValues`](https://www.w3.org/TR/css-syntax-3/#parse-list-of-component-values) -- [`parseCommaSeparatedListOfComponentValues`](https://www.w3.org/TR/css-syntax-3/#parse-comma-separated-list-of-component-values) - -### Utilities - -#### `gatherNodeAncestry` - -The AST does not expose the entire ancestry of each node. -The walker methods do provide access to the current parent, but also not the entire ancestry. - -To gather the entire ancestry for a a given sub tree of the AST you can use `gatherNodeAncestry`. -The result is a `Map` with the child nodes as keys and the parents as values. -This allows you to lookup any ancestor of any node. - -```css -import { parseComponentValue } from '@csstools/css-parser-algorithms'; - -const result = parseComponentValue(tokens, options); -const ancestry = gatherNodeAncestry(result); -``` - -### Options - -```ts -{ - onParseError?: (error: ParseError) => void -} -``` - -#### `onParseError` - -The parser algorithms are forgiving and won't stop when a parse error is encountered. -Parse errors also aren't tokens. - -To receive parsing error information you can set a callback. - -Parser errors will try to inform you about the point in the parsing logic the error happened. -This tells you the kind of error. - -## Goals and non-goals - -Things this package aims to be: -- specification compliant CSS parser -- a reliable low level package to be used in CSS sub-grammars - -What it is not: -- opinionated -- fast -- small -- a replacement for PostCSS (PostCSS is fast and also an ecosystem) - -[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test -[discord]: https://discord.gg/bUadyRwkJS -[npm-url]: https://www.npmjs.com/package/@csstools/css-parser-algorithms - -[CSS Parser Algorithms]: https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms diff --git a/node_modules/@csstools/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts deleted file mode 100644 index 59cdf944a..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { CSSToken, TokenFunction } from '@csstools/css-tokenizer'; -import { Context } from '../interfaces/context'; -import { ComponentValueType } from '../util/component-value-type'; -export type ContainerNode = FunctionNode | SimpleBlockNode; -export type ComponentValue = FunctionNode | SimpleBlockNode | WhitespaceNode | CommentNode | TokenNode; -export declare function consumeComponentValue(ctx: Context, tokens: Array): { - advance: number; - node: ComponentValue; -}; -export declare class FunctionNode { - type: ComponentValueType; - name: TokenFunction; - endToken: CSSToken; - value: Array; - constructor(name: TokenFunction, endToken: CSSToken, value: Array); - getName(): string; - /** - * Normalize the current Function: - * - if the "endToken" is EOF, replace with a ")-token" - */ - normalize(): void; - tokens(): Array; - toString(): string; - indexOf(item: ComponentValue): number | string; - at(index: number | string): ComponentValue | undefined; - walk>(cb: (entry: { - node: ComponentValue; - parent: ContainerNode; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): unknown; - isFunctionNode(): this is FunctionNode; - static isFunctionNode(x: unknown): x is FunctionNode; -} -export declare function consumeFunction(ctx: Context, tokens: Array): { - advance: number; - node: FunctionNode; -}; -export declare class SimpleBlockNode { - type: ComponentValueType; - startToken: CSSToken; - endToken: CSSToken; - value: Array; - constructor(startToken: CSSToken, endToken: CSSToken, value: Array); - /** - * Normalize the current Simple Block: - * - if the "endToken" is EOF, replace with the mirror token of the "startToken" - */ - normalize(): void; - tokens(): Array; - toString(): string; - indexOf(item: ComponentValue): number | string; - at(index: number | string): ComponentValue | undefined; - walk>(cb: (entry: { - node: ComponentValue; - parent: ContainerNode; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): unknown; - isSimpleBlockNode(): this is SimpleBlockNode; - static isSimpleBlockNode(x: unknown): x is SimpleBlockNode; -} -/** https://www.w3.org/TR/css-syntax-3/#consume-simple-block */ -export declare function consumeSimpleBlock(ctx: Context, tokens: Array): { - advance: number; - node: SimpleBlockNode; -}; -export declare class WhitespaceNode { - type: ComponentValueType; - value: Array; - constructor(value: Array); - tokens(): Array; - toString(): string; - toJSON(): { - type: ComponentValueType; - tokens: CSSToken[]; - }; - isWhitespaceNode(): this is WhitespaceNode; - static isWhitespaceNode(x: unknown): x is WhitespaceNode; -} -export declare function consumeWhitespace(ctx: Context, tokens: Array): { - advance: number; - node: WhitespaceNode; -}; -export declare class CommentNode { - type: ComponentValueType; - value: CSSToken; - constructor(value: CSSToken); - tokens(): Array; - toString(): string; - toJSON(): { - type: ComponentValueType; - tokens: CSSToken[]; - }; - isCommentNode(): this is CommentNode; - static isCommentNode(x: unknown): x is CommentNode; -} -export declare function consumeComment(ctx: Context, tokens: Array): { - advance: number; - node: CommentNode; -}; -export declare function consumeAllCommentsAndWhitespace(ctx: Context, tokens: Array): { - advance: number; - nodes: Array; -}; -export declare class TokenNode { - type: ComponentValueType; - value: CSSToken; - constructor(value: CSSToken); - tokens(): Array; - toString(): string; - toJSON(): { - type: ComponentValueType; - tokens: CSSToken[]; - }; - isTokenNode(): this is TokenNode; - static isTokenNode(x: unknown): x is TokenNode; -} diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.cjs b/node_modules/@csstools/css-parser-algorithms/dist/index.cjs deleted file mode 100644 index 4405dce4d..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/index.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e,n=require("@csstools/css-tokenizer");function consumeComponentValue(e,o){const t=o[0];if(t[0]===n.TokenType.OpenParen||t[0]===n.TokenType.OpenCurly||t[0]===n.TokenType.OpenSquare){const n=consumeSimpleBlock(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Function){const n=consumeFunction(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Whitespace){const n=consumeWhitespace(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Comment){const n=consumeComment(e,o);return{advance:n.advance,node:n.node}}return{advance:1,node:new TokenNode(t)}}exports.ComponentValueType=void 0,(e=exports.ComponentValueType||(exports.ComponentValueType={})).Function="function",e.SimpleBlock="simple-block",e.Whitespace="whitespace",e.Comment="comment",e.Token="token";class FunctionNode{type=exports.ComponentValueType.Function;name;endToken;value;constructor(e,n,o){this.name=e,this.endToken=n,this.value=o}getName(){return this.name[4].value}normalize(){this.endToken[0]===n.TokenType.EOF&&(this.endToken=[n.TokenType.CloseParen,")",-1,-1,void 0])}tokens(){return this.endToken[0]===n.TokenType.EOF?[this.name,...this.value.flatMap((e=>e.tokens()))]:[this.name,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n.isToken(e)?n.stringify(e):e.toString())).join("");return n.stringify(this.name)+e+n.stringify(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}walk(e,n){let o=!1;if(this.value.forEach(((t,s)=>{if(o)return;let i;n&&(i={...n}),!1!==e({node:t,parent:this,state:i},s)?"walk"in t&&!1===t.walk(e,i)&&(o=!0):o=!0})),o)return!1}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isFunctionNode(){return FunctionNode.isFunctionNode(this)}static isFunctionNode(e){return!!e&&(e instanceof FunctionNode&&e.type===exports.ComponentValueType.Function)}}function consumeFunction(e,o){const t=[];let s=1;for(;;){const i=o[s];if(!i||i[0]===n.TokenType.EOF)return e.onParseError(new n.ParseError("Unexpected EOF while consuming a function.",o[0][2],o[o.length-1][3],["5.4.9. Consume a function","Unexpected EOF"])),{advance:o.length,node:new FunctionNode(o[0],i,t)};if(i[0]===n.TokenType.CloseParen)return{advance:s+1,node:new FunctionNode(o[0],i,t)};if(i[0]===n.TokenType.Comment||i[0]===n.TokenType.Whitespace){const n=consumeAllCommentsAndWhitespace(e,o.slice(s));s+=n.advance,t.push(...n.nodes);continue}const r=consumeComponentValue(e,o.slice(s));s+=r.advance,t.push(r.node)}}class SimpleBlockNode{type=exports.ComponentValueType.SimpleBlock;startToken;endToken;value;constructor(e,n,o){this.startToken=e,this.endToken=n,this.value=o}normalize(){if(this.endToken[0]===n.TokenType.EOF){const e=n.mirrorVariant(this.startToken);e&&(this.endToken=e)}}tokens(){return this.endToken[0]===n.TokenType.EOF?[this.startToken,...this.value.flatMap((e=>e.tokens()))]:[this.startToken,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n.isToken(e)?n.stringify(e):e.toString())).join("");return n.stringify(this.startToken)+e+n.stringify(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}walk(e,n){let o=!1;if(this.value.forEach(((t,s)=>{if(o)return;let i;n&&(i={...n}),!1!==e({node:t,parent:this,state:i},s)?"walk"in t&&!1===t.walk(e,i)&&(o=!0):o=!0})),o)return!1}toJSON(){return{type:this.type,startToken:this.startToken,tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isSimpleBlockNode(){return SimpleBlockNode.isSimpleBlockNode(this)}static isSimpleBlockNode(e){return!!e&&(e instanceof SimpleBlockNode&&e.type===exports.ComponentValueType.SimpleBlock)}}function consumeSimpleBlock(e,o){const t=n.mirrorVariantType(o[0][0]);if(!t)throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");const s=[];let i=1;for(;;){const r=o[i];if(!r||r[0]===n.TokenType.EOF)return e.onParseError(new n.ParseError("Unexpected EOF while consuming a simple block.",o[0][2],o[o.length-1][3],["5.4.8. Consume a simple block","Unexpected EOF"])),{advance:o.length,node:new SimpleBlockNode(o[0],r,s)};if(r[0]===t)return{advance:i+1,node:new SimpleBlockNode(o[0],r,s)};if(r[0]===n.TokenType.Comment||r[0]===n.TokenType.Whitespace){const n=consumeAllCommentsAndWhitespace(e,o.slice(i));i+=n.advance,s.push(...n.nodes);continue}const a=consumeComponentValue(e,o.slice(i));i+=a.advance,s.push(a.node)}}class WhitespaceNode{type=exports.ComponentValueType.Whitespace;value;constructor(e){this.value=e}tokens(){return this.value}toString(){return n.stringify(...this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isWhitespaceNode(){return WhitespaceNode.isWhitespaceNode(this)}static isWhitespaceNode(e){return!!e&&(e instanceof WhitespaceNode&&e.type===exports.ComponentValueType.Whitespace)}}function consumeWhitespace(e,o){let t=0;for(;;){if(o[t][0]!==n.TokenType.Whitespace)return{advance:t,node:new WhitespaceNode(o.slice(0,t))};t++}}class CommentNode{type=exports.ComponentValueType.Comment;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return n.stringify(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isCommentNode(){return CommentNode.isCommentNode(this)}static isCommentNode(e){return!!e&&(e instanceof CommentNode&&e.type===exports.ComponentValueType.Comment)}}function consumeComment(e,n){return{advance:1,node:new CommentNode(n[0])}}function consumeAllCommentsAndWhitespace(e,o){const t=[];let s=0;for(;;)if(o[s][0]!==n.TokenType.Whitespace){if(o[s][0]!==n.TokenType.Comment)return{advance:s,nodes:t};t.push(new CommentNode(o[s])),s++}else{const e=consumeWhitespace(0,o.slice(s));s+=e.advance,t.push(e.node)}}class TokenNode{type=exports.ComponentValueType.Token;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return n.stringify(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isTokenNode(){return TokenNode.isTokenNode(this)}static isTokenNode(e){return!!e&&(e instanceof TokenNode&&e.type===exports.ComponentValueType.Token)}}function isSimpleBlockNode(e){return SimpleBlockNode.isSimpleBlockNode(e)}function isFunctionNode(e){return FunctionNode.isFunctionNode(e)}exports.CommentNode=CommentNode,exports.FunctionNode=FunctionNode,exports.SimpleBlockNode=SimpleBlockNode,exports.TokenNode=TokenNode,exports.WhitespaceNode=WhitespaceNode,exports.consumeAllCommentsAndWhitespace=consumeAllCommentsAndWhitespace,exports.consumeComment=consumeComment,exports.consumeComponentValue=consumeComponentValue,exports.consumeFunction=consumeFunction,exports.consumeSimpleBlock=consumeSimpleBlock,exports.consumeWhitespace=consumeWhitespace,exports.gatherNodeAncestry=function gatherNodeAncestry(e){const n=new Map;return e.walk((e=>{Array.isArray(e.node)?e.node.forEach((o=>{n.set(o,e.parent)})):n.set(e.node,e.parent)})),n},exports.isCommentNode=function isCommentNode(e){return CommentNode.isCommentNode(e)},exports.isFunctionNode=isFunctionNode,exports.isSimpleBlockNode=isSimpleBlockNode,exports.isTokenNode=function isTokenNode(e){return TokenNode.isTokenNode(e)},exports.isWhitespaceNode=function isWhitespaceNode(e){return WhitespaceNode.isWhitespaceNode(e)},exports.parseCommaSeparatedListOfComponentValues=function parseCommaSeparatedListOfComponentValues(e,o){const t={onParseError:(null==o?void 0:o.onParseError)??(()=>{})},s=[...e];if(0===e.length)return[];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=[],a=0;for(;;){if(!s[a]||s[a][0]===n.TokenType.EOF)return r.length&&i.push(r),i;if(s[a][0]===n.TokenType.Comma){i.push(r),r=[],a++;continue}const o=consumeComponentValue(t,e.slice(a));r.push(o.node),a+=o.advance}},exports.parseComponentValue=function parseComponentValue(e,o){const t={onParseError:(null==o?void 0:o.onParseError)??(()=>{})},s=[...e];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=consumeComponentValue(t,s);if(s[Math.min(i.advance,s.length-1)][0]===n.TokenType.EOF)return i.node;t.onParseError(new n.ParseError("Expected EOF after parsing a component value.",e[0][2],e[e.length-1][3],["5.3.9. Parse a component value","Expected EOF"]))},exports.parseListOfComponentValues=function parseListOfComponentValues(e,o){const t={onParseError:(null==o?void 0:o.onParseError)??(()=>{})},s=[...e];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=0;for(;;){if(!s[r]||s[r][0]===n.TokenType.EOF)return i;const e=consumeComponentValue(t,s.slice(r));i.push(e.node),r+=e.advance}},exports.replaceComponentValues=function replaceComponentValues(e,n){for(let o=0;o{if("number"!=typeof o)return;const t=e.node,s=n(t);s&&e.parent.value.splice(o,1,s)}))}}return e},exports.sourceIndices=function sourceIndices(e){if(Array.isArray(e)){const n=e[0];if(!n)return[0,0];const o=e[e.length-1]||n;return[sourceIndices(n)[0],sourceIndices(o)[1]]}const n=e.tokens(),o=n[0],t=n[n.length-1];return o&&t?[o[2],t[3]]:[0,0]},exports.stringify=function stringify(e){return e.map((e=>e.map((e=>n.stringify(...e.tokens()))).join(""))).join(",")}; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts deleted file mode 100644 index 47c3cec9e..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './consume/consume-component-block-function'; -export { parseComponentValue } from './parse/parse-component-value'; -export { parseListOfComponentValues } from './parse/parse-list-of-component-values'; -export { parseCommaSeparatedListOfComponentValues } from './parse/parse-comma-separated-list-of-component-values'; -export { gatherNodeAncestry } from './util/node-ancestry'; -export { replaceComponentValues } from './util/replace-component-values'; -export { stringify } from './util/stringify'; -export { ComponentValueType } from './util/component-value-type'; -export { isCommentNode, isFunctionNode, isSimpleBlockNode, isTokenNode, isWhitespaceNode, } from './util/type-predicates'; -export { sourceIndices } from './util/source-indices'; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.mjs b/node_modules/@csstools/css-parser-algorithms/dist/index.mjs deleted file mode 100644 index cc63349e9..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/index.mjs +++ /dev/null @@ -1 +0,0 @@ -import{TokenType as e,isToken as n,stringify as t,ParseError as o,mirrorVariant as s,mirrorVariantType as i}from"@csstools/css-tokenizer";var r;function consumeComponentValue(n,t){const o=t[0];if(o[0]===e.OpenParen||o[0]===e.OpenCurly||o[0]===e.OpenSquare){const e=consumeSimpleBlock(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Function){const e=consumeFunction(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Whitespace){const e=consumeWhitespace(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Comment){const e=consumeComment(n,t);return{advance:e.advance,node:e.node}}return{advance:1,node:new TokenNode(o)}}!function(e){e.Function="function",e.SimpleBlock="simple-block",e.Whitespace="whitespace",e.Comment="comment",e.Token="token"}(r||(r={}));class FunctionNode{type=r.Function;name;endToken;value;constructor(e,n,t){this.name=e,this.endToken=n,this.value=t}getName(){return this.name[4].value}normalize(){this.endToken[0]===e.EOF&&(this.endToken=[e.CloseParen,")",-1,-1,void 0])}tokens(){return this.endToken[0]===e.EOF?[this.name,...this.value.flatMap((e=>e.tokens()))]:[this.name,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n(e)?t(e):e.toString())).join("");return t(this.name)+e+t(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}walk(e,n){let t=!1;if(this.value.forEach(((o,s)=>{if(t)return;let i;n&&(i={...n}),!1!==e({node:o,parent:this,state:i},s)?"walk"in o&&!1===o.walk(e,i)&&(t=!0):t=!0})),t)return!1}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isFunctionNode(){return FunctionNode.isFunctionNode(this)}static isFunctionNode(e){return!!e&&(e instanceof FunctionNode&&e.type===r.Function)}}function consumeFunction(n,t){const s=[];let i=1;for(;;){const r=t[i];if(!r||r[0]===e.EOF)return n.onParseError(new o("Unexpected EOF while consuming a function.",t[0][2],t[t.length-1][3],["5.4.9. Consume a function","Unexpected EOF"])),{advance:t.length,node:new FunctionNode(t[0],r,s)};if(r[0]===e.CloseParen)return{advance:i+1,node:new FunctionNode(t[0],r,s)};if(r[0]===e.Comment||r[0]===e.Whitespace){const e=consumeAllCommentsAndWhitespace(n,t.slice(i));i+=e.advance,s.push(...e.nodes);continue}const a=consumeComponentValue(n,t.slice(i));i+=a.advance,s.push(a.node)}}class SimpleBlockNode{type=r.SimpleBlock;startToken;endToken;value;constructor(e,n,t){this.startToken=e,this.endToken=n,this.value=t}normalize(){if(this.endToken[0]===e.EOF){const e=s(this.startToken);e&&(this.endToken=e)}}tokens(){return this.endToken[0]===e.EOF?[this.startToken,...this.value.flatMap((e=>e.tokens()))]:[this.startToken,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n(e)?t(e):e.toString())).join("");return t(this.startToken)+e+t(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}walk(e,n){let t=!1;if(this.value.forEach(((o,s)=>{if(t)return;let i;n&&(i={...n}),!1!==e({node:o,parent:this,state:i},s)?"walk"in o&&!1===o.walk(e,i)&&(t=!0):t=!0})),t)return!1}toJSON(){return{type:this.type,startToken:this.startToken,tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isSimpleBlockNode(){return SimpleBlockNode.isSimpleBlockNode(this)}static isSimpleBlockNode(e){return!!e&&(e instanceof SimpleBlockNode&&e.type===r.SimpleBlock)}}function consumeSimpleBlock(n,t){const s=i(t[0][0]);if(!s)throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");const r=[];let a=1;for(;;){const i=t[a];if(!i||i[0]===e.EOF)return n.onParseError(new o("Unexpected EOF while consuming a simple block.",t[0][2],t[t.length-1][3],["5.4.8. Consume a simple block","Unexpected EOF"])),{advance:t.length,node:new SimpleBlockNode(t[0],i,r)};if(i[0]===s)return{advance:a+1,node:new SimpleBlockNode(t[0],i,r)};if(i[0]===e.Comment||i[0]===e.Whitespace){const e=consumeAllCommentsAndWhitespace(n,t.slice(a));a+=e.advance,r.push(...e.nodes);continue}const c=consumeComponentValue(n,t.slice(a));a+=c.advance,r.push(c.node)}}class WhitespaceNode{type=r.Whitespace;value;constructor(e){this.value=e}tokens(){return this.value}toString(){return t(...this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isWhitespaceNode(){return WhitespaceNode.isWhitespaceNode(this)}static isWhitespaceNode(e){return!!e&&(e instanceof WhitespaceNode&&e.type===r.Whitespace)}}function consumeWhitespace(n,t){let o=0;for(;;){if(t[o][0]!==e.Whitespace)return{advance:o,node:new WhitespaceNode(t.slice(0,o))};o++}}class CommentNode{type=r.Comment;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return t(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isCommentNode(){return CommentNode.isCommentNode(this)}static isCommentNode(e){return!!e&&(e instanceof CommentNode&&e.type===r.Comment)}}function consumeComment(e,n){return{advance:1,node:new CommentNode(n[0])}}function consumeAllCommentsAndWhitespace(n,t){const o=[];let s=0;for(;;)if(t[s][0]!==e.Whitespace){if(t[s][0]!==e.Comment)return{advance:s,nodes:o};o.push(new CommentNode(t[s])),s++}else{const e=consumeWhitespace(0,t.slice(s));s+=e.advance,o.push(e.node)}}class TokenNode{type=r.Token;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return t(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isTokenNode(){return TokenNode.isTokenNode(this)}static isTokenNode(e){return!!e&&(e instanceof TokenNode&&e.type===r.Token)}}function parseComponentValue(n,t){const s={onParseError:(null==t?void 0:t.onParseError)??(()=>{})},i=[...n];i[i.length-1][0]!==e.EOF&&i.push([e.EOF,"",i[i.length-1][2],i[i.length-1][3],void 0]);const r=consumeComponentValue(s,i);if(i[Math.min(r.advance,i.length-1)][0]===e.EOF)return r.node;s.onParseError(new o("Expected EOF after parsing a component value.",n[0][2],n[n.length-1][3],["5.3.9. Parse a component value","Expected EOF"]))}function parseListOfComponentValues(n,t){const o={onParseError:(null==t?void 0:t.onParseError)??(()=>{})},s=[...n];s[s.length-1][0]!==e.EOF&&s.push([e.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=0;for(;;){if(!s[r]||s[r][0]===e.EOF)return i;const n=consumeComponentValue(o,s.slice(r));i.push(n.node),r+=n.advance}}function parseCommaSeparatedListOfComponentValues(n,t){const o={onParseError:(null==t?void 0:t.onParseError)??(()=>{})},s=[...n];if(0===n.length)return[];s[s.length-1][0]!==e.EOF&&s.push([e.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=[],a=0;for(;;){if(!s[a]||s[a][0]===e.EOF)return r.length&&i.push(r),i;if(s[a][0]===e.Comma){i.push(r),r=[],a++;continue}const t=consumeComponentValue(o,n.slice(a));r.push(t.node),a+=t.advance}}function gatherNodeAncestry(e){const n=new Map;return e.walk((e=>{Array.isArray(e.node)?e.node.forEach((t=>{n.set(t,e.parent)})):n.set(e.node,e.parent)})),n}function isSimpleBlockNode(e){return SimpleBlockNode.isSimpleBlockNode(e)}function isFunctionNode(e){return FunctionNode.isFunctionNode(e)}function isWhitespaceNode(e){return WhitespaceNode.isWhitespaceNode(e)}function isCommentNode(e){return CommentNode.isCommentNode(e)}function isTokenNode(e){return TokenNode.isTokenNode(e)}function replaceComponentValues(e,n){for(let t=0;t{if("number"!=typeof t)return;const o=e.node,s=n(o);s&&e.parent.value.splice(t,1,s)}))}}return e}function stringify(e){return e.map((e=>e.map((e=>t(...e.tokens()))).join(""))).join(",")}function sourceIndices(e){if(Array.isArray(e)){const n=e[0];if(!n)return[0,0];const t=e[e.length-1]||n;return[sourceIndices(n)[0],sourceIndices(t)[1]]}const n=e.tokens(),t=n[0],o=n[n.length-1];return t&&o?[t[2],o[3]]:[0,0]}export{CommentNode,r as ComponentValueType,FunctionNode,SimpleBlockNode,TokenNode,WhitespaceNode,consumeAllCommentsAndWhitespace,consumeComment,consumeComponentValue,consumeFunction,consumeSimpleBlock,consumeWhitespace,gatherNodeAncestry,isCommentNode,isFunctionNode,isSimpleBlockNode,isTokenNode,isWhitespaceNode,parseCommaSeparatedListOfComponentValues,parseComponentValue,parseListOfComponentValues,replaceComponentValues,sourceIndices,stringify}; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/interfaces/context.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/interfaces/context.d.ts deleted file mode 100644 index dc246e000..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/interfaces/context.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ParseError } from '@csstools/css-tokenizer'; -export type Context = { - onParseError: (error: ParseError) => void; -}; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts deleted file mode 100644 index 67dff1d04..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -import { ComponentValue } from '../consume/consume-component-block-function'; -export declare function parseCommaSeparatedListOfComponentValues(tokens: Array, options?: { - onParseError?: (error: ParseError) => void; -}): ComponentValue[][]; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-component-value.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-component-value.d.ts deleted file mode 100644 index 2961290f9..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-component-value.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -export declare function parseComponentValue(tokens: Array, options?: { - onParseError?: (error: ParseError) => void; -}): import("../consume/consume-component-block-function").ComponentValue | undefined; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts deleted file mode 100644 index 737f554d2..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -import { ComponentValue } from '../consume/consume-component-block-function'; -export declare function parseListOfComponentValues(tokens: Array, options?: { - onParseError?: (error: ParseError) => void; -}): ComponentValue[]; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/component-value-type.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/component-value-type.d.ts deleted file mode 100644 index eda7ee93c..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/util/component-value-type.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare enum ComponentValueType { - Function = "function", - SimpleBlock = "simple-block", - Whitespace = "whitespace", - Comment = "comment", - Token = "token" -} diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/node-ancestry.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/node-ancestry.d.ts deleted file mode 100644 index 219ea6191..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/util/node-ancestry.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface walkable { - walk(cb: (entry: { - node: Array | unknown; - parent: unknown; - }, index: number | string) => boolean | void): false | undefined; -} -export declare function gatherNodeAncestry(node: walkable): Map; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/replace-component-values.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/replace-component-values.d.ts deleted file mode 100644 index 774051c6d..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/util/replace-component-values.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ComponentValue } from '../consume/consume-component-block-function'; -export declare function replaceComponentValues(componentValuesList: Array>, replaceWith: (componentValue: ComponentValue) => ComponentValue | void): ComponentValue[][]; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/source-indices.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/source-indices.d.ts deleted file mode 100644 index 92d124bef..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/util/source-indices.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -interface TokenConvertible { - tokens(): Array; -} -/** - * Returns the start and end index of a node in the CSS source string. - */ -export declare function sourceIndices(x: TokenConvertible | Array): [number, number]; -export {}; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/stringify.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/stringify.d.ts deleted file mode 100644 index 6ab4140cf..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/util/stringify.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ComponentValue } from '../consume/consume-component-block-function'; -export declare function stringify(componentValueLists: Array>): string; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/type-predicates.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/type-predicates.d.ts deleted file mode 100644 index 896d3036b..000000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/util/type-predicates.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CommentNode, FunctionNode, SimpleBlockNode, TokenNode, WhitespaceNode } from '../consume/consume-component-block-function'; -export declare function isSimpleBlockNode(x: unknown): x is SimpleBlockNode; -export declare function isFunctionNode(x: unknown): x is FunctionNode; -export declare function isWhitespaceNode(x: unknown): x is WhitespaceNode; -export declare function isCommentNode(x: unknown): x is CommentNode; -export declare function isTokenNode(x: unknown): x is TokenNode; diff --git a/node_modules/@csstools/css-parser-algorithms/package.json b/node_modules/@csstools/css-parser-algorithms/package.json deleted file mode 100644 index cde65d68c..000000000 --- a/node_modules/@csstools/css-parser-algorithms/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "@csstools/css-parser-algorithms", - "description": "Algorithms to help you parse CSS from an array of tokens.", - "version": "2.3.0", - "contributors": [ - { - "name": "Antonio Laguna", - "email": "antonio@laguna.es", - "url": "https://antonio.laguna.es" - }, - { - "name": "Romain Menke", - "email": "romainmenke@gmail.com" - } - ], - "license": "MIT", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": "^14 || ^16 || >=18" - }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" - } - }, - "files": [ - "CHANGELOG.md", - "LICENSE.md", - "README.md", - "dist" - ], - "peerDependencies": { - "@csstools/css-tokenizer": "^2.1.1" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "stryker": "stryker run --logLevel error", - "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node ./test/test.mjs" - }, - "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms#readme", - "repository": { - "type": "git", - "url": "https://github.com/csstools/postcss-plugins.git", - "directory": "packages/css-parser-algorithms" - }, - "bugs": "https://github.com/csstools/postcss-plugins/issues", - "keywords": [ - "css", - "parser" - ], - "volta": { - "extends": "../../package.json" - } -} diff --git a/node_modules/@csstools/css-tokenizer/CHANGELOG.md b/node_modules/@csstools/css-tokenizer/CHANGELOG.md deleted file mode 100644 index cb50e589d..000000000 --- a/node_modules/@csstools/css-tokenizer/CHANGELOG.md +++ /dev/null @@ -1,28 +0,0 @@ -# Changes to CSS Tokenizer - -### 2.1.1 (April 10, 2023) - -- Document `tokenize` helper function - -### 2.1.0 (February 21, 2023) - -- Add `tokenize` helper function - -### 2.0.2 (February 13, 2023) - -- Relax `isToken` to match artificial tokens that correctly follow the interface. - -### 2.0.1 (January 28, 2023) - -- Improve `types` declaration in `package.json` - -### 2.0.0 (January 19, 2023) - -- Simplify `Reader` interface (breaking) -- Change the `ParseError` interface, this is now a subclass of `Error` (breaking) -- Remove the `commentsAreTokens` option as `true` was the only desirable value (breaking) -- Improve performance - -### 1.0.0 (November 14, 2022) - -- Initial version diff --git a/node_modules/@csstools/css-tokenizer/LICENSE.md b/node_modules/@csstools/css-tokenizer/LICENSE.md deleted file mode 100644 index af5411fa2..000000000 --- a/node_modules/@csstools/css-tokenizer/LICENSE.md +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright 2022 Romain Menke, Antonio Laguna - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@csstools/css-tokenizer/README.md b/node_modules/@csstools/css-tokenizer/README.md deleted file mode 100644 index 810e47c8f..000000000 --- a/node_modules/@csstools/css-tokenizer/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# CSS Tokenizer - -[npm version][npm-url] -[Build Status][cli-url] -[Discord][discord] - -Implemented from : https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/ - -## Usage - -Add [CSS Tokenizer] to your project: - -```bash -npm install @csstools/css-tokenizer --save-dev -``` - -```js -import { tokenizer, TokenType } from '@csstools/css-tokenizer'; - -const myCSS = `@media only screen and (min-width: 768rem) { - .foo { - content: 'Some content!' !important; - } -} -`; - -const t = tokenizer({ - css: myCSS, -}); - -while (true) { - const token = t.nextToken(); - if (token[0] === TokenType.EOF) { - break; - } - - console.log(token); -} -``` - -Or use the `tokenize` helper function: - -```js -import { tokenize } from '@csstools/css-tokenizer'; - -const myCSS = `@media only screen and (min-width: 768rem) { - .foo { - content: 'Some content!' !important; - } -} -`; - -const tokens = tokenize({ - css: myCSS, -}); - -console.log(tokens); -``` - -### Options - -```ts -{ - onParseError?: (error: ParseError) => void -} -``` - -#### `onParseError` - -The tokenizer is forgiving and won't stop when a parse error is encountered. -Parse errors also aren't tokens. - -To receive parsing error information you can set a callback. - -```js -import { tokenizer, TokenType } from '@csstools/css-tokenizer'; - -const t = tokenizer({ - css: '\\', -}, { onParseError: (err) => console.warn(err) }); - -while (true) { - const token = t.nextToken(); - if (token[0] === TokenType.EOF) { - break; - } -} -``` - -Parser errors will try to inform you about the point in the tokenizer logic the error happened. -This tells you the kind of error. - -## Goals and non-goals - -Things this package aims to be: -- specification compliant CSS tokenizer -- a reliable low level package to be used in CSS parsers - -What it is not: -- opinionated -- fast -- small - -[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test -[discord]: https://discord.gg/bUadyRwkJS -[npm-url]: https://www.npmjs.com/package/@csstools/css-tokenizer - -[CSS Tokenizer]: https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts deleted file mode 100644 index 2a59b358f..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function checkIfFourCodePointsWouldStartCDO(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/matches-url-ident.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/matches-url-ident.d.ts deleted file mode 100644 index aabf7e866..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/matches-url-ident.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Context } from '../interfaces/context'; -export declare function checkIfCodePointsMatchURLIdent(ctx: Context, codePoints: Array): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts deleted file mode 100644 index 1262da304..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function checkIfThreeCodePointsWouldStartCDC(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts deleted file mode 100644 index d48323bb9..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function checkIfThreeCodePointsWouldStartAnIdentSequence(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts deleted file mode 100644 index d6eff77d5..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function checkIfThreeCodePointsWouldStartANumber(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts deleted file mode 100644 index d42102ba2..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function checkIfTwoCodePointsAreAValidEscape(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts deleted file mode 100644 index 42d390177..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function checkIfTwoCodePointsStartAComment(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/code-points/code-points.d.ts b/node_modules/@csstools/css-tokenizer/dist/code-points/code-points.d.ts deleted file mode 100644 index c920f6193..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/code-points/code-points.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** ' */ -export declare const APOSTROPHE = 39; -/** * */ -export declare const ASTERISK = 42; -/** \b */ -export declare const BACKSPACE = 8; -/** \r */ -export declare const CARRIAGE_RETURN = 13; -/** \t */ -export declare const CHARACTER_TABULATION = 9; -/** : */ -export declare const COLON = 58; -/** , */ -export declare const COMMA = 44; -/** @ */ -export declare const COMMERCIAL_AT = 64; -/** \x7F */ -export declare const DELETE = 127; -/** ! */ -export declare const EXCLAMATION_MARK = 33; -/** \f */ -export declare const FORM_FEED = 12; -/** . */ -export declare const FULL_STOP = 46; -/** > */ -export declare const GREATER_THAN_SIGN = 62; -/** - */ -export declare const HYPHEN_MINUS = 45; -/** \x1F */ -export declare const INFORMATION_SEPARATOR_ONE = 31; -/** E */ -export declare const LATIN_CAPITAL_LETTER_E = 69; -/** e */ -export declare const LATIN_SMALL_LETTER_E = 101; -/** { */ -export declare const LEFT_CURLY_BRACKET = 123; -/** ( */ -export declare const LEFT_PARENTHESIS = 40; -/** [ */ -export declare const LEFT_SQUARE_BRACKET = 91; -/** < */ -export declare const LESS_THAN_SIGN = 60; -/** \n */ -export declare const LINE_FEED = 10; -/** \v */ -export declare const LINE_TABULATION = 11; -/** _ */ -export declare const LOW_LINE = 95; -/** \x10FFFF */ -export declare const MAXIMUM_ALLOWED_CODEPOINT = 1114111; -/** \x00 */ -export declare const NULL = 0; -/** # */ -export declare const NUMBER_SIGN = 35; -/** % */ -export declare const PERCENTAGE_SIGN = 37; -/** + */ -export declare const PLUS_SIGN = 43; -/** " */ -export declare const QUOTATION_MARK = 34; -/** � */ -export declare const REPLACEMENT_CHARACTER = 65533; -/** \ */ -export declare const REVERSE_SOLIDUS = 92; -/** } */ -export declare const RIGHT_CURLY_BRACKET = 125; -/** ) */ -export declare const RIGHT_PARENTHESIS = 41; -/** ] */ -export declare const RIGHT_SQUARE_BRACKET = 93; -/** ; */ -export declare const SEMICOLON = 59; -/** \u0E */ -export declare const SHIFT_OUT = 14; -/** / */ -export declare const SOLIDUS = 47; -/** \u20 */ -export declare const SPACE = 32; diff --git a/node_modules/@csstools/css-tokenizer/dist/code-points/ranges.d.ts b/node_modules/@csstools/css-tokenizer/dist/code-points/ranges.d.ts deleted file mode 100644 index ecfbb9239..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/code-points/ranges.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export declare function isDigitCodePoint(search: number): boolean; -export declare function isUppercaseLetterCodePoint(search: number): boolean; -export declare function isLowercaseLetterCodePoint(search: number): boolean; -export declare function isHexDigitCodePoint(search: number): boolean; -export declare function isLetterCodePoint(search: number): boolean; -export declare function isNonASCIICodePoint(search: number): boolean; -export declare function isIdentStartCodePoint(search: number): boolean; -export declare function isIdentCodePoint(search: number): boolean; -export declare function isNonPrintableCodePoint(search: number): boolean; -export declare function isNewLine(search: number): boolean; -export declare function isWhitespace(search: number): boolean; -export declare function isSurrogate(search: number): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/bad-url.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/bad-url.d.ts deleted file mode 100644 index 4b18d0e8d..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/bad-url.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function consumeBadURL(ctx: Context, reader: CodePointReader): void; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/comment.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/comment.d.ts deleted file mode 100644 index d4ba2211d..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/comment.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenComment } from '../interfaces/token'; -export declare function consumeComment(ctx: Context, reader: CodePointReader): TokenComment; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/escaped-code-point.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/escaped-code-point.d.ts deleted file mode 100644 index a6f8dc2e6..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/escaped-code-point.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function consumeEscapedCodePoint(ctx: Context, reader: CodePointReader): number; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/hash-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/hash-token.d.ts deleted file mode 100644 index ac061a84c..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/hash-token.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenDelim, TokenHash } from '../interfaces/token'; -export declare function consumeHashToken(ctx: Context, reader: CodePointReader): TokenDelim | TokenHash; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/ident-like-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/ident-like-token.d.ts deleted file mode 100644 index 6be737627..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/ident-like-token.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenBadURL, TokenFunction, TokenIdent, TokenURL } from '../interfaces/token'; -export declare function consumeIdentLikeToken(ctx: Context, reader: CodePointReader): TokenIdent | TokenFunction | TokenURL | TokenBadURL; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/ident-sequence.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/ident-sequence.d.ts deleted file mode 100644 index 992520e2d..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/ident-sequence.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function consumeIdentSequence(ctx: Context, reader: CodePointReader): Array; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/number.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/number.d.ts deleted file mode 100644 index 18f1704f3..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/number.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { NumberType } from '../interfaces/token'; -export declare function consumeNumber(ctx: Context, reader: CodePointReader): NumberType; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/numeric-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/numeric-token.d.ts deleted file mode 100644 index 1217bb0aa..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/numeric-token.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenDimension, TokenNumber, TokenPercentage } from '../interfaces/token'; -export declare function consumeNumericToken(ctx: Context, reader: CodePointReader): TokenPercentage | TokenNumber | TokenDimension; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/string-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/string-token.d.ts deleted file mode 100644 index 31f6448f7..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/string-token.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenBadString, TokenString } from '../interfaces/token'; -export declare function consumeStringToken(ctx: Context, reader: CodePointReader): TokenBadString | TokenString; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/url-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/url-token.d.ts deleted file mode 100644 index 9140be704..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/url-token.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenBadURL, TokenURL } from '../interfaces/token'; -export declare function consumeUrlToken(ctx: Context, reader: CodePointReader): TokenURL | TokenBadURL; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/whitespace-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/whitespace-token.d.ts deleted file mode 100644 index 86585f70d..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/whitespace-token.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenWhitespace } from '../interfaces/token'; -export declare function consumeWhiteSpace(ctx: Context, reader: CodePointReader): TokenWhitespace; diff --git a/node_modules/@csstools/css-tokenizer/dist/index.cjs b/node_modules/@csstools/css-tokenizer/dist/index.cjs deleted file mode 100644 index a7821a398..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/index.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,o,r,n){super(e),this.name="ParseError",this.sourceStart=o,this.sourceEnd=r,this.parserState=n}}class Reader{cursor;source="";codePointSource=[];length=0;representationStart=0;representationEnd=-1;constructor(e){this.cursor=0,this.source=e,this.length=e.length,this.codePointSource=new Array(this.length);for(let e=0;e=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isNonASCIICodePoint(e){return e>=128}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCIICodePoint(e)||e===O}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===k}function isNewLine(e){return 10===e||13===e||12===e}function isWhitespace(e){return 32===e||10===e||9===e||13===e||12===e}function checkIfTwoCodePointsAreAValidEscape(e,o){return o.codePointSource[o.cursor]===R&&!isNewLine(o.codePointSource[o.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,o){return o.codePointSource[o.cursor]===k?o.codePointSource[o.cursor+1]===k||(!!isIdentStartCodePoint(o.codePointSource[o.cursor+1])||o.codePointSource[o.cursor+1]===R&&!isNewLine(o.codePointSource[o.cursor+2])):!!isIdentStartCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(0,o)}function checkIfThreeCodePointsWouldStartANumber(e,o){return o.codePointSource[o.cursor]===L||o.codePointSource[o.cursor]===k?!!isDigitCodePoint(o.codePointSource[o.cursor+1])||o.codePointSource[o.cursor+1]===T&&isDigitCodePoint(o.codePointSource[o.cursor+2]):o.codePointSource[o.cursor]===T?isDigitCodePoint(o.codePointSource[o.cursor+1]):isDigitCodePoint(o.codePointSource[o.cursor])}function checkIfTwoCodePointsStartAComment(e,o){return o.codePointSource[o.cursor]===H&&o.codePointSource[o.cursor+1]===i}function checkIfThreeCodePointsWouldStartCDC(e,o){return o.codePointSource[o.cursor]===k&&o.codePointSource[o.cursor+1]===k&&o.codePointSource[o.cursor+2]===l}function consumeComment(e,o){for(o.advanceCodePoint(2);;){const r=o.readCodePoint();if(!1===r){e.onParseError(new ParseError("Unexpected EOF while consuming a comment.",o.representationStart,o.representationEnd,["4.3.2. Consume comments","Unexpected EOF"]));break}if(r===i&&(void 0!==o.codePointSource[o.cursor]&&o.codePointSource[o.cursor]===H)){o.advanceCodePoint();break}}return[exports.TokenType.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeEscapedCodePoint(e,o){const r=o.readCodePoint();if(!1===r)return e.onParseError(new ParseError("Unexpected EOF while consuming an escaped code point.",o.representationStart,o.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),b;if(isHexDigitCodePoint(r)){const e=[r];for(;void 0!==o.codePointSource[o.cursor]&&isHexDigitCodePoint(o.codePointSource[o.cursor])&&e.length<6;)e.push(o.codePointSource[o.cursor]),o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor])&&o.advanceCodePoint();const t=parseInt(String.fromCharCode(...e),16);return 0===t?b:(n=t)>=55296&&n<=57343||t>w?b:t}var n;return r}function consumeIdentSequence(e,o){const r=[];for(;;)if(isIdentCodePoint(o.codePointSource[o.cursor]))r.push(o.codePointSource[o.cursor]),o.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(0,o))return r;o.advanceCodePoint(),r.push(consumeEscapedCodePoint(e,o))}}function consumeHashToken(e,o){if(o.advanceCodePoint(),void 0!==o.codePointSource[o.cursor]&&(isIdentCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(0,o))){let n=r.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)&&(n=r.ID);const t=consumeIdentSequence(e,o);return[exports.TokenType.Hash,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCharCode(...t),type:n}]}return[exports.TokenType.Delim,"#",o.representationStart,o.representationEnd,{value:"#"}]}function consumeNumber(e,o){let r=exports.NumberType.Integer;for(o.codePointSource[o.cursor]!==L&&o.codePointSource[o.cursor]!==k||o.advanceCodePoint();isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===T&&isDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint(2),r=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===E||o.codePointSource[o.cursor]===m){if(isDigitCodePoint(o.codePointSource[o.cursor+1]))o.advanceCodePoint(2);else{if(o.codePointSource[o.cursor+1]!==k&&o.codePointSource[o.cursor+1]!==L||!isDigitCodePoint(o.codePointSource[o.cursor+2]))return r;o.advanceCodePoint(3)}for(r=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint()}return r}function consumeNumericToken(e,o){const r=consumeNumber(0,o),n=parseFloat(o.source.slice(o.representationStart,o.representationEnd+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)){const t=consumeIdentSequence(e,o);return[exports.TokenType.Dimension,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n,type:r,unit:String.fromCharCode(...t)}]}return o.codePointSource[o.cursor]===D?(o.advanceCodePoint(),[exports.TokenType.Percentage,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}]):[exports.TokenType.Number,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n,type:r}]}function consumeWhiteSpace(e,o){for(;isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();return[exports.TokenType.Whitespace,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeStringToken(e,o){let r="";const n=o.readCodePoint();for(;;){const t=o.readCodePoint();if(!1===t)return e.onParseError(new ParseError("Unexpected EOF while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"])),[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(isNewLine(t))return e.onParseError(new ParseError("Unexpected newline while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected newline"])),o.unreadCodePoint(),[exports.TokenType.BadString,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(t===n)return[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(t!==R)r+=String.fromCharCode(t);else{if(void 0===o.codePointSource[o.cursor])continue;if(isNewLine(o.codePointSource[o.cursor])){o.advanceCodePoint();continue}r+=String.fromCharCode(consumeEscapedCodePoint(e,o))}}}const K="u".charCodeAt(0),M="U".charCodeAt(0),$="r".charCodeAt(0),J="R".charCodeAt(0),j="l".charCodeAt(0),Q="L".charCodeAt(0);function checkIfCodePointsMatchURLIdent(e,o){return 3===o.length&&((o[0]===K||o[0]===M)&&((o[1]===$||o[1]===J)&&(o[2]===j||o[2]===Q)))}function consumeBadURL(e,o){for(;;){if(void 0===o.codePointSource[o.cursor])return;if(o.codePointSource[o.cursor]===W)return void o.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(0,o)?(o.advanceCodePoint(),consumeEscapedCodePoint(e,o)):o.advanceCodePoint()}}function consumeUrlToken(e,o){consumeWhiteSpace(0,o);let r="";for(;;){if(void 0===o.codePointSource[o.cursor])return e.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"])),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(o.codePointSource[o.cursor]===W)return o.advanceCodePoint(),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(isWhitespace(o.codePointSource[o.cursor]))return consumeWhiteSpace(0,o),void 0===o.codePointSource[o.cursor]?(e.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"])),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}]):o.codePointSource[o.cursor]===W?(o.advanceCodePoint(),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}]):(consumeBadURL(e,o),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]);if(o.codePointSource[o.cursor]===N||o.codePointSource[o.cursor]===t||o.codePointSource[o.cursor]===v||((n=o.codePointSource[o.cursor])===I||n===S||A<=n&&n<=s||B<=n&&n<=f))return consumeBadURL(e,o),e.onParseError(new ParseError("Unexpected character while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"])),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(o.codePointSource[o.cursor]===R){if(checkIfTwoCodePointsAreAValidEscape(0,o)){o.advanceCodePoint(),r+=String.fromCharCode(consumeEscapedCodePoint(e,o));continue}return consumeBadURL(e,o),e.onParseError(new ParseError("Invalid escape sequence while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}r+=String.fromCharCode(o.codePointSource[o.cursor]),o.advanceCodePoint()}var n}function consumeIdentLikeToken(e,o){const r=consumeIdentSequence(e,o);if(o.codePointSource[o.cursor]!==v)return[exports.TokenType.Ident,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCharCode(...r)}];if(checkIfCodePointsMatchURLIdent(0,r)){o.advanceCodePoint();let n=0;for(;;){const e=isWhitespace(o.codePointSource[o.cursor]),i=isWhitespace(o.codePointSource[o.cursor+1]);if(e&&i){n+=1,o.advanceCodePoint(1);continue}const s=e?o.codePointSource[o.cursor+1]:o.codePointSource[o.cursor];if(s===N||s===t)return n>0&&o.unreadCodePoint(n),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCharCode(...r)}];break}return consumeUrlToken(e,o)}return o.advanceCodePoint(),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCharCode(...r)}]}function tokenizer(e,o){const r=e.css.valueOf(),n=new Reader(r),i={onParseError:(null==o?void 0:o.onParseError)??(()=>{})};return{nextToken:function nextToken(){if(n.representationStart=n.cursor,n.representationEnd=-1,checkIfTwoCodePointsStartAComment(0,n))return consumeComment(i,n);const e=n.codePointSource[n.cursor];if(void 0===e)return[exports.TokenType.EOF,"",-1,-1,void 0];if(isIdentStartCodePoint(e))return consumeIdentLikeToken(i,n);if(isDigitCodePoint(e))return consumeNumericToken(i,n);switch(e){case d:return n.advanceCodePoint(),[exports.TokenType.Comma,",",n.representationStart,n.representationEnd,void 0];case u:return n.advanceCodePoint(),[exports.TokenType.Colon,":",n.representationStart,n.representationEnd,void 0];case V:return n.advanceCodePoint(),[exports.TokenType.Semicolon,";",n.representationStart,n.representationEnd,void 0];case v:return n.advanceCodePoint(),[exports.TokenType.OpenParen,"(",n.representationStart,n.representationEnd,void 0];case W:return n.advanceCodePoint(),[exports.TokenType.CloseParen,")",n.representationStart,n.representationEnd,void 0];case x:return n.advanceCodePoint(),[exports.TokenType.OpenSquare,"[",n.representationStart,n.representationEnd,void 0];case F:return n.advanceCodePoint(),[exports.TokenType.CloseSquare,"]",n.representationStart,n.representationEnd,void 0];case h:return n.advanceCodePoint(),[exports.TokenType.OpenCurly,"{",n.representationStart,n.representationEnd,void 0];case q:return n.advanceCodePoint(),[exports.TokenType.CloseCurly,"}",n.representationStart,n.representationEnd,void 0];case t:case N:return consumeStringToken(i,n);case U:return consumeHashToken(i,n);case L:case T:return checkIfThreeCodePointsWouldStartANumber(0,n)?consumeNumericToken(i,n):(n.advanceCodePoint(),[exports.TokenType.Delim,n.source[n.representationStart],n.representationStart,n.representationEnd,{value:n.source[n.representationStart]}]);case g:case c:case C:case a:case z:return consumeWhiteSpace(0,n);case k:return checkIfThreeCodePointsWouldStartANumber(0,n)?consumeNumericToken(i,n):checkIfThreeCodePointsWouldStartCDC(0,n)?(n.advanceCodePoint(3),[exports.TokenType.CDC,"--\x3e",n.representationStart,n.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)?consumeIdentLikeToken(i,n):(n.advanceCodePoint(),[exports.TokenType.Delim,"-",n.representationStart,n.representationEnd,{value:"-"}]);case y:return checkIfFourCodePointsWouldStartCDO(0,n)?(n.advanceCodePoint(4),[exports.TokenType.CDO,"\x3c!--",n.representationStart,n.representationEnd,void 0]):(n.advanceCodePoint(),[exports.TokenType.Delim,"<",n.representationStart,n.representationEnd,{value:"<"}]);case p:if(n.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,n)){const e=consumeIdentSequence(i,n);return[exports.TokenType.AtKeyword,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,{value:String.fromCharCode(...e)}]}return[exports.TokenType.Delim,"@",n.representationStart,n.representationEnd,{value:"@"}];case R:return checkIfTwoCodePointsAreAValidEscape(0,n)?consumeIdentLikeToken(i,n):(n.advanceCodePoint(),i.onParseError(new ParseError('Invalid escape sequence after "\\"',n.representationStart,n.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[exports.TokenType.Delim,"\\",n.representationStart,n.representationEnd,{value:"\\"}])}return n.advanceCodePoint(),[exports.TokenType.Delim,n.source[n.representationStart],n.representationStart,n.representationEnd,{value:n.source[n.representationStart]}]},endOfFile:function endOfFile(){return void 0===n.codePointSource[n.cursor]}}}exports.ParseError=ParseError,exports.Reader=Reader,exports.cloneTokens=function cloneTokens(e){return"undefined"!=typeof globalThis&&"structuredClone"in globalThis?structuredClone(e):JSON.parse(JSON.stringify(e))},exports.isToken=function isToken(e){return!!Array.isArray(e)&&(!(e.length<4)&&(!!n.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))},exports.mirrorVariant=function mirrorVariant(e){switch(e[0]){case exports.TokenType.OpenParen:return[exports.TokenType.CloseParen,")",-1,-1,void 0];case exports.TokenType.CloseParen:return[exports.TokenType.OpenParen,"(",-1,-1,void 0];case exports.TokenType.OpenCurly:return[exports.TokenType.CloseCurly,"}",-1,-1,void 0];case exports.TokenType.CloseCurly:return[exports.TokenType.OpenCurly,"{",-1,-1,void 0];case exports.TokenType.OpenSquare:return[exports.TokenType.CloseSquare,"]",-1,-1,void 0];case exports.TokenType.CloseSquare:return[exports.TokenType.OpenSquare,"[",-1,-1,void 0];default:return null}},exports.mirrorVariantType=function mirrorVariantType(e){switch(e){case exports.TokenType.OpenParen:return exports.TokenType.CloseParen;case exports.TokenType.CloseParen:return exports.TokenType.OpenParen;case exports.TokenType.OpenCurly:return exports.TokenType.CloseCurly;case exports.TokenType.CloseCurly:return exports.TokenType.OpenCurly;case exports.TokenType.OpenSquare:return exports.TokenType.CloseSquare;case exports.TokenType.CloseSquare:return exports.TokenType.OpenSquare;default:return null}},exports.mutateIdent=function mutateIdent(e,o){let r="";const n=new Array(o.length);for(let e=0;e=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isNonASCIICodePoint(e){return e>=128}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCIICodePoint(e)||e===A}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===E}function isNewLine(e){return 10===e||13===e||12===e}function isWhitespace(e){return 32===e||10===e||9===e||13===e||12===e}function checkIfTwoCodePointsAreAValidEscape(e,n){return n.codePointSource[n.cursor]===N&&!isNewLine(n.codePointSource[n.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,n){return n.codePointSource[n.cursor]===E?n.codePointSource[n.cursor+1]===E||(!!isIdentStartCodePoint(n.codePointSource[n.cursor+1])||n.codePointSource[n.cursor+1]===N&&!isNewLine(n.codePointSource[n.cursor+2])):!!isIdentStartCodePoint(n.codePointSource[n.cursor])||checkIfTwoCodePointsAreAValidEscape(0,n)}function checkIfThreeCodePointsWouldStartANumber(e,n){return n.codePointSource[n.cursor]===q||n.codePointSource[n.cursor]===E?!!isDigitCodePoint(n.codePointSource[n.cursor+1])||n.codePointSource[n.cursor+1]===l&&isDigitCodePoint(n.codePointSource[n.cursor+2]):n.codePointSource[n.cursor]===l?isDigitCodePoint(n.codePointSource[n.cursor+1]):isDigitCodePoint(n.codePointSource[n.cursor])}function checkIfTwoCodePointsStartAComment(e,n){return n.codePointSource[n.cursor]===H&&n.codePointSource[n.cursor+1]===i}function checkIfThreeCodePointsWouldStartCDC(e,n){return n.codePointSource[n.cursor]===E&&n.codePointSource[n.cursor+1]===E&&n.codePointSource[n.cursor+2]===f}function consumeComment(n,r){for(r.advanceCodePoint(2);;){const e=r.readCodePoint();if(!1===e){n.onParseError(new ParseError("Unexpected EOF while consuming a comment.",r.representationStart,r.representationEnd,["4.3.2. Consume comments","Unexpected EOF"]));break}if(e===i&&(void 0!==r.codePointSource[r.cursor]&&r.codePointSource[r.cursor]===H)){r.advanceCodePoint();break}}return[e.Comment,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0]}function consumeEscapedCodePoint(e,n){const r=n.readCodePoint();if(!1===r)return e.onParseError(new ParseError("Unexpected EOF while consuming an escaped code point.",n.representationStart,n.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),x;if(isHexDigitCodePoint(r)){const e=[r];for(;void 0!==n.codePointSource[n.cursor]&&isHexDigitCodePoint(n.codePointSource[n.cursor])&&e.length<6;)e.push(n.codePointSource[n.cursor]),n.advanceCodePoint();isWhitespace(n.codePointSource[n.cursor])&&n.advanceCodePoint();const o=parseInt(String.fromCharCode(...e),16);return 0===o?x:(t=o)>=55296&&t<=57343||o>U?x:o}var t;return r}function consumeIdentSequence(e,n){const r=[];for(;;)if(isIdentCodePoint(n.codePointSource[n.cursor]))r.push(n.codePointSource[n.cursor]),n.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(0,n))return r;n.advanceCodePoint(),r.push(consumeEscapedCodePoint(e,n))}}function consumeHashToken(n,t){if(t.advanceCodePoint(),void 0!==t.codePointSource[t.cursor]&&(isIdentCodePoint(t.codePointSource[t.cursor])||checkIfTwoCodePointsAreAValidEscape(0,t))){let o=r.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,t)&&(o=r.ID);const i=consumeIdentSequence(n,t);return[e.Hash,t.source.slice(t.representationStart,t.representationEnd+1),t.representationStart,t.representationEnd,{value:String.fromCharCode(...i),type:o}]}return[e.Delim,"#",t.representationStart,t.representationEnd,{value:"#"}]}function consumeNumber(e,r){let t=n.Integer;for(r.codePointSource[r.cursor]!==q&&r.codePointSource[r.cursor]!==E||r.advanceCodePoint();isDigitCodePoint(r.codePointSource[r.cursor]);)r.advanceCodePoint();if(r.codePointSource[r.cursor]===l&&isDigitCodePoint(r.codePointSource[r.cursor+1]))for(r.advanceCodePoint(2),t=n.Number;isDigitCodePoint(r.codePointSource[r.cursor]);)r.advanceCodePoint();if(r.codePointSource[r.cursor]===v||r.codePointSource[r.cursor]===m){if(isDigitCodePoint(r.codePointSource[r.cursor+1]))r.advanceCodePoint(2);else{if(r.codePointSource[r.cursor+1]!==E&&r.codePointSource[r.cursor+1]!==q||!isDigitCodePoint(r.codePointSource[r.cursor+2]))return t;r.advanceCodePoint(3)}for(t=n.Number;isDigitCodePoint(r.codePointSource[r.cursor]);)r.advanceCodePoint()}return t}function consumeNumericToken(n,r){const t=consumeNumber(0,r),o=parseFloat(r.source.slice(r.representationStart,r.representationEnd+1));if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,r)){const i=consumeIdentSequence(n,r);return[e.Dimension,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:o,type:t,unit:String.fromCharCode(...i)}]}return r.codePointSource[r.cursor]===y?(r.advanceCodePoint(),[e.Percentage,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:o}]):[e.Number,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:o,type:t}]}function consumeWhiteSpace(n,r){for(;isWhitespace(r.codePointSource[r.cursor]);)r.advanceCodePoint();return[e.Whitespace,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0]}function consumeStringToken(n,r){let t="";const o=r.readCodePoint();for(;;){const i=r.readCodePoint();if(!1===i)return n.onParseError(new ParseError("Unexpected EOF while consuming a string token.",r.representationStart,r.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"])),[e.String,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}];if(isNewLine(i))return n.onParseError(new ParseError("Unexpected newline while consuming a string token.",r.representationStart,r.representationEnd,["4.3.5. Consume a string token","Unexpected newline"])),r.unreadCodePoint(),[e.BadString,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0];if(i===o)return[e.String,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}];if(i!==N)t+=String.fromCharCode(i);else{if(void 0===r.codePointSource[r.cursor])continue;if(isNewLine(r.codePointSource[r.cursor])){r.advanceCodePoint();continue}t+=String.fromCharCode(consumeEscapedCodePoint(n,r))}}}const K="u".charCodeAt(0),M="U".charCodeAt(0),$="r".charCodeAt(0),J="R".charCodeAt(0),j="l".charCodeAt(0),Q="L".charCodeAt(0);function checkIfCodePointsMatchURLIdent(e,n){return 3===n.length&&((n[0]===K||n[0]===M)&&((n[1]===$||n[1]===J)&&(n[2]===j||n[2]===Q)))}function consumeBadURL(e,n){for(;;){if(void 0===n.codePointSource[n.cursor])return;if(n.codePointSource[n.cursor]===W)return void n.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(0,n)?(n.advanceCodePoint(),consumeEscapedCodePoint(e,n)):n.advanceCodePoint()}}function consumeUrlToken(n,r){consumeWhiteSpace(0,r);let t="";for(;;){if(void 0===r.codePointSource[r.cursor])return n.onParseError(new ParseError("Unexpected EOF while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"])),[e.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}];if(r.codePointSource[r.cursor]===W)return r.advanceCodePoint(),[e.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}];if(isWhitespace(r.codePointSource[r.cursor]))return consumeWhiteSpace(0,r),void 0===r.codePointSource[r.cursor]?(n.onParseError(new ParseError("Unexpected EOF while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"])),[e.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}]):r.codePointSource[r.cursor]===W?(r.advanceCodePoint(),[e.URL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:t}]):(consumeBadURL(n,r),[e.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0]);if(r.codePointSource[r.cursor]===R||r.codePointSource[r.cursor]===o||r.codePointSource[r.cursor]===g||((i=r.codePointSource[r.cursor])===w||i===S||D<=i&&i<=c||B<=i&&i<=h))return consumeBadURL(n,r),n.onParseError(new ParseError("Unexpected character while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"])),[e.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0];if(r.codePointSource[r.cursor]===N){if(checkIfTwoCodePointsAreAValidEscape(0,r)){r.advanceCodePoint(),t+=String.fromCharCode(consumeEscapedCodePoint(n,r));continue}return consumeBadURL(n,r),n.onParseError(new ParseError("Invalid escape sequence while consuming a url token.",r.representationStart,r.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[e.BadURL,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,void 0]}t+=String.fromCharCode(r.codePointSource[r.cursor]),r.advanceCodePoint()}var i}function consumeIdentLikeToken(n,r){const t=consumeIdentSequence(n,r);if(r.codePointSource[r.cursor]!==g)return[e.Ident,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:String.fromCharCode(...t)}];if(checkIfCodePointsMatchURLIdent(0,t)){r.advanceCodePoint();let i=0;for(;;){const n=isWhitespace(r.codePointSource[r.cursor]),c=isWhitespace(r.codePointSource[r.cursor+1]);if(n&&c){i+=1,r.advanceCodePoint(1);continue}const s=n?r.codePointSource[r.cursor+1]:r.codePointSource[r.cursor];if(s===R||s===o)return i>0&&r.unreadCodePoint(i),[e.Function,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:String.fromCharCode(...t)}];break}return consumeUrlToken(n,r)}return r.advanceCodePoint(),[e.Function,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:String.fromCharCode(...t)}]}function tokenize(e,n){const r=tokenizer(e,n),t=[];{for(;!r.endOfFile();){const e=r.nextToken();e&&t.push(e)}const e=r.nextToken();e&&t.push(e)}return t}function tokenizer(n,r){const t=n.css.valueOf(),i=new Reader(t),c={onParseError:(null==r?void 0:r.onParseError)??(()=>{})};return{nextToken:function nextToken(){if(i.representationStart=i.cursor,i.representationEnd=-1,checkIfTwoCodePointsStartAComment(0,i))return consumeComment(c,i);const n=i.codePointSource[i.cursor];if(void 0===n)return[e.EOF,"",-1,-1,void 0];if(isIdentStartCodePoint(n))return consumeIdentLikeToken(c,i);if(isDigitCodePoint(n))return consumeNumericToken(c,i);switch(n){case d:return i.advanceCodePoint(),[e.Comma,",",i.representationStart,i.representationEnd,void 0];case u:return i.advanceCodePoint(),[e.Colon,":",i.representationStart,i.representationEnd,void 0];case V:return i.advanceCodePoint(),[e.Semicolon,";",i.representationStart,i.representationEnd,void 0];case g:return i.advanceCodePoint(),[e.OpenParen,"(",i.representationStart,i.representationEnd,void 0];case W:return i.advanceCodePoint(),[e.CloseParen,")",i.representationStart,i.representationEnd,void 0];case I:return i.advanceCodePoint(),[e.OpenSquare,"[",i.representationStart,i.representationEnd,void 0];case F:return i.advanceCodePoint(),[e.CloseSquare,"]",i.representationStart,i.representationEnd,void 0];case k:return i.advanceCodePoint(),[e.OpenCurly,"{",i.representationStart,i.representationEnd,void 0];case b:return i.advanceCodePoint(),[e.CloseCurly,"}",i.representationStart,i.representationEnd,void 0];case o:case R:return consumeStringToken(c,i);case L:return consumeHashToken(c,i);case q:case l:return checkIfThreeCodePointsWouldStartANumber(0,i)?consumeNumericToken(c,i):(i.advanceCodePoint(),[e.Delim,i.source[i.representationStart],i.representationStart,i.representationEnd,{value:i.source[i.representationStart]}]);case O:case s:case C:case a:case z:return consumeWhiteSpace(0,i);case E:return checkIfThreeCodePointsWouldStartANumber(0,i)?consumeNumericToken(c,i):checkIfThreeCodePointsWouldStartCDC(0,i)?(i.advanceCodePoint(3),[e.CDC,"--\x3e",i.representationStart,i.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,i)?consumeIdentLikeToken(c,i):(i.advanceCodePoint(),[e.Delim,"-",i.representationStart,i.representationEnd,{value:"-"}]);case T:return checkIfFourCodePointsWouldStartCDO(0,i)?(i.advanceCodePoint(4),[e.CDO,"\x3c!--",i.representationStart,i.representationEnd,void 0]):(i.advanceCodePoint(),[e.Delim,"<",i.representationStart,i.representationEnd,{value:"<"}]);case p:if(i.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,i)){const n=consumeIdentSequence(c,i);return[e.AtKeyword,i.source.slice(i.representationStart,i.representationEnd+1),i.representationStart,i.representationEnd,{value:String.fromCharCode(...n)}]}return[e.Delim,"@",i.representationStart,i.representationEnd,{value:"@"}];case N:return checkIfTwoCodePointsAreAValidEscape(0,i)?consumeIdentLikeToken(c,i):(i.advanceCodePoint(),c.onParseError(new ParseError('Invalid escape sequence after "\\"',i.representationStart,i.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[e.Delim,"\\",i.representationStart,i.representationEnd,{value:"\\"}])}return i.advanceCodePoint(),[e.Delim,i.source[i.representationStart],i.representationStart,i.representationEnd,{value:i.source[i.representationStart]}]},endOfFile:function endOfFile(){return void 0===i.codePointSource[i.cursor]}}}function cloneTokens(e){return"undefined"!=typeof globalThis&&"structuredClone"in globalThis?structuredClone(e):JSON.parse(JSON.stringify(e))}function mutateIdent(e,n){let r="";const t=new Array(n.length);for(let e=0;e; - source: string; - advanceCodePoint(n?: number): void; - readCodePoint(n?: number): number | false; - unreadCodePoint(n?: number): void; -}; diff --git a/node_modules/@csstools/css-tokenizer/dist/interfaces/context.d.ts b/node_modules/@csstools/css-tokenizer/dist/interfaces/context.d.ts deleted file mode 100644 index 339bfe4e4..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/interfaces/context.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ParseError } from './error'; -export type Context = { - onParseError: (error: ParseError) => void; -}; diff --git a/node_modules/@csstools/css-tokenizer/dist/interfaces/error.d.ts b/node_modules/@csstools/css-tokenizer/dist/interfaces/error.d.ts deleted file mode 100644 index dc47e1d69..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/interfaces/error.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare class ParseError extends Error { - /** The index of the start character of the current token. */ - sourceStart: number; - /** The index of the end character of the current token. */ - sourceEnd: number; - /** The parser steps that preceded the error. */ - parserState: Array; - constructor(message: string, sourceStart: number, sourceEnd: number, parserState: Array); -} diff --git a/node_modules/@csstools/css-tokenizer/dist/interfaces/token.d.ts b/node_modules/@csstools/css-tokenizer/dist/interfaces/token.d.ts deleted file mode 100644 index ef353850b..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/interfaces/token.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -export declare enum TokenType { - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#comment-diagram */ - Comment = "comment", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-at-keyword-token */ - AtKeyword = "at-keyword-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-bad-string-token */ - BadString = "bad-string-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-bad-url-token */ - BadURL = "bad-url-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-cdc-token */ - CDC = "CDC-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-cdo-token */ - CDO = "CDO-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-colon-token */ - Colon = "colon-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-comma-token */ - Comma = "comma-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-delim-token */ - Delim = "delim-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-dimension-token */ - Dimension = "dimension-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-eof-token */ - EOF = "EOF-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-function-token */ - Function = "function-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-hash-token */ - Hash = "hash-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-ident-token */ - Ident = "ident-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-percentage-token */ - Number = "number-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-percentage-token */ - Percentage = "percentage-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-semicolon-token */ - Semicolon = "semicolon-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-string-token */ - String = "string-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-url-token */ - URL = "url-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-whitespace-token */ - Whitespace = "whitespace-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-paren */ - OpenParen = "(-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-paren */ - CloseParen = ")-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-square */ - OpenSquare = "[-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-square */ - CloseSquare = "]-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-curly */ - OpenCurly = "{-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-curly */ - CloseCurly = "}-token" -} -export declare enum NumberType { - Integer = "integer", - Number = "number" -} -export declare enum HashType { - Unrestricted = "unrestricted", - ID = "id" -} -export type TokenAtKeyword = Token; -export type TokenBadString = Token; -export type TokenBadURL = Token; -export type TokenCDC = Token; -export type TokenCDO = Token; -export type TokenColon = Token; -export type TokenComma = Token; -export type TokenComment = Token; -export type TokenDelim = Token; -export type TokenDimension = Token; -export type TokenEOF = Token; -export type TokenFunction = Token; -export type TokenHash = Token; -export type TokenIdent = Token; -export type TokenNumber = Token; -export type TokenPercentage = Token; -export type TokenSemicolon = Token; -export type TokenString = Token; -export type TokenURL = Token; -export type TokenWhitespace = Token; -export type TokenOpenParen = Token; -export type TokenCloseParen = Token; -export type TokenOpenSquare = Token; -export type TokenCloseSquare = Token; -export type TokenOpenCurly = Token; -export type TokenCloseCurly = Token; -export type CSSToken = TokenAtKeyword | TokenBadString | TokenBadURL | TokenCDC | TokenCDO | TokenColon | TokenComma | TokenComment | TokenDelim | TokenDimension | TokenEOF | TokenFunction | TokenHash | TokenIdent | TokenNumber | TokenPercentage | TokenSemicolon | TokenString | TokenURL | TokenWhitespace | TokenOpenParen | TokenCloseParen | TokenOpenSquare | TokenCloseSquare | TokenOpenCurly | TokenCloseCurly; -export type Token = [ - /** The type of token */ - T, - /** The token representation */ - string, - /** Start position of representation */ - number, - /** End position of representation */ - number, - /** Extra data */ - U -]; -export declare function mirrorVariantType(type: TokenType): TokenType | null; -export declare function mirrorVariant(token: CSSToken): CSSToken | null; -export declare function isToken(x: any): x is CSSToken; diff --git a/node_modules/@csstools/css-tokenizer/dist/reader.d.ts b/node_modules/@csstools/css-tokenizer/dist/reader.d.ts deleted file mode 100644 index 5a710ced0..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/reader.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { CodePointReader } from './interfaces/code-point-reader'; -export declare class Reader implements CodePointReader { - cursor: number; - source: string; - codePointSource: Array; - length: number; - representationStart: number; - representationEnd: number; - constructor(source: string); - advanceCodePoint(n?: number): void; - readCodePoint(n?: number): number | false; - unreadCodePoint(n?: number): void; -} diff --git a/node_modules/@csstools/css-tokenizer/dist/stringify.d.ts b/node_modules/@csstools/css-tokenizer/dist/stringify.d.ts deleted file mode 100644 index 574d2043e..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/stringify.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { CSSToken } from './interfaces/token'; -export declare function stringify(...tokens: Array): string; diff --git a/node_modules/@csstools/css-tokenizer/dist/tokenizer.d.ts b/node_modules/@csstools/css-tokenizer/dist/tokenizer.d.ts deleted file mode 100644 index aa7f02ee0..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/tokenizer.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CSSToken } from './interfaces/token'; -import { ParseError } from './interfaces/error'; -interface Stringer { - valueOf(): string; -} -export declare function tokenize(input: { - css: Stringer; -}, options?: { - onParseError?: (error: ParseError) => void; -}): Array; -export declare function tokenizer(input: { - css: Stringer; -}, options?: { - onParseError?: (error: ParseError) => void; -}): { - nextToken: () => CSSToken | undefined; - endOfFile: () => boolean; -}; -export {}; diff --git a/node_modules/@csstools/css-tokenizer/dist/util/clone-tokens.d.ts b/node_modules/@csstools/css-tokenizer/dist/util/clone-tokens.d.ts deleted file mode 100644 index 1db05d036..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/util/clone-tokens.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { CSSToken } from '../interfaces/token'; -export declare function cloneTokens(tokens: Array): Array; diff --git a/node_modules/@csstools/css-tokenizer/dist/util/mutations.d.ts b/node_modules/@csstools/css-tokenizer/dist/util/mutations.d.ts deleted file mode 100644 index 37f23cd29..000000000 --- a/node_modules/@csstools/css-tokenizer/dist/util/mutations.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { TokenIdent } from '../interfaces/token'; -export declare function mutateIdent(ident: TokenIdent, newValue: string): void; diff --git a/node_modules/@csstools/css-tokenizer/package.json b/node_modules/@csstools/css-tokenizer/package.json deleted file mode 100644 index c17437c39..000000000 --- a/node_modules/@csstools/css-tokenizer/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@csstools/css-tokenizer", - "description": "Tokenize CSS", - "version": "2.1.1", - "contributors": [ - { - "name": "Antonio Laguna", - "email": "antonio@laguna.es", - "url": "https://antonio.laguna.es" - }, - { - "name": "Romain Menke", - "email": "romainmenke@gmail.com" - } - ], - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - }, - "engines": { - "node": "^14 || ^16 || >=18" - }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" - } - }, - "files": [ - "CHANGELOG.md", - "LICENSE.md", - "README.md", - "dist" - ], - "devDependencies": { - "@rmenke/css-tokenizer-tests": "^1.0.9", - "postcss-parser-tests": "^8.5.1" - }, - "scripts": { - "benchmark": "node ./test/benchmark.mjs", - "build": "rollup -c ../../rollup/default.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "stryker": "stryker run --logLevel error", - "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs" - }, - "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer#readme", - "repository": { - "type": "git", - "url": "https://github.com/csstools/postcss-plugins.git", - "directory": "packages/css-tokenizer" - }, - "bugs": "https://github.com/csstools/postcss-plugins/issues", - "keywords": [ - "css", - "tokenizer" - ], - "volta": { - "extends": "../../package.json" - } -} diff --git a/node_modules/@csstools/media-query-list-parser/CHANGELOG.md b/node_modules/@csstools/media-query-list-parser/CHANGELOG.md deleted file mode 100644 index 3045e7c9a..000000000 --- a/node_modules/@csstools/media-query-list-parser/CHANGELOG.md +++ /dev/null @@ -1,64 +0,0 @@ -# Changes to Media Query List Parser - -### 2.1.2 - -_July 3, 2023_ - -- Updated [`@csstools/css-parser-algorithms`](/packages/css-parser-algorithms) to [`2.3.0`](/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) - -### 2.1.1 - -_June 21, 2023_ - -- Fix parsing of `(width == 100px)`. This was erroneously parsed as a range query and will now instead be a general enclosed node. - -### 2.1.0 - -_June 1, 2023_ - -- Fix `walk` for `MediaFeatureValue` with complex component values. -- Add `state` to `walk` methods. - -This makes it possible pass down information from a parent structure to children. -e.g. you can set `entry.state.inInPrintQuery = true` for `print and (min-width: 30cm)`. - -### 2.0.4 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) - -### 2.0.3 - -_April 10, 2023_ - -- Add support for `env()` functions as values in media queries. -- Improve the detection of math function as values in media queries. - -### 2.0.2 - -_March 25, 2023_ - -- Improve case insensitive string matching. - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 19, 2023_ - -- Refactor `MediaFeatureBoolean` so that it follows the same structure as `MediaFeaturePlain` (breaking) -- Change the `ParseError` interface, this is now a subclass of `Error` (breaking) -- Add `getName` and `getNameToken` to all nodes that have a feature name. -- Add `@custom-media` parsing. - -### 1.0.0 - -_November 14, 2022_ - -- Initial version diff --git a/node_modules/@csstools/media-query-list-parser/LICENSE.md b/node_modules/@csstools/media-query-list-parser/LICENSE.md deleted file mode 100644 index af5411fa2..000000000 --- a/node_modules/@csstools/media-query-list-parser/LICENSE.md +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright 2022 Romain Menke, Antonio Laguna - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@csstools/media-query-list-parser/README.md b/node_modules/@csstools/media-query-list-parser/README.md deleted file mode 100644 index d72dc7ddc..000000000 --- a/node_modules/@csstools/media-query-list-parser/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# Media Query List Parser - -[npm version][npm-url] -[Build Status][cli-url] -[Discord][discord] - -Implemented from : https://www.w3.org/TR/mediaqueries-5/ - -## Usage - -Add [Media Query List Parser] to your project: - -```bash -npm install @csstools/media-query-list-parser @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev -``` - -[Media Query List Parser] depends on our CSS tokenizer and parser algorithms. -It must be used together with `@csstools/css-tokenizer` and `@csstools/css-parser-algorithms`. - -```ts -import { parse } from '@csstools/media-query-list-parser'; - -export function parseCustomMedia() { - const mediaQueryList = parse('screen and (min-width: 300px), (50px < height < 30vw)'); - - mediaQueryList.forEach((mediaQuery) => { - mediaQuery.walk((entry, index) => { - // Index of the current Node in `parent`. - console.log(index); - // Type of `parent`. - console.log(entry.parent.type); - - // Type of `node` - { - // Sometimes nodes can be arrays. - if (Array.isArray(entry.node)) { - entry.node.forEach((item) => { - console.log(item.type); - }); - } - - if ('type' in entry.node) { - console.log(entry.node.type); - } - } - - // stringified version of the current node. - console.log(entry.node.toString()); - - // Return `false` to stop the walker. - return false; - }); - }); -} -``` - -[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test -[discord]: https://discord.gg/bUadyRwkJS -[npm-url]: https://www.npmjs.com/package/@csstools/media-query-list-parser - -[Media Query List Parser]: https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser diff --git a/node_modules/@csstools/media-query-list-parser/dist/index.cjs b/node_modules/@csstools/media-query-list-parser/dist/index.cjs deleted file mode 100644 index 0d66a43fd..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/index.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e,t=require("@csstools/css-parser-algorithms"),i=require("@csstools/css-tokenizer");exports.NodeType=void 0,(e=exports.NodeType||(exports.NodeType={})).CustomMedia="custom-media",e.GeneralEnclosed="general-enclosed",e.MediaAnd="media-and",e.MediaCondition="media-condition",e.MediaConditionListWithAnd="media-condition-list-and",e.MediaConditionListWithOr="media-condition-list-or",e.MediaFeature="media-feature",e.MediaFeatureBoolean="mf-boolean",e.MediaFeatureName="mf-name",e.MediaFeaturePlain="mf-plain",e.MediaFeatureRangeNameValue="mf-range-name-value",e.MediaFeatureRangeValueName="mf-range-value-name",e.MediaFeatureRangeValueNameValue="mf-range-value-name-value",e.MediaFeatureValue="mf-value",e.MediaInParens="media-in-parens",e.MediaNot="media-not",e.MediaOr="media-or",e.MediaQueryWithType="media-query-with-type",e.MediaQueryWithoutType="media-query-without-type",e.MediaQueryInvalid="media-query-invalid";const a=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(a,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}class MediaCondition{type=exports.NodeType.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===exports.NodeType.MediaCondition)}}class MediaInParens{type=exports.NodeType.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.media.toString()+i.stringify(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===exports.NodeType.MediaInParens)}}class MediaQueryWithType{type=exports.NodeType.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;ee.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(e,t){let i=!1;if(this.media.forEach(((a,r)=>{if(i)return;let n;t&&(n={...t}),!1!==e({node:a,parent:this,state:n},r)?"walk"in a&&!1===a.walk(e,n)&&(i=!0):i=!0})),i)return!1}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryInvalid(){return MediaQueryInvalid.isMediaQueryInvalid(this)}static isMediaQueryInvalid(e){return!!e&&(e instanceof MediaQueryInvalid&&e.type===exports.NodeType.MediaQueryInvalid)}}class GeneralEnclosed{type=exports.NodeType.GeneralEnclosed;value;constructor(e){this.value=e}tokens(){return this.value.tokens()}toString(){return this.value.toString()}indexOf(e){return e===this.value?"value":-1}at(e){if("value"===e)return this.value}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,tokens:this.tokens()}}isGeneralEnclosed(){return GeneralEnclosed.isGeneralEnclosed(this)}static isGeneralEnclosed(e){return!!e&&(e instanceof GeneralEnclosed&&e.type===exports.NodeType.GeneralEnclosed)}}class MediaAnd{type=exports.NodeType.MediaAnd;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return i.stringify(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){return"media"===e?this.media:null}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaAnd(){return MediaAnd.isMediaAnd(this)}static isMediaAnd(e){return!!e&&(e instanceof MediaAnd&&e.type===exports.NodeType.MediaAnd)}}class MediaConditionListWithAnd{type=exports.NodeType.MediaConditionListWithAnd;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((r,n)=>{a||(t&&(i={...t}),!1!==e({node:r,parent:this,state:i},n)?"walk"in r&&!1===r.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===exports.NodeType.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=exports.NodeType.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((r,n)=>{a||(t&&(i={...t}),!1!==e({node:r,parent:this,state:i},n)?"walk"in r&&!1===r.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===exports.NodeType.MediaConditionListWithOr)}}function isNumber(e){return!!(e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Number||e.type===t.ComponentValueType.Function&&r.has(toLowerCaseAZ(e.name[4].value)))}const r=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(e){return e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Dimension}function isIdent(e){return e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Ident}function isEnvironmentVariable(e){return e.type===t.ComponentValueType.Function&&"env"===toLowerCaseAZ(e.name[4].value)}class MediaFeatureName{type=exports.NodeType.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.name.toString()+i.stringify(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===exports.NodeType.MediaFeatureName)}}function parseMediaFeatureName(e){let i=-1;for(let a=0;ae.tokens())),e.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=exports.NodeType.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===exports.NodeType.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=exports.NodeType.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?i.stringify(...this.before)+this.value.map((e=>e.toString())).join("")+i.stringify(...this.after):i.stringify(...this.before)+this.value.toString()+i.stringify(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(e,t){if(Array.isArray(this.value)){let i=!1;if(this.value.forEach(((a,r)=>{if(i)return;let n;t&&(n={...t}),!1!==e({node:a,parent:this,state:n},r)?"walk"in a&&!1===a.walk(e,n)&&(i=!0):i=!0})),i)return!1}else{let i;if(t&&(i={...t}),!1===e({node:this.value,parent:this,state:i},"value"))return!1;if("walk"in this.value)return this.value.walk(e,i)}}toJSON(){return Array.isArray(this.value)?{type:this.type,value:this.value.map((e=>e.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===exports.NodeType.MediaFeatureValue)}}function parseMediaFeatureValue(e){let i=-1,a=-1;for(let r=0;re.tokens())),e.slice(a+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t2)return!1;if(e[0][0]!==i.TokenType.Delim)return!1;if(1===e.length)switch(e[0][4].value){case exports.MediaFeatureEQ.EQ:return exports.MediaFeatureEQ.EQ;case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT;default:return!1}if(e[1][0]!==i.TokenType.Delim)return!1;if(e[1][4].value!==exports.MediaFeatureEQ.EQ)return!1;switch(e[0][4].value){case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT_OR_EQ;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT_OR_EQ;default:return!1}}exports.MediaFeatureLT=void 0,(n=exports.MediaFeatureLT||(exports.MediaFeatureLT={})).LT="<",n.LT_OR_EQ="<=",exports.MediaFeatureGT=void 0,(o=exports.MediaFeatureGT||(exports.MediaFeatureGT={})).GT=">",o.GT_OR_EQ=">=",exports.MediaFeatureEQ=void 0,(exports.MediaFeatureEQ||(exports.MediaFeatureEQ={})).EQ="=";class MediaFeatureRangeNameValue{type=exports.NodeType.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+i.stringify(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===exports.NodeType.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=exports.NodeType.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+i.stringify(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===exports.NodeType.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=exports.NodeType.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,r){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=r}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+i.stringify(...this.valueOneOperator)+this.name.toString()+i.stringify(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===exports.NodeType.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(e){let a=!1,r=!1;for(let n=0;ne.tokens())),-1!==r&&(s=e.slice(a+1,r+1).flatMap((e=>e.tokens())))):-1!==r&&(s=e.slice(0,r+1).flatMap((e=>e.tokens())));const u=parseMediaConditionWithoutOr(e.slice(Math.max(a,r,n)+1));return!1===u?new MediaQueryWithType(o,[...s,...e.slice(r+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(o,s,e.slice(r+1,n+1).flatMap((e=>e.tokens())),u)}}function parseMediaConditionListWithOr(e){let i=!1;const a=[];let r=-1,n=-1;for(let o=0;oe.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(e){let i=!1;const a=[];let r=-1,n=-1;for(let o=0;oe.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const r=parseMediaInParens(e);return!1!==r&&new MediaCondition(r)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(e){let a=-1;for(let i=0;ie.tokens())),r.startToken],o=[r.endToken,...e.slice(a+1).flatMap((e=>e.tokens()))],s=parseMediaFeature(r,n,o);if(!1!==s)return new MediaInParens(s);const u=parseMediaCondition(r.value);return!1!==u?new MediaInParens(u,n,o):new MediaInParens(new GeneralEnclosed(r),e.slice(0,a).flatMap((e=>e.tokens())),e.slice(a+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(e.startToken[0]!==i.TokenType.OpenParen)return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const a=parseMediaCondition(e.value);return!1!==a?new MediaInParens(a,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}function parseMediaNot(e){let i=!1,a=null;for(let r=0;re.tokens())),t)}}}return a||!1}function parseMediaOr(e){let i=!1;for(let a=0;ae.tokens())),t)}}return!1}}return!1}function parseMediaAnd(e){let i=!1;for(let a=0;ae.tokens())),t)}}return!1}}return!1}function parseFromTokens(e,i){const a=t.parseCommaSeparatedListOfComponentValues(e,{onParseError:null==i?void 0:i.onParseError});return a.map(((e,t)=>{const r=parseMediaQuery(e);return 0==r&&!0===(null==i?void 0:i.preserveInvalidMediaQueries)?new MediaQueryInvalid(a[t]):r})).filter((e=>!!e))}exports.MediaQueryModifier=void 0,(u=exports.MediaQueryModifier||(exports.MediaQueryModifier={})).Not="not",u.Only="only";class CustomMedia{type=exports.NodeType.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;ee.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===exports.NodeType.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let a=[],r=e;for(let t=0;tString.fromCharCode(e.charCodeAt(0)+32)))}class MediaCondition{type=f.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===f.MediaCondition)}}class MediaInParens{type=f.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return u(...this.before)+this.media.toString()+u(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===f.MediaInParens)}}class MediaQueryWithType{type=f.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;ee.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(e,t){let i=!1;if(this.media.forEach(((a,n)=>{if(i)return;let r;t&&(r={...t}),!1!==e({node:a,parent:this,state:r},n)?"walk"in a&&!1===a.walk(e,r)&&(i=!0):i=!0})),i)return!1}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryInvalid(){return MediaQueryInvalid.isMediaQueryInvalid(this)}static isMediaQueryInvalid(e){return!!e&&(e instanceof MediaQueryInvalid&&e.type===f.MediaQueryInvalid)}}class GeneralEnclosed{type=f.GeneralEnclosed;value;constructor(e){this.value=e}tokens(){return this.value.tokens()}toString(){return this.value.toString()}indexOf(e){return e===this.value?"value":-1}at(e){if("value"===e)return this.value}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,tokens:this.tokens()}}isGeneralEnclosed(){return GeneralEnclosed.isGeneralEnclosed(this)}static isGeneralEnclosed(e){return!!e&&(e instanceof GeneralEnclosed&&e.type===f.GeneralEnclosed)}}class MediaAnd{type=f.MediaAnd;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return u(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){return"media"===e?this.media:null}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaAnd(){return MediaAnd.isMediaAnd(this)}static isMediaAnd(e){return!!e&&(e instanceof MediaAnd&&e.type===f.MediaAnd)}}class MediaConditionListWithAnd{type=f.MediaConditionListWithAnd;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return u(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+u(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((n,r)=>{a||(t&&(i={...t}),!1!==e({node:n,parent:this,state:i},r)?"walk"in n&&!1===n.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===f.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=f.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return u(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+u(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((n,r)=>{a||(t&&(i={...t}),!1!==e({node:n,parent:this,state:i},r)?"walk"in n&&!1===n.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===f.MediaConditionListWithOr)}}function isNumber(t){return!!(t.type===e.Token&&t.value[0]===d.Number||t.type===e.Function&&M.has(toLowerCaseAZ(t.name[4].value)))}const M=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(t){return t.type===e.Token&&t.value[0]===d.Dimension}function isIdent(t){return t.type===e.Token&&t.value[0]===d.Ident}function isEnvironmentVariable(t){return t.type===e.Function&&"env"===toLowerCaseAZ(t.name[4].value)}class MediaFeatureName{type=f.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return u(...this.before)+this.name.toString()+u(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===f.MediaFeatureName)}}function parseMediaFeatureName(t){let i=-1;for(let a=0;ae.tokens())),t.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=f.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===f.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=f.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?u(...this.before)+this.value.map((e=>e.toString())).join("")+u(...this.after):u(...this.before)+this.value.toString()+u(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(e,t){if(Array.isArray(this.value)){let i=!1;if(this.value.forEach(((a,n)=>{if(i)return;let r;t&&(r={...t}),!1!==e({node:a,parent:this,state:r},n)?"walk"in a&&!1===a.walk(e,r)&&(i=!0):i=!0})),i)return!1}else{let i;if(t&&(i={...t}),!1===e({node:this.value,parent:this,state:i},"value"))return!1;if("walk"in this.value)return this.value.walk(e,i)}}toJSON(){return Array.isArray(this.value)?{type:this.type,value:this.value.map((e=>e.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===f.MediaFeatureValue)}}function parseMediaFeatureValue(t){let i=-1,a=-1;for(let n=0;ne.tokens())),t.slice(a+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t2)return!1;if(e[0][0]!==d.Delim)return!1;if(1===e.length)switch(e[0][4].value){case v.EQ:return v.EQ;case p.LT:return p.LT;case y.GT:return y.GT;default:return!1}if(e[1][0]!==d.Delim)return!1;if(e[1][4].value!==v.EQ)return!1;switch(e[0][4].value){case p.LT:return p.LT_OR_EQ;case y.GT:return y.GT_OR_EQ;default:return!1}}function invertComparison(e){switch(e){case v.EQ:return v.EQ;case p.LT:return y.GT;case p.LT_OR_EQ:return y.GT_OR_EQ;case y.GT:return p.LT;case y.GT_OR_EQ:return p.LT_OR_EQ;default:return!1}}!function(e){e.LT="<",e.LT_OR_EQ="<="}(p||(p={})),function(e){e.GT=">",e.GT_OR_EQ=">="}(y||(y={})),function(e){e.EQ="="}(v||(v={}));class MediaFeatureRangeNameValue{type=f.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+u(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===f.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=f.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+u(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===f.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=f.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,n){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=n}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+u(...this.valueOneOperator)+this.name.toString()+u(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===f.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(t){let i=!1,a=!1;for(let n=0;ne.tokens())),-1!==i&&(u=e.slice(t+1,i+1).flatMap((e=>e.tokens())))):-1!==i&&(u=e.slice(0,i+1).flatMap((e=>e.tokens())));const l=parseMediaConditionWithoutOr(e.slice(Math.max(t,i,s)+1));return!1===l?new MediaQueryWithType(o,[...u,...e.slice(i+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(o,u,e.slice(i+1,s+1).flatMap((e=>e.tokens())),l)}}function parseMediaConditionListWithOr(t){let i=!1;const a=[];let n=-1,r=-1;for(let o=0;oe.tokens())),t.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(t){let i=!1;const a=[];let n=-1,r=-1;for(let o=0;oe.tokens())),t.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const n=parseMediaInParens(e);return!1!==n&&new MediaCondition(n)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(t){let i=-1;for(let a=0;ae.tokens())),a.startToken],r=[a.endToken,...t.slice(i+1).flatMap((e=>e.tokens()))],o=parseMediaFeature(a,n,r);if(!1!==o)return new MediaInParens(o);const u=parseMediaCondition(a.value);return!1!==u?new MediaInParens(u,n,r):new MediaInParens(new GeneralEnclosed(a),t.slice(0,i).flatMap((e=>e.tokens())),t.slice(i+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(e.startToken[0]!==d.OpenParen)return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const i=parseMediaCondition(e.value);return!1!==i?new MediaInParens(i,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}function parseMediaNot(t){let i=!1,a=null;for(let n=0;ne.tokens())),e)}}}return a||!1}function parseMediaOr(t){let i=!1;for(let a=0;ae.tokens())),e)}}return!1}}return!1}function parseMediaAnd(t){let i=!1;for(let a=0;ae.tokens())),e)}}return!1}}return!1}function parseFromTokens(e,t){const i=o(e,{onParseError:null==t?void 0:t.onParseError});return i.map(((e,a)=>{const n=parseMediaQuery(e);return 0==n&&!0===(null==t?void 0:t.preserveInvalidMediaQueries)?new MediaQueryInvalid(i[a]):n})).filter((e=>!!e))}function parse(e,t){const i=h({css:e},{onParseError:null==t?void 0:t.onParseError}),a=[];for(;!i.endOfFile();)a.push(i.nextToken());return a.push(i.nextToken()),parseFromTokens(a,t)}!function(e){e.Not="not",e.Only="only"}(k||(k={}));class CustomMedia{type=f.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;ee.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===f.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let i=[],a=e;for(let t=0;t; - mediaQueryList: Array | null; - trueOrFalseKeyword: Array | null; - constructor(name: Array, mediaQueryList: Array | null, trueOrFalseKeyword?: Array); - getName(): string; - getNameToken(): CSSToken | null; - hasMediaQueryList(): boolean; - hasTrueKeyword(): boolean; - hasFalseKeyword(): boolean; - tokens(): Array; - toString(): string; - toJSON(): { - type: NodeType; - string: string; - nameValue: string; - name: CSSToken[]; - hasFalseKeyword: boolean; - hasTrueKeyword: boolean; - trueOrFalseKeyword: CSSToken[] | null; - mediaQueryList: ({ - type: NodeType; - string: string; - modifier: CSSToken[]; - mediaType: CSSToken[]; - and: CSSToken[] | undefined; - media: import("./media-condition").MediaCondition | undefined; - } | { - type: NodeType; - string: string; - media: import("./media-condition").MediaCondition; - } | { - type: NodeType; - string: string; - media: import("@csstools/css-parser-algorithms").ComponentValue[]; - })[] | undefined; - }; - isCustomMedia(): this is CustomMedia; - static isCustomMedia(x: unknown): x is CustomMedia; -} diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts deleted file mode 100644 index 5ab840f52..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms'; -import { CSSToken } from '@csstools/css-tokenizer'; -import { NodeType } from '../util/node-type'; -export declare class GeneralEnclosed { - type: NodeType; - value: ComponentValue; - constructor(value: ComponentValue); - tokens(): Array; - toString(): string; - indexOf(item: ComponentValue): number | string; - at(index: number | string): ComponentValue | undefined; - walk>(cb: (entry: { - node: GeneralEnclosedWalkerEntry; - parent: GeneralEnclosedWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - tokens: CSSToken[]; - }; - isGeneralEnclosed(): this is GeneralEnclosed; - static isGeneralEnclosed(x: unknown): x is GeneralEnclosed; -} -export type GeneralEnclosedWalkerEntry = ComponentValue; -export type GeneralEnclosedWalkerParent = ContainerNode | GeneralEnclosed; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts deleted file mode 100644 index ddd73d539..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens'; -import { NodeType } from '../util/node-type'; -export declare class MediaAnd { - type: NodeType; - modifier: Array; - media: MediaInParens; - constructor(modifier: Array, media: MediaInParens); - tokens(): Array; - toString(): string; - indexOf(item: MediaInParens): number | string; - at(index: number | string): MediaInParens | null; - walk>(cb: (entry: { - node: MediaAndWalkerEntry; - parent: MediaAndWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): unknown; - isMediaAnd(): this is MediaAnd; - static isMediaAnd(x: unknown): x is MediaAnd; -} -export type MediaAndWalkerEntry = MediaInParensWalkerEntry | MediaInParens; -export type MediaAndWalkerParent = MediaInParensWalkerParent | MediaAnd; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts deleted file mode 100644 index ddc51062d..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { MediaAnd, MediaAndWalkerEntry, MediaAndWalkerParent } from './media-and'; -import { MediaInParens } from './media-in-parens'; -import { MediaOr, MediaOrWalkerEntry, MediaOrWalkerParent } from './media-or'; -import { NodeType } from '../util/node-type'; -export type MediaConditionList = MediaConditionListWithAnd | MediaConditionListWithOr; -export declare class MediaConditionListWithAnd { - type: NodeType; - leading: MediaInParens; - list: Array; - before: Array; - after: Array; - constructor(leading: MediaInParens, list: Array, before?: Array, after?: Array); - tokens(): Array; - toString(): string; - indexOf(item: MediaInParens | MediaAnd): number | string; - at(index: number | string): MediaInParens | MediaAnd | undefined; - walk>(cb: (entry: { - node: MediaConditionListWithAndWalkerEntry; - parent: MediaConditionListWithAndWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): unknown; - isMediaConditionListWithAnd(): this is MediaConditionListWithAnd; - static isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; -} -export type MediaConditionListWithAndWalkerEntry = MediaAndWalkerEntry | MediaAnd; -export type MediaConditionListWithAndWalkerParent = MediaAndWalkerParent | MediaConditionListWithAnd; -export declare class MediaConditionListWithOr { - type: NodeType; - leading: MediaInParens; - list: Array; - before: Array; - after: Array; - constructor(leading: MediaInParens, list: Array, before?: Array, after?: Array); - tokens(): Array; - toString(): string; - indexOf(item: MediaInParens | MediaOr): number | string; - at(index: number | string): MediaInParens | MediaOr | undefined; - walk>(cb: (entry: { - node: MediaConditionListWithOrWalkerEntry; - parent: MediaConditionListWithOrWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): unknown; - isMediaConditionListWithOr(): this is MediaConditionListWithOr; - static isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; -} -export type MediaConditionListWithOrWalkerEntry = MediaOrWalkerEntry | MediaOr; -export type MediaConditionListWithOrWalkerParent = MediaOrWalkerParent | MediaConditionListWithOr; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts deleted file mode 100644 index faf2b49d2..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { MediaConditionListWithAnd, MediaConditionListWithAndWalkerEntry, MediaConditionListWithAndWalkerParent, MediaConditionListWithOr, MediaConditionListWithOrWalkerEntry, MediaConditionListWithOrWalkerParent } from './media-condition-list'; -import { MediaInParens } from './media-in-parens'; -import { MediaNot, MediaNotWalkerEntry, MediaNotWalkerParent } from './media-not'; -import { NodeType } from '../util/node-type'; -export declare class MediaCondition { - type: NodeType; - media: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr; - constructor(media: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr); - tokens(): Array; - toString(): string; - indexOf(item: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr): number | string; - at(index: number | string): MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr | undefined; - walk>(cb: (entry: { - node: MediaConditionWalkerEntry; - parent: MediaConditionWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): unknown; - isMediaCondition(): this is MediaCondition; - static isMediaCondition(x: unknown): x is MediaCondition; -} -export type MediaConditionWalkerEntry = MediaNotWalkerEntry | MediaConditionListWithAndWalkerEntry | MediaConditionListWithOrWalkerEntry | MediaNot | MediaConditionListWithAnd | MediaConditionListWithOr; -export type MediaConditionWalkerParent = MediaNotWalkerParent | MediaConditionListWithAndWalkerParent | MediaConditionListWithOrWalkerParent | MediaCondition; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts deleted file mode 100644 index a5c64ec1f..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { MediaFeatureName } from './media-feature-name'; -import { NodeType } from '../util/node-type'; -import { CSSToken } from '@csstools/css-tokenizer'; -export declare class MediaFeatureBoolean { - type: NodeType; - name: MediaFeatureName; - constructor(name: MediaFeatureName); - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: MediaFeatureName): number | string; - at(index: number | string): MediaFeatureName | undefined; - toJSON(): { - type: NodeType; - name: { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - tokens: CSSToken[]; - }; - isMediaFeatureBoolean(): this is MediaFeatureBoolean; - static isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; -} -export declare function parseMediaFeatureBoolean(componentValues: Array): false | MediaFeatureBoolean; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts deleted file mode 100644 index 377696577..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { TokenDelim } from '@csstools/css-tokenizer'; -export declare enum MediaFeatureLT { - LT = "<", - LT_OR_EQ = "<=" -} -export declare enum MediaFeatureGT { - GT = ">", - GT_OR_EQ = ">=" -} -export declare enum MediaFeatureEQ { - EQ = "=" -} -export type MediaFeatureComparison = MediaFeatureLT | MediaFeatureGT | MediaFeatureEQ; -export declare function matchesComparison(componentValues: Array): false | [number, number]; -export declare function comparisonFromTokens(tokens: [TokenDelim, TokenDelim] | [TokenDelim]): MediaFeatureComparison | false; -export declare function invertComparison(operator: MediaFeatureComparison): MediaFeatureComparison | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts deleted file mode 100644 index 332b421a1..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { CSSToken } from '@csstools/css-tokenizer'; -import { NodeType } from '../util/node-type'; -export declare class MediaFeatureName { - type: NodeType; - name: ComponentValue; - before: Array; - after: Array; - constructor(name: ComponentValue, before?: Array, after?: Array); - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: ComponentValue): number | string; - at(index: number | string): ComponentValue | undefined; - toJSON(): { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - isMediaFeatureName(): this is MediaFeatureName; - static isMediaFeatureName(x: unknown): x is MediaFeatureName; -} -export declare function parseMediaFeatureName(componentValues: Array): MediaFeatureName | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts deleted file mode 100644 index 32f22c401..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { CSSToken, TokenColon } from '@csstools/css-tokenizer'; -import { MediaFeatureName } from './media-feature-name'; -import { MediaFeatureValue, MediaFeatureValueWalkerEntry, MediaFeatureValueWalkerParent } from './media-feature-value'; -import { NodeType } from '../util/node-type'; -export declare class MediaFeaturePlain { - type: NodeType; - name: MediaFeatureName; - colon: TokenColon; - value: MediaFeatureValue; - constructor(name: MediaFeatureName, colon: TokenColon, value: MediaFeatureValue); - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; - at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; - walk>(cb: (entry: { - node: MediaFeaturePlainWalkerEntry; - parent: MediaFeaturePlainWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - name: { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - value: { - type: NodeType; - value: unknown; - tokens: CSSToken[]; - }; - tokens: CSSToken[]; - }; - isMediaFeaturePlain(): this is MediaFeaturePlain; - static isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; -} -export type MediaFeaturePlainWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; -export type MediaFeaturePlainWalkerParent = MediaFeatureValueWalkerParent | MediaFeaturePlain; -export declare function parseMediaFeaturePlain(componentValues: Array): MediaFeaturePlain | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts deleted file mode 100644 index 585d8c188..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { CSSToken, TokenDelim } from '@csstools/css-tokenizer'; -import { MediaFeatureComparison } from './media-feature-comparison'; -import { MediaFeatureName } from './media-feature-name'; -import { MediaFeatureValue, MediaFeatureValueWalkerEntry, MediaFeatureValueWalkerParent } from './media-feature-value'; -import { NodeType } from '../util/node-type'; -export type MediaFeatureRange = MediaFeatureRangeNameValue | MediaFeatureRangeValueName | MediaFeatureRangeValueNameValue; -export declare class MediaFeatureRangeNameValue { - type: NodeType; - name: MediaFeatureName; - operator: [TokenDelim, TokenDelim] | [TokenDelim]; - value: MediaFeatureValue; - constructor(name: MediaFeatureName, operator: [TokenDelim, TokenDelim] | [TokenDelim], value: MediaFeatureValue); - operatorKind(): MediaFeatureComparison | false; - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; - at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; - walk>(cb: (entry: { - node: MediaFeatureRangeWalkerEntry; - parent: MediaFeatureRangeWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - name: { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - value: { - type: NodeType; - value: unknown; - tokens: CSSToken[]; - }; - tokens: CSSToken[]; - }; - isMediaFeatureRangeNameValue(): this is MediaFeatureRangeNameValue; - static isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; -} -export declare class MediaFeatureRangeValueName { - type: NodeType; - name: MediaFeatureName; - operator: [TokenDelim, TokenDelim] | [TokenDelim]; - value: MediaFeatureValue; - constructor(name: MediaFeatureName, operator: [TokenDelim, TokenDelim] | [TokenDelim], value: MediaFeatureValue); - operatorKind(): MediaFeatureComparison | false; - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; - at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; - walk>(cb: (entry: { - node: MediaFeatureRangeWalkerEntry; - parent: MediaFeatureRangeWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - name: { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - value: { - type: NodeType; - value: unknown; - tokens: CSSToken[]; - }; - tokens: CSSToken[]; - }; - isMediaFeatureRangeValueName(): this is MediaFeatureRangeValueName; - static isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; -} -export declare class MediaFeatureRangeValueNameValue { - type: NodeType; - name: MediaFeatureName; - valueOne: MediaFeatureValue; - valueOneOperator: [TokenDelim, TokenDelim] | [TokenDelim]; - valueTwo: MediaFeatureValue; - valueTwoOperator: [TokenDelim, TokenDelim] | [TokenDelim]; - constructor(name: MediaFeatureName, valueOne: MediaFeatureValue, valueOneOperator: [TokenDelim, TokenDelim] | [TokenDelim], valueTwo: MediaFeatureValue, valueTwoOperator: [TokenDelim, TokenDelim] | [TokenDelim]); - valueOneOperatorKind(): MediaFeatureComparison | false; - valueTwoOperatorKind(): MediaFeatureComparison | false; - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; - at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; - walk>(cb: (entry: { - node: MediaFeatureRangeWalkerEntry; - parent: MediaFeatureRangeWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - name: { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - valueOne: { - type: NodeType; - value: unknown; - tokens: CSSToken[]; - }; - valueTwo: { - type: NodeType; - value: unknown; - tokens: CSSToken[]; - }; - tokens: CSSToken[]; - }; - isMediaFeatureRangeValueNameValue(): this is MediaFeatureRangeValueNameValue; - static isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; -} -export type MediaFeatureRangeWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; -export type MediaFeatureRangeWalkerParent = MediaFeatureValueWalkerParent | MediaFeatureRange; -export declare function parseMediaFeatureRange(componentValues: Array): MediaFeatureRange | false; -export declare const mediaDescriptors: Set; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts deleted file mode 100644 index 9615670f3..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms'; -import { CSSToken } from '@csstools/css-tokenizer'; -import { NodeType } from '../util/node-type'; -export declare class MediaFeatureValue { - type: NodeType; - value: ComponentValue | Array; - before: Array; - after: Array; - constructor(value: ComponentValue | Array, before?: Array, after?: Array); - tokens(): Array; - toString(): string; - indexOf(item: ComponentValue): number | string; - at(index: number | string): ComponentValue | Array | undefined; - walk>(cb: (entry: { - node: MediaFeatureValueWalkerEntry; - parent: MediaFeatureValueWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - value: unknown; - tokens: CSSToken[]; - }; - isMediaFeatureValue(): this is MediaFeatureValue; - static isMediaFeatureValue(x: unknown): x is MediaFeatureValue; -} -export type MediaFeatureValueWalkerEntry = ComponentValue; -export type MediaFeatureValueWalkerParent = ContainerNode | MediaFeatureValue; -export declare function parseMediaFeatureValue(componentValues: Array): MediaFeatureValue | false; -export declare function matchesRatioExactly(componentValues: Array): number[] | -1; -export declare function matchesRatio(componentValues: Array): number[] | -1; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts deleted file mode 100644 index bf9c0384f..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { SimpleBlockNode } from '@csstools/css-parser-algorithms'; -import { CSSToken } from '@csstools/css-tokenizer'; -import { MediaFeatureBoolean } from './media-feature-boolean'; -import { MediaFeaturePlain, MediaFeaturePlainWalkerEntry, MediaFeaturePlainWalkerParent } from './media-feature-plain'; -import { MediaFeatureRange, MediaFeatureRangeWalkerEntry, MediaFeatureRangeWalkerParent } from './media-feature-range'; -import { NodeType } from '../util/node-type'; -export declare class MediaFeature { - type: NodeType; - feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; - before: Array; - after: Array; - constructor(feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange, before?: Array, after?: Array); - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange): number | string; - at(index: number | string): MediaFeatureBoolean | MediaFeaturePlain | MediaFeatureRange | undefined; - walk>(cb: (entry: { - node: MediaFeatureWalkerEntry; - parent: MediaFeatureWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - feature: { - type: NodeType; - name: { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - tokens: CSSToken[]; - }; - before: CSSToken[]; - after: CSSToken[]; - }; - isMediaFeature(): this is MediaFeature; - static isMediaFeature(x: unknown): x is MediaFeature; -} -export type MediaFeatureWalkerEntry = MediaFeaturePlainWalkerEntry | MediaFeatureRangeWalkerEntry | MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; -export type MediaFeatureWalkerParent = MediaFeaturePlainWalkerParent | MediaFeatureRangeWalkerParent | MediaFeature; -export declare function parseMediaFeature(simpleBlock: SimpleBlockNode, before?: Array, after?: Array): false | MediaFeature; -export declare function newMediaFeatureBoolean(name: string): MediaFeature; -export declare function newMediaFeaturePlain(name: string, ...value: Array): MediaFeature; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts deleted file mode 100644 index 904a0725e..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms'; -import { CSSToken } from '@csstools/css-tokenizer'; -import { GeneralEnclosed } from './general-enclosed'; -import { MediaAnd } from './media-and'; -import { MediaCondition } from './media-condition'; -import { MediaConditionList } from './media-condition-list'; -import { MediaFeature } from './media-feature'; -import { MediaFeatureBoolean } from './media-feature-boolean'; -import { MediaFeatureName } from './media-feature-name'; -import { MediaFeaturePlain } from './media-feature-plain'; -import { MediaFeatureRange } from './media-feature-range'; -import { MediaFeatureValue } from './media-feature-value'; -import { NodeType } from '../util/node-type'; -import { MediaNot } from './media-not'; -import { MediaOr } from './media-or'; -export declare class MediaInParens { - type: NodeType; - media: MediaCondition | MediaFeature | GeneralEnclosed; - before: Array; - after: Array; - constructor(media: MediaCondition | MediaFeature | GeneralEnclosed, before?: Array, after?: Array); - tokens(): Array; - toString(): string; - indexOf(item: MediaCondition | MediaFeature | GeneralEnclosed): number | string; - at(index: number | string): MediaCondition | MediaFeature | GeneralEnclosed | undefined; - walk>(cb: (entry: { - node: MediaInParensWalkerEntry; - parent: MediaInParensWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - media: unknown; - before: CSSToken[]; - after: CSSToken[]; - }; - isMediaInParens(): this is MediaInParens; - static isMediaInParens(x: unknown): x is MediaInParens; -} -export type MediaInParensWalkerEntry = ComponentValue | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; -export type MediaInParensWalkerParent = ContainerNode | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts deleted file mode 100644 index 2bedcaa31..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens'; -import { NodeType } from '../util/node-type'; -export declare class MediaNot { - type: NodeType; - modifier: Array; - media: MediaInParens; - constructor(modifier: Array, media: MediaInParens); - tokens(): Array; - toString(): string; - indexOf(item: MediaInParens): number | string; - at(index: number | string): MediaInParens | undefined; - walk>(cb: (entry: { - node: MediaNotWalkerEntry; - parent: MediaNotWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - modifier: CSSToken[]; - media: { - type: NodeType; - media: unknown; - before: CSSToken[]; - after: CSSToken[]; - }; - }; - isMediaNot(): this is MediaNot; - static isMediaNot(x: unknown): x is MediaNot; -} -export type MediaNotWalkerEntry = MediaInParensWalkerEntry | MediaInParens; -export type MediaNotWalkerParent = MediaInParensWalkerParent | MediaNot; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts deleted file mode 100644 index 4459412d4..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens'; -import { NodeType } from '../util/node-type'; -export declare class MediaOr { - type: NodeType; - modifier: Array; - media: MediaInParens; - constructor(modifier: Array, media: MediaInParens); - tokens(): Array; - toString(): string; - indexOf(item: MediaInParens): number | string; - at(index: number | string): MediaInParens | undefined; - walk>(cb: (entry: { - node: MediaOrWalkerEntry; - parent: MediaOrWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - modifier: CSSToken[]; - media: { - type: NodeType; - media: unknown; - before: CSSToken[]; - after: CSSToken[]; - }; - }; - isMediaOr(): this is MediaOr; - static isMediaOr(x: unknown): x is MediaOr; -} -export type MediaOrWalkerEntry = MediaInParensWalkerEntry | MediaInParens; -export type MediaOrWalkerParent = MediaInParensWalkerParent | MediaOr; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts deleted file mode 100644 index df9733cb5..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { TokenIdent } from '@csstools/css-tokenizer'; -export declare enum MediaQueryModifier { - Not = "not", - Only = "only" -} -export declare function modifierFromToken(token: TokenIdent): MediaQueryModifier | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts deleted file mode 100644 index aa77dee09..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { CSSToken } from '@csstools/css-tokenizer'; -import { NodeType } from '../util/node-type'; -import { MediaCondition, MediaConditionWalkerEntry, MediaConditionWalkerParent } from './media-condition'; -export type MediaQuery = MediaQueryWithType | MediaQueryWithoutType | MediaQueryInvalid; -export declare class MediaQueryWithType { - type: NodeType; - modifier: Array; - mediaType: Array; - and: Array | undefined; - media: MediaCondition | undefined; - constructor(modifier: Array, mediaType: Array, and?: Array | undefined, media?: MediaCondition | undefined); - getModifier(): string; - negateQuery(): MediaQuery; - getMediaType(): string; - tokens(): Array; - toString(): string; - indexOf(item: MediaCondition): number | string; - at(index: number | string): MediaCondition | undefined; - walk>(cb: (entry: { - node: MediaQueryWithTypeWalkerEntry; - parent: MediaQueryWithTypeWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - string: string; - modifier: CSSToken[]; - mediaType: CSSToken[]; - and: CSSToken[] | undefined; - media: MediaCondition | undefined; - }; - isMediaQueryWithType(): this is MediaQueryWithType; - static isMediaQueryWithType(x: unknown): x is MediaQueryWithType; -} -export type MediaQueryWithTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; -export type MediaQueryWithTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithType; -export declare class MediaQueryWithoutType { - type: NodeType; - media: MediaCondition; - constructor(media: MediaCondition); - negateQuery(): MediaQuery; - tokens(): Array; - toString(): string; - indexOf(item: MediaCondition): number | string; - at(index: number | string): MediaCondition | undefined; - walk>(cb: (entry: { - node: MediaQueryWithoutTypeWalkerEntry; - parent: MediaQueryWithoutTypeWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - string: string; - media: MediaCondition; - }; - isMediaQueryWithoutType(): this is MediaQueryWithoutType; - static isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; -} -export type MediaQueryWithoutTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; -export type MediaQueryWithoutTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithoutType; -export declare class MediaQueryInvalid { - type: NodeType; - media: Array; - constructor(media: Array); - negateQuery(): MediaQuery; - tokens(): Array; - toString(): string; - walk>(cb: (entry: { - node: MediaQueryInvalidWalkerEntry; - parent: MediaQueryInvalidWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - string: string; - media: ComponentValue[]; - }; - isMediaQueryInvalid(): this is MediaQueryInvalid; - static isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; -} -export type MediaQueryInvalidWalkerEntry = ComponentValue; -export type MediaQueryInvalidWalkerParent = ComponentValue | MediaQueryInvalid; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts deleted file mode 100644 index b7924b760..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { TokenIdent } from '@csstools/css-tokenizer'; -export declare enum MediaType { - /** Always matches */ - All = "all", - Print = "print", - Screen = "screen", - /** Never matches */ - Tty = "tty", - /** Never matches */ - Tv = "tv", - /** Never matches */ - Projection = "projection", - /** Never matches */ - Handheld = "handheld", - /** Never matches */ - Braille = "braille", - /** Never matches */ - Embossed = "embossed", - /** Never matches */ - Aural = "aural", - /** Never matches */ - Speech = "speech" -} -export declare function typeFromToken(token: TokenIdent): MediaType | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts b/node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts deleted file mode 100644 index 1be3d0f36..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -import { CustomMedia } from '../nodes/custom-media'; -export type Options = { - preserveInvalidMediaQueries?: boolean; - onParseError?: (error: ParseError) => void; -}; -export declare function parseCustomMediaFromTokens(tokens: Array, options?: Options): CustomMedia | false; -export declare function parseCustomMedia(source: string, options?: Options): CustomMedia | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts b/node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts deleted file mode 100644 index 3801d1789..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentValue, SimpleBlockNode } from '@csstools/css-parser-algorithms'; -import { MediaAnd } from '../nodes/media-and'; -import { MediaCondition } from '../nodes/media-condition'; -import { MediaConditionListWithAnd, MediaConditionListWithOr } from '../nodes/media-condition-list'; -import { MediaInParens } from '../nodes/media-in-parens'; -import { MediaNot } from '../nodes/media-not'; -import { MediaOr } from '../nodes/media-or'; -import { MediaQuery } from '../nodes/media-query'; -export declare function parseMediaQuery(componentValues: Array): MediaQuery | false; -export declare function parseMediaConditionListWithOr(componentValues: Array): MediaConditionListWithOr | false; -export declare function parseMediaConditionListWithAnd(componentValues: Array): MediaConditionListWithAnd | false; -export declare function parseMediaCondition(componentValues: Array): MediaCondition | false; -export declare function parseMediaConditionWithoutOr(componentValues: Array): MediaCondition | false; -export declare function parseMediaInParens(componentValues: Array): MediaInParens | false; -export declare function parseMediaInParensFromSimpleBlock(simpleBlock: SimpleBlockNode): MediaInParens | false; -export declare function parseMediaNot(componentValues: Array): MediaNot | false; -export declare function parseMediaOr(componentValues: Array): false | { - advance: number; - node: MediaOr; -}; -export declare function parseMediaAnd(componentValues: Array): false | { - advance: number; - node: MediaAnd; -}; diff --git a/node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts b/node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts deleted file mode 100644 index a09339bda..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -import { MediaQuery } from '../nodes/media-query'; -export type Options = { - preserveInvalidMediaQueries?: boolean; - onParseError?: (error: ParseError) => void; -}; -export declare function parseFromTokens(tokens: Array, options?: Options): MediaQuery[]; -export declare function parse(source: string, options?: Options): MediaQuery[]; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts deleted file mode 100644 index e0702c235..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { MediaQueryInvalid, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query'; -export declare function cloneMediaQuery(x: T): T; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts deleted file mode 100644 index f0763807b..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -export declare function isNumber(componentValue: ComponentValue): boolean; -export declare function isDimension(componentValue: ComponentValue): boolean; -export declare function isIdent(componentValue: ComponentValue): boolean; -export declare function isEnvironmentVariable(componentValue: ComponentValue): boolean; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts deleted file mode 100644 index 935e6eb54..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export declare enum NodeType { - CustomMedia = "custom-media", - GeneralEnclosed = "general-enclosed", - MediaAnd = "media-and", - MediaCondition = "media-condition", - MediaConditionListWithAnd = "media-condition-list-and", - MediaConditionListWithOr = "media-condition-list-or", - MediaFeature = "media-feature", - MediaFeatureBoolean = "mf-boolean", - MediaFeatureName = "mf-name", - MediaFeaturePlain = "mf-plain", - MediaFeatureRangeNameValue = "mf-range-name-value", - MediaFeatureRangeValueName = "mf-range-value-name", - MediaFeatureRangeValueNameValue = "mf-range-value-name-value", - MediaFeatureValue = "mf-value", - MediaInParens = "media-in-parens", - MediaNot = "media-not", - MediaOr = "media-or", - MediaQueryWithType = "media-query-with-type", - MediaQueryWithoutType = "media-query-without-type", - MediaQueryInvalid = "media-query-invalid" -} diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts deleted file mode 100644 index 396b252e7..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function toLowerCaseAZ(x: string): string; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts deleted file mode 100644 index 2313f29b0..000000000 --- a/node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { GeneralEnclosed } from '../nodes/general-enclosed'; -import { MediaAnd } from '../nodes/media-and'; -import { MediaCondition } from '../nodes/media-condition'; -import { MediaConditionList, MediaConditionListWithAnd, MediaConditionListWithOr } from '../nodes/media-condition-list'; -import { MediaFeature } from '../nodes/media-feature'; -import { MediaFeatureBoolean } from '../nodes/media-feature-boolean'; -import { MediaFeatureName } from '../nodes/media-feature-name'; -import { MediaFeaturePlain } from '../nodes/media-feature-plain'; -import { MediaFeatureRange, MediaFeatureRangeNameValue, MediaFeatureRangeValueName, MediaFeatureRangeValueNameValue } from '../nodes/media-feature-range'; -import { MediaFeatureValue } from '../nodes/media-feature-value'; -import { MediaInParens } from '../nodes/media-in-parens'; -import { MediaNot } from '../nodes/media-not'; -import { MediaOr } from '../nodes/media-or'; -import { MediaQuery, MediaQueryInvalid, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query'; -export declare function isCustomMedia(x: unknown): x is GeneralEnclosed; -export declare function isGeneralEnclosed(x: unknown): x is GeneralEnclosed; -export declare function isMediaAnd(x: unknown): x is MediaAnd; -export declare function isMediaConditionList(x: unknown): x is MediaConditionList; -export declare function isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; -export declare function isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; -export declare function isMediaCondition(x: unknown): x is MediaCondition; -export declare function isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; -export declare function isMediaFeatureName(x: unknown): x is MediaFeatureName; -export declare function isMediaFeatureValue(x: unknown): x is MediaFeatureValue; -export declare function isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; -export declare function isMediaFeatureRange(x: unknown): x is MediaFeatureRange; -export declare function isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; -export declare function isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; -export declare function isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; -export declare function isMediaFeature(x: unknown): x is MediaFeature; -export declare function isMediaInParens(x: unknown): x is MediaInParens; -export declare function isMediaNot(x: unknown): x is MediaNot; -export declare function isMediaOr(x: unknown): x is MediaOr; -export declare function isMediaQuery(x: unknown): x is MediaQuery; -export declare function isMediaQueryWithType(x: unknown): x is MediaQueryWithType; -export declare function isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; -export declare function isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; diff --git a/node_modules/@csstools/media-query-list-parser/package.json b/node_modules/@csstools/media-query-list-parser/package.json deleted file mode 100644 index 561c858a6..000000000 --- a/node_modules/@csstools/media-query-list-parser/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "@csstools/media-query-list-parser", - "description": "Parse CSS media query lists.", - "version": "2.1.2", - "contributors": [ - { - "name": "Antonio Laguna", - "email": "antonio@laguna.es", - "url": "https://antonio.laguna.es" - }, - { - "name": "Romain Menke", - "email": "romainmenke@gmail.com" - } - ], - "license": "MIT", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": "^14 || ^16 || >=18" - }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" - } - }, - "files": [ - "CHANGELOG.md", - "LICENSE.md", - "README.md", - "dist" - ], - "peerDependencies": { - "@csstools/css-parser-algorithms": "^2.3.0", - "@csstools/css-tokenizer": "^2.1.1" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "stryker": "stryker run --logLevel error", - "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node ./test/test.mjs" - }, - "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser#readme", - "repository": { - "type": "git", - "url": "https://github.com/csstools/postcss-plugins.git", - "directory": "packages/media-query-list-parser" - }, - "bugs": "https://github.com/csstools/postcss-plugins/issues", - "keywords": [ - "css", - "media query", - "parser" - ], - "volta": { - "extends": "../../package.json" - } -} diff --git a/node_modules/@csstools/selector-specificity/CHANGELOG.md b/node_modules/@csstools/selector-specificity/CHANGELOG.md deleted file mode 100644 index 770a6b9fa..000000000 --- a/node_modules/@csstools/selector-specificity/CHANGELOG.md +++ /dev/null @@ -1,63 +0,0 @@ -# Changes to Selector Specificity - -### 3.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) - -### 2.2.0 - -_March 21, 2023_ - -- Improve case insensitive string matching. -- Add support for: - - `::view-transition` - - `::view-transition-group(*)` and `::view-transition-group(name)` - - `::view-transition-image-par(*)` and `::view-transition-image-par(name)` - - `::view-transition-old(*)` and `::view-transition-old(name)` - - `::view-transition-new(*)` and `::view-transition-new(name)` - -### 2.1.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.1.0 - -_January 19, 2023_ - -- Add support for `::slotted` -- Add support for `:host` -- Add support for `:host-context` - -### 2.0.2 - -_July 8, 2022_ - -- Fix case insensitive matching. - -### 2.0.1 - -_June 10, 2022_ - -- Fixed: Exception on `:nth-child` without arguments. [#439](https://github.com/csstools/postcss-plugins/issues/439) - -### 2.0.0 - -_June 4, 2022_ - -- Breaking: use only named exports instead of `default` -- Added: `compare(a, b)` function to compare selectors by specificity - -```diff -- `import selectorSpecificity from '@csstools/selector-specificity';` -+ `import { selectorSpecificity } from '@csstools/selector-specificity';` -``` - -### 1.0.0 - -_April 26, 2022_ - -- Initial version diff --git a/node_modules/@csstools/selector-specificity/LICENSE.md b/node_modules/@csstools/selector-specificity/LICENSE.md deleted file mode 100644 index e8ae93b9f..000000000 --- a/node_modules/@csstools/selector-specificity/LICENSE.md +++ /dev/null @@ -1,18 +0,0 @@ -MIT No Attribution (MIT-0) - -Copyright © CSSTools Contributors - -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. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@csstools/selector-specificity/README.md b/node_modules/@csstools/selector-specificity/README.md deleted file mode 100644 index 3868d7d09..000000000 --- a/node_modules/@csstools/selector-specificity/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# Selector Specificity - -[npm version][npm-url] -[Build Status][cli-url] -[Discord][discord] - -## Usage - -Add [Selector Specificity] to your project: - -```bash -npm install @csstools/selector-specificity --save-dev -``` - -```js -import parser from 'postcss-selector-parser'; -import { selectorSpecificity } from '@csstools/selector-specificity'; - -const selectorAST = parser().astSync('#foo:has(> .foo)'); -const specificity = selectorSpecificity(selectorAST); - -console.log(specificity.a); // 1 -console.log(specificity.b); // 1 -console.log(specificity.c); // 0 -``` - -_`selectorSpecificity` takes a single selector, not a list of selectors (not : `a, b, c`). -To compare or otherwise manipulate lists of selectors you need to call `selectorSpecificity` on each part._ - -### Comparing - -The package exports a utility function to compare two specificities. - -```js -import { selectorSpecificity, compare } from '@csstools/selector-specificity'; - -const s1 = selectorSpecificity(ast1); -const s2 = selectorSpecificity(ast2); -compare(s1, s2); // -1 | 0 | 1 -``` - -- if `s1 < s2` then `compare(s1, s2)` returns a negative number (`< 0`) -- if `s1 > s2` then `compare(s1, s2)` returns a positive number (`> 0`) -- if `s1 === s2` then `compare(s1, s2)` returns zero (`=== 0`) - -## Prior Art - -- [keeganstreet/specificity](https://github.com/keeganstreet/specificity) -- [bramus/specificity](https://github.com/bramus/specificity) - -For CSSTools we always use `postcss-selector-parser` and want to calculate specificity from this AST. - -[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test -[discord]: https://discord.gg/bUadyRwkJS -[npm-url]: https://www.npmjs.com/package/@csstools/selector-specificity - -[Selector Specificity]: https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity diff --git a/node_modules/@csstools/selector-specificity/dist/index.cjs b/node_modules/@csstools/selector-specificity/dist/index.cjs deleted file mode 100644 index 4633d0fc3..000000000 --- a/node_modules/@csstools/selector-specificity/dist/index.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("postcss-selector-parser");const s=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(s,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function selectorSpecificity(s){if(!s)return{a:0,b:0,c:0};let t=0,c=0,i=0;if("universal"==s.type)return{a:0,b:0,c:0};if("id"===s.type)t+=1;else if("tag"===s.type)i+=1;else if("class"===s.type)c+=1;else if("attribute"===s.type)c+=1;else if(isPseudoElement(s))switch(toLowerCaseAZ(s.value)){case"::slotted":if(i+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":if(s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0]))return{a:0,b:0,c:0};i+=1;break;default:i+=1}else if(e.isPseudoClass(s))switch(toLowerCaseAZ(s.value)){case":-moz-any":case":-webkit-any":case":any":case":has":case":is":case":matches":case":not":if(s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;case":where":break;case":nth-child":case":nth-last-child":if(c+=1,s.nodes&&s.nodes.length>0){const n=s.nodes[0].nodes.findIndex((e=>"tag"===e.type&&"of"===toLowerCaseAZ(e.value)));if(n>-1){const o=[e.selector({nodes:s.nodes[0].nodes.slice(n+1),value:""})];s.nodes.length>1&&o.push(...s.nodes.slice(1));const a=specificityOfMostSpecificListItem(o);t+=a.a,c+=a.b,i+=a.c}}break;case":local":case":global":s.nodes&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,i+=s.c}));break;case":host":case":host-context":if(c+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;default:c+=1}else e.isContainer(s)&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,i+=s.c}));return{a:t,b:c,c:i}}function specificityOfMostSpecificListItem(e){let s={a:0,b:0,c:0};return e.forEach((e=>{const t=selectorSpecificity(e);t.a>s.a?s=t:t.as.b?s=t:t.bs.c&&(s=t))})),s}function isPseudoElement(s){return e.isPseudoElement(s)}function selectorNodeContainsOnlyUniversal(e){if(!e)return!1;if(!e.nodes)return!1;const s=e.nodes.filter((e=>"comment"!==e.type));return 1===s.length&&"universal"===s[0].type}exports.compare=function compare(e,s){return e.a===s.a?e.b===s.b?e.c-s.c:e.b-s.b:e.a-s.a},exports.selectorSpecificity=selectorSpecificity; diff --git a/node_modules/@csstools/selector-specificity/dist/index.d.ts b/node_modules/@csstools/selector-specificity/dist/index.d.ts deleted file mode 100644 index f92ce6d84..000000000 --- a/node_modules/@csstools/selector-specificity/dist/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Node } from 'postcss-selector-parser'; -export type Specificity = { - a: number; - b: number; - c: number; -}; -export declare function compare(s1: Specificity, s2: Specificity): number; -export declare function selectorSpecificity(node: Node): Specificity; diff --git a/node_modules/@csstools/selector-specificity/dist/index.mjs b/node_modules/@csstools/selector-specificity/dist/index.mjs deleted file mode 100644 index 8ac79c745..000000000 --- a/node_modules/@csstools/selector-specificity/dist/index.mjs +++ /dev/null @@ -1 +0,0 @@ -import e from"postcss-selector-parser";const s=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(s,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function compare(e,s){return e.a===s.a?e.b===s.b?e.c-s.c:e.b-s.b:e.a-s.a}function selectorSpecificity(s){if(!s)return{a:0,b:0,c:0};let t=0,c=0,i=0;if("universal"==s.type)return{a:0,b:0,c:0};if("id"===s.type)t+=1;else if("tag"===s.type)i+=1;else if("class"===s.type)c+=1;else if("attribute"===s.type)c+=1;else if(isPseudoElement(s))switch(toLowerCaseAZ(s.value)){case"::slotted":if(i+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":if(s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0]))return{a:0,b:0,c:0};i+=1;break;default:i+=1}else if(e.isPseudoClass(s))switch(toLowerCaseAZ(s.value)){case":-moz-any":case":-webkit-any":case":any":case":has":case":is":case":matches":case":not":if(s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;case":where":break;case":nth-child":case":nth-last-child":if(c+=1,s.nodes&&s.nodes.length>0){const n=s.nodes[0].nodes.findIndex((e=>"tag"===e.type&&"of"===toLowerCaseAZ(e.value)));if(n>-1){const o=[e.selector({nodes:s.nodes[0].nodes.slice(n+1),value:""})];s.nodes.length>1&&o.push(...s.nodes.slice(1));const a=specificityOfMostSpecificListItem(o);t+=a.a,c+=a.b,i+=a.c}}break;case":local":case":global":s.nodes&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,i+=s.c}));break;case":host":case":host-context":if(c+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;default:c+=1}else e.isContainer(s)&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,i+=s.c}));return{a:t,b:c,c:i}}function specificityOfMostSpecificListItem(e){let s={a:0,b:0,c:0};return e.forEach((e=>{const t=selectorSpecificity(e);t.a>s.a?s=t:t.as.b?s=t:t.bs.c&&(s=t))})),s}function isPseudoElement(s){return e.isPseudoElement(s)}function selectorNodeContainsOnlyUniversal(e){if(!e)return!1;if(!e.nodes)return!1;const s=e.nodes.filter((e=>"comment"!==e.type));return 1===s.length&&"universal"===s[0].type}export{compare,selectorSpecificity}; diff --git a/node_modules/@csstools/selector-specificity/dist/to-lower-case-a-z.d.ts b/node_modules/@csstools/selector-specificity/dist/to-lower-case-a-z.d.ts deleted file mode 100644 index 396b252e7..000000000 --- a/node_modules/@csstools/selector-specificity/dist/to-lower-case-a-z.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function toLowerCaseAZ(x: string): string; diff --git a/node_modules/@csstools/selector-specificity/package.json b/node_modules/@csstools/selector-specificity/package.json deleted file mode 100644 index 36e083896..000000000 --- a/node_modules/@csstools/selector-specificity/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "@csstools/selector-specificity", - "description": "Determine selector specificity with postcss-selector-parser", - "version": "3.0.0", - "contributors": [ - { - "name": "Antonio Laguna", - "email": "antonio@laguna.es", - "url": "https://antonio.laguna.es" - }, - { - "name": "Romain Menke", - "email": "romainmenke@gmail.com" - } - ], - "license": "MIT-0", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": "^14 || ^16 || >=18" - }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" - } - }, - "files": [ - "CHANGELOG.md", - "LICENSE.md", - "README.md", - "dist" - ], - "peerDependencies": { - "postcss-selector-parser": "^6.0.13" - }, - "devDependencies": { - "postcss-selector-parser": "^6.0.13" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "stryker": "stryker run --logLevel error", - "test": "node ./test/index.mjs && node ./test/_import.mjs && node ./test/_require.cjs" - }, - "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity#readme", - "repository": { - "type": "git", - "url": "https://github.com/csstools/postcss-plugins.git", - "directory": "packages/selector-specificity" - }, - "bugs": "https://github.com/csstools/postcss-plugins/issues", - "keywords": [ - "css", - "postcss-selector-parser", - "specificity" - ], - "volta": { - "extends": "../../package.json" - } -} diff --git a/node_modules/@nodelib/fs.scandir/LICENSE b/node_modules/@nodelib/fs.scandir/LICENSE deleted file mode 100644 index 65a999460..000000000 --- a/node_modules/@nodelib/fs.scandir/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Denis Malinochkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@nodelib/fs.scandir/README.md b/node_modules/@nodelib/fs.scandir/README.md deleted file mode 100644 index e0b218b9f..000000000 --- a/node_modules/@nodelib/fs.scandir/README.md +++ /dev/null @@ -1,171 +0,0 @@ -# @nodelib/fs.scandir - -> List files and directories inside the specified directory. - -## :bulb: Highlights - -The package is aimed at obtaining information about entries in the directory. - -* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). -* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode). -* :link: Can safely work with broken symbolic links. - -## Install - -```console -npm install @nodelib/fs.scandir -``` - -## Usage - -```ts -import * as fsScandir from '@nodelib/fs.scandir'; - -fsScandir.scandir('path', (error, stats) => { /* … */ }); -``` - -## API - -### .scandir(path, [optionsOrSettings], callback) - -Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style. - -```ts -fsScandir.scandir('path', (error, entries) => { /* … */ }); -fsScandir.scandir('path', {}, (error, entries) => { /* … */ }); -fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ }); -``` - -### .scandirSync(path, [optionsOrSettings]) - -Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path. - -```ts -const entries = fsScandir.scandirSync('path'); -const entries = fsScandir.scandirSync('path', {}); -const entries = fsScandir.scandirSync(('path', new fsScandir.Settings()); -``` - -#### path - -* Required: `true` -* Type: `string | Buffer | URL` - -A path to a file. If a URL is provided, it must use the `file:` protocol. - -#### optionsOrSettings - -* Required: `false` -* Type: `Options | Settings` -* Default: An instance of `Settings` class - -An [`Options`](#options) object or an instance of [`Settings`](#settingsoptions) class. - -> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. - -### Settings([options]) - -A class of full settings of the package. - -```ts -const settings = new fsScandir.Settings({ followSymbolicLinks: false }); - -const entries = fsScandir.scandirSync('path', settings); -``` - -## Entry - -* `name` — The name of the entry (`unknown.txt`). -* `path` — The path of the entry relative to call directory (`root/unknown.txt`). -* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class. -* `stats` (optional) — An instance of `fs.Stats` class. - -For example, the `scandir` call for `tools` directory with one directory inside: - -```ts -{ - dirent: Dirent { name: 'typedoc', /* … */ }, - name: 'typedoc', - path: 'tools/typedoc' -} -``` - -## Options - -### stats - -* Type: `boolean` -* Default: `false` - -Adds an instance of `fs.Stats` class to the [`Entry`](#entry). - -> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO?? - -### followSymbolicLinks - -* Type: `boolean` -* Default: `false` - -Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. - -### `throwErrorOnBrokenSymbolicLink` - -* Type: `boolean` -* Default: `true` - -Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`. - -### `pathSegmentSeparator` - -* Type: `string` -* Default: `path.sep` - -By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. - -### `fs` - -* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) -* Default: A default FS methods - -By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. - -```ts -interface FileSystemAdapter { - lstat?: typeof fs.lstat; - stat?: typeof fs.stat; - lstatSync?: typeof fs.lstatSync; - statSync?: typeof fs.statSync; - readdir?: typeof fs.readdir; - readdirSync?: typeof fs.readdirSync; -} - -const settings = new fsScandir.Settings({ - fs: { lstat: fakeLstat } -}); -``` - -## `old` and `modern` mode - -This package has two modes that are used depending on the environment and parameters of use. - -### old - -* Node.js below `10.10` or when the `stats` option is enabled - -When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links). - -### modern - -* Node.js 10.10+ and the `stats` option is disabled - -In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present. - -This mode makes fewer calls to the file system. It's faster. - -## Changelog - -See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. - -## License - -This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts deleted file mode 100644 index 827f1db09..000000000 --- a/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type * as fsStat from '@nodelib/fs.stat'; -import type { Dirent, ErrnoException } from '../types'; -export interface ReaddirAsynchronousMethod { - (filepath: string, options: { - withFileTypes: true; - }, callback: (error: ErrnoException | null, files: Dirent[]) => void): void; - (filepath: string, callback: (error: ErrnoException | null, files: string[]) => void): void; -} -export interface ReaddirSynchronousMethod { - (filepath: string, options: { - withFileTypes: true; - }): Dirent[]; - (filepath: string): string[]; -} -export declare type FileSystemAdapter = fsStat.FileSystemAdapter & { - readdir: ReaddirAsynchronousMethod; - readdirSync: ReaddirSynchronousMethod; -}; -export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; -export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.js b/node_modules/@nodelib/fs.scandir/out/adapters/fs.js deleted file mode 100644 index f0fe02202..000000000 --- a/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; -const fs = require("fs"); -exports.FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - stat: fs.stat, - lstatSync: fs.lstatSync, - statSync: fs.statSync, - readdir: fs.readdir, - readdirSync: fs.readdirSync -}; -function createFileSystemAdapter(fsMethods) { - if (fsMethods === undefined) { - return exports.FILE_SYSTEM_ADAPTER; - } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); -} -exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.d.ts b/node_modules/@nodelib/fs.scandir/out/constants.d.ts deleted file mode 100644 index 33f17497d..000000000 --- a/node_modules/@nodelib/fs.scandir/out/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * IS `true` for Node.js 10.10 and greater. - */ -export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.js b/node_modules/@nodelib/fs.scandir/out/constants.js deleted file mode 100644 index 7e3d4411f..000000000 --- a/node_modules/@nodelib/fs.scandir/out/constants.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; -const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.'); -if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) { - throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); -} -const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); -const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); -const SUPPORTED_MAJOR_VERSION = 10; -const SUPPORTED_MINOR_VERSION = 10; -const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; -const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; -/** - * IS `true` for Node.js 10.10 and greater. - */ -exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; diff --git a/node_modules/@nodelib/fs.scandir/out/index.d.ts b/node_modules/@nodelib/fs.scandir/out/index.d.ts deleted file mode 100644 index b9da83ed1..000000000 --- a/node_modules/@nodelib/fs.scandir/out/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod } from './adapters/fs'; -import * as async from './providers/async'; -import Settings, { Options } from './settings'; -import type { Dirent, Entry } from './types'; -declare type AsyncCallback = async.AsyncCallback; -declare function scandir(path: string, callback: AsyncCallback): void; -declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; -declare namespace scandir { - function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; -} -declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[]; -export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod, Options }; diff --git a/node_modules/@nodelib/fs.scandir/out/index.js b/node_modules/@nodelib/fs.scandir/out/index.js deleted file mode 100644 index 99c70d3d6..000000000 --- a/node_modules/@nodelib/fs.scandir/out/index.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Settings = exports.scandirSync = exports.scandir = void 0; -const async = require("./providers/async"); -const sync = require("./providers/sync"); -const settings_1 = require("./settings"); -exports.Settings = settings_1.default; -function scandir(path, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - async.read(path, getSettings(), optionsOrSettingsOrCallback); - return; - } - async.read(path, getSettings(optionsOrSettingsOrCallback), callback); -} -exports.scandir = scandir; -function scandirSync(path, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - return sync.read(path, settings); -} -exports.scandirSync = scandirSync; -function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); -} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts deleted file mode 100644 index 5829676df..000000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -import type Settings from '../settings'; -import type { Entry } from '../types'; -export declare type AsyncCallback = (error: NodeJS.ErrnoException, entries: Entry[]) => void; -export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void; -export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void; -export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.js b/node_modules/@nodelib/fs.scandir/out/providers/async.js deleted file mode 100644 index e8e2f0a9c..000000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/async.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; -const fsStat = require("@nodelib/fs.stat"); -const rpl = require("run-parallel"); -const constants_1 = require("../constants"); -const utils = require("../utils"); -const common = require("./common"); -function read(directory, settings, callback) { - if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { - readdirWithFileTypes(directory, settings, callback); - return; - } - readdir(directory, settings, callback); -} -exports.read = read; -function readdirWithFileTypes(directory, settings, callback) { - settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { - if (readdirError !== null) { - callFailureCallback(callback, readdirError); - return; - } - const entries = dirents.map((dirent) => ({ - dirent, - name: dirent.name, - path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) - })); - if (!settings.followSymbolicLinks) { - callSuccessCallback(callback, entries); - return; - } - const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); - rpl(tasks, (rplError, rplEntries) => { - if (rplError !== null) { - callFailureCallback(callback, rplError); - return; - } - callSuccessCallback(callback, rplEntries); - }); - }); -} -exports.readdirWithFileTypes = readdirWithFileTypes; -function makeRplTaskEntry(entry, settings) { - return (done) => { - if (!entry.dirent.isSymbolicLink()) { - done(null, entry); - return; - } - settings.fs.stat(entry.path, (statError, stats) => { - if (statError !== null) { - if (settings.throwErrorOnBrokenSymbolicLink) { - done(statError); - return; - } - done(null, entry); - return; - } - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); - done(null, entry); - }); - }; -} -function readdir(directory, settings, callback) { - settings.fs.readdir(directory, (readdirError, names) => { - if (readdirError !== null) { - callFailureCallback(callback, readdirError); - return; - } - const tasks = names.map((name) => { - const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); - return (done) => { - fsStat.stat(path, settings.fsStatSettings, (error, stats) => { - if (error !== null) { - done(error); - return; - } - const entry = { - name, - path, - dirent: utils.fs.createDirentFromStats(name, stats) - }; - if (settings.stats) { - entry.stats = stats; - } - done(null, entry); - }); - }; - }); - rpl(tasks, (rplError, entries) => { - if (rplError !== null) { - callFailureCallback(callback, rplError); - return; - } - callSuccessCallback(callback, entries); - }); - }); -} -exports.readdir = readdir; -function callFailureCallback(callback, error) { - callback(error); -} -function callSuccessCallback(callback, result) { - callback(null, result); -} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts deleted file mode 100644 index 2b4d08b57..000000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.js b/node_modules/@nodelib/fs.scandir/out/providers/common.js deleted file mode 100644 index 8724cb59a..000000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/common.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.joinPathSegments = void 0; -function joinPathSegments(a, b, separator) { - /** - * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). - */ - if (a.endsWith(separator)) { - return a + b; - } - return a + separator + b; -} -exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts deleted file mode 100644 index e05c8f072..000000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type Settings from '../settings'; -import type { Entry } from '../types'; -export declare function read(directory: string, settings: Settings): Entry[]; -export declare function readdirWithFileTypes(directory: string, settings: Settings): Entry[]; -export declare function readdir(directory: string, settings: Settings): Entry[]; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.js b/node_modules/@nodelib/fs.scandir/out/providers/sync.js deleted file mode 100644 index 146db3434..000000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/sync.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; -const fsStat = require("@nodelib/fs.stat"); -const constants_1 = require("../constants"); -const utils = require("../utils"); -const common = require("./common"); -function read(directory, settings) { - if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { - return readdirWithFileTypes(directory, settings); - } - return readdir(directory, settings); -} -exports.read = read; -function readdirWithFileTypes(directory, settings) { - const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); - return dirents.map((dirent) => { - const entry = { - dirent, - name: dirent.name, - path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) - }; - if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { - try { - const stats = settings.fs.statSync(entry.path); - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); - } - catch (error) { - if (settings.throwErrorOnBrokenSymbolicLink) { - throw error; - } - } - } - return entry; - }); -} -exports.readdirWithFileTypes = readdirWithFileTypes; -function readdir(directory, settings) { - const names = settings.fs.readdirSync(directory); - return names.map((name) => { - const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); - const stats = fsStat.statSync(entryPath, settings.fsStatSettings); - const entry = { - name, - path: entryPath, - dirent: utils.fs.createDirentFromStats(name, stats) - }; - if (settings.stats) { - entry.stats = stats; - } - return entry; - }); -} -exports.readdir = readdir; diff --git a/node_modules/@nodelib/fs.scandir/out/settings.d.ts b/node_modules/@nodelib/fs.scandir/out/settings.d.ts deleted file mode 100644 index a0db11559..000000000 --- a/node_modules/@nodelib/fs.scandir/out/settings.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as fsStat from '@nodelib/fs.stat'; -import * as fs from './adapters/fs'; -export interface Options { - followSymbolicLinks?: boolean; - fs?: Partial; - pathSegmentSeparator?: string; - stats?: boolean; - throwErrorOnBrokenSymbolicLink?: boolean; -} -export default class Settings { - private readonly _options; - readonly followSymbolicLinks: boolean; - readonly fs: fs.FileSystemAdapter; - readonly pathSegmentSeparator: string; - readonly stats: boolean; - readonly throwErrorOnBrokenSymbolicLink: boolean; - readonly fsStatSettings: fsStat.Settings; - constructor(_options?: Options); - private _getValue; -} diff --git a/node_modules/@nodelib/fs.scandir/out/settings.js b/node_modules/@nodelib/fs.scandir/out/settings.js deleted file mode 100644 index 15a3e8cde..000000000 --- a/node_modules/@nodelib/fs.scandir/out/settings.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = require("path"); -const fsStat = require("@nodelib/fs.stat"); -const fs = require("./adapters/fs"); -class Settings { - constructor(_options = {}) { - this._options = _options; - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); - this.fs = fs.createFileSystemAdapter(this._options.fs); - this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); - this.stats = this._getValue(this._options.stats, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); - this.fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this.followSymbolicLinks, - fs: this.fs, - throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink - }); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } -} -exports.default = Settings; diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.d.ts b/node_modules/@nodelib/fs.scandir/out/types/index.d.ts deleted file mode 100644 index f326c5e5e..000000000 --- a/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// -import type * as fs from 'fs'; -export interface Entry { - dirent: Dirent; - name: string; - path: string; - stats?: Stats; -} -export declare type Stats = fs.Stats; -export declare type ErrnoException = NodeJS.ErrnoException; -export interface Dirent { - isBlockDevice: () => boolean; - isCharacterDevice: () => boolean; - isDirectory: () => boolean; - isFIFO: () => boolean; - isFile: () => boolean; - isSocket: () => boolean; - isSymbolicLink: () => boolean; - name: string; -} diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.js b/node_modules/@nodelib/fs.scandir/out/types/index.js deleted file mode 100644 index c8ad2e549..000000000 --- a/node_modules/@nodelib/fs.scandir/out/types/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts deleted file mode 100644 index bb863f157..000000000 --- a/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Dirent, Stats } from '../types'; -export declare function createDirentFromStats(name: string, stats: Stats): Dirent; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.js b/node_modules/@nodelib/fs.scandir/out/utils/fs.js deleted file mode 100644 index ace7c74d6..000000000 --- a/node_modules/@nodelib/fs.scandir/out/utils/fs.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createDirentFromStats = void 0; -class DirentFromStats { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); - } -} -function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); -} -exports.createDirentFromStats = createDirentFromStats; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts deleted file mode 100644 index 1b41954e7..000000000 --- a/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as fs from './fs'; -export { fs }; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.js b/node_modules/@nodelib/fs.scandir/out/utils/index.js deleted file mode 100644 index f5de129f4..000000000 --- a/node_modules/@nodelib/fs.scandir/out/utils/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.fs = void 0; -const fs = require("./fs"); -exports.fs = fs; diff --git a/node_modules/@nodelib/fs.scandir/package.json b/node_modules/@nodelib/fs.scandir/package.json deleted file mode 100644 index d3a89241b..000000000 --- a/node_modules/@nodelib/fs.scandir/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@nodelib/fs.scandir", - "version": "2.1.5", - "description": "List files and directories inside the specified directory", - "license": "MIT", - "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir", - "keywords": [ - "NodeLib", - "fs", - "FileSystem", - "file system", - "scandir", - "readdir", - "dirent" - ], - "engines": { - "node": ">= 8" - }, - "files": [ - "out/**", - "!out/**/*.map", - "!out/**/*.spec.*" - ], - "main": "out/index.js", - "typings": "out/index.d.ts", - "scripts": { - "clean": "rimraf {tsconfig.tsbuildinfo,out}", - "lint": "eslint \"src/**/*.ts\" --cache", - "compile": "tsc -b .", - "compile:watch": "tsc -p . --watch --sourceMap", - "test": "mocha \"out/**/*.spec.js\" -s 0", - "build": "npm run clean && npm run compile && npm run lint && npm test", - "watch": "npm run clean && npm run compile:watch" - }, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "devDependencies": { - "@nodelib/fs.macchiato": "1.0.4", - "@types/run-parallel": "^1.1.0" - }, - "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" -} diff --git a/node_modules/@nodelib/fs.stat/LICENSE b/node_modules/@nodelib/fs.stat/LICENSE deleted file mode 100644 index 65a999460..000000000 --- a/node_modules/@nodelib/fs.stat/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Denis Malinochkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@nodelib/fs.stat/README.md b/node_modules/@nodelib/fs.stat/README.md deleted file mode 100644 index 686f0471d..000000000 --- a/node_modules/@nodelib/fs.stat/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# @nodelib/fs.stat - -> Get the status of a file with some features. - -## :bulb: Highlights - -Wrapper around standard method `fs.lstat` and `fs.stat` with some features. - -* :beginner: Normally follows symbolic link. -* :gear: Can safely work with broken symbolic link. - -## Install - -```console -npm install @nodelib/fs.stat -``` - -## Usage - -```ts -import * as fsStat from '@nodelib/fs.stat'; - -fsStat.stat('path', (error, stats) => { /* … */ }); -``` - -## API - -### .stat(path, [optionsOrSettings], callback) - -Returns an instance of `fs.Stats` class for provided path with standard callback-style. - -```ts -fsStat.stat('path', (error, stats) => { /* … */ }); -fsStat.stat('path', {}, (error, stats) => { /* … */ }); -fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ }); -``` - -### .statSync(path, [optionsOrSettings]) - -Returns an instance of `fs.Stats` class for provided path. - -```ts -const stats = fsStat.stat('path'); -const stats = fsStat.stat('path', {}); -const stats = fsStat.stat('path', new fsStat.Settings()); -``` - -#### path - -* Required: `true` -* Type: `string | Buffer | URL` - -A path to a file. If a URL is provided, it must use the `file:` protocol. - -#### optionsOrSettings - -* Required: `false` -* Type: `Options | Settings` -* Default: An instance of `Settings` class - -An [`Options`](#options) object or an instance of [`Settings`](#settings) class. - -> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. - -### Settings([options]) - -A class of full settings of the package. - -```ts -const settings = new fsStat.Settings({ followSymbolicLink: false }); - -const stats = fsStat.stat('path', settings); -``` - -## Options - -### `followSymbolicLink` - -* Type: `boolean` -* Default: `true` - -Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`. - -### `markSymbolicLink` - -* Type: `boolean` -* Default: `false` - -Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`). - -> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link. - -### `throwErrorOnBrokenSymbolicLink` - -* Type: `boolean` -* Default: `true` - -Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. - -### `fs` - -* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) -* Default: A default FS methods - -By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. - -```ts -interface FileSystemAdapter { - lstat?: typeof fs.lstat; - stat?: typeof fs.stat; - lstatSync?: typeof fs.lstatSync; - statSync?: typeof fs.statSync; -} - -const settings = new fsStat.Settings({ - fs: { lstat: fakeLstat } -}); -``` - -## Changelog - -See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. - -## License - -This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts deleted file mode 100644 index 3af759c95..000000000 --- a/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// -import * as fs from 'fs'; -import type { ErrnoException } from '../types'; -export declare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException | null, stats: fs.Stats) => void) => void; -export declare type StatSynchronousMethod = (path: string) => fs.Stats; -export interface FileSystemAdapter { - lstat: StatAsynchronousMethod; - stat: StatAsynchronousMethod; - lstatSync: StatSynchronousMethod; - statSync: StatSynchronousMethod; -} -export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; -export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.js b/node_modules/@nodelib/fs.stat/out/adapters/fs.js deleted file mode 100644 index 8dc08c8ca..000000000 --- a/node_modules/@nodelib/fs.stat/out/adapters/fs.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; -const fs = require("fs"); -exports.FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - stat: fs.stat, - lstatSync: fs.lstatSync, - statSync: fs.statSync -}; -function createFileSystemAdapter(fsMethods) { - if (fsMethods === undefined) { - return exports.FILE_SYSTEM_ADAPTER; - } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); -} -exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/index.d.ts b/node_modules/@nodelib/fs.stat/out/index.d.ts deleted file mode 100644 index f95db995c..000000000 --- a/node_modules/@nodelib/fs.stat/out/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod } from './adapters/fs'; -import * as async from './providers/async'; -import Settings, { Options } from './settings'; -import type { Stats } from './types'; -declare type AsyncCallback = async.AsyncCallback; -declare function stat(path: string, callback: AsyncCallback): void; -declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; -declare namespace stat { - function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; -} -declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats; -export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod, Options, Stats }; diff --git a/node_modules/@nodelib/fs.stat/out/index.js b/node_modules/@nodelib/fs.stat/out/index.js deleted file mode 100644 index b23f7510d..000000000 --- a/node_modules/@nodelib/fs.stat/out/index.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.statSync = exports.stat = exports.Settings = void 0; -const async = require("./providers/async"); -const sync = require("./providers/sync"); -const settings_1 = require("./settings"); -exports.Settings = settings_1.default; -function stat(path, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - async.read(path, getSettings(), optionsOrSettingsOrCallback); - return; - } - async.read(path, getSettings(optionsOrSettingsOrCallback), callback); -} -exports.stat = stat; -function statSync(path, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - return sync.read(path, settings); -} -exports.statSync = statSync; -function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); -} diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.d.ts b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts deleted file mode 100644 index 85423ce11..000000000 --- a/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type Settings from '../settings'; -import type { ErrnoException, Stats } from '../types'; -export declare type AsyncCallback = (error: ErrnoException, stats: Stats) => void; -export declare function read(path: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.js b/node_modules/@nodelib/fs.stat/out/providers/async.js deleted file mode 100644 index 983ff0e6c..000000000 --- a/node_modules/@nodelib/fs.stat/out/providers/async.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.read = void 0; -function read(path, settings, callback) { - settings.fs.lstat(path, (lstatError, lstat) => { - if (lstatError !== null) { - callFailureCallback(callback, lstatError); - return; - } - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { - callSuccessCallback(callback, lstat); - return; - } - settings.fs.stat(path, (statError, stat) => { - if (statError !== null) { - if (settings.throwErrorOnBrokenSymbolicLink) { - callFailureCallback(callback, statError); - return; - } - callSuccessCallback(callback, lstat); - return; - } - if (settings.markSymbolicLink) { - stat.isSymbolicLink = () => true; - } - callSuccessCallback(callback, stat); - }); - }); -} -exports.read = read; -function callFailureCallback(callback, error) { - callback(error); -} -function callSuccessCallback(callback, result) { - callback(null, result); -} diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts deleted file mode 100644 index 428c3d792..000000000 --- a/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type Settings from '../settings'; -import type { Stats } from '../types'; -export declare function read(path: string, settings: Settings): Stats; diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.js b/node_modules/@nodelib/fs.stat/out/providers/sync.js deleted file mode 100644 index 1521c3616..000000000 --- a/node_modules/@nodelib/fs.stat/out/providers/sync.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.read = void 0; -function read(path, settings) { - const lstat = settings.fs.lstatSync(path); - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { - return lstat; - } - try { - const stat = settings.fs.statSync(path); - if (settings.markSymbolicLink) { - stat.isSymbolicLink = () => true; - } - return stat; - } - catch (error) { - if (!settings.throwErrorOnBrokenSymbolicLink) { - return lstat; - } - throw error; - } -} -exports.read = read; diff --git a/node_modules/@nodelib/fs.stat/out/settings.d.ts b/node_modules/@nodelib/fs.stat/out/settings.d.ts deleted file mode 100644 index f4b3d4443..000000000 --- a/node_modules/@nodelib/fs.stat/out/settings.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import * as fs from './adapters/fs'; -export interface Options { - followSymbolicLink?: boolean; - fs?: Partial; - markSymbolicLink?: boolean; - throwErrorOnBrokenSymbolicLink?: boolean; -} -export default class Settings { - private readonly _options; - readonly followSymbolicLink: boolean; - readonly fs: fs.FileSystemAdapter; - readonly markSymbolicLink: boolean; - readonly throwErrorOnBrokenSymbolicLink: boolean; - constructor(_options?: Options); - private _getValue; -} diff --git a/node_modules/@nodelib/fs.stat/out/settings.js b/node_modules/@nodelib/fs.stat/out/settings.js deleted file mode 100644 index 111ec09ca..000000000 --- a/node_modules/@nodelib/fs.stat/out/settings.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const fs = require("./adapters/fs"); -class Settings { - constructor(_options = {}) { - this._options = _options; - this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); - this.fs = fs.createFileSystemAdapter(this._options.fs); - this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } -} -exports.default = Settings; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.d.ts b/node_modules/@nodelib/fs.stat/out/types/index.d.ts deleted file mode 100644 index 74c08ed2f..000000000 --- a/node_modules/@nodelib/fs.stat/out/types/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -import type * as fs from 'fs'; -export declare type Stats = fs.Stats; -export declare type ErrnoException = NodeJS.ErrnoException; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.js b/node_modules/@nodelib/fs.stat/out/types/index.js deleted file mode 100644 index c8ad2e549..000000000 --- a/node_modules/@nodelib/fs.stat/out/types/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.stat/package.json b/node_modules/@nodelib/fs.stat/package.json deleted file mode 100644 index f2540c289..000000000 --- a/node_modules/@nodelib/fs.stat/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@nodelib/fs.stat", - "version": "2.0.5", - "description": "Get the status of a file with some features", - "license": "MIT", - "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat", - "keywords": [ - "NodeLib", - "fs", - "FileSystem", - "file system", - "stat" - ], - "engines": { - "node": ">= 8" - }, - "files": [ - "out/**", - "!out/**/*.map", - "!out/**/*.spec.*" - ], - "main": "out/index.js", - "typings": "out/index.d.ts", - "scripts": { - "clean": "rimraf {tsconfig.tsbuildinfo,out}", - "lint": "eslint \"src/**/*.ts\" --cache", - "compile": "tsc -b .", - "compile:watch": "tsc -p . --watch --sourceMap", - "test": "mocha \"out/**/*.spec.js\" -s 0", - "build": "npm run clean && npm run compile && npm run lint && npm test", - "watch": "npm run clean && npm run compile:watch" - }, - "devDependencies": { - "@nodelib/fs.macchiato": "1.0.4" - }, - "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" -} diff --git a/node_modules/@nodelib/fs.walk/LICENSE b/node_modules/@nodelib/fs.walk/LICENSE deleted file mode 100644 index 65a999460..000000000 --- a/node_modules/@nodelib/fs.walk/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Denis Malinochkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/@nodelib/fs.walk/README.md b/node_modules/@nodelib/fs.walk/README.md deleted file mode 100644 index 6ccc08db4..000000000 --- a/node_modules/@nodelib/fs.walk/README.md +++ /dev/null @@ -1,215 +0,0 @@ -# @nodelib/fs.walk - -> A library for efficiently walking a directory recursively. - -## :bulb: Highlights - -* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). -* :rocket: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type for performance reasons. See [`old` and `modern` mode](https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode). -* :gear: Built-in directories/files and error filtering system. -* :link: Can safely work with broken symbolic links. - -## Install - -```console -npm install @nodelib/fs.walk -``` - -## Usage - -```ts -import * as fsWalk from '@nodelib/fs.walk'; - -fsWalk.walk('path', (error, entries) => { /* … */ }); -``` - -## API - -### .walk(path, [optionsOrSettings], callback) - -Reads the directory recursively and asynchronously. Requires a callback function. - -> :book: If you want to use the Promise API, use `util.promisify`. - -```ts -fsWalk.walk('path', (error, entries) => { /* … */ }); -fsWalk.walk('path', {}, (error, entries) => { /* … */ }); -fsWalk.walk('path', new fsWalk.Settings(), (error, entries) => { /* … */ }); -``` - -### .walkStream(path, [optionsOrSettings]) - -Reads the directory recursively and asynchronously. [Readable Stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_readable_streams) is used as a provider. - -```ts -const stream = fsWalk.walkStream('path'); -const stream = fsWalk.walkStream('path', {}); -const stream = fsWalk.walkStream('path', new fsWalk.Settings()); -``` - -### .walkSync(path, [optionsOrSettings]) - -Reads the directory recursively and synchronously. Returns an array of entries. - -```ts -const entries = fsWalk.walkSync('path'); -const entries = fsWalk.walkSync('path', {}); -const entries = fsWalk.walkSync('path', new fsWalk.Settings()); -``` - -#### path - -* Required: `true` -* Type: `string | Buffer | URL` - -A path to a file. If a URL is provided, it must use the `file:` protocol. - -#### optionsOrSettings - -* Required: `false` -* Type: `Options | Settings` -* Default: An instance of `Settings` class - -An [`Options`](#options) object or an instance of [`Settings`](#settings) class. - -> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. - -### Settings([options]) - -A class of full settings of the package. - -```ts -const settings = new fsWalk.Settings({ followSymbolicLinks: true }); - -const entries = fsWalk.walkSync('path', settings); -``` - -## Entry - -* `name` — The name of the entry (`unknown.txt`). -* `path` — The path of the entry relative to call directory (`root/unknown.txt`). -* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. -* [`stats`] — An instance of `fs.Stats` class. - -## Options - -### basePath - -* Type: `string` -* Default: `undefined` - -By default, all paths are built relative to the root path. You can use this option to set custom root path. - -In the example below we read the files from the `root` directory, but in the results the root path will be `custom`. - -```ts -fsWalk.walkSync('root'); // → ['root/file.txt'] -fsWalk.walkSync('root', { basePath: 'custom' }); // → ['custom/file.txt'] -``` - -### concurrency - -* Type: `number` -* Default: `Infinity` - -The maximum number of concurrent calls to `fs.readdir`. - -> :book: The higher the number, the higher performance and the load on the File System. If you want to read in quiet mode, set the value to `4 * os.cpus().length` (4 is default size of [thread pool work scheduling](http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling)). - -### deepFilter - -* Type: [`DeepFilterFunction`](./src/settings.ts) -* Default: `undefined` - -A function that indicates whether the directory will be read deep or not. - -```ts -// Skip all directories that starts with `node_modules` -const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules'); -``` - -### entryFilter - -* Type: [`EntryFilterFunction`](./src/settings.ts) -* Default: `undefined` - -A function that indicates whether the entry will be included to results or not. - -```ts -// Exclude all `.js` files from results -const filter: EntryFilterFunction = (entry) => !entry.name.endsWith('.js'); -``` - -### errorFilter - -* Type: [`ErrorFilterFunction`](./src/settings.ts) -* Default: `undefined` - -A function that allows you to skip errors that occur when reading directories. - -For example, you can skip `ENOENT` errors if required: - -```ts -// Skip all ENOENT errors -const filter: ErrorFilterFunction = (error) => error.code == 'ENOENT'; -``` - -### stats - -* Type: `boolean` -* Default: `false` - -Adds an instance of `fs.Stats` class to the [`Entry`](#entry). - -> :book: Always use `fs.readdir` with additional `fs.lstat/fs.stat` calls to determine the entry type. - -### followSymbolicLinks - -* Type: `boolean` -* Default: `false` - -Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. - -### `throwErrorOnBrokenSymbolicLink` - -* Type: `boolean` -* Default: `true` - -Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. - -### `pathSegmentSeparator` - -* Type: `string` -* Default: `path.sep` - -By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. - -### `fs` - -* Type: `FileSystemAdapter` -* Default: A default FS methods - -By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. - -```ts -interface FileSystemAdapter { - lstat: typeof fs.lstat; - stat: typeof fs.stat; - lstatSync: typeof fs.lstatSync; - statSync: typeof fs.statSync; - readdir: typeof fs.readdir; - readdirSync: typeof fs.readdirSync; -} - -const settings = new fsWalk.Settings({ - fs: { lstat: fakeLstat } -}); -``` - -## Changelog - -See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. - -## License - -This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.walk/out/index.d.ts b/node_modules/@nodelib/fs.walk/out/index.d.ts deleted file mode 100644 index 8864c7bff..000000000 --- a/node_modules/@nodelib/fs.walk/out/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// -import type { Readable } from 'stream'; -import type { Dirent, FileSystemAdapter } from '@nodelib/fs.scandir'; -import { AsyncCallback } from './providers/async'; -import Settings, { DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction, Options } from './settings'; -import type { Entry } from './types'; -declare function walk(directory: string, callback: AsyncCallback): void; -declare function walk(directory: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; -declare namespace walk { - function __promisify__(directory: string, optionsOrSettings?: Options | Settings): Promise; -} -declare function walkSync(directory: string, optionsOrSettings?: Options | Settings): Entry[]; -declare function walkStream(directory: string, optionsOrSettings?: Options | Settings): Readable; -export { walk, walkSync, walkStream, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options, DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction }; diff --git a/node_modules/@nodelib/fs.walk/out/index.js b/node_modules/@nodelib/fs.walk/out/index.js deleted file mode 100644 index 15207874a..000000000 --- a/node_modules/@nodelib/fs.walk/out/index.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; -const async_1 = require("./providers/async"); -const stream_1 = require("./providers/stream"); -const sync_1 = require("./providers/sync"); -const settings_1 = require("./settings"); -exports.Settings = settings_1.default; -function walk(directory, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); - return; - } - new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); -} -exports.walk = walk; -function walkSync(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new sync_1.default(directory, settings); - return provider.read(); -} -exports.walkSync = walkSync; -function walkStream(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new stream_1.default(directory, settings); - return provider.read(); -} -exports.walkStream = walkStream; -function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.d.ts b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts deleted file mode 100644 index 0f6717d78..000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import AsyncReader from '../readers/async'; -import type Settings from '../settings'; -import type { Entry, Errno } from '../types'; -export declare type AsyncCallback = (error: Errno, entries: Entry[]) => void; -export default class AsyncProvider { - private readonly _root; - private readonly _settings; - protected readonly _reader: AsyncReader; - private readonly _storage; - constructor(_root: string, _settings: Settings); - read(callback: AsyncCallback): void; -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.js b/node_modules/@nodelib/fs.walk/out/providers/async.js deleted file mode 100644 index 51d3be51a..000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/async.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const async_1 = require("../readers/async"); -class AsyncProvider { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new async_1.default(this._root, this._settings); - this._storage = []; - } - read(callback) { - this._reader.onError((error) => { - callFailureCallback(callback, error); - }); - this._reader.onEntry((entry) => { - this._storage.push(entry); - }); - this._reader.onEnd(() => { - callSuccessCallback(callback, this._storage); - }); - this._reader.read(); - } -} -exports.default = AsyncProvider; -function callFailureCallback(callback, error) { - callback(error); -} -function callSuccessCallback(callback, entries) { - callback(null, entries); -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.d.ts b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts deleted file mode 100644 index 874f60c5a..000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import AsyncProvider from './async'; -import StreamProvider from './stream'; -import SyncProvider from './sync'; -export { AsyncProvider, StreamProvider, SyncProvider }; diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.js b/node_modules/@nodelib/fs.walk/out/providers/index.js deleted file mode 100644 index 4c2529ce8..000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/index.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SyncProvider = exports.StreamProvider = exports.AsyncProvider = void 0; -const async_1 = require("./async"); -exports.AsyncProvider = async_1.default; -const stream_1 = require("./stream"); -exports.StreamProvider = stream_1.default; -const sync_1 = require("./sync"); -exports.SyncProvider = sync_1.default; diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts deleted file mode 100644 index 294185f85..000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// -import { Readable } from 'stream'; -import AsyncReader from '../readers/async'; -import type Settings from '../settings'; -export default class StreamProvider { - private readonly _root; - private readonly _settings; - protected readonly _reader: AsyncReader; - protected readonly _stream: Readable; - constructor(_root: string, _settings: Settings); - read(): Readable; -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.js b/node_modules/@nodelib/fs.walk/out/providers/stream.js deleted file mode 100644 index 51298b0f5..000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/stream.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = require("stream"); -const async_1 = require("../readers/async"); -class StreamProvider { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new async_1.default(this._root, this._settings); - this._stream = new stream_1.Readable({ - objectMode: true, - read: () => { }, - destroy: () => { - if (!this._reader.isDestroyed) { - this._reader.destroy(); - } - } - }); - } - read() { - this._reader.onError((error) => { - this._stream.emit('error', error); - }); - this._reader.onEntry((entry) => { - this._stream.push(entry); - }); - this._reader.onEnd(() => { - this._stream.push(null); - }); - this._reader.read(); - return this._stream; - } -} -exports.default = StreamProvider; diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts deleted file mode 100644 index 551c42e41..000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import SyncReader from '../readers/sync'; -import type Settings from '../settings'; -import type { Entry } from '../types'; -export default class SyncProvider { - private readonly _root; - private readonly _settings; - protected readonly _reader: SyncReader; - constructor(_root: string, _settings: Settings); - read(): Entry[]; -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.js b/node_modules/@nodelib/fs.walk/out/providers/sync.js deleted file mode 100644 index faab6ca2a..000000000 --- a/node_modules/@nodelib/fs.walk/out/providers/sync.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const sync_1 = require("../readers/sync"); -class SyncProvider { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new sync_1.default(this._root, this._settings); - } - read() { - return this._reader.read(); - } -} -exports.default = SyncProvider; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.d.ts b/node_modules/@nodelib/fs.walk/out/readers/async.d.ts deleted file mode 100644 index 9acf4e6c2..000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// -import { EventEmitter } from 'events'; -import * as fsScandir from '@nodelib/fs.scandir'; -import type Settings from '../settings'; -import type { Entry, Errno } from '../types'; -import Reader from './reader'; -declare type EntryEventCallback = (entry: Entry) => void; -declare type ErrorEventCallback = (error: Errno) => void; -declare type EndEventCallback = () => void; -export default class AsyncReader extends Reader { - protected readonly _settings: Settings; - protected readonly _scandir: typeof fsScandir.scandir; - protected readonly _emitter: EventEmitter; - private readonly _queue; - private _isFatalError; - private _isDestroyed; - constructor(_root: string, _settings: Settings); - read(): EventEmitter; - get isDestroyed(): boolean; - destroy(): void; - onEntry(callback: EntryEventCallback): void; - onError(callback: ErrorEventCallback): void; - onEnd(callback: EndEventCallback): void; - private _pushToQueue; - private _worker; - private _handleError; - private _handleEntry; - private _emitEntry; -} -export {}; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.js b/node_modules/@nodelib/fs.walk/out/readers/async.js deleted file mode 100644 index ebe8dd573..000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/async.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const events_1 = require("events"); -const fsScandir = require("@nodelib/fs.scandir"); -const fastq = require("fastq"); -const common = require("./common"); -const reader_1 = require("./reader"); -class AsyncReader extends reader_1.default { - constructor(_root, _settings) { - super(_root, _settings); - this._settings = _settings; - this._scandir = fsScandir.scandir; - this._emitter = new events_1.EventEmitter(); - this._queue = fastq(this._worker.bind(this), this._settings.concurrency); - this._isFatalError = false; - this._isDestroyed = false; - this._queue.drain = () => { - if (!this._isFatalError) { - this._emitter.emit('end'); - } - }; - } - read() { - this._isFatalError = false; - this._isDestroyed = false; - setImmediate(() => { - this._pushToQueue(this._root, this._settings.basePath); - }); - return this._emitter; - } - get isDestroyed() { - return this._isDestroyed; - } - destroy() { - if (this._isDestroyed) { - throw new Error('The reader is already destroyed'); - } - this._isDestroyed = true; - this._queue.killAndDrain(); - } - onEntry(callback) { - this._emitter.on('entry', callback); - } - onError(callback) { - this._emitter.once('error', callback); - } - onEnd(callback) { - this._emitter.once('end', callback); - } - _pushToQueue(directory, base) { - const queueItem = { directory, base }; - this._queue.push(queueItem, (error) => { - if (error !== null) { - this._handleError(error); - } - }); - } - _worker(item, done) { - this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { - if (error !== null) { - done(error, undefined); - return; - } - for (const entry of entries) { - this._handleEntry(entry, item.base); - } - done(null, undefined); - }); - } - _handleError(error) { - if (this._isDestroyed || !common.isFatalError(this._settings, error)) { - return; - } - this._isFatalError = true; - this._isDestroyed = true; - this._emitter.emit('error', error); - } - _handleEntry(entry, base) { - if (this._isDestroyed || this._isFatalError) { - return; - } - const fullpath = entry.path; - if (base !== undefined) { - entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); - } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { - this._emitEntry(entry); - } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { - this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); - } - } - _emitEntry(entry) { - this._emitter.emit('entry', entry); - } -} -exports.default = AsyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.d.ts b/node_modules/@nodelib/fs.walk/out/readers/common.d.ts deleted file mode 100644 index 5985f97c4..000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { FilterFunction } from '../settings'; -import type Settings from '../settings'; -import type { Errno } from '../types'; -export declare function isFatalError(settings: Settings, error: Errno): boolean; -export declare function isAppliedFilter(filter: FilterFunction | null, value: T): boolean; -export declare function replacePathSegmentSeparator(filepath: string, separator: string): string; -export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.js b/node_modules/@nodelib/fs.walk/out/readers/common.js deleted file mode 100644 index a93572f48..000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/common.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; -function isFatalError(settings, error) { - if (settings.errorFilter === null) { - return true; - } - return !settings.errorFilter(error); -} -exports.isFatalError = isFatalError; -function isAppliedFilter(filter, value) { - return filter === null || filter(value); -} -exports.isAppliedFilter = isAppliedFilter; -function replacePathSegmentSeparator(filepath, separator) { - return filepath.split(/[/\\]/).join(separator); -} -exports.replacePathSegmentSeparator = replacePathSegmentSeparator; -function joinPathSegments(a, b, separator) { - if (a === '') { - return b; - } - /** - * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). - */ - if (a.endsWith(separator)) { - return a + b; - } - return a + separator + b; -} -exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts b/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts deleted file mode 100644 index e1f383b25..000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type Settings from '../settings'; -export default class Reader { - protected readonly _root: string; - protected readonly _settings: Settings; - constructor(_root: string, _settings: Settings); -} diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.js b/node_modules/@nodelib/fs.walk/out/readers/reader.js deleted file mode 100644 index 782f07cbf..000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/reader.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const common = require("./common"); -class Reader { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); - } -} -exports.default = Reader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts deleted file mode 100644 index af4103353..000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as fsScandir from '@nodelib/fs.scandir'; -import type { Entry } from '../types'; -import Reader from './reader'; -export default class SyncReader extends Reader { - protected readonly _scandir: typeof fsScandir.scandirSync; - private readonly _storage; - private readonly _queue; - read(): Entry[]; - private _pushToQueue; - private _handleQueue; - private _handleDirectory; - private _handleError; - private _handleEntry; - private _pushToStorage; -} diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.js b/node_modules/@nodelib/fs.walk/out/readers/sync.js deleted file mode 100644 index 9a8d5a6f1..000000000 --- a/node_modules/@nodelib/fs.walk/out/readers/sync.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const fsScandir = require("@nodelib/fs.scandir"); -const common = require("./common"); -const reader_1 = require("./reader"); -class SyncReader extends reader_1.default { - constructor() { - super(...arguments); - this._scandir = fsScandir.scandirSync; - this._storage = []; - this._queue = new Set(); - } - read() { - this._pushToQueue(this._root, this._settings.basePath); - this._handleQueue(); - return this._storage; - } - _pushToQueue(directory, base) { - this._queue.add({ directory, base }); - } - _handleQueue() { - for (const item of this._queue.values()) { - this._handleDirectory(item.directory, item.base); - } - } - _handleDirectory(directory, base) { - try { - const entries = this._scandir(directory, this._settings.fsScandirSettings); - for (const entry of entries) { - this._handleEntry(entry, base); - } - } - catch (error) { - this._handleError(error); - } - } - _handleError(error) { - if (!common.isFatalError(this._settings, error)) { - return; - } - throw error; - } - _handleEntry(entry, base) { - const fullpath = entry.path; - if (base !== undefined) { - entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); - } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { - this._pushToStorage(entry); - } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { - this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); - } - } - _pushToStorage(entry) { - this._storage.push(entry); - } -} -exports.default = SyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/settings.d.ts b/node_modules/@nodelib/fs.walk/out/settings.d.ts deleted file mode 100644 index d1c4b45f6..000000000 --- a/node_modules/@nodelib/fs.walk/out/settings.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import * as fsScandir from '@nodelib/fs.scandir'; -import type { Entry, Errno } from './types'; -export declare type FilterFunction = (value: T) => boolean; -export declare type DeepFilterFunction = FilterFunction; -export declare type EntryFilterFunction = FilterFunction; -export declare type ErrorFilterFunction = FilterFunction; -export interface Options { - basePath?: string; - concurrency?: number; - deepFilter?: DeepFilterFunction; - entryFilter?: EntryFilterFunction; - errorFilter?: ErrorFilterFunction; - followSymbolicLinks?: boolean; - fs?: Partial; - pathSegmentSeparator?: string; - stats?: boolean; - throwErrorOnBrokenSymbolicLink?: boolean; -} -export default class Settings { - private readonly _options; - readonly basePath?: string; - readonly concurrency: number; - readonly deepFilter: DeepFilterFunction | null; - readonly entryFilter: EntryFilterFunction | null; - readonly errorFilter: ErrorFilterFunction | null; - readonly pathSegmentSeparator: string; - readonly fsScandirSettings: fsScandir.Settings; - constructor(_options?: Options); - private _getValue; -} diff --git a/node_modules/@nodelib/fs.walk/out/settings.js b/node_modules/@nodelib/fs.walk/out/settings.js deleted file mode 100644 index d7a85c81e..000000000 --- a/node_modules/@nodelib/fs.walk/out/settings.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = require("path"); -const fsScandir = require("@nodelib/fs.scandir"); -class Settings { - constructor(_options = {}) { - this._options = _options; - this.basePath = this._getValue(this._options.basePath, undefined); - this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); - this.deepFilter = this._getValue(this._options.deepFilter, null); - this.entryFilter = this._getValue(this._options.entryFilter, null); - this.errorFilter = this._getValue(this._options.errorFilter, null); - this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); - this.fsScandirSettings = new fsScandir.Settings({ - followSymbolicLinks: this._options.followSymbolicLinks, - fs: this._options.fs, - pathSegmentSeparator: this._options.pathSegmentSeparator, - stats: this._options.stats, - throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink - }); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } -} -exports.default = Settings; diff --git a/node_modules/@nodelib/fs.walk/out/types/index.d.ts b/node_modules/@nodelib/fs.walk/out/types/index.d.ts deleted file mode 100644 index 6ee9bd3f9..000000000 --- a/node_modules/@nodelib/fs.walk/out/types/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// -import type * as scandir from '@nodelib/fs.scandir'; -export declare type Entry = scandir.Entry; -export declare type Errno = NodeJS.ErrnoException; -export interface QueueItem { - directory: string; - base?: string; -} diff --git a/node_modules/@nodelib/fs.walk/out/types/index.js b/node_modules/@nodelib/fs.walk/out/types/index.js deleted file mode 100644 index c8ad2e549..000000000 --- a/node_modules/@nodelib/fs.walk/out/types/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.walk/package.json b/node_modules/@nodelib/fs.walk/package.json deleted file mode 100644 index 86bfce48b..000000000 --- a/node_modules/@nodelib/fs.walk/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@nodelib/fs.walk", - "version": "1.2.8", - "description": "A library for efficiently walking a directory recursively", - "license": "MIT", - "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk", - "keywords": [ - "NodeLib", - "fs", - "FileSystem", - "file system", - "walk", - "scanner", - "crawler" - ], - "engines": { - "node": ">= 8" - }, - "files": [ - "out/**", - "!out/**/*.map", - "!out/**/*.spec.*", - "!out/**/tests/**" - ], - "main": "out/index.js", - "typings": "out/index.d.ts", - "scripts": { - "clean": "rimraf {tsconfig.tsbuildinfo,out}", - "lint": "eslint \"src/**/*.ts\" --cache", - "compile": "tsc -b .", - "compile:watch": "tsc -p . --watch --sourceMap", - "test": "mocha \"out/**/*.spec.js\" -s 0", - "build": "npm run clean && npm run compile && npm run lint && npm test", - "watch": "npm run clean && npm run compile:watch" - }, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "devDependencies": { - "@nodelib/fs.macchiato": "1.0.4" - }, - "gitHead": "1e5bad48565da2b06b8600e744324ea240bf49d8" -} diff --git a/node_modules/@types/minimist/LICENSE b/node_modules/@types/minimist/LICENSE deleted file mode 100755 index 9e841e7a2..000000000 --- a/node_modules/@types/minimist/LICENSE +++ /dev/null @@ -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 diff --git a/node_modules/@types/minimist/README.md b/node_modules/@types/minimist/README.md deleted file mode 100755 index 8bb1e1a0e..000000000 --- a/node_modules/@types/minimist/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/minimist` - -# Summary -This package contains type definitions for minimist (https://github.com/substack/minimist). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/minimist. - -### Additional Details - * Last updated: Wed, 07 Jul 2021 00:01:41 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by [Bart van der Schoor](https://github.com/Bartvds), [Necroskillz](https://github.com/Necroskillz), [kamranayub](https://github.com/kamranayub), and [Piotr Błażejewicz](https://github.com/peterblazejewicz). diff --git a/node_modules/@types/minimist/index.d.ts b/node_modules/@types/minimist/index.d.ts deleted file mode 100755 index afc15d596..000000000 --- a/node_modules/@types/minimist/index.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -// Type definitions for minimist 1.2 -// Project: https://github.com/substack/minimist -// Definitions by: Bart van der Schoor -// Necroskillz -// kamranayub -// Piotr Błażejewicz -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * Return an argument object populated with the array arguments from args - * - * @param [args] An optional argument array (typically `process.argv.slice(2)`) - * @param [opts] An optional options object to customize the parsing - */ -declare function minimist(args?: string[], opts?: minimist.Opts): minimist.ParsedArgs; - -/** - * Return an argument object populated with the array arguments from args. Strongly-typed - * to be the intersect of type T with minimist.ParsedArgs. - * - * `T` The type that will be intersected with minimist.ParsedArgs to represent the argument object - * - * @param [args] An optional argument array (typically `process.argv.slice(2)`) - * @param [opts] An optional options object to customize the parsing - */ -declare function minimist(args?: string[], opts?: minimist.Opts): T & minimist.ParsedArgs; - -/** - * Return an argument object populated with the array arguments from args. Strongly-typed - * to be the the type T which should extend minimist.ParsedArgs - * - * `T` The type that extends minimist.ParsedArgs and represents the argument object - * - * @param [args] An optional argument array (typically `process.argv.slice(2)`) - * @param [opts] An optional options object to customize the parsing - */ -declare function minimist(args?: string[], opts?: minimist.Opts): T; - -declare namespace minimist { - interface Opts { - /** - * A string or array of strings argument names to always treat as strings - */ - string?: string | string[] | undefined; - - /** - * A boolean, string or array of strings to always treat as booleans. If true will treat - * all double hyphenated arguments without equals signs as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) - */ - boolean?: boolean | string | string[] | undefined; - - /** - * An object mapping string names to strings or arrays of string argument names to use as aliases - */ - alias?: { [key: string]: string | string[] } | undefined; - - /** - * An object mapping string argument names to default values - */ - default?: { [key: string]: any } | undefined; - - /** - * When true, populate argv._ with everything after the first non-option - */ - stopEarly?: boolean | undefined; - - /** - * A function which is invoked with a command line parameter not defined in the opts - * configuration object. If the function returns false, the unknown option is not added to argv - */ - unknown?: ((arg: string) => boolean) | undefined; - - /** - * When true, populate argv._ with everything before the -- and argv['--'] with everything after the --. - * Note that with -- set, parsing for arguments still stops after the `--`. - */ - '--'?: boolean | undefined; - } - - interface ParsedArgs { - [arg: string]: any; - - /** - * If opts['--'] is true, populated with everything after the -- - */ - '--'?: string[] | undefined; - - /** - * Contains all the arguments that didn't have an option associated with them - */ - _: string[]; - } -} - -export = minimist; diff --git a/node_modules/@types/minimist/package.json b/node_modules/@types/minimist/package.json deleted file mode 100755 index 99ea2d207..000000000 --- a/node_modules/@types/minimist/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "@types/minimist", - "version": "1.2.2", - "description": "TypeScript definitions for minimist", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/minimist", - "license": "MIT", - "contributors": [ - { - "name": "Bart van der Schoor", - "url": "https://github.com/Bartvds", - "githubUsername": "Bartvds" - }, - { - "name": "Necroskillz", - "url": "https://github.com/Necroskillz", - "githubUsername": "Necroskillz" - }, - { - "name": "kamranayub", - "url": "https://github.com/kamranayub", - "githubUsername": "kamranayub" - }, - { - "name": "Piotr Błażejewicz", - "url": "https://github.com/peterblazejewicz", - "githubUsername": "peterblazejewicz" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/minimist" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "9032205d52417d0f537f1e52af6f7ac447acb4b87dca0ab5840b83ec7818232e", - "typeScriptVersion": "3.6" -} \ No newline at end of file diff --git a/node_modules/@types/normalize-package-data/LICENSE b/node_modules/@types/normalize-package-data/LICENSE deleted file mode 100755 index 9e841e7a2..000000000 --- a/node_modules/@types/normalize-package-data/LICENSE +++ /dev/null @@ -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 diff --git a/node_modules/@types/normalize-package-data/README.md b/node_modules/@types/normalize-package-data/README.md deleted file mode 100755 index fd3d77134..000000000 --- a/node_modules/@types/normalize-package-data/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# Installation -> `npm install --save @types/normalize-package-data` - -# Summary -This package contains type definitions for normalize-package-data (https://github.com/npm/normalize-package-data#readme). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data. -## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data/index.d.ts) -````ts -// Type definitions for normalize-package-data 2.4 -// Project: https://github.com/npm/normalize-package-data#readme -// Definitions by: Jeff Dickey -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = normalize; - -declare function normalize(data: normalize.Input, warn?: normalize.WarnFn, strict?: boolean): void; -declare function normalize(data: normalize.Input, strict?: boolean): void; - -declare namespace normalize { - type WarnFn = (msg: string) => void; - interface Input {[k: string]: any; } - - interface Person { - name?: string | undefined; - email?: string | undefined; - url?: string | undefined; - } - - interface Package { - [k: string]: any; - name: string; - version: string; - files?: string[] | undefined; - bin?: {[k: string]: string } | undefined; - man?: string[] | undefined; - keywords?: string[] | undefined; - author?: Person | undefined; - maintainers?: Person[] | undefined; - contributors?: Person[] | undefined; - bundleDependencies?: {[name: string]: string; } | undefined; - dependencies?: {[name: string]: string; } | undefined; - devDependencies?: {[name: string]: string; } | undefined; - optionalDependencies?: {[name: string]: string; } | undefined; - description?: string | undefined; - engines?: {[type: string]: string } | undefined; - license?: string | undefined; - repository?: { type: string, url: string } | undefined; - bugs?: { url: string, email?: string | undefined } | { url?: string | undefined, email: string } | undefined; - homepage?: string | undefined; - scripts?: {[k: string]: string} | undefined; - readme: string; - _id: string; - } -} - -```` - -### Additional Details - * Last updated: Wed, 07 Jul 2021 16:31:34 GMT - * Dependencies: none - * Global values: none - -# Credits -These definitions were written by [Jeff Dickey](https://github.com/jdxcode). diff --git a/node_modules/@types/normalize-package-data/index.d.ts b/node_modules/@types/normalize-package-data/index.d.ts deleted file mode 100755 index 102d073b3..000000000 --- a/node_modules/@types/normalize-package-data/index.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Type definitions for normalize-package-data 2.4 -// Project: https://github.com/npm/normalize-package-data#readme -// Definitions by: Jeff Dickey -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = normalize; - -declare function normalize(data: normalize.Input, warn?: normalize.WarnFn, strict?: boolean): void; -declare function normalize(data: normalize.Input, strict?: boolean): void; - -declare namespace normalize { - type WarnFn = (msg: string) => void; - interface Input {[k: string]: any; } - - interface Person { - name?: string | undefined; - email?: string | undefined; - url?: string | undefined; - } - - interface Package { - [k: string]: any; - name: string; - version: string; - files?: string[] | undefined; - bin?: {[k: string]: string } | undefined; - man?: string[] | undefined; - keywords?: string[] | undefined; - author?: Person | undefined; - maintainers?: Person[] | undefined; - contributors?: Person[] | undefined; - bundleDependencies?: {[name: string]: string; } | undefined; - dependencies?: {[name: string]: string; } | undefined; - devDependencies?: {[name: string]: string; } | undefined; - optionalDependencies?: {[name: string]: string; } | undefined; - description?: string | undefined; - engines?: {[type: string]: string } | undefined; - license?: string | undefined; - repository?: { type: string, url: string } | undefined; - bugs?: { url: string, email?: string | undefined } | { url?: string | undefined, email: string } | undefined; - homepage?: string | undefined; - scripts?: {[k: string]: string} | undefined; - readme: string; - _id: string; - } -} diff --git a/node_modules/@types/normalize-package-data/package.json b/node_modules/@types/normalize-package-data/package.json deleted file mode 100755 index 1f61182ea..000000000 --- a/node_modules/@types/normalize-package-data/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@types/normalize-package-data", - "version": "2.4.1", - "description": "TypeScript definitions for normalize-package-data", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data", - "license": "MIT", - "contributors": [ - { - "name": "Jeff Dickey", - "url": "https://github.com/jdxcode", - "githubUsername": "jdxcode" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/normalize-package-data" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "10653410655e204616118acfbe2900dc09227bc3a80c532a93d44b46be54db36", - "typeScriptVersion": "3.6" -} \ No newline at end of file diff --git a/node_modules/ajv/.runkit_example.js b/node_modules/ajv/.runkit_example.js deleted file mode 100644 index 0d578d5d5..000000000 --- a/node_modules/ajv/.runkit_example.js +++ /dev/null @@ -1,23 +0,0 @@ -const Ajv = require("ajv") -const ajv = new Ajv({allErrors: true}) - -const schema = { - type: "object", - properties: { - foo: {type: "string"}, - bar: {type: "number", maximum: 3}, - }, - required: ["foo", "bar"], - additionalProperties: false, -} - -const validate = ajv.compile(schema) - -test({foo: "abc", bar: 2}) -test({foo: 2, bar: 4}) - -function test(data) { - const valid = validate(data) - if (valid) console.log("Valid!") - else console.log("Invalid: " + ajv.errorsText(validate.errors)) -} diff --git a/node_modules/ajv/LICENSE b/node_modules/ajv/LICENSE deleted file mode 100644 index 139162ad2..000000000 --- a/node_modules/ajv/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2021 Evgeny Poberezkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/node_modules/ajv/README.md b/node_modules/ajv/README.md deleted file mode 100644 index ab3f774a1..000000000 --- a/node_modules/ajv/README.md +++ /dev/null @@ -1,207 +0,0 @@ -Ajv logo - -  - -# Ajv JSON schema validator - -The fastest JSON validator for Node.js and browser. - -Supports JSON Schema draft-04/06/07/2019-09/2020-12 ([draft-04 support](https://ajv.js.org/json-schema.html#draft-04) requires ajv-draft-04 package) and JSON Type Definition [RFC8927](https://datatracker.ietf.org/doc/rfc8927/). - -[![build](https://github.com/ajv-validator/ajv/workflows/build/badge.svg)](https://github.com/ajv-validator/ajv/actions?query=workflow%3Abuild) -[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) -[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) -[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master) -[![SimpleX](https://img.shields.io/badge/chat-on%20SimpleX-%2307b4b9)](https://simplex.chat/contact#/?v=1-2&smp=smp%3A%2F%2Fu2dS9sG8nMNURyZwqASV4yROM28Er0luVTx5X1CsMrU%3D%40smp4.simplex.im%2FV-6t4hoy_SsvKMi9KekdGX-VKQOhDeAe%23%2F%3Fv%3D1-2%26dh%3DMCowBQYDK2VuAyEAm98gjwvrAEiiz_YgBoaQB9dtKTl5Om1pborUyevQwzg%253D%26srv%3Do5vmywmrnaxalvz6wi3zicyftgio6psuvyniis6gco6bp6ekl4cqj4id.onion&data=%7B%22type%22%3A%22group%22%2C%22groupLinkId%22%3A%22wYrTFafovkymjUtc2vUjCQ%3D%3D%22%7D) -[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) -[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) - -## Ajv sponsors - -[Mozilla](https://www.mozilla.org)[](https://opencollective.com/ajv) - -[Microsoft](https://opensource.microsoft.com)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv) - -[Retool](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[Tidelift](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise)[SimpleX](https://github.com/simplex-chat/simplex-chat)[](https://opencollective.com/ajv) - -## Contributing - -More than 100 people contributed to Ajv, and we would love to have you join the development. We welcome implementing new features that will benefit many users and ideas to improve our documentation. - -Please review [Contributing guidelines](./CONTRIBUTING.md) and [Code components](https://ajv.js.org/components.html). - -## Documentation - -All documentation is available on the [Ajv website](https://ajv.js.org). - -Some useful site links: - -- [Getting started](https://ajv.js.org/guide/getting-started.html) -- [JSON Schema vs JSON Type Definition](https://ajv.js.org/guide/schema-language.html) -- [API reference](https://ajv.js.org/api.html) -- [Strict mode](https://ajv.js.org/strict-mode.html) -- [Standalone validation code](https://ajv.js.org/standalone.html) -- [Security considerations](https://ajv.js.org/security.html) -- [Command line interface](https://ajv.js.org/packages/ajv-cli.html) -- [Frequently Asked Questions](https://ajv.js.org/faq.html) - -## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) - -Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! - -Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. - -Please sponsor Ajv via: - -- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) -- [Ajv Open Collective](https://opencollective.com/ajv) - -Thank you. - -#### Open Collective sponsors - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## Performance - -Ajv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. - -Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: - -- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place -- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster -- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) -- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) - -Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): - -[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=62,4,1&chs=600x416&chxl=-1:|ajv|@exodus/schemasafe|is-my-json-valid|djv|@cfworker/json-schema|jsonschema/=t:100,69.2,51.5,13.1,5.1,1.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) - -## Features - -- Ajv implements JSON Schema [draft-06/07/2019-09/2020-12](http://json-schema.org/) standards (draft-04 is supported in v6): - - all validation keywords (see [JSON Schema validation keywords](https://ajv.js.org/json-schema.html)) - - [OpenAPI](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md) extensions: - - NEW: keyword [discriminator](https://ajv.js.org/json-schema.html#discriminator). - - keyword [nullable](https://ajv.js.org/json-schema.html#nullable). - - full support of remote references (remote schemas have to be added with `addSchema` or compiled to be available) - - support of recursive references between schemas - - correct string lengths for strings with unicode pairs - - JSON Schema [formats](https://ajv.js.org/guide/formats.html) (with [ajv-formats](https://github.com/ajv-validator/ajv-formats) plugin). - - [validates schemas against meta-schema](https://ajv.js.org/api.html#api-validateschema) -- NEW: supports [JSON Type Definition](https://datatracker.ietf.org/doc/rfc8927/): - - all keywords (see [JSON Type Definition schema forms](https://ajv.js.org/json-type-definition.html)) - - meta-schema for JTD schemas - - "union" keyword and user-defined keywords (can be used inside "metadata" member of the schema) -- supports [browsers](https://ajv.js.org/guide/environments.html#browsers) and Node.js 10.x - current -- [asynchronous loading](https://ajv.js.org/guide/managing-schemas.html#asynchronous-schema-loading) of referenced schemas during compilation -- "All errors" validation mode with [option allErrors](https://ajv.js.org/options.html#allerrors) -- [error messages with parameters](https://ajv.js.org/api.html#validation-errors) describing error reasons to allow error message generation -- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package -- [removing-additional-properties](https://ajv.js.org/guide/modifying-data.html#removing-additional-properties) -- [assigning defaults](https://ajv.js.org/guide/modifying-data.html#assigning-defaults) to missing properties and items -- [coercing data](https://ajv.js.org/guide/modifying-data.html#coercing-data-types) to the types specified in `type` keywords -- [user-defined keywords](https://ajv.js.org/guide/user-keywords.html) -- additional extension keywords with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package -- [\$data reference](https://ajv.js.org/guide/combining-schemas.html#data-reference) to use values from the validated data as values for the schema keywords -- [asynchronous validation](https://ajv.js.org/guide/async-validation.html) of user-defined formats and keywords - -## Install - -To install version 8: - -``` -npm install ajv -``` - -## Getting started - -Try it in the Node.js REPL: https://runkit.com/npm/ajv - -In JavaScript: - -```javascript -// or ESM/TypeScript import -import Ajv from "ajv" -// Node.js require: -const Ajv = require("ajv") - -const ajv = new Ajv() // options can be passed, e.g. {allErrors: true} - -const schema = { - type: "object", - properties: { - foo: {type: "integer"}, - bar: {type: "string"}, - }, - required: ["foo"], - additionalProperties: false, -} - -const data = { - foo: 1, - bar: "abc", -} - -const validate = ajv.compile(schema) -const valid = validate(data) -if (!valid) console.log(validate.errors) -``` - -Learn how to use Ajv and see more examples in the [Guide: getting started](https://ajv.js.org/guide/getting-started.html) - -## Changes history - -See [https://github.com/ajv-validator/ajv/releases](https://github.com/ajv-validator/ajv/releases) - -**Please note**: [Changes in version 8.0.0](https://github.com/ajv-validator/ajv/releases/tag/v8.0.0) - -[Version 7.0.0](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0) - -[Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0). - -## Code of conduct - -Please review and follow the [Code of conduct](./CODE_OF_CONDUCT.md). - -Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team. - -## Security contact - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. - -## Open-source software support - -Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. - -## License - -[MIT](./LICENSE) diff --git a/node_modules/ajv/dist/2019.d.ts b/node_modules/ajv/dist/2019.d.ts deleted file mode 100644 index 0dd0bcb04..000000000 --- a/node_modules/ajv/dist/2019.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { AnySchemaObject } from "./types"; -import AjvCore, { Options } from "./core"; -declare class Ajv2019 extends AjvCore { - constructor(opts?: Options); - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; -} -export default Ajv2019; -export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; -export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; -export { SchemaCxt, SchemaObjCxt } from "./compile"; -export { KeywordCxt } from "./compile/validate"; -export { DefinedError } from "./vocabularies/errors"; -export { JSONType } from "./compile/rules"; -export { JSONSchemaType } from "./types/json-schema"; -export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; -export { default as ValidationError } from "./runtime/validation_error"; -export { default as MissingRefError } from "./compile/ref_error"; diff --git a/node_modules/ajv/dist/2019.js b/node_modules/ajv/dist/2019.js deleted file mode 100644 index f30eb9e1c..000000000 --- a/node_modules/ajv/dist/2019.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; -const core_1 = require("./core"); -const draft7_1 = require("./vocabularies/draft7"); -const dynamic_1 = require("./vocabularies/dynamic"); -const next_1 = require("./vocabularies/next"); -const unevaluated_1 = require("./vocabularies/unevaluated"); -const discriminator_1 = require("./vocabularies/discriminator"); -const json_schema_2019_09_1 = require("./refs/json-schema-2019-09"); -const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema"; -class Ajv2019 extends core_1.default { - constructor(opts = {}) { - super({ - ...opts, - dynamicRef: true, - next: true, - unevaluated: true, - }); - } - _addVocabularies() { - super._addVocabularies(); - this.addVocabulary(dynamic_1.default); - draft7_1.default.forEach((v) => this.addVocabulary(v)); - this.addVocabulary(next_1.default); - this.addVocabulary(unevaluated_1.default); - if (this.opts.discriminator) - this.addKeyword(discriminator_1.default); - } - _addDefaultMetaSchema() { - super._addDefaultMetaSchema(); - const { $data, meta } = this.opts; - if (!meta) - return; - json_schema_2019_09_1.default.call(this, $data); - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; - } - defaultMeta() { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); - } -} -module.exports = exports = Ajv2019; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = Ajv2019; -var validate_1 = require("./compile/validate"); -Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); -var codegen_1 = require("./compile/codegen"); -Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); -Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); -Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); -Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); -Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); -Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); -var validation_error_1 = require("./runtime/validation_error"); -Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); -var ref_error_1 = require("./compile/ref_error"); -Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); -//# sourceMappingURL=2019.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/2019.js.map b/node_modules/ajv/dist/2019.js.map deleted file mode 100644 index 204e730de..000000000 --- a/node_modules/ajv/dist/2019.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"2019.js","sourceRoot":"","sources":["../lib/2019.ts"],"names":[],"mappings":";;;AACA,iCAAuC;AAEvC,kDAAsD;AACtD,oDAAsD;AACtD,8CAAgD;AAChD,4DAA8D;AAC9D,gEAAwD;AACxD,oEAA0D;AAE1D,MAAM,cAAc,GAAG,8CAA8C,CAAA;AAErE,MAAM,OAAQ,SAAQ,cAAO;IAC3B,YAAY,OAAgB,EAAE;QAC5B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,IAAI;SAClB,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EA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AE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ No newline at end of file diff --git a/node_modules/ajv/dist/2020.d.ts b/node_modules/ajv/dist/2020.d.ts deleted file mode 100644 index 77b4e016f..000000000 --- a/node_modules/ajv/dist/2020.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { AnySchemaObject } from "./types"; -import AjvCore, { Options } from "./core"; -declare class Ajv2020 extends AjvCore { - constructor(opts?: Options); - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; -} -export default Ajv2020; -export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; -export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; -export { SchemaCxt, SchemaObjCxt } from "./compile"; -export { KeywordCxt } from "./compile/validate"; -export { DefinedError } from "./vocabularies/errors"; -export { JSONType } from "./compile/rules"; -export { JSONSchemaType } from "./types/json-schema"; -export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; -export { default as ValidationError } from "./runtime/validation_error"; -export { default as MissingRefError } from "./compile/ref_error"; diff --git a/node_modules/ajv/dist/2020.js b/node_modules/ajv/dist/2020.js deleted file mode 100644 index 50a532ed3..000000000 --- a/node_modules/ajv/dist/2020.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; -const core_1 = require("./core"); -const draft2020_1 = require("./vocabularies/draft2020"); -const discriminator_1 = require("./vocabularies/discriminator"); -const json_schema_2020_12_1 = require("./refs/json-schema-2020-12"); -const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema"; -class Ajv2020 extends core_1.default { - constructor(opts = {}) { - super({ - ...opts, - dynamicRef: true, - next: true, - unevaluated: true, - }); - } - _addVocabularies() { - super._addVocabularies(); - draft2020_1.default.forEach((v) => this.addVocabulary(v)); - if (this.opts.discriminator) - this.addKeyword(discriminator_1.default); - } - _addDefaultMetaSchema() { - super._addDefaultMetaSchema(); - const { $data, meta } = this.opts; - if (!meta) - return; - json_schema_2020_12_1.default.call(this, $data); - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; - } - defaultMeta() { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); - } -} -module.exports = exports = Ajv2020; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = Ajv2020; -var validate_1 = require("./compile/validate"); -Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); -var codegen_1 = require("./compile/codegen"); -Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); -Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); -Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); -Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); -Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); -Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); -var validation_error_1 = require("./runtime/validation_error"); -Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); -var ref_error_1 = require("./compile/ref_error"); -Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); -//# sourceMappingURL=2020.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/2020.js.map b/node_modules/ajv/dist/2020.js.map deleted file mode 100644 index 1db6ae443..000000000 --- a/node_modules/ajv/dist/2020.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"2020.js","sourceRoot":"","sources":["../lib/2020.ts"],"names":[],"mappings":";;;AACA,iCAAuC;AAEvC,wDAA4D;AAC5D,gEAAwD;AACxD,oEAA0D;AAE1D,MAAM,cAAc,GAAG,8CAA8C,CAAA;AAErE,MAAM,OAAQ,SAAQ,cAAO;IAC3B,YAAY,OAAgB,EAAE;QAC5B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,IAAI;SAClB,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,mBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QAC3D,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,IAAI,CAAC,UAAU,CAAC,uBAAa,CAAC,CAAA;IAC7D,CAAC;IAED,qBAAqB;QACnB,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC7B,MAAM,EAAC,KAAK,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;QAC/B,IAAI,CAAC,IAAI;YAAE,OAAM;QACjB,6BAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACnC,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,GAAG,cAAc,CAAA;IAC7D,CAAC;IAED,WAAW;QACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW;YAC3B,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAClC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,OAAO,CAAA;AAyBtB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ No newline at end of file diff --git a/node_modules/ajv/dist/ajv.d.ts b/node_modules/ajv/dist/ajv.d.ts deleted file mode 100644 index bcc17c711..000000000 --- a/node_modules/ajv/dist/ajv.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { AnySchemaObject } from "./types"; -import AjvCore from "./core"; -declare class Ajv extends AjvCore { - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; -} -export default Ajv; -export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, SchemaValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; -export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; -export { SchemaCxt, SchemaObjCxt } from "./compile"; -export { KeywordCxt } from "./compile/validate"; -export { DefinedError } from "./vocabularies/errors"; -export { JSONType } from "./compile/rules"; -export { JSONSchemaType } from "./types/json-schema"; -export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; -export { default as ValidationError } from "./runtime/validation_error"; -export { default as MissingRefError } from "./compile/ref_error"; diff --git a/node_modules/ajv/dist/ajv.js b/node_modules/ajv/dist/ajv.js deleted file mode 100644 index 755256a73..000000000 --- a/node_modules/ajv/dist/ajv.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; -const core_1 = require("./core"); -const draft7_1 = require("./vocabularies/draft7"); -const discriminator_1 = require("./vocabularies/discriminator"); -const draft7MetaSchema = require("./refs/json-schema-draft-07.json"); -const META_SUPPORT_DATA = ["/properties"]; -const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"; -class Ajv extends core_1.default { - _addVocabularies() { - super._addVocabularies(); - draft7_1.default.forEach((v) => this.addVocabulary(v)); - if (this.opts.discriminator) - this.addKeyword(discriminator_1.default); - } - _addDefaultMetaSchema() { - super._addDefaultMetaSchema(); - if (!this.opts.meta) - return; - const metaSchema = this.opts.$data - ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) - : draft7MetaSchema; - this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; - } - defaultMeta() { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); - } -} -module.exports = exports = Ajv; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = Ajv; -var validate_1 = require("./compile/validate"); -Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); -var codegen_1 = require("./compile/codegen"); -Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); -Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); -Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); -Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); -Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); -Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); -var validation_error_1 = require("./runtime/validation_error"); -Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); -var ref_error_1 = require("./compile/ref_error"); -Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); -//# sourceMappingURL=ajv.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/ajv.js.map b/node_modules/ajv/dist/ajv.js.map deleted file mode 100644 index a229a00b4..000000000 --- a/node_modules/ajv/dist/ajv.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ajv.js","sourceRoot":"","sources":["../lib/ajv.ts"],"names":[],"mappings":";;;AACA,iCAA4B;AAC5B,kDAAsD;AACtD,gEAAwD;AACxD,qEAAoE;AAEpE,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,MAAM,cAAc,GAAG,wCAAwC,CAAA;AAE/D,MAAM,GAAI,SAAQ,cAAO;IACvB,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,gBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QACxD,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,IAAI,CAAC,UAAU,CAAC,uBAAa,CAAC,CAAA;IAC7D,CAAC;IAED,qBAAqB;QACnB,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAM;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK;YAChC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;YAC3D,CAAC,CAAC,gBAAgB,CAAA;QACpB,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,EAAE,KAAK,CAAC,CAAA;QACrD,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,GAAG,cAAc,CAAA;IAC7D,CAAC;IAED,WAAW;QACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW;YAC3B,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,GAAG,CAAA;AAC9B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,GAAG,CAAA;AA0BlB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/codegen/code.d.ts b/node_modules/ajv/dist/compile/codegen/code.d.ts deleted file mode 100644 index a0220ad76..000000000 --- a/node_modules/ajv/dist/compile/codegen/code.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -export declare abstract class _CodeOrName { - abstract readonly str: string; - abstract readonly names: UsedNames; - abstract toString(): string; - abstract emptyStr(): boolean; -} -export declare const IDENTIFIER: RegExp; -export declare class Name extends _CodeOrName { - readonly str: string; - constructor(s: string); - toString(): string; - emptyStr(): boolean; - get names(): UsedNames; -} -export declare class _Code extends _CodeOrName { - readonly _items: readonly CodeItem[]; - private _str?; - private _names?; - constructor(code: string | readonly CodeItem[]); - toString(): string; - emptyStr(): boolean; - get str(): string; - get names(): UsedNames; -} -export type CodeItem = Name | string | number | boolean | null; -export type UsedNames = Record; -export type Code = _Code | Name; -export type SafeExpr = Code | number | boolean | null; -export declare const nil: _Code; -type CodeArg = SafeExpr | string | undefined; -export declare function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code; -export declare function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code; -export declare function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void; -export declare function strConcat(c1: Code, c2: Code): Code; -export declare function stringify(x: unknown): Code; -export declare function safeStringify(x: unknown): string; -export declare function getProperty(key: Code | string | number): Code; -export declare function getEsmExportName(key: Code | string | number): Code; -export declare function regexpCode(rx: RegExp): Code; -export {}; diff --git a/node_modules/ajv/dist/compile/codegen/code.js b/node_modules/ajv/dist/compile/codegen/code.js deleted file mode 100644 index f8268838a..000000000 --- a/node_modules/ajv/dist/compile/codegen/code.js +++ /dev/null @@ -1,155 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0; -class _CodeOrName { -} -exports._CodeOrName = _CodeOrName; -exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; -class Name extends _CodeOrName { - constructor(s) { - super(); - if (!exports.IDENTIFIER.test(s)) - throw new Error("CodeGen: name must be a valid identifier"); - this.str = s; - } - toString() { - return this.str; - } - emptyStr() { - return false; - } - get names() { - return { [this.str]: 1 }; - } -} -exports.Name = Name; -class _Code extends _CodeOrName { - constructor(code) { - super(); - this._items = typeof code === "string" ? [code] : code; - } - toString() { - return this.str; - } - emptyStr() { - if (this._items.length > 1) - return false; - const item = this._items[0]; - return item === "" || item === '""'; - } - get str() { - var _a; - return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, ""))); - } - get names() { - var _a; - return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => { - if (c instanceof Name) - names[c.str] = (names[c.str] || 0) + 1; - return names; - }, {}))); - } -} -exports._Code = _Code; -exports.nil = new _Code(""); -function _(strs, ...args) { - const code = [strs[0]]; - let i = 0; - while (i < args.length) { - addCodeArg(code, args[i]); - code.push(strs[++i]); - } - return new _Code(code); -} -exports._ = _; -const plus = new _Code("+"); -function str(strs, ...args) { - const expr = [safeStringify(strs[0])]; - let i = 0; - while (i < args.length) { - expr.push(plus); - addCodeArg(expr, args[i]); - expr.push(plus, safeStringify(strs[++i])); - } - optimize(expr); - return new _Code(expr); -} -exports.str = str; -function addCodeArg(code, arg) { - if (arg instanceof _Code) - code.push(...arg._items); - else if (arg instanceof Name) - code.push(arg); - else - code.push(interpolate(arg)); -} -exports.addCodeArg = addCodeArg; -function optimize(expr) { - let i = 1; - while (i < expr.length - 1) { - if (expr[i] === plus) { - const res = mergeExprItems(expr[i - 1], expr[i + 1]); - if (res !== undefined) { - expr.splice(i - 1, 3, res); - continue; - } - expr[i++] = "+"; - } - i++; - } -} -function mergeExprItems(a, b) { - if (b === '""') - return a; - if (a === '""') - return b; - if (typeof a == "string") { - if (b instanceof Name || a[a.length - 1] !== '"') - return; - if (typeof b != "string") - return `${a.slice(0, -1)}${b}"`; - if (b[0] === '"') - return a.slice(0, -1) + b.slice(1); - return; - } - if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) - return `"${a}${b.slice(1)}`; - return; -} -function strConcat(c1, c2) { - return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`; -} -exports.strConcat = strConcat; -// TODO do not allow arrays here -function interpolate(x) { - return typeof x == "number" || typeof x == "boolean" || x === null - ? x - : safeStringify(Array.isArray(x) ? x.join(",") : x); -} -function stringify(x) { - return new _Code(safeStringify(x)); -} -exports.stringify = stringify; -function safeStringify(x) { - return JSON.stringify(x) - .replace(/\u2028/g, "\\u2028") - .replace(/\u2029/g, "\\u2029"); -} -exports.safeStringify = safeStringify; -function getProperty(key) { - return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`; -} -exports.getProperty = getProperty; -//Does best effort to format the name properly -function getEsmExportName(key) { - if (typeof key == "string" && exports.IDENTIFIER.test(key)) { - return new _Code(`${key}`); - } - throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`); -} -exports.getEsmExportName = getEsmExportName; -function regexpCode(rx) { - return new _Code(rx.toString()); -} -exports.regexpCode = regexpCode; -//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/codegen/code.js.map b/node_modules/ajv/dist/compile/codegen/code.js.map deleted file mode 100644 index c5c7a3961..000000000 --- a/node_modules/ajv/dist/compile/codegen/code.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"code.js","sourceRoot":"","sources":["../../../lib/compile/codegen/code.ts"],"names":[],"mappings":";;;AAAA,MAAsB,WAAW;CAKhC;AALD,kCAKC;AAEY,QAAA,UAAU,GAAG,uBAAuB,CAAA;AAEjD,MAAa,IAAK,SAAQ,WAAW;IAEnC,YAAY,CAAS;QACnB,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,kBAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;QACpF,IAAI,CAAC,GAAG,GAAG,CAAC,CAAA;IACd,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,GAAG,CAAA;IACjB,CAAC;IAED,QAAQ;QACN,OAAO,KAAK,CAAA;IACd,CAAC;IAED,IAAI,KAAK;QACP,OAAO,EAAC,CAAC,IAAI,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AW,CAAC,GAA2B;IACrD,OAAO,OAAO,GAAG,IAAI,QAAQ,IAAI,kBAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,IAAI,GAAG,GAAG,CAAA;AAC5F,CAAC;AAFD,kCAEC;AAED,8CAA8C;AAC9C,SAAgB,gBAAgB,CAAC,GAA2B;IAC1D,IAAI,OAAO,GAAG,IAAI,QAAQ,IAAI,kBAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAClD,OAAO,IAAI,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC,CAAA;KAC3B;IACD,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,iCAAiC,CAAC,CAAA;AACxF,CAAC;AALD,4CAKC;AAED,SAAgB,UAAU,CAAC,EAAU;IACnC,OAAO,IAAI,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;AACjC,CAAC;AAFD,gCAEC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/codegen/index.d.ts b/node_modules/ajv/dist/compile/codegen/index.d.ts deleted file mode 100644 index d586a4b49..000000000 --- a/node_modules/ajv/dist/compile/codegen/index.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { ScopeValueSets, NameValue, ValueScope, ValueScopeName } from "./scope"; -import { _Code, Code, Name } from "./code"; -import { Scope } from "./scope"; -export { _, str, strConcat, nil, getProperty, stringify, regexpCode, Name, Code } from "./code"; -export { Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds } from "./scope"; -export type SafeExpr = Code | number | boolean | null; -export type Block = Code | (() => void); -export declare const operators: { - GT: _Code; - GTE: _Code; - LT: _Code; - LTE: _Code; - EQ: _Code; - NEQ: _Code; - NOT: _Code; - OR: _Code; - AND: _Code; - ADD: _Code; -}; -export interface CodeGenOptions { - es5?: boolean; - lines?: boolean; - ownProperties?: boolean; -} -export declare class CodeGen { - readonly _scope: Scope; - readonly _extScope: ValueScope; - readonly _values: ScopeValueSets; - private readonly _nodes; - private readonly _blockStarts; - private readonly _constants; - private readonly opts; - constructor(extScope: ValueScope, opts?: CodeGenOptions); - toString(): string; - name(prefix: string): Name; - scopeName(prefix: string): ValueScopeName; - scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name; - getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined; - scopeRefs(scopeName: Name): Code; - scopeCode(): Code; - private _def; - const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name; - let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name; - var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name; - assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen; - add(lhs: Code, rhs: SafeExpr): CodeGen; - code(c: Block | SafeExpr): CodeGen; - object(...keyValues: [Name | string, SafeExpr | string][]): _Code; - if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen; - elseIf(condition: Code | boolean): CodeGen; - else(): CodeGen; - endIf(): CodeGen; - private _for; - for(iteration: Code, forBody?: Block): CodeGen; - forRange(nameOrPrefix: Name | string, from: SafeExpr, to: SafeExpr, forBody: (index: Name) => void, varKind?: Code): CodeGen; - forOf(nameOrPrefix: Name | string, iterable: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen; - forIn(nameOrPrefix: Name | string, obj: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen; - endFor(): CodeGen; - label(label: Name): CodeGen; - break(label?: Code): CodeGen; - return(value: Block | SafeExpr): CodeGen; - try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen; - throw(error: Code): CodeGen; - block(body?: Block, nodeCount?: number): CodeGen; - endBlock(nodeCount?: number): CodeGen; - func(name: Name, args?: Code, async?: boolean, funcBody?: Block): CodeGen; - endFunc(): CodeGen; - optimize(n?: number): void; - private _leafNode; - private _blockNode; - private _endBlockNode; - private _elseNode; - private get _root(); - private get _currNode(); - private set _currNode(value); -} -export declare function not(x: T): T; -export declare function and(...args: Code[]): Code; -export declare function or(...args: Code[]): Code; diff --git a/node_modules/ajv/dist/compile/codegen/index.js b/node_modules/ajv/dist/compile/codegen/index.js deleted file mode 100644 index a6c805af1..000000000 --- a/node_modules/ajv/dist/compile/codegen/index.js +++ /dev/null @@ -1,697 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0; -const code_1 = require("./code"); -const scope_1 = require("./scope"); -var code_2 = require("./code"); -Object.defineProperty(exports, "_", { enumerable: true, get: function () { return code_2._; } }); -Object.defineProperty(exports, "str", { enumerable: true, get: function () { return code_2.str; } }); -Object.defineProperty(exports, "strConcat", { enumerable: true, get: function () { return code_2.strConcat; } }); -Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return code_2.nil; } }); -Object.defineProperty(exports, "getProperty", { enumerable: true, get: function () { return code_2.getProperty; } }); -Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return code_2.stringify; } }); -Object.defineProperty(exports, "regexpCode", { enumerable: true, get: function () { return code_2.regexpCode; } }); -Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return code_2.Name; } }); -var scope_2 = require("./scope"); -Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return scope_2.Scope; } }); -Object.defineProperty(exports, "ValueScope", { enumerable: true, get: function () { return scope_2.ValueScope; } }); -Object.defineProperty(exports, "ValueScopeName", { enumerable: true, get: function () { return scope_2.ValueScopeName; } }); -Object.defineProperty(exports, "varKinds", { enumerable: true, get: function () { return scope_2.varKinds; } }); -exports.operators = { - GT: new code_1._Code(">"), - GTE: new code_1._Code(">="), - LT: new code_1._Code("<"), - LTE: new code_1._Code("<="), - EQ: new code_1._Code("==="), - NEQ: new code_1._Code("!=="), - NOT: new code_1._Code("!"), - OR: new code_1._Code("||"), - AND: new code_1._Code("&&"), - ADD: new code_1._Code("+"), -}; -class Node { - optimizeNodes() { - return this; - } - optimizeNames(_names, _constants) { - return this; - } -} -class Def extends Node { - constructor(varKind, name, rhs) { - super(); - this.varKind = varKind; - this.name = name; - this.rhs = rhs; - } - render({ es5, _n }) { - const varKind = es5 ? scope_1.varKinds.var : this.varKind; - const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`; - return `${varKind} ${this.name}${rhs};` + _n; - } - optimizeNames(names, constants) { - if (!names[this.name.str]) - return; - if (this.rhs) - this.rhs = optimizeExpr(this.rhs, names, constants); - return this; - } - get names() { - return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {}; - } -} -class Assign extends Node { - constructor(lhs, rhs, sideEffects) { - super(); - this.lhs = lhs; - this.rhs = rhs; - this.sideEffects = sideEffects; - } - render({ _n }) { - return `${this.lhs} = ${this.rhs};` + _n; - } - optimizeNames(names, constants) { - if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) - return; - this.rhs = optimizeExpr(this.rhs, names, constants); - return this; - } - get names() { - const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }; - return addExprNames(names, this.rhs); - } -} -class AssignOp extends Assign { - constructor(lhs, op, rhs, sideEffects) { - super(lhs, rhs, sideEffects); - this.op = op; - } - render({ _n }) { - return `${this.lhs} ${this.op}= ${this.rhs};` + _n; - } -} -class Label extends Node { - constructor(label) { - super(); - this.label = label; - this.names = {}; - } - render({ _n }) { - return `${this.label}:` + _n; - } -} -class Break extends Node { - constructor(label) { - super(); - this.label = label; - this.names = {}; - } - render({ _n }) { - const label = this.label ? ` ${this.label}` : ""; - return `break${label};` + _n; - } -} -class Throw extends Node { - constructor(error) { - super(); - this.error = error; - } - render({ _n }) { - return `throw ${this.error};` + _n; - } - get names() { - return this.error.names; - } -} -class AnyCode extends Node { - constructor(code) { - super(); - this.code = code; - } - render({ _n }) { - return `${this.code};` + _n; - } - optimizeNodes() { - return `${this.code}` ? this : undefined; - } - optimizeNames(names, constants) { - this.code = optimizeExpr(this.code, names, constants); - return this; - } - get names() { - return this.code instanceof code_1._CodeOrName ? this.code.names : {}; - } -} -class ParentNode extends Node { - constructor(nodes = []) { - super(); - this.nodes = nodes; - } - render(opts) { - return this.nodes.reduce((code, n) => code + n.render(opts), ""); - } - optimizeNodes() { - const { nodes } = this; - let i = nodes.length; - while (i--) { - const n = nodes[i].optimizeNodes(); - if (Array.isArray(n)) - nodes.splice(i, 1, ...n); - else if (n) - nodes[i] = n; - else - nodes.splice(i, 1); - } - return nodes.length > 0 ? this : undefined; - } - optimizeNames(names, constants) { - const { nodes } = this; - let i = nodes.length; - while (i--) { - // iterating backwards improves 1-pass optimization - const n = nodes[i]; - if (n.optimizeNames(names, constants)) - continue; - subtractNames(names, n.names); - nodes.splice(i, 1); - } - return nodes.length > 0 ? this : undefined; - } - get names() { - return this.nodes.reduce((names, n) => addNames(names, n.names), {}); - } -} -class BlockNode extends ParentNode { - render(opts) { - return "{" + opts._n + super.render(opts) + "}" + opts._n; - } -} -class Root extends ParentNode { -} -class Else extends BlockNode { -} -Else.kind = "else"; -class If extends BlockNode { - constructor(condition, nodes) { - super(nodes); - this.condition = condition; - } - render(opts) { - let code = `if(${this.condition})` + super.render(opts); - if (this.else) - code += "else " + this.else.render(opts); - return code; - } - optimizeNodes() { - super.optimizeNodes(); - const cond = this.condition; - if (cond === true) - return this.nodes; // else is ignored here - let e = this.else; - if (e) { - const ns = e.optimizeNodes(); - e = this.else = Array.isArray(ns) ? new Else(ns) : ns; - } - if (e) { - if (cond === false) - return e instanceof If ? e : e.nodes; - if (this.nodes.length) - return this; - return new If(not(cond), e instanceof If ? [e] : e.nodes); - } - if (cond === false || !this.nodes.length) - return undefined; - return this; - } - optimizeNames(names, constants) { - var _a; - this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); - if (!(super.optimizeNames(names, constants) || this.else)) - return; - this.condition = optimizeExpr(this.condition, names, constants); - return this; - } - get names() { - const names = super.names; - addExprNames(names, this.condition); - if (this.else) - addNames(names, this.else.names); - return names; - } -} -If.kind = "if"; -class For extends BlockNode { -} -For.kind = "for"; -class ForLoop extends For { - constructor(iteration) { - super(); - this.iteration = iteration; - } - render(opts) { - return `for(${this.iteration})` + super.render(opts); - } - optimizeNames(names, constants) { - if (!super.optimizeNames(names, constants)) - return; - this.iteration = optimizeExpr(this.iteration, names, constants); - return this; - } - get names() { - return addNames(super.names, this.iteration.names); - } -} -class ForRange extends For { - constructor(varKind, name, from, to) { - super(); - this.varKind = varKind; - this.name = name; - this.from = from; - this.to = to; - } - render(opts) { - const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind; - const { name, from, to } = this; - return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts); - } - get names() { - const names = addExprNames(super.names, this.from); - return addExprNames(names, this.to); - } -} -class ForIter extends For { - constructor(loop, varKind, name, iterable) { - super(); - this.loop = loop; - this.varKind = varKind; - this.name = name; - this.iterable = iterable; - } - render(opts) { - return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts); - } - optimizeNames(names, constants) { - if (!super.optimizeNames(names, constants)) - return; - this.iterable = optimizeExpr(this.iterable, names, constants); - return this; - } - get names() { - return addNames(super.names, this.iterable.names); - } -} -class Func extends BlockNode { - constructor(name, args, async) { - super(); - this.name = name; - this.args = args; - this.async = async; - } - render(opts) { - const _async = this.async ? "async " : ""; - return `${_async}function ${this.name}(${this.args})` + super.render(opts); - } -} -Func.kind = "func"; -class Return extends ParentNode { - render(opts) { - return "return " + super.render(opts); - } -} -Return.kind = "return"; -class Try extends BlockNode { - render(opts) { - let code = "try" + super.render(opts); - if (this.catch) - code += this.catch.render(opts); - if (this.finally) - code += this.finally.render(opts); - return code; - } - optimizeNodes() { - var _a, _b; - super.optimizeNodes(); - (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes(); - (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes(); - return this; - } - optimizeNames(names, constants) { - var _a, _b; - super.optimizeNames(names, constants); - (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); - (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants); - return this; - } - get names() { - const names = super.names; - if (this.catch) - addNames(names, this.catch.names); - if (this.finally) - addNames(names, this.finally.names); - return names; - } -} -class Catch extends BlockNode { - constructor(error) { - super(); - this.error = error; - } - render(opts) { - return `catch(${this.error})` + super.render(opts); - } -} -Catch.kind = "catch"; -class Finally extends BlockNode { - render(opts) { - return "finally" + super.render(opts); - } -} -Finally.kind = "finally"; -class CodeGen { - constructor(extScope, opts = {}) { - this._values = {}; - this._blockStarts = []; - this._constants = {}; - this.opts = { ...opts, _n: opts.lines ? "\n" : "" }; - this._extScope = extScope; - this._scope = new scope_1.Scope({ parent: extScope }); - this._nodes = [new Root()]; - } - toString() { - return this._root.render(this.opts); - } - // returns unique name in the internal scope - name(prefix) { - return this._scope.name(prefix); - } - // reserves unique name in the external scope - scopeName(prefix) { - return this._extScope.name(prefix); - } - // reserves unique name in the external scope and assigns value to it - scopeValue(prefixOrName, value) { - const name = this._extScope.value(prefixOrName, value); - const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set()); - vs.add(name); - return name; - } - getScopeValue(prefix, keyOrRef) { - return this._extScope.getValue(prefix, keyOrRef); - } - // return code that assigns values in the external scope to the names that are used internally - // (same names that were returned by gen.scopeName or gen.scopeValue) - scopeRefs(scopeName) { - return this._extScope.scopeRefs(scopeName, this._values); - } - scopeCode() { - return this._extScope.scopeCode(this._values); - } - _def(varKind, nameOrPrefix, rhs, constant) { - const name = this._scope.toName(nameOrPrefix); - if (rhs !== undefined && constant) - this._constants[name.str] = rhs; - this._leafNode(new Def(varKind, name, rhs)); - return name; - } - // `const` declaration (`var` in es5 mode) - const(nameOrPrefix, rhs, _constant) { - return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant); - } - // `let` declaration with optional assignment (`var` in es5 mode) - let(nameOrPrefix, rhs, _constant) { - return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant); - } - // `var` declaration with optional assignment - var(nameOrPrefix, rhs, _constant) { - return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant); - } - // assignment code - assign(lhs, rhs, sideEffects) { - return this._leafNode(new Assign(lhs, rhs, sideEffects)); - } - // `+=` code - add(lhs, rhs) { - return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs)); - } - // appends passed SafeExpr to code or executes Block - code(c) { - if (typeof c == "function") - c(); - else if (c !== code_1.nil) - this._leafNode(new AnyCode(c)); - return this; - } - // returns code for object literal for the passed argument list of key-value pairs - object(...keyValues) { - const code = ["{"]; - for (const [key, value] of keyValues) { - if (code.length > 1) - code.push(","); - code.push(key); - if (key !== value || this.opts.es5) { - code.push(":"); - (0, code_1.addCodeArg)(code, value); - } - } - code.push("}"); - return new code_1._Code(code); - } - // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) - if(condition, thenBody, elseBody) { - this._blockNode(new If(condition)); - if (thenBody && elseBody) { - this.code(thenBody).else().code(elseBody).endIf(); - } - else if (thenBody) { - this.code(thenBody).endIf(); - } - else if (elseBody) { - throw new Error('CodeGen: "else" body without "then" body'); - } - return this; - } - // `else if` clause - invalid without `if` or after `else` clauses - elseIf(condition) { - return this._elseNode(new If(condition)); - } - // `else` clause - only valid after `if` or `else if` clauses - else() { - return this._elseNode(new Else()); - } - // end `if` statement (needed if gen.if was used only with condition) - endIf() { - return this._endBlockNode(If, Else); - } - _for(node, forBody) { - this._blockNode(node); - if (forBody) - this.code(forBody).endFor(); - return this; - } - // a generic `for` clause (or statement if `forBody` is passed) - for(iteration, forBody) { - return this._for(new ForLoop(iteration), forBody); - } - // `for` statement for a range of values - forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) { - const name = this._scope.toName(nameOrPrefix); - return this._for(new ForRange(varKind, name, from, to), () => forBody(name)); - } - // `for-of` statement (in es5 mode replace with a normal for loop) - forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) { - const name = this._scope.toName(nameOrPrefix); - if (this.opts.es5) { - const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable); - return this.forRange("_i", 0, (0, code_1._) `${arr}.length`, (i) => { - this.var(name, (0, code_1._) `${arr}[${i}]`); - forBody(name); - }); - } - return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)); - } - // `for-in` statement. - // With option `ownProperties` replaced with a `for-of` loop for object keys - forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) { - if (this.opts.ownProperties) { - return this.forOf(nameOrPrefix, (0, code_1._) `Object.keys(${obj})`, forBody); - } - const name = this._scope.toName(nameOrPrefix); - return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)); - } - // end `for` loop - endFor() { - return this._endBlockNode(For); - } - // `label` statement - label(label) { - return this._leafNode(new Label(label)); - } - // `break` statement - break(label) { - return this._leafNode(new Break(label)); - } - // `return` statement - return(value) { - const node = new Return(); - this._blockNode(node); - this.code(value); - if (node.nodes.length !== 1) - throw new Error('CodeGen: "return" should have one node'); - return this._endBlockNode(Return); - } - // `try` statement - try(tryBody, catchCode, finallyCode) { - if (!catchCode && !finallyCode) - throw new Error('CodeGen: "try" without "catch" and "finally"'); - const node = new Try(); - this._blockNode(node); - this.code(tryBody); - if (catchCode) { - const error = this.name("e"); - this._currNode = node.catch = new Catch(error); - catchCode(error); - } - if (finallyCode) { - this._currNode = node.finally = new Finally(); - this.code(finallyCode); - } - return this._endBlockNode(Catch, Finally); - } - // `throw` statement - throw(error) { - return this._leafNode(new Throw(error)); - } - // start self-balancing block - block(body, nodeCount) { - this._blockStarts.push(this._nodes.length); - if (body) - this.code(body).endBlock(nodeCount); - return this; - } - // end the current self-balancing block - endBlock(nodeCount) { - const len = this._blockStarts.pop(); - if (len === undefined) - throw new Error("CodeGen: not in self-balancing block"); - const toClose = this._nodes.length - len; - if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) { - throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`); - } - this._nodes.length = len; - return this; - } - // `function` heading (or definition if funcBody is passed) - func(name, args = code_1.nil, async, funcBody) { - this._blockNode(new Func(name, args, async)); - if (funcBody) - this.code(funcBody).endFunc(); - return this; - } - // end function definition - endFunc() { - return this._endBlockNode(Func); - } - optimize(n = 1) { - while (n-- > 0) { - this._root.optimizeNodes(); - this._root.optimizeNames(this._root.names, this._constants); - } - } - _leafNode(node) { - this._currNode.nodes.push(node); - return this; - } - _blockNode(node) { - this._currNode.nodes.push(node); - this._nodes.push(node); - } - _endBlockNode(N1, N2) { - const n = this._currNode; - if (n instanceof N1 || (N2 && n instanceof N2)) { - this._nodes.pop(); - return this; - } - throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`); - } - _elseNode(node) { - const n = this._currNode; - if (!(n instanceof If)) { - throw new Error('CodeGen: "else" without "if"'); - } - this._currNode = n.else = node; - return this; - } - get _root() { - return this._nodes[0]; - } - get _currNode() { - const ns = this._nodes; - return ns[ns.length - 1]; - } - set _currNode(node) { - const ns = this._nodes; - ns[ns.length - 1] = node; - } -} -exports.CodeGen = CodeGen; -function addNames(names, from) { - for (const n in from) - names[n] = (names[n] || 0) + (from[n] || 0); - return names; -} -function addExprNames(names, from) { - return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names; -} -function optimizeExpr(expr, names, constants) { - if (expr instanceof code_1.Name) - return replaceName(expr); - if (!canOptimize(expr)) - return expr; - return new code_1._Code(expr._items.reduce((items, c) => { - if (c instanceof code_1.Name) - c = replaceName(c); - if (c instanceof code_1._Code) - items.push(...c._items); - else - items.push(c); - return items; - }, [])); - function replaceName(n) { - const c = constants[n.str]; - if (c === undefined || names[n.str] !== 1) - return n; - delete names[n.str]; - return c; - } - function canOptimize(e) { - return (e instanceof code_1._Code && - e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined)); - } -} -function subtractNames(names, from) { - for (const n in from) - names[n] = (names[n] || 0) - (from[n] || 0); -} -function not(x) { - return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._) `!${par(x)}`; -} -exports.not = not; -const andCode = mappend(exports.operators.AND); -// boolean AND (&&) expression with the passed arguments -function and(...args) { - return args.reduce(andCode); -} -exports.and = and; -const orCode = mappend(exports.operators.OR); -// boolean OR (||) expression with the passed arguments -function or(...args) { - return args.reduce(orCode); -} -exports.or = or; -function mappend(op) { - return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._) `${par(x)} ${op} ${par(y)}`); -} -function par(x) { - return x instanceof code_1.Name ? x : (0, code_1._) `(${x})`; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/codegen/index.js.map b/node_modules/ajv/dist/compile/codegen/index.js.map deleted file mode 100644 index f3826d283..000000000 --- a/node_modules/ajv/dist/compile/codegen/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/compile/codegen/index.ts"],"names":[],"mappings":";;;AACA,iCAA8F;AAC9F,mCAAuC;AAEvC,+BAA6F;AAArF,yFAAA,CAAC,OAAA;AAAE,2FAAA,GAAG,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,2FAAA,GAAG,OAAA;AAAE,mGAAA,WAAW,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,kGAAA,UAAU,OAAA;AAAE,4FAAA,IAAI,OAAA;AACxE,iCAA+F;AAAvF,8FAAA,KAAK,OAAA;AAAc,mGAAA,UAAU,OAAA;AAAE,uGAAA,cAAc,OAAA;AAAkB,iGAAA,QAAQ,OAAA;AAQlE,QAAA,SA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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,UAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,QAAC,EAAA,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AACjF,CAAC;AAED,SAAS,GAAG,CAAC,CAAO;IAClB,OAAO,CAAC,YAAY,WAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,QAAC,EAAA,IAAI,CAAC,GAAG,CAAA;AAC1C,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/codegen/scope.d.ts b/node_modules/ajv/dist/compile/codegen/scope.d.ts deleted file mode 100644 index 3d9530538..000000000 --- a/node_modules/ajv/dist/compile/codegen/scope.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { Code, Name } from "./code"; -interface NameGroup { - prefix: string; - index: number; -} -export interface NameValue { - ref: ValueReference; - key?: unknown; - code?: Code; -} -export type ValueReference = unknown; -interface ScopeOptions { - prefixes?: Set; - parent?: Scope; -} -interface ValueScopeOptions extends ScopeOptions { - scope: ScopeStore; - es5?: boolean; - lines?: boolean; -} -export type ScopeStore = Record; -type ScopeValues = { - [Prefix in string]?: Map; -}; -export type ScopeValueSets = { - [Prefix in string]?: Set; -}; -export declare enum UsedValueState { - Started = 0, - Completed = 1 -} -export type UsedScopeValues = { - [Prefix in string]?: Map; -}; -export declare const varKinds: { - const: Name; - let: Name; - var: Name; -}; -export declare class Scope { - protected readonly _names: { - [Prefix in string]?: NameGroup; - }; - protected readonly _prefixes?: Set; - protected readonly _parent?: Scope; - constructor({ prefixes, parent }?: ScopeOptions); - toName(nameOrPrefix: Name | string): Name; - name(prefix: string): Name; - protected _newName(prefix: string): string; - private _nameGroup; -} -interface ScopePath { - property: string; - itemIndex: number; -} -export declare class ValueScopeName extends Name { - readonly prefix: string; - value?: NameValue; - scopePath?: Code; - constructor(prefix: string, nameStr: string); - setValue(value: NameValue, { property, itemIndex }: ScopePath): void; -} -interface VSOptions extends ValueScopeOptions { - _n: Code; -} -export declare class ValueScope extends Scope { - protected readonly _values: ScopeValues; - protected readonly _scope: ScopeStore; - readonly opts: VSOptions; - constructor(opts: ValueScopeOptions); - get(): ScopeStore; - name(prefix: string): ValueScopeName; - value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName; - getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined; - scopeRefs(scopeName: Name, values?: ScopeValues | ScopeValueSets): Code; - scopeCode(values?: ScopeValues | ScopeValueSets, usedValues?: UsedScopeValues, getCode?: (n: ValueScopeName) => Code | undefined): Code; - private _reduceValues; -} -export {}; diff --git a/node_modules/ajv/dist/compile/codegen/scope.js b/node_modules/ajv/dist/compile/codegen/scope.js deleted file mode 100644 index acc5f7626..000000000 --- a/node_modules/ajv/dist/compile/codegen/scope.js +++ /dev/null @@ -1,143 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0; -const code_1 = require("./code"); -class ValueError extends Error { - constructor(name) { - super(`CodeGen: "code" for ${name} not defined`); - this.value = name.value; - } -} -var UsedValueState; -(function (UsedValueState) { - UsedValueState[UsedValueState["Started"] = 0] = "Started"; - UsedValueState[UsedValueState["Completed"] = 1] = "Completed"; -})(UsedValueState = exports.UsedValueState || (exports.UsedValueState = {})); -exports.varKinds = { - const: new code_1.Name("const"), - let: new code_1.Name("let"), - var: new code_1.Name("var"), -}; -class Scope { - constructor({ prefixes, parent } = {}) { - this._names = {}; - this._prefixes = prefixes; - this._parent = parent; - } - toName(nameOrPrefix) { - return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix); - } - name(prefix) { - return new code_1.Name(this._newName(prefix)); - } - _newName(prefix) { - const ng = this._names[prefix] || this._nameGroup(prefix); - return `${prefix}${ng.index++}`; - } - _nameGroup(prefix) { - var _a, _b; - if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) { - throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`); - } - return (this._names[prefix] = { prefix, index: 0 }); - } -} -exports.Scope = Scope; -class ValueScopeName extends code_1.Name { - constructor(prefix, nameStr) { - super(nameStr); - this.prefix = prefix; - } - setValue(value, { property, itemIndex }) { - this.value = value; - this.scopePath = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`; - } -} -exports.ValueScopeName = ValueScopeName; -const line = (0, code_1._) `\n`; -class ValueScope extends Scope { - constructor(opts) { - super(opts); - this._values = {}; - this._scope = opts.scope; - this.opts = { ...opts, _n: opts.lines ? line : code_1.nil }; - } - get() { - return this._scope; - } - name(prefix) { - return new ValueScopeName(prefix, this._newName(prefix)); - } - value(nameOrPrefix, value) { - var _a; - if (value.ref === undefined) - throw new Error("CodeGen: ref must be passed in value"); - const name = this.toName(nameOrPrefix); - const { prefix } = name; - const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref; - let vs = this._values[prefix]; - if (vs) { - const _name = vs.get(valueKey); - if (_name) - return _name; - } - else { - vs = this._values[prefix] = new Map(); - } - vs.set(valueKey, name); - const s = this._scope[prefix] || (this._scope[prefix] = []); - const itemIndex = s.length; - s[itemIndex] = value.ref; - name.setValue(value, { property: prefix, itemIndex }); - return name; - } - getValue(prefix, keyOrRef) { - const vs = this._values[prefix]; - if (!vs) - return; - return vs.get(keyOrRef); - } - scopeRefs(scopeName, values = this._values) { - return this._reduceValues(values, (name) => { - if (name.scopePath === undefined) - throw new Error(`CodeGen: name "${name}" has no value`); - return (0, code_1._) `${scopeName}${name.scopePath}`; - }); - } - scopeCode(values = this._values, usedValues, getCode) { - return this._reduceValues(values, (name) => { - if (name.value === undefined) - throw new Error(`CodeGen: name "${name}" has no value`); - return name.value.code; - }, usedValues, getCode); - } - _reduceValues(values, valueCode, usedValues = {}, getCode) { - let code = code_1.nil; - for (const prefix in values) { - const vs = values[prefix]; - if (!vs) - continue; - const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map()); - vs.forEach((name) => { - if (nameSet.has(name)) - return; - nameSet.set(name, UsedValueState.Started); - let c = valueCode(name); - if (c) { - const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const; - code = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`; - } - else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) { - code = (0, code_1._) `${code}${c}${this.opts._n}`; - } - else { - throw new ValueError(name); - } - nameSet.set(name, UsedValueState.Completed); - }); - } - return code; - } -} -exports.ValueScope = ValueScope; -//# sourceMappingURL=scope.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/codegen/scope.js.map b/node_modules/ajv/dist/compile/codegen/scope.js.map deleted file mode 100644 index 7afde1060..000000000 --- a/node_modules/ajv/dist/compile/codegen/scope.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../lib/compile/codegen/scope.ts"],"names":[],"mappings":";;;AAAA,iCAAyC;AAezC,MAAM,UAAW,SAAQ,KAAK;IAE5B,YAAY,IAAoB;QAC9B,KAAK,CAAC,uBAAuB,IAAI,cAAc,CAAC,CAAA;QAChD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;IACzB,CAAC;CACF;AAuBD,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,yDAAO,CAAA;IACP,6DAAS,CAAA;AACX,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AAMY,QAAA,QAAQ,GAAG;IACtB,KAAK,EAAE,IAAI,WAAI,CAAC,OAAO,CAAC;IACxB,GAAG,EAAE,IAAI,WAAI,CAAC,KAAK,CAAC;IACpB,GAAG,EAAE,IAAI,WAAI,CAAC,KAAK,CAAC;CACrB,CAAA;AAED,MA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AI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAA;iBACvD;qBAAM,IAAI,CAAC,CAAC,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,IAAI,CAAC,CAAC,EAAE;oBAChC,IAAI,GAAG,IAAA,QAAC,EAAA,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAA;iBACrC;qBAAM;oBACL,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA;iBAC3B;gBACD,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;YAC7C,CAAC,CAAC,CAAA;SACH;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAjGD,gCAiGC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/errors.d.ts b/node_modules/ajv/dist/compile/errors.d.ts deleted file mode 100644 index 74eef7e21..000000000 --- a/node_modules/ajv/dist/compile/errors.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { KeywordErrorCxt, KeywordErrorDefinition } from "../types"; -import { CodeGen, Code, Name } from "./codegen"; -export declare const keywordError: KeywordErrorDefinition; -export declare const keyword$DataError: KeywordErrorDefinition; -export interface ErrorPaths { - instancePath?: Code; - schemaPath?: string; - parentSchema?: boolean; -} -export declare function reportError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, errorPaths?: ErrorPaths, overrideAllErrors?: boolean): void; -export declare function reportExtraError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, errorPaths?: ErrorPaths): void; -export declare function resetErrorsCount(gen: CodeGen, errsCount: Name): void; -export declare function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }: KeywordErrorCxt): void; diff --git a/node_modules/ajv/dist/compile/errors.js b/node_modules/ajv/dist/compile/errors.js deleted file mode 100644 index e2aca7b93..000000000 --- a/node_modules/ajv/dist/compile/errors.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0; -const codegen_1 = require("./codegen"); -const util_1 = require("./util"); -const names_1 = require("./names"); -exports.keywordError = { - message: ({ keyword }) => (0, codegen_1.str) `must pass "${keyword}" keyword validation`, -}; -exports.keyword$DataError = { - message: ({ keyword, schemaType }) => schemaType - ? (0, codegen_1.str) `"${keyword}" keyword must be ${schemaType} ($data)` - : (0, codegen_1.str) `"${keyword}" keyword is invalid ($data)`, -}; -function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) { - const { it } = cxt; - const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error, errorPaths); - if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) { - addError(gen, errObj); - } - else { - returnErrors(it, (0, codegen_1._) `[${errObj}]`); - } -} -exports.reportError = reportError; -function reportExtraError(cxt, error = exports.keywordError, errorPaths) { - const { it } = cxt; - const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error, errorPaths); - addError(gen, errObj); - if (!(compositeRule || allErrors)) { - returnErrors(it, names_1.default.vErrors); - } -} -exports.reportExtraError = reportExtraError; -function resetErrorsCount(gen, errsCount) { - gen.assign(names_1.default.errors, errsCount); - gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null))); -} -exports.resetErrorsCount = resetErrorsCount; -function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) { - /* istanbul ignore if */ - if (errsCount === undefined) - throw new Error("ajv implementation error"); - const err = gen.name("err"); - gen.forRange("i", errsCount, names_1.default.errors, (i) => { - gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`); - gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath))); - gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`); - if (it.opts.verbose) { - gen.assign((0, codegen_1._) `${err}.schema`, schemaValue); - gen.assign((0, codegen_1._) `${err}.data`, data); - } - }); -} -exports.extendErrors = extendErrors; -function addError(gen, errObj) { - const err = gen.const("err", errObj); - gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`); - gen.code((0, codegen_1._) `${names_1.default.errors}++`); -} -function returnErrors(it, errs) { - const { gen, validateName, schemaEnv } = it; - if (schemaEnv.$async) { - gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`); - } - else { - gen.assign((0, codegen_1._) `${validateName}.errors`, errs); - gen.return(false); - } -} -const E = { - keyword: new codegen_1.Name("keyword"), - schemaPath: new codegen_1.Name("schemaPath"), - params: new codegen_1.Name("params"), - propertyName: new codegen_1.Name("propertyName"), - message: new codegen_1.Name("message"), - schema: new codegen_1.Name("schema"), - parentSchema: new codegen_1.Name("parentSchema"), -}; -function errorObjectCode(cxt, error, errorPaths) { - const { createErrors } = cxt.it; - if (createErrors === false) - return (0, codegen_1._) `{}`; - return errorObject(cxt, error, errorPaths); -} -function errorObject(cxt, error, errorPaths = {}) { - const { gen, it } = cxt; - const keyValues = [ - errorInstancePath(it, errorPaths), - errorSchemaPath(cxt, errorPaths), - ]; - extraErrorProps(cxt, error, keyValues); - return gen.object(...keyValues); -} -function errorInstancePath({ errorPath }, { instancePath }) { - const instPath = instancePath - ? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` - : errorPath; - return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)]; -} -function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) { - let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`; - if (schemaPath) { - schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`; - } - return [E.schemaPath, schPath]; -} -function extraErrorProps(cxt, { params, message }, keyValues) { - const { keyword, data, schemaValue, it } = cxt; - const { opts, propertyName, topSchemaRef, schemaPath } = it; - keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._) `{}`]); - if (opts.messages) { - keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]); - } - if (opts.verbose) { - keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]); - } - if (propertyName) - keyValues.push([E.propertyName, propertyName]); -} -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/errors.js.map b/node_modules/ajv/dist/compile/errors.js.map deleted file mode 100644 index 662089108..000000000 --- a/node_modules/ajv/dist/compile/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../lib/compile/errors.ts"],"names":[],"mappings":";;;AAEA,uCAAgE;AAEhE,iCAAyC;AACzC,mCAAuB;AAEV,QAAA,YAAY,GAA2B;IAClD,OAAO,EAAE,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,cAAc,OAAO,sBAAsB;CACvE,CAAA;AAEY,QAAA,iBAAiB,GAA2B;IACvD,OAAO,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CACjC,UAAU;QACR,CAAC,CAAC,IAAA,aAAG,EAAA,IAAI,OAAO,qBAAqB,UAAU,UAAU;QACzD,CAAC,CAAC,IAAA,aAAG,EAAA,IAAI,OAAO,8BAA8B;CACnD,CAAA;AAQD,SAAgB,WAAW,CACzB,GAAoB,EACpB,QAAgC,oBAAY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AC,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,EACvB,CAAC,CAAC,CAAC,YAAY,EAAE,IAAA,WAAC,EAAA,GAAG,YAAY,GAAG,UAAU,EAAE,CAAC,EACjD,CAAC,eAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CACf,CAAA;KACF;IACD,IAAI,YAAY;QAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;AAClE,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/index.d.ts b/node_modules/ajv/dist/compile/index.d.ts deleted file mode 100644 index 2809353d7..000000000 --- a/node_modules/ajv/dist/compile/index.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type { AnySchema, AnySchemaObject, AnyValidateFunction, EvaluatedProperties, EvaluatedItems } from "../types"; -import type Ajv from "../core"; -import type { InstanceOptions } from "../core"; -import { CodeGen, Name, Code, ValueScopeName } from "./codegen"; -import { LocalRefs } from "./resolve"; -import { JSONType } from "./rules"; -export type SchemaRefs = { - [Ref in string]?: SchemaEnv | AnySchema; -}; -export interface SchemaCxt { - readonly gen: CodeGen; - readonly allErrors?: boolean; - readonly data: Name; - readonly parentData: Name; - readonly parentDataProperty: Code | number; - readonly dataNames: Name[]; - readonly dataPathArr: (Code | number)[]; - readonly dataLevel: number; - dataTypes: JSONType[]; - definedProperties: Set; - readonly topSchemaRef: Code; - readonly validateName: Name; - evaluated?: Name; - readonly ValidationError?: Name; - readonly schema: AnySchema; - readonly schemaEnv: SchemaEnv; - readonly rootId: string; - baseId: string; - readonly schemaPath: Code; - readonly errSchemaPath: string; - readonly errorPath: Code; - readonly propertyName?: Name; - readonly compositeRule?: boolean; - props?: EvaluatedProperties | Name; - items?: EvaluatedItems | Name; - jtdDiscriminator?: string; - jtdMetadata?: boolean; - readonly createErrors?: boolean; - readonly opts: InstanceOptions; - readonly self: Ajv; -} -export interface SchemaObjCxt extends SchemaCxt { - readonly schema: AnySchemaObject; -} -interface SchemaEnvArgs { - readonly schema: AnySchema; - readonly schemaId?: "$id" | "id"; - readonly root?: SchemaEnv; - readonly baseId?: string; - readonly schemaPath?: string; - readonly localRefs?: LocalRefs; - readonly meta?: boolean; -} -export declare class SchemaEnv implements SchemaEnvArgs { - readonly schema: AnySchema; - readonly schemaId?: "$id" | "id"; - readonly root: SchemaEnv; - baseId: string; - schemaPath?: string; - localRefs?: LocalRefs; - readonly meta?: boolean; - readonly $async?: boolean; - readonly refs: SchemaRefs; - readonly dynamicAnchors: { - [Ref in string]?: true; - }; - validate?: AnyValidateFunction; - validateName?: ValueScopeName; - serialize?: (data: unknown) => string; - serializeName?: ValueScopeName; - parse?: (data: string) => unknown; - parseName?: ValueScopeName; - constructor(env: SchemaEnvArgs); -} -export declare function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv; -export declare function resolveRef(this: Ajv, root: SchemaEnv, baseId: string, ref: string): AnySchema | SchemaEnv | undefined; -export declare function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void; -export declare function resolveSchema(this: Ajv, root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it -ref: string): SchemaEnv | undefined; -export {}; diff --git a/node_modules/ajv/dist/compile/index.js b/node_modules/ajv/dist/compile/index.js deleted file mode 100644 index b125ecd02..000000000 --- a/node_modules/ajv/dist/compile/index.js +++ /dev/null @@ -1,242 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0; -const codegen_1 = require("./codegen"); -const validation_error_1 = require("../runtime/validation_error"); -const names_1 = require("./names"); -const resolve_1 = require("./resolve"); -const util_1 = require("./util"); -const validate_1 = require("./validate"); -class SchemaEnv { - constructor(env) { - var _a; - this.refs = {}; - this.dynamicAnchors = {}; - let schema; - if (typeof env.schema == "object") - schema = env.schema; - this.schema = env.schema; - this.schemaId = env.schemaId; - this.root = env.root || this; - this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]); - this.schemaPath = env.schemaPath; - this.localRefs = env.localRefs; - this.meta = env.meta; - this.$async = schema === null || schema === void 0 ? void 0 : schema.$async; - this.refs = {}; - } -} -exports.SchemaEnv = SchemaEnv; -// let codeSize = 0 -// let nodeCount = 0 -// Compiles schema in SchemaEnv -function compileSchema(sch) { - // TODO refactor - remove compilations - const _sch = getCompilingSchema.call(this, sch); - if (_sch) - return _sch; - const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails - const { es5, lines } = this.opts.code; - const { ownProperties } = this.opts; - const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); - let _ValidationError; - if (sch.$async) { - _ValidationError = gen.scopeValue("Error", { - ref: validation_error_1.default, - code: (0, codegen_1._) `require("ajv/dist/runtime/validation_error").default`, - }); - } - const validateName = gen.scopeName("validate"); - sch.validateName = validateName; - const schemaCxt = { - gen, - allErrors: this.opts.allErrors, - data: names_1.default.data, - parentData: names_1.default.parentData, - parentDataProperty: names_1.default.parentDataProperty, - dataNames: [names_1.default.data], - dataPathArr: [codegen_1.nil], - dataLevel: 0, - dataTypes: [], - definedProperties: new Set(), - topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true - ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) } - : { ref: sch.schema }), - validateName, - ValidationError: _ValidationError, - schema: sch.schema, - schemaEnv: sch, - rootId, - baseId: sch.baseId || rootId, - schemaPath: codegen_1.nil, - errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"), - errorPath: (0, codegen_1._) `""`, - opts: this.opts, - self: this, - }; - let sourceCode; - try { - this._compilations.add(sch); - (0, validate_1.validateFunctionCode)(schemaCxt); - gen.optimize(this.opts.code.optimize); - // gen.optimize(1) - const validateCode = gen.toString(); - sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`; - // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount)) - if (this.opts.code.process) - sourceCode = this.opts.code.process(sourceCode, sch); - // console.log("\n\n\n *** \n", sourceCode) - const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode); - const validate = makeValidate(this, this.scope.get()); - this.scope.value(validateName, { ref: validate }); - validate.errors = null; - validate.schema = sch.schema; - validate.schemaEnv = sch; - if (sch.$async) - validate.$async = true; - if (this.opts.code.source === true) { - validate.source = { validateName, validateCode, scopeValues: gen._values }; - } - if (this.opts.unevaluated) { - const { props, items } = schemaCxt; - validate.evaluated = { - props: props instanceof codegen_1.Name ? undefined : props, - items: items instanceof codegen_1.Name ? undefined : items, - dynamicProps: props instanceof codegen_1.Name, - dynamicItems: items instanceof codegen_1.Name, - }; - if (validate.source) - validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated); - } - sch.validate = validate; - return sch; - } - catch (e) { - delete sch.validate; - delete sch.validateName; - if (sourceCode) - this.logger.error("Error compiling schema, function code:", sourceCode); - // console.log("\n\n\n *** \n", sourceCode, this.opts) - throw e; - } - finally { - this._compilations.delete(sch); - } -} -exports.compileSchema = compileSchema; -function resolveRef(root, baseId, ref) { - var _a; - ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref); - const schOrFunc = root.refs[ref]; - if (schOrFunc) - return schOrFunc; - let _sch = resolve.call(this, root, ref); - if (_sch === undefined) { - const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv - const { schemaId } = this.opts; - if (schema) - _sch = new SchemaEnv({ schema, schemaId, root, baseId }); - } - if (_sch === undefined) - return; - return (root.refs[ref] = inlineOrCompile.call(this, _sch)); -} -exports.resolveRef = resolveRef; -function inlineOrCompile(sch) { - if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs)) - return sch.schema; - return sch.validate ? sch : compileSchema.call(this, sch); -} -// Index of schema compilation in the currently compiled list -function getCompilingSchema(schEnv) { - for (const sch of this._compilations) { - if (sameSchemaEnv(sch, schEnv)) - return sch; - } -} -exports.getCompilingSchema = getCompilingSchema; -function sameSchemaEnv(s1, s2) { - return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; -} -// resolve and compile the references ($ref) -// TODO returns AnySchemaObject (if the schema can be inlined) or validation function -function resolve(root, // information about the root schema for the current schema -ref // reference to resolve -) { - let sch; - while (typeof (sch = this.refs[ref]) == "string") - ref = sch; - return sch || this.schemas[ref] || resolveSchema.call(this, root, ref); -} -// Resolve schema, its root and baseId -function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it -ref // reference to resolve -) { - const p = this.opts.uriResolver.parse(ref); - const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p); - let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined); - // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests - if (Object.keys(root.schema).length > 0 && refPath === baseId) { - return getJsonPointer.call(this, p, root); - } - const id = (0, resolve_1.normalizeId)(refPath); - const schOrRef = this.refs[id] || this.schemas[id]; - if (typeof schOrRef == "string") { - const sch = resolveSchema.call(this, root, schOrRef); - if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") - return; - return getJsonPointer.call(this, p, sch); - } - if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") - return; - if (!schOrRef.validate) - compileSchema.call(this, schOrRef); - if (id === (0, resolve_1.normalizeId)(ref)) { - const { schema } = schOrRef; - const { schemaId } = this.opts; - const schId = schema[schemaId]; - if (schId) - baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); - return new SchemaEnv({ schema, schemaId, root, baseId }); - } - return getJsonPointer.call(this, p, schOrRef); -} -exports.resolveSchema = resolveSchema; -const PREVENT_SCOPE_CHANGE = new Set([ - "properties", - "patternProperties", - "enum", - "dependencies", - "definitions", -]); -function getJsonPointer(parsedRef, { baseId, schema, root }) { - var _a; - if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/") - return; - for (const part of parsedRef.fragment.slice(1).split("/")) { - if (typeof schema === "boolean") - return; - const partSchema = schema[(0, util_1.unescapeFragment)(part)]; - if (partSchema === undefined) - return; - schema = partSchema; - // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? - const schId = typeof schema === "object" && schema[this.opts.schemaId]; - if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { - baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); - } - } - let env; - if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) { - const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref); - env = resolveSchema.call(this, root, $ref); - } - // even though resolution failed we need to return SchemaEnv to throw exception - // so that compileAsync loads missing schema. - const { schemaId } = this.opts; - env = env || new SchemaEnv({ schema, schemaId, root, baseId }); - if (env.schema !== env.root.schema) - return env; - return undefined; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/index.js.map b/node_modules/ajv/dist/compile/index.js.map deleted file mode 100644 index 3fd890e67..000000000 --- a/node_modules/ajv/dist/compile/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/compile/index.ts"],"names":[],"mappings":";;;AAUA,uCAAgF;AAChF,kEAAyD;AACzD,mCAAuB;AACvB,uCAAkG;AAClG,iCAA6D;AAC7D,yCAA+C;AA0D/C,MAAa,SAAS;IAkBpB,YAAY,GAAkB;;QATrB,SAAI,GAAe,EAAE,CAAA;QACrB,mBAAc,GAA6B,EAAE,CAAA;QASpD,IAAI,MAAmC,CAAA;QACvC,IAAI,OAAO,GAAG,CAAC,MAAM,IAAI,QAAQ;YAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA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EAAE;QAC1F,MAAM,IAAI,GAAG,IAAA,oBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;QACnE,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;KAC3C;IACD,+EAA+E;IAC/E,6CAA6C;IAC7C,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;IAC5B,GAAG,GAAG,GAAG,IAAI,IAAI,SAAS,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC,CAAA;IAC5D,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM;QAAE,OAAO,GAAG,CAAA;IAC9C,OAAO,SAAS,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/jtd/parse.d.ts b/node_modules/ajv/dist/compile/jtd/parse.d.ts deleted file mode 100644 index 618c64aea..000000000 --- a/node_modules/ajv/dist/compile/jtd/parse.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type Ajv from "../../core"; -import { SchemaObjectMap } from "./types"; -import { SchemaEnv } from ".."; -export default function compileParser(this: Ajv, sch: SchemaEnv, definitions: SchemaObjectMap): SchemaEnv; diff --git a/node_modules/ajv/dist/compile/jtd/parse.js b/node_modules/ajv/dist/compile/jtd/parse.js deleted file mode 100644 index 8fc94fd0e..000000000 --- a/node_modules/ajv/dist/compile/jtd/parse.js +++ /dev/null @@ -1,350 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const types_1 = require("./types"); -const __1 = require(".."); -const codegen_1 = require("../codegen"); -const ref_error_1 = require("../ref_error"); -const names_1 = require("../names"); -const code_1 = require("../../vocabularies/code"); -const ref_1 = require("../../vocabularies/jtd/ref"); -const type_1 = require("../../vocabularies/jtd/type"); -const parseJson_1 = require("../../runtime/parseJson"); -const util_1 = require("../util"); -const timestamp_1 = require("../../runtime/timestamp"); -const genParse = { - elements: parseElements, - values: parseValues, - discriminator: parseDiscriminator, - properties: parseProperties, - optionalProperties: parseProperties, - enum: parseEnum, - type: parseType, - ref: parseRef, -}; -function compileParser(sch, definitions) { - const _sch = __1.getCompilingSchema.call(this, sch); - if (_sch) - return _sch; - const { es5, lines } = this.opts.code; - const { ownProperties } = this.opts; - const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); - const parseName = gen.scopeName("parse"); - const cxt = { - self: this, - gen, - schema: sch.schema, - schemaEnv: sch, - definitions, - data: names_1.default.data, - parseName, - char: gen.name("c"), - }; - let sourceCode; - try { - this._compilations.add(sch); - sch.parseName = parseName; - parserFunction(cxt); - gen.optimize(this.opts.code.optimize); - const parseFuncCode = gen.toString(); - sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${parseFuncCode}`; - const makeParse = new Function(`${names_1.default.scope}`, sourceCode); - const parse = makeParse(this.scope.get()); - this.scope.value(parseName, { ref: parse }); - sch.parse = parse; - } - catch (e) { - if (sourceCode) - this.logger.error("Error compiling parser, function code:", sourceCode); - delete sch.parse; - delete sch.parseName; - throw e; - } - finally { - this._compilations.delete(sch); - } - return sch; -} -exports.default = compileParser; -const undef = (0, codegen_1._) `undefined`; -function parserFunction(cxt) { - const { gen, parseName, char } = cxt; - gen.func(parseName, (0, codegen_1._) `${names_1.default.json}, ${names_1.default.jsonPos}, ${names_1.default.jsonPart}`, false, () => { - gen.let(names_1.default.data); - gen.let(char); - gen.assign((0, codegen_1._) `${parseName}.message`, undef); - gen.assign((0, codegen_1._) `${parseName}.position`, undef); - gen.assign(names_1.default.jsonPos, (0, codegen_1._) `${names_1.default.jsonPos} || 0`); - gen.const(names_1.default.jsonLen, (0, codegen_1._) `${names_1.default.json}.length`); - parseCode(cxt); - skipWhitespace(cxt); - gen.if(names_1.default.jsonPart, () => { - gen.assign((0, codegen_1._) `${parseName}.position`, names_1.default.jsonPos); - gen.return(names_1.default.data); - }); - gen.if((0, codegen_1._) `${names_1.default.jsonPos} === ${names_1.default.jsonLen}`, () => gen.return(names_1.default.data)); - jsonSyntaxError(cxt); - }); -} -function parseCode(cxt) { - let form; - for (const key of types_1.jtdForms) { - if (key in cxt.schema) { - form = key; - break; - } - } - if (form) - parseNullable(cxt, genParse[form]); - else - parseEmpty(cxt); -} -const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError)); -function parseNullable(cxt, parseForm) { - const { gen, schema, data } = cxt; - if (!schema.nullable) - return parseForm(cxt); - tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null)); -} -function parseElements(cxt) { - const { gen, schema, data } = cxt; - parseToken(cxt, "["); - const ix = gen.let("i", 0); - gen.assign(data, (0, codegen_1._) `[]`); - parseItems(cxt, "]", () => { - const el = gen.let("el"); - parseCode({ ...cxt, schema: schema.elements, data: el }); - gen.assign((0, codegen_1._) `${data}[${ix}++]`, el); - }); -} -function parseValues(cxt) { - const { gen, schema, data } = cxt; - parseToken(cxt, "{"); - gen.assign(data, (0, codegen_1._) `{}`); - parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values)); -} -function parseItems(cxt, endToken, block) { - tryParseItems(cxt, endToken, block); - parseToken(cxt, endToken); -} -function tryParseItems(cxt, endToken, block) { - const { gen } = cxt; - gen.for((0, codegen_1._) `;${names_1.default.jsonPos}<${names_1.default.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => { - block(); - tryParseToken(cxt, ",", () => gen.break(), hasItem); - }); - function hasItem() { - tryParseToken(cxt, endToken, () => { }, jsonSyntaxError); - } -} -function parseKeyValue(cxt, schema) { - const { gen } = cxt; - const key = gen.let("key"); - parseString({ ...cxt, data: key }); - parseToken(cxt, ":"); - parsePropertyValue(cxt, key, schema); -} -function parseDiscriminator(cxt) { - const { gen, data, schema } = cxt; - const { discriminator, mapping } = schema; - parseToken(cxt, "{"); - gen.assign(data, (0, codegen_1._) `{}`); - const startPos = gen.const("pos", names_1.default.jsonPos); - const value = gen.let("value"); - const tag = gen.let("tag"); - tryParseItems(cxt, "}", () => { - const key = gen.let("key"); - parseString({ ...cxt, data: key }); - parseToken(cxt, ":"); - gen.if((0, codegen_1._) `${key} === ${discriminator}`, () => { - parseString({ ...cxt, data: tag }); - gen.assign((0, codegen_1._) `${data}[${key}]`, tag); - gen.break(); - }, () => parseEmpty({ ...cxt, data: value }) // can be discarded/skipped - ); - }); - gen.assign(names_1.default.jsonPos, startPos); - gen.if((0, codegen_1._) `${tag} === undefined`); - parsingError(cxt, (0, codegen_1.str) `discriminator tag not found`); - for (const tagValue in mapping) { - gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); - parseSchemaProperties({ ...cxt, schema: mapping[tagValue] }, discriminator); - } - gen.else(); - parsingError(cxt, (0, codegen_1.str) `discriminator value not in schema`); - gen.endIf(); -} -function parseProperties(cxt) { - const { gen, data } = cxt; - parseToken(cxt, "{"); - gen.assign(data, (0, codegen_1._) `{}`); - parseSchemaProperties(cxt); -} -function parseSchemaProperties(cxt, discriminator) { - const { gen, schema, data } = cxt; - const { properties, optionalProperties, additionalProperties } = schema; - parseItems(cxt, "}", () => { - const key = gen.let("key"); - parseString({ ...cxt, data: key }); - parseToken(cxt, ":"); - gen.if(false); - parseDefinedProperty(cxt, key, properties); - parseDefinedProperty(cxt, key, optionalProperties); - if (discriminator) { - gen.elseIf((0, codegen_1._) `${key} === ${discriminator}`); - const tag = gen.let("tag"); - parseString({ ...cxt, data: tag }); // can be discarded, it is already assigned - } - gen.else(); - if (additionalProperties) { - parseEmpty({ ...cxt, data: (0, codegen_1._) `${data}[${key}]` }); - } - else { - parsingError(cxt, (0, codegen_1.str) `property ${key} not allowed`); - } - gen.endIf(); - }); - if (properties) { - const hasProp = (0, code_1.hasPropFunc)(gen); - const allProps = (0, codegen_1.and)(...Object.keys(properties).map((p) => (0, codegen_1._) `${hasProp}.call(${data}, ${p})`)); - gen.if((0, codegen_1.not)(allProps), () => parsingError(cxt, (0, codegen_1.str) `missing required properties`)); - } -} -function parseDefinedProperty(cxt, key, schemas = {}) { - const { gen } = cxt; - for (const prop in schemas) { - gen.elseIf((0, codegen_1._) `${key} === ${prop}`); - parsePropertyValue(cxt, key, schemas[prop]); - } -} -function parsePropertyValue(cxt, key, schema) { - parseCode({ ...cxt, schema, data: (0, codegen_1._) `${cxt.data}[${key}]` }); -} -function parseType(cxt) { - const { gen, schema, data, self } = cxt; - switch (schema.type) { - case "boolean": - parseBoolean(cxt); - break; - case "string": - parseString(cxt); - break; - case "timestamp": { - parseString(cxt); - const vts = (0, util_1.useFunc)(gen, timestamp_1.default); - const { allowDate, parseDate } = self.opts; - const notValid = allowDate ? (0, codegen_1._) `!${vts}(${data}, true)` : (0, codegen_1._) `!${vts}(${data})`; - const fail = parseDate - ? (0, codegen_1.or)(notValid, (0, codegen_1._) `(${data} = new Date(${data}), false)`, (0, codegen_1._) `isNaN(${data}.valueOf())`) - : notValid; - gen.if(fail, () => parsingError(cxt, (0, codegen_1.str) `invalid timestamp`)); - break; - } - case "float32": - case "float64": - parseNumber(cxt); - break; - default: { - const t = schema.type; - if (!self.opts.int32range && (t === "int32" || t === "uint32")) { - parseNumber(cxt, 16); // 2 ** 53 - max safe integer - if (t === "uint32") { - gen.if((0, codegen_1._) `${data} < 0`, () => parsingError(cxt, (0, codegen_1.str) `integer out of range`)); - } - } - else { - const [min, max, maxDigits] = type_1.intRange[t]; - parseNumber(cxt, maxDigits); - gen.if((0, codegen_1._) `${data} < ${min} || ${data} > ${max}`, () => parsingError(cxt, (0, codegen_1.str) `integer out of range`)); - } - } - } -} -function parseString(cxt) { - parseToken(cxt, '"'); - parseWith(cxt, parseJson_1.parseJsonString); -} -function parseEnum(cxt) { - const { gen, data, schema } = cxt; - const enumSch = schema.enum; - parseToken(cxt, '"'); - // TODO loopEnum - gen.if(false); - for (const value of enumSch) { - const valueStr = JSON.stringify(value).slice(1); // remove starting quote - gen.elseIf((0, codegen_1._) `${jsonSlice(valueStr.length)} === ${valueStr}`); - gen.assign(data, (0, codegen_1.str) `${value}`); - gen.add(names_1.default.jsonPos, valueStr.length); - } - gen.else(); - jsonSyntaxError(cxt); - gen.endIf(); -} -function parseNumber(cxt, maxDigits) { - const { gen } = cxt; - skipWhitespace(cxt); - gen.if((0, codegen_1._) `"-0123456789".indexOf(${jsonSlice(1)}) < 0`, () => jsonSyntaxError(cxt), () => parseWith(cxt, parseJson_1.parseJsonNumber, maxDigits)); -} -function parseBooleanToken(bool, fail) { - return (cxt) => { - const { gen, data } = cxt; - tryParseToken(cxt, `${bool}`, () => fail(cxt), () => gen.assign(data, bool)); - }; -} -function parseRef(cxt) { - const { gen, self, definitions, schema, schemaEnv } = cxt; - const { ref } = schema; - const refSchema = definitions[ref]; - if (!refSchema) - throw new ref_error_1.default(self.opts.uriResolver, "", ref, `No definition ${ref}`); - if (!(0, ref_1.hasRef)(refSchema)) - return parseCode({ ...cxt, schema: refSchema }); - const { root } = schemaEnv; - const sch = compileParser.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions); - partialParse(cxt, getParser(gen, sch), true); -} -function getParser(gen, sch) { - return sch.parse - ? gen.scopeValue("parse", { ref: sch.parse }) - : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.parse`; -} -function parseEmpty(cxt) { - parseWith(cxt, parseJson_1.parseJson); -} -function parseWith(cxt, parseFunc, args) { - partialParse(cxt, (0, util_1.useFunc)(cxt.gen, parseFunc), args); -} -function partialParse(cxt, parseFunc, args) { - const { gen, data } = cxt; - gen.assign(data, (0, codegen_1._) `${parseFunc}(${names_1.default.json}, ${names_1.default.jsonPos}${args ? (0, codegen_1._) `, ${args}` : codegen_1.nil})`); - gen.assign(names_1.default.jsonPos, (0, codegen_1._) `${parseFunc}.position`); - gen.if((0, codegen_1._) `${data} === undefined`, () => parsingError(cxt, (0, codegen_1._) `${parseFunc}.message`)); -} -function parseToken(cxt, tok) { - tryParseToken(cxt, tok, jsonSyntaxError); -} -function tryParseToken(cxt, tok, fail, success) { - const { gen } = cxt; - const n = tok.length; - skipWhitespace(cxt); - gen.if((0, codegen_1._) `${jsonSlice(n)} === ${tok}`, () => { - gen.add(names_1.default.jsonPos, n); - success === null || success === void 0 ? void 0 : success(cxt); - }, () => fail(cxt)); -} -function skipWhitespace({ gen, char: c }) { - gen.code((0, codegen_1._) `while((${c}=${names_1.default.json}[${names_1.default.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${names_1.default.jsonPos}++;`); -} -function jsonSlice(len) { - return len === 1 - ? (0, codegen_1._) `${names_1.default.json}[${names_1.default.jsonPos}]` - : (0, codegen_1._) `${names_1.default.json}.slice(${names_1.default.jsonPos}, ${names_1.default.jsonPos}+${len})`; -} -function jsonSyntaxError(cxt) { - parsingError(cxt, (0, codegen_1._) `"unexpected token " + ${names_1.default.json}[${names_1.default.jsonPos}]`); -} -function parsingError({ gen, parseName }, msg) { - gen.assign((0, codegen_1._) `${parseName}.message`, msg); - gen.assign((0, codegen_1._) `${parseName}.position`, names_1.default.jsonPos); - gen.return(undef); -} -//# sourceMappingURL=parse.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/jtd/parse.js.map b/node_modules/ajv/dist/compile/jtd/parse.js.map deleted file mode 100644 index a1e86279d..000000000 --- a/node_modules/ajv/dist/compile/jtd/parse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../lib/compile/jtd/parse.ts"],"names":[],"mappings":";;AAEA,mCAA0D;AAC1D,0BAAgD;AAChD,wCAAmF;AACnF,4CAA0C;AAC1C,oCAAwB;AACxB,kDAAmD;AACnD,oDAAiD;AACjD,sDAA6D;AAC7D,uDAAmF;AACnF,kCAA+B;AAC/B,uDAAoD;AAIpD,MAAM,QAAQ,GAA+B;IAC3C,QAAQ,EAAE,aAAa;IACvB,MAAM,EAAE,WAAW;IACnB,aAAa,EAAE,kBAAkB;IACjC,UAAU,EAAE,eA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AS,SAAS,CAAC,GAAkB;IACnC,OAAO,GAAG,KAAK,CAAC;QACd,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,IAAI,IAAI,eAAC,CAAC,OAAO,GAAG;QAC5B,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,IAAI,UAAU,eAAC,CAAC,OAAO,KAAK,eAAC,CAAC,OAAO,IAAI,GAAG,GAAG,CAAA;AAC3D,CAAC;AAED,SAAS,eAAe,CAAC,GAAa;IACpC,YAAY,CAAC,GAAG,EAAE,IAAA,WAAC,EAAA,yBAAyB,eAAC,CAAC,IAAI,IAAI,eAAC,CAAC,OAAO,GAAG,CAAC,CAAA;AACrE,CAAC;AAED,SAAS,YAAY,CAAC,EAAC,GAAG,EAAE,SAAS,EAAW,EAAE,GAAS;IACzD,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,SAAS,UAAU,EAAE,GAAG,CAAC,CAAA;IACxC,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,SAAS,WAAW,EAAE,eAAC,CAAC,OAAO,CAAC,CAAA;IAC/C,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACnB,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/jtd/serialize.d.ts b/node_modules/ajv/dist/compile/jtd/serialize.d.ts deleted file mode 100644 index b0413d716..000000000 --- a/node_modules/ajv/dist/compile/jtd/serialize.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type Ajv from "../../core"; -import { SchemaObjectMap } from "./types"; -import { SchemaEnv } from ".."; -export default function compileSerializer(this: Ajv, sch: SchemaEnv, definitions: SchemaObjectMap): SchemaEnv; diff --git a/node_modules/ajv/dist/compile/jtd/serialize.js b/node_modules/ajv/dist/compile/jtd/serialize.js deleted file mode 100644 index 341c50078..000000000 --- a/node_modules/ajv/dist/compile/jtd/serialize.js +++ /dev/null @@ -1,229 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const types_1 = require("./types"); -const __1 = require(".."); -const codegen_1 = require("../codegen"); -const ref_error_1 = require("../ref_error"); -const names_1 = require("../names"); -const code_1 = require("../../vocabularies/code"); -const ref_1 = require("../../vocabularies/jtd/ref"); -const util_1 = require("../util"); -const quote_1 = require("../../runtime/quote"); -const genSerialize = { - elements: serializeElements, - values: serializeValues, - discriminator: serializeDiscriminator, - properties: serializeProperties, - optionalProperties: serializeProperties, - enum: serializeString, - type: serializeType, - ref: serializeRef, -}; -function compileSerializer(sch, definitions) { - const _sch = __1.getCompilingSchema.call(this, sch); - if (_sch) - return _sch; - const { es5, lines } = this.opts.code; - const { ownProperties } = this.opts; - const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); - const serializeName = gen.scopeName("serialize"); - const cxt = { - self: this, - gen, - schema: sch.schema, - schemaEnv: sch, - definitions, - data: names_1.default.data, - }; - let sourceCode; - try { - this._compilations.add(sch); - sch.serializeName = serializeName; - gen.func(serializeName, names_1.default.data, false, () => { - gen.let(names_1.default.json, (0, codegen_1.str) ``); - serializeCode(cxt); - gen.return(names_1.default.json); - }); - gen.optimize(this.opts.code.optimize); - const serializeFuncCode = gen.toString(); - sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${serializeFuncCode}`; - const makeSerialize = new Function(`${names_1.default.scope}`, sourceCode); - const serialize = makeSerialize(this.scope.get()); - this.scope.value(serializeName, { ref: serialize }); - sch.serialize = serialize; - } - catch (e) { - if (sourceCode) - this.logger.error("Error compiling serializer, function code:", sourceCode); - delete sch.serialize; - delete sch.serializeName; - throw e; - } - finally { - this._compilations.delete(sch); - } - return sch; -} -exports.default = compileSerializer; -function serializeCode(cxt) { - let form; - for (const key of types_1.jtdForms) { - if (key in cxt.schema) { - form = key; - break; - } - } - serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty); -} -function serializeNullable(cxt, serializeForm) { - const { gen, schema, data } = cxt; - if (!schema.nullable) - return serializeForm(cxt); - gen.if((0, codegen_1._) `${data} === undefined || ${data} === null`, () => gen.add(names_1.default.json, (0, codegen_1._) `"null"`), () => serializeForm(cxt)); -} -function serializeElements(cxt) { - const { gen, schema, data } = cxt; - gen.add(names_1.default.json, (0, codegen_1.str) `[`); - const first = gen.let("first", true); - gen.forOf("el", data, (el) => { - addComma(cxt, first); - serializeCode({ ...cxt, schema: schema.elements, data: el }); - }); - gen.add(names_1.default.json, (0, codegen_1.str) `]`); -} -function serializeValues(cxt) { - const { gen, schema, data } = cxt; - gen.add(names_1.default.json, (0, codegen_1.str) `{`); - const first = gen.let("first", true); - gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first)); - gen.add(names_1.default.json, (0, codegen_1.str) `}`); -} -function serializeKeyValue(cxt, key, schema, first) { - const { gen, data } = cxt; - addComma(cxt, first); - serializeString({ ...cxt, data: key }); - gen.add(names_1.default.json, (0, codegen_1.str) `:`); - const value = gen.const("value", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(key)}`); - serializeCode({ ...cxt, schema, data: value }); -} -function serializeDiscriminator(cxt) { - const { gen, schema, data } = cxt; - const { discriminator } = schema; - gen.add(names_1.default.json, (0, codegen_1.str) `{${JSON.stringify(discriminator)}:`); - const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(discriminator)}`); - serializeString({ ...cxt, data: tag }); - gen.if(false); - for (const tagValue in schema.mapping) { - gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); - const sch = schema.mapping[tagValue]; - serializeSchemaProperties({ ...cxt, schema: sch }, discriminator); - } - gen.endIf(); - gen.add(names_1.default.json, (0, codegen_1.str) `}`); -} -function serializeProperties(cxt) { - const { gen } = cxt; - gen.add(names_1.default.json, (0, codegen_1.str) `{`); - serializeSchemaProperties(cxt); - gen.add(names_1.default.json, (0, codegen_1.str) `}`); -} -function serializeSchemaProperties(cxt, discriminator) { - const { gen, schema, data } = cxt; - const { properties, optionalProperties } = schema; - const props = keys(properties); - const optProps = keys(optionalProperties); - const allProps = allProperties(props.concat(optProps)); - let first = !discriminator; - let firstProp; - for (const key of props) { - if (first) - first = false; - else - gen.add(names_1.default.json, (0, codegen_1.str) `,`); - serializeProperty(key, properties[key], keyValue(key)); - } - if (first) - firstProp = gen.let("first", true); - for (const key of optProps) { - const value = keyValue(key); - gen.if((0, codegen_1.and)((0, codegen_1._) `${value} !== undefined`, (0, code_1.isOwnProperty)(gen, data, key)), () => { - addComma(cxt, firstProp); - serializeProperty(key, optionalProperties[key], value); - }); - } - if (schema.additionalProperties) { - gen.forIn("key", data, (key) => gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp))); - } - function keys(ps) { - return ps ? Object.keys(ps) : []; - } - function allProperties(ps) { - if (discriminator) - ps.push(discriminator); - if (new Set(ps).size !== ps.length) { - throw new Error("JTD: properties/optionalProperties/disciminator overlap"); - } - return ps; - } - function keyValue(key) { - return gen.const("value", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(key)}`); - } - function serializeProperty(key, propSchema, value) { - gen.add(names_1.default.json, (0, codegen_1.str) `${JSON.stringify(key)}:`); - serializeCode({ ...cxt, schema: propSchema, data: value }); - } - function isAdditional(key, ps) { - return ps.length ? (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._) `${key} !== ${p}`)) : true; - } -} -function serializeType(cxt) { - const { gen, schema, data } = cxt; - switch (schema.type) { - case "boolean": - gen.add(names_1.default.json, (0, codegen_1._) `${data} ? "true" : "false"`); - break; - case "string": - serializeString(cxt); - break; - case "timestamp": - gen.if((0, codegen_1._) `${data} instanceof Date`, () => gen.add(names_1.default.json, (0, codegen_1._) `'"' + ${data}.toISOString() + '"'`), () => serializeString(cxt)); - break; - default: - serializeNumber(cxt); - } -} -function serializeString({ gen, data }) { - gen.add(names_1.default.json, (0, codegen_1._) `${(0, util_1.useFunc)(gen, quote_1.default)}(${data})`); -} -function serializeNumber({ gen, data }) { - gen.add(names_1.default.json, (0, codegen_1._) `"" + ${data}`); -} -function serializeRef(cxt) { - const { gen, self, data, definitions, schema, schemaEnv } = cxt; - const { ref } = schema; - const refSchema = definitions[ref]; - if (!refSchema) - throw new ref_error_1.default(self.opts.uriResolver, "", ref, `No definition ${ref}`); - if (!(0, ref_1.hasRef)(refSchema)) - return serializeCode({ ...cxt, schema: refSchema }); - const { root } = schemaEnv; - const sch = compileSerializer.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions); - gen.add(names_1.default.json, (0, codegen_1._) `${getSerialize(gen, sch)}(${data})`); -} -function getSerialize(gen, sch) { - return sch.serialize - ? gen.scopeValue("serialize", { ref: sch.serialize }) - : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.serialize`; -} -function serializeEmpty({ gen, data }) { - gen.add(names_1.default.json, (0, codegen_1._) `JSON.stringify(${data})`); -} -function addComma({ gen }, first) { - if (first) { - gen.if(first, () => gen.assign(first, false), () => gen.add(names_1.default.json, (0, codegen_1.str) `,`)); - } - else { - gen.add(names_1.default.json, (0, codegen_1.str) `,`); - } -} -//# sourceMappingURL=serialize.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/jtd/serialize.js.map b/node_modules/ajv/dist/compile/jtd/serialize.js.map deleted file mode 100644 index 8a574d1fd..000000000 --- a/node_modules/ajv/dist/compile/jtd/serialize.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../lib/compile/jtd/serialize.ts"],"names":[],"mappings":";;AAEA,mCAA0D;AAC1D,0BAAgD;AAChD,wCAAwE;AACxE,4CAA0C;AAC1C,oCAAwB;AACxB,kDAAqD;AACrD,oDAAiD;AACjD,kCAA+B;AAC/B,+CAAuC;AAEvC,MAAM,YAAY,GAAkD;IAClE,QAAQ,EAAE,iBAAiB;IAC3B,MAAM,EAAE,eAAe;IACvB,aAAa,EAAE,sBAAsB;IACrC,UAAU,EAAE,mBAAmB;IAC/B,kBAAkB,EAAE,mBAAmB;IACvC,IAAI,EAAE,eAAe;I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EAAE,IAAA,WAAC,EAAA,kBAAkB,IAAI,GAAG,CAAC,CAAA;AAC7C,CAAC;AAED,SAAS,QAAQ,CAAC,EAAC,GAAG,EAAe,EAAE,KAAY;IACjD,IAAI,KAAK,EAAE;QACT,GAAG,CAAC,EAAE,CACJ,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9B,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,eAAC,CAAC,IAAI,EAAE,IAAA,aAAG,EAAA,GAAG,CAAC,CAC9B,CAAA;KACF;SAAM;QACL,GAAG,CAAC,GAAG,CAAC,eAAC,CAAC,IAAI,EAAE,IAAA,aAAG,EAAA,GAAG,CAAC,CAAA;KACxB;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/jtd/types.d.ts b/node_modules/ajv/dist/compile/jtd/types.d.ts deleted file mode 100644 index f131daa55..000000000 --- a/node_modules/ajv/dist/compile/jtd/types.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { SchemaObject } from "../../types"; -export type SchemaObjectMap = { - [Ref in string]?: SchemaObject; -}; -export declare const jtdForms: readonly ["elements", "values", "discriminator", "properties", "optionalProperties", "enum", "type", "ref"]; -export type JTDForm = typeof jtdForms[number]; diff --git a/node_modules/ajv/dist/compile/jtd/types.js b/node_modules/ajv/dist/compile/jtd/types.js deleted file mode 100644 index b9c60a90f..000000000 --- a/node_modules/ajv/dist/compile/jtd/types.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.jtdForms = void 0; -exports.jtdForms = [ - "elements", - "values", - "discriminator", - "properties", - "optionalProperties", - "enum", - "type", - "ref", -]; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/jtd/types.js.map b/node_modules/ajv/dist/compile/jtd/types.js.map deleted file mode 100644 index 53439e002..000000000 --- a/node_modules/ajv/dist/compile/jtd/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/compile/jtd/types.ts"],"names":[],"mappings":";;;AAIa,QAAA,QAAQ,GAAG;IACtB,UAAU;IACV,QAAQ;IACR,eAAe;IACf,YAAY;IACZ,oBAAoB;IACpB,MAAM;IACN,MAAM;IACN,KAAK;CACG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/names.d.ts b/node_modules/ajv/dist/compile/names.d.ts deleted file mode 100644 index 5740e82c6..000000000 --- a/node_modules/ajv/dist/compile/names.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Name } from "./codegen"; -declare const names: { - data: Name; - valCxt: Name; - instancePath: Name; - parentData: Name; - parentDataProperty: Name; - rootData: Name; - dynamicAnchors: Name; - vErrors: Name; - errors: Name; - this: Name; - self: Name; - scope: Name; - json: Name; - jsonPos: Name; - jsonLen: Name; - jsonPart: Name; -}; -export default names; diff --git a/node_modules/ajv/dist/compile/names.js b/node_modules/ajv/dist/compile/names.js deleted file mode 100644 index 015334bd5..000000000 --- a/node_modules/ajv/dist/compile/names.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("./codegen"); -const names = { - // validation function arguments - data: new codegen_1.Name("data"), - // args passed from referencing schema - valCxt: new codegen_1.Name("valCxt"), - instancePath: new codegen_1.Name("instancePath"), - parentData: new codegen_1.Name("parentData"), - parentDataProperty: new codegen_1.Name("parentDataProperty"), - rootData: new codegen_1.Name("rootData"), - dynamicAnchors: new codegen_1.Name("dynamicAnchors"), - // function scoped variables - vErrors: new codegen_1.Name("vErrors"), - errors: new codegen_1.Name("errors"), - this: new codegen_1.Name("this"), - // "globals" - self: new codegen_1.Name("self"), - scope: new codegen_1.Name("scope"), - // JTD serialize/parse name for JSON string and position - json: new codegen_1.Name("json"), - jsonPos: new codegen_1.Name("jsonPos"), - jsonLen: new codegen_1.Name("jsonLen"), - jsonPart: new codegen_1.Name("jsonPart"), -}; -exports.default = names; -//# sourceMappingURL=names.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/names.js.map b/node_modules/ajv/dist/compile/names.js.map deleted file mode 100644 index 9bbe8e275..000000000 --- a/node_modules/ajv/dist/compile/names.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"names.js","sourceRoot":"","sources":["../../lib/compile/names.ts"],"names":[],"mappings":";;AAAA,uCAA8B;AAE9B,MAAM,KAAK,GAAG;IACZ,gCAAgC;IAChC,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,sCAAsC;IACtC,MAAM,EAAE,IAAI,cAAI,CAAC,QAAQ,CAAC;IAC1B,YAAY,EAAE,IAAI,cAAI,CAAC,cAAc,CAAC;IACtC,UAAU,EAAE,IAAI,cAAI,CAAC,YAAY,CAAC;IAClC,kBAAkB,EAAE,IAAI,cAAI,CAAC,oBAAoB,CAAC;IAClD,QAAQ,EAAE,IAAI,cAAI,CAAC,UAAU,CAAC;IAC9B,cAAc,EAAE,IAAI,cAAI,CAAC,gBAAgB,CAAC;IAC1C,4BAA4B;IAC5B,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,MAAM,EAAE,IAAI,cAAI,CAAC,QAAQ,CAAC;IAC1B,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,YAAY;IACZ,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,KAAK,EAAE,IAAI,cAAI,CAAC,OAAO,CAAC;IACxB,wDAAwD;IACxD,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,QAAQ,EAAE,IAAI,cAAI,CAAC,UAAU,CAAC;CAC/B,CAAA;AAED,kBAAe,KAAK,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/ref_error.d.ts b/node_modules/ajv/dist/compile/ref_error.d.ts deleted file mode 100644 index 43374439e..000000000 --- a/node_modules/ajv/dist/compile/ref_error.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UriResolver } from "../types"; -export default class MissingRefError extends Error { - readonly missingRef: string; - readonly missingSchema: string; - constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string); -} diff --git a/node_modules/ajv/dist/compile/ref_error.js b/node_modules/ajv/dist/compile/ref_error.js deleted file mode 100644 index 3916dec8a..000000000 --- a/node_modules/ajv/dist/compile/ref_error.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const resolve_1 = require("./resolve"); -class MissingRefError extends Error { - constructor(resolver, baseId, ref, msg) { - super(msg || `can't resolve reference ${ref} from id ${baseId}`); - this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref); - this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef)); - } -} -exports.default = MissingRefError; -//# sourceMappingURL=ref_error.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/ref_error.js.map b/node_modules/ajv/dist/compile/ref_error.js.map deleted file mode 100644 index d13f5f2dd..000000000 --- a/node_modules/ajv/dist/compile/ref_error.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ref_error.js","sourceRoot":"","sources":["../../lib/compile/ref_error.ts"],"names":[],"mappings":";;AAAA,uCAA8D;AAG9D,MAAqB,eAAgB,SAAQ,KAAK;IAIhD,YAAY,QAAqB,EAAE,MAAc,EAAE,GAAW,EAAE,GAAY;QAC1E,KAAK,CAAC,GAAG,IAAI,2BAA2B,GAAG,YAAY,MAAM,EAAE,CAAC,CAAA;QAChE,IAAI,CAAC,UAAU,GAAG,IAAA,oBAAU,EAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;QACnD,IAAI,CAAC,aAAa,GAAG,IAAA,qBAAW,EAAC,IAAA,qBAAW,EAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;IAC1E,CAAC;CACF;AATD,kCASC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/resolve.d.ts b/node_modules/ajv/dist/compile/resolve.d.ts deleted file mode 100644 index 70ef6ce6a..000000000 --- a/node_modules/ajv/dist/compile/resolve.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { AnySchema, AnySchemaObject, UriResolver } from "../types"; -import type Ajv from "../ajv"; -import type { URIComponents } from "uri-js"; -export type LocalRefs = { - [Ref in string]?: AnySchemaObject; -}; -export declare function inlineRef(schema: AnySchema, limit?: boolean | number): boolean; -export declare function getFullPath(resolver: UriResolver, id?: string, normalize?: boolean): string; -export declare function _getFullPath(resolver: UriResolver, p: URIComponents): string; -export declare function normalizeId(id: string | undefined): string; -export declare function resolveUrl(resolver: UriResolver, baseId: string, id: string): string; -export declare function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs; diff --git a/node_modules/ajv/dist/compile/resolve.js b/node_modules/ajv/dist/compile/resolve.js deleted file mode 100644 index 8b51a20e6..000000000 --- a/node_modules/ajv/dist/compile/resolve.js +++ /dev/null @@ -1,155 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0; -const util_1 = require("./util"); -const equal = require("fast-deep-equal"); -const traverse = require("json-schema-traverse"); -// TODO refactor to use keyword definitions -const SIMPLE_INLINED = new Set([ - "type", - "format", - "pattern", - "maxLength", - "minLength", - "maxProperties", - "minProperties", - "maxItems", - "minItems", - "maximum", - "minimum", - "uniqueItems", - "multipleOf", - "required", - "enum", - "const", -]); -function inlineRef(schema, limit = true) { - if (typeof schema == "boolean") - return true; - if (limit === true) - return !hasRef(schema); - if (!limit) - return false; - return countKeys(schema) <= limit; -} -exports.inlineRef = inlineRef; -const REF_KEYWORDS = new Set([ - "$ref", - "$recursiveRef", - "$recursiveAnchor", - "$dynamicRef", - "$dynamicAnchor", -]); -function hasRef(schema) { - for (const key in schema) { - if (REF_KEYWORDS.has(key)) - return true; - const sch = schema[key]; - if (Array.isArray(sch) && sch.some(hasRef)) - return true; - if (typeof sch == "object" && hasRef(sch)) - return true; - } - return false; -} -function countKeys(schema) { - let count = 0; - for (const key in schema) { - if (key === "$ref") - return Infinity; - count++; - if (SIMPLE_INLINED.has(key)) - continue; - if (typeof schema[key] == "object") { - (0, util_1.eachItem)(schema[key], (sch) => (count += countKeys(sch))); - } - if (count === Infinity) - return Infinity; - } - return count; -} -function getFullPath(resolver, id = "", normalize) { - if (normalize !== false) - id = normalizeId(id); - const p = resolver.parse(id); - return _getFullPath(resolver, p); -} -exports.getFullPath = getFullPath; -function _getFullPath(resolver, p) { - const serialized = resolver.serialize(p); - return serialized.split("#")[0] + "#"; -} -exports._getFullPath = _getFullPath; -const TRAILING_SLASH_HASH = /#\/?$/; -function normalizeId(id) { - return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; -} -exports.normalizeId = normalizeId; -function resolveUrl(resolver, baseId, id) { - id = normalizeId(id); - return resolver.resolve(baseId, id); -} -exports.resolveUrl = resolveUrl; -const ANCHOR = /^[a-z_][-a-z0-9._]*$/i; -function getSchemaRefs(schema, baseId) { - if (typeof schema == "boolean") - return {}; - const { schemaId, uriResolver } = this.opts; - const schId = normalizeId(schema[schemaId] || baseId); - const baseIds = { "": schId }; - const pathPrefix = getFullPath(uriResolver, schId, false); - const localRefs = {}; - const schemaRefs = new Set(); - traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => { - if (parentJsonPtr === undefined) - return; - const fullPath = pathPrefix + jsonPtr; - let baseId = baseIds[parentJsonPtr]; - if (typeof sch[schemaId] == "string") - baseId = addRef.call(this, sch[schemaId]); - addAnchor.call(this, sch.$anchor); - addAnchor.call(this, sch.$dynamicAnchor); - baseIds[jsonPtr] = baseId; - function addRef(ref) { - // eslint-disable-next-line @typescript-eslint/unbound-method - const _resolve = this.opts.uriResolver.resolve; - ref = normalizeId(baseId ? _resolve(baseId, ref) : ref); - if (schemaRefs.has(ref)) - throw ambiguos(ref); - schemaRefs.add(ref); - let schOrRef = this.refs[ref]; - if (typeof schOrRef == "string") - schOrRef = this.refs[schOrRef]; - if (typeof schOrRef == "object") { - checkAmbiguosRef(sch, schOrRef.schema, ref); - } - else if (ref !== normalizeId(fullPath)) { - if (ref[0] === "#") { - checkAmbiguosRef(sch, localRefs[ref], ref); - localRefs[ref] = sch; - } - else { - this.refs[ref] = fullPath; - } - } - return ref; - } - function addAnchor(anchor) { - if (typeof anchor == "string") { - if (!ANCHOR.test(anchor)) - throw new Error(`invalid anchor "${anchor}"`); - addRef.call(this, `#${anchor}`); - } - } - }); - return localRefs; - function checkAmbiguosRef(sch1, sch2, ref) { - if (sch2 !== undefined && !equal(sch1, sch2)) - throw ambiguos(ref); - } - function ambiguos(ref) { - return new Error(`reference "${ref}" resolves to more than one schema`); - } -} -exports.getSchemaRefs = getSchemaRefs; -//# sourceMappingURL=resolve.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/resolve.js.map b/node_modules/ajv/dist/compile/resolve.js.map deleted file mode 100644 index 81f08b0c3..000000000 --- a/node_modules/ajv/dist/compile/resolve.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../lib/compile/resolve.ts"],"names":[],"mappings":";;;AAGA,iCAA+B;AAC/B,yCAAwC;AACxC,iDAAgD;AAKhD,2CAA2C;AAC3C,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,MAAM;IACN,QAAQ;IACR,SAAS;IACT,WAAW;IACX,WAAW;IACX,eAAe;IACf,eAAe;IACf,UAAU;IACV,UAAU;IACV,SAAS;IACT,SAAS;IACT,aAAa;IACb,YAAY;IACZ,UAAU;IACV,MAAM;IACN,OAAO;CACR,C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AS,gBAAgB,CAAC,IAAe,EAAE,IAA2B,EAAE,GAAW;QACjF,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;YAAE,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAA;IACnE,CAAC;IAED,SAAS,QAAQ,CAAC,GAAW;QAC3B,OAAO,IAAI,KAAK,CAAC,cAAc,GAAG,oCAAoC,CAAC,CAAA;IACzE,CAAC;AACH,CAAC;AAxDD,sCAwDC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/rules.d.ts b/node_modules/ajv/dist/compile/rules.d.ts deleted file mode 100644 index d77d68f9c..000000000 --- a/node_modules/ajv/dist/compile/rules.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { AddedKeywordDefinition } from "../types"; -declare const _jsonTypes: readonly ["string", "number", "integer", "boolean", "null", "object", "array"]; -export type JSONType = typeof _jsonTypes[number]; -export declare function isJSONType(x: unknown): x is JSONType; -type ValidationTypes = { - [K in JSONType]: boolean | RuleGroup | undefined; -}; -export interface ValidationRules { - rules: RuleGroup[]; - post: RuleGroup; - all: { - [Key in string]?: boolean | Rule; - }; - keywords: { - [Key in string]?: boolean; - }; - types: ValidationTypes; -} -export interface RuleGroup { - type?: JSONType; - rules: Rule[]; -} -export interface Rule { - keyword: string; - definition: AddedKeywordDefinition; -} -export declare function getRules(): ValidationRules; -export {}; diff --git a/node_modules/ajv/dist/compile/rules.js b/node_modules/ajv/dist/compile/rules.js deleted file mode 100644 index 82a591ff4..000000000 --- a/node_modules/ajv/dist/compile/rules.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getRules = exports.isJSONType = void 0; -const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; -const jsonTypes = new Set(_jsonTypes); -function isJSONType(x) { - return typeof x == "string" && jsonTypes.has(x); -} -exports.isJSONType = isJSONType; -function getRules() { - const groups = { - number: { type: "number", rules: [] }, - string: { type: "string", rules: [] }, - array: { type: "array", rules: [] }, - object: { type: "object", rules: [] }, - }; - return { - types: { ...groups, integer: true, boolean: true, null: true }, - rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object], - post: { rules: [] }, - all: {}, - keywords: {}, - }; -} -exports.getRules = getRules; -//# sourceMappingURL=rules.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/rules.js.map b/node_modules/ajv/dist/compile/rules.js.map deleted file mode 100644 index 084c70f82..000000000 --- a/node_modules/ajv/dist/compile/rules.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../lib/compile/rules.ts"],"names":[],"mappings":";;;AAEA,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAA;AAIjG,MAAM,SAAS,GAAgB,IAAI,GAAG,CAAC,UAAU,CAAC,CAAA;AAElD,SAAgB,UAAU,CAAC,CAAU;IACnC,OAAO,OAAO,CAAC,IAAI,QAAQ,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC;AAFD,gCAEC;AAyBD,SAAgB,QAAQ;IACtB,MAAM,MAAM,GAAgE;QAC1E,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;QACnC,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;QACnC,KAAK,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAC;QACjC,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;KACpC,CAAA;IACD,OAAO;QACL,KAAK,EAAE,EAAC,GAAG,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC;QAC5D,KAAK,EAAE,CAAC,EAAC,KAAK,EAAE,EAAE,EAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;QAC/E,IAAI,EAAE,EAAC,KAAK,EAAE,EAAE,EAAC;QACjB,GAAG,EAAE,EAAE;QACP,QAAQ,EAAE,EAAE;KACb,CAAA;AACH,CAAC;AAdD,4BAcC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/util.d.ts b/node_modules/ajv/dist/compile/util.d.ts deleted file mode 100644 index 1ec282aee..000000000 --- a/node_modules/ajv/dist/compile/util.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { AnySchema, EvaluatedProperties, EvaluatedItems } from "../types"; -import type { SchemaCxt, SchemaObjCxt } from "."; -import { Code, Name, CodeGen } from "./codegen"; -import type { Rule, ValidationRules } from "./rules"; -export declare function toHash(arr: T[]): { - [K in T]?: true; -}; -export declare function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void; -export declare function checkUnknownRules(it: SchemaCxt, schema?: AnySchema): void; -export declare function schemaHasRules(schema: AnySchema, rules: { - [Key in string]?: boolean | Rule; -}): boolean; -export declare function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean; -export declare function schemaRefOrVal({ topSchemaRef, schemaPath }: SchemaObjCxt, schema: unknown, keyword: string, $data?: string | false): Code | number | boolean; -export declare function unescapeFragment(str: string): string; -export declare function escapeFragment(str: string | number): string; -export declare function escapeJsonPointer(str: string | number): string; -export declare function unescapeJsonPointer(str: string): string; -export declare function eachItem(xs: T | T[], f: (x: T) => void): void; -type SomeEvaluated = EvaluatedProperties | EvaluatedItems; -type MergeEvaluatedFunc = (gen: CodeGen, from: Name | T, to: Name | Exclude | undefined, toName?: typeof Name) => Name | T; -interface MergeEvaluated { - props: MergeEvaluatedFunc; - items: MergeEvaluatedFunc; -} -export declare const mergeEvaluated: MergeEvaluated; -export declare function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name; -export declare function setEvaluated(gen: CodeGen, props: Name, ps: { - [K in string]?: true; -}): void; -export declare function useFunc(gen: CodeGen, f: { - code: string; -}): Name; -export declare enum Type { - Num = 0, - Str = 1 -} -export declare function getErrorPath(dataProp: Name | string | number, dataPropType?: Type, jsPropertySyntax?: boolean): Code | string; -export declare function checkStrictMode(it: SchemaCxt, msg: string, mode?: boolean | "log"): void; -export {}; diff --git a/node_modules/ajv/dist/compile/util.js b/node_modules/ajv/dist/compile/util.js deleted file mode 100644 index 091ad4c0d..000000000 --- a/node_modules/ajv/dist/compile/util.js +++ /dev/null @@ -1,178 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0; -const codegen_1 = require("./codegen"); -const code_1 = require("./codegen/code"); -// TODO refactor to use Set -function toHash(arr) { - const hash = {}; - for (const item of arr) - hash[item] = true; - return hash; -} -exports.toHash = toHash; -function alwaysValidSchema(it, schema) { - if (typeof schema == "boolean") - return schema; - if (Object.keys(schema).length === 0) - return true; - checkUnknownRules(it, schema); - return !schemaHasRules(schema, it.self.RULES.all); -} -exports.alwaysValidSchema = alwaysValidSchema; -function checkUnknownRules(it, schema = it.schema) { - const { opts, self } = it; - if (!opts.strictSchema) - return; - if (typeof schema === "boolean") - return; - const rules = self.RULES.keywords; - for (const key in schema) { - if (!rules[key]) - checkStrictMode(it, `unknown keyword: "${key}"`); - } -} -exports.checkUnknownRules = checkUnknownRules; -function schemaHasRules(schema, rules) { - if (typeof schema == "boolean") - return !schema; - for (const key in schema) - if (rules[key]) - return true; - return false; -} -exports.schemaHasRules = schemaHasRules; -function schemaHasRulesButRef(schema, RULES) { - if (typeof schema == "boolean") - return !schema; - for (const key in schema) - if (key !== "$ref" && RULES.all[key]) - return true; - return false; -} -exports.schemaHasRulesButRef = schemaHasRulesButRef; -function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) { - if (!$data) { - if (typeof schema == "number" || typeof schema == "boolean") - return schema; - if (typeof schema == "string") - return (0, codegen_1._) `${schema}`; - } - return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`; -} -exports.schemaRefOrVal = schemaRefOrVal; -function unescapeFragment(str) { - return unescapeJsonPointer(decodeURIComponent(str)); -} -exports.unescapeFragment = unescapeFragment; -function escapeFragment(str) { - return encodeURIComponent(escapeJsonPointer(str)); -} -exports.escapeFragment = escapeFragment; -function escapeJsonPointer(str) { - if (typeof str == "number") - return `${str}`; - return str.replace(/~/g, "~0").replace(/\//g, "~1"); -} -exports.escapeJsonPointer = escapeJsonPointer; -function unescapeJsonPointer(str) { - return str.replace(/~1/g, "/").replace(/~0/g, "~"); -} -exports.unescapeJsonPointer = unescapeJsonPointer; -function eachItem(xs, f) { - if (Array.isArray(xs)) { - for (const x of xs) - f(x); - } - else { - f(xs); - } -} -exports.eachItem = eachItem; -function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) { - return (gen, from, to, toName) => { - const res = to === undefined - ? from - : to instanceof codegen_1.Name - ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) - : from instanceof codegen_1.Name - ? (mergeToName(gen, to, from), from) - : mergeValues(from, to); - return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res; - }; -} -exports.mergeEvaluated = { - props: makeMergeEvaluated({ - mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => { - gen.if((0, codegen_1._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._) `${to} || {}`).code((0, codegen_1._) `Object.assign(${to}, ${from})`)); - }), - mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => { - if (from === true) { - gen.assign(to, true); - } - else { - gen.assign(to, (0, codegen_1._) `${to} || {}`); - setEvaluated(gen, to, from); - } - }), - mergeValues: (from, to) => (from === true ? true : { ...from, ...to }), - resultToName: evaluatedPropsToName, - }), - items: makeMergeEvaluated({ - mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)), - mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._) `${to} > ${from} ? ${to} : ${from}`)), - mergeValues: (from, to) => (from === true ? true : Math.max(from, to)), - resultToName: (gen, items) => gen.var("items", items), - }), -}; -function evaluatedPropsToName(gen, ps) { - if (ps === true) - return gen.var("props", true); - const props = gen.var("props", (0, codegen_1._) `{}`); - if (ps !== undefined) - setEvaluated(gen, props, ps); - return props; -} -exports.evaluatedPropsToName = evaluatedPropsToName; -function setEvaluated(gen, props, ps) { - Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true)); -} -exports.setEvaluated = setEvaluated; -const snippets = {}; -function useFunc(gen, f) { - return gen.scopeValue("func", { - ref: f, - code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)), - }); -} -exports.useFunc = useFunc; -var Type; -(function (Type) { - Type[Type["Num"] = 0] = "Num"; - Type[Type["Str"] = 1] = "Str"; -})(Type = exports.Type || (exports.Type = {})); -function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { - // let path - if (dataProp instanceof codegen_1.Name) { - const isNumber = dataPropType === Type.Num; - return jsPropertySyntax - ? isNumber - ? (0, codegen_1._) `"[" + ${dataProp} + "]"` - : (0, codegen_1._) `"['" + ${dataProp} + "']"` - : isNumber - ? (0, codegen_1._) `"/" + ${dataProp}` - : (0, codegen_1._) `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer - } - return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp); -} -exports.getErrorPath = getErrorPath; -function checkStrictMode(it, msg, mode = it.opts.strictSchema) { - if (!mode) - return; - msg = `strict mode: ${msg}`; - if (mode === true) - throw new Error(msg); - it.self.logger.warn(msg); -} -exports.checkStrictMode = checkStrictMode; -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/util.js.map b/node_modules/ajv/dist/compile/util.js.map deleted file mode 100644 index a2128fc39..000000000 --- a/node_modules/ajv/dist/compile/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../lib/compile/util.ts"],"names":[],"mappings":";;;AAEA,uCAA6D;AAC7D,yCAAoC;AAGpC,2BAA2B;AAC3B,SAAgB,MAAM,CAA4B,GAAQ;IACxD,MAAM,IAAI,GAAsB,EAAE,CAAA;IAClC,KAAK,MAAM,IAAI,IAAI,GAAG;QAAE,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACzC,OAAO,IAAI,CAAA;AACb,CAAC;AAJD,wBAIC;AAED,SAAgB,iBAAiB,CAAC,EAAa,EAAE,MAAiB;IAChE,IAAI,OAAO,MAAM,IAAI,SAAS;QAAE,OAAO,MAAM,CAAA;IAC7C,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IACjD,iBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;IAC7B,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACnD,CAAC;AALD,8CAK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AAE,CAAA;IAC3B,IAAI,IAAI,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAA;IACvC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AATD,0CASC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/applicability.d.ts b/node_modules/ajv/dist/compile/validate/applicability.d.ts deleted file mode 100644 index 165d375dc..000000000 --- a/node_modules/ajv/dist/compile/validate/applicability.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AnySchemaObject } from "../../types"; -import type { SchemaObjCxt } from ".."; -import type { JSONType, RuleGroup, Rule } from "../rules"; -export declare function schemaHasRulesForType({ schema, self }: SchemaObjCxt, type: JSONType): boolean | undefined; -export declare function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean; -export declare function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined; diff --git a/node_modules/ajv/dist/compile/validate/applicability.js b/node_modules/ajv/dist/compile/validate/applicability.js deleted file mode 100644 index 6187dbbee..000000000 --- a/node_modules/ajv/dist/compile/validate/applicability.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0; -function schemaHasRulesForType({ schema, self }, type) { - const group = self.RULES.types[type]; - return group && group !== true && shouldUseGroup(schema, group); -} -exports.schemaHasRulesForType = schemaHasRulesForType; -function shouldUseGroup(schema, group) { - return group.rules.some((rule) => shouldUseRule(schema, rule)); -} -exports.shouldUseGroup = shouldUseGroup; -function shouldUseRule(schema, rule) { - var _a; - return (schema[rule.keyword] !== undefined || - ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined))); -} -exports.shouldUseRule = shouldUseRule; -//# sourceMappingURL=applicability.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/applicability.js.map b/node_modules/ajv/dist/compile/validate/applicability.js.map deleted file mode 100644 index 450cfe75a..000000000 --- a/node_modules/ajv/dist/compile/validate/applicability.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"applicability.js","sourceRoot":"","sources":["../../../lib/compile/validate/applicability.ts"],"names":[],"mappings":";;;AAIA,SAAgB,qBAAqB,CACnC,EAAC,MAAM,EAAE,IAAI,EAAe,EAC5B,IAAc;IAEd,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACpC,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,IAAI,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AACjE,CAAC;AAND,sDAMC;AAED,SAAgB,cAAc,CAAC,MAAuB,EAAE,KAAgB;IACtE,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;AAChE,CAAC;AAFD,wCAEC;AAED,SAAgB,aAAa,CAAC,MAAuB,EAAE,IAAU;;IAC/D,OAAO,CACL,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,SAAS;SAClC,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,0CAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAA,CACrE,CAAA;AACH,CAAC;AALD,sCAKC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/boolSchema.d.ts b/node_modules/ajv/dist/compile/validate/boolSchema.d.ts deleted file mode 100644 index 0ce795201..000000000 --- a/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { SchemaCxt } from ".."; -import { Name } from "../codegen"; -export declare function topBoolOrEmptySchema(it: SchemaCxt): void; -export declare function boolOrEmptySchema(it: SchemaCxt, valid: Name): void; diff --git a/node_modules/ajv/dist/compile/validate/boolSchema.js b/node_modules/ajv/dist/compile/validate/boolSchema.js deleted file mode 100644 index 8eeb7b5ee..000000000 --- a/node_modules/ajv/dist/compile/validate/boolSchema.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0; -const errors_1 = require("../errors"); -const codegen_1 = require("../codegen"); -const names_1 = require("../names"); -const boolError = { - message: "boolean schema is false", -}; -function topBoolOrEmptySchema(it) { - const { gen, schema, validateName } = it; - if (schema === false) { - falseSchemaError(it, false); - } - else if (typeof schema == "object" && schema.$async === true) { - gen.return(names_1.default.data); - } - else { - gen.assign((0, codegen_1._) `${validateName}.errors`, null); - gen.return(true); - } -} -exports.topBoolOrEmptySchema = topBoolOrEmptySchema; -function boolOrEmptySchema(it, valid) { - const { gen, schema } = it; - if (schema === false) { - gen.var(valid, false); // TODO var - falseSchemaError(it); - } - else { - gen.var(valid, true); // TODO var - } -} -exports.boolOrEmptySchema = boolOrEmptySchema; -function falseSchemaError(it, overrideAllErrors) { - const { gen, data } = it; - // TODO maybe some other interface should be used for non-keyword validation errors... - const cxt = { - gen, - keyword: "false schema", - data, - schema: false, - schemaCode: false, - schemaValue: false, - params: {}, - it, - }; - (0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors); -} -//# sourceMappingURL=boolSchema.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/boolSchema.js.map b/node_modules/ajv/dist/compile/validate/boolSchema.js.map deleted file mode 100644 index 4aa6c99a6..000000000 --- a/node_modules/ajv/dist/compile/validate/boolSchema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"boolSchema.js","sourceRoot":"","sources":["../../../lib/compile/validate/boolSchema.ts"],"names":[],"mappings":";;;AAEA,sCAAqC;AACrC,wCAAkC;AAClC,oCAAwB;AAExB,MAAM,SAAS,GAA2B;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;IACD,IAAA,oBAAW,EAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAA;AAC3D,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/dataType.d.ts b/node_modules/ajv/dist/compile/validate/dataType.d.ts deleted file mode 100644 index 91a6194ae..000000000 --- a/node_modules/ajv/dist/compile/validate/dataType.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ErrorObject, AnySchemaObject } from "../../types"; -import type { SchemaObjCxt } from ".."; -import { JSONType } from "../rules"; -import { Code, Name } from "../codegen"; -export declare enum DataType { - Correct = 0, - Wrong = 1 -} -export declare function getSchemaTypes(schema: AnySchemaObject): JSONType[]; -export declare function getJSONTypes(ts: unknown | unknown[]): JSONType[]; -export declare function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean; -export declare function checkDataType(dataType: JSONType, data: Name, strictNums?: boolean | "log", correct?: DataType): Code; -export declare function checkDataTypes(dataTypes: JSONType[], data: Name, strictNums?: boolean | "log", correct?: DataType): Code; -export type TypeError = ErrorObject<"type", { - type: string; -}>; -export declare function reportTypeError(it: SchemaObjCxt): void; diff --git a/node_modules/ajv/dist/compile/validate/dataType.js b/node_modules/ajv/dist/compile/validate/dataType.js deleted file mode 100644 index 1732d4666..000000000 --- a/node_modules/ajv/dist/compile/validate/dataType.js +++ /dev/null @@ -1,202 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0; -const rules_1 = require("../rules"); -const applicability_1 = require("./applicability"); -const errors_1 = require("../errors"); -const codegen_1 = require("../codegen"); -const util_1 = require("../util"); -var DataType; -(function (DataType) { - DataType[DataType["Correct"] = 0] = "Correct"; - DataType[DataType["Wrong"] = 1] = "Wrong"; -})(DataType = exports.DataType || (exports.DataType = {})); -function getSchemaTypes(schema) { - const types = getJSONTypes(schema.type); - const hasNull = types.includes("null"); - if (hasNull) { - if (schema.nullable === false) - throw new Error("type: null contradicts nullable: false"); - } - else { - if (!types.length && schema.nullable !== undefined) { - throw new Error('"nullable" cannot be used without "type"'); - } - if (schema.nullable === true) - types.push("null"); - } - return types; -} -exports.getSchemaTypes = getSchemaTypes; -function getJSONTypes(ts) { - const types = Array.isArray(ts) ? ts : ts ? [ts] : []; - if (types.every(rules_1.isJSONType)) - return types; - throw new Error("type must be JSONType or JSONType[]: " + types.join(",")); -} -exports.getJSONTypes = getJSONTypes; -function coerceAndCheckDataType(it, types) { - const { gen, data, opts } = it; - const coerceTo = coerceToTypes(types, opts.coerceTypes); - const checkTypes = types.length > 0 && - !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0])); - if (checkTypes) { - const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong); - gen.if(wrongType, () => { - if (coerceTo.length) - coerceData(it, types, coerceTo); - else - reportTypeError(it); - }); - } - return checkTypes; -} -exports.coerceAndCheckDataType = coerceAndCheckDataType; -const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]); -function coerceToTypes(types, coerceTypes) { - return coerceTypes - ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array")) - : []; -} -function coerceData(it, types, coerceTo) { - const { gen, data, opts } = it; - const dataType = gen.let("dataType", (0, codegen_1._) `typeof ${data}`); - const coerced = gen.let("coerced", (0, codegen_1._) `undefined`); - if (opts.coerceTypes === "array") { - gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen - .assign(data, (0, codegen_1._) `${data}[0]`) - .assign(dataType, (0, codegen_1._) `typeof ${data}`) - .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data))); - } - gen.if((0, codegen_1._) `${coerced} !== undefined`); - for (const t of coerceTo) { - if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) { - coerceSpecificType(t); - } - } - gen.else(); - reportTypeError(it); - gen.endIf(); - gen.if((0, codegen_1._) `${coerced} !== undefined`, () => { - gen.assign(data, coerced); - assignParentData(it, coerced); - }); - function coerceSpecificType(t) { - switch (t) { - case "string": - gen - .elseIf((0, codegen_1._) `${dataType} == "number" || ${dataType} == "boolean"`) - .assign(coerced, (0, codegen_1._) `"" + ${data}`) - .elseIf((0, codegen_1._) `${data} === null`) - .assign(coerced, (0, codegen_1._) `""`); - return; - case "number": - gen - .elseIf((0, codegen_1._) `${dataType} == "boolean" || ${data} === null - || (${dataType} == "string" && ${data} && ${data} == +${data})`) - .assign(coerced, (0, codegen_1._) `+${data}`); - return; - case "integer": - gen - .elseIf((0, codegen_1._) `${dataType} === "boolean" || ${data} === null - || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`) - .assign(coerced, (0, codegen_1._) `+${data}`); - return; - case "boolean": - gen - .elseIf((0, codegen_1._) `${data} === "false" || ${data} === 0 || ${data} === null`) - .assign(coerced, false) - .elseIf((0, codegen_1._) `${data} === "true" || ${data} === 1`) - .assign(coerced, true); - return; - case "null": - gen.elseIf((0, codegen_1._) `${data} === "" || ${data} === 0 || ${data} === false`); - gen.assign(coerced, null); - return; - case "array": - gen - .elseIf((0, codegen_1._) `${dataType} === "string" || ${dataType} === "number" - || ${dataType} === "boolean" || ${data} === null`) - .assign(coerced, (0, codegen_1._) `[${data}]`); - } - } -} -function assignParentData({ gen, parentData, parentDataProperty }, expr) { - // TODO use gen.property - gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr)); -} -function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { - const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ; - let cond; - switch (dataType) { - case "null": - return (0, codegen_1._) `${data} ${EQ} null`; - case "array": - cond = (0, codegen_1._) `Array.isArray(${data})`; - break; - case "object": - cond = (0, codegen_1._) `${data} && typeof ${data} == "object" && !Array.isArray(${data})`; - break; - case "integer": - cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`); - break; - case "number": - cond = numCond(); - break; - default: - return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`; - } - return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond); - function numCond(_cond = codegen_1.nil) { - return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._) `isFinite(${data})` : codegen_1.nil); - } -} -exports.checkDataType = checkDataType; -function checkDataTypes(dataTypes, data, strictNums, correct) { - if (dataTypes.length === 1) { - return checkDataType(dataTypes[0], data, strictNums, correct); - } - let cond; - const types = (0, util_1.toHash)(dataTypes); - if (types.array && types.object) { - const notObj = (0, codegen_1._) `typeof ${data} != "object"`; - cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`; - delete types.null; - delete types.array; - delete types.object; - } - else { - cond = codegen_1.nil; - } - if (types.number) - delete types.integer; - for (const t in types) - cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct)); - return cond; -} -exports.checkDataTypes = checkDataTypes; -const typeError = { - message: ({ schema }) => `must be ${schema}`, - params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`, -}; -function reportTypeError(it) { - const cxt = getTypeErrorContext(it); - (0, errors_1.reportError)(cxt, typeError); -} -exports.reportTypeError = reportTypeError; -function getTypeErrorContext(it) { - const { gen, data, schema } = it; - const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type"); - return { - gen, - keyword: "type", - data, - schema: schema.type, - schemaCode, - schemaValue: schemaCode, - parentSchema: schema, - params: {}, - it, - }; -} -//# sourceMappingURL=dataType.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/dataType.js.map b/node_modules/ajv/dist/compile/validate/dataType.js.map deleted file mode 100644 index f19c40bc9..000000000 --- a/node_modules/ajv/dist/compile/validate/dataType.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dataType.js","sourceRoot":"","sources":["../../../lib/compile/validate/dataType.ts"],"names":[],"mappings":";;;AAOA,oCAA6C;AAC7C,mDAAqD;AACrD,sCAAqC;AACrC,wCAAkE;AAClE,kCAA8C;AAE9C,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,6CAAO,CAAA;IACP,yCAAK,CAAA;AACP,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,SAAgB,cAAc,CAAC,MAAuB;IACpD,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACvC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACtC,IAAI,OAAO,EAAE;QACX,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;KACzF;SAAM;QACL,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE;YAClD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;SAC5D;QACD,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KACjD;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAZD,wCAYC;AAED,SAAgB,YAAY,CAAC,EAAuB;IAClD,MAAM,KAAK,GAAc,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAChE,IAAI,KAAK,CAAC,KAAK,CAAC,kBAAU,CAAC;QAAE,OAAO,KAAK,CAAA;IACzC,MAAM,IAAI,KAAK,CAAC,uCAAuC,GAAG,KAAK,CA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AAHD,0CAGC;AAED,SAAS,mBAAmB,CAAC,EAAgB;IAC3C,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAC,GAAG,EAAE,CAAA;IAC9B,MAAM,UAAU,GAAG,IAAA,qBAAc,EAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACrD,OAAO;QACL,GAAG;QACH,OAAO,EAAE,MAAM;QACf,IAAI;QACJ,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,UAAU;QACV,WAAW,EAAE,UAAU;QACvB,YAAY,EAAE,MAAM;QACpB,MAAM,EAAE,EAAE;QACV,EAAE;KACH,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/defaults.d.ts b/node_modules/ajv/dist/compile/validate/defaults.d.ts deleted file mode 100644 index 02ba453b2..000000000 --- a/node_modules/ajv/dist/compile/validate/defaults.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { SchemaObjCxt } from ".."; -export declare function assignDefaults(it: SchemaObjCxt, ty?: string): void; diff --git a/node_modules/ajv/dist/compile/validate/defaults.js b/node_modules/ajv/dist/compile/validate/defaults.js deleted file mode 100644 index cd9c42d9a..000000000 --- a/node_modules/ajv/dist/compile/validate/defaults.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.assignDefaults = void 0; -const codegen_1 = require("../codegen"); -const util_1 = require("../util"); -function assignDefaults(it, ty) { - const { properties, items } = it.schema; - if (ty === "object" && properties) { - for (const key in properties) { - assignDefault(it, key, properties[key].default); - } - } - else if (ty === "array" && Array.isArray(items)) { - items.forEach((sch, i) => assignDefault(it, i, sch.default)); - } -} -exports.assignDefaults = assignDefaults; -function assignDefault(it, prop, defaultValue) { - const { gen, compositeRule, data, opts } = it; - if (defaultValue === undefined) - return; - const childData = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(prop)}`; - if (compositeRule) { - (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`); - return; - } - let condition = (0, codegen_1._) `${childData} === undefined`; - if (opts.useDefaults === "empty") { - condition = (0, codegen_1._) `${condition} || ${childData} === null || ${childData} === ""`; - } - // `${childData} === undefined` + - // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "") - gen.if(condition, (0, codegen_1._) `${childData} = ${(0, codegen_1.stringify)(defaultValue)}`); -} -//# sourceMappingURL=defaults.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/defaults.js.map b/node_modules/ajv/dist/compile/validate/defaults.js.map deleted file mode 100644 index c435d0578..000000000 --- a/node_modules/ajv/dist/compile/validate/defaults.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../lib/compile/validate/defaults.ts"],"names":[],"mappings":";;;AACA,wCAAoD;AACpD,kCAAuC;AAEvC,SAAgB,cAAc,CAAC,EAAgB,EAAE,EAAW;IAC1D,MAAM,EAAC,UAAU,EAAE,KAAK,EAAC,GAAG,EAAE,CAAC,MAAM,CAAA;IACrC,IAAI,EAAE,KAAK,QAAQ,IAAI,UAAU,EAAE;QACjC,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;YAC5B,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAA;SAChD;KACF;SAAM,IAAI,EAAE,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;KACrE;AACH,CAAC;AATD,wCASC;AAED,SAAS,aAAa,CAAC,EAAgB,EAAE,IAAqB,EAAE,YAAqB;IACnF,MAAM,EAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;IAC3C,IAAI,YAAY,KAAK,SAAS;QAAE,OAAM;IACtC,MAAM,SAAS,GAAG,IAAA,WAAC,EAAA,GAAG,IAAI,GAAG,IAAA,qBAAW,EAAC,IAAI,CAAC,EAAE,CAAA;IAChD,IAAI,aAAa,EAAE;QACjB,IAAA,sBAAe,EAAC,EAAE,EAAE,2BAA2B,SAAS,EAAE,CAAC,CAAA;QAC3D,OAAM;KACP;IAED,IAAI,SAAS,GAAG,IAAA,WAAC,EAAA,GAAG,SAAS,gBAAgB,CAAA;IAC7C,IAAI,IAAI,CAAC,WAAW,KAAK,OAAO,EAAE;QAChC,SAAS,GAAG,IAAA,WAAC,EAAA,GAAG,SAAS,OAAO,SAAS,gBAAgB,SAAS,SAAS,CAAA;KAC5E;IACD,iCAAiC;IACjC,2FAA2F;IAC3F,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,IAAA,WAAC,EAAA,GAAG,SAAS,MAAM,IAAA,mBAAS,EAAC,YAAY,CAAC,EAAE,CAAC,CAAA;AACjE,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/index.d.ts b/node_modules/ajv/dist/compile/validate/index.d.ts deleted file mode 100644 index 6c533ed72..000000000 --- a/node_modules/ajv/dist/compile/validate/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { AddedKeywordDefinition, AnySchemaObject, KeywordErrorCxt, KeywordCxtParams } from "../../types"; -import type { SchemaCxt, SchemaObjCxt } from ".."; -import { SubschemaArgs } from "./subschema"; -import { Code, Name, CodeGen } from "../codegen"; -import type { JSONType } from "../rules"; -import { ErrorPaths } from "../errors"; -export declare function validateFunctionCode(it: SchemaCxt): void; -export declare class KeywordCxt implements KeywordErrorCxt { - readonly gen: CodeGen; - readonly allErrors?: boolean; - readonly keyword: string; - readonly data: Name; - readonly $data?: string | false; - schema: any; - readonly schemaValue: Code | number | boolean; - readonly schemaCode: Code | number | boolean; - readonly schemaType: JSONType[]; - readonly parentSchema: AnySchemaObject; - readonly errsCount?: Name; - params: KeywordCxtParams; - readonly it: SchemaObjCxt; - readonly def: AddedKeywordDefinition; - constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string); - result(condition: Code, successAction?: () => void, failAction?: () => void): void; - failResult(condition: Code, successAction?: () => void, failAction?: () => void): void; - pass(condition: Code, failAction?: () => void): void; - fail(condition?: Code): void; - fail$data(condition: Code): void; - error(append?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void; - private _error; - $dataError(): void; - reset(): void; - ok(cond: Code | boolean): void; - setParams(obj: KeywordCxtParams, assign?: true): void; - block$data(valid: Name, codeBlock: () => void, $dataValid?: Code): void; - check$data(valid?: Name, $dataValid?: Code): void; - invalid$data(): Code; - subschema(appl: SubschemaArgs, valid: Name): SchemaCxt; - mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void; - mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void; -} -export declare function getData($data: string, { dataLevel, dataNames, dataPathArr }: SchemaCxt): Code | number; diff --git a/node_modules/ajv/dist/compile/validate/index.js b/node_modules/ajv/dist/compile/validate/index.js deleted file mode 100644 index 0d683322a..000000000 --- a/node_modules/ajv/dist/compile/validate/index.js +++ /dev/null @@ -1,520 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0; -const boolSchema_1 = require("./boolSchema"); -const dataType_1 = require("./dataType"); -const applicability_1 = require("./applicability"); -const dataType_2 = require("./dataType"); -const defaults_1 = require("./defaults"); -const keyword_1 = require("./keyword"); -const subschema_1 = require("./subschema"); -const codegen_1 = require("../codegen"); -const names_1 = require("../names"); -const resolve_1 = require("../resolve"); -const util_1 = require("../util"); -const errors_1 = require("../errors"); -// schema compilation - generates validation function, subschemaCode (below) is used for subschemas -function validateFunctionCode(it) { - if (isSchemaObj(it)) { - checkKeywords(it); - if (schemaCxtHasRules(it)) { - topSchemaObjCode(it); - return; - } - } - validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it)); -} -exports.validateFunctionCode = validateFunctionCode; -function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) { - if (opts.code.es5) { - gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => { - gen.code((0, codegen_1._) `"use strict"; ${funcSourceUrl(schema, opts)}`); - destructureValCxtES5(gen, opts); - gen.code(body); - }); - } - else { - gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body)); - } -} -function destructureValCxt(opts) { - return (0, codegen_1._) `{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._) `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`; -} -function destructureValCxtES5(gen, opts) { - gen.if(names_1.default.valCxt, () => { - gen.var(names_1.default.instancePath, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.instancePath}`); - gen.var(names_1.default.parentData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentData}`); - gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`); - gen.var(names_1.default.rootData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.rootData}`); - if (opts.dynamicRef) - gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`); - }, () => { - gen.var(names_1.default.instancePath, (0, codegen_1._) `""`); - gen.var(names_1.default.parentData, (0, codegen_1._) `undefined`); - gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `undefined`); - gen.var(names_1.default.rootData, names_1.default.data); - if (opts.dynamicRef) - gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `{}`); - }); -} -function topSchemaObjCode(it) { - const { schema, opts, gen } = it; - validateFunction(it, () => { - if (opts.$comment && schema.$comment) - commentKeyword(it); - checkNoDefault(it); - gen.let(names_1.default.vErrors, null); - gen.let(names_1.default.errors, 0); - if (opts.unevaluated) - resetEvaluated(it); - typeAndKeywords(it); - returnResults(it); - }); - return; -} -function resetEvaluated(it) { - // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated - const { gen, validateName } = it; - it.evaluated = gen.const("evaluated", (0, codegen_1._) `${validateName}.evaluated`); - gen.if((0, codegen_1._) `${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._) `${it.evaluated}.props`, (0, codegen_1._) `undefined`)); - gen.if((0, codegen_1._) `${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._) `${it.evaluated}.items`, (0, codegen_1._) `undefined`)); -} -function funcSourceUrl(schema, opts) { - const schId = typeof schema == "object" && schema[opts.schemaId]; - return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._) `/*# sourceURL=${schId} */` : codegen_1.nil; -} -// schema compilation - this function is used recursively to generate code for sub-schemas -function subschemaCode(it, valid) { - if (isSchemaObj(it)) { - checkKeywords(it); - if (schemaCxtHasRules(it)) { - subSchemaObjCode(it, valid); - return; - } - } - (0, boolSchema_1.boolOrEmptySchema)(it, valid); -} -function schemaCxtHasRules({ schema, self }) { - if (typeof schema == "boolean") - return !schema; - for (const key in schema) - if (self.RULES.all[key]) - return true; - return false; -} -function isSchemaObj(it) { - return typeof it.schema != "boolean"; -} -function subSchemaObjCode(it, valid) { - const { schema, gen, opts } = it; - if (opts.$comment && schema.$comment) - commentKeyword(it); - updateContext(it); - checkAsyncSchema(it); - const errsCount = gen.const("_errs", names_1.default.errors); - typeAndKeywords(it, errsCount); - // TODO var - gen.var(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); -} -function checkKeywords(it) { - (0, util_1.checkUnknownRules)(it); - checkRefsAndKeywords(it); -} -function typeAndKeywords(it, errsCount) { - if (it.opts.jtd) - return schemaKeywords(it, [], false, errsCount); - const types = (0, dataType_1.getSchemaTypes)(it.schema); - const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types); - schemaKeywords(it, types, !checkedTypes, errsCount); -} -function checkRefsAndKeywords(it) { - const { schema, errSchemaPath, opts, self } = it; - if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) { - self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`); - } -} -function checkNoDefault(it) { - const { schema, opts } = it; - if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) { - (0, util_1.checkStrictMode)(it, "default is ignored in the schema root"); - } -} -function updateContext(it) { - const schId = it.schema[it.opts.schemaId]; - if (schId) - it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId); -} -function checkAsyncSchema(it) { - if (it.schema.$async && !it.schemaEnv.$async) - throw new Error("async schema in sync schema"); -} -function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) { - const msg = schema.$comment; - if (opts.$comment === true) { - gen.code((0, codegen_1._) `${names_1.default.self}.logger.log(${msg})`); - } - else if (typeof opts.$comment == "function") { - const schemaPath = (0, codegen_1.str) `${errSchemaPath}/$comment`; - const rootName = gen.scopeValue("root", { ref: schemaEnv.root }); - gen.code((0, codegen_1._) `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`); - } -} -function returnResults(it) { - const { gen, schemaEnv, validateName, ValidationError, opts } = it; - if (schemaEnv.$async) { - // TODO assign unevaluated - gen.if((0, codegen_1._) `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._) `new ${ValidationError}(${names_1.default.vErrors})`)); - } - else { - gen.assign((0, codegen_1._) `${validateName}.errors`, names_1.default.vErrors); - if (opts.unevaluated) - assignEvaluated(it); - gen.return((0, codegen_1._) `${names_1.default.errors} === 0`); - } -} -function assignEvaluated({ gen, evaluated, props, items }) { - if (props instanceof codegen_1.Name) - gen.assign((0, codegen_1._) `${evaluated}.props`, props); - if (items instanceof codegen_1.Name) - gen.assign((0, codegen_1._) `${evaluated}.items`, items); -} -function schemaKeywords(it, types, typeErrors, errsCount) { - const { gen, schema, data, allErrors, opts, self } = it; - const { RULES } = self; - if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) { - gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition)); // TODO typecast - return; - } - if (!opts.jtd) - checkStrictTypes(it, types); - gen.block(() => { - for (const group of RULES.rules) - groupKeywords(group); - groupKeywords(RULES.post); - }); - function groupKeywords(group) { - if (!(0, applicability_1.shouldUseGroup)(schema, group)) - return; - if (group.type) { - gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers)); - iterateKeywords(it, group); - if (types.length === 1 && types[0] === group.type && typeErrors) { - gen.else(); - (0, dataType_2.reportTypeError)(it); - } - gen.endIf(); - } - else { - iterateKeywords(it, group); - } - // TODO make it "ok" call? - if (!allErrors) - gen.if((0, codegen_1._) `${names_1.default.errors} === ${errsCount || 0}`); - } -} -function iterateKeywords(it, group) { - const { gen, schema, opts: { useDefaults }, } = it; - if (useDefaults) - (0, defaults_1.assignDefaults)(it, group.type); - gen.block(() => { - for (const rule of group.rules) { - if ((0, applicability_1.shouldUseRule)(schema, rule)) { - keywordCode(it, rule.keyword, rule.definition, group.type); - } - } - }); -} -function checkStrictTypes(it, types) { - if (it.schemaEnv.meta || !it.opts.strictTypes) - return; - checkContextTypes(it, types); - if (!it.opts.allowUnionTypes) - checkMultipleTypes(it, types); - checkKeywordTypes(it, it.dataTypes); -} -function checkContextTypes(it, types) { - if (!types.length) - return; - if (!it.dataTypes.length) { - it.dataTypes = types; - return; - } - types.forEach((t) => { - if (!includesType(it.dataTypes, t)) { - strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`); - } - }); - narrowSchemaTypes(it, types); -} -function checkMultipleTypes(it, ts) { - if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { - strictTypesError(it, "use allowUnionTypes to allow union type keyword"); - } -} -function checkKeywordTypes(it, ts) { - const rules = it.self.RULES.all; - for (const keyword in rules) { - const rule = rules[keyword]; - if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) { - const { type } = rule.definition; - if (type.length && !type.some((t) => hasApplicableType(ts, t))) { - strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`); - } - } - } -} -function hasApplicableType(schTs, kwdT) { - return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer")); -} -function includesType(ts, t) { - return ts.includes(t) || (t === "integer" && ts.includes("number")); -} -function narrowSchemaTypes(it, withTypes) { - const ts = []; - for (const t of it.dataTypes) { - if (includesType(withTypes, t)) - ts.push(t); - else if (withTypes.includes("integer") && t === "number") - ts.push("integer"); - } - it.dataTypes = ts; -} -function strictTypesError(it, msg) { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; - msg += ` at "${schemaPath}" (strictTypes)`; - (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes); -} -class KeywordCxt { - constructor(it, def, keyword) { - (0, keyword_1.validateKeywordUsage)(it, def, keyword); - this.gen = it.gen; - this.allErrors = it.allErrors; - this.keyword = keyword; - this.data = it.data; - this.schema = it.schema[keyword]; - this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data; - this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data); - this.schemaType = def.schemaType; - this.parentSchema = it.schema; - this.params = {}; - this.it = it; - this.def = def; - if (this.$data) { - this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)); - } - else { - this.schemaCode = this.schemaValue; - if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) { - throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`); - } - } - if ("code" in def ? def.trackErrors : def.errors !== false) { - this.errsCount = it.gen.const("_errs", names_1.default.errors); - } - } - result(condition, successAction, failAction) { - this.failResult((0, codegen_1.not)(condition), successAction, failAction); - } - failResult(condition, successAction, failAction) { - this.gen.if(condition); - if (failAction) - failAction(); - else - this.error(); - if (successAction) { - this.gen.else(); - successAction(); - if (this.allErrors) - this.gen.endIf(); - } - else { - if (this.allErrors) - this.gen.endIf(); - else - this.gen.else(); - } - } - pass(condition, failAction) { - this.failResult((0, codegen_1.not)(condition), undefined, failAction); - } - fail(condition) { - if (condition === undefined) { - this.error(); - if (!this.allErrors) - this.gen.if(false); // this branch will be removed by gen.optimize - return; - } - this.gen.if(condition); - this.error(); - if (this.allErrors) - this.gen.endIf(); - else - this.gen.else(); - } - fail$data(condition) { - if (!this.$data) - return this.fail(condition); - const { schemaCode } = this; - this.fail((0, codegen_1._) `${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`); - } - error(append, errorParams, errorPaths) { - if (errorParams) { - this.setParams(errorParams); - this._error(append, errorPaths); - this.setParams({}); - return; - } - this._error(append, errorPaths); - } - _error(append, errorPaths) { - ; - (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths); - } - $dataError() { - (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError); - } - reset() { - if (this.errsCount === undefined) - throw new Error('add "trackErrors" to keyword definition'); - (0, errors_1.resetErrorsCount)(this.gen, this.errsCount); - } - ok(cond) { - if (!this.allErrors) - this.gen.if(cond); - } - setParams(obj, assign) { - if (assign) - Object.assign(this.params, obj); - else - this.params = obj; - } - block$data(valid, codeBlock, $dataValid = codegen_1.nil) { - this.gen.block(() => { - this.check$data(valid, $dataValid); - codeBlock(); - }); - } - check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) { - if (!this.$data) - return; - const { gen, schemaCode, schemaType, def } = this; - gen.if((0, codegen_1.or)((0, codegen_1._) `${schemaCode} === undefined`, $dataValid)); - if (valid !== codegen_1.nil) - gen.assign(valid, true); - if (schemaType.length || def.validateSchema) { - gen.elseIf(this.invalid$data()); - this.$dataError(); - if (valid !== codegen_1.nil) - gen.assign(valid, false); - } - gen.else(); - } - invalid$data() { - const { gen, schemaCode, schemaType, def, it } = this; - return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema()); - function wrong$DataType() { - if (schemaType.length) { - /* istanbul ignore if */ - if (!(schemaCode instanceof codegen_1.Name)) - throw new Error("ajv implementation error"); - const st = Array.isArray(schemaType) ? schemaType : [schemaType]; - return (0, codegen_1._) `${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`; - } - return codegen_1.nil; - } - function invalid$DataSchema() { - if (def.validateSchema) { - const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); // TODO value.code for standalone - return (0, codegen_1._) `!${validateSchemaRef}(${schemaCode})`; - } - return codegen_1.nil; - } - } - subschema(appl, valid) { - const subschema = (0, subschema_1.getSubschema)(this.it, appl); - (0, subschema_1.extendSubschemaData)(subschema, this.it, appl); - (0, subschema_1.extendSubschemaMode)(subschema, appl); - const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined }; - subschemaCode(nextContext, valid); - return nextContext; - } - mergeEvaluated(schemaCxt, toName) { - const { it, gen } = this; - if (!it.opts.unevaluated) - return; - if (it.props !== true && schemaCxt.props !== undefined) { - it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName); - } - if (it.items !== true && schemaCxt.items !== undefined) { - it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName); - } - } - mergeValidEvaluated(schemaCxt, valid) { - const { it, gen } = this; - if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { - gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name)); - return true; - } - } -} -exports.KeywordCxt = KeywordCxt; -function keywordCode(it, keyword, def, ruleType) { - const cxt = new KeywordCxt(it, def, keyword); - if ("code" in def) { - def.code(cxt, ruleType); - } - else if (cxt.$data && def.validate) { - (0, keyword_1.funcKeywordCode)(cxt, def); - } - else if ("macro" in def) { - (0, keyword_1.macroKeywordCode)(cxt, def); - } - else if (def.compile || def.validate) { - (0, keyword_1.funcKeywordCode)(cxt, def); - } -} -const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; -const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; -function getData($data, { dataLevel, dataNames, dataPathArr }) { - let jsonPointer; - let data; - if ($data === "") - return names_1.default.rootData; - if ($data[0] === "/") { - if (!JSON_POINTER.test($data)) - throw new Error(`Invalid JSON-pointer: ${$data}`); - jsonPointer = $data; - data = names_1.default.rootData; - } - else { - const matches = RELATIVE_JSON_POINTER.exec($data); - if (!matches) - throw new Error(`Invalid JSON-pointer: ${$data}`); - const up = +matches[1]; - jsonPointer = matches[2]; - if (jsonPointer === "#") { - if (up >= dataLevel) - throw new Error(errorMsg("property/index", up)); - return dataPathArr[dataLevel - up]; - } - if (up > dataLevel) - throw new Error(errorMsg("data", up)); - data = dataNames[dataLevel - up]; - if (!jsonPointer) - return data; - } - let expr = data; - const segments = jsonPointer.split("/"); - for (const segment of segments) { - if (segment) { - data = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`; - expr = (0, codegen_1._) `${expr} && ${data}`; - } - } - return expr; - function errorMsg(pointerType, up) { - return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`; - } -} -exports.getData = getData; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/index.js.map b/node_modules/ajv/dist/compile/validate/index.js.map deleted file mode 100644 index 873d09b5a..000000000 --- a/node_modules/ajv/dist/compile/validate/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/compile/validate/index.ts"],"names":[],"mappings":";;;AASA,6CAAoE;AACpE,yCAAiE;AACjE,mDAA6D;AAC7D,yCAAmF;AACnF,yCAAyC;AACzC,uCAAkG;AAClG,2CAAiG;AACjG,wCAAwF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KAAK,EAAE,CAAC,CAAA;QAC/D,MAAM,EAAE,GAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QAC9B,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;QACxB,IAAI,WAAW,KAAK,GAAG,EAAE;YACvB,IAAI,EAAE,IAAI,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC,CAAA;YACpE,OAAO,WAAW,CAAC,SAAS,GAAG,EAAE,CAAC,CAAA;SACnC;QACD,IAAI,EAAE,GAAG,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAA;QACzD,IAAI,GAAG,SAAS,CAAC,SAAS,GAAG,EAAE,CAAC,CAAA;QAChC,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAA;KAC9B;IAED,IAAI,IAAI,GAAG,IAAI,CAAA;IACf,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACvC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;QAC9B,IAAI,OAAO,EAAE;YACX,IAAI,GAAG,IAAA,WAAC,EAAA,GAAG,IAAI,GAAG,IAAA,qBAAW,EAAC,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAC,EAAE,CAAA;YAC7D,IAAI,GAAG,IAAA,WAAC,EAAA,GAAG,IAAI,OAAO,IAAI,EAAE,CAAA;SAC7B;KACF;IACD,OAAO,IAAI,CAAA;IAEX,SAAS,QAAQ,CAAC,WAAmB,EAAE,EAAU;QAC/C,OAAO,iBAAiB,WAAW,IAAI,EAAE,gCAAgC,SAAS,EAAE,CAAA;IACtF,CAAC;AACH,CAAC;AAtCD,0BAsCC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/keyword.d.ts b/node_modules/ajv/dist/compile/validate/keyword.d.ts deleted file mode 100644 index d15cee878..000000000 --- a/node_modules/ajv/dist/compile/validate/keyword.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { KeywordCxt } from "."; -import type { AddedKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition } from "../../types"; -import type { SchemaObjCxt } from ".."; -import type { JSONType } from "../rules"; -export declare function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void; -export declare function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void; -export declare function validSchemaType(schema: unknown, schemaType: JSONType[], allowUndefined?: boolean): boolean; -export declare function validateKeywordUsage({ schema, opts, self, errSchemaPath }: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string): void; diff --git a/node_modules/ajv/dist/compile/validate/keyword.js b/node_modules/ajv/dist/compile/validate/keyword.js deleted file mode 100644 index 1109d3a45..000000000 --- a/node_modules/ajv/dist/compile/validate/keyword.js +++ /dev/null @@ -1,124 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0; -const codegen_1 = require("../codegen"); -const names_1 = require("../names"); -const code_1 = require("../../vocabularies/code"); -const errors_1 = require("../errors"); -function macroKeywordCode(cxt, def) { - const { gen, keyword, schema, parentSchema, it } = cxt; - const macroSchema = def.macro.call(it.self, schema, parentSchema, it); - const schemaRef = useKeyword(gen, keyword, macroSchema); - if (it.opts.validateSchema !== false) - it.self.validateSchema(macroSchema, true); - const valid = gen.name("valid"); - cxt.subschema({ - schema: macroSchema, - schemaPath: codegen_1.nil, - errSchemaPath: `${it.errSchemaPath}/${keyword}`, - topSchemaRef: schemaRef, - compositeRule: true, - }, valid); - cxt.pass(valid, () => cxt.error(true)); -} -exports.macroKeywordCode = macroKeywordCode; -function funcKeywordCode(cxt, def) { - var _a; - const { gen, keyword, schema, parentSchema, $data, it } = cxt; - checkAsyncKeyword(it, def); - const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate; - const validateRef = useKeyword(gen, keyword, validate); - const valid = gen.let("valid"); - cxt.block$data(valid, validateKeyword); - cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid); - function validateKeyword() { - if (def.errors === false) { - assignValid(); - if (def.modifying) - modifyData(cxt); - reportErrs(() => cxt.error()); - } - else { - const ruleErrs = def.async ? validateAsync() : validateSync(); - if (def.modifying) - modifyData(cxt); - reportErrs(() => addErrs(cxt, ruleErrs)); - } - } - function validateAsync() { - const ruleErrs = gen.let("ruleErrs", null); - gen.try(() => assignValid((0, codegen_1._) `await `), (e) => gen.assign(valid, false).if((0, codegen_1._) `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._) `${e}.errors`), () => gen.throw(e))); - return ruleErrs; - } - function validateSync() { - const validateErrs = (0, codegen_1._) `${validateRef}.errors`; - gen.assign(validateErrs, null); - assignValid(codegen_1.nil); - return validateErrs; - } - function assignValid(_await = def.async ? (0, codegen_1._) `await ` : codegen_1.nil) { - const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self; - const passSchema = !(("compile" in def && !$data) || def.schema === false); - gen.assign(valid, (0, codegen_1._) `${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying); - } - function reportErrs(errors) { - var _a; - gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors); - } -} -exports.funcKeywordCode = funcKeywordCode; -function modifyData(cxt) { - const { gen, data, it } = cxt; - gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._) `${it.parentData}[${it.parentDataProperty}]`)); -} -function addErrs(cxt, errs) { - const { gen } = cxt; - gen.if((0, codegen_1._) `Array.isArray(${errs})`, () => { - gen - .assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`) - .assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`); - (0, errors_1.extendErrors)(cxt); - }, () => cxt.error()); -} -function checkAsyncKeyword({ schemaEnv }, def) { - if (def.async && !schemaEnv.$async) - throw new Error("async keyword in sync schema"); -} -function useKeyword(gen, keyword, result) { - if (result === undefined) - throw new Error(`keyword "${keyword}" failed to compile`); - return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) }); -} -function validSchemaType(schema, schemaType, allowUndefined = false) { - // TODO add tests - return (!schemaType.length || - schemaType.some((st) => st === "array" - ? Array.isArray(schema) - : st === "object" - ? schema && typeof schema == "object" && !Array.isArray(schema) - : typeof schema == st || (allowUndefined && typeof schema == "undefined"))); -} -exports.validSchemaType = validSchemaType; -function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) { - /* istanbul ignore if */ - if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { - throw new Error("ajv implementation error"); - } - const deps = def.dependencies; - if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) { - throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`); - } - if (def.validateSchema) { - const valid = def.validateSchema(schema[keyword]); - if (!valid) { - const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + - self.errorsText(def.validateSchema.errors); - if (opts.validateSchema === "log") - self.logger.error(msg); - else - throw new Error(msg); - } - } -} -exports.validateKeywordUsage = validateKeywordUsage; -//# sourceMappingURL=keyword.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/keyword.js.map b/node_modules/ajv/dist/compile/validate/keyword.js.map deleted file mode 100644 index 10d716d7e..000000000 --- a/node_modules/ajv/dist/compile/validate/keyword.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keyword.js","sourceRoot":"","sources":["../../../lib/compile/validate/keyword.ts"],"names":[],"mappings":";;;AAUA,wCAAsE;AACtE,oCAAwB;AAExB,kDAAwD;AACxD,sCAAsC;AAItC,SAAgB,gBAAgB,CAAC,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SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE;QAC3E,MAAM,IAAI,KAAK,CAAC,2CAA2C,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;KACzF;IAED,IAAI,GAAG,CAAC,cAAc,EAAE;QACtB,MAAM,KAAK,GAAG,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;QACjD,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,GAAG,GACP,YAAY,OAAO,+BAA+B,aAAa,KAAK;gBACpE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;YAC5C,IAAI,IAAI,CAAC,cAAc,KAAK,KAAK;gBAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;;gBACpD,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAA;SAC1B;KACF;AACH,CAAC;AAzBD,oDAyBC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/subschema.d.ts b/node_modules/ajv/dist/compile/validate/subschema.d.ts deleted file mode 100644 index b92785f2d..000000000 --- a/node_modules/ajv/dist/compile/validate/subschema.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { AnySchema } from "../../types"; -import type { SchemaObjCxt } from ".."; -import { Code, Name } from "../codegen"; -import { Type } from "../util"; -import type { JSONType } from "../rules"; -export interface SubschemaContext { - schema: AnySchema; - schemaPath: Code; - errSchemaPath: string; - topSchemaRef?: Code; - errorPath?: Code; - dataLevel?: number; - dataTypes?: JSONType[]; - data?: Name; - parentData?: Name; - parentDataProperty?: Code | number; - dataNames?: Name[]; - dataPathArr?: (Code | number)[]; - propertyName?: Name; - jtdDiscriminator?: string; - jtdMetadata?: boolean; - compositeRule?: true; - createErrors?: boolean; - allErrors?: boolean; -} -export type SubschemaArgs = Partial<{ - keyword: string; - schemaProp: string | number; - schema: AnySchema; - schemaPath: Code; - errSchemaPath: string; - topSchemaRef: Code; - data: Name | Code; - dataProp: Code | string | number; - dataTypes: JSONType[]; - definedProperties: Set; - propertyName: Name; - dataPropType: Type; - jtdDiscriminator: string; - jtdMetadata: boolean; - compositeRule: true; - createErrors: boolean; - allErrors: boolean; -}>; -export declare function getSubschema(it: SchemaObjCxt, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }: SubschemaArgs): SubschemaContext; -export declare function extendSubschemaData(subschema: SubschemaContext, it: SchemaObjCxt, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }: SubschemaArgs): void; -export declare function extendSubschemaMode(subschema: SubschemaContext, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }: SubschemaArgs): void; diff --git a/node_modules/ajv/dist/compile/validate/subschema.js b/node_modules/ajv/dist/compile/validate/subschema.js deleted file mode 100644 index 9de282869..000000000 --- a/node_modules/ajv/dist/compile/validate/subschema.js +++ /dev/null @@ -1,81 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0; -const codegen_1 = require("../codegen"); -const util_1 = require("../util"); -function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) { - if (keyword !== undefined && schema !== undefined) { - throw new Error('both "keyword" and "schema" passed, only one allowed'); - } - if (keyword !== undefined) { - const sch = it.schema[keyword]; - return schemaProp === undefined - ? { - schema: sch, - schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}`, - } - : { - schema: sch[schemaProp], - schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`, - }; - } - if (schema !== undefined) { - if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) { - throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); - } - return { - schema, - schemaPath, - topSchemaRef, - errSchemaPath, - }; - } - throw new Error('either "keyword" or "schema" must be passed'); -} -exports.getSubschema = getSubschema; -function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) { - if (data !== undefined && dataProp !== undefined) { - throw new Error('both "data" and "dataProp" passed, only one allowed'); - } - const { gen } = it; - if (dataProp !== undefined) { - const { errorPath, dataPathArr, opts } = it; - const nextData = gen.let("data", (0, codegen_1._) `${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true); - dataContextProps(nextData); - subschema.errorPath = (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`; - subschema.parentDataProperty = (0, codegen_1._) `${dataProp}`; - subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]; - } - if (data !== undefined) { - const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); // replaceable if used once? - dataContextProps(nextData); - if (propertyName !== undefined) - subschema.propertyName = propertyName; - // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr - } - if (dataTypes) - subschema.dataTypes = dataTypes; - function dataContextProps(_nextData) { - subschema.data = _nextData; - subschema.dataLevel = it.dataLevel + 1; - subschema.dataTypes = []; - it.definedProperties = new Set(); - subschema.parentData = it.data; - subschema.dataNames = [...it.dataNames, _nextData]; - } -} -exports.extendSubschemaData = extendSubschemaData; -function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) { - if (compositeRule !== undefined) - subschema.compositeRule = compositeRule; - if (createErrors !== undefined) - subschema.createErrors = createErrors; - if (allErrors !== undefined) - subschema.allErrors = allErrors; - subschema.jtdDiscriminator = jtdDiscriminator; // not inherited - subschema.jtdMetadata = jtdMetadata; // not inherited -} -exports.extendSubschemaMode = extendSubschemaMode; -//# sourceMappingURL=subschema.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/compile/validate/subschema.js.map b/node_modules/ajv/dist/compile/validate/subschema.js.map deleted file mode 100644 index a1b84d378..000000000 --- a/node_modules/ajv/dist/compile/validate/subschema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subschema.js","sourceRoot":"","sources":["../../../lib/compile/validate/subschema.ts"],"names":[],"mappings":";;;AAEA,wCAA0D;AAC1D,kCAA0D;AA6C1D,SAAgB,YAAY,CAC1B,EAAgB,EAChB,EAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAgB;IAErF,IAAI,OAAO,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE;QACjD,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;KACxE;IAED,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAC9B,OAAO,UAAU,KAAK,SAAS;YAC7B,CAAC,CAAC;gBACE,MAAM,EAAE,GAAG;gBACX,UAAU,EAAE,IAAA,WAAC,EAAA,GAAG,EAAE,CAAC,UAAU,GAAG,IAAA,qBAAW,EAAC,OAAO,CAAC,EAAE;gBACtD,aAAa,EAAE,GAAG,EAAE,CAAC,aAAa,IAAI,OAAO,EAAE;aAChD;YACH,CAAC,CAAC;gBACE,MAAM,EAAE,GAAG,CAAC,UAAU,CAAC;gBACvB,UAAU,EAAE,IAAA,WAAC,EAAA,GAAG,EAAE,CAAC,UAAU,GAAG,IAAA,qBAAW,EAAC,OAAO,CAAC,GAAG,IAAA,qBAAW,EAAC,UAAU,CAAC,EAAE;gBAChF,aAAa,EAAE,GAAG,EAAE,CAAC,aAAa,IAAI,OAAO,IAAI,IAAA,qBAAc,EAAC,UAAU,CAAC,EAAE;aAC9E,CAAA;KACN;IAED,IAAI,MAAM,KAAK,SAAS,EAAE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W,GAAG,WAAW,CAAA,CAAC,gBAAgB;AACtD,CAAC;AATD,kDASC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/core.d.ts b/node_modules/ajv/dist/core.d.ts deleted file mode 100644 index 4591ed9ec..000000000 --- a/node_modules/ajv/dist/core.d.ts +++ /dev/null @@ -1,173 +0,0 @@ -export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, AnyValidateFunction, ErrorObject, ErrorNoParams, } from "./types"; -export { SchemaCxt, SchemaObjCxt } from "./compile"; -export interface Plugin { - (ajv: Ajv, options?: Opts): Ajv; - [prop: string]: any; -} -export { KeywordCxt } from "./compile/validate"; -export { DefinedError } from "./vocabularies/errors"; -export { JSONType } from "./compile/rules"; -export { JSONSchemaType } from "./types/json-schema"; -export { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema"; -export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; -import type { Schema, AnySchema, AnySchemaObject, SchemaObject, AsyncSchema, Vocabulary, KeywordDefinition, AddedKeywordDefinition, AnyValidateFunction, ValidateFunction, AsyncValidateFunction, ErrorObject, Format, AddedFormat, RegExpEngine, UriResolver } from "./types"; -import type { JSONSchemaType } from "./types/json-schema"; -import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema"; -import ValidationError from "./runtime/validation_error"; -import MissingRefError from "./compile/ref_error"; -import { ValidationRules } from "./compile/rules"; -import { SchemaEnv } from "./compile"; -import { Code, ValueScope } from "./compile/codegen"; -export type Options = CurrentOptions & DeprecatedOptions; -export interface CurrentOptions { - strict?: boolean | "log"; - strictSchema?: boolean | "log"; - strictNumbers?: boolean | "log"; - strictTypes?: boolean | "log"; - strictTuples?: boolean | "log"; - strictRequired?: boolean | "log"; - allowMatchingProperties?: boolean; - allowUnionTypes?: boolean; - validateFormats?: boolean; - $data?: boolean; - allErrors?: boolean; - verbose?: boolean; - discriminator?: boolean; - unicodeRegExp?: boolean; - timestamp?: "string" | "date"; - parseDate?: boolean; - allowDate?: boolean; - $comment?: true | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown); - formats?: { - [Name in string]?: Format; - }; - keywords?: Vocabulary; - schemas?: AnySchema[] | { - [Key in string]?: AnySchema; - }; - logger?: Logger | false; - loadSchema?: (uri: string) => Promise; - removeAdditional?: boolean | "all" | "failing"; - useDefaults?: boolean | "empty"; - coerceTypes?: boolean | "array"; - next?: boolean; - unevaluated?: boolean; - dynamicRef?: boolean; - schemaId?: "id" | "$id"; - jtd?: boolean; - meta?: SchemaObject | boolean; - defaultMeta?: string | AnySchemaObject; - validateSchema?: boolean | "log"; - addUsedSchema?: boolean; - inlineRefs?: boolean | number; - passContext?: boolean; - loopRequired?: number; - loopEnum?: number; - ownProperties?: boolean; - multipleOfPrecision?: number; - int32range?: boolean; - messages?: boolean; - code?: CodeOptions; - uriResolver?: UriResolver; -} -export interface CodeOptions { - es5?: boolean; - esm?: boolean; - lines?: boolean; - optimize?: boolean | number; - formats?: Code; - source?: boolean; - process?: (code: string, schema?: SchemaEnv) => string; - regExp?: RegExpEngine; -} -interface InstanceCodeOptions extends CodeOptions { - regExp: RegExpEngine; - optimize: number; -} -interface DeprecatedOptions { - /** @deprecated */ - ignoreKeywordsWithRef?: boolean; - /** @deprecated */ - jsPropertySyntax?: boolean; - /** @deprecated */ - unicode?: boolean; -} -type RequiredInstanceOptions = { - [K in "strictSchema" | "strictNumbers" | "strictTypes" | "strictTuples" | "strictRequired" | "inlineRefs" | "loopRequired" | "loopEnum" | "meta" | "messages" | "schemaId" | "addUsedSchema" | "validateSchema" | "validateFormats" | "int32range" | "unicodeRegExp" | "uriResolver"]: NonNullable; -} & { - code: InstanceCodeOptions; -}; -export type InstanceOptions = Options & RequiredInstanceOptions; -export interface Logger { - log(...args: unknown[]): unknown; - warn(...args: unknown[]): unknown; - error(...args: unknown[]): unknown; -} -export default class Ajv { - opts: InstanceOptions; - errors?: ErrorObject[] | null; - logger: Logger; - readonly scope: ValueScope; - readonly schemas: { - [Key in string]?: SchemaEnv; - }; - readonly refs: { - [Ref in string]?: SchemaEnv | string; - }; - readonly formats: { - [Name in string]?: AddedFormat; - }; - readonly RULES: ValidationRules; - readonly _compilations: Set; - private readonly _loading; - private readonly _cache; - private readonly _metaOpts; - static ValidationError: typeof ValidationError; - static MissingRefError: typeof MissingRefError; - constructor(opts?: Options); - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; - validate(schema: Schema | string, data: unknown): boolean; - validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise; - validate(schema: Schema | JSONSchemaType | string, data: unknown): data is T; - validate(schema: JTDSchemaType, data: unknown): data is T; - validate(schema: T, data: unknown): data is JTDDataType; - validate(schema: AsyncSchema, data: unknown | T): Promise; - validate(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise; - compile(schema: Schema | JSONSchemaType, _meta?: boolean): ValidateFunction; - compile(schema: JTDSchemaType, _meta?: boolean): ValidateFunction; - compile(schema: T, _meta?: boolean): ValidateFunction>; - compile(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction; - compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction; - compileAsync(schema: SchemaObject | JSONSchemaType, _meta?: boolean): Promise>; - compileAsync(schema: JTDSchemaType, _meta?: boolean): Promise>; - compileAsync(schema: AsyncSchema, meta?: boolean): Promise>; - compileAsync(schema: AnySchemaObject, meta?: boolean): Promise>; - addSchema(schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored - key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. - _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. - _validateSchema?: boolean | "log"): Ajv; - addMetaSchema(schema: AnySchemaObject, key?: string, // schema key - _validateSchema?: boolean | "log"): Ajv; - validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise; - getSchema(keyRef: string): AnyValidateFunction | undefined; - removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv; - addVocabulary(definitions: Vocabulary): Ajv; - addKeyword(kwdOrDef: string | KeywordDefinition, def?: KeywordDefinition): Ajv; - getKeyword(keyword: string): AddedKeywordDefinition | boolean; - removeKeyword(keyword: string): Ajv; - addFormat(name: string, format: Format): Ajv; - errorsText(errors?: ErrorObject[] | null | undefined, // optional array of validation errors - { separator, dataVar }?: ErrorsTextOptions): string; - $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject; - private _removeAllSchemas; - _addSchema(schema: AnySchema, meta?: boolean, baseId?: string, validateSchema?: boolean | "log", addSchema?: boolean): SchemaEnv; - private _checkUnique; - private _compileSchemaEnv; - private _compileMetaSchema; -} -export interface ErrorsTextOptions { - separator?: string; - dataVar?: string; -} diff --git a/node_modules/ajv/dist/core.js b/node_modules/ajv/dist/core.js deleted file mode 100644 index 84911161f..000000000 --- a/node_modules/ajv/dist/core.js +++ /dev/null @@ -1,617 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; -var validate_1 = require("./compile/validate"); -Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); -var codegen_1 = require("./compile/codegen"); -Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); -Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); -Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); -Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); -Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); -Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); -const validation_error_1 = require("./runtime/validation_error"); -const ref_error_1 = require("./compile/ref_error"); -const rules_1 = require("./compile/rules"); -const compile_1 = require("./compile"); -const codegen_2 = require("./compile/codegen"); -const resolve_1 = require("./compile/resolve"); -const dataType_1 = require("./compile/validate/dataType"); -const util_1 = require("./compile/util"); -const $dataRefSchema = require("./refs/data.json"); -const uri_1 = require("./runtime/uri"); -const defaultRegExp = (str, flags) => new RegExp(str, flags); -defaultRegExp.code = "new RegExp"; -const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"]; -const EXT_SCOPE_NAMES = new Set([ - "validate", - "serialize", - "parse", - "wrapper", - "root", - "schema", - "keyword", - "pattern", - "formats", - "validate$data", - "func", - "obj", - "Error", -]); -const removedOptions = { - errorDataPath: "", - format: "`validateFormats: false` can be used instead.", - nullable: '"nullable" keyword is supported by default.', - jsonPointers: "Deprecated jsPropertySyntax can be used instead.", - extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", - missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", - processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", - sourceCode: "Use option `code: {source: true}`", - strictDefaults: "It is default now, see option `strict`.", - strictKeywords: "It is default now, see option `strict`.", - uniqueItems: '"uniqueItems" keyword is always validated.', - unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", - cache: "Map is used as cache, schema object as key.", - serialize: "Map is used as cache, schema object as key.", - ajvErrors: "It is default now.", -}; -const deprecatedOptions = { - ignoreKeywordsWithRef: "", - jsPropertySyntax: "", - unicode: '"minLength"/"maxLength" account for unicode characters by default.', -}; -const MAX_EXPRESSION = 200; -// eslint-disable-next-line complexity -function requiredOptions(o) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; - const s = o.strict; - const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize; - const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0; - const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp; - const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default; - return { - strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true, - strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true, - strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log", - strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log", - strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false, - code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp }, - loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION, - loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION, - meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true, - messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true, - inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true, - schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id", - addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true, - validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true, - validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true, - unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true, - int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true, - uriResolver: uriResolver, - }; -} -class Ajv { - constructor(opts = {}) { - this.schemas = {}; - this.refs = {}; - this.formats = {}; - this._compilations = new Set(); - this._loading = {}; - this._cache = new Map(); - opts = this.opts = { ...opts, ...requiredOptions(opts) }; - const { es5, lines } = this.opts.code; - this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines }); - this.logger = getLogger(opts.logger); - const formatOpt = opts.validateFormats; - opts.validateFormats = false; - this.RULES = (0, rules_1.getRules)(); - checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED"); - checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn"); - this._metaOpts = getMetaSchemaOptions.call(this); - if (opts.formats) - addInitialFormats.call(this); - this._addVocabularies(); - this._addDefaultMetaSchema(); - if (opts.keywords) - addInitialKeywords.call(this, opts.keywords); - if (typeof opts.meta == "object") - this.addMetaSchema(opts.meta); - addInitialSchemas.call(this); - opts.validateFormats = formatOpt; - } - _addVocabularies() { - this.addKeyword("$async"); - } - _addDefaultMetaSchema() { - const { $data, meta, schemaId } = this.opts; - let _dataRefSchema = $dataRefSchema; - if (schemaId === "id") { - _dataRefSchema = { ...$dataRefSchema }; - _dataRefSchema.id = _dataRefSchema.$id; - delete _dataRefSchema.$id; - } - if (meta && $data) - this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false); - } - defaultMeta() { - const { meta, schemaId } = this.opts; - return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined); - } - validate(schemaKeyRef, // key, ref or schema object - data // to be validated - ) { - let v; - if (typeof schemaKeyRef == "string") { - v = this.getSchema(schemaKeyRef); - if (!v) - throw new Error(`no schema with key or ref "${schemaKeyRef}"`); - } - else { - v = this.compile(schemaKeyRef); - } - const valid = v(data); - if (!("$async" in v)) - this.errors = v.errors; - return valid; - } - compile(schema, _meta) { - const sch = this._addSchema(schema, _meta); - return (sch.validate || this._compileSchemaEnv(sch)); - } - compileAsync(schema, meta) { - if (typeof this.opts.loadSchema != "function") { - throw new Error("options.loadSchema should be a function"); - } - const { loadSchema } = this.opts; - return runCompileAsync.call(this, schema, meta); - async function runCompileAsync(_schema, _meta) { - await loadMetaSchema.call(this, _schema.$schema); - const sch = this._addSchema(_schema, _meta); - return sch.validate || _compileAsync.call(this, sch); - } - async function loadMetaSchema($ref) { - if ($ref && !this.getSchema($ref)) { - await runCompileAsync.call(this, { $ref }, true); - } - } - async function _compileAsync(sch) { - try { - return this._compileSchemaEnv(sch); - } - catch (e) { - if (!(e instanceof ref_error_1.default)) - throw e; - checkLoaded.call(this, e); - await loadMissingSchema.call(this, e.missingSchema); - return _compileAsync.call(this, sch); - } - } - function checkLoaded({ missingSchema: ref, missingRef }) { - if (this.refs[ref]) { - throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`); - } - } - async function loadMissingSchema(ref) { - const _schema = await _loadSchema.call(this, ref); - if (!this.refs[ref]) - await loadMetaSchema.call(this, _schema.$schema); - if (!this.refs[ref]) - this.addSchema(_schema, ref, meta); - } - async function _loadSchema(ref) { - const p = this._loading[ref]; - if (p) - return p; - try { - return await (this._loading[ref] = loadSchema(ref)); - } - finally { - delete this._loading[ref]; - } - } - } - // Adds schema to the instance - addSchema(schema, // If array is passed, `key` will be ignored - key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. - _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. - _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead. - ) { - if (Array.isArray(schema)) { - for (const sch of schema) - this.addSchema(sch, undefined, _meta, _validateSchema); - return this; - } - let id; - if (typeof schema === "object") { - const { schemaId } = this.opts; - id = schema[schemaId]; - if (id !== undefined && typeof id != "string") { - throw new Error(`schema ${schemaId} must be string`); - } - } - key = (0, resolve_1.normalizeId)(key || id); - this._checkUnique(key); - this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true); - return this; - } - // Add schema that will be used to validate other schemas - // options in META_IGNORE_OPTIONS are alway set to false - addMetaSchema(schema, key, // schema key - _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema - ) { - this.addSchema(schema, key, true, _validateSchema); - return this; - } - // Validate schema against its meta-schema - validateSchema(schema, throwOrLogError) { - if (typeof schema == "boolean") - return true; - let $schema; - $schema = schema.$schema; - if ($schema !== undefined && typeof $schema != "string") { - throw new Error("$schema must be a string"); - } - $schema = $schema || this.opts.defaultMeta || this.defaultMeta(); - if (!$schema) { - this.logger.warn("meta-schema not available"); - this.errors = null; - return true; - } - const valid = this.validate($schema, schema); - if (!valid && throwOrLogError) { - const message = "schema is invalid: " + this.errorsText(); - if (this.opts.validateSchema === "log") - this.logger.error(message); - else - throw new Error(message); - } - return valid; - } - // Get compiled schema by `key` or `ref`. - // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) - getSchema(keyRef) { - let sch; - while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") - keyRef = sch; - if (sch === undefined) { - const { schemaId } = this.opts; - const root = new compile_1.SchemaEnv({ schema: {}, schemaId }); - sch = compile_1.resolveSchema.call(this, root, keyRef); - if (!sch) - return; - this.refs[keyRef] = sch; - } - return (sch.validate || this._compileSchemaEnv(sch)); - } - // Remove cached schema(s). - // If no parameter is passed all schemas but meta-schemas are removed. - // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. - // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. - removeSchema(schemaKeyRef) { - if (schemaKeyRef instanceof RegExp) { - this._removeAllSchemas(this.schemas, schemaKeyRef); - this._removeAllSchemas(this.refs, schemaKeyRef); - return this; - } - switch (typeof schemaKeyRef) { - case "undefined": - this._removeAllSchemas(this.schemas); - this._removeAllSchemas(this.refs); - this._cache.clear(); - return this; - case "string": { - const sch = getSchEnv.call(this, schemaKeyRef); - if (typeof sch == "object") - this._cache.delete(sch.schema); - delete this.schemas[schemaKeyRef]; - delete this.refs[schemaKeyRef]; - return this; - } - case "object": { - const cacheKey = schemaKeyRef; - this._cache.delete(cacheKey); - let id = schemaKeyRef[this.opts.schemaId]; - if (id) { - id = (0, resolve_1.normalizeId)(id); - delete this.schemas[id]; - delete this.refs[id]; - } - return this; - } - default: - throw new Error("ajv.removeSchema: invalid parameter"); - } - } - // add "vocabulary" - a collection of keywords - addVocabulary(definitions) { - for (const def of definitions) - this.addKeyword(def); - return this; - } - addKeyword(kwdOrDef, def // deprecated - ) { - let keyword; - if (typeof kwdOrDef == "string") { - keyword = kwdOrDef; - if (typeof def == "object") { - this.logger.warn("these parameters are deprecated, see docs for addKeyword"); - def.keyword = keyword; - } - } - else if (typeof kwdOrDef == "object" && def === undefined) { - def = kwdOrDef; - keyword = def.keyword; - if (Array.isArray(keyword) && !keyword.length) { - throw new Error("addKeywords: keyword must be string or non-empty array"); - } - } - else { - throw new Error("invalid addKeywords parameters"); - } - checkKeyword.call(this, keyword, def); - if (!def) { - (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd)); - return this; - } - keywordMetaschema.call(this, def); - const definition = { - ...def, - type: (0, dataType_1.getJSONTypes)(def.type), - schemaType: (0, dataType_1.getJSONTypes)(def.schemaType), - }; - (0, util_1.eachItem)(keyword, definition.type.length === 0 - ? (k) => addRule.call(this, k, definition) - : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t))); - return this; - } - getKeyword(keyword) { - const rule = this.RULES.all[keyword]; - return typeof rule == "object" ? rule.definition : !!rule; - } - // Remove keyword - removeKeyword(keyword) { - // TODO return type should be Ajv - const { RULES } = this; - delete RULES.keywords[keyword]; - delete RULES.all[keyword]; - for (const group of RULES.rules) { - const i = group.rules.findIndex((rule) => rule.keyword === keyword); - if (i >= 0) - group.rules.splice(i, 1); - } - return this; - } - // Add format - addFormat(name, format) { - if (typeof format == "string") - format = new RegExp(format); - this.formats[name] = format; - return this; - } - errorsText(errors = this.errors, // optional array of validation errors - { separator = ", ", dataVar = "data" } = {} // optional options with properties `separator` and `dataVar` - ) { - if (!errors || errors.length === 0) - return "No errors"; - return errors - .map((e) => `${dataVar}${e.instancePath} ${e.message}`) - .reduce((text, msg) => text + separator + msg); - } - $dataMetaSchema(metaSchema, keywordsJsonPointers) { - const rules = this.RULES.all; - metaSchema = JSON.parse(JSON.stringify(metaSchema)); - for (const jsonPointer of keywordsJsonPointers) { - const segments = jsonPointer.split("/").slice(1); // first segment is an empty string - let keywords = metaSchema; - for (const seg of segments) - keywords = keywords[seg]; - for (const key in rules) { - const rule = rules[key]; - if (typeof rule != "object") - continue; - const { $data } = rule.definition; - const schema = keywords[key]; - if ($data && schema) - keywords[key] = schemaOrData(schema); - } - } - return metaSchema; - } - _removeAllSchemas(schemas, regex) { - for (const keyRef in schemas) { - const sch = schemas[keyRef]; - if (!regex || regex.test(keyRef)) { - if (typeof sch == "string") { - delete schemas[keyRef]; - } - else if (sch && !sch.meta) { - this._cache.delete(sch.schema); - delete schemas[keyRef]; - } - } - } - } - _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) { - let id; - const { schemaId } = this.opts; - if (typeof schema == "object") { - id = schema[schemaId]; - } - else { - if (this.opts.jtd) - throw new Error("schema must be object"); - else if (typeof schema != "boolean") - throw new Error("schema must be object or boolean"); - } - let sch = this._cache.get(schema); - if (sch !== undefined) - return sch; - baseId = (0, resolve_1.normalizeId)(id || baseId); - const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId); - sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs }); - this._cache.set(sch.schema, sch); - if (addSchema && !baseId.startsWith("#")) { - // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) - if (baseId) - this._checkUnique(baseId); - this.refs[baseId] = sch; - } - if (validateSchema) - this.validateSchema(schema, true); - return sch; - } - _checkUnique(id) { - if (this.schemas[id] || this.refs[id]) { - throw new Error(`schema with key or id "${id}" already exists`); - } - } - _compileSchemaEnv(sch) { - if (sch.meta) - this._compileMetaSchema(sch); - else - compile_1.compileSchema.call(this, sch); - /* istanbul ignore if */ - if (!sch.validate) - throw new Error("ajv implementation error"); - return sch.validate; - } - _compileMetaSchema(sch) { - const currentOpts = this.opts; - this.opts = this._metaOpts; - try { - compile_1.compileSchema.call(this, sch); - } - finally { - this.opts = currentOpts; - } - } -} -exports.default = Ajv; -Ajv.ValidationError = validation_error_1.default; -Ajv.MissingRefError = ref_error_1.default; -function checkOptions(checkOpts, options, msg, log = "error") { - for (const key in checkOpts) { - const opt = key; - if (opt in options) - this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`); - } -} -function getSchEnv(keyRef) { - keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line - return this.schemas[keyRef] || this.refs[keyRef]; -} -function addInitialSchemas() { - const optsSchemas = this.opts.schemas; - if (!optsSchemas) - return; - if (Array.isArray(optsSchemas)) - this.addSchema(optsSchemas); - else - for (const key in optsSchemas) - this.addSchema(optsSchemas[key], key); -} -function addInitialFormats() { - for (const name in this.opts.formats) { - const format = this.opts.formats[name]; - if (format) - this.addFormat(name, format); - } -} -function addInitialKeywords(defs) { - if (Array.isArray(defs)) { - this.addVocabulary(defs); - return; - } - this.logger.warn("keywords option as map is deprecated, pass array"); - for (const keyword in defs) { - const def = defs[keyword]; - if (!def.keyword) - def.keyword = keyword; - this.addKeyword(def); - } -} -function getMetaSchemaOptions() { - const metaOpts = { ...this.opts }; - for (const opt of META_IGNORE_OPTIONS) - delete metaOpts[opt]; - return metaOpts; -} -const noLogs = { log() { }, warn() { }, error() { } }; -function getLogger(logger) { - if (logger === false) - return noLogs; - if (logger === undefined) - return console; - if (logger.log && logger.warn && logger.error) - return logger; - throw new Error("logger must implement log, warn and error methods"); -} -const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i; -function checkKeyword(keyword, def) { - const { RULES } = this; - (0, util_1.eachItem)(keyword, (kwd) => { - if (RULES.keywords[kwd]) - throw new Error(`Keyword ${kwd} is already defined`); - if (!KEYWORD_NAME.test(kwd)) - throw new Error(`Keyword ${kwd} has invalid name`); - }); - if (!def) - return; - if (def.$data && !("code" in def || "validate" in def)) { - throw new Error('$data keyword must have "code" or "validate" function'); - } -} -function addRule(keyword, definition, dataType) { - var _a; - const post = definition === null || definition === void 0 ? void 0 : definition.post; - if (dataType && post) - throw new Error('keyword with "post" flag cannot have "type"'); - const { RULES } = this; - let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType); - if (!ruleGroup) { - ruleGroup = { type: dataType, rules: [] }; - RULES.rules.push(ruleGroup); - } - RULES.keywords[keyword] = true; - if (!definition) - return; - const rule = { - keyword, - definition: { - ...definition, - type: (0, dataType_1.getJSONTypes)(definition.type), - schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType), - }, - }; - if (definition.before) - addBeforeRule.call(this, ruleGroup, rule, definition.before); - else - ruleGroup.rules.push(rule); - RULES.all[keyword] = rule; - (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd)); -} -function addBeforeRule(ruleGroup, rule, before) { - const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before); - if (i >= 0) { - ruleGroup.rules.splice(i, 0, rule); - } - else { - ruleGroup.rules.push(rule); - this.logger.warn(`rule ${before} is not defined`); - } -} -function keywordMetaschema(def) { - let { metaSchema } = def; - if (metaSchema === undefined) - return; - if (def.$data && this.opts.$data) - metaSchema = schemaOrData(metaSchema); - def.validateSchema = this.compile(metaSchema, true); -} -const $dataRef = { - $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", -}; -function schemaOrData(schema) { - return { anyOf: [schema, $dataRef] }; -} -//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/core.js.map b/node_modules/ajv/dist/core.js.map deleted file mode 100644 index c39cd6b53..000000000 --- a/node_modules/ajv/dist/core.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"core.js","sourceRoot":"","sources":["../lib/core.ts"],"names":[],"mappings":";;;AA4BA,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAKlB,6CAA6F;AAAr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M,QAAQ,GAAG;IACf,IAAI,EAAE,gFAAgF;CACvF,CAAA;AAED,SAAS,YAAY,CAAC,MAAiB;IACrC,OAAO,EAAC,KAAK,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,CAAA;AACpC,CAAC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/jtd.d.ts b/node_modules/ajv/dist/jtd.d.ts deleted file mode 100644 index de3a2273e..000000000 --- a/node_modules/ajv/dist/jtd.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { AnySchemaObject, SchemaObject, JTDParser } from "./types"; -import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema"; -import AjvCore, { CurrentOptions } from "./core"; -type JTDOptions = CurrentOptions & { - strict?: never; - allowMatchingProperties?: never; - allowUnionTypes?: never; - validateFormats?: never; - $data?: never; - verbose?: boolean; - $comment?: never; - formats?: never; - loadSchema?: never; - useDefaults?: never; - coerceTypes?: never; - next?: never; - unevaluated?: never; - dynamicRef?: never; - meta?: boolean; - defaultMeta?: never; - inlineRefs?: boolean; - loopRequired?: never; - multipleOfPrecision?: never; -}; -declare class Ajv extends AjvCore { - constructor(opts?: JTDOptions); - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; - compileSerializer(schema: SchemaObject): (data: T) => string; - compileSerializer(schema: JTDSchemaType): (data: T) => string; - compileParser(schema: SchemaObject): JTDParser; - compileParser(schema: JTDSchemaType): JTDParser; - private _compileSerializer; - private _compileParser; -} -export default Ajv; -export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, JTDParser, } from "./types"; -export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core"; -export { SchemaCxt, SchemaObjCxt } from "./compile"; -export { KeywordCxt } from "./compile/validate"; -export { JTDErrorObject } from "./vocabularies/jtd"; -export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; -export { JTDSchemaType, SomeJTDSchemaType, JTDDataType }; -export { JTDOptions }; -export { default as ValidationError } from "./runtime/validation_error"; -export { default as MissingRefError } from "./compile/ref_error"; diff --git a/node_modules/ajv/dist/jtd.js b/node_modules/ajv/dist/jtd.js deleted file mode 100644 index b89387993..000000000 --- a/node_modules/ajv/dist/jtd.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; -const core_1 = require("./core"); -const jtd_1 = require("./vocabularies/jtd"); -const jtd_schema_1 = require("./refs/jtd-schema"); -const serialize_1 = require("./compile/jtd/serialize"); -const parse_1 = require("./compile/jtd/parse"); -const META_SCHEMA_ID = "JTD-meta-schema"; -class Ajv extends core_1.default { - constructor(opts = {}) { - super({ - ...opts, - jtd: true, - }); - } - _addVocabularies() { - super._addVocabularies(); - this.addVocabulary(jtd_1.default); - } - _addDefaultMetaSchema() { - super._addDefaultMetaSchema(); - if (!this.opts.meta) - return; - this.addMetaSchema(jtd_schema_1.default, META_SCHEMA_ID, false); - } - defaultMeta() { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)); - } - compileSerializer(schema) { - const sch = this._addSchema(schema); - return sch.serialize || this._compileSerializer(sch); - } - compileParser(schema) { - const sch = this._addSchema(schema); - return (sch.parse || this._compileParser(sch)); - } - _compileSerializer(sch) { - serialize_1.default.call(this, sch, sch.schema.definitions || {}); - /* istanbul ignore if */ - if (!sch.serialize) - throw new Error("ajv implementation error"); - return sch.serialize; - } - _compileParser(sch) { - parse_1.default.call(this, sch, sch.schema.definitions || {}); - /* istanbul ignore if */ - if (!sch.parse) - throw new Error("ajv implementation error"); - return sch.parse; - } -} -module.exports = exports = Ajv; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = Ajv; -var validate_1 = require("./compile/validate"); -Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); -var codegen_1 = require("./compile/codegen"); -Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } }); -Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } }); -Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } }); -Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } }); -Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } }); -Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } }); -var validation_error_1 = require("./runtime/validation_error"); -Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); -var ref_error_1 = require("./compile/ref_error"); -Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); -//# sourceMappingURL=jtd.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/jtd.js.map b/node_modules/ajv/dist/jtd.js.map deleted file mode 100644 index e5ac473d8..000000000 --- a/node_modules/ajv/dist/jtd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jtd.js","sourceRoot":"","sources":["../lib/jtd.ts"],"names":[],"mappings":";;;AAEA,iCAA8C;AAC9C,4CAA8C;AAC9C,kDAA6C;AAC7C,uDAAuD;AACvD,+CAA+C;AAG/C,MAAM,cAAc,GAAG,iBAAiB,CAAA;AA4BxC,MAAM,GAAI,SAAQ,cAAO;IACvB,YAAY,OAAmB,EAAE;QAC/B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,GAAG,EAAE,IAAI;SACV,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB;QACd,KAA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IAAI,EAAE,GAAG,EAAG,GAAG,CAAC,MAA0B,CAAC,WAAW,IAAI,EAAE,CAAC,CAAA;QAChF,wBAAwB;QACxB,IAAI,CAAC,GAAG,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC3D,OAAO,GAAG,CAAC,KAAK,CAAA;IAClB,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,GAAG,CAAA;AAC9B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,GAAG,CAAA;AA0BlB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAElB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AAInD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ No newline at end of file diff --git a/node_modules/ajv/dist/refs/data.json b/node_modules/ajv/dist/refs/data.json deleted file mode 100644 index 9ffc9f5ce..000000000 --- a/node_modules/ajv/dist/refs/data.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", - "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)", - "type": "object", - "required": ["$data"], - "properties": { - "$data": { - "type": "string", - "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}] - } - }, - "additionalProperties": false -} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts b/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts deleted file mode 100644 index cf008331f..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type Ajv from "../../core"; -export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv; diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/index.js b/node_modules/ajv/dist/refs/json-schema-2019-09/index.js deleted file mode 100644 index e86496282..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const metaSchema = require("./schema.json"); -const applicator = require("./meta/applicator.json"); -const content = require("./meta/content.json"); -const core = require("./meta/core.json"); -const format = require("./meta/format.json"); -const metadata = require("./meta/meta-data.json"); -const validation = require("./meta/validation.json"); -const META_SUPPORT_DATA = ["/properties"]; -function addMetaSchema2019($data) { - ; - [ - metaSchema, - applicator, - content, - core, - with$data(this, format), - metadata, - with$data(this, validation), - ].forEach((sch) => this.addMetaSchema(sch, undefined, false)); - return this; - function with$data(ajv, sch) { - return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch; - } -} -exports.default = addMetaSchema2019; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map b/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map deleted file mode 100644 index 9b8a36d61..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/refs/json-schema-2019-09/index.ts"],"names":[],"mappings":";;AAEA,4CAA2C;AAC3C,qDAAoD;AACpD,+CAA8C;AAC9C,yCAAwC;AACxC,6CAA4C;AAC5C,kDAAiD;AACjD,qDAAoD;AAEpD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,UAAU;QACV,OAAO;QACP,IAAI;QACJ,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QACvB,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;KAC5B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;IAC7D,OAAO,IAAI,CAAA;IAEX,SAAS,SAAS,CAAC,GAAQ,EAAE,GAAoB;QAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAClE,CAAC;AACH,CAAC;AAfD,oCAeC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json deleted file mode 100644 index c5e91cf2a..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/applicator", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/applicator": true - }, - "$recursiveAnchor": true, - - "title": "Applicator vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "additionalItems": {"$recursiveRef": "#"}, - "unevaluatedItems": {"$recursiveRef": "#"}, - "items": { - "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}] - }, - "contains": {"$recursiveRef": "#"}, - "additionalProperties": {"$recursiveRef": "#"}, - "unevaluatedProperties": {"$recursiveRef": "#"}, - "properties": { - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "propertyNames": {"format": "regex"}, - "default": {} - }, - "dependentSchemas": { - "type": "object", - "additionalProperties": { - "$recursiveRef": "#" - } - }, - "propertyNames": {"$recursiveRef": "#"}, - "if": {"$recursiveRef": "#"}, - "then": {"$recursiveRef": "#"}, - "else": {"$recursiveRef": "#"}, - "allOf": {"$ref": "#/$defs/schemaArray"}, - "anyOf": {"$ref": "#/$defs/schemaArray"}, - "oneOf": {"$ref": "#/$defs/schemaArray"}, - "not": {"$recursiveRef": "#"} - }, - "$defs": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$recursiveRef": "#"} - } - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json deleted file mode 100644 index b8f637343..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/content", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/content": true - }, - "$recursiveAnchor": true, - - "title": "Content vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "contentMediaType": {"type": "string"}, - "contentEncoding": {"type": "string"}, - "contentSchema": {"$recursiveRef": "#"} - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json deleted file mode 100644 index f71adbff0..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/core", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/core": true - }, - "$recursiveAnchor": true, - - "title": "Core vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "$id": { - "type": "string", - "format": "uri-reference", - "$comment": "Non-empty fragments not allowed.", - "pattern": "^[^#]*#?$" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$anchor": { - "type": "string", - "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "$recursiveRef": { - "type": "string", - "format": "uri-reference" - }, - "$recursiveAnchor": { - "type": "boolean", - "default": false - }, - "$vocabulary": { - "type": "object", - "propertyNames": { - "type": "string", - "format": "uri" - }, - "additionalProperties": { - "type": "boolean" - } - }, - "$comment": { - "type": "string" - }, - "$defs": { - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "default": {} - } - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json deleted file mode 100644 index 03ccfce26..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/format", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/format": true - }, - "$recursiveAnchor": true, - - "title": "Format vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "format": {"type": "string"} - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json deleted file mode 100644 index 0e194326f..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/meta-data", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/meta-data": true - }, - "$recursiveAnchor": true, - - "title": "Meta-data vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "deprecated": { - "type": "boolean", - "default": false - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "writeOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - } - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json deleted file mode 100644 index 7027a1279..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/validation", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/validation": true - }, - "$recursiveAnchor": true, - - "title": "Validation vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, - "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, - "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, - "minContains": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 1 - }, - "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, - "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/$defs/stringArray"}, - "dependentRequired": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/stringArray" - } - }, - "const": true, - "enum": { - "type": "array", - "items": true - }, - "type": { - "anyOf": [ - {"$ref": "#/$defs/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/$defs/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - } - }, - "$defs": { - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 0 - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json b/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json deleted file mode 100644 index 54eb7157a..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/schema", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/core": true, - "https://json-schema.org/draft/2019-09/vocab/applicator": true, - "https://json-schema.org/draft/2019-09/vocab/validation": true, - "https://json-schema.org/draft/2019-09/vocab/meta-data": true, - "https://json-schema.org/draft/2019-09/vocab/format": false, - "https://json-schema.org/draft/2019-09/vocab/content": true - }, - "$recursiveAnchor": true, - - "title": "Core and Validation specifications meta-schema", - "allOf": [ - {"$ref": "meta/core"}, - {"$ref": "meta/applicator"}, - {"$ref": "meta/validation"}, - {"$ref": "meta/meta-data"}, - {"$ref": "meta/format"}, - {"$ref": "meta/content"} - ], - "type": ["object", "boolean"], - "properties": { - "definitions": { - "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "default": {} - }, - "dependencies": { - "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", - "type": "object", - "additionalProperties": { - "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}] - } - } - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts b/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts deleted file mode 100644 index c232ab05c..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type Ajv from "../../core"; -export default function addMetaSchema2020(this: Ajv, $data?: boolean): Ajv; diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/index.js b/node_modules/ajv/dist/refs/json-schema-2020-12/index.js deleted file mode 100644 index d92567564..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const metaSchema = require("./schema.json"); -const applicator = require("./meta/applicator.json"); -const unevaluated = require("./meta/unevaluated.json"); -const content = require("./meta/content.json"); -const core = require("./meta/core.json"); -const format = require("./meta/format-annotation.json"); -const metadata = require("./meta/meta-data.json"); -const validation = require("./meta/validation.json"); -const META_SUPPORT_DATA = ["/properties"]; -function addMetaSchema2020($data) { - ; - [ - metaSchema, - applicator, - unevaluated, - content, - core, - with$data(this, format), - metadata, - with$data(this, validation), - ].forEach((sch) => this.addMetaSchema(sch, undefined, false)); - return this; - function with$data(ajv, sch) { - return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch; - } -} -exports.default = addMetaSchema2020; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map b/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map deleted file mode 100644 index eb90027dd..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/refs/json-schema-2020-12/index.ts"],"names":[],"mappings":";;AAEA,4CAA2C;AAC3C,qDAAoD;AACpD,uDAAsD;AACtD,+CAA8C;AAC9C,yCAAwC;AACxC,wDAAuD;AACvD,kDAAiD;AACjD,qDAAoD;AAEpD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,UAAU;QACV,WAAW;QACX,OAAO;QACP,IAAI;QACJ,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QACvB,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;KAC5B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;IAC7D,OAAO,IAAI,CAAA;IAEX,SAAS,SAAS,CAAC,GAAQ,EAAE,GAAoB;QAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAClE,CAAC;AACH,CAAC;AAhBD,oCAgBC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json deleted file mode 100644 index 674c913da..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/applicator", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/applicator": true - }, - "$dynamicAnchor": "meta", - - "title": "Applicator vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "prefixItems": {"$ref": "#/$defs/schemaArray"}, - "items": {"$dynamicRef": "#meta"}, - "contains": {"$dynamicRef": "#meta"}, - "additionalProperties": {"$dynamicRef": "#meta"}, - "properties": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "propertyNames": {"format": "regex"}, - "default": {} - }, - "dependentSchemas": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "default": {} - }, - "propertyNames": {"$dynamicRef": "#meta"}, - "if": {"$dynamicRef": "#meta"}, - "then": {"$dynamicRef": "#meta"}, - "else": {"$dynamicRef": "#meta"}, - "allOf": {"$ref": "#/$defs/schemaArray"}, - "anyOf": {"$ref": "#/$defs/schemaArray"}, - "oneOf": {"$ref": "#/$defs/schemaArray"}, - "not": {"$dynamicRef": "#meta"} - }, - "$defs": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$dynamicRef": "#meta"} - } - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json deleted file mode 100644 index 2ae23ddb5..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/content", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/content": true - }, - "$dynamicAnchor": "meta", - - "title": "Content vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "contentEncoding": {"type": "string"}, - "contentMediaType": {"type": "string"}, - "contentSchema": {"$dynamicRef": "#meta"} - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json deleted file mode 100644 index 4c8e5cb61..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/core", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/core": true - }, - "$dynamicAnchor": "meta", - - "title": "Core vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "$id": { - "$ref": "#/$defs/uriReferenceString", - "$comment": "Non-empty fragments not allowed.", - "pattern": "^[^#]*#?$" - }, - "$schema": {"$ref": "#/$defs/uriString"}, - "$ref": {"$ref": "#/$defs/uriReferenceString"}, - "$anchor": {"$ref": "#/$defs/anchorString"}, - "$dynamicRef": {"$ref": "#/$defs/uriReferenceString"}, - "$dynamicAnchor": {"$ref": "#/$defs/anchorString"}, - "$vocabulary": { - "type": "object", - "propertyNames": {"$ref": "#/$defs/uriString"}, - "additionalProperties": { - "type": "boolean" - } - }, - "$comment": { - "type": "string" - }, - "$defs": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"} - } - }, - "$defs": { - "anchorString": { - "type": "string", - "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" - }, - "uriString": { - "type": "string", - "format": "uri" - }, - "uriReferenceString": { - "type": "string", - "format": "uri-reference" - } - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json deleted file mode 100644 index 83c26e35f..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/format-annotation": true - }, - "$dynamicAnchor": "meta", - - "title": "Format vocabulary meta-schema for annotation results", - "type": ["object", "boolean"], - "properties": { - "format": {"type": "string"} - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json deleted file mode 100644 index 11946fb50..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/meta-data", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/meta-data": true - }, - "$dynamicAnchor": "meta", - - "title": "Meta-data vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "deprecated": { - "type": "boolean", - "default": false - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "writeOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - } - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json deleted file mode 100644 index 5e4b203b2..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/unevaluated": true - }, - "$dynamicAnchor": "meta", - - "title": "Unevaluated applicator vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "unevaluatedItems": {"$dynamicRef": "#meta"}, - "unevaluatedProperties": {"$dynamicRef": "#meta"} - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json deleted file mode 100644 index e0ae13d9d..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/validation", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/validation": true - }, - "$dynamicAnchor": "meta", - - "title": "Validation vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "type": { - "anyOf": [ - {"$ref": "#/$defs/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/$defs/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "const": true, - "enum": { - "type": "array", - "items": true - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, - "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, - "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, - "minContains": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 1 - }, - "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, - "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/$defs/stringArray"}, - "dependentRequired": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/stringArray" - } - } - }, - "$defs": { - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 0 - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json b/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json deleted file mode 100644 index 1c68270fd..000000000 --- a/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/schema", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/core": true, - "https://json-schema.org/draft/2020-12/vocab/applicator": true, - "https://json-schema.org/draft/2020-12/vocab/unevaluated": true, - "https://json-schema.org/draft/2020-12/vocab/validation": true, - "https://json-schema.org/draft/2020-12/vocab/meta-data": true, - "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, - "https://json-schema.org/draft/2020-12/vocab/content": true - }, - "$dynamicAnchor": "meta", - - "title": "Core and Validation specifications meta-schema", - "allOf": [ - {"$ref": "meta/core"}, - {"$ref": "meta/applicator"}, - {"$ref": "meta/unevaluated"}, - {"$ref": "meta/validation"}, - {"$ref": "meta/meta-data"}, - {"$ref": "meta/format-annotation"}, - {"$ref": "meta/content"} - ], - "type": ["object", "boolean"], - "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", - "properties": { - "definitions": { - "$comment": "\"definitions\" has been replaced by \"$defs\".", - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "deprecated": true, - "default": {} - }, - "dependencies": { - "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.", - "type": "object", - "additionalProperties": { - "anyOf": [{"$dynamicRef": "#meta"}, {"$ref": "meta/validation#/$defs/stringArray"}] - }, - "deprecated": true, - "default": {} - }, - "$recursiveAnchor": { - "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".", - "$ref": "meta/core#/$defs/anchorString", - "deprecated": true - }, - "$recursiveRef": { - "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".", - "$ref": "meta/core#/$defs/uriReferenceString", - "deprecated": true - } - } -} diff --git a/node_modules/ajv/dist/refs/json-schema-draft-06.json b/node_modules/ajv/dist/refs/json-schema-draft-06.json deleted file mode 100644 index 5410064ba..000000000 --- a/node_modules/ajv/dist/refs/json-schema-draft-06.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-06/schema#", - "$id": "http://json-schema.org/draft-06/schema#", - "title": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$ref": "#"} - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - }, - "type": ["object", "boolean"], - "properties": { - "$id": { - "type": "string", - "format": "uri-reference" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": {}, - "examples": { - "type": "array", - "items": {} - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, - "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": {"$ref": "#"}, - "items": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], - "default": {} - }, - "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, - "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "contains": {"$ref": "#"}, - "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, - "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/definitions/stringArray"}, - "additionalProperties": {"$ref": "#"}, - "definitions": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] - } - }, - "propertyNames": {"$ref": "#"}, - "const": {}, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - {"$ref": "#/definitions/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/definitions/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "format": {"type": "string"}, - "allOf": {"$ref": "#/definitions/schemaArray"}, - "anyOf": {"$ref": "#/definitions/schemaArray"}, - "oneOf": {"$ref": "#/definitions/schemaArray"}, - "not": {"$ref": "#"} - }, - "default": {} -} diff --git a/node_modules/ajv/dist/refs/json-schema-draft-07.json b/node_modules/ajv/dist/refs/json-schema-draft-07.json deleted file mode 100644 index 6a7485104..000000000 --- a/node_modules/ajv/dist/refs/json-schema-draft-07.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://json-schema.org/draft-07/schema#", - "title": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$ref": "#"} - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - }, - "type": ["object", "boolean"], - "properties": { - "$id": { - "type": "string", - "format": "uri-reference" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "readOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, - "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": {"$ref": "#"}, - "items": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], - "default": true - }, - "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, - "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "contains": {"$ref": "#"}, - "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, - "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/definitions/stringArray"}, - "additionalProperties": {"$ref": "#"}, - "definitions": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "propertyNames": {"format": "regex"}, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] - } - }, - "propertyNames": {"$ref": "#"}, - "const": true, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - {"$ref": "#/definitions/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/definitions/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "format": {"type": "string"}, - "contentMediaType": {"type": "string"}, - "contentEncoding": {"type": "string"}, - "if": {"$ref": "#"}, - "then": {"$ref": "#"}, - "else": {"$ref": "#"}, - "allOf": {"$ref": "#/definitions/schemaArray"}, - "anyOf": {"$ref": "#/definitions/schemaArray"}, - "oneOf": {"$ref": "#/definitions/schemaArray"}, - "not": {"$ref": "#"} - }, - "default": true -} diff --git a/node_modules/ajv/dist/refs/json-schema-secure.json b/node_modules/ajv/dist/refs/json-schema-secure.json deleted file mode 100644 index 3968abd5d..000000000 --- a/node_modules/ajv/dist/refs/json-schema-secure.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#", - "title": "Meta-schema for the security assessment of JSON Schemas", - "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$ref": "#"} - } - }, - "dependencies": { - "patternProperties": { - "description": "prevent slow validation of large property names", - "required": ["propertyNames"], - "properties": { - "propertyNames": { - "required": ["maxLength"] - } - } - }, - "uniqueItems": { - "description": "prevent slow validation of large non-scalar arrays", - "if": { - "properties": { - "uniqueItems": {"const": true}, - "items": { - "properties": { - "type": { - "anyOf": [ - { - "enum": ["object", "array"] - }, - { - "type": "array", - "contains": {"enum": ["object", "array"]} - } - ] - } - } - } - } - }, - "then": { - "required": ["maxItems"] - } - }, - "pattern": { - "description": "prevent slow pattern matching of large strings", - "required": ["maxLength"] - }, - "format": { - "description": "prevent slow format validation of large strings", - "required": ["maxLength"] - } - }, - "properties": { - "additionalItems": {"$ref": "#"}, - "additionalProperties": {"$ref": "#"}, - "dependencies": { - "additionalProperties": { - "anyOf": [{"type": "array"}, {"$ref": "#"}] - } - }, - "items": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}] - }, - "definitions": { - "additionalProperties": {"$ref": "#"} - }, - "patternProperties": { - "additionalProperties": {"$ref": "#"} - }, - "properties": { - "additionalProperties": {"$ref": "#"} - }, - "if": {"$ref": "#"}, - "then": {"$ref": "#"}, - "else": {"$ref": "#"}, - "allOf": {"$ref": "#/definitions/schemaArray"}, - "anyOf": {"$ref": "#/definitions/schemaArray"}, - "oneOf": {"$ref": "#/definitions/schemaArray"}, - "not": {"$ref": "#"}, - "contains": {"$ref": "#"}, - "propertyNames": {"$ref": "#"} - } -} diff --git a/node_modules/ajv/dist/refs/jtd-schema.d.ts b/node_modules/ajv/dist/refs/jtd-schema.d.ts deleted file mode 100644 index 932797a38..000000000 --- a/node_modules/ajv/dist/refs/jtd-schema.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SchemaObject } from "../types"; -declare const jtdMetaSchema: SchemaObject; -export default jtdMetaSchema; diff --git a/node_modules/ajv/dist/refs/jtd-schema.js b/node_modules/ajv/dist/refs/jtd-schema.js deleted file mode 100644 index 1ee940afb..000000000 --- a/node_modules/ajv/dist/refs/jtd-schema.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const shared = (root) => { - const sch = { - nullable: { type: "boolean" }, - metadata: { - optionalProperties: { - union: { elements: { ref: "schema" } }, - }, - additionalProperties: true, - }, - }; - if (root) - sch.definitions = { values: { ref: "schema" } }; - return sch; -}; -const emptyForm = (root) => ({ - optionalProperties: shared(root), -}); -const refForm = (root) => ({ - properties: { - ref: { type: "string" }, - }, - optionalProperties: shared(root), -}); -const typeForm = (root) => ({ - properties: { - type: { - enum: [ - "boolean", - "timestamp", - "string", - "float32", - "float64", - "int8", - "uint8", - "int16", - "uint16", - "int32", - "uint32", - ], - }, - }, - optionalProperties: shared(root), -}); -const enumForm = (root) => ({ - properties: { - enum: { elements: { type: "string" } }, - }, - optionalProperties: shared(root), -}); -const elementsForm = (root) => ({ - properties: { - elements: { ref: "schema" }, - }, - optionalProperties: shared(root), -}); -const propertiesForm = (root) => ({ - properties: { - properties: { values: { ref: "schema" } }, - }, - optionalProperties: { - optionalProperties: { values: { ref: "schema" } }, - additionalProperties: { type: "boolean" }, - ...shared(root), - }, -}); -const optionalPropertiesForm = (root) => ({ - properties: { - optionalProperties: { values: { ref: "schema" } }, - }, - optionalProperties: { - additionalProperties: { type: "boolean" }, - ...shared(root), - }, -}); -const discriminatorForm = (root) => ({ - properties: { - discriminator: { type: "string" }, - mapping: { - values: { - metadata: { - union: [propertiesForm(false), optionalPropertiesForm(false)], - }, - }, - }, - }, - optionalProperties: shared(root), -}); -const valuesForm = (root) => ({ - properties: { - values: { ref: "schema" }, - }, - optionalProperties: shared(root), -}); -const schema = (root) => ({ - metadata: { - union: [ - emptyForm, - refForm, - typeForm, - enumForm, - elementsForm, - propertiesForm, - optionalPropertiesForm, - discriminatorForm, - valuesForm, - ].map((s) => s(root)), - }, -}); -const jtdMetaSchema = { - definitions: { - schema: schema(false), - }, - ...schema(true), -}; -exports.default = jtdMetaSchema; -//# sourceMappingURL=jtd-schema.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/refs/jtd-schema.js.map b/node_modules/ajv/dist/refs/jtd-schema.js.map deleted file mode 100644 index d46755b21..000000000 --- a/node_modules/ajv/dist/refs/jtd-schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jtd-schema.js","sourceRoot":"","sources":["../../lib/refs/jtd-schema.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAe,CAAC,IAAI,EAAE,EAAE;IAClC,MAAM,GAAG,GAAiB;QACxB,QAAQ,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;QAC3B,QAAQ,EAAE;YACR,kBAAkB,EAAE;gBAClB,KAAK,EAAE,EAAC,QAAQ,EAAE,EAAC,GAAG,EAAE,QAAQ,EAAC,EAAC;aACnC;YACD,oBAAoB,EAAE,IAAI;SAC3B;KACF,CAAA;IACD,IAAI,IAAI;QAAE,GAAG,CAAC,WAAW,GAAG,EAAC,MAAM,EAAE,EAAC,GAAG,EAAE,QAAQ,EAAC,EAAC,CAAA;IACrD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,MAAM,SAAS,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACvC,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC;CACjC,CAAC,CAAA;AAEF,MAAM,OAAO,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACrC,UAAU,EAAE;QACV,GAAG,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;KACtB;IACD,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC;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ajv/dist/runtime/equal.d.ts b/node_modules/ajv/dist/runtime/equal.d.ts deleted file mode 100644 index 777cae20e..000000000 --- a/node_modules/ajv/dist/runtime/equal.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as equal from "fast-deep-equal"; -type Equal = typeof equal & { - code: string; -}; -declare const _default: Equal; -export default _default; diff --git a/node_modules/ajv/dist/runtime/equal.js b/node_modules/ajv/dist/runtime/equal.js deleted file mode 100644 index 774bba05a..000000000 --- a/node_modules/ajv/dist/runtime/equal.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// https://github.com/ajv-validator/ajv/issues/889 -const equal = require("fast-deep-equal"); -equal.code = 'require("ajv/dist/runtime/equal").default'; -exports.default = equal; -//# sourceMappingURL=equal.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/equal.js.map b/node_modules/ajv/dist/runtime/equal.js.map deleted file mode 100644 index 0e17901c3..000000000 --- a/node_modules/ajv/dist/runtime/equal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../lib/runtime/equal.ts"],"names":[],"mappings":";;AAAA,kDAAkD;AAClD,yCAAwC;AAGtC,KAAe,CAAC,IAAI,GAAG,2CAA2C,CAAA;AAEpE,kBAAe,KAAc,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/parseJson.d.ts b/node_modules/ajv/dist/runtime/parseJson.d.ts deleted file mode 100644 index 85f1d5670..000000000 --- a/node_modules/ajv/dist/runtime/parseJson.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export declare function parseJson(s: string, pos: number): unknown; -export declare namespace parseJson { - var message: string | undefined; - var position: number; - var code: string; -} -export declare function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined; -export declare namespace parseJsonNumber { - var message: string | undefined; - var position: number; - var code: string; -} -export declare function parseJsonString(s: string, pos: number): string | undefined; -export declare namespace parseJsonString { - var message: string | undefined; - var position: number; - var code: string; -} diff --git a/node_modules/ajv/dist/runtime/parseJson.js b/node_modules/ajv/dist/runtime/parseJson.js deleted file mode 100644 index 7ebbc1bfc..000000000 --- a/node_modules/ajv/dist/runtime/parseJson.js +++ /dev/null @@ -1,184 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.parseJsonString = exports.parseJsonNumber = exports.parseJson = void 0; -const rxParseJson = /position\s(\d+)$/; -function parseJson(s, pos) { - let endPos; - parseJson.message = undefined; - let matches; - if (pos) - s = s.slice(pos); - try { - parseJson.position = pos + s.length; - return JSON.parse(s); - } - catch (e) { - matches = rxParseJson.exec(e.message); - if (!matches) { - parseJson.message = "unexpected end"; - return undefined; - } - endPos = +matches[1]; - const c = s[endPos]; - s = s.slice(0, endPos); - parseJson.position = pos + endPos; - try { - return JSON.parse(s); - } - catch (e1) { - parseJson.message = `unexpected token ${c}`; - return undefined; - } - } -} -exports.parseJson = parseJson; -parseJson.message = undefined; -parseJson.position = 0; -parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson'; -function parseJsonNumber(s, pos, maxDigits) { - let numStr = ""; - let c; - parseJsonNumber.message = undefined; - if (s[pos] === "-") { - numStr += "-"; - pos++; - } - if (s[pos] === "0") { - numStr += "0"; - pos++; - } - else { - if (!parseDigits(maxDigits)) { - errorMessage(); - return undefined; - } - } - if (maxDigits) { - parseJsonNumber.position = pos; - return +numStr; - } - if (s[pos] === ".") { - numStr += "."; - pos++; - if (!parseDigits()) { - errorMessage(); - return undefined; - } - } - if (((c = s[pos]), c === "e" || c === "E")) { - numStr += "e"; - pos++; - if (((c = s[pos]), c === "+" || c === "-")) { - numStr += c; - pos++; - } - if (!parseDigits()) { - errorMessage(); - return undefined; - } - } - parseJsonNumber.position = pos; - return +numStr; - function parseDigits(maxLen) { - let digit = false; - while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) { - digit = true; - numStr += c; - pos++; - } - return digit; - } - function errorMessage() { - parseJsonNumber.position = pos; - parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end"; - } -} -exports.parseJsonNumber = parseJsonNumber; -parseJsonNumber.message = undefined; -parseJsonNumber.position = 0; -parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber'; -const escapedChars = { - b: "\b", - f: "\f", - n: "\n", - r: "\r", - t: "\t", - '"': '"', - "/": "/", - "\\": "\\", -}; -const CODE_A = "a".charCodeAt(0); -const CODE_0 = "0".charCodeAt(0); -function parseJsonString(s, pos) { - let str = ""; - let c; - parseJsonString.message = undefined; - // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition - while (true) { - c = s[pos++]; - if (c === '"') - break; - if (c === "\\") { - c = s[pos]; - if (c in escapedChars) { - str += escapedChars[c]; - pos++; - } - else if (c === "u") { - pos++; - let count = 4; - let code = 0; - while (count--) { - code <<= 4; - c = s[pos]; - if (c === undefined) { - errorMessage("unexpected end"); - return undefined; - } - c = c.toLowerCase(); - if (c >= "a" && c <= "f") { - code += c.charCodeAt(0) - CODE_A + 10; - } - else if (c >= "0" && c <= "9") { - code += c.charCodeAt(0) - CODE_0; - } - else { - errorMessage(`unexpected token ${c}`); - return undefined; - } - pos++; - } - str += String.fromCharCode(code); - } - else { - errorMessage(`unexpected token ${c}`); - return undefined; - } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - } - else if (c === undefined) { - errorMessage("unexpected end"); - return undefined; - } - else { - if (c.charCodeAt(0) >= 0x20) { - str += c; - } - else { - errorMessage(`unexpected token ${c}`); - return undefined; - } - } - } - parseJsonString.position = pos; - return str; - function errorMessage(msg) { - parseJsonString.position = pos; - parseJsonString.message = msg; - } -} -exports.parseJsonString = parseJsonString; -parseJsonString.message = undefined; -parseJsonString.position = 0; -parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString'; -//# sourceMappingURL=parseJson.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/parseJson.js.map b/node_modules/ajv/dist/runtime/parseJson.js.map deleted file mode 100644 index 7f239fb71..000000000 --- a/node_modules/ajv/dist/runtime/parseJson.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parseJson.js","sourceRoot":"","sources":["../../lib/runtime/parseJson.ts"],"names":[],"mappings":";;;AAAA,MAAM,WAAW,GAAG,kBAAkB,CAAA;AAEtC,SAAgB,SAAS,CAAC,CAAS,EAAE,GAAW;IAC9C,IAAI,MAA0B,CAAA;IAC9B,SAAS,CAAC,OAAO,GAAG,SAAS,CAAA;IAC7B,IAAI,OAA+B,CAAA;IACnC,IAAI,GAAG;QAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACzB,IAAI;QACF,SAAS,CAAC,QAAQ,GAAG,GAAG,GAAG,CAAC,CAAC,MAAM,CAAA;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;KACrB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,GAAG,WAAW,CAAC,IAAI,CAAE,CAAW,CAAC,OAAO,CAAC,CAAA;QAChD,IAAI,CAAC,OAAO,EAAE;YACZ,SAAS,CAAC,OAAO,GAAG,gBAAgB,CAAA;YACpC,OAAO,SAAS,CAAA;SACjB;QACD,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QACpB,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;QACnB,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;QACtB,SAAS,CAAC,QAAQ,GAAG,GAAG,GAAG,MAAM,CAAA;QACjC,IAAI;YACF,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;SACrB;QAAC,OAAO,EAAE,EAAE;YACX,SAAS,CAAC,OAAO,GAAG,oBAAoB,CAAC,EAAE,CAAA;YAC3C,OAAO,SAAS,CAAA;SACjB;KACF;AACH,CAAC;AAzBD,8BAyBC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AU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAA;qBACjC;yBAAM;wBACL,YAAY,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAA;wBACrC,OAAO,SAAS,CAAA;qBACjB;oBACD,GAAG,EAAE,CAAA;iBACN;gBACD,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;aACjC;iBAAM;gBACL,YAAY,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAA;gBACrC,OAAO,SAAS,CAAA;aACjB;YACD,uEAAuE;SACxE;aAAM,IAAI,CAAC,KAAK,SAAS,EAAE;YAC1B,YAAY,CAAC,gBAAgB,CAAC,CAAA;YAC9B,OAAO,SAAS,CAAA;SACjB;aAAM;YACL,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;gBAC3B,GAAG,IAAI,CAAC,CAAA;aACT;iBAAM;gBACL,YAAY,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAA;gBACrC,OAAO,SAAS,CAAA;aACjB;SACF;KACF;IACD,eAAe,CAAC,QAAQ,GAAG,GAAG,CAAA;IAC9B,OAAO,GAAG,CAAA;IAEV,SAAS,YAAY,CAAC,GAAW;QAC/B,eAAe,CAAC,QAAQ,GAAG,GAAG,CAAA;QAC9B,eAAe,CAAC,OAAO,GAAG,GAAG,CAAA;IAC/B,CAAC;AACH,CAAC;AA5DD,0CA4DC;AAED,eAAe,CAAC,OAAO,GAAG,SAA+B,CAAA;AACzD,eAAe,CAAC,QAAQ,GAAG,CAAW,CAAA;AACtC,eAAe,CAAC,IAAI,GAAG,uDAAuD,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/quote.d.ts b/node_modules/ajv/dist/runtime/quote.d.ts deleted file mode 100644 index 0579dd3c6..000000000 --- a/node_modules/ajv/dist/runtime/quote.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare function quote(s: string): string; -declare namespace quote { - var code: string; -} -export default quote; diff --git a/node_modules/ajv/dist/runtime/quote.js b/node_modules/ajv/dist/runtime/quote.js deleted file mode 100644 index ebf78f70d..000000000 --- a/node_modules/ajv/dist/runtime/quote.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const rxEscapable = -// eslint-disable-next-line no-control-regex, no-misleading-character-class -/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; -const escaped = { - "\b": "\\b", - "\t": "\\t", - "\n": "\\n", - "\f": "\\f", - "\r": "\\r", - '"': '\\"', - "\\": "\\\\", -}; -function quote(s) { - rxEscapable.lastIndex = 0; - return ('"' + - (rxEscapable.test(s) - ? s.replace(rxEscapable, (a) => { - const c = escaped[a]; - return typeof c === "string" - ? c - : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4); - }) - : s) + - '"'); -} -exports.default = quote; -quote.code = 'require("ajv/dist/runtime/quote").default'; -//# sourceMappingURL=quote.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/quote.js.map b/node_modules/ajv/dist/runtime/quote.js.map deleted file mode 100644 index 4d226252d..000000000 --- a/node_modules/ajv/dist/runtime/quote.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../lib/runtime/quote.ts"],"names":[],"mappings":";;AAAA,MAAM,WAAW;AACf,2EAA2E;AAC3E,iIAAiI,CAAA;AAEnI,MAAM,OAAO,GAA6B;IACxC,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAA;AAED,SAAwB,KAAK,CAAC,CAAS;IACrC,WAAW,CAAC,SAAS,GAAG,CAAC,CAAA;IACzB,OAAO,CACL,GAAG;QACH,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;gBAC3B,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;gBACpB,OAAO,OAAO,CAAC,KAAK,QAAQ;oBAC1B,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;YAC/D,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC,CAAC;QACN,GAAG,CACJ,CAAA;AACH,CAAC;AAdD,wBAcC;AAED,KAAK,CAAC,IAAI,GAAG,2CAA2C,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/re2.d.ts b/node_modules/ajv/dist/runtime/re2.d.ts deleted file mode 100644 index c34a98f2f..000000000 --- a/node_modules/ajv/dist/runtime/re2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as re2 from "re2"; -type Re2 = typeof re2 & { - code: string; -}; -declare const _default: Re2; -export default _default; diff --git a/node_modules/ajv/dist/runtime/re2.js b/node_modules/ajv/dist/runtime/re2.js deleted file mode 100644 index 4b1ee2537..000000000 --- a/node_modules/ajv/dist/runtime/re2.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const re2 = require("re2"); -re2.code = 'require("ajv/dist/runtime/re2").default'; -exports.default = re2; -//# sourceMappingURL=re2.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/re2.js.map b/node_modules/ajv/dist/runtime/re2.js.map deleted file mode 100644 index bb938a2c4..000000000 --- a/node_modules/ajv/dist/runtime/re2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"re2.js","sourceRoot":"","sources":["../../lib/runtime/re2.ts"],"names":[],"mappings":";;AAAA,2BAA0B;AAGxB,GAAW,CAAC,IAAI,GAAG,yCAAyC,CAAA;AAE9D,kBAAe,GAAU,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/timestamp.d.ts b/node_modules/ajv/dist/runtime/timestamp.d.ts deleted file mode 100644 index cd4832688..000000000 --- a/node_modules/ajv/dist/runtime/timestamp.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare function validTimestamp(str: string, allowDate: boolean): boolean; -declare namespace validTimestamp { - var code: string; -} -export default validTimestamp; diff --git a/node_modules/ajv/dist/runtime/timestamp.js b/node_modules/ajv/dist/runtime/timestamp.js deleted file mode 100644 index 5e0f06564..000000000 --- a/node_modules/ajv/dist/runtime/timestamp.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const DT_SEPARATOR = /t|\s/i; -const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; -const TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i; -const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; -function validTimestamp(str, allowDate) { - // http://tools.ietf.org/html/rfc3339#section-5.6 - const dt = str.split(DT_SEPARATOR); - return ((dt.length === 2 && validDate(dt[0]) && validTime(dt[1])) || - (allowDate && dt.length === 1 && validDate(dt[0]))); -} -exports.default = validTimestamp; -function validDate(str) { - const matches = DATE.exec(str); - if (!matches) - return false; - const y = +matches[1]; - const m = +matches[2]; - const d = +matches[3]; - return (m >= 1 && - m <= 12 && - d >= 1 && - (d <= DAYS[m] || - // leap year: https://tools.ietf.org/html/rfc3339#appendix-C - (m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0)))); -} -function validTime(str) { - const matches = TIME.exec(str); - if (!matches) - return false; - const hr = +matches[1]; - const min = +matches[2]; - const sec = +matches[3]; - const tzH = +(matches[4] || 0); - const tzM = +(matches[5] || 0); - return ((hr <= 23 && min <= 59 && sec <= 59) || - // leap second - (hr - tzH === 23 && min - tzM === 59 && sec === 60)); -} -validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default'; -//# sourceMappingURL=timestamp.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/timestamp.js.map b/node_modules/ajv/dist/runtime/timestamp.js.map deleted file mode 100644 index 6b0eee039..000000000 --- a/node_modules/ajv/dist/runtime/timestamp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../lib/runtime/timestamp.ts"],"names":[],"mappings":";;AAAA,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,IAAI,GAAG,4BAA4B,CAAA;AACzC,MAAM,IAAI,GAAG,gEAAgE,CAAA;AAC7E,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;AAEhE,SAAwB,cAAc,CAAC,GAAW,EAAE,SAAkB;IACpE,iDAAiD;IACjD,MAAM,EAAE,GAAa,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IAC5C,OAAO,CACL,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACzD,CAAC,SAAS,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CACnD,CAAA;AACH,CAAC;AAPD,iCAOC;AAED,SAAS,SAAS,CAAC,GAAW;IAC5B,MAAM,OAAO,GAAoB,IAAI,CAAC,I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AC;QACpC,cAAc;QACd,CAAC,EAAE,GAAG,GAAG,KAAK,EAAE,IAAI,GAAG,GAAG,GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,CAAC,CACpD,CAAA;AACH,CAAC;AAED,cAAc,CAAC,IAAI,GAAG,+CAA+C,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/ucs2length.d.ts b/node_modules/ajv/dist/runtime/ucs2length.d.ts deleted file mode 100644 index ecbee69c5..000000000 --- a/node_modules/ajv/dist/runtime/ucs2length.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare function ucs2length(str: string): number; -declare namespace ucs2length { - var code: string; -} -export default ucs2length; diff --git a/node_modules/ajv/dist/runtime/ucs2length.js b/node_modules/ajv/dist/runtime/ucs2length.js deleted file mode 100644 index 92ea0c08a..000000000 --- a/node_modules/ajv/dist/runtime/ucs2length.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// https://mathiasbynens.be/notes/javascript-encoding -// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode -function ucs2length(str) { - const len = str.length; - let length = 0; - let pos = 0; - let value; - while (pos < len) { - length++; - value = str.charCodeAt(pos++); - if (value >= 0xd800 && value <= 0xdbff && pos < len) { - // high surrogate, and there is a next character - value = str.charCodeAt(pos); - if ((value & 0xfc00) === 0xdc00) - pos++; // low surrogate - } - } - return length; -} -exports.default = ucs2length; -ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'; -//# sourceMappingURL=ucs2length.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/ucs2length.js.map b/node_modules/ajv/dist/runtime/ucs2length.js.map deleted file mode 100644 index 7c7f78865..000000000 --- a/node_modules/ajv/dist/runtime/ucs2length.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ucs2length.js","sourceRoot":"","sources":["../../lib/runtime/ucs2length.ts"],"names":[],"mappings":";;AAAA,qDAAqD;AACrD,iEAAiE;AACjE,SAAwB,UAAU,CAAC,GAAW;IAC5C,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAA;IACtB,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,IAAI,GAAG,GAAG,CAAC,CAAA;IACX,IAAI,KAAa,CAAA;IACjB,OAAO,GAAG,GAAG,GAAG,EAAE;QAChB,MAAM,EAAE,CAAA;QACR,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAA;QAC7B,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,IAAI,GAAG,GAAG,GAAG,EAAE;YACnD,gDAAgD;YAChD,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;YAC3B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,MAAM;gBAAE,GAAG,EAAE,CAAA,CAAC,gBAAgB;SACxD;KACF;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAfD,6BAeC;AAED,UAAU,CAAC,IAAI,GAAG,gDAAgD,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/uri.d.ts b/node_modules/ajv/dist/runtime/uri.d.ts deleted file mode 100644 index 4690868fa..000000000 --- a/node_modules/ajv/dist/runtime/uri.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as uri from "uri-js"; -type URI = typeof uri & { - code: string; -}; -declare const _default: URI; -export default _default; diff --git a/node_modules/ajv/dist/runtime/uri.js b/node_modules/ajv/dist/runtime/uri.js deleted file mode 100644 index fbd38151f..000000000 --- a/node_modules/ajv/dist/runtime/uri.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const uri = require("uri-js"); -uri.code = 'require("ajv/dist/runtime/uri").default'; -exports.default = uri; -//# sourceMappingURL=uri.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/uri.js.map b/node_modules/ajv/dist/runtime/uri.js.map deleted file mode 100644 index 701bed950..000000000 --- a/node_modules/ajv/dist/runtime/uri.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../lib/runtime/uri.ts"],"names":[],"mappings":";;AAAA,8BAA6B;AAG3B,GAAW,CAAC,IAAI,GAAG,yCAAyC,CAAA;AAE9D,kBAAe,GAAU,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/validation_error.d.ts b/node_modules/ajv/dist/runtime/validation_error.d.ts deleted file mode 100644 index b0ee9698f..000000000 --- a/node_modules/ajv/dist/runtime/validation_error.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ErrorObject } from "../types"; -export default class ValidationError extends Error { - readonly errors: Partial[]; - readonly ajv: true; - readonly validation: true; - constructor(errors: Partial[]); -} diff --git a/node_modules/ajv/dist/runtime/validation_error.js b/node_modules/ajv/dist/runtime/validation_error.js deleted file mode 100644 index 353502c08..000000000 --- a/node_modules/ajv/dist/runtime/validation_error.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -class ValidationError extends Error { - constructor(errors) { - super("validation failed"); - this.errors = errors; - this.ajv = this.validation = true; - } -} -exports.default = ValidationError; -//# sourceMappingURL=validation_error.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/runtime/validation_error.js.map b/node_modules/ajv/dist/runtime/validation_error.js.map deleted file mode 100644 index 70206fbc1..000000000 --- a/node_modules/ajv/dist/runtime/validation_error.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validation_error.js","sourceRoot":"","sources":["../../lib/runtime/validation_error.ts"],"names":[],"mappings":";;AAEA,MAAqB,eAAgB,SAAQ,KAAK;IAKhD,YAAY,MAA8B;QACxC,KAAK,CAAC,mBAAmB,CAAC,CAAA;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;IACnC,CAAC;CACF;AAVD,kCAUC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/standalone/index.d.ts b/node_modules/ajv/dist/standalone/index.d.ts deleted file mode 100644 index a9141c3d2..000000000 --- a/node_modules/ajv/dist/standalone/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type AjvCore from "../core"; -import type { AnyValidateFunction } from "../types"; -declare function standaloneCode(ajv: AjvCore, refsOrFunc?: { - [K in string]?: string; -} | AnyValidateFunction): string; -export default standaloneCode; diff --git a/node_modules/ajv/dist/standalone/index.js b/node_modules/ajv/dist/standalone/index.js deleted file mode 100644 index b44bb5db5..000000000 --- a/node_modules/ajv/dist/standalone/index.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const scope_1 = require("../compile/codegen/scope"); -const code_1 = require("../compile/codegen/code"); -function standaloneCode(ajv, refsOrFunc) { - if (!ajv.opts.code.source) { - throw new Error("moduleCode: ajv instance must have code.source option"); - } - const { _n } = ajv.scope.opts; - return typeof refsOrFunc == "function" - ? funcExportCode(refsOrFunc.source) - : refsOrFunc !== undefined - ? multiExportsCode(refsOrFunc, getValidate) - : multiExportsCode(ajv.schemas, (sch) => sch.meta ? undefined : ajv.compile(sch.schema)); - function getValidate(id) { - const v = ajv.getSchema(id); - if (!v) - throw new Error(`moduleCode: no schema with id ${id}`); - return v; - } - function funcExportCode(source) { - const usedValues = {}; - const n = source === null || source === void 0 ? void 0 : source.validateName; - const vCode = validateCode(usedValues, source); - if (ajv.opts.code.esm) { - // Always do named export as `validate` rather than the variable `n` which is `validateXX` for known export value - return `"use strict";${_n}export const validate = ${n};${_n}export default ${n};${_n}${vCode}`; - } - return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}`; - } - function multiExportsCode(schemas, getValidateFunc) { - var _a; - const usedValues = {}; - let code = (0, code_1._) `"use strict";`; - for (const name in schemas) { - const v = getValidateFunc(schemas[name]); - if (v) { - const vCode = validateCode(usedValues, v.source); - const exportSyntax = ajv.opts.code.esm - ? (0, code_1._) `export const ${(0, code_1.getEsmExportName)(name)}` - : (0, code_1._) `exports${(0, code_1.getProperty)(name)}`; - code = (0, code_1._) `${code}${_n}${exportSyntax} = ${(_a = v.source) === null || _a === void 0 ? void 0 : _a.validateName};${_n}${vCode}`; - } - } - return `${code}`; - } - function validateCode(usedValues, s) { - if (!s) - throw new Error('moduleCode: function does not have "source" property'); - if (usedState(s.validateName) === scope_1.UsedValueState.Completed) - return code_1.nil; - setUsedState(s.validateName, scope_1.UsedValueState.Started); - const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode); - const code = new code_1._Code(`${scopeCode}${_n}${s.validateCode}`); - return s.evaluated ? (0, code_1._) `${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code; - function refValidateCode(n) { - var _a; - const vRef = (_a = n.value) === null || _a === void 0 ? void 0 : _a.ref; - if (n.prefix === "validate" && typeof vRef == "function") { - const v = vRef; - return validateCode(usedValues, v.source); - } - else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") { - const { validate, validateName } = vRef; - if (!validateName) - throw new Error("ajv internal error"); - const def = ajv.opts.code.es5 ? scope_1.varKinds.var : scope_1.varKinds.const; - const wrapper = (0, code_1._) `${def} ${n} = {validate: ${validateName}};`; - if (usedState(validateName) === scope_1.UsedValueState.Started) - return wrapper; - const vCode = validateCode(usedValues, validate === null || validate === void 0 ? void 0 : validate.source); - return (0, code_1._) `${wrapper}${_n}${vCode}`; - } - return undefined; - } - function usedState(name) { - var _a; - return (_a = usedValues[name.prefix]) === null || _a === void 0 ? void 0 : _a.get(name); - } - function setUsedState(name, state) { - const { prefix } = name; - const names = (usedValues[prefix] = usedValues[prefix] || new Map()); - names.set(name, state); - } - } -} -module.exports = exports = standaloneCode; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = standaloneCode; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/standalone/index.js.map b/node_modules/ajv/dist/standalone/index.js.map deleted file mode 100644 index 11864d36e..000000000 --- a/node_modules/ajv/dist/standalone/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/standalone/index.ts"],"names":[],"mappings":";;AAGA,oDAAkG;AAClG,kDAA0F;AAE1F,SAAS,cAAc,CACrB,GAAY,EACZ,UAA2D;IAE3D,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;KACzE;IACD,MAAM,EAAC,EAAE,EAAC,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAA;IAC3B,OAAO,OAAO,UAAU,IAAI,UAAU;QACpC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC;QACnC,CAAC,CAAC,UAAU,KAAK,SAAS;YAC1B,CAAC,CAAC,gBAAgB,CAAS,UAAU,EAAE,WAAW,CAAC;YACnD,CAAC,CAAC,gBAAgB,CAAY,GAAG,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAC/C,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAC/C,CAAA;IAEL,SAAS,WAAW,CAAC,EAAU;QAC7B,MAAM,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAC3B,IAAI,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,EAAE,EAAE,CAAC,CAAA;QAC9D,OAAO,CAAC,CAAA;IACV,CAAC;IAED,SAAS,cAAc,CAAC,MAAmB;QACzC,MAAM,UAAU,GAAoB,EAAE,CAAA;QACtC,MAAM,CAAC,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAA;QAC9B,MAAM,KAAK,GA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,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAQ,CAAC,KAAK,CAAA;gBAC7D,MAAM,OAAO,GAAG,IAAA,QAAC,EAAA,GAAG,GAAG,IAAI,CAAC,iBAAiB,YAAY,IAAI,CAAA;gBAC7D,IAAI,SAAS,CAAC,YAAY,CAAC,KAAK,sBAAc,CAAC,OAAO;oBAAE,OAAO,OAAO,CAAA;gBACtE,MAAM,KAAK,GAAG,YAAY,CAAC,UAAU,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,CAAA;gBACxD,OAAO,IAAA,QAAC,EAAA,GAAG,OAAO,GAAG,EAAE,GAAG,KAAK,EAAE,CAAA;aAClC;YACD,OAAO,SAAS,CAAA;QAClB,CAAC;QAED,SAAS,SAAS,CAAC,IAAoB;;YACrC,OAAO,MAAA,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,0CAAE,GAAG,CAAC,IAAI,CAAC,CAAA;QAC3C,CAAC;QAED,SAAS,YAAY,CAAC,IAAoB,EAAE,KAAqB;YAC/D,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAA;YACrB,MAAM,KAAK,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC,CAAA;YACpE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,cAAc,CAAA;AACzC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,cAAc,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/standalone/instance.d.ts b/node_modules/ajv/dist/standalone/instance.d.ts deleted file mode 100644 index 156ac3226..000000000 --- a/node_modules/ajv/dist/standalone/instance.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Ajv, { AnySchema, AnyValidateFunction, ErrorObject } from "../core"; -export default class AjvPack { - readonly ajv: Ajv; - errors?: ErrorObject[] | null; - constructor(ajv: Ajv); - validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise; - compile(schema: AnySchema, meta?: boolean): AnyValidateFunction; - getSchema(keyRef: string): AnyValidateFunction | undefined; - private getStandalone; - addSchema(...args: Parameters): AjvPack; - addKeyword(...args: Parameters): AjvPack; -} diff --git a/node_modules/ajv/dist/standalone/instance.js b/node_modules/ajv/dist/standalone/instance.js deleted file mode 100644 index 35e5c9925..000000000 --- a/node_modules/ajv/dist/standalone/instance.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const core_1 = require("../core"); -const _1 = require("."); -const requireFromString = require("require-from-string"); -class AjvPack { - constructor(ajv) { - this.ajv = ajv; - } - validate(schemaKeyRef, data) { - return core_1.default.prototype.validate.call(this, schemaKeyRef, data); - } - compile(schema, meta) { - return this.getStandalone(this.ajv.compile(schema, meta)); - } - getSchema(keyRef) { - const v = this.ajv.getSchema(keyRef); - if (!v) - return undefined; - return this.getStandalone(v); - } - getStandalone(v) { - return requireFromString((0, _1.default)(this.ajv, v)); - } - addSchema(...args) { - this.ajv.addSchema.call(this.ajv, ...args); - return this; - } - addKeyword(...args) { - this.ajv.addKeyword.call(this.ajv, ...args); - return this; - } -} -exports.default = AjvPack; -//# sourceMappingURL=instance.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/standalone/instance.js.map b/node_modules/ajv/dist/standalone/instance.js.map deleted file mode 100644 index 6ac33b114..000000000 --- a/node_modules/ajv/dist/standalone/instance.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../lib/standalone/instance.ts"],"names":[],"mappings":";;AAAA,kCAAwE;AACxE,wBAA8B;AAC9B,yDAAwD;AAExD,MAAqB,OAAO;IAE1B,YAAqB,GAAQ;QAAR,QAAG,GAAH,GAAG,CAAK;IAAG,CAAC;IAEjC,QAAQ,CAAC,YAAgC,EAAE,IAAa;QACtD,OAAO,cAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;IAC9D,CAAC;IAED,OAAO,CAAc,MAAiB,EAAE,IAAc;QACpD,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAI,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;IAC9D,CAAC;IAED,SAAS,CAAc,MAAc;QACnC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAI,MAAM,CAAC,CAAA;QACvC,IAAI,CAAC,CAAC;YAAE,OAAO,SAAS,CAAA;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;IAC9B,CAAC;IAEO,aAAa,CAAc,CAAyB;QAC1D,OAAO,iBAAiB,CAAC,IAAA,UAAc,EAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAA2B,CAAA;IACjF,CAAC;IAED,SAAS,CAAC,GAAG,IAAgD;QAC3D,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;QAC1C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,UAAU,CAAC,GAAG,IAAiD;QAC7D,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;QAC3C,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AA/BD,0BA+BC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/types/index.d.ts b/node_modules/ajv/dist/types/index.d.ts deleted file mode 100644 index 485440e9b..000000000 --- a/node_modules/ajv/dist/types/index.d.ts +++ /dev/null @@ -1,183 +0,0 @@ -import * as URI from "uri-js"; -import type { CodeGen, Code, Name, ScopeValueSets, ValueScopeName } from "../compile/codegen"; -import type { SchemaEnv, SchemaCxt, SchemaObjCxt } from "../compile"; -import type { JSONType } from "../compile/rules"; -import type { KeywordCxt } from "../compile/validate"; -import type Ajv from "../core"; -interface _SchemaObject { - id?: string; - $id?: string; - $schema?: string; - [x: string]: any; -} -export interface SchemaObject extends _SchemaObject { - id?: string; - $id?: string; - $schema?: string; - $async?: false; - [x: string]: any; -} -export interface AsyncSchema extends _SchemaObject { - $async: true; -} -export type AnySchemaObject = SchemaObject | AsyncSchema; -export type Schema = SchemaObject | boolean; -export type AnySchema = Schema | AsyncSchema; -export type SchemaMap = { - [Key in string]?: AnySchema; -}; -export interface SourceCode { - validateName: ValueScopeName; - validateCode: string; - scopeValues: ScopeValueSets; - evaluated?: Code; -} -export interface DataValidationCxt { - instancePath: string; - parentData: { - [K in T]: any; - }; - parentDataProperty: T; - rootData: Record | any[]; - dynamicAnchors: { - [Ref in string]?: ValidateFunction; - }; -} -export interface ValidateFunction { - (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T; - errors?: null | ErrorObject[]; - evaluated?: Evaluated; - schema: AnySchema; - schemaEnv: SchemaEnv; - source?: SourceCode; -} -export interface JTDParser { - (json: string): T | undefined; - message?: string; - position?: number; -} -export type EvaluatedProperties = { - [K in string]?: true; -} | true; -export type EvaluatedItems = number | true; -export interface Evaluated { - props?: EvaluatedProperties; - items?: EvaluatedItems; - dynamicProps: boolean; - dynamicItems: boolean; -} -export interface AsyncValidateFunction extends ValidateFunction { - (...args: Parameters>): Promise; - $async: true; -} -export type AnyValidateFunction = ValidateFunction | AsyncValidateFunction; -export interface ErrorObject, S = unknown> { - keyword: K; - instancePath: string; - schemaPath: string; - params: P; - propertyName?: string; - message?: string; - schema?: S; - parentSchema?: AnySchemaObject; - data?: unknown; -} -export type ErrorNoParams = ErrorObject, S>; -interface _KeywordDef { - keyword: string | string[]; - type?: JSONType | JSONType[]; - schemaType?: JSONType | JSONType[]; - allowUndefined?: boolean; - $data?: boolean; - implements?: string[]; - before?: string; - post?: boolean; - metaSchema?: AnySchemaObject; - validateSchema?: AnyValidateFunction; - dependencies?: string[]; - error?: KeywordErrorDefinition; - $dataError?: KeywordErrorDefinition; -} -export interface CodeKeywordDefinition extends _KeywordDef { - code: (cxt: KeywordCxt, ruleType?: string) => void; - trackErrors?: boolean; -} -export type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema; -export type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction; -export interface DataValidateFunction { - (...args: Parameters): boolean | Promise; - errors?: Partial[]; -} -export interface SchemaValidateFunction { - (schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): boolean | Promise; - errors?: Partial[]; -} -export interface FuncKeywordDefinition extends _KeywordDef { - validate?: SchemaValidateFunction | DataValidateFunction; - compile?: CompileKeywordFunc; - schema?: boolean; - modifying?: boolean; - async?: boolean; - valid?: boolean; - errors?: boolean | "full"; -} -export interface MacroKeywordDefinition extends FuncKeywordDefinition { - macro: MacroKeywordFunc; -} -export type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition; -export type AddedKeywordDefinition = KeywordDefinition & { - type: JSONType[]; - schemaType: JSONType[]; -}; -export interface KeywordErrorDefinition { - message: string | Code | ((cxt: KeywordErrorCxt) => string | Code); - params?: Code | ((cxt: KeywordErrorCxt) => Code); -} -export type Vocabulary = (KeywordDefinition | string)[]; -export interface KeywordErrorCxt { - gen: CodeGen; - keyword: string; - data: Name; - $data?: string | false; - schema: any; - parentSchema?: AnySchemaObject; - schemaCode: Code | number | boolean; - schemaValue: Code | number | boolean; - schemaType?: JSONType[]; - errsCount?: Name; - params: KeywordCxtParams; - it: SchemaCxt; -} -export type KeywordCxtParams = { - [P in string]?: Code | string | number; -}; -export type FormatValidator = (data: T) => boolean; -export type FormatCompare = (data1: T, data2: T) => number | undefined; -export type AsyncFormatValidator = (data: T) => Promise; -export interface FormatDefinition { - type?: T extends string ? "string" | undefined : "number"; - validate: FormatValidator | (T extends string ? string | RegExp : never); - async?: false | undefined; - compare?: FormatCompare; -} -export interface AsyncFormatDefinition { - type?: T extends string ? "string" | undefined : "number"; - validate: AsyncFormatValidator; - async: true; - compare?: FormatCompare; -} -export type AddedFormat = true | RegExp | FormatValidator | FormatDefinition | FormatDefinition | AsyncFormatDefinition | AsyncFormatDefinition; -export type Format = AddedFormat | string; -export interface RegExpEngine { - (pattern: string, u: string): RegExpLike; - code: string; -} -export interface RegExpLike { - test: (s: string) => boolean; -} -export interface UriResolver { - parse(uri: string): URI.URIComponents; - resolve(base: string, path: string): string; - serialize(component: URI.URIComponents): string; -} -export {}; diff --git a/node_modules/ajv/dist/types/index.js b/node_modules/ajv/dist/types/index.js deleted file mode 100644 index aa219d8f2..000000000 --- a/node_modules/ajv/dist/types/index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/types/index.js.map b/node_modules/ajv/dist/types/index.js.map deleted file mode 100644 index 1f80f85ec..000000000 --- a/node_modules/ajv/dist/types/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/ajv/dist/types/json-schema.d.ts b/node_modules/ajv/dist/types/json-schema.d.ts deleted file mode 100644 index 4774233fc..000000000 --- a/node_modules/ajv/dist/types/json-schema.d.ts +++ /dev/null @@ -1,125 +0,0 @@ -type StrictNullChecksWrapper = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type; -type UnionToIntersection = (U extends any ? (_: U) => void : never) extends (_: infer I) => void ? I : never; -export type SomeJSONSchema = UncheckedJSONSchemaType; -type UncheckedPartialSchema = Partial>; -export type PartialSchema = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema>; -type JSONType = IsPartial extends true ? T | undefined : T; -interface NumberKeywords { - minimum?: number; - maximum?: number; - exclusiveMinimum?: number; - exclusiveMaximum?: number; - multipleOf?: number; - format?: string; -} -interface StringKeywords { - minLength?: number; - maxLength?: number; - pattern?: string; - format?: string; -} -type UncheckedJSONSchemaType = (// these two unions allow arbitrary unions of types -{ - anyOf: readonly UncheckedJSONSchemaType[]; -} | { - oneOf: readonly UncheckedJSONSchemaType[]; -} | ({ - type: readonly (T extends number ? JSONType<"number" | "integer", IsPartial> : T extends string ? JSONType<"string", IsPartial> : T extends boolean ? JSONType<"boolean", IsPartial> : never)[]; -} & UnionToIntersection) | ((T extends number ? { - type: JSONType<"number" | "integer", IsPartial>; -} & NumberKeywords : T extends string ? { - type: JSONType<"string", IsPartial>; -} & StringKeywords : T extends boolean ? { - type: JSONType<"boolean", IsPartial>; -} : T extends readonly [any, ...any[]] ? { - type: JSONType<"array", IsPartial>; - items: { - readonly [K in keyof T]-?: UncheckedJSONSchemaType & Nullable; - } & { - length: T["length"]; - }; - minItems: T["length"]; -} & ({ - maxItems: T["length"]; -} | { - additionalItems: false; -}) : T extends readonly any[] ? { - type: JSONType<"array", IsPartial>; - items: UncheckedJSONSchemaType; - contains?: UncheckedPartialSchema; - minItems?: number; - maxItems?: number; - minContains?: number; - maxContains?: number; - uniqueItems?: true; - additionalItems?: never; -} : T extends Record ? { - type: JSONType<"object", IsPartial>; - additionalProperties?: boolean | UncheckedJSONSchemaType; - unevaluatedProperties?: boolean | UncheckedJSONSchemaType; - properties?: IsPartial extends true ? Partial> : UncheckedPropertiesSchema; - patternProperties?: Record>; - propertyNames?: Omit, "type"> & { - type?: "string"; - }; - dependencies?: { - [K in keyof T]?: Readonly<(keyof T)[]> | UncheckedPartialSchema; - }; - dependentRequired?: { - [K in keyof T]?: Readonly<(keyof T)[]>; - }; - dependentSchemas?: { - [K in keyof T]?: UncheckedPartialSchema; - }; - minProperties?: number; - maxProperties?: number; -} & (IsPartial extends true ? { - required: Readonly<(keyof T)[]>; -} : [UncheckedRequiredMembers] extends [never] ? { - required?: Readonly[]>; -} : { - required: Readonly[]>; -}) : T extends null ? { - type: JSONType<"null", IsPartial>; - nullable: true; -} : never) & { - allOf?: Readonly[]>; - anyOf?: Readonly[]>; - oneOf?: Readonly[]>; - if?: UncheckedPartialSchema; - then?: UncheckedPartialSchema; - else?: UncheckedPartialSchema; - not?: UncheckedPartialSchema; -})) & { - [keyword: string]: any; - $id?: string; - $ref?: string; - $defs?: Record>; - definitions?: Record>; -}; -export type JSONSchemaType = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType>; -type Known = { - [key: string]: Known; -} | [Known, ...Known[]] | Known[] | number | string | boolean | null; -type UncheckedPropertiesSchema = { - [K in keyof T]-?: (UncheckedJSONSchemaType & Nullable) | { - $ref: string; - }; -}; -export type PropertiesSchema = StrictNullChecksWrapper<"PropertiesSchema", UncheckedPropertiesSchema>; -type UncheckedRequiredMembers = { - [K in keyof T]-?: undefined extends T[K] ? never : K; -}[keyof T]; -export type RequiredMembers = StrictNullChecksWrapper<"RequiredMembers", UncheckedRequiredMembers>; -type Nullable = undefined extends T ? { - nullable: true; - const?: null; - enum?: Readonly<(T | null)[]>; - default?: T | null; -} : { - nullable?: false; - const?: T; - enum?: Readonly; - default?: T; -}; -export {}; diff --git a/node_modules/ajv/dist/types/json-schema.js b/node_modules/ajv/dist/types/json-schema.js deleted file mode 100644 index 2d8f98dc5..000000000 --- a/node_modules/ajv/dist/types/json-schema.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=json-schema.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/types/json-schema.js.map b/node_modules/ajv/dist/types/json-schema.js.map deleted file mode 100644 index ae6b4d0fe..000000000 --- a/node_modules/ajv/dist/types/json-schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-schema.js","sourceRoot":"","sources":["../../lib/types/json-schema.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/ajv/dist/types/jtd-schema.d.ts b/node_modules/ajv/dist/types/jtd-schema.d.ts deleted file mode 100644 index 80ad3129a..000000000 --- a/node_modules/ajv/dist/types/jtd-schema.d.ts +++ /dev/null @@ -1,174 +0,0 @@ -/** numeric strings */ -type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"; -/** string strings */ -type StringType = "string" | "timestamp"; -/** Generic JTD Schema without inference of the represented type */ -export type SomeJTDSchemaType = (// ref -{ - ref: string; -} | { - type: NumberType | StringType | "boolean"; -} | { - enum: string[]; -} | { - elements: SomeJTDSchemaType; -} | { - values: SomeJTDSchemaType; -} | { - properties: Record; - optionalProperties?: Record; - additionalProperties?: boolean; -} | { - properties?: Record; - optionalProperties: Record; - additionalProperties?: boolean; -} | { - discriminator: string; - mapping: Record; -} | {}) & { - nullable?: boolean; - metadata?: Record; - definitions?: Record; -}; -/** required keys of an object, not undefined */ -type RequiredKeys = { - [K in keyof T]-?: undefined extends T[K] ? never : K; -}[keyof T]; -/** optional or undifined-able keys of an object */ -type OptionalKeys = { - [K in keyof T]-?: undefined extends T[K] ? K : never; -}[keyof T]; -/** type is true if T is a union type */ -type IsUnion_ = false extends (T extends unknown ? ([U] extends [T] ? false : true) : never) ? false : true; -type IsUnion = IsUnion_; -/** type is true if T is identically E */ -type TypeEquality = [T] extends [E] ? ([E] extends [T] ? true : false) : false; -/** type is true if T or null is identically E or null*/ -type NullTypeEquality = TypeEquality; -/** gets only the string literals of a type or null if a type isn't a string literal */ -type EnumString = [T] extends [never] ? null : T extends string ? string extends T ? null : T : null; -/** true if type is a union of string literals */ -type IsEnum = null extends EnumString ? false : true; -/** true only if all types are array types (not tuples) */ -type IsElements = false extends IsUnion ? [T] extends [readonly unknown[]] ? undefined extends T[0.5] ? false : true : false : false; -/** true if the the type is a values type */ -type IsValues = false extends IsUnion ? TypeEquality : false; -/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */ -type IsRecord = Union extends IsUnion ? null extends EnumString ? false : true : false; -/** true if type represents an empty record */ -type IsEmptyRecord = [T] extends [Record] ? [T] extends [never] ? false : true : false; -/** actual schema */ -export type JTDSchemaType = Record> = (// refs - where null wasn't specified, must match exactly -(null extends EnumString ? never : ({ - [K in keyof D]: [T] extends [D[K]] ? { - ref: K; - } : never; -}[keyof D] & { - nullable?: false; -}) | (null extends T ? { - [K in keyof D]: [Exclude] extends [Exclude] ? { - ref: K; - } : never; -}[keyof D] & { - nullable: true; -} : never)) | (unknown extends T ? { - nullable?: boolean; -} : never) | ((true extends NullTypeEquality ? { - type: NumberType; -} : true extends NullTypeEquality ? { - type: "boolean"; -} : true extends NullTypeEquality ? { - type: StringType; -} : true extends NullTypeEquality ? { - type: "timestamp"; -} : true extends IsEnum> ? { - enum: EnumString>[]; -} : true extends IsElements> ? T extends readonly (infer E)[] ? { - elements: JTDSchemaType; -} : never : true extends IsEmptyRecord> ? { - properties: Record; - optionalProperties?: Record; -} | { - optionalProperties: Record; -} : true extends IsValues> ? T extends Record ? { - values: JTDSchemaType; -} : never : true extends IsRecord, false> ? ([RequiredKeys>] extends [never] ? { - properties?: Record; -} : { - properties: { - [K in RequiredKeys]: JTDSchemaType; - }; -}) & ([OptionalKeys>] extends [never] ? { - optionalProperties?: Record; -} : { - optionalProperties: { - [K in OptionalKeys]: JTDSchemaType, D>; - }; -}) & { - additionalProperties?: boolean; -} : true extends IsRecord, true> ? { - [K in keyof Exclude]-?: Exclude[K] extends string ? { - discriminator: K; - mapping: { - [M in Exclude[K]]: JTDSchemaType ? T : never, K>, D>; - }; - } : never; -}[keyof Exclude] : never) & (null extends T ? { - nullable: true; -} : { - nullable?: false; -}))) & { - metadata?: Record; - definitions?: { - [K in keyof D]: JTDSchemaType; - }; -}; -type JTDDataDef> = // ref -(S extends { - ref: string; -} ? D extends { - [K in S["ref"]]: infer V; -} ? JTDDataDef : never : S extends { - type: NumberType; -} ? number : S extends { - type: "boolean"; -} ? boolean : S extends { - type: "string"; -} ? string : S extends { - type: "timestamp"; -} ? string | Date : S extends { - enum: readonly (infer E)[]; -} ? string extends E ? never : [E] extends [string] ? E : never : S extends { - elements: infer E; -} ? JTDDataDef[] : S extends { - properties: Record; - optionalProperties?: Record; - additionalProperties?: boolean; -} ? { - -readonly [K in keyof S["properties"]]-?: JTDDataDef; -} & { - -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef; -} & ([S["additionalProperties"]] extends [true] ? Record : unknown) : S extends { - properties?: Record; - optionalProperties: Record; - additionalProperties?: boolean; -} ? { - -readonly [K in keyof S["properties"]]-?: JTDDataDef; -} & { - -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef; -} & ([S["additionalProperties"]] extends [true] ? Record : unknown) : S extends { - values: infer V; -} ? Record> : S extends { - discriminator: infer M; - mapping: Record; -} ? [M] extends [string] ? { - [K in keyof S["mapping"]]: JTDDataDef & { - [KM in M]: K; - }; -}[keyof S["mapping"]] : never : unknown) | (S extends { - nullable: true; -} ? null : never); -export type JTDDataType = S extends { - definitions: Record; -} ? JTDDataDef : JTDDataDef>; -export {}; diff --git a/node_modules/ajv/dist/types/jtd-schema.js b/node_modules/ajv/dist/types/jtd-schema.js deleted file mode 100644 index 11338aa8a..000000000 --- a/node_modules/ajv/dist/types/jtd-schema.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=jtd-schema.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/types/jtd-schema.js.map b/node_modules/ajv/dist/types/jtd-schema.js.map deleted file mode 100644 index add89bd77..000000000 --- a/node_modules/ajv/dist/types/jtd-schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jtd-schema.js","sourceRoot":"","sources":["../../lib/types/jtd-schema.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts b/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts deleted file mode 100644 index 607515646..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -import type { KeywordCxt } from "../../compile/validate"; -export type AdditionalItemsError = ErrorObject<"additionalItems", { - limit: number; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export declare function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js b/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js deleted file mode 100644 index 608d51eb6..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateAdditionalItems = void 0; -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const error = { - message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`, - params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`, -}; -const def = { - keyword: "additionalItems", - type: "array", - schemaType: ["boolean", "object"], - before: "uniqueItems", - error, - code(cxt) { - const { parentSchema, it } = cxt; - const { items } = parentSchema; - if (!Array.isArray(items)) { - (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas'); - return; - } - validateAdditionalItems(cxt, items); - }, -}; -function validateAdditionalItems(cxt, items) { - const { gen, schema, data, keyword, it } = cxt; - it.items = true; - const len = gen.const("len", (0, codegen_1._) `${data}.length`); - if (schema === false) { - cxt.setParams({ len: items.length }); - cxt.pass((0, codegen_1._) `${len} <= ${items.length}`); - } - else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { - const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items.length}`); // TODO var - gen.if((0, codegen_1.not)(valid), () => validateItems(valid)); - cxt.ok(valid); - } - function validateItems(valid) { - gen.forRange("i", items.length, len, (i) => { - cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid); - if (!it.allErrors) - gen.if((0, codegen_1.not)(valid), () => gen.break()); - }); - } -} -exports.validateAdditionalItems = validateAdditionalItems; -exports.default = def; -//# sourceMappingURL=additionalItems.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map b/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map deleted file mode 100644 index b3d1479c2..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"additionalItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/additionalItems.ts"],"names":[],"mappings":";;;AAOA,mDAAuD;AACvD,6CAA2E;AAI3E,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,2BAA2B,GAAG,QAAQ;IACvE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,GAAG,GAAG;CAChD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,iBAA0B;IACnC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,MAAM,EAAE,aAAa;IACrB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC9B,MAAM,EAAC,KAAK,EAAC,GAAG,YAAY,CAAA;QAC5B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC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AAC,SAAS,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,WAAI,CAAC,GAAG,EAAC,EAAE,KAAK,CAAC,CAAA;YACpE,IAAI,CAAC,EAAE,CAAC,SAAS;gBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;QAC1D,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAnBD,0DAmBC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts b/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts deleted file mode 100644 index 74698c7a2..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, AddedKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export type AdditionalPropertiesError = ErrorObject<"additionalProperties", { - additionalProperty: string; -}, AnySchema>; -declare const def: CodeKeywordDefinition & AddedKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js b/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js deleted file mode 100644 index 1d3374bb7..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const names_1 = require("../../compile/names"); -const util_1 = require("../../compile/util"); -const error = { - message: "must NOT have additional properties", - params: ({ params }) => (0, codegen_1._) `{additionalProperty: ${params.additionalProperty}}`, -}; -const def = { - keyword: "additionalProperties", - type: ["object"], - schemaType: ["boolean", "object"], - allowUndefined: true, - trackErrors: true, - error, - code(cxt) { - const { gen, schema, parentSchema, data, errsCount, it } = cxt; - /* istanbul ignore if */ - if (!errsCount) - throw new Error("ajv implementation error"); - const { allErrors, opts } = it; - it.props = true; - if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema)) - return; - const props = (0, code_1.allSchemaProperties)(parentSchema.properties); - const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties); - checkAdditionalProperties(); - cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); - function checkAdditionalProperties() { - gen.forIn("key", data, (key) => { - if (!props.length && !patProps.length) - additionalPropertyCode(key); - else - gen.if(isAdditional(key), () => additionalPropertyCode(key)); - }); - } - function isAdditional(key) { - let definedProp; - if (props.length > 8) { - // TODO maybe an option instead of hard-coded 8? - const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties"); - definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key); - } - else if (props.length) { - definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._) `${key} === ${p}`)); - } - else { - definedProp = codegen_1.nil; - } - if (patProps.length) { - definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._) `${(0, code_1.usePattern)(cxt, p)}.test(${key})`)); - } - return (0, codegen_1.not)(definedProp); - } - function deleteAdditional(key) { - gen.code((0, codegen_1._) `delete ${data}[${key}]`); - } - function additionalPropertyCode(key) { - if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) { - deleteAdditional(key); - return; - } - if (schema === false) { - cxt.setParams({ additionalProperty: key }); - cxt.error(); - if (!allErrors) - gen.break(); - return; - } - if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { - const valid = gen.name("valid"); - if (opts.removeAdditional === "failing") { - applyAdditionalSchema(key, valid, false); - gen.if((0, codegen_1.not)(valid), () => { - cxt.reset(); - deleteAdditional(key); - }); - } - else { - applyAdditionalSchema(key, valid); - if (!allErrors) - gen.if((0, codegen_1.not)(valid), () => gen.break()); - } - } - } - function applyAdditionalSchema(key, valid, errors) { - const subschema = { - keyword: "additionalProperties", - dataProp: key, - dataPropType: util_1.Type.Str, - }; - if (errors === false) { - Object.assign(subschema, { - compositeRule: true, - createErrors: false, - allErrors: false, - }); - } - cxt.subschema(subschema, valid); - } - }, -}; -exports.default = def; -//# sourceMappingURL=additionalProperties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map b/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map deleted file mode 100644 index d2f249f6f..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"additionalProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/additionalProperties.ts"],"names":[],"mappings":";;AAOA,kCAAsE;AACtE,mDAAiE;AACjE,+CAAmC;AAEnC,6CAA0E;AAQ1E,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,qCAAqC;IAC9C,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,wBAAwB,MAAM,CAAC,kBAAkB,GAAG;CAC5E,CAAA;AAED,MAAM,GAAG,GAAmD;IAC1D,OAAO,EAAE,sBAAsB;IAC/B,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,cAAc,EAAE,IAAI;IACpB,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAG;QACN,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC5D,wBAAwB;QACxB,IAAI,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC3D,MAAM,EAAC,SAAS,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;QAC5B,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,IAA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AC,CAAA;oBACxC,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE;wBACtB,GAAG,CAAC,KAAK,EAAE,CAAA;wBACX,gBAAgB,CAAC,GAAG,CAAC,CAAA;oBACvB,CAAC,CAAC,CAAA;iBACH;qBAAM;oBACL,qBAAqB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;oBACjC,IAAI,CAAC,SAAS;wBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;iBACtD;aACF;QACH,CAAC;QAED,SAAS,qBAAqB,CAAC,GAAS,EAAE,KAAW,EAAE,MAAc;YACnE,MAAM,SAAS,GAAkB;gBAC/B,OAAO,EAAE,sBAAsB;gBAC/B,QAAQ,EAAE,GAAG;gBACb,YAAY,EAAE,WAAI,CAAC,GAAG;aACvB,CAAA;YACD,IAAI,MAAM,KAAK,KAAK,EAAE;gBACpB,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;oBACvB,aAAa,EAAE,IAAI;oBACnB,YAAY,EAAE,KAAK;oBACnB,SAAS,EAAE,KAAK;iBACjB,CAAC,CAAA;aACH;YACD,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QACjC,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts b/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/allOf.js b/node_modules/ajv/dist/vocabularies/applicator/allOf.js deleted file mode 100644 index 1b1ae7376..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/allOf.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const util_1 = require("../../compile/util"); -const def = { - keyword: "allOf", - schemaType: "array", - code(cxt) { - const { gen, schema, it } = cxt; - /* istanbul ignore if */ - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - const valid = gen.name("valid"); - schema.forEach((sch, i) => { - if ((0, util_1.alwaysValidSchema)(it, sch)) - return; - const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid); - cxt.ok(valid); - cxt.mergeEvaluated(schCxt); - }); - }, -}; -exports.default = def; -//# sourceMappingURL=allOf.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map b/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map deleted file mode 100644 index d119d0eae..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"allOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/allOf.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AAEpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,wBAAwB;QACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACvE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,MAAM,CAAC,OAAO,CAAC,CAAC,GAAc,EAAE,CAAS,EAAE,EAAE;YAC3C,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,GAAG,CAAC;gBAAE,OAAM;YACtC,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAC,EAAE,KAAK,CAAC,CAAA;YACtE,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;YACb,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAC5B,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts b/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts deleted file mode 100644 index 61bca56e0..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types"; -export type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/anyOf.js b/node_modules/ajv/dist/vocabularies/applicator/anyOf.js deleted file mode 100644 index 66cfce2cc..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const def = { - keyword: "anyOf", - schemaType: "array", - trackErrors: true, - code: code_1.validateUnion, - error: { message: "must match a schema in anyOf" }, -}; -exports.default = def; -//# sourceMappingURL=anyOf.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map b/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map deleted file mode 100644 index 537ffcbeb..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"anyOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/anyOf.ts"],"names":[],"mappings":";;AACA,kCAAqC;AAIrC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE,EAAC,OAAO,EAAE,8BAA8B,EAAC;CACjD,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts b/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts deleted file mode 100644 index 5493e844f..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export type ContainsError = ErrorObject<"contains", { - minContains: number; - maxContains?: number; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/contains.js b/node_modules/ajv/dist/vocabularies/applicator/contains.js deleted file mode 100644 index 6c5473f5d..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/contains.js +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const error = { - message: ({ params: { min, max } }) => max === undefined - ? (0, codegen_1.str) `must contain at least ${min} valid item(s)` - : (0, codegen_1.str) `must contain at least ${min} and no more than ${max} valid item(s)`, - params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._) `{minContains: ${min}}` : (0, codegen_1._) `{minContains: ${min}, maxContains: ${max}}`, -}; -const def = { - keyword: "contains", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - trackErrors: true, - error, - code(cxt) { - const { gen, schema, parentSchema, data, it } = cxt; - let min; - let max; - const { minContains, maxContains } = parentSchema; - if (it.opts.next) { - min = minContains === undefined ? 1 : minContains; - max = maxContains; - } - else { - min = 1; - } - const len = gen.const("len", (0, codegen_1._) `${data}.length`); - cxt.setParams({ min, max }); - if (max === undefined && min === 0) { - (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); - return; - } - if (max !== undefined && min > max) { - (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`); - cxt.fail(); - return; - } - if ((0, util_1.alwaysValidSchema)(it, schema)) { - let cond = (0, codegen_1._) `${len} >= ${min}`; - if (max !== undefined) - cond = (0, codegen_1._) `${cond} && ${len} <= ${max}`; - cxt.pass(cond); - return; - } - it.items = true; - const valid = gen.name("valid"); - if (max === undefined && min === 1) { - validateItems(valid, () => gen.if(valid, () => gen.break())); - } - else if (min === 0) { - gen.let(valid, true); - if (max !== undefined) - gen.if((0, codegen_1._) `${data}.length > 0`, validateItemsWithCount); - } - else { - gen.let(valid, false); - validateItemsWithCount(); - } - cxt.result(valid, () => cxt.reset()); - function validateItemsWithCount() { - const schValid = gen.name("_valid"); - const count = gen.let("count", 0); - validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))); - } - function validateItems(_valid, block) { - gen.forRange("i", 0, len, (i) => { - cxt.subschema({ - keyword: "contains", - dataProp: i, - dataPropType: util_1.Type.Num, - compositeRule: true, - }, _valid); - block(); - }); - } - function checkLimits(count) { - gen.code((0, codegen_1._) `${count}++`); - if (max === undefined) { - gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true).break()); - } - else { - gen.if((0, codegen_1._) `${count} > ${max}`, () => gen.assign(valid, false).break()); - if (min === 1) - gen.assign(valid, true); - else - gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true)); - } - } - }, -}; -exports.default = def; -//# sourceMappingURL=contains.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/contains.js.map b/node_modules/ajv/dist/vocabularies/applicator/contains.js.map deleted file mode 100644 index 6a0bd39cb..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contains.js","sourceRoot":"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AAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;aACrE;iBAAM;gBACL,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,MAAM,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;gBACpE,IAAI,GAAG,KAAK,CAAC;oBAAE,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;;oBACjC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAA;aAClE;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts b/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts deleted file mode 100644 index 05900e0c5..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaMap, AnySchema } from "../../types"; -import type { KeywordCxt } from "../../compile/validate"; -export type PropertyDependencies = { - [K in string]?: string[]; -}; -export interface DependenciesErrorParams { - property: string; - missingProperty: string; - depsCount: number; - deps: string; -} -export type DependenciesError = ErrorObject<"dependencies", DependenciesErrorParams, { - [K in string]?: string[] | AnySchema; -}>; -export declare const error: KeywordErrorDefinition; -declare const def: CodeKeywordDefinition; -export declare function validatePropertyDeps(cxt: KeywordCxt, propertyDeps?: { - [K in string]?: string[]; -}): void; -export declare function validateSchemaDeps(cxt: KeywordCxt, schemaDeps?: SchemaMap): void; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/dependencies.js b/node_modules/ajv/dist/vocabularies/applicator/dependencies.js deleted file mode 100644 index e81f86d1d..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0; -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const code_1 = require("../code"); -exports.error = { - message: ({ params: { property, depsCount, deps } }) => { - const property_ies = depsCount === 1 ? "property" : "properties"; - return (0, codegen_1.str) `must have ${property_ies} ${deps} when property ${property} is present`; - }, - params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._) `{property: ${property}, - missingProperty: ${missingProperty}, - depsCount: ${depsCount}, - deps: ${deps}}`, // TODO change to reference -}; -const def = { - keyword: "dependencies", - type: "object", - schemaType: "object", - error: exports.error, - code(cxt) { - const [propDeps, schDeps] = splitDependencies(cxt); - validatePropertyDeps(cxt, propDeps); - validateSchemaDeps(cxt, schDeps); - }, -}; -function splitDependencies({ schema }) { - const propertyDeps = {}; - const schemaDeps = {}; - for (const key in schema) { - if (key === "__proto__") - continue; - const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps; - deps[key] = schema[key]; - } - return [propertyDeps, schemaDeps]; -} -function validatePropertyDeps(cxt, propertyDeps = cxt.schema) { - const { gen, data, it } = cxt; - if (Object.keys(propertyDeps).length === 0) - return; - const missing = gen.let("missing"); - for (const prop in propertyDeps) { - const deps = propertyDeps[prop]; - if (deps.length === 0) - continue; - const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties); - cxt.setParams({ - property: prop, - depsCount: deps.length, - deps: deps.join(", "), - }); - if (it.allErrors) { - gen.if(hasProperty, () => { - for (const depProp of deps) { - (0, code_1.checkReportMissingProp)(cxt, depProp); - } - }); - } - else { - gen.if((0, codegen_1._) `${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`); - (0, code_1.reportMissingProp)(cxt, missing); - gen.else(); - } - } -} -exports.validatePropertyDeps = validatePropertyDeps; -function validateSchemaDeps(cxt, schemaDeps = cxt.schema) { - const { gen, data, keyword, it } = cxt; - const valid = gen.name("valid"); - for (const prop in schemaDeps) { - if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop])) - continue; - gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => { - const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid); - cxt.mergeValidEvaluated(schCxt, valid); - }, () => gen.var(valid, true) // TODO var - ); - cxt.ok(valid); - } -} -exports.validateSchemaDeps = validateSchemaDeps; -exports.default = def; -//# sourceMappingURL=dependencies.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map b/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map deleted file mode 100644 index dafffd16b..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/dependencies.ts"],"names":[],"mappings":";;;AAQA,mDAA4C;AAC5C,6CAAoD;AACpD,kCAAmG;AAmBtF,QAAA,KAAK,GAA2B;IAC3C,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAC,EAAC,EAAE,EAAE;QACjD,MAAM,YAAY,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAA;QAChE,OAAO,IAAA,aAAG,EAAA,aAAa,YAAY,IAAI,IAAI,kBAAkB,QAAQ,aAAa,CAAA;IACpF,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAC,EAAC,EAAE,EAAE,CACjE,IAAA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AAI,CAAc,CAAC;YAAE,SAAQ;QAClE,GAAG,CAAC,EAAE,CACJ,IAAA,qBAAc,EAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EACtD,GAAG,EAAE;YACH,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;YAChE,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACxC,CAAC,EACD,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,WAAW;SACvC,CAAA;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;KACd;AACH,CAAC;AAfD,gDAeC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts b/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js b/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js deleted file mode 100644 index 66ef2e843..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dependencies_1 = require("./dependencies"); -const def = { - keyword: "dependentSchemas", - type: "object", - schemaType: "object", - code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt), -}; -exports.default = def; -//# sourceMappingURL=dependentSchemas.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map b/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map deleted file mode 100644 index 17712e6fb..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dependentSchemas.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/dependentSchemas.ts"],"names":[],"mappings":";;AACA,iDAAiD;AAEjD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,iCAAkB,EAAC,GAAG,CAAC;CACvC,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/if.d.ts b/node_modules/ajv/dist/vocabularies/applicator/if.d.ts deleted file mode 100644 index 8f602e33f..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export type IfKeywordError = ErrorObject<"if", { - failingKeyword: string; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/if.js b/node_modules/ajv/dist/vocabularies/applicator/if.js deleted file mode 100644 index 2c42a3e9c..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/if.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const error = { - message: ({ params }) => (0, codegen_1.str) `must match "${params.ifClause}" schema`, - params: ({ params }) => (0, codegen_1._) `{failingKeyword: ${params.ifClause}}`, -}; -const def = { - keyword: "if", - schemaType: ["object", "boolean"], - trackErrors: true, - error, - code(cxt) { - const { gen, parentSchema, it } = cxt; - if (parentSchema.then === undefined && parentSchema.else === undefined) { - (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored'); - } - const hasThen = hasSchema(it, "then"); - const hasElse = hasSchema(it, "else"); - if (!hasThen && !hasElse) - return; - const valid = gen.let("valid", true); - const schValid = gen.name("_valid"); - validateIf(); - cxt.reset(); - if (hasThen && hasElse) { - const ifClause = gen.let("ifClause"); - cxt.setParams({ ifClause }); - gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)); - } - else if (hasThen) { - gen.if(schValid, validateClause("then")); - } - else { - gen.if((0, codegen_1.not)(schValid), validateClause("else")); - } - cxt.pass(valid, () => cxt.error(true)); - function validateIf() { - const schCxt = cxt.subschema({ - keyword: "if", - compositeRule: true, - createErrors: false, - allErrors: false, - }, schValid); - cxt.mergeEvaluated(schCxt); - } - function validateClause(keyword, ifClause) { - return () => { - const schCxt = cxt.subschema({ keyword }, schValid); - gen.assign(valid, schValid); - cxt.mergeValidEvaluated(schCxt, valid); - if (ifClause) - gen.assign(ifClause, (0, codegen_1._) `${keyword}`); - else - cxt.setParams({ ifClause: keyword }); - }; - } - }, -}; -function hasSchema(it, keyword) { - const schema = it.schema[keyword]; - return schema !== undefined && !(0, util_1.alwaysValidSchema)(it, schema); -} -exports.default = def; -//# sourceMappingURL=if.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/if.js.map b/node_modules/ajv/dist/vocabularies/applicator/if.js.map deleted file mode 100644 index 34b3a5539..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/if.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"if.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/if.ts"],"names":[],"mappings":";;AAQA,mDAAuD;AACvD,6CAAqE;AAIrE,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,eAAe,MAAM,CAAC,QAAQ,UAAU;IAClE,MAAM,EAAE,CAAC,EAAC,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E,MAAM,CAAC,CAAA;AAC/D,CAAC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/index.d.ts b/node_modules/ajv/dist/vocabularies/applicator/index.d.ts deleted file mode 100644 index b9cc5f5c8..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { ErrorNoParams, Vocabulary } from "../../types"; -import { AdditionalItemsError } from "./additionalItems"; -import { ItemsError } from "./items2020"; -import { ContainsError } from "./contains"; -import { DependenciesError } from "./dependencies"; -import { PropertyNamesError } from "./propertyNames"; -import { AdditionalPropertiesError } from "./additionalProperties"; -import { NotKeywordError } from "./not"; -import { AnyOfError } from "./anyOf"; -import { OneOfError } from "./oneOf"; -import { IfKeywordError } from "./if"; -export default function getApplicator(draft2020?: boolean): Vocabulary; -export type ApplicatorKeywordError = ErrorNoParams<"false schema"> | AdditionalItemsError | ItemsError | ContainsError | AdditionalPropertiesError | DependenciesError | IfKeywordError | AnyOfError | OneOfError | NotKeywordError | PropertyNamesError; diff --git a/node_modules/ajv/dist/vocabularies/applicator/index.js b/node_modules/ajv/dist/vocabularies/applicator/index.js deleted file mode 100644 index cf592f279..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/index.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const additionalItems_1 = require("./additionalItems"); -const prefixItems_1 = require("./prefixItems"); -const items_1 = require("./items"); -const items2020_1 = require("./items2020"); -const contains_1 = require("./contains"); -const dependencies_1 = require("./dependencies"); -const propertyNames_1 = require("./propertyNames"); -const additionalProperties_1 = require("./additionalProperties"); -const properties_1 = require("./properties"); -const patternProperties_1 = require("./patternProperties"); -const not_1 = require("./not"); -const anyOf_1 = require("./anyOf"); -const oneOf_1 = require("./oneOf"); -const allOf_1 = require("./allOf"); -const if_1 = require("./if"); -const thenElse_1 = require("./thenElse"); -function getApplicator(draft2020 = false) { - const applicator = [ - // any - not_1.default, - anyOf_1.default, - oneOf_1.default, - allOf_1.default, - if_1.default, - thenElse_1.default, - // object - propertyNames_1.default, - additionalProperties_1.default, - dependencies_1.default, - properties_1.default, - patternProperties_1.default, - ]; - // array - if (draft2020) - applicator.push(prefixItems_1.default, items2020_1.default); - else - applicator.push(additionalItems_1.default, items_1.default); - applicator.push(contains_1.default); - return applicator; -} -exports.default = getApplicator; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/index.js.map b/node_modules/ajv/dist/vocabularies/applicator/index.js.map deleted file mode 100644 index ebcb8534d..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/index.ts"],"names":[],"mappings":";;AACA,uDAAuE;AACvE,+CAAuC;AACvC,mCAA2B;AAC3B,2CAAiD;AACjD,yCAAkD;AAClD,iDAA8D;AAC9D,mDAAiE;AACjE,iEAAsF;AACtF,6CAAqC;AACrC,2DAAmD;AACnD,+BAAiD;AACjD,mCAAyC;AACzC,mCAAyC;AACzC,mCAA2B;AAC3B,6BAA8C;AAC9C,yCAAiC;AAEjC,SAAwB,aAAa,CAAC,SAAS,GAAG,KAAK;IACrD,MAAM,UAAU,GAAG;QACjB,MAAM;QACN,aAAU;QACV,eAAK;QACL,eAAK;QACL,eAAK;QACL,YAAS;QACT,kBAAQ;QACR,SAAS;QACT,uBAAa;QACb,8BAAoB;QACpB,sBAAY;QACZ,oBAAU;QACV,2BAAiB;KAClB,CAAA;IACD,QAAQ;IACR,IAAI,SAAS;QAAE,UAAU,CAAC,IAAI,CAAC,qBAAW,EAAE,mBAAS,CAAC,CAAA;;QACjD,UAAU,CAAC,IAAI,CAAC,yBAAe,EAAE,eAAK,CAAC,CAAA;IAC5C,UAAU,CAAC,IAAI,CAAC,kBAAQ,CAAC,CAAA;IACzB,OAAO,UAAU,CAAA;AACnB,CAAC;AArBD,gCAqBC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/items.d.ts b/node_modules/ajv/dist/vocabularies/applicator/items.d.ts deleted file mode 100644 index 8e608ca9c..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition, AnySchema } from "../../types"; -import type { KeywordCxt } from "../../compile/validate"; -declare const def: CodeKeywordDefinition; -export declare function validateTuple(cxt: KeywordCxt, extraItems: string, schArr?: AnySchema[]): void; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/items.js b/node_modules/ajv/dist/vocabularies/applicator/items.js deleted file mode 100644 index 26f527bc6..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/items.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateTuple = void 0; -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const code_1 = require("../code"); -const def = { - keyword: "items", - type: "array", - schemaType: ["object", "array", "boolean"], - before: "uniqueItems", - code(cxt) { - const { schema, it } = cxt; - if (Array.isArray(schema)) - return validateTuple(cxt, "additionalItems", schema); - it.items = true; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - cxt.ok((0, code_1.validateArray)(cxt)); - }, -}; -function validateTuple(cxt, extraItems, schArr = cxt.schema) { - const { gen, parentSchema, data, keyword, it } = cxt; - checkStrictTuple(parentSchema); - if (it.opts.unevaluated && schArr.length && it.items !== true) { - it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items); - } - const valid = gen.name("valid"); - const len = gen.const("len", (0, codegen_1._) `${data}.length`); - schArr.forEach((sch, i) => { - if ((0, util_1.alwaysValidSchema)(it, sch)) - return; - gen.if((0, codegen_1._) `${len} > ${i}`, () => cxt.subschema({ - keyword, - schemaProp: i, - dataProp: i, - }, valid)); - cxt.ok(valid); - }); - function checkStrictTuple(sch) { - const { opts, errSchemaPath } = it; - const l = schArr.length; - const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false); - if (opts.strictTuples && !fullTuple) { - const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`; - (0, util_1.checkStrictMode)(it, msg, opts.strictTuples); - } - } -} -exports.validateTuple = validateTuple; -exports.default = def; -//# sourceMappingURL=items.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/items.js.map b/node_modules/ajv/dist/vocabularies/applicator/items.js.map deleted file mode 100644 index 3c4ce614c..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/items.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/items.ts"],"names":[],"mappings":";;;AAEA,mDAAuC;AACvC,6CAAqF;AACrF,kCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;IAC1C,MAAM,EAAE,aAAa;IACrB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACxB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,OAAO,aAAa,CAAC,GAAG,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAA;QAC/E,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,GAAG,CAAC,EAAE,CAAC,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,CAAA;IAC5B,CAAC;CACF,CAAA;AAED,SAAgB,aAAa,CAC3B,GAAe,EACf,UAAkB,EAClB,SAAsB,GAAG,CAAC,MAAM;IAEhC,MAAM,EAAC,GAA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K,CAAC,CAAA;QACzF,IAAI,IAAI,CAAC,YAAY,IAAI,CAAC,SAAS,EAAE;YACnC,MAAM,GAAG,GAAG,IAAI,OAAO,QAAQ,CAAC,oCAAoC,UAAU,4CAA4C,aAAa,GAAG,CAAA;YAC1I,IAAA,sBAAe,EAAC,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;SAC5C;IACH,CAAC;AACH,CAAC;AApCD,sCAoCC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts b/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts deleted file mode 100644 index a2565b2c2..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export type ItemsError = ErrorObject<"items", { - limit: number; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/items2020.js b/node_modules/ajv/dist/vocabularies/applicator/items2020.js deleted file mode 100644 index f2387d7d2..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/items2020.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const code_1 = require("../code"); -const additionalItems_1 = require("./additionalItems"); -const error = { - message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`, - params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`, -}; -const def = { - keyword: "items", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - error, - code(cxt) { - const { schema, parentSchema, it } = cxt; - const { prefixItems } = parentSchema; - it.items = true; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - if (prefixItems) - (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems); - else - cxt.ok((0, code_1.validateArray)(cxt)); - }, -}; -exports.default = def; -//# sourceMappingURL=items2020.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map b/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map deleted file mode 100644 index 5034acda6..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"items2020.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/items2020.ts"],"names":[],"mappings":";;AAOA,mDAA4C;AAC5C,6CAAoD;AACpD,kCAAqC;AACrC,uDAAyD;AAIzD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,2BAA2B,GAAG,QAAQ;IACvE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,GAAG,GAAG;CAChD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,MAAM,EAAE,aAAa;IACrB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,MAAM,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtC,MAAM,EAAC,WAAW,EAAC,GAAG,YAAY,CAAA;QAClC,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,IAAI,WAAW;YAAE,IAAA,yCAAuB,EAAC,GAAG,EAAE,WAAW,CAAC,CAAA;;YACrD,GAAG,CAAC,EAAE,CAAC,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,CAAA;IACjC,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/not.d.ts b/node_modules/ajv/dist/vocabularies/applicator/not.d.ts deleted file mode 100644 index d2f4888f3..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types"; -export type NotKeywordError = ErrorNoParams<"not", AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/not.js b/node_modules/ajv/dist/vocabularies/applicator/not.js deleted file mode 100644 index 89f6fddac..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/not.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const util_1 = require("../../compile/util"); -const def = { - keyword: "not", - schemaType: ["object", "boolean"], - trackErrors: true, - code(cxt) { - const { gen, schema, it } = cxt; - if ((0, util_1.alwaysValidSchema)(it, schema)) { - cxt.fail(); - return; - } - const valid = gen.name("valid"); - cxt.subschema({ - keyword: "not", - compositeRule: true, - createErrors: false, - allErrors: false, - }, valid); - cxt.failResult(valid, () => cxt.reset(), () => cxt.error()); - }, - error: { message: "must NOT be valid" }, -}; -exports.default = def; -//# sourceMappingURL=not.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/not.js.map b/node_modules/ajv/dist/vocabularies/applicator/not.js.map deleted file mode 100644 index 5e2a1ca11..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/not.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"not.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/not.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AAIpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE;YACjC,GAAG,CAAC,IAAI,EAAE,CAAA;YACV,OAAM;SACP;QAED,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,GAAG,CAAC,SAAS,CACX;YACE,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,KAAK;SACjB,EACD,KAAK,CACN,CAAA;QAED,GAAG,CAAC,UAAU,CACZ,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAClB,CAAA;IACH,CAAC;IACD,KAAK,EAAE,EAAC,OAAO,EAAE,mBAAmB,EAAC;CACtC,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts b/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts deleted file mode 100644 index 1e1d34f72..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export type OneOfError = ErrorObject<"oneOf", { - passingSchemas: [number, number] | null; -}, AnySchema[]>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/oneOf.js b/node_modules/ajv/dist/vocabularies/applicator/oneOf.js deleted file mode 100644 index 441db2ac0..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const error = { - message: "must match exactly one schema in oneOf", - params: ({ params }) => (0, codegen_1._) `{passingSchemas: ${params.passing}}`, -}; -const def = { - keyword: "oneOf", - schemaType: "array", - trackErrors: true, - error, - code(cxt) { - const { gen, schema, parentSchema, it } = cxt; - /* istanbul ignore if */ - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - if (it.opts.discriminator && parentSchema.discriminator) - return; - const schArr = schema; - const valid = gen.let("valid", false); - const passing = gen.let("passing", null); - const schValid = gen.name("_valid"); - cxt.setParams({ passing }); - // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas - gen.block(validateOneOf); - cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); - function validateOneOf() { - schArr.forEach((sch, i) => { - let schCxt; - if ((0, util_1.alwaysValidSchema)(it, sch)) { - gen.var(schValid, true); - } - else { - schCxt = cxt.subschema({ - keyword: "oneOf", - schemaProp: i, - compositeRule: true, - }, schValid); - } - if (i > 0) { - gen - .if((0, codegen_1._) `${schValid} && ${valid}`) - .assign(valid, false) - .assign(passing, (0, codegen_1._) `[${passing}, ${i}]`) - .else(); - } - gen.if(schValid, () => { - gen.assign(valid, true); - gen.assign(passing, i); - if (schCxt) - cxt.mergeEvaluated(schCxt, codegen_1.Name); - }); - }); - } - }, -}; -exports.default = def; -//# sourceMappingURL=oneOf.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map b/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map deleted file mode 100644 index 6cc54de65..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"oneOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/oneOf.ts"],"names":[],"mappings":";;AAOA,mDAA6C;AAC7C,6CAAoD;AASpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,wCAAwC;IACjD,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC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,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;iBACxB;qBAAM;oBACL,MAAM,GAAG,GAAG,CAAC,SAAS,CACpB;wBACE,OAAO,EAAE,OAAO;wBAChB,UAAU,EAAE,CAAC;wBACb,aAAa,EAAE,IAAI;qBACpB,EACD,QAAQ,CACT,CAAA;iBACF;gBAED,IAAI,CAAC,GAAG,CAAC,EAAE;oBACT,GAAG;yBACA,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,QAAQ,OAAO,KAAK,EAAE,CAAC;yBAC9B,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;yBACpB,MAAM,CAAC,OAAO,EAAE,IAAA,WAAC,EAAA,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC;yBACtC,IAAI,EAAE,CAAA;iBACV;gBAED,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;oBACpB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;oBACvB,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;oBACtB,IAAI,MAAM;wBAAE,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,cAAI,CAAC,CAAA;gBAC9C,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts b/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js b/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js deleted file mode 100644 index 48501c6e3..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const util_2 = require("../../compile/util"); -const def = { - keyword: "patternProperties", - type: "object", - schemaType: "object", - code(cxt) { - const { gen, schema, data, parentSchema, it } = cxt; - const { opts } = it; - const patterns = (0, code_1.allSchemaProperties)(schema); - const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p])); - if (patterns.length === 0 || - (alwaysValidPatterns.length === patterns.length && - (!it.opts.unevaluated || it.props === true))) { - return; - } - const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties; - const valid = gen.name("valid"); - if (it.props !== true && !(it.props instanceof codegen_1.Name)) { - it.props = (0, util_2.evaluatedPropsToName)(gen, it.props); - } - const { props } = it; - validatePatternProperties(); - function validatePatternProperties() { - for (const pat of patterns) { - if (checkProperties) - checkMatchingProperties(pat); - if (it.allErrors) { - validateProperties(pat); - } - else { - gen.var(valid, true); // TODO var - validateProperties(pat); - gen.if(valid); - } - } - } - function checkMatchingProperties(pat) { - for (const prop in checkProperties) { - if (new RegExp(pat).test(prop)) { - (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`); - } - } - } - function validateProperties(pat) { - gen.forIn("key", data, (key) => { - gen.if((0, codegen_1._) `${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => { - const alwaysValid = alwaysValidPatterns.includes(pat); - if (!alwaysValid) { - cxt.subschema({ - keyword: "patternProperties", - schemaProp: pat, - dataProp: key, - dataPropType: util_2.Type.Str, - }, valid); - } - if (it.opts.unevaluated && props !== true) { - gen.assign((0, codegen_1._) `${props}[${key}]`, true); - } - else if (!alwaysValid && !it.allErrors) { - // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) - // or if all properties were evaluated (props === true) - gen.if((0, codegen_1.not)(valid), () => gen.break()); - } - }); - }); - } - }, -}; -exports.default = def; -//# sourceMappingURL=patternProperties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map b/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map deleted file mode 100644 index 2a60b74a5..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"patternProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/patternProperties.ts"],"names":[],"mappings":";;AAEA,kCAAuD;AACvD,mDAAkD;AAClD,6CAAqE;AACrE,6CAA6D;AAG7D,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,MAAM,EAAC,IAAI,EAAC,GAAG,EAAE,CAAA;QACjB,MAAM,QAAQ,GAAG,IAAA,0BAAmB,EAAC,MAAM,CAAC,CAAA;QAC5C,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAChD,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAc,CAAC,CAC9C,CAAA;QAED,IACE,QAAQ,CAAC,MAAM,KAAK,CAAC;YACrB,CAAC,mBAAmB,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;gBAC7C,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,EAC9C;YACA,OAAM;SACP;QAED,MAAM,eAAe,GACnB,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,uBAAuB,IAAI,YAAY,CAAC,UAAU,CAAA;QAC/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GAAG,EAAE;oBACnD,MAAM,WAAW,GAAG,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;oBACrD,IAAI,CAAC,WAAW,EAAE;wBAChB,GAAG,CAAC,SAAS,CACX;4BACE,OAAO,EAAE,mBAAmB;4BAC5B,UAAU,EAAE,GAAG;4BACf,QAAQ,EAAE,GAAG;4BACb,YAAY,EAAE,WAAI,CAAC,GAAG;yBACvB,EACD,KAAK,CACN,CAAA;qBACF;oBAED,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,KAAK,KAAK,IAAI,EAAE;wBACzC,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,IAAI,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;qBACtC;yBAAM,IAAI,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE;wBACxC,sFAAsF;wBACtF,uDAAuD;wBACvD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;qBACtC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts b/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js b/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js deleted file mode 100644 index 727bc23ce..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const items_1 = require("./items"); -const def = { - keyword: "prefixItems", - type: "array", - schemaType: ["array"], - before: "uniqueItems", - code: (cxt) => (0, items_1.validateTuple)(cxt, "items"), -}; -exports.default = def; -//# sourceMappingURL=prefixItems.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map b/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map deleted file mode 100644 index deef718e6..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"prefixItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/prefixItems.ts"],"names":[],"mappings":";;AACA,mCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,GAAG,EAAE,OAAO,CAAC;CAC3C,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts b/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/properties.js b/node_modules/ajv/dist/vocabularies/applicator/properties.js deleted file mode 100644 index 7347358e2..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/properties.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const validate_1 = require("../../compile/validate"); -const code_1 = require("../code"); -const util_1 = require("../../compile/util"); -const additionalProperties_1 = require("./additionalProperties"); -const def = { - keyword: "properties", - type: "object", - schemaType: "object", - code(cxt) { - const { gen, schema, parentSchema, data, it } = cxt; - if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) { - additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties")); - } - const allProps = (0, code_1.allSchemaProperties)(schema); - for (const prop of allProps) { - it.definedProperties.add(prop); - } - if (it.opts.unevaluated && allProps.length && it.props !== true) { - it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props); - } - const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p])); - if (properties.length === 0) - return; - const valid = gen.name("valid"); - for (const prop of properties) { - if (hasDefault(prop)) { - applyPropertySchema(prop); - } - else { - gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties)); - applyPropertySchema(prop); - if (!it.allErrors) - gen.else().var(valid, true); - gen.endIf(); - } - cxt.it.definedProperties.add(prop); - cxt.ok(valid); - } - function hasDefault(prop) { - return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined; - } - function applyPropertySchema(prop) { - cxt.subschema({ - keyword: "properties", - schemaProp: prop, - dataProp: prop, - }, valid); - } - }, -}; -exports.default = def; -//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/properties.js.map b/node_modules/ajv/dist/vocabularies/applicator/properties.js.map deleted file mode 100644 index 27f8148cf..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/properties.ts"],"names":[],"mappings":";;AACA,qDAAiD;AACjD,kCAA2D;AAC3D,6CAA4E;AAC5E,iEAA0C;AAE1C,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACp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EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAA;gBAC9D,mBAAmB,CAAC,IAAI,CAAC,CAAA;gBACzB,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;gBAC9C,GAAG,CAAC,KAAK,EAAE,CAAA;aACZ;YACD,GAAG,CAAC,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAClC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;SACd;QAED,SAAS,UAAU,CAAC,IAAY;YAC9B,OAAO,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS,CAAA;QACvF,CAAC;QAED,SAAS,mBAAmB,CAAC,IAAY;YACvC,GAAG,CAAC,SAAS,CACX;gBACE,OAAO,EAAE,YAAY;gBACrB,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,IAAI;aACf,EACD,KAAK,CACN,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts b/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts deleted file mode 100644 index a806da32f..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export type PropertyNamesError = ErrorObject<"propertyNames", { - propertyName: string; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js b/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js deleted file mode 100644 index f3871152d..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const error = { - message: "property name must be valid", - params: ({ params }) => (0, codegen_1._) `{propertyName: ${params.propertyName}}`, -}; -const def = { - keyword: "propertyNames", - type: "object", - schemaType: ["object", "boolean"], - error, - code(cxt) { - const { gen, schema, data, it } = cxt; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - const valid = gen.name("valid"); - gen.forIn("key", data, (key) => { - cxt.setParams({ propertyName: key }); - cxt.subschema({ - keyword: "propertyNames", - data: key, - dataTypes: ["string"], - propertyName: key, - compositeRule: true, - }, valid); - gen.if((0, codegen_1.not)(valid), () => { - cxt.error(true); - if (!it.allErrors) - gen.break(); - }); - }); - cxt.ok(valid); - }, -}; -exports.default = def; -//# sourceMappingURL=propertyNames.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map b/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map deleted file mode 100644 index 835b2bb13..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"propertyNames.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/propertyNames.ts"],"names":[],"mappings":";;AAOA,mDAA4C;AAC5C,6CAAoD;AAIpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,kBAAkB,MAAM,CAAC,YAAY,GAAG;CAChE,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAE/B,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;YAC7B,GAAG,CAAC,SAAS,CAAC,EAAC,YAAY,EAAE,GAAG,EAAC,CAAC,CAAA;YAClC,GAAG,CAAC,SAAS,CACX;gBACE,OAAO,EAAE,eAAe;gBACxB,IAAI,EAAE,GAAG;gBACT,SAAS,EAAE,CAAC,QAAQ,CAAC;gBACrB,YAAY,EAAE,GAAG;gBACjB,aAAa,EAAE,IAAI;aACpB,EACD,KAAK,CACN,CAAA;YACD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE;gBACtB,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;gBACf,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,GAAG,CAAC,KAAK,EAAE,CAAA;YAChC,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts b/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/applicator/thenElse.js b/node_modules/ajv/dist/vocabularies/applicator/thenElse.js deleted file mode 100644 index 1ae639021..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const util_1 = require("../../compile/util"); -const def = { - keyword: ["then", "else"], - schemaType: ["object", "boolean"], - code({ keyword, parentSchema, it }) { - if (parentSchema.if === undefined) - (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`); - }, -}; -exports.default = def; -//# sourceMappingURL=thenElse.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map b/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map deleted file mode 100644 index 2629f4fce..000000000 --- a/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"thenElse.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/thenElse.ts"],"names":[],"mappings":";;AAEA,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,IAAI,CAAC,EAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAa;QAC1C,IAAI,YAAY,CAAC,EAAE,KAAK,SAAS;YAAE,IAAA,sBAAe,EAAC,EAAE,EAAE,IAAI,OAAO,2BAA2B,CAAC,CAAA;IAChG,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/code.d.ts b/node_modules/ajv/dist/vocabularies/code.d.ts deleted file mode 100644 index f914baca5..000000000 --- a/node_modules/ajv/dist/vocabularies/code.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { SchemaMap } from "../types"; -import type { SchemaCxt } from "../compile"; -import type { KeywordCxt } from "../compile/validate"; -import { CodeGen, Code, Name } from "../compile/codegen"; -export declare function checkReportMissingProp(cxt: KeywordCxt, prop: string): void; -export declare function checkMissingProp({ gen, data, it: { opts } }: KeywordCxt, properties: string[], missing: Name): Code; -export declare function reportMissingProp(cxt: KeywordCxt, missing: Name): void; -export declare function hasPropFunc(gen: CodeGen): Name; -export declare function isOwnProperty(gen: CodeGen, data: Name, property: Name | string): Code; -export declare function propertyInData(gen: CodeGen, data: Name, property: Name | string, ownProperties?: boolean): Code; -export declare function noPropertyInData(gen: CodeGen, data: Name, property: Name | string, ownProperties?: boolean): Code; -export declare function allSchemaProperties(schemaMap?: SchemaMap): string[]; -export declare function schemaProperties(it: SchemaCxt, schemaMap: SchemaMap): string[]; -export declare function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }: KeywordCxt, func: Code, context: Code, passSchema?: boolean): Code; -export declare function usePattern({ gen, it: { opts } }: KeywordCxt, pattern: string): Name; -export declare function validateArray(cxt: KeywordCxt): Name; -export declare function validateUnion(cxt: KeywordCxt): void; diff --git a/node_modules/ajv/dist/vocabularies/code.js b/node_modules/ajv/dist/vocabularies/code.js deleted file mode 100644 index 8cb899324..000000000 --- a/node_modules/ajv/dist/vocabularies/code.js +++ /dev/null @@ -1,131 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0; -const codegen_1 = require("../compile/codegen"); -const util_1 = require("../compile/util"); -const names_1 = require("../compile/names"); -const util_2 = require("../compile/util"); -function checkReportMissingProp(cxt, prop) { - const { gen, data, it } = cxt; - gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { - cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true); - cxt.error(); - }); -} -exports.checkReportMissingProp = checkReportMissingProp; -function checkMissingProp({ gen, data, it: { opts } }, properties, missing) { - return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._) `${missing} = ${prop}`))); -} -exports.checkMissingProp = checkMissingProp; -function reportMissingProp(cxt, missing) { - cxt.setParams({ missingProperty: missing }, true); - cxt.error(); -} -exports.reportMissingProp = reportMissingProp; -function hasPropFunc(gen) { - return gen.scopeValue("func", { - // eslint-disable-next-line @typescript-eslint/unbound-method - ref: Object.prototype.hasOwnProperty, - code: (0, codegen_1._) `Object.prototype.hasOwnProperty`, - }); -} -exports.hasPropFunc = hasPropFunc; -function isOwnProperty(gen, data, property) { - return (0, codegen_1._) `${hasPropFunc(gen)}.call(${data}, ${property})`; -} -exports.isOwnProperty = isOwnProperty; -function propertyInData(gen, data, property, ownProperties) { - const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} !== undefined`; - return ownProperties ? (0, codegen_1._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond; -} -exports.propertyInData = propertyInData; -function noPropertyInData(gen, data, property, ownProperties) { - const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} === undefined`; - return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond; -} -exports.noPropertyInData = noPropertyInData; -function allSchemaProperties(schemaMap) { - return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : []; -} -exports.allSchemaProperties = allSchemaProperties; -function schemaProperties(it, schemaMap) { - return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p])); -} -exports.schemaProperties = schemaProperties; -function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) { - const dataAndSchema = passSchema ? (0, codegen_1._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data; - const valCxt = [ - [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)], - [names_1.default.parentData, it.parentData], - [names_1.default.parentDataProperty, it.parentDataProperty], - [names_1.default.rootData, names_1.default.rootData], - ]; - if (it.opts.dynamicRef) - valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]); - const args = (0, codegen_1._) `${dataAndSchema}, ${gen.object(...valCxt)}`; - return context !== codegen_1.nil ? (0, codegen_1._) `${func}.call(${context}, ${args})` : (0, codegen_1._) `${func}(${args})`; -} -exports.callValidateCode = callValidateCode; -const newRegExp = (0, codegen_1._) `new RegExp`; -function usePattern({ gen, it: { opts } }, pattern) { - const u = opts.unicodeRegExp ? "u" : ""; - const { regExp } = opts.code; - const rx = regExp(pattern, u); - return gen.scopeValue("pattern", { - key: rx.toString(), - ref: rx, - code: (0, codegen_1._) `${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`, - }); -} -exports.usePattern = usePattern; -function validateArray(cxt) { - const { gen, data, keyword, it } = cxt; - const valid = gen.name("valid"); - if (it.allErrors) { - const validArr = gen.let("valid", true); - validateItems(() => gen.assign(validArr, false)); - return validArr; - } - gen.var(valid, true); - validateItems(() => gen.break()); - return valid; - function validateItems(notValid) { - const len = gen.const("len", (0, codegen_1._) `${data}.length`); - gen.forRange("i", 0, len, (i) => { - cxt.subschema({ - keyword, - dataProp: i, - dataPropType: util_1.Type.Num, - }, valid); - gen.if((0, codegen_1.not)(valid), notValid); - }); - } -} -exports.validateArray = validateArray; -function validateUnion(cxt) { - const { gen, schema, keyword, it } = cxt; - /* istanbul ignore if */ - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch)); - if (alwaysValid && !it.opts.unevaluated) - return; - const valid = gen.let("valid", false); - const schValid = gen.name("_valid"); - gen.block(() => schema.forEach((_sch, i) => { - const schCxt = cxt.subschema({ - keyword, - schemaProp: i, - compositeRule: true, - }, schValid); - gen.assign(valid, (0, codegen_1._) `${valid} || ${schValid}`); - const merged = cxt.mergeValidEvaluated(schCxt, schValid); - // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true) - // or if all properties and items were evaluated (it.props === true && it.items === true) - if (!merged) - gen.if((0, codegen_1.not)(valid)); - })); - cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); -} -exports.validateUnion = validateUnion; -//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/code.js.map b/node_modules/ajv/dist/vocabularies/code.js.map deleted file mode 100644 index 62d7ee121..000000000 --- a/node_modules/ajv/dist/vocabularies/code.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"code.js","sourceRoot":"","sources":["../../lib/vocabularies/code.ts"],"names":[],"mappings":";;;AAGA,gDAAoG;AACpG,0CAAuD;AACvD,4CAAgC;AAChC,0CAAuC;AACvC,SAAgB,sBAAsB,CAAC,GAAe,EAAE,IAAY;IAClE,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAC3B,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE;QACpE,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,EAAE,EAAC,EAAE,IAAI,CAAC,CAAA;QAClD,GAAG,CAAC,KAAK,EAAE,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAND,wDAMC;AAED,SAAgB,gBAAgB,CAC9B,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,EAAC,IAAI,EAAC,EAAa,EACnC,UAAoB,EACpB,OAAa;IAEb,OAAO,IAAA,YAAE,EACP,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAA,aAAG,EAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,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C,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CACtB,CAAA;AACH,CAAC;AAjCD,sCAiCC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/core/id.d.ts b/node_modules/ajv/dist/vocabularies/core/id.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/core/id.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/core/id.js b/node_modules/ajv/dist/vocabularies/core/id.js deleted file mode 100644 index 313598aab..000000000 --- a/node_modules/ajv/dist/vocabularies/core/id.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const def = { - keyword: "id", - code() { - throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); - }, -}; -exports.default = def; -//# sourceMappingURL=id.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/core/id.js.map b/node_modules/ajv/dist/vocabularies/core/id.js.map deleted file mode 100644 index 4eb27eb33..000000000 --- a/node_modules/ajv/dist/vocabularies/core/id.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"id.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/id.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,IAAI;IACb,IAAI;QACF,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;IACzE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/core/index.d.ts b/node_modules/ajv/dist/vocabularies/core/index.d.ts deleted file mode 100644 index f2e34ee36..000000000 --- a/node_modules/ajv/dist/vocabularies/core/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../../types"; -declare const core: Vocabulary; -export default core; diff --git a/node_modules/ajv/dist/vocabularies/core/index.js b/node_modules/ajv/dist/vocabularies/core/index.js deleted file mode 100644 index 87656d743..000000000 --- a/node_modules/ajv/dist/vocabularies/core/index.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const id_1 = require("./id"); -const ref_1 = require("./ref"); -const core = [ - "$schema", - "$id", - "$defs", - "$vocabulary", - { keyword: "$comment" }, - "definitions", - id_1.default, - ref_1.default, -]; -exports.default = core; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/core/index.js.map b/node_modules/ajv/dist/vocabularies/core/index.js.map deleted file mode 100644 index 5bf65f941..000000000 --- a/node_modules/ajv/dist/vocabularies/core/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/index.ts"],"names":[],"mappings":";;AACA,6BAA4B;AAC5B,+BAA8B;AAE9B,MAAM,IAAI,GAAe;IACvB,SAAS;IACT,KAAK;IACL,OAAO;IACP,aAAa;IACb,EAAC,OAAO,EAAE,UAAU,EAAC;IACrB,aAAa;IACb,YAAS;IACT,aAAU;CACX,CAAA;AAED,kBAAe,IAAI,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/core/ref.d.ts b/node_modules/ajv/dist/vocabularies/core/ref.d.ts deleted file mode 100644 index 6a0967d15..000000000 --- a/node_modules/ajv/dist/vocabularies/core/ref.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import type { KeywordCxt } from "../../compile/validate"; -import { Code } from "../../compile/codegen"; -import { SchemaEnv } from "../../compile"; -declare const def: CodeKeywordDefinition; -export declare function getValidate(cxt: KeywordCxt, sch: SchemaEnv): Code; -export declare function callRef(cxt: KeywordCxt, v: Code, sch?: SchemaEnv, $async?: boolean): void; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/core/ref.js b/node_modules/ajv/dist/vocabularies/core/ref.js deleted file mode 100644 index bac1ae853..000000000 --- a/node_modules/ajv/dist/vocabularies/core/ref.js +++ /dev/null @@ -1,122 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.callRef = exports.getValidate = void 0; -const ref_error_1 = require("../../compile/ref_error"); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const names_1 = require("../../compile/names"); -const compile_1 = require("../../compile"); -const util_1 = require("../../compile/util"); -const def = { - keyword: "$ref", - schemaType: "string", - code(cxt) { - const { gen, schema: $ref, it } = cxt; - const { baseId, schemaEnv: env, validateName, opts, self } = it; - const { root } = env; - if (($ref === "#" || $ref === "#/") && baseId === root.baseId) - return callRootRef(); - const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref); - if (schOrEnv === undefined) - throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref); - if (schOrEnv instanceof compile_1.SchemaEnv) - return callValidate(schOrEnv); - return inlineRefSchema(schOrEnv); - function callRootRef() { - if (env === root) - return callRef(cxt, validateName, env, env.$async); - const rootName = gen.scopeValue("root", { ref: root }); - return callRef(cxt, (0, codegen_1._) `${rootName}.validate`, root, root.$async); - } - function callValidate(sch) { - const v = getValidate(cxt, sch); - callRef(cxt, v, sch, sch.$async); - } - function inlineRefSchema(sch) { - const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch }); - const valid = gen.name("valid"); - const schCxt = cxt.subschema({ - schema: sch, - dataTypes: [], - schemaPath: codegen_1.nil, - topSchemaRef: schName, - errSchemaPath: $ref, - }, valid); - cxt.mergeEvaluated(schCxt); - cxt.ok(valid); - } - }, -}; -function getValidate(cxt, sch) { - const { gen } = cxt; - return sch.validate - ? gen.scopeValue("validate", { ref: sch.validate }) - : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.validate`; -} -exports.getValidate = getValidate; -function callRef(cxt, v, sch, $async) { - const { gen, it } = cxt; - const { allErrors, schemaEnv: env, opts } = it; - const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; - if ($async) - callAsyncRef(); - else - callSyncRef(); - function callAsyncRef() { - if (!env.$async) - throw new Error("async schema referenced by sync schema"); - const valid = gen.let("valid"); - gen.try(() => { - gen.code((0, codegen_1._) `await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`); - addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result - if (!allErrors) - gen.assign(valid, true); - }, (e) => { - gen.if((0, codegen_1._) `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e)); - addErrorsFrom(e); - if (!allErrors) - gen.assign(valid, false); - }); - cxt.ok(valid); - } - function callSyncRef() { - cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v)); - } - function addErrorsFrom(source) { - const errs = (0, codegen_1._) `${source}.errors`; - gen.assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged - gen.assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`); - } - function addEvaluatedFrom(source) { - var _a; - if (!it.opts.unevaluated) - return; - const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated; - // TODO refactor - if (it.props !== true) { - if (schEvaluated && !schEvaluated.dynamicProps) { - if (schEvaluated.props !== undefined) { - it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props); - } - } - else { - const props = gen.var("props", (0, codegen_1._) `${source}.evaluated.props`); - it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name); - } - } - if (it.items !== true) { - if (schEvaluated && !schEvaluated.dynamicItems) { - if (schEvaluated.items !== undefined) { - it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items); - } - } - else { - const items = gen.var("items", (0, codegen_1._) `${source}.evaluated.items`); - it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name); - } - } - } -} -exports.callRef = callRef; -exports.default = def; -//# sourceMappingURL=ref.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/core/ref.js.map b/node_modules/ajv/dist/vocabularies/core/ref.js.map deleted file mode 100644 index 88ac106af..000000000 --- a/node_modules/ajv/dist/vocabularies/core/ref.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/ref.ts"],"names":[],"mappings":";;;AAEA,uDAAqD;AACrD,kCAAwC;AACxC,mDAAmE;AACnE,+CAAmC;AACnC,2CAAmD;AACnD,6CAAiD;AAEjD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,MAAM,EAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;QAC7D,MAAM,EAAC,IAAI,EAAC,GAAG,GAAG,CAAA;QAClB,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,MAAM,KAAK,IAAI,CAAC,MAAM;YAAE,OAAO,WAAW,EAAE,CAAA;QACnF,MAAM,QAAQ,GAAG,oBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QAC1D,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,IAAI,mBAAe,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QACxF,IAAI,QAAQ,YAAY,mBAAS;YAAE,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAA;QAChE,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAA;QAE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/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts deleted file mode 100644 index ab3669a42..000000000 --- a/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import { DiscrError, DiscrErrorObj } from "../discriminator/types"; -export type DiscriminatorError = DiscrErrorObj | DiscrErrorObj; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/discriminator/index.js b/node_modules/ajv/dist/vocabularies/discriminator/index.js deleted file mode 100644 index ccdb340b2..000000000 --- a/node_modules/ajv/dist/vocabularies/discriminator/index.js +++ /dev/null @@ -1,100 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const types_1 = require("../discriminator/types"); -const compile_1 = require("../../compile"); -const util_1 = require("../../compile/util"); -const error = { - message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag - ? `tag "${tagName}" must be string` - : `value of tag "${tagName}" must be in oneOf`, - params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`, -}; -const def = { - keyword: "discriminator", - type: "object", - schemaType: "object", - error, - code(cxt) { - const { gen, data, schema, parentSchema, it } = cxt; - const { oneOf } = parentSchema; - if (!it.opts.discriminator) { - throw new Error("discriminator: requires discriminator option"); - } - const tagName = schema.propertyName; - if (typeof tagName != "string") - throw new Error("discriminator: requires propertyName"); - if (schema.mapping) - throw new Error("discriminator: mapping is not supported"); - if (!oneOf) - throw new Error("discriminator: requires oneOf keyword"); - const valid = gen.let("valid", false); - const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`); - gen.if((0, codegen_1._) `typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName })); - cxt.ok(valid); - function validateMapping() { - const mapping = getMapping(); - gen.if(false); - for (const tagValue in mapping) { - gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); - gen.assign(valid, applyTagSchema(mapping[tagValue])); - } - gen.else(); - cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName }); - gen.endIf(); - } - function applyTagSchema(schemaProp) { - const _valid = gen.name("valid"); - const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid); - cxt.mergeEvaluated(schCxt, codegen_1.Name); - return _valid; - } - function getMapping() { - var _a; - const oneOfMapping = {}; - const topRequired = hasRequired(parentSchema); - let tagRequired = true; - for (let i = 0; i < oneOf.length; i++) { - let sch = oneOf[i]; - if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) { - sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, sch === null || sch === void 0 ? void 0 : sch.$ref); - if (sch instanceof compile_1.SchemaEnv) - sch = sch.schema; - } - const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName]; - if (typeof propSch != "object") { - throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`); - } - tagRequired = tagRequired && (topRequired || hasRequired(sch)); - addMappings(propSch, i); - } - if (!tagRequired) - throw new Error(`discriminator: "${tagName}" must be required`); - return oneOfMapping; - function hasRequired({ required }) { - return Array.isArray(required) && required.includes(tagName); - } - function addMappings(sch, i) { - if (sch.const) { - addMapping(sch.const, i); - } - else if (sch.enum) { - for (const tagValue of sch.enum) { - addMapping(tagValue, i); - } - } - else { - throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`); - } - } - function addMapping(tagValue, i) { - if (typeof tagValue != "string" || tagValue in oneOfMapping) { - throw new Error(`discriminator: "${tagName}" values must be unique strings`); - } - oneOfMapping[tagValue] = i; - } - } - }, -}; -exports.default = def; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/discriminator/index.js.map b/node_modules/ajv/dist/vocabularies/discriminator/index.js.map deleted file mode 100644 index 8057a4edc..000000000 --- a/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/discriminator/index.ts"],"names":[],"mappings":";;AAEA,mDAA0D;AAC1D,kDAAgE;AAChE,2CAAmD;AACnD,6CAAuD;AAIvD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,UAAU,EAAE,OAAO,EAAC,EAAC,EAAE,EAAE,CAC3C,UAAU,KAAK,kBAAU,CAAC,GAAG;QAC3B,CAAC,CAAC,QAAQ,OAAO,kBAAkB;QACnC,CAAC,CAAC,iBAAiB,OAAO,oBAAoB;IAClD,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,UAAU,EAAE,GAAG,EAAE,OAAO,EAAC,EAAC,EAAE,EAAE,CAC/C,IAAA,WAAC,EAAA,WAAW,UAAU,UAAU,OAAO,eAAe,GAAG,GAAG;CAC/D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,MAAM,EAAC,KAAK,EAAC,GAAG,YAAY,CAAA;QAC5B,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;SAChE;QACD,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAA;QACnC,IAAI,OAAO,OAAO,IAAI,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;QACvF,IAAI,MAAM,CAAC,O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AW,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;gBAC9D,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;aACxB;YACD,IAAI,CAAC,WAAW;gBAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,oBAAoB,CAAC,CAAA;YACjF,OAAO,YAAY,CAAA;YAEnB,SAAS,WAAW,CAAC,EAAC,QAAQ,EAAkB;gBAC9C,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;YAC9D,CAAC;YAED,SAAS,WAAW,CAAC,GAAoB,EAAE,CAAS;gBAClD,IAAI,GAAG,CAAC,KAAK,EAAE;oBACb,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;iBACzB;qBAAM,IAAI,GAAG,CAAC,IAAI,EAAE;oBACnB,KAAK,MAAM,QAAQ,IAAI,GAAG,CAAC,IAAI,EAAE;wBAC/B,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;qBACxB;iBACF;qBAAM;oBACL,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,+BAA+B,CAAC,CAAA;iBACtF;YACH,CAAC;YAED,SAAS,UAAU,CAAC,QAAiB,EAAE,CAAS;gBAC9C,IAAI,OAAO,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,YAAY,EAAE;oBAC3D,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,iCAAiC,CAAC,CAAA;iBAC7E;gBACD,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts b/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts deleted file mode 100644 index 8550f6d97..000000000 --- a/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ErrorObject } from "../../types"; -export declare enum DiscrError { - Tag = "tag", - Mapping = "mapping" -} -export type DiscrErrorObj = ErrorObject<"discriminator", { - error: E; - tag: string; - tagValue: unknown; -}, string>; diff --git a/node_modules/ajv/dist/vocabularies/discriminator/types.js b/node_modules/ajv/dist/vocabularies/discriminator/types.js deleted file mode 100644 index d538f0cee..000000000 --- a/node_modules/ajv/dist/vocabularies/discriminator/types.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DiscrError = void 0; -var DiscrError; -(function (DiscrError) { - DiscrError["Tag"] = "tag"; - DiscrError["Mapping"] = "mapping"; -})(DiscrError = exports.DiscrError || (exports.DiscrError = {})); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/discriminator/types.js.map b/node_modules/ajv/dist/vocabularies/discriminator/types.js.map deleted file mode 100644 index 4908a4e9d..000000000 --- a/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/vocabularies/discriminator/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,iCAAmB,CAAA;AACrB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/draft2020.d.ts b/node_modules/ajv/dist/vocabularies/draft2020.d.ts deleted file mode 100644 index d65752c63..000000000 --- a/node_modules/ajv/dist/vocabularies/draft2020.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../types"; -declare const draft2020Vocabularies: Vocabulary[]; -export default draft2020Vocabularies; diff --git a/node_modules/ajv/dist/vocabularies/draft2020.js b/node_modules/ajv/dist/vocabularies/draft2020.js deleted file mode 100644 index 23d244aed..000000000 --- a/node_modules/ajv/dist/vocabularies/draft2020.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const core_1 = require("./core"); -const validation_1 = require("./validation"); -const applicator_1 = require("./applicator"); -const dynamic_1 = require("./dynamic"); -const next_1 = require("./next"); -const unevaluated_1 = require("./unevaluated"); -const format_1 = require("./format"); -const metadata_1 = require("./metadata"); -const draft2020Vocabularies = [ - dynamic_1.default, - core_1.default, - validation_1.default, - (0, applicator_1.default)(true), - format_1.default, - metadata_1.metadataVocabulary, - metadata_1.contentVocabulary, - next_1.default, - unevaluated_1.default, -]; -exports.default = draft2020Vocabularies; -//# sourceMappingURL=draft2020.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/draft2020.js.map b/node_modules/ajv/dist/vocabularies/draft2020.js.map deleted file mode 100644 index ae1a4d833..000000000 --- a/node_modules/ajv/dist/vocabularies/draft2020.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"draft2020.js","sourceRoot":"","sources":["../../lib/vocabularies/draft2020.ts"],"names":[],"mappings":";;AACA,iCAAmC;AACnC,6CAA+C;AAC/C,6CAAkD;AAClD,uCAAyC;AACzC,iCAAmC;AACnC,+CAAiD;AACjD,qCAAuC;AACvC,yCAAgE;AAEhE,MAAM,qBAAqB,GAAiB;IAC1C,iBAAiB;IACjB,cAAc;IACd,oBAAoB;IACpB,IAAA,oBAAuB,EAAC,IAAI,CAAC;IAC7B,gBAAgB;IAChB,6BAAkB;IAClB,4BAAiB;IACjB,cAAc;IACd,qBAAqB;CACtB,CAAA;AAED,kBAAe,qBAAqB,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/draft7.d.ts b/node_modules/ajv/dist/vocabularies/draft7.d.ts deleted file mode 100644 index 469fb8444..000000000 --- a/node_modules/ajv/dist/vocabularies/draft7.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../types"; -declare const draft7Vocabularies: Vocabulary[]; -export default draft7Vocabularies; diff --git a/node_modules/ajv/dist/vocabularies/draft7.js b/node_modules/ajv/dist/vocabularies/draft7.js deleted file mode 100644 index 1e993de0e..000000000 --- a/node_modules/ajv/dist/vocabularies/draft7.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const core_1 = require("./core"); -const validation_1 = require("./validation"); -const applicator_1 = require("./applicator"); -const format_1 = require("./format"); -const metadata_1 = require("./metadata"); -const draft7Vocabularies = [ - core_1.default, - validation_1.default, - (0, applicator_1.default)(), - format_1.default, - metadata_1.metadataVocabulary, - metadata_1.contentVocabulary, -]; -exports.default = draft7Vocabularies; -//# sourceMappingURL=draft7.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/draft7.js.map b/node_modules/ajv/dist/vocabularies/draft7.js.map deleted file mode 100644 index bc7389c67..000000000 --- a/node_modules/ajv/dist/vocabularies/draft7.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"draft7.js","sourceRoot":"","sources":["../../lib/vocabularies/draft7.ts"],"names":[],"mappings":";;AACA,iCAAmC;AACnC,6CAA+C;AAC/C,6CAAkD;AAClD,qCAAuC;AACvC,yCAAgE;AAEhE,MAAM,kBAAkB,GAAiB;IACvC,cAAc;IACd,oBAAoB;IACpB,IAAA,oBAAuB,GAAE;IACzB,gBAAgB;IAChB,6BAAkB;IAClB,4BAAiB;CAClB,CAAA;AAED,kBAAe,kBAAkB,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts b/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts deleted file mode 100644 index 562121399..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import type { KeywordCxt } from "../../compile/validate"; -declare const def: CodeKeywordDefinition; -export declare function dynamicAnchor(cxt: KeywordCxt, anchor: string): void; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js b/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js deleted file mode 100644 index 972dc35c4..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.dynamicAnchor = void 0; -const codegen_1 = require("../../compile/codegen"); -const names_1 = require("../../compile/names"); -const compile_1 = require("../../compile"); -const ref_1 = require("../core/ref"); -const def = { - keyword: "$dynamicAnchor", - schemaType: "string", - code: (cxt) => dynamicAnchor(cxt, cxt.schema), -}; -function dynamicAnchor(cxt, anchor) { - const { gen, it } = cxt; - it.schemaEnv.root.dynamicAnchors[anchor] = true; - const v = (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`; - const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt); - gen.if((0, codegen_1._) `!${v}`, () => gen.assign(v, validate)); -} -exports.dynamicAnchor = dynamicAnchor; -function _getValidate(cxt) { - const { schemaEnv, schema, self } = cxt.it; - const { root, baseId, localRefs, meta } = schemaEnv.root; - const { schemaId } = self.opts; - const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta }); - compile_1.compileSchema.call(self, sch); - return (0, ref_1.getValidate)(cxt, sch); -} -exports.default = def; -//# sourceMappingURL=dynamicAnchor.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map b/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map deleted file mode 100644 index e70afe30f..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dynamicAnchor.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/dynamicAnchor.ts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IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC,CAAA;IAC5E,uBAAa,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC7B,OAAO,IAAA,iBAAW,EAAC,GAAG,EAAE,GAAG,CAAC,CAAA;AAC9B,CAAC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts b/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts deleted file mode 100644 index fa2f2b81d..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import type { KeywordCxt } from "../../compile/validate"; -declare const def: CodeKeywordDefinition; -export declare function dynamicRef(cxt: KeywordCxt, ref: string): void; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js b/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js deleted file mode 100644 index 9f010a0df..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.dynamicRef = void 0; -const codegen_1 = require("../../compile/codegen"); -const names_1 = require("../../compile/names"); -const ref_1 = require("../core/ref"); -const def = { - keyword: "$dynamicRef", - schemaType: "string", - code: (cxt) => dynamicRef(cxt, cxt.schema), -}; -function dynamicRef(cxt, ref) { - const { gen, keyword, it } = cxt; - if (ref[0] !== "#") - throw new Error(`"${keyword}" only supports hash fragment reference`); - const anchor = ref.slice(1); - if (it.allErrors) { - _dynamicRef(); - } - else { - const valid = gen.let("valid", false); - _dynamicRef(valid); - cxt.ok(valid); - } - function _dynamicRef(valid) { - // TODO the assumption here is that `recursiveRef: #` always points to the root - // of the schema object, which is not correct, because there may be $id that - // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor. - // Because of that 2 tests in recursiveRef.json fail. - // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`). - // (This problem is not tested in JSON-Schema-Test-Suite) - if (it.schemaEnv.root.dynamicAnchors[anchor]) { - const v = gen.let("_v", (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`); - gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid)); - } - else { - _callRef(it.validateName, valid)(); - } - } - function _callRef(validate, valid) { - return valid - ? () => gen.block(() => { - (0, ref_1.callRef)(cxt, validate); - gen.let(valid, true); - }) - : () => (0, ref_1.callRef)(cxt, validate); - } -} -exports.dynamicRef = dynamicRef; -exports.default = def; -//# sourceMappingURL=dynamicRef.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map b/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map deleted file mode 100644 index 921c893f7..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dynamicRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/dynamicRef.ts"],"names":[],"mappings":";;;AAEA,mDAAgE;AAChE,+CAAmC;AACnC,qCAAmC;AAEnC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC3C,CAAA;AAED,SAAgB,UAAU,CAAC,GAAe,EAAE,GAAW;IACrD,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAC9B,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,OAAO,yCAAyC,CAAC,CAAA;IACzF,MAAM,MAAM,GAAG,GAAG,CAAC,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,CAAC;AApCD,gCAoCC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts b/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts deleted file mode 100644 index 0c751d93f..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../../types"; -declare const dynamic: Vocabulary; -export default dynamic; diff --git a/node_modules/ajv/dist/vocabularies/dynamic/index.js b/node_modules/ajv/dist/vocabularies/dynamic/index.js deleted file mode 100644 index f2388a757..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/index.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dynamicAnchor_1 = require("./dynamicAnchor"); -const dynamicRef_1 = require("./dynamicRef"); -const recursiveAnchor_1 = require("./recursiveAnchor"); -const recursiveRef_1 = require("./recursiveRef"); -const dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default]; -exports.default = dynamic; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/index.js.map b/node_modules/ajv/dist/vocabularies/dynamic/index.js.map deleted file mode 100644 index f96ba76dd..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/index.ts"],"names":[],"mappings":";;AACA,mDAA2C;AAC3C,6CAAqC;AACrC,uDAA+C;AAC/C,iDAAyC;AAEzC,MAAM,OAAO,GAAe,CAAC,uBAAa,EAAE,oBAAU,EAAE,yBAAe,EAAE,sBAAY,CAAC,CAAA;AAEtF,kBAAe,OAAO,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts b/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js b/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js deleted file mode 100644 index 9fd832353..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dynamicAnchor_1 = require("./dynamicAnchor"); -const util_1 = require("../../compile/util"); -const def = { - keyword: "$recursiveAnchor", - schemaType: "boolean", - code(cxt) { - if (cxt.schema) - (0, dynamicAnchor_1.dynamicAnchor)(cxt, ""); - else - (0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored"); - }, -}; -exports.default = def; -//# sourceMappingURL=recursiveAnchor.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map b/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map deleted file mode 100644 index 5d5e381b0..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"recursiveAnchor.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/recursiveAnchor.ts"],"names":[],"mappings":";;AACA,mDAA6C;AAC7C,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,UAAU,EAAE,SAAS;IACrB,IAAI,CAAC,GAAG;QACN,IAAI,GAAG,CAAC,MAAM;YAAE,IAAA,6BAAa,EAAC,GAAG,EAAE,EAAE,CAAC,CAAA;;YACjC,IAAA,sBAAe,EAAC,GAAG,CAAC,EAAE,EAAE,oCAAoC,CAAC,CAAA;IACpE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts b/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js b/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js deleted file mode 100644 index 8cd5c6969..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dynamicRef_1 = require("./dynamicRef"); -const def = { - keyword: "$recursiveRef", - schemaType: "string", - code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema), -}; -exports.default = def; -//# sourceMappingURL=recursiveRef.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map b/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map deleted file mode 100644 index f81380446..000000000 --- a/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"recursiveRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/recursiveRef.ts"],"names":[],"mappings":";;AACA,6CAAuC;AAEvC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,uBAAU,EAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC3C,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/errors.d.ts b/node_modules/ajv/dist/vocabularies/errors.d.ts deleted file mode 100644 index be67f2e82..000000000 --- a/node_modules/ajv/dist/vocabularies/errors.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { TypeError } from "../compile/validate/dataType"; -import type { ApplicatorKeywordError } from "./applicator"; -import type { ValidationKeywordError } from "./validation"; -import type { FormatError } from "./format/format"; -import type { UnevaluatedPropertiesError } from "./unevaluated/unevaluatedProperties"; -import type { UnevaluatedItemsError } from "./unevaluated/unevaluatedItems"; -import type { DependentRequiredError } from "./validation/dependentRequired"; -import type { DiscriminatorError } from "./discriminator"; -export type DefinedError = TypeError | ApplicatorKeywordError | ValidationKeywordError | FormatError | UnevaluatedPropertiesError | UnevaluatedItemsError | DependentRequiredError | DiscriminatorError; diff --git a/node_modules/ajv/dist/vocabularies/errors.js b/node_modules/ajv/dist/vocabularies/errors.js deleted file mode 100644 index d4d3fba00..000000000 --- a/node_modules/ajv/dist/vocabularies/errors.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/errors.js.map b/node_modules/ajv/dist/vocabularies/errors.js.map deleted file mode 100644 index 56bad7362..000000000 --- a/node_modules/ajv/dist/vocabularies/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../lib/vocabularies/errors.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/format/format.d.ts b/node_modules/ajv/dist/vocabularies/format/format.d.ts deleted file mode 100644 index 04dc98f64..000000000 --- a/node_modules/ajv/dist/vocabularies/format/format.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export type FormatError = ErrorObject<"format", { - format: string; -}, string | { - $data: string; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/format/format.js b/node_modules/ajv/dist/vocabularies/format/format.js deleted file mode 100644 index aa667c1ef..000000000 --- a/node_modules/ajv/dist/vocabularies/format/format.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const error = { - message: ({ schemaCode }) => (0, codegen_1.str) `must match format "${schemaCode}"`, - params: ({ schemaCode }) => (0, codegen_1._) `{format: ${schemaCode}}`, -}; -const def = { - keyword: "format", - type: ["number", "string"], - schemaType: "string", - $data: true, - error, - code(cxt, ruleType) { - const { gen, data, $data, schema, schemaCode, it } = cxt; - const { opts, errSchemaPath, schemaEnv, self } = it; - if (!opts.validateFormats) - return; - if ($data) - validate$DataFormat(); - else - validateFormat(); - function validate$DataFormat() { - const fmts = gen.scopeValue("formats", { - ref: self.formats, - code: opts.code.formats, - }); - const fDef = gen.const("fDef", (0, codegen_1._) `${fmts}[${schemaCode}]`); - const fType = gen.let("fType"); - const format = gen.let("format"); - // TODO simplify - gen.if((0, codegen_1._) `typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._) `${fDef}.type || "string"`).assign(format, (0, codegen_1._) `${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._) `"string"`).assign(format, fDef)); - cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt())); - function unknownFmt() { - if (opts.strictSchema === false) - return codegen_1.nil; - return (0, codegen_1._) `${schemaCode} && !${format}`; - } - function invalidFmt() { - const callFormat = schemaEnv.$async - ? (0, codegen_1._) `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` - : (0, codegen_1._) `${format}(${data})`; - const validData = (0, codegen_1._) `(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`; - return (0, codegen_1._) `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`; - } - } - function validateFormat() { - const formatDef = self.formats[schema]; - if (!formatDef) { - unknownFormat(); - return; - } - if (formatDef === true) - return; - const [fmtType, format, fmtRef] = getFormat(formatDef); - if (fmtType === ruleType) - cxt.pass(validCondition()); - function unknownFormat() { - if (opts.strictSchema === false) { - self.logger.warn(unknownMsg()); - return; - } - throw new Error(unknownMsg()); - function unknownMsg() { - return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`; - } - } - function getFormat(fmtDef) { - const code = fmtDef instanceof RegExp - ? (0, codegen_1.regexpCode)(fmtDef) - : opts.code.formats - ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` - : undefined; - const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code }); - if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { - return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._) `${fmt}.validate`]; - } - return ["string", fmtDef, fmt]; - } - function validCondition() { - if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { - if (!schemaEnv.$async) - throw new Error("async format in sync schema"); - return (0, codegen_1._) `await ${fmtRef}(${data})`; - } - return typeof format == "function" ? (0, codegen_1._) `${fmtRef}(${data})` : (0, codegen_1._) `${fmtRef}.test(${data})`; - } - } - }, -}; -exports.default = def; -//# sourceMappingURL=format.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/format/format.js.map b/node_modules/ajv/dist/vocabularies/format/format.js.map deleted file mode 100644 index 897d9ded5..000000000 --- a/node_modules/ajv/dist/vocabularies/format/format.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../lib/vocabularies/format/format.ts"],"names":[],"mappings":";;AASA,mDAAoF;AAapF,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,sBAAsB,UAAU,GAAG;IACjE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,YAAY,UA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AC,KAAK,EAAE;oBACrF,IAAI,CAAC,SAAS,CAAC,MAAM;wBAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;oBACrE,OAAO,IAAA,WAAC,EAAA,SAAS,MAAM,IAAI,IAAI,GAAG,CAAA;iBACnC;gBACD,OAAO,OAAO,MAAM,IAAI,UAAU,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,SAAS,IAAI,GAAG,CAAA;YACzF,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/format/index.d.ts b/node_modules/ajv/dist/vocabularies/format/index.d.ts deleted file mode 100644 index c8019c9d6..000000000 --- a/node_modules/ajv/dist/vocabularies/format/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../../types"; -declare const format: Vocabulary; -export default format; diff --git a/node_modules/ajv/dist/vocabularies/format/index.js b/node_modules/ajv/dist/vocabularies/format/index.js deleted file mode 100644 index d19023d24..000000000 --- a/node_modules/ajv/dist/vocabularies/format/index.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const format_1 = require("./format"); -const format = [format_1.default]; -exports.default = format; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/format/index.js.map b/node_modules/ajv/dist/vocabularies/format/index.js.map deleted file mode 100644 index 6315bfe1f..000000000 --- a/node_modules/ajv/dist/vocabularies/format/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/format/index.ts"],"names":[],"mappings":";;AACA,qCAAoC;AAEpC,MAAM,MAAM,GAAe,CAAC,gBAAa,CAAC,CAAA;AAE1C,kBAAe,MAAM,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts b/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts deleted file mode 100644 index 85e16df6a..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import { _JTDTypeError } from "./error"; -import { DiscrError, DiscrErrorObj } from "../discriminator/types"; -export type JTDDiscriminatorError = _JTDTypeError<"discriminator", "object", string> | DiscrErrorObj | DiscrErrorObj; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/discriminator.js b/node_modules/ajv/dist/vocabularies/jtd/discriminator.js deleted file mode 100644 index e7074d279..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const metadata_1 = require("./metadata"); -const nullable_1 = require("./nullable"); -const error_1 = require("./error"); -const types_1 = require("../discriminator/types"); -const error = { - message: (cxt) => { - const { schema, params } = cxt; - return params.discrError - ? params.discrError === types_1.DiscrError.Tag - ? `tag "${schema}" must be string` - : `value of tag "${schema}" must be in mapping` - : (0, error_1.typeErrorMessage)(cxt, "object"); - }, - params: (cxt) => { - const { schema, params } = cxt; - return params.discrError - ? (0, codegen_1._) `{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}` - : (0, error_1.typeErrorParams)(cxt, "object"); - }, -}; -const def = { - keyword: "discriminator", - schemaType: "string", - implements: ["mapping"], - error, - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen, data, schema, parentSchema } = cxt; - const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data); - gen.if(cond); - validateDiscriminator(); - gen.elseIf((0, codegen_1.not)(valid)); - cxt.error(); - gen.endIf(); - cxt.ok(valid); - function validateDiscriminator() { - const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(schema)}`); - gen.if((0, codegen_1._) `${tag} === undefined`); - cxt.error(false, { discrError: types_1.DiscrError.Tag, tag }); - gen.elseIf((0, codegen_1._) `typeof ${tag} == "string"`); - validateMapping(tag); - gen.else(); - cxt.error(false, { discrError: types_1.DiscrError.Tag, tag }, { instancePath: schema }); - gen.endIf(); - } - function validateMapping(tag) { - gen.if(false); - for (const tagValue in parentSchema.mapping) { - gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); - gen.assign(valid, applyTagSchema(tagValue)); - } - gen.else(); - cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag }, { instancePath: schema, schemaPath: "mapping", parentSchema: true }); - gen.endIf(); - } - function applyTagSchema(schemaProp) { - const _valid = gen.name("valid"); - cxt.subschema({ - keyword: "mapping", - schemaProp, - jtdDiscriminator: schema, - }, _valid); - return _valid; - } - }, -}; -exports.default = def; -//# sourceMappingURL=discriminator.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map b/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map deleted file mode 100644 index 53cb717b6..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"discriminator.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/discriminator.ts"],"names":[],"mappings":";;AAEA,mDAA+D;AAC/D,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAwE;AACxE,kDAAgE;AAOhE,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAC5B,OAAO,MAAM,CAAC,UAAU;YACtB,CAAC,CAAC,MAAM,CAAC,UAAU,KAAK,kBAAU,CAAC,GAAG;gBACpC,CAAC,CAAC,QAAQ,MAAM,kBAAkB;gBAClC,CAAC,CAAC,iBAAiB,MA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,CACX;gBACE,OAAO,EAAE,SAAS;gBAClB,UAAU;gBACV,gBAAgB,EAAE,MAAM;aACzB,EACD,MAAM,CACP,CAAA;YACD,OAAO,MAAM,CAAA;QACf,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts b/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts deleted file mode 100644 index 82c942c35..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition, SchemaObject } from "../../types"; -import { _JTDTypeError } from "./error"; -export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/elements.js b/node_modules/ajv/dist/vocabularies/jtd/elements.js deleted file mode 100644 index 9b8fb548a..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/elements.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const util_1 = require("../../compile/util"); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const metadata_1 = require("./metadata"); -const nullable_1 = require("./nullable"); -const error_1 = require("./error"); -const def = { - keyword: "elements", - schemaType: "object", - error: (0, error_1.typeError)("array"), - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen, data, schema, it } = cxt; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - const [valid] = (0, nullable_1.checkNullable)(cxt); - gen.if((0, codegen_1.not)(valid), () => gen.if((0, codegen_1._) `Array.isArray(${data})`, () => gen.assign(valid, (0, code_1.validateArray)(cxt)), () => cxt.error())); - cxt.ok(valid); - }, -}; -exports.default = def; -//# sourceMappingURL=elements.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/elements.js.map b/node_modules/ajv/dist/vocabularies/jtd/elements.js.map deleted file mode 100644 index 38fe3a129..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/elements.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AACpD,kCAAqC;AACrC,mDAA4C;AAC5C,yCAAwC;AACxC,yCAAwC;AACxC,mCAAgD;AAIhD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAA,iBAAS,EAAC,OAAO,CAAC;IACzB,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClC,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CACtB,GAAG,CAAC,EAAE,CACJ,IAAA,WAAC,EAAA,iBAAiB,IAAI,GAAG,EACzB,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,EAC3C,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAClB,CACF,CAAA;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts b/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts deleted file mode 100644 index 8ba1790d7..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export type JTDEnumError = ErrorObject<"enum", { - allowedValues: string[]; -}, string[]>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/enum.js b/node_modules/ajv/dist/vocabularies/jtd/enum.js deleted file mode 100644 index 78b01ee37..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/enum.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const metadata_1 = require("./metadata"); -const nullable_1 = require("./nullable"); -const error = { - message: "must be equal to one of the allowed values", - params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`, -}; -const def = { - keyword: "enum", - schemaType: "array", - error, - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen, data, schema, schemaValue, parentSchema, it } = cxt; - if (schema.length === 0) - throw new Error("enum must have non-empty array"); - if (schema.length !== new Set(schema).size) - throw new Error("enum items must be unique"); - let valid; - const isString = (0, codegen_1._) `typeof ${data} == "string"`; - if (schema.length >= it.opts.loopEnum) { - let cond; - [valid, cond] = (0, nullable_1.checkNullable)(cxt, isString); - gen.if(cond, loopEnum); - } - else { - /* istanbul ignore if */ - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - valid = (0, codegen_1.and)(isString, (0, codegen_1.or)(...schema.map((value) => (0, codegen_1._) `${data} === ${value}`))); - if (parentSchema.nullable) - valid = (0, codegen_1.or)((0, codegen_1._) `${data} === null`, valid); - } - cxt.pass(valid); - function loopEnum() { - gen.forOf("v", schemaValue, (v) => gen.if((0, codegen_1._) `${valid} = ${data} === ${v}`, () => gen.break())); - } - }, -}; -exports.default = def; -//# sourceMappingURL=enum.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/enum.js.map b/node_modules/ajv/dist/vocabularies/jtd/enum.js.map deleted file mode 100644 index 663cc7c5d..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/enum.ts"],"names":[],"mappings":";;AAEA,mDAAsD;AACtD,yCAAwC;AACxC,yCAAwC;AAIxC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,4CAA4C;IACrD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,mBAAmB,UAAU,GAAG;CAC5D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,OAAO;IACnB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC9D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QAC1E,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;QACxF,IAAI,KAAW,CAAA;QACf,MAAM,QAAQ,GAAG,IAAA,WAAC,EAAA,UAAU,IAAI,cAAc,CAAA;QAC9C,IAAI,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE;YACrC,IAAI,IAAU,CACb;YAAA,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,IAAA,wBAAa,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YAC7C,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;SACvB;aAAM;YACL,wBAAwB;YACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;YACvE,KAAK,GAAG,IAAA,aAAG,EAAC,QAAQ,EAAE,IAAA,YAAE,EAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,CAAA;YACpF,IAAI,YAAY,CAAC,QAAQ;gBAAE,KAAK,GAAG,IAAA,YAAE,EAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,KAAK,CAAC,CAAA;SAClE;QACD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAEf,SAAS,QAAQ;YACf,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,WAAmB,EAAE,CAAC,CAAC,EAAE,EAAE,CACxC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,MAAM,IAAI,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAC1D,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/error.d.ts b/node_modules/ajv/dist/vocabularies/jtd/error.d.ts deleted file mode 100644 index d334ff54c..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { KeywordErrorDefinition, KeywordErrorCxt, ErrorObject } from "../../types"; -import { Code } from "../../compile/codegen"; -export type _JTDTypeError = ErrorObject; -export declare function typeError(t: string): KeywordErrorDefinition; -export declare function typeErrorMessage({ parentSchema }: KeywordErrorCxt, t: string): string; -export declare function typeErrorParams({ parentSchema }: KeywordErrorCxt, t: string): Code; diff --git a/node_modules/ajv/dist/vocabularies/jtd/error.js b/node_modules/ajv/dist/vocabularies/jtd/error.js deleted file mode 100644 index 1a3920a7e..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/error.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.typeErrorParams = exports.typeErrorMessage = exports.typeError = void 0; -const codegen_1 = require("../../compile/codegen"); -function typeError(t) { - return { - message: (cxt) => typeErrorMessage(cxt, t), - params: (cxt) => typeErrorParams(cxt, t), - }; -} -exports.typeError = typeError; -function typeErrorMessage({ parentSchema }, t) { - return (parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable) ? `must be ${t} or null` : `must be ${t}`; -} -exports.typeErrorMessage = typeErrorMessage; -function typeErrorParams({ parentSchema }, t) { - return (0, codegen_1._) `{type: ${t}, nullable: ${!!(parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable)}}`; -} -exports.typeErrorParams = typeErrorParams; -//# sourceMappingURL=error.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/error.js.map b/node_modules/ajv/dist/vocabularies/jtd/error.js.map deleted file mode 100644 index db5596787..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/error.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/error.ts"],"names":[],"mappings":";;;AACA,mDAA6C;AAQ7C,SAAgB,SAAS,CAAC,CAAS;IACjC,OAAO;QACL,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1C,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,CAAC;KACzC,CAAA;AACH,CAAC;AALD,8BAKC;AAED,SAAgB,gBAAgB,CAAC,EAAC,YAAY,EAAkB,EAAE,CAAS;IACzE,OAAO,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,EAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAA;AACzE,CAAC;AAFD,4CAEC;AAED,SAAgB,eAAe,CAAC,EAAC,YAAY,EAAkB,EAAE,CAAS;IACxE,OAAO,IAAA,WAAC,EAAA,UAAU,CAAC,eAAe,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,CAAA,GAAG,CAAA;AAC/D,CAAC;AAFD,0CAEC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/index.d.ts b/node_modules/ajv/dist/vocabularies/jtd/index.d.ts deleted file mode 100644 index c56246b78..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Vocabulary } from "../../types"; -import { JTDTypeError } from "./type"; -import { JTDEnumError } from "./enum"; -import { JTDElementsError } from "./elements"; -import { JTDPropertiesError } from "./properties"; -import { JTDDiscriminatorError } from "./discriminator"; -import { JTDValuesError } from "./values"; -declare const jtdVocabulary: Vocabulary; -export default jtdVocabulary; -export type JTDErrorObject = JTDTypeError | JTDEnumError | JTDElementsError | JTDPropertiesError | JTDDiscriminatorError | JTDValuesError; diff --git a/node_modules/ajv/dist/vocabularies/jtd/index.js b/node_modules/ajv/dist/vocabularies/jtd/index.js deleted file mode 100644 index 18f40ab7a..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/index.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const ref_1 = require("./ref"); -const type_1 = require("./type"); -const enum_1 = require("./enum"); -const elements_1 = require("./elements"); -const properties_1 = require("./properties"); -const optionalProperties_1 = require("./optionalProperties"); -const discriminator_1 = require("./discriminator"); -const values_1 = require("./values"); -const union_1 = require("./union"); -const metadata_1 = require("./metadata"); -const jtdVocabulary = [ - "definitions", - ref_1.default, - type_1.default, - enum_1.default, - elements_1.default, - properties_1.default, - optionalProperties_1.default, - discriminator_1.default, - values_1.default, - union_1.default, - metadata_1.default, - { keyword: "additionalProperties", schemaType: "boolean" }, - { keyword: "nullable", schemaType: "boolean" }, -]; -exports.default = jtdVocabulary; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/index.js.map b/node_modules/ajv/dist/vocabularies/jtd/index.js.map deleted file mode 100644 index 713a1875b..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/index.ts"],"names":[],"mappings":";;AACA,+BAA8B;AAC9B,iCAAgD;AAChD,iCAAgD;AAChD,yCAAqD;AACrD,6CAA2D;AAC3D,6DAAqD;AACrD,mDAAoE;AACpE,qCAA+C;AAC/C,mCAA2B;AAC3B,yCAAiC;AAEjC,MAAM,aAAa,GAAe;IAChC,aAAa;IACb,aAAU;IACV,cAAW;IACX,cAAW;IACX,kBAAQ;IACR,oBAAU;IACV,4BAAkB;IAClB,uBAAa;IACb,gBAAM;IACN,eAAK;IACL,kBAAQ;IACR,EAAC,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,SAAS,EAAC;IACxD,EAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC;CAC7C,CAAA;AAED,kBAAe,aAAa,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts b/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts deleted file mode 100644 index 86e15a8ed..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { KeywordCxt } from "../../ajv"; -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export declare function checkMetadata({ it, keyword }: KeywordCxt, metadata?: boolean): void; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/metadata.js b/node_modules/ajv/dist/vocabularies/jtd/metadata.js deleted file mode 100644 index eeb3c91cd..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/metadata.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkMetadata = void 0; -const util_1 = require("../../compile/util"); -const def = { - keyword: "metadata", - schemaType: "object", - code(cxt) { - checkMetadata(cxt); - const { gen, schema, it } = cxt; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - const valid = gen.name("valid"); - cxt.subschema({ keyword: "metadata", jtdMetadata: true }, valid); - cxt.ok(valid); - }, -}; -function checkMetadata({ it, keyword }, metadata) { - if (it.jtdMetadata !== metadata) { - throw new Error(`JTD: "${keyword}" cannot be used in this schema location`); - } -} -exports.checkMetadata = checkMetadata; -exports.default = def; -//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map b/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map deleted file mode 100644 index c22e73ada..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/metadata.ts"],"names":[],"mappings":";;;AAEA,6CAAoD;AAEpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,aAAa,CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;QAC9D,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,SAAgB,aAAa,CAAC,EAAC,EAAE,EAAE,OAAO,EAAa,EAAE,QAAkB;IACzE,IAAI,EAAE,CAAC,WAAW,KAAK,QAAQ,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,0CAA0C,CAAC,CAAA;KAC5E;AACH,CAAC;AAJD,sCAIC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts b/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts deleted file mode 100644 index 254f76023..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { KeywordCxt } from "../../compile/validate"; -import { Code, Name } from "../../compile/codegen"; -export declare function checkNullable({ gen, data, parentSchema }: KeywordCxt, cond?: Code): [Name, Code]; -export declare function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code]; diff --git a/node_modules/ajv/dist/vocabularies/jtd/nullable.js b/node_modules/ajv/dist/vocabularies/jtd/nullable.js deleted file mode 100644 index 8c92d2cde..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/nullable.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkNullableObject = exports.checkNullable = void 0; -const codegen_1 = require("../../compile/codegen"); -function checkNullable({ gen, data, parentSchema }, cond = codegen_1.nil) { - const valid = gen.name("valid"); - if (parentSchema.nullable) { - gen.let(valid, (0, codegen_1._) `${data} === null`); - cond = (0, codegen_1.not)(valid); - } - else { - gen.let(valid, false); - } - return [valid, cond]; -} -exports.checkNullable = checkNullable; -function checkNullableObject(cxt, cond) { - const [valid, cond_] = checkNullable(cxt, cond); - return [valid, (0, codegen_1._) `${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`]; -} -exports.checkNullableObject = checkNullableObject; -//# sourceMappingURL=nullable.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map b/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map deleted file mode 100644 index 5bfaf3279..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/nullable.ts"],"names":[],"mappings":";;;AACA,mDAA6D;AAE7D,SAAgB,aAAa,CAC3B,EAAC,GAAG,EAAE,IAAI,EAAE,YAAY,EAAa,EACrC,OAAa,aAAG;IAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,IAAI,YAAY,CAAC,QAAQ,EAAE;QACzB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,CAAC,CAAA;QACnC,IAAI,GAAG,IAAA,aAAG,EAAC,KAAK,CAAC,CAAA;KAClB;SAAM;QACL,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;KACtB;IACD,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAZD,sCAYC;AAED,SAAgB,mBAAmB,CAAC,GAAe,EAAE,IAAU;IAC7D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC/C,OAAO,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,KAAK,cAAc,GAAG,CAAC,IAAI,kCAAkC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAA;AAC9F,CAAC;AAHD,kDAGC"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts b/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js b/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js deleted file mode 100644 index fe272758f..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const properties_1 = require("./properties"); -const def = { - keyword: "optionalProperties", - schemaType: "object", - error: properties_1.error, - code(cxt) { - if (cxt.parentSchema.properties) - return; - (0, properties_1.validateProperties)(cxt); - }, -}; -exports.default = def; -//# sourceMappingURL=optionalProperties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map b/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map deleted file mode 100644 index 21e5f0d47..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"optionalProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/optionalProperties.ts"],"names":[],"mappings":";;AAEA,6CAAsD;AAEtD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,oBAAoB;IAC7B,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAL,kBAAK;IACL,IAAI,CAAC,GAAe;QAClB,IAAI,GAAG,CAAC,YAAY,CAAC,UAAU;YAAE,OAAM;QACvC,IAAA,+BAAkB,EAAC,GAAG,CAAC,CAAA;IACzB,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts b/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts deleted file mode 100644 index 54e3b347c..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaObject } from "../../types"; -import type { KeywordCxt } from "../../compile/validate"; -import { _JTDTypeError } from "./error"; -declare enum PropError { - Additional = "additional", - Missing = "missing" -} -type PropKeyword = "properties" | "optionalProperties"; -type PropSchema = { - [P in string]?: SchemaObject; -}; -export type JTDPropertiesError = _JTDTypeError | ErrorObject | ErrorObject; -export declare const error: KeywordErrorDefinition; -declare const def: CodeKeywordDefinition; -export declare function validateProperties(cxt: KeywordCxt): void; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/properties.js b/node_modules/ajv/dist/vocabularies/jtd/properties.js deleted file mode 100644 index f4e9de458..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/properties.js +++ /dev/null @@ -1,149 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateProperties = exports.error = void 0; -const code_1 = require("../code"); -const util_1 = require("../../compile/util"); -const codegen_1 = require("../../compile/codegen"); -const metadata_1 = require("./metadata"); -const nullable_1 = require("./nullable"); -const error_1 = require("./error"); -var PropError; -(function (PropError) { - PropError["Additional"] = "additional"; - PropError["Missing"] = "missing"; -})(PropError || (PropError = {})); -exports.error = { - message: (cxt) => { - const { params } = cxt; - return params.propError - ? params.propError === PropError.Additional - ? "must NOT have additional properties" - : `must have property '${params.missingProperty}'` - : (0, error_1.typeErrorMessage)(cxt, "object"); - }, - params: (cxt) => { - const { params } = cxt; - return params.propError - ? params.propError === PropError.Additional - ? (0, codegen_1._) `{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}` - : (0, codegen_1._) `{error: ${params.propError}, missingProperty: ${params.missingProperty}}` - : (0, error_1.typeErrorParams)(cxt, "object"); - }, -}; -const def = { - keyword: "properties", - schemaType: "object", - error: exports.error, - code: validateProperties, -}; -// const error: KeywordErrorDefinition = { -// message: "should NOT have additional properties", -// params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, -// } -function validateProperties(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen, data, parentSchema, it } = cxt; - const { additionalProperties, nullable } = parentSchema; - if (it.jtdDiscriminator && nullable) - throw new Error("JTD: nullable inside discriminator mapping"); - if (commonProperties()) { - throw new Error("JTD: properties and optionalProperties have common members"); - } - const [allProps, properties] = schemaProperties("properties"); - const [allOptProps, optProperties] = schemaProperties("optionalProperties"); - if (properties.length === 0 && optProperties.length === 0 && additionalProperties) { - return; - } - const [valid, cond] = it.jtdDiscriminator === undefined - ? (0, nullable_1.checkNullableObject)(cxt, data) - : [gen.let("valid", false), true]; - gen.if(cond, () => gen.assign(valid, true).block(() => { - validateProps(properties, "properties", true); - validateProps(optProperties, "optionalProperties"); - if (!additionalProperties) - validateAdditional(); - })); - cxt.pass(valid); - function commonProperties() { - const props = parentSchema.properties; - const optProps = parentSchema.optionalProperties; - if (!(props && optProps)) - return false; - for (const p in props) { - if (Object.prototype.hasOwnProperty.call(optProps, p)) - return true; - } - return false; - } - function schemaProperties(keyword) { - const schema = parentSchema[keyword]; - const allPs = schema ? (0, code_1.allSchemaProperties)(schema) : []; - if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) { - throw new Error(`JTD: discriminator tag used in ${keyword}`); - } - const ps = allPs.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p])); - return [allPs, ps]; - } - function validateProps(props, keyword, required) { - const _valid = gen.var("valid"); - for (const prop of props) { - gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => applyPropertySchema(prop, keyword, _valid), () => missingProperty(prop)); - cxt.ok(_valid); - } - function missingProperty(prop) { - if (required) { - gen.assign(_valid, false); - cxt.error(false, { propError: PropError.Missing, missingProperty: prop }, { schemaPath: prop }); - } - else { - gen.assign(_valid, true); - } - } - } - function applyPropertySchema(prop, keyword, _valid) { - cxt.subschema({ - keyword, - schemaProp: prop, - dataProp: prop, - }, _valid); - } - function validateAdditional() { - gen.forIn("key", data, (key) => { - const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator); - const addOptProp = isAdditional(key, allOptProps, "optionalProperties"); - const extra = addProp === true ? addOptProp : addOptProp === true ? addProp : (0, codegen_1.and)(addProp, addOptProp); - gen.if(extra, () => { - if (it.opts.removeAdditional) { - gen.code((0, codegen_1._) `delete ${data}[${key}]`); - } - else { - cxt.error(false, { propError: PropError.Additional, additionalProperty: key }, { instancePath: key, parentSchema: true }); - if (!it.opts.allErrors) - gen.break(); - } - }); - }); - } - function isAdditional(key, props, keyword, jtdDiscriminator) { - let additional; - if (props.length > 8) { - // TODO maybe an option instead of hard-coded 8? - const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema[keyword], keyword); - additional = (0, codegen_1.not)((0, code_1.isOwnProperty)(gen, propsSchema, key)); - if (jtdDiscriminator !== undefined) { - additional = (0, codegen_1.and)(additional, (0, codegen_1._) `${key} !== ${jtdDiscriminator}`); - } - } - else if (props.length || jtdDiscriminator !== undefined) { - const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props); - additional = (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._) `${key} !== ${p}`)); - } - else { - additional = true; - } - return additional; - } -} -exports.validateProperties = validateProperties; -exports.default = def; -//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/properties.js.map b/node_modules/ajv/dist/vocabularies/jtd/properties.js.map deleted file mode 100644 index 03997a3d0..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/properties.ts"],"names":[],"mappings":";;;AAOA,kCAA0E;AAC1E,6CAAoE;AACpE,mDAA6D;AAC7D,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAwE;AAExE,IAAK,SAGJ;AAHD,WAAK,SAAS;IACZ,sCAAyB,C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MAAM,CAAC,KAAK,CAAC,CAAA;YACpF,UAAU,GAAG,IAAA,aAAG,EAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;SACvD;aAAM;YACL,UAAU,GAAG,IAAI,CAAA;SAClB;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;AACH,CAAC;AA1HD,gDA0HC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts b/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts deleted file mode 100644 index ccdf84c0b..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CodeKeywordDefinition, AnySchemaObject } from "../../types"; -declare const def: CodeKeywordDefinition; -export declare function hasRef(schema: AnySchemaObject): boolean; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/ref.js b/node_modules/ajv/dist/vocabularies/jtd/ref.js deleted file mode 100644 index b7c6b02d7..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/ref.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hasRef = void 0; -const compile_1 = require("../../compile"); -const codegen_1 = require("../../compile/codegen"); -const ref_error_1 = require("../../compile/ref_error"); -const names_1 = require("../../compile/names"); -const ref_1 = require("../core/ref"); -const metadata_1 = require("./metadata"); -const def = { - keyword: "ref", - schemaType: "string", - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen, data, schema: ref, parentSchema, it } = cxt; - const { schemaEnv: { root }, } = it; - const valid = gen.name("valid"); - if (parentSchema.nullable) { - gen.var(valid, (0, codegen_1._) `${data} === null`); - gen.if((0, codegen_1.not)(valid), validateJtdRef); - } - else { - gen.var(valid, false); - validateJtdRef(); - } - cxt.ok(valid); - function validateJtdRef() { - var _a; - const refSchema = (_a = root.schema.definitions) === null || _a === void 0 ? void 0 : _a[ref]; - if (!refSchema) { - throw new ref_error_1.default(it.opts.uriResolver, "", ref, `No definition ${ref}`); - } - if (hasRef(refSchema) || !it.opts.inlineRefs) - callValidate(refSchema); - else - inlineRefSchema(refSchema); - } - function callValidate(schema) { - const sch = compile_1.compileSchema.call(it.self, new compile_1.SchemaEnv({ schema, root, schemaPath: `/definitions/${ref}` })); - const v = (0, ref_1.getValidate)(cxt, sch); - const errsCount = gen.const("_errs", names_1.default.errors); - (0, ref_1.callRef)(cxt, v, sch, sch.$async); - gen.assign(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); - } - function inlineRefSchema(schema) { - const schName = gen.scopeValue("schema", it.opts.code.source === true ? { ref: schema, code: (0, codegen_1.stringify)(schema) } : { ref: schema }); - cxt.subschema({ - schema, - dataTypes: [], - schemaPath: codegen_1.nil, - topSchemaRef: schName, - errSchemaPath: `/definitions/${ref}`, - }, valid); - } - }, -}; -function hasRef(schema) { - for (const key in schema) { - let sch; - if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) - return true; - } - return false; -} -exports.hasRef = hasRef; -exports.default = def; -//# sourceMappingURL=ref.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/ref.js.map b/node_modules/ajv/dist/vocabularies/jtd/ref.js.map deleted file mode 100644 index c11c45c1f..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/ref.ts"],"names":[],"mappings":";;;AAEA,2CAAsD;AACtD,mDAA4D;AAC5D,uDAAqD;AACrD,+CAAmC;AACnC,qCAAgD;AAChD,yCAAwC;AAExC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,IAAA,w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KAAK,CAAA;AACd,CAAC;AAND,wBAMC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/type.d.ts b/node_modules/ajv/dist/vocabularies/jtd/type.d.ts deleted file mode 100644 index a115c7dad..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import { _JTDTypeError } from "./error"; -export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType>; -export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"; -export declare const intRange: { - [T in IntType]: [number, number, number]; -}; -export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/type.js b/node_modules/ajv/dist/vocabularies/jtd/type.js deleted file mode 100644 index 17a0b5107..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/type.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.intRange = void 0; -const codegen_1 = require("../../compile/codegen"); -const timestamp_1 = require("../../runtime/timestamp"); -const util_1 = require("../../compile/util"); -const metadata_1 = require("./metadata"); -const error_1 = require("./error"); -exports.intRange = { - int8: [-128, 127, 3], - uint8: [0, 255, 3], - int16: [-32768, 32767, 5], - uint16: [0, 65535, 5], - int32: [-2147483648, 2147483647, 10], - uint32: [0, 4294967295, 10], -}; -const error = { - message: (cxt) => (0, error_1.typeErrorMessage)(cxt, cxt.schema), - params: (cxt) => (0, error_1.typeErrorParams)(cxt, cxt.schema), -}; -function timestampCode(cxt) { - const { gen, data, it } = cxt; - const { timestamp, allowDate } = it.opts; - if (timestamp === "date") - return (0, codegen_1._) `${data} instanceof Date `; - const vts = (0, util_1.useFunc)(gen, timestamp_1.default); - const allowDateArg = allowDate ? (0, codegen_1._) `, true` : codegen_1.nil; - const validString = (0, codegen_1._) `typeof ${data} == "string" && ${vts}(${data}${allowDateArg})`; - return timestamp === "string" ? validString : (0, codegen_1.or)((0, codegen_1._) `${data} instanceof Date`, validString); -} -const def = { - keyword: "type", - schemaType: "string", - error, - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { data, schema, parentSchema, it } = cxt; - let cond; - switch (schema) { - case "boolean": - case "string": - cond = (0, codegen_1._) `typeof ${data} == ${schema}`; - break; - case "timestamp": { - cond = timestampCode(cxt); - break; - } - case "float32": - case "float64": - cond = (0, codegen_1._) `typeof ${data} == "number"`; - break; - default: { - const sch = schema; - cond = (0, codegen_1._) `typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)`; - if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) { - if (sch === "uint32") - cond = (0, codegen_1._) `${cond} && ${data} >= 0`; - } - else { - const [min, max] = exports.intRange[sch]; - cond = (0, codegen_1._) `${cond} && ${data} >= ${min} && ${data} <= ${max}`; - } - } - } - cxt.pass(parentSchema.nullable ? (0, codegen_1.or)((0, codegen_1._) `${data} === null`, cond) : cond); - }, -}; -exports.default = def; -//# sourceMappingURL=type.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/type.js.map b/node_modules/ajv/dist/vocabularies/jtd/type.js.map deleted file mode 100644 index 9d3393907..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/type.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/type.ts"],"names":[],"mappings":";;;AAEA,mDAAsD;AACtD,uDAAoD;AACpD,6CAA0C;AAC1C,yCAAwC;AACxC,mCAAwE;AAM3D,QAAA,QAAQ,GAA+C;IAClE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACpB,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAClB,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,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AA,YAAE,EAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACxE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/union.d.ts b/node_modules/ajv/dist/vocabularies/jtd/union.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/union.js b/node_modules/ajv/dist/vocabularies/jtd/union.js deleted file mode 100644 index 01a943994..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/union.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const def = { - keyword: "union", - schemaType: "array", - trackErrors: true, - code: code_1.validateUnion, - error: { message: "must match a schema in union" }, -}; -exports.default = def; -//# sourceMappingURL=union.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/union.js.map b/node_modules/ajv/dist/vocabularies/jtd/union.js.map deleted file mode 100644 index 4d6eb4119..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/union.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/union.ts"],"names":[],"mappings":";;AACA,kCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE,EAAC,OAAO,EAAE,8BAA8B,EAAC;CACjD,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/values.d.ts b/node_modules/ajv/dist/vocabularies/jtd/values.d.ts deleted file mode 100644 index 1eaa884a5..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition, SchemaObject } from "../../types"; -import { _JTDTypeError } from "./error"; -export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/jtd/values.js b/node_modules/ajv/dist/vocabularies/jtd/values.js deleted file mode 100644 index 3c2c95f55..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/values.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const util_1 = require("../../compile/util"); -const codegen_1 = require("../../compile/codegen"); -const metadata_1 = require("./metadata"); -const nullable_1 = require("./nullable"); -const error_1 = require("./error"); -const def = { - keyword: "values", - schemaType: "object", - error: (0, error_1.typeError)("object"), - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen, data, schema, it } = cxt; - const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data); - if ((0, util_1.alwaysValidSchema)(it, schema)) { - gen.if((0, codegen_1.not)((0, codegen_1.or)(cond, valid)), () => cxt.error()); - } - else { - gen.if(cond); - gen.assign(valid, validateMap()); - gen.elseIf((0, codegen_1.not)(valid)); - cxt.error(); - gen.endIf(); - } - cxt.ok(valid); - function validateMap() { - const _valid = gen.name("valid"); - if (it.allErrors) { - const validMap = gen.let("valid", true); - validateValues(() => gen.assign(validMap, false)); - return validMap; - } - gen.var(_valid, true); - validateValues(() => gen.break()); - return _valid; - function validateValues(notValid) { - gen.forIn("key", data, (key) => { - cxt.subschema({ - keyword: "values", - dataProp: key, - dataPropType: util_1.Type.Str, - }, _valid); - gen.if((0, codegen_1.not)(_valid), notValid); - }); - } - } - }, -}; -exports.default = def; -//# sourceMappingURL=values.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/jtd/values.js.map b/node_modules/ajv/dist/vocabularies/jtd/values.js.map deleted file mode 100644 index 790a736d1..000000000 --- a/node_modules/ajv/dist/vocabularies/jtd/values.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/values.ts"],"names":[],"mappings":";;AAEA,6CAA0D;AAC1D,mDAAmD;AACnD,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAgD;AAIhD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAA,iBAAS,EAAC,QAAQ,CAAC;IAC1B,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,IAAA,8BAAmB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QACpD,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE;YACjC,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,IAAA,YAAE,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;SAChD;aAAM;YACL,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;YACZ,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,CAAA;YAChC,GAAG,CAAC,MAAM,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,CAAC,CAAA;YACtB,GAAG,CAAC,KAAK,EAAE,CAAA;YACX,GAAG,CAAC,KAAK,EAAE,CAAA;SACZ;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;QAEb,SAAS,WAAW;YAClB,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAChC,IAAI,EAAE,CAAC,SAAS,EAAE;gBAChB,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;gBACvC,cAAc,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAA;gBACjD,OAAO,QAAQ,CAAA;aAChB;YACD,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACrB,cAAc,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YACjC,OAAO,MAAM,CAAA;YAEb,SAAS,cAAc,CAAC,QAAoB;gBAC1C,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;oBAC7B,GAAG,CAAC,SAAS,CACX;wBACE,OAAO,EAAE,QAAQ;wBACjB,QAAQ,EAAE,GAAG;wBACb,YAAY,EAAE,WAAI,CAAC,GAAG;qBACvB,EACD,MAAM,CACP,CAAA;oBACD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAA;gBAC/B,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/metadata.d.ts b/node_modules/ajv/dist/vocabularies/metadata.d.ts deleted file mode 100644 index df9cc07ca..000000000 --- a/node_modules/ajv/dist/vocabularies/metadata.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../types"; -export declare const metadataVocabulary: Vocabulary; -export declare const contentVocabulary: Vocabulary; diff --git a/node_modules/ajv/dist/vocabularies/metadata.js b/node_modules/ajv/dist/vocabularies/metadata.js deleted file mode 100644 index f07bf28b5..000000000 --- a/node_modules/ajv/dist/vocabularies/metadata.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.contentVocabulary = exports.metadataVocabulary = void 0; -exports.metadataVocabulary = [ - "title", - "description", - "default", - "deprecated", - "readOnly", - "writeOnly", - "examples", -]; -exports.contentVocabulary = [ - "contentMediaType", - "contentEncoding", - "contentSchema", -]; -//# sourceMappingURL=metadata.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/metadata.js.map b/node_modules/ajv/dist/vocabularies/metadata.js.map deleted file mode 100644 index 0d61f0831..000000000 --- a/node_modules/ajv/dist/vocabularies/metadata.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../lib/vocabularies/metadata.ts"],"names":[],"mappings":";;;AAEa,QAAA,kBAAkB,GAAe;IAC5C,OAAO;IACP,aAAa;IACb,SAAS;IACT,YAAY;IACZ,UAAU;IACV,WAAW;IACX,UAAU;CACX,CAAA;AAEY,QAAA,iBAAiB,GAAe;IAC3C,kBAAkB;IAClB,iBAAiB;IACjB,eAAe;CAChB,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/next.d.ts b/node_modules/ajv/dist/vocabularies/next.d.ts deleted file mode 100644 index 7fd5c644b..000000000 --- a/node_modules/ajv/dist/vocabularies/next.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../types"; -declare const next: Vocabulary; -export default next; diff --git a/node_modules/ajv/dist/vocabularies/next.js b/node_modules/ajv/dist/vocabularies/next.js deleted file mode 100644 index c861b3243..000000000 --- a/node_modules/ajv/dist/vocabularies/next.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dependentRequired_1 = require("./validation/dependentRequired"); -const dependentSchemas_1 = require("./applicator/dependentSchemas"); -const limitContains_1 = require("./validation/limitContains"); -const next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default]; -exports.default = next; -//# sourceMappingURL=next.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/next.js.map b/node_modules/ajv/dist/vocabularies/next.js.map deleted file mode 100644 index 474a6d4e7..000000000 --- a/node_modules/ajv/dist/vocabularies/next.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"next.js","sourceRoot":"","sources":["../../lib/vocabularies/next.ts"],"names":[],"mappings":";;AACA,sEAA8D;AAC9D,oEAA4D;AAC5D,8DAAsD;AAEtD,MAAM,IAAI,GAAe,CAAC,2BAAiB,EAAE,0BAAgB,EAAE,uBAAa,CAAC,CAAA;AAE7E,kBAAe,IAAI,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts b/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts deleted file mode 100644 index ec67e63ea..000000000 --- a/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../../types"; -declare const unevaluated: Vocabulary; -export default unevaluated; diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/index.js b/node_modules/ajv/dist/vocabularies/unevaluated/index.js deleted file mode 100644 index 30e316748..000000000 --- a/node_modules/ajv/dist/vocabularies/unevaluated/index.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const unevaluatedProperties_1 = require("./unevaluatedProperties"); -const unevaluatedItems_1 = require("./unevaluatedItems"); -const unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default]; -exports.default = unevaluated; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map b/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map deleted file mode 100644 index a4872ea43..000000000 --- a/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/index.ts"],"names":[],"mappings":";;AACA,mEAA2D;AAC3D,yDAAiD;AAEjD,MAAM,WAAW,GAAe,CAAC,+BAAqB,EAAE,0BAAgB,CAAC,CAAA;AAEzE,kBAAe,WAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts deleted file mode 100644 index 06f023926..000000000 --- a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", { - limit: number; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js deleted file mode 100644 index 0a0cd3aa4..000000000 --- a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const error = { - message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`, - params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`, -}; -const def = { - keyword: "unevaluatedItems", - type: "array", - schemaType: ["boolean", "object"], - error, - code(cxt) { - const { gen, schema, data, it } = cxt; - const items = it.items || 0; - if (items === true) - return; - const len = gen.const("len", (0, codegen_1._) `${data}.length`); - if (schema === false) { - cxt.setParams({ len: items }); - cxt.fail((0, codegen_1._) `${len} > ${items}`); - } - else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { - const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items}`); - gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items)); - cxt.ok(valid); - } - it.items = true; - function validateItems(valid, from) { - gen.forRange("i", from, len, (i) => { - cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid); - if (!it.allErrors) - gen.if((0, codegen_1.not)(valid), () => gen.break()); - }); - } - }, -}; -exports.default = def; -//# sourceMappingURL=unevaluatedItems.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map deleted file mode 100644 index a8268f031..000000000 --- a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unevaluatedItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/unevaluatedItems.ts"],"names":[],"mappings":";;AAOA,mDAAuD;AACvD,6CAA0D;AAI1D,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,2BAA2B,GAAG,QAAQ;IACvE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,GAAG,GAAG;CAChD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,CAAA;QAC3B,IAAI,KAAK,KAAK,IAAI;YAAE,OAAM;QAC1B,MAAM,G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H,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts deleted file mode 100644 index ba63f62e8..000000000 --- a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export type UnevaluatedPropertiesError = ErrorObject<"unevaluatedProperties", { - unevaluatedProperty: string; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js deleted file mode 100644 index ad298499f..000000000 --- a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const names_1 = require("../../compile/names"); -const error = { - message: "must NOT have unevaluated properties", - params: ({ params }) => (0, codegen_1._) `{unevaluatedProperty: ${params.unevaluatedProperty}}`, -}; -const def = { - keyword: "unevaluatedProperties", - type: "object", - schemaType: ["boolean", "object"], - trackErrors: true, - error, - code(cxt) { - const { gen, schema, data, errsCount, it } = cxt; - /* istanbul ignore if */ - if (!errsCount) - throw new Error("ajv implementation error"); - const { allErrors, props } = it; - if (props instanceof codegen_1.Name) { - gen.if((0, codegen_1._) `${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key)))); - } - else if (props !== true) { - gen.forIn("key", data, (key) => props === undefined - ? unevaluatedPropCode(key) - : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key))); - } - it.props = true; - cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); - function unevaluatedPropCode(key) { - if (schema === false) { - cxt.setParams({ unevaluatedProperty: key }); - cxt.error(); - if (!allErrors) - gen.break(); - return; - } - if (!(0, util_1.alwaysValidSchema)(it, schema)) { - const valid = gen.name("valid"); - cxt.subschema({ - keyword: "unevaluatedProperties", - dataProp: key, - dataPropType: util_1.Type.Str, - }, valid); - if (!allErrors) - gen.if((0, codegen_1.not)(valid), () => gen.break()); - } - } - function unevaluatedDynamic(evaluatedProps, key) { - return (0, codegen_1._) `!${evaluatedProps} || !${evaluatedProps}[${key}]`; - } - function unevaluatedStatic(evaluatedProps, key) { - const ps = []; - for (const p in evaluatedProps) { - if (evaluatedProps[p] === true) - ps.push((0, codegen_1._) `${key} !== ${p}`); - } - return (0, codegen_1.and)(...ps); - } - }, -}; -exports.default = def; -//# sourceMappingURL=unevaluatedProperties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map b/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map deleted file mode 100644 index f415251ee..000000000 --- a/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unevaluatedProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/unevaluatedProperties.ts"],"names":[],"mappings":";;AAMA,mDAA6D;AAC7D,6CAA0D;AAC1D,+CAAmC;AAQnC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,sCAAsC;IAC/C,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,yBAAyB,MAAM,CAAC,mBAAmB,GAAG;CAC9E,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,uBAAuB;IAChC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAA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gBACzC,GAAG,CAAC,KAAK,EAAE,CAAA;gBACX,IAAI,CAAC,SAAS;oBAAE,GAAG,CAAC,KAAK,EAAE,CAAA;gBAC3B,OAAM;aACP;YAED,IAAI,CAAC,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE;gBAClC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;gBAC/B,GAAG,CAAC,SAAS,CACX;oBACE,OAAO,EAAE,uBAAuB;oBAChC,QAAQ,EAAE,GAAG;oBACb,YAAY,EAAE,WAAI,CAAC,GAAG;iBACvB,EACD,KAAK,CACN,CAAA;gBACD,IAAI,CAAC,SAAS;oBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;aACtD;QACH,CAAC;QAED,SAAS,kBAAkB,CAAC,cAAoB,EAAE,GAAS;YACzD,OAAO,IAAA,WAAC,EAAA,IAAI,cAAc,QAAQ,cAAc,IAAI,GAAG,GAAG,CAAA;QAC5D,CAAC;QAED,SAAS,iBAAiB,CAAC,cAAsC,EAAE,GAAS;YAC1E,MAAM,EAAE,GAAW,EAAE,CAAA;YACrB,KAAK,MAAM,CAAC,IAAI,cAAc,EAAE;gBAC9B,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI;oBAAE,EAAE,CAAC,IAAI,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;aAC5D;YACD,OAAO,IAAA,aAAG,EAAC,GAAG,EAAE,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/const.d.ts b/node_modules/ajv/dist/vocabularies/validation/const.d.ts deleted file mode 100644 index af91a9007..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/const.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export type ConstError = ErrorObject<"const", { - allowedValue: any; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/const.js b/node_modules/ajv/dist/vocabularies/validation/const.js deleted file mode 100644 index 9564496a6..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/const.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const equal_1 = require("../../runtime/equal"); -const error = { - message: "must be equal to constant", - params: ({ schemaCode }) => (0, codegen_1._) `{allowedValue: ${schemaCode}}`, -}; -const def = { - keyword: "const", - $data: true, - error, - code(cxt) { - const { gen, data, $data, schemaCode, schema } = cxt; - if ($data || (schema && typeof schema == "object")) { - cxt.fail$data((0, codegen_1._) `!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`); - } - else { - cxt.fail((0, codegen_1._) `${schema} !== ${data}`); - } - }, -}; -exports.default = def; -//# sourceMappingURL=const.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/const.js.map b/node_modules/ajv/dist/vocabularies/validation/const.js.map deleted file mode 100644 index 0cf6cd14c..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/const.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/const.ts"],"names":[],"mappings":";;AAEA,mDAAuC;AACvC,6CAA0C;AAC1C,+CAAuC;AAIvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,2BAA2B;IACpC,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,kBAAkB,UAAU,GAAG;CAC3D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAClD,IAAI,KAAK,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,CAAC,EAAE;YAClD,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,IAAA,cAAO,EAAC,GAAG,EAAE,eAAK,CAAC,IAAI,IAAI,KAAK,UAAU,GAAG,CAAC,CAAA;SAClE;aAAM;YACL,GAAG,CAAC,IAAI,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,QAAQ,IAAI,EAAE,CAAC,CAAA;SACnC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts b/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts deleted file mode 100644 index 00f0d370f..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -import { DependenciesErrorParams, PropertyDependencies } from "../applicator/dependencies"; -export type DependentRequiredError = ErrorObject<"dependentRequired", DependenciesErrorParams, PropertyDependencies>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js b/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js deleted file mode 100644 index 09e59639f..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dependencies_1 = require("../applicator/dependencies"); -const def = { - keyword: "dependentRequired", - type: "object", - schemaType: "object", - error: dependencies_1.error, - code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt), -}; -exports.default = def; -//# sourceMappingURL=dependentRequired.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map b/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map deleted file mode 100644 index c7e88f885..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dependentRequired.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/dependentRequired.ts"],"names":[],"mappings":";;AACA,6DAKmC;AAQnC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAL,oBAAK;IACL,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,mCAAoB,EAAC,GAAG,CAAC;CACzC,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/enum.d.ts b/node_modules/ajv/dist/vocabularies/validation/enum.d.ts deleted file mode 100644 index 6231082fe..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export type EnumError = ErrorObject<"enum", { - allowedValues: any[]; -}, any[] | { - $data: string; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/enum.js b/node_modules/ajv/dist/vocabularies/validation/enum.js deleted file mode 100644 index eab6487e9..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/enum.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const equal_1 = require("../../runtime/equal"); -const error = { - message: "must be equal to one of the allowed values", - params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`, -}; -const def = { - keyword: "enum", - schemaType: "array", - $data: true, - error, - code(cxt) { - const { gen, data, $data, schema, schemaCode, it } = cxt; - if (!$data && schema.length === 0) - throw new Error("enum must have non-empty array"); - const useLoop = schema.length >= it.opts.loopEnum; - let eql; - const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default))); - let valid; - if (useLoop || $data) { - valid = gen.let("valid"); - cxt.block$data(valid, loopEnum); - } - else { - /* istanbul ignore if */ - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - const vSchema = gen.const("vSchema", schemaCode); - valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i))); - } - cxt.pass(valid); - function loopEnum() { - gen.assign(valid, false); - gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break())); - } - function equalCode(vSchema, i) { - const sch = schema[i]; - return typeof sch === "object" && sch !== null - ? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])` - : (0, codegen_1._) `${data} === ${sch}`; - } - }, -}; -exports.default = def; -//# sourceMappingURL=enum.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/enum.js.map b/node_modules/ajv/dist/vocabularies/validation/enum.js.map deleted file mode 100644 index 7b4e1eda9..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/enum.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/enum.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AACvD,6CAA0C;AAC1C,+CAAuC;AAIvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,4CAA4C;IACrD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,mBAAmB,UAAU,GAAG;CAC5D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,OAAO;IAC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CAAC,KAAK,CAAC,GAAG,EAAE,UAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,CACvC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,EAAE,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAC7E,CAAA;QACH,CAAC;QAED,SAAS,SAAS,CAAC,OAAa,EAAE,CAAS;YACzC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;YACrB,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;gBAC5C,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,EAAE,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,IAAI;gBAC3C,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,QAAQ,GAAG,EAAE,CAAA;QAC3B,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/index.d.ts b/node_modules/ajv/dist/vocabularies/validation/index.d.ts deleted file mode 100644 index a078be554..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { ErrorObject, Vocabulary } from "../../types"; -import { LimitNumberError } from "./limitNumber"; -import { MultipleOfError } from "./multipleOf"; -import { PatternError } from "./pattern"; -import { RequiredError } from "./required"; -import { UniqueItemsError } from "./uniqueItems"; -import { ConstError } from "./const"; -import { EnumError } from "./enum"; -declare const validation: Vocabulary; -export default validation; -type LimitError = ErrorObject<"maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", { - limit: number; -}, number | { - $data: string; -}>; -export type ValidationKeywordError = LimitError | LimitNumberError | MultipleOfError | PatternError | RequiredError | UniqueItemsError | ConstError | EnumError; diff --git a/node_modules/ajv/dist/vocabularies/validation/index.js b/node_modules/ajv/dist/vocabularies/validation/index.js deleted file mode 100644 index 7b56b4e45..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/index.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const limitNumber_1 = require("./limitNumber"); -const multipleOf_1 = require("./multipleOf"); -const limitLength_1 = require("./limitLength"); -const pattern_1 = require("./pattern"); -const limitProperties_1 = require("./limitProperties"); -const required_1 = require("./required"); -const limitItems_1 = require("./limitItems"); -const uniqueItems_1 = require("./uniqueItems"); -const const_1 = require("./const"); -const enum_1 = require("./enum"); -const validation = [ - // number - limitNumber_1.default, - multipleOf_1.default, - // string - limitLength_1.default, - pattern_1.default, - // object - limitProperties_1.default, - required_1.default, - // array - limitItems_1.default, - uniqueItems_1.default, - // any - { keyword: "type", schemaType: ["string", "array"] }, - { keyword: "nullable", schemaType: "boolean" }, - const_1.default, - enum_1.default, -]; -exports.default = validation; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/index.js.map b/node_modules/ajv/dist/vocabularies/validation/index.js.map deleted file mode 100644 index 69436fb32..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/index.ts"],"names":[],"mappings":";;AACA,+CAA2D;AAC3D,6CAAwD;AACxD,+CAAuC;AACvC,uCAA+C;AAC/C,uDAA+C;AAC/C,yCAAkD;AAClD,6CAAqC;AACrC,+CAA2D;AAC3D,mCAAgD;AAChD,iCAA6C;AAE7C,MAAM,UAAU,GAAe;IAC7B,SAAS;IACT,qBAAW;IACX,oBAAU;IACV,SAAS;IACT,qBAAW;IACX,iBAAO;IACP,SAAS;IACT,yBAAe;IACf,kBAAQ;IACR,QAAQ;IACR,oBAAU;IACV,qBAAW;IACX,MAAM;IACN,EAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAC;IAClD,EAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC;IAC5C,eAAY;IACZ,cAAW;CACZ,CAAA;AAED,kBAAe,UAAU,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts b/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/limitContains.js b/node_modules/ajv/dist/vocabularies/validation/limitContains.js deleted file mode 100644 index c884dae4b..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitContains.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const util_1 = require("../../compile/util"); -const def = { - keyword: ["maxContains", "minContains"], - type: "array", - schemaType: "number", - code({ keyword, parentSchema, it }) { - if (parentSchema.contains === undefined) { - (0, util_1.checkStrictMode)(it, `"${keyword}" without "contains" is ignored`); - } - }, -}; -exports.default = def; -//# sourceMappingURL=limitContains.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map b/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map deleted file mode 100644 index 788010aa9..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"limitContains.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitContains.ts"],"names":[],"mappings":";;AAEA,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC;IACvC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,EAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAa;QAC1C,IAAI,YAAY,CAAC,QAAQ,KAAK,SAAS,EAAE;YACvC,IAAA,sBAAe,EAAC,EAAE,EAAE,IAAI,OAAO,iCAAiC,CAAC,CAAA;SAClE;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts b/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/limitItems.js b/node_modules/ajv/dist/vocabularies/validation/limitItems.js deleted file mode 100644 index e1386f887..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitItems.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const error = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxItems" ? "more" : "fewer"; - return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} items`; - }, - params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`, -}; -const def = { - keyword: ["maxItems", "minItems"], - type: "array", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { keyword, data, schemaCode } = cxt; - const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; - cxt.fail$data((0, codegen_1._) `${data}.length ${op} ${schemaCode}`); - }, -}; -exports.default = def; -//# sourceMappingURL=limitItems.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map b/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map deleted file mode 100644 index 690c73456..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"limitItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitItems.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AAEvD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACtD,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,QAAQ,CAAA;IAC5D,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,MAAM,EAAE,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QAC/D,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts b/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/limitLength.js b/node_modules/ajv/dist/vocabularies/validation/limitLength.js deleted file mode 100644 index 6ae5f92e6..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitLength.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const ucs2length_1 = require("../../runtime/ucs2length"); -const error = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxLength" ? "more" : "fewer"; - return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} characters`; - }, - params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`, -}; -const def = { - keyword: ["maxLength", "minLength"], - type: "string", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { keyword, data, schemaCode, it } = cxt; - const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; - const len = it.opts.unicode === false ? (0, codegen_1._) `${data}.length` : (0, codegen_1._) `${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`; - cxt.fail$data((0, codegen_1._) `${len} ${op} ${schemaCode}`); - }, -}; -exports.default = def; -//# sourceMappingURL=limitLength.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map b/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map deleted file mode 100644 index f09c35e54..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"limitLength.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitLength.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AACvD,6CAA0C;AAC1C,yDAAiD;AAEjD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACvD,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,aAAa,CAAA;IACjE,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;IACnC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC3C,MAAM,EAAE,GAAG,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QAChE,MAAM,GAAG,GACP,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAA,cAAO,EAAC,GAAG,CAAC,GAAG,EAAE,oBAAU,CAAC,IAAI,IAAI,GAAG,CAAA;QAC7F,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,IAAI,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IAC9C,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts b/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts deleted file mode 100644 index 7b35096df..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum"; -type Comparison = "<=" | ">=" | "<" | ">"; -export type LimitNumberError = ErrorObject; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/limitNumber.js b/node_modules/ajv/dist/vocabularies/validation/limitNumber.js deleted file mode 100644 index a97c0eb9d..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const ops = codegen_1.operators; -const KWDs = { - maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, - minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, - exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, - exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE }, -}; -const error = { - message: ({ keyword, schemaCode }) => (0, codegen_1.str) `must be ${KWDs[keyword].okStr} ${schemaCode}`, - params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`, -}; -const def = { - keyword: Object.keys(KWDs), - type: "number", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { keyword, data, schemaCode } = cxt; - cxt.fail$data((0, codegen_1._) `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); - }, -}; -exports.default = def; -//# sourceMappingURL=limitNumber.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map b/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map deleted file mode 100644 index 18a365337..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"limitNumber.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitNumber.ts"],"names":[],"mappings":";;AAEA,mDAA6D;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AAI,CAAC,OAAc,CAAC,CAAC,IAAI,IAAI,UAAU,aAAa,IAAI,GAAG,CAAC,CAAA;IACxF,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts b/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts deleted file mode 100644 index cde2aa270..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/limitProperties.js b/node_modules/ajv/dist/vocabularies/validation/limitProperties.js deleted file mode 100644 index e6fc40cc6..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const error = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxProperties" ? "more" : "fewer"; - return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`; - }, - params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`, -}; -const def = { - keyword: ["maxProperties", "minProperties"], - type: "object", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { keyword, data, schemaCode } = cxt; - const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; - cxt.fail$data((0, codegen_1._) `Object.keys(${data}).length ${op} ${schemaCode}`); - }, -}; -exports.default = def; -//# sourceMappingURL=limitProperties.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map b/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map deleted file mode 100644 index a695943a9..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"limitProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitProperties.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AAEvD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QAC3D,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,aAAa,CAAA;IACjE,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;IAC3C,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,MAAM,EAAE,GAAG,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QACpE,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,eAAe,IAAI,YAAY,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IACnE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts b/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts deleted file mode 100644 index 67685dcd3..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export type MultipleOfError = ErrorObject<"multipleOf", { - multipleOf: number; -}, number | { - $data: string; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/multipleOf.js b/node_modules/ajv/dist/vocabularies/validation/multipleOf.js deleted file mode 100644 index 43cf67b77..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const error = { - message: ({ schemaCode }) => (0, codegen_1.str) `must be multiple of ${schemaCode}`, - params: ({ schemaCode }) => (0, codegen_1._) `{multipleOf: ${schemaCode}}`, -}; -const def = { - keyword: "multipleOf", - type: "number", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { gen, data, schemaCode, it } = cxt; - // const bdt = bad$DataType(schemaCode, def.schemaType, $data) - const prec = it.opts.multipleOfPrecision; - const res = gen.let("res"); - const invalid = prec - ? (0, codegen_1._) `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` - : (0, codegen_1._) `${res} !== parseInt(${res})`; - cxt.fail$data((0, codegen_1._) `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`); - }, -}; -exports.default = def; -//# sourceMappingURL=multipleOf.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map b/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map deleted file mode 100644 index 9ef825b74..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"multipleOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/multipleOf.ts"],"names":[],"mappings":";;AAEA,mDAA4C;AAQ5C,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,uBAAuB,UAAU,EAAE;IACjE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,gBAAgB,UAAU,GAAG;CACzD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACvC,sEAAsE;QACtE,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAA;QACxC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC1B,MAAM,OAAO,GAAG,IAAI;YAClB,CAAC,CAAC,IAAA,WAAC,EAAA,uBAAuB,GAAG,OAAO,GAAG,UAAU,IAAI,EAAE;YACvD,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,iBAAiB,GAAG,GAAG,CAAA;QAClC,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,UAAU,cAAc,GAAG,MAAM,IAAI,IAAI,UAAU,KAAK,OAAO,IAAI,CAAC,CAAA;IACzF,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts b/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts deleted file mode 100644 index 7edbfda93..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export type PatternError = ErrorObject<"pattern", { - pattern: string; -}, string | { - $data: string; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/pattern.js b/node_modules/ajv/dist/vocabularies/validation/pattern.js deleted file mode 100644 index f8ccdf295..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/pattern.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const error = { - message: ({ schemaCode }) => (0, codegen_1.str) `must match pattern "${schemaCode}"`, - params: ({ schemaCode }) => (0, codegen_1._) `{pattern: ${schemaCode}}`, -}; -const def = { - keyword: "pattern", - type: "string", - schemaType: "string", - $data: true, - error, - code(cxt) { - const { data, $data, schema, schemaCode, it } = cxt; - // TODO regexp should be wrapped in try/catchs - const u = it.opts.unicodeRegExp ? "u" : ""; - const regExp = $data ? (0, codegen_1._) `(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema); - cxt.fail$data((0, codegen_1._) `!${regExp}.test(${data})`); - }, -}; -exports.default = def; -//# sourceMappingURL=pattern.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/pattern.js.map b/node_modules/ajv/dist/vocabularies/validation/pattern.js.map deleted file mode 100644 index 82fa5d74c..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/pattern.ts"],"names":[],"mappings":";;AAEA,kCAAkC;AAClC,mDAA4C;AAI5C,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,uBAAuB,UAAU,GAAG;IAClE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,aAAa,UAAU,GAAG;CACtD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,8CAA8C;QAC9C,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,eAAe,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,iBAAU,EAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QACrF,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,MAAM,SAAS,IAAI,GAAG,CAAC,CAAA;IAC5C,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/required.d.ts b/node_modules/ajv/dist/vocabularies/validation/required.d.ts deleted file mode 100644 index c9cffda1e..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/required.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export type RequiredError = ErrorObject<"required", { - missingProperty: string; -}, string[] | { - $data: string; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/required.js b/node_modules/ajv/dist/vocabularies/validation/required.js deleted file mode 100644 index 1d8e29263..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/required.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const error = { - message: ({ params: { missingProperty } }) => (0, codegen_1.str) `must have required property '${missingProperty}'`, - params: ({ params: { missingProperty } }) => (0, codegen_1._) `{missingProperty: ${missingProperty}}`, -}; -const def = { - keyword: "required", - type: "object", - schemaType: "array", - $data: true, - error, - code(cxt) { - const { gen, schema, schemaCode, data, $data, it } = cxt; - const { opts } = it; - if (!$data && schema.length === 0) - return; - const useLoop = schema.length >= opts.loopRequired; - if (it.allErrors) - allErrorsMode(); - else - exitOnErrorMode(); - if (opts.strictRequired) { - const props = cxt.parentSchema.properties; - const { definedProperties } = cxt.it; - for (const requiredKey of schema) { - if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; - const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`; - (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired); - } - } - } - function allErrorsMode() { - if (useLoop || $data) { - cxt.block$data(codegen_1.nil, loopAllRequired); - } - else { - for (const prop of schema) { - (0, code_1.checkReportMissingProp)(cxt, prop); - } - } - } - function exitOnErrorMode() { - const missing = gen.let("missing"); - if (useLoop || $data) { - const valid = gen.let("valid", true); - cxt.block$data(valid, () => loopUntilMissing(missing, valid)); - cxt.ok(valid); - } - else { - gen.if((0, code_1.checkMissingProp)(cxt, schema, missing)); - (0, code_1.reportMissingProp)(cxt, missing); - gen.else(); - } - } - function loopAllRequired() { - gen.forOf("prop", schemaCode, (prop) => { - cxt.setParams({ missingProperty: prop }); - gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error()); - }); - } - function loopUntilMissing(missing, valid) { - cxt.setParams({ missingProperty: missing }); - gen.forOf(missing, schemaCode, () => { - gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties)); - gen.if((0, codegen_1.not)(valid), () => { - cxt.error(); - gen.break(); - }); - }, codegen_1.nil); - } - }, -}; -exports.default = def; -//# sourceMappingURL=required.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/required.js.map b/node_modules/ajv/dist/vocabularies/validation/required.js.map deleted file mode 100644 index 0fcbee588..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/required.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"required.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,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,IAAI,EAAC,CAAC,CAAA;gBACtC,GAAG,CAAC,EAAE,CAAC,IAAA,uBAAgB,EAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YAClF,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,SAAS,gBAAgB,CAAC,OAAa,EAAE,KAAW;YAClD,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,OAAO,EAAC,CAAC,CAAA;YACzC,GAAG,CAAC,KAAK,CACP,OAAO,EACP,UAAkB,EAClB,GAAG,EAAE;gBACH,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,qBAAc,EAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAA;gBACzE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE;oBACtB,GAAG,CAAC,KAAK,EAAE,CAAA;oBACX,GAAG,CAAC,KAAK,EAAE,CAAA;gBACb,CAAC,CAAC,CAAA;YACJ,CAAC,EACD,aAAG,CACJ,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts b/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts deleted file mode 100644 index e7c241b98..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export type UniqueItemsError = ErrorObject<"uniqueItems", { - i: number; - j: number; -}, boolean | { - $data: string; -}>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js b/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js deleted file mode 100644 index cdbecea12..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dataType_1 = require("../../compile/validate/dataType"); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const equal_1 = require("../../runtime/equal"); -const error = { - message: ({ params: { i, j } }) => (0, codegen_1.str) `must NOT have duplicate items (items ## ${j} and ${i} are identical)`, - params: ({ params: { i, j } }) => (0, codegen_1._) `{i: ${i}, j: ${j}}`, -}; -const def = { - keyword: "uniqueItems", - type: "array", - schemaType: "boolean", - $data: true, - error, - code(cxt) { - const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt; - if (!$data && !schema) - return; - const valid = gen.let("valid"); - const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : []; - cxt.block$data(valid, validateUniqueItems, (0, codegen_1._) `${schemaCode} === false`); - cxt.ok(valid); - function validateUniqueItems() { - const i = gen.let("i", (0, codegen_1._) `${data}.length`); - const j = gen.let("j"); - cxt.setParams({ i, j }); - gen.assign(valid, true); - gen.if((0, codegen_1._) `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)); - } - function canOptimize() { - return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array"); - } - function loopN(i, j) { - const item = gen.name("item"); - const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong); - const indices = gen.const("indices", (0, codegen_1._) `{}`); - gen.for((0, codegen_1._) `;${i}--;`, () => { - gen.let(item, (0, codegen_1._) `${data}[${i}]`); - gen.if(wrongType, (0, codegen_1._) `continue`); - if (itemTypes.length > 1) - gen.if((0, codegen_1._) `typeof ${item} == "string"`, (0, codegen_1._) `${item} += "_"`); - gen - .if((0, codegen_1._) `typeof ${indices}[${item}] == "number"`, () => { - gen.assign(j, (0, codegen_1._) `${indices}[${item}]`); - cxt.error(); - gen.assign(valid, false).break(); - }) - .code((0, codegen_1._) `${indices}[${item}] = ${i}`); - }); - } - function loopN2(i, j) { - const eql = (0, util_1.useFunc)(gen, equal_1.default); - const outer = gen.name("outer"); - gen.label(outer).for((0, codegen_1._) `;${i}--;`, () => gen.for((0, codegen_1._) `${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._) `${eql}(${data}[${i}], ${data}[${j}])`, () => { - cxt.error(); - gen.assign(valid, false).break(outer); - }))); - } - }, -}; -exports.default = def; -//# sourceMappingURL=uniqueItems.js.map \ No newline at end of file diff --git a/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map b/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map deleted file mode 100644 index 46eb7a2a0..000000000 --- a/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uniqueItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/uniqueItems.ts"],"names":[],"mappings":";;AAEA,8DAAwF;AACxF,mDAAkD;AAClD,6CAA0C;AAC1C,+CAAuC;AAQvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,EAAC,EAAE,EAAE,CAC5B,IAAA,aAAG,EAAA,2CAA2C,CAAC,QAAQ,CAAC,iBAAiB;IAC3E,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,OAAO,CAAC,QAAQ,CAAC,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,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,CAAA;QACJ,CAAC;QAED,SAAS,MAAM,CAAC,CAAO,EAAE,CAAO;YAC9B,MAAM,GAAG,GAAG,IAAA,cAAO,EAAC,GAAG,EAAE,eAAK,CAAC,CAAA;YAC/B,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAC/B,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAA,WAAC,EAAA,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CACrC,GAAG,CAAC,GAAG,CAAC,IAAA,WAAC,EAAA,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,CACpC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE;gBACnD,GAAG,CAAC,KAAK,EAAE,CAAA;gBACX,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACvC,CAAC,CAAC,CACH,CACF,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/ajv/lib/2019.ts b/node_modules/ajv/lib/2019.ts deleted file mode 100644 index 45a3fa535..000000000 --- a/node_modules/ajv/lib/2019.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type {AnySchemaObject} from "./types" -import AjvCore, {Options} from "./core" - -import draft7Vocabularies from "./vocabularies/draft7" -import dynamicVocabulary from "./vocabularies/dynamic" -import nextVocabulary from "./vocabularies/next" -import unevaluatedVocabulary from "./vocabularies/unevaluated" -import discriminator from "./vocabularies/discriminator" -import addMetaSchema2019 from "./refs/json-schema-2019-09" - -const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema" - -class Ajv2019 extends AjvCore { - constructor(opts: Options = {}) { - super({ - ...opts, - dynamicRef: true, - next: true, - unevaluated: true, - }) - } - - _addVocabularies(): void { - super._addVocabularies() - this.addVocabulary(dynamicVocabulary) - draft7Vocabularies.forEach((v) => this.addVocabulary(v)) - this.addVocabulary(nextVocabulary) - this.addVocabulary(unevaluatedVocabulary) - if (this.opts.discriminator) this.addKeyword(discriminator) - } - - _addDefaultMetaSchema(): void { - super._addDefaultMetaSchema() - const {$data, meta} = this.opts - if (!meta) return - addMetaSchema2019.call(this, $data) - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID - } - - defaultMeta(): string | AnySchemaObject | undefined { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) - } -} - -module.exports = exports = Ajv2019 -Object.defineProperty(exports, "__esModule", {value: true}) - -export default Ajv2019 - -export { - Format, - FormatDefinition, - AsyncFormatDefinition, - KeywordDefinition, - KeywordErrorDefinition, - CodeKeywordDefinition, - MacroKeywordDefinition, - FuncKeywordDefinition, - Vocabulary, - Schema, - SchemaObject, - AnySchemaObject, - AsyncSchema, - AnySchema, - ValidateFunction, - AsyncValidateFunction, - ErrorObject, - ErrorNoParams, -} from "./types" - -export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" -export {SchemaCxt, SchemaObjCxt} from "./compile" -export {KeywordCxt} from "./compile/validate" -export {DefinedError} from "./vocabularies/errors" -export {JSONType} from "./compile/rules" -export {JSONSchemaType} from "./types/json-schema" -export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" -export {default as ValidationError} from "./runtime/validation_error" -export {default as MissingRefError} from "./compile/ref_error" diff --git a/node_modules/ajv/lib/2020.ts b/node_modules/ajv/lib/2020.ts deleted file mode 100644 index afbdda200..000000000 --- a/node_modules/ajv/lib/2020.ts +++ /dev/null @@ -1,74 +0,0 @@ -import type {AnySchemaObject} from "./types" -import AjvCore, {Options} from "./core" - -import draft2020Vocabularies from "./vocabularies/draft2020" -import discriminator from "./vocabularies/discriminator" -import addMetaSchema2020 from "./refs/json-schema-2020-12" - -const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema" - -class Ajv2020 extends AjvCore { - constructor(opts: Options = {}) { - super({ - ...opts, - dynamicRef: true, - next: true, - unevaluated: true, - }) - } - - _addVocabularies(): void { - super._addVocabularies() - draft2020Vocabularies.forEach((v) => this.addVocabulary(v)) - if (this.opts.discriminator) this.addKeyword(discriminator) - } - - _addDefaultMetaSchema(): void { - super._addDefaultMetaSchema() - const {$data, meta} = this.opts - if (!meta) return - addMetaSchema2020.call(this, $data) - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID - } - - defaultMeta(): string | AnySchemaObject | undefined { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) - } -} - -module.exports = exports = Ajv2020 -Object.defineProperty(exports, "__esModule", {value: true}) - -export default Ajv2020 - -export { - Format, - FormatDefinition, - AsyncFormatDefinition, - KeywordDefinition, - KeywordErrorDefinition, - CodeKeywordDefinition, - MacroKeywordDefinition, - FuncKeywordDefinition, - Vocabulary, - Schema, - SchemaObject, - AnySchemaObject, - AsyncSchema, - AnySchema, - ValidateFunction, - AsyncValidateFunction, - ErrorObject, - ErrorNoParams, -} from "./types" - -export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" -export {SchemaCxt, SchemaObjCxt} from "./compile" -export {KeywordCxt} from "./compile/validate" -export {DefinedError} from "./vocabularies/errors" -export {JSONType} from "./compile/rules" -export {JSONSchemaType} from "./types/json-schema" -export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" -export {default as ValidationError} from "./runtime/validation_error" -export {default as MissingRefError} from "./compile/ref_error" diff --git a/node_modules/ajv/lib/ajv.ts b/node_modules/ajv/lib/ajv.ts deleted file mode 100644 index 7f87c8aea..000000000 --- a/node_modules/ajv/lib/ajv.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type {AnySchemaObject} from "./types" -import AjvCore from "./core" -import draft7Vocabularies from "./vocabularies/draft7" -import discriminator from "./vocabularies/discriminator" -import * as draft7MetaSchema from "./refs/json-schema-draft-07.json" - -const META_SUPPORT_DATA = ["/properties"] - -const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema" - -class Ajv extends AjvCore { - _addVocabularies(): void { - super._addVocabularies() - draft7Vocabularies.forEach((v) => this.addVocabulary(v)) - if (this.opts.discriminator) this.addKeyword(discriminator) - } - - _addDefaultMetaSchema(): void { - super._addDefaultMetaSchema() - if (!this.opts.meta) return - const metaSchema = this.opts.$data - ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) - : draft7MetaSchema - this.addMetaSchema(metaSchema, META_SCHEMA_ID, false) - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID - } - - defaultMeta(): string | AnySchemaObject | undefined { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) - } -} - -module.exports = exports = Ajv -Object.defineProperty(exports, "__esModule", {value: true}) - -export default Ajv - -export { - Format, - FormatDefinition, - AsyncFormatDefinition, - KeywordDefinition, - KeywordErrorDefinition, - CodeKeywordDefinition, - MacroKeywordDefinition, - FuncKeywordDefinition, - Vocabulary, - Schema, - SchemaObject, - AnySchemaObject, - AsyncSchema, - AnySchema, - ValidateFunction, - AsyncValidateFunction, - SchemaValidateFunction, - ErrorObject, - ErrorNoParams, -} from "./types" - -export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" -export {SchemaCxt, SchemaObjCxt} from "./compile" -export {KeywordCxt} from "./compile/validate" -export {DefinedError} from "./vocabularies/errors" -export {JSONType} from "./compile/rules" -export {JSONSchemaType} from "./types/json-schema" -export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" -export {default as ValidationError} from "./runtime/validation_error" -export {default as MissingRefError} from "./compile/ref_error" diff --git a/node_modules/ajv/lib/compile/codegen/code.ts b/node_modules/ajv/lib/compile/codegen/code.ts deleted file mode 100644 index b17701973..000000000 --- a/node_modules/ajv/lib/compile/codegen/code.ts +++ /dev/null @@ -1,168 +0,0 @@ -export abstract class _CodeOrName { - abstract readonly str: string - abstract readonly names: UsedNames - abstract toString(): string - abstract emptyStr(): boolean -} - -export const IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i - -export class Name extends _CodeOrName { - readonly str: string - constructor(s: string) { - super() - if (!IDENTIFIER.test(s)) throw new Error("CodeGen: name must be a valid identifier") - this.str = s - } - - toString(): string { - return this.str - } - - emptyStr(): boolean { - return false - } - - get names(): UsedNames { - return {[this.str]: 1} - } -} - -export class _Code extends _CodeOrName { - readonly _items: readonly CodeItem[] - private _str?: string - private _names?: UsedNames - - constructor(code: string | readonly CodeItem[]) { - super() - this._items = typeof code === "string" ? [code] : code - } - - toString(): string { - return this.str - } - - emptyStr(): boolean { - if (this._items.length > 1) return false - const item = this._items[0] - return item === "" || item === '""' - } - - get str(): string { - return (this._str ??= this._items.reduce((s: string, c: CodeItem) => `${s}${c}`, "")) - } - - get names(): UsedNames { - return (this._names ??= this._items.reduce((names: UsedNames, c) => { - if (c instanceof Name) names[c.str] = (names[c.str] || 0) + 1 - return names - }, {})) - } -} - -export type CodeItem = Name | string | number | boolean | null - -export type UsedNames = Record - -export type Code = _Code | Name - -export type SafeExpr = Code | number | boolean | null - -export const nil = new _Code("") - -type CodeArg = SafeExpr | string | undefined - -export function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code { - const code: CodeItem[] = [strs[0]] - let i = 0 - while (i < args.length) { - addCodeArg(code, args[i]) - code.push(strs[++i]) - } - return new _Code(code) -} - -const plus = new _Code("+") - -export function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code { - const expr: CodeItem[] = [safeStringify(strs[0])] - let i = 0 - while (i < args.length) { - expr.push(plus) - addCodeArg(expr, args[i]) - expr.push(plus, safeStringify(strs[++i])) - } - optimize(expr) - return new _Code(expr) -} - -export function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void { - if (arg instanceof _Code) code.push(...arg._items) - else if (arg instanceof Name) code.push(arg) - else code.push(interpolate(arg)) -} - -function optimize(expr: CodeItem[]): void { - let i = 1 - while (i < expr.length - 1) { - if (expr[i] === plus) { - const res = mergeExprItems(expr[i - 1], expr[i + 1]) - if (res !== undefined) { - expr.splice(i - 1, 3, res) - continue - } - expr[i++] = "+" - } - i++ - } -} - -function mergeExprItems(a: CodeItem, b: CodeItem): CodeItem | undefined { - if (b === '""') return a - if (a === '""') return b - if (typeof a == "string") { - if (b instanceof Name || a[a.length - 1] !== '"') return - if (typeof b != "string") return `${a.slice(0, -1)}${b}"` - if (b[0] === '"') return a.slice(0, -1) + b.slice(1) - return - } - if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) return `"${a}${b.slice(1)}` - return -} - -export function strConcat(c1: Code, c2: Code): Code { - return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}` -} - -// TODO do not allow arrays here -function interpolate(x?: string | string[] | number | boolean | null): SafeExpr | string { - return typeof x == "number" || typeof x == "boolean" || x === null - ? x - : safeStringify(Array.isArray(x) ? x.join(",") : x) -} - -export function stringify(x: unknown): Code { - return new _Code(safeStringify(x)) -} - -export function safeStringify(x: unknown): string { - return JSON.stringify(x) - .replace(/\u2028/g, "\\u2028") - .replace(/\u2029/g, "\\u2029") -} - -export function getProperty(key: Code | string | number): Code { - return typeof key == "string" && IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]` -} - -//Does best effort to format the name properly -export function getEsmExportName(key: Code | string | number): Code { - if (typeof key == "string" && IDENTIFIER.test(key)) { - return new _Code(`${key}`) - } - throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`) -} - -export function regexpCode(rx: RegExp): Code { - return new _Code(rx.toString()) -} diff --git a/node_modules/ajv/lib/compile/codegen/index.ts b/node_modules/ajv/lib/compile/codegen/index.ts deleted file mode 100644 index 9d29055dc..000000000 --- a/node_modules/ajv/lib/compile/codegen/index.ts +++ /dev/null @@ -1,832 +0,0 @@ -import type {ScopeValueSets, NameValue, ValueScope, ValueScopeName} from "./scope" -import {_, nil, _Code, Code, Name, UsedNames, CodeItem, addCodeArg, _CodeOrName} from "./code" -import {Scope, varKinds} from "./scope" - -export {_, str, strConcat, nil, getProperty, stringify, regexpCode, Name, Code} from "./code" -export {Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds} from "./scope" - -// type for expressions that can be safely inserted in code without quotes -export type SafeExpr = Code | number | boolean | null - -// type that is either Code of function that adds code to CodeGen instance using its methods -export type Block = Code | (() => void) - -export const operators = { - GT: new _Code(">"), - GTE: new _Code(">="), - LT: new _Code("<"), - LTE: new _Code("<="), - EQ: new _Code("==="), - NEQ: new _Code("!=="), - NOT: new _Code("!"), - OR: new _Code("||"), - AND: new _Code("&&"), - ADD: new _Code("+"), -} - -abstract class Node { - abstract readonly names: UsedNames - - optimizeNodes(): this | ChildNode | ChildNode[] | undefined { - return this - } - - optimizeNames(_names: UsedNames, _constants: Constants): this | undefined { - return this - } - - // get count(): number { - // return 1 - // } -} - -class Def extends Node { - constructor(private readonly varKind: Name, private readonly name: Name, private rhs?: SafeExpr) { - super() - } - - render({es5, _n}: CGOptions): string { - const varKind = es5 ? varKinds.var : this.varKind - const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}` - return `${varKind} ${this.name}${rhs};` + _n - } - - optimizeNames(names: UsedNames, constants: Constants): this | undefined { - if (!names[this.name.str]) return - if (this.rhs) this.rhs = optimizeExpr(this.rhs, names, constants) - return this - } - - get names(): UsedNames { - return this.rhs instanceof _CodeOrName ? this.rhs.names : {} - } -} - -class Assign extends Node { - constructor(readonly lhs: Code, public rhs: SafeExpr, private readonly sideEffects?: boolean) { - super() - } - - render({_n}: CGOptions): string { - return `${this.lhs} = ${this.rhs};` + _n - } - - optimizeNames(names: UsedNames, constants: Constants): this | undefined { - if (this.lhs instanceof Name && !names[this.lhs.str] && !this.sideEffects) return - this.rhs = optimizeExpr(this.rhs, names, constants) - return this - } - - get names(): UsedNames { - const names = this.lhs instanceof Name ? {} : {...this.lhs.names} - return addExprNames(names, this.rhs) - } -} - -class AssignOp extends Assign { - constructor(lhs: Code, private readonly op: Code, rhs: SafeExpr, sideEffects?: boolean) { - super(lhs, rhs, sideEffects) - } - - render({_n}: CGOptions): string { - return `${this.lhs} ${this.op}= ${this.rhs};` + _n - } -} - -class Label extends Node { - readonly names: UsedNames = {} - constructor(readonly label: Name) { - super() - } - - render({_n}: CGOptions): string { - return `${this.label}:` + _n - } -} - -class Break extends Node { - readonly names: UsedNames = {} - constructor(readonly label?: Code) { - super() - } - - render({_n}: CGOptions): string { - const label = this.label ? ` ${this.label}` : "" - return `break${label};` + _n - } -} - -class Throw extends Node { - constructor(readonly error: Code) { - super() - } - - render({_n}: CGOptions): string { - return `throw ${this.error};` + _n - } - - get names(): UsedNames { - return this.error.names - } -} - -class AnyCode extends Node { - constructor(private code: SafeExpr) { - super() - } - - render({_n}: CGOptions): string { - return `${this.code};` + _n - } - - optimizeNodes(): this | undefined { - return `${this.code}` ? this : undefined - } - - optimizeNames(names: UsedNames, constants: Constants): this { - this.code = optimizeExpr(this.code, names, constants) - return this - } - - get names(): UsedNames { - return this.code instanceof _CodeOrName ? this.code.names : {} - } -} - -abstract class ParentNode extends Node { - constructor(readonly nodes: ChildNode[] = []) { - super() - } - - render(opts: CGOptions): string { - return this.nodes.reduce((code, n) => code + n.render(opts), "") - } - - optimizeNodes(): this | ChildNode | ChildNode[] | undefined { - const {nodes} = this - let i = nodes.length - while (i--) { - const n = nodes[i].optimizeNodes() - if (Array.isArray(n)) nodes.splice(i, 1, ...n) - else if (n) nodes[i] = n - else nodes.splice(i, 1) - } - return nodes.length > 0 ? this : undefined - } - - optimizeNames(names: UsedNames, constants: Constants): this | undefined { - const {nodes} = this - let i = nodes.length - while (i--) { - // iterating backwards improves 1-pass optimization - const n = nodes[i] - if (n.optimizeNames(names, constants)) continue - subtractNames(names, n.names) - nodes.splice(i, 1) - } - return nodes.length > 0 ? this : undefined - } - - get names(): UsedNames { - return this.nodes.reduce((names: UsedNames, n) => addNames(names, n.names), {}) - } - - // get count(): number { - // return this.nodes.reduce((c, n) => c + n.count, 1) - // } -} - -abstract class BlockNode extends ParentNode { - render(opts: CGOptions): string { - return "{" + opts._n + super.render(opts) + "}" + opts._n - } -} - -class Root extends ParentNode {} - -class Else extends BlockNode { - static readonly kind = "else" -} - -class If extends BlockNode { - static readonly kind = "if" - else?: If | Else - constructor(private condition: Code | boolean, nodes?: ChildNode[]) { - super(nodes) - } - - render(opts: CGOptions): string { - let code = `if(${this.condition})` + super.render(opts) - if (this.else) code += "else " + this.else.render(opts) - return code - } - - optimizeNodes(): If | ChildNode[] | undefined { - super.optimizeNodes() - const cond = this.condition - if (cond === true) return this.nodes // else is ignored here - let e = this.else - if (e) { - const ns = e.optimizeNodes() - e = this.else = Array.isArray(ns) ? new Else(ns) : (ns as Else | undefined) - } - if (e) { - if (cond === false) return e instanceof If ? e : e.nodes - if (this.nodes.length) return this - return new If(not(cond), e instanceof If ? [e] : e.nodes) - } - if (cond === false || !this.nodes.length) return undefined - return this - } - - optimizeNames(names: UsedNames, constants: Constants): this | undefined { - this.else = this.else?.optimizeNames(names, constants) - if (!(super.optimizeNames(names, constants) || this.else)) return - this.condition = optimizeExpr(this.condition, names, constants) - return this - } - - get names(): UsedNames { - const names = super.names - addExprNames(names, this.condition) - if (this.else) addNames(names, this.else.names) - return names - } - - // get count(): number { - // return super.count + (this.else?.count || 0) - // } -} - -abstract class For extends BlockNode { - static readonly kind = "for" -} - -class ForLoop extends For { - constructor(private iteration: Code) { - super() - } - - render(opts: CGOptions): string { - return `for(${this.iteration})` + super.render(opts) - } - - optimizeNames(names: UsedNames, constants: Constants): this | undefined { - if (!super.optimizeNames(names, constants)) return - this.iteration = optimizeExpr(this.iteration, names, constants) - return this - } - - get names(): UsedNames { - return addNames(super.names, this.iteration.names) - } -} - -class ForRange extends For { - constructor( - private readonly varKind: Name, - private readonly name: Name, - private readonly from: SafeExpr, - private readonly to: SafeExpr - ) { - super() - } - - render(opts: CGOptions): string { - const varKind = opts.es5 ? varKinds.var : this.varKind - const {name, from, to} = this - return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts) - } - - get names(): UsedNames { - const names = addExprNames(super.names, this.from) - return addExprNames(names, this.to) - } -} - -class ForIter extends For { - constructor( - private readonly loop: "of" | "in", - private readonly varKind: Name, - private readonly name: Name, - private iterable: Code - ) { - super() - } - - render(opts: CGOptions): string { - return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts) - } - - optimizeNames(names: UsedNames, constants: Constants): this | undefined { - if (!super.optimizeNames(names, constants)) return - this.iterable = optimizeExpr(this.iterable, names, constants) - return this - } - - get names(): UsedNames { - return addNames(super.names, this.iterable.names) - } -} - -class Func extends BlockNode { - static readonly kind = "func" - constructor(public name: Name, public args: Code, public async?: boolean) { - super() - } - - render(opts: CGOptions): string { - const _async = this.async ? "async " : "" - return `${_async}function ${this.name}(${this.args})` + super.render(opts) - } -} - -class Return extends ParentNode { - static readonly kind = "return" - - render(opts: CGOptions): string { - return "return " + super.render(opts) - } -} - -class Try extends BlockNode { - catch?: Catch - finally?: Finally - - render(opts: CGOptions): string { - let code = "try" + super.render(opts) - if (this.catch) code += this.catch.render(opts) - if (this.finally) code += this.finally.render(opts) - return code - } - - optimizeNodes(): this { - super.optimizeNodes() - this.catch?.optimizeNodes() as Catch | undefined - this.finally?.optimizeNodes() as Finally | undefined - return this - } - - optimizeNames(names: UsedNames, constants: Constants): this { - super.optimizeNames(names, constants) - this.catch?.optimizeNames(names, constants) - this.finally?.optimizeNames(names, constants) - return this - } - - get names(): UsedNames { - const names = super.names - if (this.catch) addNames(names, this.catch.names) - if (this.finally) addNames(names, this.finally.names) - return names - } - - // get count(): number { - // return super.count + (this.catch?.count || 0) + (this.finally?.count || 0) - // } -} - -class Catch extends BlockNode { - static readonly kind = "catch" - constructor(readonly error: Name) { - super() - } - - render(opts: CGOptions): string { - return `catch(${this.error})` + super.render(opts) - } -} - -class Finally extends BlockNode { - static readonly kind = "finally" - render(opts: CGOptions): string { - return "finally" + super.render(opts) - } -} - -type StartBlockNode = If | For | Func | Return | Try - -type LeafNode = Def | Assign | Label | Break | Throw | AnyCode - -type ChildNode = StartBlockNode | LeafNode - -type EndBlockNodeType = - | typeof If - | typeof Else - | typeof For - | typeof Func - | typeof Return - | typeof Catch - | typeof Finally - -type Constants = Record - -export interface CodeGenOptions { - es5?: boolean - lines?: boolean - ownProperties?: boolean -} - -interface CGOptions extends CodeGenOptions { - _n: "\n" | "" -} - -export class CodeGen { - readonly _scope: Scope - readonly _extScope: ValueScope - readonly _values: ScopeValueSets = {} - private readonly _nodes: ParentNode[] - private readonly _blockStarts: number[] = [] - private readonly _constants: Constants = {} - private readonly opts: CGOptions - - constructor(extScope: ValueScope, opts: CodeGenOptions = {}) { - this.opts = {...opts, _n: opts.lines ? "\n" : ""} - this._extScope = extScope - this._scope = new Scope({parent: extScope}) - this._nodes = [new Root()] - } - - toString(): string { - return this._root.render(this.opts) - } - - // returns unique name in the internal scope - name(prefix: string): Name { - return this._scope.name(prefix) - } - - // reserves unique name in the external scope - scopeName(prefix: string): ValueScopeName { - return this._extScope.name(prefix) - } - - // reserves unique name in the external scope and assigns value to it - scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name { - const name = this._extScope.value(prefixOrName, value) - const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set()) - vs.add(name) - return name - } - - getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined { - return this._extScope.getValue(prefix, keyOrRef) - } - - // return code that assigns values in the external scope to the names that are used internally - // (same names that were returned by gen.scopeName or gen.scopeValue) - scopeRefs(scopeName: Name): Code { - return this._extScope.scopeRefs(scopeName, this._values) - } - - scopeCode(): Code { - return this._extScope.scopeCode(this._values) - } - - private _def( - varKind: Name, - nameOrPrefix: Name | string, - rhs?: SafeExpr, - constant?: boolean - ): Name { - const name = this._scope.toName(nameOrPrefix) - if (rhs !== undefined && constant) this._constants[name.str] = rhs - this._leafNode(new Def(varKind, name, rhs)) - return name - } - - // `const` declaration (`var` in es5 mode) - const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name { - return this._def(varKinds.const, nameOrPrefix, rhs, _constant) - } - - // `let` declaration with optional assignment (`var` in es5 mode) - let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name { - return this._def(varKinds.let, nameOrPrefix, rhs, _constant) - } - - // `var` declaration with optional assignment - var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name { - return this._def(varKinds.var, nameOrPrefix, rhs, _constant) - } - - // assignment code - assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen { - return this._leafNode(new Assign(lhs, rhs, sideEffects)) - } - - // `+=` code - add(lhs: Code, rhs: SafeExpr): CodeGen { - return this._leafNode(new AssignOp(lhs, operators.ADD, rhs)) - } - - // appends passed SafeExpr to code or executes Block - code(c: Block | SafeExpr): CodeGen { - if (typeof c == "function") c() - else if (c !== nil) this._leafNode(new AnyCode(c)) - return this - } - - // returns code for object literal for the passed argument list of key-value pairs - object(...keyValues: [Name | string, SafeExpr | string][]): _Code { - const code: CodeItem[] = ["{"] - for (const [key, value] of keyValues) { - if (code.length > 1) code.push(",") - code.push(key) - if (key !== value || this.opts.es5) { - code.push(":") - addCodeArg(code, value) - } - } - code.push("}") - return new _Code(code) - } - - // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) - if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen { - this._blockNode(new If(condition)) - - if (thenBody && elseBody) { - this.code(thenBody).else().code(elseBody).endIf() - } else if (thenBody) { - this.code(thenBody).endIf() - } else if (elseBody) { - throw new Error('CodeGen: "else" body without "then" body') - } - return this - } - - // `else if` clause - invalid without `if` or after `else` clauses - elseIf(condition: Code | boolean): CodeGen { - return this._elseNode(new If(condition)) - } - - // `else` clause - only valid after `if` or `else if` clauses - else(): CodeGen { - return this._elseNode(new Else()) - } - - // end `if` statement (needed if gen.if was used only with condition) - endIf(): CodeGen { - return this._endBlockNode(If, Else) - } - - private _for(node: For, forBody?: Block): CodeGen { - this._blockNode(node) - if (forBody) this.code(forBody).endFor() - return this - } - - // a generic `for` clause (or statement if `forBody` is passed) - for(iteration: Code, forBody?: Block): CodeGen { - return this._for(new ForLoop(iteration), forBody) - } - - // `for` statement for a range of values - forRange( - nameOrPrefix: Name | string, - from: SafeExpr, - to: SafeExpr, - forBody: (index: Name) => void, - varKind: Code = this.opts.es5 ? varKinds.var : varKinds.let - ): CodeGen { - const name = this._scope.toName(nameOrPrefix) - return this._for(new ForRange(varKind, name, from, to), () => forBody(name)) - } - - // `for-of` statement (in es5 mode replace with a normal for loop) - forOf( - nameOrPrefix: Name | string, - iterable: Code, - forBody: (item: Name) => void, - varKind: Code = varKinds.const - ): CodeGen { - const name = this._scope.toName(nameOrPrefix) - if (this.opts.es5) { - const arr = iterable instanceof Name ? iterable : this.var("_arr", iterable) - return this.forRange("_i", 0, _`${arr}.length`, (i) => { - this.var(name, _`${arr}[${i}]`) - forBody(name) - }) - } - return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)) - } - - // `for-in` statement. - // With option `ownProperties` replaced with a `for-of` loop for object keys - forIn( - nameOrPrefix: Name | string, - obj: Code, - forBody: (item: Name) => void, - varKind: Code = this.opts.es5 ? varKinds.var : varKinds.const - ): CodeGen { - if (this.opts.ownProperties) { - return this.forOf(nameOrPrefix, _`Object.keys(${obj})`, forBody) - } - const name = this._scope.toName(nameOrPrefix) - return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)) - } - - // end `for` loop - endFor(): CodeGen { - return this._endBlockNode(For) - } - - // `label` statement - label(label: Name): CodeGen { - return this._leafNode(new Label(label)) - } - - // `break` statement - break(label?: Code): CodeGen { - return this._leafNode(new Break(label)) - } - - // `return` statement - return(value: Block | SafeExpr): CodeGen { - const node = new Return() - this._blockNode(node) - this.code(value) - if (node.nodes.length !== 1) throw new Error('CodeGen: "return" should have one node') - return this._endBlockNode(Return) - } - - // `try` statement - try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen { - if (!catchCode && !finallyCode) throw new Error('CodeGen: "try" without "catch" and "finally"') - const node = new Try() - this._blockNode(node) - this.code(tryBody) - if (catchCode) { - const error = this.name("e") - this._currNode = node.catch = new Catch(error) - catchCode(error) - } - if (finallyCode) { - this._currNode = node.finally = new Finally() - this.code(finallyCode) - } - return this._endBlockNode(Catch, Finally) - } - - // `throw` statement - throw(error: Code): CodeGen { - return this._leafNode(new Throw(error)) - } - - // start self-balancing block - block(body?: Block, nodeCount?: number): CodeGen { - this._blockStarts.push(this._nodes.length) - if (body) this.code(body).endBlock(nodeCount) - return this - } - - // end the current self-balancing block - endBlock(nodeCount?: number): CodeGen { - const len = this._blockStarts.pop() - if (len === undefined) throw new Error("CodeGen: not in self-balancing block") - const toClose = this._nodes.length - len - if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) { - throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`) - } - this._nodes.length = len - return this - } - - // `function` heading (or definition if funcBody is passed) - func(name: Name, args: Code = nil, async?: boolean, funcBody?: Block): CodeGen { - this._blockNode(new Func(name, args, async)) - if (funcBody) this.code(funcBody).endFunc() - return this - } - - // end function definition - endFunc(): CodeGen { - return this._endBlockNode(Func) - } - - optimize(n = 1): void { - while (n-- > 0) { - this._root.optimizeNodes() - this._root.optimizeNames(this._root.names, this._constants) - } - } - - private _leafNode(node: LeafNode): CodeGen { - this._currNode.nodes.push(node) - return this - } - - private _blockNode(node: StartBlockNode): void { - this._currNode.nodes.push(node) - this._nodes.push(node) - } - - private _endBlockNode(N1: EndBlockNodeType, N2?: EndBlockNodeType): CodeGen { - const n = this._currNode - if (n instanceof N1 || (N2 && n instanceof N2)) { - this._nodes.pop() - return this - } - throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`) - } - - private _elseNode(node: If | Else): CodeGen { - const n = this._currNode - if (!(n instanceof If)) { - throw new Error('CodeGen: "else" without "if"') - } - this._currNode = n.else = node - return this - } - - private get _root(): Root { - return this._nodes[0] as Root - } - - private get _currNode(): ParentNode { - const ns = this._nodes - return ns[ns.length - 1] - } - - private set _currNode(node: ParentNode) { - const ns = this._nodes - ns[ns.length - 1] = node - } - - // get nodeCount(): number { - // return this._root.count - // } -} - -function addNames(names: UsedNames, from: UsedNames): UsedNames { - for (const n in from) names[n] = (names[n] || 0) + (from[n] || 0) - return names -} - -function addExprNames(names: UsedNames, from: SafeExpr): UsedNames { - return from instanceof _CodeOrName ? addNames(names, from.names) : names -} - -function optimizeExpr(expr: T, names: UsedNames, constants: Constants): T -function optimizeExpr(expr: SafeExpr, names: UsedNames, constants: Constants): SafeExpr { - if (expr instanceof Name) return replaceName(expr) - if (!canOptimize(expr)) return expr - return new _Code( - expr._items.reduce((items: CodeItem[], c: SafeExpr | string) => { - if (c instanceof Name) c = replaceName(c) - if (c instanceof _Code) items.push(...c._items) - else items.push(c) - return items - }, []) - ) - - function replaceName(n: Name): SafeExpr { - const c = constants[n.str] - if (c === undefined || names[n.str] !== 1) return n - delete names[n.str] - return c - } - - function canOptimize(e: SafeExpr): e is _Code { - return ( - e instanceof _Code && - e._items.some( - (c) => c instanceof Name && names[c.str] === 1 && constants[c.str] !== undefined - ) - ) - } -} - -function subtractNames(names: UsedNames, from: UsedNames): void { - for (const n in from) names[n] = (names[n] || 0) - (from[n] || 0) -} - -export function not(x: T): T -export function not(x: Code | SafeExpr): Code | SafeExpr { - return typeof x == "boolean" || typeof x == "number" || x === null ? !x : _`!${par(x)}` -} - -const andCode = mappend(operators.AND) - -// boolean AND (&&) expression with the passed arguments -export function and(...args: Code[]): Code { - return args.reduce(andCode) -} - -const orCode = mappend(operators.OR) - -// boolean OR (||) expression with the passed arguments -export function or(...args: Code[]): Code { - return args.reduce(orCode) -} - -type MAppend = (x: Code, y: Code) => Code - -function mappend(op: Code): MAppend { - return (x, y) => (x === nil ? y : y === nil ? x : _`${par(x)} ${op} ${par(y)}`) -} - -function par(x: Code): Code { - return x instanceof Name ? x : _`(${x})` -} diff --git a/node_modules/ajv/lib/compile/codegen/scope.ts b/node_modules/ajv/lib/compile/codegen/scope.ts deleted file mode 100644 index 511992297..000000000 --- a/node_modules/ajv/lib/compile/codegen/scope.ts +++ /dev/null @@ -1,215 +0,0 @@ -import {_, nil, Code, Name} from "./code" - -interface NameGroup { - prefix: string - index: number -} - -export interface NameValue { - ref: ValueReference // this is the reference to any value that can be referred to from generated code via `globals` var in the closure - key?: unknown // any key to identify a global to avoid duplicates, if not passed ref is used - code?: Code // this is the code creating the value needed for standalone code wit_out closure - can be a primitive value, function or import (`require`) -} - -export type ValueReference = unknown // possibly make CodeGen parameterized type on this type - -class ValueError extends Error { - readonly value?: NameValue - constructor(name: ValueScopeName) { - super(`CodeGen: "code" for ${name} not defined`) - this.value = name.value - } -} - -interface ScopeOptions { - prefixes?: Set - parent?: Scope -} - -interface ValueScopeOptions extends ScopeOptions { - scope: ScopeStore - es5?: boolean - lines?: boolean -} - -export type ScopeStore = Record - -type ScopeValues = { - [Prefix in string]?: Map -} - -export type ScopeValueSets = { - [Prefix in string]?: Set -} - -export enum UsedValueState { - Started, - Completed, -} - -export type UsedScopeValues = { - [Prefix in string]?: Map -} - -export const varKinds = { - const: new Name("const"), - let: new Name("let"), - var: new Name("var"), -} - -export class Scope { - protected readonly _names: {[Prefix in string]?: NameGroup} = {} - protected readonly _prefixes?: Set - protected readonly _parent?: Scope - - constructor({prefixes, parent}: ScopeOptions = {}) { - this._prefixes = prefixes - this._parent = parent - } - - toName(nameOrPrefix: Name | string): Name { - return nameOrPrefix instanceof Name ? nameOrPrefix : this.name(nameOrPrefix) - } - - name(prefix: string): Name { - return new Name(this._newName(prefix)) - } - - protected _newName(prefix: string): string { - const ng = this._names[prefix] || this._nameGroup(prefix) - return `${prefix}${ng.index++}` - } - - private _nameGroup(prefix: string): NameGroup { - if (this._parent?._prefixes?.has(prefix) || (this._prefixes && !this._prefixes.has(prefix))) { - throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`) - } - return (this._names[prefix] = {prefix, index: 0}) - } -} - -interface ScopePath { - property: string - itemIndex: number -} - -export class ValueScopeName extends Name { - readonly prefix: string - value?: NameValue - scopePath?: Code - - constructor(prefix: string, nameStr: string) { - super(nameStr) - this.prefix = prefix - } - - setValue(value: NameValue, {property, itemIndex}: ScopePath): void { - this.value = value - this.scopePath = _`.${new Name(property)}[${itemIndex}]` - } -} - -interface VSOptions extends ValueScopeOptions { - _n: Code -} - -const line = _`\n` - -export class ValueScope extends Scope { - protected readonly _values: ScopeValues = {} - protected readonly _scope: ScopeStore - readonly opts: VSOptions - - constructor(opts: ValueScopeOptions) { - super(opts) - this._scope = opts.scope - this.opts = {...opts, _n: opts.lines ? line : nil} - } - - get(): ScopeStore { - return this._scope - } - - name(prefix: string): ValueScopeName { - return new ValueScopeName(prefix, this._newName(prefix)) - } - - value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName { - if (value.ref === undefined) throw new Error("CodeGen: ref must be passed in value") - const name = this.toName(nameOrPrefix) as ValueScopeName - const {prefix} = name - const valueKey = value.key ?? value.ref - let vs = this._values[prefix] - if (vs) { - const _name = vs.get(valueKey) - if (_name) return _name - } else { - vs = this._values[prefix] = new Map() - } - vs.set(valueKey, name) - - const s = this._scope[prefix] || (this._scope[prefix] = []) - const itemIndex = s.length - s[itemIndex] = value.ref - name.setValue(value, {property: prefix, itemIndex}) - return name - } - - getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined { - const vs = this._values[prefix] - if (!vs) return - return vs.get(keyOrRef) - } - - scopeRefs(scopeName: Name, values: ScopeValues | ScopeValueSets = this._values): Code { - return this._reduceValues(values, (name: ValueScopeName) => { - if (name.scopePath === undefined) throw new Error(`CodeGen: name "${name}" has no value`) - return _`${scopeName}${name.scopePath}` - }) - } - - scopeCode( - values: ScopeValues | ScopeValueSets = this._values, - usedValues?: UsedScopeValues, - getCode?: (n: ValueScopeName) => Code | undefined - ): Code { - return this._reduceValues( - values, - (name: ValueScopeName) => { - if (name.value === undefined) throw new Error(`CodeGen: name "${name}" has no value`) - return name.value.code - }, - usedValues, - getCode - ) - } - - private _reduceValues( - values: ScopeValues | ScopeValueSets, - valueCode: (n: ValueScopeName) => Code | undefined, - usedValues: UsedScopeValues = {}, - getCode?: (n: ValueScopeName) => Code | undefined - ): Code { - let code: Code = nil - for (const prefix in values) { - const vs = values[prefix] - if (!vs) continue - const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map()) - vs.forEach((name: ValueScopeName) => { - if (nameSet.has(name)) return - nameSet.set(name, UsedValueState.Started) - let c = valueCode(name) - if (c) { - const def = this.opts.es5 ? varKinds.var : varKinds.const - code = _`${code}${def} ${name} = ${c};${this.opts._n}` - } else if ((c = getCode?.(name))) { - code = _`${code}${c}${this.opts._n}` - } else { - throw new ValueError(name) - } - nameSet.set(name, UsedValueState.Completed) - }) - } - return code - } -} diff --git a/node_modules/ajv/lib/compile/errors.ts b/node_modules/ajv/lib/compile/errors.ts deleted file mode 100644 index 18424a0fc..000000000 --- a/node_modules/ajv/lib/compile/errors.ts +++ /dev/null @@ -1,184 +0,0 @@ -import type {KeywordErrorCxt, KeywordErrorDefinition} from "../types" -import type {SchemaCxt} from "./index" -import {CodeGen, _, str, strConcat, Code, Name} from "./codegen" -import {SafeExpr} from "./codegen/code" -import {getErrorPath, Type} from "./util" -import N from "./names" - -export const keywordError: KeywordErrorDefinition = { - message: ({keyword}) => str`must pass "${keyword}" keyword validation`, -} - -export const keyword$DataError: KeywordErrorDefinition = { - message: ({keyword, schemaType}) => - schemaType - ? str`"${keyword}" keyword must be ${schemaType} ($data)` - : str`"${keyword}" keyword is invalid ($data)`, -} - -export interface ErrorPaths { - instancePath?: Code - schemaPath?: string - parentSchema?: boolean -} - -export function reportError( - cxt: KeywordErrorCxt, - error: KeywordErrorDefinition = keywordError, - errorPaths?: ErrorPaths, - overrideAllErrors?: boolean -): void { - const {it} = cxt - const {gen, compositeRule, allErrors} = it - const errObj = errorObjectCode(cxt, error, errorPaths) - if (overrideAllErrors ?? (compositeRule || allErrors)) { - addError(gen, errObj) - } else { - returnErrors(it, _`[${errObj}]`) - } -} - -export function reportExtraError( - cxt: KeywordErrorCxt, - error: KeywordErrorDefinition = keywordError, - errorPaths?: ErrorPaths -): void { - const {it} = cxt - const {gen, compositeRule, allErrors} = it - const errObj = errorObjectCode(cxt, error, errorPaths) - addError(gen, errObj) - if (!(compositeRule || allErrors)) { - returnErrors(it, N.vErrors) - } -} - -export function resetErrorsCount(gen: CodeGen, errsCount: Name): void { - gen.assign(N.errors, errsCount) - gen.if(_`${N.vErrors} !== null`, () => - gen.if( - errsCount, - () => gen.assign(_`${N.vErrors}.length`, errsCount), - () => gen.assign(N.vErrors, null) - ) - ) -} - -export function extendErrors({ - gen, - keyword, - schemaValue, - data, - errsCount, - it, -}: KeywordErrorCxt): void { - /* istanbul ignore if */ - if (errsCount === undefined) throw new Error("ajv implementation error") - const err = gen.name("err") - gen.forRange("i", errsCount, N.errors, (i) => { - gen.const(err, _`${N.vErrors}[${i}]`) - gen.if(_`${err}.instancePath === undefined`, () => - gen.assign(_`${err}.instancePath`, strConcat(N.instancePath, it.errorPath)) - ) - gen.assign(_`${err}.schemaPath`, str`${it.errSchemaPath}/${keyword}`) - if (it.opts.verbose) { - gen.assign(_`${err}.schema`, schemaValue) - gen.assign(_`${err}.data`, data) - } - }) -} - -function addError(gen: CodeGen, errObj: Code): void { - const err = gen.const("err", errObj) - gen.if( - _`${N.vErrors} === null`, - () => gen.assign(N.vErrors, _`[${err}]`), - _`${N.vErrors}.push(${err})` - ) - gen.code(_`${N.errors}++`) -} - -function returnErrors(it: SchemaCxt, errs: Code): void { - const {gen, validateName, schemaEnv} = it - if (schemaEnv.$async) { - gen.throw(_`new ${it.ValidationError as Name}(${errs})`) - } else { - gen.assign(_`${validateName}.errors`, errs) - gen.return(false) - } -} - -const E = { - keyword: new Name("keyword"), - schemaPath: new Name("schemaPath"), // also used in JTD errors - params: new Name("params"), - propertyName: new Name("propertyName"), - message: new Name("message"), - schema: new Name("schema"), - parentSchema: new Name("parentSchema"), -} - -function errorObjectCode( - cxt: KeywordErrorCxt, - error: KeywordErrorDefinition, - errorPaths?: ErrorPaths -): Code { - const {createErrors} = cxt.it - if (createErrors === false) return _`{}` - return errorObject(cxt, error, errorPaths) -} - -function errorObject( - cxt: KeywordErrorCxt, - error: KeywordErrorDefinition, - errorPaths: ErrorPaths = {} -): Code { - const {gen, it} = cxt - const keyValues: [Name, SafeExpr | string][] = [ - errorInstancePath(it, errorPaths), - errorSchemaPath(cxt, errorPaths), - ] - extraErrorProps(cxt, error, keyValues) - return gen.object(...keyValues) -} - -function errorInstancePath({errorPath}: SchemaCxt, {instancePath}: ErrorPaths): [Name, Code] { - const instPath = instancePath - ? str`${errorPath}${getErrorPath(instancePath, Type.Str)}` - : errorPath - return [N.instancePath, strConcat(N.instancePath, instPath)] -} - -function errorSchemaPath( - {keyword, it: {errSchemaPath}}: KeywordErrorCxt, - {schemaPath, parentSchema}: ErrorPaths -): [Name, string | Code] { - let schPath = parentSchema ? errSchemaPath : str`${errSchemaPath}/${keyword}` - if (schemaPath) { - schPath = str`${schPath}${getErrorPath(schemaPath, Type.Str)}` - } - return [E.schemaPath, schPath] -} - -function extraErrorProps( - cxt: KeywordErrorCxt, - {params, message}: KeywordErrorDefinition, - keyValues: [Name, SafeExpr | string][] -): void { - const {keyword, data, schemaValue, it} = cxt - const {opts, propertyName, topSchemaRef, schemaPath} = it - keyValues.push( - [E.keyword, keyword], - [E.params, typeof params == "function" ? params(cxt) : params || _`{}`] - ) - if (opts.messages) { - keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]) - } - if (opts.verbose) { - keyValues.push( - [E.schema, schemaValue], - [E.parentSchema, _`${topSchemaRef}${schemaPath}`], - [N.data, data] - ) - } - if (propertyName) keyValues.push([E.propertyName, propertyName]) -} diff --git a/node_modules/ajv/lib/compile/index.ts b/node_modules/ajv/lib/compile/index.ts deleted file mode 100644 index 3dac2699b..000000000 --- a/node_modules/ajv/lib/compile/index.ts +++ /dev/null @@ -1,324 +0,0 @@ -import type { - AnySchema, - AnySchemaObject, - AnyValidateFunction, - AsyncValidateFunction, - EvaluatedProperties, - EvaluatedItems, -} from "../types" -import type Ajv from "../core" -import type {InstanceOptions} from "../core" -import {CodeGen, _, nil, stringify, Name, Code, ValueScopeName} from "./codegen" -import ValidationError from "../runtime/validation_error" -import N from "./names" -import {LocalRefs, getFullPath, _getFullPath, inlineRef, normalizeId, resolveUrl} from "./resolve" -import {schemaHasRulesButRef, unescapeFragment} from "./util" -import {validateFunctionCode} from "./validate" -import * as URI from "uri-js" -import {JSONType} from "./rules" - -export type SchemaRefs = { - [Ref in string]?: SchemaEnv | AnySchema -} - -export interface SchemaCxt { - readonly gen: CodeGen - readonly allErrors?: boolean // validation mode - whether to collect all errors or break on error - readonly data: Name // Name with reference to the current part of data instance - readonly parentData: Name // should be used in keywords modifying data - readonly parentDataProperty: Code | number // should be used in keywords modifying data - readonly dataNames: Name[] - readonly dataPathArr: (Code | number)[] - readonly dataLevel: number // the level of the currently validated data, - // it can be used to access both the property names and the data on all levels from the top. - dataTypes: JSONType[] // data types applied to the current part of data instance - definedProperties: Set // set of properties to keep track of for required checks - readonly topSchemaRef: Code - readonly validateName: Name - evaluated?: Name - readonly ValidationError?: Name - readonly schema: AnySchema // current schema object - equal to parentSchema passed via KeywordCxt - readonly schemaEnv: SchemaEnv - readonly rootId: string - baseId: string // the current schema base URI that should be used as the base for resolving URIs in references (\$ref) - readonly schemaPath: Code // the run-time expression that evaluates to the property name of the current schema - readonly errSchemaPath: string // this is actual string, should not be changed to Code - readonly errorPath: Code - readonly propertyName?: Name - readonly compositeRule?: boolean // true indicates that the current schema is inside the compound keyword, - // where failing some rule doesn't mean validation failure (`anyOf`, `oneOf`, `not`, `if`). - // This flag is used to determine whether you can return validation result immediately after any error in case the option `allErrors` is not `true. - // You only need to use it if you have many steps in your keywords and potentially can define multiple errors. - props?: EvaluatedProperties | Name // properties evaluated by this schema - used by parent schema or assigned to validation function - items?: EvaluatedItems | Name // last item evaluated by this schema - used by parent schema or assigned to validation function - jtdDiscriminator?: string - jtdMetadata?: boolean - readonly createErrors?: boolean - readonly opts: InstanceOptions // Ajv instance option. - readonly self: Ajv // current Ajv instance -} - -export interface SchemaObjCxt extends SchemaCxt { - readonly schema: AnySchemaObject -} -interface SchemaEnvArgs { - readonly schema: AnySchema - readonly schemaId?: "$id" | "id" - readonly root?: SchemaEnv - readonly baseId?: string - readonly schemaPath?: string - readonly localRefs?: LocalRefs - readonly meta?: boolean -} - -export class SchemaEnv implements SchemaEnvArgs { - readonly schema: AnySchema - readonly schemaId?: "$id" | "id" - readonly root: SchemaEnv - baseId: string // TODO possibly, it should be readonly - schemaPath?: string - localRefs?: LocalRefs - readonly meta?: boolean - readonly $async?: boolean // true if the current schema is asynchronous. - readonly refs: SchemaRefs = {} - readonly dynamicAnchors: {[Ref in string]?: true} = {} - validate?: AnyValidateFunction - validateName?: ValueScopeName - serialize?: (data: unknown) => string - serializeName?: ValueScopeName - parse?: (data: string) => unknown - parseName?: ValueScopeName - - constructor(env: SchemaEnvArgs) { - let schema: AnySchemaObject | undefined - if (typeof env.schema == "object") schema = env.schema - this.schema = env.schema - this.schemaId = env.schemaId - this.root = env.root || this - this.baseId = env.baseId ?? normalizeId(schema?.[env.schemaId || "$id"]) - this.schemaPath = env.schemaPath - this.localRefs = env.localRefs - this.meta = env.meta - this.$async = schema?.$async - this.refs = {} - } -} - -// let codeSize = 0 -// let nodeCount = 0 - -// Compiles schema in SchemaEnv -export function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv { - // TODO refactor - remove compilations - const _sch = getCompilingSchema.call(this, sch) - if (_sch) return _sch - const rootId = getFullPath(this.opts.uriResolver, sch.root.baseId) // TODO if getFullPath removed 1 tests fails - const {es5, lines} = this.opts.code - const {ownProperties} = this.opts - const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) - let _ValidationError - if (sch.$async) { - _ValidationError = gen.scopeValue("Error", { - ref: ValidationError, - code: _`require("ajv/dist/runtime/validation_error").default`, - }) - } - - const validateName = gen.scopeName("validate") - sch.validateName = validateName - - const schemaCxt: SchemaCxt = { - gen, - allErrors: this.opts.allErrors, - data: N.data, - parentData: N.parentData, - parentDataProperty: N.parentDataProperty, - dataNames: [N.data], - dataPathArr: [nil], // TODO can its length be used as dataLevel if nil is removed? - dataLevel: 0, - dataTypes: [], - definedProperties: new Set(), - topSchemaRef: gen.scopeValue( - "schema", - this.opts.code.source === true - ? {ref: sch.schema, code: stringify(sch.schema)} - : {ref: sch.schema} - ), - validateName, - ValidationError: _ValidationError, - schema: sch.schema, - schemaEnv: sch, - rootId, - baseId: sch.baseId || rootId, - schemaPath: nil, - errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"), - errorPath: _`""`, - opts: this.opts, - self: this, - } - - let sourceCode: string | undefined - try { - this._compilations.add(sch) - validateFunctionCode(schemaCxt) - gen.optimize(this.opts.code.optimize) - // gen.optimize(1) - const validateCode = gen.toString() - sourceCode = `${gen.scopeRefs(N.scope)}return ${validateCode}` - // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount)) - if (this.opts.code.process) sourceCode = this.opts.code.process(sourceCode, sch) - // console.log("\n\n\n *** \n", sourceCode) - const makeValidate = new Function(`${N.self}`, `${N.scope}`, sourceCode) - const validate: AnyValidateFunction = makeValidate(this, this.scope.get()) - this.scope.value(validateName, {ref: validate}) - - validate.errors = null - validate.schema = sch.schema - validate.schemaEnv = sch - if (sch.$async) (validate as AsyncValidateFunction).$async = true - if (this.opts.code.source === true) { - validate.source = {validateName, validateCode, scopeValues: gen._values} - } - if (this.opts.unevaluated) { - const {props, items} = schemaCxt - validate.evaluated = { - props: props instanceof Name ? undefined : props, - items: items instanceof Name ? undefined : items, - dynamicProps: props instanceof Name, - dynamicItems: items instanceof Name, - } - if (validate.source) validate.source.evaluated = stringify(validate.evaluated) - } - sch.validate = validate - return sch - } catch (e) { - delete sch.validate - delete sch.validateName - if (sourceCode) this.logger.error("Error compiling schema, function code:", sourceCode) - // console.log("\n\n\n *** \n", sourceCode, this.opts) - throw e - } finally { - this._compilations.delete(sch) - } -} - -export function resolveRef( - this: Ajv, - root: SchemaEnv, - baseId: string, - ref: string -): AnySchema | SchemaEnv | undefined { - ref = resolveUrl(this.opts.uriResolver, baseId, ref) - const schOrFunc = root.refs[ref] - if (schOrFunc) return schOrFunc - - let _sch = resolve.call(this, root, ref) - if (_sch === undefined) { - const schema = root.localRefs?.[ref] // TODO maybe localRefs should hold SchemaEnv - const {schemaId} = this.opts - if (schema) _sch = new SchemaEnv({schema, schemaId, root, baseId}) - } - - if (_sch === undefined) return - return (root.refs[ref] = inlineOrCompile.call(this, _sch)) -} - -function inlineOrCompile(this: Ajv, sch: SchemaEnv): AnySchema | SchemaEnv { - if (inlineRef(sch.schema, this.opts.inlineRefs)) return sch.schema - return sch.validate ? sch : compileSchema.call(this, sch) -} - -// Index of schema compilation in the currently compiled list -export function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void { - for (const sch of this._compilations) { - if (sameSchemaEnv(sch, schEnv)) return sch - } -} - -function sameSchemaEnv(s1: SchemaEnv, s2: SchemaEnv): boolean { - return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId -} - -// resolve and compile the references ($ref) -// TODO returns AnySchemaObject (if the schema can be inlined) or validation function -function resolve( - this: Ajv, - root: SchemaEnv, // information about the root schema for the current schema - ref: string // reference to resolve -): SchemaEnv | undefined { - let sch - while (typeof (sch = this.refs[ref]) == "string") ref = sch - return sch || this.schemas[ref] || resolveSchema.call(this, root, ref) -} - -// Resolve schema, its root and baseId -export function resolveSchema( - this: Ajv, - root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it - ref: string // reference to resolve -): SchemaEnv | undefined { - const p = this.opts.uriResolver.parse(ref) - const refPath = _getFullPath(this.opts.uriResolver, p) - let baseId = getFullPath(this.opts.uriResolver, root.baseId, undefined) - // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests - if (Object.keys(root.schema).length > 0 && refPath === baseId) { - return getJsonPointer.call(this, p, root) - } - - const id = normalizeId(refPath) - const schOrRef = this.refs[id] || this.schemas[id] - if (typeof schOrRef == "string") { - const sch = resolveSchema.call(this, root, schOrRef) - if (typeof sch?.schema !== "object") return - return getJsonPointer.call(this, p, sch) - } - - if (typeof schOrRef?.schema !== "object") return - if (!schOrRef.validate) compileSchema.call(this, schOrRef) - if (id === normalizeId(ref)) { - const {schema} = schOrRef - const {schemaId} = this.opts - const schId = schema[schemaId] - if (schId) baseId = resolveUrl(this.opts.uriResolver, baseId, schId) - return new SchemaEnv({schema, schemaId, root, baseId}) - } - return getJsonPointer.call(this, p, schOrRef) -} - -const PREVENT_SCOPE_CHANGE = new Set([ - "properties", - "patternProperties", - "enum", - "dependencies", - "definitions", -]) - -function getJsonPointer( - this: Ajv, - parsedRef: URI.URIComponents, - {baseId, schema, root}: SchemaEnv -): SchemaEnv | undefined { - if (parsedRef.fragment?.[0] !== "/") return - for (const part of parsedRef.fragment.slice(1).split("/")) { - if (typeof schema === "boolean") return - const partSchema = schema[unescapeFragment(part)] - if (partSchema === undefined) return - schema = partSchema - // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? - const schId = typeof schema === "object" && schema[this.opts.schemaId] - if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { - baseId = resolveUrl(this.opts.uriResolver, baseId, schId) - } - } - let env: SchemaEnv | undefined - if (typeof schema != "boolean" && schema.$ref && !schemaHasRulesButRef(schema, this.RULES)) { - const $ref = resolveUrl(this.opts.uriResolver, baseId, schema.$ref) - env = resolveSchema.call(this, root, $ref) - } - // even though resolution failed we need to return SchemaEnv to throw exception - // so that compileAsync loads missing schema. - const {schemaId} = this.opts - env = env || new SchemaEnv({schema, schemaId, root, baseId}) - if (env.schema !== env.root.schema) return env - return undefined -} diff --git a/node_modules/ajv/lib/compile/jtd/parse.ts b/node_modules/ajv/lib/compile/jtd/parse.ts deleted file mode 100644 index a0141c770..000000000 --- a/node_modules/ajv/lib/compile/jtd/parse.ts +++ /dev/null @@ -1,411 +0,0 @@ -import type Ajv from "../../core" -import type {SchemaObject} from "../../types" -import {jtdForms, JTDForm, SchemaObjectMap} from "./types" -import {SchemaEnv, getCompilingSchema} from ".." -import {_, str, and, or, nil, not, CodeGen, Code, Name, SafeExpr} from "../codegen" -import MissingRefError from "../ref_error" -import N from "../names" -import {hasPropFunc} from "../../vocabularies/code" -import {hasRef} from "../../vocabularies/jtd/ref" -import {intRange, IntType} from "../../vocabularies/jtd/type" -import {parseJson, parseJsonNumber, parseJsonString} from "../../runtime/parseJson" -import {useFunc} from "../util" -import validTimestamp from "../../runtime/timestamp" - -type GenParse = (cxt: ParseCxt) => void - -const genParse: {[F in JTDForm]: GenParse} = { - elements: parseElements, - values: parseValues, - discriminator: parseDiscriminator, - properties: parseProperties, - optionalProperties: parseProperties, - enum: parseEnum, - type: parseType, - ref: parseRef, -} - -interface ParseCxt { - readonly gen: CodeGen - readonly self: Ajv // current Ajv instance - readonly schemaEnv: SchemaEnv - readonly definitions: SchemaObjectMap - schema: SchemaObject - data: Code - parseName: Name - char: Name -} - -export default function compileParser( - this: Ajv, - sch: SchemaEnv, - definitions: SchemaObjectMap -): SchemaEnv { - const _sch = getCompilingSchema.call(this, sch) - if (_sch) return _sch - const {es5, lines} = this.opts.code - const {ownProperties} = this.opts - const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) - const parseName = gen.scopeName("parse") - const cxt: ParseCxt = { - self: this, - gen, - schema: sch.schema as SchemaObject, - schemaEnv: sch, - definitions, - data: N.data, - parseName, - char: gen.name("c"), - } - - let sourceCode: string | undefined - try { - this._compilations.add(sch) - sch.parseName = parseName - parserFunction(cxt) - gen.optimize(this.opts.code.optimize) - const parseFuncCode = gen.toString() - sourceCode = `${gen.scopeRefs(N.scope)}return ${parseFuncCode}` - const makeParse = new Function(`${N.scope}`, sourceCode) - const parse: (json: string) => unknown = makeParse(this.scope.get()) - this.scope.value(parseName, {ref: parse}) - sch.parse = parse - } catch (e) { - if (sourceCode) this.logger.error("Error compiling parser, function code:", sourceCode) - delete sch.parse - delete sch.parseName - throw e - } finally { - this._compilations.delete(sch) - } - return sch -} - -const undef = _`undefined` - -function parserFunction(cxt: ParseCxt): void { - const {gen, parseName, char} = cxt - gen.func(parseName, _`${N.json}, ${N.jsonPos}, ${N.jsonPart}`, false, () => { - gen.let(N.data) - gen.let(char) - gen.assign(_`${parseName}.message`, undef) - gen.assign(_`${parseName}.position`, undef) - gen.assign(N.jsonPos, _`${N.jsonPos} || 0`) - gen.const(N.jsonLen, _`${N.json}.length`) - parseCode(cxt) - skipWhitespace(cxt) - gen.if(N.jsonPart, () => { - gen.assign(_`${parseName}.position`, N.jsonPos) - gen.return(N.data) - }) - gen.if(_`${N.jsonPos} === ${N.jsonLen}`, () => gen.return(N.data)) - jsonSyntaxError(cxt) - }) -} - -function parseCode(cxt: ParseCxt): void { - let form: JTDForm | undefined - for (const key of jtdForms) { - if (key in cxt.schema) { - form = key - break - } - } - if (form) parseNullable(cxt, genParse[form]) - else parseEmpty(cxt) -} - -const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError)) - -function parseNullable(cxt: ParseCxt, parseForm: GenParse): void { - const {gen, schema, data} = cxt - if (!schema.nullable) return parseForm(cxt) - tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null)) -} - -function parseElements(cxt: ParseCxt): void { - const {gen, schema, data} = cxt - parseToken(cxt, "[") - const ix = gen.let("i", 0) - gen.assign(data, _`[]`) - parseItems(cxt, "]", () => { - const el = gen.let("el") - parseCode({...cxt, schema: schema.elements, data: el}) - gen.assign(_`${data}[${ix}++]`, el) - }) -} - -function parseValues(cxt: ParseCxt): void { - const {gen, schema, data} = cxt - parseToken(cxt, "{") - gen.assign(data, _`{}`) - parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values)) -} - -function parseItems(cxt: ParseCxt, endToken: string, block: () => void): void { - tryParseItems(cxt, endToken, block) - parseToken(cxt, endToken) -} - -function tryParseItems(cxt: ParseCxt, endToken: string, block: () => void): void { - const {gen} = cxt - gen.for(_`;${N.jsonPos}<${N.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => { - block() - tryParseToken(cxt, ",", () => gen.break(), hasItem) - }) - - function hasItem(): void { - tryParseToken(cxt, endToken, () => {}, jsonSyntaxError) - } -} - -function parseKeyValue(cxt: ParseCxt, schema: SchemaObject): void { - const {gen} = cxt - const key = gen.let("key") - parseString({...cxt, data: key}) - parseToken(cxt, ":") - parsePropertyValue(cxt, key, schema) -} - -function parseDiscriminator(cxt: ParseCxt): void { - const {gen, data, schema} = cxt - const {discriminator, mapping} = schema - parseToken(cxt, "{") - gen.assign(data, _`{}`) - const startPos = gen.const("pos", N.jsonPos) - const value = gen.let("value") - const tag = gen.let("tag") - tryParseItems(cxt, "}", () => { - const key = gen.let("key") - parseString({...cxt, data: key}) - parseToken(cxt, ":") - gen.if( - _`${key} === ${discriminator}`, - () => { - parseString({...cxt, data: tag}) - gen.assign(_`${data}[${key}]`, tag) - gen.break() - }, - () => parseEmpty({...cxt, data: value}) // can be discarded/skipped - ) - }) - gen.assign(N.jsonPos, startPos) - gen.if(_`${tag} === undefined`) - parsingError(cxt, str`discriminator tag not found`) - for (const tagValue in mapping) { - gen.elseIf(_`${tag} === ${tagValue}`) - parseSchemaProperties({...cxt, schema: mapping[tagValue]}, discriminator) - } - gen.else() - parsingError(cxt, str`discriminator value not in schema`) - gen.endIf() -} - -function parseProperties(cxt: ParseCxt): void { - const {gen, data} = cxt - parseToken(cxt, "{") - gen.assign(data, _`{}`) - parseSchemaProperties(cxt) -} - -function parseSchemaProperties(cxt: ParseCxt, discriminator?: string): void { - const {gen, schema, data} = cxt - const {properties, optionalProperties, additionalProperties} = schema - parseItems(cxt, "}", () => { - const key = gen.let("key") - parseString({...cxt, data: key}) - parseToken(cxt, ":") - gen.if(false) - parseDefinedProperty(cxt, key, properties) - parseDefinedProperty(cxt, key, optionalProperties) - if (discriminator) { - gen.elseIf(_`${key} === ${discriminator}`) - const tag = gen.let("tag") - parseString({...cxt, data: tag}) // can be discarded, it is already assigned - } - gen.else() - if (additionalProperties) { - parseEmpty({...cxt, data: _`${data}[${key}]`}) - } else { - parsingError(cxt, str`property ${key} not allowed`) - } - gen.endIf() - }) - if (properties) { - const hasProp = hasPropFunc(gen) - const allProps: Code = and( - ...Object.keys(properties).map((p): Code => _`${hasProp}.call(${data}, ${p})`) - ) - gen.if(not(allProps), () => parsingError(cxt, str`missing required properties`)) - } -} - -function parseDefinedProperty(cxt: ParseCxt, key: Name, schemas: SchemaObjectMap = {}): void { - const {gen} = cxt - for (const prop in schemas) { - gen.elseIf(_`${key} === ${prop}`) - parsePropertyValue(cxt, key, schemas[prop] as SchemaObject) - } -} - -function parsePropertyValue(cxt: ParseCxt, key: Name, schema: SchemaObject): void { - parseCode({...cxt, schema, data: _`${cxt.data}[${key}]`}) -} - -function parseType(cxt: ParseCxt): void { - const {gen, schema, data, self} = cxt - switch (schema.type) { - case "boolean": - parseBoolean(cxt) - break - case "string": - parseString(cxt) - break - case "timestamp": { - parseString(cxt) - const vts = useFunc(gen, validTimestamp) - const {allowDate, parseDate} = self.opts - const notValid = allowDate ? _`!${vts}(${data}, true)` : _`!${vts}(${data})` - const fail: Code = parseDate - ? or(notValid, _`(${data} = new Date(${data}), false)`, _`isNaN(${data}.valueOf())`) - : notValid - gen.if(fail, () => parsingError(cxt, str`invalid timestamp`)) - break - } - case "float32": - case "float64": - parseNumber(cxt) - break - default: { - const t = schema.type as IntType - if (!self.opts.int32range && (t === "int32" || t === "uint32")) { - parseNumber(cxt, 16) // 2 ** 53 - max safe integer - if (t === "uint32") { - gen.if(_`${data} < 0`, () => parsingError(cxt, str`integer out of range`)) - } - } else { - const [min, max, maxDigits] = intRange[t] - parseNumber(cxt, maxDigits) - gen.if(_`${data} < ${min} || ${data} > ${max}`, () => - parsingError(cxt, str`integer out of range`) - ) - } - } - } -} - -function parseString(cxt: ParseCxt): void { - parseToken(cxt, '"') - parseWith(cxt, parseJsonString) -} - -function parseEnum(cxt: ParseCxt): void { - const {gen, data, schema} = cxt - const enumSch = schema.enum - parseToken(cxt, '"') - // TODO loopEnum - gen.if(false) - for (const value of enumSch) { - const valueStr = JSON.stringify(value).slice(1) // remove starting quote - gen.elseIf(_`${jsonSlice(valueStr.length)} === ${valueStr}`) - gen.assign(data, str`${value}`) - gen.add(N.jsonPos, valueStr.length) - } - gen.else() - jsonSyntaxError(cxt) - gen.endIf() -} - -function parseNumber(cxt: ParseCxt, maxDigits?: number): void { - const {gen} = cxt - skipWhitespace(cxt) - gen.if( - _`"-0123456789".indexOf(${jsonSlice(1)}) < 0`, - () => jsonSyntaxError(cxt), - () => parseWith(cxt, parseJsonNumber, maxDigits) - ) -} - -function parseBooleanToken(bool: boolean, fail: GenParse): GenParse { - return (cxt) => { - const {gen, data} = cxt - tryParseToken( - cxt, - `${bool}`, - () => fail(cxt), - () => gen.assign(data, bool) - ) - } -} - -function parseRef(cxt: ParseCxt): void { - const {gen, self, definitions, schema, schemaEnv} = cxt - const {ref} = schema - const refSchema = definitions[ref] - if (!refSchema) throw new MissingRefError(self.opts.uriResolver, "", ref, `No definition ${ref}`) - if (!hasRef(refSchema)) return parseCode({...cxt, schema: refSchema}) - const {root} = schemaEnv - const sch = compileParser.call(self, new SchemaEnv({schema: refSchema, root}), definitions) - partialParse(cxt, getParser(gen, sch), true) -} - -function getParser(gen: CodeGen, sch: SchemaEnv): Code { - return sch.parse - ? gen.scopeValue("parse", {ref: sch.parse}) - : _`${gen.scopeValue("wrapper", {ref: sch})}.parse` -} - -function parseEmpty(cxt: ParseCxt): void { - parseWith(cxt, parseJson) -} - -function parseWith(cxt: ParseCxt, parseFunc: {code: string}, args?: SafeExpr): void { - partialParse(cxt, useFunc(cxt.gen, parseFunc), args) -} - -function partialParse(cxt: ParseCxt, parseFunc: Name, args?: SafeExpr): void { - const {gen, data} = cxt - gen.assign(data, _`${parseFunc}(${N.json}, ${N.jsonPos}${args ? _`, ${args}` : nil})`) - gen.assign(N.jsonPos, _`${parseFunc}.position`) - gen.if(_`${data} === undefined`, () => parsingError(cxt, _`${parseFunc}.message`)) -} - -function parseToken(cxt: ParseCxt, tok: string): void { - tryParseToken(cxt, tok, jsonSyntaxError) -} - -function tryParseToken(cxt: ParseCxt, tok: string, fail: GenParse, success?: GenParse): void { - const {gen} = cxt - const n = tok.length - skipWhitespace(cxt) - gen.if( - _`${jsonSlice(n)} === ${tok}`, - () => { - gen.add(N.jsonPos, n) - success?.(cxt) - }, - () => fail(cxt) - ) -} - -function skipWhitespace({gen, char: c}: ParseCxt): void { - gen.code( - _`while((${c}=${N.json}[${N.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${N.jsonPos}++;` - ) -} - -function jsonSlice(len: number | Name): Code { - return len === 1 - ? _`${N.json}[${N.jsonPos}]` - : _`${N.json}.slice(${N.jsonPos}, ${N.jsonPos}+${len})` -} - -function jsonSyntaxError(cxt: ParseCxt): void { - parsingError(cxt, _`"unexpected token " + ${N.json}[${N.jsonPos}]`) -} - -function parsingError({gen, parseName}: ParseCxt, msg: Code): void { - gen.assign(_`${parseName}.message`, msg) - gen.assign(_`${parseName}.position`, N.jsonPos) - gen.return(undef) -} diff --git a/node_modules/ajv/lib/compile/jtd/serialize.ts b/node_modules/ajv/lib/compile/jtd/serialize.ts deleted file mode 100644 index 1d228826d..000000000 --- a/node_modules/ajv/lib/compile/jtd/serialize.ts +++ /dev/null @@ -1,266 +0,0 @@ -import type Ajv from "../../core" -import type {SchemaObject} from "../../types" -import {jtdForms, JTDForm, SchemaObjectMap} from "./types" -import {SchemaEnv, getCompilingSchema} from ".." -import {_, str, and, getProperty, CodeGen, Code, Name} from "../codegen" -import MissingRefError from "../ref_error" -import N from "../names" -import {isOwnProperty} from "../../vocabularies/code" -import {hasRef} from "../../vocabularies/jtd/ref" -import {useFunc} from "../util" -import quote from "../../runtime/quote" - -const genSerialize: {[F in JTDForm]: (cxt: SerializeCxt) => void} = { - elements: serializeElements, - values: serializeValues, - discriminator: serializeDiscriminator, - properties: serializeProperties, - optionalProperties: serializeProperties, - enum: serializeString, - type: serializeType, - ref: serializeRef, -} - -interface SerializeCxt { - readonly gen: CodeGen - readonly self: Ajv // current Ajv instance - readonly schemaEnv: SchemaEnv - readonly definitions: SchemaObjectMap - schema: SchemaObject - data: Code -} - -export default function compileSerializer( - this: Ajv, - sch: SchemaEnv, - definitions: SchemaObjectMap -): SchemaEnv { - const _sch = getCompilingSchema.call(this, sch) - if (_sch) return _sch - const {es5, lines} = this.opts.code - const {ownProperties} = this.opts - const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) - const serializeName = gen.scopeName("serialize") - const cxt: SerializeCxt = { - self: this, - gen, - schema: sch.schema as SchemaObject, - schemaEnv: sch, - definitions, - data: N.data, - } - - let sourceCode: string | undefined - try { - this._compilations.add(sch) - sch.serializeName = serializeName - gen.func(serializeName, N.data, false, () => { - gen.let(N.json, str``) - serializeCode(cxt) - gen.return(N.json) - }) - gen.optimize(this.opts.code.optimize) - const serializeFuncCode = gen.toString() - sourceCode = `${gen.scopeRefs(N.scope)}return ${serializeFuncCode}` - const makeSerialize = new Function(`${N.scope}`, sourceCode) - const serialize: (data: unknown) => string = makeSerialize(this.scope.get()) - this.scope.value(serializeName, {ref: serialize}) - sch.serialize = serialize - } catch (e) { - if (sourceCode) this.logger.error("Error compiling serializer, function code:", sourceCode) - delete sch.serialize - delete sch.serializeName - throw e - } finally { - this._compilations.delete(sch) - } - return sch -} - -function serializeCode(cxt: SerializeCxt): void { - let form: JTDForm | undefined - for (const key of jtdForms) { - if (key in cxt.schema) { - form = key - break - } - } - serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty) -} - -function serializeNullable(cxt: SerializeCxt, serializeForm: (_cxt: SerializeCxt) => void): void { - const {gen, schema, data} = cxt - if (!schema.nullable) return serializeForm(cxt) - gen.if( - _`${data} === undefined || ${data} === null`, - () => gen.add(N.json, _`"null"`), - () => serializeForm(cxt) - ) -} - -function serializeElements(cxt: SerializeCxt): void { - const {gen, schema, data} = cxt - gen.add(N.json, str`[`) - const first = gen.let("first", true) - gen.forOf("el", data, (el) => { - addComma(cxt, first) - serializeCode({...cxt, schema: schema.elements, data: el}) - }) - gen.add(N.json, str`]`) -} - -function serializeValues(cxt: SerializeCxt): void { - const {gen, schema, data} = cxt - gen.add(N.json, str`{`) - const first = gen.let("first", true) - gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first)) - gen.add(N.json, str`}`) -} - -function serializeKeyValue(cxt: SerializeCxt, key: Name, schema: SchemaObject, first?: Name): void { - const {gen, data} = cxt - addComma(cxt, first) - serializeString({...cxt, data: key}) - gen.add(N.json, str`:`) - const value = gen.const("value", _`${data}${getProperty(key)}`) - serializeCode({...cxt, schema, data: value}) -} - -function serializeDiscriminator(cxt: SerializeCxt): void { - const {gen, schema, data} = cxt - const {discriminator} = schema - gen.add(N.json, str`{${JSON.stringify(discriminator)}:`) - const tag = gen.const("tag", _`${data}${getProperty(discriminator)}`) - serializeString({...cxt, data: tag}) - gen.if(false) - for (const tagValue in schema.mapping) { - gen.elseIf(_`${tag} === ${tagValue}`) - const sch = schema.mapping[tagValue] - serializeSchemaProperties({...cxt, schema: sch}, discriminator) - } - gen.endIf() - gen.add(N.json, str`}`) -} - -function serializeProperties(cxt: SerializeCxt): void { - const {gen} = cxt - gen.add(N.json, str`{`) - serializeSchemaProperties(cxt) - gen.add(N.json, str`}`) -} - -function serializeSchemaProperties(cxt: SerializeCxt, discriminator?: string): void { - const {gen, schema, data} = cxt - const {properties, optionalProperties} = schema - const props = keys(properties) - const optProps = keys(optionalProperties) - const allProps = allProperties(props.concat(optProps)) - let first = !discriminator - let firstProp: Name | undefined - - for (const key of props) { - if (first) first = false - else gen.add(N.json, str`,`) - serializeProperty(key, properties[key], keyValue(key)) - } - if (first) firstProp = gen.let("first", true) - for (const key of optProps) { - const value = keyValue(key) - gen.if(and(_`${value} !== undefined`, isOwnProperty(gen, data, key)), () => { - addComma(cxt, firstProp) - serializeProperty(key, optionalProperties[key], value) - }) - } - if (schema.additionalProperties) { - gen.forIn("key", data, (key) => - gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp)) - ) - } - - function keys(ps?: SchemaObjectMap): string[] { - return ps ? Object.keys(ps) : [] - } - - function allProperties(ps: string[]): string[] { - if (discriminator) ps.push(discriminator) - if (new Set(ps).size !== ps.length) { - throw new Error("JTD: properties/optionalProperties/disciminator overlap") - } - return ps - } - - function keyValue(key: string): Name { - return gen.const("value", _`${data}${getProperty(key)}`) - } - - function serializeProperty(key: string, propSchema: SchemaObject, value: Name): void { - gen.add(N.json, str`${JSON.stringify(key)}:`) - serializeCode({...cxt, schema: propSchema, data: value}) - } - - function isAdditional(key: Name, ps: string[]): Code | true { - return ps.length ? and(...ps.map((p) => _`${key} !== ${p}`)) : true - } -} - -function serializeType(cxt: SerializeCxt): void { - const {gen, schema, data} = cxt - switch (schema.type) { - case "boolean": - gen.add(N.json, _`${data} ? "true" : "false"`) - break - case "string": - serializeString(cxt) - break - case "timestamp": - gen.if( - _`${data} instanceof Date`, - () => gen.add(N.json, _`'"' + ${data}.toISOString() + '"'`), - () => serializeString(cxt) - ) - break - default: - serializeNumber(cxt) - } -} - -function serializeString({gen, data}: SerializeCxt): void { - gen.add(N.json, _`${useFunc(gen, quote)}(${data})`) -} - -function serializeNumber({gen, data}: SerializeCxt): void { - gen.add(N.json, _`"" + ${data}`) -} - -function serializeRef(cxt: SerializeCxt): void { - const {gen, self, data, definitions, schema, schemaEnv} = cxt - const {ref} = schema - const refSchema = definitions[ref] - if (!refSchema) throw new MissingRefError(self.opts.uriResolver, "", ref, `No definition ${ref}`) - if (!hasRef(refSchema)) return serializeCode({...cxt, schema: refSchema}) - const {root} = schemaEnv - const sch = compileSerializer.call(self, new SchemaEnv({schema: refSchema, root}), definitions) - gen.add(N.json, _`${getSerialize(gen, sch)}(${data})`) -} - -function getSerialize(gen: CodeGen, sch: SchemaEnv): Code { - return sch.serialize - ? gen.scopeValue("serialize", {ref: sch.serialize}) - : _`${gen.scopeValue("wrapper", {ref: sch})}.serialize` -} - -function serializeEmpty({gen, data}: SerializeCxt): void { - gen.add(N.json, _`JSON.stringify(${data})`) -} - -function addComma({gen}: SerializeCxt, first?: Name): void { - if (first) { - gen.if( - first, - () => gen.assign(first, false), - () => gen.add(N.json, str`,`) - ) - } else { - gen.add(N.json, str`,`) - } -} diff --git a/node_modules/ajv/lib/compile/jtd/types.ts b/node_modules/ajv/lib/compile/jtd/types.ts deleted file mode 100644 index 7f3619576..000000000 --- a/node_modules/ajv/lib/compile/jtd/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type {SchemaObject} from "../../types" - -export type SchemaObjectMap = {[Ref in string]?: SchemaObject} - -export const jtdForms = [ - "elements", - "values", - "discriminator", - "properties", - "optionalProperties", - "enum", - "type", - "ref", -] as const - -export type JTDForm = typeof jtdForms[number] diff --git a/node_modules/ajv/lib/compile/names.ts b/node_modules/ajv/lib/compile/names.ts deleted file mode 100644 index b4b242e17..000000000 --- a/node_modules/ajv/lib/compile/names.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {Name} from "./codegen" - -const names = { - // validation function arguments - data: new Name("data"), // data passed to validation function - // args passed from referencing schema - valCxt: new Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below - instancePath: new Name("instancePath"), - parentData: new Name("parentData"), - parentDataProperty: new Name("parentDataProperty"), - rootData: new Name("rootData"), // root data - same as the data passed to the first/top validation function - dynamicAnchors: new Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef - // function scoped variables - vErrors: new Name("vErrors"), // null or array of validation errors - errors: new Name("errors"), // counter of validation errors - this: new Name("this"), - // "globals" - self: new Name("self"), - scope: new Name("scope"), - // JTD serialize/parse name for JSON string and position - json: new Name("json"), - jsonPos: new Name("jsonPos"), - jsonLen: new Name("jsonLen"), - jsonPart: new Name("jsonPart"), -} - -export default names diff --git a/node_modules/ajv/lib/compile/ref_error.ts b/node_modules/ajv/lib/compile/ref_error.ts deleted file mode 100644 index 386bf0499..000000000 --- a/node_modules/ajv/lib/compile/ref_error.ts +++ /dev/null @@ -1,13 +0,0 @@ -import {resolveUrl, normalizeId, getFullPath} from "./resolve" -import type {UriResolver} from "../types" - -export default class MissingRefError extends Error { - readonly missingRef: string - readonly missingSchema: string - - constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string) { - super(msg || `can't resolve reference ${ref} from id ${baseId}`) - this.missingRef = resolveUrl(resolver, baseId, ref) - this.missingSchema = normalizeId(getFullPath(resolver, this.missingRef)) - } -} diff --git a/node_modules/ajv/lib/compile/resolve.ts b/node_modules/ajv/lib/compile/resolve.ts deleted file mode 100644 index 4360eab06..000000000 --- a/node_modules/ajv/lib/compile/resolve.ts +++ /dev/null @@ -1,149 +0,0 @@ -import type {AnySchema, AnySchemaObject, UriResolver} from "../types" -import type Ajv from "../ajv" -import type {URIComponents} from "uri-js" -import {eachItem} from "./util" -import * as equal from "fast-deep-equal" -import * as traverse from "json-schema-traverse" - -// the hash of local references inside the schema (created by getSchemaRefs), used for inline resolution -export type LocalRefs = {[Ref in string]?: AnySchemaObject} - -// TODO refactor to use keyword definitions -const SIMPLE_INLINED = new Set([ - "type", - "format", - "pattern", - "maxLength", - "minLength", - "maxProperties", - "minProperties", - "maxItems", - "minItems", - "maximum", - "minimum", - "uniqueItems", - "multipleOf", - "required", - "enum", - "const", -]) - -export function inlineRef(schema: AnySchema, limit: boolean | number = true): boolean { - if (typeof schema == "boolean") return true - if (limit === true) return !hasRef(schema) - if (!limit) return false - return countKeys(schema) <= limit -} - -const REF_KEYWORDS = new Set([ - "$ref", - "$recursiveRef", - "$recursiveAnchor", - "$dynamicRef", - "$dynamicAnchor", -]) - -function hasRef(schema: AnySchemaObject): boolean { - for (const key in schema) { - if (REF_KEYWORDS.has(key)) return true - const sch = schema[key] - if (Array.isArray(sch) && sch.some(hasRef)) return true - if (typeof sch == "object" && hasRef(sch)) return true - } - return false -} - -function countKeys(schema: AnySchemaObject): number { - let count = 0 - for (const key in schema) { - if (key === "$ref") return Infinity - count++ - if (SIMPLE_INLINED.has(key)) continue - if (typeof schema[key] == "object") { - eachItem(schema[key], (sch) => (count += countKeys(sch))) - } - if (count === Infinity) return Infinity - } - return count -} - -export function getFullPath(resolver: UriResolver, id = "", normalize?: boolean): string { - if (normalize !== false) id = normalizeId(id) - const p = resolver.parse(id) - return _getFullPath(resolver, p) -} - -export function _getFullPath(resolver: UriResolver, p: URIComponents): string { - const serialized = resolver.serialize(p) - return serialized.split("#")[0] + "#" -} - -const TRAILING_SLASH_HASH = /#\/?$/ -export function normalizeId(id: string | undefined): string { - return id ? id.replace(TRAILING_SLASH_HASH, "") : "" -} - -export function resolveUrl(resolver: UriResolver, baseId: string, id: string): string { - id = normalizeId(id) - return resolver.resolve(baseId, id) -} - -const ANCHOR = /^[a-z_][-a-z0-9._]*$/i - -export function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs { - if (typeof schema == "boolean") return {} - const {schemaId, uriResolver} = this.opts - const schId = normalizeId(schema[schemaId] || baseId) - const baseIds: {[JsonPtr in string]?: string} = {"": schId} - const pathPrefix = getFullPath(uriResolver, schId, false) - const localRefs: LocalRefs = {} - const schemaRefs: Set = new Set() - - traverse(schema, {allKeys: true}, (sch, jsonPtr, _, parentJsonPtr) => { - if (parentJsonPtr === undefined) return - const fullPath = pathPrefix + jsonPtr - let baseId = baseIds[parentJsonPtr] - if (typeof sch[schemaId] == "string") baseId = addRef.call(this, sch[schemaId]) - addAnchor.call(this, sch.$anchor) - addAnchor.call(this, sch.$dynamicAnchor) - baseIds[jsonPtr] = baseId - - function addRef(this: Ajv, ref: string): string { - // eslint-disable-next-line @typescript-eslint/unbound-method - const _resolve = this.opts.uriResolver.resolve - ref = normalizeId(baseId ? _resolve(baseId, ref) : ref) - if (schemaRefs.has(ref)) throw ambiguos(ref) - schemaRefs.add(ref) - let schOrRef = this.refs[ref] - if (typeof schOrRef == "string") schOrRef = this.refs[schOrRef] - if (typeof schOrRef == "object") { - checkAmbiguosRef(sch, schOrRef.schema, ref) - } else if (ref !== normalizeId(fullPath)) { - if (ref[0] === "#") { - checkAmbiguosRef(sch, localRefs[ref], ref) - localRefs[ref] = sch - } else { - this.refs[ref] = fullPath - } - } - return ref - } - - function addAnchor(this: Ajv, anchor: unknown): void { - if (typeof anchor == "string") { - if (!ANCHOR.test(anchor)) throw new Error(`invalid anchor "${anchor}"`) - addRef.call(this, `#${anchor}`) - } - } - }) - - return localRefs - - function checkAmbiguosRef(sch1: AnySchema, sch2: AnySchema | undefined, ref: string): void { - if (sch2 !== undefined && !equal(sch1, sch2)) throw ambiguos(ref) - } - - function ambiguos(ref: string): Error { - return new Error(`reference "${ref}" resolves to more than one schema`) - } -} diff --git a/node_modules/ajv/lib/compile/rules.ts b/node_modules/ajv/lib/compile/rules.ts deleted file mode 100644 index ea65074f9..000000000 --- a/node_modules/ajv/lib/compile/rules.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type {AddedKeywordDefinition} from "../types" - -const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"] as const - -export type JSONType = typeof _jsonTypes[number] - -const jsonTypes: Set = new Set(_jsonTypes) - -export function isJSONType(x: unknown): x is JSONType { - return typeof x == "string" && jsonTypes.has(x) -} - -type ValidationTypes = { - [K in JSONType]: boolean | RuleGroup | undefined -} - -export interface ValidationRules { - rules: RuleGroup[] - post: RuleGroup - all: {[Key in string]?: boolean | Rule} // rules that have to be validated - keywords: {[Key in string]?: boolean} // all known keywords (superset of "all") - types: ValidationTypes -} - -export interface RuleGroup { - type?: JSONType - rules: Rule[] -} - -// This interface wraps KeywordDefinition because definition can have multiple keywords -export interface Rule { - keyword: string - definition: AddedKeywordDefinition -} - -export function getRules(): ValidationRules { - const groups: Record<"number" | "string" | "array" | "object", RuleGroup> = { - number: {type: "number", rules: []}, - string: {type: "string", rules: []}, - array: {type: "array", rules: []}, - object: {type: "object", rules: []}, - } - return { - types: {...groups, integer: true, boolean: true, null: true}, - rules: [{rules: []}, groups.number, groups.string, groups.array, groups.object], - post: {rules: []}, - all: {}, - keywords: {}, - } -} diff --git a/node_modules/ajv/lib/compile/util.ts b/node_modules/ajv/lib/compile/util.ts deleted file mode 100644 index cefae51c2..000000000 --- a/node_modules/ajv/lib/compile/util.ts +++ /dev/null @@ -1,213 +0,0 @@ -import type {AnySchema, EvaluatedProperties, EvaluatedItems} from "../types" -import type {SchemaCxt, SchemaObjCxt} from "." -import {_, getProperty, Code, Name, CodeGen} from "./codegen" -import {_Code} from "./codegen/code" -import type {Rule, ValidationRules} from "./rules" - -// TODO refactor to use Set -export function toHash(arr: T[]): {[K in T]?: true} { - const hash: {[K in T]?: true} = {} - for (const item of arr) hash[item] = true - return hash -} - -export function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void { - if (typeof schema == "boolean") return schema - if (Object.keys(schema).length === 0) return true - checkUnknownRules(it, schema) - return !schemaHasRules(schema, it.self.RULES.all) -} - -export function checkUnknownRules(it: SchemaCxt, schema: AnySchema = it.schema): void { - const {opts, self} = it - if (!opts.strictSchema) return - if (typeof schema === "boolean") return - const rules = self.RULES.keywords - for (const key in schema) { - if (!rules[key]) checkStrictMode(it, `unknown keyword: "${key}"`) - } -} - -export function schemaHasRules( - schema: AnySchema, - rules: {[Key in string]?: boolean | Rule} -): boolean { - if (typeof schema == "boolean") return !schema - for (const key in schema) if (rules[key]) return true - return false -} - -export function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean { - if (typeof schema == "boolean") return !schema - for (const key in schema) if (key !== "$ref" && RULES.all[key]) return true - return false -} - -export function schemaRefOrVal( - {topSchemaRef, schemaPath}: SchemaObjCxt, - schema: unknown, - keyword: string, - $data?: string | false -): Code | number | boolean { - if (!$data) { - if (typeof schema == "number" || typeof schema == "boolean") return schema - if (typeof schema == "string") return _`${schema}` - } - return _`${topSchemaRef}${schemaPath}${getProperty(keyword)}` -} - -export function unescapeFragment(str: string): string { - return unescapeJsonPointer(decodeURIComponent(str)) -} - -export function escapeFragment(str: string | number): string { - return encodeURIComponent(escapeJsonPointer(str)) -} - -export function escapeJsonPointer(str: string | number): string { - if (typeof str == "number") return `${str}` - return str.replace(/~/g, "~0").replace(/\//g, "~1") -} - -export function unescapeJsonPointer(str: string): string { - return str.replace(/~1/g, "/").replace(/~0/g, "~") -} - -export function eachItem(xs: T | T[], f: (x: T) => void): void { - if (Array.isArray(xs)) { - for (const x of xs) f(x) - } else { - f(xs) - } -} - -type SomeEvaluated = EvaluatedProperties | EvaluatedItems - -type MergeEvaluatedFunc = ( - gen: CodeGen, - from: Name | T, - to: Name | Exclude | undefined, - toName?: typeof Name -) => Name | T - -interface MakeMergeFuncArgs { - mergeNames: (gen: CodeGen, from: Name, to: Name) => void - mergeToName: (gen: CodeGen, from: T, to: Name) => void - mergeValues: (from: T, to: Exclude) => T - resultToName: (gen: CodeGen, res?: T) => Name -} - -function makeMergeEvaluated({ - mergeNames, - mergeToName, - mergeValues, - resultToName, -}: MakeMergeFuncArgs): MergeEvaluatedFunc { - return (gen, from, to, toName) => { - const res = - to === undefined - ? from - : to instanceof Name - ? (from instanceof Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) - : from instanceof Name - ? (mergeToName(gen, to, from), from) - : mergeValues(from, to) - return toName === Name && !(res instanceof Name) ? resultToName(gen, res) : res - } -} - -interface MergeEvaluated { - props: MergeEvaluatedFunc - items: MergeEvaluatedFunc -} - -export const mergeEvaluated: MergeEvaluated = { - props: makeMergeEvaluated({ - mergeNames: (gen, from, to) => - gen.if(_`${to} !== true && ${from} !== undefined`, () => { - gen.if( - _`${from} === true`, - () => gen.assign(to, true), - () => gen.assign(to, _`${to} || {}`).code(_`Object.assign(${to}, ${from})`) - ) - }), - mergeToName: (gen, from, to) => - gen.if(_`${to} !== true`, () => { - if (from === true) { - gen.assign(to, true) - } else { - gen.assign(to, _`${to} || {}`) - setEvaluated(gen, to, from) - } - }), - mergeValues: (from, to) => (from === true ? true : {...from, ...to}), - resultToName: evaluatedPropsToName, - }), - items: makeMergeEvaluated({ - mergeNames: (gen, from, to) => - gen.if(_`${to} !== true && ${from} !== undefined`, () => - gen.assign(to, _`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`) - ), - mergeToName: (gen, from, to) => - gen.if(_`${to} !== true`, () => - gen.assign(to, from === true ? true : _`${to} > ${from} ? ${to} : ${from}`) - ), - mergeValues: (from, to) => (from === true ? true : Math.max(from, to)), - resultToName: (gen, items) => gen.var("items", items), - }), -} - -export function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name { - if (ps === true) return gen.var("props", true) - const props = gen.var("props", _`{}`) - if (ps !== undefined) setEvaluated(gen, props, ps) - return props -} - -export function setEvaluated(gen: CodeGen, props: Name, ps: {[K in string]?: true}): void { - Object.keys(ps).forEach((p) => gen.assign(_`${props}${getProperty(p)}`, true)) -} - -const snippets: {[S in string]?: _Code} = {} - -export function useFunc(gen: CodeGen, f: {code: string}): Name { - return gen.scopeValue("func", { - ref: f, - code: snippets[f.code] || (snippets[f.code] = new _Code(f.code)), - }) -} - -export enum Type { - Num, - Str, -} - -export function getErrorPath( - dataProp: Name | string | number, - dataPropType?: Type, - jsPropertySyntax?: boolean -): Code | string { - // let path - if (dataProp instanceof Name) { - const isNumber = dataPropType === Type.Num - return jsPropertySyntax - ? isNumber - ? _`"[" + ${dataProp} + "]"` - : _`"['" + ${dataProp} + "']"` - : isNumber - ? _`"/" + ${dataProp}` - : _`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")` // TODO maybe use global escapePointer - } - return jsPropertySyntax ? getProperty(dataProp).toString() : "/" + escapeJsonPointer(dataProp) -} - -export function checkStrictMode( - it: SchemaCxt, - msg: string, - mode: boolean | "log" = it.opts.strictSchema -): void { - if (!mode) return - msg = `strict mode: ${msg}` - if (mode === true) throw new Error(msg) - it.self.logger.warn(msg) -} diff --git a/node_modules/ajv/lib/compile/validate/applicability.ts b/node_modules/ajv/lib/compile/validate/applicability.ts deleted file mode 100644 index 478b704ac..000000000 --- a/node_modules/ajv/lib/compile/validate/applicability.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type {AnySchemaObject} from "../../types" -import type {SchemaObjCxt} from ".." -import type {JSONType, RuleGroup, Rule} from "../rules" - -export function schemaHasRulesForType( - {schema, self}: SchemaObjCxt, - type: JSONType -): boolean | undefined { - const group = self.RULES.types[type] - return group && group !== true && shouldUseGroup(schema, group) -} - -export function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean { - return group.rules.some((rule) => shouldUseRule(schema, rule)) -} - -export function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined { - return ( - schema[rule.keyword] !== undefined || - rule.definition.implements?.some((kwd) => schema[kwd] !== undefined) - ) -} diff --git a/node_modules/ajv/lib/compile/validate/boolSchema.ts b/node_modules/ajv/lib/compile/validate/boolSchema.ts deleted file mode 100644 index 156355016..000000000 --- a/node_modules/ajv/lib/compile/validate/boolSchema.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type {KeywordErrorDefinition, KeywordErrorCxt} from "../../types" -import type {SchemaCxt} from ".." -import {reportError} from "../errors" -import {_, Name} from "../codegen" -import N from "../names" - -const boolError: KeywordErrorDefinition = { - message: "boolean schema is false", -} - -export function topBoolOrEmptySchema(it: SchemaCxt): void { - const {gen, schema, validateName} = it - if (schema === false) { - falseSchemaError(it, false) - } else if (typeof schema == "object" && schema.$async === true) { - gen.return(N.data) - } else { - gen.assign(_`${validateName}.errors`, null) - gen.return(true) - } -} - -export function boolOrEmptySchema(it: SchemaCxt, valid: Name): void { - const {gen, schema} = it - if (schema === false) { - gen.var(valid, false) // TODO var - falseSchemaError(it) - } else { - gen.var(valid, true) // TODO var - } -} - -function falseSchemaError(it: SchemaCxt, overrideAllErrors?: boolean): void { - const {gen, data} = it - // TODO maybe some other interface should be used for non-keyword validation errors... - const cxt: KeywordErrorCxt = { - gen, - keyword: "false schema", - data, - schema: false, - schemaCode: false, - schemaValue: false, - params: {}, - it, - } - reportError(cxt, boolError, undefined, overrideAllErrors) -} diff --git a/node_modules/ajv/lib/compile/validate/dataType.ts b/node_modules/ajv/lib/compile/validate/dataType.ts deleted file mode 100644 index b315c2ce9..000000000 --- a/node_modules/ajv/lib/compile/validate/dataType.ts +++ /dev/null @@ -1,229 +0,0 @@ -import type { - KeywordErrorDefinition, - KeywordErrorCxt, - ErrorObject, - AnySchemaObject, -} from "../../types" -import type {SchemaObjCxt} from ".." -import {isJSONType, JSONType} from "../rules" -import {schemaHasRulesForType} from "./applicability" -import {reportError} from "../errors" -import {_, nil, and, not, operators, Code, Name} from "../codegen" -import {toHash, schemaRefOrVal} from "../util" - -export enum DataType { - Correct, - Wrong, -} - -export function getSchemaTypes(schema: AnySchemaObject): JSONType[] { - const types = getJSONTypes(schema.type) - const hasNull = types.includes("null") - if (hasNull) { - if (schema.nullable === false) throw new Error("type: null contradicts nullable: false") - } else { - if (!types.length && schema.nullable !== undefined) { - throw new Error('"nullable" cannot be used without "type"') - } - if (schema.nullable === true) types.push("null") - } - return types -} - -export function getJSONTypes(ts: unknown | unknown[]): JSONType[] { - const types: unknown[] = Array.isArray(ts) ? ts : ts ? [ts] : [] - if (types.every(isJSONType)) return types - throw new Error("type must be JSONType or JSONType[]: " + types.join(",")) -} - -export function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean { - const {gen, data, opts} = it - const coerceTo = coerceToTypes(types, opts.coerceTypes) - const checkTypes = - types.length > 0 && - !(coerceTo.length === 0 && types.length === 1 && schemaHasRulesForType(it, types[0])) - if (checkTypes) { - const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong) - gen.if(wrongType, () => { - if (coerceTo.length) coerceData(it, types, coerceTo) - else reportTypeError(it) - }) - } - return checkTypes -} - -const COERCIBLE: Set = new Set(["string", "number", "integer", "boolean", "null"]) -function coerceToTypes(types: JSONType[], coerceTypes?: boolean | "array"): JSONType[] { - return coerceTypes - ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array")) - : [] -} - -function coerceData(it: SchemaObjCxt, types: JSONType[], coerceTo: JSONType[]): void { - const {gen, data, opts} = it - const dataType = gen.let("dataType", _`typeof ${data}`) - const coerced = gen.let("coerced", _`undefined`) - if (opts.coerceTypes === "array") { - gen.if(_`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => - gen - .assign(data, _`${data}[0]`) - .assign(dataType, _`typeof ${data}`) - .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)) - ) - } - gen.if(_`${coerced} !== undefined`) - for (const t of coerceTo) { - if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) { - coerceSpecificType(t) - } - } - gen.else() - reportTypeError(it) - gen.endIf() - - gen.if(_`${coerced} !== undefined`, () => { - gen.assign(data, coerced) - assignParentData(it, coerced) - }) - - function coerceSpecificType(t: string): void { - switch (t) { - case "string": - gen - .elseIf(_`${dataType} == "number" || ${dataType} == "boolean"`) - .assign(coerced, _`"" + ${data}`) - .elseIf(_`${data} === null`) - .assign(coerced, _`""`) - return - case "number": - gen - .elseIf( - _`${dataType} == "boolean" || ${data} === null - || (${dataType} == "string" && ${data} && ${data} == +${data})` - ) - .assign(coerced, _`+${data}`) - return - case "integer": - gen - .elseIf( - _`${dataType} === "boolean" || ${data} === null - || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))` - ) - .assign(coerced, _`+${data}`) - return - case "boolean": - gen - .elseIf(_`${data} === "false" || ${data} === 0 || ${data} === null`) - .assign(coerced, false) - .elseIf(_`${data} === "true" || ${data} === 1`) - .assign(coerced, true) - return - case "null": - gen.elseIf(_`${data} === "" || ${data} === 0 || ${data} === false`) - gen.assign(coerced, null) - return - - case "array": - gen - .elseIf( - _`${dataType} === "string" || ${dataType} === "number" - || ${dataType} === "boolean" || ${data} === null` - ) - .assign(coerced, _`[${data}]`) - } - } -} - -function assignParentData({gen, parentData, parentDataProperty}: SchemaObjCxt, expr: Name): void { - // TODO use gen.property - gen.if(_`${parentData} !== undefined`, () => - gen.assign(_`${parentData}[${parentDataProperty}]`, expr) - ) -} - -export function checkDataType( - dataType: JSONType, - data: Name, - strictNums?: boolean | "log", - correct = DataType.Correct -): Code { - const EQ = correct === DataType.Correct ? operators.EQ : operators.NEQ - let cond: Code - switch (dataType) { - case "null": - return _`${data} ${EQ} null` - case "array": - cond = _`Array.isArray(${data})` - break - case "object": - cond = _`${data} && typeof ${data} == "object" && !Array.isArray(${data})` - break - case "integer": - cond = numCond(_`!(${data} % 1) && !isNaN(${data})`) - break - case "number": - cond = numCond() - break - default: - return _`typeof ${data} ${EQ} ${dataType}` - } - return correct === DataType.Correct ? cond : not(cond) - - function numCond(_cond: Code = nil): Code { - return and(_`typeof ${data} == "number"`, _cond, strictNums ? _`isFinite(${data})` : nil) - } -} - -export function checkDataTypes( - dataTypes: JSONType[], - data: Name, - strictNums?: boolean | "log", - correct?: DataType -): Code { - if (dataTypes.length === 1) { - return checkDataType(dataTypes[0], data, strictNums, correct) - } - let cond: Code - const types = toHash(dataTypes) - if (types.array && types.object) { - const notObj = _`typeof ${data} != "object"` - cond = types.null ? notObj : _`!${data} || ${notObj}` - delete types.null - delete types.array - delete types.object - } else { - cond = nil - } - if (types.number) delete types.integer - for (const t in types) cond = and(cond, checkDataType(t as JSONType, data, strictNums, correct)) - return cond -} - -export type TypeError = ErrorObject<"type", {type: string}> - -const typeError: KeywordErrorDefinition = { - message: ({schema}) => `must be ${schema}`, - params: ({schema, schemaValue}) => - typeof schema == "string" ? _`{type: ${schema}}` : _`{type: ${schemaValue}}`, -} - -export function reportTypeError(it: SchemaObjCxt): void { - const cxt = getTypeErrorContext(it) - reportError(cxt, typeError) -} - -function getTypeErrorContext(it: SchemaObjCxt): KeywordErrorCxt { - const {gen, data, schema} = it - const schemaCode = schemaRefOrVal(it, schema, "type") - return { - gen, - keyword: "type", - data, - schema: schema.type, - schemaCode, - schemaValue: schemaCode, - parentSchema: schema, - params: {}, - it, - } -} diff --git a/node_modules/ajv/lib/compile/validate/defaults.ts b/node_modules/ajv/lib/compile/validate/defaults.ts deleted file mode 100644 index 2ad3d4df8..000000000 --- a/node_modules/ajv/lib/compile/validate/defaults.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type {SchemaObjCxt} from ".." -import {_, getProperty, stringify} from "../codegen" -import {checkStrictMode} from "../util" - -export function assignDefaults(it: SchemaObjCxt, ty?: string): void { - const {properties, items} = it.schema - if (ty === "object" && properties) { - for (const key in properties) { - assignDefault(it, key, properties[key].default) - } - } else if (ty === "array" && Array.isArray(items)) { - items.forEach((sch, i: number) => assignDefault(it, i, sch.default)) - } -} - -function assignDefault(it: SchemaObjCxt, prop: string | number, defaultValue: unknown): void { - const {gen, compositeRule, data, opts} = it - if (defaultValue === undefined) return - const childData = _`${data}${getProperty(prop)}` - if (compositeRule) { - checkStrictMode(it, `default is ignored for: ${childData}`) - return - } - - let condition = _`${childData} === undefined` - if (opts.useDefaults === "empty") { - condition = _`${condition} || ${childData} === null || ${childData} === ""` - } - // `${childData} === undefined` + - // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "") - gen.if(condition, _`${childData} = ${stringify(defaultValue)}`) -} diff --git a/node_modules/ajv/lib/compile/validate/index.ts b/node_modules/ajv/lib/compile/validate/index.ts deleted file mode 100644 index 15ecabd85..000000000 --- a/node_modules/ajv/lib/compile/validate/index.ts +++ /dev/null @@ -1,582 +0,0 @@ -import type { - AddedKeywordDefinition, - AnySchema, - AnySchemaObject, - KeywordErrorCxt, - KeywordCxtParams, -} from "../../types" -import type {SchemaCxt, SchemaObjCxt} from ".." -import type {InstanceOptions} from "../../core" -import {boolOrEmptySchema, topBoolOrEmptySchema} from "./boolSchema" -import {coerceAndCheckDataType, getSchemaTypes} from "./dataType" -import {shouldUseGroup, shouldUseRule} from "./applicability" -import {checkDataType, checkDataTypes, reportTypeError, DataType} from "./dataType" -import {assignDefaults} from "./defaults" -import {funcKeywordCode, macroKeywordCode, validateKeywordUsage, validSchemaType} from "./keyword" -import {getSubschema, extendSubschemaData, SubschemaArgs, extendSubschemaMode} from "./subschema" -import {_, nil, str, or, not, getProperty, Block, Code, Name, CodeGen} from "../codegen" -import N from "../names" -import {resolveUrl} from "../resolve" -import { - schemaRefOrVal, - schemaHasRulesButRef, - checkUnknownRules, - checkStrictMode, - unescapeJsonPointer, - mergeEvaluated, -} from "../util" -import type {JSONType, Rule, RuleGroup} from "../rules" -import { - ErrorPaths, - reportError, - reportExtraError, - resetErrorsCount, - keyword$DataError, -} from "../errors" - -// schema compilation - generates validation function, subschemaCode (below) is used for subschemas -export function validateFunctionCode(it: SchemaCxt): void { - if (isSchemaObj(it)) { - checkKeywords(it) - if (schemaCxtHasRules(it)) { - topSchemaObjCode(it) - return - } - } - validateFunction(it, () => topBoolOrEmptySchema(it)) -} - -function validateFunction( - {gen, validateName, schema, schemaEnv, opts}: SchemaCxt, - body: Block -): void { - if (opts.code.es5) { - gen.func(validateName, _`${N.data}, ${N.valCxt}`, schemaEnv.$async, () => { - gen.code(_`"use strict"; ${funcSourceUrl(schema, opts)}`) - destructureValCxtES5(gen, opts) - gen.code(body) - }) - } else { - gen.func(validateName, _`${N.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => - gen.code(funcSourceUrl(schema, opts)).code(body) - ) - } -} - -function destructureValCxt(opts: InstanceOptions): Code { - return _`{${N.instancePath}="", ${N.parentData}, ${N.parentDataProperty}, ${N.rootData}=${ - N.data - }${opts.dynamicRef ? _`, ${N.dynamicAnchors}={}` : nil}}={}` -} - -function destructureValCxtES5(gen: CodeGen, opts: InstanceOptions): void { - gen.if( - N.valCxt, - () => { - gen.var(N.instancePath, _`${N.valCxt}.${N.instancePath}`) - gen.var(N.parentData, _`${N.valCxt}.${N.parentData}`) - gen.var(N.parentDataProperty, _`${N.valCxt}.${N.parentDataProperty}`) - gen.var(N.rootData, _`${N.valCxt}.${N.rootData}`) - if (opts.dynamicRef) gen.var(N.dynamicAnchors, _`${N.valCxt}.${N.dynamicAnchors}`) - }, - () => { - gen.var(N.instancePath, _`""`) - gen.var(N.parentData, _`undefined`) - gen.var(N.parentDataProperty, _`undefined`) - gen.var(N.rootData, N.data) - if (opts.dynamicRef) gen.var(N.dynamicAnchors, _`{}`) - } - ) -} - -function topSchemaObjCode(it: SchemaObjCxt): void { - const {schema, opts, gen} = it - validateFunction(it, () => { - if (opts.$comment && schema.$comment) commentKeyword(it) - checkNoDefault(it) - gen.let(N.vErrors, null) - gen.let(N.errors, 0) - if (opts.unevaluated) resetEvaluated(it) - typeAndKeywords(it) - returnResults(it) - }) - return -} - -function resetEvaluated(it: SchemaObjCxt): void { - // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated - const {gen, validateName} = it - it.evaluated = gen.const("evaluated", _`${validateName}.evaluated`) - gen.if(_`${it.evaluated}.dynamicProps`, () => gen.assign(_`${it.evaluated}.props`, _`undefined`)) - gen.if(_`${it.evaluated}.dynamicItems`, () => gen.assign(_`${it.evaluated}.items`, _`undefined`)) -} - -function funcSourceUrl(schema: AnySchema, opts: InstanceOptions): Code { - const schId = typeof schema == "object" && schema[opts.schemaId] - return schId && (opts.code.source || opts.code.process) ? _`/*# sourceURL=${schId} */` : nil -} - -// schema compilation - this function is used recursively to generate code for sub-schemas -function subschemaCode(it: SchemaCxt, valid: Name): void { - if (isSchemaObj(it)) { - checkKeywords(it) - if (schemaCxtHasRules(it)) { - subSchemaObjCode(it, valid) - return - } - } - boolOrEmptySchema(it, valid) -} - -function schemaCxtHasRules({schema, self}: SchemaCxt): boolean { - if (typeof schema == "boolean") return !schema - for (const key in schema) if (self.RULES.all[key]) return true - return false -} - -function isSchemaObj(it: SchemaCxt): it is SchemaObjCxt { - return typeof it.schema != "boolean" -} - -function subSchemaObjCode(it: SchemaObjCxt, valid: Name): void { - const {schema, gen, opts} = it - if (opts.$comment && schema.$comment) commentKeyword(it) - updateContext(it) - checkAsyncSchema(it) - const errsCount = gen.const("_errs", N.errors) - typeAndKeywords(it, errsCount) - // TODO var - gen.var(valid, _`${errsCount} === ${N.errors}`) -} - -function checkKeywords(it: SchemaObjCxt): void { - checkUnknownRules(it) - checkRefsAndKeywords(it) -} - -function typeAndKeywords(it: SchemaObjCxt, errsCount?: Name): void { - if (it.opts.jtd) return schemaKeywords(it, [], false, errsCount) - const types = getSchemaTypes(it.schema) - const checkedTypes = coerceAndCheckDataType(it, types) - schemaKeywords(it, types, !checkedTypes, errsCount) -} - -function checkRefsAndKeywords(it: SchemaObjCxt): void { - const {schema, errSchemaPath, opts, self} = it - if (schema.$ref && opts.ignoreKeywordsWithRef && schemaHasRulesButRef(schema, self.RULES)) { - self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`) - } -} - -function checkNoDefault(it: SchemaObjCxt): void { - const {schema, opts} = it - if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) { - checkStrictMode(it, "default is ignored in the schema root") - } -} - -function updateContext(it: SchemaObjCxt): void { - const schId = it.schema[it.opts.schemaId] - if (schId) it.baseId = resolveUrl(it.opts.uriResolver, it.baseId, schId) -} - -function checkAsyncSchema(it: SchemaObjCxt): void { - if (it.schema.$async && !it.schemaEnv.$async) throw new Error("async schema in sync schema") -} - -function commentKeyword({gen, schemaEnv, schema, errSchemaPath, opts}: SchemaObjCxt): void { - const msg = schema.$comment - if (opts.$comment === true) { - gen.code(_`${N.self}.logger.log(${msg})`) - } else if (typeof opts.$comment == "function") { - const schemaPath = str`${errSchemaPath}/$comment` - const rootName = gen.scopeValue("root", {ref: schemaEnv.root}) - gen.code(_`${N.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`) - } -} - -function returnResults(it: SchemaCxt): void { - const {gen, schemaEnv, validateName, ValidationError, opts} = it - if (schemaEnv.$async) { - // TODO assign unevaluated - gen.if( - _`${N.errors} === 0`, - () => gen.return(N.data), - () => gen.throw(_`new ${ValidationError as Name}(${N.vErrors})`) - ) - } else { - gen.assign(_`${validateName}.errors`, N.vErrors) - if (opts.unevaluated) assignEvaluated(it) - gen.return(_`${N.errors} === 0`) - } -} - -function assignEvaluated({gen, evaluated, props, items}: SchemaCxt): void { - if (props instanceof Name) gen.assign(_`${evaluated}.props`, props) - if (items instanceof Name) gen.assign(_`${evaluated}.items`, items) -} - -function schemaKeywords( - it: SchemaObjCxt, - types: JSONType[], - typeErrors: boolean, - errsCount?: Name -): void { - const {gen, schema, data, allErrors, opts, self} = it - const {RULES} = self - if (schema.$ref && (opts.ignoreKeywordsWithRef || !schemaHasRulesButRef(schema, RULES))) { - gen.block(() => keywordCode(it, "$ref", (RULES.all.$ref as Rule).definition)) // TODO typecast - return - } - if (!opts.jtd) checkStrictTypes(it, types) - gen.block(() => { - for (const group of RULES.rules) groupKeywords(group) - groupKeywords(RULES.post) - }) - - function groupKeywords(group: RuleGroup): void { - if (!shouldUseGroup(schema, group)) return - if (group.type) { - gen.if(checkDataType(group.type, data, opts.strictNumbers)) - iterateKeywords(it, group) - if (types.length === 1 && types[0] === group.type && typeErrors) { - gen.else() - reportTypeError(it) - } - gen.endIf() - } else { - iterateKeywords(it, group) - } - // TODO make it "ok" call? - if (!allErrors) gen.if(_`${N.errors} === ${errsCount || 0}`) - } -} - -function iterateKeywords(it: SchemaObjCxt, group: RuleGroup): void { - const { - gen, - schema, - opts: {useDefaults}, - } = it - if (useDefaults) assignDefaults(it, group.type) - gen.block(() => { - for (const rule of group.rules) { - if (shouldUseRule(schema, rule)) { - keywordCode(it, rule.keyword, rule.definition, group.type) - } - } - }) -} - -function checkStrictTypes(it: SchemaObjCxt, types: JSONType[]): void { - if (it.schemaEnv.meta || !it.opts.strictTypes) return - checkContextTypes(it, types) - if (!it.opts.allowUnionTypes) checkMultipleTypes(it, types) - checkKeywordTypes(it, it.dataTypes) -} - -function checkContextTypes(it: SchemaObjCxt, types: JSONType[]): void { - if (!types.length) return - if (!it.dataTypes.length) { - it.dataTypes = types - return - } - types.forEach((t) => { - if (!includesType(it.dataTypes, t)) { - strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`) - } - }) - narrowSchemaTypes(it, types) -} - -function checkMultipleTypes(it: SchemaObjCxt, ts: JSONType[]): void { - if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { - strictTypesError(it, "use allowUnionTypes to allow union type keyword") - } -} - -function checkKeywordTypes(it: SchemaObjCxt, ts: JSONType[]): void { - const rules = it.self.RULES.all - for (const keyword in rules) { - const rule = rules[keyword] - if (typeof rule == "object" && shouldUseRule(it.schema, rule)) { - const {type} = rule.definition - if (type.length && !type.some((t) => hasApplicableType(ts, t))) { - strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`) - } - } - } -} - -function hasApplicableType(schTs: JSONType[], kwdT: JSONType): boolean { - return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer")) -} - -function includesType(ts: JSONType[], t: JSONType): boolean { - return ts.includes(t) || (t === "integer" && ts.includes("number")) -} - -function narrowSchemaTypes(it: SchemaObjCxt, withTypes: JSONType[]): void { - const ts: JSONType[] = [] - for (const t of it.dataTypes) { - if (includesType(withTypes, t)) ts.push(t) - else if (withTypes.includes("integer") && t === "number") ts.push("integer") - } - it.dataTypes = ts -} - -function strictTypesError(it: SchemaObjCxt, msg: string): void { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath - msg += ` at "${schemaPath}" (strictTypes)` - checkStrictMode(it, msg, it.opts.strictTypes) -} - -export class KeywordCxt implements KeywordErrorCxt { - readonly gen: CodeGen - readonly allErrors?: boolean - readonly keyword: string - readonly data: Name // Name referencing the current level of the data instance - readonly $data?: string | false - schema: any // keyword value in the schema - readonly schemaValue: Code | number | boolean // Code reference to keyword schema value or primitive value - readonly schemaCode: Code | number | boolean // Code reference to resolved schema value (different if schema is $data) - readonly schemaType: JSONType[] // allowed type(s) of keyword value in the schema - readonly parentSchema: AnySchemaObject - readonly errsCount?: Name // Name reference to the number of validation errors collected before this keyword, - // requires option trackErrors in keyword definition - params: KeywordCxtParams // object to pass parameters to error messages from keyword code - readonly it: SchemaObjCxt // schema compilation context (schema is guaranteed to be an object, not boolean) - readonly def: AddedKeywordDefinition - - constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string) { - validateKeywordUsage(it, def, keyword) - this.gen = it.gen - this.allErrors = it.allErrors - this.keyword = keyword - this.data = it.data - this.schema = it.schema[keyword] - this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data - this.schemaValue = schemaRefOrVal(it, this.schema, keyword, this.$data) - this.schemaType = def.schemaType - this.parentSchema = it.schema - this.params = {} - this.it = it - this.def = def - - if (this.$data) { - this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)) - } else { - this.schemaCode = this.schemaValue - if (!validSchemaType(this.schema, def.schemaType, def.allowUndefined)) { - throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`) - } - } - - if ("code" in def ? def.trackErrors : def.errors !== false) { - this.errsCount = it.gen.const("_errs", N.errors) - } - } - - result(condition: Code, successAction?: () => void, failAction?: () => void): void { - this.failResult(not(condition), successAction, failAction) - } - - failResult(condition: Code, successAction?: () => void, failAction?: () => void): void { - this.gen.if(condition) - if (failAction) failAction() - else this.error() - if (successAction) { - this.gen.else() - successAction() - if (this.allErrors) this.gen.endIf() - } else { - if (this.allErrors) this.gen.endIf() - else this.gen.else() - } - } - - pass(condition: Code, failAction?: () => void): void { - this.failResult(not(condition), undefined, failAction) - } - - fail(condition?: Code): void { - if (condition === undefined) { - this.error() - if (!this.allErrors) this.gen.if(false) // this branch will be removed by gen.optimize - return - } - this.gen.if(condition) - this.error() - if (this.allErrors) this.gen.endIf() - else this.gen.else() - } - - fail$data(condition: Code): void { - if (!this.$data) return this.fail(condition) - const {schemaCode} = this - this.fail(_`${schemaCode} !== undefined && (${or(this.invalid$data(), condition)})`) - } - - error(append?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void { - if (errorParams) { - this.setParams(errorParams) - this._error(append, errorPaths) - this.setParams({}) - return - } - this._error(append, errorPaths) - } - - private _error(append?: boolean, errorPaths?: ErrorPaths): void { - ;(append ? reportExtraError : reportError)(this, this.def.error, errorPaths) - } - - $dataError(): void { - reportError(this, this.def.$dataError || keyword$DataError) - } - - reset(): void { - if (this.errsCount === undefined) throw new Error('add "trackErrors" to keyword definition') - resetErrorsCount(this.gen, this.errsCount) - } - - ok(cond: Code | boolean): void { - if (!this.allErrors) this.gen.if(cond) - } - - setParams(obj: KeywordCxtParams, assign?: true): void { - if (assign) Object.assign(this.params, obj) - else this.params = obj - } - - block$data(valid: Name, codeBlock: () => void, $dataValid: Code = nil): void { - this.gen.block(() => { - this.check$data(valid, $dataValid) - codeBlock() - }) - } - - check$data(valid: Name = nil, $dataValid: Code = nil): void { - if (!this.$data) return - const {gen, schemaCode, schemaType, def} = this - gen.if(or(_`${schemaCode} === undefined`, $dataValid)) - if (valid !== nil) gen.assign(valid, true) - if (schemaType.length || def.validateSchema) { - gen.elseIf(this.invalid$data()) - this.$dataError() - if (valid !== nil) gen.assign(valid, false) - } - gen.else() - } - - invalid$data(): Code { - const {gen, schemaCode, schemaType, def, it} = this - return or(wrong$DataType(), invalid$DataSchema()) - - function wrong$DataType(): Code { - if (schemaType.length) { - /* istanbul ignore if */ - if (!(schemaCode instanceof Name)) throw new Error("ajv implementation error") - const st = Array.isArray(schemaType) ? schemaType : [schemaType] - return _`${checkDataTypes(st, schemaCode, it.opts.strictNumbers, DataType.Wrong)}` - } - return nil - } - - function invalid$DataSchema(): Code { - if (def.validateSchema) { - const validateSchemaRef = gen.scopeValue("validate$data", {ref: def.validateSchema}) // TODO value.code for standalone - return _`!${validateSchemaRef}(${schemaCode})` - } - return nil - } - } - - subschema(appl: SubschemaArgs, valid: Name): SchemaCxt { - const subschema = getSubschema(this.it, appl) - extendSubschemaData(subschema, this.it, appl) - extendSubschemaMode(subschema, appl) - const nextContext = {...this.it, ...subschema, items: undefined, props: undefined} - subschemaCode(nextContext, valid) - return nextContext - } - - mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void { - const {it, gen} = this - if (!it.opts.unevaluated) return - if (it.props !== true && schemaCxt.props !== undefined) { - it.props = mergeEvaluated.props(gen, schemaCxt.props, it.props, toName) - } - if (it.items !== true && schemaCxt.items !== undefined) { - it.items = mergeEvaluated.items(gen, schemaCxt.items, it.items, toName) - } - } - - mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void { - const {it, gen} = this - if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { - gen.if(valid, () => this.mergeEvaluated(schemaCxt, Name)) - return true - } - } -} - -function keywordCode( - it: SchemaObjCxt, - keyword: string, - def: AddedKeywordDefinition, - ruleType?: JSONType -): void { - const cxt = new KeywordCxt(it, def, keyword) - if ("code" in def) { - def.code(cxt, ruleType) - } else if (cxt.$data && def.validate) { - funcKeywordCode(cxt, def) - } else if ("macro" in def) { - macroKeywordCode(cxt, def) - } else if (def.compile || def.validate) { - funcKeywordCode(cxt, def) - } -} - -const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/ -const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/ -export function getData( - $data: string, - {dataLevel, dataNames, dataPathArr}: SchemaCxt -): Code | number { - let jsonPointer - let data: Code - if ($data === "") return N.rootData - if ($data[0] === "/") { - if (!JSON_POINTER.test($data)) throw new Error(`Invalid JSON-pointer: ${$data}`) - jsonPointer = $data - data = N.rootData - } else { - const matches = RELATIVE_JSON_POINTER.exec($data) - if (!matches) throw new Error(`Invalid JSON-pointer: ${$data}`) - const up: number = +matches[1] - jsonPointer = matches[2] - if (jsonPointer === "#") { - if (up >= dataLevel) throw new Error(errorMsg("property/index", up)) - return dataPathArr[dataLevel - up] - } - if (up > dataLevel) throw new Error(errorMsg("data", up)) - data = dataNames[dataLevel - up] - if (!jsonPointer) return data - } - - let expr = data - const segments = jsonPointer.split("/") - for (const segment of segments) { - if (segment) { - data = _`${data}${getProperty(unescapeJsonPointer(segment))}` - expr = _`${expr} && ${data}` - } - } - return expr - - function errorMsg(pointerType: string, up: number): string { - return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}` - } -} diff --git a/node_modules/ajv/lib/compile/validate/keyword.ts b/node_modules/ajv/lib/compile/validate/keyword.ts deleted file mode 100644 index f854aa710..000000000 --- a/node_modules/ajv/lib/compile/validate/keyword.ts +++ /dev/null @@ -1,171 +0,0 @@ -import type {KeywordCxt} from "." -import type { - AnySchema, - SchemaValidateFunction, - AnyValidateFunction, - AddedKeywordDefinition, - MacroKeywordDefinition, - FuncKeywordDefinition, -} from "../../types" -import type {SchemaObjCxt} from ".." -import {_, nil, not, stringify, Code, Name, CodeGen} from "../codegen" -import N from "../names" -import type {JSONType} from "../rules" -import {callValidateCode} from "../../vocabularies/code" -import {extendErrors} from "../errors" - -type KeywordCompilationResult = AnySchema | SchemaValidateFunction | AnyValidateFunction - -export function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void { - const {gen, keyword, schema, parentSchema, it} = cxt - const macroSchema = def.macro.call(it.self, schema, parentSchema, it) - const schemaRef = useKeyword(gen, keyword, macroSchema) - if (it.opts.validateSchema !== false) it.self.validateSchema(macroSchema, true) - - const valid = gen.name("valid") - cxt.subschema( - { - schema: macroSchema, - schemaPath: nil, - errSchemaPath: `${it.errSchemaPath}/${keyword}`, - topSchemaRef: schemaRef, - compositeRule: true, - }, - valid - ) - cxt.pass(valid, () => cxt.error(true)) -} - -export function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void { - const {gen, keyword, schema, parentSchema, $data, it} = cxt - checkAsyncKeyword(it, def) - const validate = - !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate - const validateRef = useKeyword(gen, keyword, validate) - const valid = gen.let("valid") - cxt.block$data(valid, validateKeyword) - cxt.ok(def.valid ?? valid) - - function validateKeyword(): void { - if (def.errors === false) { - assignValid() - if (def.modifying) modifyData(cxt) - reportErrs(() => cxt.error()) - } else { - const ruleErrs = def.async ? validateAsync() : validateSync() - if (def.modifying) modifyData(cxt) - reportErrs(() => addErrs(cxt, ruleErrs)) - } - } - - function validateAsync(): Name { - const ruleErrs = gen.let("ruleErrs", null) - gen.try( - () => assignValid(_`await `), - (e) => - gen.assign(valid, false).if( - _`${e} instanceof ${it.ValidationError as Name}`, - () => gen.assign(ruleErrs, _`${e}.errors`), - () => gen.throw(e) - ) - ) - return ruleErrs - } - - function validateSync(): Code { - const validateErrs = _`${validateRef}.errors` - gen.assign(validateErrs, null) - assignValid(nil) - return validateErrs - } - - function assignValid(_await: Code = def.async ? _`await ` : nil): void { - const passCxt = it.opts.passContext ? N.this : N.self - const passSchema = !(("compile" in def && !$data) || def.schema === false) - gen.assign( - valid, - _`${_await}${callValidateCode(cxt, validateRef, passCxt, passSchema)}`, - def.modifying - ) - } - - function reportErrs(errors: () => void): void { - gen.if(not(def.valid ?? valid), errors) - } -} - -function modifyData(cxt: KeywordCxt): void { - const {gen, data, it} = cxt - gen.if(it.parentData, () => gen.assign(data, _`${it.parentData}[${it.parentDataProperty}]`)) -} - -function addErrs(cxt: KeywordCxt, errs: Code): void { - const {gen} = cxt - gen.if( - _`Array.isArray(${errs})`, - () => { - gen - .assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`) - .assign(N.errors, _`${N.vErrors}.length`) - extendErrors(cxt) - }, - () => cxt.error() - ) -} - -function checkAsyncKeyword({schemaEnv}: SchemaObjCxt, def: FuncKeywordDefinition): void { - if (def.async && !schemaEnv.$async) throw new Error("async keyword in sync schema") -} - -function useKeyword(gen: CodeGen, keyword: string, result?: KeywordCompilationResult): Name { - if (result === undefined) throw new Error(`keyword "${keyword}" failed to compile`) - return gen.scopeValue( - "keyword", - typeof result == "function" ? {ref: result} : {ref: result, code: stringify(result)} - ) -} - -export function validSchemaType( - schema: unknown, - schemaType: JSONType[], - allowUndefined = false -): boolean { - // TODO add tests - return ( - !schemaType.length || - schemaType.some((st) => - st === "array" - ? Array.isArray(schema) - : st === "object" - ? schema && typeof schema == "object" && !Array.isArray(schema) - : typeof schema == st || (allowUndefined && typeof schema == "undefined") - ) - ) -} - -export function validateKeywordUsage( - {schema, opts, self, errSchemaPath}: SchemaObjCxt, - def: AddedKeywordDefinition, - keyword: string -): void { - /* istanbul ignore if */ - if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { - throw new Error("ajv implementation error") - } - - const deps = def.dependencies - if (deps?.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) { - throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`) - } - - if (def.validateSchema) { - const valid = def.validateSchema(schema[keyword]) - if (!valid) { - const msg = - `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + - self.errorsText(def.validateSchema.errors) - if (opts.validateSchema === "log") self.logger.error(msg) - else throw new Error(msg) - } - } -} diff --git a/node_modules/ajv/lib/compile/validate/subschema.ts b/node_modules/ajv/lib/compile/validate/subschema.ts deleted file mode 100644 index 9072ed774..000000000 --- a/node_modules/ajv/lib/compile/validate/subschema.ts +++ /dev/null @@ -1,135 +0,0 @@ -import type {AnySchema} from "../../types" -import type {SchemaObjCxt} from ".." -import {_, str, getProperty, Code, Name} from "../codegen" -import {escapeFragment, getErrorPath, Type} from "../util" -import type {JSONType} from "../rules" - -export interface SubschemaContext { - // TODO use Optional? align with SchemCxt property types - schema: AnySchema - schemaPath: Code - errSchemaPath: string - topSchemaRef?: Code - errorPath?: Code - dataLevel?: number - dataTypes?: JSONType[] - data?: Name - parentData?: Name - parentDataProperty?: Code | number - dataNames?: Name[] - dataPathArr?: (Code | number)[] - propertyName?: Name - jtdDiscriminator?: string - jtdMetadata?: boolean - compositeRule?: true - createErrors?: boolean - allErrors?: boolean -} - -export type SubschemaArgs = Partial<{ - keyword: string - schemaProp: string | number - schema: AnySchema - schemaPath: Code - errSchemaPath: string - topSchemaRef: Code - data: Name | Code - dataProp: Code | string | number - dataTypes: JSONType[] - definedProperties: Set - propertyName: Name - dataPropType: Type - jtdDiscriminator: string - jtdMetadata: boolean - compositeRule: true - createErrors: boolean - allErrors: boolean -}> - -export function getSubschema( - it: SchemaObjCxt, - {keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef}: SubschemaArgs -): SubschemaContext { - if (keyword !== undefined && schema !== undefined) { - throw new Error('both "keyword" and "schema" passed, only one allowed') - } - - if (keyword !== undefined) { - const sch = it.schema[keyword] - return schemaProp === undefined - ? { - schema: sch, - schemaPath: _`${it.schemaPath}${getProperty(keyword)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}`, - } - : { - schema: sch[schemaProp], - schemaPath: _`${it.schemaPath}${getProperty(keyword)}${getProperty(schemaProp)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}/${escapeFragment(schemaProp)}`, - } - } - - if (schema !== undefined) { - if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) { - throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"') - } - return { - schema, - schemaPath, - topSchemaRef, - errSchemaPath, - } - } - - throw new Error('either "keyword" or "schema" must be passed') -} - -export function extendSubschemaData( - subschema: SubschemaContext, - it: SchemaObjCxt, - {dataProp, dataPropType: dpType, data, dataTypes, propertyName}: SubschemaArgs -): void { - if (data !== undefined && dataProp !== undefined) { - throw new Error('both "data" and "dataProp" passed, only one allowed') - } - - const {gen} = it - - if (dataProp !== undefined) { - const {errorPath, dataPathArr, opts} = it - const nextData = gen.let("data", _`${it.data}${getProperty(dataProp)}`, true) - dataContextProps(nextData) - subschema.errorPath = str`${errorPath}${getErrorPath(dataProp, dpType, opts.jsPropertySyntax)}` - subschema.parentDataProperty = _`${dataProp}` - subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty] - } - - if (data !== undefined) { - const nextData = data instanceof Name ? data : gen.let("data", data, true) // replaceable if used once? - dataContextProps(nextData) - if (propertyName !== undefined) subschema.propertyName = propertyName - // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr - } - - if (dataTypes) subschema.dataTypes = dataTypes - - function dataContextProps(_nextData: Name): void { - subschema.data = _nextData - subschema.dataLevel = it.dataLevel + 1 - subschema.dataTypes = [] - it.definedProperties = new Set() - subschema.parentData = it.data - subschema.dataNames = [...it.dataNames, _nextData] - } -} - -export function extendSubschemaMode( - subschema: SubschemaContext, - {jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors}: SubschemaArgs -): void { - if (compositeRule !== undefined) subschema.compositeRule = compositeRule - if (createErrors !== undefined) subschema.createErrors = createErrors - if (allErrors !== undefined) subschema.allErrors = allErrors - subschema.jtdDiscriminator = jtdDiscriminator // not inherited - subschema.jtdMetadata = jtdMetadata // not inherited -} diff --git a/node_modules/ajv/lib/core.ts b/node_modules/ajv/lib/core.ts deleted file mode 100644 index 3686ffe76..000000000 --- a/node_modules/ajv/lib/core.ts +++ /dev/null @@ -1,887 +0,0 @@ -export { - Format, - FormatDefinition, - AsyncFormatDefinition, - KeywordDefinition, - KeywordErrorDefinition, - CodeKeywordDefinition, - MacroKeywordDefinition, - FuncKeywordDefinition, - Vocabulary, - Schema, - SchemaObject, - AnySchemaObject, - AsyncSchema, - AnySchema, - ValidateFunction, - AsyncValidateFunction, - AnyValidateFunction, - ErrorObject, - ErrorNoParams, -} from "./types" - -export {SchemaCxt, SchemaObjCxt} from "./compile" -export interface Plugin { - (ajv: Ajv, options?: Opts): Ajv - [prop: string]: any -} - -export {KeywordCxt} from "./compile/validate" -export {DefinedError} from "./vocabularies/errors" -export {JSONType} from "./compile/rules" -export {JSONSchemaType} from "./types/json-schema" -export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" -export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" - -import type { - Schema, - AnySchema, - AnySchemaObject, - SchemaObject, - AsyncSchema, - Vocabulary, - KeywordDefinition, - AddedKeywordDefinition, - AnyValidateFunction, - ValidateFunction, - AsyncValidateFunction, - ErrorObject, - Format, - AddedFormat, - RegExpEngine, - UriResolver, -} from "./types" -import type {JSONSchemaType} from "./types/json-schema" -import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" -import ValidationError from "./runtime/validation_error" -import MissingRefError from "./compile/ref_error" -import {getRules, ValidationRules, Rule, RuleGroup, JSONType} from "./compile/rules" -import {SchemaEnv, compileSchema, resolveSchema} from "./compile" -import {Code, ValueScope} from "./compile/codegen" -import {normalizeId, getSchemaRefs} from "./compile/resolve" -import {getJSONTypes} from "./compile/validate/dataType" -import {eachItem} from "./compile/util" -import * as $dataRefSchema from "./refs/data.json" - -import DefaultUriResolver from "./runtime/uri" - -const defaultRegExp: RegExpEngine = (str, flags) => new RegExp(str, flags) -defaultRegExp.code = "new RegExp" - -const META_IGNORE_OPTIONS: (keyof Options)[] = ["removeAdditional", "useDefaults", "coerceTypes"] -const EXT_SCOPE_NAMES = new Set([ - "validate", - "serialize", - "parse", - "wrapper", - "root", - "schema", - "keyword", - "pattern", - "formats", - "validate$data", - "func", - "obj", - "Error", -]) - -export type Options = CurrentOptions & DeprecatedOptions - -export interface CurrentOptions { - // strict mode options (NEW) - strict?: boolean | "log" - strictSchema?: boolean | "log" - strictNumbers?: boolean | "log" - strictTypes?: boolean | "log" - strictTuples?: boolean | "log" - strictRequired?: boolean | "log" - allowMatchingProperties?: boolean // disables a strict mode restriction - allowUnionTypes?: boolean - validateFormats?: boolean - // validation and reporting options: - $data?: boolean - allErrors?: boolean - verbose?: boolean - discriminator?: boolean - unicodeRegExp?: boolean - timestamp?: "string" | "date" // JTD only - parseDate?: boolean // JTD only - allowDate?: boolean // JTD only - $comment?: - | true - | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown) - formats?: {[Name in string]?: Format} - keywords?: Vocabulary - schemas?: AnySchema[] | {[Key in string]?: AnySchema} - logger?: Logger | false - loadSchema?: (uri: string) => Promise - // options to modify validated data: - removeAdditional?: boolean | "all" | "failing" - useDefaults?: boolean | "empty" - coerceTypes?: boolean | "array" - // advanced options: - next?: boolean // NEW - unevaluated?: boolean // NEW - dynamicRef?: boolean // NEW - schemaId?: "id" | "$id" - jtd?: boolean // NEW - meta?: SchemaObject | boolean - defaultMeta?: string | AnySchemaObject - validateSchema?: boolean | "log" - addUsedSchema?: boolean - inlineRefs?: boolean | number - passContext?: boolean - loopRequired?: number - loopEnum?: number // NEW - ownProperties?: boolean - multipleOfPrecision?: number - int32range?: boolean // JTD only - messages?: boolean - code?: CodeOptions // NEW - uriResolver?: UriResolver -} - -export interface CodeOptions { - es5?: boolean - esm?: boolean - lines?: boolean - optimize?: boolean | number - formats?: Code // code to require (or construct) map of available formats - for standalone code - source?: boolean - process?: (code: string, schema?: SchemaEnv) => string - regExp?: RegExpEngine -} - -interface InstanceCodeOptions extends CodeOptions { - regExp: RegExpEngine - optimize: number -} - -interface DeprecatedOptions { - /** @deprecated */ - ignoreKeywordsWithRef?: boolean - /** @deprecated */ - jsPropertySyntax?: boolean // added instead of jsonPointers - /** @deprecated */ - unicode?: boolean -} - -interface RemovedOptions { - format?: boolean - errorDataPath?: "object" | "property" - nullable?: boolean // "nullable" keyword is supported by default - jsonPointers?: boolean - extendRefs?: true | "ignore" | "fail" - missingRefs?: true | "ignore" | "fail" - processCode?: (code: string, schema?: SchemaEnv) => string - sourceCode?: boolean - strictDefaults?: boolean - strictKeywords?: boolean - uniqueItems?: boolean - unknownFormats?: true | string[] | "ignore" - cache?: any - serialize?: (schema: AnySchema) => unknown - ajvErrors?: boolean -} - -type OptionsInfo = { - [K in keyof T]-?: string | undefined -} - -const removedOptions: OptionsInfo = { - errorDataPath: "", - format: "`validateFormats: false` can be used instead.", - nullable: '"nullable" keyword is supported by default.', - jsonPointers: "Deprecated jsPropertySyntax can be used instead.", - extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", - missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", - processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", - sourceCode: "Use option `code: {source: true}`", - strictDefaults: "It is default now, see option `strict`.", - strictKeywords: "It is default now, see option `strict`.", - uniqueItems: '"uniqueItems" keyword is always validated.', - unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", - cache: "Map is used as cache, schema object as key.", - serialize: "Map is used as cache, schema object as key.", - ajvErrors: "It is default now.", -} - -const deprecatedOptions: OptionsInfo = { - ignoreKeywordsWithRef: "", - jsPropertySyntax: "", - unicode: '"minLength"/"maxLength" account for unicode characters by default.', -} - -type RequiredInstanceOptions = { - [K in - | "strictSchema" - | "strictNumbers" - | "strictTypes" - | "strictTuples" - | "strictRequired" - | "inlineRefs" - | "loopRequired" - | "loopEnum" - | "meta" - | "messages" - | "schemaId" - | "addUsedSchema" - | "validateSchema" - | "validateFormats" - | "int32range" - | "unicodeRegExp" - | "uriResolver"]: NonNullable -} & {code: InstanceCodeOptions} - -export type InstanceOptions = Options & RequiredInstanceOptions - -const MAX_EXPRESSION = 200 - -// eslint-disable-next-line complexity -function requiredOptions(o: Options): RequiredInstanceOptions { - const s = o.strict - const _optz = o.code?.optimize - const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0 - const regExp = o.code?.regExp ?? defaultRegExp - const uriResolver = o.uriResolver ?? DefaultUriResolver - return { - strictSchema: o.strictSchema ?? s ?? true, - strictNumbers: o.strictNumbers ?? s ?? true, - strictTypes: o.strictTypes ?? s ?? "log", - strictTuples: o.strictTuples ?? s ?? "log", - strictRequired: o.strictRequired ?? s ?? false, - code: o.code ? {...o.code, optimize, regExp} : {optimize, regExp}, - loopRequired: o.loopRequired ?? MAX_EXPRESSION, - loopEnum: o.loopEnum ?? MAX_EXPRESSION, - meta: o.meta ?? true, - messages: o.messages ?? true, - inlineRefs: o.inlineRefs ?? true, - schemaId: o.schemaId ?? "$id", - addUsedSchema: o.addUsedSchema ?? true, - validateSchema: o.validateSchema ?? true, - validateFormats: o.validateFormats ?? true, - unicodeRegExp: o.unicodeRegExp ?? true, - int32range: o.int32range ?? true, - uriResolver: uriResolver, - } -} - -export interface Logger { - log(...args: unknown[]): unknown - warn(...args: unknown[]): unknown - error(...args: unknown[]): unknown -} - -export default class Ajv { - opts: InstanceOptions - errors?: ErrorObject[] | null // errors from the last validation - logger: Logger - // shared external scope values for compiled functions - readonly scope: ValueScope - readonly schemas: {[Key in string]?: SchemaEnv} = {} - readonly refs: {[Ref in string]?: SchemaEnv | string} = {} - readonly formats: {[Name in string]?: AddedFormat} = {} - readonly RULES: ValidationRules - readonly _compilations: Set = new Set() - private readonly _loading: {[Ref in string]?: Promise} = {} - private readonly _cache: Map = new Map() - private readonly _metaOpts: InstanceOptions - - static ValidationError = ValidationError - static MissingRefError = MissingRefError - - constructor(opts: Options = {}) { - opts = this.opts = {...opts, ...requiredOptions(opts)} - const {es5, lines} = this.opts.code - - this.scope = new ValueScope({scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines}) - this.logger = getLogger(opts.logger) - const formatOpt = opts.validateFormats - opts.validateFormats = false - - this.RULES = getRules() - checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED") - checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn") - this._metaOpts = getMetaSchemaOptions.call(this) - - if (opts.formats) addInitialFormats.call(this) - this._addVocabularies() - this._addDefaultMetaSchema() - if (opts.keywords) addInitialKeywords.call(this, opts.keywords) - if (typeof opts.meta == "object") this.addMetaSchema(opts.meta) - addInitialSchemas.call(this) - opts.validateFormats = formatOpt - } - - _addVocabularies(): void { - this.addKeyword("$async") - } - - _addDefaultMetaSchema(): void { - const {$data, meta, schemaId} = this.opts - let _dataRefSchema: SchemaObject = $dataRefSchema - if (schemaId === "id") { - _dataRefSchema = {...$dataRefSchema} - _dataRefSchema.id = _dataRefSchema.$id - delete _dataRefSchema.$id - } - if (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false) - } - - defaultMeta(): string | AnySchemaObject | undefined { - const {meta, schemaId} = this.opts - return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined) - } - - // Validate data using schema - // AnySchema will be compiled and cached using schema itself as a key for Map - validate(schema: Schema | string, data: unknown): boolean - validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise - validate(schema: Schema | JSONSchemaType | string, data: unknown): data is T - // Separated for type inference to work - // eslint-disable-next-line @typescript-eslint/unified-signatures - validate(schema: JTDSchemaType, data: unknown): data is T - // This overload is only intended for typescript inference, the first - // argument prevents manual type annotation from matching this overload - validate( - schema: T, - data: unknown - ): data is JTDDataType - validate(schema: AsyncSchema, data: unknown | T): Promise - validate(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise - validate( - schemaKeyRef: AnySchema | string, // key, ref or schema object - data: unknown | T // to be validated - ): boolean | Promise { - let v: AnyValidateFunction | undefined - if (typeof schemaKeyRef == "string") { - v = this.getSchema(schemaKeyRef) - if (!v) throw new Error(`no schema with key or ref "${schemaKeyRef}"`) - } else { - v = this.compile(schemaKeyRef) - } - - const valid = v(data) - if (!("$async" in v)) this.errors = v.errors - return valid - } - - // Create validation function for passed schema - // _meta: true if schema is a meta-schema. Used internally to compile meta schemas of user-defined keywords. - compile(schema: Schema | JSONSchemaType, _meta?: boolean): ValidateFunction - // Separated for type inference to work - // eslint-disable-next-line @typescript-eslint/unified-signatures - compile(schema: JTDSchemaType, _meta?: boolean): ValidateFunction - // This overload is only intended for typescript inference, the first - // argument prevents manual type annotation from matching this overload - compile( - schema: T, - _meta?: boolean - ): ValidateFunction> - compile(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction - compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction - compile(schema: AnySchema, _meta?: boolean): AnyValidateFunction { - const sch = this._addSchema(schema, _meta) - return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction - } - - // Creates validating function for passed schema with asynchronous loading of missing schemas. - // `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema. - // TODO allow passing schema URI - // meta - optional true to compile meta-schema - compileAsync( - schema: SchemaObject | JSONSchemaType, - _meta?: boolean - ): Promise> - // Separated for type inference to work - // eslint-disable-next-line @typescript-eslint/unified-signatures - compileAsync(schema: JTDSchemaType, _meta?: boolean): Promise> - compileAsync(schema: AsyncSchema, meta?: boolean): Promise> - // eslint-disable-next-line @typescript-eslint/unified-signatures - compileAsync( - schema: AnySchemaObject, - meta?: boolean - ): Promise> - compileAsync( - schema: AnySchemaObject, - meta?: boolean - ): Promise> { - if (typeof this.opts.loadSchema != "function") { - throw new Error("options.loadSchema should be a function") - } - const {loadSchema} = this.opts - return runCompileAsync.call(this, schema, meta) - - async function runCompileAsync( - this: Ajv, - _schema: AnySchemaObject, - _meta?: boolean - ): Promise { - await loadMetaSchema.call(this, _schema.$schema) - const sch = this._addSchema(_schema, _meta) - return sch.validate || _compileAsync.call(this, sch) - } - - async function loadMetaSchema(this: Ajv, $ref?: string): Promise { - if ($ref && !this.getSchema($ref)) { - await runCompileAsync.call(this, {$ref}, true) - } - } - - async function _compileAsync(this: Ajv, sch: SchemaEnv): Promise { - try { - return this._compileSchemaEnv(sch) - } catch (e) { - if (!(e instanceof MissingRefError)) throw e - checkLoaded.call(this, e) - await loadMissingSchema.call(this, e.missingSchema) - return _compileAsync.call(this, sch) - } - } - - function checkLoaded(this: Ajv, {missingSchema: ref, missingRef}: MissingRefError): void { - if (this.refs[ref]) { - throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`) - } - } - - async function loadMissingSchema(this: Ajv, ref: string): Promise { - const _schema = await _loadSchema.call(this, ref) - if (!this.refs[ref]) await loadMetaSchema.call(this, _schema.$schema) - if (!this.refs[ref]) this.addSchema(_schema, ref, meta) - } - - async function _loadSchema(this: Ajv, ref: string): Promise { - const p = this._loading[ref] - if (p) return p - try { - return await (this._loading[ref] = loadSchema(ref)) - } finally { - delete this._loading[ref] - } - } - } - - // Adds schema to the instance - addSchema( - schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored - key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. - _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. - _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead. - ): Ajv { - if (Array.isArray(schema)) { - for (const sch of schema) this.addSchema(sch, undefined, _meta, _validateSchema) - return this - } - let id: string | undefined - if (typeof schema === "object") { - const {schemaId} = this.opts - id = schema[schemaId] - if (id !== undefined && typeof id != "string") { - throw new Error(`schema ${schemaId} must be string`) - } - } - key = normalizeId(key || id) - this._checkUnique(key) - this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true) - return this - } - - // Add schema that will be used to validate other schemas - // options in META_IGNORE_OPTIONS are alway set to false - addMetaSchema( - schema: AnySchemaObject, - key?: string, // schema key - _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema - ): Ajv { - this.addSchema(schema, key, true, _validateSchema) - return this - } - - // Validate schema against its meta-schema - validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise { - if (typeof schema == "boolean") return true - let $schema: string | AnySchemaObject | undefined - $schema = schema.$schema - if ($schema !== undefined && typeof $schema != "string") { - throw new Error("$schema must be a string") - } - $schema = $schema || this.opts.defaultMeta || this.defaultMeta() - if (!$schema) { - this.logger.warn("meta-schema not available") - this.errors = null - return true - } - const valid = this.validate($schema, schema) - if (!valid && throwOrLogError) { - const message = "schema is invalid: " + this.errorsText() - if (this.opts.validateSchema === "log") this.logger.error(message) - else throw new Error(message) - } - return valid - } - - // Get compiled schema by `key` or `ref`. - // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) - getSchema(keyRef: string): AnyValidateFunction | undefined { - let sch - while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") keyRef = sch - if (sch === undefined) { - const {schemaId} = this.opts - const root = new SchemaEnv({schema: {}, schemaId}) - sch = resolveSchema.call(this, root, keyRef) - if (!sch) return - this.refs[keyRef] = sch - } - return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction | undefined - } - - // Remove cached schema(s). - // If no parameter is passed all schemas but meta-schemas are removed. - // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. - // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. - removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv { - if (schemaKeyRef instanceof RegExp) { - this._removeAllSchemas(this.schemas, schemaKeyRef) - this._removeAllSchemas(this.refs, schemaKeyRef) - return this - } - switch (typeof schemaKeyRef) { - case "undefined": - this._removeAllSchemas(this.schemas) - this._removeAllSchemas(this.refs) - this._cache.clear() - return this - case "string": { - const sch = getSchEnv.call(this, schemaKeyRef) - if (typeof sch == "object") this._cache.delete(sch.schema) - delete this.schemas[schemaKeyRef] - delete this.refs[schemaKeyRef] - return this - } - case "object": { - const cacheKey = schemaKeyRef - this._cache.delete(cacheKey) - let id = schemaKeyRef[this.opts.schemaId] - if (id) { - id = normalizeId(id) - delete this.schemas[id] - delete this.refs[id] - } - return this - } - default: - throw new Error("ajv.removeSchema: invalid parameter") - } - } - - // add "vocabulary" - a collection of keywords - addVocabulary(definitions: Vocabulary): Ajv { - for (const def of definitions) this.addKeyword(def) - return this - } - - addKeyword( - kwdOrDef: string | KeywordDefinition, - def?: KeywordDefinition // deprecated - ): Ajv { - let keyword: string | string[] - if (typeof kwdOrDef == "string") { - keyword = kwdOrDef - if (typeof def == "object") { - this.logger.warn("these parameters are deprecated, see docs for addKeyword") - def.keyword = keyword - } - } else if (typeof kwdOrDef == "object" && def === undefined) { - def = kwdOrDef - keyword = def.keyword - if (Array.isArray(keyword) && !keyword.length) { - throw new Error("addKeywords: keyword must be string or non-empty array") - } - } else { - throw new Error("invalid addKeywords parameters") - } - - checkKeyword.call(this, keyword, def) - if (!def) { - eachItem(keyword, (kwd) => addRule.call(this, kwd)) - return this - } - keywordMetaschema.call(this, def) - const definition: AddedKeywordDefinition = { - ...def, - type: getJSONTypes(def.type), - schemaType: getJSONTypes(def.schemaType), - } - eachItem( - keyword, - definition.type.length === 0 - ? (k) => addRule.call(this, k, definition) - : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)) - ) - return this - } - - getKeyword(keyword: string): AddedKeywordDefinition | boolean { - const rule = this.RULES.all[keyword] - return typeof rule == "object" ? rule.definition : !!rule - } - - // Remove keyword - removeKeyword(keyword: string): Ajv { - // TODO return type should be Ajv - const {RULES} = this - delete RULES.keywords[keyword] - delete RULES.all[keyword] - for (const group of RULES.rules) { - const i = group.rules.findIndex((rule) => rule.keyword === keyword) - if (i >= 0) group.rules.splice(i, 1) - } - return this - } - - // Add format - addFormat(name: string, format: Format): Ajv { - if (typeof format == "string") format = new RegExp(format) - this.formats[name] = format - return this - } - - errorsText( - errors: ErrorObject[] | null | undefined = this.errors, // optional array of validation errors - {separator = ", ", dataVar = "data"}: ErrorsTextOptions = {} // optional options with properties `separator` and `dataVar` - ): string { - if (!errors || errors.length === 0) return "No errors" - return errors - .map((e) => `${dataVar}${e.instancePath} ${e.message}`) - .reduce((text, msg) => text + separator + msg) - } - - $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject { - const rules = this.RULES.all - metaSchema = JSON.parse(JSON.stringify(metaSchema)) - for (const jsonPointer of keywordsJsonPointers) { - const segments = jsonPointer.split("/").slice(1) // first segment is an empty string - let keywords = metaSchema - for (const seg of segments) keywords = keywords[seg] as AnySchemaObject - - for (const key in rules) { - const rule = rules[key] - if (typeof rule != "object") continue - const {$data} = rule.definition - const schema = keywords[key] as AnySchemaObject | undefined - if ($data && schema) keywords[key] = schemaOrData(schema) - } - } - - return metaSchema - } - - private _removeAllSchemas(schemas: {[Ref in string]?: SchemaEnv | string}, regex?: RegExp): void { - for (const keyRef in schemas) { - const sch = schemas[keyRef] - if (!regex || regex.test(keyRef)) { - if (typeof sch == "string") { - delete schemas[keyRef] - } else if (sch && !sch.meta) { - this._cache.delete(sch.schema) - delete schemas[keyRef] - } - } - } - } - - _addSchema( - schema: AnySchema, - meta?: boolean, - baseId?: string, - validateSchema = this.opts.validateSchema, - addSchema = this.opts.addUsedSchema - ): SchemaEnv { - let id: string | undefined - const {schemaId} = this.opts - if (typeof schema == "object") { - id = schema[schemaId] - } else { - if (this.opts.jtd) throw new Error("schema must be object") - else if (typeof schema != "boolean") throw new Error("schema must be object or boolean") - } - let sch = this._cache.get(schema) - if (sch !== undefined) return sch - - baseId = normalizeId(id || baseId) - const localRefs = getSchemaRefs.call(this, schema, baseId) - sch = new SchemaEnv({schema, schemaId, meta, baseId, localRefs}) - this._cache.set(sch.schema, sch) - if (addSchema && !baseId.startsWith("#")) { - // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) - if (baseId) this._checkUnique(baseId) - this.refs[baseId] = sch - } - if (validateSchema) this.validateSchema(schema, true) - return sch - } - - private _checkUnique(id: string): void { - if (this.schemas[id] || this.refs[id]) { - throw new Error(`schema with key or id "${id}" already exists`) - } - } - - private _compileSchemaEnv(sch: SchemaEnv): AnyValidateFunction { - if (sch.meta) this._compileMetaSchema(sch) - else compileSchema.call(this, sch) - - /* istanbul ignore if */ - if (!sch.validate) throw new Error("ajv implementation error") - return sch.validate - } - - private _compileMetaSchema(sch: SchemaEnv): void { - const currentOpts = this.opts - this.opts = this._metaOpts - try { - compileSchema.call(this, sch) - } finally { - this.opts = currentOpts - } - } -} - -export interface ErrorsTextOptions { - separator?: string - dataVar?: string -} - -function checkOptions( - this: Ajv, - checkOpts: OptionsInfo, - options: Options & RemovedOptions, - msg: string, - log: "warn" | "error" = "error" -): void { - for (const key in checkOpts) { - const opt = key as keyof typeof checkOpts - if (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`) - } -} - -function getSchEnv(this: Ajv, keyRef: string): SchemaEnv | string | undefined { - keyRef = normalizeId(keyRef) // TODO tests fail without this line - return this.schemas[keyRef] || this.refs[keyRef] -} - -function addInitialSchemas(this: Ajv): void { - const optsSchemas = this.opts.schemas - if (!optsSchemas) return - if (Array.isArray(optsSchemas)) this.addSchema(optsSchemas) - else for (const key in optsSchemas) this.addSchema(optsSchemas[key] as AnySchema, key) -} - -function addInitialFormats(this: Ajv): void { - for (const name in this.opts.formats) { - const format = this.opts.formats[name] - if (format) this.addFormat(name, format) - } -} - -function addInitialKeywords( - this: Ajv, - defs: Vocabulary | {[K in string]?: KeywordDefinition} -): void { - if (Array.isArray(defs)) { - this.addVocabulary(defs) - return - } - this.logger.warn("keywords option as map is deprecated, pass array") - for (const keyword in defs) { - const def = defs[keyword] as KeywordDefinition - if (!def.keyword) def.keyword = keyword - this.addKeyword(def) - } -} - -function getMetaSchemaOptions(this: Ajv): InstanceOptions { - const metaOpts = {...this.opts} - for (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt] - return metaOpts -} - -const noLogs = {log() {}, warn() {}, error() {}} - -function getLogger(logger?: Partial | false): Logger { - if (logger === false) return noLogs - if (logger === undefined) return console - if (logger.log && logger.warn && logger.error) return logger as Logger - throw new Error("logger must implement log, warn and error methods") -} - -const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i - -function checkKeyword(this: Ajv, keyword: string | string[], def?: KeywordDefinition): void { - const {RULES} = this - eachItem(keyword, (kwd) => { - if (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`) - if (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`) - }) - if (!def) return - if (def.$data && !("code" in def || "validate" in def)) { - throw new Error('$data keyword must have "code" or "validate" function') - } -} - -function addRule( - this: Ajv, - keyword: string, - definition?: AddedKeywordDefinition, - dataType?: JSONType -): void { - const post = definition?.post - if (dataType && post) throw new Error('keyword with "post" flag cannot have "type"') - const {RULES} = this - let ruleGroup = post ? RULES.post : RULES.rules.find(({type: t}) => t === dataType) - if (!ruleGroup) { - ruleGroup = {type: dataType, rules: []} - RULES.rules.push(ruleGroup) - } - RULES.keywords[keyword] = true - if (!definition) return - - const rule: Rule = { - keyword, - definition: { - ...definition, - type: getJSONTypes(definition.type), - schemaType: getJSONTypes(definition.schemaType), - }, - } - if (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before) - else ruleGroup.rules.push(rule) - RULES.all[keyword] = rule - definition.implements?.forEach((kwd) => this.addKeyword(kwd)) -} - -function addBeforeRule(this: Ajv, ruleGroup: RuleGroup, rule: Rule, before: string): void { - const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before) - if (i >= 0) { - ruleGroup.rules.splice(i, 0, rule) - } else { - ruleGroup.rules.push(rule) - this.logger.warn(`rule ${before} is not defined`) - } -} - -function keywordMetaschema(this: Ajv, def: KeywordDefinition): void { - let {metaSchema} = def - if (metaSchema === undefined) return - if (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema) - def.validateSchema = this.compile(metaSchema, true) -} - -const $dataRef = { - $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", -} - -function schemaOrData(schema: AnySchema): AnySchemaObject { - return {anyOf: [schema, $dataRef]} -} diff --git a/node_modules/ajv/lib/jtd.ts b/node_modules/ajv/lib/jtd.ts deleted file mode 100644 index 96eb7b9dc..000000000 --- a/node_modules/ajv/lib/jtd.ts +++ /dev/null @@ -1,131 +0,0 @@ -import type {AnySchemaObject, SchemaObject, JTDParser} from "./types" -import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" -import AjvCore, {CurrentOptions} from "./core" -import jtdVocabulary from "./vocabularies/jtd" -import jtdMetaSchema from "./refs/jtd-schema" -import compileSerializer from "./compile/jtd/serialize" -import compileParser from "./compile/jtd/parse" -import {SchemaEnv} from "./compile" - -const META_SCHEMA_ID = "JTD-meta-schema" - -type JTDOptions = CurrentOptions & { - // strict mode options not supported with JTD: - strict?: never - allowMatchingProperties?: never - allowUnionTypes?: never - validateFormats?: never - // validation and reporting options not supported with JTD: - $data?: never - verbose?: boolean - $comment?: never - formats?: never - loadSchema?: never - // options to modify validated data: - useDefaults?: never - coerceTypes?: never - // advanced options: - next?: never - unevaluated?: never - dynamicRef?: never - meta?: boolean - defaultMeta?: never - inlineRefs?: boolean - loopRequired?: never - multipleOfPrecision?: never -} - -class Ajv extends AjvCore { - constructor(opts: JTDOptions = {}) { - super({ - ...opts, - jtd: true, - }) - } - - _addVocabularies(): void { - super._addVocabularies() - this.addVocabulary(jtdVocabulary) - } - - _addDefaultMetaSchema(): void { - super._addDefaultMetaSchema() - if (!this.opts.meta) return - this.addMetaSchema(jtdMetaSchema, META_SCHEMA_ID, false) - } - - defaultMeta(): string | AnySchemaObject | undefined { - return (this.opts.defaultMeta = - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined)) - } - - compileSerializer(schema: SchemaObject): (data: T) => string - // Separated for type inference to work - // eslint-disable-next-line @typescript-eslint/unified-signatures - compileSerializer(schema: JTDSchemaType): (data: T) => string - compileSerializer(schema: SchemaObject): (data: T) => string { - const sch = this._addSchema(schema) - return sch.serialize || this._compileSerializer(sch) - } - - compileParser(schema: SchemaObject): JTDParser - // Separated for type inference to work - // eslint-disable-next-line @typescript-eslint/unified-signatures - compileParser(schema: JTDSchemaType): JTDParser - compileParser(schema: SchemaObject): JTDParser { - const sch = this._addSchema(schema) - return (sch.parse || this._compileParser(sch)) as JTDParser - } - - private _compileSerializer(sch: SchemaEnv): (data: T) => string { - compileSerializer.call(this, sch, (sch.schema as AnySchemaObject).definitions || {}) - /* istanbul ignore if */ - if (!sch.serialize) throw new Error("ajv implementation error") - return sch.serialize - } - - private _compileParser(sch: SchemaEnv): JTDParser { - compileParser.call(this, sch, (sch.schema as AnySchemaObject).definitions || {}) - /* istanbul ignore if */ - if (!sch.parse) throw new Error("ajv implementation error") - return sch.parse - } -} - -module.exports = exports = Ajv -Object.defineProperty(exports, "__esModule", {value: true}) - -export default Ajv - -export { - Format, - FormatDefinition, - AsyncFormatDefinition, - KeywordDefinition, - KeywordErrorDefinition, - CodeKeywordDefinition, - MacroKeywordDefinition, - FuncKeywordDefinition, - Vocabulary, - Schema, - SchemaObject, - AnySchemaObject, - AsyncSchema, - AnySchema, - ValidateFunction, - AsyncValidateFunction, - ErrorObject, - ErrorNoParams, - JTDParser, -} from "./types" - -export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core" -export {SchemaCxt, SchemaObjCxt} from "./compile" -export {KeywordCxt} from "./compile/validate" -export {JTDErrorObject} from "./vocabularies/jtd" -export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" - -export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} -export {JTDOptions} -export {default as ValidationError} from "./runtime/validation_error" -export {default as MissingRefError} from "./compile/ref_error" diff --git a/node_modules/ajv/lib/refs/data.json b/node_modules/ajv/lib/refs/data.json deleted file mode 100644 index 9ffc9f5ce..000000000 --- a/node_modules/ajv/lib/refs/data.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", - "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)", - "type": "object", - "required": ["$data"], - "properties": { - "$data": { - "type": "string", - "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}] - } - }, - "additionalProperties": false -} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts b/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts deleted file mode 100644 index b6ea7195f..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type Ajv from "../../core" -import type {AnySchemaObject} from "../../types" -import * as metaSchema from "./schema.json" -import * as applicator from "./meta/applicator.json" -import * as content from "./meta/content.json" -import * as core from "./meta/core.json" -import * as format from "./meta/format.json" -import * as metadata from "./meta/meta-data.json" -import * as validation from "./meta/validation.json" - -const META_SUPPORT_DATA = ["/properties"] - -export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv { - ;[ - metaSchema, - applicator, - content, - core, - with$data(this, format), - metadata, - with$data(this, validation), - ].forEach((sch) => this.addMetaSchema(sch, undefined, false)) - return this - - function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject { - return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json deleted file mode 100644 index c5e91cf2a..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/applicator", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/applicator": true - }, - "$recursiveAnchor": true, - - "title": "Applicator vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "additionalItems": {"$recursiveRef": "#"}, - "unevaluatedItems": {"$recursiveRef": "#"}, - "items": { - "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}] - }, - "contains": {"$recursiveRef": "#"}, - "additionalProperties": {"$recursiveRef": "#"}, - "unevaluatedProperties": {"$recursiveRef": "#"}, - "properties": { - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "propertyNames": {"format": "regex"}, - "default": {} - }, - "dependentSchemas": { - "type": "object", - "additionalProperties": { - "$recursiveRef": "#" - } - }, - "propertyNames": {"$recursiveRef": "#"}, - "if": {"$recursiveRef": "#"}, - "then": {"$recursiveRef": "#"}, - "else": {"$recursiveRef": "#"}, - "allOf": {"$ref": "#/$defs/schemaArray"}, - "anyOf": {"$ref": "#/$defs/schemaArray"}, - "oneOf": {"$ref": "#/$defs/schemaArray"}, - "not": {"$recursiveRef": "#"} - }, - "$defs": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$recursiveRef": "#"} - } - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json deleted file mode 100644 index b8f637343..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/content", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/content": true - }, - "$recursiveAnchor": true, - - "title": "Content vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "contentMediaType": {"type": "string"}, - "contentEncoding": {"type": "string"}, - "contentSchema": {"$recursiveRef": "#"} - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json deleted file mode 100644 index f71adbff0..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/core", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/core": true - }, - "$recursiveAnchor": true, - - "title": "Core vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "$id": { - "type": "string", - "format": "uri-reference", - "$comment": "Non-empty fragments not allowed.", - "pattern": "^[^#]*#?$" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$anchor": { - "type": "string", - "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "$recursiveRef": { - "type": "string", - "format": "uri-reference" - }, - "$recursiveAnchor": { - "type": "boolean", - "default": false - }, - "$vocabulary": { - "type": "object", - "propertyNames": { - "type": "string", - "format": "uri" - }, - "additionalProperties": { - "type": "boolean" - } - }, - "$comment": { - "type": "string" - }, - "$defs": { - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "default": {} - } - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json deleted file mode 100644 index 03ccfce26..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/format", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/format": true - }, - "$recursiveAnchor": true, - - "title": "Format vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "format": {"type": "string"} - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json deleted file mode 100644 index 0e194326f..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/meta-data", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/meta-data": true - }, - "$recursiveAnchor": true, - - "title": "Meta-data vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "deprecated": { - "type": "boolean", - "default": false - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "writeOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - } - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json b/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json deleted file mode 100644 index 7027a1279..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/meta/validation", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/validation": true - }, - "$recursiveAnchor": true, - - "title": "Validation vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, - "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, - "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, - "minContains": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 1 - }, - "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, - "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/$defs/stringArray"}, - "dependentRequired": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/stringArray" - } - }, - "const": true, - "enum": { - "type": "array", - "items": true - }, - "type": { - "anyOf": [ - {"$ref": "#/$defs/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/$defs/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - } - }, - "$defs": { - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 0 - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json b/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json deleted file mode 100644 index 54eb7157a..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://json-schema.org/draft/2019-09/schema", - "$vocabulary": { - "https://json-schema.org/draft/2019-09/vocab/core": true, - "https://json-schema.org/draft/2019-09/vocab/applicator": true, - "https://json-schema.org/draft/2019-09/vocab/validation": true, - "https://json-schema.org/draft/2019-09/vocab/meta-data": true, - "https://json-schema.org/draft/2019-09/vocab/format": false, - "https://json-schema.org/draft/2019-09/vocab/content": true - }, - "$recursiveAnchor": true, - - "title": "Core and Validation specifications meta-schema", - "allOf": [ - {"$ref": "meta/core"}, - {"$ref": "meta/applicator"}, - {"$ref": "meta/validation"}, - {"$ref": "meta/meta-data"}, - {"$ref": "meta/format"}, - {"$ref": "meta/content"} - ], - "type": ["object", "boolean"], - "properties": { - "definitions": { - "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", - "type": "object", - "additionalProperties": {"$recursiveRef": "#"}, - "default": {} - }, - "dependencies": { - "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", - "type": "object", - "additionalProperties": { - "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}] - } - } - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts b/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts deleted file mode 100644 index 8e850d08b..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type Ajv from "../../core" -import type {AnySchemaObject} from "../../types" -import * as metaSchema from "./schema.json" -import * as applicator from "./meta/applicator.json" -import * as unevaluated from "./meta/unevaluated.json" -import * as content from "./meta/content.json" -import * as core from "./meta/core.json" -import * as format from "./meta/format-annotation.json" -import * as metadata from "./meta/meta-data.json" -import * as validation from "./meta/validation.json" - -const META_SUPPORT_DATA = ["/properties"] - -export default function addMetaSchema2020(this: Ajv, $data?: boolean): Ajv { - ;[ - metaSchema, - applicator, - unevaluated, - content, - core, - with$data(this, format), - metadata, - with$data(this, validation), - ].forEach((sch) => this.addMetaSchema(sch, undefined, false)) - return this - - function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject { - return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json deleted file mode 100644 index 674c913da..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/applicator", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/applicator": true - }, - "$dynamicAnchor": "meta", - - "title": "Applicator vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "prefixItems": {"$ref": "#/$defs/schemaArray"}, - "items": {"$dynamicRef": "#meta"}, - "contains": {"$dynamicRef": "#meta"}, - "additionalProperties": {"$dynamicRef": "#meta"}, - "properties": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "propertyNames": {"format": "regex"}, - "default": {} - }, - "dependentSchemas": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "default": {} - }, - "propertyNames": {"$dynamicRef": "#meta"}, - "if": {"$dynamicRef": "#meta"}, - "then": {"$dynamicRef": "#meta"}, - "else": {"$dynamicRef": "#meta"}, - "allOf": {"$ref": "#/$defs/schemaArray"}, - "anyOf": {"$ref": "#/$defs/schemaArray"}, - "oneOf": {"$ref": "#/$defs/schemaArray"}, - "not": {"$dynamicRef": "#meta"} - }, - "$defs": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$dynamicRef": "#meta"} - } - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json deleted file mode 100644 index 2ae23ddb5..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/content", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/content": true - }, - "$dynamicAnchor": "meta", - - "title": "Content vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "contentEncoding": {"type": "string"}, - "contentMediaType": {"type": "string"}, - "contentSchema": {"$dynamicRef": "#meta"} - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json deleted file mode 100644 index 4c8e5cb61..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/core", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/core": true - }, - "$dynamicAnchor": "meta", - - "title": "Core vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "$id": { - "$ref": "#/$defs/uriReferenceString", - "$comment": "Non-empty fragments not allowed.", - "pattern": "^[^#]*#?$" - }, - "$schema": {"$ref": "#/$defs/uriString"}, - "$ref": {"$ref": "#/$defs/uriReferenceString"}, - "$anchor": {"$ref": "#/$defs/anchorString"}, - "$dynamicRef": {"$ref": "#/$defs/uriReferenceString"}, - "$dynamicAnchor": {"$ref": "#/$defs/anchorString"}, - "$vocabulary": { - "type": "object", - "propertyNames": {"$ref": "#/$defs/uriString"}, - "additionalProperties": { - "type": "boolean" - } - }, - "$comment": { - "type": "string" - }, - "$defs": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"} - } - }, - "$defs": { - "anchorString": { - "type": "string", - "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" - }, - "uriString": { - "type": "string", - "format": "uri" - }, - "uriReferenceString": { - "type": "string", - "format": "uri-reference" - } - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json deleted file mode 100644 index 83c26e35f..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/format-annotation": true - }, - "$dynamicAnchor": "meta", - - "title": "Format vocabulary meta-schema for annotation results", - "type": ["object", "boolean"], - "properties": { - "format": {"type": "string"} - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json deleted file mode 100644 index 11946fb50..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/meta-data", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/meta-data": true - }, - "$dynamicAnchor": "meta", - - "title": "Meta-data vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "deprecated": { - "type": "boolean", - "default": false - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "writeOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - } - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json deleted file mode 100644 index 5e4b203b2..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/unevaluated": true - }, - "$dynamicAnchor": "meta", - - "title": "Unevaluated applicator vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "unevaluatedItems": {"$dynamicRef": "#meta"}, - "unevaluatedProperties": {"$dynamicRef": "#meta"} - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json b/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json deleted file mode 100644 index e0ae13d9d..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/validation", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/validation": true - }, - "$dynamicAnchor": "meta", - - "title": "Validation vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "type": { - "anyOf": [ - {"$ref": "#/$defs/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/$defs/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "const": true, - "enum": { - "type": "array", - "items": true - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/$defs/nonNegativeInteger"}, - "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "maxItems": {"$ref": "#/$defs/nonNegativeInteger"}, - "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxContains": {"$ref": "#/$defs/nonNegativeInteger"}, - "minContains": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 1 - }, - "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"}, - "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/$defs/stringArray"}, - "dependentRequired": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/stringArray" - } - } - }, - "$defs": { - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 0 - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json b/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json deleted file mode 100644 index 1c68270fd..000000000 --- a/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/schema", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/core": true, - "https://json-schema.org/draft/2020-12/vocab/applicator": true, - "https://json-schema.org/draft/2020-12/vocab/unevaluated": true, - "https://json-schema.org/draft/2020-12/vocab/validation": true, - "https://json-schema.org/draft/2020-12/vocab/meta-data": true, - "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, - "https://json-schema.org/draft/2020-12/vocab/content": true - }, - "$dynamicAnchor": "meta", - - "title": "Core and Validation specifications meta-schema", - "allOf": [ - {"$ref": "meta/core"}, - {"$ref": "meta/applicator"}, - {"$ref": "meta/unevaluated"}, - {"$ref": "meta/validation"}, - {"$ref": "meta/meta-data"}, - {"$ref": "meta/format-annotation"}, - {"$ref": "meta/content"} - ], - "type": ["object", "boolean"], - "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", - "properties": { - "definitions": { - "$comment": "\"definitions\" has been replaced by \"$defs\".", - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "deprecated": true, - "default": {} - }, - "dependencies": { - "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.", - "type": "object", - "additionalProperties": { - "anyOf": [{"$dynamicRef": "#meta"}, {"$ref": "meta/validation#/$defs/stringArray"}] - }, - "deprecated": true, - "default": {} - }, - "$recursiveAnchor": { - "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".", - "$ref": "meta/core#/$defs/anchorString", - "deprecated": true - }, - "$recursiveRef": { - "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".", - "$ref": "meta/core#/$defs/uriReferenceString", - "deprecated": true - } - } -} diff --git a/node_modules/ajv/lib/refs/json-schema-draft-06.json b/node_modules/ajv/lib/refs/json-schema-draft-06.json deleted file mode 100644 index 5410064ba..000000000 --- a/node_modules/ajv/lib/refs/json-schema-draft-06.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-06/schema#", - "$id": "http://json-schema.org/draft-06/schema#", - "title": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$ref": "#"} - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - }, - "type": ["object", "boolean"], - "properties": { - "$id": { - "type": "string", - "format": "uri-reference" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": {}, - "examples": { - "type": "array", - "items": {} - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, - "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": {"$ref": "#"}, - "items": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], - "default": {} - }, - "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, - "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "contains": {"$ref": "#"}, - "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, - "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/definitions/stringArray"}, - "additionalProperties": {"$ref": "#"}, - "definitions": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] - } - }, - "propertyNames": {"$ref": "#"}, - "const": {}, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - {"$ref": "#/definitions/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/definitions/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "format": {"type": "string"}, - "allOf": {"$ref": "#/definitions/schemaArray"}, - "anyOf": {"$ref": "#/definitions/schemaArray"}, - "oneOf": {"$ref": "#/definitions/schemaArray"}, - "not": {"$ref": "#"} - }, - "default": {} -} diff --git a/node_modules/ajv/lib/refs/json-schema-draft-07.json b/node_modules/ajv/lib/refs/json-schema-draft-07.json deleted file mode 100644 index 6a7485104..000000000 --- a/node_modules/ajv/lib/refs/json-schema-draft-07.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://json-schema.org/draft-07/schema#", - "title": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$ref": "#"} - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}] - }, - "simpleTypes": { - "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - "stringArray": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true, - "default": [] - } - }, - "type": ["object", "boolean"], - "properties": { - "$id": { - "type": "string", - "format": "uri-reference" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "readOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": {"$ref": "#/definitions/nonNegativeInteger"}, - "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": {"$ref": "#"}, - "items": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}], - "default": true - }, - "maxItems": {"$ref": "#/definitions/nonNegativeInteger"}, - "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "contains": {"$ref": "#"}, - "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"}, - "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"}, - "required": {"$ref": "#/definitions/stringArray"}, - "additionalProperties": {"$ref": "#"}, - "definitions": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$ref": "#"}, - "propertyNames": {"format": "regex"}, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}] - } - }, - "propertyNames": {"$ref": "#"}, - "const": true, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - {"$ref": "#/definitions/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/definitions/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "format": {"type": "string"}, - "contentMediaType": {"type": "string"}, - "contentEncoding": {"type": "string"}, - "if": {"$ref": "#"}, - "then": {"$ref": "#"}, - "else": {"$ref": "#"}, - "allOf": {"$ref": "#/definitions/schemaArray"}, - "anyOf": {"$ref": "#/definitions/schemaArray"}, - "oneOf": {"$ref": "#/definitions/schemaArray"}, - "not": {"$ref": "#"} - }, - "default": true -} diff --git a/node_modules/ajv/lib/refs/json-schema-secure.json b/node_modules/ajv/lib/refs/json-schema-secure.json deleted file mode 100644 index 3968abd5d..000000000 --- a/node_modules/ajv/lib/refs/json-schema-secure.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#", - "title": "Meta-schema for the security assessment of JSON Schemas", - "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$ref": "#"} - } - }, - "dependencies": { - "patternProperties": { - "description": "prevent slow validation of large property names", - "required": ["propertyNames"], - "properties": { - "propertyNames": { - "required": ["maxLength"] - } - } - }, - "uniqueItems": { - "description": "prevent slow validation of large non-scalar arrays", - "if": { - "properties": { - "uniqueItems": {"const": true}, - "items": { - "properties": { - "type": { - "anyOf": [ - { - "enum": ["object", "array"] - }, - { - "type": "array", - "contains": {"enum": ["object", "array"]} - } - ] - } - } - } - } - }, - "then": { - "required": ["maxItems"] - } - }, - "pattern": { - "description": "prevent slow pattern matching of large strings", - "required": ["maxLength"] - }, - "format": { - "description": "prevent slow format validation of large strings", - "required": ["maxLength"] - } - }, - "properties": { - "additionalItems": {"$ref": "#"}, - "additionalProperties": {"$ref": "#"}, - "dependencies": { - "additionalProperties": { - "anyOf": [{"type": "array"}, {"$ref": "#"}] - } - }, - "items": { - "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}] - }, - "definitions": { - "additionalProperties": {"$ref": "#"} - }, - "patternProperties": { - "additionalProperties": {"$ref": "#"} - }, - "properties": { - "additionalProperties": {"$ref": "#"} - }, - "if": {"$ref": "#"}, - "then": {"$ref": "#"}, - "else": {"$ref": "#"}, - "allOf": {"$ref": "#/definitions/schemaArray"}, - "anyOf": {"$ref": "#/definitions/schemaArray"}, - "oneOf": {"$ref": "#/definitions/schemaArray"}, - "not": {"$ref": "#"}, - "contains": {"$ref": "#"}, - "propertyNames": {"$ref": "#"} - } -} diff --git a/node_modules/ajv/lib/refs/jtd-schema.ts b/node_modules/ajv/lib/refs/jtd-schema.ts deleted file mode 100644 index c01981289..000000000 --- a/node_modules/ajv/lib/refs/jtd-schema.ts +++ /dev/null @@ -1,130 +0,0 @@ -import {SchemaObject} from "../types" - -type MetaSchema = (root: boolean) => SchemaObject - -const shared: MetaSchema = (root) => { - const sch: SchemaObject = { - nullable: {type: "boolean"}, - metadata: { - optionalProperties: { - union: {elements: {ref: "schema"}}, - }, - additionalProperties: true, - }, - } - if (root) sch.definitions = {values: {ref: "schema"}} - return sch -} - -const emptyForm: MetaSchema = (root) => ({ - optionalProperties: shared(root), -}) - -const refForm: MetaSchema = (root) => ({ - properties: { - ref: {type: "string"}, - }, - optionalProperties: shared(root), -}) - -const typeForm: MetaSchema = (root) => ({ - properties: { - type: { - enum: [ - "boolean", - "timestamp", - "string", - "float32", - "float64", - "int8", - "uint8", - "int16", - "uint16", - "int32", - "uint32", - ], - }, - }, - optionalProperties: shared(root), -}) - -const enumForm: MetaSchema = (root) => ({ - properties: { - enum: {elements: {type: "string"}}, - }, - optionalProperties: shared(root), -}) - -const elementsForm: MetaSchema = (root) => ({ - properties: { - elements: {ref: "schema"}, - }, - optionalProperties: shared(root), -}) - -const propertiesForm: MetaSchema = (root) => ({ - properties: { - properties: {values: {ref: "schema"}}, - }, - optionalProperties: { - optionalProperties: {values: {ref: "schema"}}, - additionalProperties: {type: "boolean"}, - ...shared(root), - }, -}) - -const optionalPropertiesForm: MetaSchema = (root) => ({ - properties: { - optionalProperties: {values: {ref: "schema"}}, - }, - optionalProperties: { - additionalProperties: {type: "boolean"}, - ...shared(root), - }, -}) - -const discriminatorForm: MetaSchema = (root) => ({ - properties: { - discriminator: {type: "string"}, - mapping: { - values: { - metadata: { - union: [propertiesForm(false), optionalPropertiesForm(false)], - }, - }, - }, - }, - optionalProperties: shared(root), -}) - -const valuesForm: MetaSchema = (root) => ({ - properties: { - values: {ref: "schema"}, - }, - optionalProperties: shared(root), -}) - -const schema: MetaSchema = (root) => ({ - metadata: { - union: [ - emptyForm, - refForm, - typeForm, - enumForm, - elementsForm, - propertiesForm, - optionalPropertiesForm, - discriminatorForm, - valuesForm, - ].map((s) => s(root)), - }, -}) - -const jtdMetaSchema: SchemaObject = { - definitions: { - schema: schema(false), - }, - ...schema(true), -} - -export default jtdMetaSchema diff --git a/node_modules/ajv/lib/runtime/equal.ts b/node_modules/ajv/lib/runtime/equal.ts deleted file mode 100644 index 3cb00631a..000000000 --- a/node_modules/ajv/lib/runtime/equal.ts +++ /dev/null @@ -1,7 +0,0 @@ -// https://github.com/ajv-validator/ajv/issues/889 -import * as equal from "fast-deep-equal" - -type Equal = typeof equal & {code: string} -;(equal as Equal).code = 'require("ajv/dist/runtime/equal").default' - -export default equal as Equal diff --git a/node_modules/ajv/lib/runtime/parseJson.ts b/node_modules/ajv/lib/runtime/parseJson.ts deleted file mode 100644 index 92579afeb..000000000 --- a/node_modules/ajv/lib/runtime/parseJson.ts +++ /dev/null @@ -1,176 +0,0 @@ -const rxParseJson = /position\s(\d+)$/ - -export function parseJson(s: string, pos: number): unknown { - let endPos: number | undefined - parseJson.message = undefined - let matches: RegExpExecArray | null - if (pos) s = s.slice(pos) - try { - parseJson.position = pos + s.length - return JSON.parse(s) - } catch (e) { - matches = rxParseJson.exec((e as Error).message) - if (!matches) { - parseJson.message = "unexpected end" - return undefined - } - endPos = +matches[1] - const c = s[endPos] - s = s.slice(0, endPos) - parseJson.position = pos + endPos - try { - return JSON.parse(s) - } catch (e1) { - parseJson.message = `unexpected token ${c}` - return undefined - } - } -} - -parseJson.message = undefined as string | undefined -parseJson.position = 0 as number -parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson' - -export function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined { - let numStr = "" - let c: string - parseJsonNumber.message = undefined - if (s[pos] === "-") { - numStr += "-" - pos++ - } - if (s[pos] === "0") { - numStr += "0" - pos++ - } else { - if (!parseDigits(maxDigits)) { - errorMessage() - return undefined - } - } - if (maxDigits) { - parseJsonNumber.position = pos - return +numStr - } - if (s[pos] === ".") { - numStr += "." - pos++ - if (!parseDigits()) { - errorMessage() - return undefined - } - } - if (((c = s[pos]), c === "e" || c === "E")) { - numStr += "e" - pos++ - if (((c = s[pos]), c === "+" || c === "-")) { - numStr += c - pos++ - } - if (!parseDigits()) { - errorMessage() - return undefined - } - } - parseJsonNumber.position = pos - return +numStr - - function parseDigits(maxLen?: number): boolean { - let digit = false - while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) { - digit = true - numStr += c - pos++ - } - return digit - } - - function errorMessage(): void { - parseJsonNumber.position = pos - parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end" - } -} - -parseJsonNumber.message = undefined as string | undefined -parseJsonNumber.position = 0 as number -parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber' - -const escapedChars: {[X in string]?: string} = { - b: "\b", - f: "\f", - n: "\n", - r: "\r", - t: "\t", - '"': '"', - "/": "/", - "\\": "\\", -} - -const CODE_A: number = "a".charCodeAt(0) -const CODE_0: number = "0".charCodeAt(0) - -export function parseJsonString(s: string, pos: number): string | undefined { - let str = "" - let c: string | undefined - parseJsonString.message = undefined - // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition - while (true) { - c = s[pos++] - if (c === '"') break - if (c === "\\") { - c = s[pos] - if (c in escapedChars) { - str += escapedChars[c] - pos++ - } else if (c === "u") { - pos++ - let count = 4 - let code = 0 - while (count--) { - code <<= 4 - c = s[pos] - if (c === undefined) { - errorMessage("unexpected end") - return undefined - } - c = c.toLowerCase() - if (c >= "a" && c <= "f") { - code += c.charCodeAt(0) - CODE_A + 10 - } else if (c >= "0" && c <= "9") { - code += c.charCodeAt(0) - CODE_0 - } else { - errorMessage(`unexpected token ${c}`) - return undefined - } - pos++ - } - str += String.fromCharCode(code) - } else { - errorMessage(`unexpected token ${c}`) - return undefined - } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - } else if (c === undefined) { - errorMessage("unexpected end") - return undefined - } else { - if (c.charCodeAt(0) >= 0x20) { - str += c - } else { - errorMessage(`unexpected token ${c}`) - return undefined - } - } - } - parseJsonString.position = pos - return str - - function errorMessage(msg: string): void { - parseJsonString.position = pos - parseJsonString.message = msg - } -} - -parseJsonString.message = undefined as string | undefined -parseJsonString.position = 0 as number -parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString' diff --git a/node_modules/ajv/lib/runtime/quote.ts b/node_modules/ajv/lib/runtime/quote.ts deleted file mode 100644 index 1160e6a23..000000000 --- a/node_modules/ajv/lib/runtime/quote.ts +++ /dev/null @@ -1,31 +0,0 @@ -const rxEscapable = - // eslint-disable-next-line no-control-regex, no-misleading-character-class - /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g - -const escaped: {[K in string]?: string} = { - "\b": "\\b", - "\t": "\\t", - "\n": "\\n", - "\f": "\\f", - "\r": "\\r", - '"': '\\"', - "\\": "\\\\", -} - -export default function quote(s: string): string { - rxEscapable.lastIndex = 0 - return ( - '"' + - (rxEscapable.test(s) - ? s.replace(rxEscapable, (a) => { - const c = escaped[a] - return typeof c === "string" - ? c - : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) - }) - : s) + - '"' - ) -} - -quote.code = 'require("ajv/dist/runtime/quote").default' diff --git a/node_modules/ajv/lib/runtime/re2.ts b/node_modules/ajv/lib/runtime/re2.ts deleted file mode 100644 index 0c769bc7a..000000000 --- a/node_modules/ajv/lib/runtime/re2.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as re2 from "re2" - -type Re2 = typeof re2 & {code: string} -;(re2 as Re2).code = 'require("ajv/dist/runtime/re2").default' - -export default re2 as Re2 diff --git a/node_modules/ajv/lib/runtime/timestamp.ts b/node_modules/ajv/lib/runtime/timestamp.ts deleted file mode 100644 index 1625f9a40..000000000 --- a/node_modules/ajv/lib/runtime/timestamp.ts +++ /dev/null @@ -1,46 +0,0 @@ -const DT_SEPARATOR = /t|\s/i -const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/ -const TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i -const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] - -export default function validTimestamp(str: string, allowDate: boolean): boolean { - // http://tools.ietf.org/html/rfc3339#section-5.6 - const dt: string[] = str.split(DT_SEPARATOR) - return ( - (dt.length === 2 && validDate(dt[0]) && validTime(dt[1])) || - (allowDate && dt.length === 1 && validDate(dt[0])) - ) -} - -function validDate(str: string): boolean { - const matches: string[] | null = DATE.exec(str) - if (!matches) return false - const y: number = +matches[1] - const m: number = +matches[2] - const d: number = +matches[3] - return ( - m >= 1 && - m <= 12 && - d >= 1 && - (d <= DAYS[m] || - // leap year: https://tools.ietf.org/html/rfc3339#appendix-C - (m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0))) - ) -} - -function validTime(str: string): boolean { - const matches: string[] | null = TIME.exec(str) - if (!matches) return false - const hr: number = +matches[1] - const min: number = +matches[2] - const sec: number = +matches[3] - const tzH: number = +(matches[4] || 0) - const tzM: number = +(matches[5] || 0) - return ( - (hr <= 23 && min <= 59 && sec <= 59) || - // leap second - (hr - tzH === 23 && min - tzM === 59 && sec === 60) - ) -} - -validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default' diff --git a/node_modules/ajv/lib/runtime/ucs2length.ts b/node_modules/ajv/lib/runtime/ucs2length.ts deleted file mode 100644 index 47d8292b8..000000000 --- a/node_modules/ajv/lib/runtime/ucs2length.ts +++ /dev/null @@ -1,20 +0,0 @@ -// https://mathiasbynens.be/notes/javascript-encoding -// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode -export default function ucs2length(str: string): number { - const len = str.length - let length = 0 - let pos = 0 - let value: number - while (pos < len) { - length++ - value = str.charCodeAt(pos++) - if (value >= 0xd800 && value <= 0xdbff && pos < len) { - // high surrogate, and there is a next character - value = str.charCodeAt(pos) - if ((value & 0xfc00) === 0xdc00) pos++ // low surrogate - } - } - return length -} - -ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default' diff --git a/node_modules/ajv/lib/runtime/uri.ts b/node_modules/ajv/lib/runtime/uri.ts deleted file mode 100644 index 7dd35f9d1..000000000 --- a/node_modules/ajv/lib/runtime/uri.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as uri from "uri-js" - -type URI = typeof uri & {code: string} -;(uri as URI).code = 'require("ajv/dist/runtime/uri").default' - -export default uri as URI diff --git a/node_modules/ajv/lib/runtime/validation_error.ts b/node_modules/ajv/lib/runtime/validation_error.ts deleted file mode 100644 index 2d19a46a2..000000000 --- a/node_modules/ajv/lib/runtime/validation_error.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type {ErrorObject} from "../types" - -export default class ValidationError extends Error { - readonly errors: Partial[] - readonly ajv: true - readonly validation: true - - constructor(errors: Partial[]) { - super("validation failed") - this.errors = errors - this.ajv = this.validation = true - } -} diff --git a/node_modules/ajv/lib/standalone/index.ts b/node_modules/ajv/lib/standalone/index.ts deleted file mode 100644 index b6129ce9e..000000000 --- a/node_modules/ajv/lib/standalone/index.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type AjvCore from "../core" -import type {AnyValidateFunction, SourceCode} from "../types" -import type {SchemaEnv} from "../compile" -import {UsedScopeValues, UsedValueState, ValueScopeName, varKinds} from "../compile/codegen/scope" -import {_, nil, _Code, Code, getProperty, getEsmExportName} from "../compile/codegen/code" - -function standaloneCode( - ajv: AjvCore, - refsOrFunc?: {[K in string]?: string} | AnyValidateFunction -): string { - if (!ajv.opts.code.source) { - throw new Error("moduleCode: ajv instance must have code.source option") - } - const {_n} = ajv.scope.opts - return typeof refsOrFunc == "function" - ? funcExportCode(refsOrFunc.source) - : refsOrFunc !== undefined - ? multiExportsCode(refsOrFunc, getValidate) - : multiExportsCode(ajv.schemas, (sch) => - sch.meta ? undefined : ajv.compile(sch.schema) - ) - - function getValidate(id: string): AnyValidateFunction { - const v = ajv.getSchema(id) - if (!v) throw new Error(`moduleCode: no schema with id ${id}`) - return v - } - - function funcExportCode(source?: SourceCode): string { - const usedValues: UsedScopeValues = {} - const n = source?.validateName - const vCode = validateCode(usedValues, source) - if (ajv.opts.code.esm) { - // Always do named export as `validate` rather than the variable `n` which is `validateXX` for known export value - return `"use strict";${_n}export const validate = ${n};${_n}export default ${n};${_n}${vCode}` - } - return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}` - } - - function multiExportsCode( - schemas: {[K in string]?: T}, - getValidateFunc: (schOrId: T) => AnyValidateFunction | undefined - ): string { - const usedValues: UsedScopeValues = {} - let code = _`"use strict";` - for (const name in schemas) { - const v = getValidateFunc(schemas[name] as T) - if (v) { - const vCode = validateCode(usedValues, v.source) - const exportSyntax = ajv.opts.code.esm - ? _`export const ${getEsmExportName(name)}` - : _`exports${getProperty(name)}` - code = _`${code}${_n}${exportSyntax} = ${v.source?.validateName};${_n}${vCode}` - } - } - return `${code}` - } - - function validateCode(usedValues: UsedScopeValues, s?: SourceCode): Code { - if (!s) throw new Error('moduleCode: function does not have "source" property') - if (usedState(s.validateName) === UsedValueState.Completed) return nil - setUsedState(s.validateName, UsedValueState.Started) - - const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode) - const code = new _Code(`${scopeCode}${_n}${s.validateCode}`) - return s.evaluated ? _`${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code - - function refValidateCode(n: ValueScopeName): Code | undefined { - const vRef = n.value?.ref - if (n.prefix === "validate" && typeof vRef == "function") { - const v = vRef as AnyValidateFunction - return validateCode(usedValues, v.source) - } else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") { - const {validate, validateName} = vRef as SchemaEnv - if (!validateName) throw new Error("ajv internal error") - const def = ajv.opts.code.es5 ? varKinds.var : varKinds.const - const wrapper = _`${def} ${n} = {validate: ${validateName}};` - if (usedState(validateName) === UsedValueState.Started) return wrapper - const vCode = validateCode(usedValues, validate?.source) - return _`${wrapper}${_n}${vCode}` - } - return undefined - } - - function usedState(name: ValueScopeName): UsedValueState | undefined { - return usedValues[name.prefix]?.get(name) - } - - function setUsedState(name: ValueScopeName, state: UsedValueState): void { - const {prefix} = name - const names = (usedValues[prefix] = usedValues[prefix] || new Map()) - names.set(name, state) - } - } -} - -module.exports = exports = standaloneCode -Object.defineProperty(exports, "__esModule", {value: true}) - -export default standaloneCode diff --git a/node_modules/ajv/lib/standalone/instance.ts b/node_modules/ajv/lib/standalone/instance.ts deleted file mode 100644 index c4b2c30b5..000000000 --- a/node_modules/ajv/lib/standalone/instance.ts +++ /dev/null @@ -1,36 +0,0 @@ -import Ajv, {AnySchema, AnyValidateFunction, ErrorObject} from "../core" -import standaloneCode from "." -import * as requireFromString from "require-from-string" - -export default class AjvPack { - errors?: ErrorObject[] | null // errors from the last validation - constructor(readonly ajv: Ajv) {} - - validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise { - return Ajv.prototype.validate.call(this, schemaKeyRef, data) - } - - compile(schema: AnySchema, meta?: boolean): AnyValidateFunction { - return this.getStandalone(this.ajv.compile(schema, meta)) - } - - getSchema(keyRef: string): AnyValidateFunction | undefined { - const v = this.ajv.getSchema(keyRef) - if (!v) return undefined - return this.getStandalone(v) - } - - private getStandalone(v: AnyValidateFunction): AnyValidateFunction { - return requireFromString(standaloneCode(this.ajv, v)) as AnyValidateFunction - } - - addSchema(...args: Parameters): AjvPack { - this.ajv.addSchema.call(this.ajv, ...args) - return this - } - - addKeyword(...args: Parameters): AjvPack { - this.ajv.addKeyword.call(this.ajv, ...args) - return this - } -} diff --git a/node_modules/ajv/lib/types/index.ts b/node_modules/ajv/lib/types/index.ts deleted file mode 100644 index 123d9df16..000000000 --- a/node_modules/ajv/lib/types/index.ts +++ /dev/null @@ -1,240 +0,0 @@ -import * as URI from "uri-js" -import type {CodeGen, Code, Name, ScopeValueSets, ValueScopeName} from "../compile/codegen" -import type {SchemaEnv, SchemaCxt, SchemaObjCxt} from "../compile" -import type {JSONType} from "../compile/rules" -import type {KeywordCxt} from "../compile/validate" -import type Ajv from "../core" - -interface _SchemaObject { - id?: string - $id?: string - $schema?: string - [x: string]: any // TODO -} - -export interface SchemaObject extends _SchemaObject { - id?: string - $id?: string - $schema?: string - $async?: false - [x: string]: any // TODO -} - -export interface AsyncSchema extends _SchemaObject { - $async: true -} - -export type AnySchemaObject = SchemaObject | AsyncSchema - -export type Schema = SchemaObject | boolean - -export type AnySchema = Schema | AsyncSchema - -export type SchemaMap = {[Key in string]?: AnySchema} - -export interface SourceCode { - validateName: ValueScopeName - validateCode: string - scopeValues: ScopeValueSets - evaluated?: Code -} - -export interface DataValidationCxt { - instancePath: string - parentData: {[K in T]: any} // object or array - parentDataProperty: T // string or number - rootData: Record | any[] - dynamicAnchors: {[Ref in string]?: ValidateFunction} -} - -export interface ValidateFunction { - (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T - errors?: null | ErrorObject[] - evaluated?: Evaluated - schema: AnySchema - schemaEnv: SchemaEnv - source?: SourceCode -} - -export interface JTDParser { - (json: string): T | undefined - message?: string - position?: number -} - -export type EvaluatedProperties = {[K in string]?: true} | true - -export type EvaluatedItems = number | true - -export interface Evaluated { - // determined at compile time if staticProps/Items is true - props?: EvaluatedProperties - items?: EvaluatedItems - // whether props/items determined at compile time - dynamicProps: boolean - dynamicItems: boolean -} - -export interface AsyncValidateFunction extends ValidateFunction { - (...args: Parameters>): Promise - $async: true -} - -export type AnyValidateFunction = ValidateFunction | AsyncValidateFunction - -export interface ErrorObject, S = unknown> { - keyword: K - instancePath: string - schemaPath: string - params: P - // Added to validation errors of "propertyNames" keyword schema - propertyName?: string - // Excluded if option `messages` set to false. - message?: string - // These are added with the `verbose` option. - schema?: S - parentSchema?: AnySchemaObject - data?: unknown -} - -export type ErrorNoParams = ErrorObject, S> - -interface _KeywordDef { - keyword: string | string[] - type?: JSONType | JSONType[] // data types that keyword applies to - schemaType?: JSONType | JSONType[] // allowed type(s) of keyword value in the schema - allowUndefined?: boolean // used for keywords that can be invoked by other keywords, not being present in the schema - $data?: boolean // keyword supports [$data reference](../../docs/guide/combining-schemas.md#data-reference) - implements?: string[] // other schema keywords that this keyword implements - before?: string // keyword should be executed before this keyword (should be applicable to the same type) - post?: boolean // keyword should be executed after other keywords without post flag - metaSchema?: AnySchemaObject // meta-schema for keyword schema value - it is better to use schemaType where applicable - validateSchema?: AnyValidateFunction // compiled keyword metaSchema - should not be passed - dependencies?: string[] // keywords that must be present in the same schema - error?: KeywordErrorDefinition - $dataError?: KeywordErrorDefinition -} - -export interface CodeKeywordDefinition extends _KeywordDef { - code: (cxt: KeywordCxt, ruleType?: string) => void - trackErrors?: boolean -} - -export type MacroKeywordFunc = ( - schema: any, - parentSchema: AnySchemaObject, - it: SchemaCxt -) => AnySchema - -export type CompileKeywordFunc = ( - schema: any, - parentSchema: AnySchemaObject, - it: SchemaObjCxt -) => DataValidateFunction - -export interface DataValidateFunction { - (...args: Parameters): boolean | Promise - errors?: Partial[] -} - -export interface SchemaValidateFunction { - (schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): - | boolean - | Promise - errors?: Partial[] -} - -export interface FuncKeywordDefinition extends _KeywordDef { - validate?: SchemaValidateFunction | DataValidateFunction - compile?: CompileKeywordFunc - // schema: false makes validate not to expect schema (DataValidateFunction) - schema?: boolean // requires "validate" - modifying?: boolean - async?: boolean - valid?: boolean - errors?: boolean | "full" -} - -export interface MacroKeywordDefinition extends FuncKeywordDefinition { - macro: MacroKeywordFunc -} - -export type KeywordDefinition = - | CodeKeywordDefinition - | FuncKeywordDefinition - | MacroKeywordDefinition - -export type AddedKeywordDefinition = KeywordDefinition & { - type: JSONType[] - schemaType: JSONType[] -} - -export interface KeywordErrorDefinition { - message: string | Code | ((cxt: KeywordErrorCxt) => string | Code) - params?: Code | ((cxt: KeywordErrorCxt) => Code) -} - -export type Vocabulary = (KeywordDefinition | string)[] - -export interface KeywordErrorCxt { - gen: CodeGen - keyword: string - data: Name - $data?: string | false - schema: any // TODO - parentSchema?: AnySchemaObject - schemaCode: Code | number | boolean - schemaValue: Code | number | boolean - schemaType?: JSONType[] - errsCount?: Name - params: KeywordCxtParams - it: SchemaCxt -} - -export type KeywordCxtParams = {[P in string]?: Code | string | number} - -export type FormatValidator = (data: T) => boolean - -export type FormatCompare = (data1: T, data2: T) => number | undefined - -export type AsyncFormatValidator = (data: T) => Promise - -export interface FormatDefinition { - type?: T extends string ? "string" | undefined : "number" - validate: FormatValidator | (T extends string ? string | RegExp : never) - async?: false | undefined - compare?: FormatCompare -} - -export interface AsyncFormatDefinition { - type?: T extends string ? "string" | undefined : "number" - validate: AsyncFormatValidator - async: true - compare?: FormatCompare -} - -export type AddedFormat = - | true - | RegExp - | FormatValidator - | FormatDefinition - | FormatDefinition - | AsyncFormatDefinition - | AsyncFormatDefinition - -export type Format = AddedFormat | string - -export interface RegExpEngine { - (pattern: string, u: string): RegExpLike - code: string -} - -export interface RegExpLike { - test: (s: string) => boolean -} - -export interface UriResolver { - parse(uri: string): URI.URIComponents - resolve(base: string, path: string): string - serialize(component: URI.URIComponents): string -} diff --git a/node_modules/ajv/lib/types/json-schema.ts b/node_modules/ajv/lib/types/json-schema.ts deleted file mode 100644 index 281a38bdb..000000000 --- a/node_modules/ajv/lib/types/json-schema.ts +++ /dev/null @@ -1,187 +0,0 @@ -/* eslint-disable @typescript-eslint/no-empty-interface */ -type StrictNullChecksWrapper = undefined extends null - ? `strictNullChecks must be true in tsconfig to use ${Name}` - : Type - -type UnionToIntersection = (U extends any ? (_: U) => void : never) extends (_: infer I) => void - ? I - : never - -export type SomeJSONSchema = UncheckedJSONSchemaType - -type UncheckedPartialSchema = Partial> - -export type PartialSchema = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema> - -type JSONType = IsPartial extends true - ? T | undefined - : T - -interface NumberKeywords { - minimum?: number - maximum?: number - exclusiveMinimum?: number - exclusiveMaximum?: number - multipleOf?: number - format?: string -} - -interface StringKeywords { - minLength?: number - maxLength?: number - pattern?: string - format?: string -} - -type UncheckedJSONSchemaType = ( - | // these two unions allow arbitrary unions of types - { - anyOf: readonly UncheckedJSONSchemaType[] - } - | { - oneOf: readonly UncheckedJSONSchemaType[] - } - // this union allows for { type: (primitive)[] } style schemas - | ({ - type: readonly (T extends number - ? JSONType<"number" | "integer", IsPartial> - : T extends string - ? JSONType<"string", IsPartial> - : T extends boolean - ? JSONType<"boolean", IsPartial> - : never)[] - } & UnionToIntersection< - T extends number - ? NumberKeywords - : T extends string - ? StringKeywords - : T extends boolean - ? // eslint-disable-next-line @typescript-eslint/ban-types - {} - : never - >) - // this covers "normal" types; it's last so typescript looks to it first for errors - | ((T extends number - ? { - type: JSONType<"number" | "integer", IsPartial> - } & NumberKeywords - : T extends string - ? { - type: JSONType<"string", IsPartial> - } & StringKeywords - : T extends boolean - ? { - type: JSONType<"boolean", IsPartial> - } - : T extends readonly [any, ...any[]] - ? { - // JSON AnySchema for tuple - type: JSONType<"array", IsPartial> - items: { - readonly [K in keyof T]-?: UncheckedJSONSchemaType & Nullable - } & {length: T["length"]} - minItems: T["length"] - } & ({maxItems: T["length"]} | {additionalItems: false}) - : T extends readonly any[] - ? { - type: JSONType<"array", IsPartial> - items: UncheckedJSONSchemaType - contains?: UncheckedPartialSchema - minItems?: number - maxItems?: number - minContains?: number - maxContains?: number - uniqueItems?: true - additionalItems?: never - } - : T extends Record - ? { - // JSON AnySchema for records and dictionaries - // "required" is not optional because it is often forgotten - // "properties" are optional for more concise dictionary schemas - // "patternProperties" and can be only used with interfaces that have string index - type: JSONType<"object", IsPartial> - additionalProperties?: boolean | UncheckedJSONSchemaType - unevaluatedProperties?: boolean | UncheckedJSONSchemaType - properties?: IsPartial extends true - ? Partial> - : UncheckedPropertiesSchema - patternProperties?: Record> - propertyNames?: Omit, "type"> & {type?: "string"} - dependencies?: {[K in keyof T]?: Readonly<(keyof T)[]> | UncheckedPartialSchema} - dependentRequired?: {[K in keyof T]?: Readonly<(keyof T)[]>} - dependentSchemas?: {[K in keyof T]?: UncheckedPartialSchema} - minProperties?: number - maxProperties?: number - } & (IsPartial extends true // "required" is not necessary if it's a non-partial type with no required keys // are listed it only asserts that optional cannot be listed. // "required" type does not guarantee that all required properties - ? {required: Readonly<(keyof T)[]>} - : [UncheckedRequiredMembers] extends [never] - ? {required?: Readonly[]>} - : {required: Readonly[]>}) - : T extends null - ? { - type: JSONType<"null", IsPartial> - nullable: true - } - : never) & { - allOf?: Readonly[]> - anyOf?: Readonly[]> - oneOf?: Readonly[]> - if?: UncheckedPartialSchema - then?: UncheckedPartialSchema - else?: UncheckedPartialSchema - not?: UncheckedPartialSchema - }) -) & { - [keyword: string]: any - $id?: string - $ref?: string - $defs?: Record> - definitions?: Record> -} - -export type JSONSchemaType = StrictNullChecksWrapper< - "JSONSchemaType", - UncheckedJSONSchemaType -> - -type Known = - | {[key: string]: Known} - | [Known, ...Known[]] - | Known[] - | number - | string - | boolean - | null - -type UncheckedPropertiesSchema = { - [K in keyof T]-?: (UncheckedJSONSchemaType & Nullable) | {$ref: string} -} - -export type PropertiesSchema = StrictNullChecksWrapper< - "PropertiesSchema", - UncheckedPropertiesSchema -> - -type UncheckedRequiredMembers = { - [K in keyof T]-?: undefined extends T[K] ? never : K -}[keyof T] - -export type RequiredMembers = StrictNullChecksWrapper< - "RequiredMembers", - UncheckedRequiredMembers -> - -type Nullable = undefined extends T - ? { - nullable: true - const?: null // any non-null value would fail `const: null`, `null` would fail any other value in const - enum?: Readonly<(T | null)[]> // `null` must be explicitly included in "enum" for `null` to pass - default?: T | null - } - : { - nullable?: false - const?: T - enum?: Readonly - default?: T - } diff --git a/node_modules/ajv/lib/types/jtd-schema.ts b/node_modules/ajv/lib/types/jtd-schema.ts deleted file mode 100644 index 61b2bde81..000000000 --- a/node_modules/ajv/lib/types/jtd-schema.ts +++ /dev/null @@ -1,273 +0,0 @@ -/** numeric strings */ -type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" - -/** string strings */ -type StringType = "string" | "timestamp" - -/** Generic JTD Schema without inference of the represented type */ -export type SomeJTDSchemaType = ( - | // ref - {ref: string} - // primitives - | {type: NumberType | StringType | "boolean"} - // enum - | {enum: string[]} - // elements - | {elements: SomeJTDSchemaType} - // values - | {values: SomeJTDSchemaType} - // properties - | { - properties: Record - optionalProperties?: Record - additionalProperties?: boolean - } - | { - properties?: Record - optionalProperties: Record - additionalProperties?: boolean - } - // discriminator - | {discriminator: string; mapping: Record} - // empty - // NOTE see the end of - // https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492 - // eslint-disable-next-line @typescript-eslint/ban-types - | {} -) & { - nullable?: boolean - metadata?: Record - definitions?: Record -} - -/** required keys of an object, not undefined */ -type RequiredKeys = { - [K in keyof T]-?: undefined extends T[K] ? never : K -}[keyof T] - -/** optional or undifined-able keys of an object */ -type OptionalKeys = { - [K in keyof T]-?: undefined extends T[K] ? K : never -}[keyof T] - -/** type is true if T is a union type */ -type IsUnion_ = false extends ( - T extends unknown ? ([U] extends [T] ? false : true) : never -) - ? false - : true -type IsUnion = IsUnion_ - -/** type is true if T is identically E */ -type TypeEquality = [T] extends [E] ? ([E] extends [T] ? true : false) : false - -/** type is true if T or null is identically E or null*/ -type NullTypeEquality = TypeEquality - -/** gets only the string literals of a type or null if a type isn't a string literal */ -type EnumString = [T] extends [never] - ? null - : T extends string - ? string extends T - ? null - : T - : null - -/** true if type is a union of string literals */ -type IsEnum = null extends EnumString ? false : true - -/** true only if all types are array types (not tuples) */ -// NOTE relies on the fact that tuples don't have an index at 0.5, but arrays -// have an index at every number -type IsElements = false extends IsUnion - ? [T] extends [readonly unknown[]] - ? undefined extends T[0.5] - ? false - : true - : false - : false - -/** true if the the type is a values type */ -type IsValues = false extends IsUnion ? TypeEquality : false - -/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */ -type IsRecord = Union extends IsUnion - ? null extends EnumString - ? false - : true - : false - -/** true if type represents an empty record */ -type IsEmptyRecord = [T] extends [Record] - ? [T] extends [never] - ? false - : true - : false - -/** actual schema */ -export type JTDSchemaType = Record> = ( - | // refs - where null wasn't specified, must match exactly - (null extends EnumString - ? never - : - | ({[K in keyof D]: [T] extends [D[K]] ? {ref: K} : never}[keyof D] & {nullable?: false}) - // nulled refs - if ref is nullable and nullable is specified, then it can - // match either null or non-null definitions - | (null extends T - ? { - [K in keyof D]: [Exclude] extends [Exclude] - ? {ref: K} - : never - }[keyof D] & {nullable: true} - : never)) - // empty - empty schemas also treat nullable differently in that it's now fully ignored - | (unknown extends T ? {nullable?: boolean} : never) - // all other types // numbers - only accepts the type number - | ((true extends NullTypeEquality - ? {type: NumberType} - : // booleans - accepts the type boolean - true extends NullTypeEquality - ? {type: "boolean"} - : // strings - only accepts the type string - true extends NullTypeEquality - ? {type: StringType} - : // strings - only accepts the type Date - true extends NullTypeEquality - ? {type: "timestamp"} - : // enums - only accepts union of string literals - // TODO we can't actually check that everything in the union was specified - true extends IsEnum> - ? {enum: EnumString>[]} - : // arrays - only accepts arrays, could be array of unions to be resolved later - true extends IsElements> - ? T extends readonly (infer E)[] - ? { - elements: JTDSchemaType - } - : never - : // empty properties - true extends IsEmptyRecord> - ? - | {properties: Record; optionalProperties?: Record} - | {optionalProperties: Record} - : // values - true extends IsValues> - ? T extends Record - ? { - values: JTDSchemaType - } - : never - : // properties - true extends IsRecord, false> - ? ([RequiredKeys>] extends [never] - ? { - properties?: Record - } - : { - properties: {[K in RequiredKeys]: JTDSchemaType} - }) & - ([OptionalKeys>] extends [never] - ? { - optionalProperties?: Record - } - : { - optionalProperties: { - [K in OptionalKeys]: JTDSchemaType, D> - } - }) & { - additionalProperties?: boolean - } - : // discriminator - true extends IsRecord, true> - ? { - [K in keyof Exclude]-?: Exclude[K] extends string - ? { - discriminator: K - mapping: { - // TODO currently allows descriminator to be present in schema - [M in Exclude[K]]: JTDSchemaType< - Omit ? T : never, K>, - D - > - } - } - : never - }[keyof Exclude] - : never) & - (null extends T - ? { - nullable: true - } - : {nullable?: false})) -) & { - // extra properties - metadata?: Record - // TODO these should only be allowed at the top level - definitions?: {[K in keyof D]: JTDSchemaType} -} - -type JTDDataDef> = - | // ref - (S extends {ref: string} - ? D extends {[K in S["ref"]]: infer V} - ? JTDDataDef - : never - : // type - S extends {type: NumberType} - ? number - : S extends {type: "boolean"} - ? boolean - : S extends {type: "string"} - ? string - : S extends {type: "timestamp"} - ? string | Date - : // enum - S extends {enum: readonly (infer E)[]} - ? string extends E - ? never - : [E] extends [string] - ? E - : never - : // elements - S extends {elements: infer E} - ? JTDDataDef[] - : // properties - S extends { - properties: Record - optionalProperties?: Record - additionalProperties?: boolean - } - ? {-readonly [K in keyof S["properties"]]-?: JTDDataDef} & { - -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef< - S["optionalProperties"][K], - D - > - } & ([S["additionalProperties"]] extends [true] ? Record : unknown) - : S extends { - properties?: Record - optionalProperties: Record - additionalProperties?: boolean - } - ? {-readonly [K in keyof S["properties"]]-?: JTDDataDef} & { - -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef< - S["optionalProperties"][K], - D - > - } & ([S["additionalProperties"]] extends [true] ? Record : unknown) - : // values - S extends {values: infer V} - ? Record> - : // discriminator - S extends {discriminator: infer M; mapping: Record} - ? [M] extends [string] - ? { - [K in keyof S["mapping"]]: JTDDataDef & {[KM in M]: K} - }[keyof S["mapping"]] - : never - : // empty - unknown) - | (S extends {nullable: true} ? null : never) - -export type JTDDataType = S extends {definitions: Record} - ? JTDDataDef - : JTDDataDef> diff --git a/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts b/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts deleted file mode 100644 index 755e5b3da..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, not, Name} from "../../compile/codegen" -import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util" - -export type AdditionalItemsError = ErrorObject<"additionalItems", {limit: number}, AnySchema> - -const error: KeywordErrorDefinition = { - message: ({params: {len}}) => str`must NOT have more than ${len} items`, - params: ({params: {len}}) => _`{limit: ${len}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "additionalItems" as const, - type: "array", - schemaType: ["boolean", "object"], - before: "uniqueItems", - error, - code(cxt: KeywordCxt) { - const {parentSchema, it} = cxt - const {items} = parentSchema - if (!Array.isArray(items)) { - checkStrictMode(it, '"additionalItems" is ignored when "items" is not an array of schemas') - return - } - validateAdditionalItems(cxt, items) - }, -} - -export function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void { - const {gen, schema, data, keyword, it} = cxt - it.items = true - const len = gen.const("len", _`${data}.length`) - if (schema === false) { - cxt.setParams({len: items.length}) - cxt.pass(_`${len} <= ${items.length}`) - } else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { - const valid = gen.var("valid", _`${len} <= ${items.length}`) // TODO var - gen.if(not(valid), () => validateItems(valid)) - cxt.ok(valid) - } - - function validateItems(valid: Name): void { - gen.forRange("i", items.length, len, (i) => { - cxt.subschema({keyword, dataProp: i, dataPropType: Type.Num}, valid) - if (!it.allErrors) gen.if(not(valid), () => gen.break()) - }) - } -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts b/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts deleted file mode 100644 index bfb511ce5..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +++ /dev/null @@ -1,118 +0,0 @@ -import type { - CodeKeywordDefinition, - AddedKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import {allSchemaProperties, usePattern, isOwnProperty} from "../code" -import {_, nil, or, not, Code, Name} from "../../compile/codegen" -import N from "../../compile/names" -import type {SubschemaArgs} from "../../compile/validate/subschema" -import {alwaysValidSchema, schemaRefOrVal, Type} from "../../compile/util" - -export type AdditionalPropertiesError = ErrorObject< - "additionalProperties", - {additionalProperty: string}, - AnySchema -> - -const error: KeywordErrorDefinition = { - message: "must NOT have additional properties", - params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, -} - -const def: CodeKeywordDefinition & AddedKeywordDefinition = { - keyword: "additionalProperties", - type: ["object"], - schemaType: ["boolean", "object"], - allowUndefined: true, - trackErrors: true, - error, - code(cxt) { - const {gen, schema, parentSchema, data, errsCount, it} = cxt - /* istanbul ignore if */ - if (!errsCount) throw new Error("ajv implementation error") - const {allErrors, opts} = it - it.props = true - if (opts.removeAdditional !== "all" && alwaysValidSchema(it, schema)) return - const props = allSchemaProperties(parentSchema.properties) - const patProps = allSchemaProperties(parentSchema.patternProperties) - checkAdditionalProperties() - cxt.ok(_`${errsCount} === ${N.errors}`) - - function checkAdditionalProperties(): void { - gen.forIn("key", data, (key: Name) => { - if (!props.length && !patProps.length) additionalPropertyCode(key) - else gen.if(isAdditional(key), () => additionalPropertyCode(key)) - }) - } - - function isAdditional(key: Name): Code { - let definedProp: Code - if (props.length > 8) { - // TODO maybe an option instead of hard-coded 8? - const propsSchema = schemaRefOrVal(it, parentSchema.properties, "properties") - definedProp = isOwnProperty(gen, propsSchema as Code, key) - } else if (props.length) { - definedProp = or(...props.map((p) => _`${key} === ${p}`)) - } else { - definedProp = nil - } - if (patProps.length) { - definedProp = or(definedProp, ...patProps.map((p) => _`${usePattern(cxt, p)}.test(${key})`)) - } - return not(definedProp) - } - - function deleteAdditional(key: Name): void { - gen.code(_`delete ${data}[${key}]`) - } - - function additionalPropertyCode(key: Name): void { - if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) { - deleteAdditional(key) - return - } - - if (schema === false) { - cxt.setParams({additionalProperty: key}) - cxt.error() - if (!allErrors) gen.break() - return - } - - if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { - const valid = gen.name("valid") - if (opts.removeAdditional === "failing") { - applyAdditionalSchema(key, valid, false) - gen.if(not(valid), () => { - cxt.reset() - deleteAdditional(key) - }) - } else { - applyAdditionalSchema(key, valid) - if (!allErrors) gen.if(not(valid), () => gen.break()) - } - } - } - - function applyAdditionalSchema(key: Name, valid: Name, errors?: false): void { - const subschema: SubschemaArgs = { - keyword: "additionalProperties", - dataProp: key, - dataPropType: Type.Str, - } - if (errors === false) { - Object.assign(subschema, { - compositeRule: true, - createErrors: false, - allErrors: false, - }) - } - cxt.subschema(subschema, valid) - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/allOf.ts b/node_modules/ajv/lib/vocabularies/applicator/allOf.ts deleted file mode 100644 index cdfa86ff4..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type {CodeKeywordDefinition, AnySchema} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {alwaysValidSchema} from "../../compile/util" - -const def: CodeKeywordDefinition = { - keyword: "allOf", - schemaType: "array", - code(cxt: KeywordCxt) { - const {gen, schema, it} = cxt - /* istanbul ignore if */ - if (!Array.isArray(schema)) throw new Error("ajv implementation error") - const valid = gen.name("valid") - schema.forEach((sch: AnySchema, i: number) => { - if (alwaysValidSchema(it, sch)) return - const schCxt = cxt.subschema({keyword: "allOf", schemaProp: i}, valid) - cxt.ok(valid) - cxt.mergeEvaluated(schCxt) - }) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts b/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts deleted file mode 100644 index bd331b5ae..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types" -import {validateUnion} from "../code" - -export type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]> - -const def: CodeKeywordDefinition = { - keyword: "anyOf", - schemaType: "array", - trackErrors: true, - code: validateUnion, - error: {message: "must match a schema in anyOf"}, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/contains.ts b/node_modules/ajv/lib/vocabularies/applicator/contains.ts deleted file mode 100644 index d88675c6c..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/contains.ts +++ /dev/null @@ -1,109 +0,0 @@ -import type { - CodeKeywordDefinition, - KeywordErrorDefinition, - ErrorObject, - AnySchema, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, Name} from "../../compile/codegen" -import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util" - -export type ContainsError = ErrorObject< - "contains", - {minContains: number; maxContains?: number}, - AnySchema -> - -const error: KeywordErrorDefinition = { - message: ({params: {min, max}}) => - max === undefined - ? str`must contain at least ${min} valid item(s)` - : str`must contain at least ${min} and no more than ${max} valid item(s)`, - params: ({params: {min, max}}) => - max === undefined ? _`{minContains: ${min}}` : _`{minContains: ${min}, maxContains: ${max}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "contains", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - trackErrors: true, - error, - code(cxt: KeywordCxt) { - const {gen, schema, parentSchema, data, it} = cxt - let min: number - let max: number | undefined - const {minContains, maxContains} = parentSchema - if (it.opts.next) { - min = minContains === undefined ? 1 : minContains - max = maxContains - } else { - min = 1 - } - const len = gen.const("len", _`${data}.length`) - cxt.setParams({min, max}) - if (max === undefined && min === 0) { - checkStrictMode(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`) - return - } - if (max !== undefined && min > max) { - checkStrictMode(it, `"minContains" > "maxContains" is always invalid`) - cxt.fail() - return - } - if (alwaysValidSchema(it, schema)) { - let cond = _`${len} >= ${min}` - if (max !== undefined) cond = _`${cond} && ${len} <= ${max}` - cxt.pass(cond) - return - } - - it.items = true - const valid = gen.name("valid") - if (max === undefined && min === 1) { - validateItems(valid, () => gen.if(valid, () => gen.break())) - } else if (min === 0) { - gen.let(valid, true) - if (max !== undefined) gen.if(_`${data}.length > 0`, validateItemsWithCount) - } else { - gen.let(valid, false) - validateItemsWithCount() - } - cxt.result(valid, () => cxt.reset()) - - function validateItemsWithCount(): void { - const schValid = gen.name("_valid") - const count = gen.let("count", 0) - validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))) - } - - function validateItems(_valid: Name, block: () => void): void { - gen.forRange("i", 0, len, (i) => { - cxt.subschema( - { - keyword: "contains", - dataProp: i, - dataPropType: Type.Num, - compositeRule: true, - }, - _valid - ) - block() - }) - } - - function checkLimits(count: Name): void { - gen.code(_`${count}++`) - if (max === undefined) { - gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true).break()) - } else { - gen.if(_`${count} > ${max}`, () => gen.assign(valid, false).break()) - if (min === 1) gen.assign(valid, true) - else gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true)) - } - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts b/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts deleted file mode 100644 index f67611286..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +++ /dev/null @@ -1,112 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - SchemaMap, - AnySchema, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str} from "../../compile/codegen" -import {alwaysValidSchema} from "../../compile/util" -import {checkReportMissingProp, checkMissingProp, reportMissingProp, propertyInData} from "../code" - -export type PropertyDependencies = {[K in string]?: string[]} - -export interface DependenciesErrorParams { - property: string - missingProperty: string - depsCount: number - deps: string // TODO change to string[] -} - -type SchemaDependencies = SchemaMap - -export type DependenciesError = ErrorObject< - "dependencies", - DependenciesErrorParams, - {[K in string]?: string[] | AnySchema} -> - -export const error: KeywordErrorDefinition = { - message: ({params: {property, depsCount, deps}}) => { - const property_ies = depsCount === 1 ? "property" : "properties" - return str`must have ${property_ies} ${deps} when property ${property} is present` - }, - params: ({params: {property, depsCount, deps, missingProperty}}) => - _`{property: ${property}, - missingProperty: ${missingProperty}, - depsCount: ${depsCount}, - deps: ${deps}}`, // TODO change to reference -} - -const def: CodeKeywordDefinition = { - keyword: "dependencies", - type: "object", - schemaType: "object", - error, - code(cxt: KeywordCxt) { - const [propDeps, schDeps] = splitDependencies(cxt) - validatePropertyDeps(cxt, propDeps) - validateSchemaDeps(cxt, schDeps) - }, -} - -function splitDependencies({schema}: KeywordCxt): [PropertyDependencies, SchemaDependencies] { - const propertyDeps: PropertyDependencies = {} - const schemaDeps: SchemaDependencies = {} - for (const key in schema) { - if (key === "__proto__") continue - const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps - deps[key] = schema[key] - } - return [propertyDeps, schemaDeps] -} - -export function validatePropertyDeps( - cxt: KeywordCxt, - propertyDeps: {[K in string]?: string[]} = cxt.schema -): void { - const {gen, data, it} = cxt - if (Object.keys(propertyDeps).length === 0) return - const missing = gen.let("missing") - for (const prop in propertyDeps) { - const deps = propertyDeps[prop] as string[] - if (deps.length === 0) continue - const hasProperty = propertyInData(gen, data, prop, it.opts.ownProperties) - cxt.setParams({ - property: prop, - depsCount: deps.length, - deps: deps.join(", "), - }) - if (it.allErrors) { - gen.if(hasProperty, () => { - for (const depProp of deps) { - checkReportMissingProp(cxt, depProp) - } - }) - } else { - gen.if(_`${hasProperty} && (${checkMissingProp(cxt, deps, missing)})`) - reportMissingProp(cxt, missing) - gen.else() - } - } -} - -export function validateSchemaDeps(cxt: KeywordCxt, schemaDeps: SchemaMap = cxt.schema): void { - const {gen, data, keyword, it} = cxt - const valid = gen.name("valid") - for (const prop in schemaDeps) { - if (alwaysValidSchema(it, schemaDeps[prop] as AnySchema)) continue - gen.if( - propertyInData(gen, data, prop, it.opts.ownProperties), - () => { - const schCxt = cxt.subschema({keyword, schemaProp: prop}, valid) - cxt.mergeValidEvaluated(schCxt, valid) - }, - () => gen.var(valid, true) // TODO var - ) - cxt.ok(valid) - } -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts b/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts deleted file mode 100644 index dbd3ae45c..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import {validateSchemaDeps} from "./dependencies" - -const def: CodeKeywordDefinition = { - keyword: "dependentSchemas", - type: "object", - schemaType: "object", - code: (cxt) => validateSchemaDeps(cxt), -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/if.ts b/node_modules/ajv/lib/vocabularies/applicator/if.ts deleted file mode 100644 index 5a40d5e3a..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/if.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type {SchemaObjCxt} from "../../compile" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, not, Name} from "../../compile/codegen" -import {alwaysValidSchema, checkStrictMode} from "../../compile/util" - -export type IfKeywordError = ErrorObject<"if", {failingKeyword: string}, AnySchema> - -const error: KeywordErrorDefinition = { - message: ({params}) => str`must match "${params.ifClause}" schema`, - params: ({params}) => _`{failingKeyword: ${params.ifClause}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "if", - schemaType: ["object", "boolean"], - trackErrors: true, - error, - code(cxt: KeywordCxt) { - const {gen, parentSchema, it} = cxt - if (parentSchema.then === undefined && parentSchema.else === undefined) { - checkStrictMode(it, '"if" without "then" and "else" is ignored') - } - const hasThen = hasSchema(it, "then") - const hasElse = hasSchema(it, "else") - if (!hasThen && !hasElse) return - - const valid = gen.let("valid", true) - const schValid = gen.name("_valid") - validateIf() - cxt.reset() - - if (hasThen && hasElse) { - const ifClause = gen.let("ifClause") - cxt.setParams({ifClause}) - gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)) - } else if (hasThen) { - gen.if(schValid, validateClause("then")) - } else { - gen.if(not(schValid), validateClause("else")) - } - - cxt.pass(valid, () => cxt.error(true)) - - function validateIf(): void { - const schCxt = cxt.subschema( - { - keyword: "if", - compositeRule: true, - createErrors: false, - allErrors: false, - }, - schValid - ) - cxt.mergeEvaluated(schCxt) - } - - function validateClause(keyword: string, ifClause?: Name): () => void { - return () => { - const schCxt = cxt.subschema({keyword}, schValid) - gen.assign(valid, schValid) - cxt.mergeValidEvaluated(schCxt, valid) - if (ifClause) gen.assign(ifClause, _`${keyword}`) - else cxt.setParams({ifClause: keyword}) - } - } - }, -} - -function hasSchema(it: SchemaObjCxt, keyword: string): boolean { - const schema = it.schema[keyword] - return schema !== undefined && !alwaysValidSchema(it, schema) -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/index.ts b/node_modules/ajv/lib/vocabularies/applicator/index.ts deleted file mode 100644 index fc5271699..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/index.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type {ErrorNoParams, Vocabulary} from "../../types" -import additionalItems, {AdditionalItemsError} from "./additionalItems" -import prefixItems from "./prefixItems" -import items from "./items" -import items2020, {ItemsError} from "./items2020" -import contains, {ContainsError} from "./contains" -import dependencies, {DependenciesError} from "./dependencies" -import propertyNames, {PropertyNamesError} from "./propertyNames" -import additionalProperties, {AdditionalPropertiesError} from "./additionalProperties" -import properties from "./properties" -import patternProperties from "./patternProperties" -import notKeyword, {NotKeywordError} from "./not" -import anyOf, {AnyOfError} from "./anyOf" -import oneOf, {OneOfError} from "./oneOf" -import allOf from "./allOf" -import ifKeyword, {IfKeywordError} from "./if" -import thenElse from "./thenElse" - -export default function getApplicator(draft2020 = false): Vocabulary { - const applicator = [ - // any - notKeyword, - anyOf, - oneOf, - allOf, - ifKeyword, - thenElse, - // object - propertyNames, - additionalProperties, - dependencies, - properties, - patternProperties, - ] - // array - if (draft2020) applicator.push(prefixItems, items2020) - else applicator.push(additionalItems, items) - applicator.push(contains) - return applicator -} - -export type ApplicatorKeywordError = - | ErrorNoParams<"false schema"> - | AdditionalItemsError - | ItemsError - | ContainsError - | AdditionalPropertiesError - | DependenciesError - | IfKeywordError - | AnyOfError - | OneOfError - | NotKeywordError - | PropertyNamesError diff --git a/node_modules/ajv/lib/vocabularies/applicator/items.ts b/node_modules/ajv/lib/vocabularies/applicator/items.ts deleted file mode 100644 index 033cb3977..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/items.ts +++ /dev/null @@ -1,59 +0,0 @@ -import type {CodeKeywordDefinition, AnySchema, AnySchemaObject} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_} from "../../compile/codegen" -import {alwaysValidSchema, mergeEvaluated, checkStrictMode} from "../../compile/util" -import {validateArray} from "../code" - -const def: CodeKeywordDefinition = { - keyword: "items", - type: "array", - schemaType: ["object", "array", "boolean"], - before: "uniqueItems", - code(cxt: KeywordCxt) { - const {schema, it} = cxt - if (Array.isArray(schema)) return validateTuple(cxt, "additionalItems", schema) - it.items = true - if (alwaysValidSchema(it, schema)) return - cxt.ok(validateArray(cxt)) - }, -} - -export function validateTuple( - cxt: KeywordCxt, - extraItems: string, - schArr: AnySchema[] = cxt.schema -): void { - const {gen, parentSchema, data, keyword, it} = cxt - checkStrictTuple(parentSchema) - if (it.opts.unevaluated && schArr.length && it.items !== true) { - it.items = mergeEvaluated.items(gen, schArr.length, it.items) - } - const valid = gen.name("valid") - const len = gen.const("len", _`${data}.length`) - schArr.forEach((sch: AnySchema, i: number) => { - if (alwaysValidSchema(it, sch)) return - gen.if(_`${len} > ${i}`, () => - cxt.subschema( - { - keyword, - schemaProp: i, - dataProp: i, - }, - valid - ) - ) - cxt.ok(valid) - }) - - function checkStrictTuple(sch: AnySchemaObject): void { - const {opts, errSchemaPath} = it - const l = schArr.length - const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false) - if (opts.strictTuples && !fullTuple) { - const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"` - checkStrictMode(it, msg, opts.strictTuples) - } - } -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/items2020.ts b/node_modules/ajv/lib/vocabularies/applicator/items2020.ts deleted file mode 100644 index 2a99b08d5..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { - CodeKeywordDefinition, - KeywordErrorDefinition, - ErrorObject, - AnySchema, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str} from "../../compile/codegen" -import {alwaysValidSchema} from "../../compile/util" -import {validateArray} from "../code" -import {validateAdditionalItems} from "./additionalItems" - -export type ItemsError = ErrorObject<"items", {limit: number}, AnySchema> - -const error: KeywordErrorDefinition = { - message: ({params: {len}}) => str`must NOT have more than ${len} items`, - params: ({params: {len}}) => _`{limit: ${len}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "items", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - error, - code(cxt: KeywordCxt) { - const {schema, parentSchema, it} = cxt - const {prefixItems} = parentSchema - it.items = true - if (alwaysValidSchema(it, schema)) return - if (prefixItems) validateAdditionalItems(cxt, prefixItems) - else cxt.ok(validateArray(cxt)) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/not.ts b/node_modules/ajv/lib/vocabularies/applicator/not.ts deleted file mode 100644 index 8691db0bf..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/not.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {alwaysValidSchema} from "../../compile/util" - -export type NotKeywordError = ErrorNoParams<"not", AnySchema> - -const def: CodeKeywordDefinition = { - keyword: "not", - schemaType: ["object", "boolean"], - trackErrors: true, - code(cxt: KeywordCxt) { - const {gen, schema, it} = cxt - if (alwaysValidSchema(it, schema)) { - cxt.fail() - return - } - - const valid = gen.name("valid") - cxt.subschema( - { - keyword: "not", - compositeRule: true, - createErrors: false, - allErrors: false, - }, - valid - ) - - cxt.failResult( - valid, - () => cxt.reset(), - () => cxt.error() - ) - }, - error: {message: "must NOT be valid"}, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts b/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts deleted file mode 100644 index c25353ffd..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +++ /dev/null @@ -1,82 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, Name} from "../../compile/codegen" -import {alwaysValidSchema} from "../../compile/util" -import {SchemaCxt} from "../../compile" - -export type OneOfError = ErrorObject< - "oneOf", - {passingSchemas: [number, number] | null}, - AnySchema[] -> - -const error: KeywordErrorDefinition = { - message: "must match exactly one schema in oneOf", - params: ({params}) => _`{passingSchemas: ${params.passing}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "oneOf", - schemaType: "array", - trackErrors: true, - error, - code(cxt: KeywordCxt) { - const {gen, schema, parentSchema, it} = cxt - /* istanbul ignore if */ - if (!Array.isArray(schema)) throw new Error("ajv implementation error") - if (it.opts.discriminator && parentSchema.discriminator) return - const schArr: AnySchema[] = schema - const valid = gen.let("valid", false) - const passing = gen.let("passing", null) - const schValid = gen.name("_valid") - cxt.setParams({passing}) - // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas - - gen.block(validateOneOf) - - cxt.result( - valid, - () => cxt.reset(), - () => cxt.error(true) - ) - - function validateOneOf(): void { - schArr.forEach((sch: AnySchema, i: number) => { - let schCxt: SchemaCxt | undefined - if (alwaysValidSchema(it, sch)) { - gen.var(schValid, true) - } else { - schCxt = cxt.subschema( - { - keyword: "oneOf", - schemaProp: i, - compositeRule: true, - }, - schValid - ) - } - - if (i > 0) { - gen - .if(_`${schValid} && ${valid}`) - .assign(valid, false) - .assign(passing, _`[${passing}, ${i}]`) - .else() - } - - gen.if(schValid, () => { - gen.assign(valid, true) - gen.assign(passing, i) - if (schCxt) cxt.mergeEvaluated(schCxt, Name) - }) - }) - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts b/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts deleted file mode 100644 index ea624e230..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +++ /dev/null @@ -1,91 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {allSchemaProperties, usePattern} from "../code" -import {_, not, Name} from "../../compile/codegen" -import {alwaysValidSchema, checkStrictMode} from "../../compile/util" -import {evaluatedPropsToName, Type} from "../../compile/util" -import {AnySchema} from "../../types" - -const def: CodeKeywordDefinition = { - keyword: "patternProperties", - type: "object", - schemaType: "object", - code(cxt: KeywordCxt) { - const {gen, schema, data, parentSchema, it} = cxt - const {opts} = it - const patterns = allSchemaProperties(schema) - const alwaysValidPatterns = patterns.filter((p) => - alwaysValidSchema(it, schema[p] as AnySchema) - ) - - if ( - patterns.length === 0 || - (alwaysValidPatterns.length === patterns.length && - (!it.opts.unevaluated || it.props === true)) - ) { - return - } - - const checkProperties = - opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties - const valid = gen.name("valid") - if (it.props !== true && !(it.props instanceof Name)) { - it.props = evaluatedPropsToName(gen, it.props) - } - const {props} = it - validatePatternProperties() - - function validatePatternProperties(): void { - for (const pat of patterns) { - if (checkProperties) checkMatchingProperties(pat) - if (it.allErrors) { - validateProperties(pat) - } else { - gen.var(valid, true) // TODO var - validateProperties(pat) - gen.if(valid) - } - } - } - - function checkMatchingProperties(pat: string): void { - for (const prop in checkProperties) { - if (new RegExp(pat).test(prop)) { - checkStrictMode( - it, - `property ${prop} matches pattern ${pat} (use allowMatchingProperties)` - ) - } - } - } - - function validateProperties(pat: string): void { - gen.forIn("key", data, (key) => { - gen.if(_`${usePattern(cxt, pat)}.test(${key})`, () => { - const alwaysValid = alwaysValidPatterns.includes(pat) - if (!alwaysValid) { - cxt.subschema( - { - keyword: "patternProperties", - schemaProp: pat, - dataProp: key, - dataPropType: Type.Str, - }, - valid - ) - } - - if (it.opts.unevaluated && props !== true) { - gen.assign(_`${props}[${key}]`, true) - } else if (!alwaysValid && !it.allErrors) { - // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) - // or if all properties were evaluated (props === true) - gen.if(not(valid), () => gen.break()) - } - }) - }) - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts b/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts deleted file mode 100644 index 008fb2db1..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import {validateTuple} from "./items" - -const def: CodeKeywordDefinition = { - keyword: "prefixItems", - type: "array", - schemaType: ["array"], - before: "uniqueItems", - code: (cxt) => validateTuple(cxt, "items"), -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/properties.ts b/node_modules/ajv/lib/vocabularies/applicator/properties.ts deleted file mode 100644 index a55b19ce5..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/properties.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import {KeywordCxt} from "../../compile/validate" -import {propertyInData, allSchemaProperties} from "../code" -import {alwaysValidSchema, toHash, mergeEvaluated} from "../../compile/util" -import apDef from "./additionalProperties" - -const def: CodeKeywordDefinition = { - keyword: "properties", - type: "object", - schemaType: "object", - code(cxt: KeywordCxt) { - const {gen, schema, parentSchema, data, it} = cxt - if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) { - apDef.code(new KeywordCxt(it, apDef, "additionalProperties")) - } - const allProps = allSchemaProperties(schema) - for (const prop of allProps) { - it.definedProperties.add(prop) - } - if (it.opts.unevaluated && allProps.length && it.props !== true) { - it.props = mergeEvaluated.props(gen, toHash(allProps), it.props) - } - const properties = allProps.filter((p) => !alwaysValidSchema(it, schema[p])) - if (properties.length === 0) return - const valid = gen.name("valid") - - for (const prop of properties) { - if (hasDefault(prop)) { - applyPropertySchema(prop) - } else { - gen.if(propertyInData(gen, data, prop, it.opts.ownProperties)) - applyPropertySchema(prop) - if (!it.allErrors) gen.else().var(valid, true) - gen.endIf() - } - cxt.it.definedProperties.add(prop) - cxt.ok(valid) - } - - function hasDefault(prop: string): boolean | undefined { - return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined - } - - function applyPropertySchema(prop: string): void { - cxt.subschema( - { - keyword: "properties", - schemaProp: prop, - dataProp: prop, - }, - valid - ) - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts b/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts deleted file mode 100644 index 1c54d6052..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, not} from "../../compile/codegen" -import {alwaysValidSchema} from "../../compile/util" - -export type PropertyNamesError = ErrorObject<"propertyNames", {propertyName: string}, AnySchema> - -const error: KeywordErrorDefinition = { - message: "property name must be valid", - params: ({params}) => _`{propertyName: ${params.propertyName}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "propertyNames", - type: "object", - schemaType: ["object", "boolean"], - error, - code(cxt: KeywordCxt) { - const {gen, schema, data, it} = cxt - if (alwaysValidSchema(it, schema)) return - const valid = gen.name("valid") - - gen.forIn("key", data, (key) => { - cxt.setParams({propertyName: key}) - cxt.subschema( - { - keyword: "propertyNames", - data: key, - dataTypes: ["string"], - propertyName: key, - compositeRule: true, - }, - valid - ) - gen.if(not(valid), () => { - cxt.error(true) - if (!it.allErrors) gen.break() - }) - }) - - cxt.ok(valid) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts b/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts deleted file mode 100644 index 5055182e8..000000000 --- a/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {checkStrictMode} from "../../compile/util" - -const def: CodeKeywordDefinition = { - keyword: ["then", "else"], - schemaType: ["object", "boolean"], - code({keyword, parentSchema, it}: KeywordCxt) { - if (parentSchema.if === undefined) checkStrictMode(it, `"${keyword}" without "if" is ignored`) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/code.ts b/node_modules/ajv/lib/vocabularies/code.ts deleted file mode 100644 index 92cdd5b04..000000000 --- a/node_modules/ajv/lib/vocabularies/code.ts +++ /dev/null @@ -1,168 +0,0 @@ -import type {AnySchema, SchemaMap} from "../types" -import type {SchemaCxt} from "../compile" -import type {KeywordCxt} from "../compile/validate" -import {CodeGen, _, and, or, not, nil, strConcat, getProperty, Code, Name} from "../compile/codegen" -import {alwaysValidSchema, Type} from "../compile/util" -import N from "../compile/names" -import {useFunc} from "../compile/util" -export function checkReportMissingProp(cxt: KeywordCxt, prop: string): void { - const {gen, data, it} = cxt - gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { - cxt.setParams({missingProperty: _`${prop}`}, true) - cxt.error() - }) -} - -export function checkMissingProp( - {gen, data, it: {opts}}: KeywordCxt, - properties: string[], - missing: Name -): Code { - return or( - ...properties.map((prop) => - and(noPropertyInData(gen, data, prop, opts.ownProperties), _`${missing} = ${prop}`) - ) - ) -} - -export function reportMissingProp(cxt: KeywordCxt, missing: Name): void { - cxt.setParams({missingProperty: missing}, true) - cxt.error() -} - -export function hasPropFunc(gen: CodeGen): Name { - return gen.scopeValue("func", { - // eslint-disable-next-line @typescript-eslint/unbound-method - ref: Object.prototype.hasOwnProperty, - code: _`Object.prototype.hasOwnProperty`, - }) -} - -export function isOwnProperty(gen: CodeGen, data: Name, property: Name | string): Code { - return _`${hasPropFunc(gen)}.call(${data}, ${property})` -} - -export function propertyInData( - gen: CodeGen, - data: Name, - property: Name | string, - ownProperties?: boolean -): Code { - const cond = _`${data}${getProperty(property)} !== undefined` - return ownProperties ? _`${cond} && ${isOwnProperty(gen, data, property)}` : cond -} - -export function noPropertyInData( - gen: CodeGen, - data: Name, - property: Name | string, - ownProperties?: boolean -): Code { - const cond = _`${data}${getProperty(property)} === undefined` - return ownProperties ? or(cond, not(isOwnProperty(gen, data, property))) : cond -} - -export function allSchemaProperties(schemaMap?: SchemaMap): string[] { - return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [] -} - -export function schemaProperties(it: SchemaCxt, schemaMap: SchemaMap): string[] { - return allSchemaProperties(schemaMap).filter( - (p) => !alwaysValidSchema(it, schemaMap[p] as AnySchema) - ) -} - -export function callValidateCode( - {schemaCode, data, it: {gen, topSchemaRef, schemaPath, errorPath}, it}: KeywordCxt, - func: Code, - context: Code, - passSchema?: boolean -): Code { - const dataAndSchema = passSchema ? _`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data - const valCxt: [Name, Code | number][] = [ - [N.instancePath, strConcat(N.instancePath, errorPath)], - [N.parentData, it.parentData], - [N.parentDataProperty, it.parentDataProperty], - [N.rootData, N.rootData], - ] - if (it.opts.dynamicRef) valCxt.push([N.dynamicAnchors, N.dynamicAnchors]) - const args = _`${dataAndSchema}, ${gen.object(...valCxt)}` - return context !== nil ? _`${func}.call(${context}, ${args})` : _`${func}(${args})` -} - -const newRegExp = _`new RegExp` - -export function usePattern({gen, it: {opts}}: KeywordCxt, pattern: string): Name { - const u = opts.unicodeRegExp ? "u" : "" - const {regExp} = opts.code - const rx = regExp(pattern, u) - - return gen.scopeValue("pattern", { - key: rx.toString(), - ref: rx, - code: _`${regExp.code === "new RegExp" ? newRegExp : useFunc(gen, regExp)}(${pattern}, ${u})`, - }) -} - -export function validateArray(cxt: KeywordCxt): Name { - const {gen, data, keyword, it} = cxt - const valid = gen.name("valid") - if (it.allErrors) { - const validArr = gen.let("valid", true) - validateItems(() => gen.assign(validArr, false)) - return validArr - } - gen.var(valid, true) - validateItems(() => gen.break()) - return valid - - function validateItems(notValid: () => void): void { - const len = gen.const("len", _`${data}.length`) - gen.forRange("i", 0, len, (i) => { - cxt.subschema( - { - keyword, - dataProp: i, - dataPropType: Type.Num, - }, - valid - ) - gen.if(not(valid), notValid) - }) - } -} - -export function validateUnion(cxt: KeywordCxt): void { - const {gen, schema, keyword, it} = cxt - /* istanbul ignore if */ - if (!Array.isArray(schema)) throw new Error("ajv implementation error") - const alwaysValid = schema.some((sch: AnySchema) => alwaysValidSchema(it, sch)) - if (alwaysValid && !it.opts.unevaluated) return - - const valid = gen.let("valid", false) - const schValid = gen.name("_valid") - - gen.block(() => - schema.forEach((_sch: AnySchema, i: number) => { - const schCxt = cxt.subschema( - { - keyword, - schemaProp: i, - compositeRule: true, - }, - schValid - ) - gen.assign(valid, _`${valid} || ${schValid}`) - const merged = cxt.mergeValidEvaluated(schCxt, schValid) - // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true) - // or if all properties and items were evaluated (it.props === true && it.items === true) - if (!merged) gen.if(not(valid)) - }) - ) - - cxt.result( - valid, - () => cxt.reset(), - () => cxt.error(true) - ) -} diff --git a/node_modules/ajv/lib/vocabularies/core/id.ts b/node_modules/ajv/lib/vocabularies/core/id.ts deleted file mode 100644 index aa36c4bb2..000000000 --- a/node_modules/ajv/lib/vocabularies/core/id.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" - -const def: CodeKeywordDefinition = { - keyword: "id", - code() { - throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID') - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/core/index.ts b/node_modules/ajv/lib/vocabularies/core/index.ts deleted file mode 100644 index e63e2895d..000000000 --- a/node_modules/ajv/lib/vocabularies/core/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type {Vocabulary} from "../../types" -import idKeyword from "./id" -import refKeyword from "./ref" - -const core: Vocabulary = [ - "$schema", - "$id", - "$defs", - "$vocabulary", - {keyword: "$comment"}, - "definitions", - idKeyword, - refKeyword, -] - -export default core diff --git a/node_modules/ajv/lib/vocabularies/core/ref.ts b/node_modules/ajv/lib/vocabularies/core/ref.ts deleted file mode 100644 index 5d59fbcb2..000000000 --- a/node_modules/ajv/lib/vocabularies/core/ref.ts +++ /dev/null @@ -1,129 +0,0 @@ -import type {CodeKeywordDefinition, AnySchema} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import MissingRefError from "../../compile/ref_error" -import {callValidateCode} from "../code" -import {_, nil, stringify, Code, Name} from "../../compile/codegen" -import N from "../../compile/names" -import {SchemaEnv, resolveRef} from "../../compile" -import {mergeEvaluated} from "../../compile/util" - -const def: CodeKeywordDefinition = { - keyword: "$ref", - schemaType: "string", - code(cxt: KeywordCxt): void { - const {gen, schema: $ref, it} = cxt - const {baseId, schemaEnv: env, validateName, opts, self} = it - const {root} = env - if (($ref === "#" || $ref === "#/") && baseId === root.baseId) return callRootRef() - const schOrEnv = resolveRef.call(self, root, baseId, $ref) - if (schOrEnv === undefined) throw new MissingRefError(it.opts.uriResolver, baseId, $ref) - if (schOrEnv instanceof SchemaEnv) return callValidate(schOrEnv) - return inlineRefSchema(schOrEnv) - - function callRootRef(): void { - if (env === root) return callRef(cxt, validateName, env, env.$async) - const rootName = gen.scopeValue("root", {ref: root}) - return callRef(cxt, _`${rootName}.validate`, root, root.$async) - } - - function callValidate(sch: SchemaEnv): void { - const v = getValidate(cxt, sch) - callRef(cxt, v, sch, sch.$async) - } - - function inlineRefSchema(sch: AnySchema): void { - const schName = gen.scopeValue( - "schema", - opts.code.source === true ? {ref: sch, code: stringify(sch)} : {ref: sch} - ) - const valid = gen.name("valid") - const schCxt = cxt.subschema( - { - schema: sch, - dataTypes: [], - schemaPath: nil, - topSchemaRef: schName, - errSchemaPath: $ref, - }, - valid - ) - cxt.mergeEvaluated(schCxt) - cxt.ok(valid) - } - }, -} - -export function getValidate(cxt: KeywordCxt, sch: SchemaEnv): Code { - const {gen} = cxt - return sch.validate - ? gen.scopeValue("validate", {ref: sch.validate}) - : _`${gen.scopeValue("wrapper", {ref: sch})}.validate` -} - -export function callRef(cxt: KeywordCxt, v: Code, sch?: SchemaEnv, $async?: boolean): void { - const {gen, it} = cxt - const {allErrors, schemaEnv: env, opts} = it - const passCxt = opts.passContext ? N.this : nil - if ($async) callAsyncRef() - else callSyncRef() - - function callAsyncRef(): void { - if (!env.$async) throw new Error("async schema referenced by sync schema") - const valid = gen.let("valid") - gen.try( - () => { - gen.code(_`await ${callValidateCode(cxt, v, passCxt)}`) - addEvaluatedFrom(v) // TODO will not work with async, it has to be returned with the result - if (!allErrors) gen.assign(valid, true) - }, - (e) => { - gen.if(_`!(${e} instanceof ${it.ValidationError as Name})`, () => gen.throw(e)) - addErrorsFrom(e) - if (!allErrors) gen.assign(valid, false) - } - ) - cxt.ok(valid) - } - - function callSyncRef(): void { - cxt.result( - callValidateCode(cxt, v, passCxt), - () => addEvaluatedFrom(v), - () => addErrorsFrom(v) - ) - } - - function addErrorsFrom(source: Code): void { - const errs = _`${source}.errors` - gen.assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`) // TODO tagged - gen.assign(N.errors, _`${N.vErrors}.length`) - } - - function addEvaluatedFrom(source: Code): void { - if (!it.opts.unevaluated) return - const schEvaluated = sch?.validate?.evaluated - // TODO refactor - if (it.props !== true) { - if (schEvaluated && !schEvaluated.dynamicProps) { - if (schEvaluated.props !== undefined) { - it.props = mergeEvaluated.props(gen, schEvaluated.props, it.props) - } - } else { - const props = gen.var("props", _`${source}.evaluated.props`) - it.props = mergeEvaluated.props(gen, props, it.props, Name) - } - } - if (it.items !== true) { - if (schEvaluated && !schEvaluated.dynamicItems) { - if (schEvaluated.items !== undefined) { - it.items = mergeEvaluated.items(gen, schEvaluated.items, it.items) - } - } else { - const items = gen.var("items", _`${source}.evaluated.items`) - it.items = mergeEvaluated.items(gen, items, it.items, Name) - } - } - } -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/discriminator/index.ts b/node_modules/ajv/lib/vocabularies/discriminator/index.ts deleted file mode 100644 index 98f0f8cfb..000000000 --- a/node_modules/ajv/lib/vocabularies/discriminator/index.ts +++ /dev/null @@ -1,110 +0,0 @@ -import type {CodeKeywordDefinition, AnySchemaObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, getProperty, Name} from "../../compile/codegen" -import {DiscrError, DiscrErrorObj} from "../discriminator/types" -import {resolveRef, SchemaEnv} from "../../compile" -import {schemaHasRulesButRef} from "../../compile/util" - -export type DiscriminatorError = DiscrErrorObj | DiscrErrorObj - -const error: KeywordErrorDefinition = { - message: ({params: {discrError, tagName}}) => - discrError === DiscrError.Tag - ? `tag "${tagName}" must be string` - : `value of tag "${tagName}" must be in oneOf`, - params: ({params: {discrError, tag, tagName}}) => - _`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "discriminator", - type: "object", - schemaType: "object", - error, - code(cxt: KeywordCxt) { - const {gen, data, schema, parentSchema, it} = cxt - const {oneOf} = parentSchema - if (!it.opts.discriminator) { - throw new Error("discriminator: requires discriminator option") - } - const tagName = schema.propertyName - if (typeof tagName != "string") throw new Error("discriminator: requires propertyName") - if (schema.mapping) throw new Error("discriminator: mapping is not supported") - if (!oneOf) throw new Error("discriminator: requires oneOf keyword") - const valid = gen.let("valid", false) - const tag = gen.const("tag", _`${data}${getProperty(tagName)}`) - gen.if( - _`typeof ${tag} == "string"`, - () => validateMapping(), - () => cxt.error(false, {discrError: DiscrError.Tag, tag, tagName}) - ) - cxt.ok(valid) - - function validateMapping(): void { - const mapping = getMapping() - gen.if(false) - for (const tagValue in mapping) { - gen.elseIf(_`${tag} === ${tagValue}`) - gen.assign(valid, applyTagSchema(mapping[tagValue])) - } - gen.else() - cxt.error(false, {discrError: DiscrError.Mapping, tag, tagName}) - gen.endIf() - } - - function applyTagSchema(schemaProp?: number): Name { - const _valid = gen.name("valid") - const schCxt = cxt.subschema({keyword: "oneOf", schemaProp}, _valid) - cxt.mergeEvaluated(schCxt, Name) - return _valid - } - - function getMapping(): {[T in string]?: number} { - const oneOfMapping: {[T in string]?: number} = {} - const topRequired = hasRequired(parentSchema) - let tagRequired = true - for (let i = 0; i < oneOf.length; i++) { - let sch = oneOf[i] - if (sch?.$ref && !schemaHasRulesButRef(sch, it.self.RULES)) { - sch = resolveRef.call(it.self, it.schemaEnv.root, it.baseId, sch?.$ref) - if (sch instanceof SchemaEnv) sch = sch.schema - } - const propSch = sch?.properties?.[tagName] - if (typeof propSch != "object") { - throw new Error( - `discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"` - ) - } - tagRequired = tagRequired && (topRequired || hasRequired(sch)) - addMappings(propSch, i) - } - if (!tagRequired) throw new Error(`discriminator: "${tagName}" must be required`) - return oneOfMapping - - function hasRequired({required}: AnySchemaObject): boolean { - return Array.isArray(required) && required.includes(tagName) - } - - function addMappings(sch: AnySchemaObject, i: number): void { - if (sch.const) { - addMapping(sch.const, i) - } else if (sch.enum) { - for (const tagValue of sch.enum) { - addMapping(tagValue, i) - } - } else { - throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`) - } - } - - function addMapping(tagValue: unknown, i: number): void { - if (typeof tagValue != "string" || tagValue in oneOfMapping) { - throw new Error(`discriminator: "${tagName}" values must be unique strings`) - } - oneOfMapping[tagValue] = i - } - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/discriminator/types.ts b/node_modules/ajv/lib/vocabularies/discriminator/types.ts deleted file mode 100644 index bee5a2785..000000000 --- a/node_modules/ajv/lib/vocabularies/discriminator/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type {ErrorObject} from "../../types" - -export enum DiscrError { - Tag = "tag", - Mapping = "mapping", -} - -export type DiscrErrorObj = ErrorObject< - "discriminator", - {error: E; tag: string; tagValue: unknown}, - string -> diff --git a/node_modules/ajv/lib/vocabularies/draft2020.ts b/node_modules/ajv/lib/vocabularies/draft2020.ts deleted file mode 100644 index 47fbf0ee6..000000000 --- a/node_modules/ajv/lib/vocabularies/draft2020.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type {Vocabulary} from "../types" -import coreVocabulary from "./core" -import validationVocabulary from "./validation" -import getApplicatorVocabulary from "./applicator" -import dynamicVocabulary from "./dynamic" -import nextVocabulary from "./next" -import unevaluatedVocabulary from "./unevaluated" -import formatVocabulary from "./format" -import {metadataVocabulary, contentVocabulary} from "./metadata" - -const draft2020Vocabularies: Vocabulary[] = [ - dynamicVocabulary, - coreVocabulary, - validationVocabulary, - getApplicatorVocabulary(true), - formatVocabulary, - metadataVocabulary, - contentVocabulary, - nextVocabulary, - unevaluatedVocabulary, -] - -export default draft2020Vocabularies diff --git a/node_modules/ajv/lib/vocabularies/draft7.ts b/node_modules/ajv/lib/vocabularies/draft7.ts deleted file mode 100644 index 226a644aa..000000000 --- a/node_modules/ajv/lib/vocabularies/draft7.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type {Vocabulary} from "../types" -import coreVocabulary from "./core" -import validationVocabulary from "./validation" -import getApplicatorVocabulary from "./applicator" -import formatVocabulary from "./format" -import {metadataVocabulary, contentVocabulary} from "./metadata" - -const draft7Vocabularies: Vocabulary[] = [ - coreVocabulary, - validationVocabulary, - getApplicatorVocabulary(), - formatVocabulary, - metadataVocabulary, - contentVocabulary, -] - -export default draft7Vocabularies diff --git a/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts b/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts deleted file mode 100644 index ca1adb912..000000000 --- a/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, getProperty, Code} from "../../compile/codegen" -import N from "../../compile/names" -import {SchemaEnv, compileSchema} from "../../compile" -import {getValidate} from "../core/ref" - -const def: CodeKeywordDefinition = { - keyword: "$dynamicAnchor", - schemaType: "string", - code: (cxt) => dynamicAnchor(cxt, cxt.schema), -} - -export function dynamicAnchor(cxt: KeywordCxt, anchor: string): void { - const {gen, it} = cxt - it.schemaEnv.root.dynamicAnchors[anchor] = true - const v = _`${N.dynamicAnchors}${getProperty(anchor)}` - const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt) - gen.if(_`!${v}`, () => gen.assign(v, validate)) -} - -function _getValidate(cxt: KeywordCxt): Code { - const {schemaEnv, schema, self} = cxt.it - const {root, baseId, localRefs, meta} = schemaEnv.root - const {schemaId} = self.opts - const sch = new SchemaEnv({schema, schemaId, root, baseId, localRefs, meta}) - compileSchema.call(self, sch) - return getValidate(cxt, sch) -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts b/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts deleted file mode 100644 index 6a573f330..000000000 --- a/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, getProperty, Code, Name} from "../../compile/codegen" -import N from "../../compile/names" -import {callRef} from "../core/ref" - -const def: CodeKeywordDefinition = { - keyword: "$dynamicRef", - schemaType: "string", - code: (cxt) => dynamicRef(cxt, cxt.schema), -} - -export function dynamicRef(cxt: KeywordCxt, ref: string): void { - const {gen, keyword, it} = cxt - if (ref[0] !== "#") throw new Error(`"${keyword}" only supports hash fragment reference`) - const anchor = ref.slice(1) - if (it.allErrors) { - _dynamicRef() - } else { - const valid = gen.let("valid", false) - _dynamicRef(valid) - cxt.ok(valid) - } - - function _dynamicRef(valid?: Name): void { - // TODO the assumption here is that `recursiveRef: #` always points to the root - // of the schema object, which is not correct, because there may be $id that - // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor. - // Because of that 2 tests in recursiveRef.json fail. - // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`). - // (This problem is not tested in JSON-Schema-Test-Suite) - if (it.schemaEnv.root.dynamicAnchors[anchor]) { - const v = gen.let("_v", _`${N.dynamicAnchors}${getProperty(anchor)}`) - gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid)) - } else { - _callRef(it.validateName, valid)() - } - } - - function _callRef(validate: Code, valid?: Name): () => void { - return valid - ? () => - gen.block(() => { - callRef(cxt, validate) - gen.let(valid, true) - }) - : () => callRef(cxt, validate) - } -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/dynamic/index.ts b/node_modules/ajv/lib/vocabularies/dynamic/index.ts deleted file mode 100644 index 6d521db66..000000000 --- a/node_modules/ajv/lib/vocabularies/dynamic/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type {Vocabulary} from "../../types" -import dynamicAnchor from "./dynamicAnchor" -import dynamicRef from "./dynamicRef" -import recursiveAnchor from "./recursiveAnchor" -import recursiveRef from "./recursiveRef" - -const dynamic: Vocabulary = [dynamicAnchor, dynamicRef, recursiveAnchor, recursiveRef] - -export default dynamic diff --git a/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts b/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts deleted file mode 100644 index 25f3db96b..000000000 --- a/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import {dynamicAnchor} from "./dynamicAnchor" -import {checkStrictMode} from "../../compile/util" - -const def: CodeKeywordDefinition = { - keyword: "$recursiveAnchor", - schemaType: "boolean", - code(cxt) { - if (cxt.schema) dynamicAnchor(cxt, "") - else checkStrictMode(cxt.it, "$recursiveAnchor: false is ignored") - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts b/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts deleted file mode 100644 index c84af0f05..000000000 --- a/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import {dynamicRef} from "./dynamicRef" - -const def: CodeKeywordDefinition = { - keyword: "$recursiveRef", - schemaType: "string", - code: (cxt) => dynamicRef(cxt, cxt.schema), -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/errors.ts b/node_modules/ajv/lib/vocabularies/errors.ts deleted file mode 100644 index c9ca3f02f..000000000 --- a/node_modules/ajv/lib/vocabularies/errors.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type {TypeError} from "../compile/validate/dataType" -import type {ApplicatorKeywordError} from "./applicator" -import type {ValidationKeywordError} from "./validation" -import type {FormatError} from "./format/format" -import type {UnevaluatedPropertiesError} from "./unevaluated/unevaluatedProperties" -import type {UnevaluatedItemsError} from "./unevaluated/unevaluatedItems" -import type {DependentRequiredError} from "./validation/dependentRequired" -import type {DiscriminatorError} from "./discriminator" - -export type DefinedError = - | TypeError - | ApplicatorKeywordError - | ValidationKeywordError - | FormatError - | UnevaluatedPropertiesError - | UnevaluatedItemsError - | DependentRequiredError - | DiscriminatorError diff --git a/node_modules/ajv/lib/vocabularies/format/format.ts b/node_modules/ajv/lib/vocabularies/format/format.ts deleted file mode 100644 index 4b1c13e76..000000000 --- a/node_modules/ajv/lib/vocabularies/format/format.ts +++ /dev/null @@ -1,120 +0,0 @@ -import type { - AddedFormat, - FormatValidator, - AsyncFormatValidator, - CodeKeywordDefinition, - KeywordErrorDefinition, - ErrorObject, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, nil, or, Code, getProperty, regexpCode} from "../../compile/codegen" - -type FormatValidate = - | FormatValidator - | FormatValidator - | AsyncFormatValidator - | AsyncFormatValidator - | RegExp - | string - | true - -export type FormatError = ErrorObject<"format", {format: string}, string | {$data: string}> - -const error: KeywordErrorDefinition = { - message: ({schemaCode}) => str`must match format "${schemaCode}"`, - params: ({schemaCode}) => _`{format: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "format", - type: ["number", "string"], - schemaType: "string", - $data: true, - error, - code(cxt: KeywordCxt, ruleType?: string) { - const {gen, data, $data, schema, schemaCode, it} = cxt - const {opts, errSchemaPath, schemaEnv, self} = it - if (!opts.validateFormats) return - - if ($data) validate$DataFormat() - else validateFormat() - - function validate$DataFormat(): void { - const fmts = gen.scopeValue("formats", { - ref: self.formats, - code: opts.code.formats, - }) - const fDef = gen.const("fDef", _`${fmts}[${schemaCode}]`) - const fType = gen.let("fType") - const format = gen.let("format") - // TODO simplify - gen.if( - _`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, - () => gen.assign(fType, _`${fDef}.type || "string"`).assign(format, _`${fDef}.validate`), - () => gen.assign(fType, _`"string"`).assign(format, fDef) - ) - cxt.fail$data(or(unknownFmt(), invalidFmt())) - - function unknownFmt(): Code { - if (opts.strictSchema === false) return nil - return _`${schemaCode} && !${format}` - } - - function invalidFmt(): Code { - const callFormat = schemaEnv.$async - ? _`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` - : _`${format}(${data})` - const validData = _`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))` - return _`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}` - } - } - - function validateFormat(): void { - const formatDef: AddedFormat | undefined = self.formats[schema] - if (!formatDef) { - unknownFormat() - return - } - if (formatDef === true) return - const [fmtType, format, fmtRef] = getFormat(formatDef) - if (fmtType === ruleType) cxt.pass(validCondition()) - - function unknownFormat(): void { - if (opts.strictSchema === false) { - self.logger.warn(unknownMsg()) - return - } - throw new Error(unknownMsg()) - - function unknownMsg(): string { - return `unknown format "${schema as string}" ignored in schema at path "${errSchemaPath}"` - } - } - - function getFormat(fmtDef: AddedFormat): [string, FormatValidate, Code] { - const code = - fmtDef instanceof RegExp - ? regexpCode(fmtDef) - : opts.code.formats - ? _`${opts.code.formats}${getProperty(schema)}` - : undefined - const fmt = gen.scopeValue("formats", {key: schema, ref: fmtDef, code}) - if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { - return [fmtDef.type || "string", fmtDef.validate, _`${fmt}.validate`] - } - - return ["string", fmtDef, fmt] - } - - function validCondition(): Code { - if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { - if (!schemaEnv.$async) throw new Error("async format in sync schema") - return _`await ${fmtRef}(${data})` - } - return typeof format == "function" ? _`${fmtRef}(${data})` : _`${fmtRef}.test(${data})` - } - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/format/index.ts b/node_modules/ajv/lib/vocabularies/format/index.ts deleted file mode 100644 index bca2f5b3d..000000000 --- a/node_modules/ajv/lib/vocabularies/format/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type {Vocabulary} from "../../types" -import formatKeyword from "./format" - -const format: Vocabulary = [formatKeyword] - -export default format diff --git a/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts b/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts deleted file mode 100644 index f487c97f8..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +++ /dev/null @@ -1,89 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, not, getProperty, Name} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullableObject} from "./nullable" -import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" -import {DiscrError, DiscrErrorObj} from "../discriminator/types" - -export type JTDDiscriminatorError = - | _JTDTypeError<"discriminator", "object", string> - | DiscrErrorObj - | DiscrErrorObj - -const error: KeywordErrorDefinition = { - message: (cxt) => { - const {schema, params} = cxt - return params.discrError - ? params.discrError === DiscrError.Tag - ? `tag "${schema}" must be string` - : `value of tag "${schema}" must be in mapping` - : typeErrorMessage(cxt, "object") - }, - params: (cxt) => { - const {schema, params} = cxt - return params.discrError - ? _`{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}` - : typeErrorParams(cxt, "object") - }, -} - -const def: CodeKeywordDefinition = { - keyword: "discriminator", - schemaType: "string", - implements: ["mapping"], - error, - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema, parentSchema} = cxt - const [valid, cond] = checkNullableObject(cxt, data) - - gen.if(cond) - validateDiscriminator() - gen.elseIf(not(valid)) - cxt.error() - gen.endIf() - cxt.ok(valid) - - function validateDiscriminator(): void { - const tag = gen.const("tag", _`${data}${getProperty(schema)}`) - gen.if(_`${tag} === undefined`) - cxt.error(false, {discrError: DiscrError.Tag, tag}) - gen.elseIf(_`typeof ${tag} == "string"`) - validateMapping(tag) - gen.else() - cxt.error(false, {discrError: DiscrError.Tag, tag}, {instancePath: schema}) - gen.endIf() - } - - function validateMapping(tag: Name): void { - gen.if(false) - for (const tagValue in parentSchema.mapping) { - gen.elseIf(_`${tag} === ${tagValue}`) - gen.assign(valid, applyTagSchema(tagValue)) - } - gen.else() - cxt.error( - false, - {discrError: DiscrError.Mapping, tag}, - {instancePath: schema, schemaPath: "mapping", parentSchema: true} - ) - gen.endIf() - } - - function applyTagSchema(schemaProp: string): Name { - const _valid = gen.name("valid") - cxt.subschema( - { - keyword: "mapping", - schemaProp, - jtdDiscriminator: schema, - }, - _valid - ) - return _valid - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/elements.ts b/node_modules/ajv/lib/vocabularies/jtd/elements.ts deleted file mode 100644 index 983af7c02..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/elements.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type {CodeKeywordDefinition, SchemaObject} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {alwaysValidSchema} from "../../compile/util" -import {validateArray} from "../code" -import {_, not} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullable} from "./nullable" -import {typeError, _JTDTypeError} from "./error" - -export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject> - -const def: CodeKeywordDefinition = { - keyword: "elements", - schemaType: "object", - error: typeError("array"), - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema, it} = cxt - if (alwaysValidSchema(it, schema)) return - const [valid] = checkNullable(cxt) - gen.if(not(valid), () => - gen.if( - _`Array.isArray(${data})`, - () => gen.assign(valid, validateArray(cxt)), - () => cxt.error() - ) - ) - cxt.ok(valid) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/enum.ts b/node_modules/ajv/lib/vocabularies/jtd/enum.ts deleted file mode 100644 index 75464ff8e..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/enum.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition, ErrorObject} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, or, and, Code} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullable} from "./nullable" - -export type JTDEnumError = ErrorObject<"enum", {allowedValues: string[]}, string[]> - -const error: KeywordErrorDefinition = { - message: "must be equal to one of the allowed values", - params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "enum", - schemaType: "array", - error, - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema, schemaValue, parentSchema, it} = cxt - if (schema.length === 0) throw new Error("enum must have non-empty array") - if (schema.length !== new Set(schema).size) throw new Error("enum items must be unique") - let valid: Code - const isString = _`typeof ${data} == "string"` - if (schema.length >= it.opts.loopEnum) { - let cond: Code - ;[valid, cond] = checkNullable(cxt, isString) - gen.if(cond, loopEnum) - } else { - /* istanbul ignore if */ - if (!Array.isArray(schema)) throw new Error("ajv implementation error") - valid = and(isString, or(...schema.map((value: string) => _`${data} === ${value}`))) - if (parentSchema.nullable) valid = or(_`${data} === null`, valid) - } - cxt.pass(valid) - - function loopEnum(): void { - gen.forOf("v", schemaValue as Code, (v) => - gen.if(_`${valid} = ${data} === ${v}`, () => gen.break()) - ) - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/error.ts b/node_modules/ajv/lib/vocabularies/jtd/error.ts deleted file mode 100644 index 506932258..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/error.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type {KeywordErrorDefinition, KeywordErrorCxt, ErrorObject} from "../../types" -import {_, Code} from "../../compile/codegen" - -export type _JTDTypeError = ErrorObject< - K, - {type: T; nullable: boolean}, - S -> - -export function typeError(t: string): KeywordErrorDefinition { - return { - message: (cxt) => typeErrorMessage(cxt, t), - params: (cxt) => typeErrorParams(cxt, t), - } -} - -export function typeErrorMessage({parentSchema}: KeywordErrorCxt, t: string): string { - return parentSchema?.nullable ? `must be ${t} or null` : `must be ${t}` -} - -export function typeErrorParams({parentSchema}: KeywordErrorCxt, t: string): Code { - return _`{type: ${t}, nullable: ${!!parentSchema?.nullable}}` -} diff --git a/node_modules/ajv/lib/vocabularies/jtd/index.ts b/node_modules/ajv/lib/vocabularies/jtd/index.ts deleted file mode 100644 index f7baebc30..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type {Vocabulary} from "../../types" -import refKeyword from "./ref" -import typeKeyword, {JTDTypeError} from "./type" -import enumKeyword, {JTDEnumError} from "./enum" -import elements, {JTDElementsError} from "./elements" -import properties, {JTDPropertiesError} from "./properties" -import optionalProperties from "./optionalProperties" -import discriminator, {JTDDiscriminatorError} from "./discriminator" -import values, {JTDValuesError} from "./values" -import union from "./union" -import metadata from "./metadata" - -const jtdVocabulary: Vocabulary = [ - "definitions", - refKeyword, - typeKeyword, - enumKeyword, - elements, - properties, - optionalProperties, - discriminator, - values, - union, - metadata, - {keyword: "additionalProperties", schemaType: "boolean"}, - {keyword: "nullable", schemaType: "boolean"}, -] - -export default jtdVocabulary - -export type JTDErrorObject = - | JTDTypeError - | JTDEnumError - | JTDElementsError - | JTDPropertiesError - | JTDDiscriminatorError - | JTDValuesError diff --git a/node_modules/ajv/lib/vocabularies/jtd/metadata.ts b/node_modules/ajv/lib/vocabularies/jtd/metadata.ts deleted file mode 100644 index 19eeb8c7d..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {KeywordCxt} from "../../ajv" -import type {CodeKeywordDefinition} from "../../types" -import {alwaysValidSchema} from "../../compile/util" - -const def: CodeKeywordDefinition = { - keyword: "metadata", - schemaType: "object", - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, schema, it} = cxt - if (alwaysValidSchema(it, schema)) return - const valid = gen.name("valid") - cxt.subschema({keyword: "metadata", jtdMetadata: true}, valid) - cxt.ok(valid) - }, -} - -export function checkMetadata({it, keyword}: KeywordCxt, metadata?: boolean): void { - if (it.jtdMetadata !== metadata) { - throw new Error(`JTD: "${keyword}" cannot be used in this schema location`) - } -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/nullable.ts b/node_modules/ajv/lib/vocabularies/jtd/nullable.ts deleted file mode 100644 index c74b05da7..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type {KeywordCxt} from "../../compile/validate" -import {_, not, nil, Code, Name} from "../../compile/codegen" - -export function checkNullable( - {gen, data, parentSchema}: KeywordCxt, - cond: Code = nil -): [Name, Code] { - const valid = gen.name("valid") - if (parentSchema.nullable) { - gen.let(valid, _`${data} === null`) - cond = not(valid) - } else { - gen.let(valid, false) - } - return [valid, cond] -} - -export function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code] { - const [valid, cond_] = checkNullable(cxt, cond) - return [valid, _`${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`] -} diff --git a/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts b/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts deleted file mode 100644 index 8e91c8d91..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {validateProperties, error} from "./properties" - -const def: CodeKeywordDefinition = { - keyword: "optionalProperties", - schemaType: "object", - error, - code(cxt: KeywordCxt) { - if (cxt.parentSchema.properties) return - validateProperties(cxt) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/properties.ts b/node_modules/ajv/lib/vocabularies/jtd/properties.ts deleted file mode 100644 index 9dd24c5cd..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/properties.ts +++ /dev/null @@ -1,184 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - SchemaObject, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {propertyInData, allSchemaProperties, isOwnProperty} from "../code" -import {alwaysValidSchema, schemaRefOrVal} from "../../compile/util" -import {_, and, not, Code, Name} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullableObject} from "./nullable" -import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" - -enum PropError { - Additional = "additional", - Missing = "missing", -} - -type PropKeyword = "properties" | "optionalProperties" - -type PropSchema = {[P in string]?: SchemaObject} - -export type JTDPropertiesError = - | _JTDTypeError - | ErrorObject - | ErrorObject - -export const error: KeywordErrorDefinition = { - message: (cxt) => { - const {params} = cxt - return params.propError - ? params.propError === PropError.Additional - ? "must NOT have additional properties" - : `must have property '${params.missingProperty}'` - : typeErrorMessage(cxt, "object") - }, - params: (cxt) => { - const {params} = cxt - return params.propError - ? params.propError === PropError.Additional - ? _`{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}` - : _`{error: ${params.propError}, missingProperty: ${params.missingProperty}}` - : typeErrorParams(cxt, "object") - }, -} - -const def: CodeKeywordDefinition = { - keyword: "properties", - schemaType: "object", - error, - code: validateProperties, -} - -// const error: KeywordErrorDefinition = { -// message: "should NOT have additional properties", -// params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, -// } - -export function validateProperties(cxt: KeywordCxt): void { - checkMetadata(cxt) - const {gen, data, parentSchema, it} = cxt - const {additionalProperties, nullable} = parentSchema - if (it.jtdDiscriminator && nullable) throw new Error("JTD: nullable inside discriminator mapping") - if (commonProperties()) { - throw new Error("JTD: properties and optionalProperties have common members") - } - const [allProps, properties] = schemaProperties("properties") - const [allOptProps, optProperties] = schemaProperties("optionalProperties") - if (properties.length === 0 && optProperties.length === 0 && additionalProperties) { - return - } - - const [valid, cond] = - it.jtdDiscriminator === undefined - ? checkNullableObject(cxt, data) - : [gen.let("valid", false), true] - gen.if(cond, () => - gen.assign(valid, true).block(() => { - validateProps(properties, "properties", true) - validateProps(optProperties, "optionalProperties") - if (!additionalProperties) validateAdditional() - }) - ) - cxt.pass(valid) - - function commonProperties(): boolean { - const props = parentSchema.properties as Record | undefined - const optProps = parentSchema.optionalProperties as Record | undefined - if (!(props && optProps)) return false - for (const p in props) { - if (Object.prototype.hasOwnProperty.call(optProps, p)) return true - } - return false - } - - function schemaProperties(keyword: string): [string[], string[]] { - const schema = parentSchema[keyword] - const allPs = schema ? allSchemaProperties(schema) : [] - if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) { - throw new Error(`JTD: discriminator tag used in ${keyword}`) - } - const ps = allPs.filter((p) => !alwaysValidSchema(it, schema[p])) - return [allPs, ps] - } - - function validateProps(props: string[], keyword: string, required?: boolean): void { - const _valid = gen.var("valid") - for (const prop of props) { - gen.if( - propertyInData(gen, data, prop, it.opts.ownProperties), - () => applyPropertySchema(prop, keyword, _valid), - () => missingProperty(prop) - ) - cxt.ok(_valid) - } - - function missingProperty(prop: string): void { - if (required) { - gen.assign(_valid, false) - cxt.error(false, {propError: PropError.Missing, missingProperty: prop}, {schemaPath: prop}) - } else { - gen.assign(_valid, true) - } - } - } - - function applyPropertySchema(prop: string, keyword: string, _valid: Name): void { - cxt.subschema( - { - keyword, - schemaProp: prop, - dataProp: prop, - }, - _valid - ) - } - - function validateAdditional(): void { - gen.forIn("key", data, (key: Name) => { - const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator) - const addOptProp = isAdditional(key, allOptProps, "optionalProperties") - const extra = - addProp === true ? addOptProp : addOptProp === true ? addProp : and(addProp, addOptProp) - gen.if(extra, () => { - if (it.opts.removeAdditional) { - gen.code(_`delete ${data}[${key}]`) - } else { - cxt.error( - false, - {propError: PropError.Additional, additionalProperty: key}, - {instancePath: key, parentSchema: true} - ) - if (!it.opts.allErrors) gen.break() - } - }) - }) - } - - function isAdditional( - key: Name, - props: string[], - keyword: string, - jtdDiscriminator?: string - ): Code | true { - let additional: Code | boolean - if (props.length > 8) { - // TODO maybe an option instead of hard-coded 8? - const propsSchema = schemaRefOrVal(it, parentSchema[keyword], keyword) - additional = not(isOwnProperty(gen, propsSchema as Code, key)) - if (jtdDiscriminator !== undefined) { - additional = and(additional, _`${key} !== ${jtdDiscriminator}`) - } - } else if (props.length || jtdDiscriminator !== undefined) { - const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props) - additional = and(...ps.map((p) => _`${key} !== ${p}`)) - } else { - additional = true - } - return additional - } -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/ref.ts b/node_modules/ajv/lib/vocabularies/jtd/ref.ts deleted file mode 100644 index 97646ee1b..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/ref.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type {CodeKeywordDefinition, AnySchemaObject} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {compileSchema, SchemaEnv} from "../../compile" -import {_, not, nil, stringify} from "../../compile/codegen" -import MissingRefError from "../../compile/ref_error" -import N from "../../compile/names" -import {getValidate, callRef} from "../core/ref" -import {checkMetadata} from "./metadata" - -const def: CodeKeywordDefinition = { - keyword: "ref", - schemaType: "string", - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema: ref, parentSchema, it} = cxt - const { - schemaEnv: {root}, - } = it - const valid = gen.name("valid") - if (parentSchema.nullable) { - gen.var(valid, _`${data} === null`) - gen.if(not(valid), validateJtdRef) - } else { - gen.var(valid, false) - validateJtdRef() - } - cxt.ok(valid) - - function validateJtdRef(): void { - const refSchema = (root.schema as AnySchemaObject).definitions?.[ref] - if (!refSchema) { - throw new MissingRefError(it.opts.uriResolver, "", ref, `No definition ${ref}`) - } - if (hasRef(refSchema) || !it.opts.inlineRefs) callValidate(refSchema) - else inlineRefSchema(refSchema) - } - - function callValidate(schema: AnySchemaObject): void { - const sch = compileSchema.call( - it.self, - new SchemaEnv({schema, root, schemaPath: `/definitions/${ref}`}) - ) - const v = getValidate(cxt, sch) - const errsCount = gen.const("_errs", N.errors) - callRef(cxt, v, sch, sch.$async) - gen.assign(valid, _`${errsCount} === ${N.errors}`) - } - - function inlineRefSchema(schema: AnySchemaObject): void { - const schName = gen.scopeValue( - "schema", - it.opts.code.source === true ? {ref: schema, code: stringify(schema)} : {ref: schema} - ) - cxt.subschema( - { - schema, - dataTypes: [], - schemaPath: nil, - topSchemaRef: schName, - errSchemaPath: `/definitions/${ref}`, - }, - valid - ) - } - }, -} - -export function hasRef(schema: AnySchemaObject): boolean { - for (const key in schema) { - let sch: AnySchemaObject - if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) return true - } - return false -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/type.ts b/node_modules/ajv/lib/vocabularies/jtd/type.ts deleted file mode 100644 index 17274300b..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/type.ts +++ /dev/null @@ -1,75 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, nil, or, Code} from "../../compile/codegen" -import validTimestamp from "../../runtime/timestamp" -import {useFunc} from "../../compile/util" -import {checkMetadata} from "./metadata" -import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" - -export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType> - -export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" - -export const intRange: {[T in IntType]: [number, number, number]} = { - int8: [-128, 127, 3], - uint8: [0, 255, 3], - int16: [-32768, 32767, 5], - uint16: [0, 65535, 5], - int32: [-2147483648, 2147483647, 10], - uint32: [0, 4294967295, 10], -} - -export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType - -const error: KeywordErrorDefinition = { - message: (cxt) => typeErrorMessage(cxt, cxt.schema), - params: (cxt) => typeErrorParams(cxt, cxt.schema), -} - -function timestampCode(cxt: KeywordCxt): Code { - const {gen, data, it} = cxt - const {timestamp, allowDate} = it.opts - if (timestamp === "date") return _`${data} instanceof Date ` - const vts = useFunc(gen, validTimestamp) - const allowDateArg = allowDate ? _`, true` : nil - const validString = _`typeof ${data} == "string" && ${vts}(${data}${allowDateArg})` - return timestamp === "string" ? validString : or(_`${data} instanceof Date`, validString) -} - -const def: CodeKeywordDefinition = { - keyword: "type", - schemaType: "string", - error, - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {data, schema, parentSchema, it} = cxt - let cond: Code - switch (schema) { - case "boolean": - case "string": - cond = _`typeof ${data} == ${schema}` - break - case "timestamp": { - cond = timestampCode(cxt) - break - } - case "float32": - case "float64": - cond = _`typeof ${data} == "number"` - break - default: { - const sch = schema as IntType - cond = _`typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)` - if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) { - if (sch === "uint32") cond = _`${cond} && ${data} >= 0` - } else { - const [min, max] = intRange[sch] - cond = _`${cond} && ${data} >= ${min} && ${data} <= ${max}` - } - } - } - cxt.pass(parentSchema.nullable ? or(_`${data} === null`, cond) : cond) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/union.ts b/node_modules/ajv/lib/vocabularies/jtd/union.ts deleted file mode 100644 index 588f07ab4..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/union.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import {validateUnion} from "../code" - -const def: CodeKeywordDefinition = { - keyword: "union", - schemaType: "array", - trackErrors: true, - code: validateUnion, - error: {message: "must match a schema in union"}, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/jtd/values.ts b/node_modules/ajv/lib/vocabularies/jtd/values.ts deleted file mode 100644 index e64945077..000000000 --- a/node_modules/ajv/lib/vocabularies/jtd/values.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type {CodeKeywordDefinition, SchemaObject} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {alwaysValidSchema, Type} from "../../compile/util" -import {not, or, Name} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullableObject} from "./nullable" -import {typeError, _JTDTypeError} from "./error" - -export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject> - -const def: CodeKeywordDefinition = { - keyword: "values", - schemaType: "object", - error: typeError("object"), - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema, it} = cxt - const [valid, cond] = checkNullableObject(cxt, data) - if (alwaysValidSchema(it, schema)) { - gen.if(not(or(cond, valid)), () => cxt.error()) - } else { - gen.if(cond) - gen.assign(valid, validateMap()) - gen.elseIf(not(valid)) - cxt.error() - gen.endIf() - } - cxt.ok(valid) - - function validateMap(): Name | boolean { - const _valid = gen.name("valid") - if (it.allErrors) { - const validMap = gen.let("valid", true) - validateValues(() => gen.assign(validMap, false)) - return validMap - } - gen.var(_valid, true) - validateValues(() => gen.break()) - return _valid - - function validateValues(notValid: () => void): void { - gen.forIn("key", data, (key) => { - cxt.subschema( - { - keyword: "values", - dataProp: key, - dataPropType: Type.Str, - }, - _valid - ) - gen.if(not(_valid), notValid) - }) - } - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/metadata.ts b/node_modules/ajv/lib/vocabularies/metadata.ts deleted file mode 100644 index b9d5af85f..000000000 --- a/node_modules/ajv/lib/vocabularies/metadata.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type {Vocabulary} from "../types" - -export const metadataVocabulary: Vocabulary = [ - "title", - "description", - "default", - "deprecated", - "readOnly", - "writeOnly", - "examples", -] - -export const contentVocabulary: Vocabulary = [ - "contentMediaType", - "contentEncoding", - "contentSchema", -] diff --git a/node_modules/ajv/lib/vocabularies/next.ts b/node_modules/ajv/lib/vocabularies/next.ts deleted file mode 100644 index 1e987ad21..000000000 --- a/node_modules/ajv/lib/vocabularies/next.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type {Vocabulary} from "../types" -import dependentRequired from "./validation/dependentRequired" -import dependentSchemas from "./applicator/dependentSchemas" -import limitContains from "./validation/limitContains" - -const next: Vocabulary = [dependentRequired, dependentSchemas, limitContains] - -export default next diff --git a/node_modules/ajv/lib/vocabularies/unevaluated/index.ts b/node_modules/ajv/lib/vocabularies/unevaluated/index.ts deleted file mode 100644 index f7f0815db..000000000 --- a/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type {Vocabulary} from "../../types" -import unevaluatedProperties from "./unevaluatedProperties" -import unevaluatedItems from "./unevaluatedItems" - -const unevaluated: Vocabulary = [unevaluatedProperties, unevaluatedItems] - -export default unevaluated diff --git a/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts b/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts deleted file mode 100644 index 50bf0e7c1..000000000 --- a/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, not, Name} from "../../compile/codegen" -import {alwaysValidSchema, Type} from "../../compile/util" - -export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {limit: number}, AnySchema> - -const error: KeywordErrorDefinition = { - message: ({params: {len}}) => str`must NOT have more than ${len} items`, - params: ({params: {len}}) => _`{limit: ${len}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "unevaluatedItems", - type: "array", - schemaType: ["boolean", "object"], - error, - code(cxt: KeywordCxt) { - const {gen, schema, data, it} = cxt - const items = it.items || 0 - if (items === true) return - const len = gen.const("len", _`${data}.length`) - if (schema === false) { - cxt.setParams({len: items}) - cxt.fail(_`${len} > ${items}`) - } else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) { - const valid = gen.var("valid", _`${len} <= ${items}`) - gen.if(not(valid), () => validateItems(valid, items)) - cxt.ok(valid) - } - it.items = true - - function validateItems(valid: Name, from: Name | number): void { - gen.forRange("i", from, len, (i) => { - cxt.subschema({keyword: "unevaluatedItems", dataProp: i, dataPropType: Type.Num}, valid) - if (!it.allErrors) gen.if(not(valid), () => gen.break()) - }) - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts b/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts deleted file mode 100644 index 0e6868fa3..000000000 --- a/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +++ /dev/null @@ -1,85 +0,0 @@ -import type { - CodeKeywordDefinition, - KeywordErrorDefinition, - ErrorObject, - AnySchema, -} from "../../types" -import {_, not, and, Name, Code} from "../../compile/codegen" -import {alwaysValidSchema, Type} from "../../compile/util" -import N from "../../compile/names" - -export type UnevaluatedPropertiesError = ErrorObject< - "unevaluatedProperties", - {unevaluatedProperty: string}, - AnySchema -> - -const error: KeywordErrorDefinition = { - message: "must NOT have unevaluated properties", - params: ({params}) => _`{unevaluatedProperty: ${params.unevaluatedProperty}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "unevaluatedProperties", - type: "object", - schemaType: ["boolean", "object"], - trackErrors: true, - error, - code(cxt) { - const {gen, schema, data, errsCount, it} = cxt - /* istanbul ignore if */ - if (!errsCount) throw new Error("ajv implementation error") - const {allErrors, props} = it - if (props instanceof Name) { - gen.if(_`${props} !== true`, () => - gen.forIn("key", data, (key: Name) => - gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key)) - ) - ) - } else if (props !== true) { - gen.forIn("key", data, (key: Name) => - props === undefined - ? unevaluatedPropCode(key) - : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)) - ) - } - it.props = true - cxt.ok(_`${errsCount} === ${N.errors}`) - - function unevaluatedPropCode(key: Name): void { - if (schema === false) { - cxt.setParams({unevaluatedProperty: key}) - cxt.error() - if (!allErrors) gen.break() - return - } - - if (!alwaysValidSchema(it, schema)) { - const valid = gen.name("valid") - cxt.subschema( - { - keyword: "unevaluatedProperties", - dataProp: key, - dataPropType: Type.Str, - }, - valid - ) - if (!allErrors) gen.if(not(valid), () => gen.break()) - } - } - - function unevaluatedDynamic(evaluatedProps: Name, key: Name): Code { - return _`!${evaluatedProps} || !${evaluatedProps}[${key}]` - } - - function unevaluatedStatic(evaluatedProps: {[K in string]?: true}, key: Name): Code { - const ps: Code[] = [] - for (const p in evaluatedProps) { - if (evaluatedProps[p] === true) ps.push(_`${key} !== ${p}`) - } - return and(...ps) - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/const.ts b/node_modules/ajv/lib/vocabularies/validation/const.ts deleted file mode 100644 index a3b94a5dc..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/const.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_} from "../../compile/codegen" -import {useFunc} from "../../compile/util" -import equal from "../../runtime/equal" - -export type ConstError = ErrorObject<"const", {allowedValue: any}> - -const error: KeywordErrorDefinition = { - message: "must be equal to constant", - params: ({schemaCode}) => _`{allowedValue: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "const", - $data: true, - error, - code(cxt: KeywordCxt) { - const {gen, data, $data, schemaCode, schema} = cxt - if ($data || (schema && typeof schema == "object")) { - cxt.fail$data(_`!${useFunc(gen, equal)}(${data}, ${schemaCode})`) - } else { - cxt.fail(_`${schema} !== ${data}`) - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts b/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts deleted file mode 100644 index 4c616cfa9..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject} from "../../types" -import { - validatePropertyDeps, - error, - DependenciesErrorParams, - PropertyDependencies, -} from "../applicator/dependencies" - -export type DependentRequiredError = ErrorObject< - "dependentRequired", - DependenciesErrorParams, - PropertyDependencies -> - -const def: CodeKeywordDefinition = { - keyword: "dependentRequired", - type: "object", - schemaType: "object", - error, - code: (cxt) => validatePropertyDeps(cxt), -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/enum.ts b/node_modules/ajv/lib/vocabularies/validation/enum.ts deleted file mode 100644 index 76377fb02..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/enum.ts +++ /dev/null @@ -1,54 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, or, Name, Code} from "../../compile/codegen" -import {useFunc} from "../../compile/util" -import equal from "../../runtime/equal" - -export type EnumError = ErrorObject<"enum", {allowedValues: any[]}, any[] | {$data: string}> - -const error: KeywordErrorDefinition = { - message: "must be equal to one of the allowed values", - params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "enum", - schemaType: "array", - $data: true, - error, - code(cxt: KeywordCxt) { - const {gen, data, $data, schema, schemaCode, it} = cxt - if (!$data && schema.length === 0) throw new Error("enum must have non-empty array") - const useLoop = schema.length >= it.opts.loopEnum - let eql: Name | undefined - const getEql = (): Name => (eql ??= useFunc(gen, equal)) - - let valid: Code - if (useLoop || $data) { - valid = gen.let("valid") - cxt.block$data(valid, loopEnum) - } else { - /* istanbul ignore if */ - if (!Array.isArray(schema)) throw new Error("ajv implementation error") - const vSchema = gen.const("vSchema", schemaCode) - valid = or(...schema.map((_x: unknown, i: number) => equalCode(vSchema, i))) - } - cxt.pass(valid) - - function loopEnum(): void { - gen.assign(valid, false) - gen.forOf("v", schemaCode as Code, (v) => - gen.if(_`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()) - ) - } - - function equalCode(vSchema: Name, i: number): Code { - const sch = schema[i] - return typeof sch === "object" && sch !== null - ? _`${getEql()}(${data}, ${vSchema}[${i}])` - : _`${data} === ${sch}` - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/index.ts b/node_modules/ajv/lib/vocabularies/validation/index.ts deleted file mode 100644 index 3531b1962..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type {ErrorObject, Vocabulary} from "../../types" -import limitNumber, {LimitNumberError} from "./limitNumber" -import multipleOf, {MultipleOfError} from "./multipleOf" -import limitLength from "./limitLength" -import pattern, {PatternError} from "./pattern" -import limitProperties from "./limitProperties" -import required, {RequiredError} from "./required" -import limitItems from "./limitItems" -import uniqueItems, {UniqueItemsError} from "./uniqueItems" -import constKeyword, {ConstError} from "./const" -import enumKeyword, {EnumError} from "./enum" - -const validation: Vocabulary = [ - // number - limitNumber, - multipleOf, - // string - limitLength, - pattern, - // object - limitProperties, - required, - // array - limitItems, - uniqueItems, - // any - {keyword: "type", schemaType: ["string", "array"]}, - {keyword: "nullable", schemaType: "boolean"}, - constKeyword, - enumKeyword, -] - -export default validation - -type LimitError = ErrorObject< - "maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", - {limit: number}, - number | {$data: string} -> - -export type ValidationKeywordError = - | LimitError - | LimitNumberError - | MultipleOfError - | PatternError - | RequiredError - | UniqueItemsError - | ConstError - | EnumError diff --git a/node_modules/ajv/lib/vocabularies/validation/limitContains.ts b/node_modules/ajv/lib/vocabularies/validation/limitContains.ts deleted file mode 100644 index 8bb43c1a4..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {checkStrictMode} from "../../compile/util" - -const def: CodeKeywordDefinition = { - keyword: ["maxContains", "minContains"], - type: "array", - schemaType: "number", - code({keyword, parentSchema, it}: KeywordCxt) { - if (parentSchema.contains === undefined) { - checkStrictMode(it, `"${keyword}" without "contains" is ignored`) - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/limitItems.ts b/node_modules/ajv/lib/vocabularies/validation/limitItems.ts deleted file mode 100644 index 566de8588..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, operators} from "../../compile/codegen" - -const error: KeywordErrorDefinition = { - message({keyword, schemaCode}) { - const comp = keyword === "maxItems" ? "more" : "fewer" - return str`must NOT have ${comp} than ${schemaCode} items` - }, - params: ({schemaCode}) => _`{limit: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: ["maxItems", "minItems"], - type: "array", - schemaType: "number", - $data: true, - error, - code(cxt: KeywordCxt) { - const {keyword, data, schemaCode} = cxt - const op = keyword === "maxItems" ? operators.GT : operators.LT - cxt.fail$data(_`${data}.length ${op} ${schemaCode}`) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/limitLength.ts b/node_modules/ajv/lib/vocabularies/validation/limitLength.ts deleted file mode 100644 index f4f947259..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, operators} from "../../compile/codegen" -import {useFunc} from "../../compile/util" -import ucs2length from "../../runtime/ucs2length" - -const error: KeywordErrorDefinition = { - message({keyword, schemaCode}) { - const comp = keyword === "maxLength" ? "more" : "fewer" - return str`must NOT have ${comp} than ${schemaCode} characters` - }, - params: ({schemaCode}) => _`{limit: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: ["maxLength", "minLength"], - type: "string", - schemaType: "number", - $data: true, - error, - code(cxt: KeywordCxt) { - const {keyword, data, schemaCode, it} = cxt - const op = keyword === "maxLength" ? operators.GT : operators.LT - const len = - it.opts.unicode === false ? _`${data}.length` : _`${useFunc(cxt.gen, ucs2length)}(${data})` - cxt.fail$data(_`${len} ${op} ${schemaCode}`) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts b/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts deleted file mode 100644 index 5499202ef..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, operators, Code} from "../../compile/codegen" - -const ops = operators - -type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum" - -type Comparison = "<=" | ">=" | "<" | ">" - -const KWDs: {[K in Kwd]: {okStr: Comparison; ok: Code; fail: Code}} = { - maximum: {okStr: "<=", ok: ops.LTE, fail: ops.GT}, - minimum: {okStr: ">=", ok: ops.GTE, fail: ops.LT}, - exclusiveMaximum: {okStr: "<", ok: ops.LT, fail: ops.GTE}, - exclusiveMinimum: {okStr: ">", ok: ops.GT, fail: ops.LTE}, -} - -export type LimitNumberError = ErrorObject< - Kwd, - {limit: number; comparison: Comparison}, - number | {$data: string} -> - -const error: KeywordErrorDefinition = { - message: ({keyword, schemaCode}) => str`must be ${KWDs[keyword as Kwd].okStr} ${schemaCode}`, - params: ({keyword, schemaCode}) => - _`{comparison: ${KWDs[keyword as Kwd].okStr}, limit: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: Object.keys(KWDs), - type: "number", - schemaType: "number", - $data: true, - error, - code(cxt: KeywordCxt) { - const {keyword, data, schemaCode} = cxt - cxt.fail$data(_`${data} ${KWDs[keyword as Kwd].fail} ${schemaCode} || isNaN(${data})`) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts b/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts deleted file mode 100644 index 07fffa8b3..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, operators} from "../../compile/codegen" - -const error: KeywordErrorDefinition = { - message({keyword, schemaCode}) { - const comp = keyword === "maxProperties" ? "more" : "fewer" - return str`must NOT have ${comp} than ${schemaCode} properties` - }, - params: ({schemaCode}) => _`{limit: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: ["maxProperties", "minProperties"], - type: "object", - schemaType: "number", - $data: true, - error, - code(cxt: KeywordCxt) { - const {keyword, data, schemaCode} = cxt - const op = keyword === "maxProperties" ? operators.GT : operators.LT - cxt.fail$data(_`Object.keys(${data}).length ${op} ${schemaCode}`) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts b/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts deleted file mode 100644 index 1fd79abbd..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str} from "../../compile/codegen" - -export type MultipleOfError = ErrorObject< - "multipleOf", - {multipleOf: number}, - number | {$data: string} -> - -const error: KeywordErrorDefinition = { - message: ({schemaCode}) => str`must be multiple of ${schemaCode}`, - params: ({schemaCode}) => _`{multipleOf: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "multipleOf", - type: "number", - schemaType: "number", - $data: true, - error, - code(cxt: KeywordCxt) { - const {gen, data, schemaCode, it} = cxt - // const bdt = bad$DataType(schemaCode, def.schemaType, $data) - const prec = it.opts.multipleOfPrecision - const res = gen.let("res") - const invalid = prec - ? _`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` - : _`${res} !== parseInt(${res})` - cxt.fail$data(_`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/pattern.ts b/node_modules/ajv/lib/vocabularies/validation/pattern.ts deleted file mode 100644 index 7b27b7d3c..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/pattern.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {usePattern} from "../code" -import {_, str} from "../../compile/codegen" - -export type PatternError = ErrorObject<"pattern", {pattern: string}, string | {$data: string}> - -const error: KeywordErrorDefinition = { - message: ({schemaCode}) => str`must match pattern "${schemaCode}"`, - params: ({schemaCode}) => _`{pattern: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "pattern", - type: "string", - schemaType: "string", - $data: true, - error, - code(cxt: KeywordCxt) { - const {data, $data, schema, schemaCode, it} = cxt - // TODO regexp should be wrapped in try/catchs - const u = it.opts.unicodeRegExp ? "u" : "" - const regExp = $data ? _`(new RegExp(${schemaCode}, ${u}))` : usePattern(cxt, schema) - cxt.fail$data(_`!${regExp}.test(${data})`) - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/required.ts b/node_modules/ajv/lib/vocabularies/validation/required.ts deleted file mode 100644 index fea7367ed..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/required.ts +++ /dev/null @@ -1,98 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import { - checkReportMissingProp, - checkMissingProp, - reportMissingProp, - propertyInData, - noPropertyInData, -} from "../code" -import {_, str, nil, not, Name, Code} from "../../compile/codegen" -import {checkStrictMode} from "../../compile/util" - -export type RequiredError = ErrorObject< - "required", - {missingProperty: string}, - string[] | {$data: string} -> - -const error: KeywordErrorDefinition = { - message: ({params: {missingProperty}}) => str`must have required property '${missingProperty}'`, - params: ({params: {missingProperty}}) => _`{missingProperty: ${missingProperty}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "required", - type: "object", - schemaType: "array", - $data: true, - error, - code(cxt: KeywordCxt) { - const {gen, schema, schemaCode, data, $data, it} = cxt - const {opts} = it - if (!$data && schema.length === 0) return - const useLoop = schema.length >= opts.loopRequired - if (it.allErrors) allErrorsMode() - else exitOnErrorMode() - - if (opts.strictRequired) { - const props = cxt.parentSchema.properties - const {definedProperties} = cxt.it - for (const requiredKey of schema) { - if (props?.[requiredKey] === undefined && !definedProperties.has(requiredKey)) { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath - const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)` - checkStrictMode(it, msg, it.opts.strictRequired) - } - } - } - - function allErrorsMode(): void { - if (useLoop || $data) { - cxt.block$data(nil, loopAllRequired) - } else { - for (const prop of schema) { - checkReportMissingProp(cxt, prop) - } - } - } - - function exitOnErrorMode(): void { - const missing = gen.let("missing") - if (useLoop || $data) { - const valid = gen.let("valid", true) - cxt.block$data(valid, () => loopUntilMissing(missing, valid)) - cxt.ok(valid) - } else { - gen.if(checkMissingProp(cxt, schema, missing)) - reportMissingProp(cxt, missing) - gen.else() - } - } - - function loopAllRequired(): void { - gen.forOf("prop", schemaCode as Code, (prop) => { - cxt.setParams({missingProperty: prop}) - gen.if(noPropertyInData(gen, data, prop, opts.ownProperties), () => cxt.error()) - }) - } - - function loopUntilMissing(missing: Name, valid: Name): void { - cxt.setParams({missingProperty: missing}) - gen.forOf( - missing, - schemaCode as Code, - () => { - gen.assign(valid, propertyInData(gen, data, missing, opts.ownProperties)) - gen.if(not(valid), () => { - cxt.error() - gen.break() - }) - }, - nil - ) - } - }, -} - -export default def diff --git a/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts b/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts deleted file mode 100644 index 765c4d04f..000000000 --- a/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {checkDataTypes, getSchemaTypes, DataType} from "../../compile/validate/dataType" -import {_, str, Name} from "../../compile/codegen" -import {useFunc} from "../../compile/util" -import equal from "../../runtime/equal" - -export type UniqueItemsError = ErrorObject< - "uniqueItems", - {i: number; j: number}, - boolean | {$data: string} -> - -const error: KeywordErrorDefinition = { - message: ({params: {i, j}}) => - str`must NOT have duplicate items (items ## ${j} and ${i} are identical)`, - params: ({params: {i, j}}) => _`{i: ${i}, j: ${j}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "uniqueItems", - type: "array", - schemaType: "boolean", - $data: true, - error, - code(cxt: KeywordCxt) { - const {gen, data, $data, schema, parentSchema, schemaCode, it} = cxt - if (!$data && !schema) return - const valid = gen.let("valid") - const itemTypes = parentSchema.items ? getSchemaTypes(parentSchema.items) : [] - cxt.block$data(valid, validateUniqueItems, _`${schemaCode} === false`) - cxt.ok(valid) - - function validateUniqueItems(): void { - const i = gen.let("i", _`${data}.length`) - const j = gen.let("j") - cxt.setParams({i, j}) - gen.assign(valid, true) - gen.if(_`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)) - } - - function canOptimize(): boolean { - return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array") - } - - function loopN(i: Name, j: Name): void { - const item = gen.name("item") - const wrongType = checkDataTypes(itemTypes, item, it.opts.strictNumbers, DataType.Wrong) - const indices = gen.const("indices", _`{}`) - gen.for(_`;${i}--;`, () => { - gen.let(item, _`${data}[${i}]`) - gen.if(wrongType, _`continue`) - if (itemTypes.length > 1) gen.if(_`typeof ${item} == "string"`, _`${item} += "_"`) - gen - .if(_`typeof ${indices}[${item}] == "number"`, () => { - gen.assign(j, _`${indices}[${item}]`) - cxt.error() - gen.assign(valid, false).break() - }) - .code(_`${indices}[${item}] = ${i}`) - }) - } - - function loopN2(i: Name, j: Name): void { - const eql = useFunc(gen, equal) - const outer = gen.name("outer") - gen.label(outer).for(_`;${i}--;`, () => - gen.for(_`${j} = ${i}; ${j}--;`, () => - gen.if(_`${eql}(${data}[${i}], ${data}[${j}])`, () => { - cxt.error() - gen.assign(valid, false).break(outer) - }) - ) - ) - } - }, -} - -export default def diff --git a/node_modules/ajv/package.json b/node_modules/ajv/package.json deleted file mode 100644 index 61ae2b999..000000000 --- a/node_modules/ajv/package.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "name": "ajv", - "version": "8.12.0", - "description": "Another JSON Schema Validator", - "main": "dist/ajv.js", - "types": "dist/ajv.d.ts", - "files": [ - "lib/", - "dist/", - ".runkit_example.js" - ], - "scripts": { - "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" --ignore-pattern spec/JSON-Schema-Test-Suite", - "prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"", - "prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"", - "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot", - "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec", - "test-debug": "npm run test-spec -- --inspect-brk", - "test-cov": "nyc npm run test-spec", - "rollup": "rm -rf bundle && rollup -c", - "bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019 && node ./scripts/bundle.js 2020 ajv2020 ajv2020 && node ./scripts/bundle.js jtd ajvJTD ajvJTD", - "build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts && rm dist/refs/json-schema-2020-12/index.ts && rm dist/refs/jtd-schema.ts", - "json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests", - "test-karma": "karma start", - "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start", - "test-all": "npm run test-cov && if-node-version 12 npm run test-browser", - "test": "npm run json-tests && npm run prettier:check && npm run eslint && npm link && npm link --legacy-peer-deps ajv && npm run test-cov", - "test-ci": "AJV_FULL_TEST=true npm test", - "prepublish": "npm run build", - "benchmark": "npm i && npm run build && npm link && cd ./benchmark && npm link --legacy-peer-deps ajv && npm i && node ./jtd", - "docs:dev": "./scripts/prepare-site && vuepress dev docs", - "docs:build": "./scripts/prepare-site && vuepress build docs" - }, - "nyc": { - "exclude": [ - "**/spec/**", - "node_modules" - ], - "reporter": [ - "lcov", - "text-summary" - ] - }, - "repository": "ajv-validator/ajv", - "keywords": [ - "JSON", - "schema", - "validator", - "validation", - "jsonschema", - "json-schema", - "json-schema-validator", - "json-schema-validation" - ], - "author": "Evgeny Poberezkin", - "license": "MIT", - "bugs": "https://github.com/ajv-validator/ajv/issues", - "homepage": "https://ajv.js.org", - "runkitExampleFilename": ".runkit_example.js", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "devDependencies": { - "@ajv-validator/config": "^0.3.0", - "@rollup/plugin-commonjs": "^24.0.0", - "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-node-resolve": "^15.0.1", - "@rollup/plugin-typescript": "^10.0.1", - "@types/chai": "^4.2.12", - "@types/mocha": "^10.0.0", - "@types/node": "^18.11.9", - "@types/require-from-string": "^1.2.0", - "@typescript-eslint/eslint-plugin": "^3.8.0", - "@typescript-eslint/parser": "^3.8.0", - "ajv-formats": "^3.0.0-rc.0", - "browserify": "^17.0.0", - "chai": "^4.0.1", - "cross-env": "^7.0.2", - "dayjs": "^1.10.4", - "dayjs-plugin-utc": "^0.1.2", - "eslint": "^7.8.1", - "eslint-config-prettier": "^7.0.0", - "fast-uri": "^2.1.0", - "glob": "^8.0.2", - "husky": "^8.0.2", - "if-node-version": "^1.0.0", - "jimp": "^0.16.1", - "js-beautify": "^1.7.3", - "json-schema-test": "^2.0.0", - "karma": "^6.0.0", - "karma-chrome-launcher": "^3.0.0", - "karma-mocha": "^2.0.0", - "lint-staged": "^13.0.3", - "mocha": "^10.0.0", - "module-from-string": "^3.1.3", - "node-fetch": "^3.0.0", - "nyc": "^15.0.0", - "prettier": "^2.3.1", - "re2": "^1.16.0", - "rollup": "^2.44.0", - "rollup-plugin-terser": "^7.0.2", - "ts-node": "^10.0.0", - "tsify": "^5.0.2", - "typescript": "^4.8.0" - }, - "collective": { - "type": "opencollective", - "url": "https://opencollective.com/ajv" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - }, - "prettier": "@ajv-validator/config/prettierrc.json", - "husky": { - "hooks": { - "pre-commit": "lint-staged && npm test" - } - }, - "lint-staged": { - "*.{json,yaml,js,ts}": "prettier --write" - } -} diff --git a/node_modules/ansi-regex/index.d.ts b/node_modules/ansi-regex/index.d.ts deleted file mode 100644 index 2dbf6af2b..000000000 --- a/node_modules/ansi-regex/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -declare namespace ansiRegex { - interface Options { - /** - Match only the first ANSI escape. - - @default false - */ - onlyFirst: boolean; - } -} - -/** -Regular expression for matching ANSI escape codes. - -@example -``` -import ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] - -'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); -//=> ['\u001B[4m'] - -'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); -//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] -``` -*/ -declare function ansiRegex(options?: ansiRegex.Options): RegExp; - -export = ansiRegex; diff --git a/node_modules/ansi-regex/index.js b/node_modules/ansi-regex/index.js deleted file mode 100644 index 616ff837d..000000000 --- a/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = ({onlyFirst = false} = {}) => { - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, onlyFirst ? undefined : 'g'); -}; diff --git a/node_modules/ansi-regex/license b/node_modules/ansi-regex/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/ansi-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/ansi-regex/package.json b/node_modules/ansi-regex/package.json deleted file mode 100644 index 017f53116..000000000 --- a/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "ansi-regex", - "version": "5.0.1", - "description": "Regular expression for matching ANSI escape codes", - "license": "MIT", - "repository": "chalk/ansi-regex", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "view-supported": "node fixtures/view-codes.js" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.9.0", - "xo": "^0.25.3" - } -} diff --git a/node_modules/ansi-regex/readme.md b/node_modules/ansi-regex/readme.md deleted file mode 100644 index 4d848bc36..000000000 --- a/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,78 +0,0 @@ -# ansi-regex - -> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install ansi-regex -``` - - -## Usage - -```js -const ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] - -'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); -//=> ['\u001B[4m'] - -'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); -//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] -``` - - -## API - -### ansiRegex(options?) - -Returns a regex for matching ANSI escape codes. - -#### options - -Type: `object` - -##### onlyFirst - -Type: `boolean`
-Default: `false` *(Matches any ANSI escape codes in a string)* - -Match only the first ANSI escape. - - -## FAQ - -### Why do you test for codes not in the ECMA 48 standard? - -Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. - -On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js deleted file mode 100644 index 90a871c4d..000000000 --- a/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,165 +0,0 @@ -'use strict'; -const colorConvert = require('color-convert'); - -const wrapAnsi16 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => function () { - const rgb = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - gray: [90, 39], - - // Bright color - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Fix humans - styles.color.grey = styles.color.gray; - - for (const groupName of Object.keys(styles)) { - const group = styles[groupName]; - - for (const styleName of Object.keys(group)) { - const style = group[styleName]; - - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - } - - const ansi2ansi = n => n; - const rgb2rgb = (r, g, b) => [r, g, b]; - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - styles.color.ansi = { - ansi: wrapAnsi16(ansi2ansi, 0) - }; - styles.color.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 0) - }; - styles.color.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 0) - }; - - styles.bgColor.ansi = { - ansi: wrapAnsi16(ansi2ansi, 10) - }; - styles.bgColor.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 10) - }; - styles.bgColor.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 10) - }; - - for (let key of Object.keys(colorConvert)) { - if (typeof colorConvert[key] !== 'object') { - continue; - } - - const suite = colorConvert[key]; - - if (key === 'ansi16') { - key = 'ansi'; - } - - if ('ansi16' in suite) { - styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); - styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); - } - - if ('ansi256' in suite) { - styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); - styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); - } - - if ('rgb' in suite) { - styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); - styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); - } - } - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/ansi-styles/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/ansi-styles/package.json b/node_modules/ansi-styles/package.json deleted file mode 100644 index 65edb48c3..000000000 --- a/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "ansi-styles", - "version": "3.2.1", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": "chalk/ansi-styles", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava", - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" - }, - "files": [ - "index.js" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "color-convert": "^1.9.0" - }, - "devDependencies": { - "ava": "*", - "babel-polyfill": "^6.23.0", - "svg-term-cli": "^2.1.1", - "xo": "*" - }, - "ava": { - "require": "babel-polyfill" - } -} diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md deleted file mode 100644 index 3158e2df5..000000000 --- a/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,147 +0,0 @@ -# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) - -> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal - -You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - - - - -## Install - -``` -$ npm install ansi-styles -``` - - -## Usage - -```js -const style = require('ansi-styles'); - -console.log(`${style.green.open}Hello world!${style.green.close}`); - - -// Color conversion between 16/256/truecolor -// NOTE: If conversion goes to 16 colors or 256 colors, the original color -// may be degraded to fit that color palette. This means terminals -// that do not support 16 million colors will best-match the -// original color. -console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); -console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close); -``` - -## API - -Each style has an `open` and `close` property. - - -## Styles - -### Modifiers - -- `reset` -- `bold` -- `dim` -- `italic` *(Not widely supported)* -- `underline` -- `inverse` -- `hidden` -- `strikethrough` *(Not widely supported)* - -### Colors - -- `black` -- `red` -- `green` -- `yellow` -- `blue` -- `magenta` -- `cyan` -- `white` -- `gray` ("bright black") -- `redBright` -- `greenBright` -- `yellowBright` -- `blueBright` -- `magentaBright` -- `cyanBright` -- `whiteBright` - -### Background colors - -- `bgBlack` -- `bgRed` -- `bgGreen` -- `bgYellow` -- `bgBlue` -- `bgMagenta` -- `bgCyan` -- `bgWhite` -- `bgBlackBright` -- `bgRedBright` -- `bgGreenBright` -- `bgYellowBright` -- `bgBlueBright` -- `bgMagentaBright` -- `bgCyanBright` -- `bgWhiteBright` - - -## Advanced usage - -By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. - -- `style.modifier` -- `style.color` -- `style.bgColor` - -###### Example - -```js -console.log(style.color.green.open); -``` - -Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. - -###### Example - -```js -console.log(style.codes.get(36)); -//=> 39 -``` - - -## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) - -`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. - -To use these, call the associated conversion function with the intended output, for example: - -```js -style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code -style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code - -style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code -style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code - -style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code -style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code -``` - - -## Related - -- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/node_modules/argparse/CHANGELOG.md b/node_modules/argparse/CHANGELOG.md deleted file mode 100644 index dc39ed695..000000000 --- a/node_modules/argparse/CHANGELOG.md +++ /dev/null @@ -1,216 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - - -## [2.0.1] - 2020-08-29 -### Fixed -- Fix issue with `process.argv` when used with interpreters (`coffee`, `ts-node`, etc.), #150. - - -## [2.0.0] - 2020-08-14 -### Changed -- Full rewrite. Now port from python 3.9.0 & more precise following. - See [doc](./doc) for difference and migration info. -- node.js 10+ required -- Removed most of local docs in favour of original ones. - - -## [1.0.10] - 2018-02-15 -### Fixed -- Use .concat instead of + for arrays, #122. - - -## [1.0.9] - 2016-09-29 -### Changed -- Rerelease after 1.0.8 - deps cleanup. - - -## [1.0.8] - 2016-09-29 -### Changed -- Maintenance (deps bump, fix node 6.5+ tests, coverage report). - - -## [1.0.7] - 2016-03-17 -### Changed -- Teach `addArgument` to accept string arg names. #97, @tomxtobin. - - -## [1.0.6] - 2016-02-06 -### Changed -- Maintenance: moved to eslint & updated CS. - - -## [1.0.5] - 2016-02-05 -### Changed -- Removed lodash dependency to significantly reduce install size. - Thanks to @mourner. - - -## [1.0.4] - 2016-01-17 -### Changed -- Maintenance: lodash update to 4.0.0. - - -## [1.0.3] - 2015-10-27 -### Fixed -- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple. - - -## [1.0.2] - 2015-03-22 -### Changed -- Relaxed lodash version dependency. - - -## [1.0.1] - 2015-02-20 -### Changed -- Changed dependencies to be compatible with ancient nodejs. - - -## [1.0.0] - 2015-02-19 -### Changed -- Maintenance release. -- Replaced `underscore` with `lodash`. -- Bumped version to 1.0.0 to better reflect semver meaning. -- HISTORY.md -> CHANGELOG.md - - -## [0.1.16] - 2013-12-01 -### Changed -- Maintenance release. Updated dependencies and docs. - - -## [0.1.15] - 2013-05-13 -### Fixed -- Fixed #55, @trebor89 - - -## [0.1.14] - 2013-05-12 -### Fixed -- Fixed #62, @maxtaco - - -## [0.1.13] - 2013-04-08 -### Changed -- Added `.npmignore` to reduce package size - - -## [0.1.12] - 2013-02-10 -### Fixed -- Fixed conflictHandler (#46), @hpaulj - - -## [0.1.11] - 2013-02-07 -### Added -- Added 70+ tests (ported from python), @hpaulj -- Added conflictHandler, @applepicke -- Added fromfilePrefixChar, @hpaulj - -### Fixed -- Multiple bugfixes, @hpaulj - - -## [0.1.10] - 2012-12-30 -### Added -- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion) - support, thanks to @hpaulj - -### Fixed -- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj - - -## [0.1.9] - 2012-12-27 -### Fixed -- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj -- Fixed default value behavior with `*` positionals, thanks to @hpaulj -- Improve `getDefault()` behavior, thanks to @hpaulj -- Improve negative argument parsing, thanks to @hpaulj - - -## [0.1.8] - 2012-12-01 -### Fixed -- Fixed parser parents (issue #19), thanks to @hpaulj -- Fixed negative argument parse (issue #20), thanks to @hpaulj - - -## [0.1.7] - 2012-10-14 -### Fixed -- Fixed 'choices' argument parse (issue #16) -- Fixed stderr output (issue #15) - - -## [0.1.6] - 2012-09-09 -### Fixed -- Fixed check for conflict of options (thanks to @tomxtobin) - - -## [0.1.5] - 2012-09-03 -### Fixed -- Fix parser #setDefaults method (thanks to @tomxtobin) - - -## [0.1.4] - 2012-07-30 -### Fixed -- Fixed pseudo-argument support (thanks to @CGamesPlay) -- Fixed addHelp default (should be true), if not set (thanks to @benblank) - - -## [0.1.3] - 2012-06-27 -### Fixed -- Fixed formatter api name: Formatter -> HelpFormatter - - -## [0.1.2] - 2012-05-29 -### Fixed -- Removed excess whitespace in help -- Fixed error reporting, when parcer with subcommands - called with empty arguments - -### Added -- Added basic tests - - -## [0.1.1] - 2012-05-23 -### Fixed -- Fixed line wrapping in help formatter -- Added better error reporting on invalid arguments - - -## [0.1.0] - 2012-05-16 -### Added -- First release. - - -[2.0.1]: https://github.com/nodeca/argparse/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/nodeca/argparse/compare/1.0.10...2.0.0 -[1.0.10]: https://github.com/nodeca/argparse/compare/1.0.9...1.0.10 -[1.0.9]: https://github.com/nodeca/argparse/compare/1.0.8...1.0.9 -[1.0.8]: https://github.com/nodeca/argparse/compare/1.0.7...1.0.8 -[1.0.7]: https://github.com/nodeca/argparse/compare/1.0.6...1.0.7 -[1.0.6]: https://github.com/nodeca/argparse/compare/1.0.5...1.0.6 -[1.0.5]: https://github.com/nodeca/argparse/compare/1.0.4...1.0.5 -[1.0.4]: https://github.com/nodeca/argparse/compare/1.0.3...1.0.4 -[1.0.3]: https://github.com/nodeca/argparse/compare/1.0.2...1.0.3 -[1.0.2]: https://github.com/nodeca/argparse/compare/1.0.1...1.0.2 -[1.0.1]: https://github.com/nodeca/argparse/compare/1.0.0...1.0.1 -[1.0.0]: https://github.com/nodeca/argparse/compare/0.1.16...1.0.0 -[0.1.16]: https://github.com/nodeca/argparse/compare/0.1.15...0.1.16 -[0.1.15]: https://github.com/nodeca/argparse/compare/0.1.14...0.1.15 -[0.1.14]: https://github.com/nodeca/argparse/compare/0.1.13...0.1.14 -[0.1.13]: https://github.com/nodeca/argparse/compare/0.1.12...0.1.13 -[0.1.12]: https://github.com/nodeca/argparse/compare/0.1.11...0.1.12 -[0.1.11]: https://github.com/nodeca/argparse/compare/0.1.10...0.1.11 -[0.1.10]: https://github.com/nodeca/argparse/compare/0.1.9...0.1.10 -[0.1.9]: https://github.com/nodeca/argparse/compare/0.1.8...0.1.9 -[0.1.8]: https://github.com/nodeca/argparse/compare/0.1.7...0.1.8 -[0.1.7]: https://github.com/nodeca/argparse/compare/0.1.6...0.1.7 -[0.1.6]: https://github.com/nodeca/argparse/compare/0.1.5...0.1.6 -[0.1.5]: https://github.com/nodeca/argparse/compare/0.1.4...0.1.5 -[0.1.4]: https://github.com/nodeca/argparse/compare/0.1.3...0.1.4 -[0.1.3]: https://github.com/nodeca/argparse/compare/0.1.2...0.1.3 -[0.1.2]: https://github.com/nodeca/argparse/compare/0.1.1...0.1.2 -[0.1.1]: https://github.com/nodeca/argparse/compare/0.1.0...0.1.1 -[0.1.0]: https://github.com/nodeca/argparse/releases/tag/0.1.0 diff --git a/node_modules/argparse/LICENSE b/node_modules/argparse/LICENSE deleted file mode 100644 index 66a3ac80d..000000000 --- a/node_modules/argparse/LICENSE +++ /dev/null @@ -1,254 +0,0 @@ -A. HISTORY OF THE SOFTWARE -========================== - -Python was created in the early 1990s by Guido van Rossum at Stichting -Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands -as a successor of a language called ABC. Guido remains Python's -principal author, although it includes many contributions from others. - -In 1995, Guido continued his work on Python at the Corporation for -National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) -in Reston, Virginia where he released several versions of the -software. - -In May 2000, Guido and the Python core development team moved to -BeOpen.com to form the BeOpen PythonLabs team. In October of the same -year, the PythonLabs team moved to Digital Creations, which became -Zope Corporation. In 2001, the Python Software Foundation (PSF, see -https://www.python.org/psf/) was formed, a non-profit organization -created specifically to own Python-related Intellectual Property. -Zope Corporation was a sponsoring member of the PSF. - -All Python releases are Open Source (see http://www.opensource.org for -the Open Source Definition). Historically, most, but not all, Python -releases have also been GPL-compatible; the table below summarizes -the various releases. - - Release Derived Year Owner GPL- - from compatible? (1) - - 0.9.0 thru 1.2 1991-1995 CWI yes - 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes - 1.6 1.5.2 2000 CNRI no - 2.0 1.6 2000 BeOpen.com no - 1.6.1 1.6 2001 CNRI yes (2) - 2.1 2.0+1.6.1 2001 PSF no - 2.0.1 2.0+1.6.1 2001 PSF yes - 2.1.1 2.1+2.0.1 2001 PSF yes - 2.1.2 2.1.1 2002 PSF yes - 2.1.3 2.1.2 2002 PSF yes - 2.2 and above 2.1.1 2001-now PSF yes - -Footnotes: - -(1) GPL-compatible doesn't mean that we're distributing Python under - the GPL. All Python licenses, unlike the GPL, let you distribute - a modified version without making your changes open source. The - GPL-compatible licenses make it possible to combine Python with - other software that is released under the GPL; the others don't. - -(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, - because its license has a choice of law clause. According to - CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 - is "not incompatible" with the GPL. - -Thanks to the many outside volunteers who have worked under Guido's -direction to make these releases possible. - - -B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON -=============================================================== - -PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 --------------------------------------------- - -1. This LICENSE AGREEMENT is between the Python Software Foundation -("PSF"), and the Individual or Organization ("Licensee") accessing and -otherwise using this software ("Python") in source or binary form and -its associated documentation. - -2. Subject to the terms and conditions of this License Agreement, PSF hereby -grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, -analyze, test, perform and/or display publicly, prepare derivative works, -distribute, and otherwise use Python alone or in any derivative version, -provided, however, that PSF's License Agreement and PSF's notice of copyright, -i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation; -All Rights Reserved" are retained in Python alone or in any derivative version -prepared by Licensee. - -3. In the event Licensee prepares a derivative work that is based on -or incorporates Python or any part thereof, and wants to make -the derivative work available to others as provided herein, then -Licensee hereby agrees to include in any such work a brief summary of -the changes made to Python. - -4. PSF is making Python available to Licensee on an "AS IS" -basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON -FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS -A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, -OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -6. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -7. Nothing in this License Agreement shall be deemed to create any -relationship of agency, partnership, or joint venture between PSF and -Licensee. This License Agreement does not grant permission to use PSF -trademarks or trade name in a trademark sense to endorse or promote -products or services of Licensee, or any third party. - -8. By copying, installing or otherwise using Python, Licensee -agrees to be bound by the terms and conditions of this License -Agreement. - - -BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 -------------------------------------------- - -BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 - -1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an -office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the -Individual or Organization ("Licensee") accessing and otherwise using -this software in source or binary form and its associated -documentation ("the Software"). - -2. Subject to the terms and conditions of this BeOpen Python License -Agreement, BeOpen hereby grants Licensee a non-exclusive, -royalty-free, world-wide license to reproduce, analyze, test, perform -and/or display publicly, prepare derivative works, distribute, and -otherwise use the Software alone or in any derivative version, -provided, however, that the BeOpen Python License is retained in the -Software, alone or in any derivative version prepared by Licensee. - -3. BeOpen is making the Software available to Licensee on an "AS IS" -basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE -SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS -AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY -DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -5. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -6. This License Agreement shall be governed by and interpreted in all -respects by the law of the State of California, excluding conflict of -law provisions. Nothing in this License Agreement shall be deemed to -create any relationship of agency, partnership, or joint venture -between BeOpen and Licensee. This License Agreement does not grant -permission to use BeOpen trademarks or trade names in a trademark -sense to endorse or promote products or services of Licensee, or any -third party. As an exception, the "BeOpen Python" logos available at -http://www.pythonlabs.com/logos.html may be used according to the -permissions granted on that web page. - -7. By copying, installing or otherwise using the software, Licensee -agrees to be bound by the terms and conditions of this License -Agreement. - - -CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 ---------------------------------------- - -1. This LICENSE AGREEMENT is between the Corporation for National -Research Initiatives, having an office at 1895 Preston White Drive, -Reston, VA 20191 ("CNRI"), and the Individual or Organization -("Licensee") accessing and otherwise using Python 1.6.1 software in -source or binary form and its associated documentation. - -2. Subject to the terms and conditions of this License Agreement, CNRI -hereby grants Licensee a nonexclusive, royalty-free, world-wide -license to reproduce, analyze, test, perform and/or display publicly, -prepare derivative works, distribute, and otherwise use Python 1.6.1 -alone or in any derivative version, provided, however, that CNRI's -License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) -1995-2001 Corporation for National Research Initiatives; All Rights -Reserved" are retained in Python 1.6.1 alone or in any derivative -version prepared by Licensee. Alternately, in lieu of CNRI's License -Agreement, Licensee may substitute the following text (omitting the -quotes): "Python 1.6.1 is made available subject to the terms and -conditions in CNRI's License Agreement. This Agreement together with -Python 1.6.1 may be located on the Internet using the following -unique, persistent identifier (known as a handle): 1895.22/1013. This -Agreement may also be obtained from a proxy server on the Internet -using the following URL: http://hdl.handle.net/1895.22/1013". - -3. In the event Licensee prepares a derivative work that is based on -or incorporates Python 1.6.1 or any part thereof, and wants to make -the derivative work available to others as provided herein, then -Licensee hereby agrees to include in any such work a brief summary of -the changes made to Python 1.6.1. - -4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" -basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON -1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS -A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, -OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -6. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -7. This License Agreement shall be governed by the federal -intellectual property law of the United States, including without -limitation the federal copyright law, and, to the extent such -U.S. federal law does not apply, by the law of the Commonwealth of -Virginia, excluding Virginia's conflict of law provisions. -Notwithstanding the foregoing, with regard to derivative works based -on Python 1.6.1 that incorporate non-separable material that was -previously distributed under the GNU General Public License (GPL), the -law of the Commonwealth of Virginia shall govern this License -Agreement only as to issues arising under or with respect to -Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this -License Agreement shall be deemed to create any relationship of -agency, partnership, or joint venture between CNRI and Licensee. This -License Agreement does not grant permission to use CNRI trademarks or -trade name in a trademark sense to endorse or promote products or -services of Licensee, or any third party. - -8. By clicking on the "ACCEPT" button where indicated, or by copying, -installing or otherwise using Python 1.6.1, Licensee agrees to be -bound by the terms and conditions of this License Agreement. - - ACCEPT - - -CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 --------------------------------------------------- - -Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, -The Netherlands. All rights reserved. - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Stichting Mathematisch -Centrum or CWI not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO -THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE -FOR ANY SPECIAL, 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. diff --git a/node_modules/argparse/README.md b/node_modules/argparse/README.md deleted file mode 100644 index 550b5c9b7..000000000 --- a/node_modules/argparse/README.md +++ /dev/null @@ -1,84 +0,0 @@ -argparse -======== - -[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse) -[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse) - -CLI arguments parser for node.js, with [sub-commands](https://docs.python.org/3.9/library/argparse.html#sub-commands) support. Port of python's [argparse](http://docs.python.org/dev/library/argparse.html) (version [3.9.0](https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py)). - -**Difference with original.** - -- JS has no keyword arguments support. - - Pass options instead: `new ArgumentParser({ description: 'example', add_help: true })`. -- JS has no python's types `int`, `float`, ... - - Use string-typed names: `.add_argument('-b', { type: 'int', help: 'help' })`. -- `%r` format specifier uses `require('util').inspect()`. - -More details in [doc](./doc). - - -Example -------- - -`test.js` file: - -```javascript -#!/usr/bin/env node -'use strict'; - -const { ArgumentParser } = require('argparse'); -const { version } = require('./package.json'); - -const parser = new ArgumentParser({ - description: 'Argparse example' -}); - -parser.add_argument('-v', '--version', { action: 'version', version }); -parser.add_argument('-f', '--foo', { help: 'foo bar' }); -parser.add_argument('-b', '--bar', { help: 'bar foo' }); -parser.add_argument('--baz', { help: 'baz bar' }); - -console.dir(parser.parse_args()); -``` - -Display help: - -``` -$ ./test.js -h -usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ] - -Argparse example - -optional arguments: - -h, --help show this help message and exit - -v, --version show program's version number and exit - -f FOO, --foo FOO foo bar - -b BAR, --bar BAR bar foo - --baz BAZ baz bar -``` - -Parse arguments: - -``` -$ ./test.js -f=3 --bar=4 --baz 5 -{ foo: '3', bar: '4', baz: '5' } -``` - - -API docs --------- - -Since this is a port with minimal divergence, there's no separate documentation. -Use original one instead, with notes about difference. - -1. [Original doc](https://docs.python.org/3.9/library/argparse.html). -2. [Original tutorial](https://docs.python.org/3.9/howto/argparse.html). -3. [Difference with python](./doc). - - -argparse for enterprise ------------------------ - -Available as part of the Tidelift Subscription - -The maintainers of argparse and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-argparse?utm_source=npm-argparse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/argparse/argparse.js b/node_modules/argparse/argparse.js deleted file mode 100644 index 2b8c8c631..000000000 --- a/node_modules/argparse/argparse.js +++ /dev/null @@ -1,3707 +0,0 @@ -// Port of python's argparse module, version 3.9.0: -// https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py - -'use strict' - -// Copyright (C) 2010-2020 Python Software Foundation. -// Copyright (C) 2020 argparse.js authors - -/* - * Command-line parsing library - * - * This module is an optparse-inspired command-line parsing library that: - * - * - handles both optional and positional arguments - * - produces highly informative usage messages - * - supports parsers that dispatch to sub-parsers - * - * The following is a simple usage example that sums integers from the - * command-line and writes the result to a file:: - * - * parser = argparse.ArgumentParser( - * description='sum the integers at the command line') - * parser.add_argument( - * 'integers', metavar='int', nargs='+', type=int, - * help='an integer to be summed') - * parser.add_argument( - * '--log', default=sys.stdout, type=argparse.FileType('w'), - * help='the file where the sum should be written') - * args = parser.parse_args() - * args.log.write('%s' % sum(args.integers)) - * args.log.close() - * - * The module contains the following public classes: - * - * - ArgumentParser -- The main entry point for command-line parsing. As the - * example above shows, the add_argument() method is used to populate - * the parser with actions for optional and positional arguments. Then - * the parse_args() method is invoked to convert the args at the - * command-line into an object with attributes. - * - * - ArgumentError -- The exception raised by ArgumentParser objects when - * there are errors with the parser's actions. Errors raised while - * parsing the command-line are caught by ArgumentParser and emitted - * as command-line messages. - * - * - FileType -- A factory for defining types of files to be created. As the - * example above shows, instances of FileType are typically passed as - * the type= argument of add_argument() calls. - * - * - Action -- The base class for parser actions. Typically actions are - * selected by passing strings like 'store_true' or 'append_const' to - * the action= argument of add_argument(). However, for greater - * customization of ArgumentParser actions, subclasses of Action may - * be defined and passed as the action= argument. - * - * - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter, - * ArgumentDefaultsHelpFormatter -- Formatter classes which - * may be passed as the formatter_class= argument to the - * ArgumentParser constructor. HelpFormatter is the default, - * RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser - * not to change the formatting for help text, and - * ArgumentDefaultsHelpFormatter adds information about argument defaults - * to the help. - * - * All other classes in this module are considered implementation details. - * (Also note that HelpFormatter and RawDescriptionHelpFormatter are only - * considered public as object names -- the API of the formatter objects is - * still considered an implementation detail.) - */ - -const SUPPRESS = '==SUPPRESS==' - -const OPTIONAL = '?' -const ZERO_OR_MORE = '*' -const ONE_OR_MORE = '+' -const PARSER = 'A...' -const REMAINDER = '...' -const _UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args' - - -// ================================== -// Utility functions used for porting -// ================================== -const assert = require('assert') -const util = require('util') -const fs = require('fs') -const sub = require('./lib/sub') -const path = require('path') -const repr = util.inspect - -function get_argv() { - // omit first argument (which is assumed to be interpreter - `node`, `coffee`, `ts-node`, etc.) - return process.argv.slice(1) -} - -function get_terminal_size() { - return { - columns: +process.env.COLUMNS || process.stdout.columns || 80 - } -} - -function hasattr(object, name) { - return Object.prototype.hasOwnProperty.call(object, name) -} - -function getattr(object, name, value) { - return hasattr(object, name) ? object[name] : value -} - -function setattr(object, name, value) { - object[name] = value -} - -function setdefault(object, name, value) { - if (!hasattr(object, name)) object[name] = value - return object[name] -} - -function delattr(object, name) { - delete object[name] -} - -function range(from, to, step=1) { - // range(10) is equivalent to range(0, 10) - if (arguments.length === 1) [ to, from ] = [ from, 0 ] - if (typeof from !== 'number' || typeof to !== 'number' || typeof step !== 'number') { - throw new TypeError('argument cannot be interpreted as an integer') - } - if (step === 0) throw new TypeError('range() arg 3 must not be zero') - - let result = [] - if (step > 0) { - for (let i = from; i < to; i += step) result.push(i) - } else { - for (let i = from; i > to; i += step) result.push(i) - } - return result -} - -function splitlines(str, keepends = false) { - let result - if (!keepends) { - result = str.split(/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/) - } else { - result = [] - let parts = str.split(/(\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029])/) - for (let i = 0; i < parts.length; i += 2) { - result.push(parts[i] + (i + 1 < parts.length ? parts[i + 1] : '')) - } - } - if (!result[result.length - 1]) result.pop() - return result -} - -function _string_lstrip(string, prefix_chars) { - let idx = 0 - while (idx < string.length && prefix_chars.includes(string[idx])) idx++ - return idx ? string.slice(idx) : string -} - -function _string_split(string, sep, maxsplit) { - let result = string.split(sep) - if (result.length > maxsplit) { - result = result.slice(0, maxsplit).concat([ result.slice(maxsplit).join(sep) ]) - } - return result -} - -function _array_equal(array1, array2) { - if (array1.length !== array2.length) return false - for (let i = 0; i < array1.length; i++) { - if (array1[i] !== array2[i]) return false - } - return true -} - -function _array_remove(array, item) { - let idx = array.indexOf(item) - if (idx === -1) throw new TypeError(sub('%r not in list', item)) - array.splice(idx, 1) -} - -// normalize choices to array; -// this isn't required in python because `in` and `map` operators work with anything, -// but in js dealing with multiple types here is too clunky -function _choices_to_array(choices) { - if (choices === undefined) { - return [] - } else if (Array.isArray(choices)) { - return choices - } else if (choices !== null && typeof choices[Symbol.iterator] === 'function') { - return Array.from(choices) - } else if (typeof choices === 'object' && choices !== null) { - return Object.keys(choices) - } else { - throw new Error(sub('invalid choices value: %r', choices)) - } -} - -// decorator that allows a class to be called without new -function _callable(cls) { - let result = { // object is needed for inferred class name - [cls.name]: function (...args) { - let this_class = new.target === result || !new.target - return Reflect.construct(cls, args, this_class ? cls : new.target) - } - } - result[cls.name].prototype = cls.prototype - // fix default tag for toString, e.g. [object Action] instead of [object Object] - cls.prototype[Symbol.toStringTag] = cls.name - return result[cls.name] -} - -function _alias(object, from, to) { - try { - let name = object.constructor.name - Object.defineProperty(object, from, { - value: util.deprecate(object[to], sub('%s.%s() is renamed to %s.%s()', - name, from, name, to)), - enumerable: false - }) - } catch {} -} - -// decorator that allows snake_case class methods to be called with camelCase and vice versa -function _camelcase_alias(_class) { - for (let name of Object.getOwnPropertyNames(_class.prototype)) { - let camelcase = name.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase()) - if (camelcase !== name) _alias(_class.prototype, camelcase, name) - } - return _class -} - -function _to_legacy_name(key) { - key = key.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase()) - if (key === 'default') key = 'defaultValue' - if (key === 'const') key = 'constant' - return key -} - -function _to_new_name(key) { - if (key === 'defaultValue') key = 'default' - if (key === 'constant') key = 'const' - key = key.replace(/[A-Z]/g, c => '_' + c.toLowerCase()) - return key -} - -// parse options -let no_default = Symbol('no_default_value') -function _parse_opts(args, descriptor) { - function get_name() { - let stack = new Error().stack.split('\n') - .map(x => x.match(/^ at (.*) \(.*\)$/)) - .filter(Boolean) - .map(m => m[1]) - .map(fn => fn.match(/[^ .]*$/)[0]) - - if (stack.length && stack[0] === get_name.name) stack.shift() - if (stack.length && stack[0] === _parse_opts.name) stack.shift() - return stack.length ? stack[0] : '' - } - - args = Array.from(args) - let kwargs = {} - let result = [] - let last_opt = args.length && args[args.length - 1] - - if (typeof last_opt === 'object' && last_opt !== null && !Array.isArray(last_opt) && - (!last_opt.constructor || last_opt.constructor.name === 'Object')) { - kwargs = Object.assign({}, args.pop()) - } - - // LEGACY (v1 compatibility): camelcase - let renames = [] - for (let key of Object.keys(descriptor)) { - let old_name = _to_legacy_name(key) - if (old_name !== key && (old_name in kwargs)) { - if (key in kwargs) { - // default and defaultValue specified at the same time, happens often in old tests - //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key)) - } else { - kwargs[key] = kwargs[old_name] - } - renames.push([ old_name, key ]) - delete kwargs[old_name] - } - } - if (renames.length) { - let name = get_name() - deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s', - name, renames.map(([ a, b ]) => sub('%r -> %r', a, b)))) - } - // end - - let missing_positionals = [] - let positional_count = args.length - - for (let [ key, def ] of Object.entries(descriptor)) { - if (key[0] === '*') { - if (key.length > 0 && key[1] === '*') { - // LEGACY (v1 compatibility): camelcase - let renames = [] - for (let key of Object.keys(kwargs)) { - let new_name = _to_new_name(key) - if (new_name !== key && (key in kwargs)) { - if (new_name in kwargs) { - // default and defaultValue specified at the same time, happens often in old tests - //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), new_name)) - } else { - kwargs[new_name] = kwargs[key] - } - renames.push([ key, new_name ]) - delete kwargs[key] - } - } - if (renames.length) { - let name = get_name() - deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s', - name, renames.map(([ a, b ]) => sub('%r -> %r', a, b)))) - } - // end - result.push(kwargs) - kwargs = {} - } else { - result.push(args) - args = [] - } - } else if (key in kwargs && args.length > 0) { - throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key)) - } else if (key in kwargs) { - result.push(kwargs[key]) - delete kwargs[key] - } else if (args.length > 0) { - result.push(args.shift()) - } else if (def !== no_default) { - result.push(def) - } else { - missing_positionals.push(key) - } - } - - if (Object.keys(kwargs).length) { - throw new TypeError(sub('%s() got an unexpected keyword argument %r', - get_name(), Object.keys(kwargs)[0])) - } - - if (args.length) { - let from = Object.entries(descriptor).filter(([ k, v ]) => k[0] !== '*' && v !== no_default).length - let to = Object.entries(descriptor).filter(([ k ]) => k[0] !== '*').length - throw new TypeError(sub('%s() takes %s positional argument%s but %s %s given', - get_name(), - from === to ? sub('from %s to %s', from, to) : to, - from === to && to === 1 ? '' : 's', - positional_count, - positional_count === 1 ? 'was' : 'were')) - } - - if (missing_positionals.length) { - let strs = missing_positionals.map(repr) - if (strs.length > 1) strs[strs.length - 1] = 'and ' + strs[strs.length - 1] - let str_joined = strs.join(strs.length === 2 ? '' : ', ') - throw new TypeError(sub('%s() missing %i required positional argument%s: %s', - get_name(), strs.length, strs.length === 1 ? '' : 's', str_joined)) - } - - return result -} - -let _deprecations = {} -function deprecate(id, string) { - _deprecations[id] = _deprecations[id] || util.deprecate(() => {}, string) - _deprecations[id]() -} - - -// ============================= -// Utility functions and classes -// ============================= -function _AttributeHolder(cls = Object) { - /* - * Abstract base class that provides __repr__. - * - * The __repr__ method returns a string in the format:: - * ClassName(attr=name, attr=name, ...) - * The attributes are determined either by a class-level attribute, - * '_kwarg_names', or by inspecting the instance __dict__. - */ - - return class _AttributeHolder extends cls { - [util.inspect.custom]() { - let type_name = this.constructor.name - let arg_strings = [] - let star_args = {} - for (let arg of this._get_args()) { - arg_strings.push(repr(arg)) - } - for (let [ name, value ] of this._get_kwargs()) { - if (/^[a-z_][a-z0-9_$]*$/i.test(name)) { - arg_strings.push(sub('%s=%r', name, value)) - } else { - star_args[name] = value - } - } - if (Object.keys(star_args).length) { - arg_strings.push(sub('**%s', repr(star_args))) - } - return sub('%s(%s)', type_name, arg_strings.join(', ')) - } - - toString() { - return this[util.inspect.custom]() - } - - _get_kwargs() { - return Object.entries(this) - } - - _get_args() { - return [] - } - } -} - - -function _copy_items(items) { - if (items === undefined) { - return [] - } - return items.slice(0) -} - - -// =============== -// Formatting Help -// =============== -const HelpFormatter = _camelcase_alias(_callable(class HelpFormatter { - /* - * Formatter for generating usage messages and argument help strings. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - */ - - constructor() { - let [ - prog, - indent_increment, - max_help_position, - width - ] = _parse_opts(arguments, { - prog: no_default, - indent_increment: 2, - max_help_position: 24, - width: undefined - }) - - // default setting for width - if (width === undefined) { - width = get_terminal_size().columns - width -= 2 - } - - this._prog = prog - this._indent_increment = indent_increment - this._max_help_position = Math.min(max_help_position, - Math.max(width - 20, indent_increment * 2)) - this._width = width - - this._current_indent = 0 - this._level = 0 - this._action_max_length = 0 - - this._root_section = this._Section(this, undefined) - this._current_section = this._root_section - - this._whitespace_matcher = /[ \t\n\r\f\v]+/g // equivalent to python /\s+/ with ASCII flag - this._long_break_matcher = /\n\n\n+/g - } - - // =============================== - // Section and indentation methods - // =============================== - _indent() { - this._current_indent += this._indent_increment - this._level += 1 - } - - _dedent() { - this._current_indent -= this._indent_increment - assert(this._current_indent >= 0, 'Indent decreased below 0.') - this._level -= 1 - } - - _add_item(func, args) { - this._current_section.items.push([ func, args ]) - } - - // ======================== - // Message building methods - // ======================== - start_section(heading) { - this._indent() - let section = this._Section(this, this._current_section, heading) - this._add_item(section.format_help.bind(section), []) - this._current_section = section - } - - end_section() { - this._current_section = this._current_section.parent - this._dedent() - } - - add_text(text) { - if (text !== SUPPRESS && text !== undefined) { - this._add_item(this._format_text.bind(this), [text]) - } - } - - add_usage(usage, actions, groups, prefix = undefined) { - if (usage !== SUPPRESS) { - let args = [ usage, actions, groups, prefix ] - this._add_item(this._format_usage.bind(this), args) - } - } - - add_argument(action) { - if (action.help !== SUPPRESS) { - - // find all invocations - let invocations = [this._format_action_invocation(action)] - for (let subaction of this._iter_indented_subactions(action)) { - invocations.push(this._format_action_invocation(subaction)) - } - - // update the maximum item length - let invocation_length = Math.max(...invocations.map(invocation => invocation.length)) - let action_length = invocation_length + this._current_indent - this._action_max_length = Math.max(this._action_max_length, - action_length) - - // add the item to the list - this._add_item(this._format_action.bind(this), [action]) - } - } - - add_arguments(actions) { - for (let action of actions) { - this.add_argument(action) - } - } - - // ======================= - // Help-formatting methods - // ======================= - format_help() { - let help = this._root_section.format_help() - if (help) { - help = help.replace(this._long_break_matcher, '\n\n') - help = help.replace(/^\n+|\n+$/g, '') + '\n' - } - return help - } - - _join_parts(part_strings) { - return part_strings.filter(part => part && part !== SUPPRESS).join('') - } - - _format_usage(usage, actions, groups, prefix) { - if (prefix === undefined) { - prefix = 'usage: ' - } - - // if usage is specified, use that - if (usage !== undefined) { - usage = sub(usage, { prog: this._prog }) - - // if no optionals or positionals are available, usage is just prog - } else if (usage === undefined && !actions.length) { - usage = sub('%(prog)s', { prog: this._prog }) - - // if optionals and positionals are available, calculate usage - } else if (usage === undefined) { - let prog = sub('%(prog)s', { prog: this._prog }) - - // split optionals from positionals - let optionals = [] - let positionals = [] - for (let action of actions) { - if (action.option_strings.length) { - optionals.push(action) - } else { - positionals.push(action) - } - } - - // build full usage string - let action_usage = this._format_actions_usage([].concat(optionals).concat(positionals), groups) - usage = [ prog, action_usage ].map(String).join(' ') - - // wrap the usage parts if it's too long - let text_width = this._width - this._current_indent - if (prefix.length + usage.length > text_width) { - - // break usage into wrappable parts - let part_regexp = /\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+/g - let opt_usage = this._format_actions_usage(optionals, groups) - let pos_usage = this._format_actions_usage(positionals, groups) - let opt_parts = opt_usage.match(part_regexp) || [] - let pos_parts = pos_usage.match(part_regexp) || [] - assert(opt_parts.join(' ') === opt_usage) - assert(pos_parts.join(' ') === pos_usage) - - // helper for wrapping lines - let get_lines = (parts, indent, prefix = undefined) => { - let lines = [] - let line = [] - let line_len - if (prefix !== undefined) { - line_len = prefix.length - 1 - } else { - line_len = indent.length - 1 - } - for (let part of parts) { - if (line_len + 1 + part.length > text_width && line) { - lines.push(indent + line.join(' ')) - line = [] - line_len = indent.length - 1 - } - line.push(part) - line_len += part.length + 1 - } - if (line.length) { - lines.push(indent + line.join(' ')) - } - if (prefix !== undefined) { - lines[0] = lines[0].slice(indent.length) - } - return lines - } - - let lines - - // if prog is short, follow it with optionals or positionals - if (prefix.length + prog.length <= 0.75 * text_width) { - let indent = ' '.repeat(prefix.length + prog.length + 1) - if (opt_parts.length) { - lines = get_lines([prog].concat(opt_parts), indent, prefix) - lines = lines.concat(get_lines(pos_parts, indent)) - } else if (pos_parts.length) { - lines = get_lines([prog].concat(pos_parts), indent, prefix) - } else { - lines = [prog] - } - - // if prog is long, put it on its own line - } else { - let indent = ' '.repeat(prefix.length) - let parts = [].concat(opt_parts).concat(pos_parts) - lines = get_lines(parts, indent) - if (lines.length > 1) { - lines = [] - lines = lines.concat(get_lines(opt_parts, indent)) - lines = lines.concat(get_lines(pos_parts, indent)) - } - lines = [prog].concat(lines) - } - - // join lines into usage - usage = lines.join('\n') - } - } - - // prefix with 'usage:' - return sub('%s%s\n\n', prefix, usage) - } - - _format_actions_usage(actions, groups) { - // find group indices and identify actions in groups - let group_actions = new Set() - let inserts = {} - for (let group of groups) { - let start = actions.indexOf(group._group_actions[0]) - if (start === -1) { - continue - } else { - let end = start + group._group_actions.length - if (_array_equal(actions.slice(start, end), group._group_actions)) { - for (let action of group._group_actions) { - group_actions.add(action) - } - if (!group.required) { - if (start in inserts) { - inserts[start] += ' [' - } else { - inserts[start] = '[' - } - if (end in inserts) { - inserts[end] += ']' - } else { - inserts[end] = ']' - } - } else { - if (start in inserts) { - inserts[start] += ' (' - } else { - inserts[start] = '(' - } - if (end in inserts) { - inserts[end] += ')' - } else { - inserts[end] = ')' - } - } - for (let i of range(start + 1, end)) { - inserts[i] = '|' - } - } - } - } - - // collect all actions format strings - let parts = [] - for (let [ i, action ] of Object.entries(actions)) { - - // suppressed arguments are marked with None - // remove | separators for suppressed arguments - if (action.help === SUPPRESS) { - parts.push(undefined) - if (inserts[+i] === '|') { - delete inserts[+i] - } else if (inserts[+i + 1] === '|') { - delete inserts[+i + 1] - } - - // produce all arg strings - } else if (!action.option_strings.length) { - let default_value = this._get_default_metavar_for_positional(action) - let part = this._format_args(action, default_value) - - // if it's in a group, strip the outer [] - if (group_actions.has(action)) { - if (part[0] === '[' && part[part.length - 1] === ']') { - part = part.slice(1, -1) - } - } - - // add the action string to the list - parts.push(part) - - // produce the first way to invoke the option in brackets - } else { - let option_string = action.option_strings[0] - let part - - // if the Optional doesn't take a value, format is: - // -s or --long - if (action.nargs === 0) { - part = action.format_usage() - - // if the Optional takes a value, format is: - // -s ARGS or --long ARGS - } else { - let default_value = this._get_default_metavar_for_optional(action) - let args_string = this._format_args(action, default_value) - part = sub('%s %s', option_string, args_string) - } - - // make it look optional if it's not required or in a group - if (!action.required && !group_actions.has(action)) { - part = sub('[%s]', part) - } - - // add the action string to the list - parts.push(part) - } - } - - // insert things at the necessary indices - for (let i of Object.keys(inserts).map(Number).sort((a, b) => b - a)) { - parts.splice(+i, 0, inserts[+i]) - } - - // join all the action items with spaces - let text = parts.filter(Boolean).join(' ') - - // clean up separators for mutually exclusive groups - text = text.replace(/([\[(]) /g, '$1') - text = text.replace(/ ([\])])/g, '$1') - text = text.replace(/[\[(] *[\])]/g, '') - text = text.replace(/\(([^|]*)\)/g, '$1', text) - text = text.trim() - - // return the text - return text - } - - _format_text(text) { - if (text.includes('%(prog)')) { - text = sub(text, { prog: this._prog }) - } - let text_width = Math.max(this._width - this._current_indent, 11) - let indent = ' '.repeat(this._current_indent) - return this._fill_text(text, text_width, indent) + '\n\n' - } - - _format_action(action) { - // determine the required width and the entry label - let help_position = Math.min(this._action_max_length + 2, - this._max_help_position) - let help_width = Math.max(this._width - help_position, 11) - let action_width = help_position - this._current_indent - 2 - let action_header = this._format_action_invocation(action) - let indent_first - - // no help; start on same line and add a final newline - if (!action.help) { - let tup = [ this._current_indent, '', action_header ] - action_header = sub('%*s%s\n', ...tup) - - // short action name; start on the same line and pad two spaces - } else if (action_header.length <= action_width) { - let tup = [ this._current_indent, '', action_width, action_header ] - action_header = sub('%*s%-*s ', ...tup) - indent_first = 0 - - // long action name; start on the next line - } else { - let tup = [ this._current_indent, '', action_header ] - action_header = sub('%*s%s\n', ...tup) - indent_first = help_position - } - - // collect the pieces of the action help - let parts = [action_header] - - // if there was help for the action, add lines of help text - if (action.help) { - let help_text = this._expand_help(action) - let help_lines = this._split_lines(help_text, help_width) - parts.push(sub('%*s%s\n', indent_first, '', help_lines[0])) - for (let line of help_lines.slice(1)) { - parts.push(sub('%*s%s\n', help_position, '', line)) - } - - // or add a newline if the description doesn't end with one - } else if (!action_header.endsWith('\n')) { - parts.push('\n') - } - - // if there are any sub-actions, add their help as well - for (let subaction of this._iter_indented_subactions(action)) { - parts.push(this._format_action(subaction)) - } - - // return a single string - return this._join_parts(parts) - } - - _format_action_invocation(action) { - if (!action.option_strings.length) { - let default_value = this._get_default_metavar_for_positional(action) - let metavar = this._metavar_formatter(action, default_value)(1)[0] - return metavar - - } else { - let parts = [] - - // if the Optional doesn't take a value, format is: - // -s, --long - if (action.nargs === 0) { - parts = parts.concat(action.option_strings) - - // if the Optional takes a value, format is: - // -s ARGS, --long ARGS - } else { - let default_value = this._get_default_metavar_for_optional(action) - let args_string = this._format_args(action, default_value) - for (let option_string of action.option_strings) { - parts.push(sub('%s %s', option_string, args_string)) - } - } - - return parts.join(', ') - } - } - - _metavar_formatter(action, default_metavar) { - let result - if (action.metavar !== undefined) { - result = action.metavar - } else if (action.choices !== undefined) { - let choice_strs = _choices_to_array(action.choices).map(String) - result = sub('{%s}', choice_strs.join(',')) - } else { - result = default_metavar - } - - function format(tuple_size) { - if (Array.isArray(result)) { - return result - } else { - return Array(tuple_size).fill(result) - } - } - return format - } - - _format_args(action, default_metavar) { - let get_metavar = this._metavar_formatter(action, default_metavar) - let result - if (action.nargs === undefined) { - result = sub('%s', ...get_metavar(1)) - } else if (action.nargs === OPTIONAL) { - result = sub('[%s]', ...get_metavar(1)) - } else if (action.nargs === ZERO_OR_MORE) { - let metavar = get_metavar(1) - if (metavar.length === 2) { - result = sub('[%s [%s ...]]', ...metavar) - } else { - result = sub('[%s ...]', ...metavar) - } - } else if (action.nargs === ONE_OR_MORE) { - result = sub('%s [%s ...]', ...get_metavar(2)) - } else if (action.nargs === REMAINDER) { - result = '...' - } else if (action.nargs === PARSER) { - result = sub('%s ...', ...get_metavar(1)) - } else if (action.nargs === SUPPRESS) { - result = '' - } else { - let formats - try { - formats = range(action.nargs).map(() => '%s') - } catch (err) { - throw new TypeError('invalid nargs value') - } - result = sub(formats.join(' '), ...get_metavar(action.nargs)) - } - return result - } - - _expand_help(action) { - let params = Object.assign({ prog: this._prog }, action) - for (let name of Object.keys(params)) { - if (params[name] === SUPPRESS) { - delete params[name] - } - } - for (let name of Object.keys(params)) { - if (params[name] && params[name].name) { - params[name] = params[name].name - } - } - if (params.choices !== undefined) { - let choices_str = _choices_to_array(params.choices).map(String).join(', ') - params.choices = choices_str - } - // LEGACY (v1 compatibility): camelcase - for (let key of Object.keys(params)) { - let old_name = _to_legacy_name(key) - if (old_name !== key) { - params[old_name] = params[key] - } - } - // end - return sub(this._get_help_string(action), params) - } - - * _iter_indented_subactions(action) { - if (typeof action._get_subactions === 'function') { - this._indent() - yield* action._get_subactions() - this._dedent() - } - } - - _split_lines(text, width) { - text = text.replace(this._whitespace_matcher, ' ').trim() - // The textwrap module is used only for formatting help. - // Delay its import for speeding up the common usage of argparse. - let textwrap = require('./lib/textwrap') - return textwrap.wrap(text, { width }) - } - - _fill_text(text, width, indent) { - text = text.replace(this._whitespace_matcher, ' ').trim() - let textwrap = require('./lib/textwrap') - return textwrap.fill(text, { width, - initial_indent: indent, - subsequent_indent: indent }) - } - - _get_help_string(action) { - return action.help - } - - _get_default_metavar_for_optional(action) { - return action.dest.toUpperCase() - } - - _get_default_metavar_for_positional(action) { - return action.dest - } -})) - -HelpFormatter.prototype._Section = _callable(class _Section { - - constructor(formatter, parent, heading = undefined) { - this.formatter = formatter - this.parent = parent - this.heading = heading - this.items = [] - } - - format_help() { - // format the indented section - if (this.parent !== undefined) { - this.formatter._indent() - } - let item_help = this.formatter._join_parts(this.items.map(([ func, args ]) => func.apply(null, args))) - if (this.parent !== undefined) { - this.formatter._dedent() - } - - // return nothing if the section was empty - if (!item_help) { - return '' - } - - // add the heading if the section was non-empty - let heading - if (this.heading !== SUPPRESS && this.heading !== undefined) { - let current_indent = this.formatter._current_indent - heading = sub('%*s%s:\n', current_indent, '', this.heading) - } else { - heading = '' - } - - // join the section-initial newline, the heading and the help - return this.formatter._join_parts(['\n', heading, item_help, '\n']) - } -}) - - -const RawDescriptionHelpFormatter = _camelcase_alias(_callable(class RawDescriptionHelpFormatter extends HelpFormatter { - /* - * Help message formatter which retains any formatting in descriptions. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - */ - - _fill_text(text, width, indent) { - return splitlines(text, true).map(line => indent + line).join('') - } -})) - - -const RawTextHelpFormatter = _camelcase_alias(_callable(class RawTextHelpFormatter extends RawDescriptionHelpFormatter { - /* - * Help message formatter which retains formatting of all help text. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - */ - - _split_lines(text/*, width*/) { - return splitlines(text) - } -})) - - -const ArgumentDefaultsHelpFormatter = _camelcase_alias(_callable(class ArgumentDefaultsHelpFormatter extends HelpFormatter { - /* - * Help message formatter which adds default values to argument help. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - */ - - _get_help_string(action) { - let help = action.help - // LEGACY (v1 compatibility): additional check for defaultValue needed - if (!action.help.includes('%(default)') && !action.help.includes('%(defaultValue)')) { - if (action.default !== SUPPRESS) { - let defaulting_nargs = [OPTIONAL, ZERO_OR_MORE] - if (action.option_strings.length || defaulting_nargs.includes(action.nargs)) { - help += ' (default: %(default)s)' - } - } - } - return help - } -})) - - -const MetavarTypeHelpFormatter = _camelcase_alias(_callable(class MetavarTypeHelpFormatter extends HelpFormatter { - /* - * Help message formatter which uses the argument 'type' as the default - * metavar value (instead of the argument 'dest') - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - */ - - _get_default_metavar_for_optional(action) { - return typeof action.type === 'function' ? action.type.name : action.type - } - - _get_default_metavar_for_positional(action) { - return typeof action.type === 'function' ? action.type.name : action.type - } -})) - - -// ===================== -// Options and Arguments -// ===================== -function _get_action_name(argument) { - if (argument === undefined) { - return undefined - } else if (argument.option_strings.length) { - return argument.option_strings.join('/') - } else if (![ undefined, SUPPRESS ].includes(argument.metavar)) { - return argument.metavar - } else if (![ undefined, SUPPRESS ].includes(argument.dest)) { - return argument.dest - } else { - return undefined - } -} - - -const ArgumentError = _callable(class ArgumentError extends Error { - /* - * An error from creating or using an argument (optional or positional). - * - * The string value of this exception is the message, augmented with - * information about the argument that caused it. - */ - - constructor(argument, message) { - super() - this.name = 'ArgumentError' - this._argument_name = _get_action_name(argument) - this._message = message - this.message = this.str() - } - - str() { - let format - if (this._argument_name === undefined) { - format = '%(message)s' - } else { - format = 'argument %(argument_name)s: %(message)s' - } - return sub(format, { message: this._message, - argument_name: this._argument_name }) - } -}) - - -const ArgumentTypeError = _callable(class ArgumentTypeError extends Error { - /* - * An error from trying to convert a command line string to a type. - */ - - constructor(message) { - super(message) - this.name = 'ArgumentTypeError' - } -}) - - -// ============== -// Action classes -// ============== -const Action = _camelcase_alias(_callable(class Action extends _AttributeHolder(Function) { - /* - * Information about how to convert command line strings to Python objects. - * - * Action objects are used by an ArgumentParser to represent the information - * needed to parse a single argument from one or more strings from the - * command line. The keyword arguments to the Action constructor are also - * all attributes of Action instances. - * - * Keyword Arguments: - * - * - option_strings -- A list of command-line option strings which - * should be associated with this action. - * - * - dest -- The name of the attribute to hold the created object(s) - * - * - nargs -- The number of command-line arguments that should be - * consumed. By default, one argument will be consumed and a single - * value will be produced. Other values include: - * - N (an integer) consumes N arguments (and produces a list) - * - '?' consumes zero or one arguments - * - '*' consumes zero or more arguments (and produces a list) - * - '+' consumes one or more arguments (and produces a list) - * Note that the difference between the default and nargs=1 is that - * with the default, a single value will be produced, while with - * nargs=1, a list containing a single value will be produced. - * - * - const -- The value to be produced if the option is specified and the - * option uses an action that takes no values. - * - * - default -- The value to be produced if the option is not specified. - * - * - type -- A callable that accepts a single string argument, and - * returns the converted value. The standard Python types str, int, - * float, and complex are useful examples of such callables. If None, - * str is used. - * - * - choices -- A container of values that should be allowed. If not None, - * after a command-line argument has been converted to the appropriate - * type, an exception will be raised if it is not a member of this - * collection. - * - * - required -- True if the action must always be specified at the - * command line. This is only meaningful for optional command-line - * arguments. - * - * - help -- The help string describing the argument. - * - * - metavar -- The name to be used for the option's argument with the - * help string. If None, the 'dest' value will be used as the name. - */ - - constructor() { - let [ - option_strings, - dest, - nargs, - const_value, - default_value, - type, - choices, - required, - help, - metavar - ] = _parse_opts(arguments, { - option_strings: no_default, - dest: no_default, - nargs: undefined, - const: undefined, - default: undefined, - type: undefined, - choices: undefined, - required: false, - help: undefined, - metavar: undefined - }) - - // when this class is called as a function, redirect it to .call() method of itself - super('return arguments.callee.call.apply(arguments.callee, arguments)') - - this.option_strings = option_strings - this.dest = dest - this.nargs = nargs - this.const = const_value - this.default = default_value - this.type = type - this.choices = choices - this.required = required - this.help = help - this.metavar = metavar - } - - _get_kwargs() { - let names = [ - 'option_strings', - 'dest', - 'nargs', - 'const', - 'default', - 'type', - 'choices', - 'help', - 'metavar' - ] - return names.map(name => [ name, getattr(this, name) ]) - } - - format_usage() { - return this.option_strings[0] - } - - call(/*parser, namespace, values, option_string = undefined*/) { - throw new Error('.call() not defined') - } -})) - - -const BooleanOptionalAction = _camelcase_alias(_callable(class BooleanOptionalAction extends Action { - - constructor() { - let [ - option_strings, - dest, - default_value, - type, - choices, - required, - help, - metavar - ] = _parse_opts(arguments, { - option_strings: no_default, - dest: no_default, - default: undefined, - type: undefined, - choices: undefined, - required: false, - help: undefined, - metavar: undefined - }) - - let _option_strings = [] - for (let option_string of option_strings) { - _option_strings.push(option_string) - - if (option_string.startsWith('--')) { - option_string = '--no-' + option_string.slice(2) - _option_strings.push(option_string) - } - } - - if (help !== undefined && default_value !== undefined) { - help += ` (default: ${default_value})` - } - - super({ - option_strings: _option_strings, - dest, - nargs: 0, - default: default_value, - type, - choices, - required, - help, - metavar - }) - } - - call(parser, namespace, values, option_string = undefined) { - if (this.option_strings.includes(option_string)) { - setattr(namespace, this.dest, !option_string.startsWith('--no-')) - } - } - - format_usage() { - return this.option_strings.join(' | ') - } -})) - - -const _StoreAction = _callable(class _StoreAction extends Action { - - constructor() { - let [ - option_strings, - dest, - nargs, - const_value, - default_value, - type, - choices, - required, - help, - metavar - ] = _parse_opts(arguments, { - option_strings: no_default, - dest: no_default, - nargs: undefined, - const: undefined, - default: undefined, - type: undefined, - choices: undefined, - required: false, - help: undefined, - metavar: undefined - }) - - if (nargs === 0) { - throw new TypeError('nargs for store actions must be != 0; if you ' + - 'have nothing to store, actions such as store ' + - 'true or store const may be more appropriate') - } - if (const_value !== undefined && nargs !== OPTIONAL) { - throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL)) - } - super({ - option_strings, - dest, - nargs, - const: const_value, - default: default_value, - type, - choices, - required, - help, - metavar - }) - } - - call(parser, namespace, values/*, option_string = undefined*/) { - setattr(namespace, this.dest, values) - } -}) - - -const _StoreConstAction = _callable(class _StoreConstAction extends Action { - - constructor() { - let [ - option_strings, - dest, - const_value, - default_value, - required, - help - //, metavar - ] = _parse_opts(arguments, { - option_strings: no_default, - dest: no_default, - const: no_default, - default: undefined, - required: false, - help: undefined, - metavar: undefined - }) - - super({ - option_strings, - dest, - nargs: 0, - const: const_value, - default: default_value, - required, - help - }) - } - - call(parser, namespace/*, values, option_string = undefined*/) { - setattr(namespace, this.dest, this.const) - } -}) - - -const _StoreTrueAction = _callable(class _StoreTrueAction extends _StoreConstAction { - - constructor() { - let [ - option_strings, - dest, - default_value, - required, - help - ] = _parse_opts(arguments, { - option_strings: no_default, - dest: no_default, - default: false, - required: false, - help: undefined - }) - - super({ - option_strings, - dest, - const: true, - default: default_value, - required, - help - }) - } -}) - - -const _StoreFalseAction = _callable(class _StoreFalseAction extends _StoreConstAction { - - constructor() { - let [ - option_strings, - dest, - default_value, - required, - help - ] = _parse_opts(arguments, { - option_strings: no_default, - dest: no_default, - default: true, - required: false, - help: undefined - }) - - super({ - option_strings, - dest, - const: false, - default: default_value, - required, - help - }) - } -}) - - -const _AppendAction = _callable(class _AppendAction extends Action { - - constructor() { - let [ - option_strings, - dest, - nargs, - const_value, - default_value, - type, - choices, - required, - help, - metavar - ] = _parse_opts(arguments, { - option_strings: no_default, - dest: no_default, - nargs: undefined, - const: undefined, - default: undefined, - type: undefined, - choices: undefined, - required: false, - help: undefined, - metavar: undefined - }) - - if (nargs === 0) { - throw new TypeError('nargs for append actions must be != 0; if arg ' + - 'strings are not supplying the value to append, ' + - 'the append const action may be more appropriate') - } - if (const_value !== undefined && nargs !== OPTIONAL) { - throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL)) - } - super({ - option_strings, - dest, - nargs, - const: const_value, - default: default_value, - type, - choices, - required, - help, - metavar - }) - } - - call(parser, namespace, values/*, option_string = undefined*/) { - let items = getattr(namespace, this.dest, undefined) - items = _copy_items(items) - items.push(values) - setattr(namespace, this.dest, items) - } -}) - - -const _AppendConstAction = _callable(class _AppendConstAction extends Action { - - constructor() { - let [ - option_strings, - dest, - const_value, - default_value, - required, - help, - metavar - ] = _parse_opts(arguments, { - option_strings: no_default, - dest: no_default, - const: no_default, - default: undefined, - required: false, - help: undefined, - metavar: undefined - }) - - super({ - option_strings, - dest, - nargs: 0, - const: const_value, - default: default_value, - required, - help, - metavar - }) - } - - call(parser, namespace/*, values, option_string = undefined*/) { - let items = getattr(namespace, this.dest, undefined) - items = _copy_items(items) - items.push(this.const) - setattr(namespace, this.dest, items) - } -}) - - -const _CountAction = _callable(class _CountAction extends Action { - - constructor() { - let [ - option_strings, - dest, - default_value, - required, - help - ] = _parse_opts(arguments, { - option_strings: no_default, - dest: no_default, - default: undefined, - required: false, - help: undefined - }) - - super({ - option_strings, - dest, - nargs: 0, - default: default_value, - required, - help - }) - } - - call(parser, namespace/*, values, option_string = undefined*/) { - let count = getattr(namespace, this.dest, undefined) - if (count === undefined) { - count = 0 - } - setattr(namespace, this.dest, count + 1) - } -}) - - -const _HelpAction = _callable(class _HelpAction extends Action { - - constructor() { - let [ - option_strings, - dest, - default_value, - help - ] = _parse_opts(arguments, { - option_strings: no_default, - dest: SUPPRESS, - default: SUPPRESS, - help: undefined - }) - - super({ - option_strings, - dest, - default: default_value, - nargs: 0, - help - }) - } - - call(parser/*, namespace, values, option_string = undefined*/) { - parser.print_help() - parser.exit() - } -}) - - -const _VersionAction = _callable(class _VersionAction extends Action { - - constructor() { - let [ - option_strings, - version, - dest, - default_value, - help - ] = _parse_opts(arguments, { - option_strings: no_default, - version: undefined, - dest: SUPPRESS, - default: SUPPRESS, - help: "show program's version number and exit" - }) - - super({ - option_strings, - dest, - default: default_value, - nargs: 0, - help - }) - this.version = version - } - - call(parser/*, namespace, values, option_string = undefined*/) { - let version = this.version - if (version === undefined) { - version = parser.version - } - let formatter = parser._get_formatter() - formatter.add_text(version) - parser._print_message(formatter.format_help(), process.stdout) - parser.exit() - } -}) - - -const _SubParsersAction = _camelcase_alias(_callable(class _SubParsersAction extends Action { - - constructor() { - let [ - option_strings, - prog, - parser_class, - dest, - required, - help, - metavar - ] = _parse_opts(arguments, { - option_strings: no_default, - prog: no_default, - parser_class: no_default, - dest: SUPPRESS, - required: false, - help: undefined, - metavar: undefined - }) - - let name_parser_map = {} - - super({ - option_strings, - dest, - nargs: PARSER, - choices: name_parser_map, - required, - help, - metavar - }) - - this._prog_prefix = prog - this._parser_class = parser_class - this._name_parser_map = name_parser_map - this._choices_actions = [] - } - - add_parser() { - let [ - name, - kwargs - ] = _parse_opts(arguments, { - name: no_default, - '**kwargs': no_default - }) - - // set prog from the existing prefix - if (kwargs.prog === undefined) { - kwargs.prog = sub('%s %s', this._prog_prefix, name) - } - - let aliases = getattr(kwargs, 'aliases', []) - delete kwargs.aliases - - // create a pseudo-action to hold the choice help - if ('help' in kwargs) { - let help = kwargs.help - delete kwargs.help - let choice_action = this._ChoicesPseudoAction(name, aliases, help) - this._choices_actions.push(choice_action) - } - - // create the parser and add it to the map - let parser = new this._parser_class(kwargs) - this._name_parser_map[name] = parser - - // make parser available under aliases also - for (let alias of aliases) { - this._name_parser_map[alias] = parser - } - - return parser - } - - _get_subactions() { - return this._choices_actions - } - - call(parser, namespace, values/*, option_string = undefined*/) { - let parser_name = values[0] - let arg_strings = values.slice(1) - - // set the parser name if requested - if (this.dest !== SUPPRESS) { - setattr(namespace, this.dest, parser_name) - } - - // select the parser - if (hasattr(this._name_parser_map, parser_name)) { - parser = this._name_parser_map[parser_name] - } else { - let args = {parser_name, - choices: this._name_parser_map.join(', ')} - let msg = sub('unknown parser %(parser_name)r (choices: %(choices)s)', args) - throw new ArgumentError(this, msg) - } - - // parse all the remaining options into the namespace - // store any unrecognized options on the object, so that the top - // level parser can decide what to do with them - - // In case this subparser defines new defaults, we parse them - // in a new namespace object and then update the original - // namespace for the relevant parts. - let subnamespace - [ subnamespace, arg_strings ] = parser.parse_known_args(arg_strings, undefined) - for (let [ key, value ] of Object.entries(subnamespace)) { - setattr(namespace, key, value) - } - - if (arg_strings.length) { - setdefault(namespace, _UNRECOGNIZED_ARGS_ATTR, []) - getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).push(...arg_strings) - } - } -})) - - -_SubParsersAction.prototype._ChoicesPseudoAction = _callable(class _ChoicesPseudoAction extends Action { - constructor(name, aliases, help) { - let metavar = name, dest = name - if (aliases.length) { - metavar += sub(' (%s)', aliases.join(', ')) - } - super({ option_strings: [], dest, help, metavar }) - } -}) - - -const _ExtendAction = _callable(class _ExtendAction extends _AppendAction { - call(parser, namespace, values/*, option_string = undefined*/) { - let items = getattr(namespace, this.dest, undefined) - items = _copy_items(items) - items = items.concat(values) - setattr(namespace, this.dest, items) - } -}) - - -// ============== -// Type classes -// ============== -const FileType = _callable(class FileType extends Function { - /* - * Factory for creating file object types - * - * Instances of FileType are typically passed as type= arguments to the - * ArgumentParser add_argument() method. - * - * Keyword Arguments: - * - mode -- A string indicating how the file is to be opened. Accepts the - * same values as the builtin open() function. - * - bufsize -- The file's desired buffer size. Accepts the same values as - * the builtin open() function. - * - encoding -- The file's encoding. Accepts the same values as the - * builtin open() function. - * - errors -- A string indicating how encoding and decoding errors are to - * be handled. Accepts the same value as the builtin open() function. - */ - - constructor() { - let [ - flags, - encoding, - mode, - autoClose, - emitClose, - start, - end, - highWaterMark, - fs - ] = _parse_opts(arguments, { - flags: 'r', - encoding: undefined, - mode: undefined, // 0o666 - autoClose: undefined, // true - emitClose: undefined, // false - start: undefined, // 0 - end: undefined, // Infinity - highWaterMark: undefined, // 64 * 1024 - fs: undefined - }) - - // when this class is called as a function, redirect it to .call() method of itself - super('return arguments.callee.call.apply(arguments.callee, arguments)') - - Object.defineProperty(this, 'name', { - get() { - return sub('FileType(%r)', flags) - } - }) - this._flags = flags - this._options = {} - if (encoding !== undefined) this._options.encoding = encoding - if (mode !== undefined) this._options.mode = mode - if (autoClose !== undefined) this._options.autoClose = autoClose - if (emitClose !== undefined) this._options.emitClose = emitClose - if (start !== undefined) this._options.start = start - if (end !== undefined) this._options.end = end - if (highWaterMark !== undefined) this._options.highWaterMark = highWaterMark - if (fs !== undefined) this._options.fs = fs - } - - call(string) { - // the special argument "-" means sys.std{in,out} - if (string === '-') { - if (this._flags.includes('r')) { - return process.stdin - } else if (this._flags.includes('w')) { - return process.stdout - } else { - let msg = sub('argument "-" with mode %r', this._flags) - throw new TypeError(msg) - } - } - - // all other arguments are used as file names - let fd - try { - fd = fs.openSync(string, this._flags, this._options.mode) - } catch (e) { - let args = { filename: string, error: e.message } - let message = "can't open '%(filename)s': %(error)s" - throw new ArgumentTypeError(sub(message, args)) - } - - let options = Object.assign({ fd, flags: this._flags }, this._options) - if (this._flags.includes('r')) { - return fs.createReadStream(undefined, options) - } else if (this._flags.includes('w')) { - return fs.createWriteStream(undefined, options) - } else { - let msg = sub('argument "%s" with mode %r', string, this._flags) - throw new TypeError(msg) - } - } - - [util.inspect.custom]() { - let args = [ this._flags ] - let kwargs = Object.entries(this._options).map(([ k, v ]) => { - if (k === 'mode') v = { value: v, [util.inspect.custom]() { return '0o' + this.value.toString(8) } } - return [ k, v ] - }) - let args_str = [] - .concat(args.filter(arg => arg !== -1).map(repr)) - .concat(kwargs.filter(([/*kw*/, arg]) => arg !== undefined) - .map(([kw, arg]) => sub('%s=%r', kw, arg))) - .join(', ') - return sub('%s(%s)', this.constructor.name, args_str) - } - - toString() { - return this[util.inspect.custom]() - } -}) - -// =========================== -// Optional and Positional Parsing -// =========================== -const Namespace = _callable(class Namespace extends _AttributeHolder() { - /* - * Simple object for storing attributes. - * - * Implements equality by attribute names and values, and provides a simple - * string representation. - */ - - constructor(options = {}) { - super() - Object.assign(this, options) - } -}) - -// unset string tag to mimic plain object -Namespace.prototype[Symbol.toStringTag] = undefined - - -const _ActionsContainer = _camelcase_alias(_callable(class _ActionsContainer { - - constructor() { - let [ - description, - prefix_chars, - argument_default, - conflict_handler - ] = _parse_opts(arguments, { - description: no_default, - prefix_chars: no_default, - argument_default: no_default, - conflict_handler: no_default - }) - - this.description = description - this.argument_default = argument_default - this.prefix_chars = prefix_chars - this.conflict_handler = conflict_handler - - // set up registries - this._registries = {} - - // register actions - this.register('action', undefined, _StoreAction) - this.register('action', 'store', _StoreAction) - this.register('action', 'store_const', _StoreConstAction) - this.register('action', 'store_true', _StoreTrueAction) - this.register('action', 'store_false', _StoreFalseAction) - this.register('action', 'append', _AppendAction) - this.register('action', 'append_const', _AppendConstAction) - this.register('action', 'count', _CountAction) - this.register('action', 'help', _HelpAction) - this.register('action', 'version', _VersionAction) - this.register('action', 'parsers', _SubParsersAction) - this.register('action', 'extend', _ExtendAction) - // LEGACY (v1 compatibility): camelcase variants - ;[ 'storeConst', 'storeTrue', 'storeFalse', 'appendConst' ].forEach(old_name => { - let new_name = _to_new_name(old_name) - this.register('action', old_name, util.deprecate(this._registry_get('action', new_name), - sub('{action: "%s"} is renamed to {action: "%s"}', old_name, new_name))) - }) - // end - - // raise an exception if the conflict handler is invalid - this._get_handler() - - // action storage - this._actions = [] - this._option_string_actions = {} - - // groups - this._action_groups = [] - this._mutually_exclusive_groups = [] - - // defaults storage - this._defaults = {} - - // determines whether an "option" looks like a negative number - this._negative_number_matcher = /^-\d+$|^-\d*\.\d+$/ - - // whether or not there are any optionals that look like negative - // numbers -- uses a list so it can be shared and edited - this._has_negative_number_optionals = [] - } - - // ==================== - // Registration methods - // ==================== - register(registry_name, value, object) { - let registry = setdefault(this._registries, registry_name, {}) - registry[value] = object - } - - _registry_get(registry_name, value, default_value = undefined) { - return getattr(this._registries[registry_name], value, default_value) - } - - // ================================== - // Namespace default accessor methods - // ================================== - set_defaults(kwargs) { - Object.assign(this._defaults, kwargs) - - // if these defaults match any existing arguments, replace - // the previous default on the object with the new one - for (let action of this._actions) { - if (action.dest in kwargs) { - action.default = kwargs[action.dest] - } - } - } - - get_default(dest) { - for (let action of this._actions) { - if (action.dest === dest && action.default !== undefined) { - return action.default - } - } - return this._defaults[dest] - } - - - // ======================= - // Adding argument actions - // ======================= - add_argument() { - /* - * add_argument(dest, ..., name=value, ...) - * add_argument(option_string, option_string, ..., name=value, ...) - */ - let [ - args, - kwargs - ] = _parse_opts(arguments, { - '*args': no_default, - '**kwargs': no_default - }) - // LEGACY (v1 compatibility), old-style add_argument([ args ], { options }) - if (args.length === 1 && Array.isArray(args[0])) { - args = args[0] - deprecate('argument-array', - sub('use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })', { - args: args.map(repr).join(', ') - })) - } - // end - - // if no positional args are supplied or only one is supplied and - // it doesn't look like an option string, parse a positional - // argument - let chars = this.prefix_chars - if (!args.length || args.length === 1 && !chars.includes(args[0][0])) { - if (args.length && 'dest' in kwargs) { - throw new TypeError('dest supplied twice for positional argument') - } - kwargs = this._get_positional_kwargs(...args, kwargs) - - // otherwise, we're adding an optional argument - } else { - kwargs = this._get_optional_kwargs(...args, kwargs) - } - - // if no default was supplied, use the parser-level default - if (!('default' in kwargs)) { - let dest = kwargs.dest - if (dest in this._defaults) { - kwargs.default = this._defaults[dest] - } else if (this.argument_default !== undefined) { - kwargs.default = this.argument_default - } - } - - // create the action object, and add it to the parser - let action_class = this._pop_action_class(kwargs) - if (typeof action_class !== 'function') { - throw new TypeError(sub('unknown action "%s"', action_class)) - } - // eslint-disable-next-line new-cap - let action = new action_class(kwargs) - - // raise an error if the action type is not callable - let type_func = this._registry_get('type', action.type, action.type) - if (typeof type_func !== 'function') { - throw new TypeError(sub('%r is not callable', type_func)) - } - - if (type_func === FileType) { - throw new TypeError(sub('%r is a FileType class object, instance of it' + - ' must be passed', type_func)) - } - - // raise an error if the metavar does not match the type - if ('_get_formatter' in this) { - try { - this._get_formatter()._format_args(action, undefined) - } catch (err) { - // check for 'invalid nargs value' is an artifact of TypeError and ValueError in js being the same - if (err instanceof TypeError && err.message !== 'invalid nargs value') { - throw new TypeError('length of metavar tuple does not match nargs') - } else { - throw err - } - } - } - - return this._add_action(action) - } - - add_argument_group() { - let group = _ArgumentGroup(this, ...arguments) - this._action_groups.push(group) - return group - } - - add_mutually_exclusive_group() { - // eslint-disable-next-line no-use-before-define - let group = _MutuallyExclusiveGroup(this, ...arguments) - this._mutually_exclusive_groups.push(group) - return group - } - - _add_action(action) { - // resolve any conflicts - this._check_conflict(action) - - // add to actions list - this._actions.push(action) - action.container = this - - // index the action by any option strings it has - for (let option_string of action.option_strings) { - this._option_string_actions[option_string] = action - } - - // set the flag if any option strings look like negative numbers - for (let option_string of action.option_strings) { - if (this._negative_number_matcher.test(option_string)) { - if (!this._has_negative_number_optionals.length) { - this._has_negative_number_optionals.push(true) - } - } - } - - // return the created action - return action - } - - _remove_action(action) { - _array_remove(this._actions, action) - } - - _add_container_actions(container) { - // collect groups by titles - let title_group_map = {} - for (let group of this._action_groups) { - if (group.title in title_group_map) { - let msg = 'cannot merge actions - two groups are named %r' - throw new TypeError(sub(msg, group.title)) - } - title_group_map[group.title] = group - } - - // map each action to its group - let group_map = new Map() - for (let group of container._action_groups) { - - // if a group with the title exists, use that, otherwise - // create a new group matching the container's group - if (!(group.title in title_group_map)) { - title_group_map[group.title] = this.add_argument_group({ - title: group.title, - description: group.description, - conflict_handler: group.conflict_handler - }) - } - - // map the actions to their new group - for (let action of group._group_actions) { - group_map.set(action, title_group_map[group.title]) - } - } - - // add container's mutually exclusive groups - // NOTE: if add_mutually_exclusive_group ever gains title= and - // description= then this code will need to be expanded as above - for (let group of container._mutually_exclusive_groups) { - let mutex_group = this.add_mutually_exclusive_group({ - required: group.required - }) - - // map the actions to their new mutex group - for (let action of group._group_actions) { - group_map.set(action, mutex_group) - } - } - - // add all actions to this container or their group - for (let action of container._actions) { - group_map.get(action)._add_action(action) - } - } - - _get_positional_kwargs() { - let [ - dest, - kwargs - ] = _parse_opts(arguments, { - dest: no_default, - '**kwargs': no_default - }) - - // make sure required is not specified - if ('required' in kwargs) { - let msg = "'required' is an invalid argument for positionals" - throw new TypeError(msg) - } - - // mark positional arguments as required if at least one is - // always required - if (![OPTIONAL, ZERO_OR_MORE].includes(kwargs.nargs)) { - kwargs.required = true - } - if (kwargs.nargs === ZERO_OR_MORE && !('default' in kwargs)) { - kwargs.required = true - } - - // return the keyword arguments with no option strings - return Object.assign(kwargs, { dest, option_strings: [] }) - } - - _get_optional_kwargs() { - let [ - args, - kwargs - ] = _parse_opts(arguments, { - '*args': no_default, - '**kwargs': no_default - }) - - // determine short and long option strings - let option_strings = [] - let long_option_strings = [] - let option_string - for (option_string of args) { - // error on strings that don't start with an appropriate prefix - if (!this.prefix_chars.includes(option_string[0])) { - let args = {option: option_string, - prefix_chars: this.prefix_chars} - let msg = 'invalid option string %(option)r: ' + - 'must start with a character %(prefix_chars)r' - throw new TypeError(sub(msg, args)) - } - - // strings starting with two prefix characters are long options - option_strings.push(option_string) - if (option_string.length > 1 && this.prefix_chars.includes(option_string[1])) { - long_option_strings.push(option_string) - } - } - - // infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x' - let dest = kwargs.dest - delete kwargs.dest - if (dest === undefined) { - let dest_option_string - if (long_option_strings.length) { - dest_option_string = long_option_strings[0] - } else { - dest_option_string = option_strings[0] - } - dest = _string_lstrip(dest_option_string, this.prefix_chars) - if (!dest) { - let msg = 'dest= is required for options like %r' - throw new TypeError(sub(msg, option_string)) - } - dest = dest.replace(/-/g, '_') - } - - // return the updated keyword arguments - return Object.assign(kwargs, { dest, option_strings }) - } - - _pop_action_class(kwargs, default_value = undefined) { - let action = getattr(kwargs, 'action', default_value) - delete kwargs.action - return this._registry_get('action', action, action) - } - - _get_handler() { - // determine function from conflict handler string - let handler_func_name = sub('_handle_conflict_%s', this.conflict_handler) - if (typeof this[handler_func_name] === 'function') { - return this[handler_func_name] - } else { - let msg = 'invalid conflict_resolution value: %r' - throw new TypeError(sub(msg, this.conflict_handler)) - } - } - - _check_conflict(action) { - - // find all options that conflict with this option - let confl_optionals = [] - for (let option_string of action.option_strings) { - if (hasattr(this._option_string_actions, option_string)) { - let confl_optional = this._option_string_actions[option_string] - confl_optionals.push([ option_string, confl_optional ]) - } - } - - // resolve any conflicts - if (confl_optionals.length) { - let conflict_handler = this._get_handler() - conflict_handler.call(this, action, confl_optionals) - } - } - - _handle_conflict_error(action, conflicting_actions) { - let message = conflicting_actions.length === 1 ? - 'conflicting option string: %s' : - 'conflicting option strings: %s' - let conflict_string = conflicting_actions.map(([ option_string/*, action*/ ]) => option_string).join(', ') - throw new ArgumentError(action, sub(message, conflict_string)) - } - - _handle_conflict_resolve(action, conflicting_actions) { - - // remove all conflicting options - for (let [ option_string, action ] of conflicting_actions) { - - // remove the conflicting option - _array_remove(action.option_strings, option_string) - delete this._option_string_actions[option_string] - - // if the option now has no option string, remove it from the - // container holding it - if (!action.option_strings.length) { - action.container._remove_action(action) - } - } - } -})) - - -const _ArgumentGroup = _callable(class _ArgumentGroup extends _ActionsContainer { - - constructor() { - let [ - container, - title, - description, - kwargs - ] = _parse_opts(arguments, { - container: no_default, - title: undefined, - description: undefined, - '**kwargs': no_default - }) - - // add any missing keyword arguments by checking the container - setdefault(kwargs, 'conflict_handler', container.conflict_handler) - setdefault(kwargs, 'prefix_chars', container.prefix_chars) - setdefault(kwargs, 'argument_default', container.argument_default) - super(Object.assign({ description }, kwargs)) - - // group attributes - this.title = title - this._group_actions = [] - - // share most attributes with the container - this._registries = container._registries - this._actions = container._actions - this._option_string_actions = container._option_string_actions - this._defaults = container._defaults - this._has_negative_number_optionals = - container._has_negative_number_optionals - this._mutually_exclusive_groups = container._mutually_exclusive_groups - } - - _add_action(action) { - action = super._add_action(action) - this._group_actions.push(action) - return action - } - - _remove_action(action) { - super._remove_action(action) - _array_remove(this._group_actions, action) - } -}) - - -const _MutuallyExclusiveGroup = _callable(class _MutuallyExclusiveGroup extends _ArgumentGroup { - - constructor() { - let [ - container, - required - ] = _parse_opts(arguments, { - container: no_default, - required: false - }) - - super(container) - this.required = required - this._container = container - } - - _add_action(action) { - if (action.required) { - let msg = 'mutually exclusive arguments must be optional' - throw new TypeError(msg) - } - action = this._container._add_action(action) - this._group_actions.push(action) - return action - } - - _remove_action(action) { - this._container._remove_action(action) - _array_remove(this._group_actions, action) - } -}) - - -const ArgumentParser = _camelcase_alias(_callable(class ArgumentParser extends _AttributeHolder(_ActionsContainer) { - /* - * Object for parsing command line strings into Python objects. - * - * Keyword Arguments: - * - prog -- The name of the program (default: sys.argv[0]) - * - usage -- A usage message (default: auto-generated from arguments) - * - description -- A description of what the program does - * - epilog -- Text following the argument descriptions - * - parents -- Parsers whose arguments should be copied into this one - * - formatter_class -- HelpFormatter class for printing help messages - * - prefix_chars -- Characters that prefix optional arguments - * - fromfile_prefix_chars -- Characters that prefix files containing - * additional arguments - * - argument_default -- The default value for all arguments - * - conflict_handler -- String indicating how to handle conflicts - * - add_help -- Add a -h/-help option - * - allow_abbrev -- Allow long options to be abbreviated unambiguously - * - exit_on_error -- Determines whether or not ArgumentParser exits with - * error info when an error occurs - */ - - constructor() { - let [ - prog, - usage, - description, - epilog, - parents, - formatter_class, - prefix_chars, - fromfile_prefix_chars, - argument_default, - conflict_handler, - add_help, - allow_abbrev, - exit_on_error, - debug, // LEGACY (v1 compatibility), debug mode - version // LEGACY (v1 compatibility), version - ] = _parse_opts(arguments, { - prog: undefined, - usage: undefined, - description: undefined, - epilog: undefined, - parents: [], - formatter_class: HelpFormatter, - prefix_chars: '-', - fromfile_prefix_chars: undefined, - argument_default: undefined, - conflict_handler: 'error', - add_help: true, - allow_abbrev: true, - exit_on_error: true, - debug: undefined, // LEGACY (v1 compatibility), debug mode - version: undefined // LEGACY (v1 compatibility), version - }) - - // LEGACY (v1 compatibility) - if (debug !== undefined) { - deprecate('debug', - 'The "debug" argument to ArgumentParser is deprecated. Please ' + - 'override ArgumentParser.exit function instead.' - ) - } - - if (version !== undefined) { - deprecate('version', - 'The "version" argument to ArgumentParser is deprecated. Please use ' + - "add_argument(..., { action: 'version', version: 'N', ... }) instead." - ) - } - // end - - super({ - description, - prefix_chars, - argument_default, - conflict_handler - }) - - // default setting for prog - if (prog === undefined) { - prog = path.basename(get_argv()[0] || '') - } - - this.prog = prog - this.usage = usage - this.epilog = epilog - this.formatter_class = formatter_class - this.fromfile_prefix_chars = fromfile_prefix_chars - this.add_help = add_help - this.allow_abbrev = allow_abbrev - this.exit_on_error = exit_on_error - // LEGACY (v1 compatibility), debug mode - this.debug = debug - // end - - this._positionals = this.add_argument_group('positional arguments') - this._optionals = this.add_argument_group('optional arguments') - this._subparsers = undefined - - // register types - function identity(string) { - return string - } - this.register('type', undefined, identity) - this.register('type', null, identity) - this.register('type', 'auto', identity) - this.register('type', 'int', function (x) { - let result = Number(x) - if (!Number.isInteger(result)) { - throw new TypeError(sub('could not convert string to int: %r', x)) - } - return result - }) - this.register('type', 'float', function (x) { - let result = Number(x) - if (isNaN(result)) { - throw new TypeError(sub('could not convert string to float: %r', x)) - } - return result - }) - this.register('type', 'str', String) - // LEGACY (v1 compatibility): custom types - this.register('type', 'string', - util.deprecate(String, 'use {type:"str"} or {type:String} instead of {type:"string"}')) - // end - - // add help argument if necessary - // (using explicit default to override global argument_default) - let default_prefix = prefix_chars.includes('-') ? '-' : prefix_chars[0] - if (this.add_help) { - this.add_argument( - default_prefix + 'h', - default_prefix.repeat(2) + 'help', - { - action: 'help', - default: SUPPRESS, - help: 'show this help message and exit' - } - ) - } - // LEGACY (v1 compatibility), version - if (version) { - this.add_argument( - default_prefix + 'v', - default_prefix.repeat(2) + 'version', - { - action: 'version', - default: SUPPRESS, - version: this.version, - help: "show program's version number and exit" - } - ) - } - // end - - // add parent arguments and defaults - for (let parent of parents) { - this._add_container_actions(parent) - Object.assign(this._defaults, parent._defaults) - } - } - - // ======================= - // Pretty __repr__ methods - // ======================= - _get_kwargs() { - let names = [ - 'prog', - 'usage', - 'description', - 'formatter_class', - 'conflict_handler', - 'add_help' - ] - return names.map(name => [ name, getattr(this, name) ]) - } - - // ================================== - // Optional/Positional adding methods - // ================================== - add_subparsers() { - let [ - kwargs - ] = _parse_opts(arguments, { - '**kwargs': no_default - }) - - if (this._subparsers !== undefined) { - this.error('cannot have multiple subparser arguments') - } - - // add the parser class to the arguments if it's not present - setdefault(kwargs, 'parser_class', this.constructor) - - if ('title' in kwargs || 'description' in kwargs) { - let title = getattr(kwargs, 'title', 'subcommands') - let description = getattr(kwargs, 'description', undefined) - delete kwargs.title - delete kwargs.description - this._subparsers = this.add_argument_group(title, description) - } else { - this._subparsers = this._positionals - } - - // prog defaults to the usage message of this parser, skipping - // optional arguments and with no "usage:" prefix - if (kwargs.prog === undefined) { - let formatter = this._get_formatter() - let positionals = this._get_positional_actions() - let groups = this._mutually_exclusive_groups - formatter.add_usage(this.usage, positionals, groups, '') - kwargs.prog = formatter.format_help().trim() - } - - // create the parsers action and add it to the positionals list - let parsers_class = this._pop_action_class(kwargs, 'parsers') - // eslint-disable-next-line new-cap - let action = new parsers_class(Object.assign({ option_strings: [] }, kwargs)) - this._subparsers._add_action(action) - - // return the created parsers action - return action - } - - _add_action(action) { - if (action.option_strings.length) { - this._optionals._add_action(action) - } else { - this._positionals._add_action(action) - } - return action - } - - _get_optional_actions() { - return this._actions.filter(action => action.option_strings.length) - } - - _get_positional_actions() { - return this._actions.filter(action => !action.option_strings.length) - } - - // ===================================== - // Command line argument parsing methods - // ===================================== - parse_args(args = undefined, namespace = undefined) { - let argv - [ args, argv ] = this.parse_known_args(args, namespace) - if (argv && argv.length > 0) { - let msg = 'unrecognized arguments: %s' - this.error(sub(msg, argv.join(' '))) - } - return args - } - - parse_known_args(args = undefined, namespace = undefined) { - if (args === undefined) { - args = get_argv().slice(1) - } - - // default Namespace built from parser defaults - if (namespace === undefined) { - namespace = new Namespace() - } - - // add any action defaults that aren't present - for (let action of this._actions) { - if (action.dest !== SUPPRESS) { - if (!hasattr(namespace, action.dest)) { - if (action.default !== SUPPRESS) { - setattr(namespace, action.dest, action.default) - } - } - } - } - - // add any parser defaults that aren't present - for (let dest of Object.keys(this._defaults)) { - if (!hasattr(namespace, dest)) { - setattr(namespace, dest, this._defaults[dest]) - } - } - - // parse the arguments and exit if there are any errors - if (this.exit_on_error) { - try { - [ namespace, args ] = this._parse_known_args(args, namespace) - } catch (err) { - if (err instanceof ArgumentError) { - this.error(err.message) - } else { - throw err - } - } - } else { - [ namespace, args ] = this._parse_known_args(args, namespace) - } - - if (hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) { - args = args.concat(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) - delattr(namespace, _UNRECOGNIZED_ARGS_ATTR) - } - - return [ namespace, args ] - } - - _parse_known_args(arg_strings, namespace) { - // replace arg strings that are file references - if (this.fromfile_prefix_chars !== undefined) { - arg_strings = this._read_args_from_files(arg_strings) - } - - // map all mutually exclusive arguments to the other arguments - // they can't occur with - let action_conflicts = new Map() - for (let mutex_group of this._mutually_exclusive_groups) { - let group_actions = mutex_group._group_actions - for (let [ i, mutex_action ] of Object.entries(mutex_group._group_actions)) { - let conflicts = action_conflicts.get(mutex_action) || [] - conflicts = conflicts.concat(group_actions.slice(0, +i)) - conflicts = conflicts.concat(group_actions.slice(+i + 1)) - action_conflicts.set(mutex_action, conflicts) - } - } - - // find all option indices, and determine the arg_string_pattern - // which has an 'O' if there is an option at an index, - // an 'A' if there is an argument, or a '-' if there is a '--' - let option_string_indices = {} - let arg_string_pattern_parts = [] - let arg_strings_iter = Object.entries(arg_strings)[Symbol.iterator]() - for (let [ i, arg_string ] of arg_strings_iter) { - - // all args after -- are non-options - if (arg_string === '--') { - arg_string_pattern_parts.push('-') - for ([ i, arg_string ] of arg_strings_iter) { - arg_string_pattern_parts.push('A') - } - - // otherwise, add the arg to the arg strings - // and note the index if it was an option - } else { - let option_tuple = this._parse_optional(arg_string) - let pattern - if (option_tuple === undefined) { - pattern = 'A' - } else { - option_string_indices[i] = option_tuple - pattern = 'O' - } - arg_string_pattern_parts.push(pattern) - } - } - - // join the pieces together to form the pattern - let arg_strings_pattern = arg_string_pattern_parts.join('') - - // converts arg strings to the appropriate and then takes the action - let seen_actions = new Set() - let seen_non_default_actions = new Set() - let extras - - let take_action = (action, argument_strings, option_string = undefined) => { - seen_actions.add(action) - let argument_values = this._get_values(action, argument_strings) - - // error if this argument is not allowed with other previously - // seen arguments, assuming that actions that use the default - // value don't really count as "present" - if (argument_values !== action.default) { - seen_non_default_actions.add(action) - for (let conflict_action of action_conflicts.get(action) || []) { - if (seen_non_default_actions.has(conflict_action)) { - let msg = 'not allowed with argument %s' - let action_name = _get_action_name(conflict_action) - throw new ArgumentError(action, sub(msg, action_name)) - } - } - } - - // take the action if we didn't receive a SUPPRESS value - // (e.g. from a default) - if (argument_values !== SUPPRESS) { - action(this, namespace, argument_values, option_string) - } - } - - // function to convert arg_strings into an optional action - let consume_optional = start_index => { - - // get the optional identified at this index - let option_tuple = option_string_indices[start_index] - let [ action, option_string, explicit_arg ] = option_tuple - - // identify additional optionals in the same arg string - // (e.g. -xyz is the same as -x -y -z if no args are required) - let action_tuples = [] - let stop - for (;;) { - - // if we found no optional action, skip it - if (action === undefined) { - extras.push(arg_strings[start_index]) - return start_index + 1 - } - - // if there is an explicit argument, try to match the - // optional's string arguments to only this - if (explicit_arg !== undefined) { - let arg_count = this._match_argument(action, 'A') - - // if the action is a single-dash option and takes no - // arguments, try to parse more single-dash options out - // of the tail of the option string - let chars = this.prefix_chars - if (arg_count === 0 && !chars.includes(option_string[1])) { - action_tuples.push([ action, [], option_string ]) - let char = option_string[0] - option_string = char + explicit_arg[0] - let new_explicit_arg = explicit_arg.slice(1) || undefined - let optionals_map = this._option_string_actions - if (hasattr(optionals_map, option_string)) { - action = optionals_map[option_string] - explicit_arg = new_explicit_arg - } else { - let msg = 'ignored explicit argument %r' - throw new ArgumentError(action, sub(msg, explicit_arg)) - } - - // if the action expect exactly one argument, we've - // successfully matched the option; exit the loop - } else if (arg_count === 1) { - stop = start_index + 1 - let args = [ explicit_arg ] - action_tuples.push([ action, args, option_string ]) - break - - // error if a double-dash option did not use the - // explicit argument - } else { - let msg = 'ignored explicit argument %r' - throw new ArgumentError(action, sub(msg, explicit_arg)) - } - - // if there is no explicit argument, try to match the - // optional's string arguments with the following strings - // if successful, exit the loop - } else { - let start = start_index + 1 - let selected_patterns = arg_strings_pattern.slice(start) - let arg_count = this._match_argument(action, selected_patterns) - stop = start + arg_count - let args = arg_strings.slice(start, stop) - action_tuples.push([ action, args, option_string ]) - break - } - } - - // add the Optional to the list and return the index at which - // the Optional's string args stopped - assert(action_tuples.length) - for (let [ action, args, option_string ] of action_tuples) { - take_action(action, args, option_string) - } - return stop - } - - // the list of Positionals left to be parsed; this is modified - // by consume_positionals() - let positionals = this._get_positional_actions() - - // function to convert arg_strings into positional actions - let consume_positionals = start_index => { - // match as many Positionals as possible - let selected_pattern = arg_strings_pattern.slice(start_index) - let arg_counts = this._match_arguments_partial(positionals, selected_pattern) - - // slice off the appropriate arg strings for each Positional - // and add the Positional and its args to the list - for (let i = 0; i < positionals.length && i < arg_counts.length; i++) { - let action = positionals[i] - let arg_count = arg_counts[i] - let args = arg_strings.slice(start_index, start_index + arg_count) - start_index += arg_count - take_action(action, args) - } - - // slice off the Positionals that we just parsed and return the - // index at which the Positionals' string args stopped - positionals = positionals.slice(arg_counts.length) - return start_index - } - - // consume Positionals and Optionals alternately, until we have - // passed the last option string - extras = [] - let start_index = 0 - let max_option_string_index = Math.max(-1, ...Object.keys(option_string_indices).map(Number)) - while (start_index <= max_option_string_index) { - - // consume any Positionals preceding the next option - let next_option_string_index = Math.min( - // eslint-disable-next-line no-loop-func - ...Object.keys(option_string_indices).map(Number).filter(index => index >= start_index) - ) - if (start_index !== next_option_string_index) { - let positionals_end_index = consume_positionals(start_index) - - // only try to parse the next optional if we didn't consume - // the option string during the positionals parsing - if (positionals_end_index > start_index) { - start_index = positionals_end_index - continue - } else { - start_index = positionals_end_index - } - } - - // if we consumed all the positionals we could and we're not - // at the index of an option string, there were extra arguments - if (!(start_index in option_string_indices)) { - let strings = arg_strings.slice(start_index, next_option_string_index) - extras = extras.concat(strings) - start_index = next_option_string_index - } - - // consume the next optional and any arguments for it - start_index = consume_optional(start_index) - } - - // consume any positionals following the last Optional - let stop_index = consume_positionals(start_index) - - // if we didn't consume all the argument strings, there were extras - extras = extras.concat(arg_strings.slice(stop_index)) - - // make sure all required actions were present and also convert - // action defaults which were not given as arguments - let required_actions = [] - for (let action of this._actions) { - if (!seen_actions.has(action)) { - if (action.required) { - required_actions.push(_get_action_name(action)) - } else { - // Convert action default now instead of doing it before - // parsing arguments to avoid calling convert functions - // twice (which may fail) if the argument was given, but - // only if it was defined already in the namespace - if (action.default !== undefined && - typeof action.default === 'string' && - hasattr(namespace, action.dest) && - action.default === getattr(namespace, action.dest)) { - setattr(namespace, action.dest, - this._get_value(action, action.default)) - } - } - } - } - - if (required_actions.length) { - this.error(sub('the following arguments are required: %s', - required_actions.join(', '))) - } - - // make sure all required groups had one option present - for (let group of this._mutually_exclusive_groups) { - if (group.required) { - let no_actions_used = true - for (let action of group._group_actions) { - if (seen_non_default_actions.has(action)) { - no_actions_used = false - break - } - } - - // if no actions were used, report the error - if (no_actions_used) { - let names = group._group_actions - .filter(action => action.help !== SUPPRESS) - .map(action => _get_action_name(action)) - let msg = 'one of the arguments %s is required' - this.error(sub(msg, names.join(' '))) - } - } - } - - // return the updated namespace and the extra arguments - return [ namespace, extras ] - } - - _read_args_from_files(arg_strings) { - // expand arguments referencing files - let new_arg_strings = [] - for (let arg_string of arg_strings) { - - // for regular arguments, just add them back into the list - if (!arg_string || !this.fromfile_prefix_chars.includes(arg_string[0])) { - new_arg_strings.push(arg_string) - - // replace arguments referencing files with the file content - } else { - try { - let args_file = fs.readFileSync(arg_string.slice(1), 'utf8') - let arg_strings = [] - for (let arg_line of splitlines(args_file)) { - for (let arg of this.convert_arg_line_to_args(arg_line)) { - arg_strings.push(arg) - } - } - arg_strings = this._read_args_from_files(arg_strings) - new_arg_strings = new_arg_strings.concat(arg_strings) - } catch (err) { - this.error(err.message) - } - } - } - - // return the modified argument list - return new_arg_strings - } - - convert_arg_line_to_args(arg_line) { - return [arg_line] - } - - _match_argument(action, arg_strings_pattern) { - // match the pattern for this action to the arg strings - let nargs_pattern = this._get_nargs_pattern(action) - let match = arg_strings_pattern.match(new RegExp('^' + nargs_pattern)) - - // raise an exception if we weren't able to find a match - if (match === null) { - let nargs_errors = { - undefined: 'expected one argument', - [OPTIONAL]: 'expected at most one argument', - [ONE_OR_MORE]: 'expected at least one argument' - } - let msg = nargs_errors[action.nargs] - if (msg === undefined) { - msg = sub(action.nargs === 1 ? 'expected %s argument' : 'expected %s arguments', action.nargs) - } - throw new ArgumentError(action, msg) - } - - // return the number of arguments matched - return match[1].length - } - - _match_arguments_partial(actions, arg_strings_pattern) { - // progressively shorten the actions list by slicing off the - // final actions until we find a match - let result = [] - for (let i of range(actions.length, 0, -1)) { - let actions_slice = actions.slice(0, i) - let pattern = actions_slice.map(action => this._get_nargs_pattern(action)).join('') - let match = arg_strings_pattern.match(new RegExp('^' + pattern)) - if (match !== null) { - result = result.concat(match.slice(1).map(string => string.length)) - break - } - } - - // return the list of arg string counts - return result - } - - _parse_optional(arg_string) { - // if it's an empty string, it was meant to be a positional - if (!arg_string) { - return undefined - } - - // if it doesn't start with a prefix, it was meant to be positional - if (!this.prefix_chars.includes(arg_string[0])) { - return undefined - } - - // if the option string is present in the parser, return the action - if (arg_string in this._option_string_actions) { - let action = this._option_string_actions[arg_string] - return [ action, arg_string, undefined ] - } - - // if it's just a single character, it was meant to be positional - if (arg_string.length === 1) { - return undefined - } - - // if the option string before the "=" is present, return the action - if (arg_string.includes('=')) { - let [ option_string, explicit_arg ] = _string_split(arg_string, '=', 1) - if (option_string in this._option_string_actions) { - let action = this._option_string_actions[option_string] - return [ action, option_string, explicit_arg ] - } - } - - // search through all possible prefixes of the option string - // and all actions in the parser for possible interpretations - let option_tuples = this._get_option_tuples(arg_string) - - // if multiple actions match, the option string was ambiguous - if (option_tuples.length > 1) { - let options = option_tuples.map(([ /*action*/, option_string/*, explicit_arg*/ ]) => option_string).join(', ') - let args = {option: arg_string, matches: options} - let msg = 'ambiguous option: %(option)s could match %(matches)s' - this.error(sub(msg, args)) - - // if exactly one action matched, this segmentation is good, - // so return the parsed action - } else if (option_tuples.length === 1) { - let [ option_tuple ] = option_tuples - return option_tuple - } - - // if it was not found as an option, but it looks like a negative - // number, it was meant to be positional - // unless there are negative-number-like options - if (this._negative_number_matcher.test(arg_string)) { - if (!this._has_negative_number_optionals.length) { - return undefined - } - } - - // if it contains a space, it was meant to be a positional - if (arg_string.includes(' ')) { - return undefined - } - - // it was meant to be an optional but there is no such option - // in this parser (though it might be a valid option in a subparser) - return [ undefined, arg_string, undefined ] - } - - _get_option_tuples(option_string) { - let result = [] - - // option strings starting with two prefix characters are only - // split at the '=' - let chars = this.prefix_chars - if (chars.includes(option_string[0]) && chars.includes(option_string[1])) { - if (this.allow_abbrev) { - let option_prefix, explicit_arg - if (option_string.includes('=')) { - [ option_prefix, explicit_arg ] = _string_split(option_string, '=', 1) - } else { - option_prefix = option_string - explicit_arg = undefined - } - for (let option_string of Object.keys(this._option_string_actions)) { - if (option_string.startsWith(option_prefix)) { - let action = this._option_string_actions[option_string] - let tup = [ action, option_string, explicit_arg ] - result.push(tup) - } - } - } - - // single character options can be concatenated with their arguments - // but multiple character options always have to have their argument - // separate - } else if (chars.includes(option_string[0]) && !chars.includes(option_string[1])) { - let option_prefix = option_string - let explicit_arg = undefined - let short_option_prefix = option_string.slice(0, 2) - let short_explicit_arg = option_string.slice(2) - - for (let option_string of Object.keys(this._option_string_actions)) { - if (option_string === short_option_prefix) { - let action = this._option_string_actions[option_string] - let tup = [ action, option_string, short_explicit_arg ] - result.push(tup) - } else if (option_string.startsWith(option_prefix)) { - let action = this._option_string_actions[option_string] - let tup = [ action, option_string, explicit_arg ] - result.push(tup) - } - } - - // shouldn't ever get here - } else { - this.error(sub('unexpected option string: %s', option_string)) - } - - // return the collected option tuples - return result - } - - _get_nargs_pattern(action) { - // in all examples below, we have to allow for '--' args - // which are represented as '-' in the pattern - let nargs = action.nargs - let nargs_pattern - - // the default (None) is assumed to be a single argument - if (nargs === undefined) { - nargs_pattern = '(-*A-*)' - - // allow zero or one arguments - } else if (nargs === OPTIONAL) { - nargs_pattern = '(-*A?-*)' - - // allow zero or more arguments - } else if (nargs === ZERO_OR_MORE) { - nargs_pattern = '(-*[A-]*)' - - // allow one or more arguments - } else if (nargs === ONE_OR_MORE) { - nargs_pattern = '(-*A[A-]*)' - - // allow any number of options or arguments - } else if (nargs === REMAINDER) { - nargs_pattern = '([-AO]*)' - - // allow one argument followed by any number of options or arguments - } else if (nargs === PARSER) { - nargs_pattern = '(-*A[-AO]*)' - - // suppress action, like nargs=0 - } else if (nargs === SUPPRESS) { - nargs_pattern = '(-*-*)' - - // all others should be integers - } else { - nargs_pattern = sub('(-*%s-*)', 'A'.repeat(nargs).split('').join('-*')) - } - - // if this is an optional action, -- is not allowed - if (action.option_strings.length) { - nargs_pattern = nargs_pattern.replace(/-\*/g, '') - nargs_pattern = nargs_pattern.replace(/-/g, '') - } - - // return the pattern - return nargs_pattern - } - - // ======================== - // Alt command line argument parsing, allowing free intermix - // ======================== - - parse_intermixed_args(args = undefined, namespace = undefined) { - let argv - [ args, argv ] = this.parse_known_intermixed_args(args, namespace) - if (argv.length) { - let msg = 'unrecognized arguments: %s' - this.error(sub(msg, argv.join(' '))) - } - return args - } - - parse_known_intermixed_args(args = undefined, namespace = undefined) { - // returns a namespace and list of extras - // - // positional can be freely intermixed with optionals. optionals are - // first parsed with all positional arguments deactivated. The 'extras' - // are then parsed. If the parser definition is incompatible with the - // intermixed assumptions (e.g. use of REMAINDER, subparsers) a - // TypeError is raised. - // - // positionals are 'deactivated' by setting nargs and default to - // SUPPRESS. This blocks the addition of that positional to the - // namespace - - let extras - let positionals = this._get_positional_actions() - let a = positionals.filter(action => [ PARSER, REMAINDER ].includes(action.nargs)) - if (a.length) { - throw new TypeError(sub('parse_intermixed_args: positional arg' + - ' with nargs=%s', a[0].nargs)) - } - - for (let group of this._mutually_exclusive_groups) { - for (let action of group._group_actions) { - if (positionals.includes(action)) { - throw new TypeError('parse_intermixed_args: positional in' + - ' mutuallyExclusiveGroup') - } - } - } - - let save_usage - try { - save_usage = this.usage - let remaining_args - try { - if (this.usage === undefined) { - // capture the full usage for use in error messages - this.usage = this.format_usage().slice(7) - } - for (let action of positionals) { - // deactivate positionals - action.save_nargs = action.nargs - // action.nargs = 0 - action.nargs = SUPPRESS - action.save_default = action.default - action.default = SUPPRESS - } - [ namespace, remaining_args ] = this.parse_known_args(args, - namespace) - for (let action of positionals) { - // remove the empty positional values from namespace - let attr = getattr(namespace, action.dest) - if (Array.isArray(attr) && attr.length === 0) { - // eslint-disable-next-line no-console - console.warn(sub('Do not expect %s in %s', action.dest, namespace)) - delattr(namespace, action.dest) - } - } - } finally { - // restore nargs and usage before exiting - for (let action of positionals) { - action.nargs = action.save_nargs - action.default = action.save_default - } - } - let optionals = this._get_optional_actions() - try { - // parse positionals. optionals aren't normally required, but - // they could be, so make sure they aren't. - for (let action of optionals) { - action.save_required = action.required - action.required = false - } - for (let group of this._mutually_exclusive_groups) { - group.save_required = group.required - group.required = false - } - [ namespace, extras ] = this.parse_known_args(remaining_args, - namespace) - } finally { - // restore parser values before exiting - for (let action of optionals) { - action.required = action.save_required - } - for (let group of this._mutually_exclusive_groups) { - group.required = group.save_required - } - } - } finally { - this.usage = save_usage - } - return [ namespace, extras ] - } - - // ======================== - // Value conversion methods - // ======================== - _get_values(action, arg_strings) { - // for everything but PARSER, REMAINDER args, strip out first '--' - if (![PARSER, REMAINDER].includes(action.nargs)) { - try { - _array_remove(arg_strings, '--') - } catch (err) {} - } - - let value - // optional argument produces a default when not present - if (!arg_strings.length && action.nargs === OPTIONAL) { - if (action.option_strings.length) { - value = action.const - } else { - value = action.default - } - if (typeof value === 'string') { - value = this._get_value(action, value) - this._check_value(action, value) - } - - // when nargs='*' on a positional, if there were no command-line - // args, use the default if it is anything other than None - } else if (!arg_strings.length && action.nargs === ZERO_OR_MORE && - !action.option_strings.length) { - if (action.default !== undefined) { - value = action.default - } else { - value = arg_strings - } - this._check_value(action, value) - - // single argument or optional argument produces a single value - } else if (arg_strings.length === 1 && [undefined, OPTIONAL].includes(action.nargs)) { - let arg_string = arg_strings[0] - value = this._get_value(action, arg_string) - this._check_value(action, value) - - // REMAINDER arguments convert all values, checking none - } else if (action.nargs === REMAINDER) { - value = arg_strings.map(v => this._get_value(action, v)) - - // PARSER arguments convert all values, but check only the first - } else if (action.nargs === PARSER) { - value = arg_strings.map(v => this._get_value(action, v)) - this._check_value(action, value[0]) - - // SUPPRESS argument does not put anything in the namespace - } else if (action.nargs === SUPPRESS) { - value = SUPPRESS - - // all other types of nargs produce a list - } else { - value = arg_strings.map(v => this._get_value(action, v)) - for (let v of value) { - this._check_value(action, v) - } - } - - // return the converted value - return value - } - - _get_value(action, arg_string) { - let type_func = this._registry_get('type', action.type, action.type) - if (typeof type_func !== 'function') { - let msg = '%r is not callable' - throw new ArgumentError(action, sub(msg, type_func)) - } - - // convert the value to the appropriate type - let result - try { - try { - result = type_func(arg_string) - } catch (err) { - // Dear TC39, why would you ever consider making es6 classes not callable? - // We had one universal interface, [[Call]], which worked for anything - // (with familiar this-instanceof guard for classes). Now we have two. - if (err instanceof TypeError && - /Class constructor .* cannot be invoked without 'new'/.test(err.message)) { - // eslint-disable-next-line new-cap - result = new type_func(arg_string) - } else { - throw err - } - } - - } catch (err) { - // ArgumentTypeErrors indicate errors - if (err instanceof ArgumentTypeError) { - //let name = getattr(action.type, 'name', repr(action.type)) - let msg = err.message - throw new ArgumentError(action, msg) - - // TypeErrors or ValueErrors also indicate errors - } else if (err instanceof TypeError) { - let name = getattr(action.type, 'name', repr(action.type)) - let args = {type: name, value: arg_string} - let msg = 'invalid %(type)s value: %(value)r' - throw new ArgumentError(action, sub(msg, args)) - } else { - throw err - } - } - - // return the converted value - return result - } - - _check_value(action, value) { - // converted value must be one of the choices (if specified) - if (action.choices !== undefined && !_choices_to_array(action.choices).includes(value)) { - let args = {value, - choices: _choices_to_array(action.choices).map(repr).join(', ')} - let msg = 'invalid choice: %(value)r (choose from %(choices)s)' - throw new ArgumentError(action, sub(msg, args)) - } - } - - // ======================= - // Help-formatting methods - // ======================= - format_usage() { - let formatter = this._get_formatter() - formatter.add_usage(this.usage, this._actions, - this._mutually_exclusive_groups) - return formatter.format_help() - } - - format_help() { - let formatter = this._get_formatter() - - // usage - formatter.add_usage(this.usage, this._actions, - this._mutually_exclusive_groups) - - // description - formatter.add_text(this.description) - - // positionals, optionals and user-defined groups - for (let action_group of this._action_groups) { - formatter.start_section(action_group.title) - formatter.add_text(action_group.description) - formatter.add_arguments(action_group._group_actions) - formatter.end_section() - } - - // epilog - formatter.add_text(this.epilog) - - // determine help from format above - return formatter.format_help() - } - - _get_formatter() { - // eslint-disable-next-line new-cap - return new this.formatter_class({ prog: this.prog }) - } - - // ===================== - // Help-printing methods - // ===================== - print_usage(file = undefined) { - if (file === undefined) file = process.stdout - this._print_message(this.format_usage(), file) - } - - print_help(file = undefined) { - if (file === undefined) file = process.stdout - this._print_message(this.format_help(), file) - } - - _print_message(message, file = undefined) { - if (message) { - if (file === undefined) file = process.stderr - file.write(message) - } - } - - // =============== - // Exiting methods - // =============== - exit(status = 0, message = undefined) { - if (message) { - this._print_message(message, process.stderr) - } - process.exit(status) - } - - error(message) { - /* - * error(message: string) - * - * Prints a usage message incorporating the message to stderr and - * exits. - * - * If you override this in a subclass, it should not return -- it - * should either exit or raise an exception. - */ - - // LEGACY (v1 compatibility), debug mode - if (this.debug === true) throw new Error(message) - // end - this.print_usage(process.stderr) - let args = {prog: this.prog, message: message} - this.exit(2, sub('%(prog)s: error: %(message)s\n', args)) - } -})) - - -module.exports = { - ArgumentParser, - ArgumentError, - ArgumentTypeError, - BooleanOptionalAction, - FileType, - HelpFormatter, - ArgumentDefaultsHelpFormatter, - RawDescriptionHelpFormatter, - RawTextHelpFormatter, - MetavarTypeHelpFormatter, - Namespace, - Action, - ONE_OR_MORE, - OPTIONAL, - PARSER, - REMAINDER, - SUPPRESS, - ZERO_OR_MORE -} - -// LEGACY (v1 compatibility), Const alias -Object.defineProperty(module.exports, 'Const', { - get() { - let result = {} - Object.entries({ ONE_OR_MORE, OPTIONAL, PARSER, REMAINDER, SUPPRESS, ZERO_OR_MORE }).forEach(([ n, v ]) => { - Object.defineProperty(result, n, { - get() { - deprecate(n, sub('use argparse.%s instead of argparse.Const.%s', n, n)) - return v - } - }) - }) - Object.entries({ _UNRECOGNIZED_ARGS_ATTR }).forEach(([ n, v ]) => { - Object.defineProperty(result, n, { - get() { - deprecate(n, sub('argparse.Const.%s is an internal symbol and will no longer be available', n)) - return v - } - }) - }) - return result - }, - enumerable: false -}) -// end diff --git a/node_modules/argparse/lib/sub.js b/node_modules/argparse/lib/sub.js deleted file mode 100644 index e3eb3215f..000000000 --- a/node_modules/argparse/lib/sub.js +++ /dev/null @@ -1,67 +0,0 @@ -// Limited implementation of python % string operator, supports only %s and %r for now -// (other formats are not used here, but may appear in custom templates) - -'use strict' - -const { inspect } = require('util') - - -module.exports = function sub(pattern, ...values) { - let regex = /%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g - - let result = pattern.replace(regex, function (_, is_literal, is_left_align, is_padded, name, format) { - if (is_literal) return '%' - - let padded_count = 0 - if (is_padded) { - if (values.length === 0) throw new TypeError('not enough arguments for format string') - padded_count = values.shift() - if (!Number.isInteger(padded_count)) throw new TypeError('* wants int') - } - - let str - if (name !== undefined) { - let dict = values[0] - if (typeof dict !== 'object' || dict === null) throw new TypeError('format requires a mapping') - if (!(name in dict)) throw new TypeError(`no such key: '${name}'`) - str = dict[name] - } else { - if (values.length === 0) throw new TypeError('not enough arguments for format string') - str = values.shift() - } - - switch (format) { - case 's': - str = String(str) - break - case 'r': - str = inspect(str) - break - case 'd': - case 'i': - if (typeof str !== 'number') { - throw new TypeError(`%${format} format: a number is required, not ${typeof str}`) - } - str = String(str.toFixed(0)) - break - default: - throw new TypeError(`unsupported format character '${format}'`) - } - - if (padded_count > 0) { - return is_left_align ? str.padEnd(padded_count) : str.padStart(padded_count) - } else { - return str - } - }) - - if (values.length) { - if (values.length === 1 && typeof values[0] === 'object' && values[0] !== null) { - // mapping - } else { - throw new TypeError('not all arguments converted during string formatting') - } - } - - return result -} diff --git a/node_modules/argparse/lib/textwrap.js b/node_modules/argparse/lib/textwrap.js deleted file mode 100644 index 23d51cdb9..000000000 --- a/node_modules/argparse/lib/textwrap.js +++ /dev/null @@ -1,440 +0,0 @@ -// Partial port of python's argparse module, version 3.9.0 (only wrap and fill functions): -// https://github.com/python/cpython/blob/v3.9.0b4/Lib/textwrap.py - -'use strict' - -/* - * Text wrapping and filling. - */ - -// Copyright (C) 1999-2001 Gregory P. Ward. -// Copyright (C) 2002, 2003 Python Software Foundation. -// Copyright (C) 2020 argparse.js authors -// Originally written by Greg Ward - -// Hardcode the recognized whitespace characters to the US-ASCII -// whitespace characters. The main reason for doing this is that -// some Unicode spaces (like \u00a0) are non-breaking whitespaces. -// -// This less funky little regex just split on recognized spaces. E.g. -// "Hello there -- you goof-ball, use the -b option!" -// splits into -// Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/ -const wordsep_simple_re = /([\t\n\x0b\x0c\r ]+)/ - -class TextWrapper { - /* - * Object for wrapping/filling text. The public interface consists of - * the wrap() and fill() methods; the other methods are just there for - * subclasses to override in order to tweak the default behaviour. - * If you want to completely replace the main wrapping algorithm, - * you'll probably have to override _wrap_chunks(). - * - * Several instance attributes control various aspects of wrapping: - * width (default: 70) - * the maximum width of wrapped lines (unless break_long_words - * is false) - * initial_indent (default: "") - * string that will be prepended to the first line of wrapped - * output. Counts towards the line's width. - * subsequent_indent (default: "") - * string that will be prepended to all lines save the first - * of wrapped output; also counts towards each line's width. - * expand_tabs (default: true) - * Expand tabs in input text to spaces before further processing. - * Each tab will become 0 .. 'tabsize' spaces, depending on its position - * in its line. If false, each tab is treated as a single character. - * tabsize (default: 8) - * Expand tabs in input text to 0 .. 'tabsize' spaces, unless - * 'expand_tabs' is false. - * replace_whitespace (default: true) - * Replace all whitespace characters in the input text by spaces - * after tab expansion. Note that if expand_tabs is false and - * replace_whitespace is true, every tab will be converted to a - * single space! - * fix_sentence_endings (default: false) - * Ensure that sentence-ending punctuation is always followed - * by two spaces. Off by default because the algorithm is - * (unavoidably) imperfect. - * break_long_words (default: true) - * Break words longer than 'width'. If false, those words will not - * be broken, and some lines might be longer than 'width'. - * break_on_hyphens (default: true) - * Allow breaking hyphenated words. If true, wrapping will occur - * preferably on whitespaces and right after hyphens part of - * compound words. - * drop_whitespace (default: true) - * Drop leading and trailing whitespace from lines. - * max_lines (default: None) - * Truncate wrapped lines. - * placeholder (default: ' [...]') - * Append to the last line of truncated text. - */ - - constructor(options = {}) { - let { - width = 70, - initial_indent = '', - subsequent_indent = '', - expand_tabs = true, - replace_whitespace = true, - fix_sentence_endings = false, - break_long_words = true, - drop_whitespace = true, - break_on_hyphens = true, - tabsize = 8, - max_lines = undefined, - placeholder=' [...]' - } = options - - this.width = width - this.initial_indent = initial_indent - this.subsequent_indent = subsequent_indent - this.expand_tabs = expand_tabs - this.replace_whitespace = replace_whitespace - this.fix_sentence_endings = fix_sentence_endings - this.break_long_words = break_long_words - this.drop_whitespace = drop_whitespace - this.break_on_hyphens = break_on_hyphens - this.tabsize = tabsize - this.max_lines = max_lines - this.placeholder = placeholder - } - - - // -- Private methods ----------------------------------------------- - // (possibly useful for subclasses to override) - - _munge_whitespace(text) { - /* - * _munge_whitespace(text : string) -> string - * - * Munge whitespace in text: expand tabs and convert all other - * whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz" - * becomes " foo bar baz". - */ - if (this.expand_tabs) { - text = text.replace(/\t/g, ' '.repeat(this.tabsize)) // not strictly correct in js - } - if (this.replace_whitespace) { - text = text.replace(/[\t\n\x0b\x0c\r]/g, ' ') - } - return text - } - - _split(text) { - /* - * _split(text : string) -> [string] - * - * Split the text to wrap into indivisible chunks. Chunks are - * not quite the same as words; see _wrap_chunks() for full - * details. As an example, the text - * Look, goof-ball -- use the -b option! - * breaks into the following chunks: - * 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ', - * 'use', ' ', 'the', ' ', '-b', ' ', 'option!' - * if break_on_hyphens is True, or in: - * 'Look,', ' ', 'goof-ball', ' ', '--', ' ', - * 'use', ' ', 'the', ' ', '-b', ' ', option!' - * otherwise. - */ - let chunks = text.split(wordsep_simple_re) - chunks = chunks.filter(Boolean) - return chunks - } - - _handle_long_word(reversed_chunks, cur_line, cur_len, width) { - /* - * _handle_long_word(chunks : [string], - * cur_line : [string], - * cur_len : int, width : int) - * - * Handle a chunk of text (most likely a word, not whitespace) that - * is too long to fit in any line. - */ - // Figure out when indent is larger than the specified width, and make - // sure at least one character is stripped off on every pass - let space_left - if (width < 1) { - space_left = 1 - } else { - space_left = width - cur_len - } - - // If we're allowed to break long words, then do so: put as much - // of the next chunk onto the current line as will fit. - if (this.break_long_words) { - cur_line.push(reversed_chunks[reversed_chunks.length - 1].slice(0, space_left)) - reversed_chunks[reversed_chunks.length - 1] = reversed_chunks[reversed_chunks.length - 1].slice(space_left) - - // Otherwise, we have to preserve the long word intact. Only add - // it to the current line if there's nothing already there -- - // that minimizes how much we violate the width constraint. - } else if (!cur_line) { - cur_line.push(...reversed_chunks.pop()) - } - - // If we're not allowed to break long words, and there's already - // text on the current line, do nothing. Next time through the - // main loop of _wrap_chunks(), we'll wind up here again, but - // cur_len will be zero, so the next line will be entirely - // devoted to the long word that we can't handle right now. - } - - _wrap_chunks(chunks) { - /* - * _wrap_chunks(chunks : [string]) -> [string] - * - * Wrap a sequence of text chunks and return a list of lines of - * length 'self.width' or less. (If 'break_long_words' is false, - * some lines may be longer than this.) Chunks correspond roughly - * to words and the whitespace between them: each chunk is - * indivisible (modulo 'break_long_words'), but a line break can - * come between any two chunks. Chunks should not have internal - * whitespace; ie. a chunk is either all whitespace or a "word". - * Whitespace chunks will be removed from the beginning and end of - * lines, but apart from that whitespace is preserved. - */ - let lines = [] - let indent - if (this.width <= 0) { - throw Error(`invalid width ${this.width} (must be > 0)`) - } - if (this.max_lines !== undefined) { - if (this.max_lines > 1) { - indent = this.subsequent_indent - } else { - indent = this.initial_indent - } - if (indent.length + this.placeholder.trimStart().length > this.width) { - throw Error('placeholder too large for max width') - } - } - - // Arrange in reverse order so items can be efficiently popped - // from a stack of chucks. - chunks = chunks.reverse() - - while (chunks.length > 0) { - - // Start the list of chunks that will make up the current line. - // cur_len is just the length of all the chunks in cur_line. - let cur_line = [] - let cur_len = 0 - - // Figure out which static string will prefix this line. - let indent - if (lines) { - indent = this.subsequent_indent - } else { - indent = this.initial_indent - } - - // Maximum width for this line. - let width = this.width - indent.length - - // First chunk on line is whitespace -- drop it, unless this - // is the very beginning of the text (ie. no lines started yet). - if (this.drop_whitespace && chunks[chunks.length - 1].trim() === '' && lines.length > 0) { - chunks.pop() - } - - while (chunks.length > 0) { - let l = chunks[chunks.length - 1].length - - // Can at least squeeze this chunk onto the current line. - if (cur_len + l <= width) { - cur_line.push(chunks.pop()) - cur_len += l - - // Nope, this line is full. - } else { - break - } - } - - // The current line is full, and the next chunk is too big to - // fit on *any* line (not just this one). - if (chunks.length && chunks[chunks.length - 1].length > width) { - this._handle_long_word(chunks, cur_line, cur_len, width) - cur_len = cur_line.map(l => l.length).reduce((a, b) => a + b, 0) - } - - // If the last chunk on this line is all whitespace, drop it. - if (this.drop_whitespace && cur_line.length > 0 && cur_line[cur_line.length - 1].trim() === '') { - cur_len -= cur_line[cur_line.length - 1].length - cur_line.pop() - } - - if (cur_line) { - if (this.max_lines === undefined || - lines.length + 1 < this.max_lines || - (chunks.length === 0 || - this.drop_whitespace && - chunks.length === 1 && - !chunks[0].trim()) && cur_len <= width) { - // Convert current line back to a string and store it in - // list of all lines (return value). - lines.push(indent + cur_line.join('')) - } else { - let had_break = false - while (cur_line) { - if (cur_line[cur_line.length - 1].trim() && - cur_len + this.placeholder.length <= width) { - cur_line.push(this.placeholder) - lines.push(indent + cur_line.join('')) - had_break = true - break - } - cur_len -= cur_line[-1].length - cur_line.pop() - } - if (!had_break) { - if (lines) { - let prev_line = lines[lines.length - 1].trimEnd() - if (prev_line.length + this.placeholder.length <= - this.width) { - lines[lines.length - 1] = prev_line + this.placeholder - break - } - } - lines.push(indent + this.placeholder.lstrip()) - } - break - } - } - } - - return lines - } - - _split_chunks(text) { - text = this._munge_whitespace(text) - return this._split(text) - } - - // -- Public interface ---------------------------------------------- - - wrap(text) { - /* - * wrap(text : string) -> [string] - * - * Reformat the single paragraph in 'text' so it fits in lines of - * no more than 'self.width' columns, and return a list of wrapped - * lines. Tabs in 'text' are expanded with string.expandtabs(), - * and all other whitespace characters (including newline) are - * converted to space. - */ - let chunks = this._split_chunks(text) - // not implemented in js - //if (this.fix_sentence_endings) { - // this._fix_sentence_endings(chunks) - //} - return this._wrap_chunks(chunks) - } - - fill(text) { - /* - * fill(text : string) -> string - * - * Reformat the single paragraph in 'text' to fit in lines of no - * more than 'self.width' columns, and return a new string - * containing the entire wrapped paragraph. - */ - return this.wrap(text).join('\n') - } -} - - -// -- Convenience interface --------------------------------------------- - -function wrap(text, options = {}) { - /* - * Wrap a single paragraph of text, returning a list of wrapped lines. - * - * Reformat the single paragraph in 'text' so it fits in lines of no - * more than 'width' columns, and return a list of wrapped lines. By - * default, tabs in 'text' are expanded with string.expandtabs(), and - * all other whitespace characters (including newline) are converted to - * space. See TextWrapper class for available keyword args to customize - * wrapping behaviour. - */ - let { width = 70, ...kwargs } = options - let w = new TextWrapper(Object.assign({ width }, kwargs)) - return w.wrap(text) -} - -function fill(text, options = {}) { - /* - * Fill a single paragraph of text, returning a new string. - * - * Reformat the single paragraph in 'text' to fit in lines of no more - * than 'width' columns, and return a new string containing the entire - * wrapped paragraph. As with wrap(), tabs are expanded and other - * whitespace characters converted to space. See TextWrapper class for - * available keyword args to customize wrapping behaviour. - */ - let { width = 70, ...kwargs } = options - let w = new TextWrapper(Object.assign({ width }, kwargs)) - return w.fill(text) -} - -// -- Loosely related functionality ------------------------------------- - -let _whitespace_only_re = /^[ \t]+$/mg -let _leading_whitespace_re = /(^[ \t]*)(?:[^ \t\n])/mg - -function dedent(text) { - /* - * Remove any common leading whitespace from every line in `text`. - * - * This can be used to make triple-quoted strings line up with the left - * edge of the display, while still presenting them in the source code - * in indented form. - * - * Note that tabs and spaces are both treated as whitespace, but they - * are not equal: the lines " hello" and "\\thello" are - * considered to have no common leading whitespace. - * - * Entirely blank lines are normalized to a newline character. - */ - // Look for the longest leading string of spaces and tabs common to - // all lines. - let margin = undefined - text = text.replace(_whitespace_only_re, '') - let indents = text.match(_leading_whitespace_re) || [] - for (let indent of indents) { - indent = indent.slice(0, -1) - - if (margin === undefined) { - margin = indent - - // Current line more deeply indented than previous winner: - // no change (previous winner is still on top). - } else if (indent.startsWith(margin)) { - // pass - - // Current line consistent with and no deeper than previous winner: - // it's the new winner. - } else if (margin.startsWith(indent)) { - margin = indent - - // Find the largest common whitespace between current line and previous - // winner. - } else { - for (let i = 0; i < margin.length && i < indent.length; i++) { - if (margin[i] !== indent[i]) { - margin = margin.slice(0, i) - break - } - } - } - } - - if (margin) { - text = text.replace(new RegExp('^' + margin, 'mg'), '') - } - return text -} - -module.exports = { wrap, fill, dedent } diff --git a/node_modules/argparse/package.json b/node_modules/argparse/package.json deleted file mode 100644 index 647d2aff1..000000000 --- a/node_modules/argparse/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "argparse", - "description": "CLI arguments parser. Native port of python's argparse.", - "version": "2.0.1", - "keywords": [ - "cli", - "parser", - "argparse", - "option", - "args" - ], - "main": "argparse.js", - "files": [ - "argparse.js", - "lib/" - ], - "license": "Python-2.0", - "repository": "nodeca/argparse", - "scripts": { - "lint": "eslint .", - "test": "npm run lint && nyc mocha", - "coverage": "npm run test && nyc report --reporter html" - }, - "devDependencies": { - "@babel/eslint-parser": "^7.11.0", - "@babel/plugin-syntax-class-properties": "^7.10.4", - "eslint": "^7.5.0", - "mocha": "^8.0.1", - "nyc": "^15.1.0" - } -} diff --git a/node_modules/array-union/index.d.ts b/node_modules/array-union/index.d.ts deleted file mode 100644 index 379fc1d2f..000000000 --- a/node_modules/array-union/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** -Create an array of unique values, in order, from the input arrays. - -@example -``` -import arrayUnion = require('array-union'); - -arrayUnion([1, 1, 2, 3], [2, 3]); -//=> [1, 2, 3] - -arrayUnion(['foo', 'foo', 'bar']); -//=> ['foo', 'bar'] - -arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']); -//=> ['🐱', '🦄', '🐻', '🌈'] - -arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']); -//=> ['🐱', '🦄', '🐻', '🐶', '🌈'] -``` -*/ -declare function arrayUnion( - ...arguments: readonly ArgumentsType[] -): ArgumentsType; - -export = arrayUnion; diff --git a/node_modules/array-union/index.js b/node_modules/array-union/index.js deleted file mode 100644 index 7f85d3d19..000000000 --- a/node_modules/array-union/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = (...arguments_) => { - return [...new Set([].concat(...arguments_))]; -}; diff --git a/node_modules/array-union/license b/node_modules/array-union/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/array-union/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/array-union/package.json b/node_modules/array-union/package.json deleted file mode 100644 index 5ad5afa71..000000000 --- a/node_modules/array-union/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "array-union", - "version": "2.1.0", - "description": "Create an array of unique values, in order, from the input arrays", - "license": "MIT", - "repository": "sindresorhus/array-union", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "array", - "set", - "uniq", - "unique", - "duplicate", - "remove", - "union", - "combine", - "merge" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/array-union/readme.md b/node_modules/array-union/readme.md deleted file mode 100644 index 2474a1aed..000000000 --- a/node_modules/array-union/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# array-union [![Build Status](https://travis-ci.org/sindresorhus/array-union.svg?branch=master)](https://travis-ci.org/sindresorhus/array-union) - -> Create an array of unique values, in order, from the input arrays - - -## Install - -``` -$ npm install array-union -``` - - -## Usage - -```js -const arrayUnion = require('array-union'); - -arrayUnion([1, 1, 2, 3], [2, 3]); -//=> [1, 2, 3] - -arrayUnion(['foo', 'foo', 'bar']); -//=> ['foo', 'bar'] - -arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']); -//=> ['🐱', '🦄', '🐻', '🌈'] - -arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']); -//=> ['🐱', '🦄', '🐻', '🐶', '🌈'] -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/arrify/index.js b/node_modules/arrify/index.js deleted file mode 100644 index 2a2fdeeb1..000000000 --- a/node_modules/arrify/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; -module.exports = function (val) { - if (val === null || val === undefined) { - return []; - } - - return Array.isArray(val) ? val : [val]; -}; diff --git a/node_modules/arrify/license b/node_modules/arrify/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/arrify/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/arrify/package.json b/node_modules/arrify/package.json deleted file mode 100644 index 1e63e5971..000000000 --- a/node_modules/arrify/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "arrify", - "version": "1.0.1", - "description": "Convert a value to an array", - "license": "MIT", - "repository": "sindresorhus/arrify", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "array", - "arr", - "arrify", - "arrayify", - "convert", - "value" - ], - "devDependencies": { - "ava": "*", - "xo": "*" - } -} diff --git a/node_modules/arrify/readme.md b/node_modules/arrify/readme.md deleted file mode 100644 index 183d07576..000000000 --- a/node_modules/arrify/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# arrify [![Build Status](https://travis-ci.org/sindresorhus/arrify.svg?branch=master)](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) diff --git a/node_modules/astral-regex/index.d.ts b/node_modules/astral-regex/index.d.ts deleted file mode 100644 index e81ac3158..000000000 --- a/node_modules/astral-regex/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -declare namespace astralRegex { - interface Options { - /** - Only match an exact string. Useful with `RegExp#test()` to check if a string is a astral symbol. Default: `false` _(Matches any astral symbols in a string)_ - */ - readonly exact?: boolean; - } -} - -/** -Regular expression for matching [astral symbols](https://everything2.com/title/astral+plane). - -@returns A `RegExp` for matching astral symbols. - -@example -``` -import astralRegex = require('astral-regex'); - -astralRegex({exact: true}).test('🦄'); -//=> true - -'foo 🦄 💩 bar'.match(astralRegex()); -//=> ['🦄', '💩'] -``` -*/ -declare function astralRegex(options?: astralRegex.Options): RegExp; - -export = astralRegex; diff --git a/node_modules/astral-regex/index.js b/node_modules/astral-regex/index.js deleted file mode 100644 index 651177d40..000000000 --- a/node_modules/astral-regex/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -const regex = '[\uD800-\uDBFF][\uDC00-\uDFFF]'; - -const astralRegex = options => options && options.exact ? new RegExp(`^${regex}$`) : new RegExp(regex, 'g'); - -module.exports = astralRegex; diff --git a/node_modules/astral-regex/license b/node_modules/astral-regex/license deleted file mode 100644 index db6bc32cc..000000000 --- a/node_modules/astral-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Kevin Mårtensson (github.com/kevva) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/astral-regex/package.json b/node_modules/astral-regex/package.json deleted file mode 100644 index d1ceea7f3..000000000 --- a/node_modules/astral-regex/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "astral-regex", - "version": "2.0.0", - "description": "Regular expression for matching astral symbols", - "license": "MIT", - "repository": "kevva/astral-regex", - "author": { - "name": "Kevin Mårtensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "astral", - "emoji", - "regex", - "surrogate" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/astral-regex/readme.md b/node_modules/astral-regex/readme.md deleted file mode 100644 index 89d6659a4..000000000 --- a/node_modules/astral-regex/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# astral-regex [![Build Status](https://travis-ci.org/kevva/astral-regex.svg?branch=master)](https://travis-ci.org/kevva/astral-regex) - -> Regular expression for matching [astral symbols](https://everything2.com/title/astral+plane) - - -## Install - -``` -$ npm install astral-regex -``` - - -## Usage - -```js -const astralRegex = require('astral-regex'); - -astralRegex({exact: true}).test('🦄'); -//=> true - -'foo 🦄 💩 bar'.match(astralRegex()); -//=> ['🦄', '💩'] -``` - - -## API - -### astralRegex([options]) - -Returns a `RegExp` for matching astral symbols. - -#### options - -Type: `Object` - -##### exact - -Type: `boolean`
-Default: `false` *(Matches any astral symbols in a string)* - -Only match an exact string. Useful with `RegExp#test()` to check if a string is a astral symbol. - - -## License - -MIT © [Kevin Mårtensson](https://github.com/kevva) diff --git a/node_modules/balanced-match/.github/FUNDING.yml b/node_modules/balanced-match/.github/FUNDING.yml deleted file mode 100644 index 1c904eb2b..000000000 --- a/node_modules/balanced-match/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -tidelift: 'npm/balanced-match' -patreon: juliangruber diff --git a/node_modules/balanced-match/LICENSE.md b/node_modules/balanced-match/LICENSE.md deleted file mode 100644 index 2cdc8e414..000000000 --- a/node_modules/balanced-match/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/balanced-match/README.md b/node_modules/balanced-match/README.md deleted file mode 100644 index a7ccfec3c..000000000 --- a/node_modules/balanced-match/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match') - -console.log(balanced('{', '}', 'pre{in{nested}}post')) -console.log(balanced('{', '}', 'pre{first}between{second}post')) -console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')) -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -- **start** the index of the first match of `a` -- **end** the index of the matching `b` -- **pre** the preamble, `a` and `b` not included -- **body** the match, `a` and `b` not included -- **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## Security contact information - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/balanced-match/index.js b/node_modules/balanced-match/index.js deleted file mode 100644 index 7c3266fff..000000000 --- a/node_modules/balanced-match/index.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' -module.exports = balanced -function balanced (a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str) - if (b instanceof RegExp) b = maybeMatch(b, str) - - const r = range(a, b, str) - - return ( - r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - } - ) -} - -function maybeMatch (reg, str) { - const m = str.match(reg) - return m ? m[0] : null -} - -balanced.range = range -function range (a, b, str) { - let begs, beg, left, right, result - let ai = str.indexOf(a) - let bi = str.indexOf(b, ai + 1) - let i = ai - - if (ai >= 0 && bi > 0) { - if (a === b) { - return [ai, bi] - } - begs = [] - left = str.length - - while (i >= 0 && !result) { - if (i === ai) { - begs.push(i) - ai = str.indexOf(a, i + 1) - } else if (begs.length === 1) { - result = [begs.pop(), bi] - } else { - beg = begs.pop() - if (beg < left) { - left = beg - right = bi - } - - bi = str.indexOf(b, i + 1) - } - - i = ai < bi && ai >= 0 ? ai : bi - } - - if (begs.length) { - result = [left, right] - } - } - - return result -} diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json deleted file mode 100644 index c304ecff2..000000000 --- a/node_modules/balanced-match/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "2.0.0", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "prettier-standard && standard && tape test/test.js", - "bench": "matcha test/bench.js", - "release": "np" - }, - "devDependencies": { - "@c4312/matcha": "^1.3.1", - "np": "^7.4.0", - "prettier-standard": "^16.4.1", - "standard": "^16.0.3", - "tape": "^4.6.0" - }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/node_modules/brace-expansion/LICENSE b/node_modules/brace-expansion/LICENSE deleted file mode 100644 index de3226673..000000000 --- a/node_modules/brace-expansion/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013 Julian Gruber - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/brace-expansion/README.md b/node_modules/brace-expansion/README.md deleted file mode 100644 index 6b4e0e164..000000000 --- a/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) -[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## Sponsors - -This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! - -Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/brace-expansion/index.js b/node_modules/brace-expansion/index.js deleted file mode 100644 index 0478be81e..000000000 --- a/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,201 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/node_modules/brace-expansion/node_modules/balanced-match/.github/FUNDING.yml b/node_modules/brace-expansion/node_modules/balanced-match/.github/FUNDING.yml deleted file mode 100644 index cea8b16e9..000000000 --- a/node_modules/brace-expansion/node_modules/balanced-match/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -tidelift: "npm/balanced-match" -patreon: juliangruber diff --git a/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md deleted file mode 100644 index 2cdc8e414..000000000 --- a/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/brace-expansion/node_modules/balanced-match/README.md b/node_modules/brace-expansion/node_modules/balanced-match/README.md deleted file mode 100644 index d2a48b6b4..000000000 --- a/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## Security contact information - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/brace-expansion/node_modules/balanced-match/index.js b/node_modules/brace-expansion/node_modules/balanced-match/index.js deleted file mode 100644 index c67a64608..000000000 --- a/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - if(a===b) { - return [ai, bi]; - } - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} diff --git a/node_modules/brace-expansion/node_modules/balanced-match/package.json b/node_modules/brace-expansion/node_modules/balanced-match/package.json deleted file mode 100644 index ce6073e04..000000000 --- a/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "1.0.2", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "tape test/test.js", - "bench": "matcha test/bench.js" - }, - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json deleted file mode 100644 index a18faa8fd..000000000 --- a/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.11", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "main": "index.js", - "scripts": { - "test": "tape test/*.js", - "gentest": "bash test/generate.sh", - "bench": "matcha test/perf/bench.js" - }, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - }, - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "keywords": [], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/node_modules/braces/CHANGELOG.md b/node_modules/braces/CHANGELOG.md deleted file mode 100644 index 36f798b00..000000000 --- a/node_modules/braces/CHANGELOG.md +++ /dev/null @@ -1,184 +0,0 @@ -# Release history - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -
- Guiding Principles - -- Changelogs are for humans, not machines. -- There should be an entry for every single version. -- The same types of changes should be grouped. -- Versions and sections should be linkable. -- The latest version comes first. -- The release date of each versions is displayed. -- Mention whether you follow Semantic Versioning. - -
- -
- Types of changes - -Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): - -- `Added` for new features. -- `Changed` for changes in existing functionality. -- `Deprecated` for soon-to-be removed features. -- `Removed` for now removed features. -- `Fixed` for any bug fixes. -- `Security` in case of vulnerabilities. - -
- -## [3.0.0] - 2018-04-08 - -v3.0 is a complete refactor, resulting in a faster, smaller codebase, with fewer deps, and a more accurate parser and compiler. - -**Breaking Changes** - -- The undocumented `.makeRe` method was removed - -**Non-breaking changes** - -- Caching was removed - -## [2.3.2] - 2018-04-08 - -- start refactoring -- cover sets -- better range handling - -## [2.3.1] - 2018-02-17 - -- Remove unnecessary escape in Regex. (#14) - -## [2.3.0] - 2017-10-19 - -- minor code reorganization -- optimize regex -- expose `maxLength` option - -## [2.2.1] - 2017-05-30 - -- don't condense when braces contain extglobs - -## [2.2.0] - 2017-05-28 - -- ensure word boundaries are preserved -- fixes edge case where extglob characters precede a brace pattern - -## [2.1.1] - 2017-04-27 - -- use snapdragon-node -- handle edge case -- optimizations, lint - -## [2.0.4] - 2017-04-11 - -- pass opts to compiler -- minor optimization in create method -- re-write parser handlers to remove negation regex - -## [2.0.3] - 2016-12-10 - -- use split-string -- clear queue at the end -- adds sequences example -- add unit tests - -## [2.0.2] - 2016-10-21 - -- fix comma handling in nested extglobs - -## [2.0.1] - 2016-10-20 - -- add comments -- more tests, ensure quotes are stripped - -## [2.0.0] - 2016-10-19 - -- don't expand braces inside character classes -- add quantifier pattern - -## [1.8.5] - 2016-05-21 - -- Refactor (#10) - -## [1.8.4] - 2016-04-20 - -- fixes https://github.com/jonschlinkert/micromatch/issues/66 - -## [1.8.0] - 2015-03-18 - -- adds exponent examples, tests -- fixes the first example in https://github.com/jonschlinkert/micromatch/issues/38 - -## [1.6.0] - 2015-01-30 - -- optimizations, `bash` mode: -- improve path escaping - -## [1.5.0] - 2015-01-28 - -- Merge pull request #5 from eush77/lib-files - -## [1.4.0] - 2015-01-24 - -- add extglob tests -- externalize exponent function -- better whitespace handling - -## [1.3.0] - 2015-01-24 - -- make regex patterns explicity - -## [1.1.0] - 2015-01-11 - -- don't create a match group with `makeRe` - -## [1.0.0] - 2014-12-23 - -- Merge commit '97b05f5544f8348736a8efaecf5c32bbe3e2ad6e' -- support empty brace syntax -- better bash coverage -- better support for regex strings - -## [0.1.4] - 2014-11-14 - -- improve recognition of bad args, recognize mismatched argument types -- support escaping -- remove pathname-expansion -- support whitespace in patterns - -## [0.1.0] - -- first commit - -[2.3.2]: https://github.com/micromatch/braces/compare/2.3.1...2.3.2 -[2.3.1]: https://github.com/micromatch/braces/compare/2.3.0...2.3.1 -[2.3.0]: https://github.com/micromatch/braces/compare/2.2.1...2.3.0 -[2.2.1]: https://github.com/micromatch/braces/compare/2.2.0...2.2.1 -[2.2.0]: https://github.com/micromatch/braces/compare/2.1.1...2.2.0 -[2.1.1]: https://github.com/micromatch/braces/compare/2.1.0...2.1.1 -[2.1.0]: https://github.com/micromatch/braces/compare/2.0.4...2.1.0 -[2.0.4]: https://github.com/micromatch/braces/compare/2.0.3...2.0.4 -[2.0.3]: https://github.com/micromatch/braces/compare/2.0.2...2.0.3 -[2.0.2]: https://github.com/micromatch/braces/compare/2.0.1...2.0.2 -[2.0.1]: https://github.com/micromatch/braces/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/micromatch/braces/compare/1.8.5...2.0.0 -[1.8.5]: https://github.com/micromatch/braces/compare/1.8.4...1.8.5 -[1.8.4]: https://github.com/micromatch/braces/compare/1.8.0...1.8.4 -[1.8.0]: https://github.com/micromatch/braces/compare/1.6.0...1.8.0 -[1.6.0]: https://github.com/micromatch/braces/compare/1.5.0...1.6.0 -[1.5.0]: https://github.com/micromatch/braces/compare/1.4.0...1.5.0 -[1.4.0]: https://github.com/micromatch/braces/compare/1.3.0...1.4.0 -[1.3.0]: https://github.com/micromatch/braces/compare/1.2.0...1.3.0 -[1.2.0]: https://github.com/micromatch/braces/compare/1.1.0...1.2.0 -[1.1.0]: https://github.com/micromatch/braces/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/micromatch/braces/compare/0.1.4...1.0.0 -[0.1.4]: https://github.com/micromatch/braces/compare/0.1.0...0.1.4 - -[Unreleased]: https://github.com/micromatch/braces/compare/0.1.0...HEAD -[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog \ No newline at end of file diff --git a/node_modules/braces/LICENSE b/node_modules/braces/LICENSE deleted file mode 100644 index d32ab4426..000000000 --- a/node_modules/braces/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2018, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/braces/README.md b/node_modules/braces/README.md deleted file mode 100644 index cba2f600d..000000000 --- a/node_modules/braces/README.md +++ /dev/null @@ -1,593 +0,0 @@ -# braces [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/braces.svg?style=flat)](https://www.npmjs.com/package/braces) [![NPM monthly downloads](https://img.shields.io/npm/dm/braces.svg?style=flat)](https://npmjs.org/package/braces) [![NPM total downloads](https://img.shields.io/npm/dt/braces.svg?style=flat)](https://npmjs.org/package/braces) [![Linux Build Status](https://img.shields.io/travis/micromatch/braces.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/braces) - -> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save braces -``` - -## v3.0.0 Released!! - -See the [changelog](CHANGELOG.md) for details. - -## Why use braces? - -Brace patterns make globs more powerful by adding the ability to match specific ranges and sequences of characters. - -* **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests) -* **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity. -* **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up. -* **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written). -* **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)). -* [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']` -* [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']` -* [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']` -* [Supports escaping](#escaping) - To prevent evaluation of special characters. - -## Usage - -The main export is a function that takes one or more brace `patterns` and `options`. - -```js -const braces = require('braces'); -// braces(patterns[, options]); - -console.log(braces(['{01..05}', '{a..e}'])); -//=> ['(0[1-5])', '([a-e])'] - -console.log(braces(['{01..05}', '{a..e}'], { expand: true })); -//=> ['01', '02', '03', '04', '05', 'a', 'b', 'c', 'd', 'e'] -``` - -### Brace Expansion vs. Compilation - -By default, brace patterns are compiled into strings that are optimized for creating regular expressions and matching. - -**Compiled** - -```js -console.log(braces('a/{x,y,z}/b')); -//=> ['a/(x|y|z)/b'] -console.log(braces(['a/{01..20}/b', 'a/{1..5}/b'])); -//=> [ 'a/(0[1-9]|1[0-9]|20)/b', 'a/([1-5])/b' ] -``` - -**Expanded** - -Enable brace expansion by setting the `expand` option to true, or by using [braces.expand()](#expand) (returns an array similar to what you'd expect from Bash, or `echo {1..5}`, or [minimatch](https://github.com/isaacs/minimatch)): - -```js -console.log(braces('a/{x,y,z}/b', { expand: true })); -//=> ['a/x/b', 'a/y/b', 'a/z/b'] - -console.log(braces.expand('{01..10}')); -//=> ['01','02','03','04','05','06','07','08','09','10'] -``` - -### Lists - -Expand lists (like Bash "sets"): - -```js -console.log(braces('a/{foo,bar,baz}/*.js')); -//=> ['a/(foo|bar|baz)/*.js'] - -console.log(braces.expand('a/{foo,bar,baz}/*.js')); -//=> ['a/foo/*.js', 'a/bar/*.js', 'a/baz/*.js'] -``` - -### Sequences - -Expand ranges of characters (like Bash "sequences"): - -```js -console.log(braces.expand('{1..3}')); // ['1', '2', '3'] -console.log(braces.expand('a/{1..3}/b')); // ['a/1/b', 'a/2/b', 'a/3/b'] -console.log(braces('{a..c}', { expand: true })); // ['a', 'b', 'c'] -console.log(braces('foo/{a..c}', { expand: true })); // ['foo/a', 'foo/b', 'foo/c'] - -// supports zero-padded ranges -console.log(braces('a/{01..03}/b')); //=> ['a/(0[1-3])/b'] -console.log(braces('a/{001..300}/b')); //=> ['a/(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)/b'] -``` - -See [fill-range](https://github.com/jonschlinkert/fill-range) for all available range-expansion options. - -### Steppped ranges - -Steps, or increments, may be used with ranges: - -```js -console.log(braces.expand('{2..10..2}')); -//=> ['2', '4', '6', '8', '10'] - -console.log(braces('{2..10..2}')); -//=> ['(2|4|6|8|10)'] -``` - -When the [.optimize](#optimize) method is used, or [options.optimize](#optionsoptimize) is set to true, sequences are passed to [to-regex-range](https://github.com/jonschlinkert/to-regex-range) for expansion. - -### Nesting - -Brace patterns may be nested. The results of each expanded string are not sorted, and left to right order is preserved. - -**"Expanded" braces** - -```js -console.log(braces.expand('a{b,c,/{x,y}}/e')); -//=> ['ab/e', 'ac/e', 'a/x/e', 'a/y/e'] - -console.log(braces.expand('a/{x,{1..5},y}/c')); -//=> ['a/x/c', 'a/1/c', 'a/2/c', 'a/3/c', 'a/4/c', 'a/5/c', 'a/y/c'] -``` - -**"Optimized" braces** - -```js -console.log(braces('a{b,c,/{x,y}}/e')); -//=> ['a(b|c|/(x|y))/e'] - -console.log(braces('a/{x,{1..5},y}/c')); -//=> ['a/(x|([1-5])|y)/c'] -``` - -### Escaping - -**Escaping braces** - -A brace pattern will not be expanded or evaluted if _either the opening or closing brace is escaped_: - -```js -console.log(braces.expand('a\\{d,c,b}e')); -//=> ['a{d,c,b}e'] - -console.log(braces.expand('a{d,c,b\\}e')); -//=> ['a{d,c,b}e'] -``` - -**Escaping commas** - -Commas inside braces may also be escaped: - -```js -console.log(braces.expand('a{b\\,c}d')); -//=> ['a{b,c}d'] - -console.log(braces.expand('a{d\\,c,b}e')); -//=> ['ad,ce', 'abe'] -``` - -**Single items** - -Following bash conventions, a brace pattern is also not expanded when it contains a single character: - -```js -console.log(braces.expand('a{b}c')); -//=> ['a{b}c'] -``` - -## Options - -### options.maxLength - -**Type**: `Number` - -**Default**: `65,536` - -**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera. - -```js -console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error -``` - -### options.expand - -**Type**: `Boolean` - -**Default**: `undefined` - -**Description**: Generate an "expanded" brace pattern (alternatively you can use the `braces.expand()` method, which does the same thing). - -```js -console.log(braces('a/{b,c}/d', { expand: true })); -//=> [ 'a/b/d', 'a/c/d' ] -``` - -### options.nodupes - -**Type**: `Boolean` - -**Default**: `undefined` - -**Description**: Remove duplicates from the returned array. - -### options.rangeLimit - -**Type**: `Number` - -**Default**: `1000` - -**Description**: To prevent malicious patterns from being passed by users, an error is thrown when `braces.expand()` is used or `options.expand` is true and the generated range will exceed the `rangeLimit`. - -You can customize `options.rangeLimit` or set it to `Inifinity` to disable this altogether. - -**Examples** - -```js -// pattern exceeds the "rangeLimit", so it's optimized automatically -console.log(braces.expand('{1..1000}')); -//=> ['([1-9]|[1-9][0-9]{1,2}|1000)'] - -// pattern does not exceed "rangeLimit", so it's NOT optimized -console.log(braces.expand('{1..100}')); -//=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100'] -``` - -### options.transform - -**Type**: `Function` - -**Default**: `undefined` - -**Description**: Customize range expansion. - -**Example: Transforming non-numeric values** - -```js -const alpha = braces.expand('x/{a..e}/y', { - transform(value, index) { - // When non-numeric values are passed, "value" is a character code. - return 'foo/' + String.fromCharCode(value) + '-' + index; - } -}); -console.log(alpha); -//=> [ 'x/foo/a-0/y', 'x/foo/b-1/y', 'x/foo/c-2/y', 'x/foo/d-3/y', 'x/foo/e-4/y' ] -``` - -**Example: Transforming numeric values** - -```js -const numeric = braces.expand('{1..5}', { - transform(value) { - // when numeric values are passed, "value" is a number - return 'foo/' + value * 2; - } -}); -console.log(numeric); -//=> [ 'foo/2', 'foo/4', 'foo/6', 'foo/8', 'foo/10' ] -``` - -### options.quantifiers - -**Type**: `Boolean` - -**Default**: `undefined` - -**Description**: In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times. - -Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists) - -The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) are defined in the given pattern, and not to try to expand them as lists. - -**Examples** - -```js -const braces = require('braces'); -console.log(braces('a/b{1,3}/{x,y,z}')); -//=> [ 'a/b(1|3)/(x|y|z)' ] -console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true})); -//=> [ 'a/b{1,3}/(x|y|z)' ] -console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true, expand: true})); -//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ] -``` - -### options.unescape - -**Type**: `Boolean` - -**Default**: `undefined` - -**Description**: Strip backslashes that were used for escaping from the result. - -## What is "brace expansion"? - -Brace expansion is a type of parameter expansion that was made popular by unix shells for generating lists of strings, as well as regex-like matching when used alongside wildcards (globs). - -In addition to "expansion", braces are also used for matching. In other words: - -* [brace expansion](#brace-expansion) is for generating new lists -* [brace matching](#brace-matching) is for filtering existing lists - -
-More about brace expansion (click to expand) - -There are two main types of brace expansion: - -1. **lists**: which are defined using comma-separated values inside curly braces: `{a,b,c}` -2. **sequences**: which are defined using a starting value and an ending value, separated by two dots: `a{1..3}b`. Optionally, a third argument may be passed to define a "step" or increment to use: `a{1..100..10}b`. These are also sometimes referred to as "ranges". - -Here are some example brace patterns to illustrate how they work: - -**Sets** - -``` -{a,b,c} => a b c -{a,b,c}{1,2} => a1 a2 b1 b2 c1 c2 -``` - -**Sequences** - -``` -{1..9} => 1 2 3 4 5 6 7 8 9 -{4..-4} => 4 3 2 1 0 -1 -2 -3 -4 -{1..20..3} => 1 4 7 10 13 16 19 -{a..j} => a b c d e f g h i j -{j..a} => j i h g f e d c b a -{a..z..3} => a d g j m p s v y -``` - -**Combination** - -Sets and sequences can be mixed together or used along with any other strings. - -``` -{a,b,c}{1..3} => a1 a2 a3 b1 b2 b3 c1 c2 c3 -foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar -``` - -The fact that braces can be "expanded" from relatively simple patterns makes them ideal for quickly generating test fixtures, file paths, and similar use cases. - -## Brace matching - -In addition to _expansion_, brace patterns are also useful for performing regular-expression-like matching. - -For example, the pattern `foo/{1..3}/bar` would match any of following strings: - -``` -foo/1/bar -foo/2/bar -foo/3/bar -``` - -But not: - -``` -baz/1/qux -baz/2/qux -baz/3/qux -``` - -Braces can also be combined with [glob patterns](https://github.com/jonschlinkert/micromatch) to perform more advanced wildcard matching. For example, the pattern `*/{1..3}/*` would match any of following strings: - -``` -foo/1/bar -foo/2/bar -foo/3/bar -baz/1/qux -baz/2/qux -baz/3/qux -``` - -## Brace matching pitfalls - -Although brace patterns offer a user-friendly way of matching ranges or sets of strings, there are also some major disadvantages and potential risks you should be aware of. - -### tldr - -**"brace bombs"** - -* brace expansion can eat up a huge amount of processing resources -* as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially -* users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!) - -For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section. - -### The solution - -Jump to the [performance section](#performance) to see how Braces solves this problem in comparison to other libraries. - -### Geometric complexity - -At minimum, brace patterns with sets limited to two elements have quadradic or `O(n^2)` complexity. But the complexity of the algorithm increases exponentially as the number of sets, _and elements per set_, increases, which is `O(n^c)`. - -For example, the following sets demonstrate quadratic (`O(n^2)`) complexity: - -``` -{1,2}{3,4} => (2X2) => 13 14 23 24 -{1,2}{3,4}{5,6} => (2X2X2) => 135 136 145 146 235 236 245 246 -``` - -But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity: - -``` -{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248 - 249 257 258 259 267 268 269 347 348 349 357 - 358 359 367 368 369 -``` - -Now, imagine how this complexity grows given that each element is a n-tuple: - -``` -{1..100}{1..100} => (100X100) => 10,000 elements (38.4 kB) -{1..100}{1..100}{1..100} => (100X100X100) => 1,000,000 elements (5.76 MB) -``` - -Although these examples are clearly contrived, they demonstrate how brace patterns can quickly grow out of control. - -**More information** - -Interested in learning more about brace expansion? - -* [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion) -* [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion) -* [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) - -
- -## Performance - -Braces is not only screaming fast, it's also more accurate the other brace expansion libraries. - -### Better algorithms - -Fortunately there is a solution to the ["brace bomb" problem](#brace-matching-pitfalls): _don't expand brace patterns into an array when they're used for matching_. - -Instead, convert the pattern into an optimized regular expression. This is easier said than done, and braces is the only library that does this currently. - -**The proof is in the numbers** - -Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively. - -| **Pattern** | **braces** | **[minimatch][]** | -| --- | --- | --- | -| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs)| N/A (freezes) | -| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) | -| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) | -| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) | -| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) | -| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) | -| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) | -| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) | -| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) | -| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) | -| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) | -| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) | -| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) | -| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) | -| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) | -| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) | -| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) | - -### Faster algorithms - -When you need expansion, braces is still much faster. - -_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_ - -| **Pattern** | **braces** | **[minimatch][]** | -| --- | --- | --- | -| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) | -| `{1..1000000}` | `6.89 MB` (458ms 576μs) | `6.89 MB` (1s 491ms 621μs) | -| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) | -| `{1..10000}` | `48.89 kB` (2ms 202μs) | `48.89 kB` (13ms 641μs) | -| `{1..1000}` | `3.89 kB` (1ms 796μs) | `3.89 kB` (1ms 958μs) | -| `{1..100}` | `291 B` (424μs) | `291 B` (211μs) | -| `{1..10}` | `20 B` (487μs) | `20 B` (72μs) | -| `{1..3}` | `5 B` (166μs) | `5 B` (27μs) | - -If you'd like to run these comparisons yourself, see [test/support/generate.js](test/support/generate.js). - -## Benchmarks - -### Running benchmarks - -Install dev dependencies: - -```bash -npm i -d && npm benchmark -``` - -### Latest results - -Braces is more accurate, without sacrificing performance. - -```bash -# range (expanded) - braces x 29,040 ops/sec ±3.69% (91 runs sampled)) - minimatch x 4,735 ops/sec ±1.28% (90 runs sampled) - -# range (optimized for regex) - braces x 382,878 ops/sec ±0.56% (94 runs sampled) - minimatch x 1,040 ops/sec ±0.44% (93 runs sampled) - -# nested ranges (expanded) - braces x 19,744 ops/sec ±2.27% (92 runs sampled)) - minimatch x 4,579 ops/sec ±0.50% (93 runs sampled) - -# nested ranges (optimized for regex) - braces x 246,019 ops/sec ±2.02% (93 runs sampled) - minimatch x 1,028 ops/sec ±0.39% (94 runs sampled) - -# set (expanded) - braces x 138,641 ops/sec ±0.53% (95 runs sampled) - minimatch x 219,582 ops/sec ±0.98% (94 runs sampled) - -# set (optimized for regex) - braces x 388,408 ops/sec ±0.41% (95 runs sampled) - minimatch x 44,724 ops/sec ±0.91% (89 runs sampled) - -# nested sets (expanded) - braces x 84,966 ops/sec ±0.48% (94 runs sampled) - minimatch x 140,720 ops/sec ±0.37% (95 runs sampled) - -# nested sets (optimized for regex) - braces x 263,340 ops/sec ±2.06% (92 runs sampled) - minimatch x 28,714 ops/sec ±0.40% (90 runs sampled) -``` - -## About - -
-Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
- -
-Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
- -
-Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
- -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 197 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [doowb](https://github.com/doowb) | -| 1 | [es128](https://github.com/es128) | -| 1 | [eush77](https://github.com/eush77) | -| 1 | [hemanth](https://github.com/hemanth) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Author - -**Jon Schlinkert** - -* [GitHub Profile](https://github.com/jonschlinkert) -* [Twitter Profile](https://twitter.com/jonschlinkert) -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) - -### License - -Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._ \ No newline at end of file diff --git a/node_modules/braces/index.js b/node_modules/braces/index.js deleted file mode 100644 index 0eee0f567..000000000 --- a/node_modules/braces/index.js +++ /dev/null @@ -1,170 +0,0 @@ -'use strict'; - -const stringify = require('./lib/stringify'); -const compile = require('./lib/compile'); -const expand = require('./lib/expand'); -const parse = require('./lib/parse'); - -/** - * Expand the given pattern or create a regex-compatible string. - * - * ```js - * const braces = require('braces'); - * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] - * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {String} - * @api public - */ - -const braces = (input, options = {}) => { - let output = []; - - if (Array.isArray(input)) { - for (let pattern of input) { - let result = braces.create(pattern, options); - if (Array.isArray(result)) { - output.push(...result); - } else { - output.push(result); - } - } - } else { - output = [].concat(braces.create(input, options)); - } - - if (options && options.expand === true && options.nodupes === true) { - output = [...new Set(output)]; - } - return output; -}; - -/** - * Parse the given `str` with the given `options`. - * - * ```js - * // braces.parse(pattern, [, options]); - * const ast = braces.parse('a/{b,c}/d'); - * console.log(ast); - * ``` - * @param {String} pattern Brace pattern to parse - * @param {Object} options - * @return {Object} Returns an AST - * @api public - */ - -braces.parse = (input, options = {}) => parse(input, options); - -/** - * Creates a braces string from an AST, or an AST node. - * - * ```js - * const braces = require('braces'); - * let ast = braces.parse('foo/{a,b}/bar'); - * console.log(stringify(ast.nodes[2])); //=> '{a,b}' - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.stringify = (input, options = {}) => { - if (typeof input === 'string') { - return stringify(braces.parse(input, options), options); - } - return stringify(input, options); -}; - -/** - * Compiles a brace pattern into a regex-compatible, optimized string. - * This method is called by the main [braces](#braces) function by default. - * - * ```js - * const braces = require('braces'); - * console.log(braces.compile('a/{b,c}/d')); - * //=> ['a/(b|c)/d'] - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.compile = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } - return compile(input, options); -}; - -/** - * Expands a brace pattern into an array. This method is called by the - * main [braces](#braces) function when `options.expand` is true. Before - * using this method it's recommended that you read the [performance notes](#performance)) - * and advantages of using [.compile](#compile) instead. - * - * ```js - * const braces = require('braces'); - * console.log(braces.expand('a/{b,c}/d')); - * //=> ['a/b/d', 'a/c/d']; - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.expand = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } - - let result = expand(input, options); - - // filter out empty strings if specified - if (options.noempty === true) { - result = result.filter(Boolean); - } - - // filter out duplicates if specified - if (options.nodupes === true) { - result = [...new Set(result)]; - } - - return result; -}; - -/** - * Processes a brace pattern and returns either an expanded array - * (if `options.expand` is true), a highly optimized regex-compatible string. - * This method is called by the main [braces](#braces) function. - * - * ```js - * const braces = require('braces'); - * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) - * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.create = (input, options = {}) => { - if (input === '' || input.length < 3) { - return [input]; - } - - return options.expand !== true - ? braces.compile(input, options) - : braces.expand(input, options); -}; - -/** - * Expose "braces" - */ - -module.exports = braces; diff --git a/node_modules/braces/lib/compile.js b/node_modules/braces/lib/compile.js deleted file mode 100644 index 3e984a4bb..000000000 --- a/node_modules/braces/lib/compile.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -const fill = require('fill-range'); -const utils = require('./utils'); - -const compile = (ast, options = {}) => { - let walk = (node, parent = {}) => { - let invalidBlock = utils.isInvalidBrace(parent); - let invalidNode = node.invalid === true && options.escapeInvalid === true; - let invalid = invalidBlock === true || invalidNode === true; - let prefix = options.escapeInvalid === true ? '\\' : ''; - let output = ''; - - if (node.isOpen === true) { - return prefix + node.value; - } - if (node.isClose === true) { - return prefix + node.value; - } - - if (node.type === 'open') { - return invalid ? (prefix + node.value) : '('; - } - - if (node.type === 'close') { - return invalid ? (prefix + node.value) : ')'; - } - - if (node.type === 'comma') { - return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|'); - } - - if (node.value) { - return node.value; - } - - if (node.nodes && node.ranges > 0) { - let args = utils.reduce(node.nodes); - let range = fill(...args, { ...options, wrap: false, toRegex: true }); - - if (range.length !== 0) { - return args.length > 1 && range.length > 1 ? `(${range})` : range; - } - } - - if (node.nodes) { - for (let child of node.nodes) { - output += walk(child, node); - } - } - return output; - }; - - return walk(ast); -}; - -module.exports = compile; diff --git a/node_modules/braces/lib/constants.js b/node_modules/braces/lib/constants.js deleted file mode 100644 index a93794366..000000000 --- a/node_modules/braces/lib/constants.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -module.exports = { - MAX_LENGTH: 1024 * 64, - - // Digits - CHAR_0: '0', /* 0 */ - CHAR_9: '9', /* 9 */ - - // Alphabet chars. - CHAR_UPPERCASE_A: 'A', /* A */ - CHAR_LOWERCASE_A: 'a', /* a */ - CHAR_UPPERCASE_Z: 'Z', /* Z */ - CHAR_LOWERCASE_Z: 'z', /* z */ - - CHAR_LEFT_PARENTHESES: '(', /* ( */ - CHAR_RIGHT_PARENTHESES: ')', /* ) */ - - CHAR_ASTERISK: '*', /* * */ - - // Non-alphabetic chars. - CHAR_AMPERSAND: '&', /* & */ - CHAR_AT: '@', /* @ */ - CHAR_BACKSLASH: '\\', /* \ */ - CHAR_BACKTICK: '`', /* ` */ - CHAR_CARRIAGE_RETURN: '\r', /* \r */ - CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ - CHAR_COLON: ':', /* : */ - CHAR_COMMA: ',', /* , */ - CHAR_DOLLAR: '$', /* . */ - CHAR_DOT: '.', /* . */ - CHAR_DOUBLE_QUOTE: '"', /* " */ - CHAR_EQUAL: '=', /* = */ - CHAR_EXCLAMATION_MARK: '!', /* ! */ - CHAR_FORM_FEED: '\f', /* \f */ - CHAR_FORWARD_SLASH: '/', /* / */ - CHAR_HASH: '#', /* # */ - CHAR_HYPHEN_MINUS: '-', /* - */ - CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ - CHAR_LEFT_CURLY_BRACE: '{', /* { */ - CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ - CHAR_LINE_FEED: '\n', /* \n */ - CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ - CHAR_PERCENT: '%', /* % */ - CHAR_PLUS: '+', /* + */ - CHAR_QUESTION_MARK: '?', /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ - CHAR_RIGHT_CURLY_BRACE: '}', /* } */ - CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ - CHAR_SEMICOLON: ';', /* ; */ - CHAR_SINGLE_QUOTE: '\'', /* ' */ - CHAR_SPACE: ' ', /* */ - CHAR_TAB: '\t', /* \t */ - CHAR_UNDERSCORE: '_', /* _ */ - CHAR_VERTICAL_LINE: '|', /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ -}; diff --git a/node_modules/braces/lib/expand.js b/node_modules/braces/lib/expand.js deleted file mode 100644 index 376c748af..000000000 --- a/node_modules/braces/lib/expand.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -const fill = require('fill-range'); -const stringify = require('./stringify'); -const utils = require('./utils'); - -const append = (queue = '', stash = '', enclose = false) => { - let result = []; - - queue = [].concat(queue); - stash = [].concat(stash); - - if (!stash.length) return queue; - if (!queue.length) { - return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; - } - - for (let item of queue) { - if (Array.isArray(item)) { - for (let value of item) { - result.push(append(value, stash, enclose)); - } - } else { - for (let ele of stash) { - if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; - result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele)); - } - } - } - return utils.flatten(result); -}; - -const expand = (ast, options = {}) => { - let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit; - - let walk = (node, parent = {}) => { - node.queue = []; - - let p = parent; - let q = parent.queue; - - while (p.type !== 'brace' && p.type !== 'root' && p.parent) { - p = p.parent; - q = p.queue; - } - - if (node.invalid || node.dollar) { - q.push(append(q.pop(), stringify(node, options))); - return; - } - - if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { - q.push(append(q.pop(), ['{}'])); - return; - } - - if (node.nodes && node.ranges > 0) { - let args = utils.reduce(node.nodes); - - if (utils.exceedsLimit(...args, options.step, rangeLimit)) { - throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); - } - - let range = fill(...args, options); - if (range.length === 0) { - range = stringify(node, options); - } - - q.push(append(q.pop(), range)); - node.nodes = []; - return; - } - - let enclose = utils.encloseBrace(node); - let queue = node.queue; - let block = node; - - while (block.type !== 'brace' && block.type !== 'root' && block.parent) { - block = block.parent; - queue = block.queue; - } - - for (let i = 0; i < node.nodes.length; i++) { - let child = node.nodes[i]; - - if (child.type === 'comma' && node.type === 'brace') { - if (i === 1) queue.push(''); - queue.push(''); - continue; - } - - if (child.type === 'close') { - q.push(append(q.pop(), queue, enclose)); - continue; - } - - if (child.value && child.type !== 'open') { - queue.push(append(queue.pop(), child.value)); - continue; - } - - if (child.nodes) { - walk(child, node); - } - } - - return queue; - }; - - return utils.flatten(walk(ast)); -}; - -module.exports = expand; diff --git a/node_modules/braces/lib/parse.js b/node_modules/braces/lib/parse.js deleted file mode 100644 index 145ea2648..000000000 --- a/node_modules/braces/lib/parse.js +++ /dev/null @@ -1,333 +0,0 @@ -'use strict'; - -const stringify = require('./stringify'); - -/** - * Constants - */ - -const { - MAX_LENGTH, - CHAR_BACKSLASH, /* \ */ - CHAR_BACKTICK, /* ` */ - CHAR_COMMA, /* , */ - CHAR_DOT, /* . */ - CHAR_LEFT_PARENTHESES, /* ( */ - CHAR_RIGHT_PARENTHESES, /* ) */ - CHAR_LEFT_CURLY_BRACE, /* { */ - CHAR_RIGHT_CURLY_BRACE, /* } */ - CHAR_LEFT_SQUARE_BRACKET, /* [ */ - CHAR_RIGHT_SQUARE_BRACKET, /* ] */ - CHAR_DOUBLE_QUOTE, /* " */ - CHAR_SINGLE_QUOTE, /* ' */ - CHAR_NO_BREAK_SPACE, - CHAR_ZERO_WIDTH_NOBREAK_SPACE -} = require('./constants'); - -/** - * parse - */ - -const parse = (input, options = {}) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } - - let opts = options || {}; - let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - if (input.length > max) { - throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); - } - - let ast = { type: 'root', input, nodes: [] }; - let stack = [ast]; - let block = ast; - let prev = ast; - let brackets = 0; - let length = input.length; - let index = 0; - let depth = 0; - let value; - let memo = {}; - - /** - * Helpers - */ - - const advance = () => input[index++]; - const push = node => { - if (node.type === 'text' && prev.type === 'dot') { - prev.type = 'text'; - } - - if (prev && prev.type === 'text' && node.type === 'text') { - prev.value += node.value; - return; - } - - block.nodes.push(node); - node.parent = block; - node.prev = prev; - prev = node; - return node; - }; - - push({ type: 'bos' }); - - while (index < length) { - block = stack[stack.length - 1]; - value = advance(); - - /** - * Invalid chars - */ - - if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { - continue; - } - - /** - * Escaped chars - */ - - if (value === CHAR_BACKSLASH) { - push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); - continue; - } - - /** - * Right square bracket (literal): ']' - */ - - if (value === CHAR_RIGHT_SQUARE_BRACKET) { - push({ type: 'text', value: '\\' + value }); - continue; - } - - /** - * Left square bracket: '[' - */ - - if (value === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - - let closed = true; - let next; - - while (index < length && (next = advance())) { - value += next; - - if (next === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - continue; - } - - if (next === CHAR_BACKSLASH) { - value += advance(); - continue; - } - - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - brackets--; - - if (brackets === 0) { - break; - } - } - } - - push({ type: 'text', value }); - continue; - } - - /** - * Parentheses - */ - - if (value === CHAR_LEFT_PARENTHESES) { - block = push({ type: 'paren', nodes: [] }); - stack.push(block); - push({ type: 'text', value }); - continue; - } - - if (value === CHAR_RIGHT_PARENTHESES) { - if (block.type !== 'paren') { - push({ type: 'text', value }); - continue; - } - block = stack.pop(); - push({ type: 'text', value }); - block = stack[stack.length - 1]; - continue; - } - - /** - * Quotes: '|"|` - */ - - if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { - let open = value; - let next; - - if (options.keepQuotes !== true) { - value = ''; - } - - while (index < length && (next = advance())) { - if (next === CHAR_BACKSLASH) { - value += next + advance(); - continue; - } - - if (next === open) { - if (options.keepQuotes === true) value += next; - break; - } - - value += next; - } - - push({ type: 'text', value }); - continue; - } - - /** - * Left curly brace: '{' - */ - - if (value === CHAR_LEFT_CURLY_BRACE) { - depth++; - - let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; - let brace = { - type: 'brace', - open: true, - close: false, - dollar, - depth, - commas: 0, - ranges: 0, - nodes: [] - }; - - block = push(brace); - stack.push(block); - push({ type: 'open', value }); - continue; - } - - /** - * Right curly brace: '}' - */ - - if (value === CHAR_RIGHT_CURLY_BRACE) { - if (block.type !== 'brace') { - push({ type: 'text', value }); - continue; - } - - let type = 'close'; - block = stack.pop(); - block.close = true; - - push({ type, value }); - depth--; - - block = stack[stack.length - 1]; - continue; - } - - /** - * Comma: ',' - */ - - if (value === CHAR_COMMA && depth > 0) { - if (block.ranges > 0) { - block.ranges = 0; - let open = block.nodes.shift(); - block.nodes = [open, { type: 'text', value: stringify(block) }]; - } - - push({ type: 'comma', value }); - block.commas++; - continue; - } - - /** - * Dot: '.' - */ - - if (value === CHAR_DOT && depth > 0 && block.commas === 0) { - let siblings = block.nodes; - - if (depth === 0 || siblings.length === 0) { - push({ type: 'text', value }); - continue; - } - - if (prev.type === 'dot') { - block.range = []; - prev.value += value; - prev.type = 'range'; - - if (block.nodes.length !== 3 && block.nodes.length !== 5) { - block.invalid = true; - block.ranges = 0; - prev.type = 'text'; - continue; - } - - block.ranges++; - block.args = []; - continue; - } - - if (prev.type === 'range') { - siblings.pop(); - - let before = siblings[siblings.length - 1]; - before.value += prev.value + value; - prev = before; - block.ranges--; - continue; - } - - push({ type: 'dot', value }); - continue; - } - - /** - * Text - */ - - push({ type: 'text', value }); - } - - // Mark imbalanced braces and brackets as invalid - do { - block = stack.pop(); - - if (block.type !== 'root') { - block.nodes.forEach(node => { - if (!node.nodes) { - if (node.type === 'open') node.isOpen = true; - if (node.type === 'close') node.isClose = true; - if (!node.nodes) node.type = 'text'; - node.invalid = true; - } - }); - - // get the location of the block on parent.nodes (block's siblings) - let parent = stack[stack.length - 1]; - let index = parent.nodes.indexOf(block); - // replace the (invalid) block with it's nodes - parent.nodes.splice(index, 1, ...block.nodes); - } - } while (stack.length > 0); - - push({ type: 'eos' }); - return ast; -}; - -module.exports = parse; diff --git a/node_modules/braces/lib/stringify.js b/node_modules/braces/lib/stringify.js deleted file mode 100644 index 414b7bcc6..000000000 --- a/node_modules/braces/lib/stringify.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const utils = require('./utils'); - -module.exports = (ast, options = {}) => { - let stringify = (node, parent = {}) => { - let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); - let invalidNode = node.invalid === true && options.escapeInvalid === true; - let output = ''; - - if (node.value) { - if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { - return '\\' + node.value; - } - return node.value; - } - - if (node.value) { - return node.value; - } - - if (node.nodes) { - for (let child of node.nodes) { - output += stringify(child); - } - } - return output; - }; - - return stringify(ast); -}; - diff --git a/node_modules/braces/lib/utils.js b/node_modules/braces/lib/utils.js deleted file mode 100644 index e3551a674..000000000 --- a/node_modules/braces/lib/utils.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -exports.isInteger = num => { - if (typeof num === 'number') { - return Number.isInteger(num); - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isInteger(Number(num)); - } - return false; -}; - -/** - * Find a node of the given type - */ - -exports.find = (node, type) => node.nodes.find(node => node.type === type); - -/** - * Find a node of the given type - */ - -exports.exceedsLimit = (min, max, step = 1, limit) => { - if (limit === false) return false; - if (!exports.isInteger(min) || !exports.isInteger(max)) return false; - return ((Number(max) - Number(min)) / Number(step)) >= limit; -}; - -/** - * Escape the given node with '\\' before node.value - */ - -exports.escapeNode = (block, n = 0, type) => { - let node = block.nodes[n]; - if (!node) return; - - if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { - if (node.escaped !== true) { - node.value = '\\' + node.value; - node.escaped = true; - } - } -}; - -/** - * Returns true if the given brace node should be enclosed in literal braces - */ - -exports.encloseBrace = node => { - if (node.type !== 'brace') return false; - if ((node.commas >> 0 + node.ranges >> 0) === 0) { - node.invalid = true; - return true; - } - return false; -}; - -/** - * Returns true if a brace node is invalid. - */ - -exports.isInvalidBrace = block => { - if (block.type !== 'brace') return false; - if (block.invalid === true || block.dollar) return true; - if ((block.commas >> 0 + block.ranges >> 0) === 0) { - block.invalid = true; - return true; - } - if (block.open !== true || block.close !== true) { - block.invalid = true; - return true; - } - return false; -}; - -/** - * Returns true if a node is an open or close node - */ - -exports.isOpenOrClose = node => { - if (node.type === 'open' || node.type === 'close') { - return true; - } - return node.open === true || node.close === true; -}; - -/** - * Reduce an array of text nodes. - */ - -exports.reduce = nodes => nodes.reduce((acc, node) => { - if (node.type === 'text') acc.push(node.value); - if (node.type === 'range') node.type = 'text'; - return acc; -}, []); - -/** - * Flatten an array - */ - -exports.flatten = (...args) => { - const result = []; - const flat = arr => { - for (let i = 0; i < arr.length; i++) { - let ele = arr[i]; - Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele); - } - return result; - }; - flat(args); - return result; -}; diff --git a/node_modules/braces/package.json b/node_modules/braces/package.json deleted file mode 100644 index 3f52e346f..000000000 --- a/node_modules/braces/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "braces", - "description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.", - "version": "3.0.2", - "homepage": "https://github.com/micromatch/braces", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Brian Woodward (https://twitter.com/doowb)", - "Elan Shanker (https://github.com/es128)", - "Eugene Sharygin (https://github.com/eush77)", - "hemanth.hm (http://h3manth.com)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)" - ], - "repository": "micromatch/braces", - "bugs": { - "url": "https://github.com/micromatch/braces/issues" - }, - "license": "MIT", - "files": [ - "index.js", - "lib" - ], - "main": "index.js", - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "mocha", - "benchmark": "node benchmark" - }, - "dependencies": { - "fill-range": "^7.0.1" - }, - "devDependencies": { - "ansi-colors": "^3.2.4", - "bash-path": "^2.0.1", - "gulp-format-md": "^2.0.0", - "mocha": "^6.1.1" - }, - "keywords": [ - "alpha", - "alphabetical", - "bash", - "brace", - "braces", - "expand", - "expansion", - "filepath", - "fill", - "fs", - "glob", - "globbing", - "letter", - "match", - "matches", - "matching", - "number", - "numerical", - "path", - "range", - "ranges", - "sh" - ], - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "lint": { - "reflinks": true - }, - "plugins": [ - "gulp-format-md" - ] - } -} diff --git a/node_modules/callsites/index.d.ts b/node_modules/callsites/index.d.ts deleted file mode 100644 index 61f597cf5..000000000 --- a/node_modules/callsites/index.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -declare namespace callsites { - interface CallSite { - /** - Returns the value of `this`. - */ - getThis(): unknown | undefined; - - /** - Returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property. - */ - getTypeName(): string | null; - - /** - Returns the current function. - */ - getFunction(): Function | undefined; - - /** - Returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context. - */ - getFunctionName(): string | null; - - /** - Returns the name of the property of `this` or one of its prototypes that holds the current function. - */ - getMethodName(): string | undefined; - - /** - Returns the name of the script if this function was defined in a script. - */ - getFileName(): string | null; - - /** - Returns the current line number if this function was defined in a script. - */ - getLineNumber(): number | null; - - /** - Returns the current column number if this function was defined in a script. - */ - getColumnNumber(): number | null; - - /** - Returns a string representing the location where `eval` was called if this function was created using a call to `eval`. - */ - getEvalOrigin(): string | undefined; - - /** - Returns `true` if this is a top-level invocation, that is, if it's a global object. - */ - isToplevel(): boolean; - - /** - Returns `true` if this call takes place in code defined by a call to `eval`. - */ - isEval(): boolean; - - /** - Returns `true` if this call is in native V8 code. - */ - isNative(): boolean; - - /** - Returns `true` if this is a constructor call. - */ - isConstructor(): boolean; - } -} - -declare const callsites: { - /** - Get callsites from the V8 stack trace API. - - @returns An array of `CallSite` objects. - - @example - ``` - import callsites = require('callsites'); - - function unicorn() { - console.log(callsites()[0].getFileName()); - //=> '/Users/sindresorhus/dev/callsites/test.js' - } - - unicorn(); - ``` - */ - (): callsites.CallSite[]; - - // TODO: Remove this for the next major release, refactor the whole definition to: - // declare function callsites(): callsites.CallSite[]; - // export = callsites; - default: typeof callsites; -}; - -export = callsites; diff --git a/node_modules/callsites/index.js b/node_modules/callsites/index.js deleted file mode 100644 index 486c24104..000000000 --- a/node_modules/callsites/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const callsites = () => { - const _prepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = (_, stack) => stack; - const stack = new Error().stack.slice(1); - Error.prepareStackTrace = _prepareStackTrace; - return stack; -}; - -module.exports = callsites; -// TODO: Remove this for the next major release -module.exports.default = callsites; diff --git a/node_modules/callsites/license b/node_modules/callsites/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/callsites/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/callsites/package.json b/node_modules/callsites/package.json deleted file mode 100644 index 93463c34b..000000000 --- a/node_modules/callsites/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "callsites", - "version": "3.1.0", - "description": "Get callsites from the V8 stack trace API", - "license": "MIT", - "repository": "sindresorhus/callsites", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=6" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "stacktrace", - "v8", - "callsite", - "callsites", - "stack", - "trace", - "function", - "file", - "line", - "debug" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/callsites/readme.md b/node_modules/callsites/readme.md deleted file mode 100644 index fc846138f..000000000 --- a/node_modules/callsites/readme.md +++ /dev/null @@ -1,48 +0,0 @@ -# callsites [![Build Status](https://travis-ci.org/sindresorhus/callsites.svg?branch=master)](https://travis-ci.org/sindresorhus/callsites) - -> Get callsites from the [V8 stack trace API](https://v8.dev/docs/stack-trace-api) - - -## Install - -``` -$ npm install callsites -``` - - -## Usage - -```js -const callsites = require('callsites'); - -function unicorn() { - console.log(callsites()[0].getFileName()); - //=> '/Users/sindresorhus/dev/callsites/test.js' -} - -unicorn(); -``` - - -## API - -Returns an array of callsite objects with the following methods: - -- `getThis`: returns the value of `this`. -- `getTypeName`: returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property. -- `getFunction`: returns the current function. -- `getFunctionName`: returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context. -- `getMethodName`: returns the name of the property of `this` or one of its prototypes that holds the current function. -- `getFileName`: if this function was defined in a script returns the name of the script. -- `getLineNumber`: if this function was defined in a script returns the current line number. -- `getColumnNumber`: if this function was defined in a script returns the current column number -- `getEvalOrigin`: if this function was created using a call to `eval` returns a string representing the location where `eval` was called. -- `isToplevel`: is this a top-level invocation, that is, is this the global object? -- `isEval`: does this call take place in code defined by a call to `eval`? -- `isNative`: is this call in native V8 code? -- `isConstructor`: is this a constructor call? - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/camelcase-keys/index.d.ts b/node_modules/camelcase-keys/index.d.ts deleted file mode 100644 index b26c88c10..000000000 --- a/node_modules/camelcase-keys/index.d.ts +++ /dev/null @@ -1,192 +0,0 @@ -import {CamelCase, PascalCase} from 'type-fest'; - -// eslint-disable-next-line @typescript-eslint/ban-types -type EmptyTuple = []; - -/** -Return a default type if input type is nil. - -@template T - Input type. -@template U - Default type. -*/ -type WithDefault = T extends undefined | void | null ? U : T; - -/** -Check if an element is included in a tuple. - -TODO: Remove this once https://github.com/sindresorhus/type-fest/pull/217 is merged. -*/ -type IsInclude = List extends undefined - ? false - : List extends Readonly - ? false - : List extends readonly [infer First, ...infer Rest] - ? First extends Target - ? true - : IsInclude - : boolean; - -/** -Append a segment to dot-notation path. -*/ -type AppendPath = S extends '' - ? Last - : `${S}.${Last}`; - -/** -Convert keys of an object to camelcase strings. -*/ -type CamelCaseKeys< - T extends Record | readonly any[], - Deep extends boolean, - IsPascalCase extends boolean, - Exclude extends readonly unknown[], - StopPaths extends readonly string[], - Path extends string = '' -> = T extends readonly any[] - // Handle arrays or tuples. - ? { - [P in keyof T]: CamelCaseKeys< - T[P], - Deep, - IsPascalCase, - Exclude, - StopPaths - >; - } - : T extends Record - // Handle objects. - ? { - [P in keyof T & string as [IsInclude] extends [true] - ? P - : [IsPascalCase] extends [true] - ? PascalCase

- : CamelCase

]: [IsInclude>] extends [ - true - ] - ? T[P] - : [Deep] extends [true] - ? CamelCaseKeys< - T[P], - Deep, - IsPascalCase, - Exclude, - StopPaths, - AppendPath - > - : T[P]; - } - // Return anything else as-is. - : T; - -declare namespace camelcaseKeys { - interface Options { - /** - Recurse nested objects and objects in arrays. - - @default false - */ - readonly deep?: boolean; - - /** - Exclude keys from being camel-cased. - - If this option can be statically determined, it's recommended to add `as const` to it. - - @default [] - */ - readonly exclude?: ReadonlyArray; - - /** - Exclude children at the given object paths in dot-notation from being camel-cased. For example, with an object like `{a: {b: '🦄'}}`, the object path to reach the unicorn is `'a.b'`. - - If this option can be statically determined, it's recommended to add `as const` to it. - - @default [] - - @example - ``` - camelcaseKeys({ - a_b: 1, - a_c: { - c_d: 1, - c_e: { - e_f: 1 - } - } - }, { - deep: true, - stopPaths: [ - 'a_c.c_e' - ] - }), - // { - // aB: 1, - // aC: { - // cD: 1, - // cE: { - // e_f: 1 - // } - // } - // } - ``` - */ - readonly stopPaths?: readonly string[]; - - /** - Uppercase the first character as in `bye-bye` → `ByeBye`. - - @default false - */ - readonly pascalCase?: boolean; - } -} - -/** -Convert object keys to camel case using [`camelcase`](https://github.com/sindresorhus/camelcase). - -@param input - Object or array of objects to camel-case. - -@example -``` -import camelcaseKeys = require('camelcase-keys'); - -// Convert an object -camelcaseKeys({'foo-bar': true}); -//=> {fooBar: true} - -// Convert an array of objects -camelcaseKeys([{'foo-bar': true}, {'bar-foo': false}]); -//=> [{fooBar: true}, {barFoo: false}] - -camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true}); -//=> {fooBar: true, nested: {unicornRainbow: true}} - -// Convert object keys to pascal case -camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true, pascalCase: true}); -//=> {FooBar: true, Nested: {UnicornRainbow: true}} - -import minimist = require('minimist'); - -const argv = minimist(process.argv.slice(2)); -//=> {_: [], 'foo-bar': true} - -camelcaseKeys(argv); -//=> {_: [], fooBar: true} -``` -*/ -declare function camelcaseKeys< - T extends Record | readonly any[], - Options extends camelcaseKeys.Options = camelcaseKeys.Options ->( - input: T, - options?: Options -): CamelCaseKeys< -T, -WithDefault, -WithDefault, -WithDefault, -WithDefault ->; - -export = camelcaseKeys; diff --git a/node_modules/camelcase-keys/index.js b/node_modules/camelcase-keys/index.js deleted file mode 100644 index 9f4e261c0..000000000 --- a/node_modules/camelcase-keys/index.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; -const mapObj = require('map-obj'); -const camelCase = require('camelcase'); -const QuickLru = require('quick-lru'); - -const has = (array, key) => array.some(x => { - if (typeof x === 'string') { - return x === key; - } - - x.lastIndex = 0; - return x.test(key); -}); - -const cache = new QuickLru({maxSize: 100000}); - -// Reproduces behavior from `map-obj` -const isObject = value => - typeof value === 'object' && - value !== null && - !(value instanceof RegExp) && - !(value instanceof Error) && - !(value instanceof Date); - -const camelCaseConvert = (input, options) => { - if (!isObject(input)) { - return input; - } - - options = { - deep: false, - pascalCase: false, - ...options - }; - - const {exclude, pascalCase, stopPaths, deep} = options; - - const stopPathsSet = new Set(stopPaths); - - const makeMapper = parentPath => (key, value) => { - if (deep && isObject(value)) { - const path = parentPath === undefined ? key : `${parentPath}.${key}`; - - if (!stopPathsSet.has(path)) { - value = mapObj(value, makeMapper(path)); - } - } - - if (!(exclude && has(exclude, key))) { - const cacheKey = pascalCase ? `${key}_` : key; - - if (cache.has(cacheKey)) { - key = cache.get(cacheKey); - } else { - const returnValue = camelCase(key, {pascalCase, locale: false}); - - if (key.length < 100) { // Prevent abuse - cache.set(cacheKey, returnValue); - } - - key = returnValue; - } - } - - return [key, value]; - }; - - return mapObj(input, makeMapper(undefined)); -}; - -module.exports = (input, options) => { - if (Array.isArray(input)) { - return Object.keys(input).map(key => camelCaseConvert(input[key], options)); - } - - return camelCaseConvert(input, options); -}; diff --git a/node_modules/camelcase-keys/license b/node_modules/camelcase-keys/license deleted file mode 100644 index fa7ceba3e..000000000 --- a/node_modules/camelcase-keys/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/camelcase-keys/package.json b/node_modules/camelcase-keys/package.json deleted file mode 100644 index 888a13818..000000000 --- a/node_modules/camelcase-keys/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "camelcase-keys", - "version": "7.0.2", - "description": "Convert object keys to camel case", - "license": "MIT", - "repository": "sindresorhus/camelcase-keys", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=12" - }, - "scripts": { - "test": "xo && ava && tsd", - "bench": "matcha bench/bench.js" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "map", - "obj", - "object", - "key", - "keys", - "value", - "values", - "val", - "iterate", - "camelcase", - "camel-case", - "camel", - "case", - "dash", - "hyphen", - "dot", - "underscore", - "separator", - "string", - "text", - "convert", - "pascalcase", - "pascal-case", - "deep", - "recurse", - "recursive" - ], - "dependencies": { - "camelcase": "^6.3.0", - "map-obj": "^4.1.0", - "quick-lru": "^5.1.1", - "type-fest": "^1.2.1" - }, - "devDependencies": { - "ava": "^2.4.0", - "matcha": "^0.7.0", - "tsd": "^0.17.0", - "typescript": "^4.3.5", - "xo": "^0.36.1" - }, - "xo": { - "overrides": [ - { - "files": "bench/bench.js", - "rules": { - "import/no-unresolved": "off" - } - } - ] - } -} diff --git a/node_modules/camelcase-keys/readme.md b/node_modules/camelcase-keys/readme.md deleted file mode 100644 index 7874e55a4..000000000 --- a/node_modules/camelcase-keys/readme.md +++ /dev/null @@ -1,125 +0,0 @@ -# camelcase-keys - -> Convert object keys to camel case using [`camelcase`](https://github.com/sindresorhus/camelcase) - -## Install - -``` -$ npm install camelcase-keys -``` - -## Usage - -```js -const camelcaseKeys = require('camelcase-keys'); - -// Convert an object -camelcaseKeys({'foo-bar': true}); -//=> {fooBar: true} - -// Convert an array of objects -camelcaseKeys([{'foo-bar': true}, {'bar-foo': false}]); -//=> [{fooBar: true}, {barFoo: false}] - -camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true}); -//=> {fooBar: true, nested: {unicornRainbow: true}} - -camelcaseKeys({a_b: 1, a_c: {c_d: 1, c_e: {e_f: 1}}}, {deep: true, stopPaths: ['a_c.c_e']}), -//=> {aB: 1, aC: {cD: 1, cE: {e_f: 1}}} - -// Convert object keys to pascal case -camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true, pascalCase: true}); -//=> {FooBar: true, Nested: {UnicornRainbow: true}} -``` - -```js -const camelcaseKeys = require('camelcase-keys'); - -const argv = require('minimist')(process.argv.slice(2)); -//=> {_: [], 'foo-bar': true} - -camelcaseKeys(argv); -//=> {_: [], fooBar: true} -``` - -## API - -### camelcaseKeys(input, options?) - -#### input - -Type: `object | object[]` - -An object or array of objects to camel-case. - -#### options - -Type: `object` - -##### exclude - -Type: `Array`\ -Default: `[]` - -Exclude keys from being camel-cased. - -##### stopPaths - -Type: `string[]`\ -Default: `[]` - -Exclude children at the given object paths in dot-notation from being camel-cased. For example, with an object like `{a: {b: '🦄'}}`, the object path to reach the unicorn is `'a.b'`. - -```js -camelcaseKeys({ - a_b: 1, - a_c: { - c_d: 1, - c_e: { - e_f: 1 - } - } -}, { - deep: true, - stopPaths: [ - 'a_c.c_e' - ] -}), -/* -{ - aB: 1, - aC: { - cD: 1, - cE: { - e_f: 1 - } - } -} -*/ -``` - -##### deep - -Type: `boolean`\ -Default: `false` - -Recurse nested objects and objects in arrays. - -##### pascalCase - -Type: `boolean`\ -Default: `false` - -Uppercase the first character as in `bye-bye` → `ByeBye`. - -## camelcase-keys for enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of camelcase-keys and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-camelcase-keys?utm_source=npm-camelcase-keys&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - -## Related - -- [snakecase-keys](https://github.com/bendrucker/snakecase-keys) -- [kebabcase-keys](https://github.com/mattiloh/kebabcase-keys) - diff --git a/node_modules/camelcase/index.d.ts b/node_modules/camelcase/index.d.ts deleted file mode 100644 index 9db94e53c..000000000 --- a/node_modules/camelcase/index.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -declare namespace camelcase { - interface Options { - /** - Uppercase the first character: `foo-bar` → `FooBar`. - - @default false - */ - readonly pascalCase?: boolean; - - /** - Preserve the consecutive uppercase characters: `foo-BAR` → `FooBAR`. - - @default false - */ - readonly preserveConsecutiveUppercase?: boolean; - - /** - The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used. - - Setting `locale: false` ignores the platform locale and uses the [Unicode Default Case Conversion](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#simple-single-character-case-mapping) algorithm. - - Default: The host environment’s current locale. - - @example - ``` - import camelCase = require('camelcase'); - - camelCase('lorem-ipsum', {locale: 'en-US'}); - //=> 'loremIpsum' - camelCase('lorem-ipsum', {locale: 'tr-TR'}); - //=> 'loremİpsum' - camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']}); - //=> 'loremIpsum' - camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']}); - //=> 'loremİpsum' - ``` - */ - readonly locale?: false | string | readonly string[]; - } -} - -/** -Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`. - -Correctly handles Unicode strings. - -@param input - String to convert to camel case. - -@example -``` -import camelCase = require('camelcase'); - -camelCase('foo-bar'); -//=> 'fooBar' - -camelCase('foo_bar'); -//=> 'fooBar' - -camelCase('Foo-Bar'); -//=> 'fooBar' - -camelCase('розовый_пушистый_единорог'); -//=> 'розовыйПушистыйЕдинорог' - -camelCase('Foo-Bar', {pascalCase: true}); -//=> 'FooBar' - -camelCase('--foo.bar', {pascalCase: false}); -//=> 'fooBar' - -camelCase('Foo-BAR', {preserveConsecutiveUppercase: true}); -//=> 'fooBAR' - -camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true})); -//=> 'FooBAR' - -camelCase('foo bar'); -//=> 'fooBar' - -console.log(process.argv[3]); -//=> '--foo-bar' -camelCase(process.argv[3]); -//=> 'fooBar' - -camelCase(['foo', 'bar']); -//=> 'fooBar' - -camelCase(['__foo__', '--bar'], {pascalCase: true}); -//=> 'FooBar' - -camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true}) -//=> 'FooBAR' - -camelCase('lorem-ipsum', {locale: 'en-US'}); -//=> 'loremIpsum' -``` -*/ -declare function camelcase( - input: string | readonly string[], - options?: camelcase.Options -): string; - -export = camelcase; diff --git a/node_modules/camelcase/index.js b/node_modules/camelcase/index.js deleted file mode 100644 index 6ff4ee85c..000000000 --- a/node_modules/camelcase/index.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -const UPPERCASE = /[\p{Lu}]/u; -const LOWERCASE = /[\p{Ll}]/u; -const LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu; -const IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u; -const SEPARATORS = /[_.\- ]+/; - -const LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source); -const SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu'); -const NUMBERS_AND_IDENTIFIER = new RegExp('\\d+' + IDENTIFIER.source, 'gu'); - -const preserveCamelCase = (string, toLowerCase, toUpperCase) => { - let isLastCharLower = false; - let isLastCharUpper = false; - let isLastLastCharUpper = false; - - for (let i = 0; i < string.length; i++) { - const character = string[i]; - - if (isLastCharLower && UPPERCASE.test(character)) { - string = string.slice(0, i) + '-' + string.slice(i); - isLastCharLower = false; - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = true; - i++; - } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) { - string = string.slice(0, i - 1) + '-' + string.slice(i - 1); - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = false; - isLastCharLower = true; - } else { - isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character; - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character; - } - } - - return string; -}; - -const preserveConsecutiveUppercase = (input, toLowerCase) => { - LEADING_CAPITAL.lastIndex = 0; - - return input.replace(LEADING_CAPITAL, m1 => toLowerCase(m1)); -}; - -const postProcess = (input, toUpperCase) => { - SEPARATORS_AND_IDENTIFIER.lastIndex = 0; - NUMBERS_AND_IDENTIFIER.lastIndex = 0; - - return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)) - .replace(NUMBERS_AND_IDENTIFIER, m => toUpperCase(m)); -}; - -const camelCase = (input, options) => { - if (!(typeof input === 'string' || Array.isArray(input))) { - throw new TypeError('Expected the input to be `string | string[]`'); - } - - options = { - pascalCase: false, - preserveConsecutiveUppercase: false, - ...options - }; - - if (Array.isArray(input)) { - input = input.map(x => x.trim()) - .filter(x => x.length) - .join('-'); - } else { - input = input.trim(); - } - - if (input.length === 0) { - return ''; - } - - const toLowerCase = options.locale === false ? - string => string.toLowerCase() : - string => string.toLocaleLowerCase(options.locale); - const toUpperCase = options.locale === false ? - string => string.toUpperCase() : - string => string.toLocaleUpperCase(options.locale); - - if (input.length === 1) { - return options.pascalCase ? toUpperCase(input) : toLowerCase(input); - } - - const hasUpperCase = input !== toLowerCase(input); - - if (hasUpperCase) { - input = preserveCamelCase(input, toLowerCase, toUpperCase); - } - - input = input.replace(LEADING_SEPARATORS, ''); - - if (options.preserveConsecutiveUppercase) { - input = preserveConsecutiveUppercase(input, toLowerCase); - } else { - input = toLowerCase(input); - } - - if (options.pascalCase) { - input = toUpperCase(input.charAt(0)) + input.slice(1); - } - - return postProcess(input, toUpperCase); -}; - -module.exports = camelCase; -// TODO: Remove this for the next major release -module.exports.default = camelCase; diff --git a/node_modules/camelcase/license b/node_modules/camelcase/license deleted file mode 100644 index fa7ceba3e..000000000 --- a/node_modules/camelcase/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/camelcase/package.json b/node_modules/camelcase/package.json deleted file mode 100644 index c43357925..000000000 --- a/node_modules/camelcase/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "camelcase", - "version": "6.3.0", - "description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`", - "license": "MIT", - "repository": "sindresorhus/camelcase", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "camelcase", - "camel-case", - "camel", - "case", - "dash", - "hyphen", - "dot", - "underscore", - "separator", - "string", - "text", - "convert", - "pascalcase", - "pascal-case" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.11.0", - "xo": "^0.28.3" - } -} diff --git a/node_modules/camelcase/readme.md b/node_modules/camelcase/readme.md deleted file mode 100644 index 0ff8f9e18..000000000 --- a/node_modules/camelcase/readme.md +++ /dev/null @@ -1,144 +0,0 @@ -# camelcase - -> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar` - -Correctly handles Unicode strings. - -If you use this on untrusted user input, don't forget to limit the length to something reasonable. - -## Install - -``` -$ npm install camelcase -``` - -*If you need to support Firefox < 78, stay on version 5 as version 6 uses regex features not available in Firefox < 78.* - -## Usage - -```js -const camelCase = require('camelcase'); - -camelCase('foo-bar'); -//=> 'fooBar' - -camelCase('foo_bar'); -//=> 'fooBar' - -camelCase('Foo-Bar'); -//=> 'fooBar' - -camelCase('розовый_пушистый_единорог'); -//=> 'розовыйПушистыйЕдинорог' - -camelCase('Foo-Bar', {pascalCase: true}); -//=> 'FooBar' - -camelCase('--foo.bar', {pascalCase: false}); -//=> 'fooBar' - -camelCase('Foo-BAR', {preserveConsecutiveUppercase: true}); -//=> 'fooBAR' - -camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true})); -//=> 'FooBAR' - -camelCase('foo bar'); -//=> 'fooBar' - -console.log(process.argv[3]); -//=> '--foo-bar' -camelCase(process.argv[3]); -//=> 'fooBar' - -camelCase(['foo', 'bar']); -//=> 'fooBar' - -camelCase(['__foo__', '--bar'], {pascalCase: true}); -//=> 'FooBar' - -camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true}) -//=> 'FooBAR' - -camelCase('lorem-ipsum', {locale: 'en-US'}); -//=> 'loremIpsum' -``` - -## API - -### camelCase(input, options?) - -#### input - -Type: `string | string[]` - -String to convert to camel case. - -#### options - -Type: `object` - -##### pascalCase - -Type: `boolean`\ -Default: `false` - -Uppercase the first character: `foo-bar` → `FooBar` - -##### preserveConsecutiveUppercase - -Type: `boolean`\ -Default: `false` - -Preserve the consecutive uppercase characters: `foo-BAR` → `FooBAR`. - -##### locale - -Type: `false | string | string[]`\ -Default: The host environment’s current locale. - -The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used. - -```js -const camelCase = require('camelcase'); - -camelCase('lorem-ipsum', {locale: 'en-US'}); -//=> 'loremIpsum' - -camelCase('lorem-ipsum', {locale: 'tr-TR'}); -//=> 'loremİpsum' - -camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']}); -//=> 'loremIpsum' - -camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']}); -//=> 'loremİpsum' -``` - -Setting `locale: false` ignores the platform locale and uses the [Unicode Default Case Conversion](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#simple-single-character-case-mapping) algorithm: - -```js -const camelCase = require('camelcase'); - -// On a platform with 'tr-TR' - -camelCase('lorem-ipsum'); -//=> 'loremİpsum' - -camelCase('lorem-ipsum', {locale: false}); -//=> 'loremIpsum' -``` - -## camelcase for enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of camelcase and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - -## Related - -- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module -- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase -- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string -- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one -- [camelcase-keys](https://github.com/sindresorhus/camelcase-keys) - Convert object keys to camel case diff --git a/node_modules/chalk/index.js b/node_modules/chalk/index.js deleted file mode 100644 index 1cc5fa89a..000000000 --- a/node_modules/chalk/index.js +++ /dev/null @@ -1,228 +0,0 @@ -'use strict'; -const escapeStringRegexp = require('escape-string-regexp'); -const ansiStyles = require('ansi-styles'); -const stdoutColor = require('supports-color').stdout; - -const template = require('./templates.js'); - -const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); - -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; - -// `color-convert` models to exclude from the Chalk API due to conflicts and such -const skipModels = new Set(['gray']); - -const styles = Object.create(null); - -function applyOptions(obj, options) { - options = options || {}; - - // Detect level if not set manually - const scLevel = stdoutColor ? stdoutColor.level : 0; - obj.level = options.level === undefined ? scLevel : options.level; - obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; -} - -function Chalk(options) { - // We check for this.template here since calling `chalk.constructor()` - // by itself will have a `this` of a previously constructed chalk object - if (!this || !(this instanceof Chalk) || this.template) { - const chalk = {}; - applyOptions(chalk, options); - - chalk.template = function () { - const args = [].slice.call(arguments); - return chalkTag.apply(null, [chalk.template].concat(args)); - }; - - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); - - chalk.template.constructor = Chalk; - - return chalk.template; - } - - applyOptions(this, options); -} - -// Use bright blue on Windows as the normal blue color is illegible -if (isSimpleWindowsTerm) { - ansiStyles.blue.open = '\u001B[94m'; -} - -for (const key of Object.keys(ansiStyles)) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); - - styles[key] = { - get() { - const codes = ansiStyles[key]; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); - } - }; -} - -styles.visible = { - get() { - return build.call(this, this._styles || [], true, 'visible'); - } -}; - -ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); -for (const model of Object.keys(ansiStyles.color.ansi)) { - if (skipModels.has(model)) { - continue; - } - - styles[model] = { - get() { - const level = this.level; - return function () { - const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); - const codes = { - open, - close: ansiStyles.color.close, - closeRe: ansiStyles.color.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); - }; - } - }; -} - -ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); -for (const model of Object.keys(ansiStyles.bgColor.ansi)) { - if (skipModels.has(model)) { - continue; - } - - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const level = this.level; - return function () { - const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); - const codes = { - open, - close: ansiStyles.bgColor.close, - closeRe: ansiStyles.bgColor.closeRe - }; - return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); - }; - } - }; -} - -const proto = Object.defineProperties(() => {}, styles); - -function build(_styles, _empty, key) { - const builder = function () { - return applyStyle.apply(builder, arguments); - }; - - builder._styles = _styles; - builder._empty = _empty; - - const self = this; - - Object.defineProperty(builder, 'level', { - enumerable: true, - get() { - return self.level; - }, - set(level) { - self.level = level; - } - }); - - Object.defineProperty(builder, 'enabled', { - enumerable: true, - get() { - return self.enabled; - }, - set(enabled) { - self.enabled = enabled; - } - }); - - // See below for fix regarding invisible grey/dim combination on Windows - builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; - - // `__proto__` is used because we must return a function, but there is - // no way to create a function with a different prototype - builder.__proto__ = proto; // eslint-disable-line no-proto - - return builder; -} - -function applyStyle() { - // Support varags, but simply cast to string in case there's only one arg - const args = arguments; - const argsLen = args.length; - let str = String(arguments[0]); - - if (argsLen === 0) { - return ''; - } - - if (argsLen > 1) { - // Don't slice `arguments`, it prevents V8 optimizations - for (let a = 1; a < argsLen; a++) { - str += ' ' + args[a]; - } - } - - if (!this.enabled || this.level <= 0 || !str) { - return this._empty ? '' : str; - } - - // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, - // see https://github.com/chalk/chalk/issues/58 - // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. - const originalDim = ansiStyles.dim.open; - if (isSimpleWindowsTerm && this.hasGrey) { - ansiStyles.dim.open = ''; - } - - for (const code of this._styles.slice().reverse()) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - str = code.open + str.replace(code.closeRe, code.open) + code.close; - - // Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS - // https://github.com/chalk/chalk/pull/92 - str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); - } - - // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue - ansiStyles.dim.open = originalDim; - - return str; -} - -function chalkTag(chalk, strings) { - if (!Array.isArray(strings)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return [].slice.call(arguments, 1).join(' '); - } - - const args = [].slice.call(arguments, 2); - const parts = [strings.raw[0]]; - - for (let i = 1; i < strings.length; i++) { - parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); - parts.push(String(strings.raw[i])); - } - - return template(chalk, parts.join('')); -} - -Object.defineProperties(Chalk.prototype, styles); - -module.exports = Chalk(); // eslint-disable-line new-cap -module.exports.supportsColor = stdoutColor; -module.exports.default = module.exports; // For TypeScript diff --git a/node_modules/chalk/index.js.flow b/node_modules/chalk/index.js.flow deleted file mode 100644 index 622caaa2e..000000000 --- a/node_modules/chalk/index.js.flow +++ /dev/null @@ -1,93 +0,0 @@ -// @flow strict - -type TemplateStringsArray = $ReadOnlyArray; - -export type Level = $Values<{ - None: 0, - Basic: 1, - Ansi256: 2, - TrueColor: 3 -}>; - -export type ChalkOptions = {| - enabled?: boolean, - level?: Level -|}; - -export type ColorSupport = {| - level: Level, - hasBasic: boolean, - has256: boolean, - has16m: boolean -|}; - -export interface Chalk { - (...text: string[]): string, - (text: TemplateStringsArray, ...placeholders: string[]): string, - constructor(options?: ChalkOptions): Chalk, - enabled: boolean, - level: Level, - rgb(r: number, g: number, b: number): Chalk, - hsl(h: number, s: number, l: number): Chalk, - hsv(h: number, s: number, v: number): Chalk, - hwb(h: number, w: number, b: number): Chalk, - bgHex(color: string): Chalk, - bgKeyword(color: string): Chalk, - bgRgb(r: number, g: number, b: number): Chalk, - bgHsl(h: number, s: number, l: number): Chalk, - bgHsv(h: number, s: number, v: number): Chalk, - bgHwb(h: number, w: number, b: number): Chalk, - hex(color: string): Chalk, - keyword(color: string): Chalk, - - +reset: Chalk, - +bold: Chalk, - +dim: Chalk, - +italic: Chalk, - +underline: Chalk, - +inverse: Chalk, - +hidden: Chalk, - +strikethrough: Chalk, - - +visible: Chalk, - - +black: Chalk, - +red: Chalk, - +green: Chalk, - +yellow: Chalk, - +blue: Chalk, - +magenta: Chalk, - +cyan: Chalk, - +white: Chalk, - +gray: Chalk, - +grey: Chalk, - +blackBright: Chalk, - +redBright: Chalk, - +greenBright: Chalk, - +yellowBright: Chalk, - +blueBright: Chalk, - +magentaBright: Chalk, - +cyanBright: Chalk, - +whiteBright: Chalk, - - +bgBlack: Chalk, - +bgRed: Chalk, - +bgGreen: Chalk, - +bgYellow: Chalk, - +bgBlue: Chalk, - +bgMagenta: Chalk, - +bgCyan: Chalk, - +bgWhite: Chalk, - +bgBlackBright: Chalk, - +bgRedBright: Chalk, - +bgGreenBright: Chalk, - +bgYellowBright: Chalk, - +bgBlueBright: Chalk, - +bgMagentaBright: Chalk, - +bgCyanBright: Chalk, - +bgWhiteBrigh: Chalk, - - supportsColor: ColorSupport -}; - -declare module.exports: Chalk; diff --git a/node_modules/chalk/license b/node_modules/chalk/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/chalk/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json deleted file mode 100644 index bc324685a..000000000 --- a/node_modules/chalk/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "chalk", - "version": "2.4.2", - "description": "Terminal string styling done right", - "license": "MIT", - "repository": "chalk/chalk", - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava", - "bench": "matcha benchmark.js", - "coveralls": "nyc report --reporter=text-lcov | coveralls" - }, - "files": [ - "index.js", - "templates.js", - "types/index.d.ts", - "index.js.flow" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "devDependencies": { - "ava": "*", - "coveralls": "^3.0.0", - "execa": "^0.9.0", - "flow-bin": "^0.68.0", - "import-fresh": "^2.0.0", - "matcha": "^0.7.0", - "nyc": "^11.0.2", - "resolve-from": "^4.0.0", - "typescript": "^2.5.3", - "xo": "*" - }, - "types": "types/index.d.ts", - "xo": { - "envs": [ - "node", - "mocha" - ], - "ignores": [ - "test/_flow.js" - ] - } -} diff --git a/node_modules/chalk/readme.md b/node_modules/chalk/readme.md deleted file mode 100644 index d298e2c48..000000000 --- a/node_modules/chalk/readme.md +++ /dev/null @@ -1,314 +0,0 @@ -

-
-
- Chalk -
-
-
-

- -> Terminal string styling done right - -[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs) - -### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0) - - - - -## Highlights - -- Expressive API -- Highly performant -- Ability to nest styles -- [256/Truecolor color support](#256-and-truecolor-color-support) -- Auto-detects color support -- Doesn't extend `String.prototype` -- Clean and focused -- Actively maintained -- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017 - - -## Install - -```console -$ npm install chalk -``` - -
- - - - -## Usage - -```js -const chalk = require('chalk'); - -console.log(chalk.blue('Hello world!')); -``` - -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. - -```js -const chalk = require('chalk'); -const log = console.log; - -// Combine styled and normal strings -log(chalk.blue('Hello') + ' World' + chalk.red('!')); - -// Compose multiple styles using the chainable API -log(chalk.blue.bgRed.bold('Hello world!')); - -// Pass in multiple arguments -log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); - -// Nest styles -log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); - -// Nest styles of the same type even (color, underline, background) -log(chalk.green( - 'I am a green line ' + - chalk.blue.underline.bold('with a blue substring') + - ' that becomes green again!' -)); - -// ES2015 template literal -log(` -CPU: ${chalk.red('90%')} -RAM: ${chalk.green('40%')} -DISK: ${chalk.yellow('70%')} -`); - -// ES2015 tagged template literal -log(chalk` -CPU: {red ${cpu.totalPercent}%} -RAM: {green ${ram.used / ram.total * 100}%} -DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} -`); - -// Use RGB colors in terminal emulators that support it. -log(chalk.keyword('orange')('Yay for orange colored text!')); -log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); -log(chalk.hex('#DEADED').bold('Bold gray!')); -``` - -Easily define your own themes: - -```js -const chalk = require('chalk'); - -const error = chalk.bold.red; -const warning = chalk.keyword('orange'); - -console.log(error('Error!')); -console.log(warning('Warning!')); -``` - -Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): - -```js -const name = 'Sindre'; -console.log(chalk.green('Hello %s'), name); -//=> 'Hello Sindre' -``` - - -## API - -### chalk.`' - * ) - * document.type //=> 'document' - * document.nodes.length //=> 2 - * ``` - */ -declare class Document_ extends Container { - parent: undefined - type: 'document' - - constructor(defaults?: Document.DocumentProps) - - /** - * Returns a `Result` instance representing the document’s CSS roots. - * - * ```js - * const root1 = postcss.parse(css1, { from: 'a.css' }) - * const root2 = postcss.parse(css2, { from: 'b.css' }) - * const document = postcss.document() - * document.append(root1) - * document.append(root2) - * const result = document.toResult({ to: 'all.css', map: true }) - * ``` - * - * @param opts Options. - * @return Result with current document’s CSS. - */ - toResult(options?: ProcessOptions): Result -} - -declare class Document extends Document_ {} - -export = Document diff --git a/node_modules/postcss/lib/document.js b/node_modules/postcss/lib/document.js deleted file mode 100644 index 44689917f..000000000 --- a/node_modules/postcss/lib/document.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict' - -let Container = require('./container') - -let LazyResult, Processor - -class Document extends Container { - constructor(defaults) { - // type needs to be passed to super, otherwise child roots won't be normalized correctly - super({ type: 'document', ...defaults }) - - if (!this.nodes) { - this.nodes = [] - } - } - - toResult(opts = {}) { - let lazy = new LazyResult(new Processor(), this, opts) - - return lazy.stringify() - } -} - -Document.registerLazyResult = dependant => { - LazyResult = dependant -} - -Document.registerProcessor = dependant => { - Processor = dependant -} - -module.exports = Document -Document.default = Document diff --git a/node_modules/postcss/lib/fromJSON.d.ts b/node_modules/postcss/lib/fromJSON.d.ts deleted file mode 100644 index e1deedbd3..000000000 --- a/node_modules/postcss/lib/fromJSON.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { JSONHydrator } from './postcss.js' - -interface FromJSON extends JSONHydrator { - default: FromJSON -} - -declare const fromJSON: FromJSON - -export = fromJSON diff --git a/node_modules/postcss/lib/fromJSON.js b/node_modules/postcss/lib/fromJSON.js deleted file mode 100644 index 09f2b89aa..000000000 --- a/node_modules/postcss/lib/fromJSON.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict' - -let Declaration = require('./declaration') -let PreviousMap = require('./previous-map') -let Comment = require('./comment') -let AtRule = require('./at-rule') -let Input = require('./input') -let Root = require('./root') -let Rule = require('./rule') - -function fromJSON(json, inputs) { - if (Array.isArray(json)) return json.map(n => fromJSON(n)) - - let { inputs: ownInputs, ...defaults } = json - if (ownInputs) { - inputs = [] - for (let input of ownInputs) { - let inputHydrated = { ...input, __proto__: Input.prototype } - if (inputHydrated.map) { - inputHydrated.map = { - ...inputHydrated.map, - __proto__: PreviousMap.prototype - } - } - inputs.push(inputHydrated) - } - } - if (defaults.nodes) { - defaults.nodes = json.nodes.map(n => fromJSON(n, inputs)) - } - if (defaults.source) { - let { inputId, ...source } = defaults.source - defaults.source = source - if (inputId != null) { - defaults.source.input = inputs[inputId] - } - } - if (defaults.type === 'root') { - return new Root(defaults) - } else if (defaults.type === 'decl') { - return new Declaration(defaults) - } else if (defaults.type === 'rule') { - return new Rule(defaults) - } else if (defaults.type === 'comment') { - return new Comment(defaults) - } else if (defaults.type === 'atrule') { - return new AtRule(defaults) - } else { - throw new Error('Unknown node type: ' + json.type) - } -} - -module.exports = fromJSON -fromJSON.default = fromJSON diff --git a/node_modules/postcss/lib/input.d.ts b/node_modules/postcss/lib/input.d.ts deleted file mode 100644 index 6143a9b27..000000000 --- a/node_modules/postcss/lib/input.d.ts +++ /dev/null @@ -1,194 +0,0 @@ -import { CssSyntaxError, ProcessOptions } from './postcss.js' -import PreviousMap from './previous-map.js' - -declare namespace Input { - export interface FilePosition { - /** - * Column of inclusive start position in source file. - */ - column: number - - /** - * Column of exclusive end position in source file. - */ - endColumn?: number - - /** - * Line of exclusive end position in source file. - */ - endLine?: number - - /** - * Absolute path to the source file. - */ - file?: string - - /** - * Line of inclusive start position in source file. - */ - line: number - - /** - * Source code. - */ - source?: string - - /** - * URL for the source file. - */ - url: string - } - - // eslint-disable-next-line @typescript-eslint/no-use-before-define - export { Input_ as default } -} - -/** - * Represents the source CSS. - * - * ```js - * const root = postcss.parse(css, { from: file }) - * const input = root.source.input - * ``` - */ -declare class Input_ { - /** - * Input CSS source. - * - * ```js - * const input = postcss.parse('a{}', { from: file }).input - * input.css //=> "a{}" - * ``` - */ - css: string - - /** - * The absolute path to the CSS source file defined - * with the `from` option. - * - * ```js - * const root = postcss.parse(css, { from: 'a.css' }) - * root.source.input.file //=> '/home/ai/a.css' - * ``` - */ - file?: string - - /** - * The flag to indicate whether or not the source code has Unicode BOM. - */ - hasBOM: boolean - - /** - * The unique ID of the CSS source. It will be created if `from` option - * is not provided (because PostCSS does not know the file path). - * - * ```js - * const root = postcss.parse(css) - * root.source.input.file //=> undefined - * root.source.input.id //=> "" - * ``` - */ - id?: string - - /** - * The input source map passed from a compilation step before PostCSS - * (for example, from Sass compiler). - * - * ```js - * root.source.input.map.consumer().sources //=> ['a.sass'] - * ``` - */ - map: PreviousMap - - /** - * @param css Input CSS source. - * @param opts Process options. - */ - constructor(css: string, opts?: ProcessOptions) - - error( - message: string, - start: - | { - column: number - line: number - } - | { - offset: number - }, - end: - | { - column: number - line: number - } - | { - offset: number - }, - opts?: { plugin?: CssSyntaxError['plugin'] } - ): CssSyntaxError - - /** - * Returns `CssSyntaxError` with information about the error and its position. - */ - error( - message: string, - line: number, - column: number, - opts?: { plugin?: CssSyntaxError['plugin'] } - ): CssSyntaxError - - error( - message: string, - offset: number, - opts?: { plugin?: CssSyntaxError['plugin'] } - ): CssSyntaxError - - /** - * The CSS source identifier. Contains `Input#file` if the user - * set the `from` option, or `Input#id` if they did not. - * - * ```js - * const root = postcss.parse(css, { from: 'a.css' }) - * root.source.input.from //=> "/home/ai/a.css" - * - * const root = postcss.parse(css) - * root.source.input.from //=> "" - * ``` - */ - get from(): string - /** - * Converts source offset to line and column. - * - * @param offset Source offset. - */ - fromOffset(offset: number): { col: number; line: number } | null - /** - * Reads the input source map and returns a symbol position - * in the input source (e.g., in a Sass file that was compiled - * to CSS before being passed to PostCSS). Optionally takes an - * end position, exclusive. - * - * ```js - * root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 } - * root.source.input.origin(1, 1, 1, 4) - * //=> { file: 'a.css', line: 3, column: 1, endLine: 3, endColumn: 4 } - * ``` - * - * @param line Line for inclusive start position in input CSS. - * @param column Column for inclusive start position in input CSS. - * @param endLine Line for exclusive end position in input CSS. - * @param endColumn Column for exclusive end position in input CSS. - * - * @return Position in input source. - */ - origin( - line: number, - column: number, - endLine?: number, - endColumn?: number - ): false | Input.FilePosition -} - -declare class Input extends Input_ {} - -export = Input diff --git a/node_modules/postcss/lib/input.js b/node_modules/postcss/lib/input.js deleted file mode 100644 index 4f63ce92c..000000000 --- a/node_modules/postcss/lib/input.js +++ /dev/null @@ -1,248 +0,0 @@ -'use strict' - -let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') -let { fileURLToPath, pathToFileURL } = require('url') -let { isAbsolute, resolve } = require('path') -let { nanoid } = require('nanoid/non-secure') - -let terminalHighlight = require('./terminal-highlight') -let CssSyntaxError = require('./css-syntax-error') -let PreviousMap = require('./previous-map') - -let fromOffsetCache = Symbol('fromOffsetCache') - -let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) -let pathAvailable = Boolean(resolve && isAbsolute) - -class Input { - constructor(css, opts = {}) { - if ( - css === null || - typeof css === 'undefined' || - (typeof css === 'object' && !css.toString) - ) { - throw new Error(`PostCSS received ${css} instead of CSS string`) - } - - this.css = css.toString() - - if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') { - this.hasBOM = true - this.css = this.css.slice(1) - } else { - this.hasBOM = false - } - - if (opts.from) { - if ( - !pathAvailable || - /^\w+:\/\//.test(opts.from) || - isAbsolute(opts.from) - ) { - this.file = opts.from - } else { - this.file = resolve(opts.from) - } - } - - if (pathAvailable && sourceMapAvailable) { - let map = new PreviousMap(this.css, opts) - if (map.text) { - this.map = map - let file = map.consumer().file - if (!this.file && file) this.file = this.mapResolve(file) - } - } - - if (!this.file) { - this.id = '' - } - if (this.map) this.map.file = this.from - } - - error(message, line, column, opts = {}) { - let result, endLine, endColumn - - if (line && typeof line === 'object') { - let start = line - let end = column - if (typeof start.offset === 'number') { - let pos = this.fromOffset(start.offset) - line = pos.line - column = pos.col - } else { - line = start.line - column = start.column - } - if (typeof end.offset === 'number') { - let pos = this.fromOffset(end.offset) - endLine = pos.line - endColumn = pos.col - } else { - endLine = end.line - endColumn = end.column - } - } else if (!column) { - let pos = this.fromOffset(line) - line = pos.line - column = pos.col - } - - let origin = this.origin(line, column, endLine, endColumn) - if (origin) { - result = new CssSyntaxError( - message, - origin.endLine === undefined - ? origin.line - : { column: origin.column, line: origin.line }, - origin.endLine === undefined - ? origin.column - : { column: origin.endColumn, line: origin.endLine }, - origin.source, - origin.file, - opts.plugin - ) - } else { - result = new CssSyntaxError( - message, - endLine === undefined ? line : { column, line }, - endLine === undefined ? column : { column: endColumn, line: endLine }, - this.css, - this.file, - opts.plugin - ) - } - - result.input = { column, endColumn, endLine, line, source: this.css } - if (this.file) { - if (pathToFileURL) { - result.input.url = pathToFileURL(this.file).toString() - } - result.input.file = this.file - } - - return result - } - - get from() { - return this.file || this.id - } - - fromOffset(offset) { - let lastLine, lineToIndex - if (!this[fromOffsetCache]) { - let lines = this.css.split('\n') - lineToIndex = new Array(lines.length) - let prevIndex = 0 - - for (let i = 0, l = lines.length; i < l; i++) { - lineToIndex[i] = prevIndex - prevIndex += lines[i].length + 1 - } - - this[fromOffsetCache] = lineToIndex - } else { - lineToIndex = this[fromOffsetCache] - } - lastLine = lineToIndex[lineToIndex.length - 1] - - let min = 0 - if (offset >= lastLine) { - min = lineToIndex.length - 1 - } else { - let max = lineToIndex.length - 2 - let mid - while (min < max) { - mid = min + ((max - min) >> 1) - if (offset < lineToIndex[mid]) { - max = mid - 1 - } else if (offset >= lineToIndex[mid + 1]) { - min = mid + 1 - } else { - min = mid - break - } - } - } - return { - col: offset - lineToIndex[min] + 1, - line: min + 1 - } - } - - mapResolve(file) { - if (/^\w+:\/\//.test(file)) { - return file - } - return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file) - } - - origin(line, column, endLine, endColumn) { - if (!this.map) return false - let consumer = this.map.consumer() - - let from = consumer.originalPositionFor({ column, line }) - if (!from.source) return false - - let to - if (typeof endLine === 'number') { - to = consumer.originalPositionFor({ column: endColumn, line: endLine }) - } - - let fromUrl - - if (isAbsolute(from.source)) { - fromUrl = pathToFileURL(from.source) - } else { - fromUrl = new URL( - from.source, - this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile) - ) - } - - let result = { - column: from.column, - endColumn: to && to.column, - endLine: to && to.line, - line: from.line, - url: fromUrl.toString() - } - - if (fromUrl.protocol === 'file:') { - if (fileURLToPath) { - result.file = fileURLToPath(fromUrl) - } else { - /* c8 ignore next 2 */ - throw new Error(`file: protocol is not available in this PostCSS build`) - } - } - - let source = consumer.sourceContentFor(from.source) - if (source) result.source = source - - return result - } - - toJSON() { - let json = {} - for (let name of ['hasBOM', 'css', 'file', 'id']) { - if (this[name] != null) { - json[name] = this[name] - } - } - if (this.map) { - json.map = { ...this.map } - if (json.map.consumerCache) { - json.map.consumerCache = undefined - } - } - return json - } -} - -module.exports = Input -Input.default = Input - -if (terminalHighlight && terminalHighlight.registerInput) { - terminalHighlight.registerInput(Input) -} diff --git a/node_modules/postcss/lib/lazy-result.d.ts b/node_modules/postcss/lib/lazy-result.d.ts deleted file mode 100644 index e715d6755..000000000 --- a/node_modules/postcss/lib/lazy-result.d.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { SourceMap } from './postcss.js' -import Processor from './processor.js' -import Result, { Message, ResultOptions } from './result.js' -import Root from './root.js' -import Warning from './warning.js' - -declare namespace LazyResult { - // eslint-disable-next-line @typescript-eslint/no-use-before-define - export { LazyResult_ as default } -} - -/** - * A Promise proxy for the result of PostCSS transformations. - * - * A `LazyResult` instance is returned by `Processor#process`. - * - * ```js - * const lazy = postcss([autoprefixer]).process(css) - * ``` - */ -declare class LazyResult_ implements PromiseLike { - /** - * Processes input CSS through synchronous and asynchronous plugins - * and calls onRejected for each error thrown in any plugin. - * - * It implements standard Promise API. - * - * ```js - * postcss([autoprefixer]).process(css).then(result => { - * console.log(result.css) - * }).catch(error => { - * console.error(error) - * }) - * ``` - */ - catch: Promise['catch'] - - /** - * Processes input CSS through synchronous and asynchronous plugins - * and calls onFinally on any error or when all plugins will finish work. - * - * It implements standard Promise API. - * - * ```js - * postcss([autoprefixer]).process(css).finally(() => { - * console.log('processing ended') - * }) - * ``` - */ - finally: Promise['finally'] - - /** - * Processes input CSS through synchronous and asynchronous plugins - * and calls `onFulfilled` with a Result instance. If a plugin throws - * an error, the `onRejected` callback will be executed. - * - * It implements standard Promise API. - * - * ```js - * postcss([autoprefixer]).process(css, { from: cssPath }).then(result => { - * console.log(result.css) - * }) - * ``` - */ - then: Promise['then'] - - /** - * @param processor Processor used for this transformation. - * @param css CSS to parse and transform. - * @param opts Options from the `Processor#process` or `Root#toResult`. - */ - constructor(processor: Processor, css: string, opts: ResultOptions) - - /** - * Run plugin in async way and return `Result`. - * - * @return Result with output content. - */ - async(): Promise - - /** - * An alias for the `css` property. Use it with syntaxes - * that generate non-CSS output. - * - * This property will only work with synchronous plugins. - * If the processor contains any asynchronous plugins - * it will throw an error. - * - * PostCSS runners should always use `LazyResult#then`. - */ - get content(): string - - /** - * Processes input CSS through synchronous plugins, converts `Root` - * to a CSS string and returns `Result#css`. - * - * This property will only work with synchronous plugins. - * If the processor contains any asynchronous plugins - * it will throw an error. - * - * PostCSS runners should always use `LazyResult#then`. - */ - get css(): string - - /** - * Processes input CSS through synchronous plugins - * and returns `Result#map`. - * - * This property will only work with synchronous plugins. - * If the processor contains any asynchronous plugins - * it will throw an error. - * - * PostCSS runners should always use `LazyResult#then`. - */ - get map(): SourceMap - - /** - * Processes input CSS through synchronous plugins - * and returns `Result#messages`. - * - * This property will only work with synchronous plugins. If the processor - * contains any asynchronous plugins it will throw an error. - * - * PostCSS runners should always use `LazyResult#then`. - */ - get messages(): Message[] - - /** - * Options from the `Processor#process` call. - */ - get opts(): ResultOptions - - /** - * Returns a `Processor` instance, which will be used - * for CSS transformations. - */ - get processor(): Processor - - /** - * Processes input CSS through synchronous plugins - * and returns `Result#root`. - * - * This property will only work with synchronous plugins. If the processor - * contains any asynchronous plugins it will throw an error. - * - * PostCSS runners should always use `LazyResult#then`. - */ - get root(): Root - - /** - * Returns the default string description of an object. - * Required to implement the Promise interface. - */ - get [Symbol.toStringTag](): string - - /** - * Run plugin in sync way and return `Result`. - * - * @return Result with output content. - */ - sync(): Result - - /** - * Alias for the `LazyResult#css` property. - * - * ```js - * lazy + '' === lazy.css - * ``` - * - * @return Output CSS. - */ - toString(): string - - /** - * Processes input CSS through synchronous plugins - * and calls `Result#warnings`. - * - * @return Warnings from plugins. - */ - warnings(): Warning[] -} - -declare class LazyResult extends LazyResult_ {} - -export = LazyResult diff --git a/node_modules/postcss/lib/lazy-result.js b/node_modules/postcss/lib/lazy-result.js deleted file mode 100644 index d18c9c880..000000000 --- a/node_modules/postcss/lib/lazy-result.js +++ /dev/null @@ -1,550 +0,0 @@ -'use strict' - -let { isClean, my } = require('./symbols') -let MapGenerator = require('./map-generator') -let stringify = require('./stringify') -let Container = require('./container') -let Document = require('./document') -let warnOnce = require('./warn-once') -let Result = require('./result') -let parse = require('./parse') -let Root = require('./root') - -const TYPE_TO_CLASS_NAME = { - atrule: 'AtRule', - comment: 'Comment', - decl: 'Declaration', - document: 'Document', - root: 'Root', - rule: 'Rule' -} - -const PLUGIN_PROPS = { - AtRule: true, - AtRuleExit: true, - Comment: true, - CommentExit: true, - Declaration: true, - DeclarationExit: true, - Document: true, - DocumentExit: true, - Once: true, - OnceExit: true, - postcssPlugin: true, - prepare: true, - Root: true, - RootExit: true, - Rule: true, - RuleExit: true -} - -const NOT_VISITORS = { - Once: true, - postcssPlugin: true, - prepare: true -} - -const CHILDREN = 0 - -function isPromise(obj) { - return typeof obj === 'object' && typeof obj.then === 'function' -} - -function getEvents(node) { - let key = false - let type = TYPE_TO_CLASS_NAME[node.type] - if (node.type === 'decl') { - key = node.prop.toLowerCase() - } else if (node.type === 'atrule') { - key = node.name.toLowerCase() - } - - if (key && node.append) { - return [ - type, - type + '-' + key, - CHILDREN, - type + 'Exit', - type + 'Exit-' + key - ] - } else if (key) { - return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key] - } else if (node.append) { - return [type, CHILDREN, type + 'Exit'] - } else { - return [type, type + 'Exit'] - } -} - -function toStack(node) { - let events - if (node.type === 'document') { - events = ['Document', CHILDREN, 'DocumentExit'] - } else if (node.type === 'root') { - events = ['Root', CHILDREN, 'RootExit'] - } else { - events = getEvents(node) - } - - return { - eventIndex: 0, - events, - iterator: 0, - node, - visitorIndex: 0, - visitors: [] - } -} - -function cleanMarks(node) { - node[isClean] = false - if (node.nodes) node.nodes.forEach(i => cleanMarks(i)) - return node -} - -let postcss = {} - -class LazyResult { - constructor(processor, css, opts) { - this.stringified = false - this.processed = false - - let root - if ( - typeof css === 'object' && - css !== null && - (css.type === 'root' || css.type === 'document') - ) { - root = cleanMarks(css) - } else if (css instanceof LazyResult || css instanceof Result) { - root = cleanMarks(css.root) - if (css.map) { - if (typeof opts.map === 'undefined') opts.map = {} - if (!opts.map.inline) opts.map.inline = false - opts.map.prev = css.map - } - } else { - let parser = parse - if (opts.syntax) parser = opts.syntax.parse - if (opts.parser) parser = opts.parser - if (parser.parse) parser = parser.parse - - try { - root = parser(css, opts) - } catch (error) { - this.processed = true - this.error = error - } - - if (root && !root[my]) { - /* c8 ignore next 2 */ - Container.rebuild(root) - } - } - - this.result = new Result(processor, root, opts) - this.helpers = { ...postcss, postcss, result: this.result } - this.plugins = this.processor.plugins.map(plugin => { - if (typeof plugin === 'object' && plugin.prepare) { - return { ...plugin, ...plugin.prepare(this.result) } - } else { - return plugin - } - }) - } - - async() { - if (this.error) return Promise.reject(this.error) - if (this.processed) return Promise.resolve(this.result) - if (!this.processing) { - this.processing = this.runAsync() - } - return this.processing - } - - catch(onRejected) { - return this.async().catch(onRejected) - } - - get content() { - return this.stringify().content - } - - get css() { - return this.stringify().css - } - - finally(onFinally) { - return this.async().then(onFinally, onFinally) - } - - getAsyncError() { - throw new Error('Use process(css).then(cb) to work with async plugins') - } - - handleError(error, node) { - let plugin = this.result.lastPlugin - try { - if (node) node.addToError(error) - this.error = error - if (error.name === 'CssSyntaxError' && !error.plugin) { - error.plugin = plugin.postcssPlugin - error.setMessage() - } else if (plugin.postcssVersion) { - if (process.env.NODE_ENV !== 'production') { - let pluginName = plugin.postcssPlugin - let pluginVer = plugin.postcssVersion - let runtimeVer = this.result.processor.version - let a = pluginVer.split('.') - let b = runtimeVer.split('.') - - if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) { - // eslint-disable-next-line no-console - console.error( - 'Unknown error from PostCSS plugin. Your current PostCSS ' + - 'version is ' + - runtimeVer + - ', but ' + - pluginName + - ' uses ' + - pluginVer + - '. Perhaps this is the source of the error below.' - ) - } - } - } - } catch (err) { - /* c8 ignore next 3 */ - // eslint-disable-next-line no-console - if (console && console.error) console.error(err) - } - return error - } - - get map() { - return this.stringify().map - } - - get messages() { - return this.sync().messages - } - - get opts() { - return this.result.opts - } - - prepareVisitors() { - this.listeners = {} - let add = (plugin, type, cb) => { - if (!this.listeners[type]) this.listeners[type] = [] - this.listeners[type].push([plugin, cb]) - } - for (let plugin of this.plugins) { - if (typeof plugin === 'object') { - for (let event in plugin) { - if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { - throw new Error( - `Unknown event ${event} in ${plugin.postcssPlugin}. ` + - `Try to update PostCSS (${this.processor.version} now).` - ) - } - if (!NOT_VISITORS[event]) { - if (typeof plugin[event] === 'object') { - for (let filter in plugin[event]) { - if (filter === '*') { - add(plugin, event, plugin[event][filter]) - } else { - add( - plugin, - event + '-' + filter.toLowerCase(), - plugin[event][filter] - ) - } - } - } else if (typeof plugin[event] === 'function') { - add(plugin, event, plugin[event]) - } - } - } - } - } - this.hasListener = Object.keys(this.listeners).length > 0 - } - - get processor() { - return this.result.processor - } - - get root() { - return this.sync().root - } - - async runAsync() { - this.plugin = 0 - for (let i = 0; i < this.plugins.length; i++) { - let plugin = this.plugins[i] - let promise = this.runOnRoot(plugin) - if (isPromise(promise)) { - try { - await promise - } catch (error) { - throw this.handleError(error) - } - } - } - - this.prepareVisitors() - if (this.hasListener) { - let root = this.result.root - while (!root[isClean]) { - root[isClean] = true - let stack = [toStack(root)] - while (stack.length > 0) { - let promise = this.visitTick(stack) - if (isPromise(promise)) { - try { - await promise - } catch (e) { - let node = stack[stack.length - 1].node - throw this.handleError(e, node) - } - } - } - } - - if (this.listeners.OnceExit) { - for (let [plugin, visitor] of this.listeners.OnceExit) { - this.result.lastPlugin = plugin - try { - if (root.type === 'document') { - let roots = root.nodes.map(subRoot => - visitor(subRoot, this.helpers) - ) - - await Promise.all(roots) - } else { - await visitor(root, this.helpers) - } - } catch (e) { - throw this.handleError(e) - } - } - } - } - - this.processed = true - return this.stringify() - } - - runOnRoot(plugin) { - this.result.lastPlugin = plugin - try { - if (typeof plugin === 'object' && plugin.Once) { - if (this.result.root.type === 'document') { - let roots = this.result.root.nodes.map(root => - plugin.Once(root, this.helpers) - ) - - if (isPromise(roots[0])) { - return Promise.all(roots) - } - - return roots - } - - return plugin.Once(this.result.root, this.helpers) - } else if (typeof plugin === 'function') { - return plugin(this.result.root, this.result) - } - } catch (error) { - throw this.handleError(error) - } - } - - stringify() { - if (this.error) throw this.error - if (this.stringified) return this.result - this.stringified = true - - this.sync() - - let opts = this.result.opts - let str = stringify - if (opts.syntax) str = opts.syntax.stringify - if (opts.stringifier) str = opts.stringifier - if (str.stringify) str = str.stringify - - let map = new MapGenerator(str, this.result.root, this.result.opts) - let data = map.generate() - this.result.css = data[0] - this.result.map = data[1] - - return this.result - } - - get [Symbol.toStringTag]() { - return 'LazyResult' - } - - sync() { - if (this.error) throw this.error - if (this.processed) return this.result - this.processed = true - - if (this.processing) { - throw this.getAsyncError() - } - - for (let plugin of this.plugins) { - let promise = this.runOnRoot(plugin) - if (isPromise(promise)) { - throw this.getAsyncError() - } - } - - this.prepareVisitors() - if (this.hasListener) { - let root = this.result.root - while (!root[isClean]) { - root[isClean] = true - this.walkSync(root) - } - if (this.listeners.OnceExit) { - if (root.type === 'document') { - for (let subRoot of root.nodes) { - this.visitSync(this.listeners.OnceExit, subRoot) - } - } else { - this.visitSync(this.listeners.OnceExit, root) - } - } - } - - return this.result - } - - then(onFulfilled, onRejected) { - if (process.env.NODE_ENV !== 'production') { - if (!('from' in this.opts)) { - warnOnce( - 'Without `from` option PostCSS could generate wrong source map ' + - 'and will not find Browserslist config. Set it to CSS file path ' + - 'or to `undefined` to prevent this warning.' - ) - } - } - return this.async().then(onFulfilled, onRejected) - } - - toString() { - return this.css - } - - visitSync(visitors, node) { - for (let [plugin, visitor] of visitors) { - this.result.lastPlugin = plugin - let promise - try { - promise = visitor(node, this.helpers) - } catch (e) { - throw this.handleError(e, node.proxyOf) - } - if (node.type !== 'root' && node.type !== 'document' && !node.parent) { - return true - } - if (isPromise(promise)) { - throw this.getAsyncError() - } - } - } - - visitTick(stack) { - let visit = stack[stack.length - 1] - let { node, visitors } = visit - - if (node.type !== 'root' && node.type !== 'document' && !node.parent) { - stack.pop() - return - } - - if (visitors.length > 0 && visit.visitorIndex < visitors.length) { - let [plugin, visitor] = visitors[visit.visitorIndex] - visit.visitorIndex += 1 - if (visit.visitorIndex === visitors.length) { - visit.visitors = [] - visit.visitorIndex = 0 - } - this.result.lastPlugin = plugin - try { - return visitor(node.toProxy(), this.helpers) - } catch (e) { - throw this.handleError(e, node) - } - } - - if (visit.iterator !== 0) { - let iterator = visit.iterator - let child - while ((child = node.nodes[node.indexes[iterator]])) { - node.indexes[iterator] += 1 - if (!child[isClean]) { - child[isClean] = true - stack.push(toStack(child)) - return - } - } - visit.iterator = 0 - delete node.indexes[iterator] - } - - let events = visit.events - while (visit.eventIndex < events.length) { - let event = events[visit.eventIndex] - visit.eventIndex += 1 - if (event === CHILDREN) { - if (node.nodes && node.nodes.length) { - node[isClean] = true - visit.iterator = node.getIterator() - } - return - } else if (this.listeners[event]) { - visit.visitors = this.listeners[event] - return - } - } - stack.pop() - } - - walkSync(node) { - node[isClean] = true - let events = getEvents(node) - for (let event of events) { - if (event === CHILDREN) { - if (node.nodes) { - node.each(child => { - if (!child[isClean]) this.walkSync(child) - }) - } - } else { - let visitors = this.listeners[event] - if (visitors) { - if (this.visitSync(visitors, node.toProxy())) return - } - } - } - } - - warnings() { - return this.sync().warnings() - } -} - -LazyResult.registerPostcss = dependant => { - postcss = dependant -} - -module.exports = LazyResult -LazyResult.default = LazyResult - -Root.registerLazyResult(LazyResult) -Document.registerLazyResult(LazyResult) diff --git a/node_modules/postcss/lib/list.d.ts b/node_modules/postcss/lib/list.d.ts deleted file mode 100644 index 1a74d74cf..000000000 --- a/node_modules/postcss/lib/list.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -declare namespace list { - type List = { - /** - * Safely splits comma-separated values (such as those for `transition-*` - * and `background` properties). - * - * ```js - * Once (root, { list }) { - * list.comma('black, linear-gradient(white, black)') - * //=> ['black', 'linear-gradient(white, black)'] - * } - * ``` - * - * @param str Comma-separated values. - * @return Split values. - */ - comma(str: string): string[] - - default: List - - /** - * Safely splits space-separated values (such as those for `background`, - * `border-radius`, and other shorthand properties). - * - * ```js - * Once (root, { list }) { - * list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)'] - * } - * ``` - * - * @param str Space-separated values. - * @return Split values. - */ - space(str: string): string[] - - /** - * Safely splits values. - * - * ```js - * Once (root, { list }) { - * list.split('1px calc(10% + 1px)', [' ', '\n', '\t']) //=> ['1px', 'calc(10% + 1px)'] - * } - * ``` - * - * @param string separated values. - * @param separators array of separators. - * @param last boolean indicator. - * @return Split values. - */ - split(string: string, separators: string[], last: boolean): string[] - } -} - -// eslint-disable-next-line @typescript-eslint/no-redeclare -declare const list: list.List - -export = list diff --git a/node_modules/postcss/lib/list.js b/node_modules/postcss/lib/list.js deleted file mode 100644 index 1b31f9809..000000000 --- a/node_modules/postcss/lib/list.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict' - -let list = { - comma(string) { - return list.split(string, [','], true) - }, - - space(string) { - let spaces = [' ', '\n', '\t'] - return list.split(string, spaces) - }, - - split(string, separators, last) { - let array = [] - let current = '' - let split = false - - let func = 0 - let inQuote = false - let prevQuote = '' - let escape = false - - for (let letter of string) { - if (escape) { - escape = false - } else if (letter === '\\') { - escape = true - } else if (inQuote) { - if (letter === prevQuote) { - inQuote = false - } - } else if (letter === '"' || letter === "'") { - inQuote = true - prevQuote = letter - } else if (letter === '(') { - func += 1 - } else if (letter === ')') { - if (func > 0) func -= 1 - } else if (func === 0) { - if (separators.includes(letter)) split = true - } - - if (split) { - if (current !== '') array.push(current.trim()) - current = '' - split = false - } else { - current += letter - } - } - - if (last || current !== '') array.push(current.trim()) - return array - } -} - -module.exports = list -list.default = list diff --git a/node_modules/postcss/lib/map-generator.js b/node_modules/postcss/lib/map-generator.js deleted file mode 100644 index f6320bc2d..000000000 --- a/node_modules/postcss/lib/map-generator.js +++ /dev/null @@ -1,338 +0,0 @@ -'use strict' - -let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') -let { dirname, relative, resolve, sep } = require('path') -let { pathToFileURL } = require('url') - -let Input = require('./input') - -let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) -let pathAvailable = Boolean(dirname && resolve && relative && sep) - -class MapGenerator { - constructor(stringify, root, opts, cssString) { - this.stringify = stringify - this.mapOpts = opts.map || {} - this.root = root - this.opts = opts - this.css = cssString - this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute - } - - addAnnotation() { - let content - - if (this.isInline()) { - content = - 'data:application/json;base64,' + this.toBase64(this.map.toString()) - } else if (typeof this.mapOpts.annotation === 'string') { - content = this.mapOpts.annotation - } else if (typeof this.mapOpts.annotation === 'function') { - content = this.mapOpts.annotation(this.opts.to, this.root) - } else { - content = this.outputFile() + '.map' - } - let eol = '\n' - if (this.css.includes('\r\n')) eol = '\r\n' - - this.css += eol + '/*# sourceMappingURL=' + content + ' */' - } - - applyPrevMaps() { - for (let prev of this.previous()) { - let from = this.toUrl(this.path(prev.file)) - let root = prev.root || dirname(prev.file) - let map - - if (this.mapOpts.sourcesContent === false) { - map = new SourceMapConsumer(prev.text) - if (map.sourcesContent) { - map.sourcesContent = map.sourcesContent.map(() => null) - } - } else { - map = prev.consumer() - } - - this.map.applySourceMap(map, from, this.toUrl(this.path(root))) - } - } - - clearAnnotation() { - if (this.mapOpts.annotation === false) return - - if (this.root) { - let node - for (let i = this.root.nodes.length - 1; i >= 0; i--) { - node = this.root.nodes[i] - if (node.type !== 'comment') continue - if (node.text.indexOf('# sourceMappingURL=') === 0) { - this.root.removeChild(i) - } - } - } else if (this.css) { - this.css = this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm, '') - } - } - - generate() { - this.clearAnnotation() - if (pathAvailable && sourceMapAvailable && this.isMap()) { - return this.generateMap() - } else { - let result = '' - this.stringify(this.root, i => { - result += i - }) - return [result] - } - } - - generateMap() { - if (this.root) { - this.generateString() - } else if (this.previous().length === 1) { - let prev = this.previous()[0].consumer() - prev.file = this.outputFile() - this.map = SourceMapGenerator.fromSourceMap(prev) - } else { - this.map = new SourceMapGenerator({ file: this.outputFile() }) - this.map.addMapping({ - generated: { column: 0, line: 1 }, - original: { column: 0, line: 1 }, - source: this.opts.from - ? this.toUrl(this.path(this.opts.from)) - : '' - }) - } - - if (this.isSourcesContent()) this.setSourcesContent() - if (this.root && this.previous().length > 0) this.applyPrevMaps() - if (this.isAnnotation()) this.addAnnotation() - - if (this.isInline()) { - return [this.css] - } else { - return [this.css, this.map] - } - } - - generateString() { - this.css = '' - this.map = new SourceMapGenerator({ file: this.outputFile() }) - - let line = 1 - let column = 1 - - let noSource = '' - let mapping = { - generated: { column: 0, line: 0 }, - original: { column: 0, line: 0 }, - source: '' - } - - let lines, last - this.stringify(this.root, (str, node, type) => { - this.css += str - - if (node && type !== 'end') { - mapping.generated.line = line - mapping.generated.column = column - 1 - if (node.source && node.source.start) { - mapping.source = this.sourcePath(node) - mapping.original.line = node.source.start.line - mapping.original.column = node.source.start.column - 1 - this.map.addMapping(mapping) - } else { - mapping.source = noSource - mapping.original.line = 1 - mapping.original.column = 0 - this.map.addMapping(mapping) - } - } - - lines = str.match(/\n/g) - if (lines) { - line += lines.length - last = str.lastIndexOf('\n') - column = str.length - last - } else { - column += str.length - } - - if (node && type !== 'start') { - let p = node.parent || { raws: {} } - let childless = - node.type === 'decl' || (node.type === 'atrule' && !node.nodes) - if (!childless || node !== p.last || p.raws.semicolon) { - if (node.source && node.source.end) { - mapping.source = this.sourcePath(node) - mapping.original.line = node.source.end.line - mapping.original.column = node.source.end.column - 1 - mapping.generated.line = line - mapping.generated.column = column - 2 - this.map.addMapping(mapping) - } else { - mapping.source = noSource - mapping.original.line = 1 - mapping.original.column = 0 - mapping.generated.line = line - mapping.generated.column = column - 1 - this.map.addMapping(mapping) - } - } - } - }) - } - - isAnnotation() { - if (this.isInline()) { - return true - } - if (typeof this.mapOpts.annotation !== 'undefined') { - return this.mapOpts.annotation - } - if (this.previous().length) { - return this.previous().some(i => i.annotation) - } - return true - } - - isInline() { - if (typeof this.mapOpts.inline !== 'undefined') { - return this.mapOpts.inline - } - - let annotation = this.mapOpts.annotation - if (typeof annotation !== 'undefined' && annotation !== true) { - return false - } - - if (this.previous().length) { - return this.previous().some(i => i.inline) - } - return true - } - - isMap() { - if (typeof this.opts.map !== 'undefined') { - return !!this.opts.map - } - return this.previous().length > 0 - } - - isSourcesContent() { - if (typeof this.mapOpts.sourcesContent !== 'undefined') { - return this.mapOpts.sourcesContent - } - if (this.previous().length) { - return this.previous().some(i => i.withContent()) - } - return true - } - - outputFile() { - if (this.opts.to) { - return this.path(this.opts.to) - } else if (this.opts.from) { - return this.path(this.opts.from) - } else { - return 'to.css' - } - } - - path(file) { - if (file.indexOf('<') === 0) return file - if (/^\w+:\/\//.test(file)) return file - if (this.mapOpts.absolute) return file - - let from = this.opts.to ? dirname(this.opts.to) : '.' - - if (typeof this.mapOpts.annotation === 'string') { - from = dirname(resolve(from, this.mapOpts.annotation)) - } - - file = relative(from, file) - return file - } - - previous() { - if (!this.previousMaps) { - this.previousMaps = [] - if (this.root) { - this.root.walk(node => { - if (node.source && node.source.input.map) { - let map = node.source.input.map - if (!this.previousMaps.includes(map)) { - this.previousMaps.push(map) - } - } - }) - } else { - let input = new Input(this.css, this.opts) - if (input.map) this.previousMaps.push(input.map) - } - } - - return this.previousMaps - } - - setSourcesContent() { - let already = {} - if (this.root) { - this.root.walk(node => { - if (node.source) { - let from = node.source.input.from - if (from && !already[from]) { - already[from] = true - let fromUrl = this.usesFileUrls - ? this.toFileUrl(from) - : this.toUrl(this.path(from)) - this.map.setSourceContent(fromUrl, node.source.input.css) - } - } - }) - } else if (this.css) { - let from = this.opts.from - ? this.toUrl(this.path(this.opts.from)) - : '' - this.map.setSourceContent(from, this.css) - } - } - - sourcePath(node) { - if (this.mapOpts.from) { - return this.toUrl(this.mapOpts.from) - } else if (this.usesFileUrls) { - return this.toFileUrl(node.source.input.from) - } else { - return this.toUrl(this.path(node.source.input.from)) - } - } - - toBase64(str) { - if (Buffer) { - return Buffer.from(str).toString('base64') - } else { - return window.btoa(unescape(encodeURIComponent(str))) - } - } - - toFileUrl(path) { - if (pathToFileURL) { - return pathToFileURL(path).toString() - } else { - throw new Error( - '`map.absolute` option is not available in this PostCSS build' - ) - } - } - - toUrl(path) { - if (sep === '\\') { - path = path.replace(/\\/g, '/') - } - return encodeURI(path).replace(/[#?]/g, encodeURIComponent) - } -} - -module.exports = MapGenerator diff --git a/node_modules/postcss/lib/no-work-result.d.ts b/node_modules/postcss/lib/no-work-result.d.ts deleted file mode 100644 index cee0e3ad9..000000000 --- a/node_modules/postcss/lib/no-work-result.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import LazyResult from './lazy-result.js' -import { SourceMap } from './postcss.js' -import Processor from './processor.js' -import Result, { Message, ResultOptions } from './result.js' -import Root from './root.js' -import Warning from './warning.js' - -declare namespace NoWorkResult { - // eslint-disable-next-line @typescript-eslint/no-use-before-define - export { NoWorkResult_ as default } -} - -/** - * A Promise proxy for the result of PostCSS transformations. - * This lazy result instance doesn't parse css unless `NoWorkResult#root` or `Result#root` - * are accessed. See the example below for details. - * A `NoWork` instance is returned by `Processor#process` ONLY when no plugins defined. - * - * ```js - * const noWorkResult = postcss().process(css) // No plugins are defined. - * // CSS is not parsed - * let root = noWorkResult.root // now css is parsed because we accessed the root - * ``` - */ -declare class NoWorkResult_ implements LazyResult { - catch: Promise['catch'] - finally: Promise['finally'] - then: Promise['then'] - constructor(processor: Processor, css: string, opts: ResultOptions) - async(): Promise - get content(): string - get css(): string - get map(): SourceMap - get messages(): Message[] - get opts(): ResultOptions - get processor(): Processor - get root(): Root - get [Symbol.toStringTag](): string - sync(): Result - toString(): string - warnings(): Warning[] -} - -declare class NoWorkResult extends NoWorkResult_ {} - -export = NoWorkResult diff --git a/node_modules/postcss/lib/no-work-result.js b/node_modules/postcss/lib/no-work-result.js deleted file mode 100644 index 717013512..000000000 --- a/node_modules/postcss/lib/no-work-result.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict' - -let MapGenerator = require('./map-generator') -let stringify = require('./stringify') -let warnOnce = require('./warn-once') -let parse = require('./parse') -const Result = require('./result') - -class NoWorkResult { - constructor(processor, css, opts) { - css = css.toString() - this.stringified = false - - this._processor = processor - this._css = css - this._opts = opts - this._map = undefined - let root - - let str = stringify - this.result = new Result(this._processor, root, this._opts) - this.result.css = css - - let self = this - Object.defineProperty(this.result, 'root', { - get() { - return self.root - } - }) - - let map = new MapGenerator(str, root, this._opts, css) - if (map.isMap()) { - let [generatedCSS, generatedMap] = map.generate() - if (generatedCSS) { - this.result.css = generatedCSS - } - if (generatedMap) { - this.result.map = generatedMap - } - } - } - - async() { - if (this.error) return Promise.reject(this.error) - return Promise.resolve(this.result) - } - - catch(onRejected) { - return this.async().catch(onRejected) - } - - get content() { - return this.result.css - } - - get css() { - return this.result.css - } - - finally(onFinally) { - return this.async().then(onFinally, onFinally) - } - - get map() { - return this.result.map - } - - get messages() { - return [] - } - - get opts() { - return this.result.opts - } - - get processor() { - return this.result.processor - } - - get root() { - if (this._root) { - return this._root - } - - let root - let parser = parse - - try { - root = parser(this._css, this._opts) - } catch (error) { - this.error = error - } - - if (this.error) { - throw this.error - } else { - this._root = root - return root - } - } - - get [Symbol.toStringTag]() { - return 'NoWorkResult' - } - - sync() { - if (this.error) throw this.error - return this.result - } - - then(onFulfilled, onRejected) { - if (process.env.NODE_ENV !== 'production') { - if (!('from' in this._opts)) { - warnOnce( - 'Without `from` option PostCSS could generate wrong source map ' + - 'and will not find Browserslist config. Set it to CSS file path ' + - 'or to `undefined` to prevent this warning.' - ) - } - } - - return this.async().then(onFulfilled, onRejected) - } - - toString() { - return this._css - } - - warnings() { - return [] - } -} - -module.exports = NoWorkResult -NoWorkResult.default = NoWorkResult diff --git a/node_modules/postcss/lib/node.d.ts b/node_modules/postcss/lib/node.d.ts deleted file mode 100644 index d094fc265..000000000 --- a/node_modules/postcss/lib/node.d.ts +++ /dev/null @@ -1,536 +0,0 @@ -import AtRule = require('./at-rule.js') - -import { AtRuleProps } from './at-rule.js' -import Comment, { CommentProps } from './comment.js' -import Container from './container.js' -import CssSyntaxError from './css-syntax-error.js' -import Declaration, { DeclarationProps } from './declaration.js' -import Document from './document.js' -import Input from './input.js' -import { Stringifier, Syntax } from './postcss.js' -import Result from './result.js' -import Root from './root.js' -import Rule, { RuleProps } from './rule.js' -import Warning, { WarningOptions } from './warning.js' - -declare namespace Node { - export type ChildNode = AtRule.default | Comment | Declaration | Rule - - export type AnyNode = - | AtRule.default - | Comment - | Declaration - | Document - | Root - | Rule - - export type ChildProps = - | AtRuleProps - | CommentProps - | DeclarationProps - | RuleProps - - export interface Position { - /** - * Source line in file. In contrast to `offset` it starts from 1. - */ - column: number - - /** - * Source column in file. - */ - line: number - - /** - * Source offset in file. It starts from 0. - */ - offset: number - } - - export interface Range { - /** - * End position, exclusive. - */ - end: Position - - /** - * Start position, inclusive. - */ - start: Position - } - - /** - * Source represents an interface for the {@link Node.source} property. - */ - export interface Source { - /** - * The inclusive ending position for the source - * code of a node. - */ - end?: Position - - /** - * The source file from where a node has originated. - */ - input: Input - - /** - * The inclusive starting position for the source - * code of a node. - */ - start?: Position - } - - /** - * Interface represents an interface for an object received - * as parameter by Node class constructor. - */ - export interface NodeProps { - source?: Source - } - - export interface NodeErrorOptions { - /** - * An ending index inside a node's string that should be highlighted as - * source of error. - */ - endIndex?: number - /** - * An index inside a node's string that should be highlighted as source - * of error. - */ - index?: number - /** - * Plugin name that created this error. PostCSS will set it automatically. - */ - plugin?: string - /** - * A word inside a node's string, that should be highlighted as source - * of error. - */ - word?: string - } - - // eslint-disable-next-line @typescript-eslint/no-shadow - class Node extends Node_ {} - export { Node as default } -} - -/** - * It represents an abstract class that handles common - * methods for other CSS abstract syntax tree nodes. - * - * Any node that represents CSS selector or value should - * not extend the `Node` class. - */ -declare abstract class Node_ { - /** - * It represents parent of the current node. - * - * ```js - * console.log(root.nodes[0].parent === root) //=> true - * ``` - */ - parent: Container | Document | undefined - - /** - * It represents unnecessary whitespace and characters present - * in the css source code. - * - * Information to generate byte-to-byte equal node string as it was - * in the origin input. - * - * The properties of the raws object are decided by parser, - * the default parser uses the following properties: - * - * * `before`: the space symbols before the node. It also stores `*` - * and `_` symbols before the declaration (IE hack). - * * `after`: the space symbols after the last child of the node - * to the end of the node. - * * `between`: the symbols between the property and value - * for declarations, selector and `{` for rules, or last parameter - * and `{` for at-rules. - * * `semicolon`: contains true if the last child has - * an (optional) semicolon. - * * `afterName`: the space between the at-rule name and its parameters. - * * `left`: the space symbols between `/*` and the comment’s text. - * * `right`: the space symbols between the comment’s text - * and */. - * - `important`: the content of the important statement, - * if it is not just `!important`. - * - * PostCSS filters out the comments inside selectors, declaration values - * and at-rule parameters but it stores the origin content in raws. - * - * ```js - * const root = postcss.parse('a {\n color:black\n}') - * console.log(root.first.first.raws) //=> { before: '\n ', between: ':' } - * ``` - */ - raws: any - - /** - * It represents information related to origin of a node and is required - * for generating source maps. - * - * The nodes that are created manually using the public APIs - * provided by PostCSS will have `source` undefined and - * will be absent in the source map. - * - * For this reason, the plugin developer should consider - * duplicating nodes as the duplicate node will have the - * same source as the original node by default or assign - * source to a node created manually. - * - * ```js - * console.log(decl.source.input.from) //=> '/home/ai/source.css' - * console.log(decl.source.start) //=> { line: 10, column: 2 } - * console.log(decl.source.end) //=> { line: 10, column: 12 } - * ``` - * - * ```js - * // Incorrect method, source not specified! - * const prefixed = postcss.decl({ - * prop: '-moz-' + decl.prop, - * value: decl.value - * }) - * - * // Correct method, source is inherited when duplicating. - * const prefixed = decl.clone({ - * prop: '-moz-' + decl.prop - * }) - * ``` - * - * ```js - * if (atrule.name === 'add-link') { - * const rule = postcss.rule({ - * selector: 'a', - * source: atrule.source - * }) - * - * atrule.parent.insertBefore(atrule, rule) - * } - * ``` - */ - source?: Node.Source - - /** - * It represents type of a node in - * an abstract syntax tree. - * - * A type of node helps in identification of a node - * and perform operation based on it's type. - * - * ```js - * const declaration = new Declaration({ - * prop: 'color', - * value: 'black' - * }) - * - * console.log(declaration.type) //=> 'decl' - * ``` - */ - type: string - - constructor(defaults?: object) - - /** - * Insert new node after current node to current node’s parent. - * - * Just alias for `node.parent.insertAfter(node, add)`. - * - * ```js - * decl.after('color: black') - * ``` - * - * @param newNode New node. - * @return This node for methods chain. - */ - after(newNode: Node | Node.ChildProps | Node[] | string): this - - /** - * It assigns properties to an existing node instance. - * - * ```js - * decl.assign({ prop: 'word-wrap', value: 'break-word' }) - * ``` - * - * @param overrides New properties to override the node. - * - * @return `this` for method chaining. - */ - assign(overrides: object): this - - /** - * Insert new node before current node to current node’s parent. - * - * Just alias for `node.parent.insertBefore(node, add)`. - * - * ```js - * decl.before('content: ""') - * ``` - * - * @param newNode New node. - * @return This node for methods chain. - */ - before(newNode: Node | Node.ChildProps | Node[] | string): this - - /** - * Clear the code style properties for the node and its children. - * - * ```js - * node.raws.before //=> ' ' - * node.cleanRaws() - * node.raws.before //=> undefined - * ``` - * - * @param keepBetween Keep the `raws.between` symbols. - */ - cleanRaws(keepBetween?: boolean): void - - /** - * It creates clone of an existing node, which includes all the properties - * and their values, that includes `raws` but not `type`. - * - * ```js - * decl.raws.before //=> "\n " - * const cloned = decl.clone({ prop: '-moz-' + decl.prop }) - * cloned.raws.before //=> "\n " - * cloned.toString() //=> -moz-transform: scale(0) - * ``` - * - * @param overrides New properties to override in the clone. - * - * @return Duplicate of the node instance. - */ - clone(overrides?: object): Node_ - - /** - * Shortcut to clone the node and insert the resulting cloned node - * after the current node. - * - * @param overrides New properties to override in the clone. - * @return New node. - */ - cloneAfter(overrides?: object): this - - /** - * Shortcut to clone the node and insert the resulting cloned node - * before the current node. - * - * ```js - * decl.cloneBefore({ prop: '-moz-' + decl.prop }) - * ``` - * - * @param overrides Mew properties to override in the clone. - * - * @return New node - */ - cloneBefore(overrides?: object): this - - /** - * It creates an instance of the class `CssSyntaxError` and parameters passed - * to this method are assigned to the error instance. - * - * The error instance will have description for the - * error, original position of the node in the - * source, showing line and column number. - * - * If any previous map is present, it would be used - * to get original position of the source. - * - * The Previous Map here is referred to the source map - * generated by previous compilation, example: Less, - * Stylus and Sass. - * - * This method returns the error instance instead of - * throwing it. - * - * ```js - * if (!variables[name]) { - * throw decl.error(`Unknown variable ${name}`, { word: name }) - * // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black - * // color: $black - * // a - * // ^ - * // background: white - * } - * ``` - * - * @param message Description for the error instance. - * @param options Options for the error instance. - * - * @return Error instance is returned. - */ - error(message: string, options?: Node.NodeErrorOptions): CssSyntaxError - - /** - * Returns the next child of the node’s parent. - * Returns `undefined` if the current node is the last child. - * - * ```js - * if (comment.text === 'delete next') { - * const next = comment.next() - * if (next) { - * next.remove() - * } - * } - * ``` - * - * @return Next node. - */ - next(): Node.ChildNode | undefined - - /** - * Get the position for a word or an index inside the node. - * - * @param opts Options. - * @return Position. - */ - positionBy(opts?: Pick): Node.Position - - /** - * Convert string index to line/column. - * - * @param index The symbol number in the node’s string. - * @return Symbol position in file. - */ - positionInside(index: number): Node.Position - - /** - * Returns the previous child of the node’s parent. - * Returns `undefined` if the current node is the first child. - * - * ```js - * const annotation = decl.prev() - * if (annotation.type === 'comment') { - * readAnnotation(annotation.text) - * } - * ``` - * - * @return Previous node. - */ - prev(): Node.ChildNode | undefined - - /** - * Get the range for a word or start and end index inside the node. - * The start index is inclusive; the end index is exclusive. - * - * @param opts Options. - * @return Range. - */ - rangeBy( - opts?: Pick - ): Node.Range - - /** - * Returns a `raws` value. If the node is missing - * the code style property (because the node was manually built or cloned), - * PostCSS will try to autodetect the code style property by looking - * at other nodes in the tree. - * - * ```js - * const root = postcss.parse('a { background: white }') - * root.nodes[0].append({ prop: 'color', value: 'black' }) - * root.nodes[0].nodes[1].raws.before //=> undefined - * root.nodes[0].nodes[1].raw('before') //=> ' ' - * ``` - * - * @param prop Name of code style property. - * @param defaultType Name of default value, it can be missed - * if the value is the same as prop. - * @return {string} Code style value. - */ - raw(prop: string, defaultType?: string): string - - /** - * It removes the node from its parent and deletes its parent property. - * - * ```js - * if (decl.prop.match(/^-webkit-/)) { - * decl.remove() - * } - * ``` - * - * @return `this` for method chaining. - */ - remove(): this - - /** - * Inserts node(s) before the current node and removes the current node. - * - * ```js - * AtRule: { - * mixin: atrule => { - * atrule.replaceWith(mixinRules[atrule.params]) - * } - * } - * ``` - * - * @param nodes Mode(s) to replace current one. - * @return Current node to methods chain. - */ - replaceWith( - ...nodes: ( - | Node.ChildNode - | Node.ChildNode[] - | Node.ChildProps - | Node.ChildProps[] - )[] - ): this - - /** - * Finds the Root instance of the node’s tree. - * - * ```js - * root.nodes[0].nodes[0].root() === root - * ``` - * - * @return Root parent. - */ - root(): Root - - /** - * Fix circular links on `JSON.stringify()`. - * - * @return Cleaned object. - */ - toJSON(): object - - /** - * It compiles the node to browser readable cascading style sheets string - * depending on it's type. - * - * ```js - * console.log(new Rule({ selector: 'a' }).toString()) //=> "a {}" - * ``` - * - * @param stringifier A syntax to use in string generation. - * @return CSS string of this node. - */ - toString(stringifier?: Stringifier | Syntax): string - - /** - * It is a wrapper for {@link Result#warn}, providing convenient - * way of generating warnings. - * - * ```js - * Declaration: { - * bad: (decl, { result }) => { - * decl.warn(result, 'Deprecated property: bad') - * } - * } - * ``` - * - * @param result The `Result` instance that will receive the warning. - * @param message Description for the warning. - * @param options Options for the warning. - * - * @return `Warning` instance is returned - */ - warn(result: Result, message: string, options?: WarningOptions): Warning -} - -declare class Node extends Node_ { } - -export = Node diff --git a/node_modules/postcss/lib/node.js b/node_modules/postcss/lib/node.js deleted file mode 100644 index 6aa0eb31d..000000000 --- a/node_modules/postcss/lib/node.js +++ /dev/null @@ -1,381 +0,0 @@ -'use strict' - -let { isClean, my } = require('./symbols') -let CssSyntaxError = require('./css-syntax-error') -let Stringifier = require('./stringifier') -let stringify = require('./stringify') - -function cloneNode(obj, parent) { - let cloned = new obj.constructor() - - for (let i in obj) { - if (!Object.prototype.hasOwnProperty.call(obj, i)) { - /* c8 ignore next 2 */ - continue - } - if (i === 'proxyCache') continue - let value = obj[i] - let type = typeof value - - if (i === 'parent' && type === 'object') { - if (parent) cloned[i] = parent - } else if (i === 'source') { - cloned[i] = value - } else if (Array.isArray(value)) { - cloned[i] = value.map(j => cloneNode(j, cloned)) - } else { - if (type === 'object' && value !== null) value = cloneNode(value) - cloned[i] = value - } - } - - return cloned -} - -class Node { - constructor(defaults = {}) { - this.raws = {} - this[isClean] = false - this[my] = true - - for (let name in defaults) { - if (name === 'nodes') { - this.nodes = [] - for (let node of defaults[name]) { - if (typeof node.clone === 'function') { - this.append(node.clone()) - } else { - this.append(node) - } - } - } else { - this[name] = defaults[name] - } - } - } - - addToError(error) { - error.postcssNode = this - if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) { - let s = this.source - error.stack = error.stack.replace( - /\n\s{4}at /, - `$&${s.input.from}:${s.start.line}:${s.start.column}$&` - ) - } - return error - } - - after(add) { - this.parent.insertAfter(this, add) - return this - } - - assign(overrides = {}) { - for (let name in overrides) { - this[name] = overrides[name] - } - return this - } - - before(add) { - this.parent.insertBefore(this, add) - return this - } - - cleanRaws(keepBetween) { - delete this.raws.before - delete this.raws.after - if (!keepBetween) delete this.raws.between - } - - clone(overrides = {}) { - let cloned = cloneNode(this) - for (let name in overrides) { - cloned[name] = overrides[name] - } - return cloned - } - - cloneAfter(overrides = {}) { - let cloned = this.clone(overrides) - this.parent.insertAfter(this, cloned) - return cloned - } - - cloneBefore(overrides = {}) { - let cloned = this.clone(overrides) - this.parent.insertBefore(this, cloned) - return cloned - } - - error(message, opts = {}) { - if (this.source) { - let { end, start } = this.rangeBy(opts) - return this.source.input.error( - message, - { column: start.column, line: start.line }, - { column: end.column, line: end.line }, - opts - ) - } - return new CssSyntaxError(message) - } - - getProxyProcessor() { - return { - get(node, prop) { - if (prop === 'proxyOf') { - return node - } else if (prop === 'root') { - return () => node.root().toProxy() - } else { - return node[prop] - } - }, - - set(node, prop, value) { - if (node[prop] === value) return true - node[prop] = value - if ( - prop === 'prop' || - prop === 'value' || - prop === 'name' || - prop === 'params' || - prop === 'important' || - /* c8 ignore next */ - prop === 'text' - ) { - node.markDirty() - } - return true - } - } - } - - markDirty() { - if (this[isClean]) { - this[isClean] = false - let next = this - while ((next = next.parent)) { - next[isClean] = false - } - } - } - - next() { - if (!this.parent) return undefined - let index = this.parent.index(this) - return this.parent.nodes[index + 1] - } - - positionBy(opts, stringRepresentation) { - let pos = this.source.start - if (opts.index) { - pos = this.positionInside(opts.index, stringRepresentation) - } else if (opts.word) { - stringRepresentation = this.toString() - let index = stringRepresentation.indexOf(opts.word) - if (index !== -1) pos = this.positionInside(index, stringRepresentation) - } - return pos - } - - positionInside(index, stringRepresentation) { - let string = stringRepresentation || this.toString() - let column = this.source.start.column - let line = this.source.start.line - - for (let i = 0; i < index; i++) { - if (string[i] === '\n') { - column = 1 - line += 1 - } else { - column += 1 - } - } - - return { column, line } - } - - prev() { - if (!this.parent) return undefined - let index = this.parent.index(this) - return this.parent.nodes[index - 1] - } - - get proxyOf() { - return this - } - - rangeBy(opts) { - let start = { - column: this.source.start.column, - line: this.source.start.line - } - let end = this.source.end - ? { - column: this.source.end.column + 1, - line: this.source.end.line - } - : { - column: start.column + 1, - line: start.line - } - - if (opts.word) { - let stringRepresentation = this.toString() - let index = stringRepresentation.indexOf(opts.word) - if (index !== -1) { - start = this.positionInside(index, stringRepresentation) - end = this.positionInside(index + opts.word.length, stringRepresentation) - } - } else { - if (opts.start) { - start = { - column: opts.start.column, - line: opts.start.line - } - } else if (opts.index) { - start = this.positionInside(opts.index) - } - - if (opts.end) { - end = { - column: opts.end.column, - line: opts.end.line - } - } else if (opts.endIndex) { - end = this.positionInside(opts.endIndex) - } else if (opts.index) { - end = this.positionInside(opts.index + 1) - } - } - - if ( - end.line < start.line || - (end.line === start.line && end.column <= start.column) - ) { - end = { column: start.column + 1, line: start.line } - } - - return { end, start } - } - - raw(prop, defaultType) { - let str = new Stringifier() - return str.raw(this, prop, defaultType) - } - - remove() { - if (this.parent) { - this.parent.removeChild(this) - } - this.parent = undefined - return this - } - - replaceWith(...nodes) { - if (this.parent) { - let bookmark = this - let foundSelf = false - for (let node of nodes) { - if (node === this) { - foundSelf = true - } else if (foundSelf) { - this.parent.insertAfter(bookmark, node) - bookmark = node - } else { - this.parent.insertBefore(bookmark, node) - } - } - - if (!foundSelf) { - this.remove() - } - } - - return this - } - - root() { - let result = this - while (result.parent && result.parent.type !== 'document') { - result = result.parent - } - return result - } - - toJSON(_, inputs) { - let fixed = {} - let emitInputs = inputs == null - inputs = inputs || new Map() - let inputsNextIndex = 0 - - for (let name in this) { - if (!Object.prototype.hasOwnProperty.call(this, name)) { - /* c8 ignore next 2 */ - continue - } - if (name === 'parent' || name === 'proxyCache') continue - let value = this[name] - - if (Array.isArray(value)) { - fixed[name] = value.map(i => { - if (typeof i === 'object' && i.toJSON) { - return i.toJSON(null, inputs) - } else { - return i - } - }) - } else if (typeof value === 'object' && value.toJSON) { - fixed[name] = value.toJSON(null, inputs) - } else if (name === 'source') { - let inputId = inputs.get(value.input) - if (inputId == null) { - inputId = inputsNextIndex - inputs.set(value.input, inputsNextIndex) - inputsNextIndex++ - } - fixed[name] = { - end: value.end, - inputId, - start: value.start - } - } else { - fixed[name] = value - } - } - - if (emitInputs) { - fixed.inputs = [...inputs.keys()].map(input => input.toJSON()) - } - - return fixed - } - - toProxy() { - if (!this.proxyCache) { - this.proxyCache = new Proxy(this, this.getProxyProcessor()) - } - return this.proxyCache - } - - toString(stringifier = stringify) { - if (stringifier.stringify) stringifier = stringifier.stringify - let result = '' - stringifier(this, i => { - result += i - }) - return result - } - - warn(result, text, opts) { - let data = { node: this } - for (let i in opts) data[i] = opts[i] - return result.warn(text, data) - } -} - -module.exports = Node -Node.default = Node diff --git a/node_modules/postcss/lib/parse.d.ts b/node_modules/postcss/lib/parse.d.ts deleted file mode 100644 index 4c943a4d6..000000000 --- a/node_modules/postcss/lib/parse.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Parser } from './postcss.js' - -interface Parse extends Parser { - default: Parse -} - -declare const parse: Parse - -export = parse diff --git a/node_modules/postcss/lib/parse.js b/node_modules/postcss/lib/parse.js deleted file mode 100644 index 971431f23..000000000 --- a/node_modules/postcss/lib/parse.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict' - -let Container = require('./container') -let Parser = require('./parser') -let Input = require('./input') - -function parse(css, opts) { - let input = new Input(css, opts) - let parser = new Parser(input) - try { - parser.parse() - } catch (e) { - if (process.env.NODE_ENV !== 'production') { - if (e.name === 'CssSyntaxError' && opts && opts.from) { - if (/\.scss$/i.test(opts.from)) { - e.message += - '\nYou tried to parse SCSS with ' + - 'the standard CSS parser; ' + - 'try again with the postcss-scss parser' - } else if (/\.sass/i.test(opts.from)) { - e.message += - '\nYou tried to parse Sass with ' + - 'the standard CSS parser; ' + - 'try again with the postcss-sass parser' - } else if (/\.less$/i.test(opts.from)) { - e.message += - '\nYou tried to parse Less with ' + - 'the standard CSS parser; ' + - 'try again with the postcss-less parser' - } - } - } - throw e - } - - return parser.root -} - -module.exports = parse -parse.default = parse - -Container.registerParse(parse) diff --git a/node_modules/postcss/lib/parser.js b/node_modules/postcss/lib/parser.js deleted file mode 100644 index 12f87bd9c..000000000 --- a/node_modules/postcss/lib/parser.js +++ /dev/null @@ -1,603 +0,0 @@ -'use strict' - -let Declaration = require('./declaration') -let tokenizer = require('./tokenize') -let Comment = require('./comment') -let AtRule = require('./at-rule') -let Root = require('./root') -let Rule = require('./rule') - -const SAFE_COMMENT_NEIGHBOR = { - empty: true, - space: true -} - -function findLastWithPosition(tokens) { - for (let i = tokens.length - 1; i >= 0; i--) { - let token = tokens[i] - let pos = token[3] || token[2] - if (pos) return pos - } -} - -class Parser { - constructor(input) { - this.input = input - - this.root = new Root() - this.current = this.root - this.spaces = '' - this.semicolon = false - this.customProperty = false - - this.createTokenizer() - this.root.source = { input, start: { column: 1, line: 1, offset: 0 } } - } - - atrule(token) { - let node = new AtRule() - node.name = token[1].slice(1) - if (node.name === '') { - this.unnamedAtrule(node, token) - } - this.init(node, token[2]) - - let type - let prev - let shift - let last = false - let open = false - let params = [] - let brackets = [] - - while (!this.tokenizer.endOfFile()) { - token = this.tokenizer.nextToken() - type = token[0] - - if (type === '(' || type === '[') { - brackets.push(type === '(' ? ')' : ']') - } else if (type === '{' && brackets.length > 0) { - brackets.push('}') - } else if (type === brackets[brackets.length - 1]) { - brackets.pop() - } - - if (brackets.length === 0) { - if (type === ';') { - node.source.end = this.getPosition(token[2]) - this.semicolon = true - break - } else if (type === '{') { - open = true - break - } else if (type === '}') { - if (params.length > 0) { - shift = params.length - 1 - prev = params[shift] - while (prev && prev[0] === 'space') { - prev = params[--shift] - } - if (prev) { - node.source.end = this.getPosition(prev[3] || prev[2]) - } - } - this.end(token) - break - } else { - params.push(token) - } - } else { - params.push(token) - } - - if (this.tokenizer.endOfFile()) { - last = true - break - } - } - - node.raws.between = this.spacesAndCommentsFromEnd(params) - if (params.length) { - node.raws.afterName = this.spacesAndCommentsFromStart(params) - this.raw(node, 'params', params) - if (last) { - token = params[params.length - 1] - node.source.end = this.getPosition(token[3] || token[2]) - this.spaces = node.raws.between - node.raws.between = '' - } - } else { - node.raws.afterName = '' - node.params = '' - } - - if (open) { - node.nodes = [] - this.current = node - } - } - - checkMissedSemicolon(tokens) { - let colon = this.colon(tokens) - if (colon === false) return - - let founded = 0 - let token - for (let j = colon - 1; j >= 0; j--) { - token = tokens[j] - if (token[0] !== 'space') { - founded += 1 - if (founded === 2) break - } - } - // If the token is a word, e.g. `!important`, `red` or any other valid property's value. - // Then we need to return the colon after that word token. [3] is the "end" colon of that word. - // And because we need it after that one we do +1 to get the next one. - throw this.input.error( - 'Missed semicolon', - token[0] === 'word' ? token[3] + 1 : token[2] - ) - } - - colon(tokens) { - let brackets = 0 - let token, type, prev - for (let [i, element] of tokens.entries()) { - token = element - type = token[0] - - if (type === '(') { - brackets += 1 - } - if (type === ')') { - brackets -= 1 - } - if (brackets === 0 && type === ':') { - if (!prev) { - this.doubleColon(token) - } else if (prev[0] === 'word' && prev[1] === 'progid') { - continue - } else { - return i - } - } - - prev = token - } - return false - } - - comment(token) { - let node = new Comment() - this.init(node, token[2]) - node.source.end = this.getPosition(token[3] || token[2]) - - let text = token[1].slice(2, -2) - if (/^\s*$/.test(text)) { - node.text = '' - node.raws.left = text - node.raws.right = '' - } else { - let match = text.match(/^(\s*)([^]*\S)(\s*)$/) - node.text = match[2] - node.raws.left = match[1] - node.raws.right = match[3] - } - } - - createTokenizer() { - this.tokenizer = tokenizer(this.input) - } - - decl(tokens, customProperty) { - let node = new Declaration() - this.init(node, tokens[0][2]) - - let last = tokens[tokens.length - 1] - if (last[0] === ';') { - this.semicolon = true - tokens.pop() - } - - node.source.end = this.getPosition( - last[3] || last[2] || findLastWithPosition(tokens) - ) - - while (tokens[0][0] !== 'word') { - if (tokens.length === 1) this.unknownWord(tokens) - node.raws.before += tokens.shift()[1] - } - node.source.start = this.getPosition(tokens[0][2]) - - node.prop = '' - while (tokens.length) { - let type = tokens[0][0] - if (type === ':' || type === 'space' || type === 'comment') { - break - } - node.prop += tokens.shift()[1] - } - - node.raws.between = '' - - let token - while (tokens.length) { - token = tokens.shift() - - if (token[0] === ':') { - node.raws.between += token[1] - break - } else { - if (token[0] === 'word' && /\w/.test(token[1])) { - this.unknownWord([token]) - } - node.raws.between += token[1] - } - } - - if (node.prop[0] === '_' || node.prop[0] === '*') { - node.raws.before += node.prop[0] - node.prop = node.prop.slice(1) - } - - let firstSpaces = [] - let next - while (tokens.length) { - next = tokens[0][0] - if (next !== 'space' && next !== 'comment') break - firstSpaces.push(tokens.shift()) - } - - this.precheckMissedSemicolon(tokens) - - for (let i = tokens.length - 1; i >= 0; i--) { - token = tokens[i] - if (token[1].toLowerCase() === '!important') { - node.important = true - let string = this.stringFrom(tokens, i) - string = this.spacesFromEnd(tokens) + string - if (string !== ' !important') node.raws.important = string - break - } else if (token[1].toLowerCase() === 'important') { - let cache = tokens.slice(0) - let str = '' - for (let j = i; j > 0; j--) { - let type = cache[j][0] - if (str.trim().indexOf('!') === 0 && type !== 'space') { - break - } - str = cache.pop()[1] + str - } - if (str.trim().indexOf('!') === 0) { - node.important = true - node.raws.important = str - tokens = cache - } - } - - if (token[0] !== 'space' && token[0] !== 'comment') { - break - } - } - - let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment') - - if (hasWord) { - node.raws.between += firstSpaces.map(i => i[1]).join('') - firstSpaces = [] - } - this.raw(node, 'value', firstSpaces.concat(tokens), customProperty) - - if (node.value.includes(':') && !customProperty) { - this.checkMissedSemicolon(tokens) - } - } - - doubleColon(token) { - throw this.input.error( - 'Double colon', - { offset: token[2] }, - { offset: token[2] + token[1].length } - ) - } - - emptyRule(token) { - let node = new Rule() - this.init(node, token[2]) - node.selector = '' - node.raws.between = '' - this.current = node - } - - end(token) { - if (this.current.nodes && this.current.nodes.length) { - this.current.raws.semicolon = this.semicolon - } - this.semicolon = false - - this.current.raws.after = (this.current.raws.after || '') + this.spaces - this.spaces = '' - - if (this.current.parent) { - this.current.source.end = this.getPosition(token[2]) - this.current = this.current.parent - } else { - this.unexpectedClose(token) - } - } - - endFile() { - if (this.current.parent) this.unclosedBlock() - if (this.current.nodes && this.current.nodes.length) { - this.current.raws.semicolon = this.semicolon - } - this.current.raws.after = (this.current.raws.after || '') + this.spaces - } - - freeSemicolon(token) { - this.spaces += token[1] - if (this.current.nodes) { - let prev = this.current.nodes[this.current.nodes.length - 1] - if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) { - prev.raws.ownSemicolon = this.spaces - this.spaces = '' - } - } - } - - // Helpers - - getPosition(offset) { - let pos = this.input.fromOffset(offset) - return { - column: pos.col, - line: pos.line, - offset - } - } - - init(node, offset) { - this.current.push(node) - node.source = { - input: this.input, - start: this.getPosition(offset) - } - node.raws.before = this.spaces - this.spaces = '' - if (node.type !== 'comment') this.semicolon = false - } - - other(start) { - let end = false - let type = null - let colon = false - let bracket = null - let brackets = [] - let customProperty = start[1].startsWith('--') - - let tokens = [] - let token = start - while (token) { - type = token[0] - tokens.push(token) - - if (type === '(' || type === '[') { - if (!bracket) bracket = token - brackets.push(type === '(' ? ')' : ']') - } else if (customProperty && colon && type === '{') { - if (!bracket) bracket = token - brackets.push('}') - } else if (brackets.length === 0) { - if (type === ';') { - if (colon) { - this.decl(tokens, customProperty) - return - } else { - break - } - } else if (type === '{') { - this.rule(tokens) - return - } else if (type === '}') { - this.tokenizer.back(tokens.pop()) - end = true - break - } else if (type === ':') { - colon = true - } - } else if (type === brackets[brackets.length - 1]) { - brackets.pop() - if (brackets.length === 0) bracket = null - } - - token = this.tokenizer.nextToken() - } - - if (this.tokenizer.endOfFile()) end = true - if (brackets.length > 0) this.unclosedBracket(bracket) - - if (end && colon) { - if (!customProperty) { - while (tokens.length) { - token = tokens[tokens.length - 1][0] - if (token !== 'space' && token !== 'comment') break - this.tokenizer.back(tokens.pop()) - } - } - this.decl(tokens, customProperty) - } else { - this.unknownWord(tokens) - } - } - - parse() { - let token - while (!this.tokenizer.endOfFile()) { - token = this.tokenizer.nextToken() - - switch (token[0]) { - case 'space': - this.spaces += token[1] - break - - case ';': - this.freeSemicolon(token) - break - - case '}': - this.end(token) - break - - case 'comment': - this.comment(token) - break - - case 'at-word': - this.atrule(token) - break - - case '{': - this.emptyRule(token) - break - - default: - this.other(token) - break - } - } - this.endFile() - } - - precheckMissedSemicolon(/* tokens */) { - // Hook for Safe Parser - } - - raw(node, prop, tokens, customProperty) { - let token, type - let length = tokens.length - let value = '' - let clean = true - let next, prev - - for (let i = 0; i < length; i += 1) { - token = tokens[i] - type = token[0] - if (type === 'space' && i === length - 1 && !customProperty) { - clean = false - } else if (type === 'comment') { - prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty' - next = tokens[i + 1] ? tokens[i + 1][0] : 'empty' - if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { - if (value.slice(-1) === ',') { - clean = false - } else { - value += token[1] - } - } else { - clean = false - } - } else { - value += token[1] - } - } - if (!clean) { - let raw = tokens.reduce((all, i) => all + i[1], '') - node.raws[prop] = { raw, value } - } - node[prop] = value - } - - rule(tokens) { - tokens.pop() - - let node = new Rule() - this.init(node, tokens[0][2]) - - node.raws.between = this.spacesAndCommentsFromEnd(tokens) - this.raw(node, 'selector', tokens) - this.current = node - } - - spacesAndCommentsFromEnd(tokens) { - let lastTokenType - let spaces = '' - while (tokens.length) { - lastTokenType = tokens[tokens.length - 1][0] - if (lastTokenType !== 'space' && lastTokenType !== 'comment') break - spaces = tokens.pop()[1] + spaces - } - return spaces - } - - // Errors - - spacesAndCommentsFromStart(tokens) { - let next - let spaces = '' - while (tokens.length) { - next = tokens[0][0] - if (next !== 'space' && next !== 'comment') break - spaces += tokens.shift()[1] - } - return spaces - } - - spacesFromEnd(tokens) { - let lastTokenType - let spaces = '' - while (tokens.length) { - lastTokenType = tokens[tokens.length - 1][0] - if (lastTokenType !== 'space') break - spaces = tokens.pop()[1] + spaces - } - return spaces - } - - stringFrom(tokens, from) { - let result = '' - for (let i = from; i < tokens.length; i++) { - result += tokens[i][1] - } - tokens.splice(from, tokens.length - from) - return result - } - - unclosedBlock() { - let pos = this.current.source.start - throw this.input.error('Unclosed block', pos.line, pos.column) - } - - unclosedBracket(bracket) { - throw this.input.error( - 'Unclosed bracket', - { offset: bracket[2] }, - { offset: bracket[2] + 1 } - ) - } - - unexpectedClose(token) { - throw this.input.error( - 'Unexpected }', - { offset: token[2] }, - { offset: token[2] + 1 } - ) - } - - unknownWord(tokens) { - throw this.input.error( - 'Unknown word', - { offset: tokens[0][2] }, - { offset: tokens[0][2] + tokens[0][1].length } - ) - } - - unnamedAtrule(node, token) { - throw this.input.error( - 'At-rule without name', - { offset: token[2] }, - { offset: token[2] + token[1].length } - ) - } -} - -module.exports = Parser diff --git a/node_modules/postcss/lib/postcss.d.mts b/node_modules/postcss/lib/postcss.d.mts deleted file mode 100644 index a8ca8c7a1..000000000 --- a/node_modules/postcss/lib/postcss.d.mts +++ /dev/null @@ -1,72 +0,0 @@ -export { - // postcss function / namespace - default, - - // Value exports from postcss.mjs - stringify, - fromJSON, - // @ts-expect-error This value exists, but it’s untyped. - plugin, - parse, - list, - - document, - comment, - atRule, - rule, - decl, - root, - - CssSyntaxError, - Declaration, - Container, - Processor, - Document, - Comment, - Warning, - AtRule, - Result, - Input, - Rule, - Root, - Node, - - // Type-only exports - AcceptedPlugin, - AnyNode, - AtRuleProps, - Builder, - ChildNode, - ChildProps, - CommentProps, - ContainerProps, - DeclarationProps, - DocumentProps, - FilePosition, - Helpers, - JSONHydrator, - Message, - NodeErrorOptions, - NodeProps, - OldPlugin, - Parser, - Plugin, - PluginCreator, - Position, - Postcss, - ProcessOptions, - RootProps, - RuleProps, - Source, - SourceMap, - SourceMapOptions, - Stringifier, - Syntax, - TransformCallback, - Transformer, - WarningOptions, - - // This is a class, but it’s not re-exported. That’s why it’s exported as type-only here. - type LazyResult, - -} from './postcss.js' diff --git a/node_modules/postcss/lib/postcss.d.ts b/node_modules/postcss/lib/postcss.d.ts deleted file mode 100644 index 146dae0bd..000000000 --- a/node_modules/postcss/lib/postcss.d.ts +++ /dev/null @@ -1,441 +0,0 @@ -import { RawSourceMap, SourceMapGenerator } from 'source-map-js' - -import AtRule, { AtRuleProps } from './at-rule.js' -import Comment, { CommentProps } from './comment.js' -import Container, { ContainerProps } from './container.js' -import CssSyntaxError from './css-syntax-error.js' -import Declaration, { DeclarationProps } from './declaration.js' -import Document, { DocumentProps } from './document.js' -import Input, { FilePosition } from './input.js' -import LazyResult from './lazy-result.js' -import list from './list.js' -import Node, { - AnyNode, - ChildNode, - ChildProps, - NodeErrorOptions, - NodeProps, - Position, - Source -} from './node.js' -import Processor from './processor.js' -import Result, { Message } from './result.js' -import Root, { RootProps } from './root.js' -import Rule, { RuleProps } from './rule.js' -import Warning, { WarningOptions } from './warning.js' - -type DocumentProcessor = ( - document: Document, - helper: postcss.Helpers -) => Promise | void -type RootProcessor = (root: Root, helper: postcss.Helpers) => Promise | void -type DeclarationProcessor = ( - decl: Declaration, - helper: postcss.Helpers -) => Promise | void -type RuleProcessor = (rule: Rule, helper: postcss.Helpers) => Promise | void -type AtRuleProcessor = (atRule: AtRule, helper: postcss.Helpers) => Promise | void -type CommentProcessor = ( - comment: Comment, - helper: postcss.Helpers -) => Promise | void - -interface Processors { - /** - * Will be called on all`AtRule` nodes. - * - * Will be called again on node or children changes. - */ - AtRule?: { [name: string]: AtRuleProcessor } | AtRuleProcessor - - /** - * Will be called on all `AtRule` nodes, when all children will be processed. - * - * Will be called again on node or children changes. - */ - AtRuleExit?: { [name: string]: AtRuleProcessor } | AtRuleProcessor - - /** - * Will be called on all `Comment` nodes. - * - * Will be called again on node or children changes. - */ - Comment?: CommentProcessor - - /** - * Will be called on all `Comment` nodes after listeners - * for `Comment` event. - * - * Will be called again on node or children changes. - */ - CommentExit?: CommentProcessor - - /** - * Will be called on all `Declaration` nodes after listeners - * for `Declaration` event. - * - * Will be called again on node or children changes. - */ - Declaration?: { [prop: string]: DeclarationProcessor } | DeclarationProcessor - - /** - * Will be called on all `Declaration` nodes. - * - * Will be called again on node or children changes. - */ - DeclarationExit?: - | { [prop: string]: DeclarationProcessor } - | DeclarationProcessor - - /** - * Will be called on `Document` node. - * - * Will be called again on children changes. - */ - Document?: DocumentProcessor - - /** - * Will be called on `Document` node, when all children will be processed. - * - * Will be called again on children changes. - */ - DocumentExit?: DocumentProcessor - - /** - * Will be called on `Root` node once. - */ - Once?: RootProcessor - - /** - * Will be called on `Root` node once, when all children will be processed. - */ - OnceExit?: RootProcessor - - /** - * Will be called on `Root` node. - * - * Will be called again on children changes. - */ - Root?: RootProcessor - - /** - * Will be called on `Root` node, when all children will be processed. - * - * Will be called again on children changes. - */ - RootExit?: RootProcessor - - /** - * Will be called on all `Rule` nodes. - * - * Will be called again on node or children changes. - */ - Rule?: RuleProcessor - - /** - * Will be called on all `Rule` nodes, when all children will be processed. - * - * Will be called again on node or children changes. - */ - RuleExit?: RuleProcessor -} - -declare namespace postcss { - export { - AnyNode, - AtRule, - AtRuleProps, - ChildNode, - ChildProps, - Comment, - CommentProps, - Container, - ContainerProps, - CssSyntaxError, - Declaration, - DeclarationProps, - Document, - DocumentProps, - FilePosition, - Input, - LazyResult, - list, - Message, - Node, - NodeErrorOptions, - NodeProps, - Position, - Processor, - Result, - Root, - RootProps, - Rule, - RuleProps, - Source, - Warning, - WarningOptions - } - - export type SourceMap = SourceMapGenerator & { - toJSON(): RawSourceMap - } - - export type Helpers = { postcss: Postcss; result: Result } & Postcss - - export interface Plugin extends Processors { - postcssPlugin: string - prepare?: (result: Result) => Processors - } - - export interface PluginCreator { - (opts?: PluginOptions): Plugin | Processor - postcss: true - } - - export interface Transformer extends TransformCallback { - postcssPlugin: string - postcssVersion: string - } - - export interface TransformCallback { - (root: Root, result: Result): Promise | void - } - - export interface OldPlugin extends Transformer { - (opts?: T): Transformer - postcss: Transformer - } - - export type AcceptedPlugin = - | { - postcss: Processor | TransformCallback - } - | OldPlugin - | Plugin - | PluginCreator - | Processor - | TransformCallback - - export interface Parser { - ( - css: { toString(): string } | string, - opts?: Pick - ): RootNode - } - - export interface Builder { - (part: string, node?: AnyNode, type?: 'end' | 'start'): void - } - - export interface Stringifier { - (node: AnyNode, builder: Builder): void - } - - export interface JSONHydrator { - (data: object): Node - (data: object[]): Node[] - } - - export interface Syntax { - /** - * Function to generate AST by string. - */ - parse?: Parser - - /** - * Class to generate string by AST. - */ - stringify?: Stringifier - } - - export interface SourceMapOptions { - /** - * Use absolute path in generated source map. - */ - absolute?: boolean - - /** - * Indicates that PostCSS should add annotation comments to the CSS. - * By default, PostCSS will always add a comment with a path - * to the source map. PostCSS will not add annotations to CSS files - * that do not contain any comments. - * - * By default, PostCSS presumes that you want to save the source map as - * `opts.to + '.map'` and will use this path in the annotation comment. - * A different path can be set by providing a string value for annotation. - * - * If you have set `inline: true`, annotation cannot be disabled. - */ - annotation?: ((file: string, root: Root) => string) | boolean | string - - /** - * Override `from` in map’s sources. - */ - from?: string - - /** - * Indicates that the source map should be embedded in the output CSS - * as a Base64-encoded comment. By default, it is `true`. - * But if all previous maps are external, not inline, PostCSS will not embed - * the map even if you do not set this option. - * - * If you have an inline source map, the result.map property will be empty, - * as the source map will be contained within the text of `result.css`. - */ - inline?: boolean - - /** - * Source map content from a previous processing step (e.g., Sass). - * - * PostCSS will try to read the previous source map - * automatically (based on comments within the source CSS), but you can use - * this option to identify it manually. - * - * If desired, you can omit the previous map with prev: `false`. - */ - prev?: ((file: string) => string) | boolean | object | string - - /** - * Indicates that PostCSS should set the origin content (e.g., Sass source) - * of the source map. By default, it is true. But if all previous maps do not - * contain sources content, PostCSS will also leave it out even if you - * do not set this option. - */ - sourcesContent?: boolean - } - - export interface ProcessOptions { - /** - * The path of the CSS source file. You should always set `from`, - * because it is used in source map generation and syntax error messages. - */ - from?: string - - /** - * Source map options - */ - map?: boolean | SourceMapOptions - - /** - * Function to generate AST by string. - */ - parser?: Parser | Syntax - - /** - * Class to generate string by AST. - */ - stringifier?: Stringifier | Syntax - - /** - * Object with parse and stringify. - */ - syntax?: Syntax - - /** - * The path where you'll put the output CSS file. You should always set `to` - * to generate correct source maps. - */ - to?: string - } - - export type Postcss = typeof postcss - - /** - * Default function to convert a node tree into a CSS string. - */ - export let stringify: Stringifier - - /** - * Parses source css and returns a new `Root` or `Document` node, - * which contains the source CSS nodes. - * - * ```js - * // Simple CSS concatenation with source map support - * const root1 = postcss.parse(css1, { from: file1 }) - * const root2 = postcss.parse(css2, { from: file2 }) - * root1.append(root2).toResult().css - * ``` - */ - export let parse: Parser - - /** - * Rehydrate a JSON AST (from `Node#toJSON`) back into the AST classes. - * - * ```js - * const json = root.toJSON() - * // save to file, send by network, etc - * const root2 = postcss.fromJSON(json) - * ``` - */ - export let fromJSON: JSONHydrator - - /** - * Creates a new `Comment` node. - * - * @param defaults Properties for the new node. - * @return New comment node - */ - export function comment(defaults?: CommentProps): Comment - - /** - * Creates a new `AtRule` node. - * - * @param defaults Properties for the new node. - * @return New at-rule node. - */ - export function atRule(defaults?: AtRuleProps): AtRule - - /** - * Creates a new `Declaration` node. - * - * @param defaults Properties for the new node. - * @return New declaration node. - */ - export function decl(defaults?: DeclarationProps): Declaration - - /** - * Creates a new `Rule` node. - * - * @param default Properties for the new node. - * @return New rule node. - */ - export function rule(defaults?: RuleProps): Rule - - /** - * Creates a new `Root` node. - * - * @param defaults Properties for the new node. - * @return New root node. - */ - export function root(defaults?: RootProps): Root - - /** - * Creates a new `Document` node. - * - * @param defaults Properties for the new node. - * @return New document node. - */ - export function document(defaults?: DocumentProps): Document - - export { postcss as default } -} - -/** - * Create a new `Processor` instance that will apply `plugins` - * as CSS processors. - * - * ```js - * let postcss = require('postcss') - * - * postcss(plugins).process(css, { from, to }).then(result => { - * console.log(result.css) - * }) - * ``` - * - * @param plugins PostCSS plugins. - * @return Processor to process multiple CSS. - */ -declare function postcss(plugins?: postcss.AcceptedPlugin[]): Processor -declare function postcss(...plugins: postcss.AcceptedPlugin[]): Processor - -export = postcss diff --git a/node_modules/postcss/lib/postcss.js b/node_modules/postcss/lib/postcss.js deleted file mode 100644 index 080ee8378..000000000 --- a/node_modules/postcss/lib/postcss.js +++ /dev/null @@ -1,101 +0,0 @@ -'use strict' - -let CssSyntaxError = require('./css-syntax-error') -let Declaration = require('./declaration') -let LazyResult = require('./lazy-result') -let Container = require('./container') -let Processor = require('./processor') -let stringify = require('./stringify') -let fromJSON = require('./fromJSON') -let Document = require('./document') -let Warning = require('./warning') -let Comment = require('./comment') -let AtRule = require('./at-rule') -let Result = require('./result.js') -let Input = require('./input') -let parse = require('./parse') -let list = require('./list') -let Rule = require('./rule') -let Root = require('./root') -let Node = require('./node') - -function postcss(...plugins) { - if (plugins.length === 1 && Array.isArray(plugins[0])) { - plugins = plugins[0] - } - return new Processor(plugins) -} - -postcss.plugin = function plugin(name, initializer) { - let warningPrinted = false - function creator(...args) { - // eslint-disable-next-line no-console - if (console && console.warn && !warningPrinted) { - warningPrinted = true - // eslint-disable-next-line no-console - console.warn( - name + - ': postcss.plugin was deprecated. Migration guide:\n' + - 'https://evilmartians.com/chronicles/postcss-8-plugin-migration' - ) - if (process.env.LANG && process.env.LANG.startsWith('cn')) { - /* c8 ignore next 7 */ - // eslint-disable-next-line no-console - console.warn( - name + - ': 里面 postcss.plugin 被弃用. 迁移指南:\n' + - 'https://www.w3ctech.com/topic/2226' - ) - } - } - let transformer = initializer(...args) - transformer.postcssPlugin = name - transformer.postcssVersion = new Processor().version - return transformer - } - - let cache - Object.defineProperty(creator, 'postcss', { - get() { - if (!cache) cache = creator() - return cache - } - }) - - creator.process = function (css, processOpts, pluginOpts) { - return postcss([creator(pluginOpts)]).process(css, processOpts) - } - - return creator -} - -postcss.stringify = stringify -postcss.parse = parse -postcss.fromJSON = fromJSON -postcss.list = list - -postcss.comment = defaults => new Comment(defaults) -postcss.atRule = defaults => new AtRule(defaults) -postcss.decl = defaults => new Declaration(defaults) -postcss.rule = defaults => new Rule(defaults) -postcss.root = defaults => new Root(defaults) -postcss.document = defaults => new Document(defaults) - -postcss.CssSyntaxError = CssSyntaxError -postcss.Declaration = Declaration -postcss.Container = Container -postcss.Processor = Processor -postcss.Document = Document -postcss.Comment = Comment -postcss.Warning = Warning -postcss.AtRule = AtRule -postcss.Result = Result -postcss.Input = Input -postcss.Rule = Rule -postcss.Root = Root -postcss.Node = Node - -LazyResult.registerPostcss(postcss) - -module.exports = postcss -postcss.default = postcss diff --git a/node_modules/postcss/lib/postcss.mjs b/node_modules/postcss/lib/postcss.mjs deleted file mode 100644 index 35075988c..000000000 --- a/node_modules/postcss/lib/postcss.mjs +++ /dev/null @@ -1,30 +0,0 @@ -import postcss from './postcss.js' - -export default postcss - -export const stringify = postcss.stringify -export const fromJSON = postcss.fromJSON -export const plugin = postcss.plugin -export const parse = postcss.parse -export const list = postcss.list - -export const document = postcss.document -export const comment = postcss.comment -export const atRule = postcss.atRule -export const rule = postcss.rule -export const decl = postcss.decl -export const root = postcss.root - -export const CssSyntaxError = postcss.CssSyntaxError -export const Declaration = postcss.Declaration -export const Container = postcss.Container -export const Processor = postcss.Processor -export const Document = postcss.Document -export const Comment = postcss.Comment -export const Warning = postcss.Warning -export const AtRule = postcss.AtRule -export const Result = postcss.Result -export const Input = postcss.Input -export const Rule = postcss.Rule -export const Root = postcss.Root -export const Node = postcss.Node diff --git a/node_modules/postcss/lib/previous-map.d.ts b/node_modules/postcss/lib/previous-map.d.ts deleted file mode 100644 index 23edeb5c5..000000000 --- a/node_modules/postcss/lib/previous-map.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { SourceMapConsumer } from 'source-map-js' - -import { ProcessOptions } from './postcss.js' - -declare namespace PreviousMap { - // eslint-disable-next-line @typescript-eslint/no-use-before-define - export { PreviousMap_ as default } -} - -/** - * Source map information from input CSS. - * For example, source map after Sass compiler. - * - * This class will automatically find source map in input CSS or in file system - * near input file (according `from` option). - * - * ```js - * const root = parse(css, { from: 'a.sass.css' }) - * root.input.map //=> PreviousMap - * ``` - */ -declare class PreviousMap_ { - /** - * `sourceMappingURL` content. - */ - annotation?: string - - /** - * The CSS source identifier. Contains `Input#file` if the user - * set the `from` option, or `Input#id` if they did not. - */ - file?: string - - /** - * Was source map inlined by data-uri to input CSS. - */ - inline: boolean - - /** - * Path to source map file. - */ - mapFile?: string - - /** - * The directory with source map file, if source map is in separated file. - */ - root?: string - - /** - * Source map file content. - */ - text?: string - - /** - * @param css Input CSS source. - * @param opts Process options. - */ - constructor(css: string, opts?: ProcessOptions) - - /** - * Create a instance of `SourceMapGenerator` class - * from the `source-map` library to work with source map information. - * - * It is lazy method, so it will create object only on first call - * and then it will use cache. - * - * @return Object with source map information. - */ - consumer(): SourceMapConsumer - - /** - * Does source map contains `sourcesContent` with input source text. - * - * @return Is `sourcesContent` present. - */ - withContent(): boolean -} - -declare class PreviousMap extends PreviousMap_ {} - -export = PreviousMap diff --git a/node_modules/postcss/lib/previous-map.js b/node_modules/postcss/lib/previous-map.js deleted file mode 100644 index f3093dfb8..000000000 --- a/node_modules/postcss/lib/previous-map.js +++ /dev/null @@ -1,142 +0,0 @@ -'use strict' - -let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js') -let { existsSync, readFileSync } = require('fs') -let { dirname, join } = require('path') - -function fromBase64(str) { - if (Buffer) { - return Buffer.from(str, 'base64').toString() - } else { - /* c8 ignore next 2 */ - return window.atob(str) - } -} - -class PreviousMap { - constructor(css, opts) { - if (opts.map === false) return - this.loadAnnotation(css) - this.inline = this.startWith(this.annotation, 'data:') - - let prev = opts.map ? opts.map.prev : undefined - let text = this.loadMap(opts.from, prev) - if (!this.mapFile && opts.from) { - this.mapFile = opts.from - } - if (this.mapFile) this.root = dirname(this.mapFile) - if (text) this.text = text - } - - consumer() { - if (!this.consumerCache) { - this.consumerCache = new SourceMapConsumer(this.text) - } - return this.consumerCache - } - - decodeInline(text) { - let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/ - let baseUri = /^data:application\/json;base64,/ - let charsetUri = /^data:application\/json;charset=utf-?8,/ - let uri = /^data:application\/json,/ - - if (charsetUri.test(text) || uri.test(text)) { - return decodeURIComponent(text.substr(RegExp.lastMatch.length)) - } - - if (baseCharsetUri.test(text) || baseUri.test(text)) { - return fromBase64(text.substr(RegExp.lastMatch.length)) - } - - let encoding = text.match(/data:application\/json;([^,]+),/)[1] - throw new Error('Unsupported source map encoding ' + encoding) - } - - getAnnotationURL(sourceMapString) { - return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim() - } - - isMap(map) { - if (typeof map !== 'object') return false - return ( - typeof map.mappings === 'string' || - typeof map._mappings === 'string' || - Array.isArray(map.sections) - ) - } - - loadAnnotation(css) { - let comments = css.match(/\/\*\s*# sourceMappingURL=/gm) - if (!comments) return - - // sourceMappingURLs from comments, strings, etc. - let start = css.lastIndexOf(comments.pop()) - let end = css.indexOf('*/', start) - - if (start > -1 && end > -1) { - // Locate the last sourceMappingURL to avoid pickin - this.annotation = this.getAnnotationURL(css.substring(start, end)) - } - } - - loadFile(path) { - this.root = dirname(path) - if (existsSync(path)) { - this.mapFile = path - return readFileSync(path, 'utf-8').toString().trim() - } - } - - loadMap(file, prev) { - if (prev === false) return false - - if (prev) { - if (typeof prev === 'string') { - return prev - } else if (typeof prev === 'function') { - let prevPath = prev(file) - if (prevPath) { - let map = this.loadFile(prevPath) - if (!map) { - throw new Error( - 'Unable to load previous source map: ' + prevPath.toString() - ) - } - return map - } - } else if (prev instanceof SourceMapConsumer) { - return SourceMapGenerator.fromSourceMap(prev).toString() - } else if (prev instanceof SourceMapGenerator) { - return prev.toString() - } else if (this.isMap(prev)) { - return JSON.stringify(prev) - } else { - throw new Error( - 'Unsupported previous source map format: ' + prev.toString() - ) - } - } else if (this.inline) { - return this.decodeInline(this.annotation) - } else if (this.annotation) { - let map = this.annotation - if (file) map = join(dirname(file), map) - return this.loadFile(map) - } - } - - startWith(string, start) { - if (!string) return false - return string.substr(0, start.length) === start - } - - withContent() { - return !!( - this.consumer().sourcesContent && - this.consumer().sourcesContent.length > 0 - ) - } -} - -module.exports = PreviousMap -PreviousMap.default = PreviousMap diff --git a/node_modules/postcss/lib/processor.d.ts b/node_modules/postcss/lib/processor.d.ts deleted file mode 100644 index 16c6a6656..000000000 --- a/node_modules/postcss/lib/processor.d.ts +++ /dev/null @@ -1,111 +0,0 @@ -import LazyResult from './lazy-result.js' -import NoWorkResult from './no-work-result.js' -import { - AcceptedPlugin, - Plugin, - ProcessOptions, - TransformCallback, - Transformer -} from './postcss.js' -import Result from './result.js' -import Root from './root.js' - -declare namespace Processor { - // eslint-disable-next-line @typescript-eslint/no-use-before-define - export { Processor_ as default } -} - -/** - * Contains plugins to process CSS. Create one `Processor` instance, - * initialize its plugins, and then use that instance on numerous CSS files. - * - * ```js - * const processor = postcss([autoprefixer, postcssNested]) - * processor.process(css1).then(result => console.log(result.css)) - * processor.process(css2).then(result => console.log(result.css)) - * ``` - */ -declare class Processor_ { - /** - * Plugins added to this processor. - * - * ```js - * const processor = postcss([autoprefixer, postcssNested]) - * processor.plugins.length //=> 2 - * ``` - */ - plugins: (Plugin | TransformCallback | Transformer)[] - - /** - * Current PostCSS version. - * - * ```js - * if (result.processor.version.split('.')[0] !== '6') { - * throw new Error('This plugin works only with PostCSS 6') - * } - * ``` - */ - version: string - - /** - * @param plugins PostCSS plugins - */ - constructor(plugins?: AcceptedPlugin[]) - - /** - * Parses source CSS and returns a `LazyResult` Promise proxy. - * Because some plugins can be asynchronous it doesn’t make - * any transformations. Transformations will be applied - * in the `LazyResult` methods. - * - * ```js - * processor.process(css, { from: 'a.css', to: 'a.out.css' }) - * .then(result => { - * console.log(result.css) - * }) - * ``` - * - * @param css String with input CSS or any object with a `toString()` method, - * like a Buffer. Optionally, send a `Result` instance - * and the processor will take the `Root` from it. - * @param opts Options. - * @return Promise proxy. - */ - process( - css: { toString(): string } | LazyResult | Result | Root | string, - options?: ProcessOptions - ): LazyResult | NoWorkResult - - /** - * Adds a plugin to be used as a CSS processor. - * - * PostCSS plugin can be in 4 formats: - * * A plugin in `Plugin` format. - * * A plugin creator function with `pluginCreator.postcss = true`. - * PostCSS will call this function without argument to get plugin. - * * A function. PostCSS will pass the function a {@link Root} - * as the first argument and current `Result` instance - * as the second. - * * Another `Processor` instance. PostCSS will copy plugins - * from that instance into this one. - * - * Plugins can also be added by passing them as arguments when creating - * a `postcss` instance (see [`postcss(plugins)`]). - * - * Asynchronous plugins should return a `Promise` instance. - * - * ```js - * const processor = postcss() - * .use(autoprefixer) - * .use(postcssNested) - * ``` - * - * @param plugin PostCSS plugin or `Processor` with plugins. - * @return Current processor to make methods chain. - */ - use(plugin: AcceptedPlugin): this -} - -declare class Processor extends Processor_ {} - -export = Processor diff --git a/node_modules/postcss/lib/processor.js b/node_modules/postcss/lib/processor.js deleted file mode 100644 index 57854cdbd..000000000 --- a/node_modules/postcss/lib/processor.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict' - -let NoWorkResult = require('./no-work-result') -let LazyResult = require('./lazy-result') -let Document = require('./document') -let Root = require('./root') - -class Processor { - constructor(plugins = []) { - this.version = '8.4.25' - this.plugins = this.normalize(plugins) - } - - normalize(plugins) { - let normalized = [] - for (let i of plugins) { - if (i.postcss === true) { - i = i() - } else if (i.postcss) { - i = i.postcss - } - - if (typeof i === 'object' && Array.isArray(i.plugins)) { - normalized = normalized.concat(i.plugins) - } else if (typeof i === 'object' && i.postcssPlugin) { - normalized.push(i) - } else if (typeof i === 'function') { - normalized.push(i) - } else if (typeof i === 'object' && (i.parse || i.stringify)) { - if (process.env.NODE_ENV !== 'production') { - throw new Error( - 'PostCSS syntaxes cannot be used as plugins. Instead, please use ' + - 'one of the syntax/parser/stringifier options as outlined ' + - 'in your PostCSS runner documentation.' - ) - } - } else { - throw new Error(i + ' is not a PostCSS plugin') - } - } - return normalized - } - - process(css, opts = {}) { - if ( - this.plugins.length === 0 && - typeof opts.parser === 'undefined' && - typeof opts.stringifier === 'undefined' && - typeof opts.syntax === 'undefined' - ) { - return new NoWorkResult(this, css, opts) - } else { - return new LazyResult(this, css, opts) - } - } - - use(plugin) { - this.plugins = this.plugins.concat(this.normalize([plugin])) - return this - } -} - -module.exports = Processor -Processor.default = Processor - -Root.registerProcessor(Processor) -Document.registerProcessor(Processor) diff --git a/node_modules/postcss/lib/result.d.ts b/node_modules/postcss/lib/result.d.ts deleted file mode 100644 index bde48f582..000000000 --- a/node_modules/postcss/lib/result.d.ts +++ /dev/null @@ -1,206 +0,0 @@ -import { - Document, - Node, - Plugin, - ProcessOptions, - Root, - SourceMap, - TransformCallback, - Warning, - WarningOptions -} from './postcss.js' -import Processor from './processor.js' - -declare namespace Result { - export interface Message { - [others: string]: any - - /** - * Source PostCSS plugin name. - */ - plugin?: string - - /** - * Message type. - */ - type: string - } - - export interface ResultOptions extends ProcessOptions { - /** - * The CSS node that was the source of the warning. - */ - node?: Node - - /** - * Name of plugin that created this warning. `Result#warn` will fill it - * automatically with `Plugin#postcssPlugin` value. - */ - plugin?: string - } - - - // eslint-disable-next-line @typescript-eslint/no-use-before-define - export { Result_ as default } -} - -/** - * Provides the result of the PostCSS transformations. - * - * A Result instance is returned by `LazyResult#then` - * or `Root#toResult` methods. - * - * ```js - * postcss([autoprefixer]).process(css).then(result => { - * console.log(result.css) - * }) - * ``` - * - * ```js - * const result2 = postcss.parse(css).toResult() - * ``` - */ -declare class Result_ { - /** - * A CSS string representing of `Result#root`. - * - * ```js - * postcss.parse('a{}').toResult().css //=> "a{}" - * ``` - */ - css: string - - /** - * Last runned PostCSS plugin. - */ - lastPlugin: Plugin | TransformCallback - - /** - * An instance of `SourceMapGenerator` class from the `source-map` library, - * representing changes to the `Result#root` instance. - * - * ```js - * result.map.toJSON() //=> { version: 3, file: 'a.css', … } - * ``` - * - * ```js - * if (result.map) { - * fs.writeFileSync(result.opts.to + '.map', result.map.toString()) - * } - * ``` - */ - map: SourceMap - - /** - * Contains messages from plugins (e.g., warnings or custom messages). - * Each message should have type and plugin properties. - * - * ```js - * AtRule: { - * import: (atRule, { result }) { - * const importedFile = parseImport(atRule) - * result.messages.push({ - * type: 'dependency', - * plugin: 'postcss-import', - * file: importedFile, - * parent: result.opts.from - * }) - * } - * } - * ``` - */ - messages: Result.Message[] - - /** - * Options from the `Processor#process` or `Root#toResult` call - * that produced this Result instance.] - * - * ```js - * root.toResult(opts).opts === opts - * ``` - */ - opts: Result.ResultOptions - - /** - * The Processor instance used for this transformation. - * - * ```js - * for (const plugin of result.processor.plugins) { - * if (plugin.postcssPlugin === 'postcss-bad') { - * throw 'postcss-good is incompatible with postcss-bad' - * } - * }) - * ``` - */ - processor: Processor - - /** - * Root node after all transformations. - * - * ```js - * root.toResult().root === root - * ``` - */ - root: Document | Root - - /** - * @param processor Processor used for this transformation. - * @param root Root node after all transformations. - * @param opts Options from the `Processor#process` or `Root#toResult`. - */ - constructor(processor: Processor, root: Document | Root, opts: Result.ResultOptions) - - /** - * An alias for the `Result#css` property. - * Use it with syntaxes that generate non-CSS output. - * - * ```js - * result.css === result.content - * ``` - */ - get content(): string - - /** - * Returns for `Result#css` content. - * - * ```js - * result + '' === result.css - * ``` - * - * @return String representing of `Result#root`. - */ - toString(): string - - /** - * Creates an instance of `Warning` and adds it to `Result#messages`. - * - * ```js - * if (decl.important) { - * result.warn('Avoid !important', { node: decl, word: '!important' }) - * } - * ``` - * - * @param text Warning message. - * @param opts Warning options. - * @return Created warning. - */ - warn(message: string, options?: WarningOptions): Warning - - /** - * Returns warnings from plugins. Filters `Warning` instances - * from `Result#messages`. - * - * ```js - * result.warnings().forEach(warn => { - * console.warn(warn.toString()) - * }) - * ``` - * - * @return Warnings from plugins. - */ - warnings(): Warning[] -} - -declare class Result extends Result_ {} - -export = Result diff --git a/node_modules/postcss/lib/result.js b/node_modules/postcss/lib/result.js deleted file mode 100644 index 4357c2e25..000000000 --- a/node_modules/postcss/lib/result.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict' - -let Warning = require('./warning') - -class Result { - constructor(processor, root, opts) { - this.processor = processor - this.messages = [] - this.root = root - this.opts = opts - this.css = undefined - this.map = undefined - } - - get content() { - return this.css - } - - toString() { - return this.css - } - - warn(text, opts = {}) { - if (!opts.plugin) { - if (this.lastPlugin && this.lastPlugin.postcssPlugin) { - opts.plugin = this.lastPlugin.postcssPlugin - } - } - - let warning = new Warning(text, opts) - this.messages.push(warning) - - return warning - } - - warnings() { - return this.messages.filter(i => i.type === 'warning') - } -} - -module.exports = Result -Result.default = Result diff --git a/node_modules/postcss/lib/root.d.ts b/node_modules/postcss/lib/root.d.ts deleted file mode 100644 index 4ba23eb2b..000000000 --- a/node_modules/postcss/lib/root.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import Container, { ContainerProps } from './container.js' -import Document from './document.js' -import { ProcessOptions } from './postcss.js' -import Result from './result.js' - -declare namespace Root { - export interface RootRaws extends Record { - /** - * The space symbols after the last child to the end of file. - */ - after?: string - - /** - * Non-CSS code after `Root`, when `Root` is inside `Document`. - * - * **Experimental:** some aspects of this node could change within minor - * or patch version releases. - */ - codeAfter?: string - - /** - * Non-CSS code before `Root`, when `Root` is inside `Document`. - * - * **Experimental:** some aspects of this node could change within minor - * or patch version releases. - */ - codeBefore?: string - - /** - * Is the last child has an (optional) semicolon. - */ - semicolon?: boolean - } - - export interface RootProps extends ContainerProps { - /** - * Information used to generate byte-to-byte equal node string - * as it was in the origin input. - * */ - raws?: RootRaws - } - - // eslint-disable-next-line @typescript-eslint/no-use-before-define - export { Root_ as default } -} - -/** - * Represents a CSS file and contains all its parsed nodes. - * - * ```js - * const root = postcss.parse('a{color:black} b{z-index:2}') - * root.type //=> 'root' - * root.nodes.length //=> 2 - * ``` - */ -declare class Root_ extends Container { - parent: Document | undefined - raws: Root.RootRaws - type: 'root' - - constructor(defaults?: Root.RootProps) - - assign(overrides: object | Root.RootProps): this - /** - * Returns a `Result` instance representing the root’s CSS. - * - * ```js - * const root1 = postcss.parse(css1, { from: 'a.css' }) - * const root2 = postcss.parse(css2, { from: 'b.css' }) - * root1.append(root2) - * const result = root1.toResult({ to: 'all.css', map: true }) - * ``` - * - * @param opts Options. - * @return Result with current root’s CSS. - */ - toResult(options?: ProcessOptions): Result -} - -declare class Root extends Root_ {} - -export = Root diff --git a/node_modules/postcss/lib/root.js b/node_modules/postcss/lib/root.js deleted file mode 100644 index ea574edca..000000000 --- a/node_modules/postcss/lib/root.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict' - -let Container = require('./container') - -let LazyResult, Processor - -class Root extends Container { - constructor(defaults) { - super(defaults) - this.type = 'root' - if (!this.nodes) this.nodes = [] - } - - normalize(child, sample, type) { - let nodes = super.normalize(child) - - if (sample) { - if (type === 'prepend') { - if (this.nodes.length > 1) { - sample.raws.before = this.nodes[1].raws.before - } else { - delete sample.raws.before - } - } else if (this.first !== sample) { - for (let node of nodes) { - node.raws.before = sample.raws.before - } - } - } - - return nodes - } - - removeChild(child, ignore) { - let index = this.index(child) - - if (!ignore && index === 0 && this.nodes.length > 1) { - this.nodes[1].raws.before = this.nodes[index].raws.before - } - - return super.removeChild(child) - } - - toResult(opts = {}) { - let lazy = new LazyResult(new Processor(), this, opts) - return lazy.stringify() - } -} - -Root.registerLazyResult = dependant => { - LazyResult = dependant -} - -Root.registerProcessor = dependant => { - Processor = dependant -} - -module.exports = Root -Root.default = Root - -Container.registerRoot(Root) diff --git a/node_modules/postcss/lib/rule.d.ts b/node_modules/postcss/lib/rule.d.ts deleted file mode 100644 index 307c6a67a..000000000 --- a/node_modules/postcss/lib/rule.d.ts +++ /dev/null @@ -1,113 +0,0 @@ -import Container, { ContainerProps } from './container.js' - -declare namespace Rule { - export interface RuleRaws extends Record { - /** - * The space symbols after the last child of the node to the end of the node. - */ - after?: string - - /** - * The space symbols before the node. It also stores `*` - * and `_` symbols before the declaration (IE hack). - */ - before?: string - - /** - * The symbols between the selector and `{` for rules. - */ - between?: string - - /** - * Contains `true` if there is semicolon after rule. - */ - ownSemicolon?: string - - /** - * The rule’s selector with comments. - */ - selector?: { - raw: string - value: string - } - - /** - * Contains `true` if the last child has an (optional) semicolon. - */ - semicolon?: boolean - } - - export interface RuleProps extends ContainerProps { - /** Information used to generate byte-to-byte equal node string as it was in the origin input. */ - raws?: RuleRaws - /** Selector or selectors of the rule. */ - selector?: string - /** Selectors of the rule represented as an array of strings. */ - selectors?: string[] - } - - // eslint-disable-next-line @typescript-eslint/no-use-before-define - export { Rule_ as default } -} - -/** - * Represents a CSS rule: a selector followed by a declaration block. - * - * ```js - * Once (root, { Rule }) { - * let a = new Rule({ selector: 'a' }) - * a.append(…) - * root.append(a) - * } - * ``` - * - * ```js - * const root = postcss.parse('a{}') - * const rule = root.first - * rule.type //=> 'rule' - * rule.toString() //=> 'a{}' - * ``` - */ -declare class Rule_ extends Container { - parent: Container | undefined - raws: Rule.RuleRaws - /** - * The rule’s full selector represented as a string. - * - * ```js - * const root = postcss.parse('a, b { }') - * const rule = root.first - * rule.selector //=> 'a, b' - * ``` - */ - selector: string - - /** - * An array containing the rule’s individual selectors. - * Groups of selectors are split at commas. - * - * ```js - * const root = postcss.parse('a, b { }') - * const rule = root.first - * - * rule.selector //=> 'a, b' - * rule.selectors //=> ['a', 'b'] - * - * rule.selectors = ['a', 'strong'] - * rule.selector //=> 'a, strong' - * ``` - */ - selectors: string[] - - type: 'rule' - - constructor(defaults?: Rule.RuleProps) - assign(overrides: object | Rule.RuleProps): this - clone(overrides?: Partial): this - cloneAfter(overrides?: Partial): this - cloneBefore(overrides?: Partial): this -} - -declare class Rule extends Rule_ {} - -export = Rule diff --git a/node_modules/postcss/lib/rule.js b/node_modules/postcss/lib/rule.js deleted file mode 100644 index a93ab25bf..000000000 --- a/node_modules/postcss/lib/rule.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' - -let Container = require('./container') -let list = require('./list') - -class Rule extends Container { - constructor(defaults) { - super(defaults) - this.type = 'rule' - if (!this.nodes) this.nodes = [] - } - - get selectors() { - return list.comma(this.selector) - } - - set selectors(values) { - let match = this.selector ? this.selector.match(/,\s*/) : null - let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen') - this.selector = values.join(sep) - } -} - -module.exports = Rule -Rule.default = Rule - -Container.registerRule(Rule) diff --git a/node_modules/postcss/lib/stringifier.d.ts b/node_modules/postcss/lib/stringifier.d.ts deleted file mode 100644 index f707a6aa3..000000000 --- a/node_modules/postcss/lib/stringifier.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { - AnyNode, - AtRule, - Builder, - Comment, - Container, - Declaration, - Document, - Root, - Rule -} from './postcss.js' - -declare namespace Stringifier { - // eslint-disable-next-line @typescript-eslint/no-use-before-define - export { Stringifier_ as default } -} - -declare class Stringifier_ { - builder: Builder - constructor(builder: Builder) - atrule(node: AtRule, semicolon?: boolean): void - beforeAfter(node: AnyNode, detect: 'after' | 'before'): string - block(node: AnyNode, start: string): void - body(node: Container): void - comment(node: Comment): void - decl(node: Declaration, semicolon?: boolean): void - document(node: Document): void - raw(node: AnyNode, own: null | string, detect?: string): string - rawBeforeClose(root: Root): string | undefined - rawBeforeComment(root: Root, node: Comment): string | undefined - rawBeforeDecl(root: Root, node: Declaration): string | undefined - rawBeforeOpen(root: Root): string | undefined - rawBeforeRule(root: Root): string | undefined - rawColon(root: Root): string | undefined - rawEmptyBody(root: Root): string | undefined - rawIndent(root: Root): string | undefined - rawSemicolon(root: Root): boolean | undefined - rawValue(node: AnyNode, prop: string): string - root(node: Root): void - rule(node: Rule): void - stringify(node: AnyNode, semicolon?: boolean): void -} - -declare class Stringifier extends Stringifier_ {} - -export = Stringifier diff --git a/node_modules/postcss/lib/stringifier.js b/node_modules/postcss/lib/stringifier.js deleted file mode 100644 index e07ad12e7..000000000 --- a/node_modules/postcss/lib/stringifier.js +++ /dev/null @@ -1,353 +0,0 @@ -'use strict' - -const DEFAULT_RAW = { - after: '\n', - beforeClose: '\n', - beforeComment: '\n', - beforeDecl: '\n', - beforeOpen: ' ', - beforeRule: '\n', - colon: ': ', - commentLeft: ' ', - commentRight: ' ', - emptyBody: '', - indent: ' ', - semicolon: false -} - -function capitalize(str) { - return str[0].toUpperCase() + str.slice(1) -} - -class Stringifier { - constructor(builder) { - this.builder = builder - } - - atrule(node, semicolon) { - let name = '@' + node.name - let params = node.params ? this.rawValue(node, 'params') : '' - - if (typeof node.raws.afterName !== 'undefined') { - name += node.raws.afterName - } else if (params) { - name += ' ' - } - - if (node.nodes) { - this.block(node, name + params) - } else { - let end = (node.raws.between || '') + (semicolon ? ';' : '') - this.builder(name + params + end, node) - } - } - - beforeAfter(node, detect) { - let value - if (node.type === 'decl') { - value = this.raw(node, null, 'beforeDecl') - } else if (node.type === 'comment') { - value = this.raw(node, null, 'beforeComment') - } else if (detect === 'before') { - value = this.raw(node, null, 'beforeRule') - } else { - value = this.raw(node, null, 'beforeClose') - } - - let buf = node.parent - let depth = 0 - while (buf && buf.type !== 'root') { - depth += 1 - buf = buf.parent - } - - if (value.includes('\n')) { - let indent = this.raw(node, null, 'indent') - if (indent.length) { - for (let step = 0; step < depth; step++) value += indent - } - } - - return value - } - - block(node, start) { - let between = this.raw(node, 'between', 'beforeOpen') - this.builder(start + between + '{', node, 'start') - - let after - if (node.nodes && node.nodes.length) { - this.body(node) - after = this.raw(node, 'after') - } else { - after = this.raw(node, 'after', 'emptyBody') - } - - if (after) this.builder(after) - this.builder('}', node, 'end') - } - - body(node) { - let last = node.nodes.length - 1 - while (last > 0) { - if (node.nodes[last].type !== 'comment') break - last -= 1 - } - - let semicolon = this.raw(node, 'semicolon') - for (let i = 0; i < node.nodes.length; i++) { - let child = node.nodes[i] - let before = this.raw(child, 'before') - if (before) this.builder(before) - this.stringify(child, last !== i || semicolon) - } - } - - comment(node) { - let left = this.raw(node, 'left', 'commentLeft') - let right = this.raw(node, 'right', 'commentRight') - this.builder('/*' + left + node.text + right + '*/', node) - } - - decl(node, semicolon) { - let between = this.raw(node, 'between', 'colon') - let string = node.prop + between + this.rawValue(node, 'value') - - if (node.important) { - string += node.raws.important || ' !important' - } - - if (semicolon) string += ';' - this.builder(string, node) - } - - document(node) { - this.body(node) - } - - raw(node, own, detect) { - let value - if (!detect) detect = own - - // Already had - if (own) { - value = node.raws[own] - if (typeof value !== 'undefined') return value - } - - let parent = node.parent - - if (detect === 'before') { - // Hack for first rule in CSS - if (!parent || (parent.type === 'root' && parent.first === node)) { - return '' - } - - // `root` nodes in `document` should use only their own raws - if (parent && parent.type === 'document') { - return '' - } - } - - // Floating child without parent - if (!parent) return DEFAULT_RAW[detect] - - // Detect style by other nodes - let root = node.root() - if (!root.rawCache) root.rawCache = {} - if (typeof root.rawCache[detect] !== 'undefined') { - return root.rawCache[detect] - } - - if (detect === 'before' || detect === 'after') { - return this.beforeAfter(node, detect) - } else { - let method = 'raw' + capitalize(detect) - if (this[method]) { - value = this[method](root, node) - } else { - root.walk(i => { - value = i.raws[own] - if (typeof value !== 'undefined') return false - }) - } - } - - if (typeof value === 'undefined') value = DEFAULT_RAW[detect] - - root.rawCache[detect] = value - return value - } - - rawBeforeClose(root) { - let value - root.walk(i => { - if (i.nodes && i.nodes.length > 0) { - if (typeof i.raws.after !== 'undefined') { - value = i.raws.after - if (value.includes('\n')) { - value = value.replace(/[^\n]+$/, '') - } - return false - } - } - }) - if (value) value = value.replace(/\S/g, '') - return value - } - - rawBeforeComment(root, node) { - let value - root.walkComments(i => { - if (typeof i.raws.before !== 'undefined') { - value = i.raws.before - if (value.includes('\n')) { - value = value.replace(/[^\n]+$/, '') - } - return false - } - }) - if (typeof value === 'undefined') { - value = this.raw(node, null, 'beforeDecl') - } else if (value) { - value = value.replace(/\S/g, '') - } - return value - } - - rawBeforeDecl(root, node) { - let value - root.walkDecls(i => { - if (typeof i.raws.before !== 'undefined') { - value = i.raws.before - if (value.includes('\n')) { - value = value.replace(/[^\n]+$/, '') - } - return false - } - }) - if (typeof value === 'undefined') { - value = this.raw(node, null, 'beforeRule') - } else if (value) { - value = value.replace(/\S/g, '') - } - return value - } - - rawBeforeOpen(root) { - let value - root.walk(i => { - if (i.type !== 'decl') { - value = i.raws.between - if (typeof value !== 'undefined') return false - } - }) - return value - } - - rawBeforeRule(root) { - let value - root.walk(i => { - if (i.nodes && (i.parent !== root || root.first !== i)) { - if (typeof i.raws.before !== 'undefined') { - value = i.raws.before - if (value.includes('\n')) { - value = value.replace(/[^\n]+$/, '') - } - return false - } - } - }) - if (value) value = value.replace(/\S/g, '') - return value - } - - rawColon(root) { - let value - root.walkDecls(i => { - if (typeof i.raws.between !== 'undefined') { - value = i.raws.between.replace(/[^\s:]/g, '') - return false - } - }) - return value - } - - rawEmptyBody(root) { - let value - root.walk(i => { - if (i.nodes && i.nodes.length === 0) { - value = i.raws.after - if (typeof value !== 'undefined') return false - } - }) - return value - } - - rawIndent(root) { - if (root.raws.indent) return root.raws.indent - let value - root.walk(i => { - let p = i.parent - if (p && p !== root && p.parent && p.parent === root) { - if (typeof i.raws.before !== 'undefined') { - let parts = i.raws.before.split('\n') - value = parts[parts.length - 1] - value = value.replace(/\S/g, '') - return false - } - } - }) - return value - } - - rawSemicolon(root) { - let value - root.walk(i => { - if (i.nodes && i.nodes.length && i.last.type === 'decl') { - value = i.raws.semicolon - if (typeof value !== 'undefined') return false - } - }) - return value - } - - rawValue(node, prop) { - let value = node[prop] - let raw = node.raws[prop] - if (raw && raw.value === value) { - return raw.raw - } - - return value - } - - root(node) { - this.body(node) - if (node.raws.after) this.builder(node.raws.after) - } - - rule(node) { - this.block(node, this.rawValue(node, 'selector')) - if (node.raws.ownSemicolon) { - this.builder(node.raws.ownSemicolon, node, 'end') - } - } - - stringify(node, semicolon) { - /* c8 ignore start */ - if (!this[node.type]) { - throw new Error( - 'Unknown AST node type ' + - node.type + - '. ' + - 'Maybe you need to change PostCSS stringifier.' - ) - } - /* c8 ignore stop */ - this[node.type](node, semicolon) - } -} - -module.exports = Stringifier -Stringifier.default = Stringifier diff --git a/node_modules/postcss/lib/stringify.d.ts b/node_modules/postcss/lib/stringify.d.ts deleted file mode 100644 index 06ad0b4de..000000000 --- a/node_modules/postcss/lib/stringify.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Stringifier } from './postcss.js' - -interface Stringify extends Stringifier { - default: Stringify -} - -declare const stringify: Stringify - -export = stringify diff --git a/node_modules/postcss/lib/stringify.js b/node_modules/postcss/lib/stringify.js deleted file mode 100644 index 77bd0178b..000000000 --- a/node_modules/postcss/lib/stringify.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict' - -let Stringifier = require('./stringifier') - -function stringify(node, builder) { - let str = new Stringifier(builder) - str.stringify(node) -} - -module.exports = stringify -stringify.default = stringify diff --git a/node_modules/postcss/lib/symbols.js b/node_modules/postcss/lib/symbols.js deleted file mode 100644 index a142c268d..000000000 --- a/node_modules/postcss/lib/symbols.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict' - -module.exports.isClean = Symbol('isClean') - -module.exports.my = Symbol('my') diff --git a/node_modules/postcss/lib/terminal-highlight.js b/node_modules/postcss/lib/terminal-highlight.js deleted file mode 100644 index 6196c9df1..000000000 --- a/node_modules/postcss/lib/terminal-highlight.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict' - -let pico = require('picocolors') - -let tokenizer = require('./tokenize') - -let Input - -function registerInput(dependant) { - Input = dependant -} - -const HIGHLIGHT_THEME = { - ';': pico.yellow, - ':': pico.yellow, - '(': pico.cyan, - ')': pico.cyan, - '[': pico.yellow, - ']': pico.yellow, - '{': pico.yellow, - '}': pico.yellow, - 'at-word': pico.cyan, - 'brackets': pico.cyan, - 'call': pico.cyan, - 'class': pico.yellow, - 'comment': pico.gray, - 'hash': pico.magenta, - 'string': pico.green -} - -function getTokenType([type, value], processor) { - if (type === 'word') { - if (value[0] === '.') { - return 'class' - } - if (value[0] === '#') { - return 'hash' - } - } - - if (!processor.endOfFile()) { - let next = processor.nextToken() - processor.back(next) - if (next[0] === 'brackets' || next[0] === '(') return 'call' - } - - return type -} - -function terminalHighlight(css) { - let processor = tokenizer(new Input(css), { ignoreErrors: true }) - let result = '' - while (!processor.endOfFile()) { - let token = processor.nextToken() - let color = HIGHLIGHT_THEME[getTokenType(token, processor)] - if (color) { - result += token[1] - .split(/\r?\n/) - .map(i => color(i)) - .join('\n') - } else { - result += token[1] - } - } - return result -} - -terminalHighlight.registerInput = registerInput - -module.exports = terminalHighlight diff --git a/node_modules/postcss/lib/tokenize.js b/node_modules/postcss/lib/tokenize.js deleted file mode 100644 index 5a9ed1764..000000000 --- a/node_modules/postcss/lib/tokenize.js +++ /dev/null @@ -1,266 +0,0 @@ -'use strict' - -const SINGLE_QUOTE = "'".charCodeAt(0) -const DOUBLE_QUOTE = '"'.charCodeAt(0) -const BACKSLASH = '\\'.charCodeAt(0) -const SLASH = '/'.charCodeAt(0) -const NEWLINE = '\n'.charCodeAt(0) -const SPACE = ' '.charCodeAt(0) -const FEED = '\f'.charCodeAt(0) -const TAB = '\t'.charCodeAt(0) -const CR = '\r'.charCodeAt(0) -const OPEN_SQUARE = '['.charCodeAt(0) -const CLOSE_SQUARE = ']'.charCodeAt(0) -const OPEN_PARENTHESES = '('.charCodeAt(0) -const CLOSE_PARENTHESES = ')'.charCodeAt(0) -const OPEN_CURLY = '{'.charCodeAt(0) -const CLOSE_CURLY = '}'.charCodeAt(0) -const SEMICOLON = ';'.charCodeAt(0) -const ASTERISK = '*'.charCodeAt(0) -const COLON = ':'.charCodeAt(0) -const AT = '@'.charCodeAt(0) - -const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g -const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g -const RE_BAD_BRACKET = /.[\n"'(/\\]/ -const RE_HEX_ESCAPE = /[\da-f]/i - -module.exports = function tokenizer(input, options = {}) { - let css = input.css.valueOf() - let ignore = options.ignoreErrors - - let code, next, quote, content, escape - let escaped, escapePos, prev, n, currentToken - - let length = css.length - let pos = 0 - let buffer = [] - let returned = [] - - function position() { - return pos - } - - function unclosed(what) { - throw input.error('Unclosed ' + what, pos) - } - - function endOfFile() { - return returned.length === 0 && pos >= length - } - - function nextToken(opts) { - if (returned.length) return returned.pop() - if (pos >= length) return - - let ignoreUnclosed = opts ? opts.ignoreUnclosed : false - - code = css.charCodeAt(pos) - - switch (code) { - case NEWLINE: - case SPACE: - case TAB: - case CR: - case FEED: { - next = pos - do { - next += 1 - code = css.charCodeAt(next) - } while ( - code === SPACE || - code === NEWLINE || - code === TAB || - code === CR || - code === FEED - ) - - currentToken = ['space', css.slice(pos, next)] - pos = next - 1 - break - } - - case OPEN_SQUARE: - case CLOSE_SQUARE: - case OPEN_CURLY: - case CLOSE_CURLY: - case COLON: - case SEMICOLON: - case CLOSE_PARENTHESES: { - let controlChar = String.fromCharCode(code) - currentToken = [controlChar, controlChar, pos] - break - } - - case OPEN_PARENTHESES: { - prev = buffer.length ? buffer.pop()[1] : '' - n = css.charCodeAt(pos + 1) - if ( - prev === 'url' && - n !== SINGLE_QUOTE && - n !== DOUBLE_QUOTE && - n !== SPACE && - n !== NEWLINE && - n !== TAB && - n !== FEED && - n !== CR - ) { - next = pos - do { - escaped = false - next = css.indexOf(')', next + 1) - if (next === -1) { - if (ignore || ignoreUnclosed) { - next = pos - break - } else { - unclosed('bracket') - } - } - escapePos = next - while (css.charCodeAt(escapePos - 1) === BACKSLASH) { - escapePos -= 1 - escaped = !escaped - } - } while (escaped) - - currentToken = ['brackets', css.slice(pos, next + 1), pos, next] - - pos = next - } else { - next = css.indexOf(')', pos + 1) - content = css.slice(pos, next + 1) - - if (next === -1 || RE_BAD_BRACKET.test(content)) { - currentToken = ['(', '(', pos] - } else { - currentToken = ['brackets', content, pos, next] - pos = next - } - } - - break - } - - case SINGLE_QUOTE: - case DOUBLE_QUOTE: { - quote = code === SINGLE_QUOTE ? "'" : '"' - next = pos - do { - escaped = false - next = css.indexOf(quote, next + 1) - if (next === -1) { - if (ignore || ignoreUnclosed) { - next = pos + 1 - break - } else { - unclosed('string') - } - } - escapePos = next - while (css.charCodeAt(escapePos - 1) === BACKSLASH) { - escapePos -= 1 - escaped = !escaped - } - } while (escaped) - - currentToken = ['string', css.slice(pos, next + 1), pos, next] - pos = next - break - } - - case AT: { - RE_AT_END.lastIndex = pos + 1 - RE_AT_END.test(css) - if (RE_AT_END.lastIndex === 0) { - next = css.length - 1 - } else { - next = RE_AT_END.lastIndex - 2 - } - - currentToken = ['at-word', css.slice(pos, next + 1), pos, next] - - pos = next - break - } - - case BACKSLASH: { - next = pos - escape = true - while (css.charCodeAt(next + 1) === BACKSLASH) { - next += 1 - escape = !escape - } - code = css.charCodeAt(next + 1) - if ( - escape && - code !== SLASH && - code !== SPACE && - code !== NEWLINE && - code !== TAB && - code !== CR && - code !== FEED - ) { - next += 1 - if (RE_HEX_ESCAPE.test(css.charAt(next))) { - while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { - next += 1 - } - if (css.charCodeAt(next + 1) === SPACE) { - next += 1 - } - } - } - - currentToken = ['word', css.slice(pos, next + 1), pos, next] - - pos = next - break - } - - default: { - if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { - next = css.indexOf('*/', pos + 2) + 1 - if (next === 0) { - if (ignore || ignoreUnclosed) { - next = css.length - } else { - unclosed('comment') - } - } - - currentToken = ['comment', css.slice(pos, next + 1), pos, next] - pos = next - } else { - RE_WORD_END.lastIndex = pos + 1 - RE_WORD_END.test(css) - if (RE_WORD_END.lastIndex === 0) { - next = css.length - 1 - } else { - next = RE_WORD_END.lastIndex - 2 - } - - currentToken = ['word', css.slice(pos, next + 1), pos, next] - buffer.push(currentToken) - pos = next - } - - break - } - } - - pos++ - return currentToken - } - - function back(token) { - returned.push(token) - } - - return { - back, - endOfFile, - nextToken, - position - } -} diff --git a/node_modules/postcss/lib/warn-once.js b/node_modules/postcss/lib/warn-once.js deleted file mode 100644 index 316e1cf46..000000000 --- a/node_modules/postcss/lib/warn-once.js +++ /dev/null @@ -1,13 +0,0 @@ -/* eslint-disable no-console */ -'use strict' - -let printed = {} - -module.exports = function warnOnce(message) { - if (printed[message]) return - printed[message] = true - - if (typeof console !== 'undefined' && console.warn) { - console.warn(message) - } -} diff --git a/node_modules/postcss/lib/warning.d.ts b/node_modules/postcss/lib/warning.d.ts deleted file mode 100644 index b25bba816..000000000 --- a/node_modules/postcss/lib/warning.d.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { RangePosition } from './css-syntax-error.js' -import Node from './node.js' - -declare namespace Warning { - export interface WarningOptions { - /** - * End position, exclusive, in CSS node string that caused the warning. - */ - end?: RangePosition - - /** - * End index, exclusive, in CSS node string that caused the warning. - */ - endIndex?: number - - /** - * Start index, inclusive, in CSS node string that caused the warning. - */ - index?: number - - /** - * CSS node that caused the warning. - */ - node?: Node - - /** - * Name of the plugin that created this warning. `Result#warn` fills - * this property automatically. - */ - plugin?: string - - /** - * Start position, inclusive, in CSS node string that caused the warning. - */ - start?: RangePosition - - /** - * Word in CSS source that caused the warning. - */ - word?: string - } - - // eslint-disable-next-line @typescript-eslint/no-use-before-define - export { Warning_ as default } -} - -/** - * Represents a plugin’s warning. It can be created using `Node#warn`. - * - * ```js - * if (decl.important) { - * decl.warn(result, 'Avoid !important', { word: '!important' }) - * } - * ``` - */ -declare class Warning_ { - /** - * Column for inclusive start position in the input file with this warning’s source. - * - * ```js - * warning.column //=> 6 - * ``` - */ - column: number - - /** - * Column for exclusive end position in the input file with this warning’s source. - * - * ```js - * warning.endColumn //=> 4 - * ``` - */ - endColumn?: number - - /** - * Line for exclusive end position in the input file with this warning’s source. - * - * ```js - * warning.endLine //=> 6 - * ``` - */ - endLine?: number - - /** - * Line for inclusive start position in the input file with this warning’s source. - * - * ```js - * warning.line //=> 5 - * ``` - */ - line: number - - /** - * Contains the CSS node that caused the warning. - * - * ```js - * warning.node.toString() //=> 'color: white !important' - * ``` - */ - node: Node - - /** - * The name of the plugin that created this warning. - * When you call `Node#warn` it will fill this property automatically. - * - * ```js - * warning.plugin //=> 'postcss-important' - * ``` - */ - plugin: string - - /** - * The warning message. - * - * ```js - * warning.text //=> 'Try to avoid !important' - * ``` - */ - text: string - - /** - * Type to filter warnings from `Result#messages`. - * Always equal to `"warning"`. - */ - type: 'warning' - - /** - * @param text Warning message. - * @param opts Warning options. - */ - constructor(text: string, opts?: Warning.WarningOptions) - - /** - * Returns a warning position and message. - * - * ```js - * warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important' - * ``` - * - * @return Warning position and message. - */ - toString(): string -} - -declare class Warning extends Warning_ {} - -export = Warning diff --git a/node_modules/postcss/lib/warning.js b/node_modules/postcss/lib/warning.js deleted file mode 100644 index 3a3d79c93..000000000 --- a/node_modules/postcss/lib/warning.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict' - -class Warning { - constructor(text, opts = {}) { - this.type = 'warning' - this.text = text - - if (opts.node && opts.node.source) { - let range = opts.node.rangeBy(opts) - this.line = range.start.line - this.column = range.start.column - this.endLine = range.end.line - this.endColumn = range.end.column - } - - for (let opt in opts) this[opt] = opts[opt] - } - - toString() { - if (this.node) { - return this.node.error(this.text, { - index: this.index, - plugin: this.plugin, - word: this.word - }).message - } - - if (this.plugin) { - return this.plugin + ': ' + this.text - } - - return this.text - } -} - -module.exports = Warning -Warning.default = Warning diff --git a/node_modules/postcss/package.json b/node_modules/postcss/package.json deleted file mode 100755 index 0aee9a8c8..000000000 --- a/node_modules/postcss/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "postcss", - "version": "8.4.25", - "description": "Tool for transforming styles with JS plugins", - "engines": { - "node": "^10 || ^12 || >=14" - }, - "exports": { - ".": { - "require": "./lib/postcss.js", - "import": "./lib/postcss.mjs" - }, - "./lib/at-rule": "./lib/at-rule.js", - "./lib/comment": "./lib/comment.js", - "./lib/container": "./lib/container.js", - "./lib/css-syntax-error": "./lib/css-syntax-error.js", - "./lib/declaration": "./lib/declaration.js", - "./lib/fromJSON": "./lib/fromJSON.js", - "./lib/input": "./lib/input.js", - "./lib/lazy-result": "./lib/lazy-result.js", - "./lib/no-work-result": "./lib/no-work-result.js", - "./lib/list": "./lib/list.js", - "./lib/map-generator": "./lib/map-generator.js", - "./lib/node": "./lib/node.js", - "./lib/parse": "./lib/parse.js", - "./lib/parser": "./lib/parser.js", - "./lib/postcss": "./lib/postcss.js", - "./lib/previous-map": "./lib/previous-map.js", - "./lib/processor": "./lib/processor.js", - "./lib/result": "./lib/result.js", - "./lib/root": "./lib/root.js", - "./lib/rule": "./lib/rule.js", - "./lib/stringifier": "./lib/stringifier.js", - "./lib/stringify": "./lib/stringify.js", - "./lib/symbols": "./lib/symbols.js", - "./lib/terminal-highlight": "./lib/terminal-highlight.js", - "./lib/tokenize": "./lib/tokenize.js", - "./lib/warn-once": "./lib/warn-once.js", - "./lib/warning": "./lib/warning.js", - "./package.json": "./package.json" - }, - "main": "./lib/postcss.js", - "types": "./lib/postcss.d.ts", - "keywords": [ - "css", - "postcss", - "rework", - "preprocessor", - "parser", - "source map", - "transform", - "manipulation", - "transpiler" - ], - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "author": "Andrey Sitnik ", - "license": "MIT", - "homepage": "https://postcss.org/", - "repository": "postcss/postcss", - "bugs": { - "url": "https://github.com/postcss/postcss/issues" - }, - "dependencies": { - "nanoid": "^3.3.6", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - }, - "browser": { - "./lib/terminal-highlight": false, - "source-map-js": false, - "path": false, - "url": false, - "fs": false - } -} diff --git a/node_modules/punycode/LICENSE-MIT.txt b/node_modules/punycode/LICENSE-MIT.txt deleted file mode 100644 index a41e0a7ef..000000000 --- a/node_modules/punycode/LICENSE-MIT.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Mathias Bynens - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/punycode/README.md b/node_modules/punycode/README.md deleted file mode 100644 index 72b632cdc..000000000 --- a/node_modules/punycode/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# Punycode.js [![punycode on npm](https://img.shields.io/npm/v/punycode)](https://www.npmjs.com/package/emoji-test-regex-pattern) [![](https://data.jsdelivr.com/v1/package/npm/punycode/badge)](https://www.jsdelivr.com/package/npm/punycode) - -Punycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891). - -This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: - -* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C) -* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) -* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) -* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) -* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) - -This project was [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with Node.js from [v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) until [v7](https://github.com/nodejs/node/pull/7941) (soft-deprecated). - -This project provides a CommonJS module that uses ES2015+ features and JavaScript module, which work in modern Node.js versions and browsers. For the old Punycode.js version that offers the same functionality in a UMD build with support for older pre-ES2015 runtimes, including Rhino, Ringo, and Narwhal, see [v1.4.1](https://github.com/mathiasbynens/punycode.js/releases/tag/v1.4.1). - -## Installation - -Via [npm](https://www.npmjs.com/): - -```bash -npm install punycode --save -``` - -In [Node.js](https://nodejs.org/): - -> ⚠️ Note that userland modules don't hide core modules. -> For example, `require('punycode')` still imports the deprecated core module even if you executed `npm install punycode`. -> Use `require('punycode/')` to import userland modules rather than core modules. - -```js -const punycode = require('punycode/'); -``` - -## API - -### `punycode.decode(string)` - -Converts a Punycode string of ASCII symbols to a string of Unicode symbols. - -```js -// decode domain name parts -punycode.decode('maana-pta'); // 'mañana' -punycode.decode('--dqo34k'); // '☃-⌘' -``` - -### `punycode.encode(string)` - -Converts a string of Unicode symbols to a Punycode string of ASCII symbols. - -```js -// encode domain name parts -punycode.encode('mañana'); // 'maana-pta' -punycode.encode('☃-⌘'); // '--dqo34k' -``` - -### `punycode.toUnicode(input)` - -Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. - -```js -// decode domain names -punycode.toUnicode('xn--maana-pta.com'); -// → 'mañana.com' -punycode.toUnicode('xn----dqo34k.com'); -// → '☃-⌘.com' - -// decode email addresses -punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); -// → 'джумла@джpумлатест.bрфa' -``` - -### `punycode.toASCII(input)` - -Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII. - -```js -// encode domain names -punycode.toASCII('mañana.com'); -// → 'xn--maana-pta.com' -punycode.toASCII('☃-⌘.com'); -// → 'xn----dqo34k.com' - -// encode email addresses -punycode.toASCII('джумла@джpумлатест.bрфa'); -// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' -``` - -### `punycode.ucs2` - -#### `punycode.ucs2.decode(string)` - -Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. - -```js -punycode.ucs2.decode('abc'); -// → [0x61, 0x62, 0x63] -// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: -punycode.ucs2.decode('\uD834\uDF06'); -// → [0x1D306] -``` - -#### `punycode.ucs2.encode(codePoints)` - -Creates a string based on an array of numeric code point values. - -```js -punycode.ucs2.encode([0x61, 0x62, 0x63]); -// → 'abc' -punycode.ucs2.encode([0x1D306]); -// → '\uD834\uDF06' -``` - -### `punycode.version` - -A string representing the current Punycode.js version number. - -## Author - -| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | -|---| -| [Mathias Bynens](https://mathiasbynens.be/) | - -## License - -Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/punycode/package.json b/node_modules/punycode/package.json deleted file mode 100644 index 9d0790b2a..000000000 --- a/node_modules/punycode/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "punycode", - "version": "2.3.0", - "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", - "homepage": "https://mths.be/punycode", - "main": "punycode.js", - "jsnext:main": "punycode.es6.js", - "module": "punycode.es6.js", - "engines": { - "node": ">=6" - }, - "keywords": [ - "punycode", - "unicode", - "idn", - "idna", - "dns", - "url", - "domain" - ], - "license": "MIT", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "contributors": [ - { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/mathiasbynens/punycode.js.git" - }, - "bugs": "https://github.com/mathiasbynens/punycode.js/issues", - "files": [ - "LICENSE-MIT.txt", - "punycode.js", - "punycode.es6.js" - ], - "scripts": { - "test": "mocha tests", - "build": "node scripts/prepublish.js" - }, - "devDependencies": { - "codecov": "^1.0.1", - "istanbul": "^0.4.1", - "mocha": "^10.2.0" - }, - "jspm": { - "map": { - "./punycode.js": { - "node": "@node/punycode" - } - } - } -} diff --git a/node_modules/punycode/punycode.es6.js b/node_modules/punycode/punycode.es6.js deleted file mode 100644 index 244e1bfbf..000000000 --- a/node_modules/punycode/punycode.es6.js +++ /dev/null @@ -1,444 +0,0 @@ -'use strict'; - -/** Highest positive signed 32-bit float value */ -const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - -/** Bootstring parameters */ -const base = 36; -const tMin = 1; -const tMax = 26; -const skew = 38; -const damp = 700; -const initialBias = 72; -const initialN = 128; // 0x80 -const delimiter = '-'; // '\x2D' - -/** Regular expressions */ -const regexPunycode = /^xn--/; -const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. -const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - -/** Error messages */ -const errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' -}; - -/** Convenience shortcuts */ -const baseMinusTMin = base - tMin; -const floor = Math.floor; -const stringFromCharCode = String.fromCharCode; - -/*--------------------------------------------------------------------------*/ - -/** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ -function error(type) { - throw new RangeError(errors[type]); -} - -/** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ -function map(array, callback) { - const result = []; - let length = array.length; - while (length--) { - result[length] = callback(array[length]); - } - return result; -} - -/** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {String} A new string of characters returned by the callback - * function. - */ -function mapDomain(domain, callback) { - const parts = domain.split('@'); - let result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - domain = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - domain = domain.replace(regexSeparators, '\x2E'); - const labels = domain.split('.'); - const encoded = map(labels, callback).join('.'); - return result + encoded; -} - -/** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ -function ucs2decode(string) { - const output = []; - let counter = 0; - const length = string.length; - while (counter < length) { - const value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // It's a high surrogate, and there is a next character. - const extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // It's an unmatched surrogate; only append this code unit, in case the - // next code unit is the high surrogate of a surrogate pair. - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; -} - -/** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ -const ucs2encode = codePoints => String.fromCodePoint(...codePoints); - -/** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ -const basicToDigit = function(codePoint) { - if (codePoint >= 0x30 && codePoint < 0x3A) { - return 26 + (codePoint - 0x30); - } - if (codePoint >= 0x41 && codePoint < 0x5B) { - return codePoint - 0x41; - } - if (codePoint >= 0x61 && codePoint < 0x7B) { - return codePoint - 0x61; - } - return base; -}; - -/** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ -const digitToBasic = function(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); -}; - -/** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ -const adapt = function(delta, numPoints, firstTime) { - let k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); -}; - -/** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ -const decode = function(input) { - // Don't use UCS-2. - const output = []; - const inputLength = input.length; - let i = 0; - let n = initialN; - let bias = initialBias; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - let basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (let j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - const oldi = i; - for (let w = 1, k = base; /* no condition */; k += base) { - - if (index >= inputLength) { - error('invalid-input'); - } - - const digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base) { - error('invalid-input'); - } - if (digit > floor((maxInt - i) / w)) { - error('overflow'); - } - - i += digit * w; - const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - - if (digit < t) { - break; - } - - const baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } - - w *= baseMinusT; - - } - - const out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } - - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output. - output.splice(i++, 0, n); - - } - - return String.fromCodePoint(...output); -}; - -/** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ -const encode = function(input) { - const output = []; - - // Convert the input in UCS-2 to an array of Unicode code points. - input = ucs2decode(input); - - // Cache the length. - const inputLength = input.length; - - // Initialize the state. - let n = initialN; - let delta = 0; - let bias = initialBias; - - // Handle the basic code points. - for (const currentValue of input) { - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } - - const basicLength = output.length; - let handledCPCount = basicLength; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string with a delimiter unless it's empty. - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - - // All non-basic code points < n have been handled already. Find the next - // larger one: - let m = maxInt; - for (const currentValue of input) { - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow. - const handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - for (const currentValue of input) { - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } - if (currentValue === n) { - // Represent delta as a generalized variable-length integer. - let q = delta; - for (let k = base; /* no condition */; k += base) { - const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - const qMinusT = q - t; - const baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); - delta = 0; - ++handledCPCount; - } - } - - ++delta; - ++n; - - } - return output.join(''); -}; - -/** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ -const toUnicode = function(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); -}; - -/** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ -const toASCII = function(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); -}; - -/*--------------------------------------------------------------------------*/ - -/** Define the public API */ -const punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '2.1.0', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode -}; - -export { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode }; -export default punycode; diff --git a/node_modules/punycode/punycode.js b/node_modules/punycode/punycode.js deleted file mode 100644 index 752b98a9f..000000000 --- a/node_modules/punycode/punycode.js +++ /dev/null @@ -1,443 +0,0 @@ -'use strict'; - -/** Highest positive signed 32-bit float value */ -const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - -/** Bootstring parameters */ -const base = 36; -const tMin = 1; -const tMax = 26; -const skew = 38; -const damp = 700; -const initialBias = 72; -const initialN = 128; // 0x80 -const delimiter = '-'; // '\x2D' - -/** Regular expressions */ -const regexPunycode = /^xn--/; -const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. -const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - -/** Error messages */ -const errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' -}; - -/** Convenience shortcuts */ -const baseMinusTMin = base - tMin; -const floor = Math.floor; -const stringFromCharCode = String.fromCharCode; - -/*--------------------------------------------------------------------------*/ - -/** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ -function error(type) { - throw new RangeError(errors[type]); -} - -/** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ -function map(array, callback) { - const result = []; - let length = array.length; - while (length--) { - result[length] = callback(array[length]); - } - return result; -} - -/** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {String} A new string of characters returned by the callback - * function. - */ -function mapDomain(domain, callback) { - const parts = domain.split('@'); - let result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - domain = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - domain = domain.replace(regexSeparators, '\x2E'); - const labels = domain.split('.'); - const encoded = map(labels, callback).join('.'); - return result + encoded; -} - -/** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ -function ucs2decode(string) { - const output = []; - let counter = 0; - const length = string.length; - while (counter < length) { - const value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // It's a high surrogate, and there is a next character. - const extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // It's an unmatched surrogate; only append this code unit, in case the - // next code unit is the high surrogate of a surrogate pair. - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; -} - -/** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ -const ucs2encode = codePoints => String.fromCodePoint(...codePoints); - -/** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ -const basicToDigit = function(codePoint) { - if (codePoint >= 0x30 && codePoint < 0x3A) { - return 26 + (codePoint - 0x30); - } - if (codePoint >= 0x41 && codePoint < 0x5B) { - return codePoint - 0x41; - } - if (codePoint >= 0x61 && codePoint < 0x7B) { - return codePoint - 0x61; - } - return base; -}; - -/** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ -const digitToBasic = function(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); -}; - -/** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ -const adapt = function(delta, numPoints, firstTime) { - let k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); -}; - -/** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ -const decode = function(input) { - // Don't use UCS-2. - const output = []; - const inputLength = input.length; - let i = 0; - let n = initialN; - let bias = initialBias; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - let basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (let j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - const oldi = i; - for (let w = 1, k = base; /* no condition */; k += base) { - - if (index >= inputLength) { - error('invalid-input'); - } - - const digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base) { - error('invalid-input'); - } - if (digit > floor((maxInt - i) / w)) { - error('overflow'); - } - - i += digit * w; - const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - - if (digit < t) { - break; - } - - const baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } - - w *= baseMinusT; - - } - - const out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } - - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output. - output.splice(i++, 0, n); - - } - - return String.fromCodePoint(...output); -}; - -/** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ -const encode = function(input) { - const output = []; - - // Convert the input in UCS-2 to an array of Unicode code points. - input = ucs2decode(input); - - // Cache the length. - const inputLength = input.length; - - // Initialize the state. - let n = initialN; - let delta = 0; - let bias = initialBias; - - // Handle the basic code points. - for (const currentValue of input) { - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } - - const basicLength = output.length; - let handledCPCount = basicLength; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string with a delimiter unless it's empty. - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - - // All non-basic code points < n have been handled already. Find the next - // larger one: - let m = maxInt; - for (const currentValue of input) { - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow. - const handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - for (const currentValue of input) { - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } - if (currentValue === n) { - // Represent delta as a generalized variable-length integer. - let q = delta; - for (let k = base; /* no condition */; k += base) { - const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - const qMinusT = q - t; - const baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); - delta = 0; - ++handledCPCount; - } - } - - ++delta; - ++n; - - } - return output.join(''); -}; - -/** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ -const toUnicode = function(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); -}; - -/** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ -const toASCII = function(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); -}; - -/*--------------------------------------------------------------------------*/ - -/** Define the public API */ -const punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '2.1.0', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode -}; - -module.exports = punycode; diff --git a/node_modules/queue-microtask/LICENSE b/node_modules/queue-microtask/LICENSE deleted file mode 100755 index c7e685275..000000000 --- a/node_modules/queue-microtask/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/queue-microtask/README.md b/node_modules/queue-microtask/README.md deleted file mode 100644 index 0be05a64f..000000000 --- a/node_modules/queue-microtask/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# queue-microtask [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] - -[ci-image]: https://img.shields.io/github/workflow/status/feross/queue-microtask/ci/master -[ci-url]: https://github.com/feross/queue-microtask/actions -[npm-image]: https://img.shields.io/npm/v/queue-microtask.svg -[npm-url]: https://npmjs.org/package/queue-microtask -[downloads-image]: https://img.shields.io/npm/dm/queue-microtask.svg -[downloads-url]: https://npmjs.org/package/queue-microtask -[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg -[standard-url]: https://standardjs.com - -### fast, tiny [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) shim for modern engines - -- Use [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) in all modern JS engines. -- No dependencies. Less than 10 lines. No shims or complicated fallbacks. -- Optimal performance in all modern environments - - Uses `queueMicrotask` in modern environments - - Fallback to `Promise.resolve().then(fn)` in Node.js 10 and earlier, and old browsers (same performance as `queueMicrotask`) - -## install - -``` -npm install queue-microtask -``` - -## usage - -```js -const queueMicrotask = require('queue-microtask') - -queueMicrotask(() => { /* this will run soon */ }) -``` - -## What is `queueMicrotask` and why would one use it? - -The `queueMicrotask` function is a WHATWG standard. It queues a microtask to be executed prior to control returning to the event loop. - -A microtask is a short function which will run after the current task has completed its work and when there is no other code waiting to be run before control of the execution context is returned to the event loop. - -The code `queueMicrotask(fn)` is equivalent to the code `Promise.resolve().then(fn)`. It is also very similar to [`process.nextTick(fn)`](https://nodejs.org/api/process.html#process_process_nexttick_callback_args) in Node. - -Using microtasks lets code run without interfering with any other, potentially higher priority, code that is pending, but before the JS engine regains control over the execution context. - -See the [spec](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#microtask-queuing) or [Node documentation](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback) for more information. - -## Who is this package for? - -This package allows you to use `queueMicrotask` safely in all modern JS engines. Use it if you prioritize small JS bundle size over support for old browsers. - -If you just need to support Node 12 and later, use `queueMicrotask` directly. If you need to support all versions of Node, use this package. - -## Why not use `process.nextTick`? - -In Node, `queueMicrotask` and `process.nextTick` are [essentially equivalent](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback), though there are [subtle differences](https://github.com/YuzuJS/setImmediate#macrotasks-and-microtasks) that don't matter in most situations. - -You can think of `queueMicrotask` as a standardized version of `process.nextTick` that works in the browser. No need to rely on your browser bundler to shim `process` for the browser environment. - -## Why not use `setTimeout(fn, 0)`? - -This approach is the most compatible, but it has problems. Modern browsers throttle timers severely, so `setTimeout(…, 0)` usually takes at least 4ms to run. Furthermore, the throttling gets even worse if the page is backgrounded. If you have many `setTimeout` calls, then this can severely limit the performance of your program. - -## Why not use a microtask library like [`immediate`](https://www.npmjs.com/package/immediate) or [`asap`](https://www.npmjs.com/package/asap)? - -These packages are great! However, if you prioritize small JS bundle size over optimal performance in old browsers then you may want to consider this package. - -This package (`queue-microtask`) is four times smaller than `immediate`, twice as small as `asap`, and twice as small as using `process.nextTick` and letting the browser bundler shim it automatically. - -Note: This package throws an exception in JS environments which lack `Promise` support -- which are usually very old browsers and Node.js versions. - -Since the `queueMicrotask` API is supported in Node.js, Chrome, Firefox, Safari, Opera, and Edge, **the vast majority of users will get optimal performance**. Any JS environment with `Promise`, which is almost all of them, also get optimal performance. If you need support for JS environments which lack `Promise` support, use one of the alternative packages. - -## What is a shim? - -> In computer programming, a shim is a library that transparently intercepts API calls and changes the arguments passed, handles the operation itself or redirects the operation elsewhere. – [Wikipedia](https://en.wikipedia.org/wiki/Shim_(computing)) - -This package could also be described as a "ponyfill". - -> A ponyfill is almost the same as a polyfill, but not quite. Instead of patching functionality for older browsers, a ponyfill provides that functionality as a standalone module you can use. – [PonyFoo](https://ponyfoo.com/articles/polyfills-or-ponyfills) - -## API - -### `queueMicrotask(fn)` - -The `queueMicrotask()` method queues a microtask. - -The `fn` argument is a function to be executed after all pending tasks have completed but before yielding control to the browser's event loop. - -## license - -MIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org). diff --git a/node_modules/queue-microtask/index.d.ts b/node_modules/queue-microtask/index.d.ts deleted file mode 100644 index b6a864632..000000000 --- a/node_modules/queue-microtask/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const queueMicrotask: (cb: () => void) => void -export = queueMicrotask diff --git a/node_modules/queue-microtask/index.js b/node_modules/queue-microtask/index.js deleted file mode 100644 index 55605343a..000000000 --- a/node_modules/queue-microtask/index.js +++ /dev/null @@ -1,9 +0,0 @@ -/*! queue-microtask. MIT License. Feross Aboukhadijeh */ -let promise - -module.exports = typeof queueMicrotask === 'function' - ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global) - // reuse resolved promise, and allocate it lazily - : cb => (promise || (promise = Promise.resolve())) - .then(cb) - .catch(err => setTimeout(() => { throw err }, 0)) diff --git a/node_modules/queue-microtask/package.json b/node_modules/queue-microtask/package.json deleted file mode 100644 index d29a401f5..000000000 --- a/node_modules/queue-microtask/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "queue-microtask", - "description": "fast, tiny `queueMicrotask` shim for modern engines", - "version": "1.2.3", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "https://feross.org" - }, - "bugs": { - "url": "https://github.com/feross/queue-microtask/issues" - }, - "devDependencies": { - "standard": "*", - "tape": "^5.2.2" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "homepage": "https://github.com/feross/queue-microtask", - "keywords": [ - "asap", - "immediate", - "micro task", - "microtask", - "nextTick", - "process.nextTick", - "queue micro task", - "queue microtask", - "queue-microtask", - "queueMicrotask", - "setImmediate", - "task" - ], - "license": "MIT", - "main": "index.js", - "repository": { - "type": "git", - "url": "git://github.com/feross/queue-microtask.git" - }, - "scripts": { - "test": "standard && tape test/*.js" - } -} diff --git a/node_modules/quick-lru/index.d.ts b/node_modules/quick-lru/index.d.ts deleted file mode 100644 index fa58889b4..000000000 --- a/node_modules/quick-lru/index.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -declare namespace QuickLRU { - interface Options { - /** - The maximum number of items before evicting the least recently used items. - */ - readonly maxSize: number; - - /** - Called right before an item is evicted from the cache. - - Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`). - */ - onEviction?: (key: KeyType, value: ValueType) => void; - } -} - -declare class QuickLRU - implements Iterable<[KeyType, ValueType]> { - /** - The stored item count. - */ - readonly size: number; - - /** - Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29). - - The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop. - - @example - ``` - import QuickLRU = require('quick-lru'); - - const lru = new QuickLRU({maxSize: 1000}); - - lru.set('🦄', '🌈'); - - lru.has('🦄'); - //=> true - - lru.get('🦄'); - //=> '🌈' - ``` - */ - constructor(options: QuickLRU.Options); - - [Symbol.iterator](): IterableIterator<[KeyType, ValueType]>; - - /** - Set an item. - - @returns The list instance. - */ - set(key: KeyType, value: ValueType): this; - - /** - Get an item. - - @returns The stored item or `undefined`. - */ - get(key: KeyType): ValueType | undefined; - - /** - Check if an item exists. - */ - has(key: KeyType): boolean; - - /** - Get an item without marking it as recently used. - - @returns The stored item or `undefined`. - */ - peek(key: KeyType): ValueType | undefined; - - /** - Delete an item. - - @returns `true` if the item is removed or `false` if the item doesn't exist. - */ - delete(key: KeyType): boolean; - - /** - Delete all items. - */ - clear(): void; - - /** - Iterable for all the keys. - */ - keys(): IterableIterator; - - /** - Iterable for all the values. - */ - values(): IterableIterator; -} - -export = QuickLRU; diff --git a/node_modules/quick-lru/index.js b/node_modules/quick-lru/index.js deleted file mode 100644 index 7d7032e6a..000000000 --- a/node_modules/quick-lru/index.js +++ /dev/null @@ -1,123 +0,0 @@ -'use strict'; - -class QuickLRU { - constructor(options = {}) { - if (!(options.maxSize && options.maxSize > 0)) { - throw new TypeError('`maxSize` must be a number greater than 0'); - } - - this.maxSize = options.maxSize; - this.onEviction = options.onEviction; - this.cache = new Map(); - this.oldCache = new Map(); - this._size = 0; - } - - _set(key, value) { - this.cache.set(key, value); - this._size++; - - if (this._size >= this.maxSize) { - this._size = 0; - - if (typeof this.onEviction === 'function') { - for (const [key, value] of this.oldCache.entries()) { - this.onEviction(key, value); - } - } - - this.oldCache = this.cache; - this.cache = new Map(); - } - } - - get(key) { - if (this.cache.has(key)) { - return this.cache.get(key); - } - - if (this.oldCache.has(key)) { - const value = this.oldCache.get(key); - this.oldCache.delete(key); - this._set(key, value); - return value; - } - } - - set(key, value) { - if (this.cache.has(key)) { - this.cache.set(key, value); - } else { - this._set(key, value); - } - - return this; - } - - has(key) { - return this.cache.has(key) || this.oldCache.has(key); - } - - peek(key) { - if (this.cache.has(key)) { - return this.cache.get(key); - } - - if (this.oldCache.has(key)) { - return this.oldCache.get(key); - } - } - - delete(key) { - const deleted = this.cache.delete(key); - if (deleted) { - this._size--; - } - - return this.oldCache.delete(key) || deleted; - } - - clear() { - this.cache.clear(); - this.oldCache.clear(); - this._size = 0; - } - - * keys() { - for (const [key] of this) { - yield key; - } - } - - * values() { - for (const [, value] of this) { - yield value; - } - } - - * [Symbol.iterator]() { - for (const item of this.cache) { - yield item; - } - - for (const item of this.oldCache) { - const [key] = item; - if (!this.cache.has(key)) { - yield item; - } - } - } - - get size() { - let oldCacheSize = 0; - for (const key of this.oldCache.keys()) { - if (!this.cache.has(key)) { - oldCacheSize++; - } - } - - return Math.min(this._size + oldCacheSize, this.maxSize); - } -} - -module.exports = QuickLRU; diff --git a/node_modules/quick-lru/license b/node_modules/quick-lru/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/quick-lru/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/quick-lru/package.json b/node_modules/quick-lru/package.json deleted file mode 100644 index ff0dd9a14..000000000 --- a/node_modules/quick-lru/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "quick-lru", - "version": "5.1.1", - "description": "Simple “Least Recently Used” (LRU) cache", - "license": "MIT", - "repository": "sindresorhus/quick-lru", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && nyc ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "lru", - "quick", - "cache", - "caching", - "least", - "recently", - "used", - "fast", - "map", - "hash", - "buffer" - ], - "devDependencies": { - "ava": "^2.0.0", - "coveralls": "^3.0.3", - "nyc": "^15.0.0", - "tsd": "^0.11.0", - "xo": "^0.26.0" - } -} diff --git a/node_modules/quick-lru/readme.md b/node_modules/quick-lru/readme.md deleted file mode 100644 index 234294a09..000000000 --- a/node_modules/quick-lru/readme.md +++ /dev/null @@ -1,111 +0,0 @@ -# quick-lru [![Build Status](https://travis-ci.org/sindresorhus/quick-lru.svg?branch=master)](https://travis-ci.org/sindresorhus/quick-lru) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/quick-lru/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/quick-lru?branch=master) - -> Simple [“Least Recently Used” (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29) - -Useful when you need to cache something and limit memory usage. - -Inspired by the [`hashlru` algorithm](https://github.com/dominictarr/hashlru#algorithm), but instead uses [`Map`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) to support keys of any type, not just strings, and values can be `undefined`. - -## Install - -``` -$ npm install quick-lru -``` - -## Usage - -```js -const QuickLRU = require('quick-lru'); - -const lru = new QuickLRU({maxSize: 1000}); - -lru.set('🦄', '🌈'); - -lru.has('🦄'); -//=> true - -lru.get('🦄'); -//=> '🌈' -``` - -## API - -### new QuickLRU(options?) - -Returns a new instance. - -### options - -Type: `object` - -#### maxSize - -*Required*\ -Type: `number` - -The maximum number of items before evicting the least recently used items. - -#### onEviction - -*Optional*\ -Type: `(key, value) => void` - -Called right before an item is evicted from the cache. - -Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`). - -### Instance - -The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop. - -Both `key` and `value` can be of any type. - -#### .set(key, value) - -Set an item. Returns the instance. - -#### .get(key) - -Get an item. - -#### .has(key) - -Check if an item exists. - -#### .peek(key) - -Get an item without marking it as recently used. - -#### .delete(key) - -Delete an item. - -Returns `true` if the item is removed or `false` if the item doesn't exist. - -#### .clear() - -Delete all items. - -#### .keys() - -Iterable for all the keys. - -#### .values() - -Iterable for all the values. - -#### .size - -The stored item count. - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/read-pkg-up/index.d.ts b/node_modules/read-pkg-up/index.d.ts deleted file mode 100644 index 43886dc82..000000000 --- a/node_modules/read-pkg-up/index.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -import {Except} from 'type-fest'; -import {readPackageAsync, readPackageSync, Options as ReadPackageOptions, NormalizeOptions as ReadPackageNormalizeOptions, PackageJson, NormalizedPackageJson} from 'read-pkg'; - -export type Options = { - /** - Directory to start looking for a package.json file. - - @default process.cwd() - */ - cwd?: string; -} & Except; - -export type NormalizeOptions = { - /** - Directory to start looking for a package.json file. - - @default process.cwd() - */ - cwd?: string; -} & Except; - -export interface ReadResult { - packageJson: PackageJson; - path: string; -} - -export interface NormalizedReadResult { - packageJson: NormalizedPackageJson; - path: string; -} - -export { - PackageJson, - NormalizedPackageJson -}; - -/** -Read the closest `package.json` file. - -@example -``` -import {readPackageUpAsync} from 'read-pkg-up'; - -console.log(await readPackageUpAsync()); -// { -// packageJson: { -// name: 'awesome-package', -// version: '1.0.0', -// … -// }, -// path: '/Users/sindresorhus/dev/awesome-package/package.json' -// } -``` -*/ -export function readPackageUpAsync(options?: NormalizeOptions): Promise; -export function readPackageUpAsync(options: Options): Promise; - -/** -Synchronously read the closest `package.json` file. - -@example -``` -import {readPackageUpSync} from 'read-pkg-up'; - -console.log(readPackageUpSync()); -// { -// packageJson: { -// name: 'awesome-package', -// version: '1.0.0', -// … -// }, -// path: '/Users/sindresorhus/dev/awesome-package/package.json' -// } -``` -*/ -export function readPackageUpSync(options?: NormalizeOptions): NormalizedReadResult | undefined; -export function readPackageUpSync(options: Options): ReadResult | undefined; diff --git a/node_modules/read-pkg-up/index.js b/node_modules/read-pkg-up/index.js deleted file mode 100644 index e8181da81..000000000 --- a/node_modules/read-pkg-up/index.js +++ /dev/null @@ -1,27 +0,0 @@ -import path from 'path'; -import findUp from 'find-up'; -import {readPackageAsync, readPackageSync} from 'read-pkg'; - -export async function readPackageUpAsync(options) { - const filePath = await findUp('package.json', options); - if (!filePath) { - return; - } - - return { - packageJson: await readPackageAsync({...options, cwd: path.dirname(filePath)}), - path: filePath - }; -} - -export function readPackageUpSync(options) { - const filePath = findUp.sync('package.json', options); - if (!filePath) { - return; - } - - return { - packageJson: readPackageSync({...options, cwd: path.dirname(filePath)}), - path: filePath - }; -} diff --git a/node_modules/read-pkg-up/license b/node_modules/read-pkg-up/license deleted file mode 100644 index fa7ceba3e..000000000 --- a/node_modules/read-pkg-up/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/read-pkg-up/package.json b/node_modules/read-pkg-up/package.json deleted file mode 100644 index 5693d71ef..000000000 --- a/node_modules/read-pkg-up/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "read-pkg-up", - "version": "8.0.0", - "description": "Read the closest package.json file", - "license": "MIT", - "repository": "sindresorhus/read-pkg-up", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "type": "module", - "exports": "./index.js", - "engines": { - "node": ">=12" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "json", - "read", - "parse", - "file", - "fs", - "graceful", - "load", - "package", - "find", - "up", - "find-up", - "findup", - "look-up", - "look", - "search", - "match", - "resolve", - "parent", - "parents", - "folder", - "directory", - "walk", - "walking", - "path" - ], - "dependencies": { - "find-up": "^5.0.0", - "read-pkg": "^6.0.0", - "type-fest": "^1.0.1" - }, - "devDependencies": { - "ava": "^3.15.0", - "tsd": "^0.14.0", - "xo": "^0.38.2" - } -} diff --git a/node_modules/read-pkg-up/readme.md b/node_modules/read-pkg-up/readme.md deleted file mode 100644 index 8df9c22c3..000000000 --- a/node_modules/read-pkg-up/readme.md +++ /dev/null @@ -1,74 +0,0 @@ -# read-pkg-up - -> Read the closest package.json file - -## Why - -- [Finds the closest package.json](https://github.com/sindresorhus/find-up) -- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json) -- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) - -## Install - -``` -$ npm install read-pkg-up -``` - -## Usage - -```js -import {readPackageUpAsync} from 'read-pkg-up'; - -console.log(await readPackageUpAsync()); -/* -{ - packageJson: { - name: 'awesome-package', - version: '1.0.0', - … - }, - path: '/Users/sindresorhus/dev/awesome-package/package.json' -} -*/ -``` - -## API - -### readPackageUpAsync(options?) - -Returns a `Promise` or `Promise` if no `package.json` was found. - -### readPackageUpSync(options?) - -Returns the result object or `undefined` if no `package.json` was found. - -#### options - -Type: `object` - -##### cwd - -Type: `string`\ -Default: `process.cwd()` - -Directory to start looking for a package.json file. - -##### normalize - -Type: `boolean`\ -Default: `true` - -[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data. - -## read-pkg-up for enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of read-pkg-up and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-read-pkg-up?utm_source=npm-read-pkg-up&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - -## Related - -- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file -- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file -- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories -- [pkg-conf](https://github.com/sindresorhus/pkg-conf) - Get namespaced config from the closest package.json diff --git a/node_modules/read-pkg/index.d.ts b/node_modules/read-pkg/index.d.ts deleted file mode 100644 index 75e093cf9..000000000 --- a/node_modules/read-pkg/index.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import * as typeFest from 'type-fest'; -import * as normalize from 'normalize-package-data'; - -export interface Options { - /** - Current working directory. - - @default process.cwd() - */ - readonly cwd?: string; - - /** - [Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data. - - @default true - */ - readonly normalize?: boolean; -} - -export interface NormalizeOptions extends Options { - readonly normalize?: true; -} - -export type NormalizedPackageJson = PackageJson & normalize.Package; -export type PackageJson = typeFest.PackageJson; - -/** -@returns The parsed JSON. - -@example -``` -import {readPackageAsync} from 'read-pkg'; - -console.log(await readPackageAsync()); -//=> {name: 'read-pkg', …} - -console.log(await readPackageAsync({cwd: 'some-other-directory'}); -//=> {name: 'unicorn', …} -``` -*/ -export function readPackageAsync(options?: NormalizeOptions): Promise; -export function readPackageAsync(options: Options): Promise; - -/** -@returns The parsed JSON. - -@example -``` -import {readPackageSync} from 'read-pkg'; - -console.log(readPackageSync()); -//=> {name: 'read-pkg', …} - -console.log(readPackageSync({cwd: 'some-other-directory'}); -//=> {name: 'unicorn', …} -``` -*/ -export function readPackageSync(options?: NormalizeOptions): NormalizedPackageJson; -export function readPackageSync(options: Options): PackageJson; diff --git a/node_modules/read-pkg/index.js b/node_modules/read-pkg/index.js deleted file mode 100644 index d58bc28b1..000000000 --- a/node_modules/read-pkg/index.js +++ /dev/null @@ -1,26 +0,0 @@ -import fs, {promises as fsAsync} from 'fs'; -import path from 'path'; -import parseJson from 'parse-json'; -import normalizePackageData from 'normalize-package-data'; - -export async function readPackageAsync({cwd = process.cwd(), normalize = true} = {}) { - const filePath = path.resolve(cwd, 'package.json'); - const json = parseJson(await fsAsync.readFile(filePath, 'utf8')); - - if (normalize) { - normalizePackageData(json); - } - - return json; -} - -export function readPackageSync({cwd = process.cwd(), normalize = true} = {}) { - const filePath = path.resolve(cwd, 'package.json'); - const json = parseJson(fs.readFileSync(filePath, 'utf8')); - - if (normalize) { - normalizePackageData(json); - } - - return json; -} diff --git a/node_modules/read-pkg/license b/node_modules/read-pkg/license deleted file mode 100644 index fa7ceba3e..000000000 --- a/node_modules/read-pkg/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/read-pkg/package.json b/node_modules/read-pkg/package.json deleted file mode 100644 index 54a93b8b7..000000000 --- a/node_modules/read-pkg/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "read-pkg", - "version": "6.0.0", - "description": "Read a package.json file", - "license": "MIT", - "repository": "sindresorhus/read-pkg", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "type": "module", - "exports": "./index.js", - "engines": { - "node": ">=12" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "json", - "read", - "parse", - "file", - "fs", - "graceful", - "load", - "package", - "normalize" - ], - "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^3.0.2", - "parse-json": "^5.2.0", - "type-fest": "^1.0.1" - }, - "devDependencies": { - "ava": "^3.15.0", - "tsd": "^0.14.0", - "xo": "^0.38.2" - }, - "xo": { - "ignores": [ - "test/test.js" - ] - } -} diff --git a/node_modules/read-pkg/readme.md b/node_modules/read-pkg/readme.md deleted file mode 100644 index eda793bae..000000000 --- a/node_modules/read-pkg/readme.md +++ /dev/null @@ -1,72 +0,0 @@ -# read-pkg - -> Read a package.json file - -## Why - -- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json) -- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) - -## Install - -``` -$ npm install read-pkg -``` - -## Usage - -```js -import {readPackageAsync} from 'read-pkg'; - -console.log(await readPkg()); -//=> {name: 'read-pkg', …} - -console.log(await readPkg({cwd: 'some-other-directory'})); -//=> {name: 'unicorn', …} -``` - -## API - -### readPackageAsync(options?) - -Returns a `Promise` with the parsed JSON. - -### readPackageSync(options?) - -Returns the parsed JSON. - -#### options - -Type: `object` - -##### cwd - -Type: `string`\ -Default: `process.cwd()` - -Current working directory. - -##### normalize - -Type: `boolean`\ -Default: `true` - -[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data. - -## Related - -- [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file -- [write-pkg](https://github.com/sindresorhus/write-pkg) - Write a `package.json` file -- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/redent/index.d.ts b/node_modules/redent/index.d.ts deleted file mode 100644 index df1656ec8..000000000 --- a/node_modules/redent/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import {Options} from 'indent-string'; - -/** -[Strip redundant indentation](https://github.com/sindresorhus/strip-indent) and [indent the string](https://github.com/sindresorhus/indent-string). - -@param string - The string to normalize indentation. -@param count - How many times you want `options.indent` repeated. Default: `0`. - -@example -``` -import redent from 'redent'; - -redent('\n foo\n bar\n', 1); -//=> '\n foo\n bar\n' -``` -*/ -export default function redent( - string: string, - count?: number, - options?: Options -): string; - -export {Options}; diff --git a/node_modules/redent/index.js b/node_modules/redent/index.js deleted file mode 100644 index aa5d81443..000000000 --- a/node_modules/redent/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import stripIndent from 'strip-indent'; -import indentString from 'indent-string'; - -export default function redent(string, count = 0, options = {}) { - return indentString(stripIndent(string), count, options); -} diff --git a/node_modules/redent/license b/node_modules/redent/license deleted file mode 100644 index fa7ceba3e..000000000 --- a/node_modules/redent/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/redent/package.json b/node_modules/redent/package.json deleted file mode 100644 index 8c93fdfea..000000000 --- a/node_modules/redent/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "redent", - "version": "4.0.0", - "description": "Strip redundant indentation and indent the string", - "license": "MIT", - "repository": "sindresorhus/redent", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "type": "module", - "exports": "./index.js", - "engines": { - "node": ">=12" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "string", - "strip", - "trim", - "indent", - "indentation", - "add", - "reindent", - "normalize", - "remove", - "whitespace", - "space" - ], - "dependencies": { - "indent-string": "^5.0.0", - "strip-indent": "^4.0.0" - }, - "devDependencies": { - "ava": "^3.15.0", - "tsd": "^0.14.0", - "xo": "^0.39.1" - } -} diff --git a/node_modules/redent/readme.md b/node_modules/redent/readme.md deleted file mode 100644 index f9da974d6..000000000 --- a/node_modules/redent/readme.md +++ /dev/null @@ -1,65 +0,0 @@ -# redent - -> [Strip redundant indentation](https://github.com/sindresorhus/strip-indent) and [indent the string](https://github.com/sindresorhus/indent-string) - -## Install - -``` -$ npm install redent -``` - -## Usage - -```js -import redent from 'redent'; - -redent('\n foo\n bar\n', 1); -//=> '\n foo\n bar\n' -``` - -## API - -### redent(string, count?, options?) - -#### string - -Type: `string` - -The string to normalize indentation. - -#### count - -Type: `number`\ -Default: `0` - -How many times you want `options.indent` repeated. - -#### options - -Type: `object` - -##### indent - -Type: `string`\ -Default: `' '` - -The string to use for the indent. - -##### includeEmptyLines - -Type: `boolean`\ -Default: `false` - -Also indent empty lines. - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/require-from-string/index.js b/node_modules/require-from-string/index.js deleted file mode 100644 index cb5595fde..000000000 --- a/node_modules/require-from-string/index.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var Module = require('module'); -var path = require('path'); - -module.exports = function requireFromString(code, filename, opts) { - if (typeof filename === 'object') { - opts = filename; - filename = undefined; - } - - opts = opts || {}; - filename = filename || ''; - - opts.appendPaths = opts.appendPaths || []; - opts.prependPaths = opts.prependPaths || []; - - if (typeof code !== 'string') { - throw new Error('code must be a string, not ' + typeof code); - } - - var paths = Module._nodeModulePaths(path.dirname(filename)); - - var parent = module.parent; - var m = new Module(filename, parent); - m.filename = filename; - m.paths = [].concat(opts.prependPaths).concat(paths).concat(opts.appendPaths); - m._compile(code, filename); - - var exports = m.exports; - parent && parent.children && parent.children.splice(parent.children.indexOf(m), 1); - - return exports; -}; diff --git a/node_modules/require-from-string/license b/node_modules/require-from-string/license deleted file mode 100644 index 1aeb74fd2..000000000 --- a/node_modules/require-from-string/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/require-from-string/package.json b/node_modules/require-from-string/package.json deleted file mode 100644 index 800d46efc..000000000 --- a/node_modules/require-from-string/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "require-from-string", - "version": "2.0.2", - "description": "Require module from string", - "license": "MIT", - "repository": "floatdrop/require-from-string", - "author": { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com", - "url": "github.com/floatdrop" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "files": [ - "index.js" - ], - "keywords": [ - "" - ], - "dependencies": {}, - "devDependencies": { - "mocha": "*" - } -} diff --git a/node_modules/require-from-string/readme.md b/node_modules/require-from-string/readme.md deleted file mode 100644 index 88b3236f8..000000000 --- a/node_modules/require-from-string/readme.md +++ /dev/null @@ -1,56 +0,0 @@ -# require-from-string [![Build Status](https://travis-ci.org/floatdrop/require-from-string.svg?branch=master)](https://travis-ci.org/floatdrop/require-from-string) - -Load module from string in Node. - -## Install - -``` -$ npm install --save require-from-string -``` - - -## Usage - -```js -var requireFromString = require('require-from-string'); - -requireFromString('module.exports = 1'); -//=> 1 -``` - - -## API - -### requireFromString(code, [filename], [options]) - -#### code - -*Required* -Type: `string` - -Module code. - -#### filename -Type: `string` -Default: `''` - -Optional filename. - - -#### options -Type: `object` - -##### appendPaths -Type: `Array` - -List of `paths`, that will be appended to module `paths`. Useful, when you want -to be able require modules from these paths. - -##### prependPaths -Type: `Array` - -Same as `appendPaths`, but paths will be prepended. - -## License - -MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/node_modules/resolve-from/index.d.ts b/node_modules/resolve-from/index.d.ts deleted file mode 100644 index dd5f5ef61..000000000 --- a/node_modules/resolve-from/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -declare const resolveFrom: { - /** - Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path. - - @param fromDirectory - Directory to resolve from. - @param moduleId - What you would use in `require()`. - @returns Resolved module path. Throws when the module can't be found. - - @example - ``` - import resolveFrom = require('resolve-from'); - - // There is a file at `./foo/bar.js` - - resolveFrom('foo', './bar'); - //=> '/Users/sindresorhus/dev/test/foo/bar.js' - ``` - */ - (fromDirectory: string, moduleId: string): string; - - /** - Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path. - - @param fromDirectory - Directory to resolve from. - @param moduleId - What you would use in `require()`. - @returns Resolved module path or `undefined` when the module can't be found. - */ - silent(fromDirectory: string, moduleId: string): string | undefined; -}; - -export = resolveFrom; diff --git a/node_modules/resolve-from/index.js b/node_modules/resolve-from/index.js deleted file mode 100644 index 44f291c1f..000000000 --- a/node_modules/resolve-from/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; -const path = require('path'); -const Module = require('module'); -const fs = require('fs'); - -const resolveFrom = (fromDirectory, moduleId, silent) => { - if (typeof fromDirectory !== 'string') { - throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``); - } - - if (typeof moduleId !== 'string') { - throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); - } - - try { - fromDirectory = fs.realpathSync(fromDirectory); - } catch (error) { - if (error.code === 'ENOENT') { - fromDirectory = path.resolve(fromDirectory); - } else if (silent) { - return; - } else { - throw error; - } - } - - const fromFile = path.join(fromDirectory, 'noop.js'); - - const resolveFileName = () => Module._resolveFilename(moduleId, { - id: fromFile, - filename: fromFile, - paths: Module._nodeModulePaths(fromDirectory) - }); - - if (silent) { - try { - return resolveFileName(); - } catch (error) { - return; - } - } - - return resolveFileName(); -}; - -module.exports = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId); -module.exports.silent = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId, true); diff --git a/node_modules/resolve-from/license b/node_modules/resolve-from/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/resolve-from/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/resolve-from/package.json b/node_modules/resolve-from/package.json deleted file mode 100644 index 733df1627..000000000 --- a/node_modules/resolve-from/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "resolve-from", - "version": "5.0.0", - "description": "Resolve the path of a module like `require.resolve()` but from a given path", - "license": "MIT", - "repository": "sindresorhus/resolve-from", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "require", - "resolve", - "path", - "module", - "from", - "like", - "import" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/resolve-from/readme.md b/node_modules/resolve-from/readme.md deleted file mode 100644 index fd4f46f94..000000000 --- a/node_modules/resolve-from/readme.md +++ /dev/null @@ -1,72 +0,0 @@ -# resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from) - -> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path - - -## Install - -``` -$ npm install resolve-from -``` - - -## Usage - -```js -const resolveFrom = require('resolve-from'); - -// There is a file at `./foo/bar.js` - -resolveFrom('foo', './bar'); -//=> '/Users/sindresorhus/dev/test/foo/bar.js' -``` - - -## API - -### resolveFrom(fromDirectory, moduleId) - -Like `require()`, throws when the module can't be found. - -### resolveFrom.silent(fromDirectory, moduleId) - -Returns `undefined` instead of throwing when the module can't be found. - -#### fromDirectory - -Type: `string` - -Directory to resolve from. - -#### moduleId - -Type: `string` - -What you would use in `require()`. - - -## Tip - -Create a partial using a bound function if you want to resolve from the same `fromDirectory` multiple times: - -```js -const resolveFromFoo = resolveFrom.bind(null, 'foo'); - -resolveFromFoo('./bar'); -resolveFromFoo('./baz'); -``` - - -## Related - -- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory -- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path -- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory -- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point -- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily -- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/reusify/.coveralls.yml b/node_modules/reusify/.coveralls.yml deleted file mode 100644 index 359f68349..000000000 --- a/node_modules/reusify/.coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -repo_token: yIxhFqtaaz5iGVYfie9mODehFYogm8S8L diff --git a/node_modules/reusify/.travis.yml b/node_modules/reusify/.travis.yml deleted file mode 100644 index 197047681..000000000 --- a/node_modules/reusify/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: node_js -sudo: false - -node_js: - - 9 - - 8 - - 7 - - 6 - - 5 - - 4 - - 4.0 - - iojs-v3 - - iojs-v2 - - iojs-v1 - - 0.12 - - 0.10 - -cache: - directories: - - node_modules - -after_script: -- npm run coverage - -notifications: - email: - on_success: never - on_failure: always diff --git a/node_modules/reusify/LICENSE b/node_modules/reusify/LICENSE deleted file mode 100644 index fbf3a01d8..000000000 --- a/node_modules/reusify/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Matteo Collina - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/node_modules/reusify/README.md b/node_modules/reusify/README.md deleted file mode 100644 index badcb7ccf..000000000 --- a/node_modules/reusify/README.md +++ /dev/null @@ -1,145 +0,0 @@ -# reusify - -[![npm version][npm-badge]][npm-url] -[![Build Status][travis-badge]][travis-url] -[![Coverage Status][coveralls-badge]][coveralls-url] - -Reuse your objects and functions for maximum speed. This technique will -make any function run ~10% faster. You call your functions a -lot, and it adds up quickly in hot code paths. - -``` -$ node benchmarks/createNoCodeFunction.js -Total time 53133 -Total iterations 100000000 -Iteration/s 1882069.5236482036 - -$ node benchmarks/reuseNoCodeFunction.js -Total time 50617 -Total iterations 100000000 -Iteration/s 1975620.838848608 -``` - -The above benchmark uses fibonacci to simulate a real high-cpu load. -The actual numbers might differ for your use case, but the difference -should not. - -The benchmark was taken using Node v6.10.0. - -This library was extracted from -[fastparallel](http://npm.im/fastparallel). - -## Example - -```js -var reusify = require('reusify') -var fib = require('reusify/benchmarks/fib') -var instance = reusify(MyObject) - -// get an object from the cache, -// or creates a new one when cache is empty -var obj = instance.get() - -// set the state -obj.num = 100 -obj.func() - -// reset the state. -// if the state contains any external object -// do not use delete operator (it is slow) -// prefer set them to null -obj.num = 0 - -// store an object in the cache -instance.release(obj) - -function MyObject () { - // you need to define this property - // so V8 can compile MyObject into an - // hidden class - this.next = null - this.num = 0 - - var that = this - - // this function is never reallocated, - // so it can be optimized by V8 - this.func = function () { - if (null) { - // do nothing - } else { - // calculates fibonacci - fib(that.num) - } - } -} -``` - -The above example was intended for synchronous code, let's see async: -```js -var reusify = require('reusify') -var instance = reusify(MyObject) - -for (var i = 0; i < 100; i++) { - getData(i, console.log) -} - -function getData (value, cb) { - var obj = instance.get() - - obj.value = value - obj.cb = cb - obj.run() -} - -function MyObject () { - this.next = null - this.value = null - - var that = this - - this.run = function () { - asyncOperation(that.value, that.handle) - } - - this.handle = function (err, result) { - that.cb(err, result) - that.value = null - that.cb = null - instance.release(that) - } -} -``` - -Also note how in the above examples, the code, that consumes an istance of `MyObject`, -reset the state to initial condition, just before storing it in the cache. -That's needed so that every subsequent request for an instance from the cache, -could get a clean instance. - -## Why - -It is faster because V8 doesn't have to collect all the functions you -create. On a short-lived benchmark, it is as fast as creating the -nested function, but on a longer time frame it creates less -pressure on the garbage collector. - -## Other examples -If you want to see some complex example, checkout [middie](https://github.com/fastify/middie) and [steed](https://github.com/mcollina/steed). - -## Acknowledgements - -Thanks to [Trevor Norris](https://github.com/trevnorris) for -getting me down the rabbit hole of performance, and thanks to [Mathias -Buss](http://github.com/mafintosh) for suggesting me to share this -trick. - -## License - -MIT - -[npm-badge]: https://badge.fury.io/js/reusify.svg -[npm-url]: https://badge.fury.io/js/reusify -[travis-badge]: https://api.travis-ci.org/mcollina/reusify.svg -[travis-url]: https://travis-ci.org/mcollina/reusify -[coveralls-badge]: https://coveralls.io/repos/mcollina/reusify/badge.svg?branch=master&service=github -[coveralls-url]: https://coveralls.io/github/mcollina/reusify?branch=master diff --git a/node_modules/reusify/benchmarks/createNoCodeFunction.js b/node_modules/reusify/benchmarks/createNoCodeFunction.js deleted file mode 100644 index ce1aac7b7..000000000 --- a/node_modules/reusify/benchmarks/createNoCodeFunction.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict' - -var fib = require('./fib') -var max = 100000000 -var start = Date.now() - -// create a funcion with the typical error -// pattern, that delegates the heavy load -// to something else -function createNoCodeFunction () { - /* eslint no-constant-condition: "off" */ - var num = 100 - - ;(function () { - if (null) { - // do nothing - } else { - fib(num) - } - })() -} - -for (var i = 0; i < max; i++) { - createNoCodeFunction() -} - -var time = Date.now() - start -console.log('Total time', time) -console.log('Total iterations', max) -console.log('Iteration/s', max / time * 1000) diff --git a/node_modules/reusify/benchmarks/fib.js b/node_modules/reusify/benchmarks/fib.js deleted file mode 100644 index e22cc48de..000000000 --- a/node_modules/reusify/benchmarks/fib.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' - -function fib (num) { - var fib = [] - - fib[0] = 0 - fib[1] = 1 - for (var i = 2; i <= num; i++) { - fib[i] = fib[i - 2] + fib[i - 1] - } -} - -module.exports = fib diff --git a/node_modules/reusify/benchmarks/reuseNoCodeFunction.js b/node_modules/reusify/benchmarks/reuseNoCodeFunction.js deleted file mode 100644 index 3358d6e50..000000000 --- a/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict' - -var reusify = require('../') -var fib = require('./fib') -var instance = reusify(MyObject) -var max = 100000000 -var start = Date.now() - -function reuseNoCodeFunction () { - var obj = instance.get() - obj.num = 100 - obj.func() - obj.num = 0 - instance.release(obj) -} - -function MyObject () { - this.next = null - var that = this - this.num = 0 - this.func = function () { - /* eslint no-constant-condition: "off" */ - if (null) { - // do nothing - } else { - fib(that.num) - } - } -} - -for (var i = 0; i < max; i++) { - reuseNoCodeFunction() -} - -var time = Date.now() - start -console.log('Total time', time) -console.log('Total iterations', max) -console.log('Iteration/s', max / time * 1000) diff --git a/node_modules/reusify/package.json b/node_modules/reusify/package.json deleted file mode 100644 index ee66aeecb..000000000 --- a/node_modules/reusify/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "reusify", - "version": "1.0.4", - "description": "Reuse objects and functions with style", - "main": "reusify.js", - "scripts": { - "lint": "standard", - "test": "tape test.js | faucet", - "istanbul": "istanbul cover tape test.js", - "coverage": "npm run istanbul; cat coverage/lcov.info | coveralls" - }, - "pre-commit": [ - "lint", - "test" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/mcollina/reusify.git" - }, - "keywords": [ - "reuse", - "object", - "performance", - "function", - "fast" - ], - "author": "Matteo Collina ", - "license": "MIT", - "bugs": { - "url": "https://github.com/mcollina/reusify/issues" - }, - "homepage": "https://github.com/mcollina/reusify#readme", - "engines": { - "node": ">=0.10.0", - "iojs": ">=1.0.0" - }, - "devDependencies": { - "coveralls": "^2.13.3", - "faucet": "0.0.1", - "istanbul": "^0.4.5", - "pre-commit": "^1.2.2", - "standard": "^10.0.3", - "tape": "^4.8.0" - } -} diff --git a/node_modules/reusify/reusify.js b/node_modules/reusify/reusify.js deleted file mode 100644 index e6f36f3a8..000000000 --- a/node_modules/reusify/reusify.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict' - -function reusify (Constructor) { - var head = new Constructor() - var tail = head - - function get () { - var current = head - - if (current.next) { - head = current.next - } else { - head = new Constructor() - tail = head - } - - current.next = null - - return current - } - - function release (obj) { - tail.next = obj - tail = obj - } - - return { - get: get, - release: release - } -} - -module.exports = reusify diff --git a/node_modules/reusify/test.js b/node_modules/reusify/test.js deleted file mode 100644 index 929cfd719..000000000 --- a/node_modules/reusify/test.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict' - -var test = require('tape') -var reusify = require('./') - -test('reuse objects', function (t) { - t.plan(6) - - function MyObject () { - t.pass('constructor called') - this.next = null - } - - var instance = reusify(MyObject) - var obj = instance.get() - - t.notEqual(obj, instance.get(), 'two instance created') - t.notOk(obj.next, 'next must be null') - - instance.release(obj) - - // the internals keeps a hot copy ready for reuse - // putting this one back in the queue - instance.release(instance.get()) - - // comparing the old one with the one we got - // never do this in real code, after release you - // should never reuse that instance - t.equal(obj, instance.get(), 'instance must be reused') -}) - -test('reuse more than 2 objects', function (t) { - function MyObject () { - t.pass('constructor called') - this.next = null - } - - var instance = reusify(MyObject) - var obj = instance.get() - var obj2 = instance.get() - var obj3 = instance.get() - - t.notOk(obj.next, 'next must be null') - t.notOk(obj2.next, 'next must be null') - t.notOk(obj3.next, 'next must be null') - - t.notEqual(obj, obj2) - t.notEqual(obj, obj3) - t.notEqual(obj3, obj2) - - instance.release(obj) - instance.release(obj2) - instance.release(obj3) - - // skip one - instance.get() - - var obj4 = instance.get() - var obj5 = instance.get() - var obj6 = instance.get() - - t.equal(obj4, obj) - t.equal(obj5, obj2) - t.equal(obj6, obj3) - t.end() -}) diff --git a/node_modules/rimraf/CHANGELOG.md b/node_modules/rimraf/CHANGELOG.md deleted file mode 100644 index f116f1414..000000000 --- a/node_modules/rimraf/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ -# v3.0 - -- Add `--preserve-root` option to executable (default true) -- Drop support for Node.js below version 6 - -# v2.7 - -- Make `glob` an optional dependency - -# 2.6 - -- Retry on EBUSY on non-windows platforms as well -- Make `rimraf.sync` 10000% more reliable on Windows - -# 2.5 - -- Handle Windows EPERM when lstat-ing read-only dirs -- Add glob option to pass options to glob - -# 2.4 - -- Add EPERM to delay/retry loop -- Add `disableGlob` option - -# 2.3 - -- Make maxBusyTries and emfileWait configurable -- Handle weird SunOS unlink-dir issue -- Glob the CLI arg for better Windows support - -# 2.2 - -- Handle ENOENT properly on Windows -- Allow overriding fs methods -- Treat EPERM as indicative of non-empty dir -- Remove optional graceful-fs dep -- Consistently return null error instead of undefined on success -- win32: Treat ENOTEMPTY the same as EBUSY -- Add `rimraf` binary - -# 2.1 - -- Fix SunOS error code for a non-empty directory -- Try rmdir before readdir -- Treat EISDIR like EPERM -- Remove chmod -- Remove lstat polyfill, node 0.7 is not supported - -# 2.0 - -- Fix myGid call to check process.getgid -- Simplify the EBUSY backoff logic. -- Use fs.lstat in node >= 0.7.9 -- Remove gently option -- remove fiber implementation -- Delete files that are marked read-only - -# 1.0 - -- Allow ENOENT in sync method -- Throw when no callback is provided -- Make opts.gently an absolute path -- use 'stat' if 'lstat' is not available -- Consistent error naming, and rethrow non-ENOENT stat errors -- add fiber implementation diff --git a/node_modules/rimraf/LICENSE b/node_modules/rimraf/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -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. diff --git a/node_modules/rimraf/README.md b/node_modules/rimraf/README.md deleted file mode 100644 index 423b8cf85..000000000 --- a/node_modules/rimraf/README.md +++ /dev/null @@ -1,101 +0,0 @@ -[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) - -The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, [opts], callback)` - -The first parameter will be interpreted as a globbing pattern for files. If you -want to disable globbing you can do so with `opts.disableGlob` (defaults to -`false`). This might be handy, for instance, if you have filenames that contain -globbing wildcard characters. - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of - `opts.maxBusyTries` times before giving up, adding 100ms of wait - between each attempt. The default `maxBusyTries` is 3. -* `ENOENT` - If the file doesn't exist, rimraf will return - successfully, since your desired outcome is already the case. -* `EMFILE` - Since `readdir` requires opening a file descriptor, it's - possible to hit `EMFILE` if too many file descriptors are in use. - In the sync case, there's nothing to be done for this. But in the - async case, rimraf will gradually back off with timeouts up to - `opts.emfileWait` ms, which defaults to 1000. - -## options - -* unlink, chmod, stat, lstat, rmdir, readdir, - unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync - - In order to use a custom file system library, you can override - specific fs functions on the options object. - - If any of these functions are present on the options object, then - the supplied function will be used instead of the default fs - method. - - Sync methods are only relevant for `rimraf.sync()`, of course. - - For example: - - ```javascript - var myCustomFS = require('some-custom-fs') - - rimraf('some-thing', myCustomFS, callback) - ``` - -* maxBusyTries - - If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered - on Windows systems, then rimraf will retry with a linear backoff - wait of 100ms longer on each try. The default maxBusyTries is 3. - - Only relevant for async usage. - -* emfileWait - - If an `EMFILE` error is encountered, then rimraf will retry - repeatedly with a linear backoff of 1ms longer on each try, until - the timeout counter hits this max. The default limit is 1000. - - If you repeatedly encounter `EMFILE` errors, then consider using - [graceful-fs](http://npm.im/graceful-fs) in your program. - - Only relevant for async usage. - -* glob - - Set to `false` to disable [glob](http://npm.im/glob) pattern - matching. - - Set to an object to pass options to the glob module. The default - glob options are `{ nosort: true, silent: true }`. - - Glob version 6 is used in this module. - - Relevant for both sync and async usage. - -* disableGlob - - Set to any non-falsey value to disable globbing entirely. - (Equivalent to setting `glob: false`.) - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. - -## CLI - -If installed with `npm install rimraf -g` it can be used as a global -command `rimraf [ ...]` which is useful for cross platform support. - -## mkdirp - -If you need to create a directory recursively, check out -[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/node_modules/rimraf/bin.js b/node_modules/rimraf/bin.js deleted file mode 100755 index 023814cc9..000000000 --- a/node_modules/rimraf/bin.js +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env node - -const rimraf = require('./') - -const path = require('path') - -const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) -const filterOutRoot = arg => { - const ok = preserveRoot === false || !isRoot(arg) - if (!ok) { - console.error(`refusing to remove ${arg}`) - console.error('Set --no-preserve-root to allow this') - } - return ok -} - -let help = false -let dashdash = false -let noglob = false -let preserveRoot = true -const args = process.argv.slice(2).filter(arg => { - if (dashdash) - return !!arg - else if (arg === '--') - dashdash = true - else if (arg === '--no-glob' || arg === '-G') - noglob = true - else if (arg === '--glob' || arg === '-g') - noglob = false - else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) - help = true - else if (arg === '--preserve-root') - preserveRoot = true - else if (arg === '--no-preserve-root') - preserveRoot = false - else - return !!arg -}).filter(arg => !preserveRoot || filterOutRoot(arg)) - -const go = n => { - if (n >= args.length) - return - const options = noglob ? { glob: false } : {} - rimraf(args[n], options, er => { - if (er) - throw er - go(n+1) - }) -} - -if (help || args.length === 0) { - // If they didn't ask for help, then this is not a "success" - const log = help ? console.log : console.error - log('Usage: rimraf [ ...]') - log('') - log(' Deletes all files and folders at "path" recursively.') - log('') - log('Options:') - log('') - log(' -h, --help Display this usage info') - log(' -G, --no-glob Do not expand glob patterns in arguments') - log(' -g, --glob Expand glob patterns in arguments (default)') - log(' --preserve-root Do not remove \'/\' (default)') - log(' --no-preserve-root Do not treat \'/\' specially') - log(' -- Stop parsing flags') - process.exit(help ? 0 : 1) -} else - go(0) diff --git a/node_modules/rimraf/package.json b/node_modules/rimraf/package.json deleted file mode 100644 index 1bf8d5e38..000000000 --- a/node_modules/rimraf/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "rimraf", - "version": "3.0.2", - "main": "rimraf.js", - "description": "A deep deletion module for node (like `rm -rf`)", - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "repository": "git://github.com/isaacs/rimraf.git", - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags", - "test": "tap test/*.js" - }, - "bin": "./bin.js", - "dependencies": { - "glob": "^7.1.3" - }, - "files": [ - "LICENSE", - "README.md", - "bin.js", - "rimraf.js" - ], - "devDependencies": { - "mkdirp": "^0.5.1", - "tap": "^12.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } -} diff --git a/node_modules/rimraf/rimraf.js b/node_modules/rimraf/rimraf.js deleted file mode 100644 index 34da4171d..000000000 --- a/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,360 +0,0 @@ -const assert = require("assert") -const path = require("path") -const fs = require("fs") -let glob = undefined -try { - glob = require("glob") -} catch (_err) { - // treat glob as optional. -} - -const defaultGlobOpts = { - nosort: true, - silent: true -} - -// for EMFILE handling -let timeout = 0 - -const isWindows = (process.platform === "win32") - -const defaults = options => { - const methods = [ - 'unlink', - 'chmod', - 'stat', - 'lstat', - 'rmdir', - 'readdir' - ] - methods.forEach(m => { - options[m] = options[m] || fs[m] - m = m + 'Sync' - options[m] = options[m] || fs[m] - }) - - options.maxBusyTries = options.maxBusyTries || 3 - options.emfileWait = options.emfileWait || 1000 - if (options.glob === false) { - options.disableGlob = true - } - if (options.disableGlob !== true && glob === undefined) { - throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') - } - options.disableGlob = options.disableGlob || false - options.glob = options.glob || defaultGlobOpts -} - -const rimraf = (p, options, cb) => { - if (typeof options === 'function') { - cb = options - options = {} - } - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert.equal(typeof cb, 'function', 'rimraf: callback function required') - assert(options, 'rimraf: invalid options argument provided') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - defaults(options) - - let busyTries = 0 - let errState = null - let n = 0 - - const next = (er) => { - errState = errState || er - if (--n === 0) - cb(errState) - } - - const afterGlob = (er, results) => { - if (er) - return cb(er) - - n = results.length - if (n === 0) - return cb() - - results.forEach(p => { - const CB = (er) => { - if (er) { - if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && - busyTries < options.maxBusyTries) { - busyTries ++ - // try again, with the same exact callback as this one. - return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) - } - - // this one won't happen if graceful-fs is used. - if (er.code === "EMFILE" && timeout < options.emfileWait) { - return setTimeout(() => rimraf_(p, options, CB), timeout ++) - } - - // already gone - if (er.code === "ENOENT") er = null - } - - timeout = 0 - next(er) - } - rimraf_(p, options, CB) - }) - } - - if (options.disableGlob || !glob.hasMagic(p)) - return afterGlob(null, [p]) - - options.lstat(p, (er, stat) => { - if (!er) - return afterGlob(null, [p]) - - glob(p, options.glob, afterGlob) - }) - -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -const rimraf_ = (p, options, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // sunos lets the root user unlink directories, which is... weird. - // so we have to lstat here and make sure it's not a dir. - options.lstat(p, (er, st) => { - if (er && er.code === "ENOENT") - return cb(null) - - // Windows can EPERM on stat. Life is suffering. - if (er && er.code === "EPERM" && isWindows) - fixWinEPERM(p, options, er, cb) - - if (st && st.isDirectory()) - return rmdir(p, options, er, cb) - - options.unlink(p, er => { - if (er) { - if (er.code === "ENOENT") - return cb(null) - if (er.code === "EPERM") - return (isWindows) - ? fixWinEPERM(p, options, er, cb) - : rmdir(p, options, er, cb) - if (er.code === "EISDIR") - return rmdir(p, options, er, cb) - } - return cb(er) - }) - }) -} - -const fixWinEPERM = (p, options, er, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.chmod(p, 0o666, er2 => { - if (er2) - cb(er2.code === "ENOENT" ? null : er) - else - options.stat(p, (er3, stats) => { - if (er3) - cb(er3.code === "ENOENT" ? null : er) - else if (stats.isDirectory()) - rmdir(p, options, er, cb) - else - options.unlink(p, cb) - }) - }) -} - -const fixWinEPERMSync = (p, options, er) => { - assert(p) - assert(options) - - try { - options.chmodSync(p, 0o666) - } catch (er2) { - if (er2.code === "ENOENT") - return - else - throw er - } - - let stats - try { - stats = options.statSync(p) - } catch (er3) { - if (er3.code === "ENOENT") - return - else - throw er - } - - if (stats.isDirectory()) - rmdirSync(p, options, er) - else - options.unlinkSync(p) -} - -const rmdir = (p, options, originalEr, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - options.rmdir(p, er => { - if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) - rmkids(p, options, cb) - else if (er && er.code === "ENOTDIR") - cb(originalEr) - else - cb(er) - }) -} - -const rmkids = (p, options, cb) => { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.readdir(p, (er, files) => { - if (er) - return cb(er) - let n = files.length - if (n === 0) - return options.rmdir(p, cb) - let errState - files.forEach(f => { - rimraf(path.join(p, f), options, er => { - if (errState) - return - if (er) - return cb(errState = er) - if (--n === 0) - options.rmdir(p, cb) - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -const rimrafSync = (p, options) => { - options = options || {} - defaults(options) - - assert(p, 'rimraf: missing path') - assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.equal(typeof options, 'object', 'rimraf: options should be object') - - let results - - if (options.disableGlob || !glob.hasMagic(p)) { - results = [p] - } else { - try { - options.lstatSync(p) - results = [p] - } catch (er) { - results = glob.sync(p, options.glob) - } - } - - if (!results.length) - return - - for (let i = 0; i < results.length; i++) { - const p = results[i] - - let st - try { - st = options.lstatSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - - // Windows can EPERM on stat. Life is suffering. - if (er.code === "EPERM" && isWindows) - fixWinEPERMSync(p, options, er) - } - - try { - // sunos lets the root user unlink directories, which is... weird. - if (st && st.isDirectory()) - rmdirSync(p, options, null) - else - options.unlinkSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "EPERM") - return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) - if (er.code !== "EISDIR") - throw er - - rmdirSync(p, options, er) - } - } -} - -const rmdirSync = (p, options, originalEr) => { - assert(p) - assert(options) - - try { - options.rmdirSync(p) - } catch (er) { - if (er.code === "ENOENT") - return - if (er.code === "ENOTDIR") - throw originalEr - if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") - rmkidsSync(p, options) - } -} - -const rmkidsSync = (p, options) => { - assert(p) - assert(options) - options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) - - // We only end up here once we got ENOTEMPTY at least once, and - // at this point, we are guaranteed to have removed all the kids. - // So, we know that it won't be ENOENT or ENOTDIR or anything else. - // try really hard to delete stuff on windows, because it has a - // PROFOUNDLY annoying habit of not closing handles promptly when - // files are deleted, resulting in spurious ENOTEMPTY errors. - const retries = isWindows ? 100 : 1 - let i = 0 - do { - let threw = true - try { - const ret = options.rmdirSync(p, options) - threw = false - return ret - } finally { - if (++i < retries && threw) - continue - } - } while (true) -} - -module.exports = rimraf -rimraf.sync = rimrafSync diff --git a/node_modules/run-parallel/LICENSE b/node_modules/run-parallel/LICENSE deleted file mode 100644 index c7e685275..000000000 --- a/node_modules/run-parallel/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/run-parallel/README.md b/node_modules/run-parallel/README.md deleted file mode 100644 index edc3da452..000000000 --- a/node_modules/run-parallel/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# run-parallel [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] - -[travis-image]: https://img.shields.io/travis/feross/run-parallel/master.svg -[travis-url]: https://travis-ci.org/feross/run-parallel -[npm-image]: https://img.shields.io/npm/v/run-parallel.svg -[npm-url]: https://npmjs.org/package/run-parallel -[downloads-image]: https://img.shields.io/npm/dm/run-parallel.svg -[downloads-url]: https://npmjs.org/package/run-parallel -[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg -[standard-url]: https://standardjs.com - -### Run an array of functions in parallel - -![parallel](https://raw.githubusercontent.com/feross/run-parallel/master/img.png) [![Sauce Test Status](https://saucelabs.com/browser-matrix/run-parallel.svg)](https://saucelabs.com/u/run-parallel) - -### install - -``` -npm install run-parallel -``` - -### usage - -#### parallel(tasks, [callback]) - -Run the `tasks` array of functions in parallel, without waiting until the previous -function has completed. If any of the functions pass an error to its callback, the main -`callback` is immediately called with the value of the error. Once the `tasks` have -completed, the results are passed to the final `callback` as an array. - -It is also possible to use an object instead of an array. Each property will be run as a -function and the results will be passed to the final `callback` as an object instead of -an array. This can be a more readable way of handling the results. - -##### arguments - -- `tasks` - An array or object containing functions to run. Each function is passed a -`callback(err, result)` which it must call on completion with an error `err` (which can -be `null`) and an optional `result` value. -- `callback(err, results)` - An optional callback to run once all the functions have -completed. This function gets a results array (or object) containing all the result -arguments passed to the task callbacks. - -##### example - -```js -var parallel = require('run-parallel') - -parallel([ - function (callback) { - setTimeout(function () { - callback(null, 'one') - }, 200) - }, - function (callback) { - setTimeout(function () { - callback(null, 'two') - }, 100) - } -], -// optional callback -function (err, results) { - // the results array will equal ['one','two'] even though - // the second function had a shorter timeout. -}) -``` - -This module is basically equavalent to -[`async.parallel`](https://github.com/caolan/async#paralleltasks-callback), but it's -handy to just have the one function you need instead of the kitchen sink. Modularity! -Especially handy if you're serving to the browser and need to reduce your javascript -bundle size. - -Works great in the browser with [browserify](http://browserify.org/)! - -### see also - -- [run-auto](https://github.com/feross/run-auto) -- [run-parallel-limit](https://github.com/feross/run-parallel-limit) -- [run-series](https://github.com/feross/run-series) -- [run-waterfall](https://github.com/feross/run-waterfall) - -### license - -MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org). diff --git a/node_modules/run-parallel/index.js b/node_modules/run-parallel/index.js deleted file mode 100644 index 6307141d6..000000000 --- a/node_modules/run-parallel/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/*! run-parallel. MIT License. Feross Aboukhadijeh */ -module.exports = runParallel - -const queueMicrotask = require('queue-microtask') - -function runParallel (tasks, cb) { - let results, pending, keys - let isSync = true - - if (Array.isArray(tasks)) { - results = [] - pending = tasks.length - } else { - keys = Object.keys(tasks) - results = {} - pending = keys.length - } - - function done (err) { - function end () { - if (cb) cb(err, results) - cb = null - } - if (isSync) queueMicrotask(end) - else end() - } - - function each (i, err, result) { - results[i] = result - if (--pending === 0 || err) { - done(err) - } - } - - if (!pending) { - // empty - done(null) - } else if (keys) { - // object - keys.forEach(function (key) { - tasks[key](function (err, result) { each(key, err, result) }) - }) - } else { - // array - tasks.forEach(function (task, i) { - task(function (err, result) { each(i, err, result) }) - }) - } - - isSync = false -} diff --git a/node_modules/run-parallel/package.json b/node_modules/run-parallel/package.json deleted file mode 100644 index 1f1475788..000000000 --- a/node_modules/run-parallel/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "run-parallel", - "description": "Run an array of functions in parallel", - "version": "1.2.0", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "https://feross.org" - }, - "bugs": { - "url": "https://github.com/feross/run-parallel/issues" - }, - "dependencies": { - "queue-microtask": "^1.2.2" - }, - "devDependencies": { - "airtap": "^3.0.0", - "standard": "*", - "tape": "^5.0.1" - }, - "homepage": "https://github.com/feross/run-parallel", - "keywords": [ - "parallel", - "async", - "function", - "callback", - "asynchronous", - "run", - "array", - "run parallel" - ], - "license": "MIT", - "main": "index.js", - "repository": { - "type": "git", - "url": "git://github.com/feross/run-parallel.git" - }, - "scripts": { - "test": "standard && npm run test-node && npm run test-browser", - "test-browser": "airtap -- test/*.js", - "test-browser-local": "airtap --local -- test/*.js", - "test-node": "tape test/*.js" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] -} diff --git a/node_modules/semver/LICENSE b/node_modules/semver/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/semver/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -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. diff --git a/node_modules/semver/README.md b/node_modules/semver/README.md deleted file mode 100644 index 53ea9b52a..000000000 --- a/node_modules/semver/README.md +++ /dev/null @@ -1,637 +0,0 @@ -semver(1) -- The semantic versioner for npm -=========================================== - -## Install - -```bash -npm install semver -```` - -## Usage - -As a node module: - -```js -const semver = require('semver') - -semver.valid('1.2.3') // '1.2.3' -semver.valid('a.b.c') // null -semver.clean(' =v1.2.3 ') // '1.2.3' -semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true -semver.gt('1.2.3', '9.8.7') // false -semver.lt('1.2.3', '9.8.7') // true -semver.minVersion('>=1.0.0') // '1.0.0' -semver.valid(semver.coerce('v2')) // '2.0.0' -semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' -``` - -You can also just load the module for the function that you care about, if -you'd like to minimize your footprint. - -```js -// load the whole API at once in a single object -const semver = require('semver') - -// or just load the bits you need -// all of them listed here, just pick and choose what you want - -// classes -const SemVer = require('semver/classes/semver') -const Comparator = require('semver/classes/comparator') -const Range = require('semver/classes/range') - -// functions for working with versions -const semverParse = require('semver/functions/parse') -const semverValid = require('semver/functions/valid') -const semverClean = require('semver/functions/clean') -const semverInc = require('semver/functions/inc') -const semverDiff = require('semver/functions/diff') -const semverMajor = require('semver/functions/major') -const semverMinor = require('semver/functions/minor') -const semverPatch = require('semver/functions/patch') -const semverPrerelease = require('semver/functions/prerelease') -const semverCompare = require('semver/functions/compare') -const semverRcompare = require('semver/functions/rcompare') -const semverCompareLoose = require('semver/functions/compare-loose') -const semverCompareBuild = require('semver/functions/compare-build') -const semverSort = require('semver/functions/sort') -const semverRsort = require('semver/functions/rsort') - -// low-level comparators between versions -const semverGt = require('semver/functions/gt') -const semverLt = require('semver/functions/lt') -const semverEq = require('semver/functions/eq') -const semverNeq = require('semver/functions/neq') -const semverGte = require('semver/functions/gte') -const semverLte = require('semver/functions/lte') -const semverCmp = require('semver/functions/cmp') -const semverCoerce = require('semver/functions/coerce') - -// working with ranges -const semverSatisfies = require('semver/functions/satisfies') -const semverMaxSatisfying = require('semver/ranges/max-satisfying') -const semverMinSatisfying = require('semver/ranges/min-satisfying') -const semverToComparators = require('semver/ranges/to-comparators') -const semverMinVersion = require('semver/ranges/min-version') -const semverValidRange = require('semver/ranges/valid') -const semverOutside = require('semver/ranges/outside') -const semverGtr = require('semver/ranges/gtr') -const semverLtr = require('semver/ranges/ltr') -const semverIntersects = require('semver/ranges/intersects') -const simplifyRange = require('semver/ranges/simplify') -const rangeSubset = require('semver/ranges/subset') -``` - -As a command-line utility: - -``` -$ semver -h - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] [ [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range - Print versions that match the specified range. - --i --increment [] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --n <0|1> - This is the base to be used for the prerelease identifier. - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - ---rtl - Coerce version strings right to left - ---ltr - Coerce version strings left to right (default) - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them. -``` - -## Versions - -A "version" is described by the `v2.0.0` specification found at -. - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Ranges - -A `version range` is a set of `comparators` which specify versions -that satisfy the range. - -A `comparator` is composed of an `operator` and a `version`. The set -of primitive `operators` is: - -* `<` Less than -* `<=` Less than or equal to -* `>` Greater than -* `>=` Greater than or equal to -* `=` Equal. If no operator is specified, then equality is assumed, - so this operator is optional, but MAY be included. - -For example, the comparator `>=1.2.7` would match the versions -`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` -or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and -would match the versions `2.0.0` and `3.1.0`, but not the versions -`1.0.1` or `1.1.0`. - -Comparators can be joined by whitespace to form a `comparator set`, -which is satisfied by the **intersection** of all of the comparators -it includes. - -A range is composed of one or more comparator sets, joined by `||`. A -version matches a range if and only if every comparator in at least -one of the `||`-separated comparator sets is satisfied by the version. - -For example, the range `>=1.2.7 <1.3.0` would match the versions -`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, -or `1.1.0`. - -The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, -`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. - -### Prerelease Tags - -If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then -it will only be allowed to satisfy comparator sets if at least one -comparator with the same `[major, minor, patch]` tuple also has a -prerelease tag. - -For example, the range `>1.2.3-alpha.3` would be allowed to match the -version `1.2.3-alpha.7`, but it would *not* be satisfied by -`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater -than" `1.2.3-alpha.3` according to the SemVer sort rules. The version -range only accepts prerelease tags on the `1.2.3` version. The -version `3.4.5` *would* satisfy the range, because it does not have a -prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. - -The purpose for this behavior is twofold. First, prerelease versions -frequently are updated very quickly, and contain many breaking changes -that are (by the author's design) not yet fit for public consumption. -Therefore, by default, they are excluded from range matching -semantics. - -Second, a user who has opted into using a prerelease version has -clearly indicated the intent to use *that specific* set of -alpha/beta/rc versions. By including a prerelease tag in the range, -the user is indicating that they are aware of the risk. However, it -is still not appropriate to assume that they have opted into taking a -similar risk on the *next* set of prerelease versions. - -Note that this behavior can be suppressed (treating all prerelease -versions as if they were normal versions, for the purpose of range -matching) by setting the `includePrerelease` flag on the options -object to any -[functions](https://github.com/npm/node-semver#functions) that do -range matching. - -#### Prerelease Identifiers - -The method `.inc` takes an additional `identifier` string argument that -will append the value of the string as a prerelease identifier: - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta') -// '1.2.4-beta.0' -``` - -command-line example: - -```bash -$ semver 1.2.3 -i prerelease --preid beta -1.2.4-beta.0 -``` - -Which then can be used to increment further: - -```bash -$ semver 1.2.4-beta.0 -i prerelease -1.2.4-beta.1 -``` - -#### Prerelease Identifier Base - -The method `.inc` takes an optional parameter 'identifierBase' string -that will let you let your prerelease number as zero-based or one-based. -Set to `false` to omit the prerelease number altogether. -If you do not specify this parameter, it will default to zero-based. - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta', '1') -// '1.2.4-beta.1' -``` - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta', false) -// '1.2.4-beta' -``` - -command-line example: - -```bash -$ semver 1.2.3 -i prerelease --preid beta -n 1 -1.2.4-beta.1 -``` - -```bash -$ semver 1.2.3 -i prerelease --preid beta -n false -1.2.4-beta -``` - -### Advanced Range Syntax - -Advanced range syntax desugars to primitive comparators in -deterministic ways. - -Advanced ranges may be combined in the same way as primitive -comparators using white space or `||`. - -#### Hyphen Ranges `X.Y.Z - A.B.C` - -Specifies an inclusive set. - -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` - -If a partial version is provided as the first version in the inclusive -range, then the missing pieces are replaced with zeroes. - -* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` - -If a partial version is provided as the second version in the -inclusive range, then all versions that start with the supplied parts -of the tuple are accepted, but nothing that would be greater than the -provided tuple parts. - -* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0` -* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0` - -#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` - -Any of `X`, `x`, or `*` may be used to "stand in" for one of the -numeric values in the `[major, minor, patch]` tuple. - -* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless - `includePrerelease` is specified, in which case any version at all - satisfies) -* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version) -* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions) - -A partial version range is treated as an X-Range, so the special -character is in fact optional. - -* `""` (empty string) := `*` := `>=0.0.0` -* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0` -* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0` - -#### Tilde Ranges `~1.2.3` `~1.2` `~1` - -Allows patch-level changes if a minor version is specified on the -comparator. Allows minor-level changes if not. - -* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0` -* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`) -* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`) -* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0` -* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`) -* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`) -* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. - -#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` - -Allows changes that do not modify the left-most non-zero element in the -`[major, minor, patch]` tuple. In other words, this allows patch and -minor updates for versions `1.0.0` and above, patch updates for -versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. - -Many authors treat a `0.x` version as if the `x` were the major -"breaking-change" indicator. - -Caret ranges are ideal when an author may make breaking changes -between `0.2.4` and `0.3.0` releases, which is a common practice. -However, it presumes that there will *not* be breaking changes between -`0.2.4` and `0.2.5`. It allows for changes that are presumed to be -additive (but non-breaking), according to commonly observed practices. - -* `^1.2.3` := `>=1.2.3 <2.0.0-0` -* `^0.2.3` := `>=0.2.3 <0.3.0-0` -* `^0.0.3` := `>=0.0.3 <0.0.4-0` -* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. -* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the - `0.0.3` version *only* will be allowed, if they are greater than or - equal to `beta`. So, `0.0.3-pr.2` would be allowed. - -When parsing caret ranges, a missing `patch` value desugars to the -number `0`, but will allow flexibility within that value, even if the -major and minor versions are both `0`. - -* `^1.2.x` := `>=1.2.0 <2.0.0-0` -* `^0.0.x` := `>=0.0.0 <0.1.0-0` -* `^0.0` := `>=0.0.0 <0.1.0-0` - -A missing `minor` and `patch` values will desugar to zero, but also -allow flexibility within those values, even if the major version is -zero. - -* `^1.x` := `>=1.0.0 <2.0.0-0` -* `^0.x` := `>=0.0.0 <1.0.0-0` - -### Range Grammar - -Putting all this together, here is a Backus-Naur grammar for ranges, -for the benefit of parser authors: - -```bnf -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ -``` - -## Functions - -All methods and classes take a final `options` object argument. All -options in this object are `false` by default. The options supported -are: - -- `loose` Be more forgiving about not-quite-valid semver strings. - (Any resulting output will always be 100% strict compliant, of - course.) For backwards compatibility reasons, if the `options` - argument is a boolean value instead of an object, it is interpreted - to be the `loose` param. -- `includePrerelease` Set to suppress the [default - behavior](https://github.com/npm/node-semver#prerelease-tags) of - excluding prerelease tagged versions from ranges unless they are - explicitly opted into. - -Strict-mode Comparators and Ranges will be strict about the SemVer -strings that they parse. - -* `valid(v)`: Return the parsed version, or null if it's not valid. -* `inc(v, release)`: Return the version incremented by the release - type (`major`, `premajor`, `minor`, `preminor`, `patch`, - `prepatch`, or `prerelease`), or null if it's not valid - * `premajor` in one call will bump the version up to the next major - version and down to a prerelease of that major version. - `preminor`, and `prepatch` work the same way. - * If called from a non-prerelease version, the `prerelease` will work the - same as `prepatch`. It increments the patch version, then makes a - prerelease. If the input version is already a prerelease it simply - increments it. -* `prerelease(v)`: Returns an array of prerelease components, or null - if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` -* `major(v)`: Return the major version number. -* `minor(v)`: Return the minor version number. -* `patch(v)`: Return the patch version number. -* `intersects(r1, r2, loose)`: Return true if the two supplied ranges - or comparators intersect. -* `parse(v)`: Attempt to parse a string as a semantic version, returning either - a `SemVer` object or `null`. - -### Comparison - -* `gt(v1, v2)`: `v1 > v2` -* `gte(v1, v2)`: `v1 >= v2` -* `lt(v1, v2)`: `v1 < v2` -* `lte(v1, v2)`: `v1 <= v2` -* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, - even if they're not the exact same string. You already know how to - compare strings. -* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. -* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call - the corresponding function above. `"==="` and `"!=="` do simple - string comparison, but are included for completeness. Throws if an - invalid comparison string is provided. -* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions - in descending order when passed to `Array.sort()`. -* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions - are equal. Sorts in ascending order if passed to `Array.sort()`. - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `diff(v1, v2)`: Returns difference between two versions by the release type - (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), - or null if the versions are the same. - -### Comparators - -* `intersects(comparator)`: Return true if the comparators intersect - -### Ranges - -* `validRange(range)`: Return the valid range or null if it's not valid -* `satisfies(version, range)`: Return true if the version satisfies the - range. -* `maxSatisfying(versions, range)`: Return the highest version in the list - that satisfies the range, or `null` if none of them do. -* `minSatisfying(versions, range)`: Return the lowest version in the list - that satisfies the range, or `null` if none of them do. -* `minVersion(range)`: Return the lowest version that can possibly match - the given range. -* `gtr(version, range)`: Return `true` if version is greater than all the - versions possible in the range. -* `ltr(version, range)`: Return `true` if version is less than all the - versions possible in the range. -* `outside(version, range, hilo)`: Return true if the version is outside - the bounds of the range in either the high or low direction. The - `hilo` argument must be either the string `'>'` or `'<'`. (This is - the function called by `gtr` and `ltr`.) -* `intersects(range)`: Return true if any of the ranges comparators intersect -* `simplifyRange(versions, range)`: Return a "simplified" range that - matches the same items in `versions` list as the range specified. Note - that it does *not* guarantee that it would match the same versions in all - cases, only for the set of versions provided. This is useful when - generating ranges by joining together multiple versions with `||` - programmatically, to provide the user with something a bit more - ergonomic. If the provided range is shorter in string-length than the - generated range, then that is returned. -* `subset(subRange, superRange)`: Return `true` if the `subRange` range is - entirely contained by the `superRange` range. - -Note that, since ranges may be non-contiguous, a version might not be -greater than a range, less than a range, *or* satisfy a range! For -example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` -until `2.0.0`, so the version `1.2.10` would not be greater than the -range (because `2.0.1` satisfies, which is higher), nor less than the -range (since `1.2.8` satisfies, which is lower), and it also does not -satisfy the range. - -If you want to know if a version satisfies or does not satisfy a -range, use the `satisfies(version, range)` function. - -### Coercion - -* `coerce(version, options)`: Coerces a string to semver if possible - -This aims to provide a very forgiving translation of a non-semver string to -semver. It looks for the first digit in a string, and consumes all -remaining characters which satisfy at least a partial semver (e.g., `1`, -`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer -versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All -surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes -`3.4.0`). Only text which lacks digits will fail coercion (`version one` -is not valid). The maximum length for any semver component considered for -coercion is 16 characters; longer components will be ignored -(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any -semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value -components are invalid (`9999999999999999.4.7.4` is likely invalid). - -If the `options.rtl` flag is set, then `coerce` will return the right-most -coercible tuple that does not share an ending index with a longer coercible -tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not -`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of -any other overlapping SemVer tuple. - -### Clean - -* `clean(version)`: Clean a string to be a valid semver if possible - -This will return a cleaned and trimmed semver version. If the provided -version is not valid a null will be returned. This does not work for -ranges. - -ex. -* `s.clean(' = v 2.1.5foo')`: `null` -* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean(' = v 2.1.5-foo')`: `null` -* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean('=v2.1.5')`: `'2.1.5'` -* `s.clean(' =v2.1.5')`: `2.1.5` -* `s.clean(' 2.1.5 ')`: `'2.1.5'` -* `s.clean('~1.0.0')`: `null` - -## Constants - -As a convenience, helper constants are exported to provide information about what `node-semver` supports: - -### `RELEASE_TYPES` - -- major -- premajor -- minor -- preminor -- patch -- prepatch -- prerelease - -``` -const semver = require('semver'); - -if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) { - console.log('This is a valid release type!'); -} else { - console.warn('This is NOT a valid release type!'); -} -``` - -### `SEMVER_SPEC_VERSION` - -2.0.0 - -``` -const semver = require('semver'); - -console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION); -``` - -## Exported Modules - - - -You may pull in just the part of this semver utility that you need, if you -are sensitive to packing and tree-shaking concerns. The main -`require('semver')` export uses getter functions to lazily load the parts -of the API that are used. - -The following modules are available: - -* `require('semver')` -* `require('semver/classes')` -* `require('semver/classes/comparator')` -* `require('semver/classes/range')` -* `require('semver/classes/semver')` -* `require('semver/functions/clean')` -* `require('semver/functions/cmp')` -* `require('semver/functions/coerce')` -* `require('semver/functions/compare')` -* `require('semver/functions/compare-build')` -* `require('semver/functions/compare-loose')` -* `require('semver/functions/diff')` -* `require('semver/functions/eq')` -* `require('semver/functions/gt')` -* `require('semver/functions/gte')` -* `require('semver/functions/inc')` -* `require('semver/functions/lt')` -* `require('semver/functions/lte')` -* `require('semver/functions/major')` -* `require('semver/functions/minor')` -* `require('semver/functions/neq')` -* `require('semver/functions/parse')` -* `require('semver/functions/patch')` -* `require('semver/functions/prerelease')` -* `require('semver/functions/rcompare')` -* `require('semver/functions/rsort')` -* `require('semver/functions/satisfies')` -* `require('semver/functions/sort')` -* `require('semver/functions/valid')` -* `require('semver/ranges/gtr')` -* `require('semver/ranges/intersects')` -* `require('semver/ranges/ltr')` -* `require('semver/ranges/max-satisfying')` -* `require('semver/ranges/min-satisfying')` -* `require('semver/ranges/min-version')` -* `require('semver/ranges/outside')` -* `require('semver/ranges/to-comparators')` -* `require('semver/ranges/valid')` - diff --git a/node_modules/semver/bin/semver.js b/node_modules/semver/bin/semver.js deleted file mode 100755 index 242b7ade7..000000000 --- a/node_modules/semver/bin/semver.js +++ /dev/null @@ -1,197 +0,0 @@ -#!/usr/bin/env node -// Standalone semver comparison program. -// Exits successfully and prints matching version(s) if -// any supplied version is valid and passes all tests. - -const argv = process.argv.slice(2) - -let versions = [] - -const range = [] - -let inc = null - -const version = require('../package.json').version - -let loose = false - -let includePrerelease = false - -let coerce = false - -let rtl = false - -let identifier - -let identifierBase - -const semver = require('../') -const parseOptions = require('../internal/parse-options') - -let reverse = false - -let options = {} - -const main = () => { - if (!argv.length) { - return help() - } - while (argv.length) { - let a = argv.shift() - const indexOfEqualSign = a.indexOf('=') - if (indexOfEqualSign !== -1) { - const value = a.slice(indexOfEqualSign + 1) - a = a.slice(0, indexOfEqualSign) - argv.unshift(value) - } - switch (a) { - case '-rv': case '-rev': case '--rev': case '--reverse': - reverse = true - break - case '-l': case '--loose': - loose = true - break - case '-p': case '--include-prerelease': - includePrerelease = true - break - case '-v': case '--version': - versions.push(argv.shift()) - break - case '-i': case '--inc': case '--increment': - switch (argv[0]) { - case 'major': case 'minor': case 'patch': case 'prerelease': - case 'premajor': case 'preminor': case 'prepatch': - inc = argv.shift() - break - default: - inc = 'patch' - break - } - break - case '--preid': - identifier = argv.shift() - break - case '-r': case '--range': - range.push(argv.shift()) - break - case '-n': - identifierBase = argv.shift() - if (identifierBase === 'false') { - identifierBase = false - } - break - case '-c': case '--coerce': - coerce = true - break - case '--rtl': - rtl = true - break - case '--ltr': - rtl = false - break - case '-h': case '--help': case '-?': - return help() - default: - versions.push(a) - break - } - } - - options = parseOptions({ loose, includePrerelease, rtl }) - - versions = versions.map((v) => { - return coerce ? (semver.coerce(v, options) || { version: v }).version : v - }).filter((v) => { - return semver.valid(v) - }) - if (!versions.length) { - return fail() - } - if (inc && (versions.length !== 1 || range.length)) { - return failInc() - } - - for (let i = 0, l = range.length; i < l; i++) { - versions = versions.filter((v) => { - return semver.satisfies(v, range[i], options) - }) - if (!versions.length) { - return fail() - } - } - return success(versions) -} - -const failInc = () => { - console.error('--inc can only be used on a single version with no range') - fail() -} - -const fail = () => process.exit(1) - -const success = () => { - const compare = reverse ? 'rcompare' : 'compare' - versions.sort((a, b) => { - return semver[compare](a, b, options) - }).map((v) => { - return semver.clean(v, options) - }).map((v) => { - return inc ? semver.inc(v, inc, options, identifier, identifierBase) : v - }).forEach((v, i, _) => { - console.log(v) - }) -} - -const help = () => console.log( -`SemVer ${version} - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] [ [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range - Print versions that match the specified range. - --i --increment [] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - ---rtl - Coerce version strings right to left - ---ltr - Coerce version strings left to right (default) - --n - Base number to be used for the prerelease identifier. - Can be either 0 or 1, or false to omit the number altogether. - Defaults to 0. - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them.`) - -main() diff --git a/node_modules/semver/classes/comparator.js b/node_modules/semver/classes/comparator.js deleted file mode 100644 index 3d39c0eef..000000000 --- a/node_modules/semver/classes/comparator.js +++ /dev/null @@ -1,141 +0,0 @@ -const ANY = Symbol('SemVer ANY') -// hoisted class for cyclic dependency -class Comparator { - static get ANY () { - return ANY - } - - constructor (comp, options) { - options = parseOptions(options) - - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } - - comp = comp.trim().split(/\s+/).join(' ') - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) - - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } - - debug('comp', this) - } - - parse (comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - const m = comp.match(r) - - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`) - } - - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } - } - - toString () { - return this.value - } - - test (version) { - debug('Comparator.test', version, this.options.loose) - - if (this.semver === ANY || version === ANY) { - return true - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - return cmp(version, this.operator, this.semver, this.options) - } - - intersects (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } - - if (this.operator === '') { - if (this.value === '') { - return true - } - return new Range(comp.value, options).test(this.value) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - return new Range(this.value, options).test(comp.semver) - } - - options = parseOptions(options) - - // Special cases where nothing can possibly be lower - if (options.includePrerelease && - (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { - return false - } - if (!options.includePrerelease && - (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { - return false - } - - // Same direction increasing (> or >=) - if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { - return true - } - // Same direction decreasing (< or <=) - if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { - return true - } - // same SemVer and both sides are inclusive (<= or >=) - if ( - (this.semver.version === comp.semver.version) && - this.operator.includes('=') && comp.operator.includes('=')) { - return true - } - // opposite directions less than - if (cmp(this.semver, '<', comp.semver, options) && - this.operator.startsWith('>') && comp.operator.startsWith('<')) { - return true - } - // opposite directions greater than - if (cmp(this.semver, '>', comp.semver, options) && - this.operator.startsWith('<') && comp.operator.startsWith('>')) { - return true - } - return false - } -} - -module.exports = Comparator - -const parseOptions = require('../internal/parse-options') -const { safeRe: re, t } = require('../internal/re') -const cmp = require('../functions/cmp') -const debug = require('../internal/debug') -const SemVer = require('./semver') -const Range = require('./range') diff --git a/node_modules/semver/classes/index.js b/node_modules/semver/classes/index.js deleted file mode 100644 index 5e3f5c9b1..000000000 --- a/node_modules/semver/classes/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - SemVer: require('./semver.js'), - Range: require('./range.js'), - Comparator: require('./comparator.js'), -} diff --git a/node_modules/semver/classes/range.js b/node_modules/semver/classes/range.js deleted file mode 100644 index 7e7c41410..000000000 --- a/node_modules/semver/classes/range.js +++ /dev/null @@ -1,539 +0,0 @@ -// hoisted class for cyclic dependency -class Range { - constructor (range, options) { - options = parseOptions(options) - - if (range instanceof Range) { - if ( - range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease - ) { - return range - } else { - return new Range(range.raw, options) - } - } - - if (range instanceof Comparator) { - // just put it in the set and return - this.raw = range.value - this.set = [[range]] - this.format() - return this - } - - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease - - // First reduce all whitespace as much as possible so we do not have to rely - // on potentially slow regexes like \s*. This is then stored and used for - // future error messages as well. - this.raw = range - .trim() - .split(/\s+/) - .join(' ') - - // First, split on || - this.set = this.raw - .split('||') - // map the range to a 2d array of comparators - .map(r => this.parseRange(r.trim())) - // throw out any comparator lists that are empty - // this generally means that it was not a valid range, which is allowed - // in loose mode, but will still throw if the WHOLE range is invalid. - .filter(c => c.length) - - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${this.raw}`) - } - - // if we have any that are not the null set, throw out null sets. - if (this.set.length > 1) { - // keep the first one, in case they're all null sets - const first = this.set[0] - this.set = this.set.filter(c => !isNullSet(c[0])) - if (this.set.length === 0) { - this.set = [first] - } else if (this.set.length > 1) { - // if we have any that are *, then the range is just * - for (const c of this.set) { - if (c.length === 1 && isAny(c[0])) { - this.set = [c] - break - } - } - } - } - - this.format() - } - - format () { - this.range = this.set - .map((comps) => comps.join(' ').trim()) - .join('||') - .trim() - return this.range - } - - toString () { - return this.range - } - - parseRange (range) { - // memoize range parsing for performance. - // this is a very hot path, and fully deterministic. - const memoOpts = - (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | - (this.options.loose && FLAG_LOOSE) - const memoKey = memoOpts + ':' + range - const cached = cache.get(memoKey) - if (cached) { - return cached - } - - const loose = this.options.loose - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) - debug('hyphen replace', range) - - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range) - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - debug('tilde trim', range) - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) - debug('caret trim', range) - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - let rangeList = range - .split(' ') - .map(comp => parseComparator(comp, this.options)) - .join(' ') - .split(/\s+/) - // >=0.0.0 is equivalent to * - .map(comp => replaceGTE0(comp, this.options)) - - if (loose) { - // in loose mode, throw out any that are not valid comparators - rangeList = rangeList.filter(comp => { - debug('loose invalid filter', comp, this.options) - return !!comp.match(re[t.COMPARATORLOOSE]) - }) - } - debug('range list', rangeList) - - // if any comparators are the null set, then replace with JUST null set - // if more than one comparator, remove any * comparators - // also, don't include the same comparator more than once - const rangeMap = new Map() - const comparators = rangeList.map(comp => new Comparator(comp, this.options)) - for (const comp of comparators) { - if (isNullSet(comp)) { - return [comp] - } - rangeMap.set(comp.value, comp) - } - if (rangeMap.size > 1 && rangeMap.has('')) { - rangeMap.delete('') - } - - const result = [...rangeMap.values()] - cache.set(memoKey, result) - return result - } - - intersects (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } - - return this.set.some((thisComparators) => { - return ( - isSatisfiable(thisComparators, options) && - range.set.some((rangeComparators) => { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) - } - - // if ANY of the sets match ALL of its comparators, then pass - test (version) { - if (!version) { - return false - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false - } -} - -module.exports = Range - -const LRU = require('lru-cache') -const cache = new LRU({ max: 1000 }) - -const parseOptions = require('../internal/parse-options') -const Comparator = require('./comparator') -const debug = require('../internal/debug') -const SemVer = require('./semver') -const { - safeRe: re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace, -} = require('../internal/re') -const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants') - -const isNullSet = c => c.value === '<0.0.0-0' -const isAny = c => c.value === '' - -// take a set of comparators and determine whether there -// exists a version which can satisfy it -const isSatisfiable = (comparators, options) => { - let result = true - const remainingComparators = comparators.slice() - let testComparator = remainingComparators.pop() - - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options) - }) - - testComparator = remainingComparators.pop() - } - - return result -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -const parseComparator = (comp, options) => { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} - -const isX = id => !id || id.toLowerCase() === 'x' || id === '*' - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 -// ~0.0.1 --> >=0.0.1 <0.1.0-0 -const replaceTildes = (comp, options) => { - return comp - .trim() - .split(/\s+/) - .map((c) => replaceTilde(c, options)) - .join(' ') -} - -const replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, (_, M, m, p, pr) => { - debug('tilde', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0` - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0-0 - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` - } else if (pr) { - debug('replaceTilde pr', pr) - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } else { - // ~1.2.3 == >=1.2.3 <1.3.0-0 - ret = `>=${M}.${m}.${p - } <${M}.${+m + 1}.0-0` - } - - debug('tilde return', ret) - return ret - }) -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 -// ^1.2.3 --> >=1.2.3 <2.0.0-0 -// ^1.2.0 --> >=1.2.0 <2.0.0-0 -// ^0.0.1 --> >=0.0.1 <0.0.2-0 -// ^0.1.0 --> >=0.1.0 <0.2.0-0 -const replaceCarets = (comp, options) => { - return comp - .trim() - .split(/\s+/) - .map((c) => replaceCaret(c, options)) - .join(' ') -} - -const replaceCaret = (comp, options) => { - debug('caret', comp, options) - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - const z = options.includePrerelease ? '-0' : '' - return comp.replace(r, (_, M, m, p, pr) => { - debug('caret', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` - } else if (isX(p)) { - if (M === '0') { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` - } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${+M + 1}.0.0-0` - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p - }${z} <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p - }${z} <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p - } <${+M + 1}.0.0-0` - } - } - - debug('caret return', ret) - return ret - }) -} - -const replaceXRanges = (comp, options) => { - debug('replaceXRanges', comp, options) - return comp - .split(/\s+/) - .map((c) => replaceXRange(c, options)) - .join(' ') -} - -const replaceXRange = (comp, options) => { - comp = comp.trim() - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - const xM = isX(M) - const xm = xM || isX(m) - const xp = xm || isX(p) - const anyX = xp - - if (gtlt === '=' && anyX) { - gtlt = '' - } - - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } - - if (gtlt === '<') { - pr = '-0' - } - - ret = `${gtlt + M}.${m}.${p}${pr}` - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` - } else if (xp) { - ret = `>=${M}.${m}.0${pr - } <${M}.${+m + 1}.0-0` - } - - debug('xRange return', ret) - - return ret - }) -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -const replaceStars = (comp, options) => { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp - .trim() - .replace(re[t.STAR], '') -} - -const replaceGTE0 = (comp, options) => { - debug('replaceGTE0', comp, options) - return comp - .trim() - .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') -} - -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 -const hyphenReplace = incPr => ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) => { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? '-0' : ''}` - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` - } else if (fpr) { - from = `>=${from}` - } else { - from = `>=${from}${incPr ? '-0' : ''}` - } - - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = `<${+tM + 1}.0.0-0` - } else if (isX(tp)) { - to = `<${tM}.${+tm + 1}.0-0` - } else if (tpr) { - to = `<=${tM}.${tm}.${tp}-${tpr}` - } else if (incPr) { - to = `<${tM}.${tm}.${+tp + 1}-0` - } else { - to = `<=${to}` - } - - return `${from} ${to}`.trim() -} - -const testSet = (set, version, options) => { - for (let i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } - - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (let i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === Comparator.ANY) { - continue - } - - if (set[i].semver.prerelease.length > 0) { - const allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false - } - - return true -} diff --git a/node_modules/semver/classes/semver.js b/node_modules/semver/classes/semver.js deleted file mode 100644 index 84e84590e..000000000 --- a/node_modules/semver/classes/semver.js +++ /dev/null @@ -1,302 +0,0 @@ -const debug = require('../internal/debug') -const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') -const { safeRe: re, t } = require('../internal/re') - -const parseOptions = require('../internal/parse-options') -const { compareIdentifiers } = require('../internal/identifiers') -class SemVer { - constructor (version, options) { - options = parseOptions(options) - - if (version instanceof SemVer) { - if (version.loose === !!options.loose && - version.includePrerelease === !!options.includePrerelease) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) - } - - if (version.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ) - } - - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - // this isn't actually relevant for versions, but keep it so that we - // don't run into trouble passing this.options around. - this.includePrerelease = !!options.includePrerelease - - const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) - - if (!m) { - throw new TypeError(`Invalid Version: ${version}`) - } - - this.raw = version - - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } - - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } - - this.build = m[5] ? m[5].split('.') : [] - this.format() - } - - format () { - this.version = `${this.major}.${this.minor}.${this.patch}` - if (this.prerelease.length) { - this.version += `-${this.prerelease.join('.')}` - } - return this.version - } - - toString () { - return this.version - } - - compare (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - if (typeof other === 'string' && other === this.version) { - return 0 - } - other = new SemVer(other, this.options) - } - - if (other.version === this.version) { - return 0 - } - - return this.compareMain(other) || this.comparePre(other) - } - - compareMain (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return ( - compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) - ) - } - - comparePre (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } - - let i = 0 - do { - const a = this.prerelease[i] - const b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - compareBuild (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - let i = 0 - do { - const a = this.build[i] - const b = other.build[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc (release, identifier, identifierBase) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier, identifierBase) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier, identifierBase) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier, identifierBase) - this.inc('pre', identifier, identifierBase) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier, identifierBase) - } - this.inc('pre', identifier, identifierBase) - break - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if ( - this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0 - ) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. - case 'pre': { - const base = Number(identifierBase) ? 1 : 0 - - if (!identifier && identifierBase === false) { - throw new Error('invalid increment argument: identifier is empty') - } - - if (this.prerelease.length === 0) { - this.prerelease = [base] - } else { - let i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - if (identifier === this.prerelease.join('.') && identifierBase === false) { - throw new Error('invalid increment argument: identifier already exists') - } - this.prerelease.push(base) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - let prerelease = [identifier, base] - if (identifierBase === false) { - prerelease = [identifier] - } - if (compareIdentifiers(this.prerelease[0], identifier) === 0) { - if (isNaN(this.prerelease[1])) { - this.prerelease = prerelease - } - } else { - this.prerelease = prerelease - } - } - break - } - default: - throw new Error(`invalid increment argument: ${release}`) - } - this.raw = this.format() - if (this.build.length) { - this.raw += `+${this.build.join('.')}` - } - return this - } -} - -module.exports = SemVer diff --git a/node_modules/semver/functions/clean.js b/node_modules/semver/functions/clean.js deleted file mode 100644 index 811fe6b82..000000000 --- a/node_modules/semver/functions/clean.js +++ /dev/null @@ -1,6 +0,0 @@ -const parse = require('./parse') -const clean = (version, options) => { - const s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} -module.exports = clean diff --git a/node_modules/semver/functions/cmp.js b/node_modules/semver/functions/cmp.js deleted file mode 100644 index 401190947..000000000 --- a/node_modules/semver/functions/cmp.js +++ /dev/null @@ -1,52 +0,0 @@ -const eq = require('./eq') -const neq = require('./neq') -const gt = require('./gt') -const gte = require('./gte') -const lt = require('./lt') -const lte = require('./lte') - -const cmp = (a, op, b, loose) => { - switch (op) { - case '===': - if (typeof a === 'object') { - a = a.version - } - if (typeof b === 'object') { - b = b.version - } - return a === b - - case '!==': - if (typeof a === 'object') { - a = a.version - } - if (typeof b === 'object') { - b = b.version - } - return a !== b - - case '': - case '=': - case '==': - return eq(a, b, loose) - - case '!=': - return neq(a, b, loose) - - case '>': - return gt(a, b, loose) - - case '>=': - return gte(a, b, loose) - - case '<': - return lt(a, b, loose) - - case '<=': - return lte(a, b, loose) - - default: - throw new TypeError(`Invalid operator: ${op}`) - } -} -module.exports = cmp diff --git a/node_modules/semver/functions/coerce.js b/node_modules/semver/functions/coerce.js deleted file mode 100644 index febbff9c2..000000000 --- a/node_modules/semver/functions/coerce.js +++ /dev/null @@ -1,52 +0,0 @@ -const SemVer = require('../classes/semver') -const parse = require('./parse') -const { safeRe: re, t } = require('../internal/re') - -const coerce = (version, options) => { - if (version instanceof SemVer) { - return version - } - - if (typeof version === 'number') { - version = String(version) - } - - if (typeof version !== 'string') { - return null - } - - options = options || {} - - let match = null - if (!options.rtl) { - match = version.match(re[t.COERCE]) - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - let next - while ((next = re[t.COERCERTL].exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next - } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length - } - // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 - } - - if (match === null) { - return null - } - - return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) -} -module.exports = coerce diff --git a/node_modules/semver/functions/compare-build.js b/node_modules/semver/functions/compare-build.js deleted file mode 100644 index 9eb881bef..000000000 --- a/node_modules/semver/functions/compare-build.js +++ /dev/null @@ -1,7 +0,0 @@ -const SemVer = require('../classes/semver') -const compareBuild = (a, b, loose) => { - const versionA = new SemVer(a, loose) - const versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} -module.exports = compareBuild diff --git a/node_modules/semver/functions/compare-loose.js b/node_modules/semver/functions/compare-loose.js deleted file mode 100644 index 4881fbe00..000000000 --- a/node_modules/semver/functions/compare-loose.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const compareLoose = (a, b) => compare(a, b, true) -module.exports = compareLoose diff --git a/node_modules/semver/functions/compare.js b/node_modules/semver/functions/compare.js deleted file mode 100644 index 748b7afa5..000000000 --- a/node_modules/semver/functions/compare.js +++ /dev/null @@ -1,5 +0,0 @@ -const SemVer = require('../classes/semver') -const compare = (a, b, loose) => - new SemVer(a, loose).compare(new SemVer(b, loose)) - -module.exports = compare diff --git a/node_modules/semver/functions/diff.js b/node_modules/semver/functions/diff.js deleted file mode 100644 index fc224e302..000000000 --- a/node_modules/semver/functions/diff.js +++ /dev/null @@ -1,65 +0,0 @@ -const parse = require('./parse.js') - -const diff = (version1, version2) => { - const v1 = parse(version1, null, true) - const v2 = parse(version2, null, true) - const comparison = v1.compare(v2) - - if (comparison === 0) { - return null - } - - const v1Higher = comparison > 0 - const highVersion = v1Higher ? v1 : v2 - const lowVersion = v1Higher ? v2 : v1 - const highHasPre = !!highVersion.prerelease.length - const lowHasPre = !!lowVersion.prerelease.length - - if (lowHasPre && !highHasPre) { - // Going from prerelease -> no prerelease requires some special casing - - // If the low version has only a major, then it will always be a major - // Some examples: - // 1.0.0-1 -> 1.0.0 - // 1.0.0-1 -> 1.1.1 - // 1.0.0-1 -> 2.0.0 - if (!lowVersion.patch && !lowVersion.minor) { - return 'major' - } - - // Otherwise it can be determined by checking the high version - - if (highVersion.patch) { - // anything higher than a patch bump would result in the wrong version - return 'patch' - } - - if (highVersion.minor) { - // anything higher than a minor bump would result in the wrong version - return 'minor' - } - - // bumping major/minor/patch all have same result - return 'major' - } - - // add the `pre` prefix if we are going to a prerelease version - const prefix = highHasPre ? 'pre' : '' - - if (v1.major !== v2.major) { - return prefix + 'major' - } - - if (v1.minor !== v2.minor) { - return prefix + 'minor' - } - - if (v1.patch !== v2.patch) { - return prefix + 'patch' - } - - // high and low are preleases - return 'prerelease' -} - -module.exports = diff diff --git a/node_modules/semver/functions/eq.js b/node_modules/semver/functions/eq.js deleted file mode 100644 index 271fed976..000000000 --- a/node_modules/semver/functions/eq.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const eq = (a, b, loose) => compare(a, b, loose) === 0 -module.exports = eq diff --git a/node_modules/semver/functions/gt.js b/node_modules/semver/functions/gt.js deleted file mode 100644 index d9b2156d8..000000000 --- a/node_modules/semver/functions/gt.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const gt = (a, b, loose) => compare(a, b, loose) > 0 -module.exports = gt diff --git a/node_modules/semver/functions/gte.js b/node_modules/semver/functions/gte.js deleted file mode 100644 index 5aeaa6347..000000000 --- a/node_modules/semver/functions/gte.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const gte = (a, b, loose) => compare(a, b, loose) >= 0 -module.exports = gte diff --git a/node_modules/semver/functions/inc.js b/node_modules/semver/functions/inc.js deleted file mode 100644 index 7670b1bea..000000000 --- a/node_modules/semver/functions/inc.js +++ /dev/null @@ -1,19 +0,0 @@ -const SemVer = require('../classes/semver') - -const inc = (version, release, options, identifier, identifierBase) => { - if (typeof (options) === 'string') { - identifierBase = identifier - identifier = options - options = undefined - } - - try { - return new SemVer( - version instanceof SemVer ? version.version : version, - options - ).inc(release, identifier, identifierBase).version - } catch (er) { - return null - } -} -module.exports = inc diff --git a/node_modules/semver/functions/lt.js b/node_modules/semver/functions/lt.js deleted file mode 100644 index b440ab7d4..000000000 --- a/node_modules/semver/functions/lt.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const lt = (a, b, loose) => compare(a, b, loose) < 0 -module.exports = lt diff --git a/node_modules/semver/functions/lte.js b/node_modules/semver/functions/lte.js deleted file mode 100644 index 6dcc95650..000000000 --- a/node_modules/semver/functions/lte.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const lte = (a, b, loose) => compare(a, b, loose) <= 0 -module.exports = lte diff --git a/node_modules/semver/functions/major.js b/node_modules/semver/functions/major.js deleted file mode 100644 index 4283165e9..000000000 --- a/node_modules/semver/functions/major.js +++ /dev/null @@ -1,3 +0,0 @@ -const SemVer = require('../classes/semver') -const major = (a, loose) => new SemVer(a, loose).major -module.exports = major diff --git a/node_modules/semver/functions/minor.js b/node_modules/semver/functions/minor.js deleted file mode 100644 index 57b3455f8..000000000 --- a/node_modules/semver/functions/minor.js +++ /dev/null @@ -1,3 +0,0 @@ -const SemVer = require('../classes/semver') -const minor = (a, loose) => new SemVer(a, loose).minor -module.exports = minor diff --git a/node_modules/semver/functions/neq.js b/node_modules/semver/functions/neq.js deleted file mode 100644 index f944c0157..000000000 --- a/node_modules/semver/functions/neq.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const neq = (a, b, loose) => compare(a, b, loose) !== 0 -module.exports = neq diff --git a/node_modules/semver/functions/parse.js b/node_modules/semver/functions/parse.js deleted file mode 100644 index 459b3b173..000000000 --- a/node_modules/semver/functions/parse.js +++ /dev/null @@ -1,16 +0,0 @@ -const SemVer = require('../classes/semver') -const parse = (version, options, throwErrors = false) => { - if (version instanceof SemVer) { - return version - } - try { - return new SemVer(version, options) - } catch (er) { - if (!throwErrors) { - return null - } - throw er - } -} - -module.exports = parse diff --git a/node_modules/semver/functions/patch.js b/node_modules/semver/functions/patch.js deleted file mode 100644 index 63afca252..000000000 --- a/node_modules/semver/functions/patch.js +++ /dev/null @@ -1,3 +0,0 @@ -const SemVer = require('../classes/semver') -const patch = (a, loose) => new SemVer(a, loose).patch -module.exports = patch diff --git a/node_modules/semver/functions/prerelease.js b/node_modules/semver/functions/prerelease.js deleted file mode 100644 index 06aa13248..000000000 --- a/node_modules/semver/functions/prerelease.js +++ /dev/null @@ -1,6 +0,0 @@ -const parse = require('./parse') -const prerelease = (version, options) => { - const parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} -module.exports = prerelease diff --git a/node_modules/semver/functions/rcompare.js b/node_modules/semver/functions/rcompare.js deleted file mode 100644 index 0ac509e79..000000000 --- a/node_modules/semver/functions/rcompare.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const rcompare = (a, b, loose) => compare(b, a, loose) -module.exports = rcompare diff --git a/node_modules/semver/functions/rsort.js b/node_modules/semver/functions/rsort.js deleted file mode 100644 index 82404c5cf..000000000 --- a/node_modules/semver/functions/rsort.js +++ /dev/null @@ -1,3 +0,0 @@ -const compareBuild = require('./compare-build') -const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) -module.exports = rsort diff --git a/node_modules/semver/functions/satisfies.js b/node_modules/semver/functions/satisfies.js deleted file mode 100644 index 50af1c199..000000000 --- a/node_modules/semver/functions/satisfies.js +++ /dev/null @@ -1,10 +0,0 @@ -const Range = require('../classes/range') -const satisfies = (version, range, options) => { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} -module.exports = satisfies diff --git a/node_modules/semver/functions/sort.js b/node_modules/semver/functions/sort.js deleted file mode 100644 index 4d10917ab..000000000 --- a/node_modules/semver/functions/sort.js +++ /dev/null @@ -1,3 +0,0 @@ -const compareBuild = require('./compare-build') -const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) -module.exports = sort diff --git a/node_modules/semver/functions/valid.js b/node_modules/semver/functions/valid.js deleted file mode 100644 index f27bae107..000000000 --- a/node_modules/semver/functions/valid.js +++ /dev/null @@ -1,6 +0,0 @@ -const parse = require('./parse') -const valid = (version, options) => { - const v = parse(version, options) - return v ? v.version : null -} -module.exports = valid diff --git a/node_modules/semver/index.js b/node_modules/semver/index.js deleted file mode 100644 index 86d42ac16..000000000 --- a/node_modules/semver/index.js +++ /dev/null @@ -1,89 +0,0 @@ -// just pre-load all the stuff that index.js lazily exports -const internalRe = require('./internal/re') -const constants = require('./internal/constants') -const SemVer = require('./classes/semver') -const identifiers = require('./internal/identifiers') -const parse = require('./functions/parse') -const valid = require('./functions/valid') -const clean = require('./functions/clean') -const inc = require('./functions/inc') -const diff = require('./functions/diff') -const major = require('./functions/major') -const minor = require('./functions/minor') -const patch = require('./functions/patch') -const prerelease = require('./functions/prerelease') -const compare = require('./functions/compare') -const rcompare = require('./functions/rcompare') -const compareLoose = require('./functions/compare-loose') -const compareBuild = require('./functions/compare-build') -const sort = require('./functions/sort') -const rsort = require('./functions/rsort') -const gt = require('./functions/gt') -const lt = require('./functions/lt') -const eq = require('./functions/eq') -const neq = require('./functions/neq') -const gte = require('./functions/gte') -const lte = require('./functions/lte') -const cmp = require('./functions/cmp') -const coerce = require('./functions/coerce') -const Comparator = require('./classes/comparator') -const Range = require('./classes/range') -const satisfies = require('./functions/satisfies') -const toComparators = require('./ranges/to-comparators') -const maxSatisfying = require('./ranges/max-satisfying') -const minSatisfying = require('./ranges/min-satisfying') -const minVersion = require('./ranges/min-version') -const validRange = require('./ranges/valid') -const outside = require('./ranges/outside') -const gtr = require('./ranges/gtr') -const ltr = require('./ranges/ltr') -const intersects = require('./ranges/intersects') -const simplifyRange = require('./ranges/simplify') -const subset = require('./ranges/subset') -module.exports = { - parse, - valid, - clean, - inc, - diff, - major, - minor, - patch, - prerelease, - compare, - rcompare, - compareLoose, - compareBuild, - sort, - rsort, - gt, - lt, - eq, - neq, - gte, - lte, - cmp, - coerce, - Comparator, - Range, - satisfies, - toComparators, - maxSatisfying, - minSatisfying, - minVersion, - validRange, - outside, - gtr, - ltr, - intersects, - simplifyRange, - subset, - SemVer, - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, - RELEASE_TYPES: constants.RELEASE_TYPES, - compareIdentifiers: identifiers.compareIdentifiers, - rcompareIdentifiers: identifiers.rcompareIdentifiers, -} diff --git a/node_modules/semver/internal/constants.js b/node_modules/semver/internal/constants.js deleted file mode 100644 index 94be1c570..000000000 --- a/node_modules/semver/internal/constants.js +++ /dev/null @@ -1,35 +0,0 @@ -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -const SEMVER_SPEC_VERSION = '2.0.0' - -const MAX_LENGTH = 256 -const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || -/* istanbul ignore next */ 9007199254740991 - -// Max safe segment length for coercion. -const MAX_SAFE_COMPONENT_LENGTH = 16 - -// Max safe length for a build identifier. The max length minus 6 characters for -// the shortest version with a build 0.0.0+BUILD. -const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 - -const RELEASE_TYPES = [ - 'major', - 'premajor', - 'minor', - 'preminor', - 'patch', - 'prepatch', - 'prerelease', -] - -module.exports = { - MAX_LENGTH, - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_SAFE_INTEGER, - RELEASE_TYPES, - SEMVER_SPEC_VERSION, - FLAG_INCLUDE_PRERELEASE: 0b001, - FLAG_LOOSE: 0b010, -} diff --git a/node_modules/semver/internal/debug.js b/node_modules/semver/internal/debug.js deleted file mode 100644 index 1c00e1369..000000000 --- a/node_modules/semver/internal/debug.js +++ /dev/null @@ -1,9 +0,0 @@ -const debug = ( - typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG) -) ? (...args) => console.error('SEMVER', ...args) - : () => {} - -module.exports = debug diff --git a/node_modules/semver/internal/identifiers.js b/node_modules/semver/internal/identifiers.js deleted file mode 100644 index e612d0a3d..000000000 --- a/node_modules/semver/internal/identifiers.js +++ /dev/null @@ -1,23 +0,0 @@ -const numeric = /^[0-9]+$/ -const compareIdentifiers = (a, b) => { - const anum = numeric.test(a) - const bnum = numeric.test(b) - - if (anum && bnum) { - a = +a - b = +b - } - - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} - -const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) - -module.exports = { - compareIdentifiers, - rcompareIdentifiers, -} diff --git a/node_modules/semver/internal/parse-options.js b/node_modules/semver/internal/parse-options.js deleted file mode 100644 index 10d64ce06..000000000 --- a/node_modules/semver/internal/parse-options.js +++ /dev/null @@ -1,15 +0,0 @@ -// parse out just the options we care about -const looseOption = Object.freeze({ loose: true }) -const emptyOpts = Object.freeze({ }) -const parseOptions = options => { - if (!options) { - return emptyOpts - } - - if (typeof options !== 'object') { - return looseOption - } - - return options -} -module.exports = parseOptions diff --git a/node_modules/semver/internal/re.js b/node_modules/semver/internal/re.js deleted file mode 100644 index 21150b3ec..000000000 --- a/node_modules/semver/internal/re.js +++ /dev/null @@ -1,212 +0,0 @@ -const { - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_LENGTH, -} = require('./constants') -const debug = require('./debug') -exports = module.exports = {} - -// The actual regexps go on exports.re -const re = exports.re = [] -const safeRe = exports.safeRe = [] -const src = exports.src = [] -const t = exports.t = {} -let R = 0 - -const LETTERDASHNUMBER = '[a-zA-Z0-9-]' - -// Replace some greedy regex tokens to prevent regex dos issues. These regex are -// used internally via the safeRe object since all inputs in this library get -// normalized first to trim and collapse all extra whitespace. The original -// regexes are exported for userland consumption and lower level usage. A -// future breaking change could export the safer regex only with a note that -// all input should have extra whitespace removed. -const safeRegexReplacements = [ - ['\\s', 1], - ['\\d', MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], -] - -const makeSafeRegex = (value) => { - for (const [token, max] of safeRegexReplacements) { - value = value - .split(`${token}*`).join(`${token}{0,${max}}`) - .split(`${token}+`).join(`${token}{1,${max}}`) - } - return value -} - -const createToken = (name, value, isGlobal) => { - const safe = makeSafeRegex(value) - const index = R++ - debug(name, index, value) - t[name] = index - src[index] = value - re[index] = new RegExp(value, isGlobal ? 'g' : undefined) - safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) -} - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') -createToken('NUMERICIDENTIFIERLOOSE', '\\d+') - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) - -// ## Main Version -// Three dot-separated numeric identifiers. - -createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})`) - -createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})`) - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] -}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) - -createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] -}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] -}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -createToken('FULLPLAIN', `v?${src[t.MAINVERSION] -}${src[t.PRERELEASE]}?${ - src[t.BUILD]}?`) - -createToken('FULL', `^${src[t.FULLPLAIN]}$`) - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] -}${src[t.PRERELEASELOOSE]}?${ - src[t.BUILD]}?`) - -createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) - -createToken('GTLT', '((?:<|>)?=?)') - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) -createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) - -createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:${src[t.PRERELEASE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:${src[t.PRERELEASELOOSE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) -createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -createToken('COERCE', `${'(^|[^\\d])' + - '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:$|[^\\d])`) -createToken('COERCERTL', src[t.COERCE], true) - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -createToken('LONETILDE', '(?:~>?)') - -createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) -exports.tildeTrimReplace = '$1~' - -createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) -createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -createToken('LONECARET', '(?:\\^)') - -createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) -exports.caretTrimReplace = '$1^' - -createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) -createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) -createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] -}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) -exports.comparatorTrimReplace = '$1$2$3' - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAIN]})` + - `\\s*$`) - -createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAINLOOSE]})` + - `\\s*$`) - -// Star ranges basically just allow anything at all. -createToken('STAR', '(<|>)?=?\\s*\\*') -// >=0.0.0 is like a star -createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') -createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json deleted file mode 100644 index c145eca2f..000000000 --- a/node_modules/semver/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "semver", - "version": "7.5.4", - "description": "The semantic version parser used by npm.", - "main": "index.js", - "scripts": { - "test": "tap", - "snap": "tap", - "lint": "eslint \"**/*.js\"", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "posttest": "npm run lint", - "template-oss-apply": "template-oss-apply --force" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.17.0", - "tap": "^16.0.0" - }, - "license": "ISC", - "repository": { - "type": "git", - "url": "https://github.com/npm/node-semver.git" - }, - "bin": { - "semver": "bin/semver.js" - }, - "files": [ - "bin/", - "lib/", - "classes/", - "functions/", - "internal/", - "ranges/", - "index.js", - "preload.js", - "range.bnf" - ], - "tap": { - "timeout": 30, - "coverage-map": "map.js", - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - }, - "engines": { - "node": ">=10" - }, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "author": "GitHub Inc.", - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.17.0", - "engines": ">=10", - "ciVersions": [ - "10.0.0", - "10.x", - "12.x", - "14.x", - "16.x", - "18.x" - ], - "npmSpec": "8", - "distPaths": [ - "classes/", - "functions/", - "internal/", - "ranges/", - "index.js", - "preload.js", - "range.bnf" - ], - "allowPaths": [ - "/classes/", - "/functions/", - "/internal/", - "/ranges/", - "/index.js", - "/preload.js", - "/range.bnf" - ], - "publish": "true" - } -} diff --git a/node_modules/semver/preload.js b/node_modules/semver/preload.js deleted file mode 100644 index 947cd4f79..000000000 --- a/node_modules/semver/preload.js +++ /dev/null @@ -1,2 +0,0 @@ -// XXX remove in v8 or beyond -module.exports = require('./index.js') diff --git a/node_modules/semver/range.bnf b/node_modules/semver/range.bnf deleted file mode 100644 index d4c6ae0d7..000000000 --- a/node_modules/semver/range.bnf +++ /dev/null @@ -1,16 +0,0 @@ -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | [1-9] ( [0-9] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ diff --git a/node_modules/semver/ranges/gtr.js b/node_modules/semver/ranges/gtr.js deleted file mode 100644 index db7e35599..000000000 --- a/node_modules/semver/ranges/gtr.js +++ /dev/null @@ -1,4 +0,0 @@ -// Determine if version is greater than all the versions possible in the range. -const outside = require('./outside') -const gtr = (version, range, options) => outside(version, range, '>', options) -module.exports = gtr diff --git a/node_modules/semver/ranges/intersects.js b/node_modules/semver/ranges/intersects.js deleted file mode 100644 index e0e9b7ce0..000000000 --- a/node_modules/semver/ranges/intersects.js +++ /dev/null @@ -1,7 +0,0 @@ -const Range = require('../classes/range') -const intersects = (r1, r2, options) => { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2, options) -} -module.exports = intersects diff --git a/node_modules/semver/ranges/ltr.js b/node_modules/semver/ranges/ltr.js deleted file mode 100644 index 528a885eb..000000000 --- a/node_modules/semver/ranges/ltr.js +++ /dev/null @@ -1,4 +0,0 @@ -const outside = require('./outside') -// Determine if version is less than all the versions possible in the range -const ltr = (version, range, options) => outside(version, range, '<', options) -module.exports = ltr diff --git a/node_modules/semver/ranges/max-satisfying.js b/node_modules/semver/ranges/max-satisfying.js deleted file mode 100644 index 6e3d993c6..000000000 --- a/node_modules/semver/ranges/max-satisfying.js +++ /dev/null @@ -1,25 +0,0 @@ -const SemVer = require('../classes/semver') -const Range = require('../classes/range') - -const maxSatisfying = (versions, range, options) => { - let max = null - let maxSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} -module.exports = maxSatisfying diff --git a/node_modules/semver/ranges/min-satisfying.js b/node_modules/semver/ranges/min-satisfying.js deleted file mode 100644 index 9b60974e2..000000000 --- a/node_modules/semver/ranges/min-satisfying.js +++ /dev/null @@ -1,24 +0,0 @@ -const SemVer = require('../classes/semver') -const Range = require('../classes/range') -const minSatisfying = (versions, range, options) => { - let min = null - let minSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min -} -module.exports = minSatisfying diff --git a/node_modules/semver/ranges/min-version.js b/node_modules/semver/ranges/min-version.js deleted file mode 100644 index 350e1f783..000000000 --- a/node_modules/semver/ranges/min-version.js +++ /dev/null @@ -1,61 +0,0 @@ -const SemVer = require('../classes/semver') -const Range = require('../classes/range') -const gt = require('../functions/gt') - -const minVersion = (range, loose) => { - range = new Range(range, loose) - - let minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } - - minver = null - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] - - let setMin = null - comparators.forEach((comparator) => { - // Clone to avoid manipulating the comparator's semver object. - const compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!setMin || gt(compver, setMin)) { - setMin = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error(`Unexpected operation: ${comparator.operator}`) - } - }) - if (setMin && (!minver || gt(minver, setMin))) { - minver = setMin - } - } - - if (minver && range.test(minver)) { - return minver - } - - return null -} -module.exports = minVersion diff --git a/node_modules/semver/ranges/outside.js b/node_modules/semver/ranges/outside.js deleted file mode 100644 index ae99b10a5..000000000 --- a/node_modules/semver/ranges/outside.js +++ /dev/null @@ -1,80 +0,0 @@ -const SemVer = require('../classes/semver') -const Comparator = require('../classes/comparator') -const { ANY } = Comparator -const Range = require('../classes/range') -const satisfies = require('../functions/satisfies') -const gt = require('../functions/gt') -const lt = require('../functions/lt') -const lte = require('../functions/lte') -const gte = require('../functions/gte') - -const outside = (version, range, hilo, options) => { - version = new SemVer(version, options) - range = new Range(range, options) - - let gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } - - // If it satisfies the range it is not outside - if (satisfies(version, range, options)) { - return false - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] - - let high = null - let low = null - - comparators.forEach((comparator) => { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} - -module.exports = outside diff --git a/node_modules/semver/ranges/simplify.js b/node_modules/semver/ranges/simplify.js deleted file mode 100644 index 618d5b627..000000000 --- a/node_modules/semver/ranges/simplify.js +++ /dev/null @@ -1,47 +0,0 @@ -// given a set of versions and a range, create a "simplified" range -// that includes the same versions that the original range does -// If the original range is shorter than the simplified one, return that. -const satisfies = require('../functions/satisfies.js') -const compare = require('../functions/compare.js') -module.exports = (versions, range, options) => { - const set = [] - let first = null - let prev = null - const v = versions.sort((a, b) => compare(a, b, options)) - for (const version of v) { - const included = satisfies(version, range, options) - if (included) { - prev = version - if (!first) { - first = version - } - } else { - if (prev) { - set.push([first, prev]) - } - prev = null - first = null - } - } - if (first) { - set.push([first, null]) - } - - const ranges = [] - for (const [min, max] of set) { - if (min === max) { - ranges.push(min) - } else if (!max && min === v[0]) { - ranges.push('*') - } else if (!max) { - ranges.push(`>=${min}`) - } else if (min === v[0]) { - ranges.push(`<=${max}`) - } else { - ranges.push(`${min} - ${max}`) - } - } - const simplified = ranges.join(' || ') - const original = typeof range.raw === 'string' ? range.raw : String(range) - return simplified.length < original.length ? simplified : range -} diff --git a/node_modules/semver/ranges/subset.js b/node_modules/semver/ranges/subset.js deleted file mode 100644 index 1e5c26837..000000000 --- a/node_modules/semver/ranges/subset.js +++ /dev/null @@ -1,247 +0,0 @@ -const Range = require('../classes/range.js') -const Comparator = require('../classes/comparator.js') -const { ANY } = Comparator -const satisfies = require('../functions/satisfies.js') -const compare = require('../functions/compare.js') - -// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: -// - Every simple range `r1, r2, ...` is a null set, OR -// - Every simple range `r1, r2, ...` which is not a null set is a subset of -// some `R1, R2, ...` -// -// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: -// - If c is only the ANY comparator -// - If C is only the ANY comparator, return true -// - Else if in prerelease mode, return false -// - else replace c with `[>=0.0.0]` -// - If C is only the ANY comparator -// - if in prerelease mode, return true -// - else replace C with `[>=0.0.0]` -// - Let EQ be the set of = comparators in c -// - If EQ is more than one, return true (null set) -// - Let GT be the highest > or >= comparator in c -// - Let LT be the lowest < or <= comparator in c -// - If GT and LT, and GT.semver > LT.semver, return true (null set) -// - If any C is a = range, and GT or LT are set, return false -// - If EQ -// - If GT, and EQ does not satisfy GT, return true (null set) -// - If LT, and EQ does not satisfy LT, return true (null set) -// - If EQ satisfies every C, return true -// - Else return false -// - If GT -// - If GT.semver is lower than any > or >= comp in C, return false -// - If GT is >=, and GT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode -// - If no C has a prerelease and the GT.semver tuple, return false -// - If LT -// - If LT.semver is greater than any < or <= comp in C, return false -// - If LT is <=, and LT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode -// - If no C has a prerelease and the LT.semver tuple, return false -// - Else return true - -const subset = (sub, dom, options = {}) => { - if (sub === dom) { - return true - } - - sub = new Range(sub, options) - dom = new Range(dom, options) - let sawNonNull = false - - OUTER: for (const simpleSub of sub.set) { - for (const simpleDom of dom.set) { - const isSub = simpleSubset(simpleSub, simpleDom, options) - sawNonNull = sawNonNull || isSub !== null - if (isSub) { - continue OUTER - } - } - // the null set is a subset of everything, but null simple ranges in - // a complex range should be ignored. so if we saw a non-null range, - // then we know this isn't a subset, but if EVERY simple range was null, - // then it is a subset. - if (sawNonNull) { - return false - } - } - return true -} - -const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] -const minimumVersion = [new Comparator('>=0.0.0')] - -const simpleSubset = (sub, dom, options) => { - if (sub === dom) { - return true - } - - if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) { - return true - } else if (options.includePrerelease) { - sub = minimumVersionWithPreRelease - } else { - sub = minimumVersion - } - } - - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { - return true - } else { - dom = minimumVersion - } - } - - const eqSet = new Set() - let gt, lt - for (const c of sub) { - if (c.operator === '>' || c.operator === '>=') { - gt = higherGT(gt, c, options) - } else if (c.operator === '<' || c.operator === '<=') { - lt = lowerLT(lt, c, options) - } else { - eqSet.add(c.semver) - } - } - - if (eqSet.size > 1) { - return null - } - - let gtltComp - if (gt && lt) { - gtltComp = compare(gt.semver, lt.semver, options) - if (gtltComp > 0) { - return null - } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { - return null - } - } - - // will iterate one or zero times - for (const eq of eqSet) { - if (gt && !satisfies(eq, String(gt), options)) { - return null - } - - if (lt && !satisfies(eq, String(lt), options)) { - return null - } - - for (const c of dom) { - if (!satisfies(eq, String(c), options)) { - return false - } - } - - return true - } - - let higher, lower - let hasDomLT, hasDomGT - // if the subset has a prerelease, we need a comparator in the superset - // with the same tuple and a prerelease, or it's not a subset - let needDomLTPre = lt && - !options.includePrerelease && - lt.semver.prerelease.length ? lt.semver : false - let needDomGTPre = gt && - !options.includePrerelease && - gt.semver.prerelease.length ? gt.semver : false - // exception: <1.2.3-0 is the same as <1.2.3 - if (needDomLTPre && needDomLTPre.prerelease.length === 1 && - lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { - needDomLTPre = false - } - - for (const c of dom) { - hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' - hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' - if (gt) { - if (needDomGTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomGTPre.major && - c.semver.minor === needDomGTPre.minor && - c.semver.patch === needDomGTPre.patch) { - needDomGTPre = false - } - } - if (c.operator === '>' || c.operator === '>=') { - higher = higherGT(gt, c, options) - if (higher === c && higher !== gt) { - return false - } - } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { - return false - } - } - if (lt) { - if (needDomLTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomLTPre.major && - c.semver.minor === needDomLTPre.minor && - c.semver.patch === needDomLTPre.patch) { - needDomLTPre = false - } - } - if (c.operator === '<' || c.operator === '<=') { - lower = lowerLT(lt, c, options) - if (lower === c && lower !== lt) { - return false - } - } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { - return false - } - } - if (!c.operator && (lt || gt) && gtltComp !== 0) { - return false - } - } - - // if there was a < or >, and nothing in the dom, then must be false - // UNLESS it was limited by another range in the other direction. - // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 - if (gt && hasDomLT && !lt && gtltComp !== 0) { - return false - } - - if (lt && hasDomGT && !gt && gtltComp !== 0) { - return false - } - - // we needed a prerelease range in a specific tuple, but didn't get one - // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, - // because it includes prereleases in the 1.2.3 tuple - if (needDomGTPre || needDomLTPre) { - return false - } - - return true -} - -// >=1.2.3 is lower than >1.2.3 -const higherGT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp > 0 ? a - : comp < 0 ? b - : b.operator === '>' && a.operator === '>=' ? b - : a -} - -// <=1.2.3 is higher than <1.2.3 -const lowerLT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp < 0 ? a - : comp > 0 ? b - : b.operator === '<' && a.operator === '<=' ? b - : a -} - -module.exports = subset diff --git a/node_modules/semver/ranges/to-comparators.js b/node_modules/semver/ranges/to-comparators.js deleted file mode 100644 index 6c8bc7e6f..000000000 --- a/node_modules/semver/ranges/to-comparators.js +++ /dev/null @@ -1,8 +0,0 @@ -const Range = require('../classes/range') - -// Mostly just for testing and legacy API reasons -const toComparators = (range, options) => - new Range(range, options).set - .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) - -module.exports = toComparators diff --git a/node_modules/semver/ranges/valid.js b/node_modules/semver/ranges/valid.js deleted file mode 100644 index 365f35689..000000000 --- a/node_modules/semver/ranges/valid.js +++ /dev/null @@ -1,11 +0,0 @@ -const Range = require('../classes/range') -const validRange = (range, options) => { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } -} -module.exports = validRange diff --git a/node_modules/signal-exit/LICENSE.txt b/node_modules/signal-exit/LICENSE.txt deleted file mode 100644 index 954f2fa82..000000000 --- a/node_modules/signal-exit/LICENSE.txt +++ /dev/null @@ -1,16 +0,0 @@ -The ISC License - -Copyright (c) 2015-2023 Benjamin Coe, Isaac Z. Schlueter, and Contributors - -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. diff --git a/node_modules/signal-exit/README.md b/node_modules/signal-exit/README.md deleted file mode 100644 index f8e6d9d2b..000000000 --- a/node_modules/signal-exit/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# signal-exit - -When you want to fire an event no matter how a process exits: - -- reaching the end of execution. -- explicitly having `process.exit(code)` called. -- having `process.kill(pid, sig)` called. -- receiving a fatal signal from outside the process - -Use `signal-exit`. - -```js -// Hybrid module, either works -import { onExit } from 'signal-exit' -// or: -// const { onExit } = require('signal-exit') - -onExit((code, signal) => { - console.log('process exited!', code, signal) -}) -``` - -## API - -`remove = onExit((code, signal) => {}, options)` - -The return value of the function is a function that will remove -the handler. - -Note that the function _only_ fires for signals if the signal -would cause the process to exit. That is, there are no other -listeners, and it is a fatal signal. - -If the global `process` object is not suitable for this purpose -(ie, it's unset, or doesn't have an `emit` method, etc.) then the -`onExit` function is a no-op that returns a no-op `remove` method. - -### Options - -- `alwaysLast`: Run this handler after any other signal or exit - handlers. This causes `process.emit` to be monkeypatched. - -### Browser Fallback - -The `'signal-exit/browser'` module is the same fallback shim that -just doesn't do anything, but presents the same function -interface. - -Patches welcome to add something that hooks onto -`window.onbeforeunload` or similar, but it might just not be a -thing that makes sense there. diff --git a/node_modules/signal-exit/dist/cjs/browser.d.ts b/node_modules/signal-exit/dist/cjs/browser.d.ts deleted file mode 100644 index 90f2e3f11..000000000 --- a/node_modules/signal-exit/dist/cjs/browser.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * This is a browser shim that provides the same functional interface - * as the main node export, but it does nothing. - * @module - */ -import type { Handler } from './index.js'; -export declare const onExit: (cb: Handler, opts: { - alwaysLast?: boolean; -}) => () => void; -export declare const load: () => void; -export declare const unload: () => void; -//# sourceMappingURL=browser.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/browser.d.ts.map b/node_modules/signal-exit/dist/cjs/browser.d.ts.map deleted file mode 100644 index aacc1d3b6..000000000 --- a/node_modules/signal-exit/dist/cjs/browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,eAAO,MAAM,MAAM,EAAE,CACnB,EAAE,EAAE,OAAO,EACX,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,KAC3B,MAAM,IAAqB,CAAA;AAChC,eAAO,MAAM,IAAI,YAAW,CAAA;AAC5B,eAAO,MAAM,MAAM,YAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/browser.js b/node_modules/signal-exit/dist/cjs/browser.js deleted file mode 100644 index 614fbf010..000000000 --- a/node_modules/signal-exit/dist/cjs/browser.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.unload = exports.load = exports.onExit = void 0; -const onExit = () => () => { }; -exports.onExit = onExit; -const load = () => { }; -exports.load = load; -const unload = () => { }; -exports.unload = unload; -//# sourceMappingURL=browser.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/browser.js.map b/node_modules/signal-exit/dist/cjs/browser.js.map deleted file mode 100644 index 342cf2e20..000000000 --- a/node_modules/signal-exit/dist/cjs/browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":";;;AAMO,MAAM,MAAM,GAGD,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAA;AAHnB,QAAA,MAAM,UAGa;AACzB,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;AAAf,QAAA,IAAI,QAAW;AACrB,MAAM,MAAM,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;AAAjB,QAAA,MAAM,UAAW","sourcesContent":["/**\n * This is a browser shim that provides the same functional interface\n * as the main node export, but it does nothing.\n * @module\n */\nimport type { Handler } from './index.js'\nexport const onExit: (\n cb: Handler,\n opts: { alwaysLast?: boolean }\n) => () => void = () => () => {}\nexport const load = () => {}\nexport const unload = () => {}\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/index.d.ts b/node_modules/signal-exit/dist/cjs/index.d.ts deleted file mode 100644 index 18a4cc653..000000000 --- a/node_modules/signal-exit/dist/cjs/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/// -import { signals } from './signals.js'; -export { signals }; -/** - * A function that takes an exit code and signal as arguments - */ -export type Handler = (code: number | null | undefined, signal: NodeJS.Signals | null) => any; -export declare const -/** - * Called when the process is exiting, whether via signal, explicit - * exit, or running out of stuff to do. - * - * If the global process object is not suitable for instrumentation, - * then this will be a no-op. - * - * Returns a function that may be used to unload signal-exit. - */ -onExit: (cb: Handler, opts?: { - alwaysLast?: boolean | undefined; -} | undefined) => () => void, -/** - * Load the listeners. Likely you never need to call this, unless - * doing a rather deep integration with signal-exit functionality. - * Mostly exposed for the benefit of testing. - * - * @internal - */ -load: () => void, -/** - * Unload the listeners. Likely you never need to call this, unless - * doing a rather deep integration with signal-exit functionality. - * Mostly exposed for the benefit of testing. - * - * @internal - */ -unload: () => void; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/index.d.ts.map b/node_modules/signal-exit/dist/cjs/index.d.ts.map deleted file mode 100644 index ee8640d9e..000000000 --- a/node_modules/signal-exit/dist/cjs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,CAAA;AAuBlB;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,KAC1B,GAAG,CAAA;AAmQR,eAAO;AACL;;;;;;;;GAQG;AACH,MAAM,OAnMO,OAAO;;wBAPiD,IAAI;AA4MzE;;;;;;GAMG;AACH,IAAI;AAEJ;;;;;;GAMG;AACH,MAAM,YAGP,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/index.js b/node_modules/signal-exit/dist/cjs/index.js deleted file mode 100644 index 9312d0c96..000000000 --- a/node_modules/signal-exit/dist/cjs/index.js +++ /dev/null @@ -1,272 +0,0 @@ -"use strict"; -var _a; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.unload = exports.load = exports.onExit = exports.signals = void 0; -// Note: since nyc uses this module to output coverage, any lines -// that are in the direct sync flow of nyc's outputCoverage are -// ignored, since we can never get coverage for them. -// grab a reference to node's real process object right away -const signals_js_1 = require("./signals.js"); -Object.defineProperty(exports, "signals", { enumerable: true, get: function () { return signals_js_1.signals; } }); -const processOk = (process) => !!process && - typeof process === 'object' && - typeof process.removeListener === 'function' && - typeof process.emit === 'function' && - typeof process.reallyExit === 'function' && - typeof process.listeners === 'function' && - typeof process.kill === 'function' && - typeof process.pid === 'number' && - typeof process.on === 'function'; -const kExitEmitter = Symbol.for('signal-exit emitter'); -const global = globalThis; -const ObjectDefineProperty = Object.defineProperty.bind(Object); -// teeny tiny ee -class Emitter { - emitted = { - afterExit: false, - exit: false, - }; - listeners = { - afterExit: [], - exit: [], - }; - count = 0; - id = Math.random(); - constructor() { - if (global[kExitEmitter]) { - return global[kExitEmitter]; - } - ObjectDefineProperty(global, kExitEmitter, { - value: this, - writable: false, - enumerable: false, - configurable: false, - }); - } - on(ev, fn) { - this.listeners[ev].push(fn); - } - removeListener(ev, fn) { - const list = this.listeners[ev]; - const i = list.indexOf(fn); - /* c8 ignore start */ - if (i === -1) { - return; - } - /* c8 ignore stop */ - if (i === 0 && list.length === 1) { - list.length = 0; - } - else { - list.splice(i, 1); - } - } - emit(ev, code, signal) { - if (this.emitted[ev]) { - return; - } - this.emitted[ev] = true; - for (const fn of this.listeners[ev]) { - fn(code, signal); - } - } -} -class SignalExitBase { -} -const signalExitWrap = (handler) => { - return { - onExit(cb, opts) { - return handler.onExit(cb, opts); - }, - load() { - return handler.load(); - }, - unload() { - return handler.unload(); - }, - }; -}; -class SignalExitFallback extends SignalExitBase { - onExit() { - return () => { }; - } - load() { } - unload() { } -} -class SignalExit extends SignalExitBase { - // "SIGHUP" throws an `ENOSYS` error on Windows, - // so use a supported signal instead - /* c8 ignore start */ - #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'; - /* c8 ignore stop */ - #emitter = new Emitter(); - #process; - #originalProcessEmit; - #originalProcessReallyExit; - #sigListeners = {}; - #loaded = false; - constructor(process) { - super(); - this.#process = process; - // { : , ... } - this.#sigListeners = {}; - for (const sig of signals_js_1.signals) { - this.#sigListeners[sig] = () => { - // If there are no other listeners, an exit is coming! - // Simplest way: remove us and then re-send the signal. - // We know that this will kill the process, so we can - // safely emit now. - const listeners = this.#process.listeners(sig); - let { count } = this.#emitter; - // This is a workaround for the fact that signal-exit v3 and signal - // exit v4 are not aware of each other, and each will attempt to let - // the other handle it, so neither of them do. To correct this, we - // detect if we're the only handler *except* for previous versions - // of signal-exit. - /* c8 ignore start */ - //@ts-ignore - if (typeof process.__signal_exit_emitter__ === 'object') - count++; - /* c8 ignore stop */ - if (listeners.length === count) { - this.unload(); - this.#emitter.emit('exit', null, sig); - this.#emitter.emit('afterExit', null, sig); - /* c8 ignore start */ - process.kill(process.pid, sig === 'SIGHUP' ? this.#hupSig : sig); - /* c8 ignore stop */ - } - }; - } - this.#originalProcessReallyExit = process.reallyExit; - this.#originalProcessEmit = process.emit; - } - onExit(cb, opts) { - /* c8 ignore start */ - if (!processOk(this.#process)) { - return () => { }; - } - /* c8 ignore stop */ - if (this.#loaded === false) { - this.load(); - } - const ev = opts?.alwaysLast ? 'afterExit' : 'exit'; - this.#emitter.on(ev, cb); - return () => { - this.#emitter.removeListener(ev, cb); - if (this.#emitter.listeners['exit'].length === 0 && - this.#emitter.listeners['afterExit'].length === 0) { - this.unload(); - } - }; - } - load() { - if (this.#loaded) { - return; - } - this.#loaded = true; - // This is the number of onSignalExit's that are in play. - // It's important so that we can count the correct number of - // listeners on signals, and don't wait for the other one to - // handle it instead of us. - this.#emitter.count += 1; - for (const sig of signals_js_1.signals) { - try { - const fn = this.#sigListeners[sig]; - if (fn) - this.#process.on(sig, fn); - } - catch (_) { } - } - this.#process.emit = (ev, ...a) => { - return this.#processEmit(ev, ...a); - }; - this.#process.reallyExit = (code) => { - return this.#processReallyExit(code); - }; - } - unload() { - if (!this.#loaded) { - return; - } - this.#loaded = false; - signals_js_1.signals.forEach(sig => { - const listener = this.#sigListeners[sig]; - /* c8 ignore start */ - if (!listener) { - throw new Error('Listener not defined for signal: ' + sig); - } - /* c8 ignore stop */ - try { - this.#process.removeListener(sig, listener); - /* c8 ignore start */ - } - catch (_) { } - /* c8 ignore stop */ - }); - this.#process.emit = this.#originalProcessEmit; - this.#process.reallyExit = this.#originalProcessReallyExit; - this.#emitter.count -= 1; - } - #processReallyExit(code) { - /* c8 ignore start */ - if (!processOk(this.#process)) { - return 0; - } - this.#process.exitCode = code || 0; - /* c8 ignore stop */ - this.#emitter.emit('exit', this.#process.exitCode, null); - this.#emitter.emit('afterExit', this.#process.exitCode, null); - return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); - } - #processEmit(ev, ...args) { - const og = this.#originalProcessEmit; - if (ev === 'exit' && processOk(this.#process)) { - if (typeof args[0] === 'number') { - this.#process.exitCode = args[0]; - /* c8 ignore start */ - } - /* c8 ignore start */ - const ret = og.call(this.#process, ev, ...args); - /* c8 ignore start */ - this.#emitter.emit('exit', this.#process.exitCode, null); - this.#emitter.emit('afterExit', this.#process.exitCode, null); - /* c8 ignore stop */ - return ret; - } - else { - return og.call(this.#process, ev, ...args); - } - } -} -const process = globalThis.process; -// wrap so that we call the method on the actual handler, without -// exporting it directly. -_a = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()), -/** - * Called when the process is exiting, whether via signal, explicit - * exit, or running out of stuff to do. - * - * If the global process object is not suitable for instrumentation, - * then this will be a no-op. - * - * Returns a function that may be used to unload signal-exit. - */ -exports.onExit = _a.onExit, -/** - * Load the listeners. Likely you never need to call this, unless - * doing a rather deep integration with signal-exit functionality. - * Mostly exposed for the benefit of testing. - * - * @internal - */ -exports.load = _a.load, -/** - * Unload the listeners. Likely you never need to call this, unless - * doing a rather deep integration with signal-exit functionality. - * Mostly exposed for the benefit of testing. - * - * @internal - */ -exports.unload = _a.unload; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/index.js.map b/node_modules/signal-exit/dist/cjs/index.js.map deleted file mode 100644 index ebaf7c687..000000000 --- a/node_modules/signal-exit/dist/cjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,iEAAiE;AACjE,+DAA+D;AAC/D,qDAAqD;AACrD,4DAA4D;AAC5D,6CAAsC;AAC7B,wFADA,oBAAO,OACA;AAQhB,MAAM,SAAS,GAAG,CAAC,OAAY,EAAwB,EAAE,CACvD,CAAC,CAAC,OAAO;IACT,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO,OAAO,CAAC,cAAc,KAAK,UAAU;IAC5C,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU;IAClC,OAAO,OAAO,CAAC,UAAU,KAAK,UAAU;IACxC,OAAO,OAAO,CAAC,SAAS,KAAK,UA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IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;YAC7D,oBAAoB;YACpB,OAAO,GAAG,CAAA;SACX;aAAM;YACL,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,CAAA;SAC3C;IACH,CAAC;CACF;AAED,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;AAClC,iEAAiE;AACjE,yBAAyB;AACZ,KA6BT,cAAc,CAChB,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,kBAAkB,EAAE,CACxE;AA9BC;;;;;;;;GAQG;AACH,cAAM;AAEN;;;;;;GAMG;AACH,YAAI;AAEJ;;;;;;GAMG;AACH,cAAM,aAGP","sourcesContent":["// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js'\nexport { signals }\n\n// just a loosened process type so we can do some evil things\ntype ProcessRE = NodeJS.Process & {\n reallyExit: (code?: number | undefined | null) => any\n emit: (ev: string, ...a: any[]) => any\n}\n\nconst processOk = (process: any): process is ProcessRE =>\n !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function'\n\nconst kExitEmitter = Symbol.for('signal-exit emitter')\nconst global: typeof globalThis & { [kExitEmitter]?: Emitter } = globalThis\nconst ObjectDefineProperty = Object.defineProperty.bind(Object)\n\n/**\n * A function that takes an exit code and signal as arguments\n */\nexport type Handler = (\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n) => any\ntype ExitEvent = 'afterExit' | 'exit'\ntype Emitted = { [k in ExitEvent]: boolean }\ntype Listeners = { [k in ExitEvent]: Handler[] }\n\n// teeny tiny ee\nclass Emitter {\n emitted: Emitted = {\n afterExit: false,\n exit: false,\n }\n\n listeners: Listeners = {\n afterExit: [],\n exit: [],\n }\n\n count: number = 0\n id: number = Math.random()\n\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter]\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n })\n }\n\n on(ev: ExitEvent, fn: Handler) {\n this.listeners[ev].push(fn)\n }\n\n removeListener(ev: ExitEvent, fn: Handler) {\n const list = this.listeners[ev]\n const i = list.indexOf(fn)\n /* c8 ignore start */\n if (i === -1) {\n return\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0\n } else {\n list.splice(i, 1)\n }\n }\n\n emit(\n ev: ExitEvent,\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n ) {\n if (this.emitted[ev]) {\n return\n }\n this.emitted[ev] = true\n for (const fn of this.listeners[ev]) {\n fn(code, signal)\n }\n }\n}\n\nabstract class SignalExitBase {\n abstract onExit(cb: Handler, opts?: { alwaysLast?: boolean }): () => void\n abstract load(): void\n abstract unload(): void\n}\n\nconst signalExitWrap = (handler: T) => {\n return {\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n return handler.onExit(cb, opts)\n },\n load() {\n return handler.load()\n },\n unload() {\n return handler.unload()\n },\n }\n}\n\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => {}\n }\n load() {}\n unload() {}\n}\n\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'\n /* c8 ignore stop */\n #emitter = new Emitter()\n #process: ProcessRE\n #originalProcessEmit: ProcessRE['emit']\n #originalProcessReallyExit: ProcessRE['reallyExit']\n\n #sigListeners: { [k in NodeJS.Signals]?: () => void } = {}\n #loaded: boolean = false\n\n constructor(process: ProcessRE) {\n super()\n this.#process = process\n // { : , ... }\n this.#sigListeners = {}\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig)\n let { count } = this.#emitter\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit.\n /* c8 ignore start */\n //@ts-ignore\n if (typeof process.__signal_exit_emitter__ === 'object') count++\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload()\n this.#emitter.emit('exit', null, sig)\n this.#emitter.emit('afterExit', null, sig)\n /* c8 ignore start */\n process.kill(process.pid, sig === 'SIGHUP' ? this.#hupSig : sig)\n /* c8 ignore stop */\n }\n }\n }\n\n this.#originalProcessReallyExit = process.reallyExit\n this.#originalProcessEmit = process.emit\n }\n\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => {}\n }\n /* c8 ignore stop */\n\n if (this.#loaded === false) {\n this.load()\n }\n\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit'\n this.#emitter.on(ev, cb)\n return () => {\n this.#emitter.removeListener(ev, cb)\n if (\n this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0\n ) {\n this.unload()\n }\n }\n }\n\n load() {\n if (this.#loaded) {\n return\n }\n this.#loaded = true\n\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1\n\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig]\n if (fn) this.#process.on(sig, fn)\n } catch (_) {}\n }\n\n this.#process.emit = (ev: string, ...a: any[]) => {\n return this.#processEmit(ev, ...a)\n }\n this.#process.reallyExit = (code?: number | null | undefined) => {\n return this.#processReallyExit(code)\n }\n }\n\n unload() {\n if (!this.#loaded) {\n return\n }\n this.#loaded = false\n\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig]\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig)\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n })\n this.#process.emit = this.#originalProcessEmit\n this.#process.reallyExit = this.#originalProcessReallyExit\n this.#emitter.count -= 1\n }\n\n #processReallyExit(code?: number | null | undefined) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0\n }\n this.#process.exitCode = code || 0\n /* c8 ignore stop */\n\n this.#emitter.emit('exit', this.#process.exitCode, null)\n this.#emitter.emit('afterExit', this.#process.exitCode, null)\n return this.#originalProcessReallyExit.call(\n this.#process,\n this.#process.exitCode\n )\n }\n\n #processEmit(ev: string, ...args: any[]): any {\n const og = this.#originalProcessEmit\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0]\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args)\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null)\n this.#emitter.emit('afterExit', this.#process.exitCode, null)\n /* c8 ignore stop */\n return ret\n } else {\n return og.call(this.#process, ev, ...args)\n }\n }\n}\n\nconst process = globalThis.process\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const {\n /**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\n onExit,\n\n /**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n load,\n\n /**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n unload,\n} = signalExitWrap(\n processOk(process) ? new SignalExit(process) : new SignalExitFallback()\n)\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/package.json b/node_modules/signal-exit/dist/cjs/package.json deleted file mode 100644 index 5bbefffba..000000000 --- a/node_modules/signal-exit/dist/cjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/node_modules/signal-exit/dist/cjs/signals.d.ts b/node_modules/signal-exit/dist/cjs/signals.d.ts deleted file mode 100644 index 3f01ef00d..000000000 --- a/node_modules/signal-exit/dist/cjs/signals.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/// -/** - * This is not the set of all possible signals. - * - * It IS, however, the set of all signals that trigger - * an exit on either Linux or BSD systems. Linux is a - * superset of the signal names supported on BSD, and - * the unknown signals just fail to register, so we can - * catch that easily enough. - * - * Windows signals are a different set, since there are - * signals that terminate Windows processes, but don't - * terminate (or don't even exist) on Posix systems. - * - * Don't bother with SIGKILL. It's uncatchable, which - * means that we can't fire any callbacks anyway. - * - * If a user does happen to register a handler on a non- - * fatal signal like SIGWINCH or something, and then - * exit, it'll end up firing `process.emit('exit')`, so - * the handler will be fired anyway. - * - * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised - * artificially, inherently leave the process in a - * state from which it is not safe to try and enter JS - * listeners. - */ -export declare const signals: NodeJS.Signals[]; -//# sourceMappingURL=signals.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/signals.d.ts.map b/node_modules/signal-exit/dist/cjs/signals.d.ts.map deleted file mode 100644 index 891fe1e68..000000000 --- a/node_modules/signal-exit/dist/cjs/signals.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,OAAO,EAAO,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/signals.js b/node_modules/signal-exit/dist/cjs/signals.js deleted file mode 100644 index 28afc5027..000000000 --- a/node_modules/signal-exit/dist/cjs/signals.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.signals = void 0; -/** - * This is not the set of all possible signals. - * - * It IS, however, the set of all signals that trigger - * an exit on either Linux or BSD systems. Linux is a - * superset of the signal names supported on BSD, and - * the unknown signals just fail to register, so we can - * catch that easily enough. - * - * Windows signals are a different set, since there are - * signals that terminate Windows processes, but don't - * terminate (or don't even exist) on Posix systems. - * - * Don't bother with SIGKILL. It's uncatchable, which - * means that we can't fire any callbacks anyway. - * - * If a user does happen to register a handler on a non- - * fatal signal like SIGWINCH or something, and then - * exit, it'll end up firing `process.emit('exit')`, so - * the handler will be fired anyway. - * - * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised - * artificially, inherently leave the process in a - * state from which it is not safe to try and enter JS - * listeners. - */ -exports.signals = []; -exports.signals.push('SIGHUP', 'SIGINT', 'SIGTERM'); -if (process.platform !== 'win32') { - exports.signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' - // should detect profiler and enable/disable accordingly. - // see #21 - // 'SIGPROF' - ); -} -if (process.platform === 'linux') { - exports.signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT'); -} -//# sourceMappingURL=signals.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/signals.js.map b/node_modules/signal-exit/dist/cjs/signals.js.map deleted file mode 100644 index 78c613f66..000000000 --- a/node_modules/signal-exit/dist/cjs/signals.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signals.js","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACU,QAAA,OAAO,GAAqB,EAAE,CAAA;AAC3C,eAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;AAE3C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,eAAO,CAAC,IAAI,CACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ;IACR,yDAAyD;IACzD,UAAU;IACV,YAAY;KACb,CAAA;CACF;AAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,eAAO,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;CACxD","sourcesContent":["/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals: NodeJS.Signals[] = []\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM')\n\nif (process.platform !== 'win32') {\n signals.push(\n 'SIGALRM',\n 'SIGABRT',\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT')\n}\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/browser.d.ts b/node_modules/signal-exit/dist/mjs/browser.d.ts deleted file mode 100644 index 90f2e3f11..000000000 --- a/node_modules/signal-exit/dist/mjs/browser.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * This is a browser shim that provides the same functional interface - * as the main node export, but it does nothing. - * @module - */ -import type { Handler } from './index.js'; -export declare const onExit: (cb: Handler, opts: { - alwaysLast?: boolean; -}) => () => void; -export declare const load: () => void; -export declare const unload: () => void; -//# sourceMappingURL=browser.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/browser.d.ts.map b/node_modules/signal-exit/dist/mjs/browser.d.ts.map deleted file mode 100644 index aacc1d3b6..000000000 --- a/node_modules/signal-exit/dist/mjs/browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,eAAO,MAAM,MAAM,EAAE,CACnB,EAAE,EAAE,OAAO,EACX,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,KAC3B,MAAM,IAAqB,CAAA;AAChC,eAAO,MAAM,IAAI,YAAW,CAAA;AAC5B,eAAO,MAAM,MAAM,YAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/browser.js b/node_modules/signal-exit/dist/mjs/browser.js deleted file mode 100644 index 9c5f9b9e7..000000000 --- a/node_modules/signal-exit/dist/mjs/browser.js +++ /dev/null @@ -1,4 +0,0 @@ -export const onExit = () => () => { }; -export const load = () => { }; -export const unload = () => { }; -//# sourceMappingURL=browser.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/browser.js.map b/node_modules/signal-exit/dist/mjs/browser.js.map deleted file mode 100644 index b3ff303af..000000000 --- a/node_modules/signal-exit/dist/mjs/browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,MAAM,GAGD,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAA;AAChC,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;AAC5B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA","sourcesContent":["/**\n * This is a browser shim that provides the same functional interface\n * as the main node export, but it does nothing.\n * @module\n */\nimport type { Handler } from './index.js'\nexport const onExit: (\n cb: Handler,\n opts: { alwaysLast?: boolean }\n) => () => void = () => () => {}\nexport const load = () => {}\nexport const unload = () => {}\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/index.d.ts b/node_modules/signal-exit/dist/mjs/index.d.ts deleted file mode 100644 index 18a4cc653..000000000 --- a/node_modules/signal-exit/dist/mjs/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/// -import { signals } from './signals.js'; -export { signals }; -/** - * A function that takes an exit code and signal as arguments - */ -export type Handler = (code: number | null | undefined, signal: NodeJS.Signals | null) => any; -export declare const -/** - * Called when the process is exiting, whether via signal, explicit - * exit, or running out of stuff to do. - * - * If the global process object is not suitable for instrumentation, - * then this will be a no-op. - * - * Returns a function that may be used to unload signal-exit. - */ -onExit: (cb: Handler, opts?: { - alwaysLast?: boolean | undefined; -} | undefined) => () => void, -/** - * Load the listeners. Likely you never need to call this, unless - * doing a rather deep integration with signal-exit functionality. - * Mostly exposed for the benefit of testing. - * - * @internal - */ -load: () => void, -/** - * Unload the listeners. Likely you never need to call this, unless - * doing a rather deep integration with signal-exit functionality. - * Mostly exposed for the benefit of testing. - * - * @internal - */ -unload: () => void; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/index.d.ts.map b/node_modules/signal-exit/dist/mjs/index.d.ts.map deleted file mode 100644 index ee8640d9e..000000000 --- a/node_modules/signal-exit/dist/mjs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,CAAA;AAuBlB;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,KAC1B,GAAG,CAAA;AAmQR,eAAO;AACL;;;;;;;;GAQG;AACH,MAAM,OAnMO,OAAO;;wBAPiD,IAAI;AA4MzE;;;;;;GAMG;AACH,IAAI;AAEJ;;;;;;GAMG;AACH,MAAM,YAGP,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/index.js b/node_modules/signal-exit/dist/mjs/index.js deleted file mode 100644 index 97f409239..000000000 --- a/node_modules/signal-exit/dist/mjs/index.js +++ /dev/null @@ -1,268 +0,0 @@ -// Note: since nyc uses this module to output coverage, any lines -// that are in the direct sync flow of nyc's outputCoverage are -// ignored, since we can never get coverage for them. -// grab a reference to node's real process object right away -import { signals } from './signals.js'; -export { signals }; -const processOk = (process) => !!process && - typeof process === 'object' && - typeof process.removeListener === 'function' && - typeof process.emit === 'function' && - typeof process.reallyExit === 'function' && - typeof process.listeners === 'function' && - typeof process.kill === 'function' && - typeof process.pid === 'number' && - typeof process.on === 'function'; -const kExitEmitter = Symbol.for('signal-exit emitter'); -const global = globalThis; -const ObjectDefineProperty = Object.defineProperty.bind(Object); -// teeny tiny ee -class Emitter { - emitted = { - afterExit: false, - exit: false, - }; - listeners = { - afterExit: [], - exit: [], - }; - count = 0; - id = Math.random(); - constructor() { - if (global[kExitEmitter]) { - return global[kExitEmitter]; - } - ObjectDefineProperty(global, kExitEmitter, { - value: this, - writable: false, - enumerable: false, - configurable: false, - }); - } - on(ev, fn) { - this.listeners[ev].push(fn); - } - removeListener(ev, fn) { - const list = this.listeners[ev]; - const i = list.indexOf(fn); - /* c8 ignore start */ - if (i === -1) { - return; - } - /* c8 ignore stop */ - if (i === 0 && list.length === 1) { - list.length = 0; - } - else { - list.splice(i, 1); - } - } - emit(ev, code, signal) { - if (this.emitted[ev]) { - return; - } - this.emitted[ev] = true; - for (const fn of this.listeners[ev]) { - fn(code, signal); - } - } -} -class SignalExitBase { -} -const signalExitWrap = (handler) => { - return { - onExit(cb, opts) { - return handler.onExit(cb, opts); - }, - load() { - return handler.load(); - }, - unload() { - return handler.unload(); - }, - }; -}; -class SignalExitFallback extends SignalExitBase { - onExit() { - return () => { }; - } - load() { } - unload() { } -} -class SignalExit extends SignalExitBase { - // "SIGHUP" throws an `ENOSYS` error on Windows, - // so use a supported signal instead - /* c8 ignore start */ - #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'; - /* c8 ignore stop */ - #emitter = new Emitter(); - #process; - #originalProcessEmit; - #originalProcessReallyExit; - #sigListeners = {}; - #loaded = false; - constructor(process) { - super(); - this.#process = process; - // { : , ... } - this.#sigListeners = {}; - for (const sig of signals) { - this.#sigListeners[sig] = () => { - // If there are no other listeners, an exit is coming! - // Simplest way: remove us and then re-send the signal. - // We know that this will kill the process, so we can - // safely emit now. - const listeners = this.#process.listeners(sig); - let { count } = this.#emitter; - // This is a workaround for the fact that signal-exit v3 and signal - // exit v4 are not aware of each other, and each will attempt to let - // the other handle it, so neither of them do. To correct this, we - // detect if we're the only handler *except* for previous versions - // of signal-exit. - /* c8 ignore start */ - //@ts-ignore - if (typeof process.__signal_exit_emitter__ === 'object') - count++; - /* c8 ignore stop */ - if (listeners.length === count) { - this.unload(); - this.#emitter.emit('exit', null, sig); - this.#emitter.emit('afterExit', null, sig); - /* c8 ignore start */ - process.kill(process.pid, sig === 'SIGHUP' ? this.#hupSig : sig); - /* c8 ignore stop */ - } - }; - } - this.#originalProcessReallyExit = process.reallyExit; - this.#originalProcessEmit = process.emit; - } - onExit(cb, opts) { - /* c8 ignore start */ - if (!processOk(this.#process)) { - return () => { }; - } - /* c8 ignore stop */ - if (this.#loaded === false) { - this.load(); - } - const ev = opts?.alwaysLast ? 'afterExit' : 'exit'; - this.#emitter.on(ev, cb); - return () => { - this.#emitter.removeListener(ev, cb); - if (this.#emitter.listeners['exit'].length === 0 && - this.#emitter.listeners['afterExit'].length === 0) { - this.unload(); - } - }; - } - load() { - if (this.#loaded) { - return; - } - this.#loaded = true; - // This is the number of onSignalExit's that are in play. - // It's important so that we can count the correct number of - // listeners on signals, and don't wait for the other one to - // handle it instead of us. - this.#emitter.count += 1; - for (const sig of signals) { - try { - const fn = this.#sigListeners[sig]; - if (fn) - this.#process.on(sig, fn); - } - catch (_) { } - } - this.#process.emit = (ev, ...a) => { - return this.#processEmit(ev, ...a); - }; - this.#process.reallyExit = (code) => { - return this.#processReallyExit(code); - }; - } - unload() { - if (!this.#loaded) { - return; - } - this.#loaded = false; - signals.forEach(sig => { - const listener = this.#sigListeners[sig]; - /* c8 ignore start */ - if (!listener) { - throw new Error('Listener not defined for signal: ' + sig); - } - /* c8 ignore stop */ - try { - this.#process.removeListener(sig, listener); - /* c8 ignore start */ - } - catch (_) { } - /* c8 ignore stop */ - }); - this.#process.emit = this.#originalProcessEmit; - this.#process.reallyExit = this.#originalProcessReallyExit; - this.#emitter.count -= 1; - } - #processReallyExit(code) { - /* c8 ignore start */ - if (!processOk(this.#process)) { - return 0; - } - this.#process.exitCode = code || 0; - /* c8 ignore stop */ - this.#emitter.emit('exit', this.#process.exitCode, null); - this.#emitter.emit('afterExit', this.#process.exitCode, null); - return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); - } - #processEmit(ev, ...args) { - const og = this.#originalProcessEmit; - if (ev === 'exit' && processOk(this.#process)) { - if (typeof args[0] === 'number') { - this.#process.exitCode = args[0]; - /* c8 ignore start */ - } - /* c8 ignore start */ - const ret = og.call(this.#process, ev, ...args); - /* c8 ignore start */ - this.#emitter.emit('exit', this.#process.exitCode, null); - this.#emitter.emit('afterExit', this.#process.exitCode, null); - /* c8 ignore stop */ - return ret; - } - else { - return og.call(this.#process, ev, ...args); - } - } -} -const process = globalThis.process; -// wrap so that we call the method on the actual handler, without -// exporting it directly. -export const { -/** - * Called when the process is exiting, whether via signal, explicit - * exit, or running out of stuff to do. - * - * If the global process object is not suitable for instrumentation, - * then this will be a no-op. - * - * Returns a function that may be used to unload signal-exit. - */ -onExit, -/** - * Load the listeners. Likely you never need to call this, unless - * doing a rather deep integration with signal-exit functionality. - * Mostly exposed for the benefit of testing. - * - * @internal - */ -load, -/** - * Unload the listeners. Likely you never need to call this, unless - * doing a rather deep integration with signal-exit functionality. - * Mostly exposed for the benefit of testing. - * - * @internal - */ -unload, } = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/index.js.map b/node_modules/signal-exit/dist/mjs/index.js.map deleted file mode 100644 index 718ba2d5c..000000000 --- a/node_modules/signal-exit/dist/mjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,+DAA+D;AAC/D,qDAAqD;AACrD,4DAA4D;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,CAAA;AAQlB,MAAM,SAAS,GAAG,CAAC,OAAY,EAAwB,EAAE,CACvD,CAAC,CA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,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,CAAA;YAC/C,qBAAqB;YACrB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;YACxD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;YAC7D,oBAAoB;YACpB,OAAO,GAAG,CAAA;SACX;aAAM;YACL,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,CAAA;SAC3C;IACH,CAAC;CACF;AAED,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;AAClC,iEAAiE;AACjE,yBAAyB;AACzB,MAAM,CAAC,MAAM;AACX;;;;;;;;GAQG;AACH,MAAM;AAEN;;;;;;GAMG;AACH,IAAI;AAEJ;;;;;;GAMG;AACH,MAAM,GACP,GAAG,cAAc,CAChB,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,kBAAkB,EAAE,CACxE,CAAA","sourcesContent":["// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js'\nexport { signals }\n\n// just a loosened process type so we can do some evil things\ntype ProcessRE = NodeJS.Process & {\n reallyExit: (code?: number | undefined | null) => any\n emit: (ev: string, ...a: any[]) => any\n}\n\nconst processOk = (process: any): process is ProcessRE =>\n !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function'\n\nconst kExitEmitter = Symbol.for('signal-exit emitter')\nconst global: typeof globalThis & { [kExitEmitter]?: Emitter } = globalThis\nconst ObjectDefineProperty = Object.defineProperty.bind(Object)\n\n/**\n * A function that takes an exit code and signal as arguments\n */\nexport type Handler = (\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n) => any\ntype ExitEvent = 'afterExit' | 'exit'\ntype Emitted = { [k in ExitEvent]: boolean }\ntype Listeners = { [k in ExitEvent]: Handler[] }\n\n// teeny tiny ee\nclass Emitter {\n emitted: Emitted = {\n afterExit: false,\n exit: false,\n }\n\n listeners: Listeners = {\n afterExit: [],\n exit: [],\n }\n\n count: number = 0\n id: number = Math.random()\n\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter]\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n })\n }\n\n on(ev: ExitEvent, fn: Handler) {\n this.listeners[ev].push(fn)\n }\n\n removeListener(ev: ExitEvent, fn: Handler) {\n const list = this.listeners[ev]\n const i = list.indexOf(fn)\n /* c8 ignore start */\n if (i === -1) {\n return\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0\n } else {\n list.splice(i, 1)\n }\n }\n\n emit(\n ev: ExitEvent,\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n ) {\n if (this.emitted[ev]) {\n return\n }\n this.emitted[ev] = true\n for (const fn of this.listeners[ev]) {\n fn(code, signal)\n }\n }\n}\n\nabstract class SignalExitBase {\n abstract onExit(cb: Handler, opts?: { alwaysLast?: boolean }): () => void\n abstract load(): void\n abstract unload(): void\n}\n\nconst signalExitWrap = (handler: T) => {\n return {\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n return handler.onExit(cb, opts)\n },\n load() {\n return handler.load()\n },\n unload() {\n return handler.unload()\n },\n }\n}\n\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => {}\n }\n load() {}\n unload() {}\n}\n\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'\n /* c8 ignore stop */\n #emitter = new Emitter()\n #process: ProcessRE\n #originalProcessEmit: ProcessRE['emit']\n #originalProcessReallyExit: ProcessRE['reallyExit']\n\n #sigListeners: { [k in NodeJS.Signals]?: () => void } = {}\n #loaded: boolean = false\n\n constructor(process: ProcessRE) {\n super()\n this.#process = process\n // { : , ... }\n this.#sigListeners = {}\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig)\n let { count } = this.#emitter\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit.\n /* c8 ignore start */\n //@ts-ignore\n if (typeof process.__signal_exit_emitter__ === 'object') count++\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload()\n this.#emitter.emit('exit', null, sig)\n this.#emitter.emit('afterExit', null, sig)\n /* c8 ignore start */\n process.kill(process.pid, sig === 'SIGHUP' ? this.#hupSig : sig)\n /* c8 ignore stop */\n }\n }\n }\n\n this.#originalProcessReallyExit = process.reallyExit\n this.#originalProcessEmit = process.emit\n }\n\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => {}\n }\n /* c8 ignore stop */\n\n if (this.#loaded === false) {\n this.load()\n }\n\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit'\n this.#emitter.on(ev, cb)\n return () => {\n this.#emitter.removeListener(ev, cb)\n if (\n this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0\n ) {\n this.unload()\n }\n }\n }\n\n load() {\n if (this.#loaded) {\n return\n }\n this.#loaded = true\n\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1\n\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig]\n if (fn) this.#process.on(sig, fn)\n } catch (_) {}\n }\n\n this.#process.emit = (ev: string, ...a: any[]) => {\n return this.#processEmit(ev, ...a)\n }\n this.#process.reallyExit = (code?: number | null | undefined) => {\n return this.#processReallyExit(code)\n }\n }\n\n unload() {\n if (!this.#loaded) {\n return\n }\n this.#loaded = false\n\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig]\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig)\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n })\n this.#process.emit = this.#originalProcessEmit\n this.#process.reallyExit = this.#originalProcessReallyExit\n this.#emitter.count -= 1\n }\n\n #processReallyExit(code?: number | null | undefined) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0\n }\n this.#process.exitCode = code || 0\n /* c8 ignore stop */\n\n this.#emitter.emit('exit', this.#process.exitCode, null)\n this.#emitter.emit('afterExit', this.#process.exitCode, null)\n return this.#originalProcessReallyExit.call(\n this.#process,\n this.#process.exitCode\n )\n }\n\n #processEmit(ev: string, ...args: any[]): any {\n const og = this.#originalProcessEmit\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0]\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args)\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null)\n this.#emitter.emit('afterExit', this.#process.exitCode, null)\n /* c8 ignore stop */\n return ret\n } else {\n return og.call(this.#process, ev, ...args)\n }\n }\n}\n\nconst process = globalThis.process\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const {\n /**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\n onExit,\n\n /**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n load,\n\n /**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n unload,\n} = signalExitWrap(\n processOk(process) ? new SignalExit(process) : new SignalExitFallback()\n)\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/package.json b/node_modules/signal-exit/dist/mjs/package.json deleted file mode 100644 index 3dbc1ca59..000000000 --- a/node_modules/signal-exit/dist/mjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/node_modules/signal-exit/dist/mjs/signals.d.ts b/node_modules/signal-exit/dist/mjs/signals.d.ts deleted file mode 100644 index 3f01ef00d..000000000 --- a/node_modules/signal-exit/dist/mjs/signals.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/// -/** - * This is not the set of all possible signals. - * - * It IS, however, the set of all signals that trigger - * an exit on either Linux or BSD systems. Linux is a - * superset of the signal names supported on BSD, and - * the unknown signals just fail to register, so we can - * catch that easily enough. - * - * Windows signals are a different set, since there are - * signals that terminate Windows processes, but don't - * terminate (or don't even exist) on Posix systems. - * - * Don't bother with SIGKILL. It's uncatchable, which - * means that we can't fire any callbacks anyway. - * - * If a user does happen to register a handler on a non- - * fatal signal like SIGWINCH or something, and then - * exit, it'll end up firing `process.emit('exit')`, so - * the handler will be fired anyway. - * - * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised - * artificially, inherently leave the process in a - * state from which it is not safe to try and enter JS - * listeners. - */ -export declare const signals: NodeJS.Signals[]; -//# sourceMappingURL=signals.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/signals.d.ts.map b/node_modules/signal-exit/dist/mjs/signals.d.ts.map deleted file mode 100644 index 891fe1e68..000000000 --- a/node_modules/signal-exit/dist/mjs/signals.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,OAAO,EAAO,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/signals.js b/node_modules/signal-exit/dist/mjs/signals.js deleted file mode 100644 index 7dbf15a5a..000000000 --- a/node_modules/signal-exit/dist/mjs/signals.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This is not the set of all possible signals. - * - * It IS, however, the set of all signals that trigger - * an exit on either Linux or BSD systems. Linux is a - * superset of the signal names supported on BSD, and - * the unknown signals just fail to register, so we can - * catch that easily enough. - * - * Windows signals are a different set, since there are - * signals that terminate Windows processes, but don't - * terminate (or don't even exist) on Posix systems. - * - * Don't bother with SIGKILL. It's uncatchable, which - * means that we can't fire any callbacks anyway. - * - * If a user does happen to register a handler on a non- - * fatal signal like SIGWINCH or something, and then - * exit, it'll end up firing `process.emit('exit')`, so - * the handler will be fired anyway. - * - * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised - * artificially, inherently leave the process in a - * state from which it is not safe to try and enter JS - * listeners. - */ -export const signals = []; -signals.push('SIGHUP', 'SIGINT', 'SIGTERM'); -if (process.platform !== 'win32') { - signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' - // should detect profiler and enable/disable accordingly. - // see #21 - // 'SIGPROF' - ); -} -if (process.platform === 'linux') { - signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT'); -} -//# sourceMappingURL=signals.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/signals.js.map b/node_modules/signal-exit/dist/mjs/signals.js.map deleted file mode 100644 index 91008c917..000000000 --- a/node_modules/signal-exit/dist/mjs/signals.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signals.js","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAqB,EAAE,CAAA;AAC3C,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;AAE3C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,OAAO,CAAC,IAAI,CACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ;IACR,yDAAyD;IACzD,UAAU;IACV,YAAY;KACb,CAAA;CACF;AAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;CACxD","sourcesContent":["/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals: NodeJS.Signals[] = []\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM')\n\nif (process.platform !== 'win32') {\n signals.push(\n 'SIGALRM',\n 'SIGABRT',\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT')\n}\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/package.json b/node_modules/signal-exit/package.json deleted file mode 100644 index 455452f96..000000000 --- a/node_modules/signal-exit/package.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "name": "signal-exit", - "version": "4.0.2", - "description": "when you want to fire an event no matter how a process exits.", - "main": "./dist/cjs/index.js", - "module": "./dist/mjs/index.js", - "browser": "./dist/mjs/browser.js", - "types": "./dist/mjs/index.d.ts", - "exports": { - ".": { - "import": { - "types": "./dist/mjs/index.d.ts", - "default": "./dist/mjs/index.js" - }, - "require": { - "types": "./dist/cjs/index.d.ts", - "default": "./dist/cjs/index.js" - } - }, - "./signals": { - "import": { - "types": "./dist/mjs/signals.d.ts", - "default": "./dist/mjs/signals.js" - }, - "require": { - "types": "./dist/cjs/signals.d.ts", - "default": "./dist/cjs/signals.js" - } - }, - "./browser": { - "import": { - "types": "./dist/mjs/browser.d.ts", - "default": "./dist/mjs/browser.js" - }, - "require": { - "types": "./dist/cjs/browser.d.ts", - "default": "./dist/cjs/browser.js" - } - } - }, - "files": [ - "dist" - ], - "engines": { - "node": ">=14" - }, - "repository": { - "type": "git", - "url": "https://github.com/tapjs/signal-exit.git" - }, - "keywords": [ - "signal", - "exit" - ], - "author": "Ben Coe ", - "license": "ISC", - "devDependencies": { - "@types/cross-spawn": "^6.0.2", - "@types/node": "^18.15.11", - "@types/signal-exit": "^3.0.1", - "@types/tap": "^15.0.8", - "c8": "^7.13.0", - "prettier": "^2.8.6", - "tap": "^16.3.4", - "ts-node": "^10.9.1", - "typedoc": "^0.23.28", - "typescript": "^5.0.2" - }, - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "preprepare": "rm -rf dist", - "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash ./scripts/fixup.sh", - "pretest": "npm run prepare", - "presnap": "npm run prepare", - "test": "c8 tap", - "snap": "c8 tap", - "format": "prettier --write . --loglevel warn", - "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts" - }, - "prettier": { - "semi": false, - "printWidth": 75, - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "jsxSingleQuote": false, - "bracketSameLine": true, - "arrowParens": "avoid", - "endOfLine": "lf" - }, - "tap": { - "coverage": false, - "jobs": 1, - "node-arg": [ - "--no-warnings", - "--loader", - "ts-node/esm" - ], - "ts": false - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } -} diff --git a/node_modules/slash/index.d.ts b/node_modules/slash/index.d.ts deleted file mode 100644 index f9d07d11e..000000000 --- a/node_modules/slash/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** -Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar`. - -[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths and don't contain any non-ascii characters. - -@param path - A Windows backslash path. -@returns A path with forward slashes. - -@example -``` -import * as path from 'path'; -import slash = require('slash'); - -const string = path.join('foo', 'bar'); -// Unix => foo/bar -// Windows => foo\\bar - -slash(string); -// Unix => foo/bar -// Windows => foo/bar -``` -*/ -declare function slash(path: string): string; - -export = slash; diff --git a/node_modules/slash/index.js b/node_modules/slash/index.js deleted file mode 100644 index 103fbea97..000000000 --- a/node_modules/slash/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -module.exports = path => { - const isExtendedLengthPath = /^\\\\\?\\/.test(path); - const hasNonAscii = /[^\u0000-\u0080]+/.test(path); // eslint-disable-line no-control-regex - - if (isExtendedLengthPath || hasNonAscii) { - return path; - } - - return path.replace(/\\/g, '/'); -}; diff --git a/node_modules/slash/license b/node_modules/slash/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/slash/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/slash/package.json b/node_modules/slash/package.json deleted file mode 100644 index c88fcc712..000000000 --- a/node_modules/slash/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "slash", - "version": "3.0.0", - "description": "Convert Windows backslash paths to slash paths", - "license": "MIT", - "repository": "sindresorhus/slash", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "path", - "seperator", - "slash", - "backslash", - "windows", - "convert" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/slash/readme.md b/node_modules/slash/readme.md deleted file mode 100644 index f0ef4acbd..000000000 --- a/node_modules/slash/readme.md +++ /dev/null @@ -1,44 +0,0 @@ -# slash [![Build Status](https://travis-ci.org/sindresorhus/slash.svg?branch=master)](https://travis-ci.org/sindresorhus/slash) - -> Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar` - -[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths and don't contain any non-ascii characters. - -This was created since the `path` methods in Node.js outputs `\\` paths on Windows. - - -## Install - -``` -$ npm install slash -``` - - -## Usage - -```js -const path = require('path'); -const slash = require('slash'); - -const string = path.join('foo', 'bar'); -// Unix => foo/bar -// Windows => foo\\bar - -slash(string); -// Unix => foo/bar -// Windows => foo/bar -``` - - -## API - -### slash(path) - -Type: `string` - -Accepts a Windows backslash path and returns a path with forward slashes. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/slice-ansi/index.js b/node_modules/slice-ansi/index.js deleted file mode 100755 index 72d37d9a5..000000000 --- a/node_modules/slice-ansi/index.js +++ /dev/null @@ -1,103 +0,0 @@ -'use strict'; -const isFullwidthCodePoint = require('is-fullwidth-code-point'); -const astralRegex = require('astral-regex'); -const ansiStyles = require('ansi-styles'); - -const ESCAPES = [ - '\u001B', - '\u009B' -]; - -const wrapAnsi = code => `${ESCAPES[0]}[${code}m`; - -const checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => { - let output = []; - ansiCodes = [...ansiCodes]; - - for (let ansiCode of ansiCodes) { - const ansiCodeOrigin = ansiCode; - if (ansiCode.includes(';')) { - ansiCode = ansiCode.split(';')[0][0] + '0'; - } - - const item = ansiStyles.codes.get(Number.parseInt(ansiCode, 10)); - if (item) { - const indexEscape = ansiCodes.indexOf(item.toString()); - if (indexEscape === -1) { - output.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin)); - } else { - ansiCodes.splice(indexEscape, 1); - } - } else if (isEscapes) { - output.push(wrapAnsi(0)); - break; - } else { - output.push(wrapAnsi(ansiCodeOrigin)); - } - } - - if (isEscapes) { - output = output.filter((element, index) => output.indexOf(element) === index); - - if (endAnsiCode !== undefined) { - const fistEscapeCode = wrapAnsi(ansiStyles.codes.get(Number.parseInt(endAnsiCode, 10))); - output = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []); - } - } - - return output.join(''); -}; - -module.exports = (string, begin, end) => { - const characters = [...string]; - const ansiCodes = []; - - let stringEnd = typeof end === 'number' ? end : characters.length; - let isInsideEscape = false; - let ansiCode; - let visible = 0; - let output = ''; - - for (const [index, character] of characters.entries()) { - let leftEscape = false; - - if (ESCAPES.includes(character)) { - const code = /\d[^m]*/.exec(string.slice(index, index + 18)); - ansiCode = code && code.length > 0 ? code[0] : undefined; - - if (visible < stringEnd) { - isInsideEscape = true; - - if (ansiCode !== undefined) { - ansiCodes.push(ansiCode); - } - } - } else if (isInsideEscape && character === 'm') { - isInsideEscape = false; - leftEscape = true; - } - - if (!isInsideEscape && !leftEscape) { - visible++; - } - - if (!astralRegex({exact: true}).test(character) && isFullwidthCodePoint(character.codePointAt())) { - visible++; - - if (typeof end !== 'number') { - stringEnd++; - } - } - - if (visible > begin && visible <= stringEnd) { - output += character; - } else if (visible === begin && !isInsideEscape && ansiCode !== undefined) { - output = checkAnsi(ansiCodes); - } else if (visible >= stringEnd) { - output += checkAnsi(ansiCodes, true, ansiCode); - break; - } - } - - return output; -}; diff --git a/node_modules/slice-ansi/license b/node_modules/slice-ansi/license deleted file mode 100644 index e05b33c55..000000000 --- a/node_modules/slice-ansi/license +++ /dev/null @@ -1,10 +0,0 @@ -MIT License - -Copyright (c) DC -Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/slice-ansi/node_modules/ansi-styles/index.d.ts b/node_modules/slice-ansi/node_modules/ansi-styles/index.d.ts deleted file mode 100644 index 44a907e58..000000000 --- a/node_modules/slice-ansi/node_modules/ansi-styles/index.d.ts +++ /dev/null @@ -1,345 +0,0 @@ -declare type CSSColor = - | 'aliceblue' - | 'antiquewhite' - | 'aqua' - | 'aquamarine' - | 'azure' - | 'beige' - | 'bisque' - | 'black' - | 'blanchedalmond' - | 'blue' - | 'blueviolet' - | 'brown' - | 'burlywood' - | 'cadetblue' - | 'chartreuse' - | 'chocolate' - | 'coral' - | 'cornflowerblue' - | 'cornsilk' - | 'crimson' - | 'cyan' - | 'darkblue' - | 'darkcyan' - | 'darkgoldenrod' - | 'darkgray' - | 'darkgreen' - | 'darkgrey' - | 'darkkhaki' - | 'darkmagenta' - | 'darkolivegreen' - | 'darkorange' - | 'darkorchid' - | 'darkred' - | 'darksalmon' - | 'darkseagreen' - | 'darkslateblue' - | 'darkslategray' - | 'darkslategrey' - | 'darkturquoise' - | 'darkviolet' - | 'deeppink' - | 'deepskyblue' - | 'dimgray' - | 'dimgrey' - | 'dodgerblue' - | 'firebrick' - | 'floralwhite' - | 'forestgreen' - | 'fuchsia' - | 'gainsboro' - | 'ghostwhite' - | 'gold' - | 'goldenrod' - | 'gray' - | 'green' - | 'greenyellow' - | 'grey' - | 'honeydew' - | 'hotpink' - | 'indianred' - | 'indigo' - | 'ivory' - | 'khaki' - | 'lavender' - | 'lavenderblush' - | 'lawngreen' - | 'lemonchiffon' - | 'lightblue' - | 'lightcoral' - | 'lightcyan' - | 'lightgoldenrodyellow' - | 'lightgray' - | 'lightgreen' - | 'lightgrey' - | 'lightpink' - | 'lightsalmon' - | 'lightseagreen' - | 'lightskyblue' - | 'lightslategray' - | 'lightslategrey' - | 'lightsteelblue' - | 'lightyellow' - | 'lime' - | 'limegreen' - | 'linen' - | 'magenta' - | 'maroon' - | 'mediumaquamarine' - | 'mediumblue' - | 'mediumorchid' - | 'mediumpurple' - | 'mediumseagreen' - | 'mediumslateblue' - | 'mediumspringgreen' - | 'mediumturquoise' - | 'mediumvioletred' - | 'midnightblue' - | 'mintcream' - | 'mistyrose' - | 'moccasin' - | 'navajowhite' - | 'navy' - | 'oldlace' - | 'olive' - | 'olivedrab' - | 'orange' - | 'orangered' - | 'orchid' - | 'palegoldenrod' - | 'palegreen' - | 'paleturquoise' - | 'palevioletred' - | 'papayawhip' - | 'peachpuff' - | 'peru' - | 'pink' - | 'plum' - | 'powderblue' - | 'purple' - | 'rebeccapurple' - | 'red' - | 'rosybrown' - | 'royalblue' - | 'saddlebrown' - | 'salmon' - | 'sandybrown' - | 'seagreen' - | 'seashell' - | 'sienna' - | 'silver' - | 'skyblue' - | 'slateblue' - | 'slategray' - | 'slategrey' - | 'snow' - | 'springgreen' - | 'steelblue' - | 'tan' - | 'teal' - | 'thistle' - | 'tomato' - | 'turquoise' - | 'violet' - | 'wheat' - | 'white' - | 'whitesmoke' - | 'yellow' - | 'yellowgreen'; - -declare namespace ansiStyles { - interface ColorConvert { - /** - The RGB color space. - - @param red - (`0`-`255`) - @param green - (`0`-`255`) - @param blue - (`0`-`255`) - */ - rgb(red: number, green: number, blue: number): string; - - /** - The RGB HEX color space. - - @param hex - A hexadecimal string containing RGB data. - */ - hex(hex: string): string; - - /** - @param keyword - A CSS color name. - */ - keyword(keyword: CSSColor): string; - - /** - The HSL color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param lightness - (`0`-`100`) - */ - hsl(hue: number, saturation: number, lightness: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param value - (`0`-`100`) - */ - hsv(hue: number, saturation: number, value: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param whiteness - (`0`-`100`) - @param blackness - (`0`-`100`) - */ - hwb(hue: number, whiteness: number, blackness: number): string; - - /** - Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. - */ - ansi(ansi: number): string; - - /** - Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(ansi: number): string; - } - - interface CSPair { - /** - The ANSI terminal control sequence for starting this style. - */ - readonly open: string; - - /** - The ANSI terminal control sequence for ending this style. - */ - readonly close: string; - } - - interface ColorBase { - readonly ansi: ColorConvert; - readonly ansi256: ColorConvert; - readonly ansi16m: ColorConvert; - - /** - The ANSI terminal control sequence for ending this color. - */ - readonly close: string; - } - - interface Modifier { - /** - Resets the current color chain. - */ - readonly reset: CSPair; - - /** - Make text bold. - */ - readonly bold: CSPair; - - /** - Emitting only a small amount of light. - */ - readonly dim: CSPair; - - /** - Make text italic. (Not widely supported) - */ - readonly italic: CSPair; - - /** - Make text underline. (Not widely supported) - */ - readonly underline: CSPair; - - /** - Inverse background and foreground colors. - */ - readonly inverse: CSPair; - - /** - Prints the text, but makes it invisible. - */ - readonly hidden: CSPair; - - /** - Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: CSPair; - } - - interface ForegroundColor { - readonly black: CSPair; - readonly red: CSPair; - readonly green: CSPair; - readonly yellow: CSPair; - readonly blue: CSPair; - readonly cyan: CSPair; - readonly magenta: CSPair; - readonly white: CSPair; - - /** - Alias for `blackBright`. - */ - readonly gray: CSPair; - - /** - Alias for `blackBright`. - */ - readonly grey: CSPair; - - readonly blackBright: CSPair; - readonly redBright: CSPair; - readonly greenBright: CSPair; - readonly yellowBright: CSPair; - readonly blueBright: CSPair; - readonly cyanBright: CSPair; - readonly magentaBright: CSPair; - readonly whiteBright: CSPair; - } - - interface BackgroundColor { - readonly bgBlack: CSPair; - readonly bgRed: CSPair; - readonly bgGreen: CSPair; - readonly bgYellow: CSPair; - readonly bgBlue: CSPair; - readonly bgCyan: CSPair; - readonly bgMagenta: CSPair; - readonly bgWhite: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGray: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGrey: CSPair; - - readonly bgBlackBright: CSPair; - readonly bgRedBright: CSPair; - readonly bgGreenBright: CSPair; - readonly bgYellowBright: CSPair; - readonly bgBlueBright: CSPair; - readonly bgCyanBright: CSPair; - readonly bgMagentaBright: CSPair; - readonly bgWhiteBright: CSPair; - } -} - -declare const ansiStyles: { - readonly modifier: ansiStyles.Modifier; - readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; - readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; - readonly codes: ReadonlyMap; -} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; - -export = ansiStyles; diff --git a/node_modules/slice-ansi/node_modules/ansi-styles/index.js b/node_modules/slice-ansi/node_modules/ansi-styles/index.js deleted file mode 100644 index 5d82581a1..000000000 --- a/node_modules/slice-ansi/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; - -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - - return value; - }, - enumerable: true, - configurable: true - }); -}; - -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = require('color-convert'); - } - - const offset = isBackground ? 10 : 0; - const styles = {}; - - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } - - return styles; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/node_modules/slice-ansi/node_modules/ansi-styles/license b/node_modules/slice-ansi/node_modules/ansi-styles/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/slice-ansi/node_modules/ansi-styles/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/slice-ansi/node_modules/ansi-styles/package.json b/node_modules/slice-ansi/node_modules/ansi-styles/package.json deleted file mode 100644 index 75393284d..000000000 --- a/node_modules/slice-ansi/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "ansi-styles", - "version": "4.3.0", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": "chalk/ansi-styles", - "funding": "https://github.com/chalk/ansi-styles?sponsor=1", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "color-convert": "^2.0.1" - }, - "devDependencies": { - "@types/color-convert": "^1.9.0", - "ava": "^2.3.0", - "svg-term-cli": "^2.1.1", - "tsd": "^0.11.0", - "xo": "^0.25.3" - } -} diff --git a/node_modules/slice-ansi/node_modules/ansi-styles/readme.md b/node_modules/slice-ansi/node_modules/ansi-styles/readme.md deleted file mode 100644 index 24883de80..000000000 --- a/node_modules/slice-ansi/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,152 +0,0 @@ -# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) - -> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal - -You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - - - -## Install - -``` -$ npm install ansi-styles -``` - -## Usage - -```js -const style = require('ansi-styles'); - -console.log(`${style.green.open}Hello world!${style.green.close}`); - - -// Color conversion between 16/256/truecolor -// NOTE: If conversion goes to 16 colors or 256 colors, the original color -// may be degraded to fit that color palette. This means terminals -// that do not support 16 million colors will best-match the -// original color. -console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); -console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); -``` - -## API - -Each style has an `open` and `close` property. - -## Styles - -### Modifiers - -- `reset` -- `bold` -- `dim` -- `italic` *(Not widely supported)* -- `underline` -- `inverse` -- `hidden` -- `strikethrough` *(Not widely supported)* - -### Colors - -- `black` -- `red` -- `green` -- `yellow` -- `blue` -- `magenta` -- `cyan` -- `white` -- `blackBright` (alias: `gray`, `grey`) -- `redBright` -- `greenBright` -- `yellowBright` -- `blueBright` -- `magentaBright` -- `cyanBright` -- `whiteBright` - -### Background colors - -- `bgBlack` -- `bgRed` -- `bgGreen` -- `bgYellow` -- `bgBlue` -- `bgMagenta` -- `bgCyan` -- `bgWhite` -- `bgBlackBright` (alias: `bgGray`, `bgGrey`) -- `bgRedBright` -- `bgGreenBright` -- `bgYellowBright` -- `bgBlueBright` -- `bgMagentaBright` -- `bgCyanBright` -- `bgWhiteBright` - -## Advanced usage - -By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. - -- `style.modifier` -- `style.color` -- `style.bgColor` - -###### Example - -```js -console.log(style.color.green.open); -``` - -Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. - -###### Example - -```js -console.log(style.codes.get(36)); -//=> 39 -``` - -## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) - -`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. - -The following color spaces from `color-convert` are supported: - -- `rgb` -- `hex` -- `keyword` -- `hsl` -- `hsv` -- `hwb` -- `ansi` -- `ansi256` - -To use these, call the associated conversion function with the intended output, for example: - -```js -style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code -style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code - -style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code -style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code - -style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code -style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code -``` - -## Related - -- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - -## For enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/slice-ansi/node_modules/color-convert/CHANGELOG.md b/node_modules/slice-ansi/node_modules/color-convert/CHANGELOG.md deleted file mode 100644 index 0a7bce4fd..000000000 --- a/node_modules/slice-ansi/node_modules/color-convert/CHANGELOG.md +++ /dev/null @@ -1,54 +0,0 @@ -# 1.0.0 - 2016-01-07 - -- Removed: unused speed test -- Added: Automatic routing between previously unsupported conversions -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Removed: `convert()` class -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Changed: all functions to lookup dictionary -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Changed: `ansi` to `ansi256` -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Fixed: argument grouping for functions requiring only one argument -([#27](https://github.com/Qix-/color-convert/pull/27)) - -# 0.6.0 - 2015-07-23 - -- Added: methods to handle -[ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors: - - rgb2ansi16 - - rgb2ansi - - hsl2ansi16 - - hsl2ansi - - hsv2ansi16 - - hsv2ansi - - hwb2ansi16 - - hwb2ansi - - cmyk2ansi16 - - cmyk2ansi - - keyword2ansi16 - - keyword2ansi - - ansi162rgb - - ansi162hsl - - ansi162hsv - - ansi162hwb - - ansi162cmyk - - ansi162keyword - - ansi2rgb - - ansi2hsl - - ansi2hsv - - ansi2hwb - - ansi2cmyk - - ansi2keyword -([#18](https://github.com/harthur/color-convert/pull/18)) - -# 0.5.3 - 2015-06-02 - -- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]` -([#15](https://github.com/harthur/color-convert/issues/15)) - ---- - -Check out commit logs for older releases diff --git a/node_modules/slice-ansi/node_modules/color-convert/LICENSE b/node_modules/slice-ansi/node_modules/color-convert/LICENSE deleted file mode 100644 index 5b4c386f9..000000000 --- a/node_modules/slice-ansi/node_modules/color-convert/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011-2016 Heather Arthur - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/slice-ansi/node_modules/color-convert/README.md b/node_modules/slice-ansi/node_modules/color-convert/README.md deleted file mode 100644 index d4b08fc36..000000000 --- a/node_modules/slice-ansi/node_modules/color-convert/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# color-convert - -[![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert) - -Color-convert is a color conversion library for JavaScript and node. -It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest): - -```js -var convert = require('color-convert'); - -convert.rgb.hsl(140, 200, 100); // [96, 48, 59] -convert.keyword.rgb('blue'); // [0, 0, 255] - -var rgbChannels = convert.rgb.channels; // 3 -var cmykChannels = convert.cmyk.channels; // 4 -var ansiChannels = convert.ansi16.channels; // 1 -``` - -# Install - -```console -$ npm install color-convert -``` - -# API - -Simply get the property of the _from_ and _to_ conversion that you're looking for. - -All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function. - -All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha). - -```js -var convert = require('color-convert'); - -// Hex to LAB -convert.hex.lab('DEADBF'); // [ 76, 21, -2 ] -convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ] - -// RGB to CMYK -convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ] -convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ] -``` - -### Arrays -All functions that accept multiple arguments also support passing an array. - -Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.) - -```js -var convert = require('color-convert'); - -convert.rgb.hex(123, 45, 67); // '7B2D43' -convert.rgb.hex([123, 45, 67]); // '7B2D43' -``` - -## Routing - -Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex). - -Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js). - -# Contribute - -If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request. - -# License -Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE). diff --git a/node_modules/slice-ansi/node_modules/color-convert/conversions.js b/node_modules/slice-ansi/node_modules/color-convert/conversions.js deleted file mode 100644 index 2657f265c..000000000 --- a/node_modules/slice-ansi/node_modules/color-convert/conversions.js +++ /dev/null @@ -1,839 +0,0 @@ -/* MIT license */ -/* eslint-disable no-mixed-operators */ -const cssKeywords = require('color-name'); - -// NOTE: conversions should only return primitive values (i.e. arrays, or -// values that give correct `typeof` results). -// do not use box values types (i.e. Number(), String(), etc.) - -const reverseKeywords = {}; -for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; -} - -const convert = { - rgb: {channels: 3, labels: 'rgb'}, - hsl: {channels: 3, labels: 'hsl'}, - hsv: {channels: 3, labels: 'hsv'}, - hwb: {channels: 3, labels: 'hwb'}, - cmyk: {channels: 4, labels: 'cmyk'}, - xyz: {channels: 3, labels: 'xyz'}, - lab: {channels: 3, labels: 'lab'}, - lch: {channels: 3, labels: 'lch'}, - hex: {channels: 1, labels: ['hex']}, - keyword: {channels: 1, labels: ['keyword']}, - ansi16: {channels: 1, labels: ['ansi16']}, - ansi256: {channels: 1, labels: ['ansi256']}, - hcg: {channels: 3, labels: ['h', 'c', 'g']}, - apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, - gray: {channels: 1, labels: ['gray']} -}; - -module.exports = convert; - -// Hide .channels and .labels properties -for (const model of Object.keys(convert)) { - if (!('channels' in convert[model])) { - throw new Error('missing channels property: ' + model); - } - - if (!('labels' in convert[model])) { - throw new Error('missing channel labels property: ' + model); - } - - if (convert[model].labels.length !== convert[model].channels) { - throw new Error('channel and label counts mismatch: ' + model); - } - - const {channels, labels} = convert[model]; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], 'channels', {value: channels}); - Object.defineProperty(convert[model], 'labels', {value: labels}); -} - -convert.rgb.hsl = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const min = Math.min(r, g, b); - const max = Math.max(r, g, b); - const delta = max - min; - let h; - let s; - - if (max === min) { - h = 0; - } else if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else if (b === max) { - h = 4 + (r - g) / delta; - } - - h = Math.min(h * 60, 360); - - if (h < 0) { - h += 360; - } - - const l = (min + max) / 2; - - if (max === min) { - s = 0; - } else if (l <= 0.5) { - s = delta / (max + min); - } else { - s = delta / (2 - max - min); - } - - return [h, s * 100, l * 100]; -}; - -convert.rgb.hsv = function (rgb) { - let rdif; - let gdif; - let bdif; - let h; - let s; - - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const v = Math.max(r, g, b); - const diff = v - Math.min(r, g, b); - const diffc = function (c) { - return (v - c) / 6 / diff + 1 / 2; - }; - - if (diff === 0) { - h = 0; - s = 0; - } else { - s = diff / v; - rdif = diffc(r); - gdif = diffc(g); - bdif = diffc(b); - - if (r === v) { - h = bdif - gdif; - } else if (g === v) { - h = (1 / 3) + rdif - bdif; - } else if (b === v) { - h = (2 / 3) + gdif - rdif; - } - - if (h < 0) { - h += 1; - } else if (h > 1) { - h -= 1; - } - } - - return [ - h * 360, - s * 100, - v * 100 - ]; -}; - -convert.rgb.hwb = function (rgb) { - const r = rgb[0]; - const g = rgb[1]; - let b = rgb[2]; - const h = convert.rgb.hsl(rgb)[0]; - const w = 1 / 255 * Math.min(r, Math.min(g, b)); - - b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - - return [h, w * 100, b * 100]; -}; - -convert.rgb.cmyk = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - - const k = Math.min(1 - r, 1 - g, 1 - b); - const c = (1 - r - k) / (1 - k) || 0; - const m = (1 - g - k) / (1 - k) || 0; - const y = (1 - b - k) / (1 - k) || 0; - - return [c * 100, m * 100, y * 100, k * 100]; -}; - -function comparativeDistance(x, y) { - /* - See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance - */ - return ( - ((x[0] - y[0]) ** 2) + - ((x[1] - y[1]) ** 2) + - ((x[2] - y[2]) ** 2) - ); -} - -convert.rgb.keyword = function (rgb) { - const reversed = reverseKeywords[rgb]; - if (reversed) { - return reversed; - } - - let currentClosestDistance = Infinity; - let currentClosestKeyword; - - for (const keyword of Object.keys(cssKeywords)) { - const value = cssKeywords[keyword]; - - // Compute comparative distance - const distance = comparativeDistance(rgb, value); - - // Check if its less, if so set as closest - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } - } - - return currentClosestKeyword; -}; - -convert.keyword.rgb = function (keyword) { - return cssKeywords[keyword]; -}; - -convert.rgb.xyz = function (rgb) { - let r = rgb[0] / 255; - let g = rgb[1] / 255; - let b = rgb[2] / 255; - - // Assume sRGB - r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); - g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); - b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); - - const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); - - return [x * 100, y * 100, z * 100]; -}; - -convert.rgb.lab = function (rgb) { - const xyz = convert.rgb.xyz(rgb); - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - - x /= 95.047; - y /= 100; - z /= 108.883; - - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - - return [l, a, b]; -}; - -convert.hsl.rgb = function (hsl) { - const h = hsl[0] / 360; - const s = hsl[1] / 100; - const l = hsl[2] / 100; - let t2; - let t3; - let val; - - if (s === 0) { - val = l * 255; - return [val, val, val]; - } - - if (l < 0.5) { - t2 = l * (1 + s); - } else { - t2 = l + s - l * s; - } - - const t1 = 2 * l - t2; - - const rgb = [0, 0, 0]; - for (let i = 0; i < 3; i++) { - t3 = h + 1 / 3 * -(i - 1); - if (t3 < 0) { - t3++; - } - - if (t3 > 1) { - t3--; - } - - if (6 * t3 < 1) { - val = t1 + (t2 - t1) * 6 * t3; - } else if (2 * t3 < 1) { - val = t2; - } else if (3 * t3 < 2) { - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - } else { - val = t1; - } - - rgb[i] = val * 255; - } - - return rgb; -}; - -convert.hsl.hsv = function (hsl) { - const h = hsl[0]; - let s = hsl[1] / 100; - let l = hsl[2] / 100; - let smin = s; - const lmin = Math.max(l, 0.01); - - l *= 2; - s *= (l <= 1) ? l : 2 - l; - smin *= lmin <= 1 ? lmin : 2 - lmin; - const v = (l + s) / 2; - const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); - - return [h, sv * 100, v * 100]; -}; - -convert.hsv.rgb = function (hsv) { - const h = hsv[0] / 60; - const s = hsv[1] / 100; - let v = hsv[2] / 100; - const hi = Math.floor(h) % 6; - - const f = h - Math.floor(h); - const p = 255 * v * (1 - s); - const q = 255 * v * (1 - (s * f)); - const t = 255 * v * (1 - (s * (1 - f))); - v *= 255; - - switch (hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; - } -}; - -convert.hsv.hsl = function (hsv) { - const h = hsv[0]; - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const vmin = Math.max(v, 0.01); - let sl; - let l; - - l = (2 - s) * v; - const lmin = (2 - s) * vmin; - sl = s * vmin; - sl /= (lmin <= 1) ? lmin : 2 - lmin; - sl = sl || 0; - l /= 2; - - return [h, sl * 100, l * 100]; -}; - -// http://dev.w3.org/csswg/css-color/#hwb-to-rgb -convert.hwb.rgb = function (hwb) { - const h = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f; - - // Wh + bl cant be > 1 - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } - - const i = Math.floor(6 * h); - const v = 1 - bl; - f = 6 * h - i; - - if ((i & 0x01) !== 0) { - f = 1 - f; - } - - const n = wh + f * (v - wh); // Linear interpolation - - let r; - let g; - let b; - /* eslint-disable max-statements-per-line,no-multi-spaces */ - switch (i) { - default: - case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; - } - /* eslint-enable max-statements-per-line,no-multi-spaces */ - - return [r * 255, g * 255, b * 255]; -}; - -convert.cmyk.rgb = function (cmyk) { - const c = cmyk[0] / 100; - const m = cmyk[1] / 100; - const y = cmyk[2] / 100; - const k = cmyk[3] / 100; - - const r = 1 - Math.min(1, c * (1 - k) + k); - const g = 1 - Math.min(1, m * (1 - k) + k); - const b = 1 - Math.min(1, y * (1 - k) + k); - - return [r * 255, g * 255, b * 255]; -}; - -convert.xyz.rgb = function (xyz) { - const x = xyz[0] / 100; - const y = xyz[1] / 100; - const z = xyz[2] / 100; - let r; - let g; - let b; - - r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); - g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); - b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - - // Assume sRGB - r = r > 0.0031308 - ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) - : r * 12.92; - - g = g > 0.0031308 - ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) - : g * 12.92; - - b = b > 0.0031308 - ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) - : b * 12.92; - - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); - - return [r * 255, g * 255, b * 255]; -}; - -convert.xyz.lab = function (xyz) { - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - - x /= 95.047; - y /= 100; - z /= 108.883; - - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - - return [l, a, b]; -}; - -convert.lab.xyz = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let x; - let y; - let z; - - y = (l + 16) / 116; - x = a / 500 + y; - z = y - b / 200; - - const y2 = y ** 3; - const x2 = x ** 3; - const z2 = z ** 3; - y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; - x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; - z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; - - x *= 95.047; - y *= 100; - z *= 108.883; - - return [x, y, z]; -}; - -convert.lab.lch = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let h; - - const hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; - - if (h < 0) { - h += 360; - } - - const c = Math.sqrt(a * a + b * b); - - return [l, c, h]; -}; - -convert.lch.lab = function (lch) { - const l = lch[0]; - const c = lch[1]; - const h = lch[2]; - - const hr = h / 360 * 2 * Math.PI; - const a = c * Math.cos(hr); - const b = c * Math.sin(hr); - - return [l, a, b]; -}; - -convert.rgb.ansi16 = function (args, saturation = null) { - const [r, g, b] = args; - let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization - - value = Math.round(value / 50); - - if (value === 0) { - return 30; - } - - let ansi = 30 - + ((Math.round(b / 255) << 2) - | (Math.round(g / 255) << 1) - | Math.round(r / 255)); - - if (value === 2) { - ansi += 60; - } - - return ansi; -}; - -convert.hsv.ansi16 = function (args) { - // Optimization here; we already know the value and don't need to get - // it converted for us. - return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); -}; - -convert.rgb.ansi256 = function (args) { - const r = args[0]; - const g = args[1]; - const b = args[2]; - - // We use the extended greyscale palette here, with the exception of - // black and white. normal palette only has 4 greyscale shades. - if (r === g && g === b) { - if (r < 8) { - return 16; - } - - if (r > 248) { - return 231; - } - - return Math.round(((r - 8) / 247) * 24) + 232; - } - - const ansi = 16 - + (36 * Math.round(r / 255 * 5)) - + (6 * Math.round(g / 255 * 5)) - + Math.round(b / 255 * 5); - - return ansi; -}; - -convert.ansi16.rgb = function (args) { - let color = args % 10; - - // Handle greyscale - if (color === 0 || color === 7) { - if (args > 50) { - color += 3.5; - } - - color = color / 10.5 * 255; - - return [color, color, color]; - } - - const mult = (~~(args > 50) + 1) * 0.5; - const r = ((color & 1) * mult) * 255; - const g = (((color >> 1) & 1) * mult) * 255; - const b = (((color >> 2) & 1) * mult) * 255; - - return [r, g, b]; -}; - -convert.ansi256.rgb = function (args) { - // Handle greyscale - if (args >= 232) { - const c = (args - 232) * 10 + 8; - return [c, c, c]; - } - - args -= 16; - - let rem; - const r = Math.floor(args / 36) / 5 * 255; - const g = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b = (rem % 6) / 5 * 255; - - return [r, g, b]; -}; - -convert.rgb.hex = function (args) { - const integer = ((Math.round(args[0]) & 0xFF) << 16) - + ((Math.round(args[1]) & 0xFF) << 8) - + (Math.round(args[2]) & 0xFF); - - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; - -convert.hex.rgb = function (args) { - const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { - return [0, 0, 0]; - } - - let colorString = match[0]; - - if (match[0].length === 3) { - colorString = colorString.split('').map(char => { - return char + char; - }).join(''); - } - - const integer = parseInt(colorString, 16); - const r = (integer >> 16) & 0xFF; - const g = (integer >> 8) & 0xFF; - const b = integer & 0xFF; - - return [r, g, b]; -}; - -convert.rgb.hcg = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(Math.max(r, g), b); - const min = Math.min(Math.min(r, g), b); - const chroma = (max - min); - let grayscale; - let hue; - - if (chroma < 1) { - grayscale = min / (1 - chroma); - } else { - grayscale = 0; - } - - if (chroma <= 0) { - hue = 0; - } else - if (max === r) { - hue = ((g - b) / chroma) % 6; - } else - if (max === g) { - hue = 2 + (b - r) / chroma; - } else { - hue = 4 + (r - g) / chroma; - } - - hue /= 6; - hue %= 1; - - return [hue * 360, chroma * 100, grayscale * 100]; -}; - -convert.hsl.hcg = function (hsl) { - const s = hsl[1] / 100; - const l = hsl[2] / 100; - - const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); - - let f = 0; - if (c < 1.0) { - f = (l - 0.5 * c) / (1.0 - c); - } - - return [hsl[0], c * 100, f * 100]; -}; - -convert.hsv.hcg = function (hsv) { - const s = hsv[1] / 100; - const v = hsv[2] / 100; - - const c = s * v; - let f = 0; - - if (c < 1.0) { - f = (v - c) / (1 - c); - } - - return [hsv[0], c * 100, f * 100]; -}; - -convert.hcg.rgb = function (hcg) { - const h = hcg[0] / 360; - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - if (c === 0.0) { - return [g * 255, g * 255, g * 255]; - } - - const pure = [0, 0, 0]; - const hi = (h % 1) * 6; - const v = hi % 1; - const w = 1 - v; - let mg = 0; - - /* eslint-disable max-statements-per-line */ - switch (Math.floor(hi)) { - case 0: - pure[0] = 1; pure[1] = v; pure[2] = 0; break; - case 1: - pure[0] = w; pure[1] = 1; pure[2] = 0; break; - case 2: - pure[0] = 0; pure[1] = 1; pure[2] = v; break; - case 3: - pure[0] = 0; pure[1] = w; pure[2] = 1; break; - case 4: - pure[0] = v; pure[1] = 0; pure[2] = 1; break; - default: - pure[0] = 1; pure[1] = 0; pure[2] = w; - } - /* eslint-enable max-statements-per-line */ - - mg = (1.0 - c) * g; - - return [ - (c * pure[0] + mg) * 255, - (c * pure[1] + mg) * 255, - (c * pure[2] + mg) * 255 - ]; -}; - -convert.hcg.hsv = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - const v = c + g * (1.0 - c); - let f = 0; - - if (v > 0.0) { - f = c / v; - } - - return [hcg[0], f * 100, v * 100]; -}; - -convert.hcg.hsl = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - const l = g * (1.0 - c) + 0.5 * c; - let s = 0; - - if (l > 0.0 && l < 0.5) { - s = c / (2 * l); - } else - if (l >= 0.5 && l < 1.0) { - s = c / (2 * (1 - l)); - } - - return [hcg[0], s * 100, l * 100]; -}; - -convert.hcg.hwb = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1.0 - c); - return [hcg[0], (v - c) * 100, (1 - v) * 100]; -}; - -convert.hwb.hcg = function (hwb) { - const w = hwb[1] / 100; - const b = hwb[2] / 100; - const v = 1 - b; - const c = v - w; - let g = 0; - - if (c < 1) { - g = (v - c) / (1 - c); - } - - return [hwb[0], c * 100, g * 100]; -}; - -convert.apple.rgb = function (apple) { - return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; -}; - -convert.rgb.apple = function (rgb) { - return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; -}; - -convert.gray.rgb = function (args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; -}; - -convert.gray.hsl = function (args) { - return [0, 0, args[0]]; -}; - -convert.gray.hsv = convert.gray.hsl; - -convert.gray.hwb = function (gray) { - return [0, 100, gray[0]]; -}; - -convert.gray.cmyk = function (gray) { - return [0, 0, 0, gray[0]]; -}; - -convert.gray.lab = function (gray) { - return [gray[0], 0, 0]; -}; - -convert.gray.hex = function (gray) { - const val = Math.round(gray[0] / 100 * 255) & 0xFF; - const integer = (val << 16) + (val << 8) + val; - - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; - -convert.rgb.gray = function (rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; -}; diff --git a/node_modules/slice-ansi/node_modules/color-convert/index.js b/node_modules/slice-ansi/node_modules/color-convert/index.js deleted file mode 100644 index b648e5737..000000000 --- a/node_modules/slice-ansi/node_modules/color-convert/index.js +++ /dev/null @@ -1,81 +0,0 @@ -const conversions = require('./conversions'); -const route = require('./route'); - -const convert = {}; - -const models = Object.keys(conversions); - -function wrapRaw(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - if (arg0 === undefined || arg0 === null) { - return arg0; - } - - if (arg0.length > 1) { - args = arg0; - } - - return fn(args); - }; - - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -function wrapRounded(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - - if (arg0 === undefined || arg0 === null) { - return arg0; - } - - if (arg0.length > 1) { - args = arg0; - } - - const result = fn(args); - - // We're assuming the result is an array here. - // see notice in conversions.js; don't use box types - // in conversion functions. - if (typeof result === 'object') { - for (let len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } - - return result; - }; - - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -models.forEach(fromModel => { - convert[fromModel] = {}; - - Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); - Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); - - const routes = route(fromModel); - const routeModels = Object.keys(routes); - - routeModels.forEach(toModel => { - const fn = routes[toModel]; - - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); - }); -}); - -module.exports = convert; diff --git a/node_modules/slice-ansi/node_modules/color-convert/package.json b/node_modules/slice-ansi/node_modules/color-convert/package.json deleted file mode 100644 index 6e48000c7..000000000 --- a/node_modules/slice-ansi/node_modules/color-convert/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "color-convert", - "description": "Plain color conversion functions", - "version": "2.0.1", - "author": "Heather Arthur ", - "license": "MIT", - "repository": "Qix-/color-convert", - "scripts": { - "pretest": "xo", - "test": "node test/basic.js" - }, - "engines": { - "node": ">=7.0.0" - }, - "keywords": [ - "color", - "colour", - "convert", - "converter", - "conversion", - "rgb", - "hsl", - "hsv", - "hwb", - "cmyk", - "ansi", - "ansi16" - ], - "files": [ - "index.js", - "conversions.js", - "route.js" - ], - "xo": { - "rules": { - "default-case": 0, - "no-inline-comments": 0, - "operator-linebreak": 0 - } - }, - "devDependencies": { - "chalk": "^2.4.2", - "xo": "^0.24.0" - }, - "dependencies": { - "color-name": "~1.1.4" - } -} diff --git a/node_modules/slice-ansi/node_modules/color-convert/route.js b/node_modules/slice-ansi/node_modules/color-convert/route.js deleted file mode 100644 index 1a08521b5..000000000 --- a/node_modules/slice-ansi/node_modules/color-convert/route.js +++ /dev/null @@ -1,97 +0,0 @@ -const conversions = require('./conversions'); - -/* - This function routes a model to all other models. - - all functions that are routed have a property `.conversion` attached - to the returned synthetic function. This property is an array - of strings, each with the steps in between the 'from' and 'to' - color models (inclusive). - - conversions that are not possible simply are not included. -*/ - -function buildGraph() { - const graph = {}; - // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - const models = Object.keys(conversions); - - for (let len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } - - return graph; -} - -// https://en.wikipedia.org/wiki/Breadth-first_search -function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; // Unshift -> queue -> pop - - graph[fromModel].distance = 0; - - while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); - - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; - - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); - } - } - } - - return graph; -} - -function link(from, to) { - return function (args) { - return to(from(args)); - }; -} - -function wrapConversion(toModel, graph) { - const path = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; - - let cur = graph[toModel].parent; - while (graph[cur].parent) { - path.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; - } - - fn.conversion = path; - return fn; -} - -module.exports = function (fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; - - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; - - if (node.parent === null) { - // No possible conversion, or this node is the source model. - continue; - } - - conversion[toModel] = wrapConversion(toModel, graph); - } - - return conversion; -}; - diff --git a/node_modules/slice-ansi/node_modules/color-name/LICENSE b/node_modules/slice-ansi/node_modules/color-name/LICENSE deleted file mode 100644 index c6b100125..000000000 --- a/node_modules/slice-ansi/node_modules/color-name/LICENSE +++ /dev/null @@ -1,8 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2015 Dmitry Ivanov - -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. \ No newline at end of file diff --git a/node_modules/slice-ansi/node_modules/color-name/README.md b/node_modules/slice-ansi/node_modules/color-name/README.md deleted file mode 100644 index 932b97917..000000000 --- a/node_modules/slice-ansi/node_modules/color-name/README.md +++ /dev/null @@ -1,11 +0,0 @@ -A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. - -[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) - - -```js -var colors = require('color-name'); -colors.red //[255,0,0] -``` - - diff --git a/node_modules/slice-ansi/node_modules/color-name/index.js b/node_modules/slice-ansi/node_modules/color-name/index.js deleted file mode 100644 index b7c198a6f..000000000 --- a/node_modules/slice-ansi/node_modules/color-name/index.js +++ /dev/null @@ -1,152 +0,0 @@ -'use strict' - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; diff --git a/node_modules/slice-ansi/node_modules/color-name/package.json b/node_modules/slice-ansi/node_modules/color-name/package.json deleted file mode 100644 index 782dd8287..000000000 --- a/node_modules/slice-ansi/node_modules/color-name/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "color-name", - "version": "1.1.4", - "description": "A list of color names and its values", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git@github.com:colorjs/color-name.git" - }, - "keywords": [ - "color-name", - "color", - "color-keyword", - "keyword" - ], - "author": "DY ", - "license": "MIT", - "bugs": { - "url": "https://github.com/colorjs/color-name/issues" - }, - "homepage": "https://github.com/colorjs/color-name" -} diff --git a/node_modules/slice-ansi/package.json b/node_modules/slice-ansi/package.json deleted file mode 100644 index 7d6ea6956..000000000 --- a/node_modules/slice-ansi/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "slice-ansi", - "version": "4.0.0", - "description": "Slice a string with ANSI escape codes", - "license": "MIT", - "repository": "chalk/slice-ansi", - "funding": "https://github.com/chalk/slice-ansi?sponsor=1", - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "slice", - "string", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "devDependencies": { - "ava": "^2.1.0", - "chalk": "^3.0.0", - "random-item": "^3.0.0", - "strip-ansi": "^6.0.0", - "xo": "^0.26.1" - } -} diff --git a/node_modules/slice-ansi/readme.md b/node_modules/slice-ansi/readme.md deleted file mode 100644 index 88d36772c..000000000 --- a/node_modules/slice-ansi/readme.md +++ /dev/null @@ -1,66 +0,0 @@ -# slice-ansi [![Build Status](https://travis-ci.org/chalk/slice-ansi.svg?branch=master)](https://travis-ci.org/chalk/slice-ansi) [![XO: Linted](https://img.shields.io/badge/xo-linted-blue.svg)](https://github.com/xojs/xo) - -> Slice a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) - -## Install - -``` -$ npm install slice-ansi -``` - -## Usage - -```js -const chalk = require('chalk'); -const sliceAnsi = require('slice-ansi'); - -const string = 'The quick brown ' + chalk.red('fox jumped over ') + - 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); - -console.log(sliceAnsi(string, 20, 30)); -``` - -## API - -### sliceAnsi(string, beginSlice, endSlice?) - -#### string - -Type: `string` - -String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). - -#### beginSlice - -Type: `number` - -Zero-based index at which to begin the slice. - -#### endSlice - -Type: `number` - -Zero-based index at which to end the slice. - -## Related - -- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes -- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/source-map-js/CHANGELOG.md b/node_modules/source-map-js/CHANGELOG.md deleted file mode 100644 index 4cd530754..000000000 --- a/node_modules/source-map-js/CHANGELOG.md +++ /dev/null @@ -1,320 +0,0 @@ -# Change Log - -## 1.0.2 - -* Add types for path imports ([#13](https://github.com/7rulnik/source-map-js/pull/13)) [@TrySound](https://github.com/TrySound) - -## 1.0.1 - -* Remove cleanComments optimization ([#10](https://github.com/7rulnik/source-map-js/pull/10)) [@ai](https://github.com/ai) - -## 1.0.0 - -* Fix package.json#typings field ([#6](https://github.com/7rulnik/source-map-js/pull/6)) [@chalkygames123](https://github.com/chalkygames123) - -* Reduce memory usage of eachMapping w/ loop ([#5](https://github.com/7rulnik/source-map-js/pull/5)) [@noppa](https://github.com/noppa) - -* Reduce npm package size ([#7](https://github.com/7rulnik/source-map-js/pull/7)) [@ai](https://github.com/ai) - ----------- -# It doesn't related to this fork: - -## 0.5.6 - -* Fix for regression when people were using numbers as names in source maps. See - #236. - -## 0.5.5 - -* Fix "regression" of unsupported, implementation behavior that half the world - happens to have come to depend on. See #235. - -* Fix regression involving function hoisting in SpiderMonkey. See #233. - -## 0.5.4 - -* Large performance improvements to source-map serialization. See #228 and #229. - -## 0.5.3 - -* Do not include unnecessary distribution files. See - commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86. - -## 0.5.2 - -* Include browser distributions of the library in package.json's `files`. See - issue #212. - -## 0.5.1 - -* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See - ff05274becc9e6e1295ed60f3ea090d31d843379. - -## 0.5.0 - -* Node 0.8 is no longer supported. - -* Use webpack instead of dryice for bundling. - -* Big speedups serializing source maps. See pull request #203. - -* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that - explicitly start with the source root. See issue #199. - -## 0.4.4 - -* Fix an issue where using a `SourceMapGenerator` after having created a - `SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See - issue #191. - -* Fix an issue with where `SourceMapGenerator` would mistakenly consider - different mappings as duplicates of each other and avoid generating them. See - issue #192. - -## 0.4.3 - -* A very large number of performance improvements, particularly when parsing - source maps. Collectively about 75% of time shaved off of the source map - parsing benchmark! - -* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy - searching in the presence of a column option. See issue #177. - -* Fix a bug with joining a source and its source root when the source is above - the root. See issue #182. - -* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to - determine when all sources' contents are inlined into the source map. See - issue #190. - -## 0.4.2 - -* Add an `.npmignore` file so that the benchmarks aren't pulled down by - dependent projects. Issue #169. - -* Add an optional `column` argument to - `SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines - with no mappings. Issues #172 and #173. - -## 0.4.1 - -* Fix accidentally defining a global variable. #170. - -## 0.4.0 - -* The default direction for fuzzy searching was changed back to its original - direction. See #164. - -* There is now a `bias` option you can supply to `SourceMapConsumer` to control - the fuzzy searching direction. See #167. - -* About an 8% speed up in parsing source maps. See #159. - -* Added a benchmark for parsing and generating source maps. - -## 0.3.0 - -* Change the default direction that searching for positions fuzzes when there is - not an exact match. See #154. - -* Support for environments using json2.js for JSON serialization. See #156. - -## 0.2.0 - -* Support for consuming "indexed" source maps which do not have any remote - sections. See pull request #127. This introduces a minor backwards - incompatibility if you are monkey patching `SourceMapConsumer.prototype` - methods. - -## 0.1.43 - -* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue - #148 for some discussion and issues #150, #151, and #152 for implementations. - -## 0.1.42 - -* Fix an issue where `SourceNode`s from different versions of the source-map - library couldn't be used in conjunction with each other. See issue #142. - -## 0.1.41 - -* Fix a bug with getting the source content of relative sources with a "./" - prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). - -* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the - column span of each mapping. - -* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find - all generated positions associated with a given original source and line. - -## 0.1.40 - -* Performance improvements for parsing source maps in SourceMapConsumer. - -## 0.1.39 - -* Fix a bug where setting a source's contents to null before any source content - had been set before threw a TypeError. See issue #131. - -## 0.1.38 - -* Fix a bug where finding relative paths from an empty path were creating - absolute paths. See issue #129. - -## 0.1.37 - -* Fix a bug where if the source root was an empty string, relative source paths - would turn into absolute source paths. Issue #124. - -## 0.1.36 - -* Allow the `names` mapping property to be an empty string. Issue #121. - -## 0.1.35 - -* A third optional parameter was added to `SourceNode.fromStringWithSourceMap` - to specify a path that relative sources in the second parameter should be - relative to. Issue #105. - -* If no file property is given to a `SourceMapGenerator`, then the resulting - source map will no longer have a `null` file property. The property will - simply not exist. Issue #104. - -* Fixed a bug where consecutive newlines were ignored in `SourceNode`s. - Issue #116. - -## 0.1.34 - -* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103. - -* Fix bug involving source contents and the - `SourceMapGenerator.prototype.applySourceMap`. Issue #100. - -## 0.1.33 - -* Fix some edge cases surrounding path joining and URL resolution. - -* Add a third parameter for relative path to - `SourceMapGenerator.prototype.applySourceMap`. - -* Fix issues with mappings and EOLs. - -## 0.1.32 - -* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns - (issue 92). - -* Fixed test runner to actually report number of failed tests as its process - exit code. - -* Fixed a typo when reporting bad mappings (issue 87). - -## 0.1.31 - -* Delay parsing the mappings in SourceMapConsumer until queried for a source - location. - -* Support Sass source maps (which at the time of writing deviate from the spec - in small ways) in SourceMapConsumer. - -## 0.1.30 - -* Do not join source root with a source, when the source is a data URI. - -* Extend the test runner to allow running single specific test files at a time. - -* Performance improvements in `SourceNode.prototype.walk` and - `SourceMapConsumer.prototype.eachMapping`. - -* Source map browser builds will now work inside Workers. - -* Better error messages when attempting to add an invalid mapping to a - `SourceMapGenerator`. - -## 0.1.29 - -* Allow duplicate entries in the `names` and `sources` arrays of source maps - (usually from TypeScript) we are parsing. Fixes github issue 72. - -## 0.1.28 - -* Skip duplicate mappings when creating source maps from SourceNode; github - issue 75. - -## 0.1.27 - -* Don't throw an error when the `file` property is missing in SourceMapConsumer, - we don't use it anyway. - -## 0.1.26 - -* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. - -## 0.1.25 - -* Make compatible with browserify - -## 0.1.24 - -* Fix issue with absolute paths and `file://` URIs. See - https://bugzilla.mozilla.org/show_bug.cgi?id=885597 - -## 0.1.23 - -* Fix issue with absolute paths and sourcesContent, github issue 64. - -## 0.1.22 - -* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. - -## 0.1.21 - -* Fixed handling of sources that start with a slash so that they are relative to - the source root's host. - -## 0.1.20 - -* Fixed github issue #43: absolute URLs aren't joined with the source root - anymore. - -## 0.1.19 - -* Using Travis CI to run tests. - -## 0.1.18 - -* Fixed a bug in the handling of sourceRoot. - -## 0.1.17 - -* Added SourceNode.fromStringWithSourceMap. - -## 0.1.16 - -* Added missing documentation. - -* Fixed the generating of empty mappings in SourceNode. - -## 0.1.15 - -* Added SourceMapGenerator.applySourceMap. - -## 0.1.14 - -* The sourceRoot is now handled consistently. - -## 0.1.13 - -* Added SourceMapGenerator.fromSourceMap. - -## 0.1.12 - -* SourceNode now generates empty mappings too. - -## 0.1.11 - -* Added name support to SourceNode. - -## 0.1.10 - -* Added sourcesContent support to the customer and generator. diff --git a/node_modules/source-map-js/LICENSE b/node_modules/source-map-js/LICENSE deleted file mode 100644 index ed1b7cf27..000000000 --- a/node_modules/source-map-js/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ - -Copyright (c) 2009-2011, Mozilla Foundation and contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the names of the Mozilla Foundation nor the names of project - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/source-map-js/README.md b/node_modules/source-map-js/README.md deleted file mode 100644 index ba01846ca..000000000 --- a/node_modules/source-map-js/README.md +++ /dev/null @@ -1,758 +0,0 @@ -# Source Map JS - -[![NPM](https://nodei.co/npm/source-map-js.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map-js) - -Difference between original [source-map](https://github.com/mozilla/source-map): - -> TL,DR: it's fork of original source-map@0.6, but with perfomance optimizations. - -This journey starts from [source-map@0.7.0](https://github.com/mozilla/source-map/blob/master/CHANGELOG.md#070). Some part of it was rewritten to Rust and WASM and API became async. - -It's still a major block for many libraries like PostCSS or Sass for example because they need to migrate the whole API to the async way. This is the reason why 0.6.1 has 2x more downloads than 0.7.3 while it's faster several times. - -![Downloads count](media/downloads.png) - -More important that WASM version has some optimizations in JS code too. This is why [community asked to create branch for 0.6 version](https://github.com/mozilla/source-map/issues/324) and port these optimizations but, sadly, the answer was «no». A bit later I discovered [the issue](https://github.com/mozilla/source-map/issues/370) created by [Ben Rothman (@benthemonkey)](https://github.com/benthemonkey) with no response at all. - -[Roman Dvornov (@lahmatiy)](https://github.com/lahmatiy) wrote a [serveral posts](https://t.me/gorshochekvarit/76) (russian, only, sorry) about source-map library in his own Telegram channel. He mentioned the article [«Maybe you don't need Rust and WASM to speed up your JS»](https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html) written by [Vyacheslav Egorov (@mraleph)](https://github.com/mraleph). This article contains optimizations and hacks that lead to almost the same performance compare to WASM implementation. - -I decided to fork the original source-map and port these optimizations from the article and several others PR from the original source-map. - ---------- - -This is a library to generate and consume the source map format -[described here][format]. - -[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit - -## Use with Node - - $ npm install source-map-js - - - --------------------------------------------------------------------------------- - - - - - -## Table of Contents - -- [Examples](#examples) - - [Consuming a source map](#consuming-a-source-map) - - [Generating a source map](#generating-a-source-map) - - [With SourceNode (high level API)](#with-sourcenode-high-level-api) - - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) -- [API](#api) - - [SourceMapConsumer](#sourcemapconsumer) - - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) - - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) - - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) - - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) - - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) - - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) - - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) - - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) - - [SourceMapGenerator](#sourcemapgenerator) - - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) - - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) - - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) - - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) - - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) - - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) - - [SourceNode](#sourcenode) - - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) - - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) - - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) - - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) - - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) - - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) - - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) - - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) - - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) - - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) - - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) - - - -## Examples - -### Consuming a source map - -```js -var rawSourceMap = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourceRoot: 'http://example.com/www/js/', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' -}; - -var smc = new SourceMapConsumer(rawSourceMap); - -console.log(smc.sources); -// [ 'http://example.com/www/js/one.js', -// 'http://example.com/www/js/two.js' ] - -console.log(smc.originalPositionFor({ - line: 2, - column: 28 -})); -// { source: 'http://example.com/www/js/two.js', -// line: 2, -// column: 10, -// name: 'n' } - -console.log(smc.generatedPositionFor({ - source: 'http://example.com/www/js/two.js', - line: 2, - column: 10 -})); -// { line: 2, column: 28 } - -smc.eachMapping(function (m) { - // ... -}); -``` - -### Generating a source map - -In depth guide: -[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) - -#### With SourceNode (high level API) - -```js -function compile(ast) { - switch (ast.type) { - case 'BinaryExpression': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - [compile(ast.left), " + ", compile(ast.right)] - ); - case 'Literal': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - String(ast.value) - ); - // ... - default: - throw new Error("Bad AST"); - } -} - -var ast = parse("40 + 2", "add.js"); -console.log(compile(ast).toStringWithSourceMap({ - file: 'add.js' -})); -// { code: '40 + 2', -// map: [object SourceMapGenerator] } -``` - -#### With SourceMapGenerator (low level API) - -```js -var map = new SourceMapGenerator({ - file: "source-mapped.js" -}); - -map.addMapping({ - generated: { - line: 10, - column: 35 - }, - source: "foo.js", - original: { - line: 33, - column: 2 - }, - name: "christopher" -}); - -console.log(map.toString()); -// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' -``` - -## API - -Get a reference to the module: - -```js -// Node.js -var sourceMap = require('source-map'); - -// Browser builds -var sourceMap = window.sourceMap; - -// Inside Firefox -const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); -``` - -### SourceMapConsumer - -A SourceMapConsumer instance represents a parsed source map which we can query -for information about the original file positions by giving it a file position -in the generated source. - -#### new SourceMapConsumer(rawSourceMap) - -The only parameter is the raw source map (either as a string which can be -`JSON.parse`'d, or an object). According to the spec, source maps have the -following attributes: - -* `version`: Which version of the source map spec this map is following. - -* `sources`: An array of URLs to the original source files. - -* `names`: An array of identifiers which can be referenced by individual - mappings. - -* `sourceRoot`: Optional. The URL root from which all sources are relative. - -* `sourcesContent`: Optional. An array of contents of the original source files. - -* `mappings`: A string of base64 VLQs which contain the actual mappings. - -* `file`: Optional. The generated filename this source map is associated with. - -```js -var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); -``` - -#### SourceMapConsumer.prototype.computeColumnSpans() - -Compute the last column for each generated mapping. The last column is -inclusive. - -```js -// Before: -consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1 }, -// { line: 2, -// column: 10 }, -// { line: 2, -// column: 20 } ] - -consumer.computeColumnSpans(); - -// After: -consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1, -// lastColumn: 9 }, -// { line: 2, -// column: 10, -// lastColumn: 19 }, -// { line: 2, -// column: 20, -// lastColumn: Infinity } ] - -``` - -#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) - -Returns the original source, line, and column information for the generated -source's line and column positions provided. The only argument is an object with -the following properties: - -* `line`: The line number in the generated source. Line numbers in - this library are 1-based (note that the underlying source map - specification uses 0-based line numbers -- this library handles the - translation). - -* `column`: The column number in the generated source. Column numbers - in this library are 0-based. - -* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or - `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest - element that is smaller than or greater than the one we are searching for, - respectively, if the exact element cannot be found. Defaults to - `SourceMapConsumer.GREATEST_LOWER_BOUND`. - -and an object is returned with the following properties: - -* `source`: The original source file, or null if this information is not - available. - -* `line`: The line number in the original source, or null if this information is - not available. The line number is 1-based. - -* `column`: The column number in the original source, or null if this - information is not available. The column number is 0-based. - -* `name`: The original identifier, or null if this information is not available. - -```js -consumer.originalPositionFor({ line: 2, column: 10 }) -// { source: 'foo.coffee', -// line: 2, -// column: 2, -// name: null } - -consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) -// { source: null, -// line: null, -// column: null, -// name: null } -``` - -#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) - -Returns the generated line and column information for the original source, -line, and column positions provided. The only argument is an object with -the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. The line number is - 1-based. - -* `column`: The column number in the original source. The column - number is 0-based. - -and an object is returned with the following properties: - -* `line`: The line number in the generated source, or null. The line - number is 1-based. - -* `column`: The column number in the generated source, or null. The - column number is 0-based. - -```js -consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) -// { line: 1, -// column: 56 } -``` - -#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) - -Returns all generated line and column information for the original source, line, -and column provided. If no column is provided, returns all mappings -corresponding to a either the line we are searching for or the next closest line -that has any mappings. Otherwise, returns all mappings corresponding to the -given line and either the column we are searching for or the next closest column -that has any offsets. - -The only argument is an object with the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. The line number is - 1-based. - -* `column`: Optional. The column number in the original source. The - column number is 0-based. - -and an array of objects is returned, each with the following properties: - -* `line`: The line number in the generated source, or null. The line - number is 1-based. - -* `column`: The column number in the generated source, or null. The - column number is 0-based. - -```js -consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) -// [ { line: 2, -// column: 1 }, -// { line: 2, -// column: 10 }, -// { line: 2, -// column: 20 } ] -``` - -#### SourceMapConsumer.prototype.hasContentsOfAllSources() - -Return true if we have the embedded source content for every source listed in -the source map, false otherwise. - -In other words, if this method returns `true`, then -`consumer.sourceContentFor(s)` will succeed for every source `s` in -`consumer.sources`. - -```js -// ... -if (consumer.hasContentsOfAllSources()) { - consumerReadyCallback(consumer); -} else { - fetchSources(consumer, consumerReadyCallback); -} -// ... -``` - -#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) - -Returns the original source content for the source provided. The only -argument is the URL of the original source file. - -If the source content for the given source is not found, then an error is -thrown. Optionally, pass `true` as the second param to have `null` returned -instead. - -```js -consumer.sources -// [ "my-cool-lib.clj" ] - -consumer.sourceContentFor("my-cool-lib.clj") -// "..." - -consumer.sourceContentFor("this is not in the source map"); -// Error: "this is not in the source map" is not in the source map - -consumer.sourceContentFor("this is not in the source map", true); -// null -``` - -#### SourceMapConsumer.prototype.eachMapping(callback, context, order) - -Iterate over each mapping between an original source/line/column and a -generated line/column in this source map. - -* `callback`: The function that is called with each mapping. Mappings have the - form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, - name }` - -* `context`: Optional. If specified, this object will be the value of `this` - every time that `callback` is called. - -* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or - `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over - the mappings sorted by the generated file's line/column order or the - original's source/line/column order, respectively. Defaults to - `SourceMapConsumer.GENERATED_ORDER`. - -```js -consumer.eachMapping(function (m) { console.log(m); }) -// ... -// { source: 'illmatic.js', -// generatedLine: 1, -// generatedColumn: 0, -// originalLine: 1, -// originalColumn: 0, -// name: null } -// { source: 'illmatic.js', -// generatedLine: 2, -// generatedColumn: 0, -// originalLine: 2, -// originalColumn: 0, -// name: null } -// ... -``` -### SourceMapGenerator - -An instance of the SourceMapGenerator represents a source map which is being -built incrementally. - -#### new SourceMapGenerator([startOfSourceMap]) - -You may pass an object with the following properties: - -* `file`: The filename of the generated source that this source map is - associated with. - -* `sourceRoot`: A root for all relative URLs in this source map. - -* `skipValidation`: Optional. When `true`, disables validation of mappings as - they are added. This can improve performance but should be used with - discretion, as a last resort. Even then, one should avoid using this flag when - running tests, if possible. - -```js -var generator = new sourceMap.SourceMapGenerator({ - file: "my-generated-javascript-file.js", - sourceRoot: "http://example.com/app/js/" -}); -``` - -#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) - -Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. - -* `sourceMapConsumer` The SourceMap. - -```js -var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer); -``` - -#### SourceMapGenerator.prototype.addMapping(mapping) - -Add a single mapping from original source line and column to the generated -source's line and column for this source map being created. The mapping object -should have the following properties: - -* `generated`: An object with the generated line and column positions. - -* `original`: An object with the original line and column positions. - -* `source`: The original source file (relative to the sourceRoot). - -* `name`: An optional original token name for this mapping. - -```js -generator.addMapping({ - source: "module-one.scm", - original: { line: 128, column: 0 }, - generated: { line: 3, column: 456 } -}) -``` - -#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for an original source file. - -* `sourceFile` the URL of the original source file. - -* `sourceContent` the content of the source file. - -```js -generator.setSourceContent("module-one.scm", - fs.readFileSync("path/to/module-one.scm")) -``` - -#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) - -Applies a SourceMap for a source file to the SourceMap. -Each mapping to the supplied source file is rewritten using the -supplied SourceMap. Note: The resolution for the resulting mappings -is the minimum of this map and the supplied map. - -* `sourceMapConsumer`: The SourceMap to be applied. - -* `sourceFile`: Optional. The filename of the source file. - If omitted, sourceMapConsumer.file will be used, if it exists. - Otherwise an error will be thrown. - -* `sourceMapPath`: Optional. The dirname of the path to the SourceMap - to be applied. If relative, it is relative to the SourceMap. - - This parameter is needed when the two SourceMaps aren't in the same - directory, and the SourceMap to be applied contains relative source - paths. If so, those relative source paths need to be rewritten - relative to the SourceMap. - - If omitted, it is assumed that both SourceMaps are in the same directory, - thus not needing any rewriting. (Supplying `'.'` has the same effect.) - -#### SourceMapGenerator.prototype.toString() - -Renders the source map being generated to a string. - -```js -generator.toString() -// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' -``` - -### SourceNode - -SourceNodes provide a way to abstract over interpolating and/or concatenating -snippets of generated JavaScript source code, while maintaining the line and -column information associated between those snippets and the original source -code. This is useful as the final intermediate representation a compiler might -use before outputting the generated JS and source map. - -#### new SourceNode([line, column, source[, chunk[, name]]]) - -* `line`: The original line number associated with this source node, or null if - it isn't associated with an original line. The line number is 1-based. - -* `column`: The original column number associated with this source node, or null - if it isn't associated with an original column. The column number - is 0-based. - -* `source`: The original source's filename; null if no filename is provided. - -* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see - below. - -* `name`: Optional. The original identifier. - -```js -var node = new SourceNode(1, 2, "a.cpp", [ - new SourceNode(3, 4, "b.cpp", "extern int status;\n"), - new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), - new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), -]); -``` - -#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) - -Creates a SourceNode from generated code and a SourceMapConsumer. - -* `code`: The generated code - -* `sourceMapConsumer` The SourceMap for the generated code - -* `relativePath` The optional path that relative sources in `sourceMapConsumer` - should be relative to. - -```js -var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); -var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), - consumer); -``` - -#### SourceNode.prototype.add(chunk) - -Add a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -```js -node.add(" + "); -node.add(otherNode); -node.add([leftHandOperandNode, " + ", rightHandOperandNode]); -``` - -#### SourceNode.prototype.prepend(chunk) - -Prepend a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -```js -node.prepend("/** Build Id: f783haef86324gf **/\n\n"); -``` - -#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for a source file. This will be added to the -`SourceMap` in the `sourcesContent` field. - -* `sourceFile`: The filename of the source file - -* `sourceContent`: The content of the source file - -```js -node.setSourceContent("module-one.scm", - fs.readFileSync("path/to/module-one.scm")) -``` - -#### SourceNode.prototype.walk(fn) - -Walk over the tree of JS snippets in this node and its children. The walking -function is called once for each snippet of JS and is passed that snippet and -the its original associated source's line/column location. - -* `fn`: The traversal function. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.walk(function (code, loc) { console.log("WALK:", code, loc); }) -// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } -// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } -// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } -// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } -``` - -#### SourceNode.prototype.walkSourceContents(fn) - -Walk over the tree of SourceNodes. The walking function is called for each -source file content and is passed the filename and source content. - -* `fn`: The traversal function. - -```js -var a = new SourceNode(1, 2, "a.js", "generated from a"); -a.setSourceContent("a.js", "original a"); -var b = new SourceNode(1, 2, "b.js", "generated from b"); -b.setSourceContent("b.js", "original b"); -var c = new SourceNode(1, 2, "c.js", "generated from c"); -c.setSourceContent("c.js", "original c"); - -var node = new SourceNode(null, null, null, [a, b, c]); -node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) -// WALK: a.js : original a -// WALK: b.js : original b -// WALK: c.js : original c -``` - -#### SourceNode.prototype.join(sep) - -Like `Array.prototype.join` except for SourceNodes. Inserts the separator -between each of this source node's children. - -* `sep`: The separator. - -```js -var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); -var operand = new SourceNode(3, 4, "a.rs", "="); -var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); - -var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); -var joinedNode = node.join(" "); -``` - -#### SourceNode.prototype.replaceRight(pattern, replacement) - -Call `String.prototype.replace` on the very right-most source snippet. Useful -for trimming white space from the end of a source node, etc. - -* `pattern`: The pattern to replace. - -* `replacement`: The thing to replace the pattern with. - -```js -// Trim trailing white space. -node.replaceRight(/\s*$/, ""); -``` - -#### SourceNode.prototype.toString() - -Return the string representation of this source node. Walks over the tree and -concatenates all the various snippets together to one string. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.toString() -// 'unodostresquatro' -``` - -#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) - -Returns the string representation of this tree of source nodes, plus a -SourceMapGenerator which contains all the mappings between the generated and -original sources. - -The arguments are the same as those to `new SourceMapGenerator`. - -```js -var node = new SourceNode(1, 2, "a.js", [ - new SourceNode(3, 4, "b.js", "uno"), - "dos", - [ - "tres", - new SourceNode(5, 6, "c.js", "quatro") - ] -]); - -node.toStringWithSourceMap({ file: "my-output-file.js" }) -// { code: 'unodostresquatro', -// map: [object SourceMapGenerator] } -``` diff --git a/node_modules/source-map-js/lib/array-set.js b/node_modules/source-map-js/lib/array-set.js deleted file mode 100644 index fbd5c81ca..000000000 --- a/node_modules/source-map-js/lib/array-set.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); -var has = Object.prototype.hasOwnProperty; -var hasNativeMap = typeof Map !== "undefined"; - -/** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ -function ArraySet() { - this._array = []; - this._set = hasNativeMap ? new Map() : Object.create(null); -} - -/** - * Static method for creating ArraySet instances from an existing array. - */ -ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; -}; - -/** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ -ArraySet.prototype.size = function ArraySet_size() { - return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; -}; - -/** - * Add the given string to this set. - * - * @param String aStr - */ -ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util.toSetString(aStr); - var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - if (hasNativeMap) { - this._set.set(aStr, idx); - } else { - this._set[sStr] = idx; - } - } -}; - -/** - * Is the given string a member of this set? - * - * @param String aStr - */ -ArraySet.prototype.has = function ArraySet_has(aStr) { - if (hasNativeMap) { - return this._set.has(aStr); - } else { - var sStr = util.toSetString(aStr); - return has.call(this._set, sStr); - } -}; - -/** - * What is the index of the given string in the array? - * - * @param String aStr - */ -ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (hasNativeMap) { - var idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - } else { - var sStr = util.toSetString(aStr); - if (has.call(this._set, sStr)) { - return this._set[sStr]; - } - } - - throw new Error('"' + aStr + '" is not in the set.'); -}; - -/** - * What is the element at the given index? - * - * @param Number aIdx - */ -ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); -}; - -/** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ -ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); -}; - -exports.ArraySet = ArraySet; diff --git a/node_modules/source-map-js/lib/base64-vlq.js b/node_modules/source-map-js/lib/base64-vlq.js deleted file mode 100644 index 612b40401..000000000 --- a/node_modules/source-map-js/lib/base64-vlq.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -var base64 = require('./base64'); - -// A single base 64 digit can contain 6 bits of data. For the base 64 variable -// length quantities we use in the source map spec, the first bit is the sign, -// the next four bits are the actual value, and the 6th bit is the -// continuation bit. The continuation bit tells us whether there are more -// digits in this value following this digit. -// -// Continuation -// | Sign -// | | -// V V -// 101011 - -var VLQ_BASE_SHIFT = 5; - -// binary: 100000 -var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - -// binary: 011111 -var VLQ_BASE_MASK = VLQ_BASE - 1; - -// binary: 100000 -var VLQ_CONTINUATION_BIT = VLQ_BASE; - -/** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ -function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; -} - -/** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ -function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; -} - -/** - * Returns the base 64 VLQ encoded value. - */ -exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; -}; - -/** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ -exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; -}; diff --git a/node_modules/source-map-js/lib/base64.js b/node_modules/source-map-js/lib/base64.js deleted file mode 100644 index 8aa86b302..000000000 --- a/node_modules/source-map-js/lib/base64.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - -/** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ -exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); -}; - -/** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ -exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; -}; diff --git a/node_modules/source-map-js/lib/binary-search.js b/node_modules/source-map-js/lib/binary-search.js deleted file mode 100644 index 010ac941e..000000000 --- a/node_modules/source-map-js/lib/binary-search.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -exports.GREATEST_LOWER_BOUND = 1; -exports.LEAST_UPPER_BOUND = 2; - -/** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ -function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } -} - -/** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ -exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; -}; diff --git a/node_modules/source-map-js/lib/mapping-list.js b/node_modules/source-map-js/lib/mapping-list.js deleted file mode 100644 index 06d1274a0..000000000 --- a/node_modules/source-map-js/lib/mapping-list.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); - -/** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ -function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; -} - -/** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ -function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; -} - -/** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ -MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - -/** - * Add the given source mapping. - * - * @param Object aMapping - */ -MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } -}; - -/** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ -MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; -}; - -exports.MappingList = MappingList; diff --git a/node_modules/source-map-js/lib/quick-sort.js b/node_modules/source-map-js/lib/quick-sort.js deleted file mode 100644 index 23f9eda57..000000000 --- a/node_modules/source-map-js/lib/quick-sort.js +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -// It turns out that some (most?) JavaScript engines don't self-host -// `Array.prototype.sort`. This makes sense because C++ will likely remain -// faster than JS when doing raw CPU-intensive sorting. However, when using a -// custom comparator function, calling back and forth between the VM's C++ and -// JIT'd JS is rather slow *and* loses JIT type information, resulting in -// worse generated code for the comparator function than would be optimal. In -// fact, when sorting with a comparator, these costs outweigh the benefits of -// sorting in C++. By using our own JS-implemented Quick Sort (below), we get -// a ~3500ms mean speed-up in `bench/bench.html`. - -function SortTemplate(comparator) { - -/** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ -function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; -} - -/** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ -function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); -} - -/** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ -function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot, false) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } -} - - return doQuickSort; -} - -function cloneSort(comparator) { - let template = SortTemplate.toString(); - let templateFn = new Function(`return ${template}`)(); - return templateFn(comparator); -} - -/** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ - -let sortCache = new WeakMap(); -exports.quickSort = function (ary, comparator, start = 0) { - let doQuickSort = sortCache.get(comparator); - if (doQuickSort === void 0) { - doQuickSort = cloneSort(comparator); - sortCache.set(comparator, doQuickSort); - } - doQuickSort(ary, comparator, start, ary.length - 1); -}; diff --git a/node_modules/source-map-js/lib/source-map-consumer.js b/node_modules/source-map-js/lib/source-map-consumer.js deleted file mode 100644 index 4bd7a4a5d..000000000 --- a/node_modules/source-map-js/lib/source-map-consumer.js +++ /dev/null @@ -1,1184 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var util = require('./util'); -var binarySearch = require('./binary-search'); -var ArraySet = require('./array-set').ArraySet; -var base64VLQ = require('./base64-vlq'); -var quickSort = require('./quick-sort').quickSort; - -function SourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); -} - -SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); -} - -/** - * The version of the source mapping spec that we are consuming. - */ -SourceMapConsumer.prototype._version = 3; - -// `__generatedMappings` and `__originalMappings` are arrays that hold the -// parsed mapping coordinates from the source map's "mappings" attribute. They -// are lazily instantiated, accessed via the `_generatedMappings` and -// `_originalMappings` getters respectively, and we only parse the mappings -// and create these arrays once queried for a source location. We jump through -// these hoops because there can be many thousands of mappings, and parsing -// them is expensive, so we only want to do it if we must. -// -// Each object in the arrays is of the form: -// -// { -// generatedLine: The line number in the generated code, -// generatedColumn: The column number in the generated code, -// source: The path to the original source file that generated this -// chunk of code, -// originalLine: The line number in the original source that -// corresponds to this chunk of generated code, -// originalColumn: The column number in the original source that -// corresponds to this chunk of generated code, -// name: The name of the original symbol which generated this chunk of -// code. -// } -// -// All properties except for `generatedLine` and `generatedColumn` can be -// `null`. -// -// `_generatedMappings` is ordered by the generated positions. -// -// `_originalMappings` is ordered by the original positions. - -SourceMapConsumer.prototype.__generatedMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } -}); - -SourceMapConsumer.prototype.__originalMappings = null; -Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - configurable: true, - enumerable: true, - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } -}); - -SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - -SourceMapConsumer.GENERATED_ORDER = 1; -SourceMapConsumer.ORIGINAL_ORDER = 2; - -SourceMapConsumer.GREATEST_LOWER_BOUND = 1; -SourceMapConsumer.LEAST_UPPER_BOUND = 2; - -/** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ -SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - var boundCallback = aCallback.bind(context); - var names = this._names; - var sources = this._sources; - var sourceMapURL = this._sourceMapURL; - - for (var i = 0, n = mappings.length; i < n; i++) { - var mapping = mappings[i]; - var source = mapping.source === null ? null : sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, sourceMapURL); - boundCallback({ - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : names.at(mapping.name) - }); - } - }; - -/** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - -exports.SourceMapConsumer = SourceMapConsumer; - -/** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ -function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names.map(String), true); - this._sources = ArraySet.fromArray(sources, true); - - this._absoluteSources = this._sources.toArray().map(function (s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this._sourceMapURL = aSourceMapURL; - this.file = file; -} - -BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - -/** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ -BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - var i; - for (i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; -}; - -/** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ -BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - smc._sourceMapURL = aSourceMapURL; - smc._absoluteSources = smc._sources.toArray().map(function (s) { - return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); - }); - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - -/** - * The version of the source mapping spec that we are consuming. - */ -BasicSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._absoluteSources.slice(); - } -}); - -/** - * Provide the JIT with a nice shape / hidden class. - */ -function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; -} - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - -const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine; -function sortGenerated(array, start) { - let l = array.length; - let n = array.length - start; - if (n <= 1) { - return; - } else if (n == 2) { - let a = array[start]; - let b = array[start + 1]; - if (compareGenerated(a, b) > 0) { - array[start] = b; - array[start + 1] = a; - } - } else if (n < 20) { - for (let i = start; i < l; i++) { - for (let j = i; j > start; j--) { - let a = array[j - 1]; - let b = array[j]; - if (compareGenerated(a, b) <= 0) { - break; - } - array[j - 1] = b; - array[j] = a; - } - } - } else { - quickSort(array, compareGenerated, start); - } -} -BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - let subarrayStart = 0; - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - - sortGenerated(generatedMappings, subarrayStart); - subarrayStart = generatedMappings.length; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - let currentSource = mapping.source; - while (originalMappings.length <= currentSource) { - originalMappings.push(null); - } - if (originalMappings[currentSource] === null) { - originalMappings[currentSource] = []; - } - originalMappings[currentSource].push(mapping); - } - } - } - - sortGenerated(generatedMappings, subarrayStart); - this.__generatedMappings = generatedMappings; - - for (var i = 0; i < originalMappings.length; i++) { - if (originalMappings[i] != null) { - quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource); - } - } - this.__originalMappings = [].concat(...originalMappings); - }; - -/** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ -BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - -/** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ -BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ -BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - var index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - var relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - -exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - -/** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ -function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) - } - }); -} - -IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); -IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - -/** - * The version of the source mapping spec that we are consuming. - */ -IndexedSourceMapConsumer.prototype._version = 3; - -/** - * The list of original sources. - */ -Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } -}); - -/** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ -IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - -/** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ -IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - -/** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ -IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - -/** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ -IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - -/** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ -IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = null; - if (mapping.name) { - name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - -exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/node_modules/source-map-js/lib/source-map-generator.js b/node_modules/source-map-js/lib/source-map-generator.js deleted file mode 100644 index 508bcfbbc..000000000 --- a/node_modules/source-map-js/lib/source-map-generator.js +++ /dev/null @@ -1,425 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var base64VLQ = require('./base64-vlq'); -var util = require('./util'); -var ArraySet = require('./array-set').ArraySet; -var MappingList = require('./mapping-list').MappingList; - -/** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ -function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; -} - -SourceMapGenerator.prototype._version = 3; - -/** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ -SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } - - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } - - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - -/** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ -SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } - - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - -/** - * Set the source content for a source file. - */ -SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - -/** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ -SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - -/** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ -SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { - throw new Error( - 'original.line and original.column are not numbers -- you probably meant to omit ' + - 'the original mapping entirely and only map the generated position. If so, pass ' + - 'null for the original mapping instead of an object with empty or null values.' - ); - } - - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - -/** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ -SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var next; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = '' - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ','; - } - } - - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - - result += next; - } - - return result; - }; - -SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - }; - -/** - * Externalize the source map. - */ -SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - -/** - * Render the source map being generated to a string. - */ -SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - -exports.SourceMapGenerator = SourceMapGenerator; diff --git a/node_modules/source-map-js/lib/source-node.js b/node_modules/source-map-js/lib/source-node.js deleted file mode 100644 index 8bcdbe385..000000000 --- a/node_modules/source-map-js/lib/source-node.js +++ /dev/null @@ -1,413 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; -var util = require('./util'); - -// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other -// operating systems these days (capturing the result). -var REGEX_NEWLINE = /(\r?\n)/; - -// Newline character code for charCodeAt() comparisons -var NEWLINE_CODE = 10; - -// Private symbol for identifying `SourceNode`s when multiple versions of -// the source-map library are loaded. This MUST NOT CHANGE across -// versions! -var isSourceNode = "$$$isSourceNode$$$"; - -/** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ -function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); -} - -/** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ -SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var remainingLinesIndex = 0; - var shiftNextLine = function() { - var lineContents = getNextLine(); - // The last line of a file might not have a newline. - var newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[remainingLinesIndex] || ''; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[remainingLinesIndex] || ''; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - -/** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ -SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; -}; - -/** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } -}; - -/** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ -SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; -}; - -/** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ -SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; -}; - -/** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ -SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - -/** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ -SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - -/** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ -SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; -}; - -/** - * Returns the string representation of this source node along with a source - * map. - */ -SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; -}; - -exports.SourceNode = SourceNode; diff --git a/node_modules/source-map-js/lib/util.js b/node_modules/source-map-js/lib/util.js deleted file mode 100644 index 430e2d0ff..000000000 --- a/node_modules/source-map-js/lib/util.js +++ /dev/null @@ -1,594 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ -function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } -} -exports.getArg = getArg; - -var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; -var dataUrlRegexp = /^data:.+\,.+$/; - -function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; -} -exports.urlParse = urlParse; - -function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; -} -exports.urlGenerate = urlGenerate; - -var MAX_CACHED_INPUTS = 32; - -/** - * Takes some function `f(input) -> result` and returns a memoized version of - * `f`. - * - * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The - * memoization is a dumb-simple, linear least-recently-used cache. - */ -function lruMemoize(f) { - var cache = []; - - return function(input) { - for (var i = 0; i < cache.length; i++) { - if (cache[i].input === input) { - var temp = cache[0]; - cache[0] = cache[i]; - cache[i] = temp; - return cache[0].result; - } - } - - var result = f(input); - - cache.unshift({ - input, - result, - }); - - if (cache.length > MAX_CACHED_INPUTS) { - cache.pop(); - } - - return result; - }; -} - -/** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ -var normalize = lruMemoize(function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - // Split the path into parts between `/` characters. This is much faster than - // using `.split(/\/+/g)`. - var parts = []; - var start = 0; - var i = 0; - while (true) { - start = i; - i = path.indexOf("/", start); - if (i === -1) { - parts.push(path.slice(start)); - break; - } else { - parts.push(path.slice(start, i)); - while (i < path.length && path[i] === "/") { - i++; - } - } - } - - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; -}); -exports.normalize = normalize; - -/** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ -function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; -} -exports.join = join; - -exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || urlRegexp.test(aPath); -}; - -/** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ -function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); -} -exports.relative = relative; - -var supportsNullProto = (function () { - var obj = Object.create(null); - return !('__proto__' in obj); -}()); - -function identity (s) { - return s; -} - -/** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ -function toSetString(aStr) { - if (isProtoString(aStr)) { - return '$' + aStr; - } - - return aStr; -} -exports.toSetString = supportsNullProto ? identity : toSetString; - -function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; -} -exports.fromSetString = supportsNullProto ? identity : fromSetString; - -function isProtoString(s) { - if (!s) { - return false; - } - - var length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - - for (var i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; -} - -/** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ -function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByOriginalPositions = compareByOriginalPositions; - -function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) { - var cmp - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource; - -/** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ -function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - -function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine; - -function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; -} - -/** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ -function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - -/** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ -function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); -} -exports.parseSourceMapInput = parseSourceMapInput; - -/** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ -function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ''; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { - sourceRoot += '/'; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - var parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - var index = parsed.path.lastIndexOf('/'); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); -} -exports.computeSourceURL = computeSourceURL; diff --git a/node_modules/source-map-js/package.json b/node_modules/source-map-js/package.json deleted file mode 100644 index 501fafe16..000000000 --- a/node_modules/source-map-js/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "source-map-js", - "description": "Generates and consumes source maps", - "version": "1.0.2", - "homepage": "https://github.com/7rulnik/source-map-js", - "author": "Valentin 7rulnik Semirulnik ", - "contributors": [ - "Nick Fitzgerald ", - "Tobias Koppers ", - "Duncan Beevers ", - "Stephen Crane ", - "Ryan Seddon ", - "Miles Elam ", - "Mihai Bazon ", - "Michael Ficarra ", - "Todd Wolfson ", - "Alexander Solovyov ", - "Felix Gnass ", - "Conrad Irwin ", - "usrbincc ", - "David Glasser ", - "Chase Douglas ", - "Evan Wallace ", - "Heather Arthur ", - "Hugh Kennedy ", - "David Glasser ", - "Simon Lydell ", - "Jmeas Smith ", - "Michael Z Goddard ", - "azu ", - "John Gozde ", - "Adam Kirkton ", - "Chris Montgomery ", - "J. Ryan Stinnett ", - "Jack Herrington ", - "Chris Truter ", - "Daniel Espeset ", - "Jamie Wong ", - "Eddy Bruël ", - "Hawken Rives ", - "Gilad Peleg ", - "djchie ", - "Gary Ye ", - "Nicolas Lalevée " - ], - "repository": "7rulnik/source-map-js", - "main": "./source-map.js", - "files": [ - "source-map.js", - "source-map.d.ts", - "lib/" - ], - "engines": { - "node": ">=0.10.0" - }, - "license": "BSD-3-Clause", - "scripts": { - "test": "npm run build && node test/run-tests.js", - "build": "webpack --color", - "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" - }, - "devDependencies": { - "clean-publish": "^3.1.0", - "doctoc": "^0.15.0", - "webpack": "^1.12.0" - }, - "clean-publish": { - "cleanDocs": true - }, - "typings": "source-map.d.ts" -} diff --git a/node_modules/source-map-js/source-map.d.ts b/node_modules/source-map-js/source-map.d.ts deleted file mode 100644 index 9f8a4b383..000000000 --- a/node_modules/source-map-js/source-map.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -declare module 'source-map-js' { - export interface StartOfSourceMap { - file?: string; - sourceRoot?: string; - } - - export interface RawSourceMap extends StartOfSourceMap { - version: string; - sources: string[]; - names: string[]; - sourcesContent?: string[]; - mappings: string; - } - - export interface Position { - line: number; - column: number; - } - - export interface LineRange extends Position { - lastColumn: number; - } - - export interface FindPosition extends Position { - // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND - bias?: number; - } - - export interface SourceFindPosition extends FindPosition { - source: string; - } - - export interface MappedPosition extends Position { - source: string; - name?: string; - } - - export interface MappingItem { - source: string; - generatedLine: number; - generatedColumn: number; - originalLine: number; - originalColumn: number; - name: string; - } - - export class SourceMapConsumer { - static GENERATED_ORDER: number; - static ORIGINAL_ORDER: number; - - static GREATEST_LOWER_BOUND: number; - static LEAST_UPPER_BOUND: number; - - constructor(rawSourceMap: RawSourceMap); - computeColumnSpans(): void; - originalPositionFor(generatedPosition: FindPosition): MappedPosition; - generatedPositionFor(originalPosition: SourceFindPosition): LineRange; - allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; - hasContentsOfAllSources(): boolean; - sourceContentFor(source: string, returnNullOnMissing?: boolean): string; - eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; - } - - export interface Mapping { - generated: Position; - original: Position; - source: string; - name?: string; - } - - export class SourceMapGenerator { - constructor(startOfSourceMap?: StartOfSourceMap); - static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator; - addMapping(mapping: Mapping): void; - setSourceContent(sourceFile: string, sourceContent: string): void; - applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; - toString(): string; - } - - export interface CodeWithSourceMap { - code: string; - map: SourceMapGenerator; - } - - export class SourceNode { - constructor(); - constructor(line: number, column: number, source: string); - constructor(line: number, column: number, source: string, chunk?: string, name?: string); - static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; - add(chunk: string): void; - prepend(chunk: string): void; - setSourceContent(sourceFile: string, sourceContent: string): void; - walk(fn: (chunk: string, mapping: MappedPosition) => void): void; - walkSourceContents(fn: (file: string, content: string) => void): void; - join(sep: string): SourceNode; - replaceRight(pattern: string, replacement: string): SourceNode; - toString(): string; - toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; - } -} - -declare module 'source-map-js/lib/source-map-generator' { - import { SourceMapGenerator } from 'source-map-js' - export { SourceMapGenerator } -} - -declare module 'source-map-js/lib/source-map-consumer' { - import { SourceMapConsumer } from 'source-map-js' - export { SourceMapConsumer } -} - -declare module 'source-map-js/lib/source-node' { - import { SourceNode } from 'source-map-js' - export { SourceNode } -} diff --git a/node_modules/source-map-js/source-map.js b/node_modules/source-map-js/source-map.js deleted file mode 100644 index bc88fe820..000000000 --- a/node_modules/source-map-js/source-map.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; -exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; -exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/node_modules/spdx-correct/LICENSE b/node_modules/spdx-correct/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/node_modules/spdx-correct/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/node_modules/spdx-correct/README.md b/node_modules/spdx-correct/README.md deleted file mode 100644 index af563d865..000000000 --- a/node_modules/spdx-correct/README.md +++ /dev/null @@ -1,22 +0,0 @@ -## Usage - -```javascript -var correct = require('spdx-correct') -var assert = require('assert') - -assert.strictEqual(correct('mit'), 'MIT') - -assert.strictEqual(correct('Apache 2'), 'Apache-2.0') - -assert(correct('No idea what license') === null) - -// disable upgrade option -assert(correct('GPL-3.0'), 'GPL-3.0-or-later') -assert(correct('GPL-3.0', { upgrade: false }), 'GPL-3.0') -``` - -## Contributors - -spdx-correct has benefited from the work of several contributors. -See [the GitHub repository](https://github.com/jslicense/spdx-correct.js/graphs/contributors) -for more information. diff --git a/node_modules/spdx-correct/index.js b/node_modules/spdx-correct/index.js deleted file mode 100644 index 4d9037e0c..000000000 --- a/node_modules/spdx-correct/index.js +++ /dev/null @@ -1,386 +0,0 @@ -/* -Copyright spdx-correct.js contributors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -var parse = require('spdx-expression-parse') -var spdxLicenseIds = require('spdx-license-ids') - -function valid (string) { - try { - parse(string) - return true - } catch (error) { - return false - } -} - -// Sorting function that orders the given array of transpositions such -// that a transposition with the longer pattern comes before a transposition -// with a shorter pattern. This is to prevent e.g. the transposition -// ["General Public License", "GPL"] from matching to "Lesser General Public License" -// before a longer and more accurate transposition ["Lesser General Public License", "LGPL"] -// has a chance to be recognized. -function sortTranspositions(a, b) { - var length = b[0].length - a[0].length - if (length !== 0) return length - return a[0].toUpperCase().localeCompare(b[0].toUpperCase()) -} - -// Common transpositions of license identifier acronyms -var transpositions = [ - ['APGL', 'AGPL'], - ['Gpl', 'GPL'], - ['GLP', 'GPL'], - ['APL', 'Apache'], - ['ISD', 'ISC'], - ['GLP', 'GPL'], - ['IST', 'ISC'], - ['Claude', 'Clause'], - [' or later', '+'], - [' International', ''], - ['GNU', 'GPL'], - ['GUN', 'GPL'], - ['+', ''], - ['GNU GPL', 'GPL'], - ['GNU LGPL', 'LGPL'], - ['GNU/GPL', 'GPL'], - ['GNU GLP', 'GPL'], - ['GNU LESSER GENERAL PUBLIC LICENSE', 'LGPL'], - ['GNU Lesser General Public License', 'LGPL'], - ['GNU LESSER GENERAL PUBLIC LICENSE', 'LGPL-2.1'], - ['GNU Lesser General Public License', 'LGPL-2.1'], - ['LESSER GENERAL PUBLIC LICENSE', 'LGPL'], - ['Lesser General Public License', 'LGPL'], - ['LESSER GENERAL PUBLIC LICENSE', 'LGPL-2.1'], - ['Lesser General Public License', 'LGPL-2.1'], - ['GNU General Public License', 'GPL'], - ['Gnu public license', 'GPL'], - ['GNU Public License', 'GPL'], - ['GNU GENERAL PUBLIC LICENSE', 'GPL'], - ['MTI', 'MIT'], - ['Mozilla Public License', 'MPL'], - ['Universal Permissive License', 'UPL'], - ['WTH', 'WTF'], - ['WTFGPL', 'WTFPL'], - ['-License', ''] -].sort(sortTranspositions) - -var TRANSPOSED = 0 -var CORRECT = 1 - -// Simple corrections to nearly valid identifiers. -var transforms = [ - // e.g. 'mit' - function (argument) { - return argument.toUpperCase() - }, - // e.g. 'MIT ' - function (argument) { - return argument.trim() - }, - // e.g. 'M.I.T.' - function (argument) { - return argument.replace(/\./g, '') - }, - // e.g. 'Apache- 2.0' - function (argument) { - return argument.replace(/\s+/g, '') - }, - // e.g. 'CC BY 4.0'' - function (argument) { - return argument.replace(/\s+/g, '-') - }, - // e.g. 'LGPLv2.1' - function (argument) { - return argument.replace('v', '-') - }, - // e.g. 'Apache 2.0' - function (argument) { - return argument.replace(/,?\s*(\d)/, '-$1') - }, - // e.g. 'GPL 2' - function (argument) { - return argument.replace(/,?\s*(\d)/, '-$1.0') - }, - // e.g. 'Apache Version 2.0' - function (argument) { - return argument - .replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2') - }, - // e.g. 'Apache Version 2' - function (argument) { - return argument - .replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2.0') - }, - // e.g. 'ZLIB' - function (argument) { - return argument[0].toUpperCase() + argument.slice(1) - }, - // e.g. 'MPL/2.0' - function (argument) { - return argument.replace('/', '-') - }, - // e.g. 'Apache 2' - function (argument) { - return argument - .replace(/\s*V\s*(\d)/, '-$1') - .replace(/(\d)$/, '$1.0') - }, - // e.g. 'GPL-2.0', 'GPL-3.0' - function (argument) { - if (argument.indexOf('3.0') !== -1) { - return argument + '-or-later' - } else { - return argument + '-only' - } - }, - // e.g. 'GPL-2.0-' - function (argument) { - return argument + 'only' - }, - // e.g. 'GPL2' - function (argument) { - return argument.replace(/(\d)$/, '-$1.0') - }, - // e.g. 'BSD 3' - function (argument) { - return argument.replace(/(-| )?(\d)$/, '-$2-Clause') - }, - // e.g. 'BSD clause 3' - function (argument) { - return argument.replace(/(-| )clause(-| )(\d)/, '-$3-Clause') - }, - // e.g. 'New BSD license' - function (argument) { - return argument.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i, 'BSD-3-Clause') - }, - // e.g. 'Simplified BSD license' - function (argument) { - return argument.replace(/\bSimplified(-| )?BSD((-| )License)?/i, 'BSD-2-Clause') - }, - // e.g. 'Free BSD license' - function (argument) { - return argument.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i, 'BSD-2-Clause-$1BSD') - }, - // e.g. 'Clear BSD license' - function (argument) { - return argument.replace(/\bClear(-| )?BSD((-| )License)?/i, 'BSD-3-Clause-Clear') - }, - // e.g. 'Old BSD License' - function (argument) { - return argument.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i, 'BSD-4-Clause') - }, - // e.g. 'BY-NC-4.0' - function (argument) { - return 'CC-' + argument - }, - // e.g. 'BY-NC' - function (argument) { - return 'CC-' + argument + '-4.0' - }, - // e.g. 'Attribution-NonCommercial' - function (argument) { - return argument - .replace('Attribution', 'BY') - .replace('NonCommercial', 'NC') - .replace('NoDerivatives', 'ND') - .replace(/ (\d)/, '-$1') - .replace(/ ?International/, '') - }, - // e.g. 'Attribution-NonCommercial' - function (argument) { - return 'CC-' + - argument - .replace('Attribution', 'BY') - .replace('NonCommercial', 'NC') - .replace('NoDerivatives', 'ND') - .replace(/ (\d)/, '-$1') - .replace(/ ?International/, '') + - '-4.0' - } -] - -var licensesWithVersions = spdxLicenseIds - .map(function (id) { - var match = /^(.*)-\d+\.\d+$/.exec(id) - return match - ? [match[0], match[1]] - : [id, null] - }) - .reduce(function (objectMap, item) { - var key = item[1] - objectMap[key] = objectMap[key] || [] - objectMap[key].push(item[0]) - return objectMap - }, {}) - -var licensesWithOneVersion = Object.keys(licensesWithVersions) - .map(function makeEntries (key) { - return [key, licensesWithVersions[key]] - }) - .filter(function identifySoleVersions (item) { - return ( - // Licenses has just one valid version suffix. - item[1].length === 1 && - item[0] !== null && - // APL will be considered Apache, rather than APL-1.0 - item[0] !== 'APL' - ) - }) - .map(function createLastResorts (item) { - return [item[0], item[1][0]] - }) - -licensesWithVersions = undefined - -// If all else fails, guess that strings containing certain substrings -// meant to identify certain licenses. -var lastResorts = [ - ['UNLI', 'Unlicense'], - ['WTF', 'WTFPL'], - ['2 CLAUSE', 'BSD-2-Clause'], - ['2-CLAUSE', 'BSD-2-Clause'], - ['3 CLAUSE', 'BSD-3-Clause'], - ['3-CLAUSE', 'BSD-3-Clause'], - ['AFFERO', 'AGPL-3.0-or-later'], - ['AGPL', 'AGPL-3.0-or-later'], - ['APACHE', 'Apache-2.0'], - ['ARTISTIC', 'Artistic-2.0'], - ['Affero', 'AGPL-3.0-or-later'], - ['BEER', 'Beerware'], - ['BOOST', 'BSL-1.0'], - ['BSD', 'BSD-2-Clause'], - ['CDDL', 'CDDL-1.1'], - ['ECLIPSE', 'EPL-1.0'], - ['FUCK', 'WTFPL'], - ['GNU', 'GPL-3.0-or-later'], - ['LGPL', 'LGPL-3.0-or-later'], - ['GPLV1', 'GPL-1.0-only'], - ['GPL-1', 'GPL-1.0-only'], - ['GPLV2', 'GPL-2.0-only'], - ['GPL-2', 'GPL-2.0-only'], - ['GPL', 'GPL-3.0-or-later'], - ['MIT +NO-FALSE-ATTRIBS', 'MITNFA'], - ['MIT', 'MIT'], - ['MPL', 'MPL-2.0'], - ['X11', 'X11'], - ['ZLIB', 'Zlib'] -].concat(licensesWithOneVersion).sort(sortTranspositions) - -var SUBSTRING = 0 -var IDENTIFIER = 1 - -var validTransformation = function (identifier) { - for (var i = 0; i < transforms.length; i++) { - var transformed = transforms[i](identifier).trim() - if (transformed !== identifier && valid(transformed)) { - return transformed - } - } - return null -} - -var validLastResort = function (identifier) { - var upperCased = identifier.toUpperCase() - for (var i = 0; i < lastResorts.length; i++) { - var lastResort = lastResorts[i] - if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) { - return lastResort[IDENTIFIER] - } - } - return null -} - -var anyCorrection = function (identifier, check) { - for (var i = 0; i < transpositions.length; i++) { - var transposition = transpositions[i] - var transposed = transposition[TRANSPOSED] - if (identifier.indexOf(transposed) > -1) { - var corrected = identifier.replace( - transposed, - transposition[CORRECT] - ) - var checked = check(corrected) - if (checked !== null) { - return checked - } - } - } - return null -} - -module.exports = function (identifier, options) { - options = options || {} - var upgrade = options.upgrade === undefined ? true : !!options.upgrade - function postprocess (value) { - return upgrade ? upgradeGPLs(value) : value - } - var validArugment = ( - typeof identifier === 'string' && - identifier.trim().length !== 0 - ) - if (!validArugment) { - throw Error('Invalid argument. Expected non-empty string.') - } - identifier = identifier.trim() - if (valid(identifier)) { - return postprocess(identifier) - } - var noPlus = identifier.replace(/\+$/, '').trim() - if (valid(noPlus)) { - return postprocess(noPlus) - } - var transformed = validTransformation(identifier) - if (transformed !== null) { - return postprocess(transformed) - } - transformed = anyCorrection(identifier, function (argument) { - if (valid(argument)) { - return argument - } - return validTransformation(argument) - }) - if (transformed !== null) { - return postprocess(transformed) - } - transformed = validLastResort(identifier) - if (transformed !== null) { - return postprocess(transformed) - } - transformed = anyCorrection(identifier, validLastResort) - if (transformed !== null) { - return postprocess(transformed) - } - return null -} - -function upgradeGPLs (value) { - if ([ - 'GPL-1.0', 'LGPL-1.0', 'AGPL-1.0', - 'GPL-2.0', 'LGPL-2.0', 'AGPL-2.0', - 'LGPL-2.1' - ].indexOf(value) !== -1) { - return value + '-only' - } else if ([ - 'GPL-1.0+', 'GPL-2.0+', 'GPL-3.0+', - 'LGPL-2.0+', 'LGPL-2.1+', 'LGPL-3.0+', - 'AGPL-1.0+', 'AGPL-3.0+' - ].indexOf(value) !== -1) { - return value.replace(/\+$/, '-or-later') - } else if (['GPL-3.0', 'LGPL-3.0', 'AGPL-3.0'].indexOf(value) !== -1) { - return value + '-or-later' - } else { - return value - } -} diff --git a/node_modules/spdx-correct/package.json b/node_modules/spdx-correct/package.json deleted file mode 100644 index d77615638..000000000 --- a/node_modules/spdx-correct/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "spdx-correct", - "description": "correct invalid SPDX expressions", - "version": "3.2.0", - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - }, - "devDependencies": { - "defence-cli": "^3.0.1", - "replace-require-self": "^1.0.0", - "standard": "^14.3.4", - "standard-markdown": "^6.0.0", - "tape": "^5.0.1" - }, - "files": [ - "index.js" - ], - "keywords": [ - "SPDX", - "law", - "legal", - "license", - "metadata" - ], - "license": "Apache-2.0", - "repository": "jslicense/spdx-correct.js", - "scripts": { - "lint": "standard && standard-markdown README.md", - "test": "defence README.md | replace-require-self | node && node test.js" - } -} diff --git a/node_modules/spdx-exceptions/README.md b/node_modules/spdx-exceptions/README.md deleted file mode 100644 index 6c927ecc6..000000000 --- a/node_modules/spdx-exceptions/README.md +++ /dev/null @@ -1,36 +0,0 @@ -The package exports an array of strings. Each string is an identifier -for a license exception under the [Software Package Data Exchange -(SPDX)][SPDX] software license metadata standard. - -[SPDX]: https://spdx.org - -## Copyright and Licensing - -### SPDX - -"SPDX" is a federally registered United States trademark of The Linux -Foundation Corporation. - -From version 2.0 of the [SPDX] specification: - -> Copyright © 2010-2015 Linux Foundation and its Contributors. Licensed -> under the Creative Commons Attribution License 3.0 Unported. All other -> rights are expressly reserved. - -The Linux Foundation and the SPDX working groups are good people. Only -they decide what "SPDX" means, as a standard and otherwise. I respect -their work and their rights. You should, too. - -### This Package - -> I created this package by copying exception identifiers out of the -> SPDX specification. That work was mechanical, routine, and required no -> creativity whatsoever. - Kyle Mitchell, package author - -United States users concerned about intellectual property may wish to -discuss the following Supreme Court decisions with their attorneys: - -- _Baker v. Selden_, 101 U.S. 99 (1879) - -- _Feist Publications, Inc., v. Rural Telephone Service Co._, - 499 U.S. 340 (1991) diff --git a/node_modules/spdx-exceptions/index.json b/node_modules/spdx-exceptions/index.json deleted file mode 100644 index f88f088ab..000000000 --- a/node_modules/spdx-exceptions/index.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - "389-exception", - "Autoconf-exception-2.0", - "Autoconf-exception-3.0", - "Bison-exception-2.2", - "Bootloader-exception", - "Classpath-exception-2.0", - "CLISP-exception-2.0", - "DigiRule-FOSS-exception", - "eCos-exception-2.0", - "Fawkes-Runtime-exception", - "FLTK-exception", - "Font-exception-2.0", - "freertos-exception-2.0", - "GCC-exception-2.0", - "GCC-exception-3.1", - "gnu-javamail-exception", - "GPL-3.0-linking-exception", - "GPL-3.0-linking-source-exception", - "GPL-CC-1.0", - "i2p-gpl-java-exception", - "Libtool-exception", - "Linux-syscall-note", - "LLVM-exception", - "LZMA-exception", - "mif-exception", - "Nokia-Qt-exception-1.1", - "OCaml-LGPL-linking-exception", - "OCCT-exception-1.0", - "OpenJDK-assembly-exception-1.0", - "openvpn-openssl-exception", - "PS-or-PDF-font-exception-20170817", - "Qt-GPL-exception-1.0", - "Qt-LGPL-exception-1.1", - "Qwt-exception-1.0", - "Swift-exception", - "u-boot-exception-2.0", - "Universal-FOSS-exception-1.0", - "WxWindows-exception-3.1" -] diff --git a/node_modules/spdx-exceptions/package.json b/node_modules/spdx-exceptions/package.json deleted file mode 100644 index 2bafc6a38..000000000 --- a/node_modules/spdx-exceptions/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "spdx-exceptions", - "description": "list of SPDX standard license exceptions", - "version": "2.3.0", - "author": "The Linux Foundation", - "contributors": [ - "Kyle E. Mitchell (https://kemitchell.com/)" - ], - "license": "CC-BY-3.0", - "repository": "kemitchell/spdx-exceptions.json", - "files": [ - "index.json" - ], - "scripts": { - "build": "node build.js" - } -} diff --git a/node_modules/spdx-expression-parse/AUTHORS b/node_modules/spdx-expression-parse/AUTHORS deleted file mode 100644 index 257a76b94..000000000 --- a/node_modules/spdx-expression-parse/AUTHORS +++ /dev/null @@ -1,4 +0,0 @@ -C. Scott Ananian (http://cscott.net) -Kyle E. Mitchell (https://kemitchell.com) -Shinnosuke Watanabe -Antoine Motet diff --git a/node_modules/spdx-expression-parse/LICENSE b/node_modules/spdx-expression-parse/LICENSE deleted file mode 100644 index 831618eab..000000000 --- a/node_modules/spdx-expression-parse/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License - -Copyright (c) 2015 Kyle E. Mitchell & other authors listed in AUTHORS - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/spdx-expression-parse/README.md b/node_modules/spdx-expression-parse/README.md deleted file mode 100644 index 9406462e3..000000000 --- a/node_modules/spdx-expression-parse/README.md +++ /dev/null @@ -1,91 +0,0 @@ -This package parses [SPDX license expression](https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60) strings describing license terms, like [package.json license strings](https://docs.npmjs.com/files/package.json#license), into consistently structured ECMAScript objects. The npm command-line interface depends on this package, as do many automatic license-audit tools. - -In a nutshell: - -```javascript -var parse = require('spdx-expression-parse') -var assert = require('assert') - -assert.deepEqual( - // Licensed under the terms of the Two-Clause BSD License. - parse('BSD-2-Clause'), - {license: 'BSD-2-Clause'} -) - -assert.throws(function () { - // An invalid SPDX license expression. - // Should be `Apache-2.0`. - parse('Apache 2') -}) - -assert.deepEqual( - // Dual licensed under either: - // - LGPL 2.1 - // - a combination of Three-Clause BSD and MIT - parse('(LGPL-2.1 OR BSD-3-Clause AND MIT)'), - { - left: {license: 'LGPL-2.1'}, - conjunction: 'or', - right: { - left: {license: 'BSD-3-Clause'}, - conjunction: 'and', - right: {license: 'MIT'} - } - } -) -``` - -The syntax comes from the [Software Package Data eXchange (SPDX)](https://spdx.org/), a standard from the [Linux Foundation](https://www.linuxfoundation.org) for shareable data about software package license terms. SPDX aims to make sharing and auditing license data easy, especially for users of open-source software. - -The bulk of the SPDX standard describes syntax and semantics of XML metadata files. This package implements two lightweight, plain-text components of that larger standard: - -1. The [license list](https://spdx.org/licenses), a mapping from specific string identifiers, like `Apache-2.0`, to standard form license texts and bolt-on license exceptions. The [spdx-license-ids](https://www.npmjs.com/package/spdx-license-ids) and [spdx-exceptions](https://www.npmjs.com/package/spdx-exceptions) packages implement the license list. `spdx-expression-parse` depends on and `require()`s them. - - Any license identifier from the license list is a valid license expression: - - ```javascript - var identifiers = [] - .concat(require('spdx-license-ids')) - .concat(require('spdx-license-ids/deprecated')) - - identifiers.forEach(function (id) { - assert.deepEqual(parse(id), {license: id}) - }) - ``` - - So is any license identifier `WITH` a standardized license exception: - - ```javascript - identifiers.forEach(function (id) { - require('spdx-exceptions').forEach(function (e) { - assert.deepEqual( - parse(id + ' WITH ' + e), - {license: id, exception: e} - ) - }) - }) - ``` - -2. The license expression language, for describing simple and complex license terms, like `MIT` for MIT-licensed and `(GPL-2.0 OR Apache-2.0)` for dual-licensing under GPL 2.0 and Apache 2.0. `spdx-expression-parse` itself implements license expression language, exporting a parser. - - ```javascript - assert.deepEqual( - // Licensed under a combination of: - // - the MIT License AND - // - a combination of: - // - LGPL 2.1 (or a later version) AND - // - Three-Clause BSD - parse('(MIT AND (LGPL-2.1+ AND BSD-3-Clause))'), - { - left: {license: 'MIT'}, - conjunction: 'and', - right: { - left: {license: 'LGPL-2.1', plus: true}, - conjunction: 'and', - right: {license: 'BSD-3-Clause'} - } - } - ) - ``` - -The Linux Foundation and its contributors license the SPDX standard under the terms of [the Creative Commons Attribution License 3.0 Unported (SPDX: "CC-BY-3.0")](http://spdx.org/licenses/CC-BY-3.0). "SPDX" is a United States federally registered trademark of the Linux Foundation. The authors of this package license their work under the terms of the MIT License. diff --git a/node_modules/spdx-expression-parse/index.js b/node_modules/spdx-expression-parse/index.js deleted file mode 100644 index 52fab560a..000000000 --- a/node_modules/spdx-expression-parse/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' - -var scan = require('./scan') -var parse = require('./parse') - -module.exports = function (source) { - return parse(scan(source)) -} diff --git a/node_modules/spdx-expression-parse/package.json b/node_modules/spdx-expression-parse/package.json deleted file mode 100644 index c9edc9f93..000000000 --- a/node_modules/spdx-expression-parse/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "spdx-expression-parse", - "description": "parse SPDX license expressions", - "version": "3.0.1", - "author": "Kyle E. Mitchell (https://kemitchell.com)", - "files": [ - "AUTHORS", - "index.js", - "parse.js", - "scan.js" - ], - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - }, - "devDependencies": { - "defence-cli": "^3.0.1", - "replace-require-self": "^1.0.0", - "standard": "^14.1.0" - }, - "keywords": [ - "SPDX", - "law", - "legal", - "license", - "metadata", - "package", - "package.json", - "standards" - ], - "license": "MIT", - "repository": "jslicense/spdx-expression-parse.js", - "scripts": { - "lint": "standard", - "test:readme": "defence -i javascript README.md | replace-require-self | node", - "test:suite": "node test.js", - "test": "npm run test:suite && npm run test:readme" - } -} diff --git a/node_modules/spdx-expression-parse/parse.js b/node_modules/spdx-expression-parse/parse.js deleted file mode 100644 index 5a00b45c5..000000000 --- a/node_modules/spdx-expression-parse/parse.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict' - -// The ABNF grammar in the spec is totally ambiguous. -// -// This parser follows the operator precedence defined in the -// `Order of Precedence and Parentheses` section. - -module.exports = function (tokens) { - var index = 0 - - function hasMore () { - return index < tokens.length - } - - function token () { - return hasMore() ? tokens[index] : null - } - - function next () { - if (!hasMore()) { - throw new Error() - } - index++ - } - - function parseOperator (operator) { - var t = token() - if (t && t.type === 'OPERATOR' && operator === t.string) { - next() - return t.string - } - } - - function parseWith () { - if (parseOperator('WITH')) { - var t = token() - if (t && t.type === 'EXCEPTION') { - next() - return t.string - } - throw new Error('Expected exception after `WITH`') - } - } - - function parseLicenseRef () { - // TODO: Actually, everything is concatenated into one string - // for backward-compatibility but it could be better to return - // a nice structure. - var begin = index - var string = '' - var t = token() - if (t.type === 'DOCUMENTREF') { - next() - string += 'DocumentRef-' + t.string + ':' - if (!parseOperator(':')) { - throw new Error('Expected `:` after `DocumentRef-...`') - } - } - t = token() - if (t.type === 'LICENSEREF') { - next() - string += 'LicenseRef-' + t.string - return { license: string } - } - index = begin - } - - function parseLicense () { - var t = token() - if (t && t.type === 'LICENSE') { - next() - var node = { license: t.string } - if (parseOperator('+')) { - node.plus = true - } - var exception = parseWith() - if (exception) { - node.exception = exception - } - return node - } - } - - function parseParenthesizedExpression () { - var left = parseOperator('(') - if (!left) { - return - } - - var expr = parseExpression() - - if (!parseOperator(')')) { - throw new Error('Expected `)`') - } - - return expr - } - - function parseAtom () { - return ( - parseParenthesizedExpression() || - parseLicenseRef() || - parseLicense() - ) - } - - function makeBinaryOpParser (operator, nextParser) { - return function parseBinaryOp () { - var left = nextParser() - if (!left) { - return - } - - if (!parseOperator(operator)) { - return left - } - - var right = parseBinaryOp() - if (!right) { - throw new Error('Expected expression') - } - return { - left: left, - conjunction: operator.toLowerCase(), - right: right - } - } - } - - var parseAnd = makeBinaryOpParser('AND', parseAtom) - var parseExpression = makeBinaryOpParser('OR', parseAnd) - - var node = parseExpression() - if (!node || hasMore()) { - throw new Error('Syntax error') - } - return node -} diff --git a/node_modules/spdx-expression-parse/scan.js b/node_modules/spdx-expression-parse/scan.js deleted file mode 100644 index b74fce2e2..000000000 --- a/node_modules/spdx-expression-parse/scan.js +++ /dev/null @@ -1,131 +0,0 @@ -'use strict' - -var licenses = [] - .concat(require('spdx-license-ids')) - .concat(require('spdx-license-ids/deprecated')) -var exceptions = require('spdx-exceptions') - -module.exports = function (source) { - var index = 0 - - function hasMore () { - return index < source.length - } - - // `value` can be a regexp or a string. - // If it is recognized, the matching source string is returned and - // the index is incremented. Otherwise `undefined` is returned. - function read (value) { - if (value instanceof RegExp) { - var chars = source.slice(index) - var match = chars.match(value) - if (match) { - index += match[0].length - return match[0] - } - } else { - if (source.indexOf(value, index) === index) { - index += value.length - return value - } - } - } - - function skipWhitespace () { - read(/[ ]*/) - } - - function operator () { - var string - var possibilities = ['WITH', 'AND', 'OR', '(', ')', ':', '+'] - for (var i = 0; i < possibilities.length; i++) { - string = read(possibilities[i]) - if (string) { - break - } - } - - if (string === '+' && index > 1 && source[index - 2] === ' ') { - throw new Error('Space before `+`') - } - - return string && { - type: 'OPERATOR', - string: string - } - } - - function idstring () { - return read(/[A-Za-z0-9-.]+/) - } - - function expectIdstring () { - var string = idstring() - if (!string) { - throw new Error('Expected idstring at offset ' + index) - } - return string - } - - function documentRef () { - if (read('DocumentRef-')) { - var string = expectIdstring() - return { type: 'DOCUMENTREF', string: string } - } - } - - function licenseRef () { - if (read('LicenseRef-')) { - var string = expectIdstring() - return { type: 'LICENSEREF', string: string } - } - } - - function identifier () { - var begin = index - var string = idstring() - - if (licenses.indexOf(string) !== -1) { - return { - type: 'LICENSE', - string: string - } - } else if (exceptions.indexOf(string) !== -1) { - return { - type: 'EXCEPTION', - string: string - } - } - - index = begin - } - - // Tries to read the next token. Returns `undefined` if no token is - // recognized. - function parseToken () { - // Ordering matters - return ( - operator() || - documentRef() || - licenseRef() || - identifier() - ) - } - - var tokens = [] - while (hasMore()) { - skipWhitespace() - if (!hasMore()) { - break - } - - var token = parseToken() - if (!token) { - throw new Error('Unexpected `' + source[index] + - '` at offset ' + index) - } - - tokens.push(token) - } - return tokens -} diff --git a/node_modules/spdx-license-ids/README.md b/node_modules/spdx-license-ids/README.md deleted file mode 100644 index 500e32dff..000000000 --- a/node_modules/spdx-license-ids/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# spdx-license-ids - -[![npm version](https://img.shields.io/npm/v/spdx-license-ids.svg)](https://www.npmjs.com/package/spdx-license-ids) -[![Github Actions](https://action-badges.now.sh/jslicense/spdx-license-ids)](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/jslicense/spdx-license-ids) - -A list of [SPDX license](https://spdx.org/licenses/) identifiers - -## Installation - -[Download JSON directly](https://raw.githubusercontent.com/jslicense/spdx-license-ids/main/index.json), or [use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/): - -``` -npm install spdx-license-ids -``` - -## [Node.js](https://nodejs.org/) API - -### require('spdx-license-ids') - -Type: `string[]` - -All license IDs except for the currently deprecated ones. - -```javascript -const ids = require('spdx-license-ids'); -//=> ['0BSD', 'AAL', 'ADSL', 'AFL-1.1', 'AFL-1.2', 'AFL-2.0', 'AFL-2.1', 'AFL-3.0', 'AGPL-1.0-only', ...] - -ids.includes('BSD-3-Clause'); //=> true -ids.includes('CC-BY-1.0'); //=> true - -ids.includes('GPL-3.0'); //=> false -``` - -### require('spdx-license-ids/deprecated') - -Type: `string[]` - -Deprecated license IDs. - -```javascript -const deprecatedIds = require('spdx-license-ids/deprecated'); -//=> ['AGPL-1.0', 'AGPL-3.0', 'GFDL-1.1', 'GFDL-1.2', 'GFDL-1.3', 'GPL-1.0', 'GPL-2.0', ...] - -deprecatedIds.includes('BSD-3-Clause'); //=> false -deprecatedIds.includes('CC-BY-1.0'); //=> false - -deprecatedIds.includes('GPL-3.0'); //=> true -``` - -## License - -[Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/deed) diff --git a/node_modules/spdx-license-ids/deprecated.json b/node_modules/spdx-license-ids/deprecated.json deleted file mode 100644 index 278531e40..000000000 --- a/node_modules/spdx-license-ids/deprecated.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - "AGPL-1.0", - "AGPL-3.0", - "BSD-2-Clause-FreeBSD", - "BSD-2-Clause-NetBSD", - "GFDL-1.1", - "GFDL-1.2", - "GFDL-1.3", - "GPL-1.0", - "GPL-2.0", - "GPL-2.0-with-GCC-exception", - "GPL-2.0-with-autoconf-exception", - "GPL-2.0-with-bison-exception", - "GPL-2.0-with-classpath-exception", - "GPL-2.0-with-font-exception", - "GPL-3.0", - "GPL-3.0-with-GCC-exception", - "GPL-3.0-with-autoconf-exception", - "LGPL-2.0", - "LGPL-2.1", - "LGPL-3.0", - "Nunit", - "StandardML-NJ", - "bzip2-1.0.5", - "eCos-2.0", - "wxWindows" -] diff --git a/node_modules/spdx-license-ids/index.json b/node_modules/spdx-license-ids/index.json deleted file mode 100644 index 04c03126d..000000000 --- a/node_modules/spdx-license-ids/index.json +++ /dev/null @@ -1,507 +0,0 @@ -[ - "0BSD", - "AAL", - "ADSL", - "AFL-1.1", - "AFL-1.2", - "AFL-2.0", - "AFL-2.1", - "AFL-3.0", - "AGPL-1.0-only", - "AGPL-1.0-or-later", - "AGPL-3.0-only", - "AGPL-3.0-or-later", - "AMDPLPA", - "AML", - "AMPAS", - "ANTLR-PD", - "ANTLR-PD-fallback", - "APAFML", - "APL-1.0", - "APSL-1.0", - "APSL-1.1", - "APSL-1.2", - "APSL-2.0", - "Abstyles", - "AdaCore-doc", - "Adobe-2006", - "Adobe-Glyph", - "Afmparse", - "Aladdin", - "Apache-1.0", - "Apache-1.1", - "Apache-2.0", - "App-s2p", - "Arphic-1999", - "Artistic-1.0", - "Artistic-1.0-Perl", - "Artistic-1.0-cl8", - "Artistic-2.0", - "BSD-1-Clause", - "BSD-2-Clause", - "BSD-2-Clause-Patent", - "BSD-2-Clause-Views", - "BSD-3-Clause", - "BSD-3-Clause-Attribution", - "BSD-3-Clause-Clear", - "BSD-3-Clause-LBNL", - "BSD-3-Clause-Modification", - "BSD-3-Clause-No-Military-License", - "BSD-3-Clause-No-Nuclear-License", - "BSD-3-Clause-No-Nuclear-License-2014", - "BSD-3-Clause-No-Nuclear-Warranty", - "BSD-3-Clause-Open-MPI", - "BSD-4-Clause", - "BSD-4-Clause-Shortened", - "BSD-4-Clause-UC", - "BSD-4.3RENO", - "BSD-4.3TAHOE", - "BSD-Advertising-Acknowledgement", - "BSD-Attribution-HPND-disclaimer", - "BSD-Protection", - "BSD-Source-Code", - "BSL-1.0", - "BUSL-1.1", - "Baekmuk", - "Bahyph", - "Barr", - "Beerware", - "BitTorrent-1.0", - "BitTorrent-1.1", - "Bitstream-Charter", - "Bitstream-Vera", - "BlueOak-1.0.0", - "Borceux", - "Brian-Gladman-3-Clause", - "C-UDA-1.0", - "CAL-1.0", - "CAL-1.0-Combined-Work-Exception", - "CATOSL-1.1", - "CC-BY-1.0", - "CC-BY-2.0", - "CC-BY-2.5", - "CC-BY-2.5-AU", - "CC-BY-3.0", - "CC-BY-3.0-AT", - "CC-BY-3.0-DE", - "CC-BY-3.0-IGO", - "CC-BY-3.0-NL", - "CC-BY-3.0-US", - "CC-BY-4.0", - "CC-BY-NC-1.0", - "CC-BY-NC-2.0", - "CC-BY-NC-2.5", - "CC-BY-NC-3.0", - "CC-BY-NC-3.0-DE", - "CC-BY-NC-4.0", - "CC-BY-NC-ND-1.0", - "CC-BY-NC-ND-2.0", - "CC-BY-NC-ND-2.5", - "CC-BY-NC-ND-3.0", - "CC-BY-NC-ND-3.0-DE", - "CC-BY-NC-ND-3.0-IGO", - "CC-BY-NC-ND-4.0", - "CC-BY-NC-SA-1.0", - "CC-BY-NC-SA-2.0", - "CC-BY-NC-SA-2.0-DE", - "CC-BY-NC-SA-2.0-FR", - "CC-BY-NC-SA-2.0-UK", - "CC-BY-NC-SA-2.5", - "CC-BY-NC-SA-3.0", - "CC-BY-NC-SA-3.0-DE", - "CC-BY-NC-SA-3.0-IGO", - "CC-BY-NC-SA-4.0", - "CC-BY-ND-1.0", - "CC-BY-ND-2.0", - "CC-BY-ND-2.5", - "CC-BY-ND-3.0", - "CC-BY-ND-3.0-DE", - "CC-BY-ND-4.0", - "CC-BY-SA-1.0", - "CC-BY-SA-2.0", - "CC-BY-SA-2.0-UK", - "CC-BY-SA-2.1-JP", - "CC-BY-SA-2.5", - "CC-BY-SA-3.0", - "CC-BY-SA-3.0-AT", - "CC-BY-SA-3.0-DE", - "CC-BY-SA-4.0", - "CC-PDDC", - "CC0-1.0", - "CDDL-1.0", - "CDDL-1.1", - "CDL-1.0", - "CDLA-Permissive-1.0", - "CDLA-Permissive-2.0", - "CDLA-Sharing-1.0", - "CECILL-1.0", - "CECILL-1.1", - "CECILL-2.0", - "CECILL-2.1", - "CECILL-B", - "CECILL-C", - "CERN-OHL-1.1", - "CERN-OHL-1.2", - "CERN-OHL-P-2.0", - "CERN-OHL-S-2.0", - "CERN-OHL-W-2.0", - "CFITSIO", - "CMU-Mach", - "CNRI-Jython", - "CNRI-Python", - "CNRI-Python-GPL-Compatible", - "COIL-1.0", - "CPAL-1.0", - "CPL-1.0", - "CPOL-1.02", - "CUA-OPL-1.0", - "Caldera", - "ClArtistic", - "Clips", - "Community-Spec-1.0", - "Condor-1.1", - "Cornell-Lossless-JPEG", - "Crossword", - "CrystalStacker", - "Cube", - "D-FSL-1.0", - "DL-DE-BY-2.0", - "DOC", - "DRL-1.0", - "DSDP", - "Dotseqn", - "ECL-1.0", - "ECL-2.0", - "EFL-1.0", - "EFL-2.0", - "EPICS", - "EPL-1.0", - "EPL-2.0", - "EUDatagrid", - "EUPL-1.0", - "EUPL-1.1", - "EUPL-1.2", - "Elastic-2.0", - "Entessa", - "ErlPL-1.1", - "Eurosym", - "FDK-AAC", - "FSFAP", - "FSFUL", - "FSFULLR", - "FSFULLRWD", - "FTL", - "Fair", - "Frameworx-1.0", - "FreeBSD-DOC", - "FreeImage", - "GD", - "GFDL-1.1-invariants-only", - "GFDL-1.1-invariants-or-later", - "GFDL-1.1-no-invariants-only", - "GFDL-1.1-no-invariants-or-later", - "GFDL-1.1-only", - "GFDL-1.1-or-later", - "GFDL-1.2-invariants-only", - "GFDL-1.2-invariants-or-later", - "GFDL-1.2-no-invariants-only", - "GFDL-1.2-no-invariants-or-later", - "GFDL-1.2-only", - "GFDL-1.2-or-later", - "GFDL-1.3-invariants-only", - "GFDL-1.3-invariants-or-later", - "GFDL-1.3-no-invariants-only", - "GFDL-1.3-no-invariants-or-later", - "GFDL-1.3-only", - "GFDL-1.3-or-later", - "GL2PS", - "GLWTPL", - "GPL-1.0-only", - "GPL-1.0-or-later", - "GPL-2.0-only", - "GPL-2.0-or-later", - "GPL-3.0-only", - "GPL-3.0-or-later", - "Giftware", - "Glide", - "Glulxe", - "Graphics-Gems", - "HP-1986", - "HPND", - "HPND-Markus-Kuhn", - "HPND-export-US", - "HPND-sell-variant", - "HPND-sell-variant-MIT-disclaimer", - "HTMLTIDY", - "HaskellReport", - "Hippocratic-2.1", - "IBM-pibs", - "ICU", - "IEC-Code-Components-EULA", - "IJG", - "IJG-short", - "IPA", - "IPL-1.0", - "ISC", - "ImageMagick", - "Imlib2", - "Info-ZIP", - "Intel", - "Intel-ACPI", - "Interbase-1.0", - "JPL-image", - "JPNIC", - "JSON", - "Jam", - "JasPer-2.0", - "Kazlib", - "Knuth-CTAN", - "LAL-1.2", - "LAL-1.3", - "LGPL-2.0-only", - "LGPL-2.0-or-later", - "LGPL-2.1-only", - "LGPL-2.1-or-later", - "LGPL-3.0-only", - "LGPL-3.0-or-later", - "LGPLLR", - "LOOP", - "LPL-1.0", - "LPL-1.02", - "LPPL-1.0", - "LPPL-1.1", - "LPPL-1.2", - "LPPL-1.3a", - "LPPL-1.3c", - "LZMA-SDK-9.11-to-9.20", - "LZMA-SDK-9.22", - "Latex2e", - "Leptonica", - "LiLiQ-P-1.1", - "LiLiQ-R-1.1", - "LiLiQ-Rplus-1.1", - "Libpng", - "Linux-OpenIB", - "Linux-man-pages-copyleft", - "MIT", - "MIT-0", - "MIT-CMU", - "MIT-Modern-Variant", - "MIT-Wu", - "MIT-advertising", - "MIT-enna", - "MIT-feh", - "MIT-open-group", - "MITNFA", - "MPL-1.0", - "MPL-1.1", - "MPL-2.0", - "MPL-2.0-no-copyleft-exception", - "MS-LPL", - "MS-PL", - "MS-RL", - "MTLL", - "MakeIndex", - "Martin-Birgmeier", - "Minpack", - "MirOS", - "Motosoto", - "MulanPSL-1.0", - "MulanPSL-2.0", - "Multics", - "Mup", - "NAIST-2003", - "NASA-1.3", - "NBPL-1.0", - "NCGL-UK-2.0", - "NCSA", - "NGPL", - "NICTA-1.0", - "NIST-PD", - "NIST-PD-fallback", - "NLOD-1.0", - "NLOD-2.0", - "NLPL", - "NOSL", - "NPL-1.0", - "NPL-1.1", - "NPOSL-3.0", - "NRL", - "NTP", - "NTP-0", - "Naumen", - "Net-SNMP", - "NetCDF", - "Newsletr", - "Nokia", - "Noweb", - "O-UDA-1.0", - "OCCT-PL", - "OCLC-2.0", - "ODC-By-1.0", - "ODbL-1.0", - "OFFIS", - "OFL-1.0", - "OFL-1.0-RFN", - "OFL-1.0-no-RFN", - "OFL-1.1", - "OFL-1.1-RFN", - "OFL-1.1-no-RFN", - "OGC-1.0", - "OGDL-Taiwan-1.0", - "OGL-Canada-2.0", - "OGL-UK-1.0", - "OGL-UK-2.0", - "OGL-UK-3.0", - "OGTSL", - "OLDAP-1.1", - "OLDAP-1.2", - "OLDAP-1.3", - "OLDAP-1.4", - "OLDAP-2.0", - "OLDAP-2.0.1", - "OLDAP-2.1", - "OLDAP-2.2", - "OLDAP-2.2.1", - "OLDAP-2.2.2", - "OLDAP-2.3", - "OLDAP-2.4", - "OLDAP-2.5", - "OLDAP-2.6", - "OLDAP-2.7", - "OLDAP-2.8", - "OML", - "OPL-1.0", - "OPUBL-1.0", - "OSET-PL-2.1", - "OSL-1.0", - "OSL-1.1", - "OSL-2.0", - "OSL-2.1", - "OSL-3.0", - "OpenPBS-2.3", - "OpenSSL", - "PDDL-1.0", - "PHP-3.0", - "PHP-3.01", - "PSF-2.0", - "Parity-6.0.0", - "Parity-7.0.0", - "Plexus", - "PolyForm-Noncommercial-1.0.0", - "PolyForm-Small-Business-1.0.0", - "PostgreSQL", - "Python-2.0", - "Python-2.0.1", - "QPL-1.0", - "QPL-1.0-INRIA-2004", - "Qhull", - "RHeCos-1.1", - "RPL-1.1", - "RPL-1.5", - "RPSL-1.0", - "RSA-MD", - "RSCPL", - "Rdisc", - "Ruby", - "SAX-PD", - "SCEA", - "SGI-B-1.0", - "SGI-B-1.1", - "SGI-B-2.0", - "SHL-0.5", - "SHL-0.51", - "SISSL", - "SISSL-1.2", - "SMLNJ", - "SMPPL", - "SNIA", - "SPL-1.0", - "SSH-OpenSSH", - "SSH-short", - "SSPL-1.0", - "SWL", - "Saxpath", - "SchemeReport", - "Sendmail", - "Sendmail-8.23", - "SimPL-2.0", - "Sleepycat", - "Spencer-86", - "Spencer-94", - "Spencer-99", - "SugarCRM-1.1.3", - "SunPro", - "Symlinks", - "TAPR-OHL-1.0", - "TCL", - "TCP-wrappers", - "TMate", - "TORQUE-1.1", - "TOSL", - "TPDL", - "TPL-1.0", - "TTWL", - "TU-Berlin-1.0", - "TU-Berlin-2.0", - "UCAR", - "UCL-1.0", - "UPL-1.0", - "Unicode-DFS-2015", - "Unicode-DFS-2016", - "Unicode-TOU", - "Unlicense", - "VOSTROM", - "VSL-1.0", - "Vim", - "W3C", - "W3C-19980720", - "W3C-20150513", - "WTFPL", - "Watcom-1.0", - "Wsuipa", - "X11", - "X11-distribute-modifications-variant", - "XFree86-1.1", - "XSkat", - "Xerox", - "Xnet", - "YPL-1.0", - "YPL-1.1", - "ZPL-1.1", - "ZPL-2.0", - "ZPL-2.1", - "Zed", - "Zend-2.0", - "Zimbra-1.3", - "Zimbra-1.4", - "Zlib", - "blessing", - "bzip2-1.0.6", - "checkmk", - "copyleft-next-0.3.0", - "copyleft-next-0.3.1", - "curl", - "diffmark", - "dvipdfm", - "eGenix", - "etalab-2.0", - "gSOAP-1.3b", - "gnuplot", - "iMatix", - "libpng-2.0", - "libselinux-1.0", - "libtiff", - "libutil-David-Nugent", - "mpi-permissive", - "mpich2", - "mplus", - "psfrag", - "psutils", - "snprintf", - "w3m", - "xinetd", - "xlock", - "xpp", - "zlib-acknowledgement" -] diff --git a/node_modules/spdx-license-ids/package.json b/node_modules/spdx-license-ids/package.json deleted file mode 100644 index ea060776d..000000000 --- a/node_modules/spdx-license-ids/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "spdx-license-ids", - "version": "3.0.13", - "description": "A list of SPDX license identifiers", - "repository": "jslicense/spdx-license-ids", - "author": "Shinnosuke Watanabe (https://github.com/shinnn)", - "license": "CC0-1.0", - "scripts": { - "build": "node build.js", - "pretest": "eslint .", - "latest": "node latest.js", - "test": "node test.js" - }, - "files": [ - "deprecated.json", - "index.json" - ], - "keywords": [ - "spdx", - "license", - "licenses", - "id", - "identifier", - "identifiers", - "json", - "array", - "oss" - ], - "devDependencies": { - "@shinnn/eslint-config": "^7.0.0", - "eslint": "^8.2.0", - "eslint-formatter-codeframe": "^7.32.1", - "rmfr": "^2.0.0", - "tape": "^5.3.1" - }, - "eslintConfig": { - "extends": "@shinnn" - } -} diff --git a/node_modules/string-width/index.d.ts b/node_modules/string-width/index.d.ts deleted file mode 100644 index 12b530975..000000000 --- a/node_modules/string-width/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -declare const stringWidth: { - /** - Get the visual width of a string - the number of columns required to display it. - - Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - - @example - ``` - import stringWidth = require('string-width'); - - stringWidth('a'); - //=> 1 - - stringWidth('古'); - //=> 2 - - stringWidth('\u001B[1m古\u001B[22m'); - //=> 2 - ``` - */ - (string: string): number; - - // TODO: remove this in the next major version, refactor the whole definition to: - // declare function stringWidth(string: string): number; - // export = stringWidth; - default: typeof stringWidth; -} - -export = stringWidth; diff --git a/node_modules/string-width/index.js b/node_modules/string-width/index.js deleted file mode 100644 index f4d261a96..000000000 --- a/node_modules/string-width/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; -const stripAnsi = require('strip-ansi'); -const isFullwidthCodePoint = require('is-fullwidth-code-point'); -const emojiRegex = require('emoji-regex'); - -const stringWidth = string => { - if (typeof string !== 'string' || string.length === 0) { - return 0; - } - - string = stripAnsi(string); - - if (string.length === 0) { - return 0; - } - - string = string.replace(emojiRegex(), ' '); - - let width = 0; - - for (let i = 0; i < string.length; i++) { - const code = string.codePointAt(i); - - // Ignore control characters - if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { - continue; - } - - // Ignore combining characters - if (code >= 0x300 && code <= 0x36F) { - continue; - } - - // Surrogates - if (code > 0xFFFF) { - i++; - } - - width += isFullwidthCodePoint(code) ? 2 : 1; - } - - return width; -}; - -module.exports = stringWidth; -// TODO: remove this in the next major version -module.exports.default = stringWidth; diff --git a/node_modules/string-width/license b/node_modules/string-width/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/string-width/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/string-width/package.json b/node_modules/string-width/package.json deleted file mode 100644 index 28ba7b4ca..000000000 --- a/node_modules/string-width/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "string-width", - "version": "4.2.3", - "description": "Get the visual width of a string - the number of columns required to display it", - "license": "MIT", - "repository": "sindresorhus/string-width", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "string", - "character", - "unicode", - "width", - "visual", - "column", - "columns", - "fullwidth", - "full-width", - "full", - "ansi", - "escape", - "codes", - "cli", - "command-line", - "terminal", - "console", - "cjk", - "chinese", - "japanese", - "korean", - "fixed-width" - ], - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.1", - "xo": "^0.24.0" - } -} diff --git a/node_modules/string-width/readme.md b/node_modules/string-width/readme.md deleted file mode 100644 index bdd314129..000000000 --- a/node_modules/string-width/readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# string-width - -> Get the visual width of a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - -Useful to be able to measure the actual width of command-line output. - - -## Install - -``` -$ npm install string-width -``` - - -## Usage - -```js -const stringWidth = require('string-width'); - -stringWidth('a'); -//=> 1 - -stringWidth('古'); -//=> 2 - -stringWidth('\u001B[1m古\u001B[22m'); -//=> 2 -``` - - -## Related - -- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module -- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string -- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string - - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/strip-ansi/index.d.ts b/node_modules/strip-ansi/index.d.ts deleted file mode 100644 index 907fccc29..000000000 --- a/node_modules/strip-ansi/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** -Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. - -@example -``` -import stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' - -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -//=> 'Click' -``` -*/ -declare function stripAnsi(string: string): string; - -export = stripAnsi; diff --git a/node_modules/strip-ansi/index.js b/node_modules/strip-ansi/index.js deleted file mode 100644 index 9a593dfcd..000000000 --- a/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); - -module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/strip-ansi/license b/node_modules/strip-ansi/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/strip-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/strip-ansi/package.json b/node_modules/strip-ansi/package.json deleted file mode 100644 index 1a41108d4..000000000 --- a/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "strip-ansi", - "version": "6.0.1", - "description": "Strip ANSI escape codes from a string", - "license": "MIT", - "repository": "chalk/strip-ansi", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.10.0", - "xo": "^0.25.3" - } -} diff --git a/node_modules/strip-ansi/readme.md b/node_modules/strip-ansi/readme.md deleted file mode 100644 index 7c4b56d46..000000000 --- a/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) - -> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string - - -## Install - -``` -$ npm install strip-ansi -``` - - -## Usage - -```js -const stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' - -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -//=> 'Click' -``` - - -## strip-ansi for enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - - -## Related - -- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module -- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module -- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - diff --git a/node_modules/strip-indent/index.d.ts b/node_modules/strip-indent/index.d.ts deleted file mode 100644 index 2bacea971..000000000 --- a/node_modules/strip-indent/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** -Strip leading whitespace from each line in a string. - -The line with the least number of leading whitespace, ignoring empty lines, determines the number to remove. - -@example -``` -import stripIndent from 'strip-indent'; - -const string = '\tunicorn\n\t\tcake'; -// unicorn -// cake - -stripIndent(string); -//unicorn -// cake -``` -*/ -export default function stripIndent(string: string): string; diff --git a/node_modules/strip-indent/index.js b/node_modules/strip-indent/index.js deleted file mode 100644 index 3b18b97fd..000000000 --- a/node_modules/strip-indent/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import minIndent from 'min-indent'; - -export default function stripIndent(string) { - const indent = minIndent(string); - - if (indent === 0) { - return string; - } - - const regex = new RegExp(`^[ \\t]{${indent}}`, 'gm'); - - return string.replace(regex, ''); -} diff --git a/node_modules/strip-indent/license b/node_modules/strip-indent/license deleted file mode 100644 index fa7ceba3e..000000000 --- a/node_modules/strip-indent/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/strip-indent/package.json b/node_modules/strip-indent/package.json deleted file mode 100644 index 919e1fb73..000000000 --- a/node_modules/strip-indent/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "strip-indent", - "version": "4.0.0", - "description": "Strip leading whitespace from each line in a string", - "license": "MIT", - "repository": "sindresorhus/strip-indent", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "type": "module", - "exports": "./index.js", - "engines": { - "node": ">=12" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "strip", - "indent", - "indentation", - "normalize", - "remove", - "delete", - "whitespace", - "space", - "tab", - "string" - ], - "dependencies": { - "min-indent": "^1.0.1" - }, - "devDependencies": { - "ava": "^3.15.0", - "tsd": "^0.14.0", - "xo": "^0.39.1" - } -} diff --git a/node_modules/strip-indent/readme.md b/node_modules/strip-indent/readme.md deleted file mode 100644 index 371e905c1..000000000 --- a/node_modules/strip-indent/readme.md +++ /dev/null @@ -1,48 +0,0 @@ -# strip-indent - -> Strip leading whitespace from each line in a string - -The line with the least number of leading whitespace, ignoring empty lines, determines the number to remove. - -Useful for removing redundant indentation. - -## Install - -``` -$ npm install strip-indent -``` - -## Usage - -```js -import stripIndent from 'strip-indent'; - -const string = '\tunicorn\n\t\tcake'; -/* - unicorn - cake -*/ - -stripIndent(string); -/* -unicorn - cake -*/ -``` - -## Related - -- [strip-indent-cli](https://github.com/sindresorhus/strip-indent-cli) - CLI for this module -- [indent-string](https://github.com/sindresorhus/indent-string) - Indent each line in a string - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/style-search/.npmignore b/node_modules/style-search/.npmignore deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/style-search/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/style-search/CHANGELOG.md b/node_modules/style-search/CHANGELOG.md deleted file mode 100644 index 6c572f9b6..000000000 --- a/node_modules/style-search/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# Changelog - -## 0.1.0 - -- Initial extraction from [stylelint](https://github.com/stylelint/stylelint), API refactoring, and release. diff --git a/node_modules/style-search/LICENSE b/node_modules/style-search/LICENSE deleted file mode 100644 index cec41a847..000000000 --- a/node_modules/style-search/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2016, David Clark - -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. diff --git a/node_modules/style-search/README.md b/node_modules/style-search/README.md deleted file mode 100644 index 1d662db08..000000000 --- a/node_modules/style-search/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# style-search [![CircleCI](https://circleci.com/gh/davidtheclark/style-search.svg?style=svg)](https://circleci.com/gh/davidtheclark/style-search) - -Search CSS (and CSS-like) strings, with sensitivity to whether matches occur inside strings, comments, and functions. - -## Usage - -```js -var styleSearch = require('style-search'); - -styleSearch(options, callback); -``` - -**By default, the search ignores strings, comments, and function names.** You can use the options to change this behavior or introduce other restrictions. That is what makes this module more useful for many searches than `indexOf()` or a `RegExp`. - -However, if you need more detailed parsing, you should consider using the real parsers [PostCSS](https://github.com/postcss/postcss), [`postcss-selector-parser`](https://github.com/postcss/postcss-selector-parser), and [`postcss-value-parser`](https://github.com/TrySound/postcss-value-parser). - -### Example - -```css -/* Here is some pink */ -a { color: pink; } -a::before { content: "pink" } -b { color: shadesOfPink(7); } -``` - -```js -styleSearch({ - source: theCssStringAbove, - target: "pink", -}, function(match, count) { - /* Only the "pink" in `color: pink` will be - reported as a match */ -}); -``` - -### Reporting matches - -For every match found your `callback` is invoked. It is passed two arguments: - -- A `match` object with the following properties: - - `startIndex`: where the match begins - - `endIndex`: where the match ends - - `target`: what got matched (useful if your `target` option is an array instead of a single string) - - `insideFunctionArguments`: whether the match is inside a function — *this includes the parentheses around the arguments* - - `insideComment`: whether the match is inside a comment - - `insideString`: whether the match is inside a string -- The count of how many matches have been found up to this point. - -### Options - -Below you'll see that syntax feature options all accept three keywords: `"skip"`, `"check"`, `"only"`. An error will be thrown if you use `"only"` more than once. - -#### source - -String. *Required.* - -The source string to search through. - -#### target - -String or array of strings. *Required.* - -The target of the search. Can be -- a single character -- a string with some length -- an array of strings, all of which count as matches (the `match` object passed to the `callback` will differentiate which string in the array got matched via its `target` property) - -#### once - -Boolean. Default: `false`. - -If `true`, the search will stop after one match is found. - -#### comments - -`"skip"` | `"check"` | `"only"`. Default: `"skip"`. - -This includes both standard `/* CSS comments */` and non-standard but widely used `// single line comments`. - -#### strings - -`"skip"` | `"check"` | `"only"`. Default: `"skip"`. - -#### functionNames - -`"skip"` | `"check"` | `"only"`. Default: `"skip"`. - -#### functionArguments - -`"skip"` | `"check"` | `"only"`. Default: `"check"`. - -#### parentheticals - -`"skip"` | `"check"` | `"only"`. Default: `"check"`. - -This designates anything inside parentheses, which includes standard functions, but also Sass maps and other non-standard constructs. `parentheticals` is a broader category than `functionArguments`. diff --git a/node_modules/style-search/circle.yml b/node_modules/style-search/circle.yml deleted file mode 100644 index 0efe6abfb..000000000 --- a/node_modules/style-search/circle.yml +++ /dev/null @@ -1,5 +0,0 @@ -test: - override: - - nvm use 0.10 && npm test - - nvm use 0.12 && npm test - - nvm use 4.0 && npm test diff --git a/node_modules/style-search/index.js b/node_modules/style-search/index.js deleted file mode 100644 index 74a23f131..000000000 --- a/node_modules/style-search/index.js +++ /dev/null @@ -1,203 +0,0 @@ -var SKIP = 'skip'; -var CHECK = 'check'; -var ONLY = 'only'; - -module.exports = function (options, callback) { - var source = options.source; - var target = options.target; - - var skipComments = (options.comments) ? options.comments === SKIP : true; - var skipStrings = (options.strings) ? options.strings === SKIP : true; - var skipFunctionNames = (options.functionNames) ? options.functionNames === SKIP : true; - var skipFunctionArguments = options.functionArguments === SKIP; - var skipParentheticals = options.parentheticals === SKIP; - - var onceOptionUsed = false; - Object.keys(options).forEach(function(key) { - if (options[key] !== ONLY) return; - if (!onceOptionUsed) { - onceOptionUsed = true; - } else { - throw new Error('Only one syntax feature option can be the "only" one to check'); - } - }); - - var onlyComments = options.comments === ONLY; - var onlyStrings = options.strings === ONLY; - var onlyFunctionNames = options.functionNames === ONLY; - var onlyFunctionArguments = options.functionArguments === ONLY; - var onlyParentheticals = options.parentheticals === ONLY; - - var insideString = false; - var insideComment = false; - var insideSingleLineComment = false; - var insideParens = false; - var insideFunctionArguments = false; - var openingParenCount = 0; - var matchCount = 0; - var openingQuote; - - var targetIsArray = Array.isArray(target); - - // If the target is just a string, it is easy to check whether - // some index of the source matches it. - // If the target is an array of strings, though, we have to - // check whether some index of the source matches *any* of - // those target strings (stopping after the first match). - var getMatch = (function () { - if (!targetIsArray) { - return getMatchBase.bind(null, target); - } - return function(index) { - for (var ti = 0, tl = target.length; ti < tl; ti++) { - var checkResult = getMatchBase(target[ti], index); - if (checkResult) return checkResult; - } - return false; - } - })(); - - function getMatchBase(targetString, index) { - var targetStringLength = targetString.length; - - // Target is a single character - if (targetStringLength === 1 && source[index] !== targetString) return false; - - // Target is multiple characters - if (source.substr(index, targetStringLength) !== targetString) return false; - - return { - insideParens: insideParens, - insideFunctionArguments: insideFunctionArguments, - insideComment: insideComment, - insideString: insideString, - startIndex: index, - endIndex: index + targetStringLength, - target: targetString, - }; - } - - for (var i = 0, l = source.length; i < l; i++) { - var currentChar = source[i]; - - // Register the beginning of a comment - if ( - !insideString && !insideComment - && currentChar === "/" - && source[i - 1] !== "\\" // escaping - ) { - // standard comments - if (source[i + 1] === "*") { - insideComment = true; - continue; - } - // single-line comments - if (source[i + 1] === "/") { - insideComment = true; - insideSingleLineComment = true; - continue; - } - } - - if (insideComment) { - // Register the end of a standard comment - if ( - !insideSingleLineComment - && currentChar === "*" - && source[i - 1] !== "\\" // escaping - && source[i + 1] === "/" - && source[i - 1] !== "/" // don't end if it's /*/ - ) { - insideComment = false; - continue; - } - - // Register the end of a single-line comment - if ( - insideSingleLineComment - && currentChar === "\n" - ) { - insideComment = false; - insideSingleLineComment = false; - } - - if (skipComments) continue; - } - - // Register the beginning of a string - if (!insideComment && !insideString && (currentChar === "\"" || currentChar === "'")) { - if (source[i - 1] === "\\") continue; // escaping - - openingQuote = currentChar; - insideString = true; - - // For string-quotes rule - if (target === currentChar) handleMatch(getMatch(i)); - continue; - } - - if (insideString) { - // Register the end of a string - if (currentChar === openingQuote) { - if (source[i - 1] === "\\") continue; // escaping - insideString = false; - continue; - } - - if (skipStrings) continue; - } - - // Register the beginning of parens/functions - if (!insideString && !insideComment && currentChar === "(") { - // Keep track of opening parentheticals so that we - // know when the outermost function (possibly - // containing nested functions) is closing - openingParenCount++; - - insideParens = true; - // Only inside a function if there is a function name - // before the opening paren - if (/[a-zA-Z]/.test(source[i - 1])) { - insideFunctionArguments = true; - } - - if (target === "(") handleMatch(getMatch(i)); - continue; - } - - if (insideParens) { - // Register the end of a function - if (currentChar === ")") { - openingParenCount--; - // Do this here so the match is still technically inside a function - if (target === ")") handleMatch(getMatch(i)); - if (openingParenCount === 0) { - insideParens = false; - insideFunctionArguments = false; - } - continue; - } - } - - var isFunctionName = /^[a-zA-Z]*\(/.test(source.slice(i)); - if (skipFunctionNames && isFunctionName) continue; - if (onlyFunctionNames && !isFunctionName) continue; - - var match = getMatch(i); - - if (!match) continue; - handleMatch(match); - if (options.once) return; - } - - function handleMatch(match) { - if (onlyParentheticals && !insideParens) return; - if (skipParentheticals && insideParens) return; - if (onlyFunctionArguments && !insideFunctionArguments) return; - if (skipFunctionArguments && insideFunctionArguments) return; - if (onlyStrings && !insideString) return; - if (onlyComments && !insideComment) return; - matchCount++; - callback(match, matchCount); - } -} diff --git a/node_modules/style-search/package.json b/node_modules/style-search/package.json deleted file mode 100644 index 0a2cefc31..000000000 --- a/node_modules/style-search/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "style-search", - "version": "0.1.0", - "description": "Search CSS(-like) strings", - "main": "index.js", - "scripts": { - "test": "tape test.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/davidtheclark/style-search.git" - }, - "keywords": [ - "css", - "search", - "stylelint" - ], - "author": "David Clark", - "license": "ISC", - "bugs": { - "url": "https://github.com/davidtheclark/style-search/issues" - }, - "homepage": "https://github.com/davidtheclark/style-search#readme", - "devDependencies": { - "tape": "^4.5.1" - } -} diff --git a/node_modules/style-search/test.js b/node_modules/style-search/test.js deleted file mode 100644 index 71c93e9d8..000000000 --- a/node_modules/style-search/test.js +++ /dev/null @@ -1,467 +0,0 @@ -var test = require("tape"); -var styleSearch = require("./index"); - -function styleSearchResults(options) { - const results = []; - styleSearch(options, function(match) { - results.push(match.startIndex); - }); - return results; -} - -test("default options", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: "c", - }), [ 2, 4 ]); - t.deepEqual(styleSearchResults({ - source: "abc cb", - target: "a", - }), [0]); - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: "b", - }), [ 1, 5 ]); - t.deepEqual(styleSearchResults({ - source: "abc \"var(--cba)\"", - target: "a", - }), [0]); - t.end(); -}); - -test("once", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: "c", - once: true, - }), [2]); - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: "a", - once: true, - }), [0]); - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: "b", - once: false, - }), [ 1, 5 ]); - t.end(); -}); - -test("functionArguments: 'only'", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc var(--cba)", - target: "c", - functionArguments: "only", - }), [10]); - t.deepEqual(styleSearchResults({ - source: "abc var(--cba)", - target: "a", - functionArguments: "only", - }), [12]); - t.deepEqual(styleSearchResults({ - source: "abc \"var(--cba)\"", - target: "a", - functionArguments: "only", - }), []); - t.deepEqual(styleSearchResults({ - source: "translate(1px, calc(1px * 2))", - target: "1", - functionArguments: "only", - }), [ 10, 20 ]); - t.deepEqual(styleSearchResults({ - source: "var(--horse)", - target: "v", - functionArguments: "only", - }), []); - t.deepEqual(styleSearchResults({ - source: "abc (abc)", - target: "b", - functionArguments: "only", - }), [], "parens without function is not interpreted as a function"); - t.deepEqual(styleSearchResults({ - source: "de$(abc)fg", - target: "b", - functionArguments: "only", - }), [], "parens preceded by `$`, for postcss-simple-vars interpolation, not interpreted as a function"); - t.deepEqual(styleSearchResults({ - source: "de$(abc)fg", - target: ")", - functionArguments: "only", - }), [], "closing paren of non-function is ignored"); - t.end(); -}); - -test("functionArguments: 'skip'", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc var(--cba)", - target: "c", - functionArguments: "skip", - }), [2]); - t.deepEqual(styleSearchResults({ - source: "abc var(--cba)", - target: "a", - functionArguments: "skip", - }), [0]); - t.deepEqual(styleSearchResults({ - source: "abc \"a var(--cba)\"", - target: "a", - functionArguments: "skip", - }), [0]); - t.deepEqual(styleSearchResults({ - source: "translate(1px, calc(1px * 2))", - target: "1", - functionArguments: "skip", - }), []); - t.deepEqual(styleSearchResults({ - source: "var(--horse)", - target: "v", - functionArguments: "skip", - }), []); - t.deepEqual(styleSearchResults({ - source: "abc (def)", - target: "e", - functionArguments: "skip", - }), [6], "parens without function is not interpreted as a function"); - t.end(); -}); - -test("parentheticals: 'skip'", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc var(--cba)", - target: "c", - parentheticals: "skip", - }), [2]); - t.deepEqual(styleSearchResults({ - source: "abc var(--cba)", - target: "a", - parentheticals: "skip", - }), [0]); - t.deepEqual(styleSearchResults({ - source: "abc \"a var(--cba)\"", - target: "a", - parentheticals: "skip", - }), [0]); - t.deepEqual(styleSearchResults({ - source: "translate(1px, calc(1px * 2))", - target: "1", - parentheticals: "skip", - }), []); - t.deepEqual(styleSearchResults({ - source: "var(--horse)", - target: "v", - parentheticals: "skip", - }), []); - t.deepEqual(styleSearchResults({ - source: "abc (def)", - target: "e", - parentheticals: "skip", - }), [], "parens without function are still ignored"); - t.end(); -}); - -test("ignores matches inside single-quote strings", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc 'abc'", - target: "c", - }), [2]); - t.deepEqual(styleSearchResults({ - source: "abc 'abc' cba", - target: "c", - }), [ 2, 10 ]); - t.end(); -}); - -test("ignores matches inside double-quote strings", function(t) { - t.deepEqual(styleSearchResults({ - source: 'abc "abc"', - target: "c", - }), [2]); - t.deepEqual(styleSearchResults({ - source: 'abc "abc" cba', - target: "c", - }), [ 2, 10 ]); - t.end(); -}); - -test("strings: 'check'", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc 'abc'", - target: "b", - strings: "check", - }), [ 1, 6 ]); - - t.deepEqual(styleSearchResults({ - source: "abc /* 'abc' */", - target: "b", - strings: "check", - }), [1], "no strings inside comments"); - t.end(); -}); - -test("strings: 'only'", function(t) { - t.deepEqual(styleSearchResults({ - source: 'abc "abc"', - target: "b", - strings: "only", - }), [6]); - - t.deepEqual(styleSearchResults({ - source: "p[href^='https://']:before { content: \"\/*\"; \n top: 0;\n}", - target: "\n", - strings: "only", - }), [], "comments do not start inside strings"); - - t.end(); -}); - -test("ignores matches inside comments", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc/*comment*/", - target: "m", - }), []); - t.deepEqual(styleSearchResults({ - source: "abc/*command*/", - target: "a", - }), [0]); - t.end(); -}); - -test("comments: 'check'", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc/*abc*/", - target: "b", - comments: "check", - }), [ 1, 6 ]); - t.end(); -}); - -test("comments: 'only'", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc/*abc*/", - target: "b", - comments: "only", - }), [6]); - t.deepEqual(styleSearchResults({ - source: "abc/*/abc*/", - target: "b", - comments: "only", - }), [7]); - t.deepEqual(styleSearchResults({ - source: "ab'c/*abc*/c'", - target: "b", - comments: "only", - }), [], "no comments inside strings"); - t.end(); -}); - -test("ignores matches inside single-line comment", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc // comment", - target: "m", - }), []); - t.deepEqual(styleSearchResults({ - source: "abc // command", - target: "a", - }), [0]); - // Triple-slash comments are used for sassdoc - t.deepEqual(styleSearchResults({ - source: "abc /// it's all ok", - target: "a", - }), [0]); - t.end(); -}); - -test("handles escaped double-quotes in double-quote strings", function(t) { - t.deepEqual(styleSearchResults({ - source: 'abc "ab\\"c"', - target: "c", - }), [2]); - t.deepEqual(styleSearchResults({ - source: 'abc "a\\"bc" foo cba', - target: "c", - }), [ 2, 16 ]); - t.end(); -}); - -test("handles escaped double-quotes in single-quote strings", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc 'ab\\'c'", - target: "c", - }), [2]); - t.deepEqual(styleSearchResults({ - source: "abc 'a\\'bc' foo cba", - target: "c", - }), [ 2, 16 ]); - t.end(); -}); - -test("count", function(t) { - const endCounts = [] - styleSearch({ source: "123 123 123", target: "1" }, function(index, count) { - endCounts.push(count); - }); - t.deepEqual(endCounts, [ 1, 2, 3 ]); - t.end(); -}); - -test("finds parentheses", function(t) { - t.deepEqual(styleSearchResults({ - source: "a { color: rgb(0,0,0); }", - target: "(", - }), [14]); - t.deepEqual(styleSearchResults({ - source: "a { color: rgb(0,0,0); }", - target: ")", - }), [20]); - t.end(); -}); - -test("functionNames: 'check'", function(t) { - t.deepEqual(styleSearchResults({ - source: "a { color: rgb(0,0,0); }", - target: "rgb", - }), []); - t.deepEqual(styleSearchResults({ - source: "a { color: rgb(0,0,0); }", - target: "rgb", - functionNames: "check" - }), [11]); - t.end(); -}); - -test("non-single-character target", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: "abc", - }), [0]); - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: "cb", - }), [4]); - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: "c c", - }), [2]); - t.deepEqual(styleSearchResults({ - source: "abc cba abc", - target: "abc", - }), [ 0, 8 ]); - t.deepEqual(styleSearchResults({ - source: "abc cba 'abc'", - target: "abc", - }), [0]); - t.deepEqual(styleSearchResults({ - source: "abc cb", - target: "aa", - }), []); - t.end(); -}); - -test("array target", function(t) { - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: [ "a", "b" ], - }), [ 0, 1, 5, 6 ]); - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: [ "c", "b" ], - }), [ 1, 2, 4, 5 ]); - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: [ "bc", "a" ], - }), [ 0, 1, 6 ]); - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: [ "abc", "f" ], - }), [0]); - t.deepEqual(styleSearchResults({ - source: "abc cba", - target: [ 0, 1, 2 ], - }), []); - t.end(); -}); - -test("match object", function(t) { - styleSearch({ source: "abc", target: "bc" }, function(match) { - t.equal(match.startIndex, 1); - t.equal(match.endIndex, 3); - t.equal(match.target, "bc"); - t.equal(match.insideFunctionArguments, false); - t.equal(match.insideComment, false); - }); - - const twoMatches = [] - styleSearch({ source: "abc bca", target: [ "bc ", "ca" ] }, function(match) { - twoMatches.push(match); - }); - const firstMatch = twoMatches[0] - const secondMatch = twoMatches[1] - t.equal(firstMatch.startIndex, 1); - t.equal(firstMatch.endIndex, 4); - t.equal(firstMatch.target, "bc "); - t.equal(firstMatch.insideFunctionArguments, false); - t.equal(firstMatch.insideComment, false); - t.equal(secondMatch.startIndex, 5); - t.equal(secondMatch.endIndex, 7); - t.equal(secondMatch.target, "ca"); - t.equal(secondMatch.insideFunctionArguments, false); - t.equal(secondMatch.insideComment, false); - t.end(); -}); - -test("match inside a function", function(t) { - styleSearch({ source: "a { color: rgb(0, 0, 1); }", target: "1" }, function(match) { - t.equal(match.insideFunctionArguments, true); - t.equal(match.insideComment, false); - t.end(); - }); -}); - -test("match inside a comment", function(t) { - styleSearch({ - source: "a { color: /* 1 */ pink; }", - target: "1", - comments: "check" - }, function(match) { - t.equal(match.insideFunctionArguments, false); - t.equal(match.insideComment, true); - t.end(); - }); -}); - -test("match inside a block comment", function(t) { - styleSearch({ - source: "a { color:\n/**\n * 0\n * 1\n */\npink; }", - target: "1", - comments: "check" - }, function(match) { - t.equal(match.insideFunctionArguments, false); - t.equal(match.insideComment, true); - t.end(); - }); -}); - -test("match inside a comment inside function", function(t) { - styleSearch({ - source: "a { color: rgb(0, 0, 0 /* 1 */); }", - target: "1", - comments: "check" - }, function(match) { - t.equal(match.insideFunctionArguments, true); - t.equal(match.insideComment, true); - t.end(); - }); -}); - -test("error on multiple 'only' options", function(t) { - t.throws(function() { - styleSearch({ - source: "a {}", - target: "a", - comments: "only", - strings: "only", - }, function(match) {}); - }, /Only one syntax/); - t.end(); -}); diff --git a/node_modules/stylelint-config-recommended-scss/LICENSE b/node_modules/stylelint-config-recommended-scss/LICENSE deleted file mode 100644 index 9f82c82e4..000000000 --- a/node_modules/stylelint-config-recommended-scss/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Krister Kari - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/stylelint-config-recommended-scss/README.md b/node_modules/stylelint-config-recommended-scss/README.md deleted file mode 100644 index c2e6ecfd7..000000000 --- a/node_modules/stylelint-config-recommended-scss/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# stylelint-config-recommended-scss - -[![npm version](https://img.shields.io/npm/v/stylelint-config-recommended-scss?logo=npm&logoColor=fff)](https://www.npmjs.com/package/stylelint-config-recommended-scss) -[![Build Status](https://img.shields.io/github/actions/workflow/status/stylelint-scss/stylelint-config-recommended-scss/test.yml?branch=master&label=tests&logo=github)](https://github.com/stylelint-scss/stylelint-config-recommended-scss/actions/workflows/test.yml?query=workflow%3ATests) -[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen)](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github) -[![Downloads per month](https://img.shields.io/npm/dm/stylelint-config-recommended-scss)](https://npmcharts.com/compare/stylelint-config-recommended-scss) - -> The recommended shareable SCSS config for Stylelint. - -This config: - -- extends the [`stylelint-config-recommended` shared config](https://github.com/stylelint/stylelint-config-recommended) and configures its rules for SCSS -- bundles the [`stylelint-scss` plugin pack](https://github.com/stylelint-scss/stylelint-scss) and turns on its rules that check for possible errors -- bundles the [`postcss-scss` custom syntax](https://github.com/postcss/postcss-scss) and configures it - -This config is extended by the [`stylelint-config-standard-scss` shared config](https://github.com/stylelint-scss/stylelint-config-standard-scss). That config is better suited to most users as it also turns on the stylistic rules in the [`stylelint-scss` plugin pack](https://github.com/stylelint-scss/stylelint-scss). - -To see the rules that this config uses, please read the [config itself](/index.js). - -## Installation - -```shell -npm install --save-dev stylelint-config-recommended-scss -``` - -## Usage - -Set your `stylelint` config to: - -```json -{ - "extends": "stylelint-config-recommended-scss" -} -``` - -### Extending the config - -Simply add a `"rules"` key to your config, then add your overrides and additions there. - -For example, to turn off the `scss/at-if-no-null` rule: - -```json -{ - "extends": "stylelint-config-recommended-scss", - "rules": { - "scss/at-if-no-null": null - } -} -``` - -## [Changelog](CHANGELOG.md) - -## [License](LICENSE) diff --git a/node_modules/stylelint-config-recommended-scss/index.js b/node_modules/stylelint-config-recommended-scss/index.js deleted file mode 100644 index 811831725..000000000 --- a/node_modules/stylelint-config-recommended-scss/index.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -const postcssScss = require('postcss-scss'); - -module.exports = { - extends: ['stylelint-config-recommended'], - customSyntax: postcssScss, - plugins: ['stylelint-scss'], - rules: { - 'annotation-no-unknown': null, - 'at-rule-no-unknown': null, - 'comment-no-empty': null, - 'function-no-unknown': null, - 'no-invalid-position-at-import-rule': [ - true, - { - ignoreAtRules: ['use', 'forward'], - }, - ], - 'scss/at-extend-no-missing-placeholder': true, - 'scss/at-if-no-null': true, - 'scss/at-import-no-partial-leading-underscore': true, - 'scss/at-import-partial-extension': 'never', - 'scss/at-rule-no-unknown': true, - 'scss/comment-no-empty': true, - 'scss/declaration-nested-properties-no-divided-groups': true, - 'scss/dollar-variable-no-missing-interpolation': true, - 'scss/function-quote-no-quoted-strings-inside': true, - 'scss/function-unquote-no-unquoted-strings-inside': true, - 'scss/no-duplicate-mixins': true, - 'scss/no-global-function-names': true, - 'scss/operator-no-newline-after': true, - 'scss/operator-no-newline-before': true, - 'scss/operator-no-unspaced': true, - }, -}; diff --git a/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/LICENSE b/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/LICENSE deleted file mode 100644 index fb97970a4..000000000 --- a/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 - present stylelint - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/README.md b/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/README.md deleted file mode 100644 index a9b722bb8..000000000 --- a/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# stylelint-config-recommended - -[![NPM version](https://img.shields.io/npm/v/stylelint-config-recommended.svg)](https://www.npmjs.org/package/stylelint-config-recommended) [![Build Status](https://github.com/stylelint/stylelint-config-recommended/workflows/CI/badge.svg)](https://github.com/stylelint/stylelint-config-recommended/actions) - -> The recommended shareable config for Stylelint. - -It turns on most of the Stylelint rules that help you [_avoid errors_](https://stylelint.io/user-guide/rules/#avoid-errors). - -You can use this as a foundation for your own config, but we suggest most people use our [standard config](https://www.npmjs.com/package/stylelint-config-standard) instead which extends this config and adds a few more rules to enforce common conventions. - -## Installation - -```bash -npm install stylelint-config-recommended --save-dev -``` - -## Usage - -Set your `stylelint` config to: - -```json -{ - "extends": "stylelint-config-recommended" -} -``` - -### Extending the config - -Add a `"rules"` key to your config, then add your overrides and additions there. - -For example, to change the `at-rule-no-unknown` rule to use its `ignoreAtRules` option, turn off the `block-no-empty` rule, and add the `unit-allowed-list` rule: - -```json -{ - "extends": "stylelint-config-recommended", - "rules": { - "at-rule-no-unknown": [ - true, - { - "ignoreAtRules": ["extends"] - } - ], - "block-no-empty": null, - "unit-allowed-list": ["em", "rem", "s"] - } -} -``` - -## [Changelog](CHANGELOG.md) - -## [License](LICENSE) diff --git a/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/index.js b/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/index.js deleted file mode 100644 index 4236def14..000000000 --- a/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/index.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -module.exports = { - rules: { - 'annotation-no-unknown': true, - 'at-rule-no-unknown': true, - 'block-no-empty': true, - 'color-no-invalid-hex': true, - 'comment-no-empty': true, - 'custom-property-no-missing-var-function': true, - 'declaration-block-no-duplicate-custom-properties': true, - 'declaration-block-no-duplicate-properties': [ - true, - { - ignore: ['consecutive-duplicates-with-different-syntaxes'], - }, - ], - 'declaration-block-no-shorthand-property-overrides': true, - 'font-family-no-duplicate-names': true, - 'font-family-no-missing-generic-family-keyword': true, - 'function-calc-no-unspaced-operator': true, - 'function-linear-gradient-no-nonstandard-direction': true, - 'function-no-unknown': true, - 'keyframe-block-no-duplicate-selectors': true, - 'keyframe-declaration-no-important': true, - 'media-feature-name-no-unknown': true, - 'named-grid-areas-no-invalid': true, - 'no-descending-specificity': true, - 'no-duplicate-at-import-rules': true, - 'no-duplicate-selectors': true, - 'no-empty-source': true, - 'no-invalid-double-slash-comments': true, - 'no-invalid-position-at-import-rule': true, - 'no-irregular-whitespace': true, - 'property-no-unknown': true, - 'selector-anb-no-unmatchable': true, - 'selector-pseudo-class-no-unknown': true, - 'selector-pseudo-element-no-unknown': true, - 'selector-type-no-unknown': [ - true, - { - ignore: ['custom-elements'], - }, - ], - 'string-no-newline': true, - 'unit-no-unknown': true, - }, -}; diff --git a/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/package.json b/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/package.json deleted file mode 100644 index f79b711b3..000000000 --- a/node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "stylelint-config-recommended", - "version": "12.0.0", - "description": "Recommended shareable config for Stylelint", - "keywords": [ - "stylelint", - "stylelint-config", - "recommended" - ], - "repository": "stylelint/stylelint-config-recommended", - "license": "MIT", - "author": "Stylelint", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "format": "prettier . --write", - "prepare": "husky install", - "lint:formatting": "prettier . --check", - "lint:js": "eslint . --ignore-path .gitignore", - "lint:md": "remark . --quiet --frail --ignore-path .gitignore", - "lint": "npm-run-all --parallel lint:*", - "release": "np", - "pretest": "npm run lint", - "test": "jest", - "watch": "jest --watch" - }, - "lint-staged": { - "*.js": "eslint --cache --fix", - "*.{js,md,yml}": "prettier --write" - }, - "prettier": "@stylelint/prettier-config", - "eslintConfig": { - "extends": [ - "stylelint", - "stylelint/jest" - ], - "globals": { - "module": true, - "require": true - } - }, - "remarkConfig": { - "plugins": [ - "@stylelint/remark-preset" - ] - }, - "devDependencies": { - "@stylelint/prettier-config": "^2.0.0", - "@stylelint/remark-preset": "^4.0.0", - "eslint": "^8.38.0", - "eslint-config-stylelint": "^18.0.0", - "eslint-plugin-jest": "^27.2.1", - "husky": "^8.0.3", - "jest": "^29.5.0", - "lint-staged": "^13.2.1", - "np": "^7.7.0", - "npm-run-all": "^4.1.5", - "prettier": "^2.8.7", - "remark-cli": "^11.0.0", - "stylelint": "^15.5.0" - }, - "peerDependencies": { - "stylelint": "^15.5.0" - } -} diff --git a/node_modules/stylelint-config-recommended-scss/package.json b/node_modules/stylelint-config-recommended-scss/package.json deleted file mode 100644 index 82408014e..000000000 --- a/node_modules/stylelint-config-recommended-scss/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "stylelint-config-recommended-scss", - "version": "12.0.0", - "description": "The recommended shareable SCSS config for Stylelint", - "keywords": [ - "stylelint", - "stylelint-config", - "recommended", - "scss" - ], - "repository": "stylelint-scss/stylelint-config-recommended-scss", - "license": "MIT", - "author": "kristerkari", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "format": "prettier . --write", - "lint": "npm-run-all --parallel lint:*", - "lint:formatting": "prettier . --check", - "lint:js": "eslint . --ignore-path .gitignore", - "lint:md": "remark . --quiet --frail --ignore-path .gitignore", - "release": "np", - "test": "jest", - "watch": "jest --watch" - }, - "dependencies": { - "postcss-scss": "^4.0.6", - "stylelint-config-recommended": "^12.0.0", - "stylelint-scss": "^5.0.0" - }, - "devDependencies": { - "@stylelint/prettier-config": "^2.0.0", - "@stylelint/remark-preset": "^4.0.0", - "eslint": "^8.39.0", - "eslint-config-stylelint": "^18.0.0", - "eslint-plugin-jest": "^27.2.1", - "jest": "^29.5.0", - "np": "^7.7.0", - "npm-run-all2": "^5.0.2", - "prettier": "^2.8.8", - "remark-cli": "^11.0.0", - "stylelint": "^15.6.1" - }, - "peerDependencies": { - "postcss": "^8.3.3", - "stylelint": "^15.5.0" - }, - "peerDependenciesMeta": { - "postcss": { - "optional": true - } - } -} diff --git a/node_modules/stylelint-config-recommended/LICENSE b/node_modules/stylelint-config-recommended/LICENSE deleted file mode 100644 index fb97970a4..000000000 --- a/node_modules/stylelint-config-recommended/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 - present stylelint - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/stylelint-config-recommended/README.md b/node_modules/stylelint-config-recommended/README.md deleted file mode 100644 index a9b722bb8..000000000 --- a/node_modules/stylelint-config-recommended/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# stylelint-config-recommended - -[![NPM version](https://img.shields.io/npm/v/stylelint-config-recommended.svg)](https://www.npmjs.org/package/stylelint-config-recommended) [![Build Status](https://github.com/stylelint/stylelint-config-recommended/workflows/CI/badge.svg)](https://github.com/stylelint/stylelint-config-recommended/actions) - -> The recommended shareable config for Stylelint. - -It turns on most of the Stylelint rules that help you [_avoid errors_](https://stylelint.io/user-guide/rules/#avoid-errors). - -You can use this as a foundation for your own config, but we suggest most people use our [standard config](https://www.npmjs.com/package/stylelint-config-standard) instead which extends this config and adds a few more rules to enforce common conventions. - -## Installation - -```bash -npm install stylelint-config-recommended --save-dev -``` - -## Usage - -Set your `stylelint` config to: - -```json -{ - "extends": "stylelint-config-recommended" -} -``` - -### Extending the config - -Add a `"rules"` key to your config, then add your overrides and additions there. - -For example, to change the `at-rule-no-unknown` rule to use its `ignoreAtRules` option, turn off the `block-no-empty` rule, and add the `unit-allowed-list` rule: - -```json -{ - "extends": "stylelint-config-recommended", - "rules": { - "at-rule-no-unknown": [ - true, - { - "ignoreAtRules": ["extends"] - } - ], - "block-no-empty": null, - "unit-allowed-list": ["em", "rem", "s"] - } -} -``` - -## [Changelog](CHANGELOG.md) - -## [License](LICENSE) diff --git a/node_modules/stylelint-config-recommended/index.js b/node_modules/stylelint-config-recommended/index.js deleted file mode 100644 index 71feb593d..000000000 --- a/node_modules/stylelint-config-recommended/index.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -module.exports = { - rules: { - 'annotation-no-unknown': true, - 'at-rule-no-unknown': true, - 'block-no-empty': true, - 'color-no-invalid-hex': true, - 'comment-no-empty': true, - 'custom-property-no-missing-var-function': true, - 'declaration-block-no-duplicate-custom-properties': true, - 'declaration-block-no-duplicate-properties': [ - true, - { - ignore: ['consecutive-duplicates-with-different-syntaxes'], - }, - ], - 'declaration-block-no-shorthand-property-overrides': true, - 'font-family-no-duplicate-names': true, - 'font-family-no-missing-generic-family-keyword': true, - 'function-calc-no-unspaced-operator': true, - 'function-linear-gradient-no-nonstandard-direction': true, - 'function-no-unknown': true, - 'keyframe-block-no-duplicate-selectors': true, - 'keyframe-declaration-no-important': true, - 'media-feature-name-no-unknown': true, - 'media-query-no-invalid': true, - 'named-grid-areas-no-invalid': true, - 'no-descending-specificity': true, - 'no-duplicate-at-import-rules': true, - 'no-duplicate-selectors': true, - 'no-empty-source': true, - 'no-invalid-double-slash-comments': true, - 'no-invalid-position-at-import-rule': true, - 'no-irregular-whitespace': true, - 'property-no-unknown': true, - 'selector-anb-no-unmatchable': true, - 'selector-pseudo-class-no-unknown': true, - 'selector-pseudo-element-no-unknown': true, - 'selector-type-no-unknown': [ - true, - { - ignore: ['custom-elements'], - }, - ], - 'string-no-newline': true, - 'unit-no-unknown': true, - }, -}; diff --git a/node_modules/stylelint-config-recommended/package.json b/node_modules/stylelint-config-recommended/package.json deleted file mode 100644 index 311ba1fa9..000000000 --- a/node_modules/stylelint-config-recommended/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "stylelint-config-recommended", - "version": "13.0.0", - "description": "Recommended shareable config for Stylelint", - "keywords": [ - "stylelint", - "stylelint-config", - "recommended" - ], - "repository": "stylelint/stylelint-config-recommended", - "license": "MIT", - "author": "Stylelint", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "format": "prettier . --write", - "prepare": "husky install", - "lint:formatting": "prettier . --check", - "lint:js": "eslint . --ignore-path .gitignore", - "lint:md": "remark . --quiet --frail --ignore-path .gitignore", - "lint": "npm-run-all --parallel lint:*", - "release": "np", - "pretest": "npm run lint", - "test": "jest", - "watch": "jest --watch" - }, - "lint-staged": { - "*.js": "eslint --cache --fix", - "*.{js,md,yml}": "prettier --write" - }, - "prettier": "@stylelint/prettier-config", - "eslintConfig": { - "extends": [ - "stylelint", - "stylelint/jest" - ], - "globals": { - "module": true, - "require": true - } - }, - "remarkConfig": { - "plugins": [ - "@stylelint/remark-preset" - ] - }, - "devDependencies": { - "@stylelint/prettier-config": "^2.0.0", - "@stylelint/remark-preset": "^4.0.0", - "eslint": "^8.43.0", - "eslint-config-stylelint": "^18.0.0", - "eslint-plugin-jest": "^27.2.1", - "husky": "^8.0.3", - "jest": "^29.5.0", - "lint-staged": "^13.2.2", - "np": "^8.0.4", - "npm-run-all": "^4.1.5", - "prettier": "^2.8.8", - "remark-cli": "^11.0.0", - "stylelint": "^15.10.0" - }, - "peerDependencies": { - "stylelint": "^15.10.0" - }, - "engines": { - "node": "^14.13.1 || >=16.0.0" - } -} diff --git a/node_modules/stylelint-config-standard-scss/LICENSE b/node_modules/stylelint-config-standard-scss/LICENSE deleted file mode 100644 index c0e6a9f20..000000000 --- a/node_modules/stylelint-config-standard-scss/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2021 Present stylelint-scss authors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/stylelint-config-standard-scss/README.md b/node_modules/stylelint-config-standard-scss/README.md deleted file mode 100644 index a9ef31d06..000000000 --- a/node_modules/stylelint-config-standard-scss/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# stylelint-config-standard-scss - -[![npm version](https://img.shields.io/npm/v/stylelint-config-standard-scss?logo=npm&logoColor=fff)](https://www.npmjs.com/package/stylelint-config-standard-scss) -[![Build Status](https://img.shields.io/github/actions/workflow/status/stylelint-scss/stylelint-config-standard-scss/test.yml?branch=main&label=tests&logo=github)](https://github.com/stylelint-scss/stylelint-config-standard-scss/actions/workflows/test.yml?query=workflow%3ATests) -[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen)](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github) -[![Downloads per month](https://img.shields.io/npm/dm/stylelint-config-standard-scss)](https://npmcharts.com/compare/stylelint-config-standard-scss) - -> The standard shareable SCSS config for Stylelint. - -This config: - -- extends the [`stylelint-config-standard` shared config](https://github.com/stylelint/stylelint-config-standard) and configures its rules for SCSS -- extends the [`stylelint-config-recommended-scss` shared config](https://github.com/stylelint-scss/stylelint-config-recommended-scss) - -To see the rules that this config uses, please read the [config itself](/index.js). - -## Installation - -```shell -npm install --save-dev stylelint-config-standard-scss -``` - -## Usage - -Set your `stylelint` config to: - -```json -{ - "extends": "stylelint-config-standard-scss" -} -``` - -### Extending the config - -Simply add a `"rules"` key to your config, then add your overrides and additions there. - -For example, to turn off the `scss/dollar-variable-pattern` rule: - -```json -{ - "extends": "stylelint-config-standard-scss", - "rules": { - "scss/dollar-variable-pattern": null - } -} -``` - -## [Changelog](CHANGELOG.md) - -## [License](LICENSE) diff --git a/node_modules/stylelint-config-standard-scss/index.js b/node_modules/stylelint-config-standard-scss/index.js deleted file mode 100644 index 2cf42c66d..000000000 --- a/node_modules/stylelint-config-standard-scss/index.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -module.exports = { - extends: ['stylelint-config-standard', 'stylelint-config-recommended-scss'], - rules: { - 'at-rule-empty-line-before': [ - 'always', - { - except: ['blockless-after-blockless', 'first-nested'], - ignore: ['after-comment'], - ignoreAtRules: ['else'], - }, - ], - 'import-notation': 'string', - 'scss/at-else-closing-brace-newline-after': 'always-last-in-chain', - 'scss/at-else-closing-brace-space-after': 'always-intermediate', - 'scss/at-else-empty-line-before': 'never', - 'scss/at-else-if-parentheses-space-before': 'always', - 'scss/at-function-parentheses-space-before': 'never', - 'scss/at-function-pattern': [ - '^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: 'Expected function name to be kebab-case', - }, - ], - 'scss/at-if-closing-brace-newline-after': 'always-last-in-chain', - 'scss/at-if-closing-brace-space-after': 'always-intermediate', - 'scss/at-mixin-argumentless-call-parentheses': 'never', - 'scss/at-mixin-parentheses-space-before': 'never', - 'scss/at-mixin-pattern': [ - '^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: 'Expected mixin name to be kebab-case', - }, - ], - 'scss/at-rule-conditional-no-parentheses': true, - 'scss/dollar-variable-colon-space-after': 'always', - 'scss/dollar-variable-colon-space-before': 'never', - 'scss/dollar-variable-empty-line-before': [ - 'always', - { - except: ['after-dollar-variable', 'first-nested'], - ignore: ['after-comment', 'inside-single-line-block'], - }, - ], - 'scss/dollar-variable-pattern': [ - '^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: 'Expected variable to be kebab-case', - }, - ], - 'scss/double-slash-comment-empty-line-before': [ - 'always', - { - except: ['first-nested'], - ignore: ['between-comments', 'stylelint-commands'], - }, - ], - 'scss/double-slash-comment-whitespace-inside': 'always', - 'scss/percent-placeholder-pattern': [ - '^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: 'Expected placeholder to be kebab-case', - }, - ], - }, -}; diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/LICENSE b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/LICENSE deleted file mode 100644 index fb97970a4..000000000 --- a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 - present stylelint - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/README.md b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/README.md deleted file mode 100644 index a9b722bb8..000000000 --- a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# stylelint-config-recommended - -[![NPM version](https://img.shields.io/npm/v/stylelint-config-recommended.svg)](https://www.npmjs.org/package/stylelint-config-recommended) [![Build Status](https://github.com/stylelint/stylelint-config-recommended/workflows/CI/badge.svg)](https://github.com/stylelint/stylelint-config-recommended/actions) - -> The recommended shareable config for Stylelint. - -It turns on most of the Stylelint rules that help you [_avoid errors_](https://stylelint.io/user-guide/rules/#avoid-errors). - -You can use this as a foundation for your own config, but we suggest most people use our [standard config](https://www.npmjs.com/package/stylelint-config-standard) instead which extends this config and adds a few more rules to enforce common conventions. - -## Installation - -```bash -npm install stylelint-config-recommended --save-dev -``` - -## Usage - -Set your `stylelint` config to: - -```json -{ - "extends": "stylelint-config-recommended" -} -``` - -### Extending the config - -Add a `"rules"` key to your config, then add your overrides and additions there. - -For example, to change the `at-rule-no-unknown` rule to use its `ignoreAtRules` option, turn off the `block-no-empty` rule, and add the `unit-allowed-list` rule: - -```json -{ - "extends": "stylelint-config-recommended", - "rules": { - "at-rule-no-unknown": [ - true, - { - "ignoreAtRules": ["extends"] - } - ], - "block-no-empty": null, - "unit-allowed-list": ["em", "rem", "s"] - } -} -``` - -## [Changelog](CHANGELOG.md) - -## [License](LICENSE) diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/index.js b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/index.js deleted file mode 100644 index 4236def14..000000000 --- a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/index.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -module.exports = { - rules: { - 'annotation-no-unknown': true, - 'at-rule-no-unknown': true, - 'block-no-empty': true, - 'color-no-invalid-hex': true, - 'comment-no-empty': true, - 'custom-property-no-missing-var-function': true, - 'declaration-block-no-duplicate-custom-properties': true, - 'declaration-block-no-duplicate-properties': [ - true, - { - ignore: ['consecutive-duplicates-with-different-syntaxes'], - }, - ], - 'declaration-block-no-shorthand-property-overrides': true, - 'font-family-no-duplicate-names': true, - 'font-family-no-missing-generic-family-keyword': true, - 'function-calc-no-unspaced-operator': true, - 'function-linear-gradient-no-nonstandard-direction': true, - 'function-no-unknown': true, - 'keyframe-block-no-duplicate-selectors': true, - 'keyframe-declaration-no-important': true, - 'media-feature-name-no-unknown': true, - 'named-grid-areas-no-invalid': true, - 'no-descending-specificity': true, - 'no-duplicate-at-import-rules': true, - 'no-duplicate-selectors': true, - 'no-empty-source': true, - 'no-invalid-double-slash-comments': true, - 'no-invalid-position-at-import-rule': true, - 'no-irregular-whitespace': true, - 'property-no-unknown': true, - 'selector-anb-no-unmatchable': true, - 'selector-pseudo-class-no-unknown': true, - 'selector-pseudo-element-no-unknown': true, - 'selector-type-no-unknown': [ - true, - { - ignore: ['custom-elements'], - }, - ], - 'string-no-newline': true, - 'unit-no-unknown': true, - }, -}; diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/package.json b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/package.json deleted file mode 100644 index f79b711b3..000000000 --- a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "stylelint-config-recommended", - "version": "12.0.0", - "description": "Recommended shareable config for Stylelint", - "keywords": [ - "stylelint", - "stylelint-config", - "recommended" - ], - "repository": "stylelint/stylelint-config-recommended", - "license": "MIT", - "author": "Stylelint", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "format": "prettier . --write", - "prepare": "husky install", - "lint:formatting": "prettier . --check", - "lint:js": "eslint . --ignore-path .gitignore", - "lint:md": "remark . --quiet --frail --ignore-path .gitignore", - "lint": "npm-run-all --parallel lint:*", - "release": "np", - "pretest": "npm run lint", - "test": "jest", - "watch": "jest --watch" - }, - "lint-staged": { - "*.js": "eslint --cache --fix", - "*.{js,md,yml}": "prettier --write" - }, - "prettier": "@stylelint/prettier-config", - "eslintConfig": { - "extends": [ - "stylelint", - "stylelint/jest" - ], - "globals": { - "module": true, - "require": true - } - }, - "remarkConfig": { - "plugins": [ - "@stylelint/remark-preset" - ] - }, - "devDependencies": { - "@stylelint/prettier-config": "^2.0.0", - "@stylelint/remark-preset": "^4.0.0", - "eslint": "^8.38.0", - "eslint-config-stylelint": "^18.0.0", - "eslint-plugin-jest": "^27.2.1", - "husky": "^8.0.3", - "jest": "^29.5.0", - "lint-staged": "^13.2.1", - "np": "^7.7.0", - "npm-run-all": "^4.1.5", - "prettier": "^2.8.7", - "remark-cli": "^11.0.0", - "stylelint": "^15.5.0" - }, - "peerDependencies": { - "stylelint": "^15.5.0" - } -} diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/LICENSE b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/LICENSE deleted file mode 100644 index 5d3ebd2ba..000000000 --- a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 - present stylelint authors - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/README.md b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/README.md deleted file mode 100644 index 7508154d3..000000000 --- a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/README.md +++ /dev/null @@ -1,128 +0,0 @@ -# stylelint-config-standard - -[![NPM version](https://img.shields.io/npm/v/stylelint-config-standard.svg)](https://www.npmjs.org/package/stylelint-config-standard) [![Build Status](https://github.com/stylelint/stylelint-config-standard/workflows/CI/badge.svg)](https://github.com/stylelint/stylelint-config-standard/actions) - -> The standard shareable config for Stylelint. - -It extends [`stylelint-config-recommended`](https://github.com/stylelint/stylelint-config-recommended) and turns on additional rules to enforce modern conventions found in the [CSS specifications](https://www.w3.org/Style/CSS/current-work). - -To see the rules that this config uses, please read the [config itself](./index.js). - -## Example - -```css -@import url("foo.css"); -@import url("bar.css"); - -@custom-media --foo (min-width: 30em); - -/** - * Multi-line comment - */ - -:root { - --brand-red: hsl(5deg 10% 40%); -} - -/* Single-line comment */ - -.class-foo:not(a, div) { - margin: 0; - top: calc(100% - 2rem); -} - -/* Flush single line comment */ -@media (width >= 60em) { - #id-bar { - /* Flush to parent comment */ - --offset: 0px; - - color: #fff; - font-family: Helvetica, "Arial Black", sans-serif; - left: calc(var(--offset) + 50%); - } - - /* Flush nested single line comment */ - a::after { - display: block; - content: "→"; - background-image: url("x.svg"); - } -} - -@keyframes fade-in { - from { - opacity: 0; - } - - to { - opacity: 1; - } -} -``` - -_Note: the config is tested against this example, as such the example contains plenty of CSS syntax and features._ - -## Installation - -```bash -npm install stylelint-config-standard --save-dev -``` - -## Usage - -Set your Stylelint config to: - -```json -{ - "extends": "stylelint-config-standard" -} -``` - -### Extending the config - -Add a `"rules"` key to your config, then add your overrides and additions there. - -You can turn off rules by setting its value to `null`. For example: - -```json -{ - "extends": "stylelint-config-standard", - "rules": { - "selector-class-pattern": null - } -} -``` - -Or lower the severity of a rule to a warning using the `severity` secondary option. For example: - -```json -{ - "extends": "stylelint-config-standard", - "rules": { - "property-no-vendor-prefix": [ - true, - { - "severity": "warning" - } - ] - } -} -``` - -Or to add a rule, For example, the `unit-allowed-list` one: - -```json -{ - "extends": "stylelint-config-standard", - "rules": { - "unit-allowed-list": ["em", "rem", "s"] - } -} -``` - -We recommend adding more of [Stylelint's rules](https://stylelint.io/user-guide/rules/) to your config as these rules need to be configured to suit your specific needs. - -## [Changelog](CHANGELOG.md) - -## [License](LICENSE) diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/index.js b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/index.js deleted file mode 100644 index 3f89ae893..000000000 --- a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/index.js +++ /dev/null @@ -1,120 +0,0 @@ -'use strict'; - -module.exports = { - extends: 'stylelint-config-recommended', - rules: { - 'alpha-value-notation': [ - 'percentage', - { - exceptProperties: [ - 'opacity', - 'fill-opacity', - 'flood-opacity', - 'stop-opacity', - 'stroke-opacity', - ], - }, - ], - 'at-rule-empty-line-before': [ - 'always', - { - except: ['blockless-after-same-name-blockless', 'first-nested'], - ignore: ['after-comment'], - }, - ], - 'at-rule-no-vendor-prefix': true, - 'color-function-notation': 'modern', - 'color-hex-length': 'short', - 'comment-empty-line-before': [ - 'always', - { - except: ['first-nested'], - ignore: ['stylelint-commands'], - }, - ], - 'comment-whitespace-inside': 'always', - 'custom-property-empty-line-before': [ - 'always', - { - except: ['after-custom-property', 'first-nested'], - ignore: ['after-comment', 'inside-single-line-block'], - }, - ], - 'custom-media-pattern': [ - '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: (name) => `Expected custom media query name "${name}" to be kebab-case`, - }, - ], - 'custom-property-pattern': [ - '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: (name) => `Expected custom property name "${name}" to be kebab-case`, - }, - ], - 'declaration-block-no-redundant-longhand-properties': true, - 'declaration-block-single-line-max-declarations': 1, - 'declaration-empty-line-before': [ - 'always', - { - except: ['after-declaration', 'first-nested'], - ignore: ['after-comment', 'inside-single-line-block'], - }, - ], - 'font-family-name-quotes': 'always-where-recommended', - 'function-name-case': 'lower', - 'function-url-quotes': 'always', - 'hue-degree-notation': 'angle', - 'import-notation': 'url', - 'keyframe-selector-notation': 'percentage-unless-within-keyword-only-block', - 'keyframes-name-pattern': [ - '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: (name) => `Expected keyframe name "${name}" to be kebab-case`, - }, - ], - 'length-zero-no-unit': [ - true, - { - ignore: ['custom-properties'], - }, - ], - 'media-feature-name-no-vendor-prefix': true, - 'media-feature-range-notation': 'context', - 'number-max-precision': 4, - 'property-no-vendor-prefix': true, - 'rule-empty-line-before': [ - 'always-multi-line', - { - except: ['first-nested'], - ignore: ['after-comment'], - }, - ], - 'selector-attribute-quotes': 'always', - 'selector-class-pattern': [ - '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: (selector) => `Expected class selector "${selector}" to be kebab-case`, - }, - ], - 'selector-id-pattern': [ - '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: (selector) => `Expected id selector "${selector}" to be kebab-case`, - }, - ], - 'selector-no-vendor-prefix': true, - 'selector-not-notation': 'complex', - 'selector-pseudo-element-colon-notation': 'double', - 'selector-type-case': 'lower', - 'shorthand-property-no-redundant-values': true, - 'value-keyword-case': 'lower', - 'value-no-vendor-prefix': [ - true, - { - // `-webkit-box` is allowed as standard. See https://www.w3.org/TR/css-overflow-3/#webkit-line-clamp - ignoreValues: ['box', 'inline-box'], - }, - ], - }, -}; diff --git a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/package.json b/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/package.json deleted file mode 100644 index e66f1b1ef..000000000 --- a/node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "stylelint-config-standard", - "version": "33.0.0", - "description": "Standard shareable config for Stylelint", - "keywords": [ - "stylelint", - "stylelint-config", - "standard" - ], - "repository": "stylelint/stylelint-config-standard", - "license": "MIT", - "author": "Stylelint", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "format": "prettier . --write", - "prepare": "husky install", - "lint:formatting": "prettier . --check", - "lint:js": "eslint . --ignore-path .gitignore", - "lint:md": "remark . --quiet --frail --ignore-path .gitignore", - "lint": "npm-run-all --parallel lint:*", - "release": "np", - "pretest": "npm run lint", - "test": "jest", - "watch": "jest --watch" - }, - "lint-staged": { - "*.js": "eslint --cache --fix", - "*.{js,md,yml}": "prettier --write" - }, - "prettier": "@stylelint/prettier-config", - "eslintConfig": { - "extends": [ - "stylelint", - "stylelint/jest" - ], - "globals": { - "module": true, - "require": true - } - }, - "remarkConfig": { - "plugins": [ - "@stylelint/remark-preset" - ] - }, - "dependencies": { - "stylelint-config-recommended": "^12.0.0" - }, - "devDependencies": { - "@stylelint/prettier-config": "^2.0.0", - "@stylelint/remark-preset": "^4.0.0", - "eslint": "^8.38.0", - "eslint-config-stylelint": "^18.0.0", - "eslint-plugin-jest": "^27.2.1", - "husky": "^8.0.3", - "jest": "^29.5.0", - "lint-staged": "^13.2.1", - "np": "^7.7.0", - "npm-run-all": "^4.1.5", - "prettier": "^2.8.7", - "remark-cli": "^11.0.0", - "stylelint": "^15.5.0" - }, - "peerDependencies": { - "stylelint": "^15.5.0" - } -} diff --git a/node_modules/stylelint-config-standard-scss/package.json b/node_modules/stylelint-config-standard-scss/package.json deleted file mode 100644 index d1a475355..000000000 --- a/node_modules/stylelint-config-standard-scss/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "stylelint-config-standard-scss", - "version": "10.0.0", - "description": "The standard shareable SCSS config for Stylelint", - "keywords": [ - "stylelint", - "stylelint-config", - "standard", - "scss" - ], - "repository": "stylelint-scss/stylelint-config-standard-scss", - "license": "MIT", - "author": "Stylelint SCSS", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "format": "prettier . --write", - "lint": "npm-run-all --parallel lint:*", - "lint:formatting": "prettier . --check", - "lint:js": "eslint . --ignore-path .gitignore", - "lint:md": "remark . --quiet --frail --ignore-path .gitignore", - "release": "np", - "test": "jest", - "watch": "jest --watch" - }, - "dependencies": { - "stylelint-config-recommended-scss": "^12.0.0", - "stylelint-config-standard": "^33.0.0" - }, - "devDependencies": { - "@stylelint/prettier-config": "^2.0.0", - "@stylelint/remark-preset": "^4.0.0", - "eslint": "^8.41.0", - "eslint-config-stylelint": "^18.0.0", - "eslint-plugin-jest": "^27.2.1", - "jest": "^29.5.0", - "np": "^8.0.2", - "npm-run-all2": "^5.0.2", - "prettier": "^2.8.8", - "remark-cli": "^11.0.0", - "stylelint": "^15.6.2" - }, - "peerDependencies": { - "postcss": "^8.3.3", - "stylelint": "^15.5.0" - }, - "peerDependenciesMeta": { - "postcss": { - "optional": true - } - } -} diff --git a/node_modules/stylelint-config-standard/LICENSE b/node_modules/stylelint-config-standard/LICENSE deleted file mode 100644 index 5d3ebd2ba..000000000 --- a/node_modules/stylelint-config-standard/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 - present stylelint authors - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/stylelint-config-standard/README.md b/node_modules/stylelint-config-standard/README.md deleted file mode 100644 index 7508154d3..000000000 --- a/node_modules/stylelint-config-standard/README.md +++ /dev/null @@ -1,128 +0,0 @@ -# stylelint-config-standard - -[![NPM version](https://img.shields.io/npm/v/stylelint-config-standard.svg)](https://www.npmjs.org/package/stylelint-config-standard) [![Build Status](https://github.com/stylelint/stylelint-config-standard/workflows/CI/badge.svg)](https://github.com/stylelint/stylelint-config-standard/actions) - -> The standard shareable config for Stylelint. - -It extends [`stylelint-config-recommended`](https://github.com/stylelint/stylelint-config-recommended) and turns on additional rules to enforce modern conventions found in the [CSS specifications](https://www.w3.org/Style/CSS/current-work). - -To see the rules that this config uses, please read the [config itself](./index.js). - -## Example - -```css -@import url("foo.css"); -@import url("bar.css"); - -@custom-media --foo (min-width: 30em); - -/** - * Multi-line comment - */ - -:root { - --brand-red: hsl(5deg 10% 40%); -} - -/* Single-line comment */ - -.class-foo:not(a, div) { - margin: 0; - top: calc(100% - 2rem); -} - -/* Flush single line comment */ -@media (width >= 60em) { - #id-bar { - /* Flush to parent comment */ - --offset: 0px; - - color: #fff; - font-family: Helvetica, "Arial Black", sans-serif; - left: calc(var(--offset) + 50%); - } - - /* Flush nested single line comment */ - a::after { - display: block; - content: "→"; - background-image: url("x.svg"); - } -} - -@keyframes fade-in { - from { - opacity: 0; - } - - to { - opacity: 1; - } -} -``` - -_Note: the config is tested against this example, as such the example contains plenty of CSS syntax and features._ - -## Installation - -```bash -npm install stylelint-config-standard --save-dev -``` - -## Usage - -Set your Stylelint config to: - -```json -{ - "extends": "stylelint-config-standard" -} -``` - -### Extending the config - -Add a `"rules"` key to your config, then add your overrides and additions there. - -You can turn off rules by setting its value to `null`. For example: - -```json -{ - "extends": "stylelint-config-standard", - "rules": { - "selector-class-pattern": null - } -} -``` - -Or lower the severity of a rule to a warning using the `severity` secondary option. For example: - -```json -{ - "extends": "stylelint-config-standard", - "rules": { - "property-no-vendor-prefix": [ - true, - { - "severity": "warning" - } - ] - } -} -``` - -Or to add a rule, For example, the `unit-allowed-list` one: - -```json -{ - "extends": "stylelint-config-standard", - "rules": { - "unit-allowed-list": ["em", "rem", "s"] - } -} -``` - -We recommend adding more of [Stylelint's rules](https://stylelint.io/user-guide/rules/) to your config as these rules need to be configured to suit your specific needs. - -## [Changelog](CHANGELOG.md) - -## [License](LICENSE) diff --git a/node_modules/stylelint-config-standard/index.js b/node_modules/stylelint-config-standard/index.js deleted file mode 100644 index 3f89ae893..000000000 --- a/node_modules/stylelint-config-standard/index.js +++ /dev/null @@ -1,120 +0,0 @@ -'use strict'; - -module.exports = { - extends: 'stylelint-config-recommended', - rules: { - 'alpha-value-notation': [ - 'percentage', - { - exceptProperties: [ - 'opacity', - 'fill-opacity', - 'flood-opacity', - 'stop-opacity', - 'stroke-opacity', - ], - }, - ], - 'at-rule-empty-line-before': [ - 'always', - { - except: ['blockless-after-same-name-blockless', 'first-nested'], - ignore: ['after-comment'], - }, - ], - 'at-rule-no-vendor-prefix': true, - 'color-function-notation': 'modern', - 'color-hex-length': 'short', - 'comment-empty-line-before': [ - 'always', - { - except: ['first-nested'], - ignore: ['stylelint-commands'], - }, - ], - 'comment-whitespace-inside': 'always', - 'custom-property-empty-line-before': [ - 'always', - { - except: ['after-custom-property', 'first-nested'], - ignore: ['after-comment', 'inside-single-line-block'], - }, - ], - 'custom-media-pattern': [ - '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: (name) => `Expected custom media query name "${name}" to be kebab-case`, - }, - ], - 'custom-property-pattern': [ - '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: (name) => `Expected custom property name "${name}" to be kebab-case`, - }, - ], - 'declaration-block-no-redundant-longhand-properties': true, - 'declaration-block-single-line-max-declarations': 1, - 'declaration-empty-line-before': [ - 'always', - { - except: ['after-declaration', 'first-nested'], - ignore: ['after-comment', 'inside-single-line-block'], - }, - ], - 'font-family-name-quotes': 'always-where-recommended', - 'function-name-case': 'lower', - 'function-url-quotes': 'always', - 'hue-degree-notation': 'angle', - 'import-notation': 'url', - 'keyframe-selector-notation': 'percentage-unless-within-keyword-only-block', - 'keyframes-name-pattern': [ - '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: (name) => `Expected keyframe name "${name}" to be kebab-case`, - }, - ], - 'length-zero-no-unit': [ - true, - { - ignore: ['custom-properties'], - }, - ], - 'media-feature-name-no-vendor-prefix': true, - 'media-feature-range-notation': 'context', - 'number-max-precision': 4, - 'property-no-vendor-prefix': true, - 'rule-empty-line-before': [ - 'always-multi-line', - { - except: ['first-nested'], - ignore: ['after-comment'], - }, - ], - 'selector-attribute-quotes': 'always', - 'selector-class-pattern': [ - '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: (selector) => `Expected class selector "${selector}" to be kebab-case`, - }, - ], - 'selector-id-pattern': [ - '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$', - { - message: (selector) => `Expected id selector "${selector}" to be kebab-case`, - }, - ], - 'selector-no-vendor-prefix': true, - 'selector-not-notation': 'complex', - 'selector-pseudo-element-colon-notation': 'double', - 'selector-type-case': 'lower', - 'shorthand-property-no-redundant-values': true, - 'value-keyword-case': 'lower', - 'value-no-vendor-prefix': [ - true, - { - // `-webkit-box` is allowed as standard. See https://www.w3.org/TR/css-overflow-3/#webkit-line-clamp - ignoreValues: ['box', 'inline-box'], - }, - ], - }, -}; diff --git a/node_modules/stylelint-config-standard/package.json b/node_modules/stylelint-config-standard/package.json deleted file mode 100644 index e2404b385..000000000 --- a/node_modules/stylelint-config-standard/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "stylelint-config-standard", - "version": "34.0.0", - "description": "Standard shareable config for Stylelint", - "keywords": [ - "stylelint", - "stylelint-config", - "standard" - ], - "repository": "stylelint/stylelint-config-standard", - "license": "MIT", - "author": "Stylelint", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "format": "prettier . --write", - "prepare": "husky install", - "lint:formatting": "prettier . --check", - "lint:js": "eslint . --ignore-path .gitignore", - "lint:md": "remark . --quiet --frail --ignore-path .gitignore", - "lint": "npm-run-all --parallel lint:*", - "release": "np", - "pretest": "npm run lint", - "test": "jest", - "watch": "jest --watch" - }, - "lint-staged": { - "*.js": "eslint --cache --fix", - "*.{js,md,yml}": "prettier --write" - }, - "prettier": "@stylelint/prettier-config", - "eslintConfig": { - "extends": [ - "stylelint", - "stylelint/jest" - ], - "globals": { - "module": true, - "require": true - } - }, - "remarkConfig": { - "plugins": [ - "@stylelint/remark-preset" - ] - }, - "dependencies": { - "stylelint-config-recommended": "^13.0.0" - }, - "devDependencies": { - "@stylelint/prettier-config": "^2.0.0", - "@stylelint/remark-preset": "^4.0.0", - "eslint": "^8.43.0", - "eslint-config-stylelint": "^18.0.0", - "eslint-plugin-jest": "^27.2.1", - "husky": "^8.0.3", - "jest": "^29.5.0", - "lint-staged": "^13.2.2", - "np": "^8.0.4", - "npm-run-all": "^4.1.5", - "prettier": "^2.8.8", - "remark-cli": "^11.0.0", - "stylelint": "^15.10.0" - }, - "peerDependencies": { - "stylelint": "^15.10.0" - }, - "engines": { - "node": "^14.13.1 || >=16.0.0" - } -} diff --git a/node_modules/stylelint-scss/LICENSE b/node_modules/stylelint-scss/LICENSE deleted file mode 100644 index 9f82c82e4..000000000 --- a/node_modules/stylelint-scss/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Krister Kari - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/stylelint-scss/README.md b/node_modules/stylelint-scss/README.md deleted file mode 100644 index d0e948cfb..000000000 --- a/node_modules/stylelint-scss/README.md +++ /dev/null @@ -1,359 +0,0 @@ -# stylelint-scss - -[![npm version](https://img.shields.io/npm/v/stylelint-scss?logo=npm&logoColor=fff)](https://www.npmjs.com/package/stylelint-scss) -[![Build Status](https://img.shields.io/github/actions/workflow/status/stylelint-scss/stylelint-scss/test.yml?branch=master&label=tests&logo=github)](https://github.com/stylelint-scss/stylelint-scss/actions/workflows/test.yml?query=workflow%3ATests) -[![Coverage Status](https://img.shields.io/coveralls/github/stylelint-scss/stylelint-scss/master?logo=coveralls&logoColor=fff)](https://coveralls.io/github/stylelint-scss/stylelint-scss?branch=master) -[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen)](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github) -[![Downloads per month](https://img.shields.io/npm/dm/stylelint-scss)](https://npmcharts.com/compare/stylelint-scss) - -A collection of SCSS-specific linting rules for [Stylelint](https://github.com/stylelint/stylelint) (in a form of a plugin). - -## Purpose - -Stylelint by itself supports [SCSS syntax](https://stylelint.io/user-guide/get-started) very well (as well as other preprocessors' syntaxes). Moreover, it introduces some specific rules that can be used to lint SCSS, e.g. to limit [`nesting`](https://stylelint.io/user-guide/rules/max-nesting-depth), control the way [`@-rules`](https://stylelint.io/user-guide/rules#at-rule) are written. Yet Stylelint is in general focused on standard CSS. - -stylelint-scss introduces rules specific to SCSS syntax. That said, the rules from this plugin can be used with other syntaxes, like Less or some PostCSS syntaxes. That's why the rules' names are not tied to SCSS only (`at-function-pattern` instead of `scss-function-pattern`). - -The plugin follows Stylelint's guidelines (about [rule names](https://stylelint.io/user-guide/rules), testing and [so on](https://github.com/stylelint/stylelint/tree/main/docs/developer-guide)). - -## Installation and usage - -This plugin is used in the [stylelint-config-standard-scss shared config](https://github.com/stylelint-scss/stylelint-config-standard-scss). We recommend using that shared config, rather than installing this plugin directly. - -However, the plugin can still be used in you're crafting a config from the ground up. First, install `stylelint-scss` (and `stylelint`, if you haven't done so yet) via npm: - -```sh -npm install stylelint stylelint-scss -``` - -Create the `.stylelintrc.json` config file (or open the existing one), add `stylelint-scss` to the plugins array and the rules you need to the rules list. All rules from stylelint-scss need to be namespaced with `scss`. - -```jsonc -{ - "plugins": [ - "stylelint-scss" - ], - "rules": { - // recommended rules - "at-rule-no-unknown": null, - "scss/at-rule-no-unknown": true, - // ... - // any other rules you'd want to change e.g. - "scss/dollar-variable-pattern": "^foo", - "scss/selector-no-redundant-nesting-selector": true - } -} -``` - -Please refer to [Stylelint docs](https://stylelint.io/user-guide/get-started) for detailed info on using this linter. - -## List of rules - -Here are stylelint-scss' rules, grouped by the _thing_ they apply to (just like in [Stylelint](https://stylelint.io/user-guide/rules)). - -Please also see the [example configs](./docs/examples/) for special cases. - -### `@`-each - -- [`at-each-key-value-single-line`](./src/rules/at-each-key-value-single-line/README.md): This is a rule that checks for situations where users have done a loop using map-keys or map.keys and grabbed the value for that key inside of the loop. - -### `@`-else - -- [`at-else-closing-brace-newline-after`](./src/rules/at-else-closing-brace-newline-after/README.md): Require or disallow a newline after the closing brace of `@else` statements (Autofixable). -- [`at-else-closing-brace-space-after`](./src/rules/at-else-closing-brace-space-after/README.md): Require a single space or disallow whitespace after the closing brace of `@else` statements (Autofixable). -- [`at-else-empty-line-before`](./src/rules/at-else-empty-line-before/README.md): Require an empty line or disallow empty lines before `@`-else (Autofixable). -- [`at-else-if-parentheses-space-before`](./src/rules/at-else-if-parentheses-space-before/README.md): Require or disallow a space before `@else if` parentheses (Autofixable). - -### `@`-extend - -- [`at-extend-no-missing-placeholder`](./src/rules/at-extend-no-missing-placeholder/README.md): Disallow at-extends (`@extend`) with missing placeholders. - -### `@`-function - -- [`at-function-named-arguments`](./src/rules/at-function-named-arguments/README.md): Require named parameters in SCSS function call rule. -- [`at-function-parentheses-space-before`](./src/rules/at-function-parentheses-space-before/README.md): Require or disallow a space before `@function` parentheses (Autofixable). -- [`at-function-pattern`](./src/rules/at-function-pattern/README.md): Specify a pattern for Sass/SCSS-like function names. - -### `@`-if - -- [`at-if-closing-brace-newline-after`](./src/rules/at-if-closing-brace-newline-after/README.md): Require or disallow a newline after the closing brace of `@if` statements (Autofixable). -- [`at-if-closing-brace-space-after`](./src/rules/at-if-closing-brace-space-after/README.md): Require a single space or disallow whitespace after the closing brace of `@if` statements (Autofixable). -- [`at-if-no-null`](./src/rules/at-if-no-null/README.md): Disallow `null` in `@if` statements. - -### `@`-import - -- [`at-import-no-partial-leading-underscore`](./src/rules/at-import-no-partial-leading-underscore/README.md): Disallow leading underscore in partial names in `@import`. -- [`at-import-partial-extension`](./src/rules/at-import-partial-extension/README.md): Require or disallow extension in `@import` commands (Autofixable). -- [`at-import-partial-extension-blacklist`](./src/rules/at-import-partial-extension-blacklist/README.md): Specify a blacklist of disallowed file extensions for partial names in `@import` commands. -- [`at-import-partial-extension-whitelist`](./src/rules/at-import-partial-extension-whitelist/README.md): Specify a whitelist of allowed file extensions for partial names in `@import` commands. - -### `@`-mixin - -- [`at-mixin-argumentless-call-parentheses`](./src/rules/at-mixin-argumentless-call-parentheses/README.md): Require or disallow parentheses in argumentless `@mixin` calls (Autofixable). -- [`at-mixin-named-arguments`](./src/rules/at-mixin-named-arguments/README.md): Require named parameters in at-mixin call rule. -- [`at-mixin-parentheses-space-before`](./src/rules/at-mixin-parentheses-space-before/README.md): Require or disallow a space before `@mixin` parentheses (Autofixable). -- [`at-mixin-pattern`](./src/rules/at-mixin-pattern/README.md): Specify a pattern for Sass/SCSS-like mixin names. - -### `@`-rule - -- [`at-rule-conditional-no-parentheses`](./src/rules/at-rule-conditional-no-parentheses/README.md): Disallow parentheses in conditional @ rules (if, elsif, while) (Autofixable). -- [`at-rule-no-unknown`](./src/rules/at-rule-no-unknown/README.md): Disallow unknown at-rules. Should be used **instead of** Stylelint's [at-rule-no-unknown](https://stylelint.io/user-guide/rules/at-rule-no-unknown). - -### `@`-use - -- [`at-use-no-unnamespaced`](./src/rules/at-use-no-unnamespaced/README.md): Disallow `@use` without a namespace (i.e. `@use "..." as *`). - -### `$`-variable - -- [`dollar-variable-colon-newline-after`](./src/rules/dollar-variable-colon-newline-after/README.md): Require a newline after the colon in `$`-variable declarations (Autofixable). -- [`dollar-variable-colon-space-after`](./src/rules/dollar-variable-colon-space-after/README.md): Require or disallow whitespace after the colon in `$`-variable declarations (Autofixable). -- [`dollar-variable-colon-space-before`](./src/rules/dollar-variable-colon-space-before/README.md): Require a single space or disallow whitespace before the colon in `$`-variable declarations (Autofixable). -- [`dollar-variable-default`](./src/rules/dollar-variable-default/README.md): Require `!default` flag for `$`-variable declarations. -- [`dollar-variable-empty-line-after`](./src/rules/dollar-variable-empty-line-after/README.md): Require a single empty line or disallow empty lines after `$`-variable declarations (Autofixable). -- [`dollar-variable-empty-line-before`](./src/rules/dollar-variable-empty-line-before/README.md): Require a single empty line or disallow empty lines before `$`-variable declarations (Autofixable). -- [`dollar-variable-first-in-block`](./src/rules/dollar-variable-first-in-block/README.md): Require for variables to be put first in a block (a rule or in root). -- [`dollar-variable-no-missing-interpolation`](./src/rules/dollar-variable-no-missing-interpolation/README.md): Disallow Sass variables that are used without interpolation with CSS features that use custom identifiers. -- [`dollar-variable-no-namespaced-assignment`](./src/rules/dollar-variable-no-namespaced-assignment/README.md): Disallow assignment to namespaced Sass variables. -- [`dollar-variable-pattern`](./src/rules/dollar-variable-pattern/README.md): Specify a pattern for Sass-like variables. - -### `%`-placeholder - -- [`percent-placeholder-pattern`](./src/rules/percent-placeholder-pattern/README.md): Specify a pattern for `%`-placeholders. - -### `//`-comment - -- [`double-slash-comment-empty-line-before`](./src/rules/double-slash-comment-empty-line-before/README.md): Require or disallow an empty line before `//`-comments (Autofixable). -- [`double-slash-comment-inline`](./src/rules/double-slash-comment-inline/README.md): Require or disallow `//`-comments to be inline comments. -- [`double-slash-comment-whitespace-inside`](./src/rules/double-slash-comment-whitespace-inside/README.md): Require or disallow whitespace after the `//` in `//`-comments - -### Comment - -- [`comment-no-empty`](./src/rules/comment-no-empty/README.md): Disallow empty comments. -- [`comment-no-loud`](./src/rules/comment-no-loud/README.md): Disallow `/*`-comments. - -### Declaration - -- [`declaration-nested-properties`](./src/rules/declaration-nested-properties/README.md): Require or disallow properties with `-` in their names to be in a form of a nested group. -- [`declaration-nested-properties-no-divided-groups`](./src/rules/declaration-nested-properties-no-divided-groups/README.md): Disallow nested properties of the same "namespace" to be divided into multiple groups. - -### Dimension - -- [`dimension-no-non-numeric-values`](./src/rules/dimension-no-non-numeric-values/README.md): Disallow non-numeric values when interpolating a value with a unit. - -### Function - -- [`function-color-relative`](./src/rules/function-color-relative/README.md): Encourage the use of the [scale-color](https://sass-lang.com/documentation/modules/color#scale-color) function over regular color functions. -- [`function-no-unknown`](./src/rules/function-no-unknown/README.md): Disallow unknown functions. Should be used **instead of** Stylelint's [function-no-unknown](https://stylelint.io/user-guide/rules/list/at-rule-no-unknown). -- [`function-quote-no-quoted-strings-inside`](./src/rules/function-quote-no-quoted-strings-inside/README.md): Disallow quoted strings inside the [quote function](https://sass-lang.com/documentation/modules/string#quote) (Autofixable). -- [`function-unquote-no-unquoted-strings-inside`](./src/rules/function-unquote-no-unquoted-strings-inside/README.md): Disallow unquoted strings inside the [unquote function](https://sass-lang.com/documentation/modules/string#unquote) (Autofixable). - -### Map - -- [`map-keys-quotes`](./src/rules/map-keys-quotes/README.md): Require quoted keys in Sass maps. - -### Media feature - -- [`media-feature-value-dollar-variable`](./src/rules/media-feature-value-dollar-variable/README.md): Require a media feature value be a `$`-variable or disallow `$`-variables in media feature values. - -### Operator - -- [`operator-no-newline-after`](./src/rules/operator-no-newline-after/README.md): Disallow linebreaks after Sass operators. -- [`operator-no-newline-before`](./src/rules/operator-no-newline-before/README.md): Disallow linebreaks before Sass operators. -- [`operator-no-unspaced`](./src/rules/operator-no-unspaced/README.md): Disallow unspaced operators in Sass operations. - -### Partial - -- [`partial-no-import`](./src/rules/partial-no-import/README.md): Disallow non-CSS `@import`s in partial files. - -### Selector - -- [`selector-nest-combinators`](./src/rules/selector-nest-combinators/README.md): Require or disallow nesting of combinators in selectors. -- [`selector-no-redundant-nesting-selector`](./src/rules/selector-no-redundant-nesting-selector/README.md): Disallow redundant nesting selectors (`&`). -- [`selector-no-union-class-name`](./src/rules/selector-no-union-class-name/README.md): Disallow union class names with the parent selector (`&`). - -### General / Sheet - -- [`no-dollar-variables`](./src/rules/no-dollar-variables/README.md): Disallow dollar variables within a stylesheet. -- [`no-duplicate-dollar-variables`](./src/rules/no-duplicate-dollar-variables/README.md): Disallow duplicate dollar variables within a stylesheet. -- [`no-duplicate-mixins`](./src/rules/no-duplicate-mixins/README.md): Disallow duplicate mixins within a stylesheet. -- [`no-global-function-names`](./src/rules/no-global-function-names/README.md): Disallows the use of global function names, as these global functions are now located inside built-in Sass modules. - -## Help out - -The work on the plugin's rules is still in progress, so if you feel like it, you're welcome to help out with any of these (the plugin follows Stylelint guidelines so most of this is based on its docs): - -- Create, enhance, and debug rules (see Stylelint's guide to "[Working on rules](https://github.com/stylelint/stylelint/blob/main/docs/developer-guide/rules.md)"). -- Improve documentation. -- Chime in on any open issue or pull request. -- Open new issues about your ideas on new rules, or for how to improve the existing ones, and pull requests to show us how your idea works. -- Add new tests to absolutely anything. -- Work on improving performance of rules. -- Contribute to [Stylelint](https://github.com/stylelint/stylelint) -- Spread the word. - -We communicate via [issues](https://github.com/stylelint-scss/stylelint-scss/issues) and [pull requests](https://github.com/stylelint-scss/stylelint-scss/pulls). - -There is also [StackOverflow](https://stackoverflow.com/questions/tagged/stylelint), which would be the preferred QA forum. - -## Contributors - -Thanks goes to these wonderful people: - - - - - - - - - - - - - - - - - - - - -
kristerkaridryomarambleraptorXhmikosREugenojoseph118
kristerkaridryomarambleraptorXhmikosREugenojoseph118
- - - - - - - - - - - - - - - - - - - -
ybiquitousstofniksykaysonwusrawlinspipopotamasu
ybiquitousstofniksykaysonwusrawlinspipopotamasu
- - - - - - - - - - - - - - - - - - - -
jhae-deOriRntwbricardogobbosouzajeddy3bjankord
jhae-deOriRntwbricardogobbosouzajeddy3bjankord
- - - - - - - - - - - - - - - - - - - -
kevindewthibaudcolasAndyOGochalkygames123xboy2012alexander-akait
kevindewthibaudcolasAndyOGochalkygames123xboy2012alexander-akait
- - - - - - - - - - - - - - - - - - - -
vseventerSterlingVixCalme1709Deimosdiego-codeslithiumlron
vseventerSterlingVixCalme1709Deimosdiego-codeslithiumlron
- - - - - - - - - - - - - - - - - - - -
EvanHahnguoyunhejantimonstormwarningkeegan-lillomanovotny
EvanHahnguoyunhejantimonstormwarningkeegan-lillomanovotny
- - - - - - - - - - - - - - - - - - - -
paulgvsajadtorkamaniYozhikMAM-77kershYodaDaCoda
paulgvsajadtorkamaniYozhikMAM-77kershYodaDaCoda
- - - - - - - - - - - -
freezy-skqmhc
freezy-skqmhc
- -## Important documents - -- [Changelog](./CHANGELOG.md) -- [Contributing](./CONTRIBUTING.md) -- [License](./LICENSE) diff --git a/node_modules/stylelint-scss/package.json b/node_modules/stylelint-scss/package.json deleted file mode 100644 index 486c360b5..000000000 --- a/node_modules/stylelint-scss/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "stylelint-scss", - "description": "A collection of SCSS-specific rules for Stylelint", - "version": "5.0.1", - "author": "Krister Kari", - "repository": "stylelint-scss/stylelint-scss", - "license": "MIT", - "main": "src/index.js", - "peerDependencies": { - "stylelint": "^14.5.1 || ^15.0.0" - }, - "dependencies": { - "postcss-media-query-parser": "^0.2.3", - "postcss-resolve-nested-selector": "^0.1.1", - "postcss-selector-parser": "^6.0.13", - "postcss-value-parser": "^4.2.0" - }, - "devDependencies": { - "eslint": "^8.41.0", - "github-contributors-list": "^1.2.5", - "husky": "^8.0.3", - "jest": "^29.5.0", - "jest-cli": "^29.5.0", - "jest-preset-stylelint": "^6.1.0", - "lint-staged": "^13.2.2", - "np": "^8.0.2", - "postcss": "^8.4.24", - "postcss-less": "^6.0.0", - "postcss-scss": "^4.0.6", - "prettier": "^2.8.8", - "stylelint": "^15.7.0" - }, - "files": [ - "src/**/*.js", - "!**/__tests__/**" - ], - "keywords": [ - "css", - "csslint", - "lint", - "linter", - "scss", - "stylelint", - "stylelint-plugin" - ], - "scripts": { - "lint": "eslint . --ignore-path .gitignore", - "prettify": "prettier --write \"src/**/*.js\"", - "pretest": "npm run lint", - "release": "np", - "jest": "jest", - "test": "npm run jest -- --coverage", - "watch": "npm run jest -- --watch", - "test-rule": "npm run jest", - "test-util": "npm run jest", - "generate-contributors-list": "githubcontrib --owner stylelint-scss --repo stylelint-scss --cols 6 --sortOrder desc --filter greenkeeper[bot],dependabot[bot] --showlogin true --imagesize 80 --format html", - "prepare": "husky install" - } -} diff --git a/node_modules/stylelint-scss/src/index.js b/node_modules/stylelint-scss/src/index.js deleted file mode 100644 index 154a77ac7..000000000 --- a/node_modules/stylelint-scss/src/index.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -const { createPlugin } = require("stylelint"); -const rules = require("./rules"); -const namespace = require("./utils/namespace"); - -const rulesPlugins = Object.keys(rules).map(ruleName => { - return createPlugin(namespace(ruleName), rules[ruleName]); -}); - -module.exports = rulesPlugins; diff --git a/node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/README.md b/node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/README.md deleted file mode 100644 index ead328e0e..000000000 --- a/node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/README.md +++ /dev/null @@ -1,105 +0,0 @@ -# at-each-key-value-single-line - -This is a rule that checks for situations where users have: - -- Done a loop using map-keys -- Grabbed the value for that key inside of the loop. - -```scss -$font-weights: ( - "regular": 400, - "medium": 500, - "bold": 700 -); -@each $key in map-keys($font-weights) { - $value: map-get($font-weights, $key); - /** ↑ - * This call should be consolidated into the @each call. - **/ -} -``` - -## Options - -### `true` - -The following patterns are considered violations: - -```scss -$font-weights: ( - "regular": 400, - "medium": 500, - "bold": 700 -); -@each $key in map-keys($font-weights) { - $value: map-get($font-weights, $key); -} -``` - -```scss -@use 'sass:map'; - -$font-weights: ( - "regular": 400, - "medium": 500, - "bold": 700 -); -@each $key in map.keys($font-weights) { - $value: map.get($font-weights, $key); -} -``` - -The following patterns are _not_ considered violations: - -```scss -$font-weights: ("regular": 400, "medium": 500, "bold": 700); -@each $key, $value in $font-weights {...} -``` - -```scss -$font-weights: ( - "regular": 400, - "medium": 500, - "bold": 700 -); -$other-weights: ( - "regular": 400, - "medium": 500, - "bold": 700 -); - -@each $key, $value in map-keys($font-weights) { - $value: map-get($other-weights, $key); -} -``` - -```scss -@use 'sass:map'; - -$font-weights: ( - "regular": 400, - "medium": 500, - "bold": 700 -); -$other-weights: ( - "regular": 400, - "medium": 500, - "bold": 700 -); - -@each $key, $value in map.keys($font-weights) { - $value: map.get($other-weights, $key); -} -``` - -```scss -$font-weights: ("regular": 400, "medium": 500, "bold": 700); -@each $key, $value in map-keys($font-weights) {...} -``` - -```scss -@use 'sass:map'; - -$font-weights: ("regular": 400, "medium": 500, "bold": 700); -@each $key, $value in map.keys($font-weights) {...} -``` diff --git a/node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/index.js b/node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/index.js deleted file mode 100644 index 855bee834..000000000 --- a/node_modules/stylelint-scss/src/rules/at-each-key-value-single-line/index.js +++ /dev/null @@ -1,128 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const moduleNamespace = require("../../utils/moduleNamespace"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-each-key-value-single-line"); - -const messages = utils.ruleMessages(ruleName, { - expected: - "Use @each $key, $value in $map syntax instead of $value: map-get($map, $key)" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(primary) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: primary - }); - - if (!validOptions) { - return; - } - - const mapNamespace = moduleNamespace(root, "sass:map"); - - root.walkAtRules("each", rule => { - const parts = separateEachParams(rule.params); - - // If loop is fetching both key + value, return - if (parts[0].length === 2) { - return; - } - - // If didn't call map-keys, return. - if (!didCallMapKeys(parts[1], mapNamespace)) { - return; - } - - // Loop over decls inside of each statement and loop for variable assignments. - rule.walkDecls(innerDecl => { - // Check that this decl is a map-get call - if (innerDecl.prop[0] !== "$") { - return; - } - - if (!didCallMapGet(innerDecl.value, mapNamespace)) { - return; - } - - // Check map_name + key_name match. - const map_get_parts = mapGetParameters(innerDecl.value, mapNamespace); - - // Check map names match. - if (map_get_parts[0] !== mapName(parts[1], mapNamespace)) { - return; - } - - // Match key names match. - if (map_get_parts[1] !== parts[0][0]) { - return; - } - - utils.report({ - message: messages.expected, - node: rule, - result, - ruleName, - word: rule.params - }); - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -// Takes in a param string from node.params -// Returns: [[key variable, value variable], map_decl] (all Strings) -function separateEachParams(paramString) { - const parts = paramString.split("in"); - - return [parts[0].split(",").map(s => s.trim()), parts[1].trim()]; -} - -function didCallMapKeys(mapDecl, mapNamespace) { - const pattern = getNamespacedPattern("keys\\(.*\\)", mapNamespace); - - return new RegExp(pattern).test(mapDecl); -} - -function didCallMapGet(mapDecl, mapNamespace) { - const pattern = getNamespacedPattern("get\\((.*),(.*)\\)", mapNamespace); - - return new RegExp(pattern).test(mapDecl); -} - -// Fetch the name of the map from a map-keys() or map.keys() call. -function mapName(mapDecl, mapNamespace) { - if (didCallMapKeys(mapDecl, mapNamespace)) { - const pattern = getNamespacedPattern("keys\\((.*)\\)", mapNamespace); - - return mapDecl.match(new RegExp(pattern))[1]; - } - - return mapDecl; -} - -// Returns the parameters of a map-get or map.get call -// Returns [map variable, key_variable] -function mapGetParameters(mapGetDecl, mapNamespace) { - const pattern = getNamespacedPattern("get\\((.*), ?(.*)\\)", mapNamespace); - const parts = mapGetDecl.match(new RegExp(pattern)); - - return [parts[1], parts[2]]; -} - -function getNamespacedPattern(pattern, namespace) { - return namespace !== null ? `(?:${namespace}\\.|map-)${pattern}` : pattern; -} - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/README.md b/node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/README.md deleted file mode 100644 index 23e2e83bb..000000000 --- a/node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# at-else-closing-brace-newline-after - -Require or disallow a newline after the closing brace of `@else` statements. - -```scss -@if (@a == 0) { - -} @else if (@a == 1){ } -@else { } ↑ -/** ↑ ↑ - * The newline after these braces */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -This rule might have conflicts with Stylelint's core rule [`block-closing-brace-newline-after`](https://stylelint.io/user-guide/rules/block-closing-brace-newline-after) if it doesn't have `"ignoreAtRules": ["else"]` in a `.stylelintrc` config file. That's because an `@else { ... }` statement can be successfully parsed as an at-rule with a block. You might also want to set `"ignoreAtRules": ["else"]` for another Stylelint's core rule - [`at-rule-empty-line-before`](https://stylelint.io/user-guide/rules/at-rule-empty-line-before) that could be forcing empty lines before at-rules (including `@else`s that follow `@if`s or other `@else`s). - -This rule doesn't have usual `"always"` and `"never"` main option values, because if you don't need special behavior for `@if` and `@else` you could just use [`block-closing-brace-newline-after`](https://stylelint.io/user-guide/rules/block-closing-brace-newline-after) set to `"always"` or any other value. - -## Options - -`string`: `"always-last-in-chain"` - -### `"always-last-in-chain"` - -There *must always* be a newline after the closing brace of `@else` that is the last statement in a conditional statement chain (i.e. has no `@else` right after it). If it's not, there *must not* be a newline. - -The following patterns are considered warnings: - -```scss -a { - @if ($x == 1) { - // ... - } @else { - // ... - } width: 10px; // No @else after, so should have a newline -} - -@if ($x == 1) { - // ... -} @else if { } // Has @else after it, so shouldn't have a newline -@else { } -``` - -The following patterns are *not* considered warnings: - -```scss -a { - @if ($x == 1) {} @else {} - width: 10px; -} - -a { - @if ($x == 1) { - // ... - } @else if { - // ... - } @else {} - - width: 10px; -} - -a { - @if ($x == 1) { } @else if { }@else { } - - width: 10px; -} -``` - -## Optional secondary options - -### `disableFix: true` - -Disables autofixing for this rule. diff --git a/node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/index.js b/node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/index.js deleted file mode 100644 index 3d8e98296..000000000 --- a/node_modules/stylelint-scss/src/rules/at-else-closing-brace-newline-after/index.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const { isBoolean } = require("../../utils/validateTypes"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const { - sassConditionalBraceNLAfterChecker -} = require("../at-if-closing-brace-newline-after"); - -const ruleName = namespace("at-else-closing-brace-newline-after"); - -const messages = utils.ruleMessages(ruleName, { - expected: 'Expected newline after "}" of @else statement', - rejected: 'Unexpected newline after "}" of @else statement' -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation, options, context) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: expectation, - possible: ["always-last-in-chain"] - }, - { - actual: options, - possible: { - disableFix: isBoolean - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - sassConditionalBraceNLAfterChecker({ - root, - result, - ruleName, - atRuleName: "else", - expectation, - messages, - context, - options - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/README.md b/node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/README.md deleted file mode 100644 index 3cc9fdb04..000000000 --- a/node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# at-else-closing-brace-space-after - -Require a single space or disallow whitespace after the closing brace of `@else` statements. - -```scss -@if ($a == 0) { } -@else if ($x == 2) { } - ↑ -/** ↑ - * The space after this brace */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -This rule might have conflicts with Stylelint's core [`block-closing-brace-space-after`](https://stylelint.io/user-guide/rules/block-closing-brace-space-after) rule if the latter is set up in your `.stylelintrc` config file. - -## Options - -`string`: `"always-intermediate"|"never-intermediate"` - -### `"always-intermediate"` - -There *must always* be a single space after the closing brace of `@else` that is not the last statement in a conditional statement chain (i.e. does have another `@else` right after it). - -The following patterns are considered warnings: - -```scss -@if ($x == 1) { - // ... -} @else if ($x == 2) { - // ... -}@else {} - -@if ($x == 1) { - // ... -} @else if ($x == 2) { - // ... -} -@else { } - -// `@else if` has a space and a newline after the closing brace -@if ($x == 1) { - // ... -} @else if ($x == 2) { - // ... -} -@else { } - -@if ($x == 1) { - // ... -} @else if ($x == 2) { - // ... -} @else { } // Two spaces -``` - -The following patterns are *not* considered warnings: - -```scss -@if ($x == 1) { - // ... -} @else if ($x == 2) { - // ... -} @else {} - -a { - @if ($x == 1) { - // ... - } @else ($x == 2) { - // ... - } - width: 10px; -} - -@if ($x == 1) { } @else if ($x == 2) { - // ... -} @include x; - -@if ($x == 1) { - // ... -} @else if ($x == 2) { - // ... -} @include x; -``` - -### `"never-intermediate"` - -There *must never* be a whitespace after the closing brace of `@else` that is not the last statement in a conditional statement chain (i.e. does have another `@else` right after it). - -The following patterns are considered warnings: - -```scss -@if ($x == 1) { - // ... -} @else if ($x == 2) { - // ... -} @else {} - -@if ($x == 1) { - // ... -} @else if ($x == 2) { - // ... -} -@else { } -``` - -The following patterns are *not* considered warnings: - -```scss -@if ($x == 1) { - // ... -}@else {} - -a { - @if ($x == 1) { - // ... - } @else if ($x == 2) { - // ... - } - width: 10px; -} - -@if ($x == 1) { } @else if ($x == 2) { - // ... -}@include x; - -@if ($x == 1) { - // ... -} @else if ($x == 2) { - // ... -} @include x; -``` diff --git a/node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/index.js b/node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/index.js deleted file mode 100644 index ba17d7519..000000000 --- a/node_modules/stylelint-scss/src/rules/at-else-closing-brace-space-after/index.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); -const { - sassConditionalBraceSpaceAfterChecker -} = require("../at-if-closing-brace-space-after"); - -const ruleName = namespace("at-else-closing-brace-space-after"); - -const messages = utils.ruleMessages(ruleName, { - expected: 'Expected single space after "}" of @else statement', - rejected: 'Unexpected space after "}" of @else statement' -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation, _, context) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation, - possible: ["always-intermediate", "never-intermediate"] - }); - - if (!validOptions) { - return; - } - - sassConditionalBraceSpaceAfterChecker({ - root, - result, - ruleName, - atRuleName: "else", - expectation, - messages, - context - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-else-empty-line-before/README.md b/node_modules/stylelint-scss/src/rules/at-else-empty-line-before/README.md deleted file mode 100644 index b786268a9..000000000 --- a/node_modules/stylelint-scss/src/rules/at-else-empty-line-before/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# at-else-empty-line-before - -Require an empty line or disallow empty lines before `@`-else. - -```scss -@if ($a == 0) { } - /* ← */ -@else if ($x == 2) { } ↑ - ↑ -/** ↑ - * This empty line */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -`@if` and `@else` statements might need to have different behavior than all the other at-rules. For that you might need to set `"ignoreAtRules": ["else"]` for Stylelint's core rule [`at-rule-empty-line-before`](https://stylelint.io/user-guide/rules/at-rule-empty-line-before). But that would make you unable to disallow empty lines before `@else` while forcing it to be on a new line. This rule is designed to solve exactly that. - -## Options - -`string`: `"never"` - -There is no `"always"`, `"always-single-line"` options, because for such cases Stylelint's `at-rule-empty-line-before` would work. - -### `"never"` - -There *must never* be an empty line before `@else` statements. - -The following patterns are considered warnings: - -```scss -@if ($x == 1) { - // ... -} - -@else {} -``` -```scss -@if ($x == 1) { - // ... -} @else if ($x == 2) { - // ... -} - - -@else { } -``` - -The following patterns are *not* considered warnings: - -```scss -@if ($x == 1) { - // ... -} @else if ($x == 2) { - // ... -} @else {} - -a { - @if ($x == 1) { - // ... - } - @else ($x == 2) { - // ... - } -} -``` - -## Caveats - -If you use autofix, this rule could clash with [`at-mixin-parentheses-space-before`](../at-mixin-parentheses-space-before/README.md) rule. diff --git a/node_modules/stylelint-scss/src/rules/at-else-empty-line-before/index.js b/node_modules/stylelint-scss/src/rules/at-else-empty-line-before/index.js deleted file mode 100644 index d36415622..000000000 --- a/node_modules/stylelint-scss/src/rules/at-else-empty-line-before/index.js +++ /dev/null @@ -1,61 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const hasEmptyLine = require("../../utils/hasEmptyLine"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-else-empty-line-before"); - -const messages = utils.ruleMessages(ruleName, { - rejected: "Unexpected empty line before @else" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation, _, context) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation, - possible: ["never"] - }); - - if (!validOptions) { - return; - } - - root.walkAtRules(atrule => { - if (atrule.name !== "else") { - return; - } - - // Don't need to ignore "the first rule in a stylesheet", etc, cases - // because @else should always go after @if - - if (!hasEmptyLine(atrule.raws.before)) { - return; - } - - if (context.fix) { - atrule.raws.before = " "; - - return; - } - - utils.report({ - message: messages.rejected, - node: atrule, - result, - ruleName - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/README.md b/node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/README.md deleted file mode 100644 index 93de15e22..000000000 --- a/node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# at-else-if-parentheses-space-before - -Require or disallow a space before `@else if` parentheses. - -```scss -@else if ($condition) { } -/** ↑ - * The space before this parenthesis */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -There *must always* be exactly one space between the `@else if` and the condition opening parenthesis. - -*Note: This rule does not enforce parentheses to be present.* - -The following patterns are considered warnings: - -```scss -@else if($condition) { } -``` -```scss -@else if ($condition) { } -``` - -The following patterns are *not* considered warnings: - -```scss -@else if ($condition) { } -``` -```scss -@else if $condition { } -``` - -### `"never"` - -There *must never* be whitespace between the `@else if` and the condition opening parenthesis. - -The following patterns are considered warnings: - -```scss -@else if ($condition) { } -``` - -The following patterns are *not* considered warnings: - -```scss -@else if($condition) { } -``` -```scss -@else if $condition { } -``` diff --git a/node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/index.js b/node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/index.js deleted file mode 100644 index b0880fb1b..000000000 --- a/node_modules/stylelint-scss/src/rules/at-else-if-parentheses-space-before/index.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); -const whitespaceChecker = require("../../utils/whitespaceChecker"); - -const ruleName = namespace("at-else-if-parentheses-space-before"); - -const messages = utils.ruleMessages(ruleName, { - rejectedBefore: () => - "Unexpected whitespace before parentheses in else-if declaration", - expectedBefore: () => - "Expected a single space before parentheses in else-if declaration" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(value, _, context) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: value, - possible: ["always", "never"] - }); - - if (!validOptions) { - return; - } - - const match = /^if\s*\(/; - const replacement = value === "always" ? "if (" : "if("; - - const checker = whitespaceChecker("space", value, messages).before; - - root.walkAtRules("else", decl => { - // return early if the else-if statement is not surrounded by parentheses - if (!match.test(decl.params)) { - return; - } - - if (context.fix) { - decl.params = decl.params.replace(match, replacement); - } - - checker({ - source: decl.params, - index: decl.params.indexOf("("), - err: message => utils.report({ message, node: decl, result, ruleName }) - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/README.md b/node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/README.md deleted file mode 100644 index aed0bfeb8..000000000 --- a/node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# at-extend-no-missing-placeholder - -Disallow at-extends (`@extend`) with missing placeholders. - -Using a class selector with the `@extend` directive usually results in more generated CSS than when using a placeholder selector. Furthermore, Sass specifically introduced placeholder selectors in order to be used with `@extend`. - -```scss -.foo { - @extend %bar -// ↑ -// This is a placeholder selector -} -``` - -The following patterns are considered warnings: - -```scss -p { - @extend .some-class; -} -``` - -```scss -p { - @extend #some-identifer; -} -``` - -```scss -p { - @extend .blah-#{$dynamically_generated_name}; -} -``` - -The following patterns are *not* considered warnings: - -```scss -p { - @extend %placeholder; -} -``` - -```scss -p { - @extend #{$dynamically_generated_placeholder_name}; -} -``` diff --git a/node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/index.js b/node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/index.js deleted file mode 100644 index 4b44297a8..000000000 --- a/node_modules/stylelint-scss/src/rules/at-extend-no-missing-placeholder/index.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-extend-no-missing-placeholder"); - -const messages = utils.ruleMessages(ruleName, { - rejected: - "Expected a placeholder selector (e.g. %placeholder) to be used in @extend" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(actual) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { actual }); - - if (!validOptions) { - return; - } - - root.walkAtRules("extend", atrule => { - const isPlaceholder = atrule.params.trim()[0] === "%"; - const isInterpolation = /^#{.+}/.test(atrule.params.trim()); - - if (!isPlaceholder && !isInterpolation) { - utils.report({ - ruleName, - result, - node: atrule, - message: messages.rejected - }); - } - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-function-named-arguments/README.md b/node_modules/stylelint-scss/src/rules/at-function-named-arguments/README.md deleted file mode 100644 index 9ed7101ea..000000000 --- a/node_modules/stylelint-scss/src/rules/at-function-named-arguments/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# at-function-named-arguments - -Require named parameters in SCSS function call rule. - -```scss -animation: animation($duration: 250ms) { -// ↑ -// Require or disallow this -``` - -## Options - -`string`: `"always"|"never"` - -### `always` - -The following patterns are considered warnings: - -```scss -.foo { - animation: animation(250ms, 100ms, infinite); -} -``` - -```scss -.foo { - animation: animation(250ms); -} -``` - -```scss -.foo { - border: reset($value: 20, "bar", $color: #fff); -} -``` - -The following patterns are _not_ considered warnings: - -```scss -.foo { - animation: animation($duration: 250ms); -} -``` - -```scss -.foo { - animation: animation($duration: 250ms, $delay: 100ms, $direction: infinite); -} -``` - -### `never` - -The following patterns are considered warnings: - -```scss -.foo { - border: reset($value: 20); -} -``` - -```scss -.foo { - animation: animation($duration: 250ms, $delay: 100ms, $direction: infinite); -} -``` - -```scss -.foo { - border: reset($value: 20, "bar", $color: #fff); -} -``` - -The following patterns are _not_ considered warnings: - -```scss -.foo { - animation: animation(250ms, 100ms, infinite); -} -``` - -## Optional secondary options - -### `"ignore": ["single-argument"]` - -Given: - -```json -{ "ignore": ["single-argument"] } -``` - -The following patterns are _not_ considered warnings: - -```scss -.foo { - @include animation($duration: 250ms); -} -``` - -```scss -.foo { - @include reset(20); -} -``` - -### `ignoreFunctions: ["/regex/", "string"]` - -Given: - -```js -["always", { ignoreFunctions: ["/^my-/i", "custom"] }]; -``` - -The following patterns are _not_ considered warnings: - -```scss -.foo { - border: custom(20, 30); -} -``` - -```scss -.foo { - border: my-func(20, 30); -} -``` - -```scss -.foo { - border: MY-FUNC(20, 30); -} -``` diff --git a/node_modules/stylelint-scss/src/rules/at-function-named-arguments/index.js b/node_modules/stylelint-scss/src/rules/at-function-named-arguments/index.js deleted file mode 100644 index c77920a52..000000000 --- a/node_modules/stylelint-scss/src/rules/at-function-named-arguments/index.js +++ /dev/null @@ -1,131 +0,0 @@ -"use strict"; - -const valueParser = require("postcss-value-parser"); -const { utils } = require("stylelint"); -const isNativeCssFunction = require("../../utils/isNativeCssFunction"); -const { isString } = require("../../utils/validateTypes"); -const namespace = require("../../utils/namespace"); -const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); -const { - parseFunctionArguments -} = require("../../utils/parseFunctionArguments"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-function-named-arguments"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected a named parameter to be used in function call", - rejected: "Unexpected a named parameter in function call" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -const isScssVarRegExp = /^\$\S*/; - -function rule(expectation, options) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: expectation, - possible: ["always", "never"] - }, - { - actual: options, - possible: { - ignore: ["single-argument"], - ignoreFunctions: [isString] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - const shouldIgnoreSingleArgument = optionsHaveIgnored( - options, - "single-argument" - ); - - root.walkDecls(decl => { - valueParser(decl.value).walk(node => { - if ( - node.type !== "function" || - isNativeCssFunction(node.value) || - node.value === "" - ) { - return; - } - - const hasFuncIgnored = - options && - options.ignoreFunctions && - options.ignoreFunctions.some(f => { - const isRegex = /^\/.*\//.test(f); - - if (!isRegex) { - return f === node.value; - } - - const parts = f.split("/"); - - return new RegExp(parts[1], parts[2] || "").test(node.value); - }); - - if (hasFuncIgnored) { - return; - } - - const args = parseFunctionArguments(valueParser.stringify(node)); - const isSingleArgument = args.length === 1; - - if (isSingleArgument && shouldIgnoreSingleArgument) { - return; - } - - args.forEach(arg => { - switch (expectation) { - case "never": { - if (!arg.key) { - return; - } - - utils.report({ - message: messages.rejected, - node: decl, - result, - ruleName - }); - break; - } - - case "always": { - if (arg.key && isScssVarRegExp.test(arg.key)) { - return; - } - - utils.report({ - message: messages.expected, - node: decl, - result, - ruleName - }); - break; - } - } - }); - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/README.md b/node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/README.md deleted file mode 100644 index 402915675..000000000 --- a/node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# at-function-parentheses-space-before - -Require or disallow a space before `@function` parentheses. - -```scss -@function foo ($arg) { } -/** ↑ - * The space before this parenthesis */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -There *must always* be exactly one space between the function name and the opening parenthesis. - -The following patterns are considered warnings: - -```scss -@function foo($arg) { } -``` -```scss -@function foo ($arg) { } -``` - -The following patterns are *not* considered warnings: - -```scss -@function foo ($arg) { } -``` - -### `"never"` - -There *must never* be any whitespace between the function name and the opening parenthesis. - -The following patterns are considered warnings: - -```scss -@function foo ($arg) { } -``` - -The following patterns are *not* considered warnings: - -```scss -@function foo($arg) { } -``` diff --git a/node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/index.js b/node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/index.js deleted file mode 100644 index 3700e78a4..000000000 --- a/node_modules/stylelint-scss/src/rules/at-function-parentheses-space-before/index.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); -const whitespaceChecker = require("../../utils/whitespaceChecker"); - -const ruleName = namespace("at-function-parentheses-space-before"); - -const messages = utils.ruleMessages(ruleName, { - rejectedBefore: () => - "Unexpected whitespace before parentheses in function declaration", - expectedBefore: () => - "Expected a single space before parentheses in function declaration" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(value, _, context) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: value, - possible: ["always", "never"] - }); - - if (!validOptions) { - return; - } - - const match = /^([\w-]+)\s*\(/; - const replacement = value === "always" ? "$1 (" : "$1("; - - const checker = whitespaceChecker("space", value, messages).before; - - root.walkAtRules("function", decl => { - if (context.fix) { - decl.params = decl.params.replace(match, replacement); - - return; - } - - checker({ - source: decl.params, - index: decl.params.indexOf("("), - err: message => utils.report({ message, node: decl, result, ruleName }) - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-function-pattern/README.md b/node_modules/stylelint-scss/src/rules/at-function-pattern/README.md deleted file mode 100644 index 0aaf58e0e..000000000 --- a/node_modules/stylelint-scss/src/rules/at-function-pattern/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# at-function-pattern - -Specify a pattern for Sass/SCSS-like function names. - -```scss -@function grid-width($n) { -/** ↑ - * The pattern of this */ -``` - -## Options - -`regex` or `string` - -A string will be translated into a RegExp like so `new RegExp(yourString)` — so be sure to escape properly. - -### E.g. `/foo-.+/` - -The following patterns are considered warnings: - -```scss -@function boo-bar ($n) { -``` - -The following patterns are *not* considered warnings: - -```scss -@function foo-bar ($n){ -``` diff --git a/node_modules/stylelint-scss/src/rules/at-function-pattern/index.js b/node_modules/stylelint-scss/src/rules/at-function-pattern/index.js deleted file mode 100644 index 87b26b384..000000000 --- a/node_modules/stylelint-scss/src/rules/at-function-pattern/index.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const { isRegExp, isString } = require("../../utils/validateTypes"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-function-pattern"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected @function name to match specified pattern" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(pattern) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: pattern, - possible: [isRegExp, isString] - }); - - if (!validOptions) { - return; - } - - const regexpPattern = isString(pattern) ? new RegExp(pattern) : pattern; - - root.walkAtRules(decl => { - if (decl.name !== "function") { - return; - } - - // Stripping the function of its arguments - const funcName = decl.params.replace(/(\s*)\([\s\S]*\)/g, ""); - - if (regexpPattern.test(funcName)) { - return; - } - - const funcTopLine = Object.assign({}, decl.source.start); - funcTopLine.line += 1; - funcTopLine.column = 0; - - utils.report({ - message: messages.expected, - node: decl, - result, - ruleName, - end: funcTopLine - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/README.md b/node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/README.md deleted file mode 100644 index b4946f302..000000000 --- a/node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# at-if-closing-brace-newline-after - -Require or disallow a newline after the closing brace of `@if` statements. - -```scss -@if ($a == 0) { } - ↑ -/** ↑ - * The newline after this brace */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -This rule might have conflicts with Stylelint's core rule [`block-closing-brace-newline-after`](https://stylelint.io/user-guide/rules/block-closing-brace-newline-after) if it doesn't have `"ignoreAtRules": ["if"]` in a `.stylelintrc` config file. That's because an `@if { ... }` statement can be successfully parsed as an at-rule with a block. You might also want to set `"ignoreAtRules": ["else"]` for another stylelint's core rule - [`at-rule-empty-line-before`](https://stylelint.io/user-guide/rules/at-rule-empty-line-before) that could be forcing empty lines before at-rules (including `@else`s that follow `@if`s or other `@else`s). - -This rule doesn't have usual `"always"` and `"never"` main option values, because if you don't need special behavior for `@if` and `@else` you could just use [`block-closing-brace-newline-after`](https://stylelint.io/user-guide/rules/block-closing-brace-newline-after) set to `"always"` or any other value. - -## Options - -`string`: `"always-last-in-chain"` - -### `"always-last-in-chain"` - -There *must always* be a newline after the closing brace of `@if` that is the last statement in a conditional statement chain (i.e. has no `@else` right after it). If it's not, there *must not* be a newline. - -The following patterns are considered warnings: - -```scss -a { - @if ($x == 1) { - // ... - } width: 10px; // No @else - should have a newline -} - -@if ($x == 1) { - // ... -} // Has @else - shouldn't have a newline -@else { } -``` - -The following patterns are *not* considered warnings: - -```scss -a { - @if ($x == 1) {} - width: 10px; -} - -@if ($x == 1) { - // ... -} @else {} // Has @else, so no newline needed - -@if ($x == 1) { }@else { } -``` - -## Optional secondary options - -### `disableFix: true` - -Disables autofixing for this rule. diff --git a/node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/index.js b/node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/index.js deleted file mode 100644 index 8a46a9d05..000000000 --- a/node_modules/stylelint-scss/src/rules/at-if-closing-brace-newline-after/index.js +++ /dev/null @@ -1,134 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const isSingleLineString = require("../../utils/isSingleLineString"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); -const { isBoolean } = require("../../utils/validateTypes"); - -const ruleName = namespace("at-if-closing-brace-newline-after"); - -const messages = utils.ruleMessages(ruleName, { - expected: 'Expected newline after "}" of @if statement', - rejected: 'Unexpected newline after "}" of @if statement' -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation, options, context) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: expectation, - possible: ["always-last-in-chain"] - }, - { - actual: options, - possible: { - disableFix: isBoolean - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - sassConditionalBraceNLAfterChecker({ - root, - result, - ruleName, - atRuleName: "if", - expectation, - messages, - context, - options - }); - }; -} - -/** - * The core logic for this rule. Can be imported by other rules with similar - * logic, namely at-else-closing-brace-newline-after - * - * @param {Object} args -- Named arguments object - * @param {PostCSS root} args.root - * @param {PostCSS result} args.result - * @param {String ruleName} args.ruleName - needed for `report` function - * @param {String} args.atRuleName - the name of the at-rule to be checked, e.g. "if", "else" - * @param {Object} args.messages - returned by stylelint.utils.ruleMessages - * @return {undefined} - */ -function sassConditionalBraceNLAfterChecker({ - root, - result, - ruleName, - atRuleName, - expectation, - messages, - context, - options -}) { - const shouldFix = context.fix && (!options || options.disableFix !== true); - - function complain(node, message, index, fixValue) { - if (shouldFix) { - node.next().raws.before = fixValue; - - return; - } - - utils.report({ - result, - ruleName, - node, - message, - index - }); - } - - root.walkAtRules(atrule => { - // Do nothing if it's not an @if - if (atrule.name !== atRuleName) { - return; - } - - const nextNode = atrule.next(); - - if (!nextNode) { - return; - } - - const nextBefore = nextNode.raws.before; - const hasNewLinesBeforeNext = nextBefore && !isSingleLineString(nextBefore); - const reportIndex = atrule.toString().length; - - if (expectation === "always-last-in-chain") { - // If followed by @else, no newline is needed - if ( - nextNode.type === "atrule" && - (nextNode.name === "else" || nextNode.name === "elseif") - ) { - if (hasNewLinesBeforeNext) { - complain(atrule, messages.rejected, reportIndex, " "); - } - } else { - if (!hasNewLinesBeforeNext) { - complain(atrule, messages.expected, reportIndex, context.newline); - } - } - } - }); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -rule.sassConditionalBraceNLAfterChecker = sassConditionalBraceNLAfterChecker; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/README.md b/node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/README.md deleted file mode 100644 index f22ed99ee..000000000 --- a/node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# at-if-closing-brace-space-after - -Require a single space or disallow whitespace after the closing brace of `@if` statements. - -```scss -@if ($a == 0) { } - ↑ -/** ↑ - * The space after this brace */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -This rule might have conflicts with Stylelint's core [`block-closing-brace-space-after`](https://stylelint.io/user-guide/rules/block-closing-brace-space-after) rule if the latter is set up in your `.stylelintrc` config file. - -## Options - -`string`: `"always-intermediate"|"never-intermediate"` - -### `"always-intermediate"` - -There *must always* be a single space after the closing brace of `@if` that is not the last statement in a conditional statement chain (i.e. does have `@else` right after it). - -The following patterns are considered warnings: - -```scss -@if ($x == 1) { - // ... -}@else {} - -@if ($x == 1) { - // ... -} -@else { } - -// `@if` has a space and a newline after the closing brace -@if ($x == 1) { - // ... -} -@else { } - -@if ($x == 1) { - // ... -} @else { } // Two spaces -``` - -The following patterns are *not* considered warnings: - -```scss -@if ($x == 1) { - // ... -} @else {} - -a { - @if ($x == 1) {} - width: 10px; -} - -@if ($x == 1) { }@include x; - -@if ($x == 1) { - // ... -} @include x; -``` - -### `"never-intermediate"` - -There *must never* be a whitespace after the closing brace of `@if` that is not the last statement in a conditional statement chain (i.e. does have `@else` right after it). - -The following patterns are considered warnings: - -```scss -@if ($x == 1) { - // ... -} @else {} - -@if ($x == 1) { - // ... -} -@else { } -``` - -The following patterns are *not* considered warnings: - -```scss -@if ($x == 1) { - // ... -}@else {} - -a { - @if ($x == 1) {} - width: 10px; -} - -@if ($x == 1) { }@include x; - -@if ($x == 1) { - // ... -} @include x; -``` diff --git a/node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/index.js b/node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/index.js deleted file mode 100644 index 02b87eec3..000000000 --- a/node_modules/stylelint-scss/src/rules/at-if-closing-brace-space-after/index.js +++ /dev/null @@ -1,108 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-if-closing-brace-space-after"); - -const messages = utils.ruleMessages(ruleName, { - expected: 'Expected single space after "}" of @if statement', - rejected: 'Unexpected space after "}" of @if statement' -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation, _, context) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation, - possible: ["always-intermediate", "never-intermediate"] - }); - - if (!validOptions) { - return; - } - - sassConditionalBraceSpaceAfterChecker({ - root, - result, - ruleName, - atRuleName: "if", - expectation, - messages, - context - }); - }; -} - -/** - * The core logic for this rule. Can be imported by other rules with similar - * logic, namely at-else-closing-brace-space-after - * - * @param {Object} args -- Named arguments object - * @param {PostCSS root} args.root - * @param {PostCSS result} args.result - * @param {String ruleName} args.ruleName - needed for `report` function - * @param {String} args.atRuleName - the name of the at-rule to be checked, e.g. "if", "else" - * @param {Object} args.messages - returned by stylelint.utils.ruleMessages - * @return {undefined} - */ -function sassConditionalBraceSpaceAfterChecker({ - root, - result, - ruleName, - atRuleName, - expectation, - messages, - context -}) { - function complain(node, message, index, fixValue) { - if (context.fix) { - node.next().raws.before = fixValue; - - return; - } - - utils.report({ - result, - ruleName, - node, - message, - index - }); - } - - root.walkAtRules(atrule => { - // Do nothing if it's not an @if - if (atrule.name !== atRuleName) { - return; - } - - const nextNode = atrule.next(); - const hasSpaceAfter = nextNode && nextNode.raws.before === " "; - const hasWhiteSpaceAfter = nextNode && nextNode.raws.before !== ""; - const reportIndex = atrule.toString().length; - - // When followed by an @else - if (nextNode && nextNode.type === "atrule" && nextNode.name === "else") { - // A single space is needed - if (expectation === "always-intermediate" && !hasSpaceAfter) { - complain(atrule, messages.expected, reportIndex, " "); - } else if (expectation === "never-intermediate" && hasWhiteSpaceAfter) { - // No whitespace is needed - complain(atrule, messages.rejected, reportIndex, ""); - } - } - }); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -rule.sassConditionalBraceSpaceAfterChecker = - sassConditionalBraceSpaceAfterChecker; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-if-no-null/README.md b/node_modules/stylelint-scss/src/rules/at-if-no-null/README.md deleted file mode 100644 index 66a1edba0..000000000 --- a/node_modules/stylelint-scss/src/rules/at-if-no-null/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# at-if-no-null - -Check for equality to null is unnecessarily explicit since `null` is falsey in Sass. - -```scss -a { - @if $x == null {} -/** ↑ ↑ - * == or != null is unncessary */ -} -``` - -## Options - -true - -### `true` - -The following patterns are considered warnings: -```scss -a { - @if $x == null {} -} -``` - -```scss -a { - @if $x != null {} -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { - @if $x {} -} -``` - -```scss -a { - @if not $x {} -} -``` diff --git a/node_modules/stylelint-scss/src/rules/at-if-no-null/index.js b/node_modules/stylelint-scss/src/rules/at-if-no-null/index.js deleted file mode 100644 index 363f4b6b1..000000000 --- a/node_modules/stylelint-scss/src/rules/at-if-no-null/index.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-if-no-null"); - -const messages = utils.ruleMessages(ruleName, { - equals_null: "Expected @if not statement rather than @if statement == null", - not_equals_null: "Expected @if statement rather than @if statement != null" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation - }); - - if (!validOptions) { - return; - } - - root.walkAtRules(atrule => { - // Do nothing if it's not an @if - if (atrule.name !== "if") { - return; - } - - // If rule != null and (expr), skip - if (atrule.params.match(/.* != null and .*/)) { - return; - } - - if (atrule.params.match(/.* == null[ \t]*\)?/)) { - utils.report({ - message: messages.equals_null, - node: atrule, - result, - ruleName - }); - } else if (atrule.params.match(/.* != null[ \t]*\)?/)) { - utils.report({ - message: messages.not_equals_null, - node: atrule, - result, - ruleName - }); - } - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md b/node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md deleted file mode 100644 index a12c20765..000000000 --- a/node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# at-import-no-partial-leading-underscore - -Disallow leading underscore in partial names in `@import`. - -```scss -@import "path/to/_file" -/** ↑ - * Disallow this */ -``` - -The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import: - -* If the file’s extension is `.css`. -* If the filename begins with `http://` (or any other protocol). -* If the filename is a `url()`. -* If the `@import` has any media queries. - - -The following patterns are considered warnings: - -```scss -@import "_foo"; -``` - -```scss -@import "path/_fff"; -``` - -```scss -@import "path\\_fff"; /* Windows delimiters */ -``` - -```scss -@import "df/fff", '_1.scss'; -``` - -The following patterns are *not* considered warnings: - -```scss -@import "_path/fff"; /* underscore in a directory name, not in a partial name */ -``` - -```scss -@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */ -``` - -```scss -@import "_file.css"; /* Has ".css" extension, so doesn't count as a partial @import */ -``` - -```scss -/* Both are URIs, so don't count as partial @imports */ -@import "http://_file.scss"; -@import "//_file.scss"; -``` - -```scss -@import "_file.scss" screen; /* Has a media query, so doesn't count as a partial @import */ -``` diff --git a/node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/index.js b/node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/index.js deleted file mode 100644 index 349281c14..000000000 --- a/node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/index.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-import-no-partial-leading-underscore"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Unexpected leading underscore in imported partial name" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(actual) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { actual }); - - if (!validOptions) { - return; - } - - function checkPathForUnderscore(path, decl) { - // Stripping trailing quotes and whitespaces, if any - const pathStripped = path - .replace(/^\s*(["'])\s*/, "") - .replace(/\s*(["'])\s*$/, ""); - - // Searching a _ at the start of filename - if (pathStripped.search(/(?:^|\/|\\)_[^/]+$/) === -1) { - return; - } - - // Skipping importing CSS: url(), ".css", URI with a protocol, media - if ( - pathStripped.slice(0, 4) === "url(" || - pathStripped.slice(-4) === ".css" || - pathStripped.search("//") !== -1 || - pathStripped.search(/[\s,)"']\w+$/) !== -1 - ) { - return; - } - - utils.report({ - message: messages.expected, - node: decl, - result, - ruleName - }); - } - - root.walkAtRules("import", decl => { - // Processing comma-separated lists of import paths - decl.params.split(",").forEach(path => { - checkPathForUnderscore(path, decl); - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/README.md b/node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/README.md deleted file mode 100644 index ad353395b..000000000 --- a/node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# at-import-partial-extension-blacklist - -Specify a blacklist of disallowed file extensions for partial names in `@import` commands. - -```scss -@import "file.scss" -/** ↑ - * Blacklist of these */ -``` - -The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import: - -* If the file’s extension is `.css`. -* If the filename begins with `http://` (or any other protocol). -* If the filename is a `url()`. -* If the `@import` has any media queries. - -## Options - -`array`: `["array", "of", "extensions"]` - -Each value is either a string or a regexp. - -Given: - -```js -["scss", /less/] -``` - -The following patterns are considered warnings: - -```scss -@import "foo.scss"; -``` - -```scss -@import "path/fff.less"; -``` - -```scss -@import "path\\fff.ruthless"; -``` - -```scss -@import "df/fff", '1.SCSS'; -``` - -The following patterns are *not* considered warnings: - -```scss -@import "path/fff"; -``` - -```scss -@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */ -``` - -```scss -@import "file.css"; /* Has ".css" extension, so doesn't count as a partial @import */ -``` - -```scss -/* Both are URIs, so don't count as partial @imports */ -@import "http://_file.scss"; -@import "//_file.scss"; -``` - -```scss -@import "file.scss" screen; /* Has a media query, so doesn't count as a partial @import */ -``` diff --git a/node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/index.js b/node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/index.js deleted file mode 100644 index 72383fbbb..000000000 --- a/node_modules/stylelint-scss/src/rules/at-import-partial-extension-blacklist/index.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; - -const nodeJsPath = require("path"); -const { utils } = require("stylelint"); -const { isRegExp, isString } = require("../../utils/validateTypes"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-import-partial-extension-blacklist"); - -const messages = utils.ruleMessages(ruleName, { - rejected: ext => `Unexpected extension ".${ext}" in imported partial name` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(blacklistOption) { - const blacklist = [].concat(blacklistOption); - - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: blacklistOption, - possible: [isString, isRegExp] - }); - - if (!validOptions) { - return; - } - - function checkPathForUnderscore(path, decl) { - // Stripping trailing quotes and whitespaces, if any - const pathStripped = path - .replace(/^\s*(["'])\s*/, "") - .replace(/\s*(["'])\s*$/, ""); - const extension = nodeJsPath.extname(pathStripped).slice(1); - // Save this separately to be able to pass the original string to report() - const extensionNormalized = extension.toLowerCase(); - - // If the extension is empty - if (!extension) { - return; - } - - // Skipping importing CSS: url(), ".css", URI with a protocol, media - if ( - pathStripped.slice(0, 4) === "url(" || - pathStripped.slice(-4) === ".css" || - pathStripped.search("//") !== -1 || - pathStripped.search(/[\s,)"']\w+$/) !== -1 - ) { - return; - } - - blacklist.forEach(ext => { - if ( - (isString(ext) && extensionNormalized === ext) || - (isRegExp(ext) && extensionNormalized.search(ext) !== -1) - ) { - utils.report({ - message: messages.rejected(extension), - node: decl, - word: extension, - result, - ruleName - }); - } - }); - } - - root.walkAtRules("import", atRule => { - // Processing comma-separated lists of import paths - atRule.params.split(",").forEach(path => { - checkPathForUnderscore(path, atRule); - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/README.md b/node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/README.md deleted file mode 100644 index 48d275e85..000000000 --- a/node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# at-import-partial-extension-whitelist - -Specify a whitelist of allowed file extensions for partial names in `@import` commands. - -```scss -@import "file.scss" -/** ↑ - * Whitelist of these */ -``` - -The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import: - -* If the file’s extension is `.css`. -* If the filename begins with `http://` (or any other protocol). -* If the filename is a `url()`. -* If the `@import` has any media queries. - -## Options - -`array`: `["array", "of", "extensions"]` - -Each value is either a string or a regexp. - -Given: - -```js -["scss", /less/] -``` - -The following patterns are considered warnings: - -```scss -@import "file.sass"; -``` - -```scss -@import "file1", "file.stylus"; -``` - -The following patterns are *not* considered warnings: - -```scss -@import "path/fff"; -``` - -```scss -@import "foo.scss"; -``` - -```scss -@import "path/fff.less"; -``` - -```scss -@import "path\\fff.ruthless"; -``` - -```scss -@import "df/fff", '1.SCSS'; -``` - -```scss -@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */ -``` - -```scss -@import "file.css"; /* Has ".css" extension, so doesn't count as a partial @import */ -``` - -```scss -/* Both are URIs, so don't count as partial @imports */ -@import "http://_file.scss"; -@import "//_file.scss"; -``` - -```scss -@import "file.scss" screen; /* Has a media query, so doesn't count as a partial @import */ -``` diff --git a/node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/index.js b/node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/index.js deleted file mode 100644 index bc7569b99..000000000 --- a/node_modules/stylelint-scss/src/rules/at-import-partial-extension-whitelist/index.js +++ /dev/null @@ -1,89 +0,0 @@ -"use strict"; - -const nodeJsPath = require("path"); -const { utils } = require("stylelint"); -const { isRegExp, isString } = require("../../utils/validateTypes"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-import-partial-extension-whitelist"); - -const messages = utils.ruleMessages(ruleName, { - rejected: ext => `Unexpected extension ".${ext}" in imported partial name` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(whitelistOption) { - const whitelist = [].concat(whitelistOption); - - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: whitelistOption, - possible: [isString, isRegExp] - }); - - if (!validOptions) { - return; - } - - function checkPathForUnderscore(path, decl) { - // Stripping trailing quotes and whitespaces, if any - const pathStripped = path - .replace(/^\s*(["'])\s*/, "") - .replace(/\s*(["'])\s*$/, ""); - const extension = nodeJsPath.extname(pathStripped).slice(1); - // Save this separately to be able to pass the original string to report() - const extensionNormalized = extension.toLowerCase(); - - // If the extension is empty - if (!extension) { - return; - } - - // Skipping importing CSS: url(), ".css", URI with a protocol, media - if ( - pathStripped.slice(0, 4) === "url(" || - pathStripped.slice(-4) === ".css" || - pathStripped.search("//") !== -1 || - pathStripped.search(/[\s,)"']\w+$/) !== -1 - ) { - return; - } - - if ( - whitelist.some(ext => { - return ( - (isString(ext) && extensionNormalized === ext) || - (isRegExp(ext) && extensionNormalized.search(ext) !== -1) - ); - }) - ) { - return; - } - - utils.report({ - message: messages.rejected(extension), - node: decl, - word: extension, - result, - ruleName - }); - } - - root.walkAtRules("import", atRule => { - // Processing comma-separated lists of import paths - atRule.params.split(",").forEach(path => { - checkPathForUnderscore(path, atRule); - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-import-partial-extension/README.md b/node_modules/stylelint-scss/src/rules/at-import-partial-extension/README.md deleted file mode 100644 index b059c5b00..000000000 --- a/node_modules/stylelint-scss/src/rules/at-import-partial-extension/README.md +++ /dev/null @@ -1,118 +0,0 @@ -# at-import-partial-extension - -Require or disallow extension in `@import` commands. - -```scss -@import "file.scss"; -/** ↑ - * This extension */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule only when `"never"` is given. - -The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import: - -- If the file’s extension is `.css`. -- If the filename begins with `http://` (or any other protocol). -- If the filename is a `url()`. -- If the `@import` has any media queries. - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -The following patterns are considered warnings: - -```scss -@import "foo"; -``` - -```scss -@import "path/fff"; -``` - -```scss -@import "path\\fff"; -``` - -```scss -@import "df/fff", "1.SCSS"; -``` - -The following patterns are _not_ considered warnings: - -```scss -@import "fff.scss"; -``` - -```scss -@import "path/fff.scss"; -``` - -```scss -@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */ -``` - -```scss -@import "file.css"; /* Has ".css" extension, so doesn't count as a partial @import */ -``` - -```scss -/* Both are URIs, so don't count as partial @imports */ -@import "http://_file.scss"; -@import "//_file.scss"; -``` - -```scss -@import "file.scss" screen; /* Has a media query, so doesn't count as a partial @import */ -``` - -### `"never"` - -The following patterns are considered warnings: - -```scss -@import "foo.scss"; -``` - -```scss -@import "path/fff.less"; -``` - -```scss -@import "path\\fff.ruthless"; -``` - -```scss -@import "df/fff", "1.SCSS"; -``` - -The following patterns are _not_ considered warnings: - -```scss -@import "foo"; -``` - -```scss -@import "path/fff"; -``` - -```scss -@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */ -``` - -```scss -@import "file.css"; /* Has ".css" extension, so doesn't count as a partial @import */ -``` - -```scss -/* Both are URIs, so don't count as partial @imports */ -@import "http://_file.scss"; -@import "//_file.scss"; -``` - -```scss -@import "file.scss" screen; /* Has a media query, so doesn't count as a partial @import */ -``` diff --git a/node_modules/stylelint-scss/src/rules/at-import-partial-extension/index.js b/node_modules/stylelint-scss/src/rules/at-import-partial-extension/index.js deleted file mode 100644 index 9ca1aaba5..000000000 --- a/node_modules/stylelint-scss/src/rules/at-import-partial-extension/index.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; - -const nodeJsPath = require("path"); -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-import-partial-extension"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected @import to have an extension", - rejected: ext => `Unexpected extension ".${ext}" in @import` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -// https://drafts.csswg.org/mediaqueries/#media-types -const mediaQueryTypes = [ - "all", - "print", - "screen", - "speech", - "tv", - "tty", - "projection", - "handheld", - "braille", - "embossed", - "aural" -]; - -const mediaQueryTypesRE = new RegExp(`(${mediaQueryTypes.join("|")})$`, "i"); -const stripPath = path => - path.replace(/^\s*(["'])\s*/, "").replace(/\s*(["'])\s*$/, ""); - -function rule(expectation, _, context) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation, - possible: ["always", "never"] - }); - - if (!validOptions) { - return; - } - - root.walkAtRules("import", decl => { - const paths = decl.params - .split(/["']\s*,/) - .filter(path => !mediaQueryTypesRE.test(path.trim())); - - // Processing comma-separated lists of import paths - paths.forEach(path => { - // Stripping trailing quotes and whitespaces, if any - const pathStripped = stripPath(path); - - // Skipping importing CSS: url(), ".css", URI with a protocol - if ( - pathStripped.slice(0, 4) === "url(" || - pathStripped.slice(-4) === ".css" || - pathStripped.search("//") !== -1 - ) { - return; - } - - const extension = nodeJsPath.extname(pathStripped).slice(1); - - if (!extension && expectation === "always") { - utils.report({ - message: messages.expected, - node: decl, - result, - ruleName - }); - - return; - } - - const isScssPartial = extension === "scss"; - if (extension && isScssPartial && expectation === "never") { - if (context.fix) { - const extPattern = new RegExp(`\\.${extension}(['" ]*)$`, "g"); - decl.params = decl.params.replace(extPattern, "$1"); - - return; - } - - utils.report({ - message: messages.rejected(extension), - node: decl, - word: extension, - result, - ruleName - }); - } - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/README.md b/node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/README.md deleted file mode 100644 index 50089c160..000000000 --- a/node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# at-mixin-argumentless-call-parentheses - -Require or disallow parentheses in argumentless `@mixin` calls. - -```scss -@include mixin-name() { -/** ↑ - * Such mixin calls */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -There *must always* be parentheses in mixin calls, even if no arguments are passed. - -The following patterns are considered warnings: - -```scss -@include mixin-name; -``` - -The following patterns are *not* considered warnings: - -```scss -@include mixin-name(); -``` - -### `"never"` - -There *must never* be parentheses when calling a mixin without arguments. - -The following patterns are considered warnings: - -```scss -@include mixin-name(); -``` - -The following patterns are *not* considered warnings: - -```scss -@include mixin-name; -``` diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/index.js b/node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/index.js deleted file mode 100644 index f49555e13..000000000 --- a/node_modules/stylelint-scss/src/rules/at-mixin-argumentless-call-parentheses/index.js +++ /dev/null @@ -1,68 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-mixin-argumentless-call-parentheses"); - -const messages = utils.ruleMessages(ruleName, { - expected: mixin => `Expected parentheses in mixin "${mixin}" call`, - rejected: mixin => - `Unexpected parentheses in argumentless mixin "${mixin}" call` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(value, _, context) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: value, - possible: ["always", "never"] - }); - - if (!validOptions) { - return; - } - - root.walkAtRules("include", mixinCall => { - // If it is "No parens in argumentless calls" - if (value === "never" && mixinCall.params.search(/\(\s*\)\s*$/) === -1) { - return; - } - - // If it is "Always use parens" - if (value === "always" && mixinCall.params.search(/\(/) !== -1) { - return; - } - - if (context.fix) { - if (value === "always") { - mixinCall.params = `${mixinCall.params} ()`; - } else { - mixinCall.params = mixinCall.params.replace(/\s*\([\s\S]*?\)$/, ""); - } - - return; - } - - const mixinName = /\s*(\S*?)\s*(?:\(|$)/.exec(mixinCall.params)[1]; - - utils.report({ - message: - messages[value === "never" ? "rejected" : "expected"](mixinName), - node: mixinCall, - result, - ruleName - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/README.md b/node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/README.md deleted file mode 100644 index 4eafe2058..000000000 --- a/node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# at-mixin-named-arguments - -Require named parameters in at-mixin call rule. - -```scss -@include animation($duration: 250ms) { -// ↑ -// Require or disallow this -``` - -## Options - -`string`: `"always"|"never"` - -### `always` - -The following patterns are considered warnings: - -```scss -.foo { - @include animation(250ms, 100ms, infinite); -} -``` - -```scss -.foo { - @include animation(250ms); -} -``` - -```scss -.foo { - @include reset($value: 20, 'bar', $color: #FFF); -} -``` - -The following patterns are *not* considered warnings: - -```scss -.foo { - @include animation($duration: 250ms); -} -``` - -```scss -.foo { - @include animation($duration: 250ms, $delay: 100ms, $direction: infinite); -} -``` - -### `never` - -The following patterns are considered warnings: - -```scss -.foo { - @include reset($value: 20); -} -``` - -```scss -.foo { - @include animation($duration: 250ms, $delay: 100ms, $direction: infinite); -} -``` - -```scss -.foo { - @include reset($value: 20, 'bar', $color: #FFF); -} -``` - -The following patterns are *not* considered warnings: - -```scss -.foo { - @include animation(250ms, 100ms, infinite); -} -``` - -## Optional secondary options - -### `"ignore": ["single-argument"]` - -Given: -```json -{ "ignore": ["single-argument"] } -``` - -The following patterns are *not* considered warnings: - -```scss -.foo { - @include animation($duration: 250ms); -} -``` - -```scss -.foo { - @include reset(20); -} -``` diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/index.js b/node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/index.js deleted file mode 100644 index c3063f48a..000000000 --- a/node_modules/stylelint-scss/src/rules/at-mixin-named-arguments/index.js +++ /dev/null @@ -1,125 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-mixin-named-arguments"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected a named parameter to be used in at-include call", - rejected: "Unexpected a named parameter in at-include call" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -const hasArgumentsRegExp = /\((.*)\)$/; -const isScssVarRegExp = /^\$\S*/; - -function rule(expectation, options) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: expectation, - possible: ["always", "never"] - }, - { - actual: options, - possible: { - ignore: ["single-argument"] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - const shouldIgnoreSingleArgument = optionsHaveIgnored( - options, - "single-argument" - ); - - root.walkAtRules("include", atRule => { - const argsString = atRule.params - .replace(/\n/g, " ") - .match(hasArgumentsRegExp); - - // Ignore @include that does not contain arguments. - if ( - !argsString || - argsString.index === -1 || - argsString[0].length === 2 - ) { - return; - } - - const args = argsString[1] - // Create array of arguments. - .split(",") - // Create a key-value array for every argument. - .map(argsString => - argsString.split(":").map(argsKeyValuePair => argsKeyValuePair.trim()) - ) - .reduce((resultArray, keyValuePair) => { - const pair = { value: keyValuePair[1] || keyValuePair[0] }; - - if (keyValuePair[1]) { - pair.key = keyValuePair[0]; - } - - return [...resultArray, pair]; - }, []); - - const isSingleArgument = args.length === 1; - - if (isSingleArgument && shouldIgnoreSingleArgument) { - return; - } - - args.forEach(arg => { - switch (expectation) { - case "never": { - if (!arg.key) { - return; - } - - utils.report({ - message: messages.rejected, - node: atRule, - result, - ruleName - }); - break; - } - - case "always": { - if (arg.key && isScssVarRegExp.test(arg.key)) { - return; - } - - utils.report({ - message: messages.expected, - node: atRule, - result, - ruleName - }); - break; - } - } - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/README.md b/node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/README.md deleted file mode 100644 index 6e291f34e..000000000 --- a/node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# at-mixin-parentheses-space-before - -Require or disallow a space before `@mixin` parentheses. - -```scss -@mixin foo ($arg) { } -/** ↑ - * The space before this parenthesis */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -There *must always* be exactly one space between the mixin name and the opening parenthesis. - -*Note: This rule does not enforce parentheses to be present in a declaration without arguments.* - -The following patterns are considered warnings: - -```scss -@mixin foo($arg) { } -``` -```scss -@mixin foo ($arg) { } -``` - -The following patterns are *not* considered warnings: - -```scss -@mixin foo ($arg) { } -``` -```scss -@mixin foo { } -``` - -### `"never"` - -There *must never* be any whitespace between the mixin name and the opening parenthesis. - -The following patterns are considered warnings: - -```scss -@mixin foo ($arg) { } -``` - -The following patterns are *not* considered warnings: - -```scss -@mixin foo($arg) { } -``` -```scss -@mixin foo { } -``` diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/index.js b/node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/index.js deleted file mode 100644 index 1ddccd4f2..000000000 --- a/node_modules/stylelint-scss/src/rules/at-mixin-parentheses-space-before/index.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const whitespaceChecker = require("../../utils/whitespaceChecker"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-mixin-parentheses-space-before"); - -const messages = utils.ruleMessages(ruleName, { - rejectedBefore: () => - "Unexpected whitespace before parentheses in mixin declaration", - expectedBefore: () => - "Expected a single space before parentheses in mixin declaration" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(value, _, context) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: value, - possible: ["always", "never"] - }); - - if (!validOptions) { - return; - } - - const match = /^([\w-]+)\s*\(/; - const replacement = value === "always" ? "$1 (" : "$1("; - - const checker = whitespaceChecker("space", value, messages).before; - - root.walkAtRules("mixin", decl => { - if (context.fix) { - decl.params = decl.params.replace(match, replacement); - - return; - } - - checker({ - source: decl.params, - index: decl.params.indexOf("("), - err: message => utils.report({ message, node: decl, result, ruleName }) - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-pattern/README.md b/node_modules/stylelint-scss/src/rules/at-mixin-pattern/README.md deleted file mode 100644 index 786b2f0c4..000000000 --- a/node_modules/stylelint-scss/src/rules/at-mixin-pattern/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# at-mixin-pattern - -Specify a pattern for Sass/SCSS-like mixin names. - -```scss -@mixin complex-object ($items: 10) { -/** ↑ - * The pattern of this */ -``` - -## Options - -`regex` or `string` - -A string will be translated into a RegExp like so `new RegExp(yourString)` — so be sure to escape properly. - -### E.g. `/foo-.+/` - -The following patterns are considered warnings: - -```scss -@mixin boo-bar { -``` - -The following patterns are *not* considered warnings: - -```scss -@mixin foo-bar { -``` diff --git a/node_modules/stylelint-scss/src/rules/at-mixin-pattern/index.js b/node_modules/stylelint-scss/src/rules/at-mixin-pattern/index.js deleted file mode 100644 index 9a6634a5e..000000000 --- a/node_modules/stylelint-scss/src/rules/at-mixin-pattern/index.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const { isRegExp, isString } = require("../../utils/validateTypes"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-mixin-pattern"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected @mixin name to match specified pattern" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(pattern) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: pattern, - possible: [isRegExp, isString] - }); - - if (!validOptions) { - return; - } - - const regexpPattern = isString(pattern) ? new RegExp(pattern) : pattern; - - root.walkAtRules(decl => { - if (decl.name !== "mixin") { - return; - } - - // Stripping the mixin of its arguments - const mixinName = decl.params.replace(/(\s*)\([\s\S]*\)/g, ""); - - if (regexpPattern.test(mixinName)) { - return; - } - - const mixinTopLine = Object.assign({}, decl.source.start); - mixinTopLine.line += 1; - mixinTopLine.column = 0; - - utils.report({ - message: messages.expected, - node: decl, - result, - ruleName, - end: mixinTopLine - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/README.md b/node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/README.md deleted file mode 100644 index e389992f5..000000000 --- a/node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# at-rule-conditional-no-parentheses - -Disallow parentheses in conditional @ rules (if, elsif, while) - -```css - @if (true) {} -/** ↑ ↑ - * Get rid of parentheses like this. */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -## Options - -### `true` - -The following patterns are considered warnings: - -```scss -@if(true) -``` - -```scss -@else if(true) -``` - -```scss -@while(true) -``` - -The following patterns are *not* considered warnings: - -```scss -@if true -``` - -```scss -@else if true -``` - -```scss -@while true -``` diff --git a/node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/index.js b/node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/index.js deleted file mode 100644 index d89564e25..000000000 --- a/node_modules/stylelint-scss/src/rules/at-rule-conditional-no-parentheses/index.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-rule-conditional-no-parentheses"); - -const messages = utils.ruleMessages(ruleName, { - rejected: "Unexpected () used to surround statements for @-rules" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -// postcss picks up else-if as else. -const conditional_rules = ["if", "while", "else"]; - -function report(atrule, result) { - utils.report({ - message: messages.rejected, - node: atrule, - result, - ruleName - }); -} - -function fix(atrule) { - const regex = /(if)? ?\((.*)\)/; - - // 2 regex groups: 'if ' and cond. - const groups = atrule.params.match(regex).slice(1); - - atrule.params = [...new Set(groups)].join(" "); -} - -function rule(primary, _unused, context) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: primary - }); - - if (!validOptions) { - return; - } - - root.walkAtRules(atrule => { - // Check if this is a conditional rule. - if (!conditional_rules.includes(atrule.name)) { - return; - } - - // Else uses a different regex - // params are of format "`if (cond)` or `if cond` - // instead of `(cond)` or `cond`" - if (atrule.name === "else") { - if (atrule.params.match(/ ?if ?\(.*\) ?$/)) { - if (context.fix) { - fix(atrule); - } else { - report(atrule, result); - } - } - } else { - if (atrule.params.trim().match(/^\(.*\)$/)) { - if (context.fix) { - fix(atrule); - } else { - report(atrule, result); - } - } - } - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-rule-no-unknown/README.md b/node_modules/stylelint-scss/src/rules/at-rule-no-unknown/README.md deleted file mode 100644 index d26b42bda..000000000 --- a/node_modules/stylelint-scss/src/rules/at-rule-no-unknown/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# at-rule-no-unknown - -Disallow unknown at-rules. Should be used **instead of** Stylelint's [at-rule-no-unknown](https://stylelint.io/user-guide/rules/at-rule-no-unknown). - -```css - @unknown (max-width: 960px) {} -/** ↑ - * At-rules like this */ -``` - -This rule is basically a wrapper around the mentioned core rule, but with added SCSS-specific `@`-directives. So if you use the core rule, `@if`, `@extend` and other Sass-y things will get warnings. You must disable Stylelint's core rule to make this rule work: - -```json -{ - "rules": { - "at-rule-no-unknown": null, - "scss/at-rule-no-unknown": true - } -} -``` - -## Options - -### `true` - -The following patterns are considered warnings: - -```css -@unknown {} -``` - -The following patterns are *not* considered warnings: - -```css -@function foo () {} -``` - -```css -@while ($i == 1) {} -``` - -```css -@media (max-width: 960px) {} -``` - -```css -@if ($i) {} @else {} -``` - -## Optional secondary options - -### `ignoreAtRules: ["/regex/", "string"]` - -Given: - -```js -["/^my-/i", "custom"] -``` - -The following patterns are *not* considered warnings: - -```css -@my-at-rule "x.css"; -``` - -```css -@my-other-at-rule {} -``` - -```css -@MY-OTHER-AT-RULE {} -``` - -```css -@custom {} -``` diff --git a/node_modules/stylelint-scss/src/rules/at-rule-no-unknown/index.js b/node_modules/stylelint-scss/src/rules/at-rule-no-unknown/index.js deleted file mode 100644 index 1fef73c2e..000000000 --- a/node_modules/stylelint-scss/src/rules/at-rule-no-unknown/index.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; - -const { rules, utils } = require("stylelint"); -const { isRegExp, isString } = require("../../utils/validateTypes"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const sassAtRules = [ - "at-root", - "content", - "debug", - "each", - "else", - "else if", - "error", - "extend", - "for", - "forward", - "function", - "if", - "import", - "include", - "media", - "mixin", - "return", - "use", - "warn", - "while" -]; - -const ruleToCheckAgainst = "at-rule-no-unknown"; - -const ruleName = namespace(ruleToCheckAgainst); - -const messages = utils.ruleMessages(ruleName, { - rejected: (...args) => { - return rules[ruleToCheckAgainst].messages - .rejected(...args) - .replace(` (${ruleToCheckAgainst})`, ""); - } -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(primaryOption, secondaryOptions) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: primaryOption - }, - { - actual: secondaryOptions, - possible: { - ignoreAtRules: [isRegExp, isString] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - const optionsAtRules = secondaryOptions && secondaryOptions.ignoreAtRules; - const ignoreAtRules = sassAtRules.concat(optionsAtRules || []); - const defaultedOptions = Object.assign({}, secondaryOptions, { - ignoreAtRules - }); - - utils.checkAgainstRule( - { - ruleName: ruleToCheckAgainst, - ruleSettings: [primaryOption, defaultedOptions], - root - }, - warning => { - const name = warning.node.name; - - if (!ignoreAtRules.includes(name)) { - utils.report({ - message: messages.rejected(`@${name}`), - ruleName, - result, - node: warning.node, - start: { line: warning.line, column: warning.column }, - end: { line: warning.endLine, column: warning.endColumn } - }); - } - } - ); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/README.md b/node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/README.md deleted file mode 100644 index 35d8b5dce..000000000 --- a/node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# at-use-no-unnamespaced - -Disallow usage of `@use` without a namespace. - -```scss -@use "foo" as *; -/** ↑ - * Disallow this */ -``` - -The following patterns are considered warnings: - -```scss -@use "foo" as *; -``` - -The following patterns are _not_ considered warnings: - -```scss -@use "foo"; -``` - -```scss -@use "foo" as bar; -``` diff --git a/node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/index.js b/node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/index.js deleted file mode 100644 index 2c3503e4c..000000000 --- a/node_modules/stylelint-scss/src/rules/at-use-no-unnamespaced/index.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("at-use-no-unnamespaced"); - -const messages = utils.ruleMessages(ruleName, { - rejected: "Unexpected @use without namespace" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(actual) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { actual }); - - if (!validOptions) { - return; - } - - root.walkAtRules("use", decl => { - if (/as\s*\*\s*(?:$|with\s*\()/.test(decl.params)) { - utils.report({ - message: messages.rejected, - node: decl, - result, - ruleName - }); - } - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/comment-no-empty/README.md b/node_modules/stylelint-scss/src/rules/comment-no-empty/README.md deleted file mode 100644 index e8ec36378..000000000 --- a/node_modules/stylelint-scss/src/rules/comment-no-empty/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# comment-no-empty - -Disallow empty comments. Should be used **instead of** the Stylelint's [comment-no-empty](https://stylelint.io/user-guide/rules/comment-no-empty) because the core rule ignores SCSS-like comments. - - -```scss - /* */ - // -``` - -To avoid duplicate issues, you must disable the core rule as follows: - -```json -{ - "rules": { - "comment-no-empty": null, - "scss/comment-no-empty": true - } -} -``` - -## Options - -### `true` - -The following patterns are considered violations: - - -```scss -/**/ -``` - - -```scss -/* */ -``` - - -```scss -/* - - */ -``` - - -```scss -// -``` - - -```scss -width: 10px; // -``` - -The following patterns are _not_ considered violations: - - -```scss -/* comment */ -``` - - -```scss -/* - * Multi-line Comment -**/ -``` diff --git a/node_modules/stylelint-scss/src/rules/comment-no-empty/index.js b/node_modules/stylelint-scss/src/rules/comment-no-empty/index.js deleted file mode 100644 index 03b02b3e1..000000000 --- a/node_modules/stylelint-scss/src/rules/comment-no-empty/index.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; - -const { rules, utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const coreRuleName = "comment-no-empty"; - -const ruleName = namespace(coreRuleName); - -const messages = utils.ruleMessages(ruleName, { - rejected: rules[coreRuleName].messages.rejected.replace( - ` (${coreRuleName})`, - "" - ) -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(primary) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: primary - }); - - if (!validOptions) { - return; - } - - root.walkComments(comment => { - if (isEmptyComment(comment)) { - utils.report({ - message: messages.rejected, - node: comment, - result, - ruleName - }); - } - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -function isEmptyComment(comment) { - return comment.text === ""; -} - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/comment-no-loud/README.md b/node_modules/stylelint-scss/src/rules/comment-no-loud/README.md deleted file mode 100644 index c75232e53..000000000 --- a/node_modules/stylelint-scss/src/rules/comment-no-loud/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# comment-no-loud - -Disallow `/*`-comments. - -```scss -/* Comment */ -// ↑ ↑ -// This line -``` - -This rule only works on CSS comments (`/* */`) and ignores all double-slash (`//`) comments. - -## Options - -### `true` - -The following patterns are considered violations: - -```scss -/* comment */ -``` - -```scss -/* - * comment -*/ -``` - -The following patterns are *not* considered warnings: - -```scss -// comment -``` diff --git a/node_modules/stylelint-scss/src/rules/comment-no-loud/index.js b/node_modules/stylelint-scss/src/rules/comment-no-loud/index.js deleted file mode 100644 index bc2b2f7bd..000000000 --- a/node_modules/stylelint-scss/src/rules/comment-no-loud/index.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("comment-no-loud"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected // for comments instead of /*" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(primary) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: primary - }); - - if (!validOptions) { - return; - } - - root.walkComments(comment => { - if (isLoudComment(comment)) { - utils.report({ - message: messages.expected, - node: comment, - result, - ruleName - }); - } - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -function isLoudComment(comment) { - const regex = new RegExp(/^[ \t\n]*\/\*/); - - const splitComment = comment.source.input.css.split("\n"); - const commentFirstLine = splitComment[comment.source.start.line - 1]; - - return regex.test(commentFirstLine); -} - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/README.md b/node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/README.md deleted file mode 100644 index c96e43103..000000000 --- a/node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# declaration-nested-properties-no-divided-groups - -Disallow nested properties of the same "namespace" be divided into multiple groups. - -```scss -/* Such groups: */ -font: { /* `font` is a "namespace" */ - size: 16px; - weight: 700; -} -``` - -A "namespace" is everything before the first `-` in property names, e.g. `margin` in `margin-bottom`. It is the "namespace" that is used as a root identifier for a nested properties group (`font` in the example above). - -[Sass official docs on nested properties](https://sass-lang.com/documentation/style-rules/declarations#nesting). - -The following patterns are considered warnings: - -```scss -a { - background: url(img.png) center { - size: auto; - } - background: { - repeat: no-repeat; - } -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { - background: url(img.png) center { - size: auto; - } - background-repeat: no-repeat; -} -``` - -```scss -a { - background: url(img.png) center no-repeat { - color: red; - } - margin: 10px { - left: 1px; - } -} -``` - -```scss -a { - background: url(img.png) center { - size: auto; - } - background :red { - repeat: no-repeat; - } -} -/* There is no space after the colon in `background :red` so it is considered A SELECTOR and is compiled into: - -a background :red { - color: blue; -} - -*/ -``` diff --git a/node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/index.js b/node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/index.js deleted file mode 100644 index cce9e986c..000000000 --- a/node_modules/stylelint-scss/src/rules/declaration-nested-properties-no-divided-groups/index.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const parseNestedPropRoot = require("../../utils/parseNestedPropRoot"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const hasOwnProp = Object.prototype.hasOwnProperty; - -const ruleName = namespace("declaration-nested-properties-no-divided-groups"); - -const messages = utils.ruleMessages(ruleName, { - expected: prop => - `Expected all nested properties of "${prop}" namespace to be in one nested group` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation - }); - - if (!validOptions) { - return; - } - - root.walk(item => { - if (item.type !== "rule" && item.type !== "atrule") { - return; - } - - const nestedGroups = {}; - - // Find all nested property groups - item.each(decl => { - if (decl.type !== "rule") { - return; - } - - const testForProp = parseNestedPropRoot(decl.selector); - - if (testForProp && testForProp.propName !== undefined) { - const ns = testForProp.propName.value; - - if (!hasOwnProp.call(nestedGroups, ns)) { - nestedGroups[ns] = []; - } - - nestedGroups[ns].push(decl); - } - }); - - Object.keys(nestedGroups).forEach(namespace => { - // Only warn if there are more than one nested groups with equal namespaces - if (nestedGroups[namespace].length === 1) { - return; - } - - nestedGroups[namespace].forEach(group => { - utils.report({ - message: messages.expected(namespace), - node: group, - result, - ruleName - }); - }); - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/declaration-nested-properties/README.md b/node_modules/stylelint-scss/src/rules/declaration-nested-properties/README.md deleted file mode 100644 index 9536ef06c..000000000 --- a/node_modules/stylelint-scss/src/rules/declaration-nested-properties/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# declaration-nested-properties - -Require or disallow properties with `-` in their names to be in a form of a nested group. - -```scss -/* This is properties nesting: */ -font: { - size: 16px; - weight: 700; -} -``` - -[Sass official docs on nested properties](https://sass-lang.com/documentation/style-rules/declarations#nesting). - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -*Every property* with a `-` in its name *must be* inside a nested property group. - -Property names with browser prefixes are ignored with `always`. - -The following patterns are considered warnings: - -```scss -a { - margin-left: 10px; -} -``` - -```scss -a { - font: { - size: 10px; - } - font-weight: 400; // This one should be nested aswell -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { - margin: { - left: 10px; - } -} -``` - -```scss -a { - font: 10px/1.1 Arial { - weight: bold; - } -} -``` - -```scss -a { - -webkit-box-sizing: border-box; - -webkit-box-shadow: 1px 0 0 red; -} -``` - -### `"never"` - -Nested properties are not allowed. - -The following patterns are considered warnings: - -```scss -a { - margin: { - left: 10px; - } -} -``` - -```scss -a { - background: red { - repeat: no-repeat; - } -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { - background-color: red; - background-repeat: no-repeat; -} -``` - -```scss -a { - background:red { - color: blue; - } -} - -/* There is no space after the colon in `background:red` so it is considered A SELECTOR and is compiled into: - -a background:red { - color: blue; -} - -*/ -``` - -## Optional options - -### `except: ["only-of-namespace"]` - -*Works only* with `"always"` and reverses its effect for a property if it is the only one with the corresponding "namespace" (e.g. `margin` in `margin-top`) in a ruleset. - -The following patterns are considered warnings: - -```scss -a { - font-family: Arial, sans-serif; - font-size: 10px; -} -``` - -```scss -a { - font: { - size: 10px; // Only one rule nested (reverse "always") - } -} -``` - -```scss -a { - font: { - size: 10px; // Prop 1, ... - } - font-weight: 400; // ... prop 2, so must be nested as well -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { - position: absolute; - background-color: red; // no other `background-` properties in a ruleset -} -``` diff --git a/node_modules/stylelint-scss/src/rules/declaration-nested-properties/index.js b/node_modules/stylelint-scss/src/rules/declaration-nested-properties/index.js deleted file mode 100644 index e9e785f62..000000000 --- a/node_modules/stylelint-scss/src/rules/declaration-nested-properties/index.js +++ /dev/null @@ -1,168 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const isStandardSyntaxProperty = require("../../utils/isStandardSyntaxProperty"); -const optionsHaveException = require("../../utils/optionsHaveException"); -const namespace = require("../../utils/namespace"); -const parseNestedPropRoot = require("../../utils/parseNestedPropRoot"); -const ruleUrl = require("../../utils/ruleUrl"); - -const hasOwnProp = Object.prototype.hasOwnProperty; - -const ruleName = namespace("declaration-nested-properties"); - -const messages = utils.ruleMessages(ruleName, { - expected: prop => `Expected property "${prop}" to be in a nested form`, - rejected: prop => `Unexpected nested property "${prop}"` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation, options) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: expectation, - possible: ["always", "never"] - }, - { - actual: options, - possible: { - except: ["only-of-namespace"] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - if (expectation === "always") { - root.walk(item => { - if (item.type !== "rule" && item.type !== "atrule") { - return; - } - - const warningCandidates = {}; - - item.each(decl => { - const { prop, type, selector } = decl; - - // Looking for namespaced non-nested properties - // Namespaced prop is basically a prop with a `-` in a name, e.g. `margin-top` - if (type === "decl") { - if (!isStandardSyntaxProperty(prop)) { - return; - } - - // Add simple namespaced prop decls to warningCandidates.ns - // (prop names with browser prefixes are ignored) - const seekNamespace = /^([a-zA-Z\d]+)-/.exec(prop); - - if (seekNamespace && seekNamespace[1]) { - const ns = seekNamespace[1]; - - if (!hasOwnProp.call(warningCandidates, ns)) { - warningCandidates[ns] = []; - } - - warningCandidates[ns].push({ node: decl }); - } - } - - // Nested props, `prop: [value] { }` - if (type === "rule" || (type === "decl" && decl.isNested)) { - // `background:red {` - selector; - // `background: red {` - nested prop; space is decisive here - const testForProp = parseNestedPropRoot( - selector || decl.toString() - ); - - if (testForProp && testForProp.propName !== undefined) { - const ns = testForProp.propName.value; - - if (!hasOwnProp.call(warningCandidates, ns)) { - warningCandidates[ns] = []; - } - - warningCandidates[ns].push({ - node: decl, - nested: true - }); - } - } - }); - - // Now check if the found properties deserve warnings - Object.keys(warningCandidates).forEach(namespace => { - const exceptIfOnlyOfNs = optionsHaveException( - options, - "only-of-namespace" - ); - const moreThanOneProp = warningCandidates[namespace].length > 1; - - warningCandidates[namespace].forEach(candidate => { - if (candidate.nested === true) { - if (exceptIfOnlyOfNs) { - // If there is only one prop inside a nested prop - warn (reverse "always") - if ( - candidate.nested === true && - candidate.node.nodes.length === 1 - ) { - utils.report({ - message: messages.rejected(namespace), - node: candidate.node, - result, - ruleName - }); - } - } - } else { - // Don't warn on non-nested namespaced props if there are - // less than 2 of them, and except: "only-of-namespace" is set - if (exceptIfOnlyOfNs && !moreThanOneProp) { - return; - } - - utils.report({ - message: messages.expected(candidate.node.prop), - node: candidate.node, - result, - ruleName - }); - } - }); - }); - }); - } else if (expectation === "never") { - root.walk(item => { - // Just check if there are ANY nested props - if (item.type === "rule") { - // `background:red {` - selector; - // `background: red {` - nested prop; space is decisive here - const testForProp = parseNestedPropRoot(item.selector); - - if (testForProp && testForProp.propName !== undefined) { - utils.report({ - message: messages.rejected(testForProp.propName.value), - result, - ruleName, - node: item - }); - } - } - }); - } - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/README.md b/node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/README.md deleted file mode 100644 index 985444f9c..000000000 --- a/node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# dimension-no-non-numeric-values - -Interpolating a value with a unit (e.g. `#{$value}px`) results in a -_string_ value, not as numeric value. This value then cannot be used in -numerical operations. It is better to use arithmetic to apply a unit to a -number (e.g. `$value * 1px`). - -This rule requires that all interpolation for values should be in the format `$value * 1` instead of `#{value}` - -```scss -$value: 4; - -p { - padding: #{value}px; -// ↑ ↑ -// should be $value * 1px -} -``` - -## Options - -### `true` - -The following patterns are considered violations: - -```scss -$value: 4; - -p { - padding: #{value}px; -} -``` - -The following patterns are _not_ considered violations: - -```scss -$value: 4; - -p { - padding: $value * 1px; -} -``` - -## List of units -Font-relative lengths ([link](https://www.w3.org/TR/css-values-4/#font-relative-lengths)) -* em -* ex -* cap -* ch -* ic -* rem -* lh -* rlh - -Viewport-relative lengths ([link](https://www.w3.org/TR/css-values-4/#viewport-relative-lengths)) -* vw -* vh -* vi -* vb -* vmin -* vmax - -Absolute lengths ([link](https://www.w3.org/TR/css-values-4/#absolute-lengths)) -* cm -* mm -* Q -* in -* pc -* pt -* px - -Angle units ([link](https://www.w3.org/TR/css-values-4/#angles)) -* deg -* grad -* rad -* turn - -Duration units ([link](https://www.w3.org/TR/css-values-4/#time)) -* s -* ms - -Frequency units ([link](https://www.w3.org/TR/css-values-4/#frequency)) -* Hz -* kHz - -Resolution units ([link](https://www.w3.org/TR/css-values-4/#resolution)) -* dpi -* dpcm -* dppx -* x - -Flexible lengths ([link](https://www.w3.org/TR/css-grid-1/#fr-unit)) -* fr diff --git a/node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/index.js b/node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/index.js deleted file mode 100644 index 0d21e74c0..000000000 --- a/node_modules/stylelint-scss/src/rules/dimension-no-non-numeric-values/index.js +++ /dev/null @@ -1,150 +0,0 @@ -"use strict"; - -const valueParser = require("postcss-value-parser"); -const { utils } = require("stylelint"); -const declarationValueIndex = require("../../utils/declarationValueIndex"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("dimension-no-non-numeric-values"); - -const messages = utils.ruleMessages(ruleName, { - rejected: unit => - `Expected "$value * 1${unit}" instead of "#{$value}${unit}". Consider writing "value" in terms of ${unit} originally.` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -const units = [ - // Font-relative lengths: - // https://www.w3.org/TR/css-values-4/#font-relative-lengths - "em", - "ex", - "cap", - "ch", - "ic", - "rem", - "lh", - "rlh", - - // Viewport-relative lengths: - // https://www.w3.org/TR/css-values-4/#viewport-relative-lengths - "vw", - "vh", - "vi", - "vb", - "vmin", - "vmax", - - // Absolute lengths: - // https://www.w3.org/TR/css-values-4/#absolute-lengths - "cm", - "mm", - "Q", - "in", - "pc", - "pt", - "px", - - // Angle units: - // https://www.w3.org/TR/css-values-4/#angles - "deg", - "grad", - "rad", - "turn", - - // Duration units: - // https://www.w3.org/TR/css-values-4/#time - "s", - "ms", - - // Frequency units: - // https://www.w3.org/TR/css-values-4/#frequency - "Hz", - "kHz", - - // Resolution units: - // https://www.w3.org/TR/css-values-4/#resolution - "dpi", - "dpcm", - "dppx", - "x", - - // Flexible lengths: - // https://www.w3.org/TR/css-grid-1/#fr-unit - "fr" -]; - -function rule(primary) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: primary - }); - - if (!validOptions) { - return; - } - - root.walkDecls(decl => { - valueParser(decl.value).walk(node => { - // All words are non-quoted, while strings are quoted. - // If quoted, it's probably a deliberate non-numeric dimension. - if (node.type !== "word") { - return; - } - - if (!isInterpolated(node.value)) { - return; - } - - const regex = new RegExp(`#{[$a-z_0-9 +-]*}(${units.join("|")});?`); - const matchUnit = decl.value.match(regex); - - if (!matchUnit) { - return; - } - - const unit = matchUnit[1]; - const offset = decl.value.indexOf(unit); - - utils.report({ - ruleName, - result, - message: messages.rejected(unit), - index: declarationValueIndex(decl) + offset, - node: decl - }); - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -function isInterpolated(value) { - let boolean = false; - - // ValueParser breaks up interpolation with math into multiple, fragmented - // segments (#{$value, +, 2}px). The easiest way to detect this is to look for a fragmented - // interpolated section. - if (value.match(/^#{\$[a-z]*$/)) { - return true; - } - - units.forEach(unit => { - const regex = new RegExp(`^#{[$a-z_0-9 +-]*}${unit};?$`); - - if (value.match(regex)) { - boolean = true; - } - }); - - return boolean; -} - -module.exports = rule; -module.exports.units = units; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/README.md deleted file mode 100644 index c19459763..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# dollar-variable-colon-newline-after - -Require a newline after the colon in `$`-variable declarations. - -```scss -$box-shadow: - 0 0 0 1px #5b9dd9, - 0 0 2px 1px rgba(30, 140, 190, 0.8); - /* ↑ */ -/** ↑ - * The newline after this colon */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -## Options - -`string`: `"always"|"always-multi-line"` - -### `"always"` - -There *must always* be a newline after the colon. - -The following patterns are considered warnings: - -```scss -$var:100px; -``` - -```scss -a { $var:100px; } -``` - -```scss -$var: 100px; -``` - -The following patterns are *not* considered warnings: - -```scss -$var: - 100px; -``` - -```scss -a { - $var: - 100px; -} -``` - -### `"always-multi-line"` - -There *must always* be a newline after the colon *if the variable value is multi-line*. - -The following patterns are considered warnings: - -```scss -$box-shadow: 0 0 0 1px #5b9dd9, - 0 0 2px 1px rgba(30, 140, 190, 0.8); -``` - -The following patterns are *not* considered warnings: - -```scss -$box-shadow: - 0 0 0 1px #5b9dd9, - 0 0 2px 1px rgba(30, 140, 190, 0.8); -``` - -```scss -$box-shadow: - 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); -// The VALUE is single-line, so a newline after the colon is ignored by this rule. -``` - -```scss -$var: 100px; -``` - -## Optional secondary options - -### `disableFix: true` - -Disables autofixing for this rule. diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/index.js deleted file mode 100644 index 07007dadf..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-newline-after/index.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const declarationValueIndex = require("../../utils/declarationValueIndex"); -const isSingleLineString = require("../../utils/isSingleLineString"); -const whitespaceChecker = require("../../utils/whitespaceChecker"); -const { isBoolean } = require("../../utils/validateTypes"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("dollar-variable-colon-newline-after"); - -const messages = utils.ruleMessages(ruleName, { - expectedAfter: () => 'Expected newline after ":"', - expectedAfterMultiLine: () => - 'Expected newline after ":" with a multi-line value' -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation, options, context) { - const checker = whitespaceChecker("newline", expectation, messages); - - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: expectation, - possible: ["always", "always-multi-line"] - }, - { - actual: options, - possible: { - disableFix: isBoolean - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - const shouldFix = context.fix && (!options || options.disableFix !== true); - - root.walkDecls(decl => { - if (!decl.prop || decl.prop[0] !== "$") { - return; - } - - const value = decl.value.trim(); - const startsWithParen = value[0] === "("; - const endsWithParen = value[value.length - 1] === ")"; - const endsWithDefault = /\)\s*!default$/.test(value); - const isMultilineVarWithParens = - startsWithParen && - (endsWithParen || endsWithDefault) && - !isSingleLineString(value); - - if (isMultilineVarWithParens) { - return; - } - - // Get the raw $var, and only that - const endOfPropIndex = - declarationValueIndex(decl) + decl.raw("between").length - 1; - // `$var:`, `$var :` - const propPlusColon = decl.toString().slice(0, endOfPropIndex); - - for (let i = 0, l = propPlusColon.length; i < l; i++) { - if (propPlusColon[i] !== ":") { - continue; - } - - const indexToCheck = - propPlusColon.substr(propPlusColon[i], 3) === "/*" - ? propPlusColon.indexOf("*/", i) + 1 - : i; - - checker.afterOneOnly({ - source: propPlusColon, - index: indexToCheck, - lineCheckStr: decl.value, - err: m => { - if (shouldFix) { - const nextLinePrefix = - expectation === "always" - ? decl.raws.before.replace(context.newline, "") - : decl.value - .split(context.newline)[1] - .replace(/^(\s+).*$/, (_, whitespace) => whitespace); - - decl.raws.between = decl.raws.between.replace( - /:(.*)$/, - `:${context.newline}${nextLinePrefix}` - ); - - return; - } - - utils.report({ - message: m, - node: decl, - index: indexToCheck, - result, - ruleName - }); - } - }); - break; - } - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/README.md deleted file mode 100644 index bc594c6bf..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/README.md +++ /dev/null @@ -1,139 +0,0 @@ -# dollar-variable-colon-space-after - -Require or disallow whitespace after the colon in `$`-variable declarations. - -```scss -$variable: 10px; -/** ↑ - * The space after this colon */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -## Options - -`string`: `"always"|"never"|"always-single-line"|"at-least-one-space"` - -### `"always"` - -There *must always* be a single space after the colon. - -The following patterns are considered warnings: - -```scss -a { $var :10px } -``` - -```scss -$var:10px; -``` - -```scss -$var: - 10px; -// a newline is not a space -``` - -The following patterns are *not* considered warnings: - -```scss -a { $var : 10px } -``` - -```scss -$var: 10px; -``` - -### `"never"` - -There *must never* be whitespace after the colon. - -The following patterns are considered warnings: - -```scss -$var: 10px; -``` - -```scss -$var: -10px; -``` - -```scss -a { $var :10px } -``` - -The following patterns are *not* considered warnings: - -```scss -$var :10px; -``` - -```scss -a { $var:10px } -``` - -### `"always-single-line"` - -There *must always* be a single space after the colon *if the variable value is single-line*. - -The following patterns are considered warnings: - -```scss -$box-shadow:0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); -``` - -The following patterns are *not* considered warnings: - -```scss -a { - $box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.8); -} -``` - -```scss -$box-shadow: - 0 0 0 1px #5b9dd9, - 0 0 2px 1px rgba(30, 140, 190, 0.8); -``` - -```scss -a { - $box-shadow:0 0 0 1px #5b9dd9, - 0 0 2px 1px rgba(30, 140, 190, 0.8); -} -``` - -### `"at-least-one-space"` - -There must always be *at least* a single space after the colon. - -The following patterns are considered warnings: - -```scss -a { $var :10px } -``` - -```scss -$var:10px; -``` - -```scss -$var: - 10px; -// a newline is not a space -``` - -The following patterns are *not* considered warnings: - -```scss -a { $var : 10px } -``` - -```scss -$var: 10px; -``` - -```scss -$var: 10px; -``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/index.js deleted file mode 100644 index 707053165..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-after/index.js +++ /dev/null @@ -1,120 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const declarationValueIndex = require("../../utils/declarationValueIndex"); -const isSingleLineString = require("../../utils/isSingleLineString"); -const whitespaceChecker = require("../../utils/whitespaceChecker"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("dollar-variable-colon-space-after"); - -const messages = utils.ruleMessages(ruleName, { - expectedAfter: () => 'Expected single space after ":"', - rejectedAfter: () => 'Unexpected whitespace after ":"', - expectedAfterSingleLine: () => - 'Expected single space after ":" with a single-line value', - expectedAfterAtLeast: () => 'Expected at least one space after ":"' -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation, _, context) { - const checker = whitespaceChecker("space", expectation, messages); - - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation, - possible: ["always", "never", "always-single-line", "at-least-one-space"] - }); - - if (!validOptions) { - return; - } - - variableColonSpaceChecker({ - root, - result, - locationChecker: checker.after, - checkedRuleName: ruleName, - position: "after", - expectation, - context - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -function variableColonSpaceChecker({ - locationChecker, - root, - result, - checkedRuleName, - position, - expectation, - context -}) { - root.walkDecls(decl => { - if (decl.prop === undefined || decl.prop[0] !== "$") { - return; - } - - if (context && context.fix) { - if ( - expectation === "always-single-line" && - !isSingleLineString(decl.value) - ) { - return; - } - - if (position === "before") { - const replacement = expectation === "never" ? ":" : " :"; - - decl.raws.between = decl.raws.between.replace(/\s*:/, replacement); - } else if (position === "after") { - const match = expectation === "at-least-one-space" ? /:(?! )/ : /:\s*/; - const replacement = expectation === "never" ? ":" : ": "; - - decl.raws.between = decl.raws.between.replace(match, replacement); - } - - return; - } - - // Get the raw $var, and only that - const endOfPropIndex = - declarationValueIndex(decl) + decl.raw("between").length - 1; - // `$var:`, `$var :` - const propPlusColon = decl.toString().slice(0, endOfPropIndex); - - for (let i = 0; i < propPlusColon.length; i++) { - if (propPlusColon[i] !== ":") { - continue; - } - - locationChecker({ - source: propPlusColon, - index: i, - lineCheckStr: decl.value, - err: m => { - utils.report({ - message: m, - node: decl, - index: i, - result, - ruleName: checkedRuleName - }); - } - }); - break; - } - }); -} - -module.exports = rule; -module.exports.variableColonSpaceChecker = variableColonSpaceChecker; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md deleted file mode 100644 index 1036dae32..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# dollar-variable-colon-space-before - -Require a single space or disallow whitespace before the colon in `$`-variable declarations. - -```scss -$variable: 10px; -/** ↑ - * The space before this colon */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -## Options - -`string`: `"always"|"never" - -### `"always"` - -There *must always* be a single space before the colon. - -The following patterns are considered warnings: - -```scss -a { $var: 10px } -``` - -```scss -$var:10px; -``` - -```scss -$var :10px; -``` - -```scss -$var -:10px; -``` - -The following patterns are *not* considered warnings: - -```scss -a { $var : 10px } -``` - -```scss -$var :10px; -``` - -### `"never"` - -There *must never* be whitespace before the colon. - -The following patterns are considered warnings: - -```scss -$var :10px; -``` - -```scss -a { $var -:10px } -``` - -The following patterns are *not* considered warnings: - -```scss -$var:10px; -``` - -```scss -a { $var: 10px } -``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/index.js deleted file mode 100644 index 2f1781390..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/index.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const { - variableColonSpaceChecker -} = require("../dollar-variable-colon-space-after"); -const whitespaceChecker = require("../../utils/whitespaceChecker"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("dollar-variable-colon-space-before"); - -const messages = utils.ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before ":"', - rejectedBefore: () => 'Unexpected whitespace before ":"' -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation, _, context) { - const checker = whitespaceChecker("space", expectation, messages); - - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation, - possible: ["always", "never"] - }); - - if (!validOptions) { - return; - } - - variableColonSpaceChecker({ - root, - result, - locationChecker: checker.before, - checkedRuleName: ruleName, - position: "before", - expectation, - context - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-default/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-default/README.md deleted file mode 100644 index a75649a49..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-default/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# dollar-variable-default - -Require `!default` flag for `$`-variable declarations - -```scss -$variable: 10px !default; -/** ↑ - * This is variable with default value */ -``` - -## Optional Options - -### `ignore: "local"` - -Makes this rule ignore local variables (variables defined inside a rule/mixin/function, etc.). - -The following patterns are *not* considered warnings: - -```scss -$var: 10px !default; - -a { - $local-var: 10px; -} -``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-default/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-default/index.js deleted file mode 100644 index fea01d93b..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-default/index.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("dollar-variable-default"); - -const messages = utils.ruleMessages(ruleName, { - expected: variable => `Expected !default flag for "${variable}"` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(primaryOption, secondaryOptions) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: primaryOption - }, - { - actual: secondaryOptions, - possible: { - ignore: ["local"] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - root.walkDecls(decl => { - // not variable - if (decl.prop[0] !== "$") { - return; - } - - // "ignore" options - if ( - optionsHaveIgnored(secondaryOptions, "local") && - decl.parent.type !== "root" - ) { - return; - } - - if (decl.value.toLowerCase().includes("!default")) { - return; - } - - utils.report({ - message: messages.expected(decl.prop), - node: decl, - result, - ruleName - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/README.md deleted file mode 100644 index 3ba9cff99..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/README.md +++ /dev/null @@ -1,185 +0,0 @@ -# dollar-variable-empty-line-after - -Require an empty line or disallow empty lines after `$`-variable declarations. - -If the `$`-variable declaration is the last declaration in a file, it's ignored. - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -There *must always* be one empty line after a `$`-variable declaration. - -The following patterns are considered warnings: - -```scss -$var: 200px; -@import '1.css'; -``` - -```scss -a { - $var: 1; -} -``` - -The following patterns are *not* considered warnings: - -```scss -$var: 100px; // The last declaration in a stylesheet -``` - -```scss -$var: 1; - -a { color: red; } -``` - -### `"never"` - -There *must never* be an empty line after a `$`-variable declaration. - -The following patterns are considered warnings: - -```scss -$var: 1; - -a { color: red; } -``` - -The following patterns are *not* considered warnings: - -```scss -$var: 100px; -$var2: 200px; -``` - -```scss -$var: 1; -a { - width: auto; -} -``` - -## Optional secondary options - -### `except: ["last-nested", "before-comment", "before-dollar-variable"]` - -### `"last-nested"` - -Reverse the primary option for a `$`-variable declaration if it's the last child of its parent. - -For example, with `"always"`: - -The following patterns are considered warnings: - -```scss -a { - $var: 1; - color: red; -} - -b { - $var: 1; - -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { - color: red; - $var: 1; -} - -b { - $var: 1; - - color: red; -} -``` - -### `"before-comment"` - -Reverse the primary option for `$`-variable declarations that go before comments. - -For example, with `"always"`: - -The following patterns are *not* considered warnings: - -```scss -a { - $var: 1; - // comment -} -``` - -### `"before-dollar-variable"` - -Reverse the primary option for `$`-variable declarations that go right after another `$`-variable declaration. - -For example, with `"always"`: - -The following patterns are considered warnings: - -```scss -a { - $var: 1; // this one is ok - $var1: 2; // and this one shouldn't have a preceding empty line - b { - width: 100px; - } -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { - $var: 1; - $var1: 2; - - b { - width: 100%; - } -} -``` - -### `ignore: ["before-comment", "inside-single-line-block"]` - -### `"before-comment"` - -Ignore `$`-variables that go before a comment. - -For example, with `"always"`: - -The following patterns are *not* considered warnings: - -```scss -$var: 1 -// comment - -$var2: 1; -/* comment */ -``` - -### `"inside-single-line-block"` - -Ignore `$`-variables that are inside single-line blocks. - -For example, with `"always"`: - -The following patterns are *not* considered warnings: - -```scss -a { $var: 10; } -``` - -### `disableFix: true` - -Disables autofixing for this rule. diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/index.js deleted file mode 100644 index 6244e805a..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-after/index.js +++ /dev/null @@ -1,251 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const blockString = require("../../utils/blockString"); -const hasEmptyLine = require("../../utils/hasEmptyLine"); -const isSingleLineString = require("../../utils/isSingleLineString"); -const namespace = require("../../utils/namespace"); -const optionsHaveException = require("../../utils/optionsHaveException"); -const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); -const ruleUrl = require("../../utils/ruleUrl"); -const { isBoolean } = require("../../utils/validateTypes"); - -const ruleName = namespace("dollar-variable-empty-line-after"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected an empty line after $-variable", - rejected: "Unexpected empty line after $-variable" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation, options, context) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: expectation, - possible: ["always", "never"] - }, - { - actual: options, - possible: { - except: ["last-nested", "before-comment", "before-dollar-variable"], - ignore: ["before-comment", "inside-single-line-block"], - disableFix: isBoolean - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - const fixNext = (decl, match, replace) => { - decl.raws.before = decl.raws.before.replace( - new RegExp(`^${match}`), - replace - ); - }; - - const fixParent = (decl, match, replace) => { - decl.parent.raws.after = decl.parent.raws.after.replace( - new RegExp(`^${match}`), - replace - ); - }; - - const hasNewline = str => str.indexOf(context.newline) > -1; - const isDollarVar = node => node.prop && node.prop[0] === "$"; - - root.walkDecls(decl => { - let expectEmptyLineAfter = expectation === "always"; - const exceptLastNested = optionsHaveException(options, "last-nested"); - const exceptBeforeComment = optionsHaveException( - options, - "before-comment" - ); - const exceptBeforeVariable = optionsHaveException( - options, - "before-dollar-variable" - ); - const ignoreInsideSingleLineBlock = optionsHaveIgnored( - options, - "inside-single-line-block" - ); - const ignoreBeforeComment = optionsHaveIgnored(options, "before-comment"); - - const isSingleLineDeclaration = isSingleLineString( - blockString(decl.parent) - ); - - // Ignore declarations that aren't variables. - // ------------------------------------------ - if (!isDollarVar(decl)) { - return; - } - - // Ignore declaration if it's the last line in a file. - // --------------------------------------------------- - if (decl === root.last) { - return; - } - - // Ignore single line blocks (if chosen as an option). - // --------------------------------------------------- - if ( - ignoreInsideSingleLineBlock && - decl.parent.type !== "root" && - isSingleLineDeclaration - ) { - return; - } - - const next = decl.next(); - - // The declaration is the last in a block. - // --------------------------------------- - if (!next) { - const hasEmptyLineAfter = hasEmptyLine(decl.parent.raws.after); - - if ( - (expectEmptyLineAfter && hasEmptyLineAfter && !exceptLastNested) || - (!expectEmptyLineAfter && !hasEmptyLineAfter && !exceptLastNested) || - (expectEmptyLineAfter && !hasEmptyLineAfter && exceptLastNested) || - (!expectEmptyLineAfter && hasEmptyLineAfter && exceptLastNested) - ) { - return; - } - } - - // The declaration is NOT the last in a block. - // ------------------------------------------- - else { - const hasEmptyLineAfter = hasEmptyLine(next.raws.before); - const nextIsComment = next.type === "comment"; - const nextIsVariable = isDollarVar(next); - - if (nextIsComment) { - if ( - ignoreBeforeComment || - (expectEmptyLineAfter && - hasEmptyLineAfter && - !exceptBeforeComment) || - (!expectEmptyLineAfter && - !hasEmptyLineAfter && - !exceptBeforeComment) || - (expectEmptyLineAfter && - !hasEmptyLineAfter && - exceptBeforeComment) || - (!expectEmptyLineAfter && hasEmptyLineAfter && exceptBeforeComment) - ) { - return; - } - } else if (nextIsVariable) { - if ( - (expectEmptyLineAfter && - hasEmptyLineAfter && - !exceptBeforeVariable) || - (!expectEmptyLineAfter && - !hasEmptyLineAfter && - !exceptBeforeVariable) || - (expectEmptyLineAfter && - !hasEmptyLineAfter && - exceptBeforeVariable) || - (!expectEmptyLineAfter && - hasEmptyLineAfter && - exceptBeforeVariable) || - (expectEmptyLineAfter && hasEmptyLineAfter && exceptBeforeVariable) - ) { - return; - } - } else if (expectEmptyLineAfter === hasEmptyLineAfter) { - return; - } - } - - const isFixDisabled = options && options.disableFix === true; - - if (context.fix && !isFixDisabled) { - if (next) { - const nextBefore = next.raws.before; - const hasEmptyLineAfter = hasEmptyLine(nextBefore); - const nextIsComment = next.type === "comment"; - const nextIsVariable = isDollarVar(next); - - if (expectEmptyLineAfter && !hasEmptyLineAfter) { - fixNext(next, context.newline, context.newline + context.newline); - - if (exceptLastNested && !hasNewline(nextBefore)) { - fixNext(next, "\\s+", context.newline + context.newline); - } - - return; - } else if ( - (expectEmptyLineAfter && - exceptBeforeComment && - nextIsComment && - hasEmptyLineAfter) || - (expectEmptyLineAfter && - exceptBeforeVariable && - nextIsVariable && - hasEmptyLineAfter) || - (!expectEmptyLineAfter && hasEmptyLineAfter) - ) { - fixNext(decl, "\\n\\r\\n", "\r\n"); - fixNext(next, context.newline + context.newline, context.newline); - - return; - } else if ( - (!expectEmptyLineAfter && - exceptBeforeComment && - nextIsComment && - !hasEmptyLineAfter) || - (!expectEmptyLineAfter && - exceptBeforeVariable && - nextIsVariable && - !hasEmptyLineAfter) - ) { - fixNext(next, context.newline, context.newline + context.newline); - - return; - } - } else { - const hasEmptyLineAfter = hasEmptyLine(decl.parent.raws.after); - - expectEmptyLineAfter = exceptLastNested - ? !expectEmptyLineAfter - : expectEmptyLineAfter; - - if (expectEmptyLineAfter && !hasEmptyLineAfter) { - fixParent(decl, context.newline, context.newline + context.newline); - - return; - } else if (!expectEmptyLineAfter && hasEmptyLineAfter) { - fixParent(decl, "\\n\\r\\n", "\r\n"); - fixParent(decl, context.newline + context.newline, context.newline); - - return; - } - } - } - - utils.report({ - message: expectEmptyLineAfter ? messages.expected : messages.rejected, - node: decl, - result, - ruleName - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/README.md deleted file mode 100644 index 883257ce5..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/README.md +++ /dev/null @@ -1,229 +0,0 @@ -# dollar-variable-empty-line-before - -Require an empty line or disallow empty lines before `$`-variable declarations. - -If the `$`-variable declaration is the first declaration in a file, it's ignored. - -```scss - /* ← */ -$width: 10px; ↑ -/** ↑ - * This empty line */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -There _must always_ be one empty line before a `$`-variable declaration. - -The following patterns are considered warnings: - -```scss -@import "1.css"; -$var2: 200px; -``` - -```scss -a { - $var: 1; -} -``` - -The following patterns are _not_ considered warnings: - -```scss -$var: 100px; // The first declaration in a stylesheet -``` - -```scss -a { - color: red; -} - -$var: 1; -``` - -### `"never"` - -There _must never_ be an empty line before a `$`-variable declaration. - -The following patterns are considered warnings: - -```scss -a { - color: red; -} - -$var: 1; -``` - -The following patterns are _not_ considered warnings: - -```scss -$var: 100px; -$var2: 200px; -``` - -```scss -a { - width: auto; -} -$var: 1; -``` - -## Optional secondary options - -### `except: ["first-nested", "after-comment", "after-dollar-variable"]` - -### `"first-nested"` - -Reverse the primary option for a `$`-variable declaration if it's the first child of its parent. - -For example, with `"always"`: - -The following patterns are considered warnings: - -```scss -a { - - $var: 1; - color: red; -} - -b { - color: red; - - $var: 1; -} -``` - -The following patterns are _not_ considered warnings: - -```scss -a { - $var: 1; - color: red; -} - -b { - color: red; - $var: 1; -} -``` - -### `"after-comment"` - -Reverse the primary option for `$`-variable declarations that go after comments. - -For example, with `"always"`: - -The following patterns are considered warnings: - -```scss -a { - // comment - - $var: 1; -} - -b { - /* comment */ - - $var: 1; -} -``` - -The following patterns are _not_ considered warnings: - -```scss -a { - // comment - $var: 1; -} -``` - -### `"after-dollar-variable"` - -Reverse the primary option for `$`-variable declarations that go right after another `$`-variable declaration. - -For example, with `"always"`: - -The following patterns are considered warnings: - -```scss -a { - - $var: 1; // this one is ok - - $var1: 2; // and this one shouldn't have a preceding empty line -} -``` - -The following patterns are _not_ considered warnings: - -```scss -a { - - $var: 1; - $var1: 2; -} -``` - -### `ignore: ["after-comment", "inside-single-line-block", "after-dollar-variable"]` - -### `"after-comment"` - -Ignore `$`-variables that go after a comment. - -For example, with `"always"`: - -The following patterns are _not_ considered warnings: - -```scss -// comment -$var: 1 - -/* comment */ -$var2: 1; -``` - -### `"inside-single-line-block"` - -Ignore `$`-variables that are inside single-line blocks. - -For example, with `"always"`: - -The following patterns are _not_ considered warnings: - -```scss -a { - $var: 10; -} -``` - -### `"after-dollar-variable"` - -For example, with `"always"`: - -The following patterns are considered warnings: - -```scss -width: 1px; -$var2: 2; -``` - -The following patterns are _not_ considered warnings: - -```scss -$var1: 1; -$var2: 2; -``` - -### `disableFix: true` - -Disables autofixing for this rule. diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/index.js deleted file mode 100644 index b983cacc6..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-empty-line-before/index.js +++ /dev/null @@ -1,176 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const blockString = require("../../utils/blockString"); -const hasEmptyLine = require("../../utils/hasEmptyLine"); -const isSingleLineString = require("../../utils/isSingleLineString"); -const namespace = require("../../utils/namespace"); -const optionsHaveException = require("../../utils/optionsHaveException"); -const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); -const ruleUrl = require("../../utils/ruleUrl"); -const { isBoolean } = require("../../utils/validateTypes"); - -const ruleName = namespace("dollar-variable-empty-line-before"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected an empty line before $-variable", - rejected: "Unexpected empty line before $-variable" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation, options, context) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: expectation, - possible: ["always", "never"] - }, - { - actual: options, - possible: { - except: ["first-nested", "after-comment", "after-dollar-variable"], - ignore: [ - "after-comment", - "inside-single-line-block", - "after-dollar-variable" - ], - disableFix: isBoolean - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - const fix = (decl, match, replace) => { - decl.raws.before = decl.raws.before.replace( - new RegExp(`^${match}`), - replace - ); - }; - - const hasNewline = str => str.includes(context.newline); - - root.walkDecls(decl => { - if (!isDollarVar(decl)) { - return; - } - - // Always ignore the first $var in a stylesheet - if (decl === root.first) { - return; - } - - // If ignoring vars after comments is set - if ( - optionsHaveIgnored(options, "after-comment") && - decl.prev() && - decl.prev().type === "comment" - ) { - return; - } - - // If ignoring single-line blocks - if ( - optionsHaveIgnored(options, "inside-single-line-block") && - decl.parent.type !== "root" && - isSingleLineString(blockString(decl.parent)) - ) { - return; - } - - // if ignoring after another $-variable - if ( - optionsHaveIgnored(options, "after-dollar-variable") && - decl.prev() && - isDollarVar(decl.prev()) - ) { - return; - } - - let expectHasEmptyLineBefore = expectation === "always"; - - // Reverse for a variable that is a first child of its parent - if ( - optionsHaveException(options, "first-nested") && - decl === decl.parent.first - ) { - expectHasEmptyLineBefore = !expectHasEmptyLineBefore; - } - - // Reverse if after a comment - if ( - optionsHaveException(options, "after-comment") && - decl.prev() && - decl.prev().type === "comment" - ) { - expectHasEmptyLineBefore = !expectHasEmptyLineBefore; - } - - // Reverse if after another $-variable - if ( - optionsHaveException(options, "after-dollar-variable") && - decl.prev() && - isDollarVar(decl.prev()) - ) { - expectHasEmptyLineBefore = !expectHasEmptyLineBefore; - } - - const before = decl.raws.before; - - if (expectHasEmptyLineBefore === hasEmptyLine(before)) { - return; - } - - const isFixDisabled = options && options.disableFix === true; - - if (context.fix && !isFixDisabled) { - if (expectHasEmptyLineBefore && !hasEmptyLine(before)) { - fix(decl, context.newline, context.newline + context.newline); - - if ( - optionsHaveException(options, "first-nested") && - !hasNewline(before) - ) { - fix(decl, "\\s+", context.newline + context.newline); - } - - return; - } - - if (!expectHasEmptyLineBefore && hasEmptyLine(before)) { - fix(decl, "\\n\\r\\n", "\r\n"); - fix(decl, context.newline + context.newline, context.newline); - - return; - } - } - - utils.report({ - message: expectHasEmptyLineBefore - ? messages.expected - : messages.rejected, - node: decl, - result, - ruleName - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -function isDollarVar(node) { - return node.prop && node.prop[0] === "$"; -} - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/README.md deleted file mode 100644 index eac3374c2..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/README.md +++ /dev/null @@ -1,202 +0,0 @@ -# dollar-variable-first-in-block - -Require `$`-variable declarations to be placed first in a block (root or a rule). - -## Options - -### `true` - -The following patterns are considered violations: - -```scss -@import "1.css"; -$var: 200px; -``` - -```scss -a { - width: 100px; - $var: 1; -} -``` - -The following patterns are _not_ considered warnings: - -```scss -$var: 100px; -@import "1.css"; -``` - -```scss -a { - $var: 1; - color: red; -} -``` - -## Optional secondary options - -### `ignore: ["comments", "imports"]` - -### `"comments"` - -The following patterns are _not_ considered violations: - -```scss -// Comment -$var: 1; -``` - -```scss -a { - // Comment - $var: 1; - color: red; -} -``` - -### `"imports"` - -The following patterns are _not_ considered violations: - -```scss -@import "1.css"; -$var: 1; -``` - -```scss -@use "sass:color"; -$primary-color: #f26e21 !default; -$secondary-color: color.change($primary-color, $alpha: 0.08) !default; -``` - -```scss -@forward "src/list"; -$var1: 100px; -``` - -### `except: ["root", "at-rule", "function", "mixin", "if-else", "loops"]` - -### `"root"` - -The following patterns are _not_ considered warnings: - -```scss -// Imports -@import "1.css"; - -// Variables -$var: 1; -``` - -```scss -/* Imports */ -@import "1.css"; -// Variables -$var1: 1; -$var2: 1; - -a { - width: 100px; -} -``` - -### `"at-rule"` - -The following patterns are _not_ considered warnings: - -```scss -@at-root .class { - width: 100px; - $var: 1; -} -``` - -### `"function"` - -The following patterns are _not_ considered warnings: - -```scss -@function function-name($numbers1, $numbers2) { - $var1: 1; - - @each $number in $numbers1 { - $var1: $var1 + $number; - } - - $var: 2; - - @each $number in $numbers2 { - $var2: $var2 + $number; - } - - @return $var1 + $var2; -} -``` - -### `"mixin"` - -The following patterns are _not_ considered warnings: - -```scss -@mixin mixin-name { - width: 100px; - $var: 1000px; - height: $var1; -} -``` - -### `"if-else"` - -The following patterns are _not_ considered warnings: - -```scss -@if $direction == up { - width: 100px; - $var: 1000px; -} -``` - -```scss -@if $direction == up { - width: 100px; -} @else { - height: 100px; - $var: 1000px; -} -``` - -```scss -@if $direction == up { - width: 100px; - $var1: 1000px; -} @else { - height: 100px; - $var2: 1000px; -} -``` - -### `"loops"` - -The following patterns are _not_ considered warnings: - -```scss -@each $size in $sizes { - width: 100px; - $var: 1000px; -} -``` - -```scss -@for $i from 1 through 3 { - width: 100px; - $var: 1000px; -} -``` - -```scss -@while $value > $base { - width: 100px; - $var: 1000px; -} -``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/index.js deleted file mode 100644 index ee13e385b..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-first-in-block/index.js +++ /dev/null @@ -1,125 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const optionsHaveException = require("../../utils/optionsHaveException"); -const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("dollar-variable-first-in-block"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected $-variable to be first in block" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(primary, options) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: primary - }, - { - actual: options, - possible: { - ignore: ["comments", "imports"], - except: ["root", "at-rule", "function", "mixin", "if-else", "loops"] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - const isDollarVar = node => node.prop && node.prop[0] === "$"; - - root.walkDecls(decl => { - // Ignore declarations that aren't variables. - // ------------------------------------------ - if (!isDollarVar(decl)) { - return; - } - - // If selected, ignore declarations in root. - // ----------------------------------------- - if (optionsHaveException(options, "root") && decl.parent === root) { - return; - } - - // If selected, ignore declarations in different types of at-rules. - // ---------------------------------------------------------------- - if (decl.parent.type === "atrule") { - if ( - optionsHaveException(options, "at-rule") || - (optionsHaveException(options, "function") && - decl.parent.name === "function") || - (optionsHaveException(options, "mixin") && - decl.parent.name === "mixin") || - (optionsHaveException(options, "if-else") && - (decl.parent.name === "if" || decl.parent.name === "else")) || - (optionsHaveException(options, "loops") && - (decl.parent.name === "each" || - decl.parent.name === "for" || - decl.parent.name === "while")) - ) { - return; - } - } - - const previous = decl.prev(); - - // If first or preceded by another variable. - // ----------------------------------------- - if (!previous || isDollarVar(previous)) { - return; - } - - // Check if preceded only by allowed types. - // ---------------------------------------- - let precededOnlyByAllowed = true; - const allowComments = optionsHaveIgnored(options, "comments"); - const allowImports = optionsHaveIgnored(options, "imports"); - const importAtRules = ["import", "use", "forward"]; - - for (const sibling of decl.parent.nodes) { - if (sibling === decl) { - break; - } else if ( - !isDollarVar(sibling) && - !( - (allowComments && sibling.type === "comment") || - (allowImports && - sibling.type === "atrule" && - importAtRules.includes(sibling.name)) - ) - ) { - precededOnlyByAllowed = false; - } - } - - if (precededOnlyByAllowed) { - return; - } - - utils.report({ - message: messages.expected, - node: decl, - result, - ruleName - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/README.md deleted file mode 100644 index 61dfbd0a6..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/README.md +++ /dev/null @@ -1,111 +0,0 @@ -# dollar-variable-no-missing-interpolation - -Disallow Sass variables that are used without interpolation with CSS features that use custom identifiers. - -```scss -.class { - $var: "my-anim"; - animation-name: $var; -// ↑ -// This variable needs to be interpolated -// because its value is a string -} -``` - -Sass variables that contain a custom identifier as a string always require interpolation when used. Some CSS [at-rules](https://css-tricks.com/the-at-rules-of-css/) require variable interpolation even when the custom identifier value is not a string. - -For example, your CSS animation could look like this: - -```scss -animation: myAnim 5s; -``` - -When you store your custom identifier as string in a Sass variable... - -```scss -$myVar: "myAnim"; -``` - -...then you need to make sure that the variable is interpolated when it gets used: - -```scss -animation: #{$myVar} 5s; -``` - -If you do not interpolate the variable, Sass will compile your animation name to a string, producing invalid CSS: - -```scss -animation: "myAnim" 5s; -``` - -This rule can only check for variables that are defined inside the same file where they are used. - -The following patterns are considered warnings: - -```scss -$var: my-anim; - -@keyframes $var {} -``` - -```scss -$var: "circled-digits"; - -@counter-style $var { - system: fixed; - symbols: ➀ ➁ ➂; - suffix: ' '; - speak-as: numbers; -} -``` - -```scss -$var: "my-counter"; - -body { - counter-reset: $var; -} -``` - -```scss -$var: "my-anim"; - -@supports (animation-name: $var) { - @keyframes {} -} -``` - -The following patterns are *not* considered warnings: - -```scss -$var: my-anim; - -@keyframes #{$var} {} -``` - -```scss -$var: circled-digits; - -@counter-style #{$var} { - system: fixed; - symbols: ➀ ➁ ➂; - suffix: ' '; - speak-as: numbers; -} -``` - -```scss -$var: my-counter; - -body { - counter-reset: $var; -} -``` - -```scss -$var: my-anim; - -@supports (animation-name: $var) { - @keyframes {} -} -``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/index.js deleted file mode 100644 index d64bc8fca..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-no-missing-interpolation/index.js +++ /dev/null @@ -1,148 +0,0 @@ -"use strict"; - -const valueParser = require("postcss-value-parser"); -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("dollar-variable-no-missing-interpolation"); - -const messages = utils.ruleMessages(ruleName, { - rejected: (n, v) => - `Expected variable ${v} to be interpolated when using it with ${n}` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -// https://developer.mozilla.org/en/docs/Web/CSS/custom-ident#Lists_of_excluded_values -const customIdentProps = [ - "animation", - "animation-name", - "counter-reset", - "counter-increment", - "list-style-type", - "will-change" -]; - -// https://developer.mozilla.org/en/docs/Web/CSS/At-rule -const customIdentAtRules = ["counter-style", "keyframes", "supports"]; - -function isAtRule(type) { - return type === "atrule"; -} - -function isCustomIdentAtRule(node) { - return isAtRule(node.type) && customIdentAtRules.includes(node.name); -} - -function isCustomIdentProp(node) { - return customIdentProps.includes(node.prop); -} - -function isAtSupports(node) { - return isAtRule(node.type) && node.name === "supports"; -} - -function isSassVar(value) { - return value[0] === "$"; -} - -function isStringVal(value) { - return /^(["']).*(["'])$/.test(value); -} - -function toRegex(arr) { - return new RegExp(`(${arr.join("|")})`); -} - -function rule(actual) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { actual }); - - if (!validOptions) { - return; - } - - const stringVars = []; - const vars = []; - - function findVars(node) { - node.walkDecls(decl => { - const { prop, value } = decl; - - if (!isSassVar(prop) || vars.includes(prop)) { - return; - } - - if (isStringVal(value)) { - stringVars.push(prop); - } - - vars.push(prop); - }); - } - - findVars(root); - root.walkRules(findVars); - - if (!vars.length) { - return; - } - - function shouldReport(node, value) { - if (isAtSupports(node) || isCustomIdentProp(node)) { - return stringVars.includes(value); - } - - if (isCustomIdentAtRule(node)) { - return vars.includes(value); - } - - return false; - } - - function report(node, value) { - const { name, prop, type } = node; - const nodeName = isAtRule(type) ? `@${name}` : prop; - - utils.report({ - ruleName, - result, - node, - message: messages.rejected(nodeName, value) - }); - } - - function exitEarly(node) { - return node.type !== "word" || !node.value; - } - - function walkValues(node, value) { - valueParser(value).walk(valNode => { - const { value } = valNode; - - if (exitEarly(valNode) || !shouldReport(node, value)) { - return; - } - - report(node, value); - }); - } - - root.walkDecls(toRegex(customIdentProps), decl => { - walkValues(decl, decl.value); - }); - - root.walkAtRules(toRegex(customIdentAtRules), atRule => { - walkValues(atRule, atRule.params); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/README.md deleted file mode 100644 index 850094fc8..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# dollar-variable-no-namespaced-assignment - -Disallow assignment to namespaced variables. - -```scss -a { imported.$foo: 1px; } -/** ↑ - * This assignment */ -``` - -## Examples - -The following patterns are considered warnings: - -```scss -imported.$foo: 1; -``` - -The following patterns are *not* considered warnings: - -```scss -a { b: imported.$foo-bar; } -a { $foo: 0; } -``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/index.js deleted file mode 100644 index f3f967a38..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-no-namespaced-assignment/index.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("dollar-variable-no-namespaced-assignment"); - -const messages = utils.ruleMessages(ruleName, { - rejected: "Unexpected assignment to a namespaced $ variable" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(actual) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { actual }); - - if (!validOptions) { - return; - } - - root.walkDecls(decl => { - if (!/^[^$.]+\.\$./.test(decl.prop)) { - return; - } - - utils.report({ - message: messages.rejected, - node: decl, - result, - ruleName - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-pattern/README.md b/node_modules/stylelint-scss/src/rules/dollar-variable-pattern/README.md deleted file mode 100644 index de911c1c0..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-pattern/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# dollar-variable-pattern - -Specify a pattern for Sass-like variables. - -```scss -a { $foo: 1px; } -/** ↑ - * The pattern of this */ -``` - -## Options - -`regex` or `string` - -A string will be translated into a RegExp like so `new RegExp(yourString)` — so be sure to escape properly. - -### Examples - - -The following patterns are considered warnings: - -```scss -/* stylelint scss/dollar-variable-pattern: /foo-.+/ */ -a { $boo-bar: 0; } -a { $fooBar: 0; } - -/* stylelint scss/dollar-variable-pattern: /[a-z][a-zA-Z]+/ */ -a { $foo-bar: 0; } -a { $FooBar: 0; } -a { $fooBar-baz: 0; } -``` - -The following patterns are *not* considered warnings: - -```scss -/* stylelint scss/dollar-variable-pattern: /foo-.+/ */ -a { $foo-bar: 0; } -a { $foo-bar-baz: 0; } -a { $foo-barBaz: 0; } -a { $boo-foo-bar: 0; } - -/* stylelint scss/dollar-variable-pattern: /[a-z][a-zA-Z]+/ */ -a { $fooBar: 0; } -a { $fooBarBaz: 0; } -``` - -## Optional Options - -### `ignore: "local"|"global"` - -#### `"local"` - -Makes this rule ignore local variables (variables defined inside a rule/mixin/function, etc.). - -The following patterns are *not* considered warnings: - -```scss -/* stylelint scss/dollar-variable-pattern: [/^foo-/, {"ignore": "local"}] */ -$foo-name00: 10px; -a { $bar-name01: 10px; } -``` - -#### `"global"` - -Makes this rule ignore global variables (variables defined in the stylesheet root). - -The following patterns are *not* considered warnings: - -```scss -/* stylelint scss/dollar-variable-pattern: [/^foo-/, {"ignore": "global"}] */ -$bar-name01: 10px; -a { $foo-name02: 10px; } -``` diff --git a/node_modules/stylelint-scss/src/rules/dollar-variable-pattern/index.js b/node_modules/stylelint-scss/src/rules/dollar-variable-pattern/index.js deleted file mode 100644 index 81b44489f..000000000 --- a/node_modules/stylelint-scss/src/rules/dollar-variable-pattern/index.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const { isRegExp, isString } = require("../../utils/validateTypes"); -const namespace = require("../../utils/namespace"); -const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("dollar-variable-pattern"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected $ variable name to match specified pattern" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(pattern, options) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: pattern, - possible: [isRegExp, isString] - }, - { - actual: options, - possible: { - ignore: ["local", "global"] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - const regexpPattern = isString(pattern) ? new RegExp(pattern) : pattern; - - root.walkDecls(decl => { - const { prop } = decl; - - if (prop[0] !== "$") { - return; - } - - // If local or global variables need to be ignored - if ( - (optionsHaveIgnored(options, "global") && - decl.parent.type === "root") || - (optionsHaveIgnored(options, "local") && decl.parent.type !== "root") - ) { - return; - } - - if (regexpPattern.test(prop.slice(1))) { - return; - } - - utils.report({ - message: messages.expected, - node: decl, - result, - ruleName - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/README.md b/node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/README.md deleted file mode 100644 index 52bda18d1..000000000 --- a/node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/README.md +++ /dev/null @@ -1,203 +0,0 @@ -# double-slash-comment-empty-line-before - -Require or disallow an empty line before `//`-comments. - -```scss -a {} - /* ← */ -// comment /* ↑ */ -/** ↑ -* This line */ -``` - -The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule. - -This rule only works with SCSS-like [single-line comments](https://sass-lang.com/documentation/syntax/comments) and ignores: -* comments that are the very first nodes in a file; -* CSS comments (`/* */`); -* comments that are on the same line as some non-comment code (inline comments). - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -There *must always* be an empty line before `//`-comments. - -The following patterns are considered warnings: - -```scss -a {} -// comment -``` - -The following patterns are *not* considered warnings: - -```scss -a {} - -// comment -``` - -```scss -a {} // comment -``` - -### `"never"` - -There *must never* be an empty line before `//`-comments. - -The following patterns are considered warnings: - -```scss -a {} - -// comment -``` - -The following patterns are *not* considered warnings: - -```scss -a {} -// comment -``` - -```scss -a {} // comment -``` - -## Optional options - -### `except: ["first-nested", "inside-block"]` - -#### `"first-nested"` - -Reverse the primary option for `//`-comments that are nested and the first child of their parent node. - -For example, with `"always"`: - -The following patterns are considered warnings: - -```scss -a { - - // comment - color: pink; -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { - // comment - color: pink; -} -``` - -#### `"inside-block"` - -Reverse the primary option for `//`-comments that are inside a block. - -For example, with `"always"`: - -The following patterns are considered warnings: - -```scss -a { - background: pink; - - // comment - color: pink; -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { - background: pink; - // comment - color: pink; -} -``` - -### `ignore: ["between-comments", "stylelint-commands", "inside-block"]` - -#### `"between-comments"` - -Don't require an empty line before `//`-comments that are placed after other `//`-comments or CSS comments. - -For example, with `"always"`: - -The following patterns are *not* considered warnings: - -```scss -a { - background: pink; - - // comment - // comment - color: #eee; -} -``` - -```scss -a { - background: pink; - - /* comment */ - // comment - color: #eee; -} -``` - -#### `"stylelint-commands"` - -Ignore `//`-comments that deliver commands to stylelint, e.g. `// stylelint-disable color-no-hex`. - -For example, with `"always"`: - -The following patterns are considered warnings: - -```scss -a { - background: pink; - // not a stylelint command - color: #eee; -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { - background: pink; - // stylelint-disable color-no-hex - color: pink; -} -``` - -#### `"inside-block"` - -Ignore `//`-comments that are inside a block. - -For example, the following patterns are *not* considered warnings: - -```scss -a { - background: pink; - // comment - color: pink; -} -``` - -```scss -a { - background: pink; - - // comment - color: pink; -} -``` diff --git a/node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/index.js b/node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/index.js deleted file mode 100644 index 9a3bd20bd..000000000 --- a/node_modules/stylelint-scss/src/rules/double-slash-comment-empty-line-before/index.js +++ /dev/null @@ -1,151 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const addEmptyLineBefore = require("../../utils/addEmptyLineBefore"); -const isInlineComment = require("../../utils/isInlineComment"); -const namespace = require("../../utils/namespace"); -const optionsHaveException = require("../../utils/optionsHaveException"); -const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); -const removeEmptyLinesBefore = require("../../utils/removeEmptyLinesBefore"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("double-slash-comment-empty-line-before"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected empty line before comment", - rejected: "Unexpected empty line before comment" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -const stylelintCommandPrefix = "stylelint-"; - -function rule(expectation, options, context) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: expectation, - possible: ["always", "never"] - }, - { - actual: options, - possible: { - except: ["first-nested", "inside-block"], - ignore: ["stylelint-commands", "between-comments", "inside-block"] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - root.walkComments(comment => { - // Only process // comments - if (!comment.raws.inline && !comment.inline) { - return; - } - - if (isInlineComment(comment)) { - return; - } - - // Ignore the first node - if (comment === root.first) { - return; - } - - // Optionally ignore stylelint commands - if ( - comment.text.indexOf(stylelintCommandPrefix) === 0 && - optionsHaveIgnored(options, "stylelint-commands") - ) { - return; - } - - // Optionally ignore comments inside blocks - if ( - comment.parent !== root && - optionsHaveIgnored(options, "inside-block") - ) { - return; - } - - // Optionally ignore newlines between comments - const prev = comment.prev(); - - if ( - prev && - prev.type === "comment" && - optionsHaveIgnored(options, "between-comments") - ) { - return; - } - - const before = comment.raw("before"); - - const expectEmptyLineBefore = (() => { - if ( - optionsHaveException(options, "first-nested") && - comment.parent !== root && - comment === comment.parent.first - ) { - return false; - } - - // Reverse expectation for comments inside blocks - if ( - comment.parent !== root && - optionsHaveException(options, "inside-block") - ) { - return expectation === "never"; - } - - return expectation === "always"; - })(); - - const hasEmptyLineBefore = before.search(/\n\s*?\n/) !== -1; - - // Return if the expectation is met - if (expectEmptyLineBefore === hasEmptyLineBefore) { - return; - } - - if (context.fix) { - if (expectEmptyLineBefore && !hasEmptyLineBefore) { - addEmptyLineBefore(comment, context.newline); - - return; - } - - if (!expectEmptyLineBefore && hasEmptyLineBefore) { - removeEmptyLinesBefore(comment, context.newline); - - return; - } - } - - const message = expectEmptyLineBefore - ? messages.expected - : messages.rejected; - - utils.report({ - message, - node: comment, - result, - ruleName - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/double-slash-comment-inline/README.md b/node_modules/stylelint-scss/src/rules/double-slash-comment-inline/README.md deleted file mode 100644 index c4ddef648..000000000 --- a/node_modules/stylelint-scss/src/rules/double-slash-comment-inline/README.md +++ /dev/null @@ -1,110 +0,0 @@ -# double-slash-comment-inline - -Require or disallow `//`-comments to be inline comments. - -```scss -a { - width: 10px; // inline-comment -/* ↑ - * Such comments */ -``` - -An inline comment in terms of this rule is a comment that is placed on the same line with any other code, either before or after it. - -This rule only works with SCSS-like [single-line comments](https://sass-lang.com/documentation/syntax/comments) and ignores CSS comments (`/* */`). - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -`//`-comments *must always* be inline comments. - -The following patterns are considered warnings: - -```scss -// comment -a { width: 10px; } -``` - -```scss -a { - // comment - width: 10px; -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { // comment - width: 10px; -} -``` - -```scss -a { - width: 10px; // comment -} -``` - -```scss -a, // comment -b { - width: 10px; -} -``` - -### `"never"` - -`//`-comments *must never* be inline comments. - -The following patterns are considered warnings: - -```scss -a { - width: 10px; // comment -} -``` - -```scss -a, // comment -b { - width: 10px; -} -``` - -The following patterns are *not* considered warnings: - -```scss -// comment -a { width: 10px; } -``` - -```scss -a { - // comment - width: 10px; -} -``` - -## Optional options - -### `ignore: ["stylelint-commands"]` - -#### `"stylelint-commands"` - -Ignore `//`-comments that deliver commands to stylelint, e.g. `// stylelint-disable color-no-hex`. - -For example, with `"always"`: - -The following patterns are *not* considered warnings: - -```scss -a { - background: pink; - // stylelint-disable color-no-hex - color: pink; -} -``` diff --git a/node_modules/stylelint-scss/src/rules/double-slash-comment-inline/index.js b/node_modules/stylelint-scss/src/rules/double-slash-comment-inline/index.js deleted file mode 100644 index 75f4483e6..000000000 --- a/node_modules/stylelint-scss/src/rules/double-slash-comment-inline/index.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const eachRoot = require("../../utils/eachRoot"); -const findCommentsInRaws = require("../../utils/findCommentsInRaws"); -const namespace = require("../../utils/namespace"); -const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("double-slash-comment-inline"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected //-comment to be inline comment", - rejected: "Unexpected inline //-comment" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -const stylelintCommandPrefix = "stylelint-"; - -function rule(expectation, options) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: expectation, - possible: ["always", "never"] - }, - { - actual: options, - possible: { - ignore: ["stylelint-commands"] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - eachRoot(root, checkRoot); - - function checkRoot(root) { - const rootString = root.source.input.css; - - if (rootString.trim() === "") { - return; - } - - const comments = findCommentsInRaws(rootString); - - comments.forEach(comment => { - // Only process // comments - if (comment.type !== "double-slash") { - return; - } - - // Optionally ignore stylelint commands - if ( - comment.text.indexOf(stylelintCommandPrefix) === 0 && - optionsHaveIgnored(options, "stylelint-commands") - ) { - return; - } - - const isInline = comment.inlineAfter || comment.inlineBefore; - let message; - - if (isInline && expectation === "never") { - message = messages.rejected; - } else if (!isInline && expectation === "always") { - message = messages.expected; - } else { - return; - } - - utils.report({ - message, - node: root, - index: comment.source.start, - result, - ruleName - }); - }); - } - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/README.md b/node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/README.md deleted file mode 100644 index aa99fd778..000000000 --- a/node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# double-slash-comment-whitespace-inside - -Require or disallow whitespace after the `//` in `//`-comments - -```scss -a { - width: 10px; // inline-comment -/* ↑ - * Such whitespace */ -``` - -This rule only works with SCSS-like [single-line comments](https://sass-lang.com/documentation/syntax/comments) and ignores CSS comments (`/* */`). - -Any number of slashes are allowed at the beginning of the comment. So `/// comment` is treated the same way as `// comment`. - -Note that a newline is not possible as a whitespace in terms of this rule as `//`-comments are intended to be single-line. - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -There *must always* be whitespace after the `//` inside `//`-comments. - -The following patterns are considered warnings: - -```scss -//comment -``` - -The following patterns are *not* considered warnings: - -```scss -// comment -``` - -```scss -/// comment -``` - -### `"never"` - -There *must never* be whitespace after the `//` inside `//`-comments. - -The following patterns are considered warnings: - -```scss -// comment -``` - -The following patterns are *not* considered warnings: - -```scss -//comment -``` - -```scss -///comment -``` diff --git a/node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/index.js b/node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/index.js deleted file mode 100644 index 213845eff..000000000 --- a/node_modules/stylelint-scss/src/rules/double-slash-comment-whitespace-inside/index.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const eachRoot = require("../../utils/eachRoot"); -const findCommentsInRaws = require("../../utils/findCommentsInRaws"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("double-slash-comment-whitespace-inside"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected a space after //", - rejected: "Unexpected space after //" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation, - possible: ["always", "never"] - }); - - if (!validOptions) { - return; - } - - eachRoot(root, checkRoot); - - function checkRoot(root) { - const rootString = root.source.input.css; - - if (rootString.trim() === "") { - return; - } - - const comments = findCommentsInRaws(rootString); - - comments.forEach(comment => { - // Only process // comments - if (comment.type !== "double-slash") { - return; - } - - // if it's `//` - no warning whatsoever; if `// ` - then trailing - // whitespace rule will govern this - if (comment.text === "") { - return; - } - - let message; - - if (expectation === "never" && comment.raws.left !== "") { - message = messages.rejected; - } else if (comment.raws.left === "" && expectation === "always") { - message = messages.expected; - } else { - return; - } - - utils.report({ - message, - node: root, - index: comment.source.start + comment.raws.startToken.length, - result, - ruleName - }); - }); - } - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/function-color-relative/README.md b/node_modules/stylelint-scss/src/rules/function-color-relative/README.md deleted file mode 100644 index 36d4a7629..000000000 --- a/node_modules/stylelint-scss/src/rules/function-color-relative/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# function-color-relative - -Encourage the use of the [scale-color](https://sass-lang.com/documentation/modules/color#scale-color) over: - -* [darken](https://sass-lang.com/documentation/modules/color#darken) -* [desaturate](https://sass-lang.com/documentation/modules/color#desaturate) -* [fade-in](https://sass-lang.com/documentation/modules/color#fade-in) -* [fade-out](https://sass-lang.com/documentation/modules/color#fade-out) -* [lighten](https://sass-lang.com/documentation/modules/color#lighten) -* [opacify](https://sass-lang.com/documentation/modules/color#opacify) -* [saturate](https://sass-lang.com/documentation/modules/color#saturate) -* [transparentize](https://sass-lang.com/documentation/modules/color#transparentize) - -```scss -p { - color: saturate(blue, 20%); - /** ↑ ↑ - * This function should be scale-color - */ -} -``` - -## Options - -### `true` - -The following patterns are considered violations: - -```scss -p { - color: saturate(blue, 20%); -} -``` - -```scss -p { - color: desaturate(blue, 20%); -} -``` - -```scss -p { - color: darken(blue, .2); -} -``` - -```scss -p { - color: lighten(blue, .2); -} -``` - -```scss -p { - color: opacify(blue, .2); -} -``` - -```scss -p { - color: fade-in(blue, .2); -} -``` - -```scss -p { - color: transparentize(blue, .2); -} -``` - -```scss -p { - color: fade-out(blue, .2); -} -``` - -The following patterns are _not_ considered violations: - -```scss - p { - color: scale-color(blue, $alpha: -40%); - } -``` diff --git a/node_modules/stylelint-scss/src/rules/function-color-relative/index.js b/node_modules/stylelint-scss/src/rules/function-color-relative/index.js deleted file mode 100644 index 86c4718c6..000000000 --- a/node_modules/stylelint-scss/src/rules/function-color-relative/index.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; - -const valueParser = require("postcss-value-parser"); -const { utils } = require("stylelint"); -const declarationValueIndex = require("../../utils/declarationValueIndex"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("function-color-relative"); - -const messages = utils.ruleMessages(ruleName, { - rejected: "Expected the scale-color function to be used" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -const function_names = [ - "saturate", - "desaturate", - "darken", - "lighten", - "opacify", - "fade-in", - "transparentize", - "fade-out" -]; - -function isColorFunction(node) { - return node.type === "function" && function_names.includes(node.value); -} - -function rule(primary) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: primary - }); - - if (!validOptions) { - return; - } - - root.walkDecls(decl => { - valueParser(decl.value).walk(node => { - // Verify that we're only looking at functions. - if (node.type !== "function" || node.value === "") { - return; - } - - const isFilter = decl.prop === "filter"; - const isSassColorFunction = !isFilter && isColorFunction(node); - const isDSFilterColorFunction = - isFilter && - node.value === "drop-shadow" && - node.nodes.some(isColorFunction); - - if (isSassColorFunction || isDSFilterColorFunction) { - const nodes = isDSFilterColorFunction - ? node.nodes.filter(isColorFunction) - : [node]; - - nodes.forEach(node => { - utils.report({ - message: messages.rejected, - node: decl, - index: declarationValueIndex(decl) + node.sourceIndex, - result, - ruleName - }); - }); - } - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/function-no-unknown/README.md b/node_modules/stylelint-scss/src/rules/function-no-unknown/README.md deleted file mode 100644 index 2d8a3cb8b..000000000 --- a/node_modules/stylelint-scss/src/rules/function-no-unknown/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# function-no-unknown - -Disallow unknown functions. Should be used **instead of** Stylelint's [function-no-unknown](https://stylelint.io/user-guide/rules/list/at-rule-no-unknown). - -```css -a { color: unknown(1); } -/** ↑ - * Functions like this */ -``` - -This rule is basically a wrapper around the mentioned core rule. You must disable Stylelint's core rule to make this rule work: - -```json -{ - "rules": { - "function-no-unknown": null, - "scss/function-no-unknown": true - } -} -``` - -## Options - -### `true` - -The following patterns are considered warnings: - -```css -a { color: unknown(1); } -``` - -The following patterns are *not* considered warnings: - -```css -a { color: hsl(240 100% 50%); } -``` - -```css -a { color: if(true, green, red); } -``` - -## Optional secondary options - -### `ignoreFunctions: ["/regex/", /regex/, "non-regex"]` - -Given: - -```json -["/^my-/i", "foo"] -``` - -The following patterns are *not* considered warnings: - -```css -a { color: my-func(1); } -``` - -```css -a { color: MY-FUNC(1); } -``` - -```css -a { color: foo(1); } -``` diff --git a/node_modules/stylelint-scss/src/rules/function-no-unknown/index.js b/node_modules/stylelint-scss/src/rules/function-no-unknown/index.js deleted file mode 100644 index 97a17dfb1..000000000 --- a/node_modules/stylelint-scss/src/rules/function-no-unknown/index.js +++ /dev/null @@ -1,133 +0,0 @@ -"use strict"; - -const valueParser = require("postcss-value-parser"); -const { rules, utils } = require("stylelint"); -const { ALL_FUNCTIONS } = require("../../utils/functions"); -const namespace = require("../../utils/namespace"); -const { isRegExp, isString } = require("../../utils/validateTypes"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleToCheckAgainst = "function-no-unknown"; - -const ruleName = namespace(ruleToCheckAgainst); - -const messages = utils.ruleMessages(ruleName, { - rejected: (...args) => { - return rules[ruleToCheckAgainst].messages - .rejected(...args) - .replace(` (${ruleToCheckAgainst})`, ""); - } -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function isNamespacedFunction(fn) { - const namespacedFunc = /^\w+\.\w+$/; - return namespacedFunc.test(fn); -} - -function isAtUseAsSyntax(nodes) { - const [first, second, third] = nodes.slice(-3); - return ( - first.type === "word" && - first.value === "as" && - second.type === "space" && - third.type === "word" - ); -} - -function getAtUseNamespace(nodes) { - if (isAtUseAsSyntax(nodes)) { - const [last] = nodes.slice(-1); - return last.value; - } - const [first] = nodes; - const parts = first.value.split("/"); - const [last] = parts.slice(-1); - return last; -} - -function rule(primaryOption, secondaryOptions) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: primaryOption - }, - { - actual: secondaryOptions, - possible: { - ignoreFunctions: [isString, isRegExp] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - const optionsFunctions = - (secondaryOptions && secondaryOptions.ignoreFunctions) || []; - const ignoreFunctions = ALL_FUNCTIONS.concat(optionsFunctions); - const ignoreFunctionsAsSet = new Set(ignoreFunctions); - const newSecondaryOptions = Object.assign({}, secondaryOptions, { - ignoreFunctions - }); - - utils.checkAgainstRule( - { - ruleName: ruleToCheckAgainst, - ruleSettings: [primaryOption, newSecondaryOptions], - root - }, - warning => { - const { node, index } = warning; - - // NOTE: Using `valueParser` is necessary for extracting a function name. This may be a performance waste. - valueParser(node.value).walk(valueNode => { - const { type, value: funcName } = valueNode; - - if (type !== "function" || funcName.trim() === "") { - return; - } - - if (isNamespacedFunction(funcName)) { - const atUseNamespaces = []; - - root.walkAtRules(/^use$/i, atRule => { - const { nodes } = valueParser(atRule.params); - atUseNamespaces.push(getAtUseNamespace(nodes)); - }); - - if (atUseNamespaces.length) { - const [namespace] = funcName.split("."); - if (atUseNamespaces.includes(namespace)) { - return; - } - } - } - - if (!ignoreFunctionsAsSet.has(funcName)) { - utils.report({ - message: messages.rejected(funcName), - ruleName, - result, - node, - index - }); - } - }); - } - ); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/README.md b/node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/README.md deleted file mode 100644 index b26b03d72..000000000 --- a/node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# function-quote-no-quoted-strings-inside - -Disallow quoted strings inside the [quote function](https://sass-lang.com/documentation/modules/string#quote) - -```scss -p { - font-family: quote("Helvetica"); - /** ↑ ↑ - * These quotes are unnecessary - */ -} -``` - -## Options - -### `true` - -The following patterns are considered violations: - -```scss -a { - font-family: quote("Helvetica"); -} -``` - -```scss -$font: "Helvetica"; -p { - font-family: quote($font); -} -``` - -The following patterns are _not_ considered violations: - -```scss -a { - color: quote(blue); -} -``` - -```scss -$font: Helvetica; -p { - font-family: quote($font); -} -``` diff --git a/node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/index.js b/node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/index.js deleted file mode 100644 index b0c91a895..000000000 --- a/node_modules/stylelint-scss/src/rules/function-quote-no-quoted-strings-inside/index.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; - -const valueParser = require("postcss-value-parser"); -const { utils } = require("stylelint"); -const declarationValueIndex = require("../../utils/declarationValueIndex"); -const isNativeCssFunction = require("../../utils/isNativeCssFunction"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("function-quote-no-quoted-strings-inside"); - -const messages = utils.ruleMessages(ruleName, { - rejected: "Quote function used with an already-quoted string" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(primary, _, context) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: primary - }); - - if (!validOptions) { - return; - } - - // Setup variable naming. - const vars = {}; - - root.walkDecls(decl => { - if (decl.prop[0] !== "$") { - return; - } - - valueParser(decl.value).walk(node => { - vars[decl.prop] = node.type; - }); - }); - - root.walkDecls(decl => { - valueParser(decl.value).walk(node => { - // Verify that we're only looking at functions. - if ( - node.type !== "function" || - isNativeCssFunction(node.value) || - node.value === "" - ) { - return; - } - - // Verify we're only looking at quote() calls. - if (node.value !== "quote") { - return; - } - - // Report error if first character is a quote. - // postcss-value-parser represents quoted strings as type 'string' (as opposed to word) - if (node.nodes[0].quote || vars[node.nodes[0].value] === "string") { - if (context.fix) { - const contents = decl.value.match(/quote\((.*)\)/); - decl.value = decl.value.replace(/quote\(.*\)/, contents[1]); - } else { - utils.report({ - message: messages.rejected, - node: decl, - index: declarationValueIndex(decl) + node.sourceIndex, - result, - ruleName - }); - } - } - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/README.md b/node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/README.md deleted file mode 100644 index 79537d918..000000000 --- a/node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# function-unquote-no-unquoted-strings-inside - -Disallow unquoted strings inside the [unquote function](https://sass-lang.com/documentation/modules/string#unquote) - -```scss -p { - font-family: unquote(Helvetica); - /** ↑ ↑ - * This function call is unnecessary - */ -} -``` - -## Options - -### `true` - -The following patterns are considered violations: - -```scss -a { - font-family: unquote(Helvetica); -} -``` - -```scss -$font: Helvetica; -p { - font-family: unquote($font); -} -``` - -The following patterns are _not_ considered violations: - -```scss -a { - color: unquote("blue"); -} -``` - -```scss -$font: "Helvetica"; -p { - font-family: unquote($font); -} -``` diff --git a/node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/index.js b/node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/index.js deleted file mode 100644 index 1caded7f4..000000000 --- a/node_modules/stylelint-scss/src/rules/function-unquote-no-unquoted-strings-inside/index.js +++ /dev/null @@ -1,88 +0,0 @@ -"use strict"; - -const valueParser = require("postcss-value-parser"); -const { utils } = require("stylelint"); -const declarationValueIndex = require("../../utils/declarationValueIndex"); -const isNativeCssFunction = require("../../utils/isNativeCssFunction"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("function-unquote-no-unquoted-strings-inside"); - -const messages = utils.ruleMessages(ruleName, { - rejected: "Unquote function used with an already-unquoted string" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(primary, _, context) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: primary - }); - - if (!validOptions) { - return; - } - - // Setup variable naming. - const vars = {}; - - root.walkDecls(decl => { - if (decl.prop[0] !== "$") { - return; - } - - valueParser(decl.value).walk(node => { - vars[decl.prop] = node.type; - }); - }); - - root.walkDecls(decl => { - valueParser(decl.value).walk(node => { - // Verify that we're only looking at functions. - if ( - node.type !== "function" || - isNativeCssFunction(node.value) || - node.value === "" - ) { - return; - } - - // Verify we're only looking at quote() calls. - if (node.value !== "unquote") { - return; - } - - // Report error if first character is a quote. - // postcss-value-parser represents quoted strings as type 'string' (as opposed to word) - if ( - (!node.nodes[0].quote && node.nodes[0].value[0] !== "$") || - vars[node.nodes[0].value] === "word" - ) { - if (context.fix) { - const contents = /unquote\((.*)\)/.exec(decl.value); - - decl.value = contents[1]; - } else { - utils.report({ - message: messages.rejected, - node: decl, - index: declarationValueIndex(decl) + node.sourceIndex, - result, - ruleName - }); - } - } - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/index.js b/node_modules/stylelint-scss/src/rules/index.js deleted file mode 100644 index 7d99314b5..000000000 --- a/node_modules/stylelint-scss/src/rules/index.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; - -const rules = { - "at-each-key-value-single-line": require("./at-each-key-value-single-line"), - "at-else-closing-brace-newline-after": require("./at-else-closing-brace-newline-after"), - "at-else-closing-brace-space-after": require("./at-else-closing-brace-space-after"), - "at-else-empty-line-before": require("./at-else-empty-line-before"), - "at-else-if-parentheses-space-before": require("./at-else-if-parentheses-space-before"), - "at-extend-no-missing-placeholder": require("./at-extend-no-missing-placeholder"), - "at-function-named-arguments": require("./at-function-named-arguments"), - "at-function-parentheses-space-before": require("./at-function-parentheses-space-before"), - "at-function-pattern": require("./at-function-pattern"), - "at-if-closing-brace-newline-after": require("./at-if-closing-brace-newline-after"), - "at-if-closing-brace-space-after": require("./at-if-closing-brace-space-after"), - "at-if-no-null": require("./at-if-no-null"), - "at-import-no-partial-leading-underscore": require("./at-import-no-partial-leading-underscore"), - "at-import-partial-extension-blacklist": require("./at-import-partial-extension-blacklist"), - "at-import-partial-extension-whitelist": require("./at-import-partial-extension-whitelist"), - "at-import-partial-extension": require("./at-import-partial-extension"), - "at-mixin-argumentless-call-parentheses": require("./at-mixin-argumentless-call-parentheses"), - "at-mixin-named-arguments": require("./at-mixin-named-arguments"), - "at-mixin-parentheses-space-before": require("./at-mixin-parentheses-space-before"), - "at-mixin-pattern": require("./at-mixin-pattern"), - "at-rule-conditional-no-parentheses": require("./at-rule-conditional-no-parentheses"), - "at-rule-no-unknown": require("./at-rule-no-unknown"), - "at-use-no-unnamespaced": require("./at-use-no-unnamespaced"), - "comment-no-empty": require("./comment-no-empty"), - "comment-no-loud": require("./comment-no-loud"), - "declaration-nested-properties-no-divided-groups": require("./declaration-nested-properties-no-divided-groups"), - "declaration-nested-properties": require("./declaration-nested-properties"), - "dimension-no-non-numeric-values": require("./dimension-no-non-numeric-values"), - "dollar-variable-colon-newline-after": require("./dollar-variable-colon-newline-after"), - "dollar-variable-colon-space-after": require("./dollar-variable-colon-space-after"), - "dollar-variable-colon-space-before": require("./dollar-variable-colon-space-before"), - "dollar-variable-default": require("./dollar-variable-default"), - "dollar-variable-empty-line-after": require("./dollar-variable-empty-line-after"), - "dollar-variable-empty-line-before": require("./dollar-variable-empty-line-before"), - "dollar-variable-first-in-block": require("./dollar-variable-first-in-block"), - "dollar-variable-no-missing-interpolation": require("./dollar-variable-no-missing-interpolation"), - "dollar-variable-no-namespaced-assignment": require("./dollar-variable-no-namespaced-assignment"), - "dollar-variable-pattern": require("./dollar-variable-pattern"), - "double-slash-comment-empty-line-before": require("./double-slash-comment-empty-line-before"), - "double-slash-comment-inline": require("./double-slash-comment-inline"), - "double-slash-comment-whitespace-inside": require("./double-slash-comment-whitespace-inside"), - "function-color-relative": require("./function-color-relative"), - "function-no-unknown": require("./function-no-unknown"), - "function-quote-no-quoted-strings-inside": require("./function-quote-no-quoted-strings-inside"), - "function-unquote-no-unquoted-strings-inside": require("./function-unquote-no-unquoted-strings-inside"), - "map-keys-quotes": require("./map-keys-quotes"), - "media-feature-value-dollar-variable": require("./media-feature-value-dollar-variable"), - "no-dollar-variables": require("./no-dollar-variables"), - "no-duplicate-dollar-variables": require("./no-duplicate-dollar-variables"), - "no-duplicate-mixins": require("./no-duplicate-mixins"), - "no-global-function-names": require("./no-global-function-names"), - "operator-no-newline-after": require("./operator-no-newline-after"), - "operator-no-newline-before": require("./operator-no-newline-before"), - "operator-no-unspaced": require("./operator-no-unspaced"), - "partial-no-import": require("./partial-no-import"), - "percent-placeholder-pattern": require("./percent-placeholder-pattern"), - "selector-nest-combinators": require("./selector-nest-combinators"), - "selector-no-redundant-nesting-selector": require("./selector-no-redundant-nesting-selector"), - "selector-no-union-class-name": require("./selector-no-union-class-name") -}; - -module.exports = rules; diff --git a/node_modules/stylelint-scss/src/rules/map-keys-quotes/README.md b/node_modules/stylelint-scss/src/rules/map-keys-quotes/README.md deleted file mode 100644 index 087177ebe..000000000 --- a/node_modules/stylelint-scss/src/rules/map-keys-quotes/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# map-keys-quotes - -Require quoted keys in Sass maps. - -```scss -$test: (Helvetica: 14px, Arial: 25px); - /** ↑ ↑ - * These words should be quoted. - */ -``` - -## Options - -### `always` - -The following patterns are considered violations: - -```scss -$test: (Helvetica: 14px, Arial: 25px); -``` - -The following patterns are _not_ considered violations: - -```scss -$test: ("foo": 14px, "bar": 25px); -``` diff --git a/node_modules/stylelint-scss/src/rules/map-keys-quotes/index.js b/node_modules/stylelint-scss/src/rules/map-keys-quotes/index.js deleted file mode 100644 index b5952c7f4..000000000 --- a/node_modules/stylelint-scss/src/rules/map-keys-quotes/index.js +++ /dev/null @@ -1,101 +0,0 @@ -"use strict"; - -const valueParser = require("postcss-value-parser"); -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("map-keys-quotes"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Expected keys in map to be quoted." -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -const mathOperators = ["+", "/", "-", "*", "%"]; - -function rule(primary) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: primary, - possible: ["always"] - }); - - if (!validOptions) { - return; - } - - root.walkDecls(decl => { - if (decl.prop[0] !== "$") { - return; - } - - valueParser(decl.value).walk(node => { - if ( - node.type === "function" && - node.value === "" && - isMap(node.nodes) - ) { - // Identify all of the map-keys and see if they're strings (not words). - const mapKeys = returnMapKeys(node.nodes); - - mapKeys.forEach(map_key => { - if (mathOperators.includes(map_key.value)) { - return; - } - - if (map_key.type === "word" && isNaN(map_key.value)) { - utils.report({ - message: messages.expected, - node: decl, - result, - ruleName - }); - } - }); - } - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -// Takes in a list of map nodes and identifies if they are a map. -// A map is identified by the pattern: [string/word colon(div) anything comma(div) ...] -function isMap(nodes) { - if (nodes.length < 4) { - return false; - } - - if (nodes[0].type !== "word" && nodes[0].type !== "string") { - return false; - } - - if (nodes[1].value !== ":") { - return false; - } - - if (nodes[3].value !== ",") { - return false; - } - - return true; -} - -function returnMapKeys(array) { - const new_array = []; - - for (let i = 0; i < array.length; i += 4) { - new_array.push(array[i]); - } - - return new_array; -} - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/README.md b/node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/README.md deleted file mode 100644 index c7674e8db..000000000 --- a/node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# media-feature-value-dollar-variable - -Require a media feature value be a `$`-variable or disallow `$`-variables in media feature values. - -```scss -@media (max-width: $var) { a { color: red; } } -// ↑ -// Require or disallow this -} -``` - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -A media feature value *must consist* of just a single `$`-variable (possibly with interpolation). - -The following patterns are considered warnings: - -```scss -@media (max-width: 300px) { b { color: red; } } -``` - -```scss -@media (max-width: $var + 10px) { b { color: red; } } -``` - -```scss -@media screen and (max-width: $var), or (min-width: 100px){ b { color: red; } } -``` - -```scss -@media screen and (max-width: #{$val} + 10px) { a { display: none; } } -``` - -```scss -@media screen and (max-width: #{$val + $x} ) { a { display: none; } } -``` - -```scss -@media screen and (min-width: funcName($p)){ b { color: red; } } -``` - -The following patterns are *not* considered warnings: - -```scss -@media ( max-width: $var ) {b { color: red; }} -``` - -```scss -@media ( max-width: #{$var}) {b { color: red; }} -``` - -### `"never"` - -There *must never* be a `$`-variable in a media feature value. Even as a parameter to a function call. - -The following patterns are considered warnings: - -```scss -@media screen and (min-width: $var){ b { color: red; } } -``` - -```scss -@media screen and (min-width: 100px + $var){ b { color: red; } } -``` - -```scss -@media screen and (min-width: funcName($var)){ b { color: red; } } -``` - -The following patterns are *not* considered warnings: - -```scss -@media screen and (min-width: 100px){ b { color: red; } } -``` - -```scss -@media screen and (min-width: 100px + 10px){ b { color: red; } } -``` - -```scss -@media screen and (min-width: funcName(10px)){ b { color: red; } } -``` - -## Optional options - -### `ignore: ["keywords"]` - -#### `"keywords"` - -Ignore keyword values like `none`, `dark`, `fine`, `srgb`. - -For example, with `"always"`: - -The following patterns are *not* considered warnings: - -```scss -@media screen and (max-width: $var) and (pointer: fine) { - a { display: none; } -} -``` diff --git a/node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/index.js b/node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/index.js deleted file mode 100644 index 7100379a1..000000000 --- a/node_modules/stylelint-scss/src/rules/media-feature-value-dollar-variable/index.js +++ /dev/null @@ -1,109 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const optionsHaveIgnored = require("../../utils/optionsHaveIgnored"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("media-feature-value-dollar-variable"); - -const messages = utils.ruleMessages(ruleName, { - rejected: "Unexpected dollar-variable as a media feature value", - expected: - "Expected a dollar-variable (e.g. $var) to be used as a media feature value" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation, options) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: expectation, - possible: ["always", "never"] - }, - { - actual: options, - possible: { - ignore: ["keywords"] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - const valueRegex = /:\s*(\S.+?)(:?\s*)\)/; - // In `(max-width: 10px )` find `: 10px )`. - // Got to go with that (the global search doesn't remember parens' insides) - // and parse it again afterwards to remove trailing junk - const valueRegexGlobal = new RegExp(valueRegex.source, "g"); - // `$var-name_sth` - const variableRegex = /^(\w+\.)?\$[\w-]+$/; - // `#{$var-name_sth}` - const interpolationVarRegex = /^#{\s*(\w+\.)?\$\w+\s*}$/; - // `none`, `dark` - const keywordValueRegex = /^[a-z][a-z\d-]*$/; - - root.walkAtRules("media", atRule => { - const found = atRule.params.match(valueRegexGlobal); - - // If there are no values - if (!found || !found.length) { - return; - } - - found.forEach(found => { - // ... parse `: 10px )` to `10px` - const valueParsed = found.match(valueRegex)[1]; - - // Just a shorthand to stylelint.utils.report() - function complain(message) { - utils.report({ - ruleName, - result, - node: atRule, - word: valueParsed, - message - }); - } - - // Keyword values, like `none`, should always be fine if keywords are - // ignored. - if ( - keywordValueRegex.test(valueParsed) && - optionsHaveIgnored(options, "keywords") - ) { - return; - } - - // A value should be a single variable - // or it should be a single variable inside Sass interpolation - if ( - expectation === "always" && - !( - variableRegex.test(valueParsed) || - interpolationVarRegex.test(valueParsed) - ) - ) { - complain(messages.expected); - } else if (expectation === "never" && valueParsed.includes("$")) { - // "Never" means no variables at all (functions allowed) - complain(messages.rejected); - } - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/no-dollar-variables/README.md b/node_modules/stylelint-scss/src/rules/no-dollar-variables/README.md deleted file mode 100644 index bb282bf7c..000000000 --- a/node_modules/stylelint-scss/src/rules/no-dollar-variables/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# no-dollar-variables - -Disallow dollar variables within a stylesheet. - -```scss - $a: 1; -/** ↑ - * These dollar variables */ -``` - -## Options - -### `true` - -The following patterns are considered violations: - -```scss -$a: 1; -``` - -```scss -$a: 1; -$b: 2; -``` - -```scss -.b { - $a: 1; -} -``` - -The following patterns are *not* considered violations: - -```scss -a { - color: blue; -} -``` diff --git a/node_modules/stylelint-scss/src/rules/no-dollar-variables/index.js b/node_modules/stylelint-scss/src/rules/no-dollar-variables/index.js deleted file mode 100644 index a07724f78..000000000 --- a/node_modules/stylelint-scss/src/rules/no-dollar-variables/index.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("no-dollar-variables"); - -const messages = utils.ruleMessages(ruleName, { - rejected: variable => `Unexpected dollar variable ${variable}` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(value) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: value - }); - - if (!validOptions) { - return; - } - - root.walkDecls(decl => { - if (decl.prop[0] !== "$") { - return; - } - - utils.report({ - message: messages.rejected(decl.prop), - node: decl, - result, - ruleName - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/README.md b/node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/README.md deleted file mode 100644 index 2b56dfb96..000000000 --- a/node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/README.md +++ /dev/null @@ -1,212 +0,0 @@ -# no-duplicate-dollar-variables - -Disallow duplicate dollar variables within a stylesheet. - -```scss -$a: 1; -$a: 2; -/** ↑ - * These are duplicates */ -``` - -A dollar variable is considered a duplicate if it shadows a variable of the same name (see the [Sass documentation](https://sass-lang.com/documentation/variables#shadowing)). Two dollar variables are not duplicates if their scopes are unrelated. - -```scss -.one { - $a: 1; - /** ↑ - * Not a duplicate */ -} -.two { - $a: 2; - /** ↑ - * Not a duplicate */ -} -``` - -A dollar variable is **not** considered a duplicate if it contains the `!default` keyword (see the [Sass documentation](https://sass-lang.com/documentation/variables#default-values)). Two dollar variables are duplicates if they both contain `!default` keyword. - -```scss -$a: 1; -$a: 5 !default; -/** ↑ - * Not a duplicate */ - -$b: 1 !default; -$b: 5 !default; -/** ↑ - * These are duplicates */ -``` - - - -## Options - -### `true` - -The following patterns are considered violations: - -```scss -$a: 1; -$a: 2; -``` - -```scss -$a: 1; -$b: 2; -$a: 3; -``` - -```scss -$a: 1; -.b { - $a: 1; -} -``` - -```scss -$a: 1; -.b { - .c { - $a: 1; - } -} -``` - -```scss -$a: 1; -@mixin b { - $a: 1; -} -``` - -The following patterns are _not_ considered violations: - -```scss -$a: 1; -$b: 2; -``` - -```scss -$a: 1; -.b { - $b: 2; -} -``` - -___ - -### `ignoreInside: ["at-rule", "nested-at-rule"]` - -#### `"at-rule"` - -Ignores dollar variables that are inside both nested and non-nested at-rules (`@media`, `@mixin`, etc.). - -Given: - -```json -{ "ignoreInside": ["at-rule"] } -``` - -The following patterns are _not_ considered warnings: - -```scss -$a: 1; -@mixin c { - $a: 1; -} -``` - -```scss -$a: 1; -.b { - @mixin c { - $a: 1; - } -} -``` - -#### `"nested-at-rule"` - -Ignores dollar variables that are inside nested at-rules (`@media`, `@mixin`, etc.). - -Given: - -```json -{ "ignoreInside": ["nested-at-rule"] } -``` - -The following patterns are _not_ considered warnings: - -```scss -$a: 1; -.b { - @mixin c { - $a: 1; - } -} -``` - -___ - -### `ignoreInsideAtRules: ["array", "of", "at-rules"]` - -Ignores all variables that are inside specified at-rules. - -Given: - -```json -{ "ignoreInsideAtRules": ["if", "mixin"] } -``` - -The following patterns are _not_ considered warnings: - -```scss -$a: 1; - -@mixin b { - $a: 2; -} -``` - -```scss -$a: 1; - -@if (true) { - $a: 2; -} -``` - -___ - -### `ignoreDefaults: [boolean]` - -Ignore all variables containing the `!default` keyword. - -Given: - -```json -{ "ignoreDefaults": true } -``` - -The following patterns are _not_ considered warnings: - -```scss -$a: 5 !default; -$a: $a + 1; - -$a: 15 !default; -``` - -Given: - -```json -{ "ignoreDefaults": false } -``` - -The following patterns are considered warnings: - -```scss -$a: 5 !default; -$a: 1; -``` diff --git a/node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/index.js b/node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/index.js deleted file mode 100644 index e38ba55c8..000000000 --- a/node_modules/stylelint-scss/src/rules/no-duplicate-dollar-variables/index.js +++ /dev/null @@ -1,194 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const { isBoolean } = require("../../utils/validateTypes"); -const { isString } = require("../../utils/validateTypes"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("no-duplicate-dollar-variables"); - -const messages = utils.ruleMessages(ruleName, { - rejected: variable => `Unexpected duplicate dollar variable ${variable}` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(value, secondaryOptions) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { - actual: value - }, - { - actual: secondaryOptions, - possible: { - ignoreInside: ["at-rule", "nested-at-rule"], - ignoreInsideAtRules: [isString], - ignoreDefaults: [isBoolean] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - const vars = {}; - - /** - * Traverse the [vars] tree through the path defined by [ancestors], creating nodes as needed. - * @param {*} ancestors - * @returns the tree of the node defined by the last of [ancestors]. - */ - function getScope(ancestors) { - let scope = vars; - - for (const node of ancestors) { - if (!(node in scope)) { - scope[node] = {}; - } - - scope = scope[node]; - } - - return scope; - } - - /** - * Iterates through the ancestors while checking each scope until the [variable] is found. - * If not found, an object with empty values is returned. - * @param {*} ancestors - * @param {string} variable the variable name. - * @returns The previously declared variable data or an object with empty values. - */ - function getVariableData(ancestors, variable) { - let scope = vars; - - for (const node of ancestors) { - scope = scope[node]; - - if (scope[variable]) { - return scope[variable]; - } - } - - return { - defaultCount: 0, - isDeclared: false - }; - } - - /** - * Checks whether the given [variableData] is declared. - * @param {{ defaultCount: number; isDeclared: boolean; }} variableData the variable data - * containing default count and if the variable is declared. - * @param {boolean} isDefault if the variable contains the `!default` keyword. - * @param {boolean | number} ignoreDefaults the ignore defaults options. - * @returns true if declared. - */ - function isDeclared(variableData, isDefault, ignoreDefaults) { - if (isDefault) { - if (Number.isFinite(ignoreDefaults)) { - return variableData.defaultCount >= ignoreDefaults; - } else if (ignoreDefaults) { - return false; - } - } - - return variableData.isDeclared; - } - - /** - * Processes the variable data based on the given arguments. - * @param {{ defaultCount: number; isDeclared: boolean; }} variableData the variable data - * containing default count and if the variable is declared. - * @param {boolean} isDefault if the variable contains the `!default` keyword. - * @param {boolean | number} ignoreDefaults the ignore defaults options. - * @returns the updated `variableData`. - */ - function processVariableData(variableData, isDefault, ignoreDefaults) { - return { - defaultCount: isDefault - ? ++variableData.defaultCount - : variableData.defaultCount, - isDeclared: - isDefault && ignoreDefaults !== false ? variableData.isDeclared : true - }; - } - - const ignoreDefaults = - secondaryOptions && secondaryOptions.ignoreDefaults !== undefined - ? secondaryOptions.ignoreDefaults - : 1; - - root.walkDecls(decl => { - const isVar = decl.prop[0] === "$"; - const isInsideIgnoredAtRule = - decl.parent.type === "atrule" && - secondaryOptions && - secondaryOptions.ignoreInside && - secondaryOptions.ignoreInside === "at-rule"; - const isInsideIgnoredNestedAtRule = - decl.parent.type === "atrule" && - decl.parent.parent.type !== "root" && - secondaryOptions && - secondaryOptions.ignoreInside && - secondaryOptions.ignoreInside === "nested-at-rule"; - const isInsideIgnoredSpecifiedAtRule = - decl.parent.type === "atrule" && - secondaryOptions && - secondaryOptions.ignoreInsideAtRules && - secondaryOptions.ignoreInsideAtRules.includes(decl.parent.name); - - if ( - !isVar || - isInsideIgnoredAtRule || - isInsideIgnoredNestedAtRule || - isInsideIgnoredSpecifiedAtRule - ) { - return; - } - - const ancestors = []; - let parent = decl.parent; - - while (parent !== null && parent !== undefined) { - const parentKey = parent.toString(); - - ancestors.unshift(parentKey); - parent = parent.parent; - } - - const scope = getScope(ancestors); - const isDefault = /!default/.test(decl.value); - const variableData = getVariableData(ancestors, decl.prop); - - if (isDeclared(variableData, isDefault, ignoreDefaults)) { - utils.report({ - message: messages.rejected(decl.prop), - node: decl, - result, - ruleName - }); - } - - scope[decl.prop] = processVariableData( - variableData, - isDefault, - ignoreDefaults - ); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/no-duplicate-mixins/README.md b/node_modules/stylelint-scss/src/rules/no-duplicate-mixins/README.md deleted file mode 100644 index cdb7bb27c..000000000 --- a/node_modules/stylelint-scss/src/rules/no-duplicate-mixins/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# no-duplicate-mixins - -Disallow duplicate mixins within a stylesheet. - -```scss -@mixin font-size-default { - font-size: 16px; -} -@mixin font-size-default { - font-size: 18px; -} -/** ↑ - * These are duplicates */ -``` - -## Options - -### `true` - -The following patterns are considered violations: - -```scss -@mixin font-size-default { - font-size: 16px; -} -@mixin font-size-default { - font-size: 18px; -} -``` - -```scss -@mixin font-size-default { - font-size: 16px; -} -@mixin font-size-sm { - font-size: 14px; -} -@mixin font-size-default { - font-size: 18px; -} -``` - -```scss -@mixin font-size { - font-size: 16px; -} -@mixin font-size($var) { - font-size: $var; -} -``` - -```scss -@mixin font-size($property, $value) { - #{$property}: $value; -} -@mixin font-size($var) { - font-size: $var; -} -``` - -```scss -@mixin font-size { - color: blue; -} - -.b { - @mixin font-size { - color: red; - } - @include font-size; -} -``` - -The following patterns are _not_ considered violations: - -```scss -@mixin font-size-default { - font-size: 16px; -} -@mixin font-size-lg { - font-size: 18px; -} -``` diff --git a/node_modules/stylelint-scss/src/rules/no-duplicate-mixins/index.js b/node_modules/stylelint-scss/src/rules/no-duplicate-mixins/index.js deleted file mode 100644 index a1f84135e..000000000 --- a/node_modules/stylelint-scss/src/rules/no-duplicate-mixins/index.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const atRuleBaseName = require("../../utils/atRuleBaseName"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("no-duplicate-mixins"); - -const messages = utils.ruleMessages(ruleName, { - rejected: mixin => `Unexpected duplicate mixin ${mixin}` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(value) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: value - }); - - if (!validOptions) { - return; - } - - const mixins = {}; - - root.walkAtRules(decl => { - const isMixin = decl.name === "mixin"; - - if (!isMixin) { - return; - } - - const mixinName = atRuleBaseName(decl); - - if (mixins[mixinName]) { - utils.report({ - message: messages.rejected(mixinName), - node: decl, - result, - ruleName - }); - } - - mixins[mixinName] = true; - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/no-global-function-names/README.md b/node_modules/stylelint-scss/src/rules/no-global-function-names/README.md deleted file mode 100644 index fc98125cf..000000000 --- a/node_modules/stylelint-scss/src/rules/no-global-function-names/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# no-global-function-names - -Disallows the use of global function names, as these global functions are now located inside built-in Sass modules. - -A full list of disallowed names (and their alternatives) is located [here](https://github.com/sass/sass/blob/main/accepted/module-system.md#built-in-modules-1) - -It is recommended to use the [Sass migrator](https://sass-lang.com/documentation/cli/migrator) to change these global function names automatically. - -```scss -@use "sass:color"; -a { - background: color.adjust(#6b717f, $red: 15); -} -``` - -The following patterns are considered warnings: - -```scss -a { - background: adjust-color(#6b717f, $red: 15); -} -``` - -The following patterns are *not* considered warnings: - -```scss -@use "sass:color"; -a { - background: color.adjust(#6b717f, $red: 15); -} -``` \ No newline at end of file diff --git a/node_modules/stylelint-scss/src/rules/no-global-function-names/index.js b/node_modules/stylelint-scss/src/rules/no-global-function-names/index.js deleted file mode 100644 index 9d750d7a6..000000000 --- a/node_modules/stylelint-scss/src/rules/no-global-function-names/index.js +++ /dev/null @@ -1,203 +0,0 @@ -"use strict"; - -const valueParser = require("postcss-value-parser"); -const { utils } = require("stylelint"); -const declarationValueIndex = require("../../utils/declarationValueIndex"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const interpolationPrefix = /^#{\s*/m; - -const rules = { - red: "color", - blue: "color", - green: "color", - mix: "color", - hue: "color", - saturation: "color", - lightness: "color", - complement: "color", - "adjust-color": "color", - "scale-color": "color", - "change-color": "color", - "ie-hex-str": "color", - "map-get": "map", - "map-merge": "map", - "map-remove": "map", - "map-keys": "map", - "map-values": "map", - "map-has-key": "map", - unquote: "string", - quote: "string", - "str-length": "string", - "str-insert": "string", - "str-index": "string", - "str-slice": "string", - "to-upper-case": "string", - "to-lower-case": "string", - "unique-id": "string", - percentage: "math", - round: "math", - ceil: "math", - floor: "math", - abs: "math", - random: "math", - unit: "math", - unitless: "math", - comparable: "math", - length: "list", - nth: "list", - "set-nth": "list", - join: "list", - append: "list", - zip: "list", - index: "list", - "list-separator": "list", - "feature-exists": "meta", - "variable-exists": "meta", - "global-variable-exists": "meta", - "function-exists": "meta", - "mixin-exists": "meta", - inspect: "meta", - "get-function": "meta", - "type-of": "meta", - call: "meta", - "content-exists": "meta", - keywords: "meta", - "selector-nest": "selector", - "selector-append": "selector", - "selector-replace": "selector", - "selector-unify": "selector", - "is-superselector": "selector", - "simple-selectors": "selector", - "selector-parse": "selector", - "selector-extend": "selector", - lighten: "color", - "adjust-hue": "color", - darken: "color", - desaturate: "color", - opacify: "color", - transparentize: "color" -}; - -const new_rule_names = { - "adjust-color": "adjust", - "scale-color": "scale", - "change-color": "change", - "map-get": "get", - "map-merge": "merge", - "map-remove": "remove", - "map-keys": "keys", - "map-values": "values", - "map-has-key": "has-key", - "str-length": "length", - "str-insert": "insert", - "str-index": "index", - "str-slice": "slice", - unitless: "is-unitless", - comparable: "compatible", - "list-separator": "separator", - "selector-nest": "nest", - "selector-append": "append", - "selector-replace": "replace", - "selector-unify": "unify", - "selector-parse": "parse", - "selector-extend": "extend", - lighten: "adjust", - "adjust-hue": "adjust", - darken: "adjust", - desaturate: "adjust", - opacify: "adjust", - saturate: "adjust", - transparentize: "adjust" -}; - -const rule_mapping = { - lighten: ["lighten($color, $amount)", "adjust($color, $lightness: $amount)"], - "adjust-hue": [ - "adjust-hue($color, $amount)", - "adjust($color, $hue: $amount)" - ], - darken: ["darken($color, $amount)", "adjust($color, $lightness: -$amount)"], - desaturate: [ - "desaturate($color, $amount)", - "adjust($color, $saturation: -$amount)" - ], - opacify: ["opacify($color, $amount)", "adjust($color, $alpha: -$amount)"], - saturate: [ - "saturate($color, $amount)", - "adjust($color, $saturation: $amount)" - ], - transparentize: [ - "transparentize($color, $amount)", - "adjust($color, $alpha: -$amount)" - ] -}; - -const ruleName = namespace("no-global-function-names"); - -const messages = utils.ruleMessages(ruleName, { - rejectedFullMessage: string => string, - rejected: name => errorMessage(name) -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function errorMessage(name) { - const sass_package = rules[name]; - const rename = new_rule_names[name]; - const map_rule = rule_mapping[name]; - - if (rename) { - if (map_rule) { - const [old_rule, new_rule] = map_rule; - - return `Expected ${sass_package}.${new_rule} instead of ${old_rule}`; - } - - return `Expected ${sass_package}.${rename} instead of ${name}`; - } else { - return `Expected ${sass_package}.${name} instead of ${name}`; - } -} - -function rule(value) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: value - }); - - if (!validOptions) { - return; - } - - root.walkDecls(decl => { - valueParser(decl.value).walk(node => { - const cleanValue = node.value.replace(interpolationPrefix, ""); - - // Verify that we're only looking at functions. - if (node.type !== "function" || cleanValue === "") { - return; - } - - if (Object.keys(rules).includes(cleanValue)) { - utils.report({ - message: messages.rejected(cleanValue), - node: decl, - index: declarationValueIndex(decl) + node.sourceIndex, - result, - ruleName - }); - } - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/operator-no-newline-after/README.md b/node_modules/stylelint-scss/src/rules/operator-no-newline-after/README.md deleted file mode 100644 index 677f1e610..000000000 --- a/node_modules/stylelint-scss/src/rules/operator-no-newline-after/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# operator-no-newline-after - -Disallow linebreaks after Sass operators. - -```scss -a { width: 10px + $n; } -/** ↑ - * Linebreaks after this */ -``` - -This rule checks math operators (`+`, `-`, `/`, `*`, `%`) and comparison operators (`>`, `<`, `!=`, `==`, `>=`, `<=`). - -Not all symbols that correspond to math operators are actually considered operators by Sass. Some of the exceptions are: - -* `+` and `-` as signs before values; -* `+` and `-` as signs in [space-delimited lists](https://sass-lang.com/documentation/operators/string); -* `-` as part of [a string](https://sass-lang.com/documentation/operators/string) or [a Sass identifier](https://sass-lang.com/documentation/operators/numeric#unary-operators), e.g. a variable; -* `/` as a CSS delimiter in property values like `font: 10px/1.2 Arial;` ([read more](https://sass-lang.com/documentation/operators/numeric#slash-separated-values)). - -For more details refer to [Sass official documentation](https://sass-lang.com/documentation). An online Sass compiler - [Sassmeister](https://www.sassmeister.com/) - could also come in handy. - -The following patterns are considered warnings: - -```scss -a { width: 10 + -1; } -``` - -```scss -a { - width: 10 + - 1; -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { - width: str- // not a math operator, ignored - some; -} -``` - -```scss -a { width: 10px - 1; } -``` - -```scss -a { - width: 10px * 1.7 // the newline is not right after the operator - + 1; -} -``` diff --git a/node_modules/stylelint-scss/src/rules/operator-no-newline-after/index.js b/node_modules/stylelint-scss/src/rules/operator-no-newline-after/index.js deleted file mode 100644 index a8d93edf6..000000000 --- a/node_modules/stylelint-scss/src/rules/operator-no-newline-after/index.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const eachRoot = require("../../utils/eachRoot"); -const isWhitespace = require("../../utils/isWhitespace"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); -const { calculationOperatorSpaceChecker } = require("../operator-no-unspaced"); - -const ruleName = namespace("operator-no-newline-after"); - -const messages = utils.ruleMessages(ruleName, { - rejected: operator => `Unexpected newline after "${operator}"` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -/** - * The checker function: whether there is a newline before THAT operator. - */ -function checkNewlineBefore({ - string, - globalIndex, - startIndex, - endIndex, - node, - result -}) { - const symbol = string.substring(startIndex, endIndex + 1); - let newLineBefore = false; - - let index = endIndex + 1; - - while (index && isWhitespace(string[index])) { - if (string[index] === "\n") { - newLineBefore = true; - break; - } - - index++; - } - - if (newLineBefore) { - utils.report({ - ruleName, - result, - node, - message: messages.rejected(symbol), - index: endIndex + globalIndex - }); - } -} - -function rule(expectation) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation - }); - - if (!validOptions) { - return; - } - - eachRoot(root, checkRoot); - - function checkRoot(root) { - calculationOperatorSpaceChecker({ - root, - result, - checker: checkNewlineBefore - }); - } - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/operator-no-newline-before/README.md b/node_modules/stylelint-scss/src/rules/operator-no-newline-before/README.md deleted file mode 100644 index 81b358aab..000000000 --- a/node_modules/stylelint-scss/src/rules/operator-no-newline-before/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# operator-no-newline-before - -Disallow linebreaks before Sass operators. - -```scss -a { width: 10px - + $n; } -/** ↑ - * Linebreaks before this */ -``` - -This rule checks math operators (`+`, `-`, `/`, `*`, `%`) and comparison operators (`>`, `<`, `!=`, `==`, `>=`, `<=`). - -Not all symbols that correspond to math operators are actually considered operators by Sass. Some of the exceptions are: - -* `+` and `-` as signs before values; -* `+` and `-` as signs in [space-delimited lists](https://sass-lang.com/documentation/operators/string); -* `-` as part of [a string](https://sass-lang.com/documentation/operators/string) or [a Sass identifier](https://sass-lang.com/documentation/operators/numeric#unary-operators), e.g. a variable; -* `/` as a CSS delimiter in property values like `font: 10px/1.2 Arial;` ([read more](https://sass-lang.com/documentation/operators/numeric#slash-separated-values)). - -For more details refer to [Sass official documentation](https://sass-lang.com/documentation). An online Sass compiler - [Sassmeister](https://www.sassmeister.com/) - could also come in handy. - -The following patterns are considered warnings: - -```scss -a { width: 10 -+ 1; } -``` - -```scss -a { - width: 10 - + 1; -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { - width: 10px - -1; // not a math operator, ignored -} -``` - -```scss -a { width: 10px - 1; } -``` - -```scss -a { - width: 100px + - $var * 0.5625; // the newline is not right before the operator -} -``` diff --git a/node_modules/stylelint-scss/src/rules/operator-no-newline-before/index.js b/node_modules/stylelint-scss/src/rules/operator-no-newline-before/index.js deleted file mode 100644 index 0369ae3a6..000000000 --- a/node_modules/stylelint-scss/src/rules/operator-no-newline-before/index.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const eachRoot = require("../../utils/eachRoot"); -const isWhitespace = require("../../utils/isWhitespace"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); -const { calculationOperatorSpaceChecker } = require("../operator-no-unspaced"); - -const ruleName = namespace("operator-no-newline-before"); - -const messages = utils.ruleMessages(ruleName, { - rejected: operator => `Unexpected newline before "${operator}"` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -/** - * The checker function: whether there is a newline before THAT operator. - */ -function checkNewlineBefore({ - string, - globalIndex, - startIndex, - endIndex, - node, - result -}) { - const symbol = string.substring(startIndex, endIndex + 1); - let newLineBefore = false; - - let index = startIndex - 1; - - while (index && isWhitespace(string[index])) { - if (string[index] === "\n") { - newLineBefore = true; - break; - } - - index--; - } - - if (newLineBefore) { - utils.report({ - ruleName, - result, - node, - message: messages.rejected(symbol), - index: endIndex + globalIndex - }); - } -} - -function rule(expectation) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation - }); - - if (!validOptions) { - return; - } - - eachRoot(root, checkRoot); - - function checkRoot(root) { - calculationOperatorSpaceChecker({ - root, - result, - checker: checkNewlineBefore - }); - } - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/operator-no-unspaced/README.md b/node_modules/stylelint-scss/src/rules/operator-no-unspaced/README.md deleted file mode 100644 index 4bef68522..000000000 --- a/node_modules/stylelint-scss/src/rules/operator-no-unspaced/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# operator-no-unspaced - -Disallow unspaced operators in Sass operations. - -```scss -a { width: 10px*$n; } -/** ↑ - * The space around this operator */ -``` - -This rule checks math operators (`+`, `-`, `/`, `*`, `%`) and comparison operators (`>`, `<`, `!=`, `==`, `>=`, `<=`). - -Not all symbols that correspond to math operators are actually considered operators by Sass. Some of the exceptions are: - -* `+` and `-` as signs before values; -* `+` and `-` as signs in [space-delimited lists](https://sass-lang.com/documentation/operators/string); -* `-` as part of [a string](https://sass-lang.com/documentation/operators/string) or [a Sass identifier](https://sass-lang.com/documentation/operators/numeric#unary-operators), e.g. a variable; -* `/` as a CSS delimiter in property values like `font: 10px/1.2 Arial;` ([read more](https://sass-lang.com/documentation/operators/numeric#slash-separated-values)). - -For more details refer to [Sass official documentation](https://sass-lang.com/documentation/file.SASS_REFERENCE.html). An online Sass compiler - [Sassmeister](https://www.sassmeister.com/) - could also come in handy. - -The following patterns are considered warnings: - -```scss -a { width: 10+1; } -``` - -```scss -a { width: 10+ 1; } -``` - -```scss -a { width: 10-1; } -``` - -```scss -a { width: 10px* 1.5; } -``` - -```scss -@if ($var==10) { ... } -``` - -```scss -a { width: 10px * 1.5; } // More than one space -``` - -```scss -a { width: (10) /1; } // Has a value inside parens on one side, so is an operation -``` - -```scss -// Operations can be inside interpolation in selectors, property names, etc. -.class#{1 +1}name { - color: red; -} - -p { - background-#{\"col\" +\"or\"}: red; -} -``` - -The following patterns are *not* considered warnings: - -```scss -a { width: 10 * 1; } -``` - -```scss -a { width: 10 +1; } // A space-delimited Sass list -``` - -```scss -// A space-delimited Sass list, in "10px-" "10" is a number, "px-" is a unit -a { width: 10px- 1; } -``` - -```scss -a { width: 10px/1; } // Compiled as CSS, as in "font: 10px/1 ..." -``` - -```scss -a { width: (10) /#{1}; } // Has interpolation on one of the sides, so not an operation -``` - -```scss -a { width: $var-1; } // "$var-1" is a variable name -``` - -```scss -a { width: "10*1"; } // Inside a string, ignored -``` - -```scss -// Linebreak will do as a whitespace; indentation before "-" and trailing spaces after "1" are left to the corresponding stylelint rules -a { - width: 1 - - a; -} -``` diff --git a/node_modules/stylelint-scss/src/rules/operator-no-unspaced/index.js b/node_modules/stylelint-scss/src/rules/operator-no-unspaced/index.js deleted file mode 100644 index cdee380a4..000000000 --- a/node_modules/stylelint-scss/src/rules/operator-no-unspaced/index.js +++ /dev/null @@ -1,308 +0,0 @@ -"use strict"; - -const mediaQueryParser = require("postcss-media-query-parser").default; -const { utils } = require("stylelint"); -const atRuleParamIndex = require("../../utils/atRuleParamIndex"); -const declarationValueIndex = require("../../utils/declarationValueIndex"); -const eachRoot = require("../../utils/eachRoot"); -const findCommentsInRaws = require("../../utils/findCommentsInRaws"); -const findOperators = require("../../utils/sassValueParser"); -const isWhitespace = require("../../utils/isWhitespace"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("operator-no-unspaced"); - -const messages = utils.ruleMessages(ruleName, { - expectedAfter: operator => `Expected single space after "${operator}"`, - expectedBefore: operator => `Expected single space before "${operator}"` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -/** - * The actual check for are there (un)necessary whitespaces - */ -function checkSpaces({ - string, - globalIndex, - startIndex, - endIndex, - node, - result -}) { - const symbol = string.substring(startIndex, endIndex + 1); - - const beforeOk = - (string[startIndex - 1] === " " && !isWhitespace(string[startIndex - 2])) || - newlineBefore(string, startIndex - 1); - - if (!beforeOk) { - utils.report({ - ruleName, - result, - node, - message: messages.expectedBefore(symbol), - index: startIndex + globalIndex - }); - } - - const afterOk = - (string[endIndex + 1] === " " && !isWhitespace(string[endIndex + 2])) || - string[endIndex + 1] === "\n" || - string.substr(endIndex + 1, 2) === "\r\n"; - - if (!afterOk) { - utils.report({ - ruleName, - result, - node, - message: messages.expectedAfter(symbol), - index: endIndex + globalIndex - }); - } -} - -function newlineBefore(str, startIndex) { - let index = startIndex; - - while (index && isWhitespace(str[index])) { - if (str[index] === "\n") return true; - - index--; - } - - return false; -} - -function rule(expectation) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation - }); - - if (!validOptions) { - return; - } - - eachRoot(root, checkRoot); - - function checkRoot(root) { - const rootString = root.source.input.css; - - if (rootString.trim() === "") { - return; - } - - calculationOperatorSpaceChecker({ - root, - result, - checker: checkSpaces - }); - } - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -/** - * The core rule logic function. This one can be imported by some other rules - * that work with Sass operators - * - * @param {Object} args -- Named arguments object - * @param {PostCSS Root} args.root - * @param {PostCSS Result} args.result - * @param {function} args.checker -- the function that is run against all the - * operators found in the input. Takes these arguments: - * {Object} cbArgs -- Named arguments object - * {string} cbArgs.string -- the input string (suspected operation) - * {number} cbArgs.globalIndex -- the string's index in a global input - * {number} cbArgs.startIndex -- the start index of a symbol to inspect - * {number} cbArgs.endIndex -- the end index of a symbol to inspect - * (two indexes needed to allow for `==`, `!=`, etc.) - * {PostCSS Node} cbArgs.node -- for stylelint.utils.report - * {PostCSS Result} cbArgs.result -- for stylelint.utils.report - */ -function calculationOperatorSpaceChecker({ root, result, checker }) { - /** - * Takes a string, finds all occurrences of Sass interpolation in it, then - * finds all operators inside that interpolation - * - * @return {array} An array of objects { string, operators } - effectively, - * a list of operators for each Sass interpolation occurrence - */ - function findInterpolation(string, startIndex) { - const interpolationRegex = /#{(.*?)}/g; - const results = []; - // Searching for interpolation - let match = interpolationRegex.exec(string); - - startIndex = !isNaN(startIndex) ? Number(startIndex) : 0; - while (match !== null) { - results.push({ - source: match[0], - operators: findOperators({ - string: match[0], - globalIndex: match.index + startIndex - }) - }); - match = interpolationRegex.exec(string); - } - - return results; - } - - const dataURIRegex = /^url\(\s*['"]?data:.+['"]?\s*\)/; - - root.walk(item => { - if (item.prop === "unicode-range") { - return; - } - - let results = []; - - // Check a value (`10px` in `width: 10px;`) - if (item.value !== undefined) { - if (dataURIRegex.test(item.value)) { - return results; - } - results.push({ - source: item.value, - operators: findOperators({ - string: item.value, - globalIndex: declarationValueIndex(item), - // For Sass variable values some special rules apply - isAfterColon: item.prop[0] === "$" - }) - }); - } - - // Property name - if (item.prop !== undefined) { - results = results.concat(findInterpolation(item.prop)); - } - - // Selector - if (item.selector !== undefined) { - results = results.concat(findInterpolation(item.selector)); - } - - if (item.type === "atrule") { - // @forward, @use and @at-root - if ( - item.name === "forward" || - item.name === "use" || - item.name === "at-root" - ) { - return; - } - - // Media queries - if (item.name === "media" || item.name === "import") { - mediaQueryParser(item.params).walk(node => { - const type = node.type; - - if (["keyword", "media-type", "media-feature"].includes(type)) { - results = results.concat( - findInterpolation( - node.value, - atRuleParamIndex(item) + node.sourceIndex - ) - ); - } else if (type === "value") { - results.push({ - source: node.value, - operators: findOperators({ - string: node.value, - globalIndex: atRuleParamIndex(item) + node.sourceIndex, - isAfterColon: true - }) - }); - } else if (type === "url") { - const isQuoted = node.value[0] === '"' || node.value[0] === "'"; - const containsWhitespace = node.value.search(/\s/) > -1; - - if (isQuoted || containsWhitespace) { - // The argument to the url function is only parsed as SassScript if it is a quoted - // string, or a _valid_ unquoted URL [1]. - // - // [1] https://sass-lang.com/documentation/syntax/special-functions#url - results.push({ - source: node.value, - operators: findOperators({ - string: node.value, - globalIndex: atRuleParamIndex(item) + node.sourceIndex, - isAfterColon: true - }) - }); - } - } - }); - } else { - // Function and mixin definitions and other rules - results.push({ - source: item.params, - operators: findOperators({ - string: item.params, - globalIndex: atRuleParamIndex(item), - isAfterColon: true - }) - }); - } - } - - // All the strings have been parsed, now run whitespace checking - results.forEach(el => { - // Only if there are operators within a string - if (el.operators && el.operators.length > 0) { - el.operators.forEach(operator => { - checker({ - string: el.source, - globalIndex: operator.globalIndex, - startIndex: operator.startIndex, - endIndex: operator.endIndex, - node: item, - result - }); - }); - } - }); - }); - - // Checking interpolation inside comments - // We have to give up on PostCSS here because it skips some inline comments - findCommentsInRaws(root.source.input.css).forEach(comment => { - const startIndex = - comment.source.start + - comment.raws.startToken.length + - comment.raws.left.length; - - if (comment.type !== "css") { - return; - } - - findInterpolation(comment.text).forEach(el => { - // Only if there are operators within a string - if (el.operators && el.operators.length > 0) { - el.operators.forEach(operator => { - checker({ - string: el.source, - globalIndex: operator.globalIndex + startIndex, - startIndex: operator.startIndex, - endIndex: operator.endIndex, - node: root, - result - }); - }); - } - }); - }); -} - -rule.calculationOperatorSpaceChecker = calculationOperatorSpaceChecker; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/partial-no-import/README.md b/node_modules/stylelint-scss/src/rules/partial-no-import/README.md deleted file mode 100644 index 4a280b4ef..000000000 --- a/node_modules/stylelint-scss/src/rules/partial-no-import/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# partial-no-import - -Disallow non-CSS `@import`s in partial files. - -```scss -// path/to/_file.scss: -/* ↑ in partial files */ - - @import "path/to/file.scss" -/*↑ Disallow imports */ -``` - -The rule skips CSS files (doesn't report any `@import`s in them). - -The rule also ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import: - -* If the file’s extension is `.css`. -* If the filename begins with `http://` (or any other protocol). -* If the filename is a `url()`. -* If the `@import` has any media queries. - -The following patterns are considered warnings: - -```scss -// path/to/_file.scss: - -@import "foo.scss"; -``` - -```scss -// path/to/_file.less: -@import "path/fff.less"; -``` - -```scss -// path/to/_file.scss: -@import "path\\fff.supa"; -``` - -The following patterns are *not* considered warnings: - -```scss -// path/to/file.scss: -@import "path/fff"; - -/* @import in a file that is not a partial */ -``` - -```scss -// path/to/_file.scss: -@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */ -``` - -```scss -// path/to/_file.scss: -@import "file.css"; /* Has ".css" extension, so doesn't count as a partial @import */ -``` - -```scss -// path/to/_file.scss: -@import "http://_file.scss"; -@import "//_file.scss"; -/* Both are URIs, so don't count as partial @imports */ -``` - -```scss -// path/to/_file.scss: -@import "file.scss" screen; /* Has a media query, so doesn't count as a partial @import */ -``` diff --git a/node_modules/stylelint-scss/src/rules/partial-no-import/index.js b/node_modules/stylelint-scss/src/rules/partial-no-import/index.js deleted file mode 100644 index 851181ce0..000000000 --- a/node_modules/stylelint-scss/src/rules/partial-no-import/index.js +++ /dev/null @@ -1,89 +0,0 @@ -"use strict"; - -const nodeJsPath = require("path"); -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("partial-no-import"); - -const messages = utils.ruleMessages(ruleName, { - expected: "Unexpected @import in a partial" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(on) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: on - }); - - if (!validOptions) { - return; - } - - if (root.source.input.file === undefined || !root.source.input.file) { - result.warn( - "The 'partial-no-import' rule won't work if linting in a code string without an actual file." - ); - - return; - } - - const fileName = nodeJsPath.basename(root.source.input.file); - const extName = nodeJsPath.extname(root.source.input.file); - - function checkImportForCSS(path, decl) { - // Stripping trailing quotes and whitespaces, if any - const pathStripped = path - .replace(/^\s*(["'])\s*/, "") - .replace(/\s*(["'])\s*$/, ""); - - // Skipping importing empty import, CSS: url(), ".css", URI with a protocol, media - if ( - pathStripped.trim() === "" || - pathStripped.slice(0, 4) === "url(" || - pathStripped.slice(-4) === ".css" || - pathStripped.search("//") !== -1 || - pathStripped.search(/[\s,)"']\w+$/) !== -1 - ) { - return; - } - - utils.report({ - message: messages.expected, - node: decl, - index: decl.params.indexOf(path), - result, - ruleName - }); - } - - // Usual CSS file - if (extName === ".css") { - return; - } - - // Not a partial - if (fileName[0] !== "_") { - return; - } - - root.walkAtRules("import", mixinCall => { - // Check if @import is treated as CSS import; report only if not - // Processing comma-separated lists of import paths - mixinCall.params.split(/["']\s*,/).forEach(path => { - checkImportForCSS(path, mixinCall); - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/README.md b/node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/README.md deleted file mode 100644 index d4e85c233..000000000 --- a/node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# percent-placeholder-pattern - -Specify a pattern for `%`-placeholders. - -```scss - %foobar { display: flex; } -/** ↑ - * The pattern of this */ -``` - -## Options - -`regex` or `string` - -A string will be translated into a RegExp like so `new RegExp(yourString)` — so be sure to escape properly. - -Nested selectors will be resolved before checking. - -The selector value *after `%`* will be checked. No need to include `%` in your pattern. - -### E.g. `/^foo-[a-z]+$/` - -The following patterns are considered warnings: - -```scss -%myriad { display: flex; } -``` - -```scss -%foo-bar { - &-supa { display: flex; } /* %foo-bar matches, but %foo-bar-supa doesn't */ -} -``` - -```scss -%foo- { /* %foo- on the 1st leves doesn't match */ - &bar { display: flex; } -} -``` - -The following patterns are *not* considered warnings: - -```scss -%foo-aimp { display: flex; } -``` - -```scss -%foo-bar { - &lignt { display: flex; } -} -``` - -```scss -.p { - @extend %mathy; // The rule only checks placeholder definitions -} -``` diff --git a/node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/index.js b/node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/index.js deleted file mode 100644 index 767e2e741..000000000 --- a/node_modules/stylelint-scss/src/rules/percent-placeholder-pattern/index.js +++ /dev/null @@ -1,101 +0,0 @@ -"use strict"; - -const resolveNestedSelector = require("postcss-resolve-nested-selector"); -const { utils } = require("stylelint"); -const { isRegExp, isString } = require("../../utils/validateTypes"); -const hasInterpolatingAmpersand = require("../../utils/hasInterpolatingAmpersand"); -const isStandardRule = require("../../utils/isStandardRule"); -const isStandardSelector = require("../../utils/isStandardSelector"); -const parseSelector = require("../../utils/parseSelector"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("percent-placeholder-pattern"); - -const messages = utils.ruleMessages(ruleName, { - expected: placeholder => - `Expected %-placeholder "%${placeholder}" to match specified pattern` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(pattern) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: pattern, - possible: [isRegExp, isString] - }); - - if (!validOptions) { - return; - } - - const placeholderPattern = isString(pattern) - ? new RegExp(pattern) - : pattern; - - // Checking placeholder definitions (looking among regular rules) - root.walkRules(rule => { - const { selector } = rule; - - // Just a shorthand for calling `parseSelector` - function parse(selector) { - parseSelector(selector, result, rule, s => checkSelector(s, rule)); - } - - // If it's a custom prop or a less mixin - if (!isStandardRule(rule)) { - return; - } - - // If the selector has interpolation - if (!isStandardSelector(selector)) { - return; - } - - // Nested selectors are processed in steps, as nesting levels are resolved. - // Here we skip processing intermediate parts of selectors (to process only fully resolved selectors) - // if (rule.nodes.some(node => node.type === "rule" || node.type === "atrule")) { return } - - // Only resolve selectors that have an interpolating "&" - if (hasInterpolatingAmpersand(selector)) { - resolveNestedSelector(selector, rule).forEach(parse); - } else { - parse(selector); - } - }); - - function checkSelector(fullSelector, rule) { - // postcss-selector-parser gives %placeholders' nodes a "tag" type - fullSelector.walkTags(compoundSelector => { - const { value, sourceIndex } = compoundSelector; - - if (value[0] !== "%") { - return; - } - - const placeholder = value.slice(1); - - if (placeholderPattern.test(placeholder)) { - return; - } - - utils.report({ - result, - ruleName, - message: messages.expected(placeholder), - node: rule, - index: sourceIndex - }); - }); - } - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/selector-nest-combinators/README.md b/node_modules/stylelint-scss/src/rules/selector-nest-combinators/README.md deleted file mode 100644 index 8c6f94dfc..000000000 --- a/node_modules/stylelint-scss/src/rules/selector-nest-combinators/README.md +++ /dev/null @@ -1,221 +0,0 @@ -# selector-nest-combinators - -Require or disallow nesting of combinators in selectors - -```scss -/* Examples of selectors without nesting of combinators */ -.foo .bar {} - -.foo.bar {} - -.foo > .bar {} - -.foo:hover {} - -/* Corresponding selectors with combinators nested */ -.foo { - .bar {} -} - -.foo { - &.bar {} -} - -.foo { - & > .bar {} -} - -.foo { - &:hover {} -} -``` - -## Options - -`string`: `"always"|"never"` - -### `"always"` - -*Every combinator* in a selector *must be* nested where possible without altering the existing resolved selector. - -Sections of selectors preceding a parent selector are ignored with `always`. -e.g. - -```scss -.foo { - .bar.baz & {} -} -``` - -Sections of selectors within pseudo selectors are also ignored with `always`. -e.g. - -```scss -.foo { - &:not(.bar .baz) {} -} -``` - -while this could be refactored to: - -```scss -.bar { - .baz { - .foo:not(&) {} - } -} -``` - -There are variances in the way this is compiled between compilers, therefore for the purposes of this rule the selector sections within pseudo selectors are being ignored. - -The following patterns are considered warnings: - -```scss -.foo .bar {} -``` - -```scss -.foo.bar {} -``` - -```scss -.foo > .bar {} -``` - -```scss -.foo:hover {} -``` - -```scss -a[href] {} -``` - -```scss -* + li {} -``` - -```scss -:nth-child(2n - 1):last-child {} -``` - -The following patterns are *not* considered warnings: - -```scss -.foo { - .bar {} -} -``` - -```scss -.foo { - &.bar {} -} -``` - -```scss -.foo { - & > .bar {} -} -``` - -```scss -.foo { - &:hover {} -} -``` - -```scss -a { - &[href] {} -} -``` - -```scss -* { - & + li {} -} -``` - -```scss -:nth-child(2n - 1) { - &:last-child {} -} -``` - -### `"never"` - -Nested of selectors are not allowed. - -The following patterns are considered warnings: - -```scss -.foo { - .bar {} -} -``` - -```scss -.foo { - &.bar {} -} -``` - -```scss -.foo { - & > .bar {} -} -``` - -```scss -.foo { - &:hover {} -} -``` - -```scss -a { - &[href] {} -} -``` - -```scss -* { - & + li {} -} -``` - -```scss -:nth-child(2n - 1) { - &:last-child {} -} -``` - -The following patterns are *not* considered warnings: - -```scss -.foo .bar {} -``` - -```scss -.foo.bar {} -``` - -```scss -.foo > .bar {} -``` - -```scss -.foo:hover {} -``` - -```scss -a[href] {} -``` - -```scss -* + li {} -``` - -```scss -:nth-child(2n - 1):last-child {} -``` diff --git a/node_modules/stylelint-scss/src/rules/selector-nest-combinators/index.js b/node_modules/stylelint-scss/src/rules/selector-nest-combinators/index.js deleted file mode 100644 index 05a546887..000000000 --- a/node_modules/stylelint-scss/src/rules/selector-nest-combinators/index.js +++ /dev/null @@ -1,165 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const parseSelector = require("../../utils/parseSelector"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("selector-nest-combinators"); - -const messages = utils.ruleMessages(ruleName, { - expectedInterpolation: `Expected interpolation to be in a nested form`, - expected: (combinator, type) => - `Expected combinator "${combinator}" of type "${type}" to be in a nested form`, - rejected: `Unexpected nesting found in selector` -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(expectation) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { - actual: expectation, - possible: ["always", "never"] - }); - - if (!validOptions) { - return; - } - - function precedesParentSelector(current) { - do { - current = current.next(); - - if (current.type === "nesting") { - return true; - } - } while (current.next()); - - return false; - } - - // attribute, class, combinator, comment, id, nesting, pseudo, root, selector, string, tag, or universal - const chainingTypes = [ - "attribute", - "class", - "id", - "pseudo", - "tag", - "universal" - ]; - - const interpolationRe = /#{.+?}$/; - - root.walkRules(rule => { - if ( - rule.parent && - rule.parent.type === "atrule" && - rule.parent.name === "keyframes" - ) { - return; - } - - if (typeof rule.selector === "string") { - const isNestedProperty = rule.selector.slice(-1) === ":"; - - if (isNestedProperty) { - return; - } - } - - parseSelector(rule.selector, result, rule, fullSelector => { - let message; - - fullSelector.walk(node => { - if (node.value === "}") { - return; - } - - if (expectation === "always") { - if (node.type === "selector") { - return; - } - - if ( - node.parent && - node.parent.type === "selector" && - node.parent.parent && - node.parent.parent.type === "pseudo" - ) { - return; - } - - if (!node.prev()) { - return; - } - - if (node.next() && precedesParentSelector(node)) { - return; - } - - if (node.type === "combinator") { - if (node.next() && !chainingTypes.includes(node.next().type)) { - return; - } - - if (!chainingTypes.includes(node.prev().type)) { - return; - } - } - - if ( - chainingTypes.includes(node.type) && - !chainingTypes.includes(node.prev().type) - ) { - return; - } - - if ( - node.type !== "combinator" && - !chainingTypes.includes(node.type) - ) { - return; - } - - const hasInterpolation = interpolationRe.test(rule.selector); - - if (node.type !== "combinator" && hasInterpolation) { - return; - } - - if (hasInterpolation) { - message = messages.expectedInterpolation; - } else { - message = messages.expected(node.value, node.type); - } - } - - if (expectation === "never") { - if (rule.parent.type === "root" || rule.parent.type === "atrule") { - return; - } - - message = messages.rejected; - } - - utils.report({ - ruleName, - result, - node: rule, - message, - index: node.sourceIndex - }); - }); - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/README.md b/node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/README.md deleted file mode 100644 index 33bbf7f7c..000000000 --- a/node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# selector-no-redundant-nesting-selector - -Disallow redundant nesting selectors (`&`). - -```scss -p { - & a {} -//↑ -// This type of selector -} -``` - -The following patterns are considered warnings: - -```scss -p { - & a {} -} -``` - -```scss -p { - & > a {} -} -``` - -```scss -p { - & .class {} -} -``` - -```scss -p { - & + .foo {} -} -``` - -The following patterns are *not* considered warnings: - -```scss -p { - &.foo {} -} -``` - -```scss -p { - .foo > & {} -} -``` - -```scss -p { - &, - .foo, - .bar { - margin: 0; - } -} -``` - -## Options - -`ignoreKeywords`: `["/regex/", /regex/, "string"]` - -if you are using Less or some other non-SCSS syntax, the warnings can be disabled by using `ignoreKeywords` option. - -For example, you need to ignore the `when` keyword in `less`: - -```js -{ - rules: { - 'scss/selector-no-redundant-nesting-selector', [true, { ignoreKeywords: ['when'] }], - }, -} -``` - -The following patterns are *not* considered warnings: - -```less - @theme: ~'dark'; -p { - & when (@theme = dark) { - color: #000; - } - & when not(@theme = dark) { - color: #fff; - } -} -``` - -Conversely, if you do not use the `ignoreKeywords` option: - -```js -{ - rules: { - 'scss/selector-no-redundant-nesting-selector', true, - }, -} -``` - -The following patterns are considered warnings: - -```less - @theme: ~'dark'; -p { - & when (@theme = dark) { - color: #000; - } - & when not(@theme = dark) { - color: #fff; - } -} -``` diff --git a/node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/index.js b/node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/index.js deleted file mode 100644 index 02c76e8a0..000000000 --- a/node_modules/stylelint-scss/src/rules/selector-no-redundant-nesting-selector/index.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; - -const { utils } = require("stylelint"); -const optionsMatches = require("../../utils/optionsMatches"); -const hasNestedSibling = require("../../utils/hasNestedSibling"); -const isType = require("../../utils/isType"); -const parseSelector = require("../../utils/parseSelector"); -const { isRegExp, isString } = require("../../utils/validateTypes"); -const namespace = require("../../utils/namespace"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("selector-no-redundant-nesting-selector"); - -const messages = utils.ruleMessages(ruleName, { - rejected: "Unnecessary nesting selector (&)" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -function rule(actual, options) { - return (root, result) => { - const validOptions = utils.validateOptions( - result, - ruleName, - { actual }, - { - actual: options, - possible: { - ignoreKeywords: [isString, isRegExp] - }, - optional: true - } - ); - - if (!validOptions) { - return; - } - - root.walkRules(/&/, rule => { - parseSelector(rule.selector, result, rule, fullSelector => { - // "Ampersand followed by a combinator followed by non-combinator non-ampersand and not the selector end" - fullSelector.walkNesting(node => { - const prev = node.prev(); - - if (prev || hasNestedSibling(node)) { - return; - } - - const next = node.next(); - - if (!next && node.parent.parent.nodes.length > 1) { - return; - } - - if (next && next.type !== "combinator") { - return; - } - - const nextNext = next ? next.next() : null; - - if ( - (isType(nextNext, "tag") && - optionsMatches( - options, - "ignoreKeywords", - nextNext.value.trim() - )) || - isType(nextNext, "combinator") - ) { - return; - } - - utils.report({ - ruleName, - result, - node: rule, - message: messages.rejected, - index: node.sourceIndex - }); - }); - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/rules/selector-no-union-class-name/README.md b/node_modules/stylelint-scss/src/rules/selector-no-union-class-name/README.md deleted file mode 100644 index ef773c949..000000000 --- a/node_modules/stylelint-scss/src/rules/selector-no-union-class-name/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# selector-no-union-class-name - -Disallow union class names with the parent selector (`&`). - -```scss -.class { - &-union { -//↑ -// This type usage of `&` - } -} -``` - -The following patterns are considered warnings: - -```scss -.class { - &-union {} -} -``` - -```scss -.class { - &_union {} -} -``` - -```scss -.class { - &union {} -} -``` - -The following patterns are *not* considered warnings: - -```scss -.class { - &.foo {} -} -``` - -```scss -.class { - & p {} -} -``` diff --git a/node_modules/stylelint-scss/src/rules/selector-no-union-class-name/index.js b/node_modules/stylelint-scss/src/rules/selector-no-union-class-name/index.js deleted file mode 100644 index d510f9ad5..000000000 --- a/node_modules/stylelint-scss/src/rules/selector-no-union-class-name/index.js +++ /dev/null @@ -1,103 +0,0 @@ -"use strict"; - -const { - isAttribute, - isClassName, - isCombinator, - isIdentifier, - isPseudoClass, - isPseudoElement -} = require("postcss-selector-parser"); -const { utils } = require("stylelint"); -const namespace = require("../../utils/namespace"); -const parseSelector = require("../../utils/parseSelector"); -const ruleUrl = require("../../utils/ruleUrl"); - -const ruleName = namespace("selector-no-union-class-name"); - -const messages = utils.ruleMessages(ruleName, { - rejected: "Unexpected union class name with the parent selector (&)" -}); - -const meta = { - url: ruleUrl(ruleName) -}; - -const validNestingTypes = [ - isClassName, - isCombinator, - isAttribute, - isIdentifier, - isPseudoClass, - isPseudoElement -]; - -function rule(actual) { - return (root, result) => { - const validOptions = utils.validateOptions(result, ruleName, { actual }); - - if (!validOptions) { - return; - } - - root.walkRules(/&/, rule => { - const parentNodes = []; - - const selector = getSelectorFromRule(rule.parent); - - if (selector) { - parseSelector(selector, result, rule, fullSelector => { - fullSelector.walk(node => parentNodes.push(node)); - }); - } - - if (parentNodes.length === 0) return; - - const lastParentNode = parentNodes[parentNodes.length - 1]; - - if (!isClassName(lastParentNode)) return; - - parseSelector(rule.selector, result, rule, fullSelector => { - fullSelector.walkNesting(node => { - const next = node.next(); - - if (!next) return; - - if (validNestingTypes.some(isType => isType(next))) return; - - utils.report({ - ruleName, - result, - node: rule, - message: messages.rejected, - index: node.sourceIndex - }); - }); - }); - }); - }; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; - -/** - * Searches for the closest rule which - * has a selector and returns the selector - * @returns {string|undefined} - */ -function getSelectorFromRule(rule) { - // All non at-rules have their own selector - if (rule.selector !== undefined) { - return rule.selector; - } - - // At-rules like @mixin don't have a selector themself - // but their parents might have one - if (rule.parent) { - return getSelectorFromRule(rule.parent); - } -} - -module.exports = rule; diff --git a/node_modules/stylelint-scss/src/utils/addEmptyLineBefore.js b/node_modules/stylelint-scss/src/utils/addEmptyLineBefore.js deleted file mode 100644 index a962b0a6b..000000000 --- a/node_modules/stylelint-scss/src/utils/addEmptyLineBefore.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -// Add an empty line before a node. Mutates the node. -module.exports = function addEmptyLineBefore( - node /*: postcss$node*/, - newline /*: '\n' | '\r\n'*/ -) /*: postcss$node*/ { - if (!/\r?\n/.test(node.raws.before)) { - node.raws.before = newline.repeat(2) + node.raws.before; - } else { - node.raws.before = node.raws.before.replace(/(\r?\n)/, `${newline}$1`); - } - - return node; -}; diff --git a/node_modules/stylelint-scss/src/utils/atRuleBaseName.js b/node_modules/stylelint-scss/src/utils/atRuleBaseName.js deleted file mode 100644 index c8b807b8b..000000000 --- a/node_modules/stylelint-scss/src/utils/atRuleBaseName.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -/** - * Get an at rule's base name - * - * @param {AtRule} atRule - * @return {string} The name - */ -module.exports = function (atRule) { - return atRule.params.replace(/\([^)]*\)/, "").trim(); -}; diff --git a/node_modules/stylelint-scss/src/utils/atRuleParamIndex.js b/node_modules/stylelint-scss/src/utils/atRuleParamIndex.js deleted file mode 100644 index a68a12620..000000000 --- a/node_modules/stylelint-scss/src/utils/atRuleParamIndex.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -/** - * Get the index of a media query's params - * - * @param {AtRule} atRule - * @return {int} The index - */ -module.exports = function (atRule) { - // Initial 1 is for the `@` - let index = 1 + atRule.name.length; - - if (atRule.raw("afterName")) { - index += atRule.raw("afterName").length; - } - - return index; -}; diff --git a/node_modules/stylelint-scss/src/utils/beforeBlockString.js b/node_modules/stylelint-scss/src/utils/beforeBlockString.js deleted file mode 100644 index 4552d1538..000000000 --- a/node_modules/stylelint-scss/src/utils/beforeBlockString.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; - -/** - * Given a CSS statement, return the string before the block. - * For rules, this is the selector list (and surrounding whitespace). - * For at-rules, this is the name and params (and surrounding whitespace). - * - * If there is no block, return empty string. - * - * @param {Rule|AtRule} statement - postcss rule or at-rule node - * @param {object} options - * @param {boolean} [options.noRawBefore] - Leave out the `before` string - * @return {string} - */ -module.exports = function (statement, { noRawBefore } = {}) { - let result = ""; - - if (statement.type !== "rule" && statement.type !== "atrule") { - return result; - } - - if (!noRawBefore) { - result += statement.raws.before; - } - - if (statement.type === "rule") { - result += statement.selector; - } else { - result += `@${statement.name}${statement.raws.afterName}${statement.params}`; - } - - const between = statement.raws.between; - - if (between !== undefined) { - result += between; - } - - return result; -}; diff --git a/node_modules/stylelint-scss/src/utils/blockString.js b/node_modules/stylelint-scss/src/utils/blockString.js deleted file mode 100644 index d2f0e4b3e..000000000 --- a/node_modules/stylelint-scss/src/utils/blockString.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -const beforeBlockString = require("./beforeBlockString"); -const hasBlock = require("./hasBlock"); -const rawNodeString = require("./rawNodeString"); - -/** - * Return a CSS statement's block -- the string that starts with `{` and ends with `}`. - * - * If the statement has no block (e.g. `@import url(foo.css);`), - * return undefined. - * - * @param {Rule|AtRule} statement - postcss rule or at-rule node - * @return {string|undefined} - */ -module.exports = function (statement) { - if (!hasBlock(statement)) { - return; - } - - return rawNodeString(statement).slice(beforeBlockString(statement).length); -}; diff --git a/node_modules/stylelint-scss/src/utils/configurationError.js b/node_modules/stylelint-scss/src/utils/configurationError.js deleted file mode 100644 index 1e3c6b7d9..000000000 --- a/node_modules/stylelint-scss/src/utils/configurationError.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -/** - * Create configurationError from text and set CLI exit code - * - * @param {string} text - * @return {Error} - The error, with text and exit code - */ -module.exports = function (text) { - const err = new Error(text); - - err.code = 78; - - return err; -}; diff --git a/node_modules/stylelint-scss/src/utils/declarationValueIndex.js b/node_modules/stylelint-scss/src/utils/declarationValueIndex.js deleted file mode 100644 index 5f573eab8..000000000 --- a/node_modules/stylelint-scss/src/utils/declarationValueIndex.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -/** - * Get the index of a declaration's value - * - * @param {Decl} decl - * @return {int} The index - */ -module.exports = function (decl) { - const beforeColon = decl.toString().indexOf(":"); - const afterColon = - decl.raw("between").length - decl.raw("between").indexOf(":"); - - return beforeColon + afterColon; -}; diff --git a/node_modules/stylelint-scss/src/utils/eachRoot.js b/node_modules/stylelint-scss/src/utils/eachRoot.js deleted file mode 100644 index 7d1923cec..000000000 --- a/node_modules/stylelint-scss/src/utils/eachRoot.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -/** - * Executes a provided function once for each CSS block element. - * - * @param {Root|Document} root - root element of file. - * @param {function} cb - Function to execute for each CSS block element - */ -module.exports = function (root, cb) { - // class `Document` is a part of `postcss-html`, - // It is collection of roots in HTML File. - // See: https://github.com/gucong3000/postcss-html/blob/master/lib/document.js - if (root.constructor.name === "Document") { - root.nodes.forEach(cb); - } else { - cb(root); - } -}; diff --git a/node_modules/stylelint-scss/src/utils/findCommentsInRaws.js b/node_modules/stylelint-scss/src/utils/findCommentsInRaws.js deleted file mode 100644 index e9183d929..000000000 --- a/node_modules/stylelint-scss/src/utils/findCommentsInRaws.js +++ /dev/null @@ -1,241 +0,0 @@ -"use strict"; - -/** - * Finds comments, both CSS comments and double slash ones, in a CSS string - * This helper exists because PostCSS drops some inline comments (those - * between selectors, property values, etc.) - * https://github.com/postcss/postcss/issues/845#issuecomment-232306259 - * - * @param {string} rawString -- the source raw CSS string - * @return {array} array of objects with these props: - * � type -- "css" or "double-slash" - * � source: { start, end } - * IMPORTANT: the function itself considers \r as a character, and counts - * it for `start` and `end`. But if their values are passed to PostCSS's - * result.warn(), than "\r\n" is consideren ONE CHAR (newline)! - * � raws - * raws.startToken -- `/*`, `/**`, `/**!`, etc. - * raws.left -- whitespace after the comment opening marker - * raws.text -- the full comment, including markers (//, /*) - * raws.right -- whitespace before the comment closing marker - * raws.endToken -- `*\/`, `**\/` for CSS comments - * � text -- the comment text only, excluding //, /*, trailing whitespaces - * � inlineAfter -- true, if there is something before the comment on - * the same line - * � inlineBefore -- true, if there is something after the comment on - * the same line - */ - -module.exports = function findCommentsInRaws(rawString) { - const result = []; - let comment = {}; - // Keeps track of which structure the parser is inside (string, comment, - // url function, parens). E.g., /* comment */ inside a string doesn't - // constitute a comment, so as url(//path) - const modesEntered = [ - { - mode: "normal", - character: null - } - ]; - let commentStart = null; - - // postcss-scss transforms //-comments into CSS comments, like so: - // `// comment` -> `/* comment*/`. So to have a correct intex we need to - // keep track on the added `*/` sequences - let offset = 0; - - for (let i = 0; i < rawString.length; i++) { - const character = rawString[i]; - const prevChar = i > 0 ? rawString[i - 1] : null; - const nextChar = i + 1 < rawString.length ? rawString[i + 1] : null; - - const lastModeIndex = modesEntered.length - 1; - const mode = - modesEntered[lastModeIndex] && modesEntered[lastModeIndex].mode; - - switch (character) { - // If entering/exiting a string - case '"': - case "'": { - if (mode === "comment") { - break; - } - - if ( - mode === "string" && - modesEntered[lastModeIndex].character === character && - prevChar !== "\\" - ) { - // Exiting a string - modesEntered.pop(); - } else { - // Entering a string - modesEntered.push({ - mode: "string", - character - }); - } - - break; - } - // Entering url, other function or parens (only url matters) - case "(": { - if (mode === "comment" || mode === "string") { - break; - } - - const functionNameRegSearch = - /(?:^|[\n\r]|\s-|[:\s,.(){}*+/%])([\w-]*)$/.exec( - rawString.substring(0, i) - ); - - // A `\S(` can be in, say, `@media(` - if (!functionNameRegSearch) { - modesEntered.push({ - mode: "parens", - character: "(" - }); - break; - } - - const functionName = functionNameRegSearch[1]; - - modesEntered.push({ - mode: functionName === "url" ? "url" : "parens", - character: "(" - }); - break; - } - // Exiting url, other function or parens - case ")": { - if (mode === "comment" || mode === "string") { - break; - } - - modesEntered.pop(); - break; - } - // checking for comment - case "/": { - // Break if the / is inside a comment because we leap over the second - // slash in // and in */, so the / is not from a marker. Also break - // if inside a string - if (mode === "comment" || mode === "string") { - break; - } - - if (nextChar === "*") { - modesEntered.push({ - mode: "comment", - character: "/*" - }); - comment = { - type: "css", - source: { start: i + offset }, - // If i is 0 then the file/the line starts with this comment - inlineAfter: - i > 0 && rawString.substring(0, i).search(/\n\s*$/) === -1 - }; - commentStart = i; - // Skip the next iteration as the * is already checked - i++; - } else if (nextChar === "/") { - // `url(//path/to/file)` has no comment - if (mode === "url") { - break; - } - - modesEntered.push({ - mode: "comment", - character: "//" - }); - comment = { - type: "double-slash", - source: { start: i + offset }, - // If i is 0 then the file/the line starts with this comment - inlineAfter: - i > 0 && rawString.substring(0, i).search(/\n\s*$/) === -1 - }; - commentStart = i; - // Skip the next iteration as the second slash in // is already checked - i++; - } - - break; - } - // Might be a closing `*/` - case "*": { - if ( - mode === "comment" && - modesEntered[lastModeIndex].character === "/*" && - nextChar === "/" - ) { - comment.source.end = i + 1 + offset; - - const commentRaw = rawString.substring(commentStart, i + 2); - const matches = /^(\/\*+[!#]?)(\s*)([\s\S]*?)(\s*)(\*+\/)$/.exec( - commentRaw - ); - - modesEntered.pop(); - comment.raws = { - startToken: matches[1], - left: matches[2], - text: commentRaw, - right: matches[4], - endToken: matches[5] - }; - comment.text = matches[3]; - comment.inlineBefore = - rawString.substring(i + 2).search(/^\s*\S+\s*?\n/) !== -1; - result.push(Object.assign({}, comment)); - comment = {}; - // Skip the next loop as the / in */ is already checked - i++; - } - - break; - } - default: { - const isNewline = - (character === "\r" && rawString[i + 1] === "\n") || - (character === "\n" && rawString[i - 1] !== "\r"); - - // //-comments end before newline and if the code string ends - if (isNewline || i === rawString.length - 1) { - if ( - mode === "comment" && - modesEntered[lastModeIndex].character === "//" - ) { - comment.source.end = (isNewline ? i - 1 : i) + offset; - - const commentRaw = rawString.substring( - commentStart, - isNewline ? i : i + 1 - ); - const matches = /^(\/+)(\s*)(.*?)(\s*)$/.exec(commentRaw); - - modesEntered.pop(); - comment.raws = { - startToken: matches[1], - left: matches[2], - text: commentRaw, - right: matches[4] - }; - comment.text = matches[3]; - comment.inlineBefore = false; - result.push(Object.assign({}, comment)); - comment = {}; - // Compensate for the `*/` added by postcss-scss - offset += 2; - } - } - - break; - } - } - } - - return result; -}; diff --git a/node_modules/stylelint-scss/src/utils/functions.js b/node_modules/stylelint-scss/src/utils/functions.js deleted file mode 100644 index 24f61ae03..000000000 --- a/node_modules/stylelint-scss/src/utils/functions.js +++ /dev/null @@ -1,257 +0,0 @@ -"use strict"; - -/** - * @see https://sass-lang.com/documentation/modules#global-functions - */ -const GLOBAL_FUNCTIONS = Object.freeze(["hsl", "hsla", "if", "rgb", "rgba"]); - -/** - * @see https://sass-lang.com/documentation/modules/color - */ -const COLOR_FUNCTIONS = Object.freeze([ - "adjust-color", - "adjust-hue", - "alpha", - "blackness", - "blue", - "change-color", - "complement", - "darken", - "desaturate", - "fade-in", - "fade-out", - "grayscale", - "green", - "hue", - "ie-hex-str", - "invert", - "lighten", - "lightness", - "mix", - "opacity", - "red", - "saturate", - "saturation", - "scale-color", - "transparentize", - - // with namespace - "color.adjust", - "color.alpha", - "color.blackness", - "color.blue", - "color.change", - "color.complement", - "color.grayscale", - "color.green", - "color.hue", - "color.hwb", - "color.ie-hex-str", - "color.invert", - "color.lightness", - "color.mix", - "color.red", - "color.saturation", - "color.scale", - "color.whiteness" -]); - -/** - * @see https://sass-lang.com/documentation/modules/list - */ -const LIST_FUNCTIONS = Object.freeze([ - "append", - "index", - "is-bracketed", - "join", - "length", - "list-separator", - "nth", - "set-nth", - "list.zip", - - // with namespace - "list.append", - "list.index", - "list.is-bracketed", - "list.join", - "list.length", - "list.nth", - "list.separator", - "list.set-nth", - "list.slash", - "zip" -]); - -/** - * @see https://sass-lang.com/documentation/modules/map - */ -const MAP_FUNCTIONS = Object.freeze([ - "map-get", - "map-has-key", - "map-keys", - "map-merge", - "map-remove", - "map-values", - - // with namespace - "map.deep-merge", - "map.deep-remove", - "map.get", - "map.has-key", - "map.keys", - "map.merge", - "map.remove", - "map.set", - "map.values" -]); - -/** - * @see https://sass-lang.com/documentation/modules/math - */ -const MATH_FUNCTIONS = Object.freeze([ - "abs", - "ceil", - "comparable", - "floor", - "max", - "min", - "percentage", - "random", - "round", - "unit", - "unitless", - - // with namespace - "math.abs", - "math.acos", - "math.asin", - "math.atan", - "math.atan2", - "math.ceil", - "math.clamp", - "math.compatible", - "math.cos", - "math.div", - "math.floor", - "math.hypot", - "math.is-unitless", - "math.log", - "math.max", - "math.min", - "math.percentage", - "math.pow", - "math.random", - "math.round", - "math.sin", - "math.sqrt", - "math.tan", - "math.unit" -]); - -/** - * @see https://sass-lang.com/documentation/modules/meta - */ -const META_FUNCTIONS = Object.freeze([ - "call", - "content-exists", - "feature-exists", - "function-exists", - "get-function", - "global-variable-exists", - "inspect", - "keywords", - "mixin-exists", - "type-of", - "variable-exists", - - // with namespace - "meta.calc-args", - "meta.calc-name", - "meta.call", - "meta.content-exists", - "meta.feature-exists", - "meta.function-exists", - "meta.get-function", - "meta.global-variable-exists", - "meta.inspect", - "meta.keywords", - "meta.mixin-exists", - "meta.module-functions", - "meta.module-variables", - "meta.type-of", - "meta.variable-exists" -]); - -/** - * @see https://sass-lang.com/documentation/modules/selector - */ -const SELECTOR_FUNCTIONS = Object.freeze([ - "is-superselector", - "selector-append", - "selector-extend", - "selector-nest", - "selector-parse", - "selector-replace", - "selector-unify", - "simple-selectors", - - // with namespace - "selector.append", - "selector.extend", - "selector.is-superselector", - "selector.nest", - "selector.parse", - "selector.replace", - "selector.simple-selectors", - "selector.unify" -]); - -/** - * @see https://sass-lang.com/documentation/modules/string - */ -const STRING_FUNCTIONS = Object.freeze([ - "quote", - "str-index", - "str-insert", - "str-length", - "str-slice", - "to-lower-case", - "to-upper-case", - "unique-id", - "unquote", - - // with namespace - "string.index", - "string.insert", - "string.length", - "string.quote", - "string.slice", - "string.to-lower-case", - "string.to-upper-case", - "string.unique-id", - "string.unquote" -]); - -const ALL_FUNCTIONS = Object.freeze([ - ...GLOBAL_FUNCTIONS, - ...COLOR_FUNCTIONS, - ...LIST_FUNCTIONS, - ...MAP_FUNCTIONS, - ...MATH_FUNCTIONS, - ...META_FUNCTIONS, - ...SELECTOR_FUNCTIONS, - ...STRING_FUNCTIONS -]); - -module.exports = { - GLOBAL_FUNCTIONS, - COLOR_FUNCTIONS, - LIST_FUNCTIONS, - MAP_FUNCTIONS, - MATH_FUNCTIONS, - META_FUNCTIONS, - SELECTOR_FUNCTIONS, - STRING_FUNCTIONS, - ALL_FUNCTIONS -}; diff --git a/node_modules/stylelint-scss/src/utils/hasBlock.js b/node_modules/stylelint-scss/src/utils/hasBlock.js deleted file mode 100644 index e2d3b37e8..000000000 --- a/node_modules/stylelint-scss/src/utils/hasBlock.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -/** - * Check if a statement has an block (empty or otherwise). - * - * @param {Rule|AtRule} statement - postcss rule or at-rule node - * @return {boolean} True if `statement` has a block (empty or otherwise) - */ -module.exports = function (statement) { - return statement.nodes !== undefined; -}; diff --git a/node_modules/stylelint-scss/src/utils/hasEmptyLine.js b/node_modules/stylelint-scss/src/utils/hasEmptyLine.js deleted file mode 100644 index f7a5afa8a..000000000 --- a/node_modules/stylelint-scss/src/utils/hasEmptyLine.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -/** - * Check if a string contains at least one empty line - * - * @param {string} string - * @return {boolean} - */ -module.exports = function (string) { - return string && (string.includes("\n\n") || string.includes("\n\r\n")); -}; diff --git a/node_modules/stylelint-scss/src/utils/hasInterpolatingAmpersand.js b/node_modules/stylelint-scss/src/utils/hasInterpolatingAmpersand.js deleted file mode 100644 index ac91964c2..000000000 --- a/node_modules/stylelint-scss/src/utils/hasInterpolatingAmpersand.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; - -/** - * Check whether a selector has an interpolating ampersand - * An "interpolating ampersand" is an "&" used to interpolate within another - * simple selector (e.g. `&-modifier`), rather than an "&" that stands - * on its own as a simple selector (e.g. `& .child`) - * - * @param {string} selector - * @return {boolean} If `true`, the selector has an interpolating ampersand - */ -module.exports = function (selector) { - for (let i = 0; i < selector.length; i++) { - if (selector[i] !== "&") { - continue; - } - - if (selector[i - 1] !== undefined && !isCombinator(selector[i - 1])) { - return true; - } - - if (selector[i + 1] !== undefined && !isCombinator(selector[i + 1])) { - return true; - } - } - - return false; -}; - -function isCombinator(x) { - return /[\s+>~]/.test(x); -} diff --git a/node_modules/stylelint-scss/src/utils/hasInterpolation.js b/node_modules/stylelint-scss/src/utils/hasInterpolation.js deleted file mode 100644 index dcd0ad20a..000000000 --- a/node_modules/stylelint-scss/src/utils/hasInterpolation.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -const hasLessInterpolation = require("./hasLessInterpolation"); -const hasPsvInterpolation = require("./hasPsvInterpolation"); -const hasScssInterpolation = require("./hasScssInterpolation"); -const hasTplInterpolation = require("./hasTplInterpolation"); - -/** - * Check whether a string has interpolation - * - * @param {string} string - * @return {boolean} If `true`, a string has interpolation - */ -module.exports = function (string) { - // SCSS or Less interpolation - return !!( - hasLessInterpolation(string) || - hasScssInterpolation(string) || - hasTplInterpolation(string) || - hasPsvInterpolation(string) - ); -}; diff --git a/node_modules/stylelint-scss/src/utils/hasLessInterpolation.js b/node_modules/stylelint-scss/src/utils/hasLessInterpolation.js deleted file mode 100644 index bb4e82f43..000000000 --- a/node_modules/stylelint-scss/src/utils/hasLessInterpolation.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -/** - * Check whether a string has less interpolation - * - * @param {string} string - * @return {boolean} If `true`, a string has less interpolation - */ -module.exports = function (string) { - return /@{.+?}/.test(string); -}; diff --git a/node_modules/stylelint-scss/src/utils/hasNestedSibling.js b/node_modules/stylelint-scss/src/utils/hasNestedSibling.js deleted file mode 100644 index 5860a8a43..000000000 --- a/node_modules/stylelint-scss/src/utils/hasNestedSibling.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -/** - * Determines whether a given node has nested sibling. - * - * @param {import('postcss').Node} node - * @return {boolean} - */ -module.exports = function (node) { - return ( - node && node.parent.nodes.some(n => n !== node && n.type === "nesting") - ); -}; diff --git a/node_modules/stylelint-scss/src/utils/hasPsvInterpolation.js b/node_modules/stylelint-scss/src/utils/hasPsvInterpolation.js deleted file mode 100644 index 95a524ce1..000000000 --- a/node_modules/stylelint-scss/src/utils/hasPsvInterpolation.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -/** - * Check whether a string has postcss-simple-vars interpolation - * - * @param {string} string - */ -module.exports = function (string) { - return /\$\(.+?\)/.test(string); -}; diff --git a/node_modules/stylelint-scss/src/utils/hasScssInterpolation.js b/node_modules/stylelint-scss/src/utils/hasScssInterpolation.js deleted file mode 100644 index 58ed69ae0..000000000 --- a/node_modules/stylelint-scss/src/utils/hasScssInterpolation.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -/** - * Check whether a string has scss interpolation - * - * @param {string} string - */ -module.exports = function (string) { - return /#{.+?}/.test(string); -}; diff --git a/node_modules/stylelint-scss/src/utils/hasTplInterpolation.js b/node_modules/stylelint-scss/src/utils/hasTplInterpolation.js deleted file mode 100644 index 6a93295d4..000000000 --- a/node_modules/stylelint-scss/src/utils/hasTplInterpolation.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -/** - * Check whether a string has JS template literal interpolation or HTML-like template - * - * @param {string} string - * @return {boolean} If `true`, a string has template literal interpolation - */ -module.exports = function (string) { - return /{.+?}/.test(string); -}; diff --git a/node_modules/stylelint-scss/src/utils/isCustomPropertySet.js b/node_modules/stylelint-scss/src/utils/isCustomPropertySet.js deleted file mode 100644 index 46937229e..000000000 --- a/node_modules/stylelint-scss/src/utils/isCustomPropertySet.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -/** - * Check whether a Node is a custom property set - * - * @param {import('postcss').Rule} node - * @returns {boolean} - */ -module.exports = function (node) { - const prop = node?.raws?.prop?.raw || node.prop; - const value = node?.raws?.value?.raw || node.value; - - return ( - node.type === "decl" && - prop.startsWith("--") && - value.startsWith("{") && - value.endsWith("}") - ); -}; diff --git a/node_modules/stylelint-scss/src/utils/isInlineComment.js b/node_modules/stylelint-scss/src/utils/isInlineComment.js deleted file mode 100644 index 5ee37e42e..000000000 --- a/node_modules/stylelint-scss/src/utils/isInlineComment.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; - -/** - * Check if a comment is inline one (i.e. on the same line as some non-comment - * code). Only works with comments that are not ignored by PostCSS. To work - * with those that are ignored use `findCommentInRaws` - * - * @param {Comment} comment - PostCSS comment node - * @return {boolean} true, if the comment is an inline one - */ -module.exports = function isInlineComment(comment) { - const nextNode = comment.next(); - const isBeforeSomething = - !!nextNode && - nextNode.type !== "comment" && - comment.source.end.line === nextNode.source.start.line; - const isAfterSomething = comment.raws.before.search(/\n/) === -1; - - return isAfterSomething || isBeforeSomething; -}; diff --git a/node_modules/stylelint-scss/src/utils/isNativeCssFunction.js b/node_modules/stylelint-scss/src/utils/isNativeCssFunction.js deleted file mode 100644 index 76c50a103..000000000 --- a/node_modules/stylelint-scss/src/utils/isNativeCssFunction.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; - -const nativeCssFunctions = new Set([ - "annotation", - "attr", - "blur", - "brightness", - "calc", - "character-variant", - "circle", - "contrast", - "cross-fade", - "cubic-bezier", - "drop-shadow", - "element", - "ellipse", - "fit-content", - "format", - "frames", - "grayscale", - "hsl", - "hsla", - "hue-rotate", - "image", - "image-set", - "inset", - "invert", - "leader", - "linear-gradient", - "local", - "matrix", - "matrix3d", - "minmax", - "opacity", - "ornaments", - "perspective", - "polygon", - "radial-gradient", - "rect", - "repeat", - "repeating-linear-gradient", - "repeating-radial-gradient", - "rgb", - "rgba", - "rotate", - "rotate3d", - "rotateX", - "rotatex", - "rotateY", - "rotatey", - "rotateZ", - "rotatez", - "saturate", - "scale", - "scale3d", - "scaleX", - "scalex", - "scaleY", - "scaley", - "scaleZ", - "scalez", - "sepia", - "skew", - "skewX", - "skewY", - "steps", - "styleset", - "stylistic", - "swash", - "symbols", - "target-counter", - "target-counters", - "target-text", - "translate", - "translate3d", - "translateX", - "translatex", - "translateY", - "translatey", - "translateZ", - "translatez", - "url", - "var" -]); - -/** - * Check if a function name is a native CSS function name. - * - * @param {string} functionName The name to check. - * @returns {boolean} Whether or not the given function name is a native CSS function name. - */ -module.exports = function isNativeCssFunction(functionName) { - return nativeCssFunctions.has(functionName); -}; diff --git a/node_modules/stylelint-scss/src/utils/isSingleLineString.js b/node_modules/stylelint-scss/src/utils/isSingleLineString.js deleted file mode 100644 index e9696ffc8..000000000 --- a/node_modules/stylelint-scss/src/utils/isSingleLineString.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -/** - * Check if a string is a single line (i.e. does not contain - * any newline characters). - * - * @param {string} input - * @return {boolean} - */ -module.exports = function (input) { - return !/[\n\r]/.test(input); -}; diff --git a/node_modules/stylelint-scss/src/utils/isStandardRule.js b/node_modules/stylelint-scss/src/utils/isStandardRule.js deleted file mode 100644 index 0e2e51b0b..000000000 --- a/node_modules/stylelint-scss/src/utils/isStandardRule.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; - -const isCustomPropertySet = require("./isCustomPropertySet"); -const isStandardSyntaxSelector = require("./isStandardSelector"); - -/** - * Check whether a Node is a standard rule - * - * @param {import('postcss').Rule} rule - * @returns {boolean} - */ -module.exports = function (rule) { - // Get full selector - const selector = rule?.raws?.selector?.raw || rule.selector; - - if (!isStandardSyntaxSelector(rule.selector)) { - return false; - } - - // Custom property set (e.g. --custom-property-set: {}) - if (isCustomPropertySet(rule)) { - return false; - } - - // Called Less mixin (e.g. a { .mixin() }) - // @ts-ignore TODO TYPES support LESS and SASS types somehow - if (rule.mixin) { - return false; - } - - // Less detached rulesets - if (selector.startsWith("@") && selector.endsWith(":")) { - return false; - } - - // Ignore Less &:extend rule - // @ts-ignore TODO TYPES support LESS and SASS types somehow - if (rule.extend) { - return false; - } - - // Ignore mixin or &:extend rule - // https://github.com/shellscape/postcss-less/blob/master/lib/less-parser.js#L52 - // @ts-ignore TODO TYPES support LESS and SASS types somehow - if (rule.params && rule.params[0]) { - return false; - } - - // Non-outputting Less mixin definition (e.g. .mixin() {}) - if (selector.endsWith(")") && !selector.includes(":")) { - return false; - } - - // Less guards - if (/when\s+(not\s+)*\(/.test(selector)) { - return false; - } - - // Ignore Scss nested properties - if (selector.endsWith(":")) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint-scss/src/utils/isStandardSelector.js b/node_modules/stylelint-scss/src/utils/isStandardSelector.js deleted file mode 100644 index 221f30f25..000000000 --- a/node_modules/stylelint-scss/src/utils/isStandardSelector.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -const hasInterpolation = require("./hasInterpolation"); -const isStandardSyntaxSelector = require("./isStandardSyntaxSelector"); - -/** - * Check whether a selector is standard - * - * @param {string} selector - * @return {boolean} If `true`, the selector is standard - */ -module.exports = function (selector) { - const standardSyntaxSelector = isStandardSyntaxSelector(selector); - - // SCSS placeholder selectors - if (!standardSyntaxSelector) { - if (selector.indexOf("%") === 0 && !hasInterpolation(selector)) { - return true; - } - } - - return standardSyntaxSelector; -}; diff --git a/node_modules/stylelint-scss/src/utils/isStandardSyntaxProperty.js b/node_modules/stylelint-scss/src/utils/isStandardSyntaxProperty.js deleted file mode 100644 index 60e180181..000000000 --- a/node_modules/stylelint-scss/src/utils/isStandardSyntaxProperty.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; - -const hasInterpolation = require("./hasInterpolation"); - -/** - * Check whether a property is standard - * - * @param {string} property - * @returns {boolean} - */ -module.exports = function (property) { - // SCSS var (e.g. $var: x), list (e.g. $list: (x)) or map (e.g. $map: (key:value)) - if (property.startsWith("$")) { - return false; - } - - // Less var (e.g. @var: x) - if (property.startsWith("@")) { - return false; - } - - // Less append property value with space (e.g. transform+_: scale(2)) - if (property.endsWith("+") || property.endsWith("+_")) { - return false; - } - - // SCSS or Less interpolation - if (hasInterpolation(property)) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint-scss/src/utils/isStandardSyntaxSelector.js b/node_modules/stylelint-scss/src/utils/isStandardSyntaxSelector.js deleted file mode 100644 index 208e614e8..000000000 --- a/node_modules/stylelint-scss/src/utils/isStandardSyntaxSelector.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; - -const hasInterpolation = require("./hasInterpolation"); - -/** - * Check whether a selector is standard - * - * @param {string} selector - * @returns {boolean} - */ -module.exports = function (selector) { - // SCSS or Less interpolation - if (hasInterpolation(selector)) { - return false; - } - - // SCSS placeholder selectors - if (selector.startsWith("%")) { - return false; - } - - // Less :extend() - if (/:extend(\(.*?\))?/.test(selector)) { - return false; - } - - // Less mixin with resolved nested selectors (e.g. .foo().bar or .foo(@a, @b)[bar]) - if (/\.[\w-]+\(.*\).+/.test(selector)) { - return false; - } - - // ERB template tags - if (selector.includes("<%") || selector.includes("%>")) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint-scss/src/utils/isType.js b/node_modules/stylelint-scss/src/utils/isType.js deleted file mode 100644 index 28bc4f6ff..000000000 --- a/node_modules/stylelint-scss/src/utils/isType.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -/** - * Determine whether the given node is of the given type. - * - * @param {import('postcss').Node} node - * @param {string} type - * @return {boolean} - */ -module.exports = function (node, type) { - return node && node.type === type; -}; diff --git a/node_modules/stylelint-scss/src/utils/isWhitespace.js b/node_modules/stylelint-scss/src/utils/isWhitespace.js deleted file mode 100644 index 624c14cfc..000000000 --- a/node_modules/stylelint-scss/src/utils/isWhitespace.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -/** - * Check if a character is whitespace. - * - * @param {string} char - A single character - * @return {boolean} - */ -module.exports = function (char) { - return [" ", "\n", "\t", "\r", "\f"].includes(char); -}; diff --git a/node_modules/stylelint-scss/src/utils/matchesStringOrRegExp.js b/node_modules/stylelint-scss/src/utils/matchesStringOrRegExp.js deleted file mode 100644 index 67fce2864..000000000 --- a/node_modules/stylelint-scss/src/utils/matchesStringOrRegExp.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; - -/** - * Compares a string to a second value that, if it fits a certain convention, - * is converted to a regular expression before the comparison. - * If it doesn't fit the convention, then two strings are compared. - * - * Any strings starting and ending with `/` are interpreted - * as regular expressions. - * - * @param {string | Array} input - * @param {string | RegExp | Array} comparison - * - * @returns {false | {match: string, pattern: (string | RegExp), substring: string}} - */ -module.exports = function matchesStringOrRegExp(input, comparison) { - if (!Array.isArray(input)) { - return testAgainstStringOrRegExpOrArray(input, comparison); - } - - for (const inputItem of input) { - const testResult = testAgainstStringOrRegExpOrArray(inputItem, comparison); - - if (testResult) { - return testResult; - } - } - - return false; -}; - -/** - * @param {string} value - * @param {string | RegExp | Array} comparison - */ -function testAgainstStringOrRegExpOrArray(value, comparison) { - if (!Array.isArray(comparison)) { - return testAgainstStringOrRegExp(value, comparison); - } - - for (const comparisonItem of comparison) { - const testResult = testAgainstStringOrRegExp(value, comparisonItem); - - if (testResult) { - return testResult; - } - } - - return false; -} - -/** - * @param {string} value - * @param {string | RegExp} comparison - */ -function testAgainstStringOrRegExp(value, comparison) { - // If it's a RegExp, test directly - if (comparison instanceof RegExp) { - const match = value.match(comparison); - - return match - ? { match: value, pattern: comparison, substring: match[0] || "" } - : false; - } - - // Check if it's RegExp in a string - const firstComparisonChar = comparison[0]; - const lastComparisonChar = comparison[comparison.length - 1]; - const secondToLastComparisonChar = comparison[comparison.length - 2]; - - const comparisonIsRegex = - firstComparisonChar === "/" && - (lastComparisonChar === "/" || - (secondToLastComparisonChar === "/" && lastComparisonChar === "i")); - - const hasCaseInsensitiveFlag = - comparisonIsRegex && lastComparisonChar === "i"; - - // If so, create a new RegExp from it - if (comparisonIsRegex) { - const valueMatch = hasCaseInsensitiveFlag - ? value.match(new RegExp(comparison.slice(1, -2), "i")) - : value.match(new RegExp(comparison.slice(1, -1))); - - return valueMatch - ? { match: value, pattern: comparison, substring: valueMatch[0] || "" } - : false; - } - - // Otherwise, it's a string. Do a strict comparison - return value === comparison - ? { match: value, pattern: comparison, substring: value } - : false; -} diff --git a/node_modules/stylelint-scss/src/utils/moduleNamespace.js b/node_modules/stylelint-scss/src/utils/moduleNamespace.js deleted file mode 100644 index 141cccd2e..000000000 --- a/node_modules/stylelint-scss/src/utils/moduleNamespace.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; - -/** - * Returns the namespace of an imported module or `null` if the namespace is removed. - * - * Example: no import found, possibly using global function - * `@use "sass:color";` - * `moduleNamespace(root, 'sass:map')` returns 'map' - * - * Example: default namespace - * `@use "sass:map";` - * `moduleNamespace(root, 'sass:map')` returns `map` - * - * Example: custom namespace - * `@use "sass:map" as ns;` - * `moduleNamespace(root, 'sass:map')` returns 'ns' - * - * Example: no namespace - * `@use "sass:map" as *;` - * `moduleNamespace(root, 'sass:map')` returns `null` - * - * Have a look at the tests for more examples. - */ -module.exports = function moduleNamespace(root, module) { - let moduleNamespace = getDefaultNamespace(module); - - root.walkAtRules("use", rule => { - const customNamespace = getCustomNamespace(module, rule); - - switch (customNamespace) { - case null: - return; - case "*": - moduleNamespace = null; - return; - default: - moduleNamespace = customNamespace; - } - }); - - return moduleNamespace; -}; - -function getDefaultNamespace(module) { - return module.match(/([^/:]+)$/)[1].replace(/\.[^.]+$/, ""); -} - -function getCustomNamespace(module, rule) { - const ruleParamsParts = rule.params.split( - new RegExp(`["']${module}['"][ \n]*as`) - ); - - if (ruleParamsParts.length < 2) { - return null; - } - - const secondRuleParamsPart = ruleParamsParts[1].trim(); - - return !secondRuleParamsPart.startsWith("*") - ? secondRuleParamsPart.split(" ")[0] - : "*"; -} diff --git a/node_modules/stylelint-scss/src/utils/namespace.js b/node_modules/stylelint-scss/src/utils/namespace.js deleted file mode 100644 index 03ded56ee..000000000 --- a/node_modules/stylelint-scss/src/utils/namespace.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -const prefix = "scss"; - -module.exports = function namespace(ruleName) { - return `${prefix}/${ruleName}`; -}; diff --git a/node_modules/stylelint-scss/src/utils/optionsHaveException.js b/node_modules/stylelint-scss/src/utils/optionsHaveException.js deleted file mode 100644 index 00261419c..000000000 --- a/node_modules/stylelint-scss/src/utils/optionsHaveException.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -/** - * Check if an options object contains a certain `except` keyword. - * It will look for an `except` property whose value should - * be an array of keywords. - * - * @param {object} options - * @param {string} exceptionName - * @return {boolean} - */ -module.exports = function (options, exceptionName) { - return options && options.except && options.except.includes(exceptionName); -}; diff --git a/node_modules/stylelint-scss/src/utils/optionsHaveIgnored.js b/node_modules/stylelint-scss/src/utils/optionsHaveIgnored.js deleted file mode 100644 index 688b869d5..000000000 --- a/node_modules/stylelint-scss/src/utils/optionsHaveIgnored.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -/** - * Check if an options object contains a certain `ignore` keyword. - * It will look for an `ignore` property whose value should - * be an array of keywords. - * - * @param {object} options - * @param {string} ignoredName - * @return {boolean} - */ -module.exports = function (options, ignoredName) { - return options && options.ignore && options.ignore.includes(ignoredName); -}; diff --git a/node_modules/stylelint-scss/src/utils/optionsMatches.js b/node_modules/stylelint-scss/src/utils/optionsMatches.js deleted file mode 100644 index fb848f682..000000000 --- a/node_modules/stylelint-scss/src/utils/optionsMatches.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -const matchesStringOrRegExp = require("./matchesStringOrRegExp"); - -/** - * Check if an options object's propertyName contains a user-defined string or - * regex that matches the passed in input. - * - * @param {{ [x: string]: any; }} options - * @param {string} propertyName - * @param {unknown} input - * - * @returns {boolean} - */ -module.exports = function optionsMatches(options, propertyName, input) { - return Boolean( - options && - options[propertyName] && - typeof input === "string" && - matchesStringOrRegExp(input, options[propertyName]) - ); -}; diff --git a/node_modules/stylelint-scss/src/utils/parseFunctionArguments.js b/node_modules/stylelint-scss/src/utils/parseFunctionArguments.js deleted file mode 100644 index 2b944cbe5..000000000 --- a/node_modules/stylelint-scss/src/utils/parseFunctionArguments.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; - -const valueParser = require("postcss-value-parser"); - -function groupByKeyValue(nodes) { - if (!nodes) { - return []; - } - - let groupIndex = 0; - - return nodes.reduce((acc, node, nodeIndex) => { - const isComma = node.type === "div" && node.value === ","; - const skipTrailingComma = isComma && nodeIndex === nodes.length - 1; - - if (skipTrailingComma) { - return acc; - } - - if (isComma) { - groupIndex++; - } - - acc[groupIndex] = acc[groupIndex] || []; - - if (!isComma) { - acc[groupIndex].push(node); - } - - return acc; - }, []); -} - -function mapToKeyValue(nodes) { - const keyVal = nodes.reduce((acc, curr, i) => { - if (acc.length === 1) { - return acc; - } - - const nextNode = nodes[i + 1]; - const isNextNodeColon = - nextNode && nextNode.type === "div" && nextNode.value === ":"; - - if (isNextNodeColon) { - acc.push({ - key: valueParser.stringify(nodes[i]), - value: valueParser.stringify(nodes.slice(2)) - }); - - return acc; - } - - acc.push({ - value: valueParser.stringify(nodes) - }); - - return acc; - }, []); - - return keyVal[0]; -} - -function parseFunctionArguments(value) { - const parsed = valueParser(value); - - if (!parsed.nodes[0] || parsed.nodes[0].type !== "function") { - return []; - } - - return parsed.nodes.map(node => - groupByKeyValue(node.nodes).map(mapToKeyValue) - )[0]; -} - -module.exports = { - groupByKeyValue, - mapToKeyValue, - parseFunctionArguments -}; diff --git a/node_modules/stylelint-scss/src/utils/parseNestedPropRoot.js b/node_modules/stylelint-scss/src/utils/parseNestedPropRoot.js deleted file mode 100644 index 9675e1914..000000000 --- a/node_modules/stylelint-scss/src/utils/parseNestedPropRoot.js +++ /dev/null @@ -1,96 +0,0 @@ -"use strict"; - -/** - * Attempts to parse a selector as if it"s a root for a group of nested props - * E.g.: `margin: {`, `font: 10px/1.1 Arial {` ("{" excluded) - */ - -module.exports = function parseNestedPropRoot(propString) { - const modesEntered = [ - { - mode: "normal", - character: null, - isCalculationEnabled: true - } - ]; - const result = {}; - let lastModeIndex = 0; - let propName = ""; - - for (let i = 0; i < propString.length; i++) { - const character = propString[i]; - const prevCharacter = propString[i - 1]; - - // If entering/exiting a string - if (character === '"' || character === "'") { - if (modesEntered[lastModeIndex].isCalculationEnabled === true) { - modesEntered.push({ - mode: "string", - isCalculationEnabled: false, - character - }); - lastModeIndex++; - } else if ( - modesEntered[lastModeIndex].mode === "string" && - modesEntered[lastModeIndex].character === character && - prevCharacter !== "\\" - ) { - modesEntered.pop(); - lastModeIndex--; - } - } - - // If entering/exiting interpolation - if (character === "{") { - modesEntered.push({ - mode: "interpolation", - isCalculationEnabled: true - }); - lastModeIndex++; - } else if (character === "}") { - modesEntered.pop(); - lastModeIndex--; - } - - // Check for : outside fn call, string or interpolation. It must be at the - // end of a string or have a whitespace between it and following value - if ( - modesEntered[lastModeIndex].mode === "normal" && - character === ":" && - prevCharacter !== "\\" - ) { - const propValueStr = propString.substring(i + 1); - - if (propValueStr.length) { - const propValue = { - before: /^(\s*)/.exec(propValueStr)[1], - value: propValueStr.trim() - }; - - // It's a declaration if 1) there is a whitespace after :, or - // 2) the value is a number with/without a unit (starts with a number - // or a dot), or - // 3) the value is a variable (starts with $), or - // 4) the value a string, surprisingly - if (propValue.before === "" && !/^[\d.$'"]/.test(propValue.value)) { - return null; - } - - // +1 for the colon - propValue.sourceIndex = propValue.before.length + i + 1; - result.propValue = propValue; - } - - result.propName = { - after: /(\s*)$/.exec(propName)[1], - value: propName.trim() - }; - - return result; - } - - propName += character; - } - - return null; -}; diff --git a/node_modules/stylelint-scss/src/utils/parseSelector.js b/node_modules/stylelint-scss/src/utils/parseSelector.js deleted file mode 100644 index 84d36005e..000000000 --- a/node_modules/stylelint-scss/src/utils/parseSelector.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -const postCssSelectorParser = require("postcss-selector-parser"); - -module.exports = function (selector, result, node, cb) { - try { - return postCssSelectorParser(cb).processSync(selector); - } catch (e) { - result.warn("Cannot parse selector", { node }); - } -}; diff --git a/node_modules/stylelint-scss/src/utils/rawNodeString.js b/node_modules/stylelint-scss/src/utils/rawNodeString.js deleted file mode 100644 index 03a1e1d64..000000000 --- a/node_modules/stylelint-scss/src/utils/rawNodeString.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -/** - * Stringify PostCSS node including its raw "before" string. - * - * @param {Node} node - Any PostCSS node - * @return {string} - */ -module.exports = function (node) { - let result = ""; - - if (node.raws.before) { - result += node.raws.before; - } - - result += node.toString(); - - return result; -}; diff --git a/node_modules/stylelint-scss/src/utils/removeEmptyLinesBefore.js b/node_modules/stylelint-scss/src/utils/removeEmptyLinesBefore.js deleted file mode 100644 index be487fdd4..000000000 --- a/node_modules/stylelint-scss/src/utils/removeEmptyLinesBefore.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -// Remove empty lines before a node. Mutates the node. -module.exports = function removeEmptyLinesBefore( - node /*: postcss$node*/, - newline /*: '\n' | '\r\n'*/ -) /*: postcss$node*/ { - node.raws.before = node.raws.before.replace(/(\r?\n\s*\n)+/g, newline); - - return node; -}; diff --git a/node_modules/stylelint-scss/src/utils/ruleUrl.js b/node_modules/stylelint-scss/src/utils/ruleUrl.js deleted file mode 100644 index 831baa05e..000000000 --- a/node_modules/stylelint-scss/src/utils/ruleUrl.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -const revision = "master"; - -/** - * Get the specified rule's URL. - * - * @param {string} ruleName - * @return {string} - */ -module.exports = function ruleUrl(ruleName) { - let name = ruleName; - if (name.includes("/")) { - [, name] = name.split("/", 2); - } - return `https://github.com/stylelint-scss/stylelint-scss/blob/${revision}/src/rules/${name}`; -}; diff --git a/node_modules/stylelint-scss/src/utils/sassValueParser/index.js b/node_modules/stylelint-scss/src/utils/sassValueParser/index.js deleted file mode 100644 index 04ce78e6a..000000000 --- a/node_modules/stylelint-scss/src/utils/sassValueParser/index.js +++ /dev/null @@ -1,1021 +0,0 @@ -"use strict"; - -/** - * Processes a string and finds Sass operators in it - * - * @param {Object} args - Named arguments object - * @param {String} args.string - the input string - * @param {Number} args.globalIndex - the position of args.string from the start of the line - * @param {Boolean} args.isAfterColon - pass "true" if the string is - * a variable value, a mixin/function parameter default. - * In such cases + and / tend to be operations more often - * @param {Function} args.callback - will be called on every instance of - * an operator. Accepts parameters: - * • string - the default source string - * • globalIndex - the string's position in the outer input - * • startIndex - index in string, where the operator starts - * • endIndex - index in string, where the operator ends (for `==`, etc.) - * - * @return {Array} array of { symbol, globalIndex, startIndex, endIndex } - * for each operator found within a string - */ -module.exports = function findOperators({ - string, - globalIndex, - isAfterColon, - callback -}) { - const mathOperators = ["+", "/", "-", "*", "%"]; - // A stack of modes activated for the current char: string, interpolation - // Calculations inside strings are not processed, so spaces are not linted - const modesEntered = [ - { - mode: "normal", - isCalculationEnabled: true, - character: null - } - ]; - const result = []; - let lastModeIndex = 0; - - for (let i = 0; i < string.length; i++) { - const character = string[i]; - const substringStartingWithIndex = string.substring(i); - const lastMode = modesEntered[lastModeIndex]; - - // If entering/exiting a string - if (character === '"' || character === "'") { - if (lastMode && lastMode.isCalculationEnabled === true) { - modesEntered.push({ - mode: "string", - isCalculationEnabled: false, - character - }); - lastModeIndex++; - } else if ( - lastMode && - lastMode.mode === "string" && - lastMode.character === character && - string[i - 1] !== "\\" - ) { - modesEntered.pop(); - lastModeIndex--; - } - } - - // If entering/exiting interpolation (may be inside a string) - // Comparing with length-2 because `#{` at the very end doesnt matter - if ( - character === "#" && - i + 1 < string.length - 2 && - string[i + 1] === "{" - ) { - modesEntered.push({ - mode: "interpolation", - isCalculationEnabled: true - }); - lastModeIndex++; - } else if (character === "}") { - modesEntered.pop(); - lastModeIndex--; - } - - // Don't lint if inside a string - if (lastMode && lastMode.isCalculationEnabled === false) { - continue; - } - - // If it's a math operator - if ( - (mathOperators.includes(character) && - mathOperatorCharType(string, i, isAfterColon) === "op") || - // or is "<" or ">" - substringStartingWithIndex.search(/^[<>]([^=]|$)/) !== -1 - ) { - result.push({ - symbol: string[i], - globalIndex, - startIndex: i, - endIndex: i - }); - - if (callback) { - callback(string, globalIndex, i, i); - } - } - - // "<=", ">=", "!=", "==" - if (substringStartingWithIndex.search(/^[><=!]=/) !== -1) { - result.push({ - symbol: string[i], - globalIndex, - startIndex: i, - endIndex: i + 1 - }); - - if (callback) { - callback(string, globalIndex, i, i + 1); - } - } - } - - // result.length > 0 && console.log(string, result) - return result; -}; - -/** - * Checks if a character is an operator, a sign (+ or -), or part of a string - * - * @param {String} string - the source string - * @param {Number} index - the index of the character in string to check - * @param {Boolean} isAfterColon - if the value string a variable - * value, a mixin/function parameter default. In such cases + and / tend - * to be operations more often - * @return {String|false} - * • "op", if the character is a operator in a math/string operation - * • "sign" if it is a + or - before a numeric, - * • "char" if it is a part of a string, - * • false - if it is none from above (most likely an error) - */ -function mathOperatorCharType(string, index, isAfterColon) { - // !Checking here to prevent unnecessary calculations and deep recursion - // when calling isPrecedingOperator() - if (!["+", "/", "-", "*", "%"].includes(string[index])) { - return "char"; - } - - const character = string[index]; - const prevCharacter = string[index - 1]; - - if (prevCharacter !== "\\") { - // ---- Processing + characters - if (character === "+") { - return checkPlus(string, index, isAfterColon); - } - - // ---- Processing - characters - if (character === "-") { - return checkMinus(string, index); - } - - // ---- Processing * character - if (character === "*") { - return checkMultiplication(string, index); - } - - // ---- Processing % character - if (character === "%") { - return checkPercent(string, index); - } - - // ---- Processing / character - // https://sass-lang.com/documentation/operators/numeric#slash-separated-values - if (character === "/") { - return checkSlash(string, index, isAfterColon); - } - } - - return "char"; -} - -// -------------------------------------------------------------------------- -// Functions for checking particular characters (+, -, /) -// -------------------------------------------------------------------------- - -/** - * Checks the specified `*` char type: operator, sign (*), part of string - * - * @param {String} string - the source string - * @param {Number} index - the index of the character in string to check - * @return {String|false} - * • "op", if the character is a operator in a math/string operation - * • "sign" if it is a sign before a positive number, - * • "char" if it is a part of a string or identifier, - * • false - if it is none from above (most likely an error) - */ -function checkMultiplication(string, index) { - const insideFn = isInsideFunctionCall(string, index); - - if (insideFn.is && insideFn.fn) { - const fnArgsReg = new RegExp(insideFn.fn + "\\(([^)]+)\\)"); - const fnArgs = string.match(fnArgsReg); - const isSingleMultiplicationChar = - Array.isArray(fnArgs) && fnArgs[1] === "*"; - // e.g. selector(:has(*)) - if (isSingleMultiplicationChar) { - return "char"; - } - } - - return "op"; -} - -/** - * Checks the specified `+` char type: operator, sign (+ or -), part of string - * - * @param {String} string - the source string - * @param {Number} index - the index of the character in string to check - * @param {Boolean} isAftercolon - if the value string a variable - * value, a mixin/function parameter default. In such cases + is always an - * operator if surrounded by numbers/values with units - * @return {String|false} - * • "op", if the character is a operator in a math/string operation - * • "sign" if it is a sign before a positive number, - * • false - if it is none from above (most likely an error) - */ -function checkPlus(string, index, isAftercolon) { - const before = string.substring(0, index); - const after = string.substring(index + 1); - - // If the character is at the beginning of the input - const isAtStart_ = isAtStart(string, index); - // If the character is at the end of the input - const isAtEnd_ = isAtEnd(string, index); - const isWhitespaceBefore = before.search(/\s$/) !== -1; - const isWhitespaceAfter = after.search(/^\s/) !== -1; - - const isValueWithUnitAfter_ = isValueWithUnitAfter(after); - const isNumberAfter_ = isNumberAfter(after); - const isInterpolationAfter_ = isInterpolationAfter(after); - // The early check above helps prevent deep recursion here - const isPrecedingOperator_ = isPrecedingOperator(string, index); - - if (isAtStart_) { - // console.log("+, `+` or `+ `") - return "sign"; - } - - // E.g. `1+1`, `string+#fff` - if (!isAtStart_ && !isWhitespaceBefore && !isAtEnd_ && !isWhitespaceAfter) { - // E.g. `1-+1` - if (isPrecedingOperator_) { - // console.log('1+1') - return "sign"; - } - - // console.log("+, no spaces") - return "op"; - } - - // e.g. `something +something` - if (!isAtEnd_ && !isWhitespaceAfter) { - // e.g. `+something`, ` ... , +something`, etc. - if (isNoOperandBefore(string, index)) { - // console.log("+, nothing before") - return "sign"; - } - - // e.g. `sth +10px`, `sth +1` - if ( - (isValueWithUnitAfter_.is && !isValueWithUnitAfter_.opsBetween) || - (isNumberAfter_.is && !isNumberAfter_.opsBetween) - ) { - if (isAftercolon === true) { - // console.log(": 10px +1") - return "op"; - } - - // e.g. `(sth +10px)`, `fun(sth +1)` - if ( - isInsideParens(string, index) || - isInsideFunctionCall(string, index).is - ) { - // console.log("+10px or +1, inside function or parens") - return "op"; - } - - // e.g. `#{10px +1}` - if (isInsideInterpolation(string, index)) { - // console.log('+, #{10px +1}') - return "op"; - } - - // console.log('+, default') - return "sign"; - } - - // e.g. `sth +#fff`, `sth +string`, `sth +#{...}`, `sth +$var` - if ( - isStringAfter(after) || - isHexColorAfter(after) || - after[0] === "$" || - (isInterpolationAfter_.is && !isInterpolationAfter_.opsBefore) - ) { - // e.g. `sth+ +string` - if (isPrecedingOperator_) { - // console.log("+10px or +1, before is an operator") - return "sign"; - } - - // console.log("+#000, +string, +#{sth}, +$var") - return "op"; - } - - // console.log('sth +sth, default') - return "op"; - } - - // If the + is after a value, e.g. `$var+` - if (!isAtStart_ && !isWhitespaceBefore) { - // It is always an operator. Prior to Sass 4, `#{...}+` was different, - // but that's not logical and had been fixed. - // console.log('1+ sth') - return "op"; - } - - // If it has whitespaces on both sides - // console.log('sth + sth') - return "op"; -} - -/** - * Checks the specified `-` character: operator, sign (+ or -), part of string - * - * @param {String} string - the source string - * @param {Number} index - the index of the character in string to check - * @return {String|false} - * • "op", if the character is a operator in a math/string operation - * • "sign" if it is a sign before a negative number, - * • "char" if it is a part of a string or identifier, - * • false - if it is none from above (most likely an error) - */ -function checkMinus(string, index) { - const before = string.substring(0, index); - const after = string.substring(index + 1); - // If the character is at the beginning of the input - const isAtStart_ = isAtStart(string, index); - // If the character is at the end of the input - const isAtEnd_ = isAtEnd(string, index); - const isWhitespaceBefore = before.search(/\s$/) !== -1; - const isWhitespaceAfter = after.search(/^\s/) !== -1; - - const isValueWithUnitAfter_ = isValueWithUnitAfter(after); - const isValueWithUnitBefore_ = isValueWithUnitBefore(before); - const isNumberAfter_ = isNumberAfter(after); - const isNumberBefore_ = isNumberBefore(before); - const isInterpolationAfter_ = isInterpolationAfter(after); - const isParensAfter_ = isParensAfter(after); - const isParensBefore_ = isParensBefore(before); - // The early check above helps prevent deep recursion here - const isPrecedingOperator_ = isPrecedingOperator(string, index); - const isInsideFunctionCall_ = isInsideFunctionCall(string, index); - - if (isAtStart_) { - // console.log("-, - or - ") - return "sign"; - } - - // `10 - 11` - if (!isAtEnd_ && !isAtStart_ && isWhitespaceBefore && isWhitespaceAfter) { - // console.log("-, Op: 10px - 10px") - return "op"; - } - - // e.g. `something -10px` - if (!isAtEnd_ && !isAtStart_ && isWhitespaceBefore && !isWhitespaceAfter) { - if (isParensAfter_.is && !isParensAfter_.opsBefore) { - // console.log("-, Op: -(...)") - return "op"; - } - - // e.g. `#{10px -1}`, `#{math.acos(-0.5)}` - if (isInsideInterpolation(string, index)) { - // e.g. `url(https://my-url.com/image-#{$i -2}-dark.svg)` - if (isInsideFunctionCall_.fn === "url") { - return "op"; - } - - if ( - isInsideFunctionCall_.is && - ((isValueWithUnitAfter_.is && !isValueWithUnitAfter_.opsBetween) || - (isNumberAfter_.is && !isNumberAfter_.opsBetween)) - ) { - return "sign"; - } - - // e.g. `#{$i * -10}px` - if (isWhitespaceBefore && isNumberAfter_.is && isPrecedingOperator_) { - return "sign"; - } - - return "op"; - } - - // e.g. `sth -1px`, `sth -1`. - // Always a sign, even inside parens/function args - if ( - (isValueWithUnitAfter_.is && !isValueWithUnitAfter_.opsBetween) || - (isNumberAfter_.is && !isNumberAfter_.opsBetween) - ) { - // console.log("-, sign: -1px or -1") - return "sign"; - } - - // e.g. `sth --1`, `sth +-2px` - if ( - (isValueWithUnitAfter_.is && isValueWithUnitAfter_.opsBetween) || - (isNumberAfter_.is && isNumberAfter_.opsBetween) - ) { - // console.log("-, op: --1px or --1") - return "op"; - } - - // ` -string`, ` -#{...}` - if ( - isStringAfter(after) || - (isInterpolationAfter_.is && !isInterpolationAfter_.opsBefore) - ) { - // console.log("-, char: -#{...}") - return "char"; - } - - // e.g. `#0af -#f0a`, and edge-cases can take a hike - if (isHexColorAfter(after) && isHexColorBefore(before.trim())) { - // console.log("-, op: #fff-, -#fff") - return "op"; - } - - // If the - is before a variable, than it's most likely an operator - if (after[0] === "$") { - if (isPrecedingOperator_) { - // console.log("-, sign: -$var, another operator before") - return "sign"; - } - - // console.log("-, op: -$var, NO other operator before") - return "op"; - } - - // By default let's make it an sign for now - // console.log('-, sign: default in -') - return "sign"; - } - - // No whitespace before, - // e.g. `10x- something` - if (!isAtEnd_ && !isAtStart_ && !isWhitespaceBefore && isWhitespaceAfter) { - if (isParensBefore_) { - // console.log('-, op: `(...)- `') - return "op"; - } - - // e.g. `#{10px- 1}` - if (isInsideInterpolation(string, index)) { - return "op"; - } - - if (isNumberBefore(before) || isHexColorBefore(before)) { - // console.log('`-, op: 10- , #aff- `') - return "op"; - } - - // console.log('-, char: default in - ') - return "char"; - } - - // NO Whitespace, - // e.g. `10px-1` - if (!isAtEnd_ && !isAtStart_ && !isWhitespaceBefore && !isWhitespaceAfter) { - // console.log('no spaces') - // `-1`, `-10px` - if ( - (isValueWithUnitAfter_.is && !isValueWithUnitAfter_.opsBetween) || - (isNumberAfter_.is && !isNumberAfter_.opsBetween) - ) { - // `10px-1`, `1-10px`, `1-1`, `1x-1x` - if (isValueWithUnitBefore_ || isNumberBefore_) { - // console.log("-, op: 1-10px") - return "op"; - } - - // The - could be a "sign" here, but for now "char" does the job - } - - // `1-$var` - if (isNumberBefore_ && after[0] === "$") { - // console.log("-, op: 1-$var") - return "op"; - } - - // `fn()-10px` - if ( - isFunctionBefore(before) && - ((isNumberAfter_.is && !isNumberAfter_.opsBetween) || - (isValueWithUnitAfter_.is && !isValueWithUnitAfter_.opsBetween)) - ) { - // console.log("-, op: fn()-10px") - return "op"; - } - } - - // And in all the other cases it's a character inside a string - // console.log("-, default: char") - return "char"; -} - -/** - * Checks the specified `/` character: operator, sign (+ or -), part of string - * - * @param {String} string - the source string - * @param {Number} index - the index of the character in string to check - * @param {Boolean} isAfterColon - if the value string a variable - * value, a mixin/function parameter default. In such cases / is always an - * operator if surrounded by numbers/values with units - * @return {String|false} - * • "op", if the character is a operator in a math/string operation - * • "char" if it gets compiled as-is, e.g. `font: 10px/1.2;`, - * • false - if it is none from above (most likely an error) - */ -function checkSlash(string, index, isAfterColon) { - // Trimming these, as spaces before/after a slash don't matter - const before = string.substring(0, index).trim(); - const after = string.substring(index + 1).trim(); - - const isValueWithUnitAfter_ = isValueWithUnitAfter(after); - const isValueWithUnitBefore_ = isValueWithUnitBefore(before); - const isNumberAfter_ = isNumberAfter(after); - const isNumberBefore_ = isNumberBefore(before); - const isParensAfter_ = isParensAfter(after); - const isParensBefore_ = isParensBefore(before); - - // FIRST OFF. Interpolation on any of the sides is a NO-GO for division op - if (isInterpolationBefore(before).is || isInterpolationAfter(after).is) { - // console.log("/, interpolation") - return "char"; - } - - // having a dot before probably means a relative path. - // e.g. url(../../image.png) - if (isDotBefore(before)) { - return "char"; - } - - // e.g. `(1px/1)`, `fn(7 / 15)`, but not `url(8/11)` - const isInsideFn = isInsideFunctionCall(string, index); - - if (isInsideFn.is && isInsideFn.fn === "url") { - // e.g. `url(https://my-url.com/image-#{$i /2}-dark.svg)` - if (isInsideInterpolation(string, index)) { - return "op"; - } - return "char"; - } - - // e.g. `10px/normal` - if (isStringBefore(before).is || isStringAfter(after)) { - // console.log("/, string") - return "char"; - } - - // For all other value options (numbers, value+unit, hex color) - - // `$var/1`, `#fff/-$var` - // Here we don't care if there is a sign before the var - if (isVariableBefore(before) || isVariableAfter(after).is) { - // console.log("/, variable") - return "op"; - } - - if (isFunctionBefore(before) || isFunctionAfter(after).is) { - // console.log("/, function as operand") - return "op"; - } - - if (isParensBefore_ || isParensAfter_.is) { - // console.log("/, function as operand") - return "op"; - } - - // `$var: 10px/2; // 5px` - if ( - isAfterColon === true && - (isValueWithUnitAfter_.is || isNumberAfter_.is) && - (isValueWithUnitBefore_ || isNumberBefore_) - ) { - return "op"; - } - - // Quick check of the following operator symbol - if it is a math operator - if ( - // +, *, % count as operators unless after interpolation or at the start - before.search(/[^{,(}\s]\s*[+*%][^(){},]+$/) !== -1 || - // We consider minus as op only if surrounded by whitespaces (` - `); - before.search(/[^{,(}\s]\s+-\s[^(){},]+$/) !== -1 || - // `10/2 * 3`, `10/2 % 3`, with or without spaces - after.search(/^[^(){},]+[*%]/) !== -1 || - // `10px/2px+1`, `10px/2px+ 1` - after.search(/^[^(){},\s]+\+/) !== -1 || - // Anything but `10px/2px +1`, `10px/2px +1px` - after.search(/^[^(){},\s]+\s+(\+\D)/) !== -1 || - // Following ` -`: only if `$var` after (`10/10 -$var`) - after.search(/^[^(){},\s]+\s+-(\$|\s)/) !== -1 || - // Following `-`: only if number after (`10s/10s-10`, `10s/10s-.1`) - after.search(/^[^(){},\s]+-(\.)?\d/) !== -1 || - // Or if there is a number before anything but string after (not `10s/1-str`,) - after.search(/^(\d*\.)?\d+-\s*[^#a-zA-Z_\s]/) !== -1 - ) { - // console.log("/, math op around") - return "op"; - } - - if ( - isInsideParens(string, index) || - (isInsideFn.is && isInsideFn.fn !== "url") - ) { - // console.log("/, parens or function arg") - return "op"; - } - - // console.log("/, default") - return "char"; -} - -/** - * Checks the specified `%` character: operator or part of value - * - * @param {String} string - the source string - * @param {Number} index - the index of the character in string to check - * @return {String|false} - * • "op", if the character is a operator in a math/string operation - * • "char" if it gets compiled as-is, e.g. `width: 10%`, - * • false - if it is none from above (most likely an error) - */ -function checkPercent(string, index) { - // Trimming these, as spaces before/after a slash don't matter - const before = string.substring(0, index); - const after = string.substring(index + 1); - - // If the character is at the beginning of the input - const isAtStart_ = isAtStart(string, index); - // If the character is at the end of the input - const isAtEnd_ = isAtEnd(string, index); - const isWhitespaceBefore = before.search(/\s$/) !== -1; - const isWhitespaceAfter = after.search(/^\s/) !== -1; - - const isParensBefore_ = isParensBefore(before); - - // FIRST OFF. Interpolation on any of the sides is a NO-GO - if ( - isInterpolationBefore(before.trim()).is || - isInterpolationAfter(after.trim()).is - ) { - // console.log("%, interpolation") - return "char"; - } - - if (isAtStart_ || isAtEnd_) { - // console.log("%, start/end") - return "char"; - } - - // In ` %` it's most likely an operator (except for interpolation - // checked above) - if (isWhitespaceBefore && !isWhitespaceAfter) { - // console.log("%, ` %`") - return "op"; - } - - // `$var% 1`, `$var%1`, `$var%-1` - if (isVariableBefore(before) || isParensBefore_) { - // console.log("%, after a variable, function or parens") - return "op"; - } - - // in all other cases in `% ` it is most likely a unit - if (!isWhitespaceBefore && isWhitespaceAfter) { - // console.log("%, `% `") - return "char"; - } - - // console.log("%, default") - return "char"; -} - -// -------------------------------------------------------------------------- -// Lots of elementary helpers -// -------------------------------------------------------------------------- - -function isAtStart(string, index) { - const before = string.substring(0, index).trim(); - - return before.length === 0 || before.search(/[({,]$/) !== -1; -} - -function isAtEnd(string, index) { - const after = string.substring(index + 1).trim(); - - return after.length === 0 || after.search(/^[,)}]/) !== -1; -} - -function isInsideParens(string, index) { - const before = string.substring(0, index).trim(); - const after = string.substring(index + 1).trim(); - - return ( - before.search(/(?:^|[,{\s])\([^(){},]+$/) !== -1 && - after.search(/^[^(){},\s]+\s*\)/) !== -1 - ); -} - -function isInsideInterpolation(string, index) { - const before = string.substring(0, index).trim(); - - return before.search(/#{[^}]*$/) !== -1; -} - -/** - * Checks if the character is inside a function arguments - * - * @param {String} string - the input string - * @param {Number} index - current character index - * @return {Object} return - * {Boolean} return.is - if inside a function arguments - * {String} return.fn - function name - */ -function isInsideFunctionCall(string, index) { - const result = { is: false, fn: null }; - const before = string.substring(0, index).trim(); - const after = string.substring(index + 1).trim(); - const beforeMatch = before.match( - /(?:[a-zA-Z_-][\w-]*\()?(:?[a-zA-Z_-][\w-]*)\(/ - ); - - if (beforeMatch && beforeMatch[0] && after.search(/^[^(,]+\)/) !== -1) { - result.is = true; - result.fn = beforeMatch[1]; - } - - return result; -} - -/** - * Checks if there is a string before the character. - * Also checks if there is a math operator in between - * - * @param {String} before - the input string that preceses the character - * @return {Object} return - * {Boolean} return.is - if there is a string - * {String} return.opsBetween - if there are operators in between - */ -function isStringBefore(before) { - const result = { is: false, opsBetween: false }; - const stringOpsClipped = before.replace(/(\s*[+/*%]|\s+-)+$/, ""); - - if (stringOpsClipped !== before) { - result.opsBetween = true; - } - - // If it is quoted - if ( - stringOpsClipped[stringOpsClipped.length - 1] === '"' || - stringOpsClipped[stringOpsClipped.length - 1] === "'" - ) { - result.is = true; - } else if ( - stringOpsClipped.search( - /(?:^|[/(){},: ])([a-zA-Z_][\w-]*|-+[a-zA-Z_][\w-]*)$/ - ) !== -1 - ) { - // First pattern: a1, a1a, a-1, - result.is = true; - } - - return result; -} - -function isStringAfter(after) { - const stringTrimmed = after.trim(); - - // If it is quoted - if (stringTrimmed[0] === '"' || stringTrimmed[0] === "'") return true; - - // e.g. `a1`, `a1a`, `a-1`, and even `--s323` - return ( - stringTrimmed.search(/^([a-zA-Z_][\w-]*|-+[a-zA-Z_][\w-]*)(?:$|[)}, ])/) !== - -1 - ); -} - -function isInterpolationAfter(after) { - const result = { is: false, opsBetween: false }; - const matches = after.match(/^\s*([+/*%-]\s*)*#{/); - - if (matches) { - if (matches[0]) { - result.is = true; - } - - if (matches[1]) { - result.opsBetween = true; - } - } - - return result; -} - -function isParensAfter(after) { - const result = { is: false, opsBetween: false }; - const matches = after.match(/^\s*([+/*%-]\s*)*\(/); - - if (matches) { - if (matches[0]) { - result.is = true; - } - - if (matches[1]) { - result.opsBetween = true; - } - } - - return result; -} - -function isParensBefore(before) { - return before.search(/\)\s*$/) !== -1; -} - -/** - * Checks if there is an interpolation before the character. - * Also checks if there is a math operator in between - * - * @param {String} before - the input string that preceses the character - * @return {Object} return - * {Boolean} return.is - if there is an interpolation - * {String} return.opsBetween - if there are operators in between - */ -function isInterpolationBefore(before) { - const result = { is: false, opsBetween: false }; - // Removing preceding operators if any - const beforeOpsClipped = before.replace(/(\s*[+/*%-])+$/, ""); - - if (beforeOpsClipped !== before) { - result.opsBetween = true; - } - - if (beforeOpsClipped[beforeOpsClipped.length - 1] === "}") { - result.is = true; - } - - return result; -} - -function isValueWithUnitBefore(before) { - // 1px, 0.1p-x, .2p-, 11.2pdf-df1df_ - // Surprisingly, ` d.10px` - .10px is separated from a sequence - // and is considered a value with a unit - return before.trim().search(/(^|[/(, .])\d[\w-]+$/) !== -1; -} - -function isValueWithUnitAfter(after) { - const result = { is: false, opsBetween: false }; - // 1px, 0.1p-x, .2p-, 11.2pdf-dfd1f_ - // Again, ` d.10px` - .10px is separated from a sequence - // and is considered a value with a unit - const matches = after.match( - /^\s*([+/*%-]\s*)*(\d+(\.\d+)?|\.\d+)[\w-%]+(?:$|[)}, ])/ - ); - - if (matches) { - if (matches[0]) { - result.is = true; - } - - if (matches[1]) { - result.opsBetween = true; - } - } - - return result; -} - -function isNumberAfter(after) { - const result = { is: false, opsBetween: false }; - const matches = after.match( - /^\s*([+/*%-]\s*)*(\d+(\.\d+)?|\.\d+)(?:$|[)}, ])/ - ); - - if (matches) { - if (matches[0]) { - result.is = true; - } - - if (matches[1]) { - result.opsBetween = true; - } - } - - return result; -} - -function isNumberBefore(before) { - return before.trim().search(/(?:^|[/(){},\s])(\d+(\.\d+)?|\.\d+)$/) !== -1; -} - -function isVariableBefore(before) { - return before.trim().search(/\$[\w-]+$/) !== -1; -} - -function isVariableAfter(after) { - const result = { is: false, opsBetween: false }; - const matches = after.match(/^\s*([+/*%-]\s*)*\$/); - - if (matches) { - if (matches[0]) { - result.is = true; - } - - if (matches[1]) { - result.opsBetween = true; - } - } - - return result; -} - -function isDotBefore(before) { - return before.slice(-1) === "."; -} - -function isFunctionBefore(before) { - return before.trim().search(/[\w-]\(.*?\)\s*$/) !== -1; -} - -function isFunctionAfter(after) { - const result = { is: false, opsBetween: false }; - // `-fn()` is a valid function name, so if a - should be a sign/operator, - // it must have a space after - const matches = after.match(/^\s*(-\s+|[+/*%]\s*)*[a-zA-Z_-][\w-]*\(/); - - if (matches) { - if (matches[0]) { - result.is = true; - } - - if (matches[1]) { - result.opsBetween = true; - } - } - - return result; -} - -/** - * Checks if the input string is a hex color value - * - * @param {String} string - the input - * @return {Boolean} true, if the input is a hex color - */ -function isHexColor(string) { - return string.trim().search(/^#([\da-fA-F]{3}|[\da-fA-F]{6})$/) !== -1; -} - -function isHexColorAfter(after) { - const afterTrimmed = after.match(/(.*?)(?:[)},+/*%\-\s]|$)/)[1].trim(); - - return isHexColor(afterTrimmed); -} - -function isHexColorBefore(before) { - return ( - before.search(/(?:[/(){},+*%-\s]|^)#([\da-fA-F]{3}|[\da-fA-F]{6})$/) !== -1 - ); -} - -/** - * Checks if there is no operand before the current char - * In other words, the current char is at the start of a possible operation, - * e.g. at the string start, after the opening paren or after a comma - * - * @param {String} string - the input string - * @param {Number} index - current char's position in string - * @return {Boolean} - */ -function isNoOperandBefore(string, index) { - const before = string.substring(0, index).trim(); - - return before.length === 0 || before.search(/[({,]&/) !== -1; -} - -function isPrecedingOperator(string, index) { - let prevCharIndex = -1; - - for (let i = index - 1; i >= 0; i--) { - if (string[i].search(/\s/) === -1) { - prevCharIndex = i; - break; - } - } - - if (prevCharIndex === -1) { - return false; - } - - if (mathOperatorCharType(string, prevCharIndex) === "op") { - return true; - } - - return false; -} - -module.exports.mathOperatorCharType = mathOperatorCharType; -module.exports.isInsideFunctionCall = isInsideFunctionCall; diff --git a/node_modules/stylelint-scss/src/utils/validateTypes.js b/node_modules/stylelint-scss/src/utils/validateTypes.js deleted file mode 100644 index 0610c75a4..000000000 --- a/node_modules/stylelint-scss/src/utils/validateTypes.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; - -/** - * Checks if the value is a boolean or a Boolean object. - * @param {unknown} value - * @returns {value is boolean} - */ -function isBoolean(value) { - return typeof value === "boolean" || value instanceof Boolean; -} - -/** - * Checks if the value is a number or a Number object. - * @param {unknown} value - * @returns {value is number} - */ -function isNumber(value) { - return typeof value === "number" || value instanceof Number; -} - -/** - * Checks if the value is a regular expression. - * @param {unknown} value - * @returns {value is RegExp} - */ -function isRegExp(value) { - return value instanceof RegExp; -} - -/** - * Checks if the value is a string or a String object. - * @param {unknown} value - * @returns {value is string} - */ -function isString(value) { - return typeof value === "string" || value instanceof String; -} - -module.exports = { - isBoolean, - isNumber, - isRegExp, - isString -}; diff --git a/node_modules/stylelint-scss/src/utils/whitespaceChecker.js b/node_modules/stylelint-scss/src/utils/whitespaceChecker.js deleted file mode 100644 index 86dbdaa97..000000000 --- a/node_modules/stylelint-scss/src/utils/whitespaceChecker.js +++ /dev/null @@ -1,338 +0,0 @@ -"use strict"; - -const configurationError = require("./configurationError"); -const isSingleLineString = require("./isSingleLineString"); -const isWhitespace = require("./isWhitespace"); - -/** - * Create a whitespaceChecker, which exposes the following functions: - * - `before()` - * - `beforeAllowingIndentation()` - * - `after()` - * - `afterOneOnly()` - * - * @param {"space"|"newline"} targetWhitespace - This is a keyword instead - * of the actual character (e.g. " ") in order to accommodate - * different styles of newline ("\n" vs "\r\n") - * @param { - * "always"|"never" - * |"always-single-line"|"always-multi-line" - * | "never-single-line"|"never-multi-line" - * } expectation - * @param {object} messages - An object of message functions; - * calling `before*()` or `after*()` and the `expectation` that is passed - * determines which message functions are required - * @param {function} [messages.expectedBefore] - * @param {function} [messages.rejectedBefore] - * @param {function} [messages.expectedAfter] - * @param {function} [messages.rejectedAfter] - * @param {function} [messages.expectedBeforeSingleLine] - * @param {function} [messages.rejectedBeforeSingleLine] - * @param {function} [messages.expectedBeforeMultiLine] - * @param {function} [messages.rejectedBeforeMultiLine] - * @return {object} The checker, with its exposed checking functions - */ -module.exports = function (targetWhitespace, expectation, messages) { - // Keep track of active arguments in order to avoid passing - // too much stuff around, making signatures long and confusing. - // This variable gets reset anytime a checking function is called. - let activeArgs; - - /** - * Check for whitespace *before* a character. - * - * @param {object} args - Named arguments object - * @param {string} args.source - The source string - * @param {number} args.index - The index of the character to check before - * @param {function} args.err - If a violation is found, this callback - * will be invoked with the relevant warning message. - * Typically this callback will report() the violation. - * @param {function} args.errTarget - If a violation is found, this string - * will be sent to the relevant warning message. - * @param {string} [args.lineCheckStr] - Single- and multi-line checkers - * will use this string to determine whether they should proceed, - * i.e. if this string is one line only, single-line checkers will check, - * multi-line checkers will ignore. - * If none is passed, they will use `source`. - * @param {boolean} [args.onlyOneChar=false] - Only check *one* character before. - * By default, "always-*" checks will look for the `targetWhitespace` one - * before and then ensure there is no whitespace two before. This option - * bypasses that second check. - * @param {boolean} [args.allowIndentation=false] - Allow arbitrary indentation - * between the `targetWhitespace` (almost definitely a newline) and the `index`. - * With this option, the checker will see if a newline *begins* the whitespace before - * the `index`. - */ - function before({ - source, - index, - err, - errTarget, - lineCheckStr, - onlyOneChar = false, - allowIndentation = false - }) { - activeArgs = { - source, - index, - err, - errTarget, - onlyOneChar, - allowIndentation - }; - - switch (expectation) { - case "always": - expectBefore(); - break; - case "never": - rejectBefore(); - break; - case "always-single-line": - if (!isSingleLineString(lineCheckStr || source)) { - return; - } - - expectBefore(messages.expectedBeforeSingleLine); - break; - case "never-single-line": - if (!isSingleLineString(lineCheckStr || source)) { - return; - } - - rejectBefore(messages.rejectedBeforeSingleLine); - break; - case "always-multi-line": - if (isSingleLineString(lineCheckStr || source)) { - return; - } - - expectBefore(messages.expectedBeforeMultiLine); - break; - case "never-multi-line": - if (isSingleLineString(lineCheckStr || source)) { - return; - } - - rejectBefore(messages.rejectedBeforeMultiLine); - break; - default: - throw configurationError(`Unknown expectation "${expectation}"`); - } - } - - /** - * Check for whitespace *after* a character. - * - * Parameters are pretty much the same as for `before()`, above, just substitute - * the word "after" for "before". - */ - function after({ - source, - index, - err, - errTarget, - lineCheckStr, - onlyOneChar = false - }) { - activeArgs = { source, index, err, errTarget, onlyOneChar }; - - switch (expectation) { - case "always": - expectAfter(); - break; - case "never": - rejectAfter(); - break; - case "always-single-line": - if (!isSingleLineString(lineCheckStr || source)) { - return; - } - - expectAfter(messages.expectedAfterSingleLine); - break; - case "never-single-line": - if (!isSingleLineString(lineCheckStr || source)) { - return; - } - - rejectAfter(messages.rejectedAfterSingleLine); - break; - case "always-multi-line": - if (isSingleLineString(lineCheckStr || source)) { - return; - } - - expectAfter(messages.expectedAfterMultiLine); - break; - case "never-multi-line": - if (isSingleLineString(lineCheckStr || source)) { - return; - } - - rejectAfter(messages.rejectedAfterMultiLine); - break; - case "at-least-one-space": - expectAfter(messages.expectedAfterAtLeast); - break; - default: - throw configurationError(`Unknown expectation "${expectation}"`); - } - } - - function beforeAllowingIndentation(obj) { - before(Object.assign({}, obj, { allowIndentation: true })); - } - - function expectBefore(messageFunc = messages.expectedBefore) { - if (activeArgs.allowIndentation) { - expectBeforeAllowingIndentation(messageFunc); - - return; - } - - const { source, index } = activeArgs; - const oneCharBefore = source[index - 1]; - const twoCharsBefore = source[index - 2]; - - if (!isValue(oneCharBefore)) { - return; - } - - if (targetWhitespace === "newline") { - // If index is preceeded by a Windows CR-LF ... - if (oneCharBefore === "\n" && twoCharsBefore === "\r") { - if (activeArgs.onlyOneChar || !isWhitespace(source[index - 3])) { - return; - } - } - - // If index is followed by a Unix LF ... - if (oneCharBefore === "\n" && twoCharsBefore !== "\r") { - if (activeArgs.onlyOneChar || !isWhitespace(twoCharsBefore)) { - return; - } - } - } - - if (targetWhitespace === "space" && oneCharBefore === " ") { - if (activeArgs.onlyOneChar || !isWhitespace(twoCharsBefore)) { - return; - } - } - - activeArgs.err( - messageFunc(activeArgs.errTarget ? activeArgs.errTarget : source[index]) - ); - } - - function expectBeforeAllowingIndentation( - messageFunc = messages.expectedBefore - ) { - const { source, index, err } = activeArgs; - const expectedChar = (() => { - if (targetWhitespace === "newline") { - return "\n"; - } - - if (targetWhitespace === "space") { - return " "; - } - })(); - let i = index - 1; - - while (source[i] !== expectedChar) { - if (source[i] === "\t" || source[i] === " ") { - i--; - continue; - } - - err( - messageFunc(activeArgs.errTarget ? activeArgs.errTarget : source[index]) - ); - - return; - } - } - - function rejectBefore(messageFunc = messages.rejectedBefore) { - const { source, index } = activeArgs; - const oneCharBefore = source[index - 1]; - - if (isValue(oneCharBefore) && isWhitespace(oneCharBefore)) { - activeArgs.err( - messageFunc(activeArgs.errTarget ? activeArgs.errTarget : source[index]) - ); - } - } - - function afterOneOnly(obj) { - after(Object.assign({}, obj, { onlyOneChar: true })); - } - - function expectAfter(messageFunc = messages.expectedAfter) { - const { source, index } = activeArgs; - - const oneCharAfter = index + 1 < source.length ? source[index + 1] : ""; - const twoCharsAfter = index + 2 < source.length ? source[index + 2] : ""; - - if (!isValue(oneCharAfter)) { - return; - } - - if (targetWhitespace === "newline") { - // If index is followed by a Windows CR-LF ... - if (oneCharAfter === "\r" && twoCharsAfter === "\n") { - const threeCharsAfter = - index + 3 < source.length ? source[index + 3] : ""; - - if (activeArgs.onlyOneChar || !isWhitespace(threeCharsAfter)) { - return; - } - } - - // If index is followed by a Unix LF ... - if (oneCharAfter === "\n") { - if (activeArgs.onlyOneChar || !isWhitespace(twoCharsAfter)) { - return; - } - } - } - - if (targetWhitespace === "space" && oneCharAfter === " ") { - if ( - expectation === "at-least-one-space" || - activeArgs.onlyOneChar || - !isWhitespace(twoCharsAfter) - ) { - return; - } - } - - activeArgs.err( - messageFunc(activeArgs.errTarget ? activeArgs.errTarget : source[index]) - ); - } - - function rejectAfter(messageFunc = messages.rejectedAfter) { - const { source, index } = activeArgs; - const oneCharAfter = index + 1 < source.length ? source[index + 1] : ""; - - if (isValue(oneCharAfter) && isWhitespace(oneCharAfter)) { - activeArgs.err( - messageFunc(activeArgs.errTarget ? activeArgs.errTarget : source[index]) - ); - } - } - - return { - before, - beforeAllowingIndentation, - after, - afterOneOnly - }; -}; - -function isValue(x) { - return x !== undefined && x !== null; -} diff --git a/node_modules/stylelint/LICENSE b/node_modules/stylelint/LICENSE deleted file mode 100644 index 58332c87e..000000000 --- a/node_modules/stylelint/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 - present Maxime Thirouin, David Clark & Richard Hallows - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/stylelint/README.md b/node_modules/stylelint/README.md deleted file mode 100644 index 056537cbf..000000000 --- a/node_modules/stylelint/README.md +++ /dev/null @@ -1,103 +0,0 @@ -# Stylelint - -[![npm version](https://img.shields.io/npm/v/stylelint?logo=npm&logoColor=fff)](https://www.npmjs.com/package/stylelint) -[![Build Status](https://github.com/stylelint/stylelint/workflows/Testing/badge.svg)](https://github.com/stylelint/stylelint/actions/workflows/testing.yml?query=branch%3Amain) -[![npm downloads](https://img.shields.io/npm/dm/stylelint)](https://npmcharts.com/compare/stylelint?minimal=true) - -A mighty CSS linter that helps you avoid errors and enforce conventions. - -## Features - -It's mighty as it: - -- has over **100 built-in rules** for modern CSS syntax and features -- supports **plugins** so you can create your own custom rules -- automatically **fixes problems** where possible -- supports **shareable configs** that you can create or extend -- can **be customized** to your exact needs -- has **15k unit tests** making it robust -- is **trusted by companies worldwide** like Google and GitHub - -And it can be extended to: - -- extract **embedded styles** from HTML, Markdown and CSS-in-JS template literals -- parse **CSS-like languages** like SCSS, Sass, Less and SugarSS - -## How it'll help you - -It'll help you **avoid errors**, for example: - -- invalid things, e.g. malformed grid areas -- valid things that are problematic, e.g. duplicate selectors -- unknown things, e.g. misspelled property names - -And **enforce conventions**, for example: - -- disallow things, e.g. specific units -- enforce naming patterns, e.g. for custom properties -- set limits, e.g. the number of ID selectors -- specify notations, e.g. for modern color functions - -We recommend using a pretty printer like Prettier alongside Stylelint. Linters and pretty printers are complementary tools that work together to help you write consistent and error-free code. - -## Example output - -![Example](example.png) - -## Guides - -- User guide - - [Getting started](docs/user-guide/get-started.md) - - [Customizing](docs/user-guide/customize.md) - - [Configuring](docs/user-guide/configure.md) - - [Rules](docs/user-guide/rules.md) - - [Ignoring code](docs/user-guide/ignore-code.md) - - [CLI](docs/user-guide/cli.md) - - [Node.js API](docs/user-guide/node-api.md) - - [PostCSS plugin](docs/user-guide/postcss-plugin.md) - - [Options](docs/user-guide/options.md) - - [Errors & warnings](docs/user-guide/errors.md) -- Developer guide - - [Writing rules](docs/developer-guide/rules.md) - - [Writing plugins](docs/developer-guide/plugins.md) - - [Writing custom syntaxes](docs/developer-guide/syntaxes.md) - - [Writing custom formatters](docs/developer-guide/formatters.md) - - [Writing system tests](docs/developer-guide/system-tests.md) -- Migration guide - - [Migrating to 15.0.0](docs/migration-guide/to-15.md) - - [Migrating to 14.0.0](docs/migration-guide/to-14.md) -- Maintainer guide - - [Managing issues](docs/maintainer-guide/issues.md) - - [Managing pull requests](docs/maintainer-guide/pull-requests.md) - - [Performing releases](docs/maintainer-guide/releases.md) -- About - - [Vision](docs/about/vision.md) - - [Semantic versioning](docs/about/semantic-versioning.md) - -## Contributors - -Stylelint is maintained by volunteers. Without the code contributions from [all these fantastic people](https://github.com/stylelint/stylelint/graphs/contributors), Stylelint would not exist. [Become a contributor](CONTRIBUTING.md). - -### Sponsors - - - - - -Thank you to all our sponsors! [Become a sponsor](https://opencollective.com/stylelint). - -### Backers - - - - - -Thank you to all our backers! [Become a backer](https://opencollective.com/stylelint). - -### Website hosting - -[![Deploys by Netlify](https://www.netlify.com/img/global/badges/netlify-color-accent.svg)](https://www.netlify.com) - -## License - -[The MIT License](https://raw.githubusercontent.com/stylelint/stylelint/main/LICENSE). diff --git a/node_modules/stylelint/bin/stylelint.mjs b/node_modules/stylelint/bin/stylelint.mjs deleted file mode 100755 index f9984171a..000000000 --- a/node_modules/stylelint/bin/stylelint.mjs +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env node - -import cli from '../lib/cli.mjs'; - -cli(process.argv.slice(2)); diff --git a/node_modules/stylelint/lib/assignDisabledRanges.js b/node_modules/stylelint/lib/assignDisabledRanges.js deleted file mode 100644 index 7a7d40517..000000000 --- a/node_modules/stylelint/lib/assignDisabledRanges.js +++ /dev/null @@ -1,417 +0,0 @@ -'use strict'; - -const isStandardSyntaxComment = require('./utils/isStandardSyntaxComment'); -const { - DISABLE_COMMAND, - DISABLE_LINE_COMMAND, - DISABLE_NEXT_LINE_COMMAND, - ENABLE_COMMAND, - extractConfigurationComment, - getConfigurationComment, - isConfigurationComment, -} = require('./utils/configurationComment'); -const { assert, assertNumber, assertString } = require('./utils/validateTypes'); - -const ALL_RULES = 'all'; - -/** @typedef {import('postcss').Comment} PostcssComment */ -/** @typedef {import('postcss').Root} PostcssRoot */ -/** @typedef {import('postcss').Document} PostcssDocument */ -/** @typedef {import('stylelint').PostcssResult} PostcssResult */ -/** @typedef {import('stylelint').DisabledRangeObject} DisabledRangeObject */ -/** @typedef {import('stylelint').DisabledRange} DisabledRange */ - -/** - * @param {PostcssComment} comment - * @param {number} start - * @param {boolean} strictStart - * @param {string|undefined} description - * @param {number} [end] - * @param {boolean} [strictEnd] - * @returns {DisabledRange} - */ -function createDisableRange(comment, start, strictStart, description, end, strictEnd) { - return { - comment, - start, - end: end || undefined, - strictStart, - strictEnd: typeof strictEnd === 'boolean' ? strictEnd : undefined, - description, - }; -} - -/** - * Run it like a PostCSS plugin - * @param {PostcssRoot | PostcssDocument} root - * @param {PostcssResult} result - * @returns {PostcssResult} - */ -module.exports = function assignDisabledRanges(root, result) { - result.stylelint = result.stylelint || { - disabledRanges: {}, - ruleSeverities: {}, - customMessages: {}, - ruleMetadata: {}, - }; - - /** - * Most of the functions below work via side effects mutating this object - * @type {DisabledRangeObject & { all: DisabledRange[] }} - */ - const disabledRanges = { - [ALL_RULES]: [], - }; - - result.stylelint.disabledRanges = disabledRanges; - - // Work around postcss/postcss-scss#109 by merging adjacent `//` comments - // into a single node before passing to `checkComment`. - - /** @type {PostcssComment?} */ - let inlineEnd; - - const configurationComment = result.stylelint.config?.configurationComment; - - root.walkComments((comment) => { - if (inlineEnd) { - // Ignore comments already processed by grouping with a previous one. - if (inlineEnd === comment) inlineEnd = null; - - return; - } - - const nextComment = comment.next(); - - // If any of these conditions are not met, do not merge comments. - if ( - !( - !isStandardSyntaxComment(comment) && - isConfigurationComment(comment, configurationComment) && - nextComment && - nextComment.type === 'comment' && - (comment.text.includes('--') || nextComment.text.startsWith('--')) - ) - ) { - checkComment(comment); - - return; - } - - let lastLine = (comment.source && comment.source.end && comment.source.end.line) || 0; - const fullComment = comment.clone(); - - let current = nextComment; - - while ( - !isStandardSyntaxComment(current) && - !isConfigurationComment(current, configurationComment) - ) { - const currentLine = (current.source && current.source.end && current.source.end.line) || 0; - - if (lastLine + 1 !== currentLine) break; - - fullComment.text += `\n${current.text}`; - - if (fullComment.source && current.source) { - fullComment.source.end = current.source.end; - } - - inlineEnd = current; - const next = current.next(); - - if (!next || next.type !== 'comment') break; - - current = next; - lastLine = currentLine; - } - - checkComment(fullComment); - }); - - return result; - - /** - * @param {PostcssComment} comment - */ - function processDisableLineCommand(comment) { - if (comment.source && comment.source.start) { - const line = comment.source.start.line; - const description = getDescription(comment.text); - - for (const ruleName of getCommandRules(DISABLE_LINE_COMMAND, comment.text)) { - disableLine(comment, line, ruleName, description); - } - } - } - - /** - * @param {PostcssComment} comment - */ - function processDisableNextLineCommand(comment) { - if (comment.source && comment.source.end) { - const line = comment.source.end.line; - const description = getDescription(comment.text); - - for (const ruleName of getCommandRules(DISABLE_NEXT_LINE_COMMAND, comment.text)) { - disableLine(comment, line + 1, ruleName, description); - } - } - } - - /** - * @param {PostcssComment} comment - * @param {number} line - * @param {string} ruleName - * @param {string|undefined} description - */ - function disableLine(comment, line, ruleName, description) { - if (ruleIsDisabled(ALL_RULES)) { - throw comment.error('All rules have already been disabled', { - plugin: 'stylelint', - }); - } - - if (ruleName === ALL_RULES) { - for (const disabledRuleName of Object.keys(disabledRanges)) { - if (ruleIsDisabled(disabledRuleName)) continue; - - const strict = disabledRuleName === ALL_RULES; - - startDisabledRange(comment, line, disabledRuleName, strict, description); - endDisabledRange(line, disabledRuleName, strict); - } - } else { - if (ruleIsDisabled(ruleName)) { - throw comment.error(`"${ruleName}" has already been disabled`, { - plugin: 'stylelint', - }); - } - - startDisabledRange(comment, line, ruleName, true, description); - endDisabledRange(line, ruleName, true); - } - } - - /** - * @param {PostcssComment} comment - */ - function processDisableCommand(comment) { - const description = getDescription(comment.text); - - for (const ruleToDisable of getCommandRules(DISABLE_COMMAND, comment.text)) { - const isAllRules = ruleToDisable === ALL_RULES; - - if (ruleIsDisabled(ruleToDisable)) { - throw comment.error( - isAllRules - ? 'All rules have already been disabled' - : `"${ruleToDisable}" has already been disabled`, - { - plugin: 'stylelint', - }, - ); - } - - if (comment.source && comment.source.start) { - const line = comment.source.start.line; - - if (isAllRules) { - for (const ruleName of Object.keys(disabledRanges)) { - startDisabledRange(comment, line, ruleName, ruleName === ALL_RULES, description); - } - } else { - startDisabledRange(comment, line, ruleToDisable, true, description); - } - } - } - } - - /** - * @param {PostcssComment} comment - */ - function processEnableCommand(comment) { - for (const ruleToEnable of getCommandRules(ENABLE_COMMAND, comment.text)) { - // need fallback if endLine will be undefined - const endLine = comment.source && comment.source.end && comment.source.end.line; - - assertNumber(endLine); - - if (ruleToEnable === ALL_RULES) { - if ( - Object.values(disabledRanges).every((ranges) => { - if (ranges.length === 0) return true; - - const lastRange = ranges[ranges.length - 1]; - - return lastRange && typeof lastRange.end === 'number'; - }) - ) { - throw comment.error('No rules have been disabled', { - plugin: 'stylelint', - }); - } - - for (const [ruleName, ranges] of Object.entries(disabledRanges)) { - const lastRange = ranges[ranges.length - 1]; - - if (!lastRange || !lastRange.end) { - endDisabledRange(endLine, ruleName, ruleName === ALL_RULES); - } - } - - continue; - } - - if (ruleIsDisabled(ALL_RULES) && disabledRanges[ruleToEnable] === undefined) { - // Get a starting point from the where all rules were disabled - disabledRanges[ruleToEnable] = disabledRanges[ALL_RULES].map( - ({ start, end, description }) => - createDisableRange(comment, start, false, description, end, false), - ); - - endDisabledRange(endLine, ruleToEnable, true); - - continue; - } - - if (ruleIsDisabled(ruleToEnable)) { - endDisabledRange(endLine, ruleToEnable, true); - - continue; - } - - throw comment.error(`"${ruleToEnable}" has not been disabled`, { - plugin: 'stylelint', - }); - } - } - - /** - * @param {PostcssComment} comment - */ - function checkComment(comment) { - // Ignore comments that are not relevant commands - - if (!isConfigurationComment(comment, configurationComment)) { - return; - } - - switch (extractConfigurationComment(comment, configurationComment)) { - case DISABLE_LINE_COMMAND: - processDisableLineCommand(comment); - break; - case DISABLE_NEXT_LINE_COMMAND: - processDisableNextLineCommand(comment); - break; - case DISABLE_COMMAND: - processDisableCommand(comment); - break; - case ENABLE_COMMAND: - processEnableCommand(comment); - break; - } - } - - /** - * @param {string} command - * @param {string} fullText - * @returns {string[]} - */ - function getCommandRules(command, fullText) { - // Allow for description (f.e. /* stylelint-disable a, b -- Description */). - const fullCommand = getConfigurationComment(command, configurationComment); - const rulesText = fullText.slice(fullCommand.length).split(/\s-{2,}\s/u)[0]; - - assertString(rulesText); - const rules = rulesText - .trim() - .split(',') - .filter(Boolean) - .map((r) => r.trim()); - - if (rules.length === 0) { - return [ALL_RULES]; - } - - return rules; - } - - /** - * @param {string} fullText - * @returns {string|undefined} - */ - function getDescription(fullText) { - const descriptionStart = fullText.indexOf('--'); - - if (descriptionStart === -1) return; - - return fullText.slice(descriptionStart + 2).trim(); - } - - /** - * @param {PostcssComment} comment - * @param {number} line - * @param {string} ruleName - * @param {boolean} strict - * @param {string|undefined} description - */ - function startDisabledRange(comment, line, ruleName, strict, description) { - const rangeObj = createDisableRange(comment, line, strict, description); - - ensureRuleRanges(ruleName); - - const range = disabledRanges[ruleName]; - - assert(range); - range.push(rangeObj); - } - - /** - * @param {number} line - * @param {string} ruleName - * @param {boolean} strict - */ - function endDisabledRange(line, ruleName, strict) { - const ranges = disabledRanges[ruleName]; - const lastRangeForRule = ranges ? ranges[ranges.length - 1] : null; - - if (!lastRangeForRule) { - return; - } - - // Add an `end` prop to the last range of that rule - lastRangeForRule.end = line; - lastRangeForRule.strictEnd = strict; - } - - /** - * @param {string} ruleName - */ - function ensureRuleRanges(ruleName) { - if (!disabledRanges[ruleName]) { - disabledRanges[ruleName] = disabledRanges[ALL_RULES].map( - ({ comment, start, end, description }) => - createDisableRange(comment, start, false, description, end, false), - ); - } - } - - /** - * @param {string} ruleName - * @returns {boolean} - */ - function ruleIsDisabled(ruleName) { - const ranges = disabledRanges[ruleName]; - - if (!ranges) return false; - - const lastRange = ranges[ranges.length - 1]; - - if (!lastRange) return false; - - if (!lastRange.end) return true; - - return false; - } -}; diff --git a/node_modules/stylelint/lib/augmentConfig.js b/node_modules/stylelint/lib/augmentConfig.js deleted file mode 100644 index 9e87635d6..000000000 --- a/node_modules/stylelint/lib/augmentConfig.js +++ /dev/null @@ -1,440 +0,0 @@ -'use strict'; - -const configurationError = require('./utils/configurationError'); -const getModulePath = require('./utils/getModulePath'); -const globjoin = require('globjoin'); -const micromatch = require('micromatch'); -const normalizeAllRuleSettings = require('./normalizeAllRuleSettings'); -const normalizePath = require('normalize-path'); -const path = require('path'); - -/** @typedef {import('stylelint').InternalApi} StylelintInternalApi */ -/** @typedef {import('stylelint').Config} StylelintConfig */ -/** @typedef {import('stylelint').CosmiconfigResult} StylelintCosmiconfigResult */ - -/** - * @param {string} glob - * @param {string} basedir - * @returns {string} - */ -function absolutizeGlob(glob, basedir) { - const result = path.isAbsolute(glob.replace(/^!/, '')) ? glob : globjoin(basedir, glob); - - // Glob patterns for micromatch should be in POSIX-style - return normalizePath(result); -} - -/** - * - Merges config and stylelint options - * - Makes all paths absolute - * - Merges extends - * @param {StylelintInternalApi} stylelint - * @param {StylelintConfig} config - * @param {string} configDir - * @param {boolean} allowOverrides - * @param {string} rootConfigDir - * @param {string} [filePath] - * @returns {Promise} - */ -async function augmentConfigBasic( - stylelint, - config, - configDir, - allowOverrides, - rootConfigDir, - filePath, -) { - let augmentedConfig = config; - - if (allowOverrides) { - augmentedConfig = addOptions(stylelint, augmentedConfig); - } - - if (filePath) { - augmentedConfig = applyOverrides(augmentedConfig, rootConfigDir, filePath); - } - - augmentedConfig = await extendConfig( - stylelint, - augmentedConfig, - configDir, - rootConfigDir, - filePath, - ); - - const cwd = stylelint._options.cwd; - - return absolutizePaths(augmentedConfig, configDir, cwd); -} - -/** - * Extended configs need to be run through augmentConfigBasic - * but do not need the full treatment. Things like pluginFunctions - * will be resolved and added by the parent config. - * @param {string} cwd - * @returns {(cosmiconfigResult?: StylelintCosmiconfigResult) => Promise} - */ -function augmentConfigExtended(cwd) { - return async (cosmiconfigResult) => { - if (!cosmiconfigResult) { - return null; - } - - const configDir = path.dirname(cosmiconfigResult.filepath || ''); - const { config } = cosmiconfigResult; - - const augmentedConfig = absolutizePaths(config, configDir, cwd); - - return { - config: augmentedConfig, - filepath: cosmiconfigResult.filepath, - }; - }; -} - -/** - * @param {StylelintInternalApi} stylelint - * @param {string} [filePath] - * @param {StylelintCosmiconfigResult} [cosmiconfigResult] - * @returns {Promise} - */ -async function augmentConfigFull(stylelint, filePath, cosmiconfigResult) { - if (!cosmiconfigResult) { - return null; - } - - const config = cosmiconfigResult.config; - const filepath = cosmiconfigResult.filepath; - - const configDir = stylelint._options.configBasedir || path.dirname(filepath || ''); - - let augmentedConfig = await augmentConfigBasic( - stylelint, - config, - configDir, - true, - configDir, - filePath, - ); - - augmentedConfig = addPluginFunctions(augmentedConfig); - - if (!augmentedConfig.rules) { - throw configurationError( - 'No rules found within configuration. Have you provided a "rules" property?', - ); - } - - augmentedConfig = normalizeAllRuleSettings(augmentedConfig); - - return { - config: augmentedConfig, - filepath: cosmiconfigResult.filepath, - }; -} - -/** - * Make all paths in the config absolute. - * - * @param {StylelintConfig} config - * @param {string} configDir - * @param {string} cwd - * @returns {StylelintConfig} - */ -function absolutizePaths(config, configDir, cwd) { - if (config.ignoreFiles) { - config.ignoreFiles = [config.ignoreFiles].flat().map((glob) => absolutizeGlob(glob, configDir)); - } - - if (config.plugins) { - config.plugins = [config.plugins].flat().map((lookup) => { - if (typeof lookup === 'string') { - return getModulePath(configDir, lookup, cwd); - } - - return lookup; - }); - } - - return config; -} - -/** - * @param {StylelintInternalApi} stylelint - * @param {StylelintConfig} config - * @param {string} configDir - * @param {string} rootConfigDir - * @param {string} [filePath] - * @return {Promise} - */ -async function extendConfig(stylelint, config, configDir, rootConfigDir, filePath) { - if (config.extends === undefined) { - return config; - } - - const { extends: configExtends, ...originalWithoutExtends } = config; - const normalizedExtends = [configExtends].flat(); - - let resultConfig = originalWithoutExtends; - - for (const extendLookup of normalizedExtends) { - let extendResult; - - if (typeof extendLookup === 'string') { - extendResult = await loadExtendedConfig(stylelint, configDir, extendLookup); - } else if (typeof extendLookup === 'object' && extendLookup !== null) { - extendResult = { config: extendLookup }; - } - - if (extendResult) { - let extendResultConfig = extendResult.config; - const extendConfigDir = path.dirname(extendResult.filepath || ''); - - extendResultConfig = await augmentConfigBasic( - stylelint, - extendResultConfig, - extendConfigDir, - false, - rootConfigDir, - filePath, - ); - - resultConfig = mergeConfigs(resultConfig, extendResultConfig); - } - } - - return mergeConfigs(resultConfig, originalWithoutExtends); -} - -/** - * @param {StylelintInternalApi} stylelint - * @param {string} configDir - * @param {string} extendLookup - * @return {Promise} - */ -function loadExtendedConfig(stylelint, configDir, extendLookup) { - const extendPath = getModulePath(configDir, extendLookup, stylelint._options.cwd); - - return stylelint._extendExplorer.load(extendPath); -} - -/** - * When merging configs (via extends) - * - plugin, extends, overrides arrays are joined - * - rules are merged via Object.assign, so there is no attempt made to - * merge any given rule's settings. If b contains the same rule as a, - * b's rule settings will override a's rule settings entirely. - * - Everything else is merged via Object.assign - * @param {StylelintConfig} a - * @param {StylelintConfig} b - * @returns {StylelintConfig} - */ -function mergeConfigs(a, b) { - /** @type {Pick} */ - const pluginMerger = {}; - - if (a.plugins || b.plugins) { - pluginMerger.plugins = []; - - if (a.plugins) { - pluginMerger.plugins = pluginMerger.plugins.concat(a.plugins); - } - - if (b.plugins) { - pluginMerger.plugins = [...new Set(pluginMerger.plugins.concat(b.plugins))]; - } - } - - /** @type {Pick} */ - const overridesMerger = {}; - - if (a.overrides || b.overrides) { - overridesMerger.overrides = []; - - if (a.overrides) { - overridesMerger.overrides = overridesMerger.overrides.concat(a.overrides); - } - - if (b.overrides) { - overridesMerger.overrides = [...new Set(overridesMerger.overrides.concat(b.overrides))]; - } - } - - /** @type {Pick} */ - const extendsMerger = {}; - - if (a.extends || b.extends) { - extendsMerger.extends = []; - - if (a.extends) { - extendsMerger.extends = extendsMerger.extends.concat(a.extends); - } - - if (b.extends) { - extendsMerger.extends = extendsMerger.extends.concat(b.extends); - } - - // Remove duplicates from the array, the last item takes precedence - extendsMerger.extends = extendsMerger.extends.filter( - (item, index, arr) => arr.lastIndexOf(item) === index, - ); - } - - const rulesMerger = {}; - - if (a.rules || b.rules) { - rulesMerger.rules = { ...a.rules, ...b.rules }; - } - - const result = { - ...a, - ...b, - ...extendsMerger, - ...pluginMerger, - ...overridesMerger, - ...rulesMerger, - }; - - return result; -} - -/** - * @param {StylelintConfig} config - * @returns {StylelintConfig} - */ -function addPluginFunctions(config) { - if (!config.plugins) { - return config; - } - - const normalizedPlugins = [config.plugins].flat(); - - /** @type {StylelintConfig['pluginFunctions']} */ - const pluginFunctions = {}; - - for (const pluginLookup of normalizedPlugins) { - let pluginImport; - - if (typeof pluginLookup === 'string') { - pluginImport = require(pluginLookup); - } else { - pluginImport = pluginLookup; - } - - // Handle either ES6 or CommonJS modules - pluginImport = pluginImport.default || pluginImport; - - // A plugin can export either a single rule definition - // or an array of them - const normalizedPluginImport = [pluginImport].flat(); - - for (const pluginRuleDefinition of normalizedPluginImport) { - if (!pluginRuleDefinition.ruleName) { - throw configurationError( - `stylelint requires plugins to expose a ruleName. The plugin "${pluginLookup}" is not doing this, so will not work with stylelint. Please file an issue with the plugin.`, - ); - } - - if (!pluginRuleDefinition.ruleName.includes('/')) { - throw configurationError( - `stylelint requires plugin rules to be namespaced, i.e. only \`plugin-namespace/plugin-rule-name\` plugin rule names are supported. The plugin rule "${pluginRuleDefinition.ruleName}" does not do this, so will not work. Please file an issue with the plugin.`, - ); - } - - pluginFunctions[pluginRuleDefinition.ruleName] = pluginRuleDefinition.rule; - } - } - - config.pluginFunctions = pluginFunctions; - - return config; -} - -/** - * @param {StylelintConfig} fullConfig - * @param {string} rootConfigDir - * @param {string} filePath - * @return {StylelintConfig} - */ -function applyOverrides(fullConfig, rootConfigDir, filePath) { - let { overrides, ...config } = fullConfig; - - if (!overrides) { - return config; - } - - if (!Array.isArray(overrides)) { - throw new TypeError( - 'The `overrides` configuration property should be an array, e.g. { "overrides": [{ "files": "*.css", "rules": {} }] }.', - ); - } - - for (const override of overrides) { - const { files, ...configOverrides } = override; - - if (!files) { - throw new Error( - 'Every object in the `overrides` configuration property should have a `files` property with globs, e.g. { "overrides": [{ "files": "*.css", "rules": {} }] }.', - ); - } - - const absoluteGlobs = [files].flat().map((glob) => absolutizeGlob(glob, rootConfigDir)); - - if ( - micromatch.isMatch(filePath, absoluteGlobs, { dot: true }) || - // E.g. `*.css` matches any CSS files in any directories. - micromatch.isMatch(filePath, files, { dot: true, basename: true }) - ) { - config = mergeConfigs(config, configOverrides); - } - } - - return config; -} - -/** - * Add options to the config - * - * @param {StylelintInternalApi} stylelint - * @param {StylelintConfig} config - * - * @returns {StylelintConfig} - */ -function addOptions(stylelint, config) { - const augmentedConfig = { - ...config, - }; - - if (stylelint._options.ignoreDisables) { - augmentedConfig.ignoreDisables = stylelint._options.ignoreDisables; - } - - if (stylelint._options.quiet) { - augmentedConfig.quiet = stylelint._options.quiet; - } - - if (stylelint._options.reportNeedlessDisables) { - augmentedConfig.reportNeedlessDisables = stylelint._options.reportNeedlessDisables; - } - - if (stylelint._options.reportInvalidScopeDisables) { - augmentedConfig.reportInvalidScopeDisables = stylelint._options.reportInvalidScopeDisables; - } - - if (stylelint._options.reportDescriptionlessDisables) { - augmentedConfig.reportDescriptionlessDisables = - stylelint._options.reportDescriptionlessDisables; - } - - if (stylelint._options.customSyntax) { - augmentedConfig.customSyntax = stylelint._options.customSyntax; - } - - if (stylelint._options.fix) { - augmentedConfig.fix = stylelint._options.fix; - } - - return augmentedConfig; -} - -module.exports = { augmentConfigExtended, augmentConfigFull, applyOverrides }; diff --git a/node_modules/stylelint/lib/cli.mjs b/node_modules/stylelint/lib/cli.mjs deleted file mode 100644 index 33f1fb282..000000000 --- a/node_modules/stylelint/lib/cli.mjs +++ /dev/null @@ -1,639 +0,0 @@ -import picocolors from 'picocolors'; -const { dim, red } = picocolors; - -import { EOL } from 'os'; -import meow from 'meow'; -import path from 'path'; -import resolveFrom from 'resolve-from'; - -import checkInvalidCLIOptions from './utils/checkInvalidCLIOptions.js'; -import { isPlainObject } from './utils/validateTypes.js'; -import printConfig from './printConfig.js'; -import resolveCustomFormatter from './resolveCustomFormatter.js'; -import standalone from './standalone.js'; -import writeOutputFile from './writeOutputFile.js'; - -import { - DEFAULT_CACHE_LOCATION, - DEFAULT_FORMATTER, - DEFAULT_IGNORE_FILENAME, - EXIT_CODE_ERROR, -} from './constants.js'; - -import { createRequire } from 'module'; -// @ts-expect-error -const require = createRequire(import.meta.url); - -/** - * @typedef {{ - * allowEmptyInput: boolean; - * cache: boolean; - * cacheLocation?: string; - * cacheStrategy?: string; - * color: boolean; - * config?: string; - * configBasedir?: string; - * customFormatter?: string; - * customSyntax?: string; - * disableDefaultIgnores: boolean; - * fix: boolean; - * formatter: string; - * globbyOptions?: string; - * help: boolean; - * ignoreDisables: boolean; - * ignorePath: string[]; - * ignorePattern: string[]; - * maxWarnings?: number; - * outputFile?: string; - * printConfig: boolean; - * quiet: boolean; - * quietDeprecationWarnings: boolean; - * reportDescriptionlessDisables: boolean; - * reportInvalidScopeDisables: boolean; - * reportNeedlessDisables: boolean; - * stdin: boolean; - * stdinFilename?: string; - * version: boolean; - * }} CLIFlags - */ - -/** - * @typedef {{ - * input: string[]; - * showHelp: (code: number) => void; - * showVersion: () => void; - * flags: CLIFlags; - * }} CLIOptions - */ - -/** - * @typedef {{ - * allowEmptyInput?: boolean; - * cache?: boolean; - * cacheLocation?: string; - * cacheStrategy?: string; - * code?: string; - * codeFilename?: string; - * configFile?: string; - * configBasedir?: string; - * customSyntax?: string; - * disableDefaultIgnores?: boolean; - * files?: string[]; - * fix?: boolean; - * formatter: any; - * globbyOptions?: Record; - * ignoreDisables?: boolean; - * ignorePath?: string[]; - * ignorePattern?: string[]; - * maxWarnings?: number; - * outputFile?: string; - * quiet?: boolean; - * quietDeprecationWarnings?: boolean; - * reportDescriptionlessDisables?: boolean; - * reportInvalidScopeDisables?: boolean; - * reportNeedlessDisables?: boolean; - * }} OptionBaseType - */ - -const meowOptions = { - autoHelp: false, - autoVersion: false, - help: ` - Usage: stylelint [input] [options] - - Input: Files(s), glob(s), or nothing to use stdin. - - If an input argument is wrapped in quotation marks, it will be passed to - globby for cross-platform glob support. "node_modules" are always ignored. - You can also pass no input and use stdin, instead. - - Options: - - --config, -c - - A path to a specific configuration file (JSON, YAML, CommonJS, or ES module), - or a module name in "node_modules" that points to one. If no argument is - provided, Stylelint will search for configuration files in the following - places, in this order: - - - a "stylelint" property in "package.json" - - a ".stylelintrc" file - - a ".stylelintrc.{cjs,mjs,js,json,yaml,yml}" file - - a "stylelint.config.{cjs,mjs,js}" file - - The search will begin in the working directory and move up the directory - tree until a configuration file is found. - - --config-basedir - - An absolute path to the directory that relative paths defining "extends", - "plugins", and "customSyntax" are *relative to*. Only necessary if these - values are relative paths. - - --print-config - - Print the configuration for the given input file path. Globs are unsupported. - - --ignore-path, -i - - A path to a file containing patterns that describe files to ignore. The - path can be absolute or relative to "process.cwd()". You can repeat the - option to provide multiple paths. By default, Stylelint looks for - "${DEFAULT_IGNORE_FILENAME}" in "process.cwd()". Multiple can be set. - - --ignore-pattern, --ip - - A pattern of files to ignore (in addition to those in "${DEFAULT_IGNORE_FILENAME}"). - Multiple can be set. - - --fix - - Automatically fix problems of certain rules. - - --custom-syntax - - A module name or path to a JS file exporting a PostCSS-compatible syntax. - - --stdin - - Accept stdin input even if it is empty. - - --stdin-filename - - A filename to assign stdin input. - - --ignore-disables, --id - - Ignore "stylelint-disable" comments. - - --disable-default-ignores, --di - - Allow linting of "node_modules". - - --[no-]cache - - Store the info about processed files in order to only operate on the - changed ones the next time you run Stylelint. By default, the cache is - stored in "${DEFAULT_CACHE_LOCATION}". To adjust this, use "--cache-location". - Cache is disabled by default. - - --cache-location - - A path to a file or directory to be used for the cache location. If a - directory is specified, a cache file will be created inside the specified - folder, with a name derived from a hash of the current working directory. - - If the directory for the cache does not exist, make sure you add a trailing "/" - on *nix systems or "\\" on Windows. Otherwise the path will be assumed to - be a file. - - --cache-strategy - - A strategy for the cache to use for detecting changed files. Either one of: - - metadata by metadata of a file (default) - content by content of a file - - The "content" strategy can be useful in cases where the modification time - of your files changes even if their contents have not. For example, this can - happen during git operations like "git clone" because git does not track file - modification time. - - --formatter, -f - - An output formatter. The variants are as follows: - - string human-readable strings (default) - compact similar to ESLint's compact formatter - github workflow commands for GitHub Actions - json JSON format - tap TAP format - unix C compiler-like format - verbose extend "string" to include a file list and a tally - - --custom-formatter - - A path to a JS file or module name exporting a custom formatting function. - - --quiet, -q - - Only register problems for rules with an "error"-level severity (ignore - "warning"-level). - - --quiet-deprecation-warnings - - Ignore deprecations warnings. - - --[no-]color - - Force enabling/disabling of color. - - --report-needless-disables, --rd - - Also report errors for "stylelint-disable" comments that are not blocking - a lint warning. The process will exit with code ${EXIT_CODE_ERROR} if needless disables are found. - - --report-invalid-scope-disables, --risd - - Report "stylelint-disable" comments that used for rules that don't exist - within the configuration object. The process will exit with code ${EXIT_CODE_ERROR} if invalid - scope disables are found. - - --report-descriptionless-disables, --rdd - - Report "stylelint-disable" comments without a description. The process will - exit with code ${EXIT_CODE_ERROR} if descriptionless disables are found. - - --max-warnings, --mw - - The number of warnings above which the process will exit with code ${EXIT_CODE_ERROR}. - Useful when setting "defaultSeverity" to "warning" and expecting the process - to fail on warnings (e.g. CI build). - - --output-file, -o - - A file path to write a report. - - --allow-empty-input, --aei - - When a glob pattern matches no files, the process will exit without throwing an error. - - --globby-options, --go - - Options in JSON format passed to globby. - - --version, -v - - Show the version. - - --help, -h - - Show the help. - `, - flags: { - allowEmptyInput: { - alias: 'aei', - type: 'boolean', - }, - cache: { - type: 'boolean', - }, - cacheLocation: { - type: 'string', - }, - cacheStrategy: { - type: 'string', - }, - color: { - type: 'boolean', - }, - config: { - alias: 'c', - type: 'string', - }, - configBasedir: { - type: 'string', - }, - customFormatter: { - type: 'string', - }, - customSyntax: { - type: 'string', - }, - disableDefaultIgnores: { - alias: 'di', - type: 'boolean', - }, - fix: { - type: 'boolean', - }, - formatter: { - alias: 'f', - type: 'string', - default: DEFAULT_FORMATTER, - }, - globbyOptions: { - alias: 'go', - type: 'string', - }, - help: { - alias: 'h', - type: 'boolean', - }, - ignoreDisables: { - alias: 'id', - type: 'boolean', - }, - ignorePath: { - alias: 'i', - type: 'string', - isMultiple: true, - }, - ignorePattern: { - alias: 'ip', - type: 'string', - isMultiple: true, - }, - maxWarnings: { - alias: 'mw', - type: 'number', - }, - outputFile: { - alias: 'o', - type: 'string', - }, - printConfig: { - type: 'boolean', - }, - quiet: { - alias: 'q', - type: 'boolean', - }, - quietDeprecationWarnings: { - type: 'boolean', - }, - reportDescriptionlessDisables: { - alias: 'rdd', - type: 'boolean', - }, - reportInvalidScopeDisables: { - alias: 'risd', - type: 'boolean', - }, - reportNeedlessDisables: { - alias: 'rd', - type: 'boolean', - }, - stdin: { - type: 'boolean', - }, - stdinFilename: { - type: 'string', - }, - version: { - alias: 'v', - type: 'boolean', - }, - }, -}; - -/** - * @param {string[]} argv - * @returns {Promise} - */ -export default async function main(argv) { - const cli = buildCLI(argv); - - const invalidOptionsMessage = checkInvalidCLIOptions(meowOptions.flags, cli.flags); - - if (invalidOptionsMessage) { - process.stderr.write(invalidOptionsMessage); - process.exit(EXIT_CODE_ERROR); // eslint-disable-line n/no-process-exit - } - - let formatter = cli.flags.formatter; - - if (cli.flags.customFormatter) { - const customFormatter = resolveCustomFormatter(cli.flags.customFormatter); - - formatter = require(customFormatter); - } - - /** @type {OptionBaseType} */ - const optionsBase = { - formatter, - }; - - if (cli.flags.quiet) { - optionsBase.quiet = cli.flags.quiet; - } - - if (cli.flags.quietDeprecationWarnings) { - optionsBase.quietDeprecationWarnings = cli.flags.quietDeprecationWarnings; - } - - if (cli.flags.customSyntax) { - optionsBase.customSyntax = cli.flags.customSyntax; - } - - if (cli.flags.config) { - // Should check these possibilities: - // a. name of a node_module - // b. absolute path - // c. relative path relative to `process.cwd()`. - // If none of the above work, we'll try a relative path starting - // in `process.cwd()`. - optionsBase.configFile = - resolveFrom.silent(process.cwd(), cli.flags.config) || - path.join(process.cwd(), cli.flags.config); - } - - if (cli.flags.configBasedir) { - optionsBase.configBasedir = path.isAbsolute(cli.flags.configBasedir) - ? cli.flags.configBasedir - : path.resolve(process.cwd(), cli.flags.configBasedir); - } - - if (cli.flags.globbyOptions) { - try { - optionsBase.globbyOptions = await parseGlobbyOptions(cli.flags.globbyOptions); - } catch (error) { - if (typeof error === 'string') { - process.stderr.write(`${error}${EOL}`); - process.exitCode = EXIT_CODE_ERROR; - - return; - } - - throw error; - } - } - - if (cli.flags.stdinFilename) { - optionsBase.codeFilename = cli.flags.stdinFilename; - } - - if (cli.flags.ignorePath) { - optionsBase.ignorePath = cli.flags.ignorePath; - } - - if (cli.flags.ignorePattern) { - optionsBase.ignorePattern = cli.flags.ignorePattern; - } - - if (cli.flags.ignoreDisables) { - optionsBase.ignoreDisables = cli.flags.ignoreDisables; - } - - if (cli.flags.disableDefaultIgnores) { - optionsBase.disableDefaultIgnores = cli.flags.disableDefaultIgnores; - } - - if (cli.flags.cache) { - optionsBase.cache = true; - } - - if (cli.flags.cacheLocation) { - optionsBase.cacheLocation = cli.flags.cacheLocation; - } - - if (cli.flags.cacheStrategy) { - optionsBase.cacheStrategy = cli.flags.cacheStrategy; - } - - if (cli.flags.fix) { - optionsBase.fix = cli.flags.fix; - } - - if (cli.flags.outputFile) { - optionsBase.outputFile = cli.flags.outputFile; - } - - const reportNeedlessDisables = cli.flags.reportNeedlessDisables; - const reportInvalidScopeDisables = cli.flags.reportInvalidScopeDisables; - const reportDescriptionlessDisables = cli.flags.reportDescriptionlessDisables; - - if (reportNeedlessDisables) { - optionsBase.reportNeedlessDisables = reportNeedlessDisables; - } - - if (reportInvalidScopeDisables) { - optionsBase.reportInvalidScopeDisables = reportInvalidScopeDisables; - } - - if (reportDescriptionlessDisables) { - optionsBase.reportDescriptionlessDisables = reportDescriptionlessDisables; - } - - const maxWarnings = cli.flags.maxWarnings; - - if (maxWarnings !== undefined) { - optionsBase.maxWarnings = maxWarnings; - } - - if (cli.flags.help) { - cli.showHelp(0); - - return; - } - - if (cli.flags.version) { - cli.showVersion(); - - return; - } - - if (cli.flags.allowEmptyInput) { - optionsBase.allowEmptyInput = cli.flags.allowEmptyInput; - } - - // Add input/code into options - /** @type {OptionBaseType} */ - const options = cli.input.length - ? { - ...optionsBase, - files: cli.input, - } - : await getStdin().then((stdin) => ({ - ...optionsBase, - code: stdin, - })); - - if (cli.flags.printConfig) { - return printConfig(options) - .then((config) => { - process.stdout.write(JSON.stringify(config, null, ' ')); - }) - .catch(handleError); - } - - if (!options.files && !options.code && !cli.flags.stdin) { - cli.showHelp(0); - - return; - } - - return standalone(options) - .then((linted) => { - if (!linted.output) { - return; - } - - process.stdout.write(linted.output); - - if (options.outputFile) { - writeOutputFile(linted.output, options.outputFile).catch(handleError); - } - - if (linted.errored) { - process.exitCode = EXIT_CODE_ERROR; - } else if (maxWarnings !== undefined && linted.maxWarningsExceeded) { - const foundWarnings = linted.maxWarningsExceeded.foundWarnings; - - process.stderr.write( - `${EOL}${red(`Max warnings exceeded: `)}${foundWarnings} found. ${dim( - `${maxWarnings} allowed${EOL}${EOL}`, - )}`, - ); - process.exitCode = EXIT_CODE_ERROR; - } - }) - .catch(handleError); -} - -/** - * @param {{ stack: any, code: any }} err - * @returns {void} - */ -function handleError(err) { - process.stderr.write(err.stack + EOL); - const exitCode = typeof err.code === 'number' ? err.code : 1; - - process.exitCode = exitCode; -} - -/** - * @param {string} value - * @returns {Promise>} - */ -function parseGlobbyOptions(value) { - const errorMessage = () => - `Invalid option ${red('"--globby-options"')}.` + - ` The value ${red(`"${value}"`)} is not valid JSON object.`; - - let options; - - try { - options = JSON.parse(value); - } catch (_) { - return Promise.reject(errorMessage()); - } - - if (isPlainObject(options)) { - return Promise.resolve(options); - } - - return Promise.reject(errorMessage()); -} - -/** - * @returns {Promise} - */ -async function getStdin() { - const chunks = []; - - for await (const chunk of process.stdin) { - chunks.push(chunk); - } - - return Buffer.concat(chunks).toString(); -} - -/** - * @param {string[]} argv - * @returns {CLIOptions} - */ -export function buildCLI(argv) { - // @ts-expect-error -- TS2322: Type 'Result' is not assignable to type 'CLIOptions'. - return meow({ ...meowOptions, argv, importMeta: import.meta }); -} diff --git a/node_modules/stylelint/lib/constants.js b/node_modules/stylelint/lib/constants.js deleted file mode 100644 index 94d816b26..000000000 --- a/node_modules/stylelint/lib/constants.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -const DEFAULT_CACHE_LOCATION = './.stylelintcache'; -const CACHE_STRATEGY_METADATA = 'metadata'; -const CACHE_STRATEGY_CONTENT = 'content'; -const DEFAULT_CACHE_STRATEGY = CACHE_STRATEGY_METADATA; - -const DEFAULT_IGNORE_FILENAME = '.stylelintignore'; - -const DEFAULT_FORMATTER = 'string'; - -const EXIT_CODE_ERROR = 2; - -module.exports = { - DEFAULT_CACHE_LOCATION, - CACHE_STRATEGY_METADATA, - CACHE_STRATEGY_CONTENT, - DEFAULT_CACHE_STRATEGY, - - DEFAULT_IGNORE_FILENAME, - - DEFAULT_FORMATTER, - - EXIT_CODE_ERROR, -}; diff --git a/node_modules/stylelint/lib/createPartialStylelintResult.js b/node_modules/stylelint/lib/createPartialStylelintResult.js deleted file mode 100644 index 171dfc9d8..000000000 --- a/node_modules/stylelint/lib/createPartialStylelintResult.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict'; - -/** @typedef {import('stylelint').PostcssResult} PostcssResult */ -/** @typedef {import('stylelint').LintResult} StylelintResult */ - -/** - * @param {PostcssResult} [postcssResult] - * @param {import('stylelint').CssSyntaxError} [cssSyntaxError] - * @return {StylelintResult} - */ -module.exports = function createPartialStylelintResult(postcssResult, cssSyntaxError) { - /** @type {StylelintResult} */ - let stylelintResult; - /** @type {string | undefined} */ - let source; - - if (postcssResult && postcssResult.root) { - if (postcssResult.root.source) { - source = postcssResult.root.source.input.file; - - if (!source && 'id' in postcssResult.root.source.input) { - source = postcssResult.root.source.input.id; - } - } - - const deprecationMessages = postcssResult.messages.filter( - (message) => message.stylelintType === 'deprecation', - ); - const deprecations = deprecationMessages.map((deprecationMessage) => { - return { - text: deprecationMessage.text, - reference: deprecationMessage.stylelintReference, - }; - }); - - const invalidOptionMessages = postcssResult.messages.filter( - (message) => message.stylelintType === 'invalidOption', - ); - const invalidOptionWarnings = invalidOptionMessages.map((invalidOptionMessage) => { - return { - text: invalidOptionMessage.text, - }; - }); - - const parseErrors = postcssResult.messages.filter( - (message) => message.stylelintType === 'parseError', - ); - - // Remove deprecation warnings, invalid options, and parse errors from the messages - postcssResult.messages = postcssResult.messages.filter( - (message) => - message.stylelintType !== 'deprecation' && - message.stylelintType !== 'invalidOption' && - message.stylelintType !== 'parseError', - ); - - // This defines the stylelint result object that formatters receive - stylelintResult = { - source, - deprecations, - invalidOptionWarnings, - // @ts-expect-error -- TS2322: Type 'Message[]' is not assignable to type '(Warning & { stylelintType: string; })[]'. - parseErrors, - errored: postcssResult.stylelint.stylelintError, - warnings: postcssResult.messages.map((message) => { - return { - line: message.line, - column: message.column, - endLine: message.endLine, - endColumn: message.endColumn, - rule: message.rule, - severity: message.severity, - text: message.text, - }; - }), - ignored: postcssResult.stylelint.ignored, - _postcssResult: postcssResult, - }; - } else if (cssSyntaxError) { - if (cssSyntaxError.name !== 'CssSyntaxError') { - throw cssSyntaxError; - } - - stylelintResult = { - source: cssSyntaxError.file || '', - deprecations: [], - invalidOptionWarnings: [], - parseErrors: [], - errored: true, - warnings: [ - { - line: cssSyntaxError.line, - column: cssSyntaxError.column, - endLine: cssSyntaxError.endLine, - endColumn: cssSyntaxError.endColumn, - rule: cssSyntaxError.name, - severity: 'error', - text: `${cssSyntaxError.reason} (${cssSyntaxError.name})`, - }, - ], - }; - } else { - throw new Error( - 'createPartialStylelintResult must be called with either postcssResult or CssSyntaxError', - ); - } - - return stylelintResult; -}; diff --git a/node_modules/stylelint/lib/createPlugin.js b/node_modules/stylelint/lib/createPlugin.js deleted file mode 100644 index e6d3e3ad1..000000000 --- a/node_modules/stylelint/lib/createPlugin.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * @type {import('stylelint')['createPlugin']} - */ -module.exports = function createPlugin(ruleName, rule) { - return { - ruleName, - rule, - }; -}; diff --git a/node_modules/stylelint/lib/createStylelint.js b/node_modules/stylelint/lib/createStylelint.js deleted file mode 100644 index 3165cc433..000000000 --- a/node_modules/stylelint/lib/createStylelint.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -const { cosmiconfig, defaultLoadersSync } = require('cosmiconfig'); - -const augmentConfig = require('./augmentConfig'); -const FileCache = require('./utils/FileCache'); - -const IS_TEST = process.env.NODE_ENV === 'test'; -const STOP_DIR = IS_TEST ? process.cwd() : undefined; - -/** - * @type {import('stylelint')['_createLinter']} - */ -module.exports = function createStylelint(options = {}) { - const cwd = options.cwd || process.cwd(); - - return { - _options: { ...options, cwd }, - - _extendExplorer: cosmiconfig('', { - transform: augmentConfig.augmentConfigExtended(cwd), - loaders: { - '.cjs': (cjsPath, cjsContent) => - Promise.resolve(defaultLoadersSync['.cjs'](cjsPath, cjsContent)), - '.js': (jsPath, cjsContent) => - Promise.resolve(defaultLoadersSync['.js'](jsPath, cjsContent)), - }, - stopDir: STOP_DIR, - }), - - _specifiedConfigCache: new Map(), - _postcssResultCache: new Map(), - _fileCache: new FileCache(options.cacheLocation, options.cacheStrategy, cwd), - }; -}; diff --git a/node_modules/stylelint/lib/descriptionlessDisables.js b/node_modules/stylelint/lib/descriptionlessDisables.js deleted file mode 100644 index 4c8d7b1c1..000000000 --- a/node_modules/stylelint/lib/descriptionlessDisables.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -const optionsMatches = require('./utils/optionsMatches'); -const validateDisableSettings = require('./validateDisableSettings'); - -/** @typedef {import('postcss').Comment} PostcssComment */ -/** @typedef {import('stylelint').DisableReportRange} DisableReportRange */ -/** @typedef {import('stylelint').DisableOptionsReport} StylelintDisableOptionsReport */ - -/** - * @param {import('stylelint').LintResult[]} results - */ -module.exports = function descriptionlessDisables(results) { - for (const result of results) { - const settings = validateDisableSettings( - result._postcssResult, - 'reportDescriptionlessDisables', - ); - - if (!settings) continue; - - const [enabled, options, stylelintResult] = settings; - - /** @type {Set} */ - const alreadyReported = new Set(); - - for (const [rule, ruleRanges] of Object.entries(stylelintResult.disabledRanges)) { - for (const range of ruleRanges) { - if (range.description) continue; - - if (alreadyReported.has(range.comment)) continue; - - if (enabled === optionsMatches(options, 'except', rule)) { - // An 'all' rule will get copied for each individual rule. If the - // configuration is `[false, {except: ['specific-rule']}]`, we - // don't want to report the copies that match except, so we record - // the comment as already reported. - if (!enabled && rule === 'all') alreadyReported.add(range.comment); - - continue; - } - - alreadyReported.add(range.comment); - - // If the comment doesn't have a location, we can't report a useful error. - // In practice we expect all comments to have locations, though. - if (!range.comment.source || !range.comment.source.start) continue; - - result.warnings.push({ - text: `Disable for "${rule}" is missing a description`, - rule: '--report-descriptionless-disables', - line: range.comment.source.start.line, - column: range.comment.source.start.column, - endLine: range.comment.source.end && range.comment.source.end.line, - endColumn: range.comment.source.end && range.comment.source.end.column, - severity: options.severity, - }); - } - } - } -}; diff --git a/node_modules/stylelint/lib/formatters/calcSeverityCounts.js b/node_modules/stylelint/lib/formatters/calcSeverityCounts.js deleted file mode 100644 index b19e9c66f..000000000 --- a/node_modules/stylelint/lib/formatters/calcSeverityCounts.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -/** - * @typedef {import('stylelint').Severity} Severity - * - * @param {Severity} severity - * @param {Record} counts - * @returns {void} - */ -module.exports = function calcSeverityCounts(severity, counts) { - switch (severity) { - case 'error': - counts.error += 1; - break; - case 'warning': - counts.warning += 1; - break; - default: - throw new Error(`Unknown severity: "${severity}"`); - } -}; diff --git a/node_modules/stylelint/lib/formatters/compactFormatter.js b/node_modules/stylelint/lib/formatters/compactFormatter.js deleted file mode 100644 index a4318ea18..000000000 --- a/node_modules/stylelint/lib/formatters/compactFormatter.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -const preprocessWarnings = require('./preprocessWarnings'); - -/** - * @type {import('stylelint').Formatter} - */ -module.exports = function compactFormatter(results) { - return results - .flatMap((result) => { - const { warnings } = preprocessWarnings(result); - - return warnings.map( - (warning) => - `${result.source}: ` + - `line ${warning.line}, ` + - `col ${warning.column}, ` + - `${warning.severity} - ` + - `${warning.text}`, - ); - }) - .join('\n'); -}; diff --git a/node_modules/stylelint/lib/formatters/githubFormatter.js b/node_modules/stylelint/lib/formatters/githubFormatter.js deleted file mode 100644 index 1a4b440f1..000000000 --- a/node_modules/stylelint/lib/formatters/githubFormatter.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -const preprocessWarnings = require('./preprocessWarnings'); - -/** - * @see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions - * - * @type {import('stylelint').Formatter} - */ -module.exports = function githubFormatter(results, returnValue) { - const title = 'Stylelint problem'; - const metadata = returnValue.ruleMetadata; - - const lines = results.flatMap((result) => { - const { source, warnings } = preprocessWarnings(result); - - return warnings.map(({ line, column, endLine, endColumn, text, severity, rule }) => { - const msg = buildMessage(text, metadata[rule]); - - return endLine === undefined - ? `::${severity} file=${source},line=${line},col=${column},title=${title}::${msg}` - : `::${severity} file=${source},line=${line},col=${column},endLine=${endLine},endColumn=${endColumn},title=${title}::${msg}`; - }); - }); - - lines.push(''); - - return lines.join('\n'); -}; - -/** - * @param {string} msg - * @param {Partial | undefined} metadata - * @returns {string} - */ -function buildMessage(msg, metadata) { - if (!metadata) return msg; - - const url = metadata.url ? ` - ${metadata.url}` : ''; - - let additional = [ - metadata.fixable ? 'maybe fixable' : '', - metadata.deprecated ? 'deprecated' : '', - ] - .filter(Boolean) - .join(', '); - - additional = additional ? ` [${additional}]` : ''; - - return `${msg}${additional}${url}`; -} diff --git a/node_modules/stylelint/lib/formatters/index.js b/node_modules/stylelint/lib/formatters/index.js deleted file mode 100644 index 4b9569db7..000000000 --- a/node_modules/stylelint/lib/formatters/index.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const importLazy = require('import-lazy'); - -/** @type {import('stylelint')['formatters']} */ -const formatters = { - compact: importLazy(() => require('./compactFormatter'))(), - github: importLazy(() => require('./githubFormatter'))(), - json: importLazy(() => require('./jsonFormatter'))(), - string: importLazy(() => require('./stringFormatter'))(), - tap: importLazy(() => require('./tapFormatter'))(), - unix: importLazy(() => require('./unixFormatter'))(), - verbose: importLazy(() => require('./verboseFormatter'))(), -}; - -module.exports = formatters; diff --git a/node_modules/stylelint/lib/formatters/jsonFormatter.js b/node_modules/stylelint/lib/formatters/jsonFormatter.js deleted file mode 100644 index da5ae965e..000000000 --- a/node_modules/stylelint/lib/formatters/jsonFormatter.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -/** - * Omit any properties starting with `_`, which are fake-private - * - * @type {import('stylelint').Formatter} - */ -module.exports = function jsonFormatter(results) { - const cleanedResults = results.map((result) => - Object.entries(result) - .filter(([key]) => !key.startsWith('_')) - .reduce((/** @type {{ [key: string]: any }} */ obj, [key, value]) => { - obj[key] = value; - - return obj; - }, {}), - ); - - return JSON.stringify(cleanedResults); -}; diff --git a/node_modules/stylelint/lib/formatters/preprocessWarnings.js b/node_modules/stylelint/lib/formatters/preprocessWarnings.js deleted file mode 100644 index 4bba00841..000000000 --- a/node_modules/stylelint/lib/formatters/preprocessWarnings.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -/** @typedef {import('stylelint').LintResult} LintResult */ -/** @typedef {LintResult['parseErrors'][0]} ParseError */ -/** @typedef {LintResult['warnings'][0]} Warning */ -/** @typedef {Warning['severity']} Severity */ - -/** - * Preprocess warnings in a given lint result. - * Note that this function has a side-effect. - * - * @param {LintResult} result - * @returns {LintResult} - */ -module.exports = function preprocessWarnings(result) { - for (const error of result.parseErrors || []) { - result.warnings.push(parseErrorToWarning(error)); - } - - for (const warning of result.warnings) { - warning.severity = normalizeSeverity(warning); - } - - result.warnings.sort(byLocationOrder); - - return result; -}; - -/** - * @param {ParseError} error - * @returns {Warning} - */ -function parseErrorToWarning(error) { - return { - line: error.line, - column: error.column, - rule: error.stylelintType, - severity: 'error', - text: `${error.text} (${error.stylelintType})`, - }; -} - -/** - * @param {Warning} warning - * @returns {Severity} - */ -function normalizeSeverity(warning) { - // NOTE: Plugins may add a warning without severity, for example, - // by directly using the PostCSS `Result#warn()` API. - return warning.severity || 'error'; -} - -/** - * @param {Warning} a - * @param {Warning} b - * @returns {number} - */ -function byLocationOrder(a, b) { - // positionless first - if (!a.line && b.line) return -1; - - // positionless first - if (a.line && !b.line) return 1; - - if (a.line < b.line) return -1; - - if (a.line > b.line) return 1; - - if (a.column < b.column) return -1; - - if (a.column > b.column) return 1; - - return 0; -} diff --git a/node_modules/stylelint/lib/formatters/stringFormatter.js b/node_modules/stylelint/lib/formatters/stringFormatter.js deleted file mode 100644 index 43a8fe0c5..000000000 --- a/node_modules/stylelint/lib/formatters/stringFormatter.js +++ /dev/null @@ -1,276 +0,0 @@ -'use strict'; - -const path = require('path'); -const stringWidth = require('string-width'); -const table = require('table'); -const { yellow, dim, underline, blue, red, green } = require('picocolors'); - -const calcSeverityCounts = require('./calcSeverityCounts'); -const pluralize = require('../utils/pluralize'); -const { assertNumber } = require('../utils/validateTypes'); -const preprocessWarnings = require('./preprocessWarnings'); -const terminalLink = require('./terminalLink'); - -const NON_ASCII_PATTERN = /\P{ASCII}/u; -const MARGIN_WIDTHS = 9; - -/** - * @param {string} s - * @returns {string} - */ -function nope(s) { - return s; -} - -const levelColors = { - info: blue, - warning: yellow, - error: red, - success: nope, -}; - -const symbols = { - info: blue('ℹ'), - warning: yellow('⚠'), - error: red('✖'), - success: green('✔'), -}; - -/** - * @param {import('stylelint').LintResult[]} results - * @returns {string} - */ -function deprecationsFormatter(results) { - const allDeprecationWarnings = results.flatMap((result) => result.deprecations || []); - - if (allDeprecationWarnings.length === 0) { - return ''; - } - - const seenText = new Set(); - const lines = []; - - for (const { text, reference } of allDeprecationWarnings) { - if (seenText.has(text)) continue; - - seenText.add(text); - - let line = ` ${dim('-')} ${text}`; - - if (reference) { - line += dim(` See: ${underline(reference)}`); - } - - lines.push(line); - } - - return ['', yellow('Deprecation warnings:'), ...lines, ''].join('\n'); -} - -/** - * @param {import('stylelint').LintResult[]} results - * @return {string} - */ -function invalidOptionsFormatter(results) { - const allInvalidOptionWarnings = results.flatMap((result) => - (result.invalidOptionWarnings || []).map((warning) => warning.text), - ); - const uniqueInvalidOptionWarnings = [...new Set(allInvalidOptionWarnings)]; - - return uniqueInvalidOptionWarnings.reduce((output, warning) => { - output += red('Invalid Option: '); - output += warning; - - return `${output}\n`; - }, '\n'); -} - -/** - * @param {string} fromValue - * @param {string} cwd - * @return {string} - */ -function logFrom(fromValue, cwd) { - if (fromValue.startsWith('<')) { - return underline(fromValue); - } - - const filePath = path.relative(cwd, fromValue).split(path.sep).join('/'); - - return terminalLink(filePath, `file://${fromValue}`); -} - -/** - * @param {{[k: number]: number}} columnWidths - * @return {number} - */ -function getMessageWidth(columnWidths) { - const width = columnWidths[3]; - - assertNumber(width); - - if (!process.stdout.isTTY) { - return width; - } - - const availableWidth = process.stdout.columns < 80 ? 80 : process.stdout.columns; - const fullWidth = Object.values(columnWidths).reduce((a, b) => a + b); - - // If there is no reason to wrap the text, we won't align the last column to the right - if (availableWidth > fullWidth + MARGIN_WIDTHS) { - return width; - } - - return availableWidth - (fullWidth - width + MARGIN_WIDTHS); -} - -/** - * @param {import('stylelint').Warning[]} messages - * @param {string} source - * @param {string} cwd - * @return {string} - */ -function formatter(messages, source, cwd) { - if (messages.length === 0) return ''; - - /** - * Create a list of column widths, needed to calculate - * the size of the message column and if needed wrap it. - * @type {{[k: string]: number}} - */ - const columnWidths = { 0: 1, 1: 1, 2: 1, 3: 1, 4: 1 }; - - /** - * @param {[string, string, string, string, string]} columns - * @return {[string, string, string, string, string]} - */ - function calculateWidths(columns) { - for (const [key, value] of Object.entries(columns)) { - const normalisedValue = value ? value.toString() : value; - const width = columnWidths[key]; - - assertNumber(width); - columnWidths[key] = Math.max(width, stringWidth(normalisedValue)); - } - - return columns; - } - - let output = '\n'; - - if (source) { - output += `${logFrom(source, cwd)}\n`; - } - - /** - * @param {import('stylelint').Warning} message - * @return {string} - */ - function formatMessageText(message) { - let result = message.text; - - result = result - // Remove all control characters (newline, tab and etc) - .replace(/[\u0001-\u001A]+/g, ' ') // eslint-disable-line no-control-regex - .replace(/\.$/, ''); - - const ruleString = ` (${message.rule})`; - - if (result.endsWith(ruleString)) { - result = result.slice(0, result.lastIndexOf(ruleString)); - } - - return result; - } - - const cleanedMessages = messages.map((message) => { - const { line, column, severity } = message; - /** - * @type {[string, string, string, string, string]} - */ - const row = [ - line ? line.toString() : '', - column ? column.toString() : '', - symbols[severity] ? levelColors[severity](symbols[severity]) : severity, - formatMessageText(message), - dim(message.rule || ''), - ]; - - calculateWidths(row); - - return row; - }); - - const messageWidth = getMessageWidth(columnWidths); - const hasNonAsciiChar = messages.some((msg) => NON_ASCII_PATTERN.test(msg.text)); - - output += table - .table(cleanedMessages, { - border: table.getBorderCharacters('void'), - columns: { - 0: { alignment: 'right', width: columnWidths[0], paddingRight: 0 }, - 1: { alignment: 'left', width: columnWidths[1] }, - 2: { alignment: 'center', width: columnWidths[2] }, - 3: { - alignment: 'left', - width: messageWidth, - wrapWord: messageWidth > 1 && !hasNonAsciiChar, - }, - 4: { alignment: 'left', width: columnWidths[4], paddingRight: 0 }, - }, - drawHorizontalLine: () => false, - }) - .split('\n') - .map((el) => el.replace(/(\d+)\s+(\d+)/, (_m, p1, p2) => dim(`${p1}:${p2}`)).trimEnd()) - .join('\n'); - - return output; -} - -/** - * @type {import('stylelint').Formatter} - */ -module.exports = function stringFormatter(results, returnValue) { - let output = invalidOptionsFormatter(results); - - output += deprecationsFormatter(results); - - const counts = { error: 0, warning: 0 }; - - output = results.reduce((accum, result) => { - preprocessWarnings(result); - - accum += formatter( - result.warnings, - result.source || '', - (returnValue && returnValue.cwd) || process.cwd(), - ); - - for (const warning of result.warnings) { - calcSeverityCounts(warning.severity, counts); - } - - return accum; - }, output); - - // Ensure consistent padding - output = output.trim(); - - if (output !== '') { - output = `\n${output}\n\n`; - - const errorCount = counts.error; - const warningCount = counts.warning; - const total = errorCount + warningCount; - - if (total > 0) { - const error = red(`${errorCount} ${pluralize('error', errorCount)}`); - const warning = yellow(`${warningCount} ${pluralize('warning', warningCount)}`); - const tally = `${total} ${pluralize('problem', total)} (${error}, ${warning})`; - - output += `${tally}\n\n`; - } - } - - return output; -}; diff --git a/node_modules/stylelint/lib/formatters/tapFormatter.js b/node_modules/stylelint/lib/formatters/tapFormatter.js deleted file mode 100644 index e8f597df0..000000000 --- a/node_modules/stylelint/lib/formatters/tapFormatter.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -const preprocessWarnings = require('./preprocessWarnings'); - -/** - * @type {import('stylelint').Formatter} - */ -module.exports = function tapFormatter(results) { - const lines = [`TAP version 13\n1..${results.length}`]; - - for (const [index, result] of results.entries()) { - preprocessWarnings(result); - - lines.push( - `${result.errored ? 'not ok' : 'ok'} ${index + 1} - ${result.ignored ? 'ignored ' : ''}${ - result.source - }`, - ); - - if (result.warnings.length > 0) { - lines.push('---', 'messages:'); - - for (const warning of result.warnings) { - lines.push( - ` - message: "${warning.text}"`, - ` severity: ${warning.severity}`, - ` data:`, - ` line: ${warning.line}`, - ` column: ${warning.column}`, - ); - - if (typeof warning.endLine === 'number') { - lines.push(` endLine: ${warning.endLine}`); - } - - if (typeof warning.endColumn === 'number') { - lines.push(` endColumn: ${warning.endColumn}`); - } - - if (typeof warning.rule === 'string') { - lines.push(` ruleId: ${warning.rule}`); - } - } - - lines.push('---'); - } - } - - lines.push(''); - - return lines.join('\n'); -}; diff --git a/node_modules/stylelint/lib/formatters/terminalLink.js b/node_modules/stylelint/lib/formatters/terminalLink.js deleted file mode 100644 index 3e551e804..000000000 --- a/node_modules/stylelint/lib/formatters/terminalLink.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -const supportsHyperlinks = require('supports-hyperlinks'); - -// ANSI escapes -const OSC = '\u001B]'; -const BEL = '\u0007'; -const SEP = ';'; - -/** - * @see https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda - * - * @param {string} text - * @param {string} url - * @returns {string} - */ -module.exports = function terminalLink(text, url) { - if (supportsHyperlinks.stdout) { - return [OSC, '8', SEP, SEP, url, BEL, text, OSC, '8', SEP, SEP, BEL].join(''); - } - - return text; -}; diff --git a/node_modules/stylelint/lib/formatters/unixFormatter.js b/node_modules/stylelint/lib/formatters/unixFormatter.js deleted file mode 100644 index 170ba1004..000000000 --- a/node_modules/stylelint/lib/formatters/unixFormatter.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const calcSeverityCounts = require('./calcSeverityCounts'); -const pluralize = require('../utils/pluralize'); -const preprocessWarnings = require('./preprocessWarnings'); - -/** - * @type {import('stylelint').Formatter} - */ -module.exports = function unixFormatter(results) { - const counts = { error: 0, warning: 0 }; - const lines = results.flatMap((result) => { - preprocessWarnings(result); - - return result.warnings.map((warning) => { - calcSeverityCounts(warning.severity, counts); - - return ( - `${result.source}:${warning.line}:${warning.column}: ` + - `${warning.text} [${warning.severity}]` - ); - }); - }); - const total = lines.length; - let output = lines.join('\n'); - - if (total > 0) { - output += `\n\n${total} ${pluralize('problem', total)}`; - output += ` (${counts.error} ${pluralize('error', counts.error)}`; - output += `, ${counts.warning} ${pluralize('warning', counts.warning)})\n`; - } - - return output; -}; diff --git a/node_modules/stylelint/lib/formatters/verboseFormatter.js b/node_modules/stylelint/lib/formatters/verboseFormatter.js deleted file mode 100644 index a3a3619a5..000000000 --- a/node_modules/stylelint/lib/formatters/verboseFormatter.js +++ /dev/null @@ -1,149 +0,0 @@ -'use strict'; - -const { underline, red, yellow, dim, green } = require('picocolors'); - -const pluralize = require('../utils/pluralize'); -const stringFormatter = require('./stringFormatter'); -const terminalLink = require('./terminalLink'); - -/** @typedef {import('stylelint').Formatter} Formatter */ -/** @typedef {import('stylelint').LintResult} LintResult */ -/** @typedef {import('stylelint').Warning} Warning */ -/** @typedef {import('stylelint').Severity} Severity */ -/** @typedef {import('stylelint').RuleMeta} RuleMeta */ - -/** - * @type {Formatter} - */ -module.exports = function verboseFormatter(results, returnValue) { - let output = stringFormatter(results, returnValue); - - if (output === '') { - output = '\n'; - } - - const ignoredCount = results.filter((result) => result.ignored).length; - const checkedDisplay = ignoredCount - ? `${results.length - ignoredCount} of ${results.length}` - : results.length; - - output += underline(`${checkedDisplay} ${pluralize('source', results.length)} checked\n`); - - for (const result of results) { - let formatting = green; - - if (result.errored) { - formatting = red; - } else if (result.warnings.length) { - formatting = yellow; - } else if (result.ignored) { - formatting = dim; - } - - let sourceText = fileLink(result.source); - - if (result.ignored) { - sourceText += ' (ignored)'; - } - - output += formatting(` ${sourceText}\n`); - } - - const warnings = results.flatMap((r) => r.warnings); - - if (warnings.length === 0) { - output += '\n0 problems found\n'; - } else { - const warningsBySeverity = groupBy(warnings, (w) => w.severity); - let fixableProblemsFound = false; - - /** - * @param {Severity} severity - */ - const printProblems = (severity) => { - const problems = warningsBySeverity[severity]; - - if (problems === undefined) return; - - output += '\n'; - output += underline(`${problems.length} ${pluralize(severity, problems.length)} found\n`); - - const problemsByRule = groupBy(problems, (w) => w.rule); - const metadata = returnValue.ruleMetadata; - - for (const [rule, list] of Object.entries(problemsByRule)) { - const meta = metadata[rule] || {}; - - let additional = [meta.fixable ? 'maybe fixable' : '', meta.deprecated ? 'deprecated' : ''] - .filter(Boolean) - .join(', '); - - additional = additional ? ` (${additional})` : ''; - - output += dim(` ${ruleLink(rule, meta)}: ${list.length}${additional}\n`); - - if (!fixableProblemsFound && meta.fixable) { - fixableProblemsFound = true; - } - } - }; - - printProblems('error'); - printProblems('warning'); - - if (fixableProblemsFound) { - output += yellow('\nYou may fix some problems with the "--fix" option.\n'); - } - } - - return `${output}\n`; -}; - -/** - * @template {string} K - * @param {Warning[]} array - * @param {(w: Warning) => K} keyFn - * @returns {Record} - */ -function groupBy(array, keyFn) { - /** @type {Record} */ - const result = {}; - - for (const item of array) { - const key = keyFn(item); - let warnings = result[key]; - - if (warnings === undefined) { - result[key] = warnings = []; - } - - warnings.push(item); - } - - return result; -} - -/** - * @param {string | undefined} source - * @returns {string} - */ -function fileLink(source) { - if (!source || source.startsWith('<')) { - return `${source}`; - } - - return terminalLink(source, `file://${source}`); -} - -/** - * @param {string} rule - * @param {Partial | undefined} metadata - * @returns {string} - */ -function ruleLink(rule, metadata) { - if (metadata && metadata.url) { - return terminalLink(rule, metadata.url); - } - - return rule; -} diff --git a/node_modules/stylelint/lib/getConfigForFile.js b/node_modules/stylelint/lib/getConfigForFile.js deleted file mode 100644 index c5780ed26..000000000 --- a/node_modules/stylelint/lib/getConfigForFile.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -const configurationError = require('./utils/configurationError'); -const path = require('path'); -const { augmentConfigFull } = require('./augmentConfig'); -const { cosmiconfig, defaultLoadersSync } = require('cosmiconfig'); - -const IS_TEST = process.env.NODE_ENV === 'test'; -const STOP_DIR = IS_TEST ? process.cwd() : undefined; - -/** @typedef {import('stylelint').InternalApi} StylelintInternalApi */ -/** @typedef {import('stylelint').Config} StylelintConfig */ -/** @typedef {import('stylelint').CosmiconfigResult} StylelintCosmiconfigResult */ - -/** - * @param {StylelintInternalApi} stylelint - * @param {string} [searchPath] - * @param {string} [filePath] - * @returns {Promise} - */ -module.exports = async function getConfigForFile( - stylelint, - searchPath = stylelint._options.cwd, - filePath, -) { - const optionsConfig = stylelint._options.config; - const cwd = stylelint._options.cwd; - - if (optionsConfig !== undefined) { - const cached = stylelint._specifiedConfigCache.get(optionsConfig); - - // If config has overrides the resulting config might be different for some files. - // Cache results only if resulted config is the same for all linted files. - if (cached && !optionsConfig.overrides) { - return cached; - } - - const augmentedResult = augmentConfigFull(stylelint, filePath, { - config: optionsConfig, - // Add the extra path part so that we can get the directory without being - // confused - filepath: path.join(cwd, 'argument-config'), - }); - - stylelint._specifiedConfigCache.set(optionsConfig, augmentedResult); - - return augmentedResult; - } - - const configExplorer = cosmiconfig('stylelint', { - transform: (cosmiconfigResult) => augmentConfigFull(stylelint, filePath, cosmiconfigResult), - loaders: { - '.cjs': (cjsPath, cjsContent) => - Promise.resolve(defaultLoadersSync['.cjs'](cjsPath, cjsContent)), - '.js': (jsPath, cjsContent) => Promise.resolve(defaultLoadersSync['.js'](jsPath, cjsContent)), - }, - stopDir: STOP_DIR, - }); - - let config = stylelint._options.configFile - ? await configExplorer.load(stylelint._options.configFile) - : await configExplorer.search(searchPath); - - if (!config) { - config = await configExplorer.search(cwd); - } - - if (!config) { - return Promise.reject( - configurationError(`No configuration provided${searchPath ? ` for ${searchPath}` : ''}`), - ); - } - - return config; -}; diff --git a/node_modules/stylelint/lib/getPostcssResult.js b/node_modules/stylelint/lib/getPostcssResult.js deleted file mode 100644 index 024642e17..000000000 --- a/node_modules/stylelint/lib/getPostcssResult.js +++ /dev/null @@ -1,142 +0,0 @@ -'use strict'; - -const LazyResult = require('postcss/lib/lazy-result').default; -const path = require('path'); -const { default: postcss } = require('postcss'); -const { promises: fs } = require('fs'); - -const getModulePath = require('./utils/getModulePath'); - -/** @typedef {import('postcss').Result} Result */ -/** @typedef {import('postcss').Syntax} Syntax */ -/** @typedef {import('stylelint').CustomSyntax} CustomSyntax */ -/** @typedef {import('stylelint').GetPostcssOptions} GetPostcssOptions */ -/** @typedef {import('stylelint').InternalApi} StylelintInternalApi */ - -const postcssProcessor = postcss(); - -/** - * @param {StylelintInternalApi} stylelint - * @param {GetPostcssOptions} options - * - * @returns {Promise} - */ -module.exports = async function getPostcssResult(stylelint, options = {}) { - const cached = options.filePath ? stylelint._postcssResultCache.get(options.filePath) : undefined; - - if (cached) { - return cached; - } - - const syntax = options.customSyntax - ? getCustomSyntax(options.customSyntax, stylelint._options.configBasedir) - : cssSyntax(stylelint, options.filePath); - - const postcssOptions = { - from: options.filePath, - syntax, - }; - - /** @type {string | undefined} */ - let getCode; - - if (options.code !== undefined) { - getCode = options.code; - } else if (options.filePath) { - getCode = await fs.readFile(options.filePath, 'utf8'); - } - - if (getCode === undefined) { - return Promise.reject(new Error('code or filePath required')); - } - - const postcssResult = await new LazyResult(postcssProcessor, getCode, postcssOptions); - - if (options.filePath) { - stylelint._postcssResultCache.set(options.filePath, postcssResult); - } - - return postcssResult; -}; - -/** - * @param {CustomSyntax} customSyntax - * @param {string | undefined} basedir - * @returns {Syntax} - */ -function getCustomSyntax(customSyntax, basedir) { - if (typeof customSyntax === 'string') { - const customSyntaxLookup = basedir ? getModulePath(basedir, customSyntax) : customSyntax; - - let resolved; - - try { - resolved = require(customSyntaxLookup); - } catch (error) { - if ( - error && - typeof error === 'object' && - 'code' in error && - error.code === 'MODULE_NOT_FOUND' && - 'message' in error && - typeof error.message === 'string' && - error.message.includes(customSyntax) - ) { - throw new Error( - `Cannot resolve custom syntax module "${customSyntax}". Check that module "${customSyntax}" is available and spelled correctly.\n\nCaused by: ${error}`, - ); - } - - throw error; - } - - /* - * PostCSS allows for syntaxes that only contain a parser, however, - * it then expects the syntax to be set as the `parse` option. - */ - if (!resolved.parse) { - resolved = { - parse: resolved, - stringify: postcss.stringify, - }; - } - - return resolved; - } - - if (typeof customSyntax === 'object') { - if (typeof customSyntax.parse === 'function') { - return { ...customSyntax }; - } - - throw new TypeError( - 'An object provided to the "customSyntax" option must have a "parse" property. Ensure the "parse" property exists and its value is a function.', - ); - } - - throw new Error('Custom syntax must be a string or a Syntax object'); -} - -/** - * @param {StylelintInternalApi} stylelint - * @param {string|undefined} filePath - * @returns {Syntax} - */ -function cssSyntax(stylelint, filePath) { - const fileExtension = filePath ? path.extname(filePath).slice(1).toLowerCase() : ''; - const extensions = ['css', 'pcss', 'postcss']; - - if (fileExtension && !extensions.includes(fileExtension)) { - console.warn( - `${filePath}: you should use the "customSyntax" option when linting something other than CSS`, - ); - } - - return { - parse: - stylelint._options.fix && extensions.includes(fileExtension) - ? require('postcss-safe-parser') - : postcss.parse, - stringify: postcss.stringify, - }; -} diff --git a/node_modules/stylelint/lib/index.js b/node_modules/stylelint/lib/index.js deleted file mode 100644 index 4f991e19c..000000000 --- a/node_modules/stylelint/lib/index.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -const checkAgainstRule = require('./utils/checkAgainstRule'); -const createPlugin = require('./createPlugin'); -const createStylelint = require('./createStylelint'); -const formatters = require('./formatters'); -const postcssPlugin = require('./postcssPlugin'); -const report = require('./utils/report'); -const resolveConfig = require('./resolveConfig'); -const ruleMessages = require('./utils/ruleMessages'); -const rules = require('./rules'); -const { longhandSubPropertiesOfShorthandProperties } = require('./reference/properties'); -const standalone = require('./standalone'); -const validateOptions = require('./utils/validateOptions'); - -/** @type {import('stylelint')} */ -const stylelint = Object.assign(postcssPlugin, { - lint: standalone, - rules, - formatters, - createPlugin, - resolveConfig, - _createLinter: createStylelint, - utils: { - report, - ruleMessages, - validateOptions, - checkAgainstRule, - }, - reference: { - longhandSubPropertiesOfShorthandProperties, - }, -}); - -module.exports = stylelint; diff --git a/node_modules/stylelint/lib/invalidScopeDisables.js b/node_modules/stylelint/lib/invalidScopeDisables.js deleted file mode 100644 index 7aad8e724..000000000 --- a/node_modules/stylelint/lib/invalidScopeDisables.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -const optionsMatches = require('./utils/optionsMatches'); -const validateDisableSettings = require('./validateDisableSettings'); - -/** - * @param {import('stylelint').LintResult[]} results - */ -module.exports = function invalidScopeDisables(results) { - for (const result of results) { - const settings = validateDisableSettings(result._postcssResult, 'reportInvalidScopeDisables'); - - if (!settings) continue; - - const [enabled, options, stylelintResult] = settings; - - const configRules = (stylelintResult.config || {}).rules || {}; - - const usedRules = new Set(Object.keys(configRules)); - - usedRules.add('all'); - - for (const [rule, ruleRanges] of Object.entries(stylelintResult.disabledRanges)) { - if (usedRules.has(rule)) continue; - - if (enabled === optionsMatches(options, 'except', rule)) continue; - - for (const range of ruleRanges) { - if (!range.strictStart && !range.strictEnd) continue; - - // If the comment doesn't have a location, we can't report a useful error. - // In practice we expect all comments to have locations, though. - if (!range.comment.source || !range.comment.source.start) continue; - - result.warnings.push({ - text: `Rule "${rule}" isn't enabled`, - rule: '--report-invalid-scope-disables', - line: range.comment.source.start.line, - column: range.comment.source.start.column, - endLine: range.comment.source.end && range.comment.source.end.line, - endColumn: range.comment.source.end && range.comment.source.end.column, - severity: options.severity, - }); - } - } - } -}; diff --git a/node_modules/stylelint/lib/isPathIgnored.js b/node_modules/stylelint/lib/isPathIgnored.js deleted file mode 100644 index 31ec2b6a0..000000000 --- a/node_modules/stylelint/lib/isPathIgnored.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -const micromatch = require('micromatch'); -const path = require('path'); - -const filterFilePaths = require('./utils/filterFilePaths'); -const getConfigForFile = require('./getConfigForFile'); -const getFileIgnorer = require('./utils/getFileIgnorer'); - -/** - * To find out if a path is ignored, we need to load the config, - * which may have an ignoreFiles property. We then check the path - * against these. - * @param {import('stylelint').InternalApi} stylelint - * @param {string} [filePath] - * @return {Promise} - */ -module.exports = async function isPathIgnored(stylelint, filePath) { - if (!filePath) { - return false; - } - - const cwd = stylelint._options.cwd; - const result = await getConfigForFile(stylelint, filePath, filePath); - - if (!result) { - return true; - } - - const ignoreFiles = result.config.ignoreFiles || []; - const absoluteFilePath = path.isAbsolute(filePath) ? filePath : path.resolve(cwd, filePath); - - if (micromatch([absoluteFilePath], ignoreFiles).length > 0) { - return true; - } - - const ignorer = getFileIgnorer(stylelint._options); - - if (filterFilePaths(ignorer, [path.relative(cwd, absoluteFilePath)]).length === 0) { - return true; - } - - return false; -}; diff --git a/node_modules/stylelint/lib/lintPostcssResult.js b/node_modules/stylelint/lib/lintPostcssResult.js deleted file mode 100644 index 9f1c368a1..000000000 --- a/node_modules/stylelint/lib/lintPostcssResult.js +++ /dev/null @@ -1,151 +0,0 @@ -'use strict'; - -const assignDisabledRanges = require('./assignDisabledRanges'); -const getOsEol = require('./utils/getOsEol'); -const reportUnknownRuleNames = require('./reportUnknownRuleNames'); -const rules = require('./rules'); -const getStylelintRule = require('./utils/getStylelintRule'); -const { DEFAULT_CONFIGURATION_COMMENT } = require('./utils/configurationComment'); - -/** @typedef {import('stylelint').LinterOptions} LinterOptions */ -/** @typedef {import('stylelint').PostcssResult} PostcssResult */ -/** @typedef {import('stylelint').Config} StylelintConfig */ - -/** - * @param {LinterOptions} stylelintOptions - * @param {PostcssResult} postcssResult - * @param {StylelintConfig} config - * @returns {Promise} - */ -module.exports = function lintPostcssResult(stylelintOptions, postcssResult, config) { - postcssResult.stylelint.ruleSeverities = {}; - postcssResult.stylelint.customMessages = {}; - postcssResult.stylelint.ruleMetadata = {}; - postcssResult.stylelint.stylelintError = false; - postcssResult.stylelint.stylelintWarning = false; - postcssResult.stylelint.quiet = config.quiet; - postcssResult.stylelint.config = config; - - /** @type {string | undefined} */ - let newline; - const postcssDoc = postcssResult.root; - - if (postcssDoc) { - if (!('type' in postcssDoc)) { - throw new Error('Unexpected Postcss root object!'); - } - - const newlineMatch = postcssDoc.source && postcssDoc.source.input.css.match(/\r?\n/); - - newline = newlineMatch ? newlineMatch[0] : getOsEol(); - - assignDisabledRanges(postcssDoc, postcssResult); - } - - const isFileFixCompatible = isFixCompatible(postcssResult); - - if (!isFileFixCompatible) { - postcssResult.stylelint.disableWritingFix = true; - } - - const postcssRoots = /** @type {import('postcss').Root[]} */ ( - postcssDoc && postcssDoc.constructor.name === 'Document' ? postcssDoc.nodes : [postcssDoc] - ); - - // Promises for the rules. Although the rule code runs synchronously now, - // the use of Promises makes it compatible with the possibility of async - // rules down the line. - /** @type {Array>} */ - const performRules = []; - - const rulesOrder = Object.keys(rules); - const ruleNames = config.rules - ? Object.keys(config.rules).sort((a, b) => rulesOrder.indexOf(a) - rulesOrder.indexOf(b)) - : []; - - for (const ruleName of ruleNames) { - const ruleFunction = getStylelintRule(ruleName, config); - - if (ruleFunction === undefined) { - performRules.push( - Promise.all( - postcssRoots.map((postcssRoot) => - reportUnknownRuleNames(ruleName, postcssRoot, postcssResult), - ), - ), - ); - - continue; - } - - const ruleSettings = config.rules && config.rules[ruleName]; - - if (ruleSettings === null || ruleSettings[0] === null) { - continue; - } - - if ( - ruleFunction.meta && - ruleFunction.meta.deprecated && - !stylelintOptions.quietDeprecationWarnings - ) { - warnDeprecatedRule(postcssResult, ruleName); - } - - const primaryOption = ruleSettings[0]; - const secondaryOptions = ruleSettings[1]; - - // Log the rule's severity in the PostCSS result - const defaultSeverity = config.defaultSeverity || 'error'; - // disableFix in secondary option - const disableFix = (secondaryOptions && secondaryOptions.disableFix === true) || false; - - postcssResult.stylelint.ruleSeverities[ruleName] = - (secondaryOptions && secondaryOptions.severity) || defaultSeverity; - postcssResult.stylelint.customMessages[ruleName] = secondaryOptions && secondaryOptions.message; - postcssResult.stylelint.ruleMetadata[ruleName] = ruleFunction.meta || {}; - - performRules.push( - Promise.all( - postcssRoots.map((postcssRoot) => - ruleFunction(primaryOption, secondaryOptions, { - configurationComment: config.configurationComment || DEFAULT_CONFIGURATION_COMMENT, - fix: - !disableFix && - config.fix && - // Next two conditionals are temporary measures until #2643 is resolved - isFileFixCompatible && - !postcssResult.stylelint.disabledRanges[ruleName], - newline, - })(postcssRoot, postcssResult), - ), - ), - ); - } - - return Promise.all(performRules); -}; - -/** - * There are currently some bugs in the autofixer of Stylelint. - * The autofixer does not yet adhere to stylelint-disable comments, so if there are disabled - * ranges we can not autofix this document. More info in issue #2643. - * - * @param {PostcssResult} postcssResult - * @returns {boolean} - */ -function isFixCompatible({ stylelint }) { - // Check for issue #2643 - if (stylelint.disabledRanges.all && stylelint.disabledRanges.all.length) return false; - - return true; -} - -/** - * @param {PostcssResult} result - * @param {string} ruleName - * @returns {void} - */ -function warnDeprecatedRule(result, ruleName) { - result.warn(`The "${ruleName}" rule is deprecated.`, { stylelintType: 'deprecation' }); -} diff --git a/node_modules/stylelint/lib/lintSource.js b/node_modules/stylelint/lib/lintSource.js deleted file mode 100644 index 2a92619a8..000000000 --- a/node_modules/stylelint/lib/lintSource.js +++ /dev/null @@ -1,146 +0,0 @@ -'use strict'; - -const path = require('path'); - -const getConfigForFile = require('./getConfigForFile'); -const getPostcssResult = require('./getPostcssResult'); -const isPathIgnored = require('./isPathIgnored'); -const isPathNotFoundError = require('./utils/isPathNotFoundError'); -const lintPostcssResult = require('./lintPostcssResult'); - -/** @typedef {import('stylelint').InternalApi} StylelintInternalApi */ -/** @typedef {import('stylelint').GetLintSourceOptions} Options */ -/** @typedef {import('postcss').Result} Result */ -/** @typedef {import('stylelint').PostcssResult} PostcssResult */ -/** @typedef {import('stylelint').StylelintPostcssResult} StylelintPostcssResult */ - -/** - * Run stylelint on a PostCSS Result, either one that is provided - * or one that we create - * @param {StylelintInternalApi} stylelint - * @param {Options} options - * @returns {Promise} - */ -module.exports = async function lintSource(stylelint, options = {}) { - if (!options.filePath && options.code === undefined && !options.existingPostcssResult) { - return Promise.reject(new Error('You must provide filePath, code, or existingPostcssResult')); - } - - const isCodeNotFile = options.code !== undefined; - - const inputFilePath = isCodeNotFile ? options.codeFilename : options.filePath; - - if (inputFilePath !== undefined && !path.isAbsolute(inputFilePath)) { - if (isCodeNotFile) { - return Promise.reject(new Error('codeFilename must be an absolute path')); - } - - return Promise.reject(new Error('filePath must be an absolute path')); - } - - const isIgnored = await isPathIgnored(stylelint, inputFilePath).catch((err) => { - if (isCodeNotFile && isPathNotFoundError(err)) return false; - - throw err; - }); - - if (isIgnored) { - return options.existingPostcssResult - ? Object.assign(options.existingPostcssResult, { - stylelint: createEmptyStylelintPostcssResult(), - }) - : createEmptyPostcssResult(inputFilePath); - } - - const configSearchPath = stylelint._options.configFile || inputFilePath; - const cwd = stylelint._options.cwd; - - let configForFile; - - try { - configForFile = await getConfigForFile(stylelint, configSearchPath, inputFilePath); - } catch (err) { - if (isCodeNotFile && isPathNotFoundError(err)) { - configForFile = await getConfigForFile(stylelint, cwd); - } else { - throw err; - } - } - - if (!configForFile) { - return Promise.reject(new Error('Config file not found')); - } - - const config = configForFile.config; - const existingPostcssResult = options.existingPostcssResult; - - if (options.cache) { - stylelint._fileCache.calcHashOfConfig(config); - - if (options.filePath && !stylelint._fileCache.hasFileChanged(options.filePath)) { - return existingPostcssResult - ? Object.assign(existingPostcssResult, { - stylelint: createEmptyStylelintPostcssResult(), - }) - : createEmptyPostcssResult(inputFilePath); - } - } - - /** @type {StylelintPostcssResult} */ - const stylelintResult = { - ruleSeverities: {}, - customMessages: {}, - ruleMetadata: {}, - disabledRanges: {}, - }; - - const postcssResult = - existingPostcssResult || - (await getPostcssResult(stylelint, { - code: options.code, - codeFilename: options.codeFilename, - filePath: inputFilePath, - customSyntax: config.customSyntax, - })); - - const stylelintPostcssResult = Object.assign(postcssResult, { - stylelint: stylelintResult, - }); - - await lintPostcssResult(stylelint._options, stylelintPostcssResult, config); - - return stylelintPostcssResult; -}; - -/** - * @returns {StylelintPostcssResult} - */ -function createEmptyStylelintPostcssResult() { - return { - ruleSeverities: {}, - customMessages: {}, - ruleMetadata: {}, - disabledRanges: {}, - ignored: true, - stylelintError: false, - stylelintWarning: false, - }; -} - -/** - * @param {string} [filePath] - * @returns {PostcssResult} - */ -function createEmptyPostcssResult(filePath) { - return { - root: { - source: { - input: { file: filePath }, - }, - }, - messages: [], - opts: undefined, - stylelint: createEmptyStylelintPostcssResult(), - warn: () => {}, - }; -} diff --git a/node_modules/stylelint/lib/needlessDisables.js b/node_modules/stylelint/lib/needlessDisables.js deleted file mode 100644 index 9431e16a7..000000000 --- a/node_modules/stylelint/lib/needlessDisables.js +++ /dev/null @@ -1,101 +0,0 @@ -'use strict'; - -const optionsMatches = require('./utils/optionsMatches'); -const putIfAbsent = require('./utils/putIfAbsent'); -const validateDisableSettings = require('./validateDisableSettings'); - -/** @typedef {import('postcss').Comment} PostcssComment */ -/** @typedef {import('stylelint').DisabledRange} DisabledRange */ -/** @typedef {import('stylelint').DisableReportRange} DisableReportRange */ - -/** - * @param {import('stylelint').LintResult[]} results - */ -module.exports = function needlessDisables(results) { - for (const result of results) { - const settings = validateDisableSettings(result._postcssResult, 'reportNeedlessDisables'); - - if (!settings) continue; - - const [enabled, options, stylelintResult] = settings; - - const rangeData = stylelintResult.disabledRanges; - - if (!rangeData) continue; - - const disabledWarnings = stylelintResult.disabledWarnings || []; - - // A map from `stylelint-disable` comments to the set of rules that - // are usefully disabled by each comment. We track this - // comment-by-comment rather than range-by-range because ranges that - // disable *all* rules are duplicated for each rule they apply to in - // practice. - /** @type {Map>}} */ - const usefulDisables = new Map(); - - for (const warning of disabledWarnings) { - const rule = warning.rule; - const ruleRanges = rangeData[rule]; - - if (ruleRanges) { - for (const range of ruleRanges) { - if (isWarningInRange(warning, range)) { - putIfAbsent(usefulDisables, range.comment, () => new Set()).add(rule); - } - } - } - - for (const range of rangeData.all || []) { - if (isWarningInRange(warning, range)) { - putIfAbsent(usefulDisables, range.comment, () => new Set()).add(rule); - } - } - } - - const allRangeComments = new Set((rangeData.all || []).map((range) => range.comment)); - - for (const [rule, ranges] of Object.entries(rangeData)) { - for (const range of ranges) { - if (rule !== 'all' && allRangeComments.has(range.comment)) continue; - - if (enabled === optionsMatches(options, 'except', rule)) continue; - - const useful = usefulDisables.get(range.comment) || new Set(); - - // Only emit a warning if this range's comment isn't useful for this rule. - // For the special rule "all", only emit a warning if it's not useful for - // *any* rules, because it covers all of them. - if (rule === 'all' ? useful.size !== 0 : useful.has(rule)) continue; - - // If the comment doesn't have a location, we can't report a useful error. - // In practice we expect all comments to have locations, though. - if (!range.comment.source || !range.comment.source.start) continue; - - result.warnings.push({ - text: `Needless disable for "${rule}"`, - rule: '--report-needless-disables', - line: range.comment.source.start.line, - column: range.comment.source.start.column, - endLine: range.comment.source.end && range.comment.source.end.line, - endColumn: range.comment.source.end && range.comment.source.end.column, - severity: options.severity, - }); - } - } - } -}; - -/** - * @param {import('stylelint').DisabledWarning} warning - * @param {DisabledRange} range - * @return {boolean} - */ -function isWarningInRange(warning, range) { - const line = warning.line; - - // Need to check if range.end exist, because line number type cannot be compared to undefined - return ( - range.start <= line && - ((range.end !== undefined && range.end >= line) || range.end === undefined) - ); -} diff --git a/node_modules/stylelint/lib/normalizeAllRuleSettings.js b/node_modules/stylelint/lib/normalizeAllRuleSettings.js deleted file mode 100644 index 6562efaa3..000000000 --- a/node_modules/stylelint/lib/normalizeAllRuleSettings.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -const normalizeRuleSettings = require('./normalizeRuleSettings'); -const getStylelintRule = require('./utils/getStylelintRule'); - -/** @typedef {import('stylelint').Config} StylelintConfig */ - -/** - * @param {StylelintConfig} config - * @return {StylelintConfig} - */ -function normalizeAllRuleSettings(config) { - if (!config.rules) return config; - - /** @type {StylelintConfig['rules']} */ - const normalizedRules = {}; - - for (const [ruleName, rawRuleSettings] of Object.entries(config.rules)) { - const rule = getStylelintRule(ruleName, config); - - if (rule) { - normalizedRules[ruleName] = normalizeRuleSettings(rawRuleSettings, rule); - } else { - normalizedRules[ruleName] = []; - } - } - - config.rules = normalizedRules; - - return config; -} - -module.exports = normalizeAllRuleSettings; diff --git a/node_modules/stylelint/lib/normalizeRuleSettings.js b/node_modules/stylelint/lib/normalizeRuleSettings.js deleted file mode 100644 index 1169259a8..000000000 --- a/node_modules/stylelint/lib/normalizeRuleSettings.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -const { isPlainObject } = require('./utils/validateTypes'); - -// Rule settings can take a number of forms, e.g. -// a. "rule-name": null -// b. "rule-name": [null, ...] -// c. "rule-name": primaryOption -// d. "rule-name": [primaryOption] -// e. "rule-name": [primaryOption, secondaryOption] -// Where primaryOption can be anything: primitive, Object, or Array. - -/** - * This function normalizes all the possibilities into the - * standard form: [primaryOption, secondaryOption] - * Except in the cases with null, a & b, in which case - * null is returned - * @template T - * @template {Object} O - * @param {import('stylelint').ConfigRuleSettings} rawSettings - * @param {import('stylelint').Rule} [rule] - * @return {[T] | [T, O] | null} - */ -module.exports = function normalizeRuleSettings(rawSettings, rule) { - if (rawSettings === null || rawSettings === undefined) { - return null; - } - - if (!Array.isArray(rawSettings)) { - return [rawSettings]; - } - // Everything below is an array ... - - const [primary, secondary] = rawSettings; - - if (rawSettings.length > 0 && (primary === null || primary === undefined)) { - return null; - } - - if (rule && !rule.primaryOptionArray) { - return rawSettings; - } - // Everything below is a rule that CAN have an array for a primary option ... - // (they might also have something else, e.g. rule-properties-order can - // have the string "alphabetical") - - if (rawSettings.length === 1 && Array.isArray(primary)) { - return rawSettings; - } - - if (rawSettings.length === 2 && !isPlainObject(primary) && isPlainObject(secondary)) { - return rawSettings; - } - - // `T` must be an array type, but TSC thinks it's probably invalid to - // cast `[T]` to `T` so we cast through `any` first. - return [/** @type {T} */ (/** @type {any} */ (rawSettings))]; -}; diff --git a/node_modules/stylelint/lib/postcssPlugin.js b/node_modules/stylelint/lib/postcssPlugin.js deleted file mode 100644 index ba7e68341..000000000 --- a/node_modules/stylelint/lib/postcssPlugin.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -const path = require('path'); - -const createStylelint = require('./createStylelint'); -const lintSource = require('./lintSource'); - -/** @typedef {import('stylelint').PostcssPluginOptions} PostcssPluginOptions */ -/** @typedef {import('stylelint').Config} StylelintConfig */ - -/** - * @type {import('postcss').PluginCreator} - * */ -module.exports = (options = {}) => { - const [cwd, tailoredOptions] = isConfig(options) - ? [process.cwd(), { config: options }] - : [options.cwd || process.cwd(), options]; - const stylelint = createStylelint(tailoredOptions); - - return { - postcssPlugin: 'stylelint', - Once(root, { result }) { - let filePath = root.source && root.source.input.file; - - if (filePath && !path.isAbsolute(filePath)) { - filePath = path.join(cwd, filePath); - } - - return lintSource(stylelint, { - filePath, - existingPostcssResult: result, - }); - }, - }; -}; - -module.exports.postcss = true; - -/** - * @param {PostcssPluginOptions} options - * @returns {options is StylelintConfig} - */ -function isConfig(options) { - return 'rules' in options; -} diff --git a/node_modules/stylelint/lib/prepareReturnValue.js b/node_modules/stylelint/lib/prepareReturnValue.js deleted file mode 100644 index 52ca874c6..000000000 --- a/node_modules/stylelint/lib/prepareReturnValue.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -const descriptionlessDisables = require('./descriptionlessDisables'); -const invalidScopeDisables = require('./invalidScopeDisables'); -const needlessDisables = require('./needlessDisables'); -const reportDisables = require('./reportDisables'); - -/** @typedef {import('stylelint').Formatter} Formatter */ -/** @typedef {import('stylelint').LintResult} StylelintResult */ -/** @typedef {import('stylelint').LinterOptions["maxWarnings"]} maxWarnings */ -/** @typedef {import('stylelint').LinterResult} LinterResult */ - -/** - * @param {StylelintResult[]} stylelintResults - * @param {maxWarnings} maxWarnings - * @param {Formatter} formatter - * @param {string} cwd - * - * @returns {LinterResult} - */ -module.exports = function prepareReturnValue(stylelintResults, maxWarnings, formatter, cwd) { - reportDisables(stylelintResults); - needlessDisables(stylelintResults); - invalidScopeDisables(stylelintResults); - descriptionlessDisables(stylelintResults); - - let errored = false; - - for (const result of stylelintResults) { - if ( - result.errored || - result.parseErrors.length > 0 || - result.warnings.some((warning) => warning.severity === 'error') - ) { - errored = true; - result.errored = true; - } - } - - /** @type {LinterResult} */ - const returnValue = { - cwd, - errored, - results: [], - output: '', - reportedDisables: [], - ruleMetadata: getRuleMetadata(stylelintResults), - }; - - if (maxWarnings !== undefined) { - const foundWarnings = stylelintResults.reduce((count, file) => count + file.warnings.length, 0); - - if (foundWarnings > maxWarnings) { - returnValue.maxWarningsExceeded = { maxWarnings, foundWarnings }; - } - } - - returnValue.output = formatter(stylelintResults, returnValue); - returnValue.results = stylelintResults; - - return returnValue; -}; - -/** - * @param {StylelintResult[]} lintResults - */ -function getRuleMetadata(lintResults) { - const [lintResult] = lintResults; - - if (lintResult === undefined) return {}; - - if (lintResult._postcssResult === undefined) return {}; - - return lintResult._postcssResult.stylelint.ruleMetadata; -} diff --git a/node_modules/stylelint/lib/printConfig.js b/node_modules/stylelint/lib/printConfig.js deleted file mode 100644 index d1e972a6e..000000000 --- a/node_modules/stylelint/lib/printConfig.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -const resolveConfig = require('./resolveConfig'); -const globby = require('globby'); - -/** @typedef {import('stylelint').Config} StylelintConfig */ - -/** - * @param {import('stylelint').LinterOptions} options - * @returns {Promise} - */ -module.exports = async function printConfig({ - cwd = process.cwd(), - code, - config, - configBasedir, - configFile, - globbyOptions, - files, -}) { - const isCodeNotFile = code !== undefined; - const filePath = files && files[0]; - - if (!files || files.length !== 1 || !filePath || isCodeNotFile) { - return Promise.reject( - new Error('The --print-config option must be used with exactly one file path.'), - ); - } - - if (globby.hasMagic(filePath)) { - return Promise.reject(new Error('The --print-config option does not support globs.')); - } - - return ( - (await resolveConfig(filePath, { - cwd: (globbyOptions && globbyOptions.cwd) || cwd, - config, - configBasedir, - configFile, - })) || null - ); -}; diff --git a/node_modules/stylelint/lib/reference/atKeywords.js b/node_modules/stylelint/lib/reference/atKeywords.js deleted file mode 100644 index 5773d14ea..000000000 --- a/node_modules/stylelint/lib/reference/atKeywords.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -const uniteSets = require('../utils/uniteSets.js'); - -// https://www.w3.org/TR/css-page-3/#syntax-page-selector -const pageMarginAtKeywords = new Set([ - 'top-left-corner', - 'top-left', - 'top-center', - 'top-right', - 'top-right-corner', - 'bottom-left-corner', - 'bottom-left', - 'bottom-center', - 'bottom-right', - 'bottom-right-corner', - 'left-top', - 'left-middle', - 'left-bottom', - 'right-top', - 'right-middle', - 'right-bottom', -]); - -// https://developer.mozilla.org/en/docs/Web/CSS/At-rule -const atKeywords = uniteSets(pageMarginAtKeywords, [ - 'annotation', - 'apply', - 'character-variant', - 'charset', - 'container', - 'counter-style', - 'custom-media', - 'custom-selector', - 'document', - 'font-face', - 'font-feature-values', - 'import', - 'keyframes', - 'layer', - 'media', - 'namespace', - 'nest', - 'ornaments', - 'page', - 'property', - 'scroll-timeline', - 'styleset', - 'stylistic', - 'supports', - 'swash', - 'viewport', -]); - -module.exports = { - atKeywords, -}; diff --git a/node_modules/stylelint/lib/reference/functions.js b/node_modules/stylelint/lib/reference/functions.js deleted file mode 100644 index aedfcd3ff..000000000 --- a/node_modules/stylelint/lib/reference/functions.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -const camelCaseFunctions = new Set([ - 'translateX', - 'translateY', - 'translateZ', - 'scaleX', - 'scaleY', - 'scaleZ', - 'rotateX', - 'rotateY', - 'rotateZ', - 'skewX', - 'skewY', -]); - -const colorFunctions = new Set([ - 'color', - 'color-mix', - 'hsl', - 'hsla', - 'hwb', - 'lab', - 'lch', - 'oklab', - 'oklch', - 'rgb', - 'rgba', -]); - -const mathFunctions = new Set([ - 'abs', - 'acos', - 'asin', - 'atan', - 'atan2', - 'calc', - 'clamp', - 'cos', - 'exp', - 'hypot', - 'log', - 'max', - 'min', - 'mod', - 'pow', - 'rem', - 'round', - 'sign', - 'sin', - 'sqrt', - 'tan', -]); - -module.exports = { - camelCaseFunctions, - colorFunctions, - mathFunctions, -}; diff --git a/node_modules/stylelint/lib/reference/keywords.js b/node_modules/stylelint/lib/reference/keywords.js deleted file mode 100644 index 0a0dbdc63..000000000 --- a/node_modules/stylelint/lib/reference/keywords.js +++ /dev/null @@ -1,505 +0,0 @@ -'use strict'; - -const uniteSets = require('../utils/uniteSets.js'); - -const basicKeywords = new Set(['initial', 'inherit', 'revert', 'revert-layer', 'unset']); - -const systemFontKeywords = uniteSets(basicKeywords, [ - 'caption', - 'icon', - 'menu', - 'message-box', - 'small-caption', - 'status-bar', -]); - -const fontFamilyKeywords = uniteSets(basicKeywords, [ - 'serif', - 'sans-serif', - 'cursive', - 'fantasy', - 'monospace', - 'system-ui', - 'ui-serif', - 'ui-sans-serif', - 'ui-monospace', - 'ui-rounded', -]); - -const fontWeightRelativeKeywords = new Set(['bolder', 'lighter']); - -const fontWeightAbsoluteKeywords = new Set(['normal', 'bold']); - -const fontWeightNonNumericKeywords = uniteSets( - fontWeightRelativeKeywords, - fontWeightAbsoluteKeywords, -); - -const fontWeightNumericKeywords = new Set([ - '100', - '200', - '300', - '400', - '500', - '600', - '700', - '800', - '900', -]); - -const fontWeightKeywords = uniteSets( - basicKeywords, - fontWeightNonNumericKeywords, - fontWeightNumericKeywords, -); - -const fontStyleKeywords = uniteSets(basicKeywords, ['normal', 'italic', 'oblique']); - -const fontVariantKeywords = uniteSets(basicKeywords, [ - 'normal', - 'none', - 'historical-forms', - 'none', - 'common-ligatures', - 'no-common-ligatures', - 'discretionary-ligatures', - 'no-discretionary-ligatures', - 'historical-ligatures', - 'no-historical-ligatures', - 'contextual', - 'no-contextual', - 'small-caps', - 'small-caps', - 'all-small-caps', - 'petite-caps', - 'all-petite-caps', - 'unicase', - 'titling-caps', - 'lining-nums', - 'oldstyle-nums', - 'proportional-nums', - 'tabular-nums', - 'diagonal-fractions', - 'stacked-fractions', - 'ordinal', - 'slashed-zero', - 'jis78', - 'jis83', - 'jis90', - 'jis04', - 'simplified', - 'traditional', - 'full-width', - 'proportional-width', - 'ruby', -]); - -const fontStretchKeywords = uniteSets(basicKeywords, [ - 'semi-condensed', - 'condensed', - 'extra-condensed', - 'ultra-condensed', - 'semi-expanded', - 'expanded', - 'extra-expanded', - 'ultra-expanded', -]); - -const fontSizeKeywords = uniteSets(basicKeywords, [ - 'xx-small', - 'x-small', - 'small', - 'medium', - 'large', - 'x-large', - 'xx-large', - 'larger', - 'smaller', -]); - -const lineHeightKeywords = uniteSets(basicKeywords, ['normal']); - -const fontShorthandKeywords = uniteSets( - basicKeywords, - fontStyleKeywords, - fontVariantKeywords, - fontWeightKeywords, - fontStretchKeywords, - fontSizeKeywords, - lineHeightKeywords, - fontFamilyKeywords, -); - -const animationNameKeywords = uniteSets(basicKeywords, ['none']); - -const animationTimingFunctionKeywords = uniteSets(basicKeywords, [ - 'linear', - 'ease', - 'ease-in', - 'ease-in-out', - 'ease-out', - 'step-start', - 'step-end', - 'steps', - 'cubic-bezier', -]); - -const animationIterationCountKeywords = new Set(['infinite']); - -const animationDirectionKeywords = uniteSets(basicKeywords, [ - 'normal', - 'reverse', - 'alternate', - 'alternate-reverse', -]); - -const animationFillModeKeywords = new Set(['none', 'forwards', 'backwards', 'both']); - -const animationPlayStateKeywords = uniteSets(basicKeywords, ['running', 'paused']); - -// cf. https://developer.mozilla.org/en-US/docs/Web/CSS/animation -const animationShorthandKeywords = uniteSets( - basicKeywords, - animationNameKeywords, - animationTimingFunctionKeywords, - animationIterationCountKeywords, - animationDirectionKeywords, - animationFillModeKeywords, - animationPlayStateKeywords, -); - -const gridRowKeywords = uniteSets(basicKeywords, ['auto', 'span']); - -const gridColumnKeywords = uniteSets(basicKeywords, ['auto', 'span']); - -const gridAreaKeywords = uniteSets(basicKeywords, ['auto', 'span']); - -// https://developer.mozilla.org/docs/Web/CSS/counter-increment -const counterIncrementKeywords = uniteSets(basicKeywords, ['none']); - -const counterResetKeywords = uniteSets(basicKeywords, ['none']); - -// https://developer.mozilla.org/ru/docs/Web/CSS/list-style-type -const listStyleTypeKeywords = uniteSets(basicKeywords, [ - 'none', - 'disc', - 'circle', - 'square', - 'decimal', - 'cjk-decimal', - 'decimal-leading-zero', - 'lower-roman', - 'upper-roman', - 'lower-greek', - 'lower-alpha', - 'lower-latin', - 'upper-alpha', - 'upper-latin', - 'arabic-indic', - 'armenian', - 'bengali', - 'cambodian', - 'cjk-earthly-branch', - 'cjk-ideographic', - 'devanagari', - 'ethiopic-numeric', - 'georgian', - 'gujarati', - 'gurmukhi', - 'hebrew', - 'hiragana', - 'hiragana-iroha', - 'japanese-formal', - 'japanese-informal', - 'kannada', - 'katakana', - 'katakana-iroha', - 'khmer', - 'korean-hangul-formal', - 'korean-hanja-formal', - 'korean-hanja-informal', - 'lao', - 'lower-armenian', - 'malayalam', - 'mongolian', - 'myanmar', - 'oriya', - 'persian', - 'simp-chinese-formal', - 'simp-chinese-informal', - 'tamil', - 'telugu', - 'thai', - 'tibetan', - 'trad-chinese-formal', - 'trad-chinese-informal', - 'upper-armenian', - 'disclosure-open', - 'disclosure-closed', - // Non-standard extensions (without prefixe) - 'ethiopic-halehame', - 'ethiopic-halehame-am', - 'ethiopic-halehame-ti-er', - 'ethiopic-halehame-ti-et', - 'hangul', - 'hangul-consonant', - 'urdu', -]); - -const listStylePositionKeywords = uniteSets(basicKeywords, ['inside', 'outside']); - -const listStyleImageKeywords = uniteSets(basicKeywords, ['none']); - -const listStyleShorthandKeywords = uniteSets( - basicKeywords, - listStyleTypeKeywords, - listStylePositionKeywords, - listStyleImageKeywords, -); - -const camelCaseKeywords = new Set([ - 'optimizeSpeed', - 'optimizeQuality', - 'optimizeLegibility', - 'geometricPrecision', - 'currentColor', - 'crispEdges', - 'visiblePainted', - 'visibleFill', - 'visibleStroke', - 'sRGB', - 'linearRGB', -]); - -const keyframeSelectorKeywords = new Set(['from', 'to']); - -const systemColorsKeywords = new Set([ - // https://www.w3.org/TR/CSS22/ui.html#system-colors - 'activeborder', - 'activecaption', - 'appworkspace', - 'background', - 'buttonface', - 'buttonhighlight', - 'buttonshadow', - 'buttontext', - 'captiontext', - 'graytext', - 'highlight', - 'highlighttext', - 'inactiveborder', - 'inactivecaption', - 'inactivecaptiontext', - 'infobackground', - 'infotext', - 'menu', - 'menutext', - 'scrollbar', - 'threeddarkshadow', - 'threedface', - 'threedhighlight', - 'threedlightshadow', - 'threedshadow', - 'window', - 'windowframe', - 'windowtext', - // https://www.w3.org/TR/css-color-4/#css-system-colors - 'accentcolor', - 'accentcolortext', - 'activetext', - 'buttonborder', - 'buttonface', - 'buttontext', - 'canvas', - 'canvastext', - 'field', - 'fieldtext', - 'graytext', - 'highlight', - 'highlighttext', - 'linktext', - 'mark', - 'marktext', - 'selecteditem', - 'selecteditemtext', - 'visitedtext', -]); - -const namedColorsKeywords = new Set([ - // https://www.w3.org/TR/css-color-4/#named-colors - 'aliceblue', - 'antiquewhite', - 'aqua', - 'aquamarine', - 'azure', - 'beige', - 'bisque', - 'black', - 'blanchedalmond', - 'blue', - 'blueviolet', - 'brown', - 'burlywood', - 'cadetblue', - 'chartreuse', - 'chocolate', - 'coral', - 'cornflowerblue', - 'cornsilk', - 'crimson', - 'cyan', - 'darkblue', - 'darkcyan', - 'darkgoldenrod', - 'darkgray', - 'darkgreen', - 'darkgrey', - 'darkkhaki', - 'darkmagenta', - 'darkolivegreen', - 'darkorange', - 'darkorchid', - 'darkred', - 'darksalmon', - 'darkseagreen', - 'darkslateblue', - 'darkslategray', - 'darkslategrey', - 'darkturquoise', - 'darkviolet', - 'deeppink', - 'deepskyblue', - 'dimgray', - 'dimgrey', - 'dodgerblue', - 'firebrick', - 'floralwhite', - 'forestgreen', - 'fuchsia', - 'gainsboro', - 'ghostwhite', - 'gold', - 'goldenrod', - 'gray', - 'green', - 'greenyellow', - 'grey', - 'honeydew', - 'hotpink', - 'indianred', - 'indigo', - 'ivory', - 'khaki', - 'lavender', - 'lavenderblush', - 'lawngreen', - 'lemonchiffon', - 'lightblue', - 'lightcoral', - 'lightcyan', - 'lightgoldenrodyellow', - 'lightgray', - 'lightgreen', - 'lightgrey', - 'lightpink', - 'lightsalmon', - 'lightseagreen', - 'lightskyblue', - 'lightslategray', - 'lightslategrey', - 'lightsteelblue', - 'lightyellow', - 'lime', - 'limegreen', - 'linen', - 'magenta', - 'maroon', - 'mediumaquamarine', - 'mediumblue', - 'mediumorchid', - 'mediumpurple', - 'mediumseagreen', - 'mediumslateblue', - 'mediumspringgreen', - 'mediumturquoise', - 'mediumvioletred', - 'midnightblue', - 'mintcream', - 'mistyrose', - 'moccasin', - 'navajowhite', - 'navy', - 'oldlace', - 'olive', - 'olivedrab', - 'orange', - 'orangered', - 'orchid', - 'palegoldenrod', - 'palegreen', - 'paleturquoise', - 'palevioletred', - 'papayawhip', - 'peachpuff', - 'peru', - 'pink', - 'plum', - 'powderblue', - 'purple', - 'rebeccapurple', - 'red', - 'rosybrown', - 'royalblue', - 'saddlebrown', - 'salmon', - 'sandybrown', - 'seagreen', - 'seashell', - 'sienna', - 'silver', - 'skyblue', - 'slateblue', - 'slategray', - 'slategrey', - 'snow', - 'springgreen', - 'steelblue', - 'tan', - 'teal', - 'thistle', - 'tomato', - 'turquoise', - 'violet', - 'wheat', - 'white', - 'whitesmoke', - 'yellow', - 'yellowgreen', -]); - -module.exports = { - animationNameKeywords, - animationShorthandKeywords, - basicKeywords, - camelCaseKeywords, - counterIncrementKeywords, - counterResetKeywords, - fontFamilyKeywords, - fontShorthandKeywords, - fontSizeKeywords, - fontWeightAbsoluteKeywords, - fontWeightKeywords, - fontWeightNonNumericKeywords, - fontWeightRelativeKeywords, - gridAreaKeywords, - gridColumnKeywords, - gridRowKeywords, - keyframeSelectorKeywords, - listStyleImageKeywords, - listStylePositionKeywords, - listStyleShorthandKeywords, - listStyleTypeKeywords, - namedColorsKeywords, - systemColorsKeywords, - systemFontKeywords, -}; diff --git a/node_modules/stylelint/lib/reference/mediaFeatures.js b/node_modules/stylelint/lib/reference/mediaFeatures.js deleted file mode 100644 index 71cd63557..000000000 --- a/node_modules/stylelint/lib/reference/mediaFeatures.js +++ /dev/null @@ -1,115 +0,0 @@ -'use strict'; - -const uniteSets = require('../utils/uniteSets.js'); - -const deprecatedMediaFeatureNames = new Set([ - 'device-aspect-ratio', - 'device-height', - 'device-width', -]); - -const rangeTypeMediaFeatureNames = uniteSets(deprecatedMediaFeatureNames, [ - 'aspect-ratio', - 'color', - 'color-index', - 'height', - 'horizontal-viewport-segments', - 'monochrome', - 'resolution', - 'vertical-viewport-segments', - 'width', -]); - -const rangeTypeMediaFeatureNamesWithMinMaxPrefix = new Set( - [...rangeTypeMediaFeatureNames].flatMap((name) => { - return [`min-${name}`, `max-${name}`]; - }), -); - -const discreteTypeMediaFeatureNames = new Set([ - 'any-hover', - 'any-pointer', - 'color-gamut', - 'display-mode', - 'dynamic-range', - 'environment-blending', - 'forced-colors', - 'grid', - 'hover', - 'inverted-colors', - 'light-level', - 'nav-controls', - 'orientation', - 'overflow-block', - 'overflow-inline', - 'pointer', - 'prefers-color-scheme', - 'prefers-contrast', - 'prefers-reduced-data', - 'prefers-reduced-motion', - 'prefers-reduced-transparency', - 'scan', - 'scripting', - 'update', - 'video-color-gamut', - 'video-dynamic-range', -]); - -const mediaFeatureNames = uniteSets( - deprecatedMediaFeatureNames, - rangeTypeMediaFeatureNames, - rangeTypeMediaFeatureNamesWithMinMaxPrefix, - discreteTypeMediaFeatureNames, -); - -const mediaFeatureNameAllowedValueKeywords = new Map([ - ['any-hover', new Set(['none', 'hover'])], - ['any-pointer', new Set(['none', 'coarse', 'fine'])], - ['color-gamut', new Set(['srgb', 'p3', 'rec2020'])], - ['display-mode', new Set(['fullscreen', 'standalone', 'minimal-ui', 'browser'])], - ['dynamic-range', new Set(['standard', 'high'])], - ['environment-blending', new Set(['opaque', 'additive', 'subtractive'])], - ['forced-colors', new Set(['none', 'active'])], - ['hover', new Set(['none', 'hover'])], - ['inverted-colors', new Set(['none', 'inverted'])], - ['nav-controls', new Set(['none', 'back'])], - ['orientation', new Set(['portrait', 'landscape'])], - ['overflow-block', new Set(['none', 'scroll', 'paged'])], - ['overflow-inline', new Set(['none', 'scroll'])], - ['pointer', new Set(['none', 'coarse', 'fine'])], - ['prefers-color-scheme', new Set(['light', 'dark'])], - ['prefers-contrast', new Set(['no-preference', 'less', 'more', 'custom'])], - ['prefers-reduced-data', new Set(['no-preference', 'reduce'])], - ['prefers-reduced-motion', new Set(['no-preference', 'reduce'])], - ['prefers-reduced-transparency', new Set(['no-preference', 'reduce'])], - ['resolution', new Set(['infinite'])], - ['scan', new Set(['interlace', 'progressive'])], - ['scripting', new Set(['none', 'initial-only', 'enabled'])], - ['update', new Set(['none', 'slow', 'fast'])], - ['video-color-gamut', new Set(['srgb', 'p3', 'rec2020'])], - ['video-dynamic-range', new Set(['standard', 'high'])], -]); - -const mediaFeatureNameAllowedValueTypes = new Map([ - ['aspect-ratio', new Set(['ratio'])], - ['color', new Set(['integer'])], - ['color-index', new Set(['integer'])], - ['device-aspect-ratio', new Set(['ratio'])], - ['device-height', new Set(['length'])], - ['device-width', new Set(['length'])], - ['grid', new Set(['mq-boolean'])], - ['height', new Set(['length'])], - ['horizontal-viewport-segments', new Set(['integer'])], - ['monochrome', new Set(['integer'])], - ['resolution', new Set(['resolution'])], - ['vertical-viewport-segments', new Set(['integer'])], - ['width', new Set(['length'])], -]); - -module.exports = { - mediaFeatureNameAllowedValueKeywords, - mediaFeatureNameAllowedValueTypes, - mediaFeatureNames, - rangeTypeMediaFeatureNames, - rangeTypeMediaFeatureNamesWithMinMaxPrefix, -}; diff --git a/node_modules/stylelint/lib/reference/prefixes.js b/node_modules/stylelint/lib/reference/prefixes.js deleted file mode 100644 index 2dade4265..000000000 --- a/node_modules/stylelint/lib/reference/prefixes.js +++ /dev/null @@ -1,5 +0,0 @@ -const prefixes = new Set(['-webkit-', '-moz-', '-ms-', '-o-']); - -module.exports = { - prefixes, -}; diff --git a/node_modules/stylelint/lib/reference/properties.js b/node_modules/stylelint/lib/reference/properties.js deleted file mode 100644 index ba10ec1a0..000000000 --- a/node_modules/stylelint/lib/reference/properties.js +++ /dev/null @@ -1,399 +0,0 @@ -'use strict'; - -const acceptCustomIdentsProperties = new Set([ - 'animation', - 'animation-name', - 'font', - 'font-family', - 'counter-increment', - 'grid-row', - 'grid-column', - 'grid-area', - 'list-style', - 'list-style-type', -]); - -/** @type {import('stylelint').LonghandSubPropertiesOfShorthandProperties} */ -const longhandSubPropertiesOfShorthandProperties = new Map([ - // Sort alphabetically - [ - 'animation', - new Set([ - // prettier-ignore - 'animation-name', - 'animation-duration', - 'animation-timing-function', - 'animation-delay', - 'animation-iteration-count', - 'animation-direction', - 'animation-fill-mode', - 'animation-play-state', - ]), - ], - [ - 'background', - new Set([ - // prettier-ignore - 'background-image', - 'background-size', - 'background-position', - 'background-repeat', - 'background-origin', - 'background-clip', - 'background-attachment', - 'background-color', - ]), - ], - [ - 'border', - new Set([ - // prettier-ignore - 'border-top-width', - 'border-right-width', - 'border-bottom-width', - 'border-left-width', - 'border-top-style', - 'border-right-style', - 'border-bottom-style', - 'border-left-style', - 'border-top-color', - 'border-right-color', - 'border-bottom-color', - 'border-left-color', - ]), - ], - [ - 'border-block-end', - new Set([ - // prettier-ignore - 'border-block-end-width', - 'border-block-end-style', - 'border-block-end-color', - ]), - ], - [ - 'border-block-start', - new Set([ - // prettier-ignore - 'border-block-start-width', - 'border-block-start-style', - 'border-block-start-color', - ]), - ], - [ - 'border-bottom', - new Set([ - // prettier-ignore - 'border-bottom-width', - 'border-bottom-style', - 'border-bottom-color', - ]), - ], - [ - 'border-color', - new Set([ - // prettier-ignore - 'border-top-color', - 'border-right-color', - 'border-bottom-color', - 'border-left-color', - ]), - ], - [ - 'border-image', - new Set([ - // prettier-ignore - 'border-image-source', - 'border-image-slice', - 'border-image-width', - 'border-image-outset', - 'border-image-repeat', - ]), - ], - [ - 'border-inline-end', - new Set([ - // prettier-ignore - 'border-inline-end-width', - 'border-inline-end-style', - 'border-inline-end-color', - ]), - ], - [ - 'border-inline-start', - new Set([ - // prettier-ignore - 'border-inline-start-width', - 'border-inline-start-style', - 'border-inline-start-color', - ]), - ], - [ - 'border-left', - new Set([ - // prettier-ignore - 'border-left-width', - 'border-left-style', - 'border-left-color', - ]), - ], - [ - 'border-radius', - new Set([ - // prettier-ignore - 'border-top-left-radius', - 'border-top-right-radius', - 'border-bottom-right-radius', - 'border-bottom-left-radius', - ]), - ], - [ - 'border-right', - new Set([ - // prettier-ignore - 'border-right-width', - 'border-right-style', - 'border-right-color', - ]), - ], - [ - 'border-style', - new Set([ - // prettier-ignore - 'border-top-style', - 'border-right-style', - 'border-bottom-style', - 'border-left-style', - ]), - ], - [ - 'border-top', - new Set([ - // prettier-ignore - 'border-top-width', - 'border-top-style', - 'border-top-color', - ]), - ], - [ - 'border-width', - new Set([ - // prettier-ignore - 'border-top-width', - 'border-right-width', - 'border-bottom-width', - 'border-left-width', - ]), - ], - [ - 'column-rule', - new Set([ - // prettier-ignore - 'column-rule-width', - 'column-rule-style', - 'column-rule-color', - ]), - ], - [ - 'columns', - new Set([ - // prettier-ignore - 'column-width', - 'column-count', - ]), - ], - [ - 'flex', - new Set([ - // prettier-ignore - 'flex-grow', - 'flex-shrink', - 'flex-basis', - ]), - ], - [ - 'flex-flow', - new Set([ - // prettier-ignore - 'flex-direction', - 'flex-wrap', - ]), - ], - [ - 'font', - new Set([ - // prettier-ignore - 'font-style', - 'font-variant', - 'font-weight', - 'font-stretch', - 'font-size', - 'line-height', - 'font-family', - ]), - ], - [ - 'grid', - new Set([ - // prettier-ignore - 'grid-template-rows', - 'grid-template-columns', - 'grid-template-areas', - 'grid-auto-rows', - 'grid-auto-columns', - 'grid-auto-flow', - 'grid-column-gap', - 'grid-row-gap', - ]), - ], - [ - 'grid-area', - new Set([ - // prettier-ignore - 'grid-row-start', - 'grid-column-start', - 'grid-row-end', - 'grid-column-end', - ]), - ], - [ - 'grid-column', - new Set([ - // prettier-ignore - 'grid-column-start', - 'grid-column-end', - ]), - ], - [ - 'grid-gap', - new Set([ - // prettier-ignore - 'grid-row-gap', - 'grid-column-gap', - ]), - ], - [ - 'grid-row', - new Set([ - // prettier-ignore - 'grid-row-start', - 'grid-row-end', - ]), - ], - [ - 'grid-template', - new Set([ - // prettier-ignore - 'grid-template-columns', - 'grid-template-rows', - 'grid-template-areas', - ]), - ], - [ - 'inset', - new Set([ - // prettier-ignore - 'top', - 'right', - 'bottom', - 'left', - ]), - ], - [ - 'list-style', - new Set([ - // prettier-ignore - 'list-style-type', - 'list-style-position', - 'list-style-image', - ]), - ], - [ - 'margin', - new Set([ - // prettier-ignore - 'margin-top', - 'margin-right', - 'margin-bottom', - 'margin-left', - ]), - ], - [ - 'mask', - new Set([ - // prettier-ignore - 'mask-image', - 'mask-mode', - 'mask-position', - 'mask-size', - 'mask-repeat', - 'mask-origin', - 'mask-clip', - 'mask-composite', - ]), - ], - [ - 'outline', - new Set([ - // prettier-ignore - 'outline-color', - 'outline-style', - 'outline-width', - ]), - ], - [ - 'padding', - new Set([ - // prettier-ignore - 'padding-top', - 'padding-right', - 'padding-bottom', - 'padding-left', - ]), - ], - [ - 'text-decoration', - new Set([ - // prettier-ignore - 'text-decoration-line', - 'text-decoration-style', - 'text-decoration-color', - // TODO: add support for text-decoration-thickness, Level 4 - // https://w3c.github.io/csswg-drafts/css-text-decor-4/#text-decoration-width-property - ]), - ], - [ - 'text-emphasis', - new Set([ - // prettier-ignore - 'text-emphasis-style', - 'text-emphasis-color', - ]), - ], - [ - 'transition', - new Set([ - // prettier-ignore - 'transition-property', - 'transition-duration', - 'transition-timing-function', - 'transition-delay', - ]), - ], -]); - -const longhandTimeProperties = new Set([ - 'transition-duration', - 'transition-delay', - 'animation-duration', - 'animation-delay', -]); - -const shorthandTimeProperties = new Set(['transition', 'animation']); - -module.exports = { - acceptCustomIdentsProperties, - longhandSubPropertiesOfShorthandProperties, - longhandTimeProperties, - shorthandTimeProperties, -}; diff --git a/node_modules/stylelint/lib/reference/selectors.js b/node_modules/stylelint/lib/reference/selectors.js deleted file mode 100644 index 5acfb7718..000000000 --- a/node_modules/stylelint/lib/reference/selectors.js +++ /dev/null @@ -1,320 +0,0 @@ -'use strict'; - -const htmlTags = require('html-tags'); -const uniteSets = require('../utils/uniteSets.js'); - -const deprecatedHtmlTypeSelectors = new Set([ - 'acronym', - 'applet', - 'basefont', - 'big', - 'blink', - 'center', - 'content', - 'dir', - 'font', - 'frame', - 'frameset', - 'hgroup', - 'isindex', - 'keygen', - 'listing', - 'marquee', - 'nobr', - 'noembed', - 'plaintext', - 'spacer', - 'strike', - 'tt', - 'xmp', -]); - -// typecasting htmlTags to be more generic; see https://github.com/stylelint/stylelint/pull/6013 for discussion -/** @type {Set} */ -const standardHtmlTypeSelectors = new Set(htmlTags); - -const htmlTypeSelectors = uniteSets(deprecatedHtmlTypeSelectors, standardHtmlTypeSelectors); - -const mixedCaseSvgTypeSelectors = new Set([ - 'altGlyph', - 'altGlyphDef', - 'altGlyphItem', - 'animateColor', - 'animateMotion', - 'animateTransform', - 'clipPath', - 'feBlend', - 'feColorMatrix', - 'feComponentTransfer', - 'feComposite', - 'feConvolveMatrix', - 'feDiffuseLighting', - 'feDisplacementMap', - 'feDistantLight', - 'feDropShadow', - 'feFlood', - 'feFuncA', - 'feFuncB', - 'feFuncG', - 'feFuncR', - 'feGaussianBlur', - 'feImage', - 'feMerge', - 'feMergeNode', - 'feMorphology', - 'feOffset', - 'fePointLight', - 'feSpecularLighting', - 'feSpotLight', - 'feTile', - 'feTurbulence', - 'foreignObject', - 'glyphRef', - 'linearGradient', - 'radialGradient', - 'textPath', -]); - -// These are the ones that can have single-colon notation -const levelOneAndTwoPseudoElements = new Set(['before', 'after', 'first-line', 'first-letter']); - -const shadowTreePseudoElements = new Set(['part']); - -const webkitScrollbarPseudoElements = new Set([ - '-webkit-resizer', - '-webkit-scrollbar', - '-webkit-scrollbar-button', - '-webkit-scrollbar-corner', - '-webkit-scrollbar-thumb', - '-webkit-scrollbar-track', - '-webkit-scrollbar-track-piece', -]); - -const vendorSpecificPseudoElements = uniteSets(webkitScrollbarPseudoElements, [ - '-moz-focus-inner', - '-moz-focus-outer', - '-moz-list-bullet', - '-moz-meter-bar', - '-moz-placeholder', - '-moz-progress-bar', - '-moz-range-progress', - '-moz-range-thumb', - '-moz-range-track', - '-ms-browse', - '-ms-check', - '-ms-clear', - '-ms-expand', - '-ms-fill', - '-ms-fill-lower', - '-ms-fill-upper', - '-ms-reveal', - '-ms-thumb', - '-ms-ticks-after', - '-ms-ticks-before', - '-ms-tooltip', - '-ms-track', - '-ms-value', - '-webkit-color-swatch', - '-webkit-color-swatch-wrapper', - '-webkit-calendar-picker-indicator', - '-webkit-clear-button', - '-webkit-date-and-time-value', - '-webkit-datetime-edit', - '-webkit-datetime-edit-ampm-field', - '-webkit-datetime-edit-day-field', - '-webkit-datetime-edit-fields-wrapper', - '-webkit-datetime-edit-hour-field', - '-webkit-datetime-edit-millisecond-field', - '-webkit-datetime-edit-minute-field', - '-webkit-datetime-edit-month-field', - '-webkit-datetime-edit-second-field', - '-webkit-datetime-edit-text', - '-webkit-datetime-edit-week-field', - '-webkit-datetime-edit-year-field', - '-webkit-details-marker', - '-webkit-distributed', - '-webkit-file-upload-button', - '-webkit-input-placeholder', - '-webkit-keygen-select', - '-webkit-meter-bar', - '-webkit-meter-even-less-good-value', - '-webkit-meter-inner-element', - '-webkit-meter-optimum-value', - '-webkit-meter-suboptimum-value', - '-webkit-progress-bar', - '-webkit-progress-inner-element', - '-webkit-progress-value', - '-webkit-search-cancel-button', - '-webkit-search-decoration', - '-webkit-search-results-button', - '-webkit-search-results-decoration', - '-webkit-slider-runnable-track', - '-webkit-slider-thumb', - '-webkit-textfield-decoration-container', - '-webkit-validation-bubble', - '-webkit-validation-bubble-arrow', - '-webkit-validation-bubble-arrow-clipper', - '-webkit-validation-bubble-heading', - '-webkit-validation-bubble-message', - '-webkit-validation-bubble-text-block', -]); - -const pseudoElements = uniteSets( - levelOneAndTwoPseudoElements, - vendorSpecificPseudoElements, - shadowTreePseudoElements, - [ - 'backdrop', - 'content', - 'cue', - 'file-selector-button', - 'grammar-error', - 'highlight', - 'marker', - 'placeholder', - 'selection', - 'shadow', - 'slotted', - 'spelling-error', - 'target-text', - ], -); - -const aNPlusBNotationPseudoClasses = new Set([ - 'nth-column', - 'nth-last-column', - 'nth-last-of-type', - 'nth-of-type', -]); - -const aNPlusBOfSNotationPseudoClasses = new Set(['nth-child', 'nth-last-child']); - -const atRulePagePseudoClasses = new Set(['first', 'right', 'left', 'blank']); - -const linguisticPseudoClasses = new Set(['dir', 'lang']); - -const logicalCombinationsPseudoClasses = new Set(['has', 'is', 'matches', 'not', 'where']); - -const vendorSpecificPseudoClasses = new Set([ - '-khtml-drag', - '-moz-any', - '-moz-any-link', - '-moz-broken', - '-moz-drag-over', - '-moz-first-node', - '-moz-focusring', - '-moz-full-screen', - '-moz-full-screen-ancestor', - '-moz-last-node', - '-moz-loading', - '-moz-meter-optimum', - '-moz-meter-sub-optimum', - '-moz-meter-sub-sub-optimum', - '-moz-placeholder', - '-moz-submit-invalid', - '-moz-suppressed', - '-moz-ui-invalid', - '-moz-ui-valid', - '-moz-user-disabled', - '-moz-window-inactive', - '-ms-fullscreen', - '-ms-input-placeholder', - '-webkit-drag', - '-webkit-any', - '-webkit-any-link', - '-webkit-autofill', - '-webkit-full-screen', - '-webkit-full-screen-ancestor', -]); - -// https://webkit.org/blog/363/styling-scrollbars/ -const webkitScrollbarPseudoClasses = new Set([ - 'horizontal', - 'vertical', - 'decrement', - 'increment', - 'start', - 'end', - 'double-button', - 'single-button', - 'no-button', - 'corner-present', - 'window-inactive', -]); - -const pseudoClasses = uniteSets( - aNPlusBNotationPseudoClasses, - linguisticPseudoClasses, - logicalCombinationsPseudoClasses, - aNPlusBOfSNotationPseudoClasses, - vendorSpecificPseudoClasses, - [ - 'active', - 'any-link', - 'autofill', - 'blank', - 'checked', - 'current', - 'default', - 'defined', - 'disabled', - 'empty', - 'enabled', - 'first-child', - 'first-of-type', - 'focus', - 'focus-within', - 'focus-visible', - 'fullscreen', - 'fullscreen-ancestor', - 'future', - 'host', - 'host-context', - 'hover', - 'indeterminate', - 'in-range', - 'invalid', - 'last-child', - 'last-of-type', - 'link', - 'modal', - 'only-child', - 'only-of-type', - 'optional', - 'out-of-range', - 'past', - 'placeholder-shown', - 'playing', - 'picture-in-picture', - 'paused', - 'read-only', - 'read-write', - 'required', - 'root', - 'scope', - 'state', - 'target', - 'unresolved', - 'user-invalid', - 'user-valid', - 'valid', - 'visited', - 'window-inactive', // for ::selection (chrome) - ], -); - -module.exports = { - aNPlusBNotationPseudoClasses, - aNPlusBOfSNotationPseudoClasses, - atRulePagePseudoClasses, - levelOneAndTwoPseudoElements, - linguisticPseudoClasses, - logicalCombinationsPseudoClasses, - mixedCaseSvgTypeSelectors, - pseudoClasses, - pseudoElements, - shadowTreePseudoElements, - htmlTypeSelectors, - webkitScrollbarPseudoClasses, - webkitScrollbarPseudoElements, -}; diff --git a/node_modules/stylelint/lib/reference/units.js b/node_modules/stylelint/lib/reference/units.js deleted file mode 100644 index aaadd4ce1..000000000 --- a/node_modules/stylelint/lib/reference/units.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -const uniteSets = require('../utils/uniteSets.js'); - -const lengthUnits = new Set([ - // Font-relative length units - 'cap', - 'ch', - 'em', - 'ex', - 'ic', - 'lh', - 'rcap', - 'rch', - 'rem', - 'rex', - 'ric', - 'rlh', - // Viewport-percentage lengths - 'dvb', - 'dvh', - 'dvi', - 'dvmax', - 'dvmin', - 'dvw', - 'lvb', - 'lvh', - 'lvi', - 'lvmax', - 'lvmin', - 'lvw', - 'svb', - 'svh', - 'svi', - 'svmax', - 'svmin', - 'svw', - 'vb', - 'vh', - 'vi', - 'vw', - 'vmin', - 'vmax', - 'vm', - // Absolute length units - 'px', - 'mm', - 'cm', - 'in', - 'pt', - 'pc', - 'q', - 'mozmm', - // Flexible length units - 'fr', - // Container query units - 'cqw', - 'cqh', - 'cqi', - 'cqb', - 'cqmin', - 'cqmax', -]); - -const resolutionUnits = new Set(['dpi', 'dpcm', 'dppx', 'x']); - -const units = uniteSets(lengthUnits, resolutionUnits, [ - // Relative length units - '%', - // Time length units - 's', - 'ms', - // Angle - 'deg', - 'grad', - 'turn', - 'rad', - // Frequency - 'Hz', - 'kHz', -]); - -module.exports = { - lengthUnits, - resolutionUnits, - units, -}; diff --git a/node_modules/stylelint/lib/reportDisables.js b/node_modules/stylelint/lib/reportDisables.js deleted file mode 100644 index 1abf008ff..000000000 --- a/node_modules/stylelint/lib/reportDisables.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -/** @typedef {import('stylelint').DisableReportRange} DisabledRange */ -/** @typedef {import('stylelint').LintResult} StylelintResult */ -/** @typedef {import('stylelint').ConfigRuleSettings} StylelintConfigRuleSettings */ - -/** - * Returns a report describing which `results` (if any) contain disabled ranges - * for rules that disallow disables via `reportDisables: true`. - * - * @param {StylelintResult[]} results - */ -module.exports = function reportDisables(results) { - for (const result of results) { - // File with `CssSyntaxError` don't have `_postcssResult`s. - if (!result._postcssResult) { - continue; - } - - const rangeData = result._postcssResult.stylelint.disabledRanges; - - if (!rangeData) continue; - - const config = result._postcssResult.stylelint.config; - - if (!config || !config.rules) continue; - - // If no rules actually disallow disables, don't bother looking for ranges - // that correspond to disabled rules. - if (!Object.values(config.rules).some((rule) => reportDisablesForRule(rule))) { - continue; - } - - for (const [rule, ranges] of Object.entries(rangeData)) { - for (const range of ranges) { - if (!reportDisablesForRule(config.rules[rule] || [])) continue; - - // If the comment doesn't have a location, we can't report a useful error. - // In practice we expect all comments to have locations, though. - if (!range.comment.source || !range.comment.source.start) continue; - - result.warnings.push({ - text: `Rule "${rule}" may not be disabled`, - rule: 'reportDisables', - line: range.comment.source.start.line, - column: range.comment.source.start.column, - endLine: range.comment.source.end && range.comment.source.end.line, - endColumn: range.comment.source.end && range.comment.source.end.column, - severity: 'error', - }); - } - } - } -}; - -/** - * @param {StylelintConfigRuleSettings} options - * @return {boolean} - */ -function reportDisablesForRule(options) { - if (!options || !options[1]) return false; - - return Boolean(options[1].reportDisables); -} diff --git a/node_modules/stylelint/lib/reportUnknownRuleNames.js b/node_modules/stylelint/lib/reportUnknownRuleNames.js deleted file mode 100644 index 3f5a1c07f..000000000 --- a/node_modules/stylelint/lib/reportUnknownRuleNames.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -const levenshtein = require('fastest-levenshtein'); -const rules = require('./rules'); - -const MAX_LEVENSHTEIN_DISTANCE = 6; -const MAX_SUGGESTIONS_COUNT = 3; - -/** - * @param {string} ruleName - * @return {string[]} - */ -function extractSuggestions(ruleName) { - const suggestions = Array.from({ length: MAX_LEVENSHTEIN_DISTANCE }); - - for (let i = 0; i < suggestions.length; i++) { - suggestions[i] = []; - } - - for (const existRuleName of Object.keys(rules)) { - const distance = levenshtein.distance(existRuleName, ruleName); - - if (distance <= MAX_LEVENSHTEIN_DISTANCE) { - suggestions[distance - 1].push(existRuleName); - } - } - - /** @type {string[]} */ - let result = []; - - for (const [i, suggestion] of suggestions.entries()) { - if (suggestion.length > 0) { - if (i < 3) { - return suggestion.slice(0, MAX_SUGGESTIONS_COUNT); - } - - result = result.concat(suggestion); - } - } - - return result.slice(0, MAX_SUGGESTIONS_COUNT); -} - -/** - * @param {string} ruleName - * @param {string[]} [suggestions=[]] - * @return {string} - */ -function rejectMessage(ruleName, suggestions = []) { - return `Unknown rule ${ruleName}.${ - suggestions.length > 0 ? ` Did you mean ${suggestions.join(', ')}?` : '' - }`; -} - -/** @type {Map} */ -const cache = new Map(); - -/** - * @param {string} unknownRuleName - * @param {import('postcss').Root} postcssRoot - * @param {import('stylelint').PostcssResult} postcssResult - * @returns {void} - */ -module.exports = function reportUnknownRuleNames(unknownRuleName, postcssRoot, postcssResult) { - const suggestions = cache.has(unknownRuleName) - ? /** @type {string[]} */ (cache.get(unknownRuleName)) - : extractSuggestions(unknownRuleName); - - cache.set(unknownRuleName, suggestions); - postcssResult.warn(rejectMessage(unknownRuleName, suggestions), { - severity: 'error', - rule: unknownRuleName, - node: postcssRoot, - index: 0, - }); -}; diff --git a/node_modules/stylelint/lib/resolveConfig.js b/node_modules/stylelint/lib/resolveConfig.js deleted file mode 100644 index 5f710674a..000000000 --- a/node_modules/stylelint/lib/resolveConfig.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -const path = require('path'); - -const createStylelint = require('./createStylelint'); -const getConfigForFile = require('./getConfigForFile'); - -/** - * @type {import('stylelint')['resolveConfig']} - */ -module.exports = async function resolveConfig( - filePath, - { cwd = process.cwd(), config, configBasedir, configFile } = {}, -) { - if (!filePath) { - return undefined; - } - - const stylelint = createStylelint({ - config, - configFile, - configBasedir, - cwd, - }); - - const absoluteFilePath = !path.isAbsolute(filePath) - ? path.join(cwd, filePath) - : path.normalize(filePath); - - const configSearchPath = stylelint._options.configFile || absoluteFilePath; - - const resolved = await getConfigForFile(stylelint, configSearchPath, absoluteFilePath); - - if (!resolved) { - return undefined; - } - - return resolved.config; -}; diff --git a/node_modules/stylelint/lib/resolveCustomFormatter.js b/node_modules/stylelint/lib/resolveCustomFormatter.js deleted file mode 100644 index f2c798caf..000000000 --- a/node_modules/stylelint/lib/resolveCustomFormatter.js +++ /dev/null @@ -1,16 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -/** - * @param {string} formatterPath - * @returns {string} - */ -module.exports = function resolveCustomFormatter(formatterPath) { - const resolvedPath = path.resolve(formatterPath); - - if (fs.existsSync(resolvedPath)) { - return resolvedPath; - } - - return require.resolve(formatterPath); -}; diff --git a/node_modules/stylelint/lib/rules/alpha-value-notation/index.js b/node_modules/stylelint/lib/rules/alpha-value-notation/index.js deleted file mode 100644 index 3bb297e41..000000000 --- a/node_modules/stylelint/lib/rules/alpha-value-notation/index.js +++ /dev/null @@ -1,227 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString, assert } = require('../../utils/validateTypes'); - -const ruleName = 'alpha-value-notation'; - -const messages = ruleMessages(ruleName, { - expected: (unfixed, fixed) => `Expected "${unfixed}" to be "${fixed}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/alpha-value-notation', - fixable: true, -}; - -const ALPHA_PROPS = - /^(?:opacity|shape-image-threshold|fill-opacity|flood-opacity|stop-opacity|stroke-opacity)$/i; -const ALPHA_FUNCTION = /(?:color|hsla?|rgba?|hwb|lab|lch|oklab|oklch)\(/i; -const ALPHA_FUNCTION_NAME = /^(?:color|hsla?|rgba?|hwb|lab|lch|oklab|oklch)$/i; -const DIGIT = /\d/; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['number', 'percentage'], - }, - { - actual: secondaryOptions, - possible: { - exceptProperties: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) return; - - const optionFuncs = Object.freeze({ - number: { - expFunc: isNumber, - fixFunc: asNumber, - }, - percentage: { - expFunc: isPercentage, - fixFunc: asPercentage, - }, - }); - - root.walkDecls((decl) => { - const declarationValue = getDeclarationValue(decl); - const isAlphaProp = ALPHA_PROPS.test(decl.prop); - - if ( - // If the property is not an alpha property - (!isAlphaProp && - // And the value is not an alpha function - !ALPHA_FUNCTION.test(declarationValue)) || - // Or the value does not contain digits - !DIGIT.test(declarationValue) - ) { - // Abort early - return; - } - - let needsFix = false; - const parsedValue = valueParser(declarationValue); - - parsedValue.walk((node) => { - /** @type {import('postcss-value-parser').Node | undefined} */ - let alpha; - - if (isAlphaProp && DIGIT.test(node.value)) { - alpha = findAlphaInValue(node); - } else if (node.type === 'function' && ALPHA_FUNCTION_NAME.test(node.value)) { - alpha = findAlphaInFunction(node); - } - - if (!alpha) return; - - const { value } = alpha; - - if (!isStandardSyntaxValue(value)) return; - - if (!isNumber(value) && !isPercentage(value)) return; - - /** @type {'number' | 'percentage'} */ - let expectation = primary; - - if (optionsMatches(secondaryOptions, 'exceptProperties', decl.prop)) { - if (expectation === 'number') { - expectation = 'percentage'; - } else if (expectation === 'percentage') { - expectation = 'number'; - } - } - - if (optionFuncs[expectation].expFunc(value)) return; - - const fixed = optionFuncs[expectation].fixFunc(value); - const unfixed = value; - - if (context.fix) { - alpha.value = String(fixed); - needsFix = true; - - return; - } - - const index = declarationValueIndex(decl) + alpha.sourceIndex; - const endIndex = index + alpha.value.length; - - report({ - message: messages.expected, - messageArgs: [unfixed, fixed], - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - - if (needsFix) { - setDeclarationValue(decl, parsedValue.toString()); - } - }); - }; -}; - -/** - * @param {string} value - * @returns {string} - */ -function asPercentage(value) { - const number = Number(value); - - return `${Number((number * 100).toPrecision(3))}%`; -} - -/** - * @param {string} value - * @returns {string} - */ -function asNumber(value) { - const dimension = valueParser.unit(value); - - assert(dimension); - - const number = Number(dimension.number); - - return Number((number / 100).toPrecision(3)).toString(); -} - -/** - * @template {import('postcss-value-parser').Node} T - * @param {T} node - * @returns {T | undefined} - */ -function findAlphaInValue(node) { - return node.type === 'word' || node.type === 'function' ? node : undefined; -} - -/** - * @param {import('postcss-value-parser').FunctionNode} node - * @returns {import('postcss-value-parser').Node | undefined} - */ -function findAlphaInFunction(node) { - const legacySyntax = node.nodes.some(({ type, value }) => type === 'div' && value === ','); - - if (legacySyntax) { - const args = node.nodes.filter(({ type }) => type === 'word' || type === 'function'); - - if (args.length === 4) return args[3]; - - return undefined; - } - - const slashNodeIndex = node.nodes.findIndex(({ type, value }) => type === 'div' && value === '/'); - - if (slashNodeIndex !== -1) { - const nodesAfterSlash = node.nodes.slice(slashNodeIndex + 1, node.nodes.length); - - return nodesAfterSlash.find(({ type }) => type === 'word'); - } - - return undefined; -} - -/** - * @param {string} value - * @returns {boolean} - */ -function isPercentage(value) { - const dimension = valueParser.unit(value); - - return dimension && dimension.unit === '%'; -} - -/** - * @param {string} value - * @returns {boolean} - */ -function isNumber(value) { - const dimension = valueParser.unit(value); - - return dimension && dimension.unit === ''; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/annotation-no-unknown/index.js b/node_modules/stylelint/lib/rules/annotation-no-unknown/index.js deleted file mode 100644 index a1a187f19..000000000 --- a/node_modules/stylelint/lib/rules/annotation-no-unknown/index.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'annotation-no-unknown'; - -const messages = ruleMessages(ruleName, { - rejected: (annotation) => `Unexpected unknown annotation "${annotation}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/annotation-no-unknown', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignoreAnnotations: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkDecls(checkStatement); - - /** - * @param {import('postcss').Declaration} decl - */ - function checkStatement(decl) { - if (!isStandardSyntaxValue(decl.value)) return; - - if (decl.important) return; - - if (!decl.value.includes('!')) return; - - const parsedValue = valueParser(getDeclarationValue(decl)); - - parsedValue.walk((node) => { - if (!isAnnotation(node)) return; - - const value = node.value; - const tokenValue = value.slice(1); - - if (optionsMatches(secondaryOptions, 'ignoreAnnotations', tokenValue)) { - return; - } - - report({ - message: messages.rejected, - messageArgs: [value], - node: decl, - result, - ruleName, - word: value, - }); - }); - } - - /** - * @param {valueParser.Node} node - */ - function isAnnotation(node) { - return node.type === 'word' && node.value.startsWith('!'); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-allowed-list/index.js b/node_modules/stylelint/lib/rules/at-rule-allowed-list/index.js deleted file mode 100644 index 98d9181ab..000000000 --- a/node_modules/stylelint/lib/rules/at-rule-allowed-list/index.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isString } = require('../../utils/validateTypes'); - -const ruleName = 'at-rule-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (name) => `Unexpected at-rule "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/at-rule-allowed-list', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString], - }); - - if (!validOptions) { - return; - } - - const primaryValues = [primary].flat(); - - root.walkAtRules((atRule) => { - const name = atRule.name; - - if (!isStandardSyntaxAtRule(atRule)) { - return; - } - - if (primaryValues.includes(vendor.unprefixed(name).toLowerCase())) { - return; - } - - report({ - message: messages.rejected, - messageArgs: [name], - node: atRule, - result, - ruleName, - word: `@${name}`, - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-disallowed-list/index.js b/node_modules/stylelint/lib/rules/at-rule-disallowed-list/index.js deleted file mode 100644 index a59a74289..000000000 --- a/node_modules/stylelint/lib/rules/at-rule-disallowed-list/index.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isString } = require('../../utils/validateTypes'); - -const ruleName = 'at-rule-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (name) => `Unexpected at-rule "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/at-rule-disallowed-list', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString], - }); - - if (!validOptions) { - return; - } - - const primaryValues = [primary].flat(); - - root.walkAtRules((atRule) => { - const name = atRule.name; - - if (!isStandardSyntaxAtRule(atRule)) { - return; - } - - if (!primaryValues.includes(vendor.unprefixed(name).toLowerCase())) { - return; - } - - report({ - message: messages.rejected, - messageArgs: [name], - node: atRule, - result, - ruleName, - word: `@${atRule.name}`, - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-empty-line-before/index.js b/node_modules/stylelint/lib/rules/at-rule-empty-line-before/index.js deleted file mode 100644 index 8c5df6832..000000000 --- a/node_modules/stylelint/lib/rules/at-rule-empty-line-before/index.js +++ /dev/null @@ -1,173 +0,0 @@ -'use strict'; - -const addEmptyLineBefore = require('../../utils/addEmptyLineBefore'); -const getPreviousNonSharedLineCommentNode = require('../../utils/getPreviousNonSharedLineCommentNode'); -const hasEmptyLine = require('../../utils/hasEmptyLine'); -const isAfterComment = require('../../utils/isAfterComment'); -const isBlocklessAtRuleAfterBlocklessAtRule = require('../../utils/isBlocklessAtRuleAfterBlocklessAtRule'); -const isBlocklessAtRuleAfterSameNameBlocklessAtRule = require('../../utils/isBlocklessAtRuleAfterSameNameBlocklessAtRule'); -const isFirstNested = require('../../utils/isFirstNested'); -const isFirstNodeOfRoot = require('../../utils/isFirstNodeOfRoot'); -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const optionsMatches = require('../../utils/optionsMatches'); -const removeEmptyLinesBefore = require('../../utils/removeEmptyLinesBefore'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const { isAtRule } = require('../../utils/typeGuards'); -const validateOptions = require('../../utils/validateOptions'); -const { isString } = require('../../utils/validateTypes'); - -const ruleName = 'at-rule-empty-line-before'; - -const messages = ruleMessages(ruleName, { - expected: 'Expected empty line before at-rule', - rejected: 'Unexpected empty line before at-rule', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/at-rule-empty-line-before', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['always', 'never'], - }, - { - actual: secondaryOptions, - possible: { - except: [ - 'after-same-name', - 'inside-block', - 'blockless-after-same-name-blockless', - 'blockless-after-blockless', - 'first-nested', - ], - ignore: [ - 'after-comment', - 'first-nested', - 'inside-block', - 'blockless-after-same-name-blockless', - 'blockless-after-blockless', - ], - ignoreAtRules: [isString], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - /** @type {'always' | 'never'} */ - const expectation = primary; - - root.walkAtRules((atRule) => { - const isNested = atRule.parent && atRule.parent.type !== 'root'; - - // Ignore the first node - if (isFirstNodeOfRoot(atRule)) { - return; - } - - if (!isStandardSyntaxAtRule(atRule)) { - return; - } - - // Return early if at-rule is to be ignored - if (optionsMatches(secondaryOptions, 'ignoreAtRules', atRule.name)) { - return; - } - - // Optionally ignore the expectation if the node is blockless - if ( - optionsMatches(secondaryOptions, 'ignore', 'blockless-after-blockless') && - isBlocklessAtRuleAfterBlocklessAtRule(atRule) - ) { - return; - } - - // Optionally ignore the node if it is the first nested - if (optionsMatches(secondaryOptions, 'ignore', 'first-nested') && isFirstNested(atRule)) { - return; - } - - // Optionally ignore the expectation if the node is blockless - // and following another blockless at-rule with the same name - if ( - optionsMatches(secondaryOptions, 'ignore', 'blockless-after-same-name-blockless') && - isBlocklessAtRuleAfterSameNameBlocklessAtRule(atRule) - ) { - return; - } - - // Optionally ignore the expectation if the node is inside a block - if (optionsMatches(secondaryOptions, 'ignore', 'inside-block') && isNested) { - return; - } - - // Optionally ignore the expectation if a comment precedes this node - if (optionsMatches(secondaryOptions, 'ignore', 'after-comment') && isAfterComment(atRule)) { - return; - } - - const hasEmptyLineBefore = hasEmptyLine(atRule.raws.before); - let expectEmptyLineBefore = expectation === 'always'; - - // Optionally reverse the expectation if any exceptions apply - if ( - (optionsMatches(secondaryOptions, 'except', 'after-same-name') && - isAtRuleAfterSameNameAtRule(atRule)) || - (optionsMatches(secondaryOptions, 'except', 'inside-block') && isNested) || - (optionsMatches(secondaryOptions, 'except', 'first-nested') && isFirstNested(atRule)) || - (optionsMatches(secondaryOptions, 'except', 'blockless-after-blockless') && - isBlocklessAtRuleAfterBlocklessAtRule(atRule)) || - (optionsMatches(secondaryOptions, 'except', 'blockless-after-same-name-blockless') && - isBlocklessAtRuleAfterSameNameBlocklessAtRule(atRule)) - ) { - expectEmptyLineBefore = !expectEmptyLineBefore; - } - - // Return if the expectation is met - if (expectEmptyLineBefore === hasEmptyLineBefore) { - return; - } - - // Fix - if (context.fix && context.newline) { - if (expectEmptyLineBefore) { - addEmptyLineBefore(atRule, context.newline); - } else { - removeEmptyLinesBefore(atRule, context.newline); - } - - return; - } - - const message = expectEmptyLineBefore ? messages.expected : messages.rejected; - - report({ message, node: atRule, result, ruleName }); - }); - }; -}; - -/** - * @param {import('postcss').AtRule} atRule - */ -function isAtRuleAfterSameNameAtRule(atRule) { - const previousNode = getPreviousNonSharedLineCommentNode(atRule); - - return previousNode && isAtRule(previousNode) && previousNode.name === atRule.name; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-name-case/index.js b/node_modules/stylelint/lib/rules/at-rule-name-case/index.js deleted file mode 100644 index fd73f4651..000000000 --- a/node_modules/stylelint/lib/rules/at-rule-name-case/index.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'at-rule-name-case'; - -const messages = ruleMessages(ruleName, { - expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/at-rule-name-case', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondary, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['lower', 'upper'], - }); - - if (!validOptions) { - return; - } - - /** @type {'lower' | 'upper'} */ - const expectation = primary; - - root.walkAtRules((atRule) => { - if (!isStandardSyntaxAtRule(atRule)) { - return; - } - - const name = atRule.name; - - const expectedName = expectation === 'lower' ? name.toLowerCase() : name.toUpperCase(); - - if (name === expectedName) { - return; - } - - if (context.fix) { - atRule.name = expectedName; - - return; - } - - report({ - message: messages.expected(name, expectedName), - node: atRule, - ruleName, - result, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-name-newline-after/index.js b/node_modules/stylelint/lib/rules/at-rule-name-newline-after/index.js deleted file mode 100644 index d04dbb312..000000000 --- a/node_modules/stylelint/lib/rules/at-rule-name-newline-after/index.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -const atRuleNameSpaceChecker = require('../atRuleNameSpaceChecker'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'at-rule-name-newline-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: (name) => `Expected newline after at-rule name "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/at-rule-name-newline-after', - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line'], - }); - - if (!validOptions) { - return; - } - - atRuleNameSpaceChecker({ - root, - result, - locationChecker: checker.afterOneOnly, - checkedRuleName: ruleName, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-name-space-after/index.js b/node_modules/stylelint/lib/rules/at-rule-name-space-after/index.js deleted file mode 100644 index 473457dc7..000000000 --- a/node_modules/stylelint/lib/rules/at-rule-name-space-after/index.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -const atRuleNameSpaceChecker = require('../atRuleNameSpaceChecker'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'at-rule-name-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: (name) => `Expected single space after at-rule name "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/at-rule-name-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondary, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-single-line'], - }); - - if (!validOptions) { - return; - } - - atRuleNameSpaceChecker({ - root, - result, - locationChecker: checker.after, - checkedRuleName: ruleName, - fix: context.fix - ? (atRule) => { - if (typeof atRule.raws.afterName === 'string') { - atRule.raws.afterName = atRule.raws.afterName.replace(/^\s*/, ' '); - } - } - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-no-unknown/index.js b/node_modules/stylelint/lib/rules/at-rule-no-unknown/index.js deleted file mode 100644 index 58cdeaab7..000000000 --- a/node_modules/stylelint/lib/rules/at-rule-no-unknown/index.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const { atKeywords } = require('../../reference/atKeywords'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'at-rule-no-unknown'; - -const messages = ruleMessages(ruleName, { - rejected: (atRule) => `Unexpected unknown at-rule "${atRule}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/at-rule-no-unknown', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignoreAtRules: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkAtRules((atRule) => { - if (!isStandardSyntaxAtRule(atRule)) { - return; - } - - const name = atRule.name; - - // Return early if at-rule is to be ignored - if (optionsMatches(secondaryOptions, 'ignoreAtRules', atRule.name)) { - return; - } - - if (vendor.prefix(name) || atKeywords.has(name.toLowerCase())) { - return; - } - - const atName = `@${name}`; - - report({ - message: messages.rejected, - messageArgs: [atName], - node: atRule, - ruleName, - result, - word: atName, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-no-vendor-prefix/index.js b/node_modules/stylelint/lib/rules/at-rule-no-vendor-prefix/index.js deleted file mode 100644 index 38a3e99f6..000000000 --- a/node_modules/stylelint/lib/rules/at-rule-no-vendor-prefix/index.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -const isAutoprefixable = require('../../utils/isAutoprefixable'); -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'at-rule-no-vendor-prefix'; - -const messages = ruleMessages(ruleName, { - rejected: (p) => `Unexpected vendor-prefixed at-rule "@${p}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/at-rule-no-vendor-prefix', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondary, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkAtRules((atRule) => { - if (!isStandardSyntaxAtRule(atRule)) { - return; - } - - const name = atRule.name; - - if (!name.startsWith('-')) { - return; - } - - if (!isAutoprefixable.atRuleName(name)) { - return; - } - - if (context.fix) { - atRule.name = isAutoprefixable.unprefix(atRule.name); - - return; - } - - report({ - message: messages.rejected, - messageArgs: [name], - node: atRule, - word: `@${name}`, - result, - ruleName, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-property-required-list/index.js b/node_modules/stylelint/lib/rules/at-rule-property-required-list/index.js deleted file mode 100644 index a093305a1..000000000 --- a/node_modules/stylelint/lib/rules/at-rule-property-required-list/index.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -const createMapWithSet = require('../../utils/createMapWithSet'); -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); -const validateOptions = require('../../utils/validateOptions'); -const { isString } = require('../../utils/validateTypes'); - -const ruleName = 'at-rule-property-required-list'; - -const messages = ruleMessages(ruleName, { - expected: (atRule, property) => `Expected property "${property}" for at-rule "${atRule}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/at-rule-property-required-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [validateObjectWithArrayProps(isString)], - }); - - if (!validOptions) { - return; - } - - const propLists = createMapWithSet(primary); - - /** @type {Set} */ - const currentPropList = new Set(); - - root.walkAtRules((atRule) => { - if (!isStandardSyntaxAtRule(atRule)) { - return; - } - - const { name, nodes } = atRule; - const atRuleName = name.toLowerCase(); - const propList = propLists.get(atRuleName); - - if (!propList) { - return; - } - - currentPropList.clear(); - - for (const node of nodes) { - if (!node || node.type !== 'decl') continue; - - const propName = node.prop.toLowerCase(); - - if (!propList.has(propName)) continue; - - currentPropList.add(propName); - } - - if (currentPropList.size === propList.size) { - return; - } - - for (const requiredProp of propList) { - if (currentPropList.has(requiredProp)) continue; - - report({ - message: messages.expected, - messageArgs: [atRuleName, requiredProp], - node: atRule, - word: `@${atRule.name}`, - result, - ruleName, - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-semicolon-newline-after/index.js b/node_modules/stylelint/lib/rules/at-rule-semicolon-newline-after/index.js deleted file mode 100644 index 0b93de65a..000000000 --- a/node_modules/stylelint/lib/rules/at-rule-semicolon-newline-after/index.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -const hasBlock = require('../../utils/hasBlock'); -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const nextNonCommentNode = require('../../utils/nextNonCommentNode'); -const rawNodeString = require('../../utils/rawNodeString'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'at-rule-semicolon-newline-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected newline after ";"', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/at-rule-semicolon-newline-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondary, context) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always'], - }); - - if (!validOptions) { - return; - } - - root.walkAtRules((atRule) => { - const nextNode = atRule.next(); - - if (!nextNode) { - return; - } - - if (hasBlock(atRule)) { - return; - } - - if (!isStandardSyntaxAtRule(atRule)) { - return; - } - - // Allow an end-of-line comment - const nodeToCheck = nextNonCommentNode(nextNode); - - if (!nodeToCheck) { - return; - } - - checker.afterOneOnly({ - source: rawNodeString(nodeToCheck), - index: -1, - err: (msg) => { - if (context.fix) { - nodeToCheck.raws.before = context.newline + nodeToCheck.raws.before; - } else { - report({ - message: msg, - node: atRule, - index: atRule.toString().length + 1, - result, - ruleName, - }); - } - }, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/at-rule-semicolon-space-before/index.js b/node_modules/stylelint/lib/rules/at-rule-semicolon-space-before/index.js deleted file mode 100644 index b75d38531..000000000 --- a/node_modules/stylelint/lib/rules/at-rule-semicolon-space-before/index.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -const hasBlock = require('../../utils/hasBlock'); -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const rawNodeString = require('../../utils/rawNodeString'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'at-rule-semicolon-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before ";"', - rejectedBefore: () => 'Unexpected whitespace before ";"', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/at-rule-semicolon-space-before', - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - root.walkAtRules((atRule) => { - if (hasBlock(atRule)) { - return; - } - - if (!isStandardSyntaxAtRule(atRule)) { - return; - } - - const nodeString = rawNodeString(atRule); - - checker.before({ - source: nodeString, - index: nodeString.length, - err: (m) => { - report({ - message: m, - node: atRule, - index: nodeString.length - 1, - result, - ruleName, - }); - }, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js b/node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js deleted file mode 100644 index e9213a453..000000000 --- a/node_modules/stylelint/lib/rules/atRuleNameSpaceChecker.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -const isStandardSyntaxAtRule = require('../utils/isStandardSyntaxAtRule'); -const report = require('../utils/report'); - -/** - * @param {{ - * root: import('postcss').Root, - * locationChecker: (opts: { source: string, index: number, err: (msg: string) => void, errTarget: string }) => void, - * result: import('stylelint').PostcssResult, - * checkedRuleName: string, - * fix?: ((atRule: import('postcss').AtRule) => void) | null, - * }} options - */ -module.exports = function atRuleNameSpaceChecker(options) { - options.root.walkAtRules((atRule) => { - if (!isStandardSyntaxAtRule(atRule)) { - return; - } - - checkColon( - `@${atRule.name}${atRule.raws.afterName || ''}${atRule.params}`, - atRule.name.length, - atRule, - ); - }); - - /** - * @param {string} source - * @param {number} index - * @param {import('postcss').AtRule} node - */ - function checkColon(source, index, node) { - options.locationChecker({ - source, - index, - err: (m) => { - if (options.fix) { - options.fix(node); - - return; - } - - report({ - message: m, - node, - index, - result: options.result, - ruleName: options.checkedRuleName, - }); - }, - errTarget: `@${node.name}`, - }); - } -}; diff --git a/node_modules/stylelint/lib/rules/block-closing-brace-empty-line-before/index.js b/node_modules/stylelint/lib/rules/block-closing-brace-empty-line-before/index.js deleted file mode 100644 index e33a1c398..000000000 --- a/node_modules/stylelint/lib/rules/block-closing-brace-empty-line-before/index.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; - -const addEmptyLineAfter = require('../../utils/addEmptyLineAfter'); -const blockString = require('../../utils/blockString'); -const hasBlock = require('../../utils/hasBlock'); -const hasEmptyBlock = require('../../utils/hasEmptyBlock'); -const hasEmptyLine = require('../../utils/hasEmptyLine'); -const isSingleLineString = require('../../utils/isSingleLineString'); -const optionsMatches = require('../../utils/optionsMatches'); -const removeEmptyLinesAfter = require('../../utils/removeEmptyLinesAfter'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'block-closing-brace-empty-line-before'; - -const messages = ruleMessages(ruleName, { - expected: 'Expected empty line before closing brace', - rejected: 'Unexpected empty line before closing brace', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/block-closing-brace-empty-line-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['always-multi-line', 'never'], - }, - { - actual: secondaryOptions, - possible: { - except: ['after-closing-brace'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - // Check both kinds of statements: rules and at-rules - root.walkRules(check); - root.walkAtRules(check); - - /** - * @param {import('postcss').Rule | import('postcss').AtRule} statement - */ - function check(statement) { - // Return early if blockless or has empty block - if (!hasBlock(statement) || hasEmptyBlock(statement)) { - return; - } - - // Get whitespace after ""}", ignoring extra semicolon - const before = (statement.raws.after || '').replace(/;+/, ''); - - // Calculate index - const statementString = statement.toString(); - let index = statementString.length - 1; - - if (statementString[index - 1] === '\r') { - index -= 1; - } - - // Set expectation - const expectEmptyLineBefore = (() => { - const childNodeTypes = statement.nodes.map((item) => item.type); - - // Reverse the primary options if `after-closing-brace` is set - if ( - optionsMatches(secondaryOptions, 'except', 'after-closing-brace') && - statement.type === 'atrule' && - !childNodeTypes.includes('decl') - ) { - return primary === 'never'; - } - - return primary === 'always-multi-line' && !isSingleLineString(blockString(statement)); - })(); - - // Check for at least one empty line - const hasEmptyLineBefore = hasEmptyLine(before); - - // Return if the expectation is met - if (expectEmptyLineBefore === hasEmptyLineBefore) { - return; - } - - if (context.fix) { - const { newline } = context; - - if (typeof newline !== 'string') return; - - if (expectEmptyLineBefore) { - addEmptyLineAfter(statement, newline); - } else { - removeEmptyLinesAfter(statement, newline); - } - - return; - } - - const message = expectEmptyLineBefore ? messages.expected : messages.rejected; - - report({ - message, - result, - ruleName, - node: statement, - index, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-closing-brace-newline-after/index.js b/node_modules/stylelint/lib/rules/block-closing-brace-newline-after/index.js deleted file mode 100644 index 47a0495e1..000000000 --- a/node_modules/stylelint/lib/rules/block-closing-brace-newline-after/index.js +++ /dev/null @@ -1,152 +0,0 @@ -'use strict'; - -const blockString = require('../../utils/blockString'); -const hasBlock = require('../../utils/hasBlock'); -const optionsMatches = require('../../utils/optionsMatches'); -const rawNodeString = require('../../utils/rawNodeString'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); -const { isString } = require('../../utils/validateTypes'); - -const ruleName = 'block-closing-brace-newline-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected newline after "}"', - expectedAfterSingleLine: () => 'Expected newline after "}" of a single-line block', - rejectedAfterSingleLine: () => 'Unexpected whitespace after "}" of a single-line block', - expectedAfterMultiLine: () => 'Expected newline after "}" of a multi-line block', - rejectedAfterMultiLine: () => 'Unexpected whitespace after "}" of a multi-line block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/block-closing-brace-newline-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [ - 'always', - 'always-single-line', - 'never-single-line', - 'always-multi-line', - 'never-multi-line', - ], - }, - { - actual: secondaryOptions, - possible: { - ignoreAtRules: [isString], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - // Check both kinds of statements: rules and at-rules - root.walkRules(check); - root.walkAtRules(check); - - /** - * @param {import('postcss').Rule | import('postcss').AtRule} statement - */ - function check(statement) { - if (!hasBlock(statement)) { - return; - } - - if ( - statement.type === 'atrule' && - optionsMatches(secondaryOptions, 'ignoreAtRules', statement.name) - ) { - return; - } - - const nextNode = statement.next(); - - if (!nextNode) { - return; - } - - // Allow an end-of-line comment x spaces after the brace - const nextNodeIsSingleLineComment = - nextNode.type === 'comment' && - !/[^ ]/.test(nextNode.raws.before || '') && - !nextNode.toString().includes('\n'); - - const nodeToCheck = nextNodeIsSingleLineComment ? nextNode.next() : nextNode; - - if (!nodeToCheck) { - return; - } - - let reportIndex = statement.toString().length; - let source = rawNodeString(nodeToCheck); - - // Skip a semicolon at the beginning, if any - if (source && source.startsWith(';')) { - source = source.slice(1); - reportIndex++; - } - - // Only check one after, because there might be other - // spaces handled by the indentation rule - checker.afterOneOnly({ - source, - index: -1, - lineCheckStr: blockString(statement), - err: (msg) => { - if (context.fix) { - const nodeToCheckRaws = nodeToCheck.raws; - - if (typeof nodeToCheckRaws.before !== 'string') return; - - if (primary.startsWith('always')) { - const index = nodeToCheckRaws.before.search(/\r?\n/); - - nodeToCheckRaws.before = - index >= 0 - ? nodeToCheckRaws.before.slice(index) - : context.newline + nodeToCheckRaws.before; - - return; - } - - if (primary.startsWith('never')) { - nodeToCheckRaws.before = ''; - - return; - } - } - - report({ - message: msg, - node: statement, - index: reportIndex, - result, - ruleName, - }); - }, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-closing-brace-newline-before/index.js b/node_modules/stylelint/lib/rules/block-closing-brace-newline-before/index.js deleted file mode 100644 index e6f96aad9..000000000 --- a/node_modules/stylelint/lib/rules/block-closing-brace-newline-before/index.js +++ /dev/null @@ -1,132 +0,0 @@ -'use strict'; - -const blockString = require('../../utils/blockString'); -const hasBlock = require('../../utils/hasBlock'); -const hasEmptyBlock = require('../../utils/hasEmptyBlock'); -const isSingleLineString = require('../../utils/isSingleLineString'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'block-closing-brace-newline-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: 'Expected newline before "}"', - expectedBeforeMultiLine: 'Expected newline before "}" of a multi-line block', - rejectedBeforeMultiLine: 'Unexpected whitespace before "}" of a multi-line block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/block-closing-brace-newline-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line', 'never-multi-line'], - }); - - if (!validOptions) { - return; - } - - // Check both kinds of statements: rules and at-rules - root.walkRules(check); - root.walkAtRules(check); - - /** - * @param {import('postcss').Rule | import('postcss').AtRule} statement - */ - function check(statement) { - // Return early if blockless or has empty block - if (!hasBlock(statement) || hasEmptyBlock(statement)) { - return; - } - - // Ignore extra semicolon - const after = (statement.raws.after || '').replace(/;+/, ''); - - if (after === undefined) { - return; - } - - const blockIsMultiLine = !isSingleLineString(blockString(statement)); - const statementString = statement.toString(); - - let index = statementString.length - 2; - - if (statementString[index - 1] === '\r') { - index -= 1; - } - - // We're really just checking whether a - // newline *starts* the block's final space -- between - // the last declaration and the closing brace. We can - // ignore any other whitespace between them, because that - // will be checked by the indentation rule. - if (!after.startsWith('\n') && !after.startsWith('\r\n')) { - if (primary === 'always') { - complain(messages.expectedBefore); - } else if (blockIsMultiLine && primary === 'always-multi-line') { - complain(messages.expectedBeforeMultiLine); - } - } - - if (after !== '' && blockIsMultiLine && primary === 'never-multi-line') { - complain(messages.rejectedBeforeMultiLine); - } - - /** - * @param {string} message - */ - function complain(message) { - if (context.fix) { - const statementRaws = statement.raws; - - if (typeof statementRaws.after !== 'string') return; - - if (primary.startsWith('always')) { - const firstWhitespaceIndex = statementRaws.after.search(/\s/); - const newlineBefore = - firstWhitespaceIndex >= 0 - ? statementRaws.after.slice(0, firstWhitespaceIndex) - : statementRaws.after; - const newlineAfter = - firstWhitespaceIndex >= 0 ? statementRaws.after.slice(firstWhitespaceIndex) : ''; - const newlineIndex = newlineAfter.search(/\r?\n/); - - statementRaws.after = - newlineIndex >= 0 - ? newlineBefore + newlineAfter.slice(newlineIndex) - : newlineBefore + context.newline + newlineAfter; - - return; - } - - if (primary === 'never-multi-line') { - statementRaws.after = statementRaws.after.replace(/\s/g, ''); - - return; - } - } - - report({ - message, - result, - ruleName, - node: statement, - index, - }); - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-closing-brace-space-after/index.js b/node_modules/stylelint/lib/rules/block-closing-brace-space-after/index.js deleted file mode 100644 index f285d0672..000000000 --- a/node_modules/stylelint/lib/rules/block-closing-brace-space-after/index.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -const blockString = require('../../utils/blockString'); -const hasBlock = require('../../utils/hasBlock'); -const rawNodeString = require('../../utils/rawNodeString'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'block-closing-brace-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected single space after "}"', - rejectedAfter: () => 'Unexpected whitespace after "}"', - expectedAfterSingleLine: () => 'Expected single space after "}" of a single-line block', - rejectedAfterSingleLine: () => 'Unexpected whitespace after "}" of a single-line block', - expectedAfterMultiLine: () => 'Expected single space after "}" of a multi-line block', - rejectedAfterMultiLine: () => 'Unexpected whitespace after "}" of a multi-line block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/block-closing-brace-space-after', - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [ - 'always', - 'never', - 'always-single-line', - 'never-single-line', - 'always-multi-line', - 'never-multi-line', - ], - }); - - if (!validOptions) { - return; - } - - // Check both kinds of statements: rules and at-rules - root.walkRules(check); - root.walkAtRules(check); - - /** - * @param {import('postcss').Rule | import('postcss').AtRule} statement - */ - function check(statement) { - const nextNode = statement.next(); - - if (!nextNode) { - return; - } - - if (!hasBlock(statement)) { - return; - } - - let reportIndex = statement.toString().length; - let source = rawNodeString(nextNode); - - // Skip a semicolon at the beginning, if any - if (source && source.startsWith(';')) { - source = source.slice(1); - reportIndex++; - } - - checker.after({ - source, - index: -1, - lineCheckStr: blockString(statement), - err: (msg) => { - report({ - message: msg, - node: statement, - index: reportIndex, - result, - ruleName, - }); - }, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-closing-brace-space-before/index.js b/node_modules/stylelint/lib/rules/block-closing-brace-space-before/index.js deleted file mode 100644 index 03ac08f1f..000000000 --- a/node_modules/stylelint/lib/rules/block-closing-brace-space-before/index.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict'; - -const blockString = require('../../utils/blockString'); -const hasBlock = require('../../utils/hasBlock'); -const hasEmptyBlock = require('../../utils/hasEmptyBlock'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'block-closing-brace-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before "}"', - rejectedBefore: () => 'Unexpected whitespace before "}"', - expectedBeforeSingleLine: () => 'Expected single space before "}" of a single-line block', - rejectedBeforeSingleLine: () => 'Unexpected whitespace before "}" of a single-line block', - expectedBeforeMultiLine: () => 'Expected single space before "}" of a multi-line block', - rejectedBeforeMultiLine: () => 'Unexpected whitespace before "}" of a multi-line block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/block-closing-brace-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [ - 'always', - 'never', - 'always-single-line', - 'never-single-line', - 'always-multi-line', - 'never-multi-line', - ], - }); - - if (!validOptions) { - return; - } - - // Check both kinds of statement: rules and at-rules - root.walkRules(check); - root.walkAtRules(check); - - /** - * @param {import('postcss').Rule | import('postcss').AtRule} statement - */ - function check(statement) { - // Return early if blockless or has empty block - if (!hasBlock(statement) || hasEmptyBlock(statement)) { - return; - } - - const source = blockString(statement); - const statementString = statement.toString(); - - let index = statementString.length - 2; - - if (statementString[index - 1] === '\r') { - index -= 1; - } - - checker.before({ - source, - index: source.length - 1, - err: (msg) => { - if (context.fix) { - const statementRaws = statement.raws; - - if (typeof statementRaws.after !== 'string') return; - - if (primary.startsWith('always')) { - statementRaws.after = statementRaws.after.replace(/\s*$/, ' '); - - return; - } - - if (primary.startsWith('never')) { - statementRaws.after = statementRaws.after.replace(/\s*$/, ''); - - return; - } - } - - report({ - message: msg, - node: statement, - index, - result, - ruleName, - }); - }, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-no-empty/index.js b/node_modules/stylelint/lib/rules/block-no-empty/index.js deleted file mode 100644 index f5c782330..000000000 --- a/node_modules/stylelint/lib/rules/block-no-empty/index.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict'; - -const beforeBlockString = require('../../utils/beforeBlockString'); -const hasBlock = require('../../utils/hasBlock'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const { isConfigurationComment } = require('../../utils/configurationComment'); -const { isComment } = require('../../utils/typeGuards'); -const validateOptions = require('../../utils/validateOptions'); -const { isBoolean } = require('../../utils/validateTypes'); - -const ruleName = 'block-no-empty'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected empty block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/block-no-empty', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: isBoolean, - }, - { - actual: secondaryOptions, - possible: { - ignore: ['comments'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const ignoreComments = optionsMatches(secondaryOptions, 'ignore', 'comments'); - - // Check both kinds of statements: rules and at-rules - root.walkRules(check); - root.walkAtRules(check); - - /** @typedef {import('postcss').Rule | import('postcss').AtRule} Statement */ - - /** - * @param {Statement} statement - */ - function check(statement) { - if (!hasBlock(statement)) { - return; - } - - if (hasNotableChild(statement)) { - return; - } - - if (hasNonWhitespace(statement)) { - return; - } - - let index = beforeBlockString(statement, { noRawBefore: true }).length; - - // For empty blocks when using SugarSS parser - if (statement.raws.between === undefined) { - index--; - } - - report({ - message: messages.rejected, - node: statement, - start: statement.positionBy({ index }), - result, - ruleName, - }); - } - - /** - * @param {Statement} statement - * @returns {boolean} - */ - function hasNotableChild(statement) { - return statement.nodes.some((child) => { - if (isComment(child)) { - if (ignoreComments) return false; - - if (isConfigurationComment(child, context.configurationComment)) return false; - } - - return true; - }); - } - - /** - * @param {Statement} statement - * @returns {boolean} - */ - function hasNonWhitespace(statement) { - const { after } = statement.raws; - - return typeof after === 'string' && /\S/.test(after); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-opening-brace-newline-after/index.js b/node_modules/stylelint/lib/rules/block-opening-brace-newline-after/index.js deleted file mode 100644 index fc6984e7b..000000000 --- a/node_modules/stylelint/lib/rules/block-opening-brace-newline-after/index.js +++ /dev/null @@ -1,182 +0,0 @@ -'use strict'; - -const beforeBlockString = require('../../utils/beforeBlockString'); -const blockString = require('../../utils/blockString'); -const hasBlock = require('../../utils/hasBlock'); -const hasEmptyBlock = require('../../utils/hasEmptyBlock'); -const optionsMatches = require('../../utils/optionsMatches'); -const rawNodeString = require('../../utils/rawNodeString'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'block-opening-brace-newline-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected newline after "{"', - expectedAfterMultiLine: () => 'Expected newline after "{" of a multi-line block', - rejectedAfterMultiLine: () => 'Unexpected whitespace after "{" of a multi-line block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/block-opening-brace-newline-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['always', 'rules', 'always-multi-line', 'never-multi-line'], - }, - { - actual: secondaryOptions, - possible: { - ignore: ['rules'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - // Check both kinds of statement: rules and at-rules - if (!optionsMatches(secondaryOptions, 'ignore', 'rules')) { - root.walkRules(check); - } - - root.walkAtRules(check); - - /** - * @param {import('postcss').Rule | import('postcss').AtRule} statement - */ - function check(statement) { - // Return early if blockless or has an empty block - if (!hasBlock(statement) || hasEmptyBlock(statement)) { - return; - } - - const backupCommentNextBefores = new Map(); - - /** - * next node with checking newlines after comment - * - * @param {import('postcss').ChildNode | undefined} startNode - * @returns {import('postcss').ChildNode | undefined} - */ - function nextNode(startNode) { - if (!startNode || !startNode.next) return; - - if (startNode.type === 'comment') { - const reNewLine = /\r?\n/; - const newLineMatch = reNewLine.test(startNode.raws.before || ''); - - const next = startNode.next(); - - if (next && newLineMatch && !reNewLine.test(next.raws.before || '')) { - backupCommentNextBefores.set(next, next.raws.before); - next.raws.before = startNode.raws.before; - } - - return nextNode(next); - } - - return startNode; - } - - // Allow an end-of-line comment - const nodeToCheck = nextNode(statement.first); - - if (!nodeToCheck) { - return; - } - - checker.afterOneOnly({ - source: rawNodeString(nodeToCheck), - index: -1, - lineCheckStr: blockString(statement), - err: (m) => { - if (context.fix) { - const nodeToCheckRaws = nodeToCheck.raws; - - if (typeof nodeToCheckRaws.before !== 'string') return; - - if (primary.startsWith('always')) { - const index = nodeToCheckRaws.before.search(/\r?\n/); - - nodeToCheckRaws.before = - index >= 0 - ? nodeToCheckRaws.before.slice(index) - : context.newline + nodeToCheckRaws.before; - - backupCommentNextBefores.delete(nodeToCheck); - - return; - } - - if (primary === 'never-multi-line') { - // Restore the `before` of the node next to the comment node. - for (const [node, before] of backupCommentNextBefores.entries()) { - node.raws.before = before; - } - - backupCommentNextBefores.clear(); - - // Fix - const reNewLine = /\r?\n/; - let fixTarget = statement.first; - - while (fixTarget) { - const fixTargetRaws = fixTarget.raws; - - if (typeof fixTargetRaws.before !== 'string') continue; - - if (reNewLine.test(fixTargetRaws.before || '')) { - fixTargetRaws.before = fixTargetRaws.before.replace(/\r?\n/g, ''); - } - - if (fixTarget.type !== 'comment') { - break; - } - - fixTarget = fixTarget.next(); - } - - nodeToCheckRaws.before = ''; - - return; - } - } - - report({ - message: m, - node: statement, - index: beforeBlockString(statement, { noRawBefore: true }).length + 1, - result, - ruleName, - }); - }, - }); - - // Restore the `before` of the node next to the comment node. - for (const [node, before] of backupCommentNextBefores.entries()) { - node.raws.before = before; - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-opening-brace-newline-before/index.js b/node_modules/stylelint/lib/rules/block-opening-brace-newline-before/index.js deleted file mode 100644 index 1bc9aa8d4..000000000 --- a/node_modules/stylelint/lib/rules/block-opening-brace-newline-before/index.js +++ /dev/null @@ -1,120 +0,0 @@ -'use strict'; - -const beforeBlockString = require('../../utils/beforeBlockString'); -const blockString = require('../../utils/blockString'); -const hasBlock = require('../../utils/hasBlock'); -const hasEmptyBlock = require('../../utils/hasEmptyBlock'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'block-opening-brace-newline-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected newline before "{"', - expectedBeforeSingleLine: () => 'Expected newline before "{" of a single-line block', - rejectedBeforeSingleLine: () => 'Unexpected whitespace before "{" of a single-line block', - expectedBeforeMultiLine: () => 'Expected newline before "{" of a multi-line block', - rejectedBeforeMultiLine: () => 'Unexpected whitespace before "{" of a multi-line block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/block-opening-brace-newline-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [ - 'always', - 'always-single-line', - 'never-single-line', - 'always-multi-line', - 'never-multi-line', - ], - }); - - if (!validOptions) { - return; - } - - // Check both kinds of statement: rules and at-rules - root.walkRules(check); - root.walkAtRules(check); - - /** - * @param {import('postcss').Rule | import('postcss').AtRule} statement - */ - function check(statement) { - // Return early if blockless or has an empty block - if (!hasBlock(statement) || hasEmptyBlock(statement)) { - return; - } - - const source = beforeBlockString(statement); - const beforeBraceNoRaw = beforeBlockString(statement, { - noRawBefore: true, - }); - - let index = beforeBraceNoRaw.length - 1; - - if (beforeBraceNoRaw[index - 1] === '\r') { - index -= 1; - } - - checker.beforeAllowingIndentation({ - lineCheckStr: blockString(statement), - source, - index: source.length, - err: (m) => { - if (context.fix) { - const statementRaws = statement.raws; - - if (typeof statementRaws.between !== 'string') return; - - if (primary.startsWith('always')) { - const spaceIndex = statementRaws.between.search(/\s+$/); - - if (spaceIndex >= 0) { - statement.raws.between = - statementRaws.between.slice(0, spaceIndex) + - context.newline + - statementRaws.between.slice(spaceIndex); - } else { - statementRaws.between += context.newline; - } - - return; - } - - if (primary.startsWith('never')) { - statementRaws.between = statementRaws.between.replace(/\s*$/, ''); - - return; - } - } - - report({ - message: m, - node: statement, - index, - result, - ruleName, - }); - }, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-opening-brace-space-after/index.js b/node_modules/stylelint/lib/rules/block-opening-brace-space-after/index.js deleted file mode 100644 index 02fc149ea..000000000 --- a/node_modules/stylelint/lib/rules/block-opening-brace-space-after/index.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -const beforeBlockString = require('../../utils/beforeBlockString'); -const blockString = require('../../utils/blockString'); -const hasBlock = require('../../utils/hasBlock'); -const hasEmptyBlock = require('../../utils/hasEmptyBlock'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'block-opening-brace-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected single space after "{"', - rejectedAfter: () => 'Unexpected whitespace after "{"', - expectedAfterSingleLine: () => 'Expected single space after "{" of a single-line block', - rejectedAfterSingleLine: () => 'Unexpected whitespace after "{" of a single-line block', - expectedAfterMultiLine: () => 'Expected single space after "{" of a multi-line block', - rejectedAfterMultiLine: () => 'Unexpected whitespace after "{" of a multi-line block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/block-opening-brace-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [ - 'always', - 'never', - 'always-single-line', - 'never-single-line', - 'always-multi-line', - 'never-multi-line', - ], - }, - { - actual: secondaryOptions, - possible: { - ignore: ['at-rules'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - // Check both kinds of statements: rules and at-rules - root.walkRules(check); - - if (!optionsMatches(secondaryOptions, 'ignore', 'at-rules')) { - root.walkAtRules(check); - } - - /** - * @param {import('postcss').Rule | import('postcss').AtRule} statement - */ - function check(statement) { - // Return early if blockless or has an empty block - if (!hasBlock(statement) || hasEmptyBlock(statement)) { - return; - } - - checker.after({ - source: blockString(statement), - index: 0, - err: (m) => { - if (context.fix) { - const statementFirst = statement.first; - - if (statementFirst == null) return; - - if (primary.startsWith('always')) { - statementFirst.raws.before = ' '; - - return; - } - - if (primary.startsWith('never')) { - statementFirst.raws.before = ''; - - return; - } - } - - report({ - message: m, - node: statement, - index: beforeBlockString(statement, { noRawBefore: true }).length + 1, - result, - ruleName, - }); - }, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/block-opening-brace-space-before/index.js b/node_modules/stylelint/lib/rules/block-opening-brace-space-before/index.js deleted file mode 100644 index fcde4e48d..000000000 --- a/node_modules/stylelint/lib/rules/block-opening-brace-space-before/index.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; - -const beforeBlockString = require('../../utils/beforeBlockString'); -const blockString = require('../../utils/blockString'); -const hasBlock = require('../../utils/hasBlock'); -const hasEmptyBlock = require('../../utils/hasEmptyBlock'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'block-opening-brace-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before "{"', - rejectedBefore: () => 'Unexpected whitespace before "{"', - expectedBeforeSingleLine: () => 'Expected single space before "{" of a single-line block', - rejectedBeforeSingleLine: () => 'Unexpected whitespace before "{" of a single-line block', - expectedBeforeMultiLine: () => 'Expected single space before "{" of a multi-line block', - rejectedBeforeMultiLine: () => 'Unexpected whitespace before "{" of a multi-line block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/block-opening-brace-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [ - 'always', - 'never', - 'always-single-line', - 'never-single-line', - 'always-multi-line', - 'never-multi-line', - ], - }, - { - actual: secondaryOptions, - possible: { - ignoreAtRules: [isString, isRegExp], - ignoreSelectors: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - // Check both kinds of statements: rules and at-rules - root.walkRules(check); - root.walkAtRules(check); - - /** - * @param {import('postcss').Rule | import('postcss').AtRule} statement - */ - function check(statement) { - // Return early if blockless or has an empty block - if (!hasBlock(statement) || hasEmptyBlock(statement)) { - return; - } - - // Return early if at-rule is to be ignored - if ( - statement.type === 'atrule' && - optionsMatches(secondaryOptions, 'ignoreAtRules', statement.name) - ) { - return; - } - - // Return early if selector is to be ignored - if ( - statement.type === 'rule' && - optionsMatches(secondaryOptions, 'ignoreSelectors', statement.selector) - ) { - return; - } - - const source = beforeBlockString(statement); - const beforeBraceNoRaw = beforeBlockString(statement, { - noRawBefore: true, - }); - - let index = beforeBraceNoRaw.length - 1; - - if (beforeBraceNoRaw[index - 1] === '\r') { - index -= 1; - } - - checker.before({ - source, - index: source.length, - lineCheckStr: blockString(statement), - err: (m) => { - if (context.fix) { - if (primary.startsWith('always')) { - statement.raws.between = ' '; - - return; - } - - if (primary.startsWith('never')) { - statement.raws.between = ''; - - return; - } - } - - report({ - message: m, - node: statement, - index, - result, - ruleName, - }); - }, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-function-notation/index.js b/node_modules/stylelint/lib/rules/color-function-notation/index.js deleted file mode 100644 index ed1eb2d7b..000000000 --- a/node_modules/stylelint/lib/rules/color-function-notation/index.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const isStandardSyntaxColorFunction = require('../../utils/isStandardSyntaxColorFunction'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const { isValueFunction } = require('../../utils/typeGuards'); -const validateOptions = require('../../utils/validateOptions'); -const optionsMatches = require('../../utils/optionsMatches'); - -const ruleName = 'color-function-notation'; - -const messages = ruleMessages(ruleName, { - expected: (primary) => `Expected ${primary} color-function notation`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/color-function-notation', - fixable: true, -}; - -const LEGACY_FUNCTION_NAME = /^(?:rgba|hsla)$/i; -const LEGACY_NOTATION_FUNCTION = /\b(?:rgba?|hsla?)\(/i; -const LEGACY_NOTATION_FUNCTION_NAME = /^(?:rgba?|hsla?)$/i; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['modern', 'legacy'], - }, - { - actual: secondaryOptions, - possible: { - ignore: ['with-var-inside'], - }, - optional: true, - }, - ); - - if (!validOptions) return; - - const ignoreWithVarInside = optionsMatches(secondaryOptions, 'ignore', 'with-var-inside'); - - root.walkDecls((decl) => { - if (!LEGACY_NOTATION_FUNCTION.test(decl.value)) return; - - if (primary === 'modern' && !decl.value.includes(',')) return; - - let needsFix = false; - const parsedValue = valueParser(getDeclarationValue(decl)); - - parsedValue.walk((node) => { - if (!isValueFunction(node)) return; - - if (!isStandardSyntaxColorFunction(node)) return; - - const { value, sourceIndex, sourceEndIndex, nodes } = node; - - if (ignoreWithVarInside && containsVariable(nodes)) { - return; - } - - if (!LEGACY_NOTATION_FUNCTION_NAME.test(value)) return; - - if (primary === 'modern' && !hasCommas(node)) return; - - if (primary === 'legacy' && hasCommas(node)) return; - - if (context.fix && primary === 'modern') { - let commaCount = 0; - - // Convert punctuation - node.nodes = nodes.map((childNode) => { - if (isComma(childNode)) { - // Non-alpha commas to space and alpha commas to slashes - if (commaCount < 2) { - // @ts-expect-error -- TS2322: Type '"space"' is not assignable to type '"div"'. - childNode.type = 'space'; - childNode.value = atLeastOneSpace(childNode.after); - commaCount++; - } else { - childNode.value = '/'; - childNode.before = atLeastOneSpace(childNode.before); - childNode.after = atLeastOneSpace(childNode.after); - } - } - - return childNode; - }); - - // Remove trailing 'a' from legacy function name - if (LEGACY_FUNCTION_NAME.test(value)) { - node.value = value.slice(0, -1); - } - - needsFix = true; - - return; - } - - const index = declarationValueIndex(decl) + sourceIndex; - const endIndex = index + (sourceEndIndex - sourceIndex); - - report({ - message: messages.expected, - messageArgs: [primary], - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - - if (needsFix) { - setDeclarationValue(decl, parsedValue.toString()); - } - }); - }; -}; - -/** - * @param {string} whitespace - */ -function atLeastOneSpace(whitespace) { - return whitespace !== '' ? whitespace : ' '; -} - -/** - * @param {import('postcss-value-parser').Node[]} nodes - */ -function containsVariable(nodes) { - return nodes.some(({ type, value }) => type === 'function' && value.toLowerCase() === 'var'); -} - -/** - * @param {import('postcss-value-parser').Node} node - * @returns {node is import('postcss-value-parser').DivNode} - */ -function isComma(node) { - return node.type === 'div' && node.value === ','; -} - -/** - * @param {import('postcss-value-parser').FunctionNode} node - */ -function hasCommas(node) { - return node.nodes && node.nodes.some((childNode) => isComma(childNode)); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-hex-alpha/index.js b/node_modules/stylelint/lib/rules/color-hex-alpha/index.js deleted file mode 100644 index 404b7dd72..000000000 --- a/node_modules/stylelint/lib/rules/color-hex-alpha/index.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const hasValidHex = require('../../utils/hasValidHex'); -const isValidHex = require('../../utils/isValidHex'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); - -const ruleName = 'color-hex-alpha'; - -const messages = ruleMessages(ruleName, { - expected: (hex) => `Expected alpha channel in "${hex}"`, - unexpected: (hex) => `Unexpected alpha channel in "${hex}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/color-hex-alpha', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) return; - - root.walkDecls((decl) => { - if (!hasValidHex(decl.value)) return; - - const parsedValue = valueParser(decl.value); - - parsedValue.walk((node) => { - if (isUrlFunction(node)) return false; - - if (!isHexColor(node)) return; - - const { value } = node; - - if (primary === 'always' && hasAlphaChannel(value)) return; - - if (primary === 'never' && !hasAlphaChannel(value)) return; - - const index = declarationValueIndex(decl) + node.sourceIndex; - const endIndex = index + value.length; - - report({ - message: primary === 'never' ? messages.unexpected : messages.expected, - messageArgs: [value], - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - }); - }; -}; - -/** - * @param {import('postcss-value-parser').Node} node - */ -function isUrlFunction({ type, value }) { - return type === 'function' && value === 'url'; -} - -/** - * @param {import('postcss-value-parser').Node} node - */ -function isHexColor({ type, value }) { - return type === 'word' && isValidHex(value); -} - -/** - * @param {string} hex - */ -function hasAlphaChannel(hex) { - return hex.length === 5 || hex.length === 9; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-hex-case/index.js b/node_modules/stylelint/lib/rules/color-hex-case/index.js deleted file mode 100644 index 662a14f18..000000000 --- a/node_modules/stylelint/lib/rules/color-hex-case/index.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'color-hex-case'; - -const messages = ruleMessages(ruleName, { - expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/color-hex-case', - fixable: true, - deprecated: true, -}; - -const HEX = /^#[\da-z]+/i; -const CONTAINS_HEX = /#[\da-z]+/i; -const IGNORED_FUNCTIONS = new Set(['url']); - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['lower', 'upper'], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (!CONTAINS_HEX.test(decl.value)) return; - - const parsedValue = valueParser(getDeclarationValue(decl)); - let needsFix = false; - - parsedValue.walk((node) => { - const { value } = node; - - if (isIgnoredFunction(node)) return false; - - if (!isHexColor(node)) return; - - const expected = primary === 'lower' ? value.toLowerCase() : value.toUpperCase(); - - if (value === expected) return; - - if (context.fix) { - node.value = expected; - needsFix = true; - - return; - } - - report({ - message: messages.expected(value, expected), - node: decl, - index: declarationValueIndex(decl) + node.sourceIndex, - result, - ruleName, - }); - }); - - if (needsFix) { - setDeclarationValue(decl, parsedValue.toString()); - } - }); - }; -}; - -/** - * @param {import('postcss-value-parser').Node} node - */ -function isIgnoredFunction({ type, value }) { - return type === 'function' && IGNORED_FUNCTIONS.has(value.toLowerCase()); -} - -/** - * @param {import('postcss-value-parser').Node} node - */ -function isHexColor({ type, value }) { - return type === 'word' && HEX.test(value); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-hex-length/index.js b/node_modules/stylelint/lib/rules/color-hex-length/index.js deleted file mode 100644 index 413f5f197..000000000 --- a/node_modules/stylelint/lib/rules/color-hex-length/index.js +++ /dev/null @@ -1,148 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'color-hex-length'; - -const messages = ruleMessages(ruleName, { - expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/color-hex-length', - fixable: true, -}; - -const HEX = /^#[\da-z]+$/i; -const CONTAINS_HEX = /#[\da-z]+/i; -const IGNORED_FUNCTIONS = new Set(['url']); - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['short', 'long'], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (!CONTAINS_HEX.test(decl.value)) return; - - const parsedValue = valueParser(getDeclarationValue(decl)); - let needsFix = false; - - parsedValue.walk((node) => { - const { value: hexValue } = node; - - if (isIgnoredFunction(node)) return false; - - if (!isHexColor(node)) return; - - if (primary === 'long' && hexValue.length !== 4 && hexValue.length !== 5) { - return; - } - - if (primary === 'short' && (hexValue.length < 6 || !canShrink(hexValue))) { - return; - } - - const variant = primary === 'long' ? longer : shorter; - const expectedHex = variant(hexValue); - - if (context.fix) { - node.value = expectedHex; - needsFix = true; - - return; - } - - const index = declarationValueIndex(decl) + node.sourceIndex; - const endIndex = index + node.value.length; - - report({ - message: messages.expected, - messageArgs: [hexValue, expectedHex], - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - - if (needsFix) { - setDeclarationValue(decl, parsedValue.toString()); - } - }); - }; -}; - -/** - * @param {string} hex - */ -function canShrink(hex) { - hex = hex.toLowerCase(); - - return ( - hex[1] === hex[2] && - hex[3] === hex[4] && - hex[5] === hex[6] && - (hex.length === 7 || (hex.length === 9 && hex[7] === hex[8])) - ); -} - -/** - * @param {string} hex - */ -function shorter(hex) { - let hexVariant = '#'; - - for (let i = 1; i < hex.length; i += 2) { - hexVariant += hex[i]; - } - - return hexVariant; -} - -/** - * @param {string} hex - */ -function longer(hex) { - let hexVariant = '#'; - - for (let i = 1; i < hex.length; i++) { - hexVariant += hex.charAt(i).repeat(2); - } - - return hexVariant; -} - -/** - * @param {import('postcss-value-parser').Node} node - */ -function isIgnoredFunction({ type, value }) { - return type === 'function' && IGNORED_FUNCTIONS.has(value.toLowerCase()); -} - -/** - * @param {import('postcss-value-parser').Node} node - */ -function isHexColor({ type, value }) { - return type === 'word' && HEX.test(value); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-named/colordUtils.js b/node_modules/stylelint/lib/rules/color-named/colordUtils.js deleted file mode 100644 index adf9023dc..000000000 --- a/node_modules/stylelint/lib/rules/color-named/colordUtils.js +++ /dev/null @@ -1,108 +0,0 @@ -const { colord, extend } = require('colord'); -const valueParser = require('postcss-value-parser'); - -const namesPlugin = require('colord/plugins/names'); -const hwbPlugin = require('colord/plugins/hwb'); -const labPlugin = require('colord/plugins/lab'); -const lchPlugin = require('colord/plugins/lch'); - -extend([ - // Type definitions are not compatible with commonjs. - /** @type {any} */ (namesPlugin), - /** @type {any} */ (hwbPlugin), - /** @type {any} */ (labPlugin), - /** @type {any} */ (lchPlugin), - - /* Syntaxes that is removed in Color Module Level 4 specification. */ - - // hwb() with comma - (_colordClass, parsers) => { - parsers.string.push([parseHwbWithCommaString, /** @type {any} */ ('hwb-with-comma')]); - }, - // gray() - (_colordClass, parsers) => { - parsers.string.push([parseGrayString, /** @type {any} */ ('gray')]); - }, -]); - -module.exports = { - colord, -}; - -/** - * Parses a valid hwb with comma CSS color function - * https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hwb()#syntax - * @type {import('colord/types').ParseFunction} - */ -function parseHwbWithCommaString(input) { - input = input.toLowerCase(); - - if (!input.startsWith('hwb(') || !input.endsWith(')') || input.includes('/')) { - return null; - } - - const [hue, whiteness = '', blackness = '', alpha, ...extraArgs] = input.slice(4, -1).split(','); - - if (!hue || !hue.trim() || !whiteness.trim() || !blackness.trim() || extraArgs.length > 0) { - return null; - } - - // Change the delimiter and parse with colord. - const colordInstance = colord( - `hwb(${hue} ${whiteness} ${blackness}${alpha ? ` / ${alpha}` : ''})`, - ); - - if (!colordInstance.isValid()) { - return null; - } - - return colordInstance.rgba; -} - -/** - * Parses a valid gray() CSS color function - * @type {import('colord/types').ParseFunction} - */ -function parseGrayString(input) { - input = input.toLowerCase(); - - if (!input.startsWith('gray(') || !input.endsWith(')')) { - return null; - } - - const [lightness, alpha, ...extraArgs] = input.slice(5, -1).split(','); - - if (!lightness || extraArgs.length > 0) { - return null; - } - - const lightnessWithUnit = valueParser.unit(lightness.trim()); - - if (!lightnessWithUnit || !['', '%'].includes(lightnessWithUnit.unit)) { - return null; - } - - /** - * @type {import('colord/types').LabColor | import('colord/types').LabaColor} - */ - let colorObject = { - l: Number(lightnessWithUnit.number), - a: 0, - b: 0, - }; - - if (alpha) { - const alphaWithUnit = valueParser.unit(alpha.trim()); - - if (!alphaWithUnit || !['', '%'].includes(alphaWithUnit.unit)) { - return null; - } - - colorObject = { - ...colorObject, - alpha: Number(alphaWithUnit.number) / (alphaWithUnit.unit ? 100 : 1), - }; - } - - return colord(colorObject).rgba; -} diff --git a/node_modules/stylelint/lib/rules/color-named/index.js b/node_modules/stylelint/lib/rules/color-named/index.js deleted file mode 100644 index 6cb75bb33..000000000 --- a/node_modules/stylelint/lib/rules/color-named/index.js +++ /dev/null @@ -1,184 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const optionsMatches = require('../../utils/optionsMatches'); -const { acceptCustomIdentsProperties } = require('../../reference/properties'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); -const { isRegExp, isString } = require('../../utils/validateTypes'); -const { colord } = require('./colordUtils'); -const hasNamedColor = require('../../utils/hasNamedColor'); -const hasValidHex = require('../../utils/hasValidHex'); -const hasColorFunction = require('../../utils/hasColorFunction'); -const { namedColorsKeywords } = require('../../reference/keywords'); - -const ruleName = 'color-named'; - -const messages = ruleMessages(ruleName, { - expected: (named, original) => `Expected "${original}" to be "${named}"`, - rejected: (named) => `Unexpected named color "${named}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/color-named', -}; - -// Todo tested on case insensitivity -const NODE_TYPES = new Set(['word', 'function']); - -const HAS_GRAY_FUNCTION = /\bgray\(/i; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['never', 'always-where-possible'], - }, - { - actual: secondaryOptions, - possible: { - ignoreProperties: [isString, isRegExp], - ignore: ['inside-function'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (acceptCustomIdentsProperties.has(decl.prop)) { - return; - } - - // Return early if the property is to be ignored - if (optionsMatches(secondaryOptions, 'ignoreProperties', decl.prop)) { - return; - } - - const { value: declValue } = decl; - - if (primary === 'never' && !hasNamedColor(declValue)) { - return; - } - - if ( - primary === 'always-where-possible' && - !hasValidHex(declValue) && - !hasColorFunction(declValue) && - !HAS_GRAY_FUNCTION.test(declValue) - ) { - return; - } - - valueParser(declValue).walk((node) => { - const value = node.value; - const type = node.type; - const sourceIndex = node.sourceIndex; - - if (optionsMatches(secondaryOptions, 'ignore', 'inside-function') && type === 'function') { - return false; - } - - if (!isStandardSyntaxFunction(node)) { - return false; - } - - if (!isStandardSyntaxValue(value)) { - return; - } - - // Return early if neither a word nor a function - if (!NODE_TYPES.has(type)) { - return; - } - - // Check for named colors for "never" option - if ( - primary === 'never' && - type === 'word' && - namedColorsKeywords.has(value.toLowerCase()) - ) { - complain( - messages.rejected(value), - decl, - declarationValueIndex(decl) + sourceIndex, - value.length, - ); - - return; - } - - // Check "always-where-possible" option ... - if (primary !== 'always-where-possible') { - return; - } - - let rawColorString = null; - let colorString = null; - - if (type === 'function') { - rawColorString = valueParser.stringify(node); - - // First by checking for alternative color function representations ... - // Remove all spaces to match what's in `representations` - colorString = rawColorString.replace(/\s*([,/()])\s*/g, '$1').replace(/\s{2,}/g, ' '); - } else if (type === 'word' && value.startsWith('#')) { - // Then by checking for alternative hex representations - rawColorString = colorString = value; - } else { - return; - } - - const color = colord(colorString); - - if (!color.isValid()) { - return; - } - - const namedColor = color.toName(); - - if (namedColor && namedColor.toLowerCase() !== 'transparent') { - complain( - messages.expected(namedColor, colorString), - decl, - declarationValueIndex(decl) + sourceIndex, - rawColorString.length, - ); - } - }); - }); - - /** - * @param {string} message - * @param {import('postcss').Node} node - * @param {number} index - * @param {number} length - */ - function complain(message, node, index, length) { - report({ - result, - ruleName, - message, - node, - index, - endIndex: index + length, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-no-hex/index.js b/node_modules/stylelint/lib/rules/color-no-hex/index.js deleted file mode 100644 index 99dd87b89..000000000 --- a/node_modules/stylelint/lib/rules/color-no-hex/index.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'color-no-hex'; - -const messages = ruleMessages(ruleName, { - rejected: (hex) => `Unexpected hex color "${hex}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/color-no-hex', -}; - -const HEX = /^#[\da-z]+$/i; -const CONTAINS_HEX = /#[\da-z]+/i; -const IGNORED_FUNCTIONS = new Set(['url']); - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (!CONTAINS_HEX.test(decl.value)) return; - - const parsedValue = valueParser(getDeclarationValue(decl)); - - parsedValue.walk((node) => { - if (isIgnoredFunction(node)) return false; - - if (!isHexColor(node)) return; - - const index = declarationValueIndex(decl) + node.sourceIndex; - const endIndex = index + node.value.length; - - report({ - message: messages.rejected, - messageArgs: [node.value], - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - }); - }; -}; - -/** - * @param {import('postcss-value-parser').Node} node - */ -function isIgnoredFunction({ type, value }) { - return type === 'function' && IGNORED_FUNCTIONS.has(value.toLowerCase()); -} - -/** - * @param {import('postcss-value-parser').Node} node - */ -function isHexColor({ type, value }) { - return type === 'word' && HEX.test(value); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/color-no-invalid-hex/index.js b/node_modules/stylelint/lib/rules/color-no-invalid-hex/index.js deleted file mode 100644 index 16b09fabf..000000000 --- a/node_modules/stylelint/lib/rules/color-no-invalid-hex/index.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const isStandardSyntaxHexColor = require('../../utils/isStandardSyntaxHexColor'); -const isValidHex = require('../../utils/isValidHex'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); - -const ruleName = 'color-no-invalid-hex'; - -const messages = ruleMessages(ruleName, { - rejected: (hex) => `Unexpected invalid hex color "${hex}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/color-no-invalid-hex', -}; - -const CONTAINS_HEX = /#[\da-z]+/i; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (!isStandardSyntaxHexColor(decl.value)) { - return; - } - - if (!CONTAINS_HEX.test(decl.value)) { - return; - } - - valueParser(decl.value).walk(({ value, type, sourceIndex }) => { - if (type === 'function' && value.endsWith('url')) return false; - - if (type !== 'word') return; - - const hexMatch = /^#[\da-z]+/i.exec(value); - - if (!hexMatch) return; - - const hexValue = hexMatch[0]; - - if (!hexValue || isValidHex(hexValue)) return; - - const index = declarationValueIndex(decl) + sourceIndex; - const endIndex = index + hexValue.length; - - report({ - message: messages.rejected, - messageArgs: [hexValue], - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/comment-empty-line-before/index.js b/node_modules/stylelint/lib/rules/comment-empty-line-before/index.js deleted file mode 100644 index 9aaef4075..000000000 --- a/node_modules/stylelint/lib/rules/comment-empty-line-before/index.js +++ /dev/null @@ -1,133 +0,0 @@ -'use strict'; - -const addEmptyLineBefore = require('../../utils/addEmptyLineBefore'); -const hasEmptyLine = require('../../utils/hasEmptyLine'); -const isAfterComment = require('../../utils/isAfterComment'); -const isFirstNested = require('../../utils/isFirstNested'); -const isFirstNodeOfRoot = require('../../utils/isFirstNodeOfRoot'); -const isSharedLineComment = require('../../utils/isSharedLineComment'); -const isStandardSyntaxComment = require('../../utils/isStandardSyntaxComment'); -const optionsMatches = require('../../utils/optionsMatches'); -const removeEmptyLinesBefore = require('../../utils/removeEmptyLinesBefore'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isConfigurationComment } = require('../../utils/configurationComment'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'comment-empty-line-before'; - -const messages = ruleMessages(ruleName, { - expected: 'Expected empty line before comment', - rejected: 'Unexpected empty line before comment', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/comment-empty-line-before', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['always', 'never'], - }, - { - actual: secondaryOptions, - possible: { - except: ['first-nested'], - ignore: ['stylelint-commands', 'after-comment'], - ignoreComments: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkComments((comment) => { - // Ignore the first node - if (isFirstNodeOfRoot(comment)) { - return; - } - - // Optionally ignore stylelint commands - if ( - isConfigurationComment(comment, context.configurationComment) && - optionsMatches(secondaryOptions, 'ignore', 'stylelint-commands') - ) { - return; - } - - // Optionally ignore newlines between comments - if (optionsMatches(secondaryOptions, 'ignore', 'after-comment') && isAfterComment(comment)) { - return; - } - - // Ignore comments matching the ignoreComments option. - if (optionsMatches(secondaryOptions, 'ignoreComments', comment.text)) { - return; - } - - // Ignore shared-line comments - if (isSharedLineComment(comment)) { - return; - } - - // Ignore non-standard comments - if (!isStandardSyntaxComment(comment)) { - return; - } - - const expectEmptyLineBefore = (() => { - if (optionsMatches(secondaryOptions, 'except', 'first-nested') && isFirstNested(comment)) { - return false; - } - - return primary === 'always'; - })(); - - const before = comment.raws.before || ''; - const hasEmptyLineBefore = hasEmptyLine(before); - - // Return if the expectation is met - if (expectEmptyLineBefore === hasEmptyLineBefore) { - return; - } - - // Fix - if (context.fix) { - if (typeof context.newline !== 'string') return; - - if (expectEmptyLineBefore) { - addEmptyLineBefore(comment, context.newline); - } else { - removeEmptyLinesBefore(comment, context.newline); - } - - return; - } - - const message = expectEmptyLineBefore ? messages.expected : messages.rejected; - - report({ - message, - node: comment, - result, - ruleName, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/comment-no-empty/index.js b/node_modules/stylelint/lib/rules/comment-no-empty/index.js deleted file mode 100644 index 64b4d3752..000000000 --- a/node_modules/stylelint/lib/rules/comment-no-empty/index.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -const isStandardSyntaxComment = require('../../utils/isStandardSyntaxComment'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'comment-no-empty'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected empty comment', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/comment-no-empty', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkComments((comment) => { - // To ignore non-standard comments - if (!isStandardSyntaxComment(comment)) { - return; - } - - // To ignore comments that are not empty - if (comment.text && comment.text.length !== 0) { - return; - } - - report({ - message: messages.rejected, - node: comment, - result, - ruleName, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/comment-pattern/index.js b/node_modules/stylelint/lib/rules/comment-pattern/index.js deleted file mode 100644 index 27226a83c..000000000 --- a/node_modules/stylelint/lib/rules/comment-pattern/index.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'comment-pattern'; - -const messages = ruleMessages(ruleName, { - expected: (pattern) => `Expected comment to match pattern "${pattern}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/comment-pattern', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isRegExp, isString], - }); - - if (!validOptions) { - return; - } - - const normalizedPattern = isString(primary) ? new RegExp(primary) : primary; - - root.walkComments((comment) => { - const text = comment.text; - - if (normalizedPattern.test(text)) { - return; - } - - report({ - message: messages.expected, - messageArgs: [primary], - node: comment, - result, - ruleName, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/comment-whitespace-inside/index.js b/node_modules/stylelint/lib/rules/comment-whitespace-inside/index.js deleted file mode 100644 index 6a84af350..000000000 --- a/node_modules/stylelint/lib/rules/comment-whitespace-inside/index.js +++ /dev/null @@ -1,141 +0,0 @@ -'use strict'; - -const isStandardSyntaxComment = require('../../utils/isStandardSyntaxComment'); -const isWhitespace = require('../../utils/isWhitespace'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'comment-whitespace-inside'; - -const messages = ruleMessages(ruleName, { - expectedOpening: 'Expected whitespace after "/*"', - rejectedOpening: 'Unexpected whitespace after "/*"', - expectedClosing: 'Expected whitespace before "*/"', - rejectedClosing: 'Unexpected whitespace before "*/"', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/comment-whitespace-inside', - fixable: true, -}; - -/** - * @param {import('postcss').Comment} comment - */ -function addWhitespaceBefore(comment) { - if (comment.text.startsWith('*')) { - comment.text = comment.text.replace(/^(\*+)/, `$1 `); - } else { - comment.raws.left = ' '; - } -} - -/** - * @param {import('postcss').Comment} comment - */ -function addWhitespaceAfter(comment) { - if (comment.text[comment.text.length - 1] === '*') { - comment.text = comment.text.replace(/(\*+)$/, ` $1`); - } else { - comment.raws.right = ' '; - } -} - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - root.walkComments((comment) => { - if (!isStandardSyntaxComment(comment)) { - return; - } - - const rawComment = comment.toString(); - const firstFourChars = rawComment.slice(0, 4); - - // Return early if sourcemap or copyright comment - if (/^\/\*[#!]\s/.test(firstFourChars)) { - return; - } - - const leftMatches = rawComment.match(/(^\/\*+)(\s)?/); - - if (leftMatches == null || leftMatches[1] == null) { - throw new Error(`Invalid comment: "${rawComment}"`); - } - - const rightMatches = rawComment.match(/(\s)?(\*+\/)$/); - - if (rightMatches == null || rightMatches[2] == null) { - throw new Error(`Invalid comment: "${rawComment}"`); - } - - const opener = leftMatches[1]; - const leftSpace = leftMatches[2] || ''; - const rightSpace = rightMatches[1] || ''; - const closer = rightMatches[2]; - - if (primary === 'never' && leftSpace !== '') { - complain(messages.rejectedOpening, opener.length); - } - - if (primary === 'always' && !isWhitespace(leftSpace)) { - complain(messages.expectedOpening, opener.length); - } - - if (primary === 'never' && rightSpace !== '') { - complain(messages.rejectedClosing, comment.toString().length - closer.length - 1); - } - - if (primary === 'always' && !isWhitespace(rightSpace)) { - complain(messages.expectedClosing, comment.toString().length - closer.length - 1); - } - - /** - * @param {string} message - * @param {number} index - */ - function complain(message, index) { - if (context.fix) { - if (primary === 'never') { - comment.raws.left = ''; - comment.raws.right = ''; - comment.text = comment.text.replace(/^(\*+)(\s+)?/, '$1').replace(/(\s+)?(\*+)$/, '$2'); - } else { - if (!leftSpace) { - addWhitespaceBefore(comment); - } - - if (!rightSpace) { - addWhitespaceAfter(comment); - } - } - - return; - } - - report({ - message, - index, - result, - ruleName, - node: comment, - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/comment-word-disallowed-list/index.js b/node_modules/stylelint/lib/rules/comment-word-disallowed-list/index.js deleted file mode 100644 index e2ba6737b..000000000 --- a/node_modules/stylelint/lib/rules/comment-word-disallowed-list/index.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -const containsString = require('../../utils/containsString'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'comment-word-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (pattern) => `Unexpected word matching pattern "${pattern}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/comment-word-disallowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkComments((comment) => { - const text = comment.text; - const rawComment = comment.toString(); - const firstFourChars = rawComment.slice(0, 4); - - // Return early if sourcemap - if (firstFourChars === '/*# ') { - return; - } - - const matchesWord = matchesStringOrRegExp(text, primary) || containsString(text, primary); - - if (!matchesWord) { - return; - } - - report({ - message: messages.rejected, - messageArgs: [matchesWord.pattern], - node: comment, - word: matchesWord.substring, - result, - ruleName, - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/custom-media-pattern/index.js b/node_modules/stylelint/lib/rules/custom-media-pattern/index.js deleted file mode 100644 index fae968dc4..000000000 --- a/node_modules/stylelint/lib/rules/custom-media-pattern/index.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'custom-media-pattern'; - -const messages = ruleMessages(ruleName, { - expected: (mediaName, pattern) => `Expected "${mediaName}" to match pattern "${pattern}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/custom-media-pattern', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isRegExp, isString], - }); - - if (!validOptions) { - return; - } - - const regexpPattern = isString(primary) ? new RegExp(primary) : primary; - - root.walkAtRules((atRule) => { - if (atRule.name.toLowerCase() !== 'custom-media') { - return; - } - - const [fullName, customMediaName] = atRule.params.match(/^--(\S+)\b/) || []; - - if (fullName === undefined || customMediaName === undefined) { - throw new Error(`Unexpected at-rule params: "${atRule.params}"`); - } - - if (regexpPattern.test(customMediaName)) { - return; - } - - const index = atRuleParamIndex(atRule); - - report({ - message: messages.expected, - messageArgs: [fullName, primary], - node: atRule, - index, - endIndex: index + fullName.length, - result, - ruleName, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/custom-property-empty-line-before/index.js b/node_modules/stylelint/lib/rules/custom-property-empty-line-before/index.js deleted file mode 100644 index 4d5b0fd00..000000000 --- a/node_modules/stylelint/lib/rules/custom-property-empty-line-before/index.js +++ /dev/null @@ -1,143 +0,0 @@ -'use strict'; - -const addEmptyLineBefore = require('../../utils/addEmptyLineBefore'); -const blockString = require('../../utils/blockString'); -const getPreviousNonSharedLineCommentNode = require('../../utils/getPreviousNonSharedLineCommentNode'); -const hasEmptyLine = require('../../utils/hasEmptyLine'); -const isAfterComment = require('../../utils/isAfterComment'); -const isCustomProperty = require('../../utils/isCustomProperty'); -const isFirstNested = require('../../utils/isFirstNested'); -const isSingleLineString = require('../../utils/isSingleLineString'); -const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); -const optionsMatches = require('../../utils/optionsMatches'); -const removeEmptyLinesBefore = require('../../utils/removeEmptyLinesBefore'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isAtRule, isDeclaration, isRule } = require('../../utils/typeGuards'); - -const ruleName = 'custom-property-empty-line-before'; - -const messages = ruleMessages(ruleName, { - expected: 'Expected empty line before custom property', - rejected: 'Unexpected empty line before custom property', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/custom-property-empty-line-before', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['always', 'never'], - }, - { - actual: secondaryOptions, - possible: { - except: ['first-nested', 'after-comment', 'after-custom-property'], - ignore: ['after-comment', 'first-nested', 'inside-single-line-block'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - const prop = decl.prop; - const parent = decl.parent; - - if (!isStandardSyntaxDeclaration(decl)) { - return; - } - - if (!isCustomProperty(prop)) { - return; - } - - // Optionally ignore the node if a comment precedes it - if (optionsMatches(secondaryOptions, 'ignore', 'after-comment') && isAfterComment(decl)) { - return; - } - - // Optionally ignore the node if it is the first nested - if (optionsMatches(secondaryOptions, 'ignore', 'first-nested') && isFirstNested(decl)) { - return; - } - - // Optionally ignore nodes inside single-line blocks - if ( - optionsMatches(secondaryOptions, 'ignore', 'inside-single-line-block') && - parent != null && - (isAtRule(parent) || isRule(parent)) && - isSingleLineString(blockString(parent)) - ) { - return; - } - - let expectEmptyLineBefore = primary === 'always'; - - // Optionally reverse the expectation if any exceptions apply - if ( - (optionsMatches(secondaryOptions, 'except', 'first-nested') && isFirstNested(decl)) || - (optionsMatches(secondaryOptions, 'except', 'after-comment') && isAfterComment(decl)) || - (optionsMatches(secondaryOptions, 'except', 'after-custom-property') && - isAfterCustomProperty(decl)) - ) { - expectEmptyLineBefore = !expectEmptyLineBefore; - } - - const hasEmptyLineBefore = hasEmptyLine(decl.raws.before); - - // Return if the expectation is met - if (expectEmptyLineBefore === hasEmptyLineBefore) { - return; - } - - // Fix - if (context.fix) { - if (context.newline == null) return; - - if (expectEmptyLineBefore) { - addEmptyLineBefore(decl, context.newline); - } else { - removeEmptyLinesBefore(decl, context.newline); - } - - return; - } - - const message = expectEmptyLineBefore ? messages.expected : messages.rejected; - - report({ - message, - node: decl, - result, - ruleName, - }); - }); - }; -}; - -/** - * @param {import('postcss').Declaration} decl - */ -function isAfterCustomProperty(decl) { - const prevNode = getPreviousNonSharedLineCommentNode(decl); - - return prevNode != null && isDeclaration(prevNode) && isCustomProperty(prevNode.prop); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/custom-property-no-missing-var-function/index.js b/node_modules/stylelint/lib/rules/custom-property-no-missing-var-function/index.js deleted file mode 100644 index f6378ff7f..000000000 --- a/node_modules/stylelint/lib/rules/custom-property-no-missing-var-function/index.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'custom-property-no-missing-var-function'; - -const messages = ruleMessages(ruleName, { - rejected: (customProperty) => `Unexpected missing var function for "${customProperty}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/custom-property-no-missing-var-function', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) return; - - /** @type {Set} */ - const knownCustomProperties = new Set(); - - root.walkAtRules(/^property$/i, (atRule) => { - knownCustomProperties.add(atRule.params); - }); - - root.walkDecls(/^--/, ({ prop }) => { - knownCustomProperties.add(prop); - }); - - root.walkDecls((decl) => { - const { value } = decl; - - if (!value.includes('--')) return; - - const parsedValue = valueParser(value); - - parsedValue.walk((node) => { - if (isVarFunction(node)) return false; - - if (!isDashedIdent(node)) return; - - if (!knownCustomProperties.has(node.value)) return; - - const index = declarationValueIndex(decl) + node.sourceIndex; - const endIndex = index + node.value.length; - - report({ - message: messages.rejected, - messageArgs: [node.value], - node: decl, - index, - endIndex, - result, - ruleName, - }); - - return false; - }); - }); - }; -}; - -/** - * @param {import('postcss-value-parser').Node} node - */ -function isDashedIdent({ type, value }) { - return type === 'word' && value.startsWith('--'); -} - -/** - * @param {import('postcss-value-parser').Node} node - */ -function isVarFunction({ type, value }) { - return type === 'function' && value === 'var'; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/custom-property-pattern/index.js b/node_modules/stylelint/lib/rules/custom-property-pattern/index.js deleted file mode 100644 index 9f8a1dba2..000000000 --- a/node_modules/stylelint/lib/rules/custom-property-pattern/index.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); -const isCustomProperty = require('../../utils/isCustomProperty'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const { isRegExp, isString } = require('../../utils/validateTypes'); -const { isValueFunction } = require('../../utils/typeGuards'); -const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); - -const ruleName = 'custom-property-pattern'; - -const messages = ruleMessages(ruleName, { - expected: (propName, pattern) => `Expected "${propName}" to match pattern "${pattern}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/custom-property-pattern', -}; - -const VAR_FUNC_REGEX = /var\(/i; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isRegExp, isString], - }); - - if (!validOptions) { - return; - } - - const regexpPattern = isString(primary) ? new RegExp(primary) : primary; - - /** - * @param {string} property - * @returns {boolean} - */ - function check(property) { - return ( - !isCustomProperty(property) || - !isStandardSyntaxProperty(property) || - regexpPattern.test(property.slice(2)) - ); - } - - root.walkDecls((decl) => { - const { prop, value } = decl; - - if (VAR_FUNC_REGEX.test(value)) { - const parsedValue = valueParser(value); - - parsedValue.walk((node) => { - if (!isValueFunction(node)) return; - - if (node.value.toLowerCase() !== 'var') return; - - const { nodes } = node; - - const firstNode = nodes[0]; - - if (!firstNode || check(firstNode.value)) return; - - complain(declarationValueIndex(decl) + firstNode.sourceIndex, firstNode.value, decl); - }); - } - - if (check(prop)) return; - - complain(0, prop, decl); - }); - - /** - * @param {number} index - * @param {string} propName - * @param {import('postcss').Declaration} decl - */ - function complain(index, propName, decl) { - report({ - result, - ruleName, - message: messages.expected, - messageArgs: [propName, primary], - node: decl, - index, - endIndex: index + propName.length, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-bang-space-after/index.js b/node_modules/stylelint/lib/rules/declaration-bang-space-after/index.js deleted file mode 100644 index 6ce833433..000000000 --- a/node_modules/stylelint/lib/rules/declaration-bang-space-after/index.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -const declarationBangSpaceChecker = require('../declarationBangSpaceChecker'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'declaration-bang-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected single space after "!"', - rejectedAfter: () => 'Unexpected whitespace after "!"', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-bang-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - declarationBangSpaceChecker({ - root, - result, - locationChecker: checker.after, - checkedRuleName: ruleName, - fix: context.fix - ? (decl, index) => { - let bangIndex = index - declarationValueIndex(decl); - const declValue = getDeclarationValue(decl); - let target; - /** @type {(value: string) => void} */ - let setFixed; - - if (bangIndex < declValue.length) { - target = declValue; - setFixed = (value) => { - setDeclarationValue(decl, value); - }; - } else if (decl.important) { - target = decl.raws.important || ' !important'; - bangIndex -= declValue.length; - setFixed = (value) => { - decl.raws.important = value; - }; - } else { - return false; // not standard - } - - const targetBefore = target.slice(0, bangIndex + 1); - const targetAfter = target.slice(bangIndex + 1); - - if (primary === 'always') { - setFixed(targetBefore + targetAfter.replace(/^\s*/, ' ')); - - return true; - } - - if (primary === 'never') { - setFixed(targetBefore + targetAfter.replace(/^\s*/, '')); - - return true; - } - - return false; - } - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-bang-space-before/index.js b/node_modules/stylelint/lib/rules/declaration-bang-space-before/index.js deleted file mode 100644 index 3d6216f48..000000000 --- a/node_modules/stylelint/lib/rules/declaration-bang-space-before/index.js +++ /dev/null @@ -1,92 +0,0 @@ -'use strict'; - -const declarationBangSpaceChecker = require('../declarationBangSpaceChecker'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'declaration-bang-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before "!"', - rejectedBefore: () => 'Unexpected whitespace before "!"', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-bang-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - declarationBangSpaceChecker({ - root, - result, - locationChecker: checker.before, - checkedRuleName: ruleName, - fix: context.fix - ? (decl, index) => { - let bangIndex = index - declarationValueIndex(decl); - const value = getDeclarationValue(decl); - let target; - /** @type {(val: string) => void} */ - let setFixed; - - if (bangIndex < value.length) { - target = value; - setFixed = (val) => { - setDeclarationValue(decl, val); - }; - } else if (decl.important) { - target = decl.raws.important || ' !important'; - bangIndex -= value.length; - setFixed = (val) => { - decl.raws.important = val; - }; - } else { - return false; // not standard - } - - const targetBefore = target.slice(0, bangIndex); - const targetAfter = target.slice(bangIndex); - - if (primary === 'always') { - // eslint-disable-next-line prefer-template - setFixed(targetBefore.replace(/\s*$/, '') + ' ' + targetAfter); - - return true; - } - - if (primary === 'never') { - setFixed(targetBefore.replace(/\s*$/, '') + targetAfter); - - return true; - } - - return false; - } - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-custom-properties/index.js b/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-custom-properties/index.js deleted file mode 100644 index 4e465f24a..000000000 --- a/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-custom-properties/index.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -const eachDeclarationBlock = require('../../utils/eachDeclarationBlock'); -const isCustomProperty = require('../../utils/isCustomProperty'); -const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const { isRegExp, isString } = require('../../utils/validateTypes'); -const validateOptions = require('../../utils/validateOptions'); -const optionsMatches = require('../../utils/optionsMatches'); - -const ruleName = 'declaration-block-no-duplicate-custom-properties'; - -const messages = ruleMessages(ruleName, { - rejected: (property) => `Unexpected duplicate "${property}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-block-no-duplicate-custom-properties', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignoreProperties: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - eachDeclarationBlock(root, (eachDecl) => { - const decls = new Set(); - - eachDecl((decl) => { - const prop = decl.prop; - - if (!isStandardSyntaxProperty(prop)) { - return; - } - - if (!isCustomProperty(prop)) { - return; - } - - if (optionsMatches(secondaryOptions, 'ignoreProperties', prop)) { - return; - } - - const isDuplicate = decls.has(prop); - - if (isDuplicate) { - report({ - message: messages.rejected, - messageArgs: [prop], - node: decl, - result, - ruleName, - word: prop, - }); - - return; - } - - decls.add(prop); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-properties/index.js b/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-properties/index.js deleted file mode 100644 index cb03facf9..000000000 --- a/node_modules/stylelint/lib/rules/declaration-block-no-duplicate-properties/index.js +++ /dev/null @@ -1,277 +0,0 @@ -'use strict'; - -const { parse, List } = require('css-tree'); -const eachDeclarationBlock = require('../../utils/eachDeclarationBlock'); -const isCustomProperty = require('../../utils/isCustomProperty'); -const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); -const vendor = require('../../utils/vendor'); - -const ruleName = 'declaration-block-no-duplicate-properties'; - -const messages = ruleMessages(ruleName, { - rejected: (property) => `Unexpected duplicate "${property}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-block-no-duplicate-properties', - fixable: true, -}; - -/** @typedef {import('css-tree').CssNode} CssNode */ - -/** @type {(node: CssNode) => node is CssNode & { children: List }} */ -const hasChildren = (node) => 'children' in node && node.children instanceof List; - -/** @type {(node1: CssNode[], node2: CssNode[]) => boolean} */ -const isEqualValueNodes = (nodes1, nodes2) => { - // Different lengths indicate different syntaxes. - if (nodes1.length !== nodes2.length) { - return false; - } - - for (let i = 0; i < nodes1.length; i++) { - const node1 = nodes1[i]; - const node2 = nodes2[i]; - - // Different types indicate different syntaxes. - if (typeof node1 === 'undefined' || typeof node2 === 'undefined' || node1.type !== node2.type) { - return false; - } - - const node1Name = 'name' in node1 ? String(node1.name) : ''; - const node2Name = 'name' in node2 ? String(node2.name) : ''; - - // Custom properties have unknown value syntaxes but are equal for CSS parsers. - if ( - node1.type === 'Identifier' && - isCustomProperty(node1Name) && - node2.type === 'Identifier' && - isCustomProperty(node2Name) - ) { - continue; - } - - // Different ident or function names indicate different syntaxes. - if (node1Name.toLowerCase() !== node2Name.toLowerCase()) { - return false; - } - - const node1Unit = 'unit' in node1 ? node1.unit : ''; - const node2Unit = 'unit' in node2 ? node2.unit : ''; - - // Different units indicate different syntaxes. - if (node1Unit !== node2Unit) { - return false; - } - - const node1Children = hasChildren(node1) ? node1.children.toArray() : null; - const node2Children = hasChildren(node2) ? node2.children.toArray() : null; - - if (Array.isArray(node1Children) && Array.isArray(node2Children)) { - if (isEqualValueNodes(node1Children, node2Children)) { - continue; - } else { - return false; - } - } - } - - return true; -}; - -/** @type {(value1: string, value2: string) => boolean} */ -const isEqualValueSyntaxes = (value1, value2) => { - if (value1 === value2) { - return true; - } - - if (!(isStandardSyntaxValue(value1) && isStandardSyntaxValue(value2))) { - return false; - } - - let value1Node; - let value2Node; - - try { - value1Node = parse(value1, { context: 'value' }); - value2Node = parse(value2, { context: 'value' }); - } catch (error) { - return false; - } - - const node1Children = hasChildren(value1Node) ? value1Node.children.toArray() : []; - const node2Children = hasChildren(value2Node) ? value2Node.children.toArray() : []; - - return isEqualValueNodes(node1Children, node2Children); -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignore: [ - 'consecutive-duplicates', - 'consecutive-duplicates-with-different-values', - 'consecutive-duplicates-with-different-syntaxes', - 'consecutive-duplicates-with-same-prefixless-values', - ], - ignoreProperties: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const ignoreDuplicates = optionsMatches(secondaryOptions, 'ignore', 'consecutive-duplicates'); - const ignoreDiffValues = optionsMatches( - secondaryOptions, - 'ignore', - 'consecutive-duplicates-with-different-values', - ); - const ignoreDiffSyntaxes = optionsMatches( - secondaryOptions, - 'ignore', - 'consecutive-duplicates-with-different-syntaxes', - ); - const ignorePrefixlessSameValues = optionsMatches( - secondaryOptions, - 'ignore', - 'consecutive-duplicates-with-same-prefixless-values', - ); - - eachDeclarationBlock(root, (eachDecl) => { - /** @type {import('postcss').Declaration[]} */ - const decls = []; - - eachDecl((decl) => { - const prop = decl.prop; - const lowerProp = decl.prop.toLowerCase(); - const value = decl.value; - const important = decl.important; - - if (!isStandardSyntaxProperty(prop)) { - return; - } - - if (isCustomProperty(prop)) { - return; - } - - // Return early if the property is to be ignored - if (optionsMatches(secondaryOptions, 'ignoreProperties', prop)) { - return; - } - - // Ignore the src property as commonly duplicated in at-fontface - if (lowerProp === 'src') { - return; - } - - const indexDuplicate = decls.findIndex((d) => d.prop.toLowerCase() === lowerProp); - - if (indexDuplicate === -1) { - decls.push(decl); - } - - const duplicateDecl = decls[indexDuplicate]; - - if (!duplicateDecl) { - return; - } - - const duplicateValue = duplicateDecl.value || ''; - const duplicateImportant = duplicateDecl.important || false; - const duplicateIsMoreImportant = !important && duplicateImportant; - const duplicatesAreConsecutive = indexDuplicate === decls.length - 1; - const unprefixedDuplicatesAreEqual = - vendor.unprefixed(value) === vendor.unprefixed(duplicateValue); - - const fixOrReport = () => { - if (!context.fix) { - return report({ - message: messages.rejected, - messageArgs: [prop], - node: decl, - result, - ruleName, - word: prop, - }); - } - - if (duplicateIsMoreImportant) { - return decl.remove(); - } - - // replace previous "active" decl with current one - decls[indexDuplicate] = decl; - - return duplicateDecl.remove(); - }; - - if (ignoreDiffValues || ignoreDiffSyntaxes || ignorePrefixlessSameValues) { - if ( - !duplicatesAreConsecutive || - (ignorePrefixlessSameValues && !unprefixedDuplicatesAreEqual) - ) { - fixOrReport(); - - return; - } - - if (ignoreDiffSyntaxes) { - const duplicateValueSyntaxesAreEqual = isEqualValueSyntaxes(value, duplicateValue); - - if (duplicateValueSyntaxesAreEqual) { - fixOrReport(); - - return; - } - } - - if (value !== duplicateValue) { - return; - } - - if (context.fix) { - return duplicateDecl.remove(); - } - - return report({ - message: messages.rejected, - messageArgs: [prop], - node: decl, - result, - ruleName, - word: prop, - }); - } - - if (ignoreDuplicates && duplicatesAreConsecutive) { - return; - } - - fixOrReport(); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-no-redundant-longhand-properties/index.js b/node_modules/stylelint/lib/rules/declaration-block-no-redundant-longhand-properties/index.js deleted file mode 100644 index 1457f6ebb..000000000 --- a/node_modules/stylelint/lib/rules/declaration-block-no-redundant-longhand-properties/index.js +++ /dev/null @@ -1,294 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const arrayEqual = require('../../utils/arrayEqual'); -const { basicKeywords } = require('../../reference/keywords'); -const eachDeclarationBlock = require('../../utils/eachDeclarationBlock'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const { longhandSubPropertiesOfShorthandProperties } = require('../../reference/properties'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'declaration-block-no-redundant-longhand-properties'; - -const messages = ruleMessages(ruleName, { - expected: (props) => `Expected shorthand property "${props}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-block-no-redundant-longhand-properties', - fixable: true, -}; - -/** @typedef {import('postcss').Declaration} Declaration */ - -/** @type {Map) => (string | undefined)>} */ -const customResolvers = new Map([ - [ - 'grid-column', - (decls) => { - const start = decls.get('grid-column-start')?.value.trim(); - const end = decls.get('grid-column-end')?.value.trim(); - - if (!start || !end) return; - - return `${start} / ${end}`; - }, - ], - [ - 'grid-row', - (decls) => { - const start = decls.get('grid-row-start')?.value.trim(); - const end = decls.get('grid-row-end')?.value.trim(); - - if (!start || !end) return; - - return `${start} / ${end}`; - }, - ], - [ - 'grid-template', - (decls) => { - const areas = decls.get('grid-template-areas')?.value.trim(); - const columns = decls.get('grid-template-columns')?.value.trim(); - const rows = decls.get('grid-template-rows')?.value.trim(); - - if (!(areas && columns && rows)) return; - - const splitAreas = [...areas.matchAll(/"[^"]+"/g)].map((x) => x[0]); - const splitRows = rows.split(' '); - - if (splitAreas.length === 0 || splitRows.length === 0) return; - - if (splitAreas.length !== splitRows.length) return; - - const zipped = splitAreas.map((area, i) => `${area} ${splitRows[i]}`).join(' '); - - return `${zipped} / ${columns}`; - }, - ], - [ - 'transition', - (decls) => { - /** @type {(input: string | undefined) => string[]} */ - const commaSeparated = (input = '') => { - let trimmedInput = input.trim(); - - if (!trimmedInput) return []; - - if (trimmedInput.indexOf(',') === -1) return [trimmedInput]; - - /** @type {import('postcss-value-parser').ParsedValue} */ - let parsedValue = valueParser(trimmedInput); - /** @type {Array>} */ - let valueParts = []; - - { - /** @type {Array} */ - let currentListItem = []; - - parsedValue.nodes.forEach((node) => { - if (node.type === 'div' && node.value === ',') { - valueParts.push(currentListItem); - currentListItem = []; - - return; - } - - currentListItem.push(node); - }); - - valueParts.push(currentListItem); - } - - return valueParts.map((s) => valueParser.stringify(s).trim()).filter((s) => s.length > 0); - }; - - const delays = commaSeparated(decls.get('transition-delay')?.value); - const durations = commaSeparated(decls.get('transition-duration')?.value); - const timingFunctions = commaSeparated(decls.get('transition-timing-function')?.value); - const properties = commaSeparated(decls.get('transition-property')?.value); - - if (!(delays.length && durations.length && timingFunctions.length && properties.length)) { - return; - } - - // transition-property is the canonical list of the number of properties; - // see spec: https://w3c.github.io/csswg-drafts/css-transitions/#transition-property-property - // if there are more transition-properties than duration/delay/timings, - // the other properties are computed cyclically -- ex with % - // see spec example #3: https://w3c.github.io/csswg-drafts/css-transitions/#example-d94cbd75 - return properties - .map((property, i) => { - return [ - property, - durations[i % durations.length], - timingFunctions[i % timingFunctions.length], - delays[i % delays.length], - ] - .filter(isString) - .join(' '); - }) - .join(', '); - }, - ], -]); - -/** - * @param {string} prefixedShorthandProperty - * @param {string[]} prefixedShorthandData - * @param {Map} transformedDeclarationNodes - * @returns {string | undefined} - */ -const resolveShorthandValue = ( - prefixedShorthandProperty, - prefixedShorthandData, - transformedDeclarationNodes, -) => { - const resolver = customResolvers.get(prefixedShorthandProperty); - - if (resolver === undefined) { - // the "default" resolver: sort the longhand values in the order - // of their properties - const values = prefixedShorthandData - .map((p) => transformedDeclarationNodes.get(p)?.value.trim()) - .filter(Boolean); - - return values.length > 0 ? values.join(' ') : undefined; - } - - return resolver(transformedDeclarationNodes); -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignoreShorthands: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - /** @type {Map} */ - const longhandToShorthands = new Map(); - - for (const [shorthand, longhandProps] of longhandSubPropertiesOfShorthandProperties.entries()) { - if (optionsMatches(secondaryOptions, 'ignoreShorthands', shorthand)) { - continue; - } - - for (const longhand of longhandProps) { - const shorthands = longhandToShorthands.get(longhand) || []; - - shorthands.push(shorthand); - longhandToShorthands.set(longhand, shorthands); - } - } - - eachDeclarationBlock(root, (eachDecl) => { - /** @type {Map} */ - const longhandDeclarations = new Map(); - /** @type {Map} */ - const longhandDeclarationNodes = new Map(); - - eachDecl((decl) => { - // basic keywords are not allowed in shorthand properties - if (basicKeywords.has(decl.value)) { - return; - } - - const prop = decl.prop.toLowerCase(); - const unprefixedProp = vendor.unprefixed(prop); - const prefix = vendor.prefix(prop); - - const shorthandProperties = longhandToShorthands.get(unprefixedProp); - - if (!shorthandProperties) { - return; - } - - for (const shorthandProperty of shorthandProperties) { - const prefixedShorthandProperty = prefix + shorthandProperty; - const longhandDeclaration = longhandDeclarations.get(prefixedShorthandProperty) || []; - const longhandDeclarationNode = - longhandDeclarationNodes.get(prefixedShorthandProperty) || []; - - longhandDeclaration.push(prop); - longhandDeclarations.set(prefixedShorthandProperty, longhandDeclaration); - - longhandDeclarationNode.push(decl); - longhandDeclarationNodes.set(prefixedShorthandProperty, longhandDeclarationNode); - - const shorthandProps = longhandSubPropertiesOfShorthandProperties.get(shorthandProperty); - const prefixedShorthandData = Array.from(shorthandProps || []).map( - (item) => prefix + item, - ); - - const copiedPrefixedShorthandData = [...prefixedShorthandData]; - - if (!arrayEqual(copiedPrefixedShorthandData.sort(), longhandDeclaration.sort())) { - continue; - } - - if (context.fix) { - const declNodes = longhandDeclarationNodes.get(prefixedShorthandProperty) || []; - const [firstDeclNode] = declNodes; - - if (firstDeclNode) { - const transformedDeclarationNodes = new Map( - declNodes.map((d) => [d.prop.toLowerCase(), d]), - ); - const resolvedShorthandValue = resolveShorthandValue( - prefixedShorthandProperty, - prefixedShorthandData, - transformedDeclarationNodes, - ); - - if (resolvedShorthandValue) { - const newShorthandDeclarationNode = firstDeclNode.clone({ - prop: prefixedShorthandProperty, - value: resolvedShorthandValue, - }); - - firstDeclNode.replaceWith(newShorthandDeclarationNode); - - declNodes.forEach((node) => node.remove()); - - return; - } - } - } - - report({ - ruleName, - result, - node: decl, - word: decl.prop, - message: messages.expected, - messageArgs: [prefixedShorthandProperty], - }); - } - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/index.js b/node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/index.js deleted file mode 100644 index db75f18a9..000000000 --- a/node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/index.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -const eachDeclarationBlock = require('../../utils/eachDeclarationBlock'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const { longhandSubPropertiesOfShorthandProperties } = require('../../reference/properties'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); - -const ruleName = 'declaration-block-no-shorthand-property-overrides'; - -const messages = ruleMessages(ruleName, { - rejected: (shorthand, original) => `Unexpected shorthand "${shorthand}" after "${original}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-block-no-shorthand-property-overrides', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - eachDeclarationBlock(root, (eachDecl) => { - /** @type {Map} */ - const declarations = new Map(); - - eachDecl((decl) => { - const prop = decl.prop; - const unprefixedProp = vendor.unprefixed(prop).toLowerCase(); - const prefix = vendor.prefix(prop).toLowerCase(); - - const overrideables = /** @type {Map>} */ ( - longhandSubPropertiesOfShorthandProperties - ).get(unprefixedProp); - - if (!overrideables) { - declarations.set(prop.toLowerCase(), prop); - - return; - } - - for (const longhandProp of overrideables) { - const declaration = declarations.get(prefix + longhandProp); - - if (!declaration) { - continue; - } - - report({ - ruleName, - result, - node: decl, - message: messages.rejected, - messageArgs: [prop, declaration || ''], - word: prop, - }); - } - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-after/index.js b/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-after/index.js deleted file mode 100644 index fa218039b..000000000 --- a/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-after/index.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict'; - -const blockString = require('../../utils/blockString'); -const nextNonCommentNode = require('../../utils/nextNonCommentNode'); -const rawNodeString = require('../../utils/rawNodeString'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); -const { isAtRule, isRule } = require('../../utils/typeGuards'); - -const ruleName = 'declaration-block-semicolon-newline-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected newline after ";"', - expectedAfterMultiLine: () => 'Expected newline after ";" in a multi-line declaration block', - rejectedAfterMultiLine: () => 'Unexpected newline after ";" in a multi-line declaration block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-block-semicolon-newline-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line', 'never-multi-line'], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - // Ignore last declaration if there's no trailing semicolon - const parentRule = decl.parent; - - if (!parentRule) throw new Error('A parent node must be present'); - - if (!isAtRule(parentRule) && !isRule(parentRule)) { - return; - } - - if (!parentRule.raws.semicolon && parentRule.last === decl) { - return; - } - - const nextNode = decl.next(); - - if (!nextNode) { - return; - } - - // Allow end-of-line comment - const nodeToCheck = nextNonCommentNode(nextNode); - - if (!nodeToCheck) { - return; - } - - checker.afterOneOnly({ - source: rawNodeString(nodeToCheck), - index: -1, - lineCheckStr: blockString(parentRule), - err: (m) => { - if (context.fix) { - if (primary.startsWith('always')) { - const index = nodeToCheck.raws.before.search(/\r?\n/); - - nodeToCheck.raws.before = - index >= 0 - ? nodeToCheck.raws.before.slice(index) - : context.newline + nodeToCheck.raws.before; - - return; - } - - if (primary === 'never-multi-line') { - nodeToCheck.raws.before = ''; - - return; - } - } - - report({ - message: m, - node: decl, - index: decl.toString().length + 1, - result, - ruleName, - }); - }, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-before/index.js b/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-before/index.js deleted file mode 100644 index 9e75fb293..000000000 --- a/node_modules/stylelint/lib/rules/declaration-block-semicolon-newline-before/index.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -const blockString = require('../../utils/blockString'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); -const { isAtRule, isRule } = require('../../utils/typeGuards'); - -const ruleName = 'declaration-block-semicolon-newline-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected newline before ";"', - expectedBeforeMultiLine: () => 'Expected newline before ";" in a multi-line declaration block', - rejectedBeforeMultiLine: () => - 'Unexpected whitespace before ";" in a multi-line declaration block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-block-semicolon-newline-before', - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line', 'never-multi-line'], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - const parentRule = decl.parent; - - if (!parentRule) throw new Error('A parent node must be present'); - - if (!isAtRule(parentRule) && !isRule(parentRule)) { - return; - } - - if (!parentRule.raws.semicolon && parentRule.last === decl) { - return; - } - - const declString = decl.toString(); - - checker.beforeAllowingIndentation({ - source: declString, - index: declString.length, - lineCheckStr: blockString(parentRule), - err: (m) => { - report({ - message: m, - node: decl, - index: decl.toString().length - 1, - result, - ruleName, - }); - }, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-semicolon-space-after/index.js b/node_modules/stylelint/lib/rules/declaration-block-semicolon-space-after/index.js deleted file mode 100644 index 97a16bdc2..000000000 --- a/node_modules/stylelint/lib/rules/declaration-block-semicolon-space-after/index.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict'; - -const blockString = require('../../utils/blockString'); -const rawNodeString = require('../../utils/rawNodeString'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); -const { isAtRule, isRule } = require('../../utils/typeGuards'); - -const ruleName = 'declaration-block-semicolon-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected single space after ";"', - rejectedAfter: () => 'Unexpected whitespace after ";"', - expectedAfterSingleLine: () => - 'Expected single space after ";" in a single-line declaration block', - rejectedAfterSingleLine: () => - 'Unexpected whitespace after ";" in a single-line declaration block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-block-semicolon-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never', 'always-single-line', 'never-single-line'], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - // Ignore last declaration if there's no trailing semicolon - const parentRule = decl.parent; - - if (!parentRule) throw new Error('A parent node must be present'); - - if (!isAtRule(parentRule) && !isRule(parentRule)) { - return; - } - - if (!parentRule.raws.semicolon && parentRule.last === decl) { - return; - } - - const nextDecl = decl.next(); - - if (!nextDecl) { - return; - } - - checker.after({ - source: rawNodeString(nextDecl), - index: -1, - lineCheckStr: blockString(parentRule), - err: (m) => { - if (context.fix) { - if (primary.startsWith('always')) { - nextDecl.raws.before = ' '; - - return; - } - - if (primary.startsWith('never')) { - nextDecl.raws.before = ''; - - return; - } - } - - report({ - message: m, - node: decl, - index: decl.toString().length + 1, - result, - ruleName, - }); - }, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-semicolon-space-before/index.js b/node_modules/stylelint/lib/rules/declaration-block-semicolon-space-before/index.js deleted file mode 100644 index 56426dc3b..000000000 --- a/node_modules/stylelint/lib/rules/declaration-block-semicolon-space-before/index.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -const blockString = require('../../utils/blockString'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); -const { isAtRule, isRule } = require('../../utils/typeGuards'); - -const ruleName = 'declaration-block-semicolon-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before ";"', - rejectedBefore: () => 'Unexpected whitespace before ";"', - expectedBeforeSingleLine: () => - 'Expected single space before ";" in a single-line declaration block', - rejectedBeforeSingleLine: () => - 'Unexpected whitespace before ";" in a single-line declaration block', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-block-semicolon-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never', 'always-single-line', 'never-single-line'], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - // Ignore last declaration if there's no trailing semicolon - const parentRule = decl.parent; - - if (!parentRule) throw new Error('A parent node must be present'); - - if (!isAtRule(parentRule) && !isRule(parentRule)) { - return; - } - - if (!parentRule.raws.semicolon && parentRule.last === decl) { - return; - } - - const declString = decl.toString(); - - checker.before({ - source: declString, - index: declString.length, - lineCheckStr: blockString(parentRule), - err: (m) => { - if (context.fix) { - const value = getDeclarationValue(decl); - - if (primary.startsWith('always')) { - if (decl.important) { - decl.raws.important = ' !important '; - } else { - setDeclarationValue(decl, value.replace(/\s*$/, ' ')); - } - - return; - } - - if (primary.startsWith('never')) { - if (decl.raws.important) { - decl.raws.important = decl.raws.important.replace(/\s*$/, ''); - } else { - setDeclarationValue(decl, value.replace(/\s*$/, '')); - } - - return; - } - } - - report({ - message: m, - node: decl, - index: decl.toString().length - 1, - result, - ruleName, - }); - }, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-single-line-max-declarations/index.js b/node_modules/stylelint/lib/rules/declaration-block-single-line-max-declarations/index.js deleted file mode 100644 index be9498565..000000000 --- a/node_modules/stylelint/lib/rules/declaration-block-single-line-max-declarations/index.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -const blockString = require('../../utils/blockString'); -const isSingleLineString = require('../../utils/isSingleLineString'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isNumber } = require('../../utils/validateTypes'); - -const ruleName = 'declaration-block-single-line-max-declarations'; - -const messages = ruleMessages(ruleName, { - expected: (max) => `Expected no more than ${max} ${max === 1 ? 'declaration' : 'declarations'}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-block-single-line-max-declarations', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isNumber], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - const block = blockString(ruleNode); - - if (!isSingleLineString(block)) { - return; - } - - if (!ruleNode.nodes) { - return; - } - - const decls = ruleNode.nodes.filter((node) => node.type === 'decl'); - - if (decls.length <= primary) { - return; - } - - report({ - message: messages.expected, - messageArgs: [primary], - node: ruleNode, - word: block, - result, - ruleName, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-block-trailing-semicolon/index.js b/node_modules/stylelint/lib/rules/declaration-block-trailing-semicolon/index.js deleted file mode 100644 index acc45e646..000000000 --- a/node_modules/stylelint/lib/rules/declaration-block-trailing-semicolon/index.js +++ /dev/null @@ -1,146 +0,0 @@ -'use strict'; - -const hasBlock = require('../../utils/hasBlock'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const { isAtRule } = require('../../utils/typeGuards'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'declaration-block-trailing-semicolon'; - -const messages = ruleMessages(ruleName, { - expected: 'Expected a trailing semicolon', - rejected: 'Unexpected trailing semicolon', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-block-trailing-semicolon', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['always', 'never'], - }, - { - actual: secondaryOptions, - possible: { - ignore: ['single-declaration'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkAtRules((atRule) => { - if (!atRule.parent) throw new Error('A parent node must be present'); - - if (atRule.parent === root) { - return; - } - - if (atRule !== atRule.parent.last) { - return; - } - - if (hasBlock(atRule)) { - return; - } - - checkLastNode(atRule); - }); - - root.walkDecls((decl) => { - if (!decl.parent) throw new Error('A parent node must be present'); - - if (decl.parent.type === 'object') { - return; - } - - if (decl !== decl.parent.last) { - return; - } - - checkLastNode(decl); - }); - - /** - * @param {import('postcss').Node} node - */ - function checkLastNode(node) { - if (!node.parent) throw new Error('A parent node must be present'); - - const hasSemicolon = node.parent.raws.semicolon; - const ignoreSingleDeclaration = optionsMatches( - secondaryOptions, - 'ignore', - 'single-declaration', - ); - - if (ignoreSingleDeclaration && node.parent.first === node) { - return; - } - - let message; - - if (primary === 'always') { - if (hasSemicolon) { - return; - } - - // auto-fix - if (context.fix) { - node.parent.raws.semicolon = true; - - if (isAtRule(node)) { - node.raws.between = ''; - node.parent.raws.after = ' '; - } - - return; - } - - message = messages.expected; - } else if (primary === 'never') { - if (!hasSemicolon) { - return; - } - - // auto-fix - if (context.fix) { - node.parent.raws.semicolon = false; - - return; - } - - message = messages.rejected; - } else { - throw new Error(`Unexpected primary option: "${primary}"`); - } - - report({ - message, - node, - index: node.toString().trim().length - 1, - result, - ruleName, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-colon-newline-after/index.js b/node_modules/stylelint/lib/rules/declaration-colon-newline-after/index.js deleted file mode 100644 index acfa40465..000000000 --- a/node_modules/stylelint/lib/rules/declaration-colon-newline-after/index.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'declaration-colon-newline-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected newline after ":"', - expectedAfterMultiLine: () => 'Expected newline after ":" with a multi-line declaration', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-colon-newline-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line'], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (!isStandardSyntaxDeclaration(decl)) { - return; - } - - // Get the raw prop, and only the prop - const endOfPropIndex = declarationValueIndex(decl) + (decl.raws.between || '').length - 1; - - // The extra characters tacked onto the end ensure that there is a character to check - // after the colon. Otherwise, with `background:pink` the character after the - const propPlusColon = `${decl.toString().slice(0, endOfPropIndex)}xxx`; - - for (let i = 0, l = propPlusColon.length; i < l; i++) { - if (propPlusColon[i] !== ':') { - continue; - } - - const indexToCheck = /^[^\S\r\n]*\/\*/.test(propPlusColon.slice(i + 1)) - ? propPlusColon.indexOf('*/', i) + 1 - : i; - - checker.afterOneOnly({ - source: propPlusColon, - index: indexToCheck, - lineCheckStr: decl.value, - err: (m) => { - if (context.fix) { - const between = decl.raws.between; - - if (between == null) throw new Error('`between` must be present'); - - const betweenStart = declarationValueIndex(decl) - between.length; - const sliceIndex = indexToCheck - betweenStart + 1; - const betweenBefore = between.slice(0, sliceIndex); - const betweenAfter = between.slice(sliceIndex); - - decl.raws.between = /^\s*\n/.test(betweenAfter) - ? betweenBefore + betweenAfter.replace(/^[^\S\r\n]*/, '') - : betweenBefore + context.newline + betweenAfter; - - return; - } - - report({ - message: m, - node: decl, - index: indexToCheck, - result, - ruleName, - }); - }, - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-colon-space-after/index.js b/node_modules/stylelint/lib/rules/declaration-colon-space-after/index.js deleted file mode 100644 index 93bda5ffc..000000000 --- a/node_modules/stylelint/lib/rules/declaration-colon-space-after/index.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -const declarationColonSpaceChecker = require('../declarationColonSpaceChecker'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'declaration-colon-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected single space after ":"', - rejectedAfter: () => 'Unexpected whitespace after ":"', - expectedAfterSingleLine: () => 'Expected single space after ":" with a single-line declaration', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-colon-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never', 'always-single-line'], - }); - - if (!validOptions) { - return; - } - - declarationColonSpaceChecker({ - root, - result, - locationChecker: checker.after, - checkedRuleName: ruleName, - fix: context.fix - ? (decl, index) => { - const colonIndex = index - declarationValueIndex(decl); - const between = decl.raws.between; - - if (between == null) throw new Error('`between` must be present'); - - if (primary.startsWith('always')) { - decl.raws.between = - between.slice(0, colonIndex) + between.slice(colonIndex).replace(/^:\s*/, ': '); - - return true; - } - - if (primary === 'never') { - decl.raws.between = - between.slice(0, colonIndex) + between.slice(colonIndex).replace(/^:\s*/, ':'); - - return true; - } - - return false; - } - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-colon-space-before/index.js b/node_modules/stylelint/lib/rules/declaration-colon-space-before/index.js deleted file mode 100644 index 38e896695..000000000 --- a/node_modules/stylelint/lib/rules/declaration-colon-space-before/index.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -const declarationColonSpaceChecker = require('../declarationColonSpaceChecker'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'declaration-colon-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before ":"', - rejectedBefore: () => 'Unexpected whitespace before ":"', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-colon-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - declarationColonSpaceChecker({ - root, - result, - locationChecker: checker.before, - checkedRuleName: ruleName, - fix: context.fix - ? (decl, index) => { - const colonIndex = index - declarationValueIndex(decl); - const between = decl.raws.between; - - if (between == null) throw new Error('`between` must be present'); - - if (primary === 'always') { - decl.raws.between = - between.slice(0, colonIndex).replace(/\s*$/, ' ') + between.slice(colonIndex); - - return true; - } - - if (primary === 'never') { - decl.raws.between = - between.slice(0, colonIndex).replace(/\s*$/, '') + between.slice(colonIndex); - - return true; - } - - return false; - } - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-empty-line-before/index.js b/node_modules/stylelint/lib/rules/declaration-empty-line-before/index.js deleted file mode 100644 index 0837b3bb9..000000000 --- a/node_modules/stylelint/lib/rules/declaration-empty-line-before/index.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; - -const addEmptyLineBefore = require('../../utils/addEmptyLineBefore'); -const blockString = require('../../utils/blockString'); -const hasEmptyLine = require('../../utils/hasEmptyLine'); -const isAfterComment = require('../../utils/isAfterComment'); -const isAfterStandardPropertyDeclaration = require('../../utils/isAfterStandardPropertyDeclaration'); -const isCustomProperty = require('../../utils/isCustomProperty'); -const isFirstNested = require('../../utils/isFirstNested'); -const isFirstNodeOfRoot = require('../../utils/isFirstNodeOfRoot'); -const isSingleLineString = require('../../utils/isSingleLineString'); -const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); -const optionsMatches = require('../../utils/optionsMatches'); -const removeEmptyLinesBefore = require('../../utils/removeEmptyLinesBefore'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isAtRule, isRule, isRoot } = require('../../utils/typeGuards'); - -const ruleName = 'declaration-empty-line-before'; - -const messages = ruleMessages(ruleName, { - expected: 'Expected empty line before declaration', - rejected: 'Unexpected empty line before declaration', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-empty-line-before', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['always', 'never'], - }, - { - actual: secondaryOptions, - possible: { - except: ['first-nested', 'after-comment', 'after-declaration'], - ignore: [ - 'after-comment', - 'after-declaration', - 'first-nested', - 'inside-single-line-block', - ], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - const prop = decl.prop; - const parent = decl.parent; - - if (parent == null) { - return; - } - - // Ignore the first node - if (isFirstNodeOfRoot(decl)) { - return; - } - - if (!isAtRule(parent) && !isRule(parent) && !isRoot(parent)) { - return; - } - - if (!isStandardSyntaxDeclaration(decl)) { - return; - } - - if (isCustomProperty(prop)) { - return; - } - - // Optionally ignore the node if a comment precedes it - if (optionsMatches(secondaryOptions, 'ignore', 'after-comment') && isAfterComment(decl)) { - return; - } - - // Optionally ignore the node if a declaration precedes it - if ( - optionsMatches(secondaryOptions, 'ignore', 'after-declaration') && - isAfterStandardPropertyDeclaration(decl) - ) { - return; - } - - // Optionally ignore the node if it is the first nested - if (optionsMatches(secondaryOptions, 'ignore', 'first-nested') && isFirstNested(decl)) { - return; - } - - // Optionally ignore nodes inside single-line blocks - if ( - optionsMatches(secondaryOptions, 'ignore', 'inside-single-line-block') && - isSingleLineString(blockString(parent)) - ) { - return; - } - - let expectEmptyLineBefore = primary === 'always'; - - // Optionally reverse the expectation if any exceptions apply - if ( - (optionsMatches(secondaryOptions, 'except', 'first-nested') && isFirstNested(decl)) || - (optionsMatches(secondaryOptions, 'except', 'after-comment') && isAfterComment(decl)) || - (optionsMatches(secondaryOptions, 'except', 'after-declaration') && - isAfterStandardPropertyDeclaration(decl)) - ) { - expectEmptyLineBefore = !expectEmptyLineBefore; - } - - // Check for at least one empty line - const hasEmptyLineBefore = hasEmptyLine(decl.raws.before); - - // Return if the expectation is met - if (expectEmptyLineBefore === hasEmptyLineBefore) { - return; - } - - // Fix - if (context.fix) { - if (context.newline == null) return; - - if (expectEmptyLineBefore) { - addEmptyLineBefore(decl, context.newline); - } else { - removeEmptyLinesBefore(decl, context.newline); - } - - return; - } - - const message = expectEmptyLineBefore ? messages.expected : messages.rejected; - - report({ message, node: decl, result, ruleName }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-no-important/index.js b/node_modules/stylelint/lib/rules/declaration-no-important/index.js deleted file mode 100644 index b6b16e338..000000000 --- a/node_modules/stylelint/lib/rules/declaration-no-important/index.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -const getImportantPosition = require('../../utils/getImportantPosition'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { assert } = require('../../utils/validateTypes'); - -const ruleName = 'declaration-no-important'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected !important', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-no-important', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (!decl.important) { - return; - } - - const pos = getImportantPosition(decl.toString()); - - assert(pos); - - report({ - message: messages.rejected, - node: decl, - index: pos.index, - endIndex: pos.endIndex, - result, - ruleName, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-property-max-values/index.js b/node_modules/stylelint/lib/rules/declaration-property-max-values/index.js deleted file mode 100644 index 1e57e96c2..000000000 --- a/node_modules/stylelint/lib/rules/declaration-property-max-values/index.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const vendor = require('../../utils/vendor'); -const validateOptions = require('../../utils/validateOptions'); -const { isNumber, assertNumber } = require('../../utils/validateTypes'); -const validateObjectWithProps = require('../../utils/validateObjectWithProps'); - -const ruleName = 'declaration-property-max-values'; - -const messages = ruleMessages(ruleName, { - rejected: (property, max) => - `Expected "${property}" to have no more than ${max} ${max === 1 ? 'value' : 'values'}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-property-max-values', -}; - -/** - * @param {valueParser.Node} node - */ -const isValueNode = (node) => { - return node.type === 'word' || node.type === 'function' || node.type === 'string'; -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [validateObjectWithProps(isNumber)], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - const { prop, value } = decl; - const propLength = valueParser(value).nodes.filter(isValueNode).length; - - const unprefixedProp = vendor.unprefixed(prop); - const propKey = Object.keys(primary).find((propIdentifier) => - matchesStringOrRegExp(unprefixedProp, propIdentifier), - ); - - if (!propKey) { - return; - } - - const max = primary[propKey]; - - assertNumber(max); - - if (propLength <= max) { - return; - } - - report({ - message: messages.rejected, - messageArgs: [prop, max], - node: decl, - result, - ruleName, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-property-unit-allowed-list/index.js b/node_modules/stylelint/lib/rules/declaration-property-unit-allowed-list/index.js deleted file mode 100644 index 89453350b..000000000 --- a/node_modules/stylelint/lib/rules/declaration-property-unit-allowed-list/index.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDimension = require('../../utils/getDimension'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); -const validateOptions = require('../../utils/validateOptions'); -const { isString } = require('../../utils/validateTypes'); -const vendor = require('../../utils/vendor'); - -const ruleName = 'declaration-property-unit-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (property, unit) => `Unexpected unit "${unit}" for property "${property}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-property-unit-allowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [validateObjectWithArrayProps(isString)], - }, - { - actual: secondaryOptions, - possible: { - ignore: ['inside-function'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - const prop = decl.prop; - const value = decl.value; - - const unprefixedProp = vendor.unprefixed(prop); - - const propKey = Object.keys(primary).find((propIdentifier) => - matchesStringOrRegExp(unprefixedProp, propIdentifier), - ); - - if (!propKey) { - return; - } - - const propValue = primary[propKey]; - - if (!propValue) { - return; - } - - const propList = new Set([propValue].flat()); - - valueParser(value).walk((node) => { - // Ignore wrong units within `url` function - if (node.type === 'function') { - if (node.value.toLowerCase() === 'url') { - return false; - } - - if (optionsMatches(secondaryOptions, 'ignore', 'inside-function')) { - return false; - } - } - - if (node.type === 'string') { - return; - } - - const { unit } = getDimension(node); - - if (!unit || propList.has(unit.toLowerCase())) { - return; - } - - const index = declarationValueIndex(decl) + node.sourceIndex; - const endIndex = index + node.value.length; - - report({ - message: messages.rejected, - messageArgs: [prop, unit], - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-property-unit-disallowed-list/index.js b/node_modules/stylelint/lib/rules/declaration-property-unit-disallowed-list/index.js deleted file mode 100644 index 6b13e30a5..000000000 --- a/node_modules/stylelint/lib/rules/declaration-property-unit-disallowed-list/index.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDimension = require('../../utils/getDimension'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); -const validateOptions = require('../../utils/validateOptions'); -const { isString } = require('../../utils/validateTypes'); -const vendor = require('../../utils/vendor'); - -const ruleName = 'declaration-property-unit-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (property, unit) => `Unexpected unit "${unit}" for property "${property}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-property-unit-disallowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [validateObjectWithArrayProps(isString)], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - const prop = decl.prop; - const value = decl.value; - - const unprefixedProp = vendor.unprefixed(prop); - - const propKey = Object.keys(primary).find((propIdentifier) => - matchesStringOrRegExp(unprefixedProp, propIdentifier), - ); - - if (!propKey) { - return; - } - - const propValue = primary[propKey]; - - if (!propValue) { - return; - } - - const propList = new Set([propValue].flat()); - - valueParser(value).walk((node) => { - // Ignore wrong units within `url` function - if (node.type === 'function' && node.value.toLowerCase() === 'url') { - return false; - } - - if (node.type === 'string') { - return; - } - - const { unit } = getDimension(node); - - if (!unit || !propList.has(unit.toLowerCase())) { - return; - } - - const index = declarationValueIndex(decl) + node.sourceIndex; - const endIndex = index + node.value.length; - - report({ - message: messages.rejected, - messageArgs: [prop, unit], - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-property-value-allowed-list/index.js b/node_modules/stylelint/lib/rules/declaration-property-value-allowed-list/index.js deleted file mode 100644 index 5f52e3f16..000000000 --- a/node_modules/stylelint/lib/rules/declaration-property-value-allowed-list/index.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); -const validateOptions = require('../../utils/validateOptions'); -const { isString, isRegExp } = require('../../utils/validateTypes'); -const vendor = require('../../utils/vendor'); - -const ruleName = 'declaration-property-value-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (property, value) => `Unexpected value "${value}" for property "${property}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-property-value-allowed-list', -}; - -/** @type {import('stylelint').Rule>>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [validateObjectWithArrayProps(isString, isRegExp)], - }); - - if (!validOptions) { - return; - } - - const propKeys = Object.keys(primary); - - root.walkDecls((decl) => { - const { prop, value } = decl; - - const unprefixedProp = vendor.unprefixed(prop); - const propPatterns = propKeys.filter((key) => matchesStringOrRegExp(unprefixedProp, key)); - - if (propPatterns.length === 0) { - return; - } - - if (propPatterns.some((pattern) => optionsMatches(primary, pattern, value))) { - return; - } - - const index = declarationValueIndex(decl); - const endIndex = index + decl.value.length; - - report({ - message: messages.rejected, - messageArgs: [prop, value], - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-property-value-disallowed-list/index.js b/node_modules/stylelint/lib/rules/declaration-property-value-disallowed-list/index.js deleted file mode 100644 index b7bd7439d..000000000 --- a/node_modules/stylelint/lib/rules/declaration-property-value-disallowed-list/index.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); -const validateOptions = require('../../utils/validateOptions'); -const { isString, isRegExp } = require('../../utils/validateTypes'); -const vendor = require('../../utils/vendor'); - -const ruleName = 'declaration-property-value-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (property, value) => `Unexpected value "${value}" for property "${property}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-property-value-disallowed-list', -}; - -/** @type {import('stylelint').Rule>>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [validateObjectWithArrayProps(isString, isRegExp)], - }); - - if (!validOptions) { - return; - } - - const propKeys = Object.keys(primary); - - root.walkDecls((decl) => { - const { prop, value } = decl; - - const unprefixedProp = vendor.unprefixed(prop); - const propPatterns = propKeys.filter((key) => matchesStringOrRegExp(unprefixedProp, key)); - - if (propPatterns.length === 0) { - return; - } - - if (propPatterns.every((pattern) => !optionsMatches(primary, pattern, value))) { - return; - } - - const index = declarationValueIndex(decl); - const endIndex = index + decl.value.length; - - report({ - message: messages.rejected, - messageArgs: [prop, value], - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declaration-property-value-no-unknown/index.js b/node_modules/stylelint/lib/rules/declaration-property-value-no-unknown/index.js deleted file mode 100644 index 46153e672..000000000 --- a/node_modules/stylelint/lib/rules/declaration-property-value-no-unknown/index.js +++ /dev/null @@ -1,166 +0,0 @@ -'use strict'; - -const { isPlainObject } = require('is-plain-object'); -const { fork, parse, find } = require('css-tree'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); -const isCustomProperty = require('../../utils/isCustomProperty'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); -const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); -const { isAtRule } = require('../../utils/typeGuards'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'declaration-property-value-no-unknown'; - -const messages = ruleMessages(ruleName, { - rejected: (property, value) => `Unexpected unknown value "${value}" for property "${property}"`, - rejectedParseError: (property, value) => - `Cannot parse property value "${value}" for property "${property}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/declaration-property-value-no-unknown', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignoreProperties: [validateObjectWithArrayProps(isString, isRegExp)], - propertiesSyntax: [isPlainObject], - typesSyntax: [isPlainObject], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const ignoreProperties = Array.from( - Object.entries((secondaryOptions && secondaryOptions.ignoreProperties) || {}), - ); - - /** @type {(name: string, propValue: string) => boolean} */ - const isPropIgnored = (name, value) => { - const [, valuePattern] = - ignoreProperties.find(([namePattern]) => matchesStringOrRegExp(name, namePattern)) || []; - - return valuePattern && matchesStringOrRegExp(value, valuePattern); - }; - - const propertiesSyntax = (secondaryOptions && secondaryOptions.propertiesSyntax) || {}; - const typesSyntax = (secondaryOptions && secondaryOptions.typesSyntax) || {}; - - const forkedLexer = fork({ - properties: propertiesSyntax, - types: typesSyntax, - }).lexer; - - root.walkDecls((decl) => { - const { prop, value, parent } = decl; - - // NOTE: CSSTree's `fork()` doesn't support `-moz-initial`, but it may be possible in the future. - // See https://github.com/stylelint/stylelint/pull/6511#issuecomment-1412921062 - if (/^-moz-initial$/i.test(value)) return; - - if (!isStandardSyntaxDeclaration(decl)) return; - - if (!isStandardSyntaxProperty(prop)) return; - - if (!isStandardSyntaxValue(value)) return; - - if (isCustomProperty(prop)) return; - - if (isPropIgnored(prop, value)) return; - - /** @type {import('css-tree').CssNode} */ - let cssTreeValueNode; - - try { - cssTreeValueNode = parse(value, { context: 'value' }); - - if (containsUnsupportedFunction(cssTreeValueNode)) return; - } catch (e) { - const index = declarationValueIndex(decl); - const endIndex = index + value.length; - - report({ - message: messages.rejectedParseError(prop, value), - node: decl, - index, - endIndex, - result, - ruleName, - }); - - return; - } - - const { error } = - parent && isAtRule(parent) - ? forkedLexer.matchAtruleDescriptor(parent.name, prop, cssTreeValueNode) - : forkedLexer.matchProperty(prop, cssTreeValueNode); - - if (!error) return; - - if (!('mismatchLength' in error)) return; - - const { mismatchLength, mismatchOffset, name, rawMessage } = error; - - if (name !== 'SyntaxMatchError') return; - - if (rawMessage !== 'Mismatch') return; - - const mismatchValue = value.slice(mismatchOffset, mismatchOffset + mismatchLength); - const index = declarationValueIndex(decl) + mismatchOffset; - const endIndex = index + mismatchLength; - - report({ - message: messages.rejected(prop, mismatchValue), - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - }; -}; - -/** - * TODO: This function avoids false positives because CSSTree doesn't fully support - * some math functions like `clamp()` via `fork()`. In the future, it may be unnecessary. - * - * @see https://github.com/stylelint/stylelint/pull/6511#issuecomment-1412921062 - * @see https://github.com/stylelint/stylelint/issues/6635#issuecomment-1425787649 - * - * @param {import('css-tree').CssNode} cssTreeNode - * @returns {boolean} - */ -function containsUnsupportedFunction(cssTreeNode) { - return Boolean( - find( - cssTreeNode, - (node) => node.type === 'Function' && ['clamp', 'min', 'max', 'env'].includes(node.name), - ), - ); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/declarationBangSpaceChecker.js b/node_modules/stylelint/lib/rules/declarationBangSpaceChecker.js deleted file mode 100644 index ad17cd22f..000000000 --- a/node_modules/stylelint/lib/rules/declarationBangSpaceChecker.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../utils/declarationValueIndex'); -const report = require('../utils/report'); -const styleSearch = require('style-search'); - -/** @typedef {import('postcss').Declaration} Declaration */ - -/** @typedef {(args: { source: string, index: number, err: (message: string) => void }) => void} LocationChecker */ - -/** - * @param {{ - * root: import('postcss').Root, - * locationChecker: LocationChecker, - * result: import('stylelint').PostcssResult, - * checkedRuleName: string, - * fix: ((decl: Declaration, index: number) => boolean) | null, - * }} opts - * @returns {void} - */ -module.exports = function declarationBangSpaceChecker(opts) { - opts.root.walkDecls((decl) => { - const indexOffset = declarationValueIndex(decl); - const declString = decl.toString(); - const valueString = decl.toString().slice(indexOffset); - - if (!valueString.includes('!')) { - return; - } - - styleSearch({ source: valueString, target: '!' }, (match) => { - check(declString, match.startIndex + indexOffset, decl); - }); - }); - - /** - * @param {string} source - * @param {number} index - * @param {Declaration} decl - */ - function check(source, index, decl) { - opts.locationChecker({ - source, - index, - err: (message) => { - if (opts.fix && opts.fix(decl, index)) { - return; - } - - report({ - message, - node: decl, - index, - result: opts.result, - ruleName: opts.checkedRuleName, - }); - }, - }); - } -}; diff --git a/node_modules/stylelint/lib/rules/declarationColonSpaceChecker.js b/node_modules/stylelint/lib/rules/declarationColonSpaceChecker.js deleted file mode 100644 index 1f84e1d30..000000000 --- a/node_modules/stylelint/lib/rules/declarationColonSpaceChecker.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../utils/declarationValueIndex'); -const isStandardSyntaxDeclaration = require('../utils/isStandardSyntaxDeclaration'); -const report = require('../utils/report'); - -/** @typedef {(args: { source: string, index: number, lineCheckStr: string, err: (message: string) => void }) => void} LocationChecker */ - -/** - * @param {{ - * root: import('postcss').Root, - * locationChecker: LocationChecker, - * fix: ((decl: import('postcss').Declaration, index: number) => boolean) | null, - * result: import('stylelint').PostcssResult, - * checkedRuleName: string, - * }} opts - */ -module.exports = function declarationColonSpaceChecker(opts) { - opts.root.walkDecls((decl) => { - if (!isStandardSyntaxDeclaration(decl)) { - return; - } - - // Get the raw prop, and only the prop - const endOfPropIndex = declarationValueIndex(decl) + (decl.raws.between || '').length - 1; - - // The extra characters tacked onto the end ensure that there is a character to check - // after the colon. Otherwise, with `background:pink` the character after the - const propPlusColon = `${decl.toString().slice(0, endOfPropIndex)}xxx`; - - for (let i = 0, l = propPlusColon.length; i < l; i++) { - if (propPlusColon[i] !== ':') { - continue; - } - - opts.locationChecker({ - source: propPlusColon, - index: i, - lineCheckStr: decl.value, - err: (message) => { - if (opts.fix && opts.fix(decl, i)) { - return; - } - - report({ - message, - node: decl, - index: decl.prop.toString().length + 1, - result: opts.result, - ruleName: opts.checkedRuleName, - }); - }, - }); - break; - } - }); -}; diff --git a/node_modules/stylelint/lib/rules/findMediaOperator.js b/node_modules/stylelint/lib/rules/findMediaOperator.js deleted file mode 100644 index 698ea8b0b..000000000 --- a/node_modules/stylelint/lib/rules/findMediaOperator.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -const styleSearch = require('style-search'); - -const rangeOperators = ['>=', '<=', '>', '<', '=']; - -/** @typedef {import('style-search').StyleSearchMatch} StyleSearchMatch */ - -/** - * @template {import('postcss').AtRule} T - * @param {T} atRule - * @param {(match: StyleSearchMatch, params: string, atRule: T) => void} cb - */ -module.exports = function findMediaOperator(atRule, cb) { - if (atRule.name.toLowerCase() !== 'media') { - return; - } - - const params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; - - styleSearch({ source: params, target: rangeOperators }, (match) => { - const before = params[match.startIndex - 1]; - - if (before === '>' || before === '<') { - return; - } - - cb(match, params, atRule); - }); -}; diff --git a/node_modules/stylelint/lib/rules/font-family-name-quotes/index.js b/node_modules/stylelint/lib/rules/font-family-name-quotes/index.js deleted file mode 100644 index ba4d58e1b..000000000 --- a/node_modules/stylelint/lib/rules/font-family-name-quotes/index.js +++ /dev/null @@ -1,269 +0,0 @@ -'use strict'; - -const findFontFamily = require('../../utils/findFontFamily'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const isVariable = require('../../utils/isVariable'); -const { fontFamilyKeywords } = require('../../reference/keywords'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'font-family-name-quotes'; - -const messages = ruleMessages(ruleName, { - expected: (family) => `Expected quotes around "${family}"`, - rejected: (family) => `Unexpected quotes around "${family}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/font-family-name-quotes', - fixable: true, -}; - -/** - * @param {string} font - * @returns {boolean} - */ -function isSystemFontKeyword(font) { - if (font.startsWith('-apple-')) { - return true; - } - - if (font === 'BlinkMacSystemFont') { - return true; - } - - return false; -} - -/** - * "To avoid mistakes in escaping, it is recommended to quote font family names - * that contain white space, digits, or punctuation characters other than hyphens" - * (https://www.w3.org/TR/CSS2/fonts.html#font-family-prop) - * - * @param {string} family - * @returns {boolean} - */ -function quotesRecommended(family) { - return !/^[-a-zA-Z]+$/.test(family); -} - -/** - * Quotes are required if the family is not a valid CSS identifier - * (regexes from https://mathiasbynens.be/notes/unquoted-font-family) - * - * @param {string} family - * @returns {boolean} - */ -function quotesRequired(family) { - return family - .split(/\s+/) - .some((word) => /^(?:-?\d|--)/.test(word) || !/^[-\w\u{00A0}-\u{10FFFF}]+$/u.test(word)); -} - -/** - * @typedef {{ - * name: string, - * rawName: string, - * hasQuotes: boolean, - * sourceIndex: number, - * resetIndexes: (offset: number) => void, - * removeQuotes: () => void, - * addQuotes: () => void, - * }} MutableNode - */ - -/** - * - * @param {import('postcss-value-parser').Node[]} fontFamilies - * @param {import('postcss').Declaration} decl - * @returns {MutableNode[]} - */ -const makeMutableFontFamilies = (fontFamilies, decl) => { - /** - * @type {MutableNode[]} - */ - const mutableNodes = []; - - fontFamilies.forEach((fontFamily, idx) => { - const quote = 'quote' in fontFamily && fontFamily.quote; - const name = fontFamily.value; - - /** @type {MutableNode} */ - const newNode = { - name, - rawName: quote ? `${quote}${name}${quote}` : name, - sourceIndex: fontFamily.sourceIndex, - hasQuotes: Boolean(quote), - resetIndexes(offset) { - mutableNodes.slice(idx + 1).forEach((n) => (n.sourceIndex += offset)); - }, - removeQuotes() { - if (this.hasQuotes === false) return; - - const openIndex = this.sourceIndex; - const closeIndex = openIndex + this.name.length + 2; - - this.hasQuotes = false; - decl.value = decl.value.slice(0, openIndex) + this.name + decl.value.substring(closeIndex); - this.resetIndexes(-2); - }, - addQuotes() { - if (this.hasQuotes === true) return; - - const openIndex = this.sourceIndex; - const closeIndex = openIndex + this.name.length; - - this.hasQuotes = true; - const fixedName = `"${this.name}"`; - - decl.value = decl.value.slice(0, openIndex) + fixedName + decl.value.substring(closeIndex); - this.resetIndexes(2); - }, - }; - - mutableNodes.push(newNode); - }); - - return mutableNodes; -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondary, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always-where-required', 'always-where-recommended', 'always-unless-keyword'], - }); - - if (!validOptions) { - return; - } - - root.walkDecls(/^font(-family)?$/i, (decl) => { - if (!isStandardSyntaxValue(decl.value)) { - return; - } - - let fontFamilyNodes = makeMutableFontFamilies(findFontFamily(decl.value), decl); - - if (fontFamilyNodes.length === 0) { - return; - } - - for (const fontFamilyNode of fontFamilyNodes) { - checkFamilyName(fontFamilyNode, decl); - } - }); - - /** - * @param {MutableNode} fontFamilyNode - * @param {import('postcss').Declaration} decl - */ - function checkFamilyName(fontFamilyNode, decl) { - const { name: family, rawName: rawFamily, hasQuotes } = fontFamilyNode; - - if (isVariable(rawFamily)) { - return; - } - - // Disallow quotes around (case-insensitive) keywords - // and system font keywords in all cases - if (fontFamilyKeywords.has(family.toLowerCase()) || isSystemFontKeyword(family)) { - if (hasQuotes) { - if (context.fix) { - fontFamilyNode.removeQuotes(); - - return; - } - - return complain(messages.rejected(family), rawFamily, decl); - } - - return; - } - - const required = quotesRequired(family); - const recommended = quotesRecommended(family); - - switch (primary) { - case 'always-unless-keyword': - if (!hasQuotes) { - if (context.fix) { - fontFamilyNode.addQuotes(); - - return; - } - - return complain(messages.expected(family), rawFamily, decl); - } - - return; - - case 'always-where-recommended': - if (!recommended && hasQuotes) { - if (context.fix) { - fontFamilyNode.removeQuotes(); - - return; - } - - return complain(messages.rejected(family), rawFamily, decl); - } - - if (recommended && !hasQuotes) { - if (context.fix) { - fontFamilyNode.addQuotes(); - - return; - } - - return complain(messages.expected(family), rawFamily, decl); - } - - return; - - case 'always-where-required': - if (!required && hasQuotes) { - if (context.fix) { - fontFamilyNode.removeQuotes(); - - return; - } - - return complain(messages.rejected(family), rawFamily, decl); - } - - if (required && !hasQuotes) { - if (context.fix) { - fontFamilyNode.addQuotes(); - - return; - } - - return complain(messages.expected(family), rawFamily, decl); - } - } - } - - /** - * @param {string} message - * @param {string} family - * @param {import('postcss').Declaration} decl - */ - function complain(message, family, decl) { - report({ - result, - ruleName, - message, - node: decl, - word: family, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/font-family-no-duplicate-names/index.js b/node_modules/stylelint/lib/rules/font-family-no-duplicate-names/index.js deleted file mode 100644 index 6ec11f071..000000000 --- a/node_modules/stylelint/lib/rules/font-family-no-duplicate-names/index.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const findFontFamily = require('../../utils/findFontFamily'); -const { fontFamilyKeywords } = require('../../reference/keywords'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'font-family-no-duplicate-names'; - -const messages = ruleMessages(ruleName, { - rejected: (name) => `Unexpected duplicate name ${name}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/font-family-no-duplicate-names', -}; - -/** - * @param {import('postcss-value-parser').Node} node - */ -const isFamilyNameKeyword = (node) => - !('quote' in node) && fontFamilyKeywords.has(node.value.toLowerCase()); - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignoreFontFamilyNames: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkDecls(/^font(-family)?$/i, (decl) => { - const keywords = new Set(); - const familyNames = new Set(); - - const fontFamilies = findFontFamily(decl.value); - - if (fontFamilies.length === 0) { - return; - } - - for (const fontFamilyNode of fontFamilies) { - const family = fontFamilyNode.value.trim(); - - if (optionsMatches(secondaryOptions, 'ignoreFontFamilyNames', family)) { - continue; - } - - const rawFamily = - 'quote' in fontFamilyNode ? fontFamilyNode.quote + family + fontFamilyNode.quote : family; - - if (isFamilyNameKeyword(fontFamilyNode)) { - if (keywords.has(family.toLowerCase())) { - complain( - messages.rejected(family), - declarationValueIndex(decl) + fontFamilyNode.sourceIndex, - rawFamily.length, - decl, - ); - - continue; - } - - keywords.add(family); - - continue; - } - - if (familyNames.has(family)) { - complain( - messages.rejected(family), - declarationValueIndex(decl) + fontFamilyNode.sourceIndex, - rawFamily.length, - decl, - ); - - continue; - } - - familyNames.add(family); - } - }); - - /** - * @param {string} message - * @param {number} index - * @param {number} length - * @param {import('postcss').Declaration} decl - */ - function complain(message, index, length, decl) { - report({ - result, - ruleName, - message, - node: decl, - index, - endIndex: index + length, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/font-family-no-missing-generic-family-keyword/index.js b/node_modules/stylelint/lib/rules/font-family-no-missing-generic-family-keyword/index.js deleted file mode 100644 index 846a469b8..000000000 --- a/node_modules/stylelint/lib/rules/font-family-no-missing-generic-family-keyword/index.js +++ /dev/null @@ -1,120 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const findFontFamily = require('../../utils/findFontFamily'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const isVariable = require('../../utils/isVariable'); -const { systemFontKeywords, fontFamilyKeywords } = require('../../reference/keywords'); -const optionsMatches = require('../../utils/optionsMatches'); -const postcss = require('postcss'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isAtRule } = require('../../utils/typeGuards'); -const { isRegExp, isString, assert } = require('../../utils/validateTypes'); - -const ruleName = 'font-family-no-missing-generic-family-keyword'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected missing generic font family', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/font-family-no-missing-generic-family-keyword', -}; - -/** - * @param {import('postcss-value-parser').Node} node - * @returns {boolean} - */ -const isFamilyNameKeyword = (node) => - !('quote' in node) && fontFamilyKeywords.has(node.value.toLowerCase()); - -/** - * @param {string} value - * @returns {boolean} - */ -const isLastFontFamilyVariable = (value) => { - const lastValue = postcss.list.comma(value).pop(); - - return lastValue != null && (isVariable(lastValue) || !isStandardSyntaxValue(lastValue)); -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignoreFontFamilies: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkDecls(/^font(-family)?$/i, (decl) => { - // Ignore @font-face - const parent = decl.parent; - - if (parent && isAtRule(parent) && parent.name.toLowerCase() === 'font-face') { - return; - } - - if (decl.prop === 'font' && systemFontKeywords.has(decl.value.toLowerCase())) { - return; - } - - if (isLastFontFamilyVariable(decl.value)) { - return; - } - - const fontFamilies = findFontFamily(decl.value); - - if (fontFamilies.length === 0) { - return; - } - - if (fontFamilies.some((node) => isFamilyNameKeyword(node))) { - return; - } - - if ( - fontFamilies.some((node) => - optionsMatches(secondaryOptions, 'ignoreFontFamilies', node.value), - ) - ) { - return; - } - - const lastFontFamily = fontFamilies[fontFamilies.length - 1]; - - assert(lastFontFamily); - - const valueIndex = declarationValueIndex(decl); - const index = valueIndex + lastFontFamily.sourceIndex; - const endIndex = valueIndex + lastFontFamily.sourceEndIndex; - - report({ - result, - ruleName, - message: messages.rejected, - node: decl, - index, - endIndex, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/font-weight-notation/index.js b/node_modules/stylelint/lib/rules/font-weight-notation/index.js deleted file mode 100644 index f16c6774f..000000000 --- a/node_modules/stylelint/lib/rules/font-weight-notation/index.js +++ /dev/null @@ -1,214 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const isNumbery = require('../../utils/isNumbery'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const isVariable = require('../../utils/isVariable'); -const { - fontWeightNonNumericKeywords, - fontWeightRelativeKeywords, -} = require('../../reference/keywords'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const { assertString } = require('../../utils/validateTypes'); - -const ruleName = 'font-weight-notation'; - -const messages = ruleMessages(ruleName, { - expected: (type) => `Expected ${type} font-weight notation`, - expectedWithActual: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/font-weight-notation', - fixable: true, -}; - -const NORMAL_KEYWORD = 'normal'; - -const NAMED_TO_NUMERIC = new Map([ - ['normal', '400'], - ['bold', '700'], -]); -const NUMERIC_TO_NAMED = new Map([ - ['400', 'normal'], - ['700', 'bold'], -]); - -/** @type {import('stylelint').Rule<'numeric' | 'named-where-possible'>} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['numeric', 'named-where-possible'], - }, - { - actual: secondaryOptions, - possible: { - ignore: ['relative'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const ignoreRelative = optionsMatches(secondaryOptions, 'ignore', 'relative'); - - root.walkDecls(/^font(-weight)?$/i, (decl) => { - const isFontShorthandProp = decl.prop.toLowerCase() === 'font'; - - const parsedValue = valueParser(getDeclarationValue(decl)); - const valueNodes = parsedValue.nodes; - - const hasNumericFontWeight = valueNodes.some((node, index, nodes) => { - return isNumbery(node.value) && !isDivNode(nodes[index - 1]); - }); - - for (const [index, valueNode] of valueNodes.entries()) { - if (!isPossibleFontWeightNode(valueNode, index, valueNodes)) continue; - - const { value } = valueNode; - - if (isFontShorthandProp) { - if (value.toLowerCase() === NORMAL_KEYWORD && hasNumericFontWeight) { - continue; // Not `normal` for font-weight - } - - if (checkWeight(decl, valueNode)) { - break; // Stop traverse if font-weight is processed - } - } - - checkWeight(decl, valueNode); - } - - if (context.fix) { - // Autofix after the loop ends can prevent value nodes from changing their positions during the loop. - setDeclarationValue(decl, parsedValue.toString()); - } - }); - - /** - * @param {import('postcss').Declaration} decl - * @param {import('postcss-value-parser').Node} weightValueNode - * @returns {true | undefined} - */ - function checkWeight(decl, weightValueNode) { - const weightValue = weightValueNode.value; - - if (!isStandardSyntaxValue(weightValue)) { - return; - } - - if (isVariable(weightValue)) { - return; - } - - const lowerWeightValue = weightValue.toLowerCase(); - - if (ignoreRelative && fontWeightRelativeKeywords.has(lowerWeightValue)) { - return; - } - - if (primary === 'numeric') { - if (!isNumbery(lowerWeightValue) && fontWeightNonNumericKeywords.has(lowerWeightValue)) { - const numericValue = NAMED_TO_NUMERIC.get(lowerWeightValue); - - if (context.fix) { - if (numericValue) { - weightValueNode.value = numericValue; - - return true; - } - } - - const msg = numericValue - ? messages.expectedWithActual(weightValue, numericValue) - : messages.expected('numeric'); - - complain(msg, weightValueNode); - - return true; - } - } - - if (primary === 'named-where-possible') { - if (isNumbery(lowerWeightValue) && NUMERIC_TO_NAMED.has(lowerWeightValue)) { - const namedValue = NUMERIC_TO_NAMED.get(lowerWeightValue); - - assertString(namedValue); - - if (context.fix) { - weightValueNode.value = namedValue; - - return true; - } - - complain(messages.expectedWithActual(weightValue, namedValue), weightValueNode); - - return true; - } - } - - /** - * @param {string} message - * @param {import('postcss-value-parser').Node} valueNode - */ - function complain(message, valueNode) { - const index = declarationValueIndex(decl) + valueNode.sourceIndex; - const endIndex = index + valueNode.value.length; - - report({ - ruleName, - result, - message, - node: decl, - index, - endIndex, - }); - } - } - }; -}; - -/** - * @param {import('postcss-value-parser').Node | undefined} node - * @returns {boolean} - */ -function isDivNode(node) { - return node !== undefined && node.type === 'div'; -} - -/** - * @param {import('postcss-value-parser').Node} node - * @param {number} index - * @param {import('postcss-value-parser').Node[]} nodes - * @returns {boolean} - */ -function isPossibleFontWeightNode(node, index, nodes) { - if (node.type !== 'word') return false; - - // Exclude `/` format like `16px/3`. - if (isDivNode(nodes[index - 1])) return false; - - if (isDivNode(nodes[index + 1])) return false; - - return true; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-allowed-list/index.js b/node_modules/stylelint/lib/rules/function-allowed-list/index.js deleted file mode 100644 index e74f4d1a0..000000000 --- a/node_modules/stylelint/lib/rules/function-allowed-list/index.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'function-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (name) => `Unexpected function "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-allowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - valueParser(decl.value).walk((node) => { - if (node.type !== 'function') { - return; - } - - if (!isStandardSyntaxFunction(node)) { - return; - } - - if (matchesStringOrRegExp(vendor.unprefixed(node.value), primary)) { - return; - } - - const index = declarationValueIndex(decl) + node.sourceIndex; - const endIndex = index + node.value.length; - - report({ - message: messages.rejected, - messageArgs: [node.value], - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-calc-no-unspaced-operator/index.js b/node_modules/stylelint/lib/rules/function-calc-no-unspaced-operator/index.js deleted file mode 100644 index 0e7c00f07..000000000 --- a/node_modules/stylelint/lib/rules/function-calc-no-unspaced-operator/index.js +++ /dev/null @@ -1,381 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const { assert } = require('../../utils/validateTypes'); - -const ruleName = 'function-calc-no-unspaced-operator'; - -const messages = ruleMessages(ruleName, { - expectedBefore: (operator) => `Expected single space before "${operator}" operator`, - expectedAfter: (operator) => `Expected single space after "${operator}" operator`, - expectedOperatorBeforeSign: (operator) => `Expected an operator before sign "${operator}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-calc-no-unspaced-operator', - fixable: true, -}; - -const OPERATORS = new Set(['+', '-']); -const OPERATOR_REGEX = /[+-]/; -const ALL_OPERATORS = new Set([...OPERATORS, '*', '/']); - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) return; - - /** - * @param {string} message - * @param {import('postcss').Node} node - * @param {number} index - * @param {string} operator - */ - function complain(message, node, index, operator) { - const endIndex = index + operator.length; - - report({ message, node, index, endIndex, result, ruleName }); - } - - root.walkDecls((decl) => { - const value = getDeclarationValue(decl); - - if (!OPERATOR_REGEX.test(value)) return; - - let needsFix = false; - const valueIndex = declarationValueIndex(decl); - const parsedValue = valueParser(value); - - /** - * @param {import('postcss-value-parser').Node} operatorNode - * @param {import('postcss-value-parser').Node} currentNode - * @param {boolean} isBeforeOp - */ - function checkAroundOperator(operatorNode, currentNode, isBeforeOp) { - const operator = operatorNode.value; - const operatorSourceIndex = operatorNode.sourceIndex; - - if (currentNode && !isSingleSpace(currentNode)) { - if (currentNode.type === 'word') { - if (isBeforeOp) { - const lastChar = currentNode.value.slice(-1); - - if (OPERATORS.has(lastChar)) { - if (context.fix) { - currentNode.value = `${currentNode.value.slice(0, -1)} ${lastChar}`; - - return true; - } - - complain( - messages.expectedOperatorBeforeSign(operator), - decl, - operatorSourceIndex, - operator, - ); - - return true; - } - } else { - const firstChar = currentNode.value.slice(0, 1); - - if (OPERATORS.has(firstChar)) { - if (context.fix) { - currentNode.value = `${firstChar} ${currentNode.value.slice(1)}`; - - return true; - } - - complain(messages.expectedAfter(operator), decl, operatorSourceIndex, operator); - - return true; - } - } - - if (context.fix) { - needsFix = true; - currentNode.value = isBeforeOp ? `${currentNode.value} ` : ` ${currentNode.value}`; - - return true; - } - - complain( - isBeforeOp ? messages.expectedBefore(operator) : messages.expectedAfter(operator), - decl, - valueIndex + operatorSourceIndex, - operator, - ); - - return true; - } - - if (currentNode.type === 'space') { - const indexOfFirstNewLine = currentNode.value.search(/(\n|\r\n)/); - - if (indexOfFirstNewLine === 0) return; - - if (context.fix) { - needsFix = true; - currentNode.value = - indexOfFirstNewLine === -1 ? ' ' : currentNode.value.slice(indexOfFirstNewLine); - - return true; - } - - const message = isBeforeOp - ? messages.expectedBefore(operator) - : messages.expectedAfter(operator); - - complain(message, decl, valueIndex + operatorSourceIndex, operator); - - return true; - } - - if (currentNode.type === 'function') { - if (context.fix) { - needsFix = true; - currentNode.value = isBeforeOp ? `${currentNode.value} ` : ` ${currentNode.value}`; - - return true; - } - - const message = isBeforeOp - ? messages.expectedBefore(operator) - : messages.expectedAfter(operator); - - complain(message, decl, valueIndex + operatorSourceIndex, operator); - - return true; - } - } - - return false; - } - - /** - * @param {import('postcss-value-parser').Node[]} nodes - */ - function checkForOperatorInFirstNode(nodes) { - const firstNode = nodes[0]; - - assert(firstNode); - - if (firstNode.type !== 'word') return false; - - if (!isStandardSyntaxValue(firstNode.value)) return false; - - const operatorIndex = firstNode.value.search(OPERATOR_REGEX); - const operator = firstNode.value.slice(operatorIndex, operatorIndex + 1); - - if (operatorIndex <= 0) return false; - - const charBefore = firstNode.value.charAt(operatorIndex - 1); - const charAfter = firstNode.value.charAt(operatorIndex + 1); - - if (charBefore && charBefore !== ' ' && charAfter && charAfter !== ' ') { - if (context.fix) { - needsFix = true; - firstNode.value = insertCharAtIndex(firstNode.value, operatorIndex + 1, ' '); - firstNode.value = insertCharAtIndex(firstNode.value, operatorIndex, ' '); - } else { - complain( - messages.expectedBefore(operator), - decl, - valueIndex + firstNode.sourceIndex + operatorIndex, - operator, - ); - complain( - messages.expectedAfter(operator), - decl, - valueIndex + firstNode.sourceIndex + operatorIndex + 1, - operator, - ); - } - } else if (charBefore && charBefore !== ' ') { - if (context.fix) { - needsFix = true; - firstNode.value = insertCharAtIndex(firstNode.value, operatorIndex, ' '); - } else { - complain( - messages.expectedBefore(operator), - decl, - valueIndex + firstNode.sourceIndex + operatorIndex, - operator, - ); - } - } else if (charAfter && charAfter !== ' ') { - if (context.fix) { - needsFix = true; - firstNode.value = insertCharAtIndex(firstNode.value, operatorIndex, ' '); - } else { - complain( - messages.expectedAfter(operator), - decl, - valueIndex + firstNode.sourceIndex + operatorIndex + 1, - operator, - ); - } - } - - return true; - } - - /** - * @param {import('postcss-value-parser').Node[]} nodes - */ - function checkForOperatorInLastNode(nodes) { - if (nodes.length === 1) return false; - - const lastNode = nodes[nodes.length - 1]; - - assert(lastNode); - - if (lastNode.type !== 'word') return false; - - const operatorIndex = lastNode.value.search(OPERATOR_REGEX); - - if (operatorIndex === -1) return false; - - if (lastNode.value.charAt(operatorIndex - 1) === ' ') return false; - - // E.g. "10px * -2" when the last node is "-2" - if ( - isOperator(nodes[nodes.length - 3], ALL_OPERATORS) && - isSingleSpace(nodes[nodes.length - 2]) - ) { - return false; - } - - if (context.fix) { - needsFix = true; - lastNode.value = insertCharAtIndex(lastNode.value, operatorIndex + 1, ' ').trim(); - lastNode.value = insertCharAtIndex(lastNode.value, operatorIndex, ' ').trim(); - - return true; - } - - const operator = lastNode.value.charAt(operatorIndex); - - complain( - messages.expectedOperatorBeforeSign(operator), - decl, - valueIndex + lastNode.sourceIndex + operatorIndex, - operator, - ); - - return true; - } - - /** - * @param {import('postcss-value-parser').Node[]} nodes - */ - function checkWords(nodes) { - if (checkForOperatorInFirstNode(nodes) || checkForOperatorInLastNode(nodes)) return; - - for (const [index, node] of nodes.entries()) { - const lastChar = node.value.slice(-1); - const firstChar = node.value.slice(0, 1); - - if (node.type === 'word') { - if (index === 0 && OPERATORS.has(lastChar)) { - if (context.fix) { - node.value = `${node.value.slice(0, -1)} ${lastChar}`; - - continue; - } - - complain(messages.expectedBefore(lastChar), decl, node.sourceIndex, lastChar); - } else if (index === nodes.length && OPERATORS.has(firstChar)) { - if (context.fix) { - node.value = `${firstChar} ${node.value.slice(1)}`; - - continue; - } - - complain( - messages.expectedOperatorBeforeSign(firstChar), - decl, - node.sourceIndex, - firstChar, - ); - } - } - } - } - - parsedValue.walk((node) => { - if (node.type !== 'function' || node.value.toLowerCase() !== 'calc') return; - - const { nodes } = node; - - if (!nodes.length) return; - - let foundOperatorNode = false; - - for (const [nodeIndex, currNode] of nodes.entries()) { - if (!isOperator(currNode)) continue; - - foundOperatorNode = true; - - const nodeBefore = nodes[nodeIndex - 1]; - const nodeAfter = nodes[nodeIndex + 1]; - - if (isSingleSpace(nodeBefore) && isSingleSpace(nodeAfter)) continue; - - if (nodeAfter && checkAroundOperator(currNode, nodeAfter, false)) continue; - - nodeBefore && checkAroundOperator(currNode, nodeBefore, true); - } - - if (!foundOperatorNode) { - checkWords(nodes); - } - }); - - if (needsFix) { - setDeclarationValue(decl, parsedValue.toString()); - } - }); - }; -}; - -/** - * @param {string} str - * @param {number} index - * @param {string} char - */ -function insertCharAtIndex(str, index, char) { - return str.slice(0, index) + char + str.slice(index, str.length); -} - -/** - * @param {import('postcss-value-parser').Node | undefined} node - * @returns {node is import('postcss-value-parser').SpaceNode & { value: ' ' } } - */ -function isSingleSpace(node) { - return node != null && node.type === 'space' && node.value === ' '; -} - -/** - * @param {import('postcss-value-parser').Node | undefined} node - * @param {Set} [operators] - * @returns {node is import('postcss-value-parser').WordNode} - */ -function isOperator(node, operators = OPERATORS) { - return node != null && node.type === 'word' && operators.has(node.value); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-comma-newline-after/index.js b/node_modules/stylelint/lib/rules/function-comma-newline-after/index.js deleted file mode 100644 index 1852dc22c..000000000 --- a/node_modules/stylelint/lib/rules/function-comma-newline-after/index.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -const fixer = require('../functionCommaSpaceFix'); -const functionCommaSpaceChecker = require('../functionCommaSpaceChecker'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'function-comma-newline-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected newline after ","', - expectedAfterMultiLine: () => 'Expected newline after "," in a multi-line function', - rejectedAfterMultiLine: () => 'Unexpected whitespace after "," in a multi-line function', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-comma-newline-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line', 'never-multi-line'], - }); - - if (!validOptions) { - return; - } - - functionCommaSpaceChecker({ - root, - result, - locationChecker: checker.afterOneOnly, - checkedRuleName: ruleName, - fix: context.fix - ? (div, index, nodes) => - fixer({ - div, - index, - nodes, - expectation: primary, - position: 'after', - symb: context.newline || '', - }) - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-comma-newline-before/index.js b/node_modules/stylelint/lib/rules/function-comma-newline-before/index.js deleted file mode 100644 index a94d55bfd..000000000 --- a/node_modules/stylelint/lib/rules/function-comma-newline-before/index.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -const fixer = require('../functionCommaSpaceFix'); -const functionCommaSpaceChecker = require('../functionCommaSpaceChecker'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'function-comma-newline-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected newline before ","', - expectedBeforeMultiLine: () => 'Expected newline before "," in a multi-line function', - rejectedBeforeMultiLine: () => 'Unexpected whitespace before "," in a multi-line function', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-comma-newline-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line', 'never-multi-line'], - }); - - if (!validOptions) { - return; - } - - functionCommaSpaceChecker({ - root, - result, - locationChecker: checker.beforeAllowingIndentation, - checkedRuleName: ruleName, - fix: context.fix - ? (div, index, nodes) => - fixer({ - div, - index, - nodes, - expectation: primary, - position: 'before', - symb: context.newline || '', - }) - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-comma-space-after/index.js b/node_modules/stylelint/lib/rules/function-comma-space-after/index.js deleted file mode 100644 index 3f4d4122c..000000000 --- a/node_modules/stylelint/lib/rules/function-comma-space-after/index.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -const fixer = require('../functionCommaSpaceFix'); -const functionCommaSpaceChecker = require('../functionCommaSpaceChecker'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'function-comma-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected single space after ","', - rejectedAfter: () => 'Unexpected whitespace after ","', - expectedAfterSingleLine: () => 'Expected single space after "," in a single-line function', - rejectedAfterSingleLine: () => 'Unexpected whitespace after "," in a single-line function', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-comma-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never', 'always-single-line', 'never-single-line'], - }); - - if (!validOptions) { - return; - } - - functionCommaSpaceChecker({ - root, - result, - locationChecker: checker.after, - checkedRuleName: ruleName, - fix: context.fix - ? (div, index, nodes) => - fixer({ - div, - index, - nodes, - expectation: primary, - position: 'after', - symb: ' ', - }) - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-comma-space-before/index.js b/node_modules/stylelint/lib/rules/function-comma-space-before/index.js deleted file mode 100644 index ca97bcc26..000000000 --- a/node_modules/stylelint/lib/rules/function-comma-space-before/index.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -const fixer = require('../functionCommaSpaceFix'); -const functionCommaSpaceChecker = require('../functionCommaSpaceChecker'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'function-comma-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before ","', - rejectedBefore: () => 'Unexpected whitespace before ","', - expectedBeforeSingleLine: () => 'Expected single space before "," in a single-line function', - rejectedBeforeSingleLine: () => 'Unexpected whitespace before "," in a single-line function', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-comma-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never', 'always-single-line', 'never-single-line'], - }); - - if (!validOptions) { - return; - } - - functionCommaSpaceChecker({ - root, - result, - locationChecker: checker.before, - checkedRuleName: ruleName, - fix: context.fix - ? (div, index, nodes) => - fixer({ - div, - index, - nodes, - expectation: primary, - position: 'before', - symb: ' ', - }) - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-disallowed-list/index.js b/node_modules/stylelint/lib/rules/function-disallowed-list/index.js deleted file mode 100644 index fa8c7f249..000000000 --- a/node_modules/stylelint/lib/rules/function-disallowed-list/index.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'function-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (name) => `Unexpected function "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-disallowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - valueParser(decl.value).walk((node) => { - if (node.type !== 'function') { - return; - } - - if (!isStandardSyntaxFunction(node)) { - return; - } - - if (!matchesStringOrRegExp(vendor.unprefixed(node.value), primary)) { - return; - } - - const index = declarationValueIndex(decl) + node.sourceIndex; - const endIndex = index + node.value.length; - - report({ - message: messages.rejected, - messageArgs: [node.value], - node: decl, - index, - endIndex, - result, - ruleName, - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-linear-gradient-no-nonstandard-direction/index.js b/node_modules/stylelint/lib/rules/function-linear-gradient-no-nonstandard-direction/index.js deleted file mode 100644 index f97679b2a..000000000 --- a/node_modules/stylelint/lib/rules/function-linear-gradient-no-nonstandard-direction/index.js +++ /dev/null @@ -1,140 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const functionArgumentsSearch = require('../../utils/functionArgumentsSearch'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); -const vendor = require('../../utils/vendor'); - -const ruleName = 'function-linear-gradient-no-nonstandard-direction'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected nonstandard direction', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-linear-gradient-no-nonstandard-direction', -}; - -const LINEAR_GRADIENT_FUNCTION = '(?:-webkit-|-moz-|-o-|-ms-)?linear-gradient'; -const LINEAR_GRADIENT_FUNCTION_CALL = new RegExp(`${LINEAR_GRADIENT_FUNCTION}\\(`, 'i'); -const LINEAR_GRADIENT_FUNCTION_NAME = new RegExp(`^${LINEAR_GRADIENT_FUNCTION}$`, 'i'); - -const DIRECTION = /top|left|bottom|right/i; -const DIRECTION_WITH_TO = new RegExp(`^to (${DIRECTION.source})(?: (${DIRECTION.source}))?$`, 'i'); -const DIRECTION_WITHOUT_TO = new RegExp(`^(${DIRECTION.source})(?: (${DIRECTION.source}))?$`, 'i'); - -const DIGIT = /[\d.]/; -const ANGLE = /^[\d.]+(?:deg|grad|rad|turn)$/; -const IN_KEYWORD = /\bin\b/i; - -/** - * @param {string} source - * @param {boolean} withToPrefix - */ -function isStandardDirection(source, withToPrefix) { - const regexp = withToPrefix ? DIRECTION_WITH_TO : DIRECTION_WITHOUT_TO; - - const matches = source.match(regexp); - - if (!matches) { - return false; - } - - if (matches.length === 2) { - return true; - } - - // Cannot repeat side-or-corner, e.g. "to top top" - if (matches.length === 3 && matches[1] !== matches[2]) { - return true; - } - - return false; -} - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (!LINEAR_GRADIENT_FUNCTION_CALL.test(decl.value)) return; - - valueParser(decl.value).walk((valueNode) => { - if (valueNode.type !== 'function') { - return; - } - - functionArgumentsSearch( - valueParser.stringify(valueNode).toLowerCase(), - LINEAR_GRADIENT_FUNCTION_NAME, - (expression, expressionIndex) => { - const args = expression.split(','); - const firstArg = (args[0] || '').trim(); - - // If the first arg is not standard, return early - if (!isStandardSyntaxValue(firstArg)) { - return; - } - - // Ignore gradients with modern syntax that have color space interpolation arguments - if (IN_KEYWORD.test(firstArg)) { - return; - } - - // If the first character is a number, we can assume the user intends an angle - if (DIGIT.test(firstArg.charAt(0))) { - if (ANGLE.test(firstArg)) { - return; - } - - complain(); - - return; - } - - // The first argument may not be a direction: it may be an angle, - // or a color stop (in which case user gets default direction, "to bottom") - // cf. https://drafts.csswg.org/css-images-3/#linear-gradient-syntax - if (!DIRECTION.test(firstArg)) { - return; - } - - const withToPrefix = !vendor.prefix(valueNode.value); - - if (!isStandardDirection(firstArg, withToPrefix)) { - complain(); - } - - function complain() { - const index = declarationValueIndex(decl) + valueNode.sourceIndex + expressionIndex; - const endIndex = index + (args[0] || '').trimEnd().length; - - report({ - message: messages.rejected, - node: decl, - index, - endIndex, - result, - ruleName, - }); - } - }, - ); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-max-empty-lines/index.js b/node_modules/stylelint/lib/rules/function-max-empty-lines/index.js deleted file mode 100644 index c20341375..000000000 --- a/node_modules/stylelint/lib/rules/function-max-empty-lines/index.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); -const { isNumber } = require('../../utils/validateTypes'); - -const ruleName = 'function-max-empty-lines'; - -const messages = ruleMessages(ruleName, { - expected: (max) => `Expected no more than ${max} empty ${max === 1 ? 'line' : 'lines'}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-max-empty-lines', - fixable: true, - deprecated: true, -}; - -/** - * @param {import('postcss').Declaration} decl - */ -function placeIndexOnValueStart(decl) { - if (decl.raws.between == null) throw new Error('`between` must be present'); - - return decl.prop.length + decl.raws.between.length - 1; -} - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const maxAdjacentNewlines = primary + 1; - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: isNumber, - }); - - if (!validOptions) { - return; - } - - const violatedCRLFNewLinesRegex = new RegExp(`(?:\r\n){${maxAdjacentNewlines + 1},}`); - const violatedLFNewLinesRegex = new RegExp(`\n{${maxAdjacentNewlines + 1},}`); - const allowedLFNewLinesString = context.fix ? '\n'.repeat(maxAdjacentNewlines) : ''; - const allowedCRLFNewLinesString = context.fix ? '\r\n'.repeat(maxAdjacentNewlines) : ''; - - root.walkDecls((decl) => { - if (!decl.value.includes('(')) { - return; - } - - const stringValue = getDeclarationValue(decl); - /** @type {Array<[string, string]>} */ - const splittedValue = []; - let sourceIndexStart = 0; - - valueParser(stringValue).walk((node) => { - if ( - node.type !== 'function' /* ignore non functions */ || - node.value.length === 0 /* ignore sass lists */ - ) { - return; - } - - const stringifiedNode = valueParser.stringify(node); - - if ( - !violatedLFNewLinesRegex.test(stringifiedNode) && - !violatedCRLFNewLinesRegex.test(stringifiedNode) - ) { - return; - } - - if (context.fix) { - const newNodeString = stringifiedNode - .replace(new RegExp(violatedLFNewLinesRegex, 'gm'), allowedLFNewLinesString) - .replace(new RegExp(violatedCRLFNewLinesRegex, 'gm'), allowedCRLFNewLinesString); - - splittedValue.push([ - stringValue.slice(sourceIndexStart, node.sourceIndex), - newNodeString, - ]); - sourceIndexStart = node.sourceIndex + stringifiedNode.length; - } else { - report({ - message: messages.expected(primary), - node: decl, - index: placeIndexOnValueStart(decl) + node.sourceIndex, - result, - ruleName, - }); - } - }); - - if (context.fix && splittedValue.length > 0) { - const updatedValue = - splittedValue.reduce((acc, curr) => acc + curr[0] + curr[1], '') + - stringValue.slice(sourceIndexStart); - - setDeclarationValue(decl, updatedValue); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-name-case/index.js b/node_modules/stylelint/lib/rules/function-name-case/index.js deleted file mode 100644 index 45c9ceccf..000000000 --- a/node_modules/stylelint/lib/rules/function-name-case/index.js +++ /dev/null @@ -1,120 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction'); -const { camelCaseFunctions } = require('../../reference/functions'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); -const { isRegExp, isString } = require('../../utils/validateTypes'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); - -const ruleName = 'function-name-case'; - -const messages = ruleMessages(ruleName, { - expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-name-case', - fixable: true, -}; - -const mapLowercaseFunctionNamesToCamelCase = new Map(); - -for (const func of camelCaseFunctions) { - mapLowercaseFunctionNamesToCamelCase.set(func.toLowerCase(), func); -} - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['lower', 'upper'], - }, - { - actual: secondaryOptions, - possible: { - ignoreFunctions: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (!decl.value.includes('(')) return; - - if (!isStandardSyntaxValue(decl.value)) return; - - let needFix = false; - const parsed = valueParser(getDeclarationValue(decl)); - - parsed.walk((node) => { - if (node.type !== 'function' || !isStandardSyntaxFunction(node)) { - return; - } - - const functionName = node.value; - const functionNameLowerCase = functionName.toLowerCase(); - - if (optionsMatches(secondaryOptions, 'ignoreFunctions', functionName)) { - return; - } - - let expectedFunctionName = null; - - if ( - primary === 'lower' && - mapLowercaseFunctionNamesToCamelCase.has(functionNameLowerCase) - ) { - expectedFunctionName = mapLowercaseFunctionNamesToCamelCase.get(functionNameLowerCase); - } else if (primary === 'lower') { - expectedFunctionName = functionNameLowerCase; - } else { - expectedFunctionName = functionName.toUpperCase(); - } - - if (functionName === expectedFunctionName) { - return; - } - - if (context.fix) { - needFix = true; - node.value = expectedFunctionName; - - return; - } - - report({ - message: messages.expected, - messageArgs: [functionName, expectedFunctionName], - node: decl, - index: declarationValueIndex(decl) + node.sourceIndex, - result, - ruleName, - }); - }); - - if (context.fix && needFix) { - setDeclarationValue(decl, parsed.toString()); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-no-unknown/index.js b/node_modules/stylelint/lib/rules/function-no-unknown/index.js deleted file mode 100644 index 531237721..000000000 --- a/node_modules/stylelint/lib/rules/function-no-unknown/index.js +++ /dev/null @@ -1,110 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const functionsListPath = require('css-functions-list'); -const { tokenize } = require('@csstools/css-tokenizer'); -const { - isFunctionNode, - isSimpleBlockNode, - parseListOfComponentValues, -} = require('@csstools/css-parser-algorithms'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const isCustomFunction = require('../../utils/isCustomFunction'); -const { isRegExp, isString } = require('../../utils/validateTypes'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); - -const ruleName = 'function-no-unknown'; - -const messages = ruleMessages(ruleName, { - rejected: (name) => `Unexpected unknown function "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-no-unknown', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignoreFunctions: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const functionsList = [ - ...JSON.parse(fs.readFileSync(functionsListPath.toString(), 'utf8')), - // #5960 - '-webkit-gradient', - 'color-stop', - 'from', - 'to', - // #6537 - 'scroll', - ]; - - root.walkDecls((decl) => { - const { value } = decl; - - if (!value.includes('(')) return; - - if (!isStandardSyntaxValue(value)) return; - - /** - * @param {import('@csstools/css-parser-algorithms').ComponentValue} componentValue - */ - const walker = (componentValue) => { - if (!isFunctionNode(componentValue)) return; - - const name = componentValue.getName(); - - if (isCustomFunction(name)) return; - - if (optionsMatches(secondaryOptions, 'ignoreFunctions', name)) return; - - if (functionsList.includes(name.toLowerCase())) return; - - report({ - message: messages.rejected, - messageArgs: [name], - node: decl, - index: declarationValueIndex(decl) + componentValue.name[2], - result, - ruleName, - word: name, - }); - }; - - parseListOfComponentValues(tokenize({ css: value })).forEach((componentValue) => { - if (isFunctionNode(componentValue) || isSimpleBlockNode(componentValue)) { - walker(componentValue); - - componentValue.walk(({ node }) => { - walker(node); - }); - } - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-parentheses-newline-inside/index.js b/node_modules/stylelint/lib/rules/function-parentheses-newline-inside/index.js deleted file mode 100644 index 67dd51e94..000000000 --- a/node_modules/stylelint/lib/rules/function-parentheses-newline-inside/index.js +++ /dev/null @@ -1,276 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const isSingleLineString = require('../../utils/isSingleLineString'); -const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); - -const ruleName = 'function-parentheses-newline-inside'; - -const messages = ruleMessages(ruleName, { - expectedOpening: 'Expected newline after "("', - expectedClosing: 'Expected newline before ")"', - expectedOpeningMultiLine: 'Expected newline after "(" in a multi-line function', - rejectedOpeningMultiLine: 'Unexpected whitespace after "(" in a multi-line function', - expectedClosingMultiLine: 'Expected newline before ")" in a multi-line function', - rejectedClosingMultiLine: 'Unexpected whitespace before ")" in a multi-line function', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-parentheses-newline-inside', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line', 'never-multi-line'], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (!decl.value.includes('(')) { - return; - } - - let hasFixed = false; - const declValue = getDeclarationValue(decl); - const parsedValue = valueParser(declValue); - - parsedValue.walk((valueNode) => { - if (valueNode.type !== 'function') { - return; - } - - if (!isStandardSyntaxFunction(valueNode)) { - return; - } - - const functionString = valueParser.stringify(valueNode); - const isMultiLine = !isSingleLineString(functionString); - const containsNewline = (/** @type {string} */ str) => str.includes('\n'); - - // Check opening ... - - const openingIndex = valueNode.sourceIndex + valueNode.value.length + 1; - const checkBefore = getCheckBefore(valueNode); - - if (primary === 'always' && !containsNewline(checkBefore)) { - if (context.fix) { - hasFixed = true; - fixBeforeForAlways(valueNode, context.newline || ''); - } else { - complain(messages.expectedOpening, openingIndex); - } - } - - if (isMultiLine && primary === 'always-multi-line' && !containsNewline(checkBefore)) { - if (context.fix) { - hasFixed = true; - fixBeforeForAlways(valueNode, context.newline || ''); - } else { - complain(messages.expectedOpeningMultiLine, openingIndex); - } - } - - if (isMultiLine && primary === 'never-multi-line' && checkBefore !== '') { - if (context.fix) { - hasFixed = true; - fixBeforeForNever(valueNode); - } else { - complain(messages.rejectedOpeningMultiLine, openingIndex); - } - } - - // Check closing ... - - const closingIndex = valueNode.sourceIndex + functionString.length - 2; - const checkAfter = getCheckAfter(valueNode); - - if (primary === 'always' && !containsNewline(checkAfter)) { - if (context.fix) { - hasFixed = true; - fixAfterForAlways(valueNode, context.newline || ''); - } else { - complain(messages.expectedClosing, closingIndex); - } - } - - if (isMultiLine && primary === 'always-multi-line' && !containsNewline(checkAfter)) { - if (context.fix) { - hasFixed = true; - fixAfterForAlways(valueNode, context.newline || ''); - } else { - complain(messages.expectedClosingMultiLine, closingIndex); - } - } - - if (isMultiLine && primary === 'never-multi-line' && checkAfter !== '') { - if (context.fix) { - hasFixed = true; - fixAfterForNever(valueNode); - } else { - complain(messages.rejectedClosingMultiLine, closingIndex); - } - } - }); - - if (hasFixed) { - setDeclarationValue(decl, parsedValue.toString()); - } - - /** - * @param {string} message - * @param {number} offset - */ - function complain(message, offset) { - report({ - ruleName, - result, - message, - node: decl, - index: declarationValueIndex(decl) + offset, - }); - } - }); - }; -}; - -/** @typedef {import('postcss-value-parser').FunctionNode} FunctionNode */ - -/** - * @param {FunctionNode} valueNode - */ -function getCheckBefore(valueNode) { - let before = valueNode.before; - - for (const node of valueNode.nodes) { - if (node.type === 'comment') { - continue; - } - - if (node.type === 'space') { - before += node.value; - continue; - } - - break; - } - - return before; -} - -/** - * @param {FunctionNode} valueNode - */ -function getCheckAfter(valueNode) { - let after = ''; - - for (const node of [...valueNode.nodes].reverse()) { - if (node.type === 'comment') { - continue; - } - - if (node.type === 'space') { - after = node.value + after; - continue; - } - - break; - } - - after += valueNode.after; - - return after; -} - -/** - * @param {FunctionNode} valueNode - * @param {string} newline - */ -function fixBeforeForAlways(valueNode, newline) { - let target; - - for (const node of valueNode.nodes) { - if (node.type === 'comment') { - continue; - } - - if (node.type === 'space') { - target = node; - continue; - } - - break; - } - - if (target) { - target.value = newline + target.value; - } else { - valueNode.before = newline + valueNode.before; - } -} - -/** - * @param {FunctionNode} valueNode - */ -function fixBeforeForNever(valueNode) { - valueNode.before = ''; - - for (const node of valueNode.nodes) { - if (node.type === 'comment') { - continue; - } - - if (node.type === 'space') { - node.value = ''; - continue; - } - - break; - } -} - -/** - * @param {FunctionNode} valueNode - * @param {string} newline - */ -function fixAfterForAlways(valueNode, newline) { - valueNode.after = newline + valueNode.after; -} - -/** - * @param {FunctionNode} valueNode - */ -function fixAfterForNever(valueNode) { - valueNode.after = ''; - - for (const node of [...valueNode.nodes].reverse()) { - if (node.type === 'comment') { - continue; - } - - if (node.type === 'space') { - node.value = ''; - continue; - } - - break; - } -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-parentheses-space-inside/index.js b/node_modules/stylelint/lib/rules/function-parentheses-space-inside/index.js deleted file mode 100644 index 4974e7a23..000000000 --- a/node_modules/stylelint/lib/rules/function-parentheses-space-inside/index.js +++ /dev/null @@ -1,175 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const isSingleLineString = require('../../utils/isSingleLineString'); -const isStandardSyntaxFunction = require('../../utils/isStandardSyntaxFunction'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); - -const ruleName = 'function-parentheses-space-inside'; - -const messages = ruleMessages(ruleName, { - expectedOpening: 'Expected single space after "("', - rejectedOpening: 'Unexpected whitespace after "("', - expectedClosing: 'Expected single space before ")"', - rejectedClosing: 'Unexpected whitespace before ")"', - expectedOpeningSingleLine: 'Expected single space after "(" in a single-line function', - rejectedOpeningSingleLine: 'Unexpected whitespace after "(" in a single-line function', - expectedClosingSingleLine: 'Expected single space before ")" in a single-line function', - rejectedClosingSingleLine: 'Unexpected whitespace before ")" in a single-line function', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-parentheses-space-inside', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never', 'always-single-line', 'never-single-line'], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (!decl.value.includes('(')) { - return; - } - - let hasFixed = false; - const declValue = getDeclarationValue(decl); - const parsedValue = valueParser(declValue); - - parsedValue.walk((valueNode) => { - if (valueNode.type !== 'function') { - return; - } - - if (!isStandardSyntaxFunction(valueNode)) { - return; - } - - // Ignore function without parameters - if (!valueNode.nodes.length) { - return; - } - - const functionString = valueParser.stringify(valueNode); - const isSingleLine = isSingleLineString(functionString); - - // Check opening ... - - const openingIndex = valueNode.sourceIndex + valueNode.value.length + 1; - - if (primary === 'always' && valueNode.before !== ' ') { - if (context.fix) { - hasFixed = true; - valueNode.before = ' '; - } else { - complain(messages.expectedOpening, openingIndex); - } - } - - if (primary === 'never' && valueNode.before !== '') { - if (context.fix) { - hasFixed = true; - valueNode.before = ''; - } else { - complain(messages.rejectedOpening, openingIndex); - } - } - - if (isSingleLine && primary === 'always-single-line' && valueNode.before !== ' ') { - if (context.fix) { - hasFixed = true; - valueNode.before = ' '; - } else { - complain(messages.expectedOpeningSingleLine, openingIndex); - } - } - - if (isSingleLine && primary === 'never-single-line' && valueNode.before !== '') { - if (context.fix) { - hasFixed = true; - valueNode.before = ''; - } else { - complain(messages.rejectedOpeningSingleLine, openingIndex); - } - } - - // Check closing ... - - const closingIndex = valueNode.sourceIndex + functionString.length - 2; - - if (primary === 'always' && valueNode.after !== ' ') { - if (context.fix) { - hasFixed = true; - valueNode.after = ' '; - } else { - complain(messages.expectedClosing, closingIndex); - } - } - - if (primary === 'never' && valueNode.after !== '') { - if (context.fix) { - hasFixed = true; - valueNode.after = ''; - } else { - complain(messages.rejectedClosing, closingIndex); - } - } - - if (isSingleLine && primary === 'always-single-line' && valueNode.after !== ' ') { - if (context.fix) { - hasFixed = true; - valueNode.after = ' '; - } else { - complain(messages.expectedClosingSingleLine, closingIndex); - } - } - - if (isSingleLine && primary === 'never-single-line' && valueNode.after !== '') { - if (context.fix) { - hasFixed = true; - valueNode.after = ''; - } else { - complain(messages.rejectedClosingSingleLine, closingIndex); - } - } - }); - - if (hasFixed) { - setDeclarationValue(decl, parsedValue.toString()); - } - - /** - * @param {string} message - * @param {number} offset - */ - function complain(message, offset) { - report({ - ruleName, - result, - message, - node: decl, - index: declarationValueIndex(decl) + offset, - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-url-no-scheme-relative/index.js b/node_modules/stylelint/lib/rules/function-url-no-scheme-relative/index.js deleted file mode 100644 index 601929cdf..000000000 --- a/node_modules/stylelint/lib/rules/function-url-no-scheme-relative/index.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -const functionArgumentsSearch = require('../../utils/functionArgumentsSearch'); -const isStandardSyntaxUrl = require('../../utils/isStandardSyntaxUrl'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'function-url-no-scheme-relative'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected scheme-relative url', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-url-no-scheme-relative', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - functionArgumentsSearch(decl.toString().toLowerCase(), 'url', (args, index) => { - const url = args.trim().replace(/^['"]+|['"]+$/g, ''); - - if (!isStandardSyntaxUrl(url) || !url.startsWith('//')) { - return; - } - - report({ - message: messages.rejected, - node: decl, - index, - endIndex: index + args.length, - result, - ruleName, - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-url-quotes/index.js b/node_modules/stylelint/lib/rules/function-url-quotes/index.js deleted file mode 100644 index efe959ea4..000000000 --- a/node_modules/stylelint/lib/rules/function-url-quotes/index.js +++ /dev/null @@ -1,195 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const functionArgumentsSearch = require('../../utils/functionArgumentsSearch'); -const getAtRuleParams = require('../../utils/getAtRuleParams'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const isStandardSyntaxUrl = require('../../utils/isStandardSyntaxUrl'); -const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'function-url-quotes'; - -const messages = ruleMessages(ruleName, { - expected: (functionName) => `Expected quotes around "${functionName}" function argument`, - rejected: (functionName) => `Unexpected quotes around "${functionName}" function argument`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-url-quotes', - fixable: true, -}; - -const URL_FUNC_REGEX = /url\(/i; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['always', 'never'], - }, - { - actual: secondaryOptions, - possible: { - except: ['empty'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const exceptEmpty = optionsMatches(secondaryOptions, 'except', 'empty'); - const emptyArgumentPatterns = new Set(['', "''", '""']); - - root.walkAtRules(checkAtRuleParams); - root.walkDecls(checkDeclParams); - - /** - * @param {import('postcss').Declaration} decl - */ - function checkDeclParams(decl) { - if (!URL_FUNC_REGEX.test(decl.value)) return; - - if (!isStandardSyntaxDeclaration(decl)) return; - - const value = getDeclarationValue(decl); - const startIndex = declarationValueIndex(decl); - const parsed = functionArgumentsSearch(value, /^url$/i, (args, index, funcNode) => { - checkArgs(decl, args, startIndex + index, funcNode); - }); - - if (context.fix) { - decl.value = parsed.toString(); - } - } - - /** - * @param {import('postcss').AtRule} atRule - */ - function checkAtRuleParams(atRule) { - const params = getAtRuleParams(atRule); - const startIndex = atRuleParamIndex(atRule); - - let hasUrlFunction = false; - - const parsed = functionArgumentsSearch(params, /^url$/i, (args, index, funcNode) => { - hasUrlFunction = true; - checkArgs(atRule, args, startIndex + index, funcNode); - }); - - if (!hasUrlFunction) return; - - if (context.fix) { - atRule.params = parsed.toString(); - } - } - - /** - * @param {import('postcss-value-parser').FunctionNode} funcNode - */ - function addQuotes(funcNode) { - for (const argNode of funcNode.nodes) { - if (argNode.type === 'word') { - argNode.value = `"${argNode.value}"`; - } - } - } - - /** - * @param {import('postcss-value-parser').FunctionNode} funcNode - */ - function removeQuotes(funcNode) { - for (const argNode of funcNode.nodes) { - if (argNode.type === 'string') { - // NOTE: We can ignore this error because the test passes. - // @ts-expect-error -- TS2322: Type '"word"' is not assignable to type '"string"'. - argNode.type = 'word'; - } - } - } - - /** - * @param {import('postcss').Declaration | import('postcss').AtRule} node - * @param {string} args - * @param {number} index - * @param {import('postcss-value-parser').FunctionNode} funcNode - */ - function checkArgs(node, args, index, funcNode) { - const functionName = funcNode.value.toLowerCase(); - let shouldHasQuotes = primary === 'always'; - - const leftTrimmedArgs = args.trimStart(); - - if (!isStandardSyntaxUrl(leftTrimmedArgs)) { - return; - } - - const complaintIndex = index + args.length - leftTrimmedArgs.length; - const complaintEndIndex = index + args.length; - const hasQuotes = leftTrimmedArgs.startsWith("'") || leftTrimmedArgs.startsWith('"'); - - if (exceptEmpty && emptyArgumentPatterns.has(args.trim())) { - shouldHasQuotes = !shouldHasQuotes; - } - - if (shouldHasQuotes) { - if (hasQuotes) { - return; - } - - if (context.fix) { - addQuotes(funcNode); - - return; - } - - complain(messages.expected(functionName), node, complaintIndex, complaintEndIndex); - } else { - if (!hasQuotes) { - return; - } - - if (context.fix) { - removeQuotes(funcNode); - - return; - } - - complain(messages.rejected(functionName), node, complaintIndex, complaintEndIndex); - } - } - - /** - * @param {string} message - * @param {import('postcss').Node} node - * @param {number} index - * @param {number} endIndex - */ - function complain(message, node, index, endIndex) { - report({ - message, - node, - index, - endIndex, - result, - ruleName, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-url-scheme-allowed-list/index.js b/node_modules/stylelint/lib/rules/function-url-scheme-allowed-list/index.js deleted file mode 100644 index a98f30ef5..000000000 --- a/node_modules/stylelint/lib/rules/function-url-scheme-allowed-list/index.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -const functionArgumentsSearch = require('../../utils/functionArgumentsSearch'); -const getSchemeFromUrl = require('../../utils/getSchemeFromUrl'); -const isStandardSyntaxUrl = require('../../utils/isStandardSyntaxUrl'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'function-url-scheme-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (scheme) => `Unexpected URL scheme "${scheme}:"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-url-scheme-allowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - functionArgumentsSearch(decl.toString().toLowerCase(), 'url', (args, index) => { - const unspacedUrlString = args.trim(); - - if (!isStandardSyntaxUrl(unspacedUrlString)) { - return; - } - - const urlString = unspacedUrlString.replace(/^['"]+|['"]+$/g, ''); - const scheme = getSchemeFromUrl(urlString); - - if (scheme === null) { - return; - } - - if (matchesStringOrRegExp(scheme, primary)) { - return; - } - - report({ - message: messages.rejected, - messageArgs: [scheme], - node: decl, - index, - endIndex: index + args.length, - result, - ruleName, - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-url-scheme-disallowed-list/index.js b/node_modules/stylelint/lib/rules/function-url-scheme-disallowed-list/index.js deleted file mode 100644 index c9c5214bf..000000000 --- a/node_modules/stylelint/lib/rules/function-url-scheme-disallowed-list/index.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -const functionArgumentsSearch = require('../../utils/functionArgumentsSearch'); -const getSchemeFromUrl = require('../../utils/getSchemeFromUrl'); -const isStandardSyntaxUrl = require('../../utils/isStandardSyntaxUrl'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'function-url-scheme-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (scheme) => `Unexpected URL scheme "${scheme}:"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-url-scheme-disallowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - functionArgumentsSearch(decl.toString().toLowerCase(), 'url', (args, index) => { - const unspacedUrlString = args.trim(); - - if (!isStandardSyntaxUrl(unspacedUrlString)) { - return; - } - - const urlString = unspacedUrlString.replace(/^['"]+|['"]+$/g, ''); - const scheme = getSchemeFromUrl(urlString); - - if (scheme === null) { - return; - } - - if (!matchesStringOrRegExp(scheme, primary)) { - return; - } - - report({ - message: messages.rejected, - messageArgs: [scheme], - node: decl, - index, - endIndex: index + args.length, - result, - ruleName, - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/function-whitespace-after/index.js b/node_modules/stylelint/lib/rules/function-whitespace-after/index.js deleted file mode 100644 index 3e5e2aaa8..000000000 --- a/node_modules/stylelint/lib/rules/function-whitespace-after/index.js +++ /dev/null @@ -1,194 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const isWhitespace = require('../../utils/isWhitespace'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const styleSearch = require('style-search'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'function-whitespace-after'; - -const messages = ruleMessages(ruleName, { - expected: 'Expected whitespace after ")"', - rejected: 'Unexpected whitespace after ")"', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/function-whitespace-after', - fixable: true, - deprecated: true, -}; - -const ACCEPTABLE_AFTER_CLOSING_PAREN = new Set([')', ',', '}', ':', '/', undefined]); - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - /** - * @param {import('postcss').Node} node - * @param {string} value - * @param {number} nodeIndex - * @param {((index: number) => void) | undefined} fix - */ - function check(node, value, nodeIndex, fix) { - styleSearch( - { - source: value, - target: ')', - functionArguments: 'only', - }, - (match) => { - checkClosingParen(value, match.startIndex + 1, node, nodeIndex, fix); - }, - ); - } - - /** - * @param {string} source - * @param {number} index - * @param {import('postcss').Node} node - * @param {number} nodeIndex - * @param {((index: number) => void) | undefined} fix - */ - function checkClosingParen(source, index, node, nodeIndex, fix) { - const nextChar = source.charAt(index); - - if (!nextChar) return; - - if (primary === 'always') { - // Allow for the next character to be a single empty space, - // another closing parenthesis, a comma, or the end of the value - if (nextChar === ' ') { - return; - } - - if (nextChar === '\n') { - return; - } - - if (source.slice(index, index + 2) === '\r\n') { - return; - } - - if (ACCEPTABLE_AFTER_CLOSING_PAREN.has(nextChar)) { - return; - } - - if (fix) { - fix(index); - - return; - } - - report({ - message: messages.expected, - node, - index: nodeIndex + index, - result, - ruleName, - }); - } else if (primary === 'never' && isWhitespace(nextChar)) { - if (fix) { - fix(index); - - return; - } - - report({ - message: messages.rejected, - node, - index: nodeIndex + index, - result, - ruleName, - }); - } - } - - /** - * @param {string} value - */ - function createFixer(value) { - let fixed = ''; - let lastIndex = 0; - /** @type {(index: number) => void} */ - let applyFix; - - if (primary === 'always') { - applyFix = (index) => { - // eslint-disable-next-line prefer-template - fixed += value.slice(lastIndex, index) + ' '; - lastIndex = index; - }; - } else if (primary === 'never') { - applyFix = (index) => { - let whitespaceEndIndex = index + 1; - - while ( - whitespaceEndIndex < value.length && - isWhitespace(value.charAt(whitespaceEndIndex)) - ) { - whitespaceEndIndex++; - } - - fixed += value.slice(lastIndex, index); - lastIndex = whitespaceEndIndex; - }; - } else { - throw new Error(`Unexpected option: "${primary}"`); - } - - return { - applyFix, - get hasFixed() { - return Boolean(lastIndex); - }, - get fixed() { - return fixed + value.slice(lastIndex); - }, - }; - } - - root.walkAtRules(/^import$/i, (atRule) => { - const param = (atRule.raws.params && atRule.raws.params.raw) || atRule.params; - const fixer = context.fix && createFixer(param); - - check(atRule, param, atRuleParamIndex(atRule), fixer ? fixer.applyFix : undefined); - - if (fixer && fixer.hasFixed) { - if (atRule.raws.params) { - atRule.raws.params.raw = fixer.fixed; - } else { - atRule.params = fixer.fixed; - } - } - }); - root.walkDecls((decl) => { - const value = getDeclarationValue(decl); - const fixer = context.fix && createFixer(value); - - check(decl, value, declarationValueIndex(decl), fixer ? fixer.applyFix : undefined); - - if (fixer && fixer.hasFixed) { - setDeclarationValue(decl, fixer.fixed); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/functionCommaSpaceChecker.js b/node_modules/stylelint/lib/rules/functionCommaSpaceChecker.js deleted file mode 100644 index 1c004fa86..000000000 --- a/node_modules/stylelint/lib/rules/functionCommaSpaceChecker.js +++ /dev/null @@ -1,123 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../utils/declarationValueIndex'); -const getDeclarationValue = require('../utils/getDeclarationValue'); -const isStandardSyntaxFunction = require('../utils/isStandardSyntaxFunction'); -const report = require('../utils/report'); -const setDeclarationValue = require('../utils/setDeclarationValue'); -const valueParser = require('postcss-value-parser'); - -/** @typedef {import('postcss-value-parser').Node} ValueParserNode */ -/** @typedef {import('postcss-value-parser').DivNode} ValueParserDivNode */ -/** @typedef {(args: { source: string, index: number, err: (message: string) => void }) => void} LocationChecker */ - -/** - * @param {{ - * root: import('postcss').Root, - * locationChecker: LocationChecker, - * fix: ((node: ValueParserDivNode, index: number, nodes: ValueParserNode[]) => boolean) | null, - * result: import('stylelint').PostcssResult, - * checkedRuleName: string, - * }} opts - */ -module.exports = function functionCommaSpaceChecker(opts) { - opts.root.walkDecls((decl) => { - const declValue = getDeclarationValue(decl); - - let hasFixed; - const parsedValue = valueParser(declValue); - - parsedValue.walk((valueNode) => { - if (valueNode.type !== 'function') { - return; - } - - if (!isStandardSyntaxFunction(valueNode)) { - return; - } - - // Ignore `url()` arguments, which may contain data URIs or other funky stuff - if (valueNode.value.toLowerCase() === 'url') { - return; - } - - const argumentStrings = valueNode.nodes.map((node) => valueParser.stringify(node)); - - const functionArguments = (() => { - // Remove function name and parens - let result = valueNode.before + argumentStrings.join('') + valueNode.after; - - // 1. Remove comments including preceding whitespace (when only succeeded by whitespace) - // 2. Remove all other comments, but leave adjacent whitespace intact - // eslint-disable-next-line regexp/no-dupe-disjunctions -- TODO: Possible to simplify the regex. - result = result.replace(/( *\/(\*.*\*\/(?!\S)|\/.*)|(\/(\*.*\*\/|\/.*)))/, ''); - - return result; - })(); - - /** - * Gets the index of the comma for checking. - * @param {ValueParserDivNode} commaNode The comma node - * @param {number} nodeIndex The index of the comma node - * @returns {number} The index of the comma for checking - */ - const getCommaCheckIndex = (commaNode, nodeIndex) => { - let commaBefore = - valueNode.before + argumentStrings.slice(0, nodeIndex).join('') + commaNode.before; - - // 1. Remove comments including preceding whitespace (when only succeeded by whitespace) - // 2. Remove all other comments, but leave adjacent whitespace intact - // eslint-disable-next-line regexp/no-dupe-disjunctions -- TODO: Possible to simplify the regex. - commaBefore = commaBefore.replace(/( *\/(\*.*\*\/(?!\S)|\/.*)|(\/(\*.*\*\/|\/.*)))/, ''); - - return commaBefore.length; - }; - - /** @type {{ commaNode: ValueParserDivNode, checkIndex: number, nodeIndex: number }[]} */ - const commaDataList = []; - - for (const [nodeIndex, node] of valueNode.nodes.entries()) { - if (node.type !== 'div' || node.value !== ',') { - continue; - } - - const checkIndex = getCommaCheckIndex(node, nodeIndex); - - commaDataList.push({ - commaNode: node, - checkIndex, - nodeIndex, - }); - } - - for (const { commaNode, checkIndex, nodeIndex } of commaDataList) { - opts.locationChecker({ - source: functionArguments, - index: checkIndex, - err: (message) => { - const index = - declarationValueIndex(decl) + commaNode.sourceIndex + commaNode.before.length; - - if (opts.fix && opts.fix(commaNode, nodeIndex, valueNode.nodes)) { - hasFixed = true; - - return; - } - - report({ - index, - message, - node: decl, - result: opts.result, - ruleName: opts.checkedRuleName, - }); - }, - }); - } - }); - - if (hasFixed) { - setDeclarationValue(decl, parsedValue.toString()); - } - }); -}; diff --git a/node_modules/stylelint/lib/rules/functionCommaSpaceFix.js b/node_modules/stylelint/lib/rules/functionCommaSpaceFix.js deleted file mode 100644 index b4ad08c68..000000000 --- a/node_modules/stylelint/lib/rules/functionCommaSpaceFix.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -/** - * @param {{ - * div: import('postcss-value-parser').DivNode, - * index: number, - * nodes: import('postcss-value-parser').Node[], - * expectation: string, - * position: 'before' | 'after', - * symb: string, - * }} params - * @returns {boolean} - */ -module.exports = function functionCommaSpaceFix(params) { - const { div, index, nodes, expectation, position, symb } = params; - - if (expectation.startsWith('always')) { - div[position] = symb; - - return true; - } - - if (expectation.startsWith('never')) { - div[position] = ''; - - for (let i = index + 1; i < nodes.length; i++) { - const node = nodes[i]; - - if (node === undefined) { - continue; - } - - if (node.type === 'comment') { - continue; - } - - if (node.type === 'space') { - node.value = ''; - continue; - } - - break; - } - - return true; - } - - return false; -}; diff --git a/node_modules/stylelint/lib/rules/hue-degree-notation/index.js b/node_modules/stylelint/lib/rules/hue-degree-notation/index.js deleted file mode 100644 index d596c15bc..000000000 --- a/node_modules/stylelint/lib/rules/hue-degree-notation/index.js +++ /dev/null @@ -1,151 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'hue-degree-notation'; - -const messages = ruleMessages(ruleName, { - expected: (unfixed, fixed) => `Expected "${unfixed}" to be "${fixed}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/hue-degree-notation', - fixable: true, -}; - -const HUE_FIRST_ARG_FUNCS = ['hsl', 'hsla', 'hwb']; -const HUE_THIRD_ARG_FUNCS = ['lch', 'oklch']; -const HUE_FUNCS = new Set([...HUE_FIRST_ARG_FUNCS, ...HUE_THIRD_ARG_FUNCS]); -const HAS_HUE_COLOR_FUNC = new RegExp(`\\b(?:${[...HUE_FUNCS].join('|')})\\(`, 'i'); - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['angle', 'number'], - }); - - if (!validOptions) return; - - root.walkDecls((decl) => { - if (!HAS_HUE_COLOR_FUNC.test(decl.value)) return; - - let needsFix = false; - const parsedValue = valueParser(getDeclarationValue(decl)); - - parsedValue.walk((node) => { - if (node.type !== 'function') return; - - if (!HUE_FUNCS.has(node.value.toLowerCase())) return; - - const hue = findHue(node); - - if (!hue) return; - - const { value } = hue; - - if (!isStandardSyntaxValue(value)) return; - - if (!isDegree(value) && !isNumber(value)) return; - - if (primary === 'angle' && isDegree(value)) return; - - if (primary === 'number' && isNumber(value)) return; - - const fixed = primary === 'angle' ? asDegree(value) : asNumber(value); - const unfixed = value; - - if (context.fix) { - hue.value = fixed; - needsFix = true; - - return; - } - - const valueIndex = declarationValueIndex(decl); - - report({ - message: messages.expected, - messageArgs: [unfixed, fixed], - node: decl, - index: valueIndex + hue.sourceIndex, - endIndex: valueIndex + hue.sourceEndIndex, - result, - ruleName, - }); - }); - - if (needsFix) { - setDeclarationValue(decl, parsedValue.toString()); - } - }); - }; -}; - -/** - * @param {string} value - */ -function asDegree(value) { - return `${value}deg`; -} - -/** - * @param {string} value - */ -function asNumber(value) { - const dimension = valueParser.unit(value); - - if (dimension) return dimension.number; - - throw new TypeError(`The "${value}" value must have a unit`); -} - -/** - * @param {import('postcss-value-parser').FunctionNode} node - */ -function findHue(node) { - const args = node.nodes.filter(({ type }) => type === 'word' || type === 'function'); - const value = node.value.toLowerCase(); - - if (HUE_FIRST_ARG_FUNCS.includes(value)) { - return args[0]; - } - - if (HUE_THIRD_ARG_FUNCS.includes(value)) { - return args[2]; - } - - return undefined; -} - -/** - * @param {string} value - */ -function isDegree(value) { - const dimension = valueParser.unit(value); - - return dimension && dimension.unit.toLowerCase() === 'deg'; -} - -/** - * @param {string} value - */ -function isNumber(value) { - const dimension = valueParser.unit(value); - - return dimension && dimension.unit === ''; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/import-notation/index.js b/node_modules/stylelint/lib/rules/import-notation/index.js deleted file mode 100644 index 2e40df5e8..000000000 --- a/node_modules/stylelint/lib/rules/import-notation/index.js +++ /dev/null @@ -1,126 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const setAtRuleParams = require('../../utils/setAtRuleParams'); -const getAtRuleParams = require('../../utils/getAtRuleParams'); -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); - -const ruleName = 'import-notation'; - -const messages = ruleMessages(ruleName, { - expected: (unfixed, fixed) => `Expected "${unfixed}" to be "${fixed}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/import-notation', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['string', 'url'], - }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^import$/i, checkAtRuleImportParams); - - /** - * @param {import('postcss').AtRule} atRule - */ - function checkAtRuleImportParams(atRule) { - const params = getAtRuleParams(atRule); - const parsed = valueParser(params); - - for (const node of parsed.nodes) { - const start = atRuleParamIndex(atRule); - const end = start + node.sourceEndIndex; - - if (primary === 'string') { - if (node.type === 'function' && node.value.toLowerCase() === 'url') { - const urlFunctionFull = valueParser.stringify(node); - const urlFunctionArguments = valueParser.stringify(node.nodes); - - const quotedUrlFunctionFirstArgument = - node.nodes[0] && node.nodes[0].type === 'word' - ? `"${urlFunctionArguments}"` - : urlFunctionArguments; - - if (context.fix) { - const restAtRuleParams = atRule.params.slice(node.sourceEndIndex); - - setAtRuleParams(atRule, `${quotedUrlFunctionFirstArgument}${restAtRuleParams}`); - - return; - } - - complain( - messages.expected(urlFunctionFull, quotedUrlFunctionFirstArgument), - atRule, - start, - end, - ); - - return; - } - } - - if (primary === 'url') { - if (node.type === 'space') return; - - if (node.type === 'word' || node.type === 'string') { - const path = valueParser.stringify(node); - - const urlFunctionFull = `url(${path})`; - - if (context.fix) { - const restAtRuleParams = atRule.params.slice(node.sourceEndIndex); - - setAtRuleParams(atRule, `${urlFunctionFull}${restAtRuleParams}`); - - return; - } - - const quotedNodeValue = - node.type === 'word' ? `"${node.value}"` : `${node.quote}${node.value}${node.quote}`; - - complain(messages.expected(quotedNodeValue, urlFunctionFull), atRule, start, end); - - return; - } - } - } - } - - /** - * @param {string} message - * @param {import('postcss').Node} node - * @param {number} index - * @param {number} endIndex - */ - function complain(message, node, index, endIndex) { - report({ - message, - node, - index, - endIndex, - result, - ruleName, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/indentation/index.js b/node_modules/stylelint/lib/rules/indentation/index.js deleted file mode 100644 index f6c01c515..000000000 --- a/node_modules/stylelint/lib/rules/indentation/index.js +++ /dev/null @@ -1,733 +0,0 @@ -'use strict'; - -const beforeBlockString = require('../../utils/beforeBlockString'); -const hasBlock = require('../../utils/hasBlock'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const styleSearch = require('style-search'); -const validateOptions = require('../../utils/validateOptions'); -const { isAtRule, isDeclaration, isRoot, isRule } = require('../../utils/typeGuards'); -const { isBoolean, isNumber, isString, assertString } = require('../../utils/validateTypes'); - -const ruleName = 'indentation'; -const messages = ruleMessages(ruleName, { - expected: (x) => `Expected indentation of ${x}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/indentation', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions = {}, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [isNumber, 'tab'], - }, - { - actual: secondaryOptions, - possible: { - baseIndentLevel: [isNumber, 'auto'], - except: ['block', 'value', 'param'], - ignore: ['value', 'param', 'inside-parens'], - indentInsideParens: ['twice', 'once-at-root-twice-in-block'], - indentClosingBrace: [isBoolean], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const spaceCount = isNumber(primary) ? primary : null; - const indentChar = spaceCount == null ? '\t' : ' '.repeat(spaceCount); - const warningWord = primary === 'tab' ? 'tab' : 'space'; - - /** @type {number | 'auto'} */ - const baseIndentLevel = secondaryOptions.baseIndentLevel; - /** @type {boolean} */ - const indentClosingBrace = secondaryOptions.indentClosingBrace; - - /** - * @param {number} level - */ - const legibleExpectation = (level) => { - const count = spaceCount == null ? level : level * spaceCount; - const quantifiedWarningWord = count === 1 ? warningWord : `${warningWord}s`; - - return `${count} ${quantifiedWarningWord}`; - }; - - // Cycle through all nodes using walk. - root.walk((node) => { - if (isRoot(node)) { - // Ignore nested template literals root in css-in-js lang - return; - } - - const nodeLevel = indentationLevel(node); - - // Cut out any * and _ hacks from `before` - const before = (node.raws.before || '').replace(/[*_]$/, ''); - const after = typeof node.raws.after === 'string' ? node.raws.after : ''; - const parent = node.parent; - - if (!parent) throw new Error('A parent node must be present'); - - const expectedOpeningBraceIndentation = indentChar.repeat(nodeLevel); - - // Only inspect the spaces before the node - // if this is the first node in root - // or there is a newline in the `before` string. - // (If there is no newline before a node, - // there is no "indentation" to check.) - const isFirstChild = parent.type === 'root' && parent.first === node; - const lastIndexOfNewline = before.lastIndexOf('\n'); - - // Inspect whitespace in the `before` string that is - // *after* the *last* newline character, - // because anything besides that is not indentation for this node: - // it is some other kind of separation, checked by some separate rule - if ( - (lastIndexOfNewline !== -1 || - (isFirstChild && - (!getDocument(parent) || - (parent.raws.codeBefore && parent.raws.codeBefore.endsWith('\n'))))) && - before.slice(lastIndexOfNewline + 1) !== expectedOpeningBraceIndentation - ) { - if (context.fix) { - if (isFirstChild && isString(node.raws.before)) { - node.raws.before = node.raws.before.replace( - /^[ \t]*(?=\S|$)/, - expectedOpeningBraceIndentation, - ); - } - - node.raws.before = fixIndentation(node.raws.before, expectedOpeningBraceIndentation); - } else { - report({ - message: messages.expected(legibleExpectation(nodeLevel)), - node, - result, - ruleName, - }); - } - } - - // Only blocks have the `after` string to check. - // Only inspect `after` strings that start with a newline; - // otherwise there's no indentation involved. - // And check `indentClosingBrace` to see if it should be indented an extra level. - const closingBraceLevel = indentClosingBrace ? nodeLevel + 1 : nodeLevel; - const expectedClosingBraceIndentation = indentChar.repeat(closingBraceLevel); - - if ( - (isRule(node) || isAtRule(node)) && - hasBlock(node) && - after && - after.includes('\n') && - after.slice(after.lastIndexOf('\n') + 1) !== expectedClosingBraceIndentation - ) { - if (context.fix) { - node.raws.after = fixIndentation(node.raws.after, expectedClosingBraceIndentation); - } else { - report({ - message: messages.expected(legibleExpectation(closingBraceLevel)), - node, - index: node.toString().length - 1, - result, - ruleName, - }); - } - } - - // If this is a declaration, check the value - if (isDeclaration(node)) { - checkValue(node, nodeLevel); - } - - // If this is a rule, check the selector - if (isRule(node)) { - checkSelector(node, nodeLevel); - } - - // If this is an at rule, check the params - if (isAtRule(node)) { - checkAtRuleParams(node, nodeLevel); - } - }); - - /** - * @param {import('postcss').Node} node - * @param {number} level - * @returns {number} - */ - function indentationLevel(node, level = 0) { - if (!node.parent) throw new Error('A parent node must be present'); - - if (isRoot(node.parent)) { - return level + getRootBaseIndentLevel(node.parent, baseIndentLevel, primary); - } - - let calculatedLevel; - - // Indentation level equals the ancestor nodes - // separating this node from root; so recursively - // run this operation - calculatedLevel = indentationLevel(node.parent, level + 1); - - // If `secondaryOptions.except` includes "block", - // blocks are taken down one from their calculated level - // (all blocks are the same level as their parents) - if ( - optionsMatches(secondaryOptions, 'except', 'block') && - (isRule(node) || isAtRule(node)) && - hasBlock(node) - ) { - calculatedLevel--; - } - - return calculatedLevel; - } - - /** - * @param {import('postcss').Declaration} decl - * @param {number} declLevel - */ - function checkValue(decl, declLevel) { - if (!decl.value.includes('\n')) { - return; - } - - if (optionsMatches(secondaryOptions, 'ignore', 'value')) { - return; - } - - const declString = decl.toString(); - const valueLevel = optionsMatches(secondaryOptions, 'except', 'value') - ? declLevel - : declLevel + 1; - - checkMultilineBit(declString, valueLevel, decl); - } - - /** - * @param {import('postcss').Rule} ruleNode - * @param {number} ruleLevel - */ - function checkSelector(ruleNode, ruleLevel) { - const selector = ruleNode.selector; - - // Less mixins have params, and they should be indented extra - // @ts-expect-error -- TS2339: Property 'params' does not exist on type 'Rule'. - if (ruleNode.params) { - ruleLevel += 1; - } - - checkMultilineBit(selector, ruleLevel, ruleNode); - } - - /** - * @param {import('postcss').AtRule} atRule - * @param {number} ruleLevel - */ - function checkAtRuleParams(atRule, ruleLevel) { - if (optionsMatches(secondaryOptions, 'ignore', 'param')) { - return; - } - - // @nest and SCSS's @at-root rules should be treated like regular rules, not expected - // to have their params (selectors) indented - const paramLevel = - optionsMatches(secondaryOptions, 'except', 'param') || - atRule.name === 'nest' || - atRule.name === 'at-root' - ? ruleLevel - : ruleLevel + 1; - - checkMultilineBit(beforeBlockString(atRule).trim(), paramLevel, atRule); - } - - /** - * @param {string} source - * @param {number} newlineIndentLevel - * @param {import('postcss').Node} node - */ - function checkMultilineBit(source, newlineIndentLevel, node) { - if (!source.includes('\n')) { - return; - } - - // Data for current node fixing - /** @type {Array<{ expectedIndentation: string, currentIndentation: string, startIndex: number }>} */ - const fixPositions = []; - - // `outsideParens` because function arguments and also non-standard parenthesized stuff like - // Sass maps are ignored to allow for arbitrary indentation - let parentheticalDepth = 0; - - const ignoreInsideParans = optionsMatches(secondaryOptions, 'ignore', 'inside-parens'); - - styleSearch( - { - source, - target: '\n', - // @ts-expect-error -- The `outsideParens` option is unsupported. Why? - outsideParens: ignoreInsideParans, - }, - (match, matchCount) => { - const precedesClosingParenthesis = /^[ \t]*\)/.test(source.slice(match.startIndex + 1)); - - if (ignoreInsideParans && (precedesClosingParenthesis || match.insideParens)) { - return; - } - - let expectedIndentLevel = newlineIndentLevel; - - // Modififications for parenthetical content - if (!ignoreInsideParans && match.insideParens) { - // If the first match in is within parentheses, reduce the parenthesis penalty - if (matchCount === 1) parentheticalDepth -= 1; - - // Account for windows line endings - let newlineIndex = match.startIndex; - - if (source[match.startIndex - 1] === '\r') { - newlineIndex--; - } - - const followsOpeningParenthesis = /\([ \t]*$/.test(source.slice(0, newlineIndex)); - - if (followsOpeningParenthesis) { - parentheticalDepth += 1; - } - - const followsOpeningBrace = /\{[ \t]*$/.test(source.slice(0, newlineIndex)); - - if (followsOpeningBrace) { - parentheticalDepth += 1; - } - - const startingClosingBrace = /^[ \t]*\}/.test(source.slice(match.startIndex + 1)); - - if (startingClosingBrace) { - parentheticalDepth -= 1; - } - - expectedIndentLevel += parentheticalDepth; - - // Past this point, adjustments to parentheticalDepth affect next line - - if (precedesClosingParenthesis) { - parentheticalDepth -= 1; - } - - switch (secondaryOptions.indentInsideParens) { - case 'twice': - if (!precedesClosingParenthesis || indentClosingBrace) { - expectedIndentLevel += 1; - } - - break; - case 'once-at-root-twice-in-block': - if (node.parent === node.root()) { - if (precedesClosingParenthesis && !indentClosingBrace) { - expectedIndentLevel -= 1; - } - - break; - } - - if (!precedesClosingParenthesis || indentClosingBrace) { - expectedIndentLevel += 1; - } - - break; - default: - if (precedesClosingParenthesis && !indentClosingBrace) { - expectedIndentLevel -= 1; - } - } - } - - // Starting at the index after the newline, we want to - // check that the whitespace characters (excluding newlines) before the first - // non-whitespace character equal the expected indentation - const afterNewlineSpaceMatches = /^([ \t]*)\S/.exec(source.slice(match.startIndex + 1)); - - if (!afterNewlineSpaceMatches) { - return; - } - - const afterNewlineSpace = afterNewlineSpaceMatches[1] || ''; - const expectedIndentation = indentChar.repeat( - expectedIndentLevel > 0 ? expectedIndentLevel : 0, - ); - - if (afterNewlineSpace !== expectedIndentation) { - if (context.fix) { - // Adding fixes position in reverse order, because if we change indent in the beginning of the string it will break all following fixes for that string - fixPositions.unshift({ - expectedIndentation, - currentIndentation: afterNewlineSpace, - startIndex: match.startIndex, - }); - } else { - report({ - message: messages.expected(legibleExpectation(expectedIndentLevel)), - node, - index: match.startIndex + afterNewlineSpace.length + 1, - result, - ruleName, - }); - } - } - }, - ); - - if (fixPositions.length) { - if (isRule(node)) { - for (const fixPosition of fixPositions) { - node.selector = replaceIndentation( - node.selector, - fixPosition.currentIndentation, - fixPosition.expectedIndentation, - fixPosition.startIndex, - ); - } - } - - if (isDeclaration(node)) { - const declProp = node.prop; - const declBetween = node.raws.between; - - if (!isString(declBetween)) { - throw new TypeError('The `between` property must be a string'); - } - - for (const fixPosition of fixPositions) { - if (fixPosition.startIndex < declProp.length + declBetween.length) { - node.raws.between = replaceIndentation( - declBetween, - fixPosition.currentIndentation, - fixPosition.expectedIndentation, - fixPosition.startIndex - declProp.length, - ); - } else { - node.value = replaceIndentation( - node.value, - fixPosition.currentIndentation, - fixPosition.expectedIndentation, - fixPosition.startIndex - declProp.length - declBetween.length, - ); - } - } - } - - if (isAtRule(node)) { - const atRuleName = node.name; - const atRuleAfterName = node.raws.afterName; - const atRuleParams = node.params; - - if (!isString(atRuleAfterName)) { - throw new TypeError('The `afterName` property must be a string'); - } - - for (const fixPosition of fixPositions) { - // 1 — it's a @ length - if (fixPosition.startIndex < 1 + atRuleName.length + atRuleAfterName.length) { - node.raws.afterName = replaceIndentation( - atRuleAfterName, - fixPosition.currentIndentation, - fixPosition.expectedIndentation, - fixPosition.startIndex - atRuleName.length - 1, - ); - } else { - node.params = replaceIndentation( - atRuleParams, - fixPosition.currentIndentation, - fixPosition.expectedIndentation, - fixPosition.startIndex - atRuleName.length - atRuleAfterName.length - 1, - ); - } - } - } - } - } - }; -}; - -/** - * @param {import('postcss').Root} root - * @param {number | 'auto'} baseIndentLevel - * @param {string} space - * @returns {number} - */ -function getRootBaseIndentLevel(root, baseIndentLevel, space) { - const document = getDocument(root); - - if (!document) { - return 0; - } - - if (!root.source) { - throw new Error('The root node must have a source'); - } - - /** @type {import('postcss').Source & { baseIndentLevel?: number }} */ - const source = root.source; - - const indentLevel = source.baseIndentLevel; - - if (isNumber(indentLevel) && Number.isSafeInteger(indentLevel)) { - return indentLevel; - } - - const newIndentLevel = inferRootIndentLevel(root, baseIndentLevel, () => - inferDocIndentSize(document, space), - ); - - source.baseIndentLevel = newIndentLevel; - - return newIndentLevel; -} - -/** - * @param {import('postcss').Node} node - */ -function getDocument(node) { - // @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Node'. - const document = node.document; - - if (document) { - return document; - } - - const root = node.root(); - - // @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Node'. - return root && root.document; -} - -/** - * @param {import('postcss').Document} document - * @param {string} space - * returns {number} - */ -function inferDocIndentSize(document, space) { - if (!document.source) throw new Error('The document node must have a source'); - - /** @type {import('postcss').Source & { indentSize?: number }} */ - const docSource = document.source; - - let indentSize = docSource.indentSize; - - if (isNumber(indentSize) && Number.isSafeInteger(indentSize)) { - return indentSize; - } - - const source = document.source.input.css; - const indents = source.match(/^ *(?=\S)/gm); - - if (indents) { - /** @type {Map} */ - const scores = new Map(); - let lastIndentSize = 0; - let lastLeadingSpacesLength = 0; - - /** - * @param {number} leadingSpacesLength - */ - const vote = (leadingSpacesLength) => { - if (leadingSpacesLength) { - lastIndentSize = Math.abs(leadingSpacesLength - lastLeadingSpacesLength) || lastIndentSize; - - if (lastIndentSize > 1) { - const score = scores.get(lastIndentSize); - - if (score) { - scores.set(lastIndentSize, score + 1); - } else { - scores.set(lastIndentSize, 1); - } - } - } else { - lastIndentSize = 0; - } - - lastLeadingSpacesLength = leadingSpacesLength; - }; - - for (const leadingSpaces of indents) { - vote(leadingSpaces.length); - } - - let bestScore = 0; - - for (const [indentSizeDate, score] of scores.entries()) { - if (score > bestScore) { - bestScore = score; - indentSize = indentSizeDate; - } - } - } - - indentSize = - Number(indentSize) || (indents && indents[0] && indents[0].length) || Number(space) || 2; - docSource.indentSize = indentSize; - - return indentSize; -} - -/** - * @param {import('postcss').Root} root - * @param {number | 'auto'} baseIndentLevel - * @param {() => number} indentSize - * @returns {number} - */ -function inferRootIndentLevel(root, baseIndentLevel, indentSize) { - /** - * @param {string} indent - */ - function getIndentLevel(indent) { - const tabMatch = indent.match(/\t/g); - const tabCount = tabMatch ? tabMatch.length : 0; - - const spaceMatch = indent.match(/ /g); - const spaceCount = spaceMatch ? Math.round(spaceMatch.length / indentSize()) : 0; - - return tabCount + spaceCount; - } - - let newBaseIndentLevel = 0; - - if (!isNumber(baseIndentLevel) || !Number.isSafeInteger(baseIndentLevel)) { - if (!root.source) throw new Error('The root node must have a source'); - - let source = root.source.input.css; - - source = source.replace(/^[^\r\n]+/, (firstLine) => { - const match = root.raws.codeBefore && /(?:^|\n)([ \t]*)$/.exec(root.raws.codeBefore); - - if (match) { - return match[1] + firstLine; - } - - return ''; - }); - - const indents = source.match(/^[ \t]*(?=\S)/gm); - - if (indents) { - return Math.min(...indents.map((indent) => getIndentLevel(indent))); - } - - newBaseIndentLevel = 1; - } else { - newBaseIndentLevel = baseIndentLevel; - } - - const indents = []; - const foundIndents = root.raws.codeBefore && /(?:^|\n)([ \t]*)\S/m.exec(root.raws.codeBefore); - - // The indent level of the CSS code block in non-CSS-like files is determined by the shortest indent of non-empty line. - if (foundIndents) { - let shortest = Number.MAX_SAFE_INTEGER; - let i = 0; - - while (++i < foundIndents.length) { - const foundIndent = foundIndents[i]; - - assertString(foundIndent); - const current = getIndentLevel(foundIndent); - - if (current < shortest) { - shortest = current; - - if (shortest === 0) { - break; - } - } - } - - if (shortest !== Number.MAX_SAFE_INTEGER) { - indents.push(new Array(shortest).fill(' ').join('')); - } - } - - const after = root.raws.after; - - if (after) { - let afterEnd; - - if (after.endsWith('\n')) { - // @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Root'. - const document = root.document; - - if (document) { - const nextRoot = document.nodes[document.nodes.indexOf(root) + 1]; - - afterEnd = nextRoot ? nextRoot.raws.codeBefore : document.raws.codeAfter; - } else { - // Nested root node in css-in-js lang - const parent = root.parent; - - if (!parent) throw new Error('The root node must have a parent'); - - const nextRoot = parent.nodes[parent.nodes.indexOf(root) + 1]; - - afterEnd = nextRoot ? nextRoot.raws.codeBefore : root.raws.codeAfter; - } - } else { - afterEnd = after; - } - - if (afterEnd) indents.push(afterEnd.match(/^[ \t]*/)[0]); - } - - if (indents.length) { - return Math.max(...indents.map((indent) => getIndentLevel(indent))) + newBaseIndentLevel; - } - - return newBaseIndentLevel; -} - -/** - * @param {string | undefined} str - * @param {string} whitespace - */ -function fixIndentation(str, whitespace) { - if (!isString(str)) { - return str; - } - - return str.replace(/\n[ \t]*(?=\S|$)/g, `\n${whitespace}`); -} - -/** - * @param {string} input - * @param {string} searchString - * @param {string} replaceString - * @param {number} startIndex - */ -function replaceIndentation(input, searchString, replaceString, startIndex) { - const offset = startIndex + 1; - const stringStart = input.slice(0, offset); - const stringEnd = input.slice(offset + searchString.length); - - return stringStart + replaceString + stringEnd; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/index.js b/node_modules/stylelint/lib/rules/index.js deleted file mode 100644 index 6693e5f47..000000000 --- a/node_modules/stylelint/lib/rules/index.js +++ /dev/null @@ -1,378 +0,0 @@ -'use strict'; - -const importLazy = require('import-lazy'); - -/** @type {import('stylelint')['rules']} */ -const rules = { - 'alpha-value-notation': importLazy(() => require('./alpha-value-notation'))(), - 'annotation-no-unknown': importLazy(() => require('./annotation-no-unknown'))(), - 'at-rule-allowed-list': importLazy(() => require('./at-rule-allowed-list'))(), - 'at-rule-disallowed-list': importLazy(() => require('./at-rule-disallowed-list'))(), - 'at-rule-empty-line-before': importLazy(() => require('./at-rule-empty-line-before'))(), - 'at-rule-name-case': importLazy(() => require('./at-rule-name-case'))(), - 'at-rule-name-newline-after': importLazy(() => require('./at-rule-name-newline-after'))(), - 'at-rule-semicolon-space-before': importLazy(() => require('./at-rule-semicolon-space-before'))(), - 'at-rule-name-space-after': importLazy(() => require('./at-rule-name-space-after'))(), - 'at-rule-no-unknown': importLazy(() => require('./at-rule-no-unknown'))(), - 'at-rule-no-vendor-prefix': importLazy(() => require('./at-rule-no-vendor-prefix'))(), - 'at-rule-property-required-list': importLazy(() => require('./at-rule-property-required-list'))(), - 'at-rule-semicolon-newline-after': importLazy(() => - require('./at-rule-semicolon-newline-after'), - )(), - 'block-closing-brace-empty-line-before': importLazy(() => - require('./block-closing-brace-empty-line-before'), - )(), - 'block-closing-brace-newline-after': importLazy(() => - require('./block-closing-brace-newline-after'), - )(), - 'block-closing-brace-newline-before': importLazy(() => - require('./block-closing-brace-newline-before'), - )(), - 'block-closing-brace-space-after': importLazy(() => - require('./block-closing-brace-space-after'), - )(), - 'block-closing-brace-space-before': importLazy(() => - require('./block-closing-brace-space-before'), - )(), - 'block-no-empty': importLazy(() => require('./block-no-empty'))(), - 'block-opening-brace-newline-after': importLazy(() => - require('./block-opening-brace-newline-after'), - )(), - 'block-opening-brace-newline-before': importLazy(() => - require('./block-opening-brace-newline-before'), - )(), - 'block-opening-brace-space-after': importLazy(() => - require('./block-opening-brace-space-after'), - )(), - 'block-opening-brace-space-before': importLazy(() => - require('./block-opening-brace-space-before'), - )(), - 'color-function-notation': importLazy(() => require('./color-function-notation'))(), - 'color-hex-alpha': importLazy(() => require('./color-hex-alpha'))(), - 'color-hex-case': importLazy(() => require('./color-hex-case'))(), - 'color-hex-length': importLazy(() => require('./color-hex-length'))(), - 'color-named': importLazy(() => require('./color-named'))(), - 'color-no-hex': importLazy(() => require('./color-no-hex'))(), - 'color-no-invalid-hex': importLazy(() => require('./color-no-invalid-hex'))(), - 'comment-empty-line-before': importLazy(() => require('./comment-empty-line-before'))(), - 'comment-no-empty': importLazy(() => require('./comment-no-empty'))(), - 'comment-pattern': importLazy(() => require('./comment-pattern'))(), - 'comment-whitespace-inside': importLazy(() => require('./comment-whitespace-inside'))(), - 'comment-word-disallowed-list': importLazy(() => require('./comment-word-disallowed-list'))(), - 'custom-media-pattern': importLazy(() => require('./custom-media-pattern'))(), - 'custom-property-empty-line-before': importLazy(() => - require('./custom-property-empty-line-before'), - )(), - 'custom-property-no-missing-var-function': importLazy(() => - require('./custom-property-no-missing-var-function'), - )(), - 'custom-property-pattern': importLazy(() => require('./custom-property-pattern'))(), - 'declaration-bang-space-after': importLazy(() => require('./declaration-bang-space-after'))(), - 'declaration-bang-space-before': importLazy(() => require('./declaration-bang-space-before'))(), - 'declaration-block-no-duplicate-custom-properties': importLazy(() => - require('./declaration-block-no-duplicate-custom-properties'), - )(), - 'declaration-block-no-duplicate-properties': importLazy(() => - require('./declaration-block-no-duplicate-properties'), - )(), - 'declaration-block-no-redundant-longhand-properties': importLazy(() => - require('./declaration-block-no-redundant-longhand-properties'), - )(), - 'declaration-block-no-shorthand-property-overrides': importLazy(() => - require('./declaration-block-no-shorthand-property-overrides'), - )(), - 'declaration-block-semicolon-newline-after': importLazy(() => - require('./declaration-block-semicolon-newline-after'), - )(), - 'declaration-block-semicolon-newline-before': importLazy(() => - require('./declaration-block-semicolon-newline-before'), - )(), - 'declaration-block-semicolon-space-after': importLazy(() => - require('./declaration-block-semicolon-space-after'), - )(), - 'declaration-block-semicolon-space-before': importLazy(() => - require('./declaration-block-semicolon-space-before'), - )(), - 'declaration-block-single-line-max-declarations': importLazy(() => - require('./declaration-block-single-line-max-declarations'), - )(), - 'declaration-block-trailing-semicolon': importLazy(() => - require('./declaration-block-trailing-semicolon'), - )(), - 'declaration-colon-newline-after': importLazy(() => - require('./declaration-colon-newline-after'), - )(), - 'declaration-colon-space-after': importLazy(() => require('./declaration-colon-space-after'))(), - 'declaration-colon-space-before': importLazy(() => require('./declaration-colon-space-before'))(), - 'declaration-empty-line-before': importLazy(() => require('./declaration-empty-line-before'))(), - 'declaration-no-important': importLazy(() => require('./declaration-no-important'))(), - 'declaration-property-max-values': importLazy(() => - require('./declaration-property-max-values'), - )(), - 'declaration-property-unit-allowed-list': importLazy(() => - require('./declaration-property-unit-allowed-list'), - )(), - 'declaration-property-unit-disallowed-list': importLazy(() => - require('./declaration-property-unit-disallowed-list'), - )(), - 'declaration-property-value-allowed-list': importLazy(() => - require('./declaration-property-value-allowed-list'), - )(), - 'declaration-property-value-disallowed-list': importLazy(() => - require('./declaration-property-value-disallowed-list'), - )(), - 'declaration-property-value-no-unknown': importLazy(() => - require('./declaration-property-value-no-unknown'), - )(), - 'font-family-no-missing-generic-family-keyword': importLazy(() => - require('./font-family-no-missing-generic-family-keyword'), - )(), - 'font-family-name-quotes': importLazy(() => require('./font-family-name-quotes'))(), - 'font-family-no-duplicate-names': importLazy(() => require('./font-family-no-duplicate-names'))(), - 'font-weight-notation': importLazy(() => require('./font-weight-notation'))(), - 'function-allowed-list': importLazy(() => require('./function-allowed-list'))(), - 'function-calc-no-unspaced-operator': importLazy(() => - require('./function-calc-no-unspaced-operator'), - )(), - 'function-comma-newline-after': importLazy(() => require('./function-comma-newline-after'))(), - 'function-comma-newline-before': importLazy(() => require('./function-comma-newline-before'))(), - 'function-comma-space-after': importLazy(() => require('./function-comma-space-after'))(), - 'function-comma-space-before': importLazy(() => require('./function-comma-space-before'))(), - 'function-disallowed-list': importLazy(() => require('./function-disallowed-list'))(), - 'function-linear-gradient-no-nonstandard-direction': importLazy(() => - require('./function-linear-gradient-no-nonstandard-direction'), - )(), - 'function-max-empty-lines': importLazy(() => require('./function-max-empty-lines'))(), - 'function-name-case': importLazy(() => require('./function-name-case'))(), - 'function-no-unknown': importLazy(() => require('./function-no-unknown'))(), - 'function-parentheses-newline-inside': importLazy(() => - require('./function-parentheses-newline-inside'), - )(), - 'function-parentheses-space-inside': importLazy(() => - require('./function-parentheses-space-inside'), - )(), - 'function-url-no-scheme-relative': importLazy(() => - require('./function-url-no-scheme-relative'), - )(), - 'function-url-quotes': importLazy(() => require('./function-url-quotes'))(), - 'function-url-scheme-allowed-list': importLazy(() => - require('./function-url-scheme-allowed-list'), - )(), - 'function-url-scheme-disallowed-list': importLazy(() => - require('./function-url-scheme-disallowed-list'), - )(), - 'function-whitespace-after': importLazy(() => require('./function-whitespace-after'))(), - 'hue-degree-notation': importLazy(() => require('./hue-degree-notation'))(), - 'import-notation': importLazy(() => require('./import-notation'))(), - 'keyframe-block-no-duplicate-selectors': importLazy(() => - require('./keyframe-block-no-duplicate-selectors'), - )(), - 'keyframe-declaration-no-important': importLazy(() => - require('./keyframe-declaration-no-important'), - )(), - 'keyframe-selector-notation': importLazy(() => require('./keyframe-selector-notation'))(), - 'keyframes-name-pattern': importLazy(() => require('./keyframes-name-pattern'))(), - 'length-zero-no-unit': importLazy(() => require('./length-zero-no-unit'))(), - linebreaks: importLazy(() => require('./linebreaks'))(), - 'max-empty-lines': importLazy(() => require('./max-empty-lines'))(), - 'max-line-length': importLazy(() => require('./max-line-length'))(), - 'max-nesting-depth': importLazy(() => require('./max-nesting-depth'))(), - 'media-feature-colon-space-after': importLazy(() => - require('./media-feature-colon-space-after'), - )(), - 'media-feature-colon-space-before': importLazy(() => - require('./media-feature-colon-space-before'), - )(), - 'media-feature-name-allowed-list': importLazy(() => - require('./media-feature-name-allowed-list'), - )(), - 'media-feature-name-case': importLazy(() => require('./media-feature-name-case'))(), - 'media-feature-name-disallowed-list': importLazy(() => - require('./media-feature-name-disallowed-list'), - )(), - 'media-feature-name-no-unknown': importLazy(() => require('./media-feature-name-no-unknown'))(), - 'media-feature-name-no-vendor-prefix': importLazy(() => - require('./media-feature-name-no-vendor-prefix'), - )(), - 'media-feature-name-unit-allowed-list': importLazy(() => - require('./media-feature-name-unit-allowed-list'), - )(), - 'media-feature-name-value-allowed-list': importLazy(() => - require('./media-feature-name-value-allowed-list'), - )(), - 'media-feature-name-value-no-unknown': importLazy(() => - require('./media-feature-name-value-no-unknown'), - )(), - 'media-feature-parentheses-space-inside': importLazy(() => - require('./media-feature-parentheses-space-inside'), - )(), - 'media-feature-range-notation': importLazy(() => require('./media-feature-range-notation'))(), - 'media-feature-range-operator-space-after': importLazy(() => - require('./media-feature-range-operator-space-after'), - )(), - 'media-feature-range-operator-space-before': importLazy(() => - require('./media-feature-range-operator-space-before'), - )(), - 'media-query-list-comma-newline-after': importLazy(() => - require('./media-query-list-comma-newline-after'), - )(), - 'media-query-list-comma-newline-before': importLazy(() => - require('./media-query-list-comma-newline-before'), - )(), - 'media-query-list-comma-space-after': importLazy(() => - require('./media-query-list-comma-space-after'), - )(), - 'media-query-list-comma-space-before': importLazy(() => - require('./media-query-list-comma-space-before'), - )(), - 'media-query-no-invalid': importLazy(() => require('./media-query-no-invalid'))(), - 'named-grid-areas-no-invalid': importLazy(() => require('./named-grid-areas-no-invalid'))(), - 'no-descending-specificity': importLazy(() => require('./no-descending-specificity'))(), - 'no-duplicate-at-import-rules': importLazy(() => require('./no-duplicate-at-import-rules'))(), - 'no-duplicate-selectors': importLazy(() => require('./no-duplicate-selectors'))(), - 'no-empty-source': importLazy(() => require('./no-empty-source'))(), - 'no-empty-first-line': importLazy(() => require('./no-empty-first-line'))(), - 'no-eol-whitespace': importLazy(() => require('./no-eol-whitespace'))(), - 'no-extra-semicolons': importLazy(() => require('./no-extra-semicolons'))(), - 'no-invalid-double-slash-comments': importLazy(() => - require('./no-invalid-double-slash-comments'), - )(), - 'no-invalid-position-at-import-rule': importLazy(() => - require('./no-invalid-position-at-import-rule'), - )(), - 'no-irregular-whitespace': importLazy(() => require('./no-irregular-whitespace'))(), - 'no-missing-end-of-source-newline': importLazy(() => - require('./no-missing-end-of-source-newline'), - )(), - 'no-unknown-animations': importLazy(() => require('./no-unknown-animations'))(), - 'no-unknown-custom-properties': importLazy(() => require('./no-unknown-custom-properties'))(), - 'number-leading-zero': importLazy(() => require('./number-leading-zero'))(), - 'number-max-precision': importLazy(() => require('./number-max-precision'))(), - 'number-no-trailing-zeros': importLazy(() => require('./number-no-trailing-zeros'))(), - 'property-allowed-list': importLazy(() => require('./property-allowed-list'))(), - 'property-case': importLazy(() => require('./property-case'))(), - 'property-disallowed-list': importLazy(() => require('./property-disallowed-list'))(), - 'property-no-unknown': importLazy(() => require('./property-no-unknown'))(), - 'property-no-vendor-prefix': importLazy(() => require('./property-no-vendor-prefix'))(), - 'rule-empty-line-before': importLazy(() => require('./rule-empty-line-before'))(), - 'rule-selector-property-disallowed-list': importLazy(() => - require('./rule-selector-property-disallowed-list'), - )(), - 'selector-anb-no-unmatchable': importLazy(() => require('./selector-anb-no-unmatchable'))(), - 'selector-attribute-brackets-space-inside': importLazy(() => - require('./selector-attribute-brackets-space-inside'), - )(), - 'selector-attribute-name-disallowed-list': importLazy(() => - require('./selector-attribute-name-disallowed-list'), - )(), - 'selector-attribute-operator-allowed-list': importLazy(() => - require('./selector-attribute-operator-allowed-list'), - )(), - 'selector-attribute-operator-disallowed-list': importLazy(() => - require('./selector-attribute-operator-disallowed-list'), - )(), - 'selector-attribute-operator-space-after': importLazy(() => - require('./selector-attribute-operator-space-after'), - )(), - 'selector-attribute-operator-space-before': importLazy(() => - require('./selector-attribute-operator-space-before'), - )(), - 'selector-attribute-quotes': importLazy(() => require('./selector-attribute-quotes'))(), - 'selector-class-pattern': importLazy(() => require('./selector-class-pattern'))(), - 'selector-combinator-allowed-list': importLazy(() => - require('./selector-combinator-allowed-list'), - )(), - 'selector-combinator-disallowed-list': importLazy(() => - require('./selector-combinator-disallowed-list'), - )(), - 'selector-combinator-space-after': importLazy(() => - require('./selector-combinator-space-after'), - )(), - 'selector-combinator-space-before': importLazy(() => - require('./selector-combinator-space-before'), - )(), - 'selector-descendant-combinator-no-non-space': importLazy(() => - require('./selector-descendant-combinator-no-non-space'), - )(), - 'selector-disallowed-list': importLazy(() => require('./selector-disallowed-list'))(), - 'selector-id-pattern': importLazy(() => require('./selector-id-pattern'))(), - 'selector-list-comma-newline-after': importLazy(() => - require('./selector-list-comma-newline-after'), - )(), - 'selector-list-comma-newline-before': importLazy(() => - require('./selector-list-comma-newline-before'), - )(), - 'selector-list-comma-space-after': importLazy(() => - require('./selector-list-comma-space-after'), - )(), - 'selector-list-comma-space-before': importLazy(() => - require('./selector-list-comma-space-before'), - )(), - 'selector-max-attribute': importLazy(() => require('./selector-max-attribute'))(), - 'selector-max-class': importLazy(() => require('./selector-max-class'))(), - 'selector-max-combinators': importLazy(() => require('./selector-max-combinators'))(), - 'selector-max-compound-selectors': importLazy(() => - require('./selector-max-compound-selectors'), - )(), - 'selector-max-empty-lines': importLazy(() => require('./selector-max-empty-lines'))(), - 'selector-max-id': importLazy(() => require('./selector-max-id'))(), - 'selector-max-pseudo-class': importLazy(() => require('./selector-max-pseudo-class'))(), - 'selector-max-specificity': importLazy(() => require('./selector-max-specificity'))(), - 'selector-max-type': importLazy(() => require('./selector-max-type'))(), - 'selector-max-universal': importLazy(() => require('./selector-max-universal'))(), - 'selector-nested-pattern': importLazy(() => require('./selector-nested-pattern'))(), - 'selector-no-qualifying-type': importLazy(() => require('./selector-no-qualifying-type'))(), - 'selector-no-vendor-prefix': importLazy(() => require('./selector-no-vendor-prefix'))(), - 'selector-not-notation': importLazy(() => require('./selector-not-notation'))(), - 'selector-pseudo-class-allowed-list': importLazy(() => - require('./selector-pseudo-class-allowed-list'), - )(), - 'selector-pseudo-class-case': importLazy(() => require('./selector-pseudo-class-case'))(), - 'selector-pseudo-class-disallowed-list': importLazy(() => - require('./selector-pseudo-class-disallowed-list'), - )(), - 'selector-pseudo-class-no-unknown': importLazy(() => - require('./selector-pseudo-class-no-unknown'), - )(), - 'selector-pseudo-class-parentheses-space-inside': importLazy(() => - require('./selector-pseudo-class-parentheses-space-inside'), - )(), - 'selector-pseudo-element-allowed-list': importLazy(() => - require('./selector-pseudo-element-allowed-list'), - )(), - 'selector-pseudo-element-case': importLazy(() => require('./selector-pseudo-element-case'))(), - 'selector-pseudo-element-colon-notation': importLazy(() => - require('./selector-pseudo-element-colon-notation'), - )(), - 'selector-pseudo-element-disallowed-list': importLazy(() => - require('./selector-pseudo-element-disallowed-list'), - )(), - 'selector-pseudo-element-no-unknown': importLazy(() => - require('./selector-pseudo-element-no-unknown'), - )(), - 'selector-type-case': importLazy(() => require('./selector-type-case'))(), - 'selector-type-no-unknown': importLazy(() => require('./selector-type-no-unknown'))(), - 'shorthand-property-no-redundant-values': importLazy(() => - require('./shorthand-property-no-redundant-values'), - )(), - 'string-no-newline': importLazy(() => require('./string-no-newline'))(), - 'string-quotes': importLazy(() => require('./string-quotes'))(), - 'time-min-milliseconds': importLazy(() => require('./time-min-milliseconds'))(), - 'unicode-bom': importLazy(() => require('./unicode-bom'))(), - 'unit-allowed-list': importLazy(() => require('./unit-allowed-list'))(), - 'unit-case': importLazy(() => require('./unit-case'))(), - 'unit-disallowed-list': importLazy(() => require('./unit-disallowed-list'))(), - 'unit-no-unknown': importLazy(() => require('./unit-no-unknown'))(), - 'value-keyword-case': importLazy(() => require('./value-keyword-case'))(), - 'value-list-comma-newline-after': importLazy(() => require('./value-list-comma-newline-after'))(), - 'value-list-comma-newline-before': importLazy(() => - require('./value-list-comma-newline-before'), - )(), - 'value-list-comma-space-after': importLazy(() => require('./value-list-comma-space-after'))(), - 'value-list-comma-space-before': importLazy(() => require('./value-list-comma-space-before'))(), - 'value-list-max-empty-lines': importLazy(() => require('./value-list-max-empty-lines'))(), - 'value-no-vendor-prefix': importLazy(() => require('./value-no-vendor-prefix'))(), - indentation: importLazy(() => require('./indentation'))(), -}; - -module.exports = rules; diff --git a/node_modules/stylelint/lib/rules/keyframe-block-no-duplicate-selectors/index.js b/node_modules/stylelint/lib/rules/keyframe-block-no-duplicate-selectors/index.js deleted file mode 100644 index 2e064bf8e..000000000 --- a/node_modules/stylelint/lib/rules/keyframe-block-no-duplicate-selectors/index.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'keyframe-block-no-duplicate-selectors'; - -const messages = ruleMessages(ruleName, { - rejected: (selector) => `Unexpected duplicate "${selector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/keyframe-block-no-duplicate-selectors', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^(-(moz|webkit)-)?keyframes$/i, (atRuleKeyframes) => { - const selectors = new Set(); - - atRuleKeyframes.walkRules((keyframeRule) => { - const ruleSelectors = keyframeRule.selectors; - - ruleSelectors.forEach((selector) => { - if (!isStandardSyntaxSelector(selector)) { - return; - } - - const normalizedSelector = selector.toLowerCase(); - - const isDuplicate = selectors.has(normalizedSelector); - - if (isDuplicate) { - report({ - message: messages.rejected, - messageArgs: [selector], - node: keyframeRule, - result, - ruleName, - word: selector, - }); - - return; - } - - selectors.add(normalizedSelector); - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/keyframe-declaration-no-important/index.js b/node_modules/stylelint/lib/rules/keyframe-declaration-no-important/index.js deleted file mode 100644 index bcadeeffe..000000000 --- a/node_modules/stylelint/lib/rules/keyframe-declaration-no-important/index.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -const getImportantPosition = require('../../utils/getImportantPosition'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { assert } = require('../../utils/validateTypes'); - -const ruleName = 'keyframe-declaration-no-important'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected !important', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/keyframe-declaration-no-important', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^(-(moz|webkit)-)?keyframes$/i, (atRuleKeyframes) => { - atRuleKeyframes.walkDecls((decl) => { - if (!decl.important) { - return; - } - - const pos = getImportantPosition(decl.toString()); - - assert(pos); - - report({ - message: messages.rejected, - node: decl, - index: pos.index, - endIndex: pos.endIndex, - result, - ruleName, - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/keyframe-selector-notation/index.js b/node_modules/stylelint/lib/rules/keyframe-selector-notation/index.js deleted file mode 100644 index b951379a9..000000000 --- a/node_modules/stylelint/lib/rules/keyframe-selector-notation/index.js +++ /dev/null @@ -1,164 +0,0 @@ -'use strict'; - -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const transformSelector = require('../../utils/transformSelector'); -const validateOptions = require('../../utils/validateOptions'); -const { assertString } = require('../../utils/validateTypes'); - -const ruleName = 'keyframe-selector-notation'; - -const messages = ruleMessages(ruleName, { - expected: (selector, fixedSelector) => `Expected "${selector}" to be "${fixedSelector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/keyframe-selector-notation', - fixable: true, -}; - -const PERCENTAGE_SELECTORS = new Set(['0%', '100%']); -const KEYWORD_SELECTORS = new Set(['from', 'to']); -const NAMED_TIMELINE_RANGE_SELECTORS = new Set(['cover', 'contain', 'entry', 'enter', 'exit']); -const PERCENTAGE_TO_KEYWORD = new Map([ - ['0%', 'from'], - ['100%', 'to'], -]); -const KEYWORD_TO_PERCENTAGE = new Map([ - ['from', '0%'], - ['to', '100%'], -]); - -/** @type {import('stylelint').Rule<'keyword' | 'percentage' | 'percentage-unless-within-keyword-only-block'>} */ -const rule = (primary, _, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['keyword', 'percentage', 'percentage-unless-within-keyword-only-block'], - }); - - if (!validOptions) return; - - /** - * @typedef {{ - * expFunc: (selector: string, selectorsInBlock: string[]) => boolean, - * fixFunc: (selector: string) => string, - * }} OptionFuncs - * - * @type {Record} - */ - const optionFuncs = Object.freeze({ - keyword: { - expFunc: (selector) => KEYWORD_SELECTORS.has(selector), - fixFunc: (selector) => getFromMap(PERCENTAGE_TO_KEYWORD, selector), - }, - percentage: { - expFunc: (selector) => PERCENTAGE_SELECTORS.has(selector), - fixFunc: (selector) => getFromMap(KEYWORD_TO_PERCENTAGE, selector), - }, - 'percentage-unless-within-keyword-only-block': { - expFunc: (selector, selectorsInBlock) => { - if (selectorsInBlock.every((s) => KEYWORD_SELECTORS.has(s))) return true; - - return PERCENTAGE_SELECTORS.has(selector); - }, - fixFunc: (selector) => getFromMap(KEYWORD_TO_PERCENTAGE, selector), - }, - }); - - root.walkAtRules(/^(-(moz|webkit)-)?keyframes$/i, (atRuleKeyframes) => { - const selectorsInBlock = - primary === 'percentage-unless-within-keyword-only-block' - ? getSelectorsInBlock(atRuleKeyframes) - : []; - - atRuleKeyframes.walkRules((keyframeRule) => { - transformSelector(result, keyframeRule, (selectors) => { - let first = true; - - selectors.walkTags((selectorTag) => { - if (first && NAMED_TIMELINE_RANGE_SELECTORS.has(selectorTag.value)) { - return false; - } - - first = false; - - checkSelector( - selectorTag.value, - optionFuncs[primary], - (fixedSelector) => (selectorTag.value = fixedSelector), - ); - }); - }); - - /** - * @param {string} selector - * @param {OptionFuncs} funcs - * @param {(fixedSelector: string) => void} fixer - */ - function checkSelector(selector, { expFunc, fixFunc }, fixer) { - const normalizedSelector = selector.toLowerCase(); - - if ( - !KEYWORD_SELECTORS.has(normalizedSelector) && - !PERCENTAGE_SELECTORS.has(normalizedSelector) - ) { - return; - } - - if (expFunc(selector, selectorsInBlock)) return; - - const fixedSelector = fixFunc(selector); - - if (context.fix) { - fixer(fixedSelector); - - return; - } - - report({ - message: messages.expected, - messageArgs: [selector, fixedSelector], - node: keyframeRule, - result, - ruleName, - word: selector, - }); - } - }); - }); - }; -}; - -/** - * @param {Map} map - * @param {string} key - * @returns {string} - */ -function getFromMap(map, key) { - const value = map.get(key); - - assertString(value); - - return value; -} - -/** - * @param {import('postcss').AtRule} atRule - * @returns {string[]} - */ -function getSelectorsInBlock(atRule) { - /** @type {string[]} */ - const selectors = []; - - atRule.walkRules((r) => { - selectors.push(...r.selectors); - }); - - return selectors; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/keyframes-name-pattern/index.js b/node_modules/stylelint/lib/rules/keyframes-name-pattern/index.js deleted file mode 100644 index dbdd96dd5..000000000 --- a/node_modules/stylelint/lib/rules/keyframes-name-pattern/index.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const isStandardSyntaxKeyframesName = require('../../utils/isStandardSyntaxKeyframesName'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'keyframes-name-pattern'; - -const messages = ruleMessages(ruleName, { - expected: (keyframeName, pattern) => `Expected "${keyframeName}" to match pattern "${pattern}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/keyframes-name-pattern', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isRegExp, isString], - }); - - if (!validOptions) { - return; - } - - const regex = isString(primary) ? new RegExp(primary) : primary; - - root.walkAtRules(/keyframes/i, (keyframesNode) => { - const value = keyframesNode.params; - - if (!isStandardSyntaxKeyframesName(value)) { - return; - } - - if (regex.test(value)) { - return; - } - - const index = atRuleParamIndex(keyframesNode); - const endIndex = index + value.length; - - report({ - index, - endIndex, - message: messages.expected, - messageArgs: [value, primary], - node: keyframesNode, - ruleName, - result, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/length-zero-no-unit/index.js b/node_modules/stylelint/lib/rules/length-zero-no-unit/index.js deleted file mode 100644 index 7c8eaaee3..000000000 --- a/node_modules/stylelint/lib/rules/length-zero-no-unit/index.js +++ /dev/null @@ -1,227 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getAtRuleParams = require('../../utils/getAtRuleParams'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const isCustomProperty = require('../../utils/isCustomProperty'); -const isMathFunction = require('../../utils/isMathFunction'); -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const { lengthUnits } = require('../../reference/units'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setAtRuleParams = require('../../utils/setAtRuleParams'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'length-zero-no-unit'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected unit', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/length-zero-no-unit', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - }, - { - actual: secondaryOptions, - possible: { - ignore: ['custom-properties'], - ignoreFunctions: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) return; - - let needsFix; - - /** - * @param {import('postcss').Node} node - * @param {number} nodeIndex - * @param {import('postcss-value-parser').Node} valueNode - */ - function check(node, nodeIndex, valueNode) { - const { value, sourceIndex } = valueNode; - - if (isMathFunction(valueNode)) return false; - - if (isFunction(valueNode) && optionsMatches(secondaryOptions, 'ignoreFunctions', value)) - return false; - - if (!isWord(valueNode)) return; - - const numberUnit = valueParser.unit(value); - - if (numberUnit === false) return; - - const { number, unit } = numberUnit; - - if (unit === '') return; - - if (!isLength(unit)) return; - - if (isFraction(unit)) return; - - if (!isZero(number)) return; - - if (context.fix) { - let regularNumber = number; - - if (regularNumber.startsWith('.')) { - regularNumber = number.slice(1); - } - - valueNode.value = regularNumber; - needsFix = true; - - return; - } - - const index = nodeIndex + sourceIndex + number.length; - const endIndex = index + unit.length; - - report({ - index, - endIndex, - message: messages.rejected, - node, - result, - ruleName, - }); - } - - /** - * @param {import('postcss').AtRule} node - */ - function checkAtRule(node) { - if (!isStandardSyntaxAtRule(node)) return; - - needsFix = false; - - const index = atRuleParamIndex(node); - const parsedValue = valueParser(getAtRuleParams(node)); - - parsedValue.walk((valueNode) => check(node, index, valueNode)); - - if (needsFix) { - setAtRuleParams(node, parsedValue.toString()); - } - } - - /** - * @param {import('postcss').Declaration} node - */ - function checkDecl(node) { - needsFix = false; - - const { prop } = node; - - if (isLineHeight(prop)) return; - - if (isFlex(prop)) return; - - if (optionsMatches(secondaryOptions, 'ignore', 'custom-properties') && isCustomProperty(prop)) - return; - - const index = declarationValueIndex(node); - const parsedValue = valueParser(getDeclarationValue(node)); - - parsedValue.walk((valueNode, valueNodeIndex, valueNodes) => { - if (isLineHeightValue(node, valueNodes, valueNodeIndex)) return; - - return check(node, index, valueNode); - }); - - if (needsFix) { - setDeclarationValue(node, parsedValue.toString()); - } - } - - root.walkAtRules(checkAtRule); - root.walkDecls(checkDecl); - }; -}; - -/** - * @param {import('postcss').Declaration} decl - * @param {import('postcss-value-parser').Node[]} nodes - * @param {number} index - */ -function isLineHeightValue({ prop }, nodes, index) { - const lastNode = nodes[index - 1]; - - return ( - prop.toLowerCase() === 'font' && lastNode && lastNode.type === 'div' && lastNode.value === '/' - ); -} - -/** - * @param {string} prop - */ -function isLineHeight(prop) { - return prop.toLowerCase() === 'line-height'; -} - -/** - * @param {string} prop - */ -function isFlex(prop) { - return prop.toLowerCase() === 'flex'; -} - -/** - * @param {import('postcss-value-parser').Node} node - */ -function isWord({ type }) { - return type === 'word'; -} - -/** - * @param {string} unit - */ -function isLength(unit) { - return lengthUnits.has(unit.toLowerCase()); -} - -/** - * @param {import('postcss-value-parser').Node} node - */ -function isFunction({ type }) { - return type === 'function'; -} - -/** - * @param {string} unit - */ -function isFraction(unit) { - return unit.toLowerCase() === 'fr'; -} - -/** - * @param {string} number - */ -function isZero(number) { - return Number.parseFloat(number) === 0; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/linebreaks/index.js b/node_modules/stylelint/lib/rules/linebreaks/index.js deleted file mode 100644 index e16dee79c..000000000 --- a/node_modules/stylelint/lib/rules/linebreaks/index.js +++ /dev/null @@ -1,132 +0,0 @@ -'use strict'; - -const postcss = require('postcss'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'linebreaks'; - -const messages = ruleMessages(ruleName, { - expected: (linebreak) => `Expected linebreak to be ${linebreak}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/linebreaks', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['unix', 'windows'], - }); - - if (!validOptions) { - return; - } - - const shouldHaveCR = primary === 'windows'; - - if (context.fix) { - root.walk((node) => { - if ('selector' in node) { - node.selector = fixData(node.selector); - } - - if ('value' in node) { - node.value = fixData(node.value); - } - - if ('text' in node) { - node.text = fixData(node.text); - } - - if (node.raws.before) { - node.raws.before = fixData(node.raws.before); - } - - if (typeof node.raws.after === 'string') { - node.raws.after = fixData(node.raws.after); - } - }); - - if (typeof root.raws.after === 'string') { - root.raws.after = fixData(root.raws.after); - } - } else { - if (root.source == null) throw new Error('The root node must have a source'); - - const lines = root.source.input.css.split('\n'); - - for (let [i, line] of lines.entries()) { - if (i < lines.length - 1 && !line.includes('\r')) { - line += '\n'; - } - - if (hasError(line)) { - const lineNum = i + 1; - const colNum = line.length; - - reportNewlineError(lineNum, colNum); - } - } - } - - /** - * @param {string} dataToCheck - */ - function hasError(dataToCheck) { - const hasNewlineToVerify = /[\r\n]/.test(dataToCheck); - const hasCR = hasNewlineToVerify ? /\r/.test(dataToCheck) : false; - - return hasNewlineToVerify && hasCR !== shouldHaveCR; - } - - /** - * @param {string} data - */ - function fixData(data) { - if (data) { - let res = data.replace(/\r/g, ''); - - if (shouldHaveCR) { - res = res.replace(/\n/g, '\r\n'); - } - - return res; - } - - return data; - } - - /** - * @param {number} line - * @param {number} column - */ - function reportNewlineError(line, column) { - // Creating a node manually helps us to point to empty lines. - const node = postcss.rule({ - source: { - start: { line, column, offset: 0 }, - input: new postcss.Input(''), - }, - }); - - report({ - message: messages.expected(primary), - node, - result, - ruleName, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/max-empty-lines/index.js b/node_modules/stylelint/lib/rules/max-empty-lines/index.js deleted file mode 100644 index e68be5554..000000000 --- a/node_modules/stylelint/lib/rules/max-empty-lines/index.js +++ /dev/null @@ -1,219 +0,0 @@ -'use strict'; - -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const styleSearch = require('style-search'); -const validateOptions = require('../../utils/validateOptions'); -const { isNumber } = require('../../utils/validateTypes'); - -const ruleName = 'max-empty-lines'; - -const messages = ruleMessages(ruleName, { - expected: (max) => `Expected no more than ${max} empty ${max === 1 ? 'line' : 'lines'}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/max-empty-lines', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - let emptyLines = 0; - let lastIndex = -1; - - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: isNumber, - }, - { - actual: secondaryOptions, - possible: { - ignore: ['comments'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const ignoreComments = optionsMatches(secondaryOptions, 'ignore', 'comments'); - const getChars = replaceEmptyLines.bind(null, primary); - - /** - * 1. walk nodes & replace enterchar - * 2. deal with special case. - */ - if (context.fix) { - root.walk((node) => { - if (node.type === 'comment' && !ignoreComments) { - node.raws.left = getChars(node.raws.left); - node.raws.right = getChars(node.raws.right); - } - - if (node.raws.before) { - node.raws.before = getChars(node.raws.before); - } - }); - - // first node - const firstNodeRawsBefore = root.first && root.first.raws.before; - // root raws - const rootRawsAfter = root.raws.after; - - // not document node - // @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Root'. - if ((root.document && root.document.constructor.name) !== 'Document') { - if (firstNodeRawsBefore) { - root.first.raws.before = getChars(firstNodeRawsBefore, true); - } - - if (rootRawsAfter) { - // when max set 0, should be treated as 1 in this situation. - root.raws.after = replaceEmptyLines(primary === 0 ? 1 : primary, rootRawsAfter, true); - } - } else if (rootRawsAfter) { - // `css in js` or `html` - root.raws.after = replaceEmptyLines(primary === 0 ? 1 : primary, rootRawsAfter); - } - - return; - } - - emptyLines = 0; - lastIndex = -1; - const rootString = root.toString(); - - styleSearch( - { - source: rootString, - target: /\r\n/.test(rootString) ? '\r\n' : '\n', - comments: ignoreComments ? 'skip' : 'check', - }, - (match) => { - checkMatch(rootString, match.startIndex, match.endIndex, root); - }, - ); - - /** - * @param {string} source - * @param {number} matchStartIndex - * @param {number} matchEndIndex - * @param {import('postcss').Root} node - */ - function checkMatch(source, matchStartIndex, matchEndIndex, node) { - const eof = matchEndIndex === source.length; - let problem = false; - - // Additional check for beginning of file - if (!matchStartIndex || lastIndex === matchStartIndex) { - emptyLines++; - } else { - emptyLines = 0; - } - - lastIndex = matchEndIndex; - - if (emptyLines > primary) problem = true; - - if (!eof && !problem) return; - - if (problem) { - report({ - message: messages.expected(primary), - node, - index: matchStartIndex, - result, - ruleName, - }); - } - - // Additional check for end of file - if (eof && primary) { - emptyLines++; - - if (emptyLines > primary && isEofNode(result.root, node)) { - report({ - message: messages.expected(primary), - node, - index: matchEndIndex, - result, - ruleName, - }); - } - } - } - - /** - * @param {number} maxLines - * @param {unknown} str - * @param {boolean?} isSpecialCase - */ - function replaceEmptyLines(maxLines, str, isSpecialCase = false) { - const repeatTimes = isSpecialCase ? maxLines : maxLines + 1; - - if (repeatTimes === 0 || typeof str !== 'string') { - return ''; - } - - const emptyLFLines = '\n'.repeat(repeatTimes); - const emptyCRLFLines = '\r\n'.repeat(repeatTimes); - - return /(?:\r\n)+/.test(str) - ? str.replace(/(\r\n)+/g, ($1) => { - if ($1.length / 2 > repeatTimes) { - return emptyCRLFLines; - } - - return $1; - }) - : str.replace(/(\n)+/g, ($1) => { - if ($1.length > repeatTimes) { - return emptyLFLines; - } - - return $1; - }); - } - }; -}; - -/** - * Checks whether the given node is the last node of file. - * @param {import('stylelint').PostcssResult['root']} document - the document node with `postcss-html` and `postcss-jsx`. - * @param {import('postcss').Root} root - the root node of css - */ -function isEofNode(document, root) { - if (!document || document.constructor.name !== 'Document' || !('type' in document)) { - return true; - } - - // In the `postcss-html` and `postcss-jsx` syntax, checks that there is text after the given node. - let after; - - if (root === document.last) { - after = document.raws && document.raws.codeAfter; - } else { - // @ts-expect-error -- TS2345: Argument of type 'Root' is not assignable to parameter of type 'number | ChildNode'. - const rootIndex = document.index(root); - - const nextNode = document.nodes[rootIndex + 1]; - - after = nextNode && nextNode.raws && nextNode.raws.codeBefore; - } - - return !String(after).trim(); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/max-line-length/index.js b/node_modules/stylelint/lib/rules/max-line-length/index.js deleted file mode 100644 index 87aa7c8bc..000000000 --- a/node_modules/stylelint/lib/rules/max-line-length/index.js +++ /dev/null @@ -1,203 +0,0 @@ -'use strict'; - -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const styleSearch = require('style-search'); -const validateOptions = require('../../utils/validateOptions'); -const { isNumber, isRegExp, isString, assert } = require('../../utils/validateTypes'); - -const ruleName = 'max-line-length'; - -const messages = ruleMessages(ruleName, { - expected: (max) => - `Expected line length to be no more than ${max} ${max === 1 ? 'character' : 'characters'}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/max-line-length', - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: isNumber, - }, - { - actual: secondaryOptions, - possible: { - ignore: ['non-comments', 'comments'], - ignorePattern: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - if (root.source == null) { - throw new Error('The root node must have a source'); - } - - const EXCLUDED_PATTERNS = [ - /url\(\s*(\S.*\S)\s*\)/gi, // allow tab, whitespace in url content - /@import\s+(['"].*['"])/gi, - ]; - - const ignoreNonComments = optionsMatches(secondaryOptions, 'ignore', 'non-comments'); - const ignoreComments = optionsMatches(secondaryOptions, 'ignore', 'comments'); - const rootString = context.fix ? root.toString() : root.source.input.css; - // Array of skipped sub strings, i.e `url(...)`, `@import "..."` - /** @type {Array<[number, number]>} */ - let skippedSubStrings = []; - let skippedSubStringsIndex = 0; - - for (const pattern of EXCLUDED_PATTERNS) { - for (const match of rootString.matchAll(pattern)) { - const subMatch = match[1] || ''; - const startOfSubString = (match.index || 0) + (match[0] || '').indexOf(subMatch); - - skippedSubStrings.push([startOfSubString, startOfSubString + subMatch.length]); - } - } - - skippedSubStrings = skippedSubStrings.sort((a, b) => a[0] - b[0]); - - // Check first line - checkNewline({ endIndex: 0 }); - // Check subsequent lines - styleSearch({ source: rootString, target: ['\n'], comments: 'check' }, (match) => - checkNewline(match), - ); - - /** - * @param {number} index - */ - function complain(index) { - report({ - index, - result, - ruleName, - message: messages.expected(primary), - node: root, - }); - } - - /** - * @param {number} start - * @param {number} end - */ - function tryToPopSubString(start, end) { - const skippedSubString = skippedSubStrings[skippedSubStringsIndex]; - - assert(skippedSubString); - const [startSubString, endSubString] = skippedSubString; - - // Excluded substring does not presented in current line - if (end < startSubString) { - return 0; - } - - // Compute excluded substring size regarding to current line indexes - const excluded = Math.min(end, endSubString) - Math.max(start, startSubString); - - // Current substring is out of range for next lines - if (endSubString <= end) { - skippedSubStringsIndex++; - } - - return excluded; - } - - /** - * @param {import('style-search').StyleSearchMatch | { endIndex: number }} match - */ - function checkNewline(match) { - let nextNewlineIndex = rootString.indexOf('\n', match.endIndex); - - if (rootString[nextNewlineIndex - 1] === '\r') { - nextNewlineIndex -= 1; - } - - // Accommodate last line - if (nextNewlineIndex === -1) { - nextNewlineIndex = rootString.length; - } - - const rawLineLength = nextNewlineIndex - match.endIndex; - const excludedLength = skippedSubStrings[skippedSubStringsIndex] - ? tryToPopSubString(match.endIndex, nextNewlineIndex) - : 0; - const lineText = rootString.slice(match.endIndex, nextNewlineIndex); - - // Case sensitive ignorePattern match - if (optionsMatches(secondaryOptions, 'ignorePattern', lineText)) { - return; - } - - // If the line's length is less than or equal to the specified - // max, ignore it ... So anything below is liable to be complained about. - // **Note that the length of any url arguments or import urls - // are excluded from the calculation.** - if (rawLineLength - excludedLength <= primary) { - return; - } - - const complaintIndex = nextNewlineIndex - 1; - - if (ignoreComments) { - if ('insideComment' in match && match.insideComment) { - return; - } - - // This trimming business is to notice when the line starts a - // comment but that comment is indented, e.g. - // /* something here */ - const nextTwoChars = rootString.slice(match.endIndex).trim().slice(0, 2); - - if (nextTwoChars === '/*' || nextTwoChars === '//') { - return; - } - } - - if (ignoreNonComments) { - if ('insideComment' in match && match.insideComment) { - return complain(complaintIndex); - } - - // This trimming business is to notice when the line starts a - // comment but that comment is indented, e.g. - // /* something here */ - const nextTwoChars = rootString.slice(match.endIndex).trim().slice(0, 2); - - if (nextTwoChars !== '/*' && nextTwoChars !== '//') { - return; - } - - return complain(complaintIndex); - } - - // If there are no spaces besides initial (indent) spaces, ignore it - const lineString = rootString.slice(match.endIndex, nextNewlineIndex); - - if (!lineString.replace(/^\s+/, '').includes(' ')) { - return; - } - - return complain(complaintIndex); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/max-nesting-depth/index.js b/node_modules/stylelint/lib/rules/max-nesting-depth/index.js deleted file mode 100644 index a1211c94f..000000000 --- a/node_modules/stylelint/lib/rules/max-nesting-depth/index.js +++ /dev/null @@ -1,166 +0,0 @@ -'use strict'; - -const hasBlock = require('../../utils/hasBlock'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const optionsMatches = require('../../utils/optionsMatches'); -const parser = require('postcss-selector-parser'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isAtRule, isDeclaration, isRoot, isRule } = require('../../utils/typeGuards'); -const { isNumber, isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'max-nesting-depth'; - -const messages = ruleMessages(ruleName, { - expected: (depth) => `Expected nesting depth to be no more than ${depth}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/max-nesting-depth', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - /** - * @param {import('postcss').Node} node - */ - const isIgnoreAtRule = (node) => - isAtRule(node) && optionsMatches(secondaryOptions, 'ignoreAtRules', node.name); - - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [isNumber], - }, - { - optional: true, - actual: secondaryOptions, - possible: { - ignore: ['blockless-at-rules', 'pseudo-classes'], - ignoreAtRules: [isString, isRegExp], - ignorePseudoClasses: [isString, isRegExp], - }, - }, - ); - - if (!validOptions) return; - - root.walkRules(checkStatement); - root.walkAtRules(checkStatement); - - /** - * @param {import('postcss').Rule | import('postcss').AtRule} statement - */ - function checkStatement(statement) { - if (isIgnoreAtRule(statement)) { - return; - } - - if (!hasBlock(statement)) { - return; - } - - if (isRule(statement) && !isStandardSyntaxRule(statement)) { - return; - } - - const depth = nestingDepth(statement, 0); - - if (depth > primary) { - report({ - ruleName, - result, - node: statement, - message: messages.expected, - messageArgs: [primary], - }); - } - } - }; - - /** - * @param {import('postcss').Node} node - * @param {number} level - * @returns {number} - */ - function nestingDepth(node, level) { - const parent = node.parent; - - if (!parent) { - return 0; - } - - if (isIgnoreAtRule(parent)) { - return 0; - } - - // The nesting depth level's computation has finished - // when this function, recursively called, receives - // a node that is not nested -- a direct child of the - // root node - if (isRoot(parent) || (isAtRule(parent) && parent.parent && isRoot(parent.parent))) { - return level; - } - - /** - * @param {string} selector - */ - function containsPseudoClassesOnly(selector) { - const normalized = parser().processSync(selector, { lossless: false }); - const selectors = normalized.split(','); - - return selectors.every((sel) => extractPseudoRule(sel)); - } - - /** - * @param {string[]} selectors - * @returns {boolean} - */ - function containsIgnoredPseudoClassesOnly(selectors) { - if (!(secondaryOptions && secondaryOptions.ignorePseudoClasses)) return false; - - return selectors.every((selector) => { - const pseudoRule = extractPseudoRule(selector); - - if (!pseudoRule) return false; - - return optionsMatches(secondaryOptions, 'ignorePseudoClasses', pseudoRule); - }); - } - - if ( - (optionsMatches(secondaryOptions, 'ignore', 'blockless-at-rules') && - isAtRule(node) && - node.every((child) => !isDeclaration(child))) || - (optionsMatches(secondaryOptions, 'ignore', 'pseudo-classes') && - isRule(node) && - containsPseudoClassesOnly(node.selector)) || - (isRule(node) && containsIgnoredPseudoClassesOnly(node.selectors)) - ) { - return nestingDepth(parent, level); - } - - // Unless any of the conditions above apply, we want to - // add 1 to the nesting depth level and then check the parent, - // continuing to add and move up the hierarchy - // until we hit the root node - return nestingDepth(parent, level + 1); - } -}; - -/** - * @param {string} selector - * @returns {string | undefined} - */ -function extractPseudoRule(selector) { - return selector.startsWith('&:') && selector[2] !== ':' ? selector.slice(2) : undefined; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-colon-space-after/index.js b/node_modules/stylelint/lib/rules/media-feature-colon-space-after/index.js deleted file mode 100644 index f456adf0d..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-colon-space-after/index.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const mediaFeatureColonSpaceChecker = require('../mediaFeatureColonSpaceChecker'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'media-feature-colon-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected single space after ":"', - rejectedAfter: () => 'Unexpected whitespace after ":"', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-colon-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - /** @type {Map | undefined} */ - let fixData; - - mediaFeatureColonSpaceChecker({ - root, - result, - locationChecker: checker.after, - checkedRuleName: ruleName, - fix: context.fix - ? (atRule, index) => { - const paramColonIndex = index - atRuleParamIndex(atRule); - - fixData = fixData || new Map(); - const colonIndices = fixData.get(atRule) || []; - - colonIndices.push(paramColonIndex); - fixData.set(atRule, colonIndices); - - return true; - } - : null, - }); - - if (fixData) { - for (const [atRule, colonIndices] of fixData.entries()) { - let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; - - for (const index of colonIndices.sort((a, b) => b - a)) { - const beforeColon = params.slice(0, index + 1); - const afterColon = params.slice(index + 1); - - if (primary === 'always') { - params = beforeColon + afterColon.replace(/^\s*/, ' '); - } else if (primary === 'never') { - params = beforeColon + afterColon.replace(/^\s*/, ''); - } - } - - if (atRule.raws.params) { - atRule.raws.params.raw = params; - } else { - atRule.params = params; - } - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-colon-space-before/index.js b/node_modules/stylelint/lib/rules/media-feature-colon-space-before/index.js deleted file mode 100644 index 4bdc41b99..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-colon-space-before/index.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const mediaFeatureColonSpaceChecker = require('../mediaFeatureColonSpaceChecker'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'media-feature-colon-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before ":"', - rejectedBefore: () => 'Unexpected whitespace before ":"', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-colon-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - /** @type {Map | undefined} */ - let fixData; - - mediaFeatureColonSpaceChecker({ - root, - result, - locationChecker: checker.before, - checkedRuleName: ruleName, - fix: context.fix - ? (atRule, index) => { - const paramColonIndex = index - atRuleParamIndex(atRule); - - fixData = fixData || new Map(); - const colonIndices = fixData.get(atRule) || []; - - colonIndices.push(paramColonIndex); - fixData.set(atRule, colonIndices); - - return true; - } - : null, - }); - - if (fixData) { - for (const [atRule, colonIndices] of fixData.entries()) { - let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; - - for (const index of colonIndices.sort((a, b) => b - a)) { - const beforeColon = params.slice(0, index); - const afterColon = params.slice(index); - - if (primary === 'always') { - params = beforeColon.replace(/\s*$/, ' ') + afterColon; - } else if (primary === 'never') { - params = beforeColon.replace(/\s*$/, '') + afterColon; - } - } - - if (atRule.raws.params) { - atRule.raws.params.raw = params; - } else { - atRule.params = params; - } - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-allowed-list/index.js b/node_modules/stylelint/lib/rules/media-feature-name-allowed-list/index.js deleted file mode 100644 index 9c89fd79d..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-name-allowed-list/index.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const findMediaFeatureNames = require('../../utils/findMediaFeatureNames'); -const getAtRuleParams = require('../../utils/getAtRuleParams'); -const isCustomMediaQuery = require('../../utils/isCustomMediaQuery'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'media-feature-name-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (name) => `Unexpected media feature name "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-name-allowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^media$/i, (atRule) => { - findMediaFeatureNames(getAtRuleParams(atRule), (mediaFeatureNameToken) => { - const [, , startIndex, endIndex, { value: featureName }] = mediaFeatureNameToken; - - if (isCustomMediaQuery(featureName)) { - return; - } - - if (matchesStringOrRegExp(featureName, primary)) { - return; - } - - const atRuleIndex = atRuleParamIndex(atRule); - - report({ - message: messages.rejected, - messageArgs: [featureName], - node: atRule, - index: atRuleIndex + startIndex, - endIndex: atRuleIndex + endIndex + 1, - ruleName, - result, - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-case/index.js b/node_modules/stylelint/lib/rules/media-feature-name-case/index.js deleted file mode 100644 index b2befcca1..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-name-case/index.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -const { mutateIdent } = require('@csstools/css-tokenizer'); - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const findMediaFeatureNames = require('../../utils/findMediaFeatureNames'); -const isCustomMediaQuery = require('../../utils/isCustomMediaQuery'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'media-feature-name-case'; - -const messages = ruleMessages(ruleName, { - expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-name-case', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['lower', 'upper'], - }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^media$/i, (atRule) => { - let hasComments = atRule.raws.params?.raw; - let mediaRule = hasComments ? hasComments : atRule.params; - - let hasFixes = false; - - mediaRule = findMediaFeatureNames(mediaRule, (mediaFeatureNameToken) => { - const [, , startIndex, endIndex, { value: featureName }] = mediaFeatureNameToken; - - if (isCustomMediaQuery(featureName)) { - return; - } - - const expectedFeatureName = - primary === 'lower' ? featureName.toLowerCase() : featureName.toUpperCase(); - - if (featureName === expectedFeatureName) { - return; - } - - if (context.fix) { - mutateIdent(mediaFeatureNameToken, expectedFeatureName); - hasFixes = true; - - return; - } - - const atRuleIndex = atRuleParamIndex(atRule); - - report({ - message: messages.expected(featureName, expectedFeatureName), - node: atRule, - index: atRuleIndex + startIndex, - endIndex: atRuleIndex + endIndex + 1, - ruleName, - result, - }); - }).stringify(); - - if (hasFixes) { - if (hasComments) { - if (atRule.raws.params == null) { - throw new Error('The `AtRuleRaws` node must have a `params` property'); - } - - atRule.raws.params.raw = mediaRule; - } else { - atRule.params = mediaRule; - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-disallowed-list/index.js b/node_modules/stylelint/lib/rules/media-feature-name-disallowed-list/index.js deleted file mode 100644 index 62caa3b4a..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-name-disallowed-list/index.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const findMediaFeatureNames = require('../../utils/findMediaFeatureNames'); -const getAtRuleParams = require('../../utils/getAtRuleParams'); -const isCustomMediaQuery = require('../../utils/isCustomMediaQuery'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'media-feature-name-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (name) => `Unexpected media feature name "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-name-disallowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^media$/i, (atRule) => { - findMediaFeatureNames(getAtRuleParams(atRule), (mediaFeatureNameToken) => { - const [, , startIndex, endIndex, { value: featureName }] = mediaFeatureNameToken; - - if (isCustomMediaQuery(featureName)) { - return; - } - - if (!matchesStringOrRegExp(featureName, primary)) { - return; - } - - const atRuleIndex = atRuleParamIndex(atRule); - - report({ - message: messages.rejected, - messageArgs: [featureName], - node: atRule, - index: atRuleIndex + startIndex, - endIndex: atRuleIndex + endIndex + 1, - ruleName, - result, - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-no-unknown/index.js b/node_modules/stylelint/lib/rules/media-feature-name-no-unknown/index.js deleted file mode 100644 index 897abb612..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-name-no-unknown/index.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const findMediaFeatureNames = require('../../utils/findMediaFeatureNames'); -const getAtRuleParams = require('../../utils/getAtRuleParams'); -const isCustomMediaQuery = require('../../utils/isCustomMediaQuery'); -const { mediaFeatureNames } = require('../../reference/mediaFeatures'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'media-feature-name-no-unknown'; - -const messages = ruleMessages(ruleName, { - rejected: (mediaFeatureName) => `Unexpected unknown media feature name "${mediaFeatureName}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-name-no-unknown', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignoreMediaFeatureNames: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^media$/i, (atRule) => { - findMediaFeatureNames(getAtRuleParams(atRule), (mediaFeatureNameToken) => { - const [, , startIndex, endIndex, { value: featureName }] = mediaFeatureNameToken; - - if (isCustomMediaQuery(featureName)) { - return; - } - - if (optionsMatches(secondaryOptions, 'ignoreMediaFeatureNames', featureName)) { - return; - } - - if (vendor.prefix(featureName) || mediaFeatureNames.has(featureName.toLowerCase())) { - return; - } - - const atRuleIndex = atRuleParamIndex(atRule); - - report({ - message: messages.rejected, - messageArgs: [featureName], - node: atRule, - index: atRuleIndex + startIndex, - endIndex: atRuleIndex + endIndex + 1, - ruleName, - result, - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-no-vendor-prefix/index.js b/node_modules/stylelint/lib/rules/media-feature-name-no-vendor-prefix/index.js deleted file mode 100644 index 941f246d8..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-name-no-vendor-prefix/index.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -const isAutoprefixable = require('../../utils/isAutoprefixable'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'media-feature-name-no-vendor-prefix'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected vendor-prefix', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-name-no-vendor-prefix', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^media$/i, (atRule) => { - const params = atRule.params; - - if (!isAutoprefixable.mediaFeatureName(params)) { - return; - } - - const matches = atRule.toString().match(/(?:min-|max-)?-[a-z-]+device-pixel-ratio/gi); - - if (!matches) { - return; - } - - if (context.fix) { - atRule.params = isAutoprefixable.unprefix(atRule.params); - - return; - } - - for (const match of matches) { - report({ - message: messages.rejected, - node: atRule, - word: match, - result, - ruleName, - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-unit-allowed-list/index.js b/node_modules/stylelint/lib/rules/media-feature-name-unit-allowed-list/index.js deleted file mode 100644 index b8329396b..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-name-unit-allowed-list/index.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict'; - -const { TokenType } = require('@csstools/css-tokenizer'); -const { isTokenNode } = require('@csstools/css-parser-algorithms'); -const { - isMediaFeaturePlain, - isMediaFeatureRange, - isMediaQueryInvalid, -} = require('@csstools/media-query-list-parser'); - -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); -const { isString } = require('../../utils/validateTypes'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const parseMediaQuery = require('../../utils/parseMediaQuery'); - -const ruleName = 'media-feature-name-unit-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (unit, name) => `Unexpected unit "${unit}" for name "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-name-unit-allowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [validateObjectWithArrayProps(isString)], - }); - - if (!validOptions) { - return; - } - - const primaryPairs = Object.entries(primary); - const primaryUnitList = (/** @type {string} */ featureName) => { - for (const [name, unit] of primaryPairs) { - if (matchesStringOrRegExp(featureName, name)) return [unit].flat(); - } - - return undefined; - }; - - root.walkAtRules(/^media$/i, (atRule) => { - const mediaQueryList = parseMediaQuery(atRule); - - mediaQueryList.forEach((mediaQuery) => { - if (isMediaQueryInvalid(mediaQuery)) return; - - const initialState = { - mediaFeatureName: '', - /** @type {string[] | undefined} */ - unitList: undefined, - }; - - mediaQuery.walk(({ node, state }) => { - if (!state) return; - - if (isMediaFeaturePlain(node) || isMediaFeatureRange(node)) { - state.mediaFeatureName = node.getName(); - state.unitList = primaryUnitList(state.mediaFeatureName); - - return; - } - - if (!isTokenNode(node)) return; - - const { mediaFeatureName, unitList } = state; - - if (!mediaFeatureName || !unitList) return; - - const [tokenType, , startIndex, endIndex, parsedValue] = node.value; - - if (tokenType !== TokenType.Dimension) { - return; - } - - if (unitList.includes(parsedValue.unit.toLowerCase())) { - return; - } - - const atRuleIndex = atRuleParamIndex(atRule); - - report({ - message: messages.rejected(parsedValue.unit, mediaFeatureName), - node: atRule, - index: atRuleIndex + startIndex, - endIndex: atRuleIndex + endIndex + 1, - result, - ruleName, - }); - }, initialState); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-value-allowed-list/index.js b/node_modules/stylelint/lib/rules/media-feature-name-value-allowed-list/index.js deleted file mode 100644 index 01f21865b..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-name-value-allowed-list/index.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -const { sourceIndices } = require('@csstools/css-parser-algorithms'); -const { - isMediaQueryInvalid, - isMediaFeature, - isMediaFeatureValue, -} = require('@csstools/media-query-list-parser'); - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const optionsMatches = require('../../utils/optionsMatches'); -const parseMediaQuery = require('../../utils/parseMediaQuery'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isString, isRegExp } = require('../../utils/validateTypes'); - -const ruleName = 'media-feature-name-value-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (name, value) => `Unexpected value "${value}" for name "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-name-value-allowed-list', -}; - -/** @type {import('stylelint').Rule>>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [validateObjectWithArrayProps(isString, isRegExp)], - }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^media$/i, (atRule) => { - parseMediaQuery(atRule).forEach((mediaQuery) => { - if (isMediaQueryInvalid(mediaQuery)) return; - - const initialState = { - mediaFeatureName: '', - unprefixedMediaFeatureName: '', - }; - - mediaQuery.walk(({ node, state }) => { - if (!state) return; - - if (isMediaFeature(node)) { - state.mediaFeatureName = node.getName(); - state.unprefixedMediaFeatureName = vendor.unprefixed(node.getName()); - - return; - } - - if (!isMediaFeatureValue(node)) return; - - const { mediaFeatureName, unprefixedMediaFeatureName } = state; - - if (!mediaFeatureName || !unprefixedMediaFeatureName) return; - - const componentValues = [node.value].flat(); - const value = componentValues.map((x) => x.toString()).join(''); - - const allowedValuesKey = Object.keys(primary).find((featureName) => - matchesStringOrRegExp(unprefixedMediaFeatureName, featureName), - ); - - if (allowedValuesKey == null) { - return; - } - - if (optionsMatches(primary, allowedValuesKey, value)) { - return; - } - - const atRuleIndex = atRuleParamIndex(atRule); - const [startIndex, endIndex] = sourceIndices(componentValues); - - report({ - index: atRuleIndex + startIndex, - endIndex: atRuleIndex + endIndex + 1, - message: messages.rejected, - messageArgs: [mediaFeatureName, value], - node: atRule, - ruleName, - result, - }); - }, initialState); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-name-value-no-unknown/index.js b/node_modules/stylelint/lib/rules/media-feature-name-value-no-unknown/index.js deleted file mode 100644 index dc85897b4..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-name-value-no-unknown/index.js +++ /dev/null @@ -1,277 +0,0 @@ -'use strict'; - -const { TokenType, NumberType } = require('@csstools/css-tokenizer'); -const { isTokenNode, isFunctionNode, sourceIndices } = require('@csstools/css-parser-algorithms'); -const { - isMediaFeature, - isMediaFeatureValue, - matchesRatioExactly, - isMediaQueryInvalid, -} = require('@csstools/media-query-list-parser'); - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const parseMediaQuery = require('../../utils/parseMediaQuery'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { lengthUnits, resolutionUnits } = require('../../reference/units'); -const { mathFunctions } = require('../../reference/functions'); -const { - mediaFeatureNameAllowedValueKeywords, - mediaFeatureNameAllowedValueTypes, - mediaFeatureNames, -} = require('../../reference/mediaFeatures'); - -const ruleName = 'media-feature-name-value-no-unknown'; - -const messages = ruleMessages(ruleName, { - rejected: (name, value) => `Unexpected unknown media feature value "${value}" for name "${name}"`, -}); - -const HAS_MIN_MAX_PREFIX = /^(?:min|max)-/i; - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-name-value-no-unknown', -}; - -/** @typedef {{ mediaFeatureName: string, mediaFeatureNameRaw: string }} State */ -/** @typedef { (state: State, valuePart: string, start: number, end: number) => void } Reporter */ - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - /** - * Check that a single token value is valid for a given media feature name. - * - * @param {State} state - * @param {import('@csstools/css-tokenizer').CSSToken} token - * @param {Reporter} reporter - * @returns {void} - */ - function checkSingleToken(state, token, reporter) { - const [type, raw, start, end, parsed] = token; - - if (type === TokenType.Ident) { - const supportedKeywords = mediaFeatureNameAllowedValueKeywords.get(state.mediaFeatureName); - - if (supportedKeywords) { - const keyword = vendor.unprefixed(parsed.value.toLowerCase()); - - if (supportedKeywords.has(keyword)) return; - } - - // An ident that isn't expected for the given media feature name - reporter(state, raw, start, end); - - return; - } - - const supportedValueTypes = mediaFeatureNameAllowedValueTypes.get(state.mediaFeatureName); - - if (!supportedValueTypes) { - // The given media feature name doesn't support any single token values. - reporter(state, raw, start, end); - - return; - } - - if (type === TokenType.Number) { - if (parsed.type === NumberType.Integer) { - if ( - // Integer values are valid for types "integer" and "ratio". - supportedValueTypes.has('integer') || - supportedValueTypes.has('ratio') || - // Integer values of "0" are also valid for "length", "resolution" and "mq-boolean". - (parsed.value === 0 && - (supportedValueTypes.has('length') || - supportedValueTypes.has('resolution') || - supportedValueTypes.has('mq-boolean'))) || - // Integer values of "1" are also valid for "mq-boolean". - (parsed.value === 1 && supportedValueTypes.has('mq-boolean')) - ) { - return; - } - - // An integer when the media feature doesn't support integers. - reporter(state, raw, start, end); - - return; - } - - if ( - // Numbers are valid for "ratio". - supportedValueTypes.has('ratio') || - // Numbers with value "0" are also valid for "length". - (parsed.value === 0 && - (supportedValueTypes.has('length') || supportedValueTypes.has('resolution'))) - ) { - return; - } - - // A number when the media feature doesn't support numbers. - reporter(state, raw, start, end); - - return; - } - - if (type === TokenType.Dimension) { - const unit = parsed.unit.toLowerCase(); - - if (supportedValueTypes.has('resolution') && resolutionUnits.has(unit)) return; - - if (supportedValueTypes.has('length') && lengthUnits.has(unit)) return; - - // An unexpected dimension or a media feature that doesn't support dimensions. - reporter(state, raw, start, end); - } - } - - /** - * Check that a function node is valid for a given media feature name. - * - * @param {State} state - * @param {import('@csstools/css-parser-algorithms').FunctionNode} functionNode - * @param {Reporter} reporter - * @returns {void} - */ - function checkFunction(state, functionNode, reporter) { - const functionName = functionNode.getName().toLowerCase(); - - // "env()" can represent any value, it is treated as valid for static analysis. - if (functionName === 'env') return; - - const supportedValueTypes = mediaFeatureNameAllowedValueTypes.get(state.mediaFeatureName); - - if ( - supportedValueTypes && - mathFunctions.has(functionName) && - (supportedValueTypes.has('integer') || - supportedValueTypes.has('length') || - supportedValueTypes.has('ratio') || - supportedValueTypes.has('resolution')) - ) { - return; - } - - // An unexpected function or a media feature that doesn't support types that can be the result of a function. - reporter(state, functionNode.toString(), ...sourceIndices(functionNode)); - } - - /** - * Check that an array of component values is valid for a given media feature name. - * - * @param {State} state - * @param {Array} componentValues - * @param {Reporter} reporter - * @returns {void} - */ - function checkListOfComponentValues(state, componentValues, reporter) { - const supportedValueTypes = mediaFeatureNameAllowedValueTypes.get(state.mediaFeatureName); - - if ( - supportedValueTypes && - supportedValueTypes.has('ratio') && - matchesRatioExactly(componentValues) !== -1 - ) { - return; - } - - // An invalid aspect ratio or a media feature that doesn't support aspect ratios. - reporter( - state, - componentValues.map((x) => x.toString()).join(''), - ...sourceIndices(componentValues), - ); - } - - /** - * @param {State} state - * @param {import('@csstools/media-query-list-parser').MediaFeatureValue} valueNode - * @param {Reporter} reporter - * @returns {void} - */ - function checkMediaFeatureValue(state, valueNode, reporter) { - if (isTokenNode(valueNode.value)) { - checkSingleToken(state, valueNode.value.value, reporter); - - return; - } - - if (isFunctionNode(valueNode.value)) { - checkFunction(state, valueNode.value, reporter); - - return; - } - - if (Array.isArray(valueNode.value)) { - checkListOfComponentValues(state, valueNode.value, reporter); - } - } - - root.walkAtRules(/^media$/i, (atRule) => { - /** - * @type {Reporter} - */ - const reporter = (state, valuePart, start, end) => { - const atRuleParamIndexValue = atRuleParamIndex(atRule); - - report({ - message: messages.rejected, - messageArgs: [state.mediaFeatureNameRaw, valuePart], - index: atRuleParamIndexValue + start, - endIndex: atRuleParamIndexValue + end + 1, - node: atRule, - ruleName, - result, - }); - }; - - /** @type {State} */ - const initialState = { - mediaFeatureName: '', - mediaFeatureNameRaw: '', - }; - - parseMediaQuery(atRule).forEach((mediaQuery) => { - if (isMediaQueryInvalid(mediaQuery)) return; - - mediaQuery.walk(({ node, state }) => { - if (!state) return; - - if (isMediaFeature(node)) { - const mediaFeatureNameRaw = node.getName(); - let mediaFeatureName = vendor.unprefixed(mediaFeatureNameRaw.toLowerCase()); - - // Unknown media feature names are handled by "media-feature-name-no-unknown". - if (!mediaFeatureNames.has(mediaFeatureName)) return; - - mediaFeatureName = mediaFeatureName.replace(HAS_MIN_MAX_PREFIX, ''); - - state.mediaFeatureName = mediaFeatureName; - state.mediaFeatureNameRaw = mediaFeatureNameRaw; - - return; - } - - if (!state.mediaFeatureName || !state.mediaFeatureNameRaw) return; - - if (isMediaFeatureValue(node)) { - checkMediaFeatureValue(state, node, reporter); - } - }, initialState); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-parentheses-space-inside/index.js b/node_modules/stylelint/lib/rules/media-feature-parentheses-space-inside/index.js deleted file mode 100644 index 800823b8e..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-parentheses-space-inside/index.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); - -const ruleName = 'media-feature-parentheses-space-inside'; - -const messages = ruleMessages(ruleName, { - expectedOpening: 'Expected single space after "("', - rejectedOpening: 'Unexpected whitespace after "("', - expectedClosing: 'Expected single space before ")"', - rejectedClosing: 'Unexpected whitespace before ")"', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-parentheses-space-inside', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^media$/i, (atRule) => { - // If there are comments in the params, the complete string - // will be at atRule.raws.params.raw - const params = (atRule.raws.params && atRule.raws.params.raw) || atRule.params; - const indexBoost = atRuleParamIndex(atRule); - /** @type {Array<{ message: string, index: number }>} */ - const problems = []; - - const parsedParams = valueParser(params).walk((node) => { - if (node.type === 'function') { - const len = valueParser.stringify(node).length; - - if (primary === 'never') { - if (/[ \t]/.test(node.before)) { - if (context.fix) node.before = ''; - - problems.push({ - message: messages.rejectedOpening, - index: node.sourceIndex + 1 + indexBoost, - }); - } - - if (/[ \t]/.test(node.after)) { - if (context.fix) node.after = ''; - - problems.push({ - message: messages.rejectedClosing, - index: node.sourceIndex - 2 + len + indexBoost, - }); - } - } else if (primary === 'always') { - if (node.before === '') { - if (context.fix) node.before = ' '; - - problems.push({ - message: messages.expectedOpening, - index: node.sourceIndex + 1 + indexBoost, - }); - } - - if (node.after === '') { - if (context.fix) node.after = ' '; - - problems.push({ - message: messages.expectedClosing, - index: node.sourceIndex - 2 + len + indexBoost, - }); - } - } - } - }); - - if (problems.length) { - if (context.fix) { - atRule.params = parsedParams.toString(); - - return; - } - - for (const err of problems) { - report({ - message: err.message, - node: atRule, - index: err.index, - result, - ruleName, - }); - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-range-notation/index.js b/node_modules/stylelint/lib/rules/media-feature-range-notation/index.js deleted file mode 100644 index 770daafa8..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-range-notation/index.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; - -const { TokenType } = require('@csstools/css-tokenizer'); -const { TokenNode, sourceIndices } = require('@csstools/css-parser-algorithms'); -const { - MediaFeatureName, - MediaFeatureRangeNameValue, - isMediaFeature, - isMediaFeaturePlain, - isMediaFeatureRange, - isMediaQueryInvalid, -} = require('@csstools/media-query-list-parser'); - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const parseMediaQuery = require('../../utils/parseMediaQuery'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { rangeTypeMediaFeatureNames } = require('../../reference/mediaFeatures'); - -const ruleName = 'media-feature-range-notation'; - -const messages = ruleMessages(ruleName, { - expected: (primary) => `Expected "${primary}" media feature range notation`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-range-notation', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['prefix', 'context'], - }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^media$/i, (atRule) => { - const mediaQueryList = parseMediaQuery(atRule); - let hasFixes = false; - - mediaQueryList.forEach((mediaQuery) => { - if (isMediaQueryInvalid(mediaQuery)) return; - - mediaQuery.walk(({ node, parent }) => { - // Only look at plain and range notation media features - if (!isMediaFeatureRange(node) && !isMediaFeaturePlain(node)) return; - - // Expected plain notation and received plain notation - if (primary === 'prefix' && isMediaFeaturePlain(node)) return; - - // Expected range notation and received range notation - if (primary === 'context' && isMediaFeatureRange(node)) return; - - const featureName = node.getName(); - const unprefixedMediaFeature = featureName.replace(/^(?:min|max)-/i, ''); - - if (!rangeTypeMediaFeatureNames.has(unprefixedMediaFeature)) return; - - if (context.fix && primary === 'context' && isMediaFeaturePlain(node)) { - if (!isMediaFeature(parent)) return; - - hasFixes = true; - - /** @type {import('@csstools/css-tokenizer').TokenDelim} */ - const operator = /^min-/i.test(featureName) - ? [TokenType.Delim, '>', -1, -1, { value: '>' }] - : [TokenType.Delim, '<', -1, -1, { value: '<' }]; - - parent.feature = new MediaFeatureRangeNameValue( - new MediaFeatureName( - new TokenNode([ - TokenType.Ident, - unprefixedMediaFeature, - -1, - -1, - { value: unprefixedMediaFeature }, - ]), - node.name.before, - node.name.after.length > 0 - ? node.name.after - : [[TokenType.Whitespace, ' ', -1, -1, undefined]], - ), - [operator, [TokenType.Delim, '=', -1, -1, { value: '=' }]], - node.value, - ); - - return; - } - - const [startIndex, endIndex] = sourceIndices(node); - - const atRuleIndex = atRuleParamIndex(atRule); - - report({ - message: messages.expected, - messageArgs: [primary], - node: atRule, - index: atRuleIndex + startIndex - 1, - endIndex: atRuleIndex + endIndex + 1 + 1, - result, - ruleName, - }); - }); - }); - - if (hasFixes) { - const expectedMediaQueryList = mediaQueryList - .map((mediaQuery) => mediaQuery.toString()) - .join(','); - - if (expectedMediaQueryList === atRule.params) return; - - atRule.params = expectedMediaQueryList; - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-range-operator-space-after/index.js b/node_modules/stylelint/lib/rules/media-feature-range-operator-space-after/index.js deleted file mode 100644 index 95ba71161..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-range-operator-space-after/index.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const findMediaOperator = require('../findMediaOperator'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'media-feature-range-operator-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected single space after range operator', - rejectedAfter: () => 'Unexpected whitespace after range operator', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-range-operator-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^media$/i, (atRule) => { - /** @type {number[]} */ - const fixOperatorIndices = []; - /** @type {((index: number) => void) | null} */ - const fix = context.fix ? (index) => fixOperatorIndices.push(index) : null; - - findMediaOperator(atRule, (match, params, node) => { - checkAfterOperator(match, params, node, fix); - }); - - if (fixOperatorIndices.length) { - let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; - - for (const index of fixOperatorIndices.sort((a, b) => b - a)) { - const beforeOperator = params.slice(0, index + 1); - const afterOperator = params.slice(index + 1); - - if (primary === 'always') { - params = beforeOperator + afterOperator.replace(/^\s*/, ' '); - } else if (primary === 'never') { - params = beforeOperator + afterOperator.replace(/^\s*/, ''); - } - } - - if (atRule.raws.params) { - atRule.raws.params.raw = params; - } else { - atRule.params = params; - } - } - }); - - /** - * @param {import('style-search').StyleSearchMatch} match - * @param {string} params - * @param {import('postcss').AtRule} node - * @param {((index: number) => void) | null} fix - */ - function checkAfterOperator(match, params, node, fix) { - const endIndex = match.startIndex + match.target.length - 1; - - checker.after({ - source: params, - index: endIndex, - err: (m) => { - if (fix) { - fix(endIndex); - - return; - } - - report({ - message: m, - node, - index: endIndex + atRuleParamIndex(node) + 1, - result, - ruleName, - }); - }, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-feature-range-operator-space-before/index.js b/node_modules/stylelint/lib/rules/media-feature-range-operator-space-before/index.js deleted file mode 100644 index 5ddcbfd9c..000000000 --- a/node_modules/stylelint/lib/rules/media-feature-range-operator-space-before/index.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const findMediaOperator = require('../findMediaOperator'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'media-feature-range-operator-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before range operator', - rejectedBefore: () => 'Unexpected whitespace before range operator', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-feature-range-operator-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^media$/i, (atRule) => { - /** @type {number[]} */ - const fixOperatorIndices = []; - /** @type {((index: number) => void) | null} */ - const fix = context.fix ? (index) => fixOperatorIndices.push(index) : null; - - findMediaOperator(atRule, (match, params, node) => { - checkBeforeOperator(match, params, node, fix); - }); - - if (fixOperatorIndices.length) { - let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; - - for (const index of fixOperatorIndices.sort((a, b) => b - a)) { - const beforeOperator = params.slice(0, index); - const afterOperator = params.slice(index); - - if (primary === 'always') { - params = beforeOperator.replace(/\s*$/, ' ') + afterOperator; - } else if (primary === 'never') { - params = beforeOperator.replace(/\s*$/, '') + afterOperator; - } - } - - if (atRule.raws.params) { - atRule.raws.params.raw = params; - } else { - atRule.params = params; - } - } - }); - - /** - * @param {import('style-search').StyleSearchMatch} match - * @param {string} params - * @param {import('postcss').AtRule} node - * @param {((index: number) => void) | null} fix - */ - function checkBeforeOperator(match, params, node, fix) { - // The extra `+ 1` is because the match itself contains - // the character before the operator - checker.before({ - source: params, - index: match.startIndex, - err: (m) => { - if (fix) { - fix(match.startIndex); - - return; - } - - report({ - message: m, - node, - index: match.startIndex - 1 + atRuleParamIndex(node), - result, - ruleName, - }); - }, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-query-list-comma-newline-after/index.js b/node_modules/stylelint/lib/rules/media-query-list-comma-newline-after/index.js deleted file mode 100644 index c9c8dcdcb..000000000 --- a/node_modules/stylelint/lib/rules/media-query-list-comma-newline-after/index.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const mediaQueryListCommaWhitespaceChecker = require('../mediaQueryListCommaWhitespaceChecker'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'media-query-list-comma-newline-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected newline after ","', - expectedAfterMultiLine: () => 'Expected newline after "," in a multi-line list', - rejectedAfterMultiLine: () => 'Unexpected whitespace after "," in a multi-line list', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-query-list-comma-newline-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line', 'never-multi-line'], - }); - - if (!validOptions) { - return; - } - - // Only check for the newline after the comma, while allowing - // arbitrary indentation after the newline - /** @type {Map | undefined} */ - let fixData; - - mediaQueryListCommaWhitespaceChecker({ - root, - result, - locationChecker: checker.afterOneOnly, - checkedRuleName: ruleName, - allowTrailingComments: primary.startsWith('always'), - fix: context.fix - ? (atRule, index) => { - const paramCommaIndex = index - atRuleParamIndex(atRule); - - fixData = fixData || new Map(); - const commaIndices = fixData.get(atRule) || []; - - commaIndices.push(paramCommaIndex); - fixData.set(atRule, commaIndices); - - return true; - } - : null, - }); - - if (fixData) { - for (const [atRule, commaIndices] of fixData.entries()) { - let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; - - for (const index of commaIndices.sort((a, b) => b - a)) { - const beforeComma = params.slice(0, index + 1); - const afterComma = params.slice(index + 1); - - if (primary.startsWith('always')) { - params = /^\s*\n/.test(afterComma) - ? beforeComma + afterComma.replace(/^[^\S\r\n]*/, '') - : beforeComma + context.newline + afterComma; - } else if (primary.startsWith('never')) { - params = beforeComma + afterComma.replace(/^\s*/, ''); - } - } - - if (atRule.raws.params) { - atRule.raws.params.raw = params; - } else { - atRule.params = params; - } - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-query-list-comma-newline-before/index.js b/node_modules/stylelint/lib/rules/media-query-list-comma-newline-before/index.js deleted file mode 100644 index 6b155498d..000000000 --- a/node_modules/stylelint/lib/rules/media-query-list-comma-newline-before/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -const mediaQueryListCommaWhitespaceChecker = require('../mediaQueryListCommaWhitespaceChecker'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'media-query-list-comma-newline-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected newline before ","', - expectedBeforeMultiLine: () => 'Expected newline before "," in a multi-line list', - rejectedBeforeMultiLine: () => 'Unexpected whitespace before "," in a multi-line list', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-query-list-comma-newline-before', - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line', 'never-multi-line'], - }); - - if (!validOptions) { - return; - } - - mediaQueryListCommaWhitespaceChecker({ - root, - result, - locationChecker: checker.beforeAllowingIndentation, - checkedRuleName: ruleName, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-query-list-comma-space-after/index.js b/node_modules/stylelint/lib/rules/media-query-list-comma-space-after/index.js deleted file mode 100644 index 4eb0d4ac9..000000000 --- a/node_modules/stylelint/lib/rules/media-query-list-comma-space-after/index.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const mediaQueryListCommaWhitespaceChecker = require('../mediaQueryListCommaWhitespaceChecker'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'media-query-list-comma-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected single space after ","', - rejectedAfter: () => 'Unexpected whitespace after ","', - expectedAfterSingleLine: () => 'Expected single space after "," in a single-line list', - rejectedAfterSingleLine: () => 'Unexpected whitespace after "," in a single-line list', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-query-list-comma-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never', 'always-single-line', 'never-single-line'], - }); - - if (!validOptions) { - return; - } - - /** @type {Map | undefined} */ - let fixData; - - mediaQueryListCommaWhitespaceChecker({ - root, - result, - locationChecker: checker.after, - checkedRuleName: ruleName, - fix: context.fix - ? (atRule, index) => { - const paramCommaIndex = index - atRuleParamIndex(atRule); - - fixData = fixData || new Map(); - const commaIndices = fixData.get(atRule) || []; - - commaIndices.push(paramCommaIndex); - fixData.set(atRule, commaIndices); - - return true; - } - : null, - }); - - if (fixData) { - for (const [atRule, commaIndices] of fixData.entries()) { - let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; - - for (const index of commaIndices.sort((a, b) => b - a)) { - const beforeComma = params.slice(0, index + 1); - const afterComma = params.slice(index + 1); - - if (primary.startsWith('always')) { - params = beforeComma + afterComma.replace(/^\s*/, ' '); - } else if (primary.startsWith('never')) { - params = beforeComma + afterComma.replace(/^\s*/, ''); - } - } - - if (atRule.raws.params) { - atRule.raws.params.raw = params; - } else { - atRule.params = params; - } - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-query-list-comma-space-before/index.js b/node_modules/stylelint/lib/rules/media-query-list-comma-space-before/index.js deleted file mode 100644 index b292e117b..000000000 --- a/node_modules/stylelint/lib/rules/media-query-list-comma-space-before/index.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const mediaQueryListCommaWhitespaceChecker = require('../mediaQueryListCommaWhitespaceChecker'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'media-query-list-comma-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before ","', - rejectedBefore: () => 'Unexpected whitespace before ","', - expectedBeforeSingleLine: () => 'Expected single space before "," in a single-line list', - rejectedBeforeSingleLine: () => 'Unexpected whitespace before "," in a single-line list', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-query-list-comma-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never', 'always-single-line', 'never-single-line'], - }); - - if (!validOptions) { - return; - } - - /** @type {Map | undefined} */ - let fixData; - - mediaQueryListCommaWhitespaceChecker({ - root, - result, - locationChecker: checker.before, - checkedRuleName: ruleName, - fix: context.fix - ? (atRule, index) => { - const paramCommaIndex = index - atRuleParamIndex(atRule); - - fixData = fixData || new Map(); - const commaIndices = fixData.get(atRule) || []; - - commaIndices.push(paramCommaIndex); - fixData.set(atRule, commaIndices); - - return true; - } - : null, - }); - - if (fixData) { - for (const [atRule, commaIndices] of fixData.entries()) { - let params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; - - for (const index of commaIndices.sort((a, b) => b - a)) { - const beforeComma = params.slice(0, index); - const afterComma = params.slice(index); - - if (primary.startsWith('always')) { - params = beforeComma.replace(/\s*$/, ' ') + afterComma; - } else if (primary.startsWith('never')) { - params = beforeComma.replace(/\s*$/, '') + afterComma; - } - } - - if (atRule.raws.params) { - atRule.raws.params.raw = params; - } else { - atRule.params = params; - } - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/media-query-no-invalid/index.js b/node_modules/stylelint/lib/rules/media-query-no-invalid/index.js deleted file mode 100644 index 961cba3b7..000000000 --- a/node_modules/stylelint/lib/rules/media-query-no-invalid/index.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; - -const { sourceIndices } = require('@csstools/css-parser-algorithms'); -const { - isMediaQueryInvalid, - isGeneralEnclosed, - isMediaFeaturePlain, - isMediaFeatureRange, - isMediaFeatureBoolean, -} = require('@csstools/media-query-list-parser'); - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const parseMediaQuery = require('../../utils/parseMediaQuery'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const isCustomMediaQuery = require('../../utils/isCustomMediaQuery'); -const { rangeTypeMediaFeatureNames } = require('../../reference/mediaFeatures'); - -const ruleName = 'media-query-no-invalid'; - -const messages = ruleMessages(ruleName, { - rejected: (query) => `Unexpected invalid media query "${query}"`, -}); - -const HAS_MIN_MAX_PREFIX = /^(?:min|max)-/i; - -const meta = { - url: 'https://stylelint.io/user-guide/rules/media-query-no-invalid', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkAtRules(/^media$/i, (atRule) => { - /** @type {Array<{tokens(): Array}>} */ - let invalidNodes = []; - - parseMediaQuery(atRule).forEach((mediaQuery) => { - if (isMediaQueryInvalid(mediaQuery)) { - // Queries that fail to parse are invalid. - invalidNodes.push(mediaQuery); - - return; - } - - mediaQuery.walk(({ node, parent }) => { - // All general enclosed nodes are invalid. - if (isGeneralEnclosed(node)) { - invalidNodes.push(node); - - return; - } - - // Invalid plain media features. - if (isMediaFeaturePlain(node)) { - const name = node.getName(); - - if (isCustomMediaQuery(name)) { - // In a plain context, custom media queries are invalid. - invalidNodes.push(parent); - - return; - } - - return; - } - - // Invalid range media features. - if (isMediaFeatureRange(node)) { - const name = node.getName().toLowerCase(); - - if (isCustomMediaQuery(name)) { - // In a range context, custom media queries are invalid. - invalidNodes.push(parent); - - return; - } - - if (HAS_MIN_MAX_PREFIX.test(name)) { - // In a range context, min- and max- prefixed feature names are invalid. - invalidNodes.push(parent); - - return; - } - - if (!rangeTypeMediaFeatureNames.has(name)) { - // In a range context, non-range typed features are invalid. - invalidNodes.push(parent); - - return; - } - - return; - } - - // Invalid boolean media features. - if (isMediaFeatureBoolean(node)) { - const name = node.getName().toLowerCase(); - - if (HAS_MIN_MAX_PREFIX.test(name)) { - // In a range context, min- and max- prefixed feature names are invalid - invalidNodes.push(parent); - } - } - }); - }); - - if (invalidNodes.length === 0) return; - - const atRuleParamIndexValue = atRuleParamIndex(atRule); - - invalidNodes.forEach((invalidNode) => { - const [start, end] = sourceIndices(invalidNode); - - report({ - message: messages.rejected, - messageArgs: [invalidNode.toString()], - index: atRuleParamIndexValue + start, - endIndex: atRuleParamIndexValue + end + 1, - node: atRule, - ruleName, - result, - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/mediaFeatureColonSpaceChecker.js b/node_modules/stylelint/lib/rules/mediaFeatureColonSpaceChecker.js deleted file mode 100644 index 8d72c90a5..000000000 --- a/node_modules/stylelint/lib/rules/mediaFeatureColonSpaceChecker.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../utils/atRuleParamIndex'); -const report = require('../utils/report'); -const styleSearch = require('style-search'); - -/** - * @param {{ - * root: import('postcss').Root, - * locationChecker: (args: { source: string, index: number, err: (message: string) => void }) => void, - * fix: ((node: import('postcss').AtRule, index: number) => boolean) | null, - * result: import('stylelint').PostcssResult, - * checkedRuleName: string, - * }} opts - */ -module.exports = function mediaFeatureColonSpaceChecker(opts) { - opts.root.walkAtRules(/^media$/i, (atRule) => { - const params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; - - styleSearch({ source: params, target: ':' }, (match) => { - checkColon(params, match.startIndex, atRule); - }); - }); - - /** - * @param {string} source - * @param {number} index - * @param {import('postcss').AtRule} node - */ - function checkColon(source, index, node) { - opts.locationChecker({ - source, - index, - err: (message) => { - const colonIndex = index + atRuleParamIndex(node); - - if (opts.fix && opts.fix(node, colonIndex)) { - return; - } - - report({ - message, - node, - index: colonIndex, - result: opts.result, - ruleName: opts.checkedRuleName, - }); - }, - }); - } -}; diff --git a/node_modules/stylelint/lib/rules/mediaQueryListCommaWhitespaceChecker.js b/node_modules/stylelint/lib/rules/mediaQueryListCommaWhitespaceChecker.js deleted file mode 100644 index 7c84b1924..000000000 --- a/node_modules/stylelint/lib/rules/mediaQueryListCommaWhitespaceChecker.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -const styleSearch = require('style-search'); - -const atRuleParamIndex = require('../utils/atRuleParamIndex'); -const report = require('../utils/report'); -const { assertString } = require('../utils/validateTypes'); - -/** - * @param {{ - * root: import('postcss').Root, - * result: import('stylelint').PostcssResult, - * locationChecker: (args: { source: string, index: number, err: (message: string) => void }) => void, - * checkedRuleName: string, - * fix?: ((atRule: import('postcss').AtRule, index: number) => boolean) | null | undefined, - * allowTrailingComments?: boolean, - * }} opts - */ -module.exports = function mediaQueryListCommaWhitespaceChecker(opts) { - opts.root.walkAtRules(/^media$/i, (atRule) => { - const params = atRule.raws.params ? atRule.raws.params.raw : atRule.params; - - styleSearch({ source: params, target: ',' }, (match) => { - let index = match.startIndex; - - if (opts.allowTrailingComments) { - // if there is a comment on the same line at after the comma, check the space after the comment. - let execResult; - - while ((execResult = /^[^\S\r\n]*\/\*([\s\S]*?)\*\//.exec(params.slice(index + 1)))) { - assertString(execResult[0]); - index += execResult[0].length; - } - - if ((execResult = /^([^\S\r\n]*\/\/[\s\S]*?)\r?\n/.exec(params.slice(index + 1)))) { - assertString(execResult[1]); - index += execResult[1].length; - } - } - - checkComma(params, index, atRule); - }); - }); - - /** - * @param {string} source - * @param {number} index - * @param {import('postcss').AtRule} node - */ - function checkComma(source, index, node) { - opts.locationChecker({ - source, - index, - err: (message) => { - const commaIndex = index + atRuleParamIndex(node); - - if (opts.fix && opts.fix(node, commaIndex)) { - return; - } - - report({ - message, - node, - index: commaIndex, - result: opts.result, - ruleName: opts.checkedRuleName, - }); - }, - }); - } -}; diff --git a/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/index.js b/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/index.js deleted file mode 100644 index 9b5e82a69..000000000 --- a/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/index.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const findNotContiguousOrRectangular = require('./utils/findNotContiguousOrRectangular'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { assert } = require('../../utils/validateTypes'); - -const ruleName = 'named-grid-areas-no-invalid'; - -const messages = ruleMessages(ruleName, { - expectedToken: () => 'Expected cell token within string', - expectedSameNumber: () => 'Expected same number of cell tokens in each string', - expectedRectangle: (name) => `Expected single filled-in rectangle for "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/named-grid-areas-no-invalid', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkDecls(/^(?:grid|grid-template|grid-template-areas)$/i, (decl) => { - const { value } = decl; - - if (value.toLowerCase().trim() === 'none') return; - - /** @type {Array<{ values: string[], index: number, endIndex: number }>} */ - const areas = []; - let reportSent = false; - - valueParser(value).walk(({ sourceIndex, sourceEndIndex, type, value: tokenValue }) => { - if (type !== 'string') return; - - if (tokenValue === '') { - complain(messages.expectedToken(), sourceIndex, sourceEndIndex); - reportSent = true; - - return; - } - - areas.push({ - values: tokenValue.trim().split(' ').filter(Boolean), - index: sourceIndex, - endIndex: sourceEndIndex, - }); - }); - - if (reportSent) return; - - const [firstArea] = areas; - - if (firstArea === undefined) return; - - const notSameNumberArea = areas.find( - (area) => area.values.length !== firstArea.values.length, - ); - - if (notSameNumberArea !== undefined) { - complain( - messages.expectedSameNumber(), - notSameNumberArea.index, - notSameNumberArea.endIndex, - ); - - return; - } - - const notContiguousOrRectangular = findNotContiguousOrRectangular(areas.map((a) => a.values)); - - for (const name of notContiguousOrRectangular.sort()) { - const area = areas.find((a) => a.values.includes(name)); - - assert(area); - complain(messages.expectedRectangle(name), area.index, area.endIndex); - } - - /** - * @param {string} message - * @param {number} index - * @param {number} endIndex - */ - function complain(message, index, endIndex) { - const start = declarationValueIndex(decl); - - report({ - message, - node: decl, - index: start + index, - endIndex: start + endIndex, - result, - ruleName, - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/utils/findNotContiguousOrRectangular.js b/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/utils/findNotContiguousOrRectangular.js deleted file mode 100644 index 340a1d579..000000000 --- a/node_modules/stylelint/lib/rules/named-grid-areas-no-invalid/utils/findNotContiguousOrRectangular.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -const arrayEqual = require('../../../utils/arrayEqual'); - -/** - * - * @param {string[][]} areas - * @param {string} name - * @returns {boolean} - */ -function isContiguousAndRectangular(areas, name) { - const indicesByRow = areas.map((row) => { - const indices = []; - let idx = row.indexOf(name); - - while (idx !== -1) { - indices.push(idx); - idx = row.indexOf(name, idx + 1); - } - - return indices; - }); - - for (let i = 0; i < indicesByRow.length; i++) { - for (let j = i + 1; j < indicesByRow.length; j++) { - const x = indicesByRow[i]; - const y = indicesByRow[j]; - - if ((x && x.length === 0) || (y && y.length === 0)) { - continue; - } - - if (!arrayEqual(x, y)) { - return false; - } - } - } - - return true; -} - -/** - * - * @param {string[][]} areas - * @returns {string[]} - */ -function namedAreas(areas) { - const names = new Set(areas.flat()); - - names.delete('.'); - - return [...names]; -} - -/** - * - * @param {string[][]} areas - * @returns {string[]} - */ -function findNotContiguousOrRectangular(areas) { - return namedAreas(areas).filter((name) => !isContiguousAndRectangular(areas, name)); -} - -module.exports = findNotContiguousOrRectangular; diff --git a/node_modules/stylelint/lib/rules/no-descending-specificity/index.js b/node_modules/stylelint/lib/rules/no-descending-specificity/index.js deleted file mode 100644 index 4bbe50b0b..000000000 --- a/node_modules/stylelint/lib/rules/no-descending-specificity/index.js +++ /dev/null @@ -1,168 +0,0 @@ -'use strict'; - -const resolvedNestedSelector = require('postcss-resolve-nested-selector'); -const { selectorSpecificity: calculate, compare } = require('@csstools/selector-specificity'); - -const findAtRuleContext = require('../../utils/findAtRuleContext'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const { pseudoElements } = require('../../reference/selectors'); -const nodeContextLookup = require('../../utils/nodeContextLookup'); -const optionsMatches = require('../../utils/optionsMatches'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'no-descending-specificity'; - -const messages = ruleMessages(ruleName, { - rejected: (b, a) => `Expected selector "${b}" to come before selector "${a}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-descending-specificity', -}; - -/** @typedef {{ selector: string, specificity: import('@csstools/selector-specificity').Specificity }} Entry */ - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - }, - { - optional: true, - actual: secondaryOptions, - possible: { - ignore: ['selectors-within-list'], - }, - }, - ); - - if (!validOptions) { - return; - } - - const ignoreSelectorsWithinList = optionsMatches( - secondaryOptions, - 'ignore', - 'selectors-within-list', - ); - - const selectorContextLookup = nodeContextLookup(); - - root.walkRules((ruleNode) => { - // Ignore nested property `foo: {};` - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selectors = ruleNode.selectors; - - // Ignores selectors within list of selectors - if (ignoreSelectorsWithinList && selectors.length > 1) { - return; - } - - /** @type {Map} */ - const comparisonContext = selectorContextLookup.getContext( - ruleNode, - findAtRuleContext(ruleNode), - ); - - for (const selector of selectors) { - // Ignore `.selector, { }` - if (selector.trim() === '') { - continue; - } - - // Resolve any nested selectors before checking - for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { - if (!isStandardSyntaxSelector(resolvedSelector)) { - continue; - } - - parseSelector(resolvedSelector, result, ruleNode, (s) => { - checkSelector(resolvedSelector, s, ruleNode, comparisonContext); - }); - } - } - }); - - /** - * @param {string} selector - * @param {import('postcss-selector-parser').Root} selectorNode - * @param {import('postcss').Rule} ruleNode - * @param {Map} comparisonContext - */ - function checkSelector(selector, selectorNode, ruleNode, comparisonContext) { - const referenceSelector = lastCompoundSelectorWithoutPseudoClasses(selectorNode); - - if (!referenceSelector) return; - - const selectorSpecificity = calculate(selectorNode); - const entry = { selector, specificity: selectorSpecificity }; - const priorComparableSelectors = comparisonContext.get(referenceSelector); - - if (!priorComparableSelectors) { - comparisonContext.set(referenceSelector, [entry]); - - return; - } - - for (const priorEntry of priorComparableSelectors) { - if (compare(selectorSpecificity, priorEntry.specificity) < 0) { - report({ - ruleName, - result, - node: ruleNode, - message: messages.rejected, - messageArgs: [selector, priorEntry.selector], - word: selector, - }); - - break; - } - } - - priorComparableSelectors.push(entry); - } - }; -}; - -/** - * @param {import('postcss-selector-parser').Root} selectorNode - * @returns {string | undefined} - */ -function lastCompoundSelectorWithoutPseudoClasses(selectorNode) { - const firstChild = selectorNode.nodes[0]; - - if (!firstChild) return undefined; - - const nodesByCombinator = firstChild.split((node) => node.type === 'combinator'); - const nodesAfterLastCombinator = nodesByCombinator[nodesByCombinator.length - 1]; - - if (!nodesAfterLastCombinator) return undefined; - - const nodesWithoutPseudoClasses = nodesAfterLastCombinator.filter((node) => { - return ( - node.type !== 'pseudo' || - node.value.startsWith('::') || - pseudoElements.has(node.value.replace(/:/g, '')) - ); - }); - - if (nodesWithoutPseudoClasses.length === 0) return undefined; - - return nodesWithoutPseudoClasses.join(''); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-duplicate-at-import-rules/index.js b/node_modules/stylelint/lib/rules/no-duplicate-at-import-rules/index.js deleted file mode 100644 index 7ca365e6b..000000000 --- a/node_modules/stylelint/lib/rules/no-duplicate-at-import-rules/index.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; - -const getAtRuleParams = require('../../utils/getAtRuleParams'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); - -const ruleName = 'no-duplicate-at-import-rules'; - -const messages = ruleMessages(ruleName, { - rejected: (atImport) => `Unexpected duplicate @import rule ${atImport}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-duplicate-at-import-rules', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - /** @type {Record} */ - const imports = {}; - - root.walkAtRules(/^import$/i, (atRule) => { - const [firstParam, ...restParams] = valueParser(getAtRuleParams(atRule)).nodes; - - if (!firstParam) { - return; - } - - // extract uri from url() if exists - const uri = - firstParam.type === 'function' && firstParam.value === 'url' && firstParam.nodes[0] - ? firstParam.nodes[0].value - : firstParam.value; - - const media = listImportConditions(restParams); - - let importedUris = imports[uri]; - const isDuplicate = media.length - ? media.some((q) => importedUris && importedUris.includes(q)) - : importedUris; - - if (isDuplicate) { - report({ - message: messages.rejected, - messageArgs: [uri], - node: atRule, - result, - ruleName, - word: atRule.toString(), - }); - - return; - } - - if (!importedUris) { - importedUris = imports[uri] = []; - } - - importedUris.push(...media); - }); - }; -}; - -/** @typedef { import('postcss-value-parser').Node } Node */ - -/** - * @param {Node | Array} node - * @returns {string} - */ -function stringifyCondition(node) { - // remove whitespace to get a more consistent key - return valueParser.stringify(node).replace(/\s/g, ''); -} - -/** - * List the import conditions found in the prelude of an `@import` rule - * - * @param {Node[]} params - * @returns {Array} - */ -function listImportConditions(params) { - if (!params.length) return []; - - const separator = ' '; - /** @type {Array} */ - const sharedConditions = []; - /** @type {Array} */ - const media = []; - /** @type {Array} */ - let lastMediaQuery = []; - - for (const param of params) { - // remove top level whitespace and comments to get a more consistent key - if (param.type === 'space' || param.type === 'comment') { - continue; - } - - // layer and supports conditions must precede media query conditions - if (!media.length) { - // @import url(...) layer(base) supports(display: flex) - if (param.type === 'function' && (param.value === 'supports' || param.value === 'layer')) { - sharedConditions.push(stringifyCondition(param)); - continue; - } - - // @import url(...) layer - if (param.type === 'word' && param.value === 'layer') { - sharedConditions.push(stringifyCondition(param)); - continue; - } - } - - if (param.type === 'div' && param.value === ',') { - media.push(stringifyCondition(lastMediaQuery)); - lastMediaQuery = []; - continue; - } - - lastMediaQuery.push(param); - } - - if (lastMediaQuery.length) { - media.push(stringifyCondition(lastMediaQuery)); - } - - // Only media query conditions - if (media.length && !sharedConditions.length) { - return media; - } - - // Only layer and supports conditions - if (!media.length && sharedConditions.length) { - return [sharedConditions.join(separator)]; - } - - const sharedConditionsString = sharedConditions.join(separator); - - return media.map((m) => { - return sharedConditionsString + separator + m; - }); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-duplicate-selectors/index.js b/node_modules/stylelint/lib/rules/no-duplicate-selectors/index.js deleted file mode 100644 index a5c8694ad..000000000 --- a/node_modules/stylelint/lib/rules/no-duplicate-selectors/index.js +++ /dev/null @@ -1,178 +0,0 @@ -'use strict'; - -const resolvedNestedSelector = require('postcss-resolve-nested-selector'); -const selectorParser = require('postcss-selector-parser'); - -const findAtRuleContext = require('../../utils/findAtRuleContext'); -const isKeyframeRule = require('../../utils/isKeyframeRule'); -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const nodeContextLookup = require('../../utils/nodeContextLookup'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isBoolean } = require('../../utils/validateTypes'); - -const ruleName = 'no-duplicate-selectors'; - -const messages = ruleMessages(ruleName, { - rejected: (selector, firstDuplicateLine) => - `Unexpected duplicate selector "${selector}", first used at line ${firstDuplicateLine}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-duplicate-selectors', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - disallowInList: [isBoolean], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const shouldDisallowDuplicateInList = secondaryOptions && secondaryOptions.disallowInList; - - // The top level of this map will be rule sources. - // Each source maps to another map, which maps rule parents to a set of selectors. - // This ensures that selectors are only checked against selectors - // from other rules that share the same parent and the same source. - const selectorContextLookup = nodeContextLookup(); - - root.walkRules((ruleNode) => { - if (isKeyframeRule(ruleNode)) { - return; - } - - const contextSelectorSet = selectorContextLookup.getContext( - ruleNode, - findAtRuleContext(ruleNode), - ); - const resolvedSelectorList = [ - ...new Set( - ruleNode.selectors.flatMap((selector) => resolvedNestedSelector(selector, ruleNode)), - ), - ]; - - const normalizedSelectorList = resolvedSelectorList.map(normalize); - - // Sort the selectors list so that the order of the constituents - // doesn't matter - const sortedSelectorList = [...normalizedSelectorList].sort().join(','); - - if (!ruleNode.source) throw new Error('The rule node must have a source'); - - if (!ruleNode.source.start) throw new Error('The rule source must have a start position'); - - const selectorLine = ruleNode.source.start.line; - - // Complain if the same selector list occurs twice - - let previousDuplicatePosition; - // When `disallowInList` is true, we must parse `sortedSelectorList` into - // list items. - /** @type {string[]} */ - const selectorListParsed = []; - - if (shouldDisallowDuplicateInList) { - parseSelector(sortedSelectorList, result, ruleNode, (selectors) => { - selectors.each((s) => { - const selector = String(s); - - selectorListParsed.push(selector); - - if (contextSelectorSet.get(selector)) { - previousDuplicatePosition = contextSelectorSet.get(selector); - } - }); - }); - } else { - previousDuplicatePosition = contextSelectorSet.get(sortedSelectorList); - } - - if (previousDuplicatePosition) { - // If the selector isn't nested we can use its raw value; otherwise, - // we have to approximate something for the message -- which is close enough - const isNestedSelector = resolvedSelectorList.join(',') !== ruleNode.selectors.join(','); - const selectorForMessage = isNestedSelector - ? resolvedSelectorList.join(', ') - : ruleNode.selector; - - return report({ - result, - ruleName, - node: ruleNode, - message: messages.rejected, - messageArgs: [selectorForMessage, previousDuplicatePosition], - word: selectorForMessage, - }); - } - - const presentedSelectors = new Set(); - const reportedSelectors = new Set(); - - // Or complain if one selector list contains the same selector more than once - for (const selector of ruleNode.selectors) { - const normalized = normalize(selector); - - if (presentedSelectors.has(normalized)) { - if (reportedSelectors.has(normalized)) { - continue; - } - - report({ - result, - ruleName, - node: ruleNode, - message: messages.rejected, - messageArgs: [selector, selectorLine], - word: selector, - }); - reportedSelectors.add(normalized); - } else { - presentedSelectors.add(normalized); - } - } - - if (shouldDisallowDuplicateInList) { - for (const selector of selectorListParsed) { - // [selectorLine] will not really be accurate for multi-line - // selectors, such as "bar" in "foo,\nbar {}". - contextSelectorSet.set(selector, selectorLine); - } - } else { - contextSelectorSet.set(sortedSelectorList, selectorLine); - } - }); - }; -}; - -/** - * @param {string} selector - * @returns {string} - */ -function normalize(selector) { - if (!isStandardSyntaxSelector(selector)) { - return selector; - } - - return selectorParser().processSync(selector, { lossless: false }); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-empty-first-line/index.js b/node_modules/stylelint/lib/rules/no-empty-first-line/index.js deleted file mode 100644 index ee90c6e99..000000000 --- a/node_modules/stylelint/lib/rules/no-empty-first-line/index.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'no-empty-first-line'; -const noEmptyFirstLineTest = /^\s*[\r\n]/; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected empty line', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-empty-first-line', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - // @ts-expect-error -- TS2339: Property 'inline' does not exist on type 'Source'. Property 'lang' does not exist on type 'Source'. - if (!validOptions || root.source.inline || root.source.lang === 'object-literal') { - return; - } - - const rootString = context.fix ? root.toString() : (root.source && root.source.input.css) || ''; - - if (!rootString.trim()) { - return; - } - - if (noEmptyFirstLineTest.test(rootString)) { - if (context.fix) { - if (root.first == null) { - throw new Error('The root node must have the first node.'); - } - - if (root.first.raws.before == null) { - throw new Error('The first node must have spaces before.'); - } - - root.first.raws.before = root.first.raws.before.trimStart(); - - return; - } - - report({ - message: messages.rejected, - node: root, - result, - ruleName, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-empty-source/index.js b/node_modules/stylelint/lib/rules/no-empty-source/index.js deleted file mode 100644 index 28b9a422f..000000000 --- a/node_modules/stylelint/lib/rules/no-empty-source/index.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'no-empty-source'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected empty source', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-empty-source', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - const rootString = context.fix ? root.toString() : (root.source && root.source.input.css) || ''; - - if (rootString.trim()) { - return; - } - - report({ - message: messages.rejected, - node: root, - result, - ruleName, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-eol-whitespace/index.js b/node_modules/stylelint/lib/rules/no-eol-whitespace/index.js deleted file mode 100644 index 9eb58e67e..000000000 --- a/node_modules/stylelint/lib/rules/no-eol-whitespace/index.js +++ /dev/null @@ -1,297 +0,0 @@ -'use strict'; - -const styleSearch = require('style-search'); - -const isOnlyWhitespace = require('../../utils/isOnlyWhitespace'); -const isStandardSyntaxComment = require('../../utils/isStandardSyntaxComment'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const { isAtRule, isComment, isDeclaration, isRule } = require('../../utils/typeGuards'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'no-eol-whitespace'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected whitespace at end of line', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-eol-whitespace', - fixable: true, - deprecated: true, -}; - -const whitespacesToReject = new Set([' ', '\t']); - -/** - * @param {string} str - * @returns {string} - */ -function fixString(str) { - return str.replace(/[ \t]+$/, ''); -} - -/** - * @param {number} lastEOLIndex - * @param {string} string - * @param {{ ignoreEmptyLines: boolean, isRootFirst: boolean }} options - * @returns {number} - */ -function findErrorStartIndex(lastEOLIndex, string, { ignoreEmptyLines, isRootFirst }) { - const eolWhitespaceIndex = lastEOLIndex - 1; - - // If the character before newline is not whitespace, ignore - if (!whitespacesToReject.has(string.charAt(eolWhitespaceIndex))) { - return -1; - } - - if (ignoreEmptyLines) { - // If there is only whitespace between the previous newline and - // this newline, ignore - const beforeNewlineIndex = string.lastIndexOf('\n', eolWhitespaceIndex); - - if (beforeNewlineIndex >= 0 || isRootFirst) { - const line = string.substring(beforeNewlineIndex, eolWhitespaceIndex); - - if (isOnlyWhitespace(line)) { - return -1; - } - } - } - - return eolWhitespaceIndex; -} - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - }, - { - optional: true, - actual: secondaryOptions, - possible: { - ignore: ['empty-lines'], - }, - }, - ); - - if (!validOptions) { - return; - } - - const ignoreEmptyLines = optionsMatches(secondaryOptions, 'ignore', 'empty-lines'); - - if (context.fix) { - fix(root); - } - - const rootString = context.fix ? root.toString() : (root.source && root.source.input.css) || ''; - - /** - * @param {number} index - */ - const reportFromIndex = (index) => { - report({ - message: messages.rejected, - node: root, - index, - result, - ruleName, - }); - }; - - eachEolWhitespace(rootString, reportFromIndex, true); - - const errorIndex = findErrorStartIndex(rootString.length, rootString, { - ignoreEmptyLines, - isRootFirst: true, - }); - - if (errorIndex > -1) { - reportFromIndex(errorIndex); - } - - /** - * Iterate each whitespace at the end of each line of the given string. - * @param {string} string - the source code string - * @param {(index: number) => void} callback - callback the whitespace index at the end of each line. - * @param {boolean} isRootFirst - set `true` if the given string is the first token of the root. - * @returns {void} - */ - function eachEolWhitespace(string, callback, isRootFirst) { - styleSearch( - { - source: string, - target: ['\n', '\r'], - comments: 'check', - }, - (match) => { - const index = findErrorStartIndex(match.startIndex, string, { - ignoreEmptyLines, - isRootFirst, - }); - - if (index > -1) { - callback(index); - } - }, - ); - } - - /** - * @param {import('postcss').Root} rootNode - */ - function fix(rootNode) { - let isRootFirst = true; - - rootNode.walk((node) => { - fixText( - node.raws.before, - (fixed) => { - node.raws.before = fixed; - }, - isRootFirst, - ); - isRootFirst = false; - - if (isAtRule(node)) { - fixText(node.raws.afterName, (fixed) => { - node.raws.afterName = fixed; - }); - - const rawsParams = node.raws.params; - - if (rawsParams) { - fixText(rawsParams.raw, (fixed) => { - rawsParams.raw = fixed; - }); - } else { - fixText(node.params, (fixed) => { - node.params = fixed; - }); - } - } - - if (isRule(node)) { - const rawsSelector = node.raws.selector; - - if (rawsSelector) { - fixText(rawsSelector.raw, (fixed) => { - rawsSelector.raw = fixed; - }); - } else { - fixText(node.selector, (fixed) => { - node.selector = fixed; - }); - } - } - - if (isAtRule(node) || isRule(node) || isDeclaration(node)) { - fixText(node.raws.between, (fixed) => { - node.raws.between = fixed; - }); - } - - if (isDeclaration(node)) { - const rawsValue = node.raws.value; - - if (rawsValue) { - fixText(rawsValue.raw, (fixed) => { - rawsValue.raw = fixed; - }); - } else { - fixText(node.value, (fixed) => { - node.value = fixed; - }); - } - } - - if (isComment(node)) { - fixText(node.raws.left, (fixed) => { - node.raws.left = fixed; - }); - - if (!isStandardSyntaxComment(node)) { - node.raws.right = node.raws.right && fixString(node.raws.right); - } else { - fixText(node.raws.right, (fixed) => { - node.raws.right = fixed; - }); - } - - fixText(node.text, (fixed) => { - node.text = fixed; - }); - } - - if (isAtRule(node) || isRule(node)) { - fixText(node.raws.after, (fixed) => { - node.raws.after = fixed; - }); - } - }); - - fixText( - rootNode.raws.after, - (fixed) => { - rootNode.raws.after = fixed; - }, - isRootFirst, - ); - - if (typeof rootNode.raws.after === 'string') { - const lastEOL = Math.max( - rootNode.raws.after.lastIndexOf('\n'), - rootNode.raws.after.lastIndexOf('\r'), - ); - - if (lastEOL !== rootNode.raws.after.length - 1) { - rootNode.raws.after = - rootNode.raws.after.slice(0, lastEOL + 1) + - fixString(rootNode.raws.after.slice(lastEOL + 1)); - } - } - } - - /** - * @param {string | undefined} value - * @param {(text: string) => void} fixFn - * @param {boolean} isRootFirst - */ - function fixText(value, fixFn, isRootFirst = false) { - if (!value) { - return; - } - - let fixed = ''; - let lastIndex = 0; - - eachEolWhitespace( - value, - (index) => { - const newlineIndex = index + 1; - - fixed += fixString(value.slice(lastIndex, newlineIndex)); - lastIndex = newlineIndex; - }, - isRootFirst, - ); - - if (lastIndex) { - fixed += value.slice(lastIndex); - fixFn(fixed); - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-extra-semicolons/index.js b/node_modules/stylelint/lib/rules/no-extra-semicolons/index.js deleted file mode 100644 index eba41e3a4..000000000 --- a/node_modules/stylelint/lib/rules/no-extra-semicolons/index.js +++ /dev/null @@ -1,244 +0,0 @@ -'use strict'; - -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const styleSearch = require('style-search'); -const validateOptions = require('../../utils/validateOptions'); -const { isAtRule } = require('../../utils/typeGuards'); - -const ruleName = 'no-extra-semicolons'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected extra semicolon', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-extra-semicolons', - fixable: true, - deprecated: true, -}; - -/** - * @param {import('postcss').Node} node - * @returns {number} - */ -function getOffsetByNode(node) { - // @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Document | Container' - if (node.parent && node.parent.document) { - return 0; - } - - const root = node.root(); - - if (!root.source) throw new Error('The root node must have a source'); - - if (!node.source) throw new Error('The node must have a source'); - - if (!node.source.start) throw new Error('The source must have a start position'); - - const string = root.source.input.css; - const nodeColumn = node.source.start.column; - const nodeLine = node.source.start.line; - let line = 1; - let column = 1; - let index = 0; - - for (let i = 0; i < string.length; i++) { - if (column === nodeColumn && nodeLine === line) { - index = i; - break; - } - - if (string[i] === '\n') { - column = 1; - line += 1; - } else { - column += 1; - } - } - - return index; -} - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - if (root.raws.after && root.raws.after.trim().length !== 0) { - const rawAfterRoot = root.raws.after; - - /** @type {number[]} */ - const fixSemiIndices = []; - - styleSearch({ source: rawAfterRoot, target: ';' }, (match) => { - if (context.fix) { - fixSemiIndices.push(match.startIndex); - - return; - } - - if (!root.source) throw new Error('The root node must have a source'); - - complain(root.source.input.css.length - rawAfterRoot.length + match.startIndex); - }); - - // fix - if (fixSemiIndices.length) { - root.raws.after = removeIndices(rawAfterRoot, fixSemiIndices); - } - } - - root.walk((node) => { - if (isAtRule(node) && !isStandardSyntaxAtRule(node)) { - return; - } - - if (node.type === 'rule' && !isStandardSyntaxRule(node)) { - return; - } - - if (node.raws.before && node.raws.before.trim().length !== 0) { - const rawBeforeNode = node.raws.before; - const allowedSemi = 0; - - const rawBeforeIndexStart = 0; - - /** @type {number[]} */ - const fixSemiIndices = []; - - styleSearch({ source: rawBeforeNode, target: ';' }, (match, count) => { - if (count === allowedSemi) { - return; - } - - if (context.fix) { - fixSemiIndices.push(match.startIndex - rawBeforeIndexStart); - - return; - } - - complain(getOffsetByNode(node) - rawBeforeNode.length + match.startIndex); - }); - - // fix - if (fixSemiIndices.length) { - node.raws.before = removeIndices(rawBeforeNode, fixSemiIndices); - } - } - - if (typeof node.raws.after === 'string' && node.raws.after.trim().length !== 0) { - const rawAfterNode = node.raws.after; - - /** - * If the last child is a Less mixin followed by more than one semicolon, - * node.raws.after will be populated with that semicolon. - * Since we ignore Less mixins, exit here - */ - if ( - 'last' in node && - node.last && - node.last.type === 'atrule' && - !isStandardSyntaxAtRule(node.last) - ) { - return; - } - - /** @type {number[]} */ - const fixSemiIndices = []; - - styleSearch({ source: rawAfterNode, target: ';' }, (match) => { - if (context.fix) { - fixSemiIndices.push(match.startIndex); - - return; - } - - const index = - getOffsetByNode(node) + - node.toString().length - - 1 - - rawAfterNode.length + - match.startIndex; - - complain(index); - }); - - // fix - if (fixSemiIndices.length) { - node.raws.after = removeIndices(rawAfterNode, fixSemiIndices); - } - } - - if (typeof node.raws.ownSemicolon === 'string') { - const rawOwnSemicolon = node.raws.ownSemicolon; - const allowedSemi = 0; - - /** @type {number[]} */ - const fixSemiIndices = []; - - styleSearch({ source: rawOwnSemicolon, target: ';' }, (match, count) => { - if (count === allowedSemi) { - return; - } - - if (context.fix) { - fixSemiIndices.push(match.startIndex); - - return; - } - - const index = - getOffsetByNode(node) + - node.toString().length - - rawOwnSemicolon.length + - match.startIndex; - - complain(index); - }); - - // fix - if (fixSemiIndices.length) { - node.raws.ownSemicolon = removeIndices(rawOwnSemicolon, fixSemiIndices); - } - } - }); - - /** - * @param {number} index - */ - function complain(index) { - report({ - message: messages.rejected, - node: root, - index, - result, - ruleName, - }); - } - - /** - * @param {string} str - * @param {number[]} indices - * @returns {string} - */ - function removeIndices(str, indices) { - for (const index of indices.reverse()) { - str = str.slice(0, index) + str.slice(index + 1); - } - - return str; - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-invalid-double-slash-comments/index.js b/node_modules/stylelint/lib/rules/no-invalid-double-slash-comments/index.js deleted file mode 100644 index 880587379..000000000 --- a/node_modules/stylelint/lib/rules/no-invalid-double-slash-comments/index.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'no-invalid-double-slash-comments'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected double-slash CSS comment', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-invalid-double-slash-comments', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (decl.prop.startsWith('//')) { - report({ - message: messages.rejected, - node: decl, - result, - ruleName, - word: decl.toString(), - }); - } - }); - - root.walkRules((ruleNode) => { - for (const selector of ruleNode.selectors) { - if (selector.startsWith('//')) { - report({ - message: messages.rejected, - node: ruleNode, - result, - ruleName, - word: ruleNode.toString(), - }); - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-invalid-position-at-import-rule/index.js b/node_modules/stylelint/lib/rules/no-invalid-position-at-import-rule/index.js deleted file mode 100644 index 4bc0f2b4a..000000000 --- a/node_modules/stylelint/lib/rules/no-invalid-position-at-import-rule/index.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const { isAtRule } = require('../../utils/typeGuards'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'no-invalid-position-at-import-rule'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected invalid position @import rule', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-invalid-position-at-import-rule', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, options) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: options, - possible: { - ignoreAtRules: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - let invalidPosition = false; - - root.walk((node) => { - const nodeName = ('name' in node && node.name && node.name.toLowerCase()) || ''; - - if ( - (isAtRule(node) && - nodeName !== 'charset' && - nodeName !== 'import' && - nodeName !== 'layer' && - !optionsMatches(options, 'ignoreAtRules', node.name) && - isStandardSyntaxAtRule(node)) || - (node.type === 'rule' && isStandardSyntaxRule(node)) - ) { - invalidPosition = true; - - return; - } - - if (isAtRule(node) && nodeName === 'import' && invalidPosition) { - report({ - message: messages.rejected, - node, - result, - ruleName, - word: node.toString(), - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-irregular-whitespace/index.js b/node_modules/stylelint/lib/rules/no-irregular-whitespace/index.js deleted file mode 100644 index 2420179d0..000000000 --- a/node_modules/stylelint/lib/rules/no-irregular-whitespace/index.js +++ /dev/null @@ -1,111 +0,0 @@ -'use strict'; - -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'no-irregular-whitespace'; - -const messages = ruleMessages(ruleName, { - unexpected: 'Unexpected irregular whitespace', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-irregular-whitespace', -}; - -const IRREGULAR_WHITESPACES = [ - '\u000B', // Line Tabulation (\v) - - '\u000C', // Form Feed (\f) - - '\u00A0', // No-Break Space - - '\u0085', // Next Line - '\u1680', // Ogham Space Mark - '\u180E', // Mongolian Vowel Separator - - '\uFEFF', // Zero Width No-Break Space - - '\u2000', // En Quad - '\u2001', // Em Quad - '\u2002', // En Space - - '\u2003', // Em Space - - '\u2004', // Tree-Per-Em - '\u2005', // Four-Per-Em - '\u2006', // Six-Per-Em - '\u2007', // Figure Space - '\u2008', // Punctuation Space - - '\u2009', // Thin Space - '\u200A', // Hair Space - '\u200B', // Zero Width Space - - '\u2028', // Line Separator - '\u2029', // Paragraph Separator - '\u202F', // Narrow No-Break Space - '\u205F', // Medium Mathematical Space - '\u3000', // Ideographic Space -]; - -const IRREGULAR_WHITESPACES_PATTERN = new RegExp(`([${IRREGULAR_WHITESPACES.join('')}])`); - -/** - * @param {string} str - * @returns {string | null} - */ -const findIrregularWhitespace = (str) => { - const result = IRREGULAR_WHITESPACES_PATTERN.exec(str); - - return (result && result[1]) || null; -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - /** - * @param {import('postcss').Node} node - * @param {string | undefined} value - */ - const validate = (node, value) => { - const issue = value && findIrregularWhitespace(value); - - if (issue) { - report({ - ruleName, - result, - message: messages.unexpected, - node, - word: issue, - }); - } - }; - - root.walkAtRules((atRule) => { - validate(atRule, atRule.name); - validate(atRule, atRule.params); - validate(atRule, atRule.raws.before); - validate(atRule, atRule.raws.after); - validate(atRule, atRule.raws.afterName); - validate(atRule, atRule.raws.between); - }); - - root.walkRules((ruleNode) => { - validate(ruleNode, ruleNode.selector); - validate(ruleNode, ruleNode.raws.before); - validate(ruleNode, ruleNode.raws.after); - validate(ruleNode, ruleNode.raws.between); - }); - - root.walkDecls((decl) => { - validate(decl, decl.prop); - validate(decl, decl.value); - validate(decl, decl.raws.before); - validate(decl, decl.raws.between); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-missing-end-of-source-newline/index.js b/node_modules/stylelint/lib/rules/no-missing-end-of-source-newline/index.js deleted file mode 100644 index 10c576afc..000000000 --- a/node_modules/stylelint/lib/rules/no-missing-end-of-source-newline/index.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'no-missing-end-of-source-newline'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected missing end-of-source newline', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-missing-end-of-source-newline', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - if (root.source == null) { - throw new Error('The root node must have a source property'); - } - - // @ts-expect-error -- TS2339: Property 'inline' does not exist on type 'Source'. - if (root.source.inline || root.source.lang === 'object-literal') { - return; - } - - const rootString = context.fix ? root.toString() : root.source.input.css; - - if (!rootString.trim() || rootString.endsWith('\n')) { - return; - } - - // Fix - if (context.fix) { - root.raws.after = context.newline; - - return; - } - - report({ - message: messages.rejected, - node: root, - index: rootString.length - 1, - result, - ruleName, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-unknown-animations/index.js b/node_modules/stylelint/lib/rules/no-unknown-animations/index.js deleted file mode 100644 index fe5995c1b..000000000 --- a/node_modules/stylelint/lib/rules/no-unknown-animations/index.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const findAnimationName = require('../../utils/findAnimationName'); -const { animationNameKeywords } = require('../../reference/keywords'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'no-unknown-animations'; - -const messages = ruleMessages(ruleName, { - rejected: (animationName) => `Unexpected unknown animation name "${animationName}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-unknown-animations', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - const declaredAnimations = new Set(); - - root.walkAtRules(/(-(moz|webkit)-)?keyframes/i, (atRule) => { - declaredAnimations.add(atRule.params); - }); - - root.walkDecls((decl) => { - if (decl.prop.toLowerCase() === 'animation' || decl.prop.toLowerCase() === 'animation-name') { - const animationNames = findAnimationName(decl.value); - - if (animationNames.length === 0) { - return; - } - - for (const animationNameNode of animationNames) { - if (animationNameKeywords.has(animationNameNode.value.toLowerCase())) { - continue; - } - - if (declaredAnimations.has(animationNameNode.value)) { - continue; - } - - const begin = declarationValueIndex(decl); - - report({ - result, - ruleName, - message: messages.rejected, - messageArgs: [animationNameNode.value], - node: decl, - index: begin + animationNameNode.sourceIndex, - endIndex: begin + animationNameNode.sourceEndIndex, - }); - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/no-unknown-custom-properties/index.js b/node_modules/stylelint/lib/rules/no-unknown-custom-properties/index.js deleted file mode 100644 index a15965af4..000000000 --- a/node_modules/stylelint/lib/rules/no-unknown-custom-properties/index.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const { isValueFunction } = require('../../utils/typeGuards'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'no-unknown-custom-properties'; - -const messages = ruleMessages(ruleName, { - rejected: (propName) => `Unexpected unknown custom property "${propName}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/no-unknown-custom-properties', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) return; - - /** @type {Set} */ - const declaredCustomProps = new Set(); - - root.walkAtRules(/^property$/i, ({ params }) => { - declaredCustomProps.add(params); - }); - - root.walkDecls(/^--/, ({ prop }) => { - declaredCustomProps.add(prop); - }); - - root.walkDecls((decl) => { - const { value } = decl; - - const parsedValue = valueParser(value); - - parsedValue.walk((node) => { - if (!isValueFunction(node) || node.value !== 'var') return; - - const [firstNode, secondNode] = node.nodes; - - if (!firstNode || declaredCustomProps.has(firstNode.value)) return; - - // Second node (div) indicates fallback exists in all cases - if (secondNode && secondNode.type === 'div') return; - - const startIndex = declarationValueIndex(decl); - - report({ - result, - ruleName, - message: messages.rejected, - messageArgs: [firstNode.value], - node: decl, - index: startIndex + firstNode.sourceIndex, - endIndex: startIndex + firstNode.sourceEndIndex, - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/number-leading-zero/index.js b/node_modules/stylelint/lib/rules/number-leading-zero/index.js deleted file mode 100644 index 82ccc2ed7..000000000 --- a/node_modules/stylelint/lib/rules/number-leading-zero/index.js +++ /dev/null @@ -1,197 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const { isAtRule } = require('../../utils/typeGuards'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'number-leading-zero'; - -const messages = ruleMessages(ruleName, { - expected: 'Expected a leading zero', - rejected: 'Unexpected leading zero', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/number-leading-zero', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - root.walkAtRules((atRule) => { - if (atRule.name.toLowerCase() === 'import') { - return; - } - - check(atRule, atRule.params); - }); - - root.walkDecls((decl) => check(decl, decl.value)); - - /** - * @param {import('postcss').AtRule | import('postcss').Declaration} node - * @param {string} value - */ - function check(node, value) { - /** @type {Array<{ startIndex: number, endIndex: number }>} */ - const neverFixPositions = []; - /** @type {Array<{ index: number }>} */ - const alwaysFixPositions = []; - - // Get out quickly if there are no periods - if (!value.includes('.')) { - return; - } - - valueParser(value).walk((valueNode) => { - // Ignore `url` function - if (valueNode.type === 'function' && valueNode.value.toLowerCase() === 'url') { - return false; - } - - // Ignore strings, comments, etc - if (valueNode.type !== 'word') { - return; - } - - // Check leading zero - if (primary === 'always') { - const match = /(?:\D|^)(\.\d+)/.exec(valueNode.value); - - if (match == null || match[0] == null || match[1] == null) { - return; - } - - // The regexp above consists of 2 capturing groups (or capturing parentheses). - // We need the index of the second group. This makes sanse when we have "-.5" as an input - // for regex. And we need the index of ".5". - const capturingGroupIndex = match[0].length - match[1].length; - - const index = valueNode.sourceIndex + match.index + capturingGroupIndex; - - if (context.fix) { - alwaysFixPositions.unshift({ - index, - }); - - return; - } - - const baseIndex = isAtRule(node) ? atRuleParamIndex(node) : declarationValueIndex(node); - - complain(messages.expected, node, baseIndex + index); - } - - if (primary === 'never') { - const match = /(?:\D|^)(0+)(\.\d+)/.exec(valueNode.value); - - if (match == null || match[0] == null || match[1] == null || match[2] == null) { - return; - } - - // The regexp above consists of 3 capturing groups (or capturing parentheses). - // We need the index of the second group. This makes sanse when we have "-00.5" - // as an input for regex. And we need the index of "00". - const capturingGroupIndex = match[0].length - (match[1].length + match[2].length); - - const index = valueNode.sourceIndex + match.index + capturingGroupIndex; - - if (context.fix) { - neverFixPositions.unshift({ - startIndex: index, - // match[1].length is the length of our matched zero(s) - endIndex: index + match[1].length, - }); - - return; - } - - const baseIndex = isAtRule(node) ? atRuleParamIndex(node) : declarationValueIndex(node); - - complain(messages.rejected, node, baseIndex + index); - } - }); - - if (alwaysFixPositions.length) { - for (const fixPosition of alwaysFixPositions) { - const index = fixPosition.index; - - if (isAtRule(node)) { - node.params = addLeadingZero(node.params, index); - } else { - node.value = addLeadingZero(node.value, index); - } - } - } - - if (neverFixPositions.length) { - for (const fixPosition of neverFixPositions) { - const startIndex = fixPosition.startIndex; - const endIndex = fixPosition.endIndex; - - if (isAtRule(node)) { - node.params = removeLeadingZeros(node.params, startIndex, endIndex); - } else { - node.value = removeLeadingZeros(node.value, startIndex, endIndex); - } - } - } - } - - /** - * @param {string} message - * @param {import('postcss').Node} node - * @param {number} index - */ - function complain(message, node, index) { - report({ - result, - ruleName, - message, - node, - index, - }); - } - }; -}; - -/** - * @param {string} input - * @param {number} index - * @returns {string} - */ -function addLeadingZero(input, index) { - // eslint-disable-next-line prefer-template - return input.slice(0, index) + '0' + input.slice(index); -} - -/** - * @param {string} input - * @param {number} startIndex - * @param {number} endIndex - * @returns {string} - */ -function removeLeadingZeros(input, startIndex, endIndex) { - return input.slice(0, startIndex) + input.slice(endIndex); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/number-max-precision/index.js b/node_modules/stylelint/lib/rules/number-max-precision/index.js deleted file mode 100644 index 04bd895a3..000000000 --- a/node_modules/stylelint/lib/rules/number-max-precision/index.js +++ /dev/null @@ -1,214 +0,0 @@ -'use strict'; - -const { tokenize, TokenType } = require('@csstools/css-tokenizer'); -const { - isFunctionNode, - isSimpleBlockNode, - isTokenNode, - parseListOfComponentValues, -} = require('@csstools/css-parser-algorithms'); - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getAtRuleParams = require('../../utils/getAtRuleParams'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isNumber, isRegExp, isString } = require('../../utils/validateTypes'); -const validateObjectWithProps = require('../../utils/validateObjectWithProps'); - -const ruleName = 'number-max-precision'; - -const messages = ruleMessages(ruleName, { - expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/number-max-precision', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [isNumber], - }, - { - optional: true, - actual: secondaryOptions, - possible: { - ignoreProperties: [isString, isRegExp], - ignoreUnits: [isString, isRegExp], - insideFunctions: [validateObjectWithProps(isNumber)], - }, - }, - ); - - if (!validOptions) { - return; - } - - /** @type {Map} */ - const insideFunctions = new Map(Object.entries(secondaryOptions?.insideFunctions ?? {})); - - root.walkAtRules((atRule) => { - if (atRule.name.toLowerCase() === 'import') { - return; - } - - check(atRule, atRuleParamIndex, getAtRuleParams(atRule)); - }); - - root.walkDecls((decl) => { - check(decl, declarationValueIndex, getDeclarationValue(decl)); - }); - - /** - * @template {import('postcss').AtRule | import('postcss').Declaration} T - * @param {T} node - * @param {(node: T) => number} getIndex - * @param {string} value - */ - function check(node, getIndex, value) { - // Get out quickly if there are no periods - if (!value.includes('.')) { - return; - } - - const prop = 'prop' in node ? node.prop : undefined; - - if (optionsMatches(secondaryOptions, 'ignoreProperties', prop)) { - return; - } - - parseListOfComponentValues(tokenize({ css: value })).forEach((componentValue) => { - const initialState = { - ignored: false, - precision: primary, - }; - - walker(node, getIndex, componentValue, initialState); - - if (isFunctionNode(componentValue) || isSimpleBlockNode(componentValue)) { - componentValue.walk(({ node: mediaNode, state }) => { - if (!state) return; - - if (state.ignored) return; - - walker(node, getIndex, mediaNode, state); - }, initialState); - } - }); - } - - /** - * @template {import('postcss').AtRule | import('postcss').Declaration} T - * @param {T} node - * @param {(node: T) => number} getIndex - * @param {import('@csstools/css-parser-algorithms').ComponentValue} componentValue - * @param {{ ignored: boolean, precision: number }} state - */ - function walker(node, getIndex, componentValue, state) { - if (isFunctionNode(componentValue)) { - const name = componentValue.getName().toLowerCase(); - - if (name === 'url') { - // postcss-value-parser exposed url token contents as "word" tokens, these were indistinguishable from numeric values in any other function. - // With @csstools/css-tokenizer this is no longer relevant, but we preserve the old condition to avoid breaking changes. - state.ignored = true; - - return; - } - - state.precision = precisionInsideFunction(name, state.precision); - - return; - } - - if (!isTokenNode(componentValue)) { - return; - } - - const [tokenType, raw, startIndex, endIndex, parsedValue] = componentValue.value; - - if ( - tokenType !== TokenType.Number && - tokenType !== TokenType.Dimension && - tokenType !== TokenType.Percentage - ) { - return; - } - - let unitStringLength = 0; - - if (tokenType === TokenType.Dimension) { - const unit = parsedValue.unit; - - unitStringLength = unit.length; - - if (optionsMatches(secondaryOptions, 'ignoreUnits', unit)) { - return; - } - } else if (tokenType === TokenType.Percentage) { - unitStringLength = 1; - - if (optionsMatches(secondaryOptions, 'ignoreUnits', '%')) { - return; - } - } - - const match = /\d*\.(\d+)/.exec(raw); - - if (match == null || match[0] == null || match[1] == null) { - return; - } - - if (match[1].length <= state.precision) { - return; - } - - const nodeIndex = getIndex(node); - - report({ - result, - ruleName, - node, - index: nodeIndex + startIndex, - endIndex: nodeIndex + (endIndex + 1) - unitStringLength, - message: messages.expected, - messageArgs: [parsedValue.value, parsedValue.value.toFixed(state.precision)], - }); - } - - /** - * @param {string} functionName - * @param {number} currentPrecision - * @returns {number} - */ - function precisionInsideFunction(functionName, currentPrecision) { - const precisionForFunction = insideFunctions.get(functionName); - - if (isNumber(precisionForFunction)) return precisionForFunction; - - for (const [name, precision] of insideFunctions) { - if (matchesStringOrRegExp(functionName, name)) { - return precision; - } - } - - return currentPrecision; - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/number-no-trailing-zeros/index.js b/node_modules/stylelint/lib/rules/number-no-trailing-zeros/index.js deleted file mode 100644 index 287ce07a4..000000000 --- a/node_modules/stylelint/lib/rules/number-no-trailing-zeros/index.js +++ /dev/null @@ -1,140 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const { isAtRule } = require('../../utils/typeGuards'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'number-no-trailing-zeros'; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected trailing zero(s)', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/number-no-trailing-zeros', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkAtRules((atRule) => { - if (atRule.name.toLowerCase() === 'import') { - return; - } - - check(atRule, atRule.params); - }); - - root.walkDecls((decl) => check(decl, decl.value)); - - /** - * @param {import('postcss').AtRule | import('postcss').Declaration} node - * @param {string} value - */ - function check(node, value) { - /** @type {Array<{ startIndex: number, endIndex: number }>} */ - const fixPositions = []; - - // Get out quickly if there are no periods - if (!value.includes('.')) { - return; - } - - valueParser(value).walk((valueNode) => { - // Ignore `url` function - if (valueNode.type === 'function' && valueNode.value.toLowerCase() === 'url') { - return false; - } - - // Ignore strings, comments, etc - if (valueNode.type !== 'word') { - return; - } - - const match = /\.(\d{0,100}?)(0+)(?:\D|$)/.exec(valueNode.value); - - // match[1] is any numbers between the decimal and our trailing zero, could be empty - // match[2] is our trailing zero(s) - if (match == null || match[1] == null || match[2] == null) { - return; - } - - // our index is: - // the index of our valueNode + - // the index of our match + - // 1 for our decimal + - // the length of our potential non-zero number match (match[1]) - const index = valueNode.sourceIndex + match.index + 1 + match[1].length; - - // our startIndex is identical to our index except when we have only - // trailing zeros after our decimal. in that case we don't need the decimal - // either so we move our index back by 1. - const startIndex = match[1].length > 0 ? index : index - 1; - - // our end index is our original index + the length of our trailing zeros - const endIndex = index + match[2].length; - - if (context.fix) { - fixPositions.unshift({ - startIndex, - endIndex, - }); - - return; - } - - const baseIndex = isAtRule(node) ? atRuleParamIndex(node) : declarationValueIndex(node); - - report({ - message: messages.rejected, - node, - // this is the index of the _first_ trailing zero - index: baseIndex + index, - result, - ruleName, - }); - }); - - if (fixPositions.length) { - for (const fixPosition of fixPositions) { - const startIndex = fixPosition.startIndex; - const endIndex = fixPosition.endIndex; - - if (isAtRule(node)) { - node.params = removeTrailingZeros(node.params, startIndex, endIndex); - } else { - node.value = removeTrailingZeros(node.value, startIndex, endIndex); - } - } - } - } - }; -}; - -/** - * @param {string} input - * @param {number} startIndex - * @param {number} endIndex - * @returns {string} - */ -function removeTrailingZeros(input, startIndex, endIndex) { - return input.slice(0, startIndex) + input.slice(endIndex); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/property-allowed-list/index.js b/node_modules/stylelint/lib/rules/property-allowed-list/index.js deleted file mode 100644 index c35948309..000000000 --- a/node_modules/stylelint/lib/rules/property-allowed-list/index.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -const isCustomProperty = require('../../utils/isCustomProperty'); -const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'property-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (property) => `Unexpected property "${property}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/property-allowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - const prop = decl.prop; - - if (!isStandardSyntaxProperty(prop)) { - return; - } - - if (isCustomProperty(prop)) { - return; - } - - // either the prefix or unprefixed version is in the list - if (matchesStringOrRegExp([prop, vendor.unprefixed(prop)], primary)) { - return; - } - - report({ - message: messages.rejected, - messageArgs: [prop], - word: prop, - node: decl, - result, - ruleName, - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/property-case/index.js b/node_modules/stylelint/lib/rules/property-case/index.js deleted file mode 100644 index a52b72b26..000000000 --- a/node_modules/stylelint/lib/rules/property-case/index.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -const isCustomProperty = require('../../utils/isCustomProperty'); -const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const optionsMatches = require('../../utils/optionsMatches'); -const { isRegExp, isString } = require('../../utils/validateTypes'); -const { isRule } = require('../../utils/typeGuards'); - -const ruleName = 'property-case'; - -const messages = ruleMessages(ruleName, { - expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/property-case', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['lower', 'upper'], - }, - { - actual: secondaryOptions, - possible: { - ignoreSelectors: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - const prop = decl.prop; - - if (!isStandardSyntaxProperty(prop)) { - return; - } - - if (isCustomProperty(prop)) { - return; - } - - const { parent } = decl; - - if (!parent) throw new Error('A parent node must be present'); - - if (isRule(parent)) { - const { selector } = parent; - - if (selector && optionsMatches(secondaryOptions, 'ignoreSelectors', selector)) { - return; - } - } - - const expectedProp = primary === 'lower' ? prop.toLowerCase() : prop.toUpperCase(); - - if (prop === expectedProp) { - return; - } - - if (context.fix) { - decl.prop = expectedProp; - - return; - } - - report({ - message: messages.expected(prop, expectedProp), - word: prop, - node: decl, - ruleName, - result, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/property-disallowed-list/index.js b/node_modules/stylelint/lib/rules/property-disallowed-list/index.js deleted file mode 100644 index f98827897..000000000 --- a/node_modules/stylelint/lib/rules/property-disallowed-list/index.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -const isCustomProperty = require('../../utils/isCustomProperty'); -const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'property-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (property) => `Unexpected property "${property}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/property-disallowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - const prop = decl.prop; - - if (!isStandardSyntaxProperty(prop)) { - return; - } - - if (isCustomProperty(prop)) { - return; - } - - // either the prefix or unprefixed version is in the list - if (!matchesStringOrRegExp([prop, vendor.unprefixed(prop)], primary)) { - return; - } - - report({ - message: messages.rejected, - messageArgs: [prop], - word: prop, - node: decl, - result, - ruleName, - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/property-no-unknown/index.js b/node_modules/stylelint/lib/rules/property-no-unknown/index.js deleted file mode 100644 index b6b05899e..000000000 --- a/node_modules/stylelint/lib/rules/property-no-unknown/index.js +++ /dev/null @@ -1,120 +0,0 @@ -'use strict'; - -const isCustomProperty = require('../../utils/isCustomProperty'); -const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); -const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); -const optionsMatches = require('../../utils/optionsMatches'); -const properties = require('known-css-properties').all; -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const { isAtRule, isRule } = require('../../utils/typeGuards'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isBoolean, isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'property-no-unknown'; - -const messages = ruleMessages(ruleName, { - rejected: (property) => `Unexpected unknown property "${property}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/property-no-unknown', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - const allValidProperties = new Set(properties); - - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignoreProperties: [isString, isRegExp], - checkPrefixed: [isBoolean], - ignoreSelectors: [isString, isRegExp], - ignoreAtRules: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const shouldCheckPrefixed = secondaryOptions && secondaryOptions.checkPrefixed; - - root.walkDecls(checkStatement); - - /** - * @param {import('postcss').Declaration} decl - */ - function checkStatement(decl) { - const prop = decl.prop; - - if (!isStandardSyntaxProperty(prop)) { - return; - } - - if (!isStandardSyntaxDeclaration(decl)) { - return; - } - - if (isCustomProperty(prop)) { - return; - } - - if (!shouldCheckPrefixed && vendor.prefix(prop)) { - return; - } - - if (optionsMatches(secondaryOptions, 'ignoreProperties', prop)) { - return; - } - - const parent = decl.parent; - - if ( - parent && - isRule(parent) && - optionsMatches(secondaryOptions, 'ignoreSelectors', parent.selector) - ) { - return; - } - - /** @type {import('postcss').Node | undefined} */ - let node = parent; - - while (node && node.type !== 'root') { - if (isAtRule(node) && optionsMatches(secondaryOptions, 'ignoreAtRules', node.name)) { - return; - } - - node = node.parent; - } - - if (allValidProperties.has(prop.toLowerCase())) { - return; - } - - report({ - message: messages.rejected, - messageArgs: [prop], - node: decl, - result, - ruleName, - word: prop, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/property-no-vendor-prefix/index.js b/node_modules/stylelint/lib/rules/property-no-vendor-prefix/index.js deleted file mode 100644 index 3e186ed7f..000000000 --- a/node_modules/stylelint/lib/rules/property-no-vendor-prefix/index.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict'; - -const isAutoprefixable = require('../../utils/isAutoprefixable'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'property-no-vendor-prefix'; - -const messages = ruleMessages(ruleName, { - rejected: (property) => `Unexpected vendor-prefix "${property}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/property-no-vendor-prefix', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - optional: true, - actual: secondaryOptions, - possible: { - ignoreProperties: [isString, isRegExp], - }, - }, - ); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - const prop = decl.prop; - const unprefixedProp = vendor.unprefixed(prop); - - //return early if property is to be ignored - if (optionsMatches(secondaryOptions, 'ignoreProperties', unprefixedProp)) { - return; - } - - // Make sure there's a vendor prefix, - // but this isn't a custom property - - if (prop[0] !== '-' || prop[1] === '-') { - return; - } - - if (!isAutoprefixable.property(prop)) { - return; - } - - if (context.fix) { - decl.prop = isAutoprefixable.unprefix(decl.prop); - - return; - } - - report({ - message: messages.rejected, - messageArgs: [prop], - word: prop, - node: decl, - result, - ruleName, - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/rule-empty-line-before/index.js b/node_modules/stylelint/lib/rules/rule-empty-line-before/index.js deleted file mode 100644 index cec5efbf1..000000000 --- a/node_modules/stylelint/lib/rules/rule-empty-line-before/index.js +++ /dev/null @@ -1,162 +0,0 @@ -'use strict'; - -const addEmptyLineBefore = require('../../utils/addEmptyLineBefore'); -const getPreviousNonSharedLineCommentNode = require('../../utils/getPreviousNonSharedLineCommentNode'); -const hasEmptyLine = require('../../utils/hasEmptyLine'); -const isAfterSingleLineComment = require('../../utils/isAfterSingleLineComment'); -const isFirstNested = require('../../utils/isFirstNested'); -const isFirstNodeOfRoot = require('../../utils/isFirstNodeOfRoot'); -const isSingleLineString = require('../../utils/isSingleLineString'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const optionsMatches = require('../../utils/optionsMatches'); -const removeEmptyLinesBefore = require('../../utils/removeEmptyLinesBefore'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'rule-empty-line-before'; - -const messages = ruleMessages(ruleName, { - expected: 'Expected empty line before rule', - rejected: 'Unexpected empty line before rule', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/rule-empty-line-before', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['always', 'never', 'always-multi-line', 'never-multi-line'], - }, - { - actual: secondaryOptions, - possible: { - ignore: ['after-comment', 'first-nested', 'inside-block'], - except: [ - 'after-rule', - 'after-single-line-comment', - 'first-nested', - 'inside-block-and-after-rule', - 'inside-block', - ], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const expectation = /** @type {string} */ (primary); - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - // Ignore the first node - if (isFirstNodeOfRoot(ruleNode)) { - return; - } - - // Optionally ignore the expectation if a comment precedes this node - if (optionsMatches(secondaryOptions, 'ignore', 'after-comment')) { - const prevNode = ruleNode.prev(); - - if (prevNode && prevNode.type === 'comment') { - return; - } - } - - // Optionally ignore the node if it is the first nested - if (optionsMatches(secondaryOptions, 'ignore', 'first-nested') && isFirstNested(ruleNode)) { - return; - } - - const isNested = ruleNode.parent && ruleNode.parent.type !== 'root'; - - // Optionally ignore the expectation if inside a block - if (optionsMatches(secondaryOptions, 'ignore', 'inside-block') && isNested) { - return; - } - - // Ignore if the expectation is for multiple and the rule is single-line - if (expectation.includes('multi-line') && isSingleLineString(ruleNode.toString())) { - return; - } - - let expectEmptyLineBefore = expectation.includes('always'); - - // Optionally reverse the expectation if any exceptions apply - if ( - (optionsMatches(secondaryOptions, 'except', 'first-nested') && isFirstNested(ruleNode)) || - (optionsMatches(secondaryOptions, 'except', 'after-rule') && isAfterRule(ruleNode)) || - (optionsMatches(secondaryOptions, 'except', 'inside-block-and-after-rule') && - isNested && - isAfterRule(ruleNode)) || - (optionsMatches(secondaryOptions, 'except', 'after-single-line-comment') && - isAfterSingleLineComment(ruleNode)) || - (optionsMatches(secondaryOptions, 'except', 'inside-block') && isNested) - ) { - expectEmptyLineBefore = !expectEmptyLineBefore; - } - - const hasEmptyLineBefore = hasEmptyLine(ruleNode.raws.before); - - // Return if the expectation is met - if (expectEmptyLineBefore === hasEmptyLineBefore) { - return; - } - - // Fix - if (context.fix) { - const newline = context.newline; - - if (typeof newline !== 'string') { - throw new Error(`The "newline" property must be a string: ${newline}`); - } - - if (expectEmptyLineBefore) { - addEmptyLineBefore(ruleNode, newline); - } else { - removeEmptyLinesBefore(ruleNode, newline); - } - - return; - } - - const message = expectEmptyLineBefore ? messages.expected : messages.rejected; - - report({ - message, - node: ruleNode, - result, - ruleName, - }); - }); - }; -}; - -/** - * @param {import('postcss').Rule} ruleNode - * @returns {boolean} - */ -function isAfterRule(ruleNode) { - const prevNode = getPreviousNonSharedLineCommentNode(ruleNode); - - return prevNode != null && prevNode.type === 'rule'; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/rule-selector-property-disallowed-list/index.js b/node_modules/stylelint/lib/rules/rule-selector-property-disallowed-list/index.js deleted file mode 100644 index da8ed8ecd..000000000 --- a/node_modules/stylelint/lib/rules/rule-selector-property-disallowed-list/index.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); -const validateOptions = require('../../utils/validateOptions'); -const { isString, isRegExp } = require('../../utils/validateTypes'); - -const ruleName = 'rule-selector-property-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (selector, property) => `Unexpected property "${property}" for selector "${selector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/rule-selector-property-disallowed-list', -}; - -/** @type {import('stylelint').Rule>>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [validateObjectWithArrayProps(isString, isRegExp)], - }); - - if (!validOptions) { - return; - } - - const selectors = Object.keys(primary); - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selectorKey = selectors.find((selector) => - matchesStringOrRegExp(ruleNode.selector, selector), - ); - - if (!selectorKey) { - return; - } - - const disallowedProperties = primary[selectorKey]; - - if (!disallowedProperties) { - return; - } - - ruleNode.walkDecls((decl) => { - const { prop } = decl; - - if (matchesStringOrRegExp(prop, disallowedProperties)) { - report({ - message: messages.rejected, - messageArgs: [ruleNode.selector, prop], - node: decl, - result, - ruleName, - word: prop, - }); - } - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-anb-no-unmatchable/index.js b/node_modules/stylelint/lib/rules/selector-anb-no-unmatchable/index.js deleted file mode 100644 index c4c494ebd..000000000 --- a/node_modules/stylelint/lib/rules/selector-anb-no-unmatchable/index.js +++ /dev/null @@ -1,111 +0,0 @@ -'use strict'; - -const { parse } = require('css-tree'); -const { - aNPlusBNotationPseudoClasses, - aNPlusBOfSNotationPseudoClasses, -} = require('../../reference/selectors'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); - -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const hasANPlusBNotationPseudoClasses = require('../../utils/hasANPlusBNotationPseudoClasses'); - -const ruleName = 'selector-anb-no-unmatchable'; - -const messages = ruleMessages(ruleName, { - rejected: (pseudoClass) => `Unexpected unmatchable An+B selector "${pseudoClass}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-anb-no-unmatchable', -}; - -function isUnmatchableNth(/** @type {import('css-tree').AnPlusB} */ nth) { - const { a, b } = nth; - - if (a !== null && a !== '0' && a !== '-0') { - return false; - } - - if (b !== null && b !== '0' && b !== '-0') { - return false; - } - - return true; -} - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!hasANPlusBNotationPseudoClasses(ruleNode.selector)) return; - - if (!isStandardSyntaxRule(ruleNode)) return; - - ruleNode.selectors.forEach((selector) => { - let cssTreeSelector; - - try { - cssTreeSelector = parse(selector, { context: 'selector', positions: true }); - } catch (e) { - return; - } - - checkSelector(cssTreeSelector); - }); - - function checkSelector(/** @type {import('css-tree').CssNode} */ selector) { - if (selector.type !== 'Selector') { - return; - } - - selector.children.forEach((selectorChild) => { - if ( - selectorChild.type !== 'PseudoClassSelector' || - (!aNPlusBNotationPseudoClasses.has(selectorChild.name) && - !aNPlusBOfSNotationPseudoClasses.has(selectorChild.name)) - ) { - return; - } - - const pseudoClassSelector = selectorChild; - - if (pseudoClassSelector.children === null) { - return; - } - - pseudoClassSelector.children.forEach((child) => { - if (child.type !== 'Nth' || child.nth.type !== 'AnPlusB') { - return; - } - - if (isUnmatchableNth(child.nth)) { - report({ - message: messages.rejected, - messageArgs: [`:${pseudoClassSelector.name}`], - node: ruleNode, - index: pseudoClassSelector.loc?.start.column, - endIndex: pseudoClassSelector.loc?.end.column, - result, - ruleName, - }); - } - }); - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-brackets-space-inside/index.js b/node_modules/stylelint/lib/rules/selector-attribute-brackets-space-inside/index.js deleted file mode 100644 index 2654751b5..000000000 --- a/node_modules/stylelint/lib/rules/selector-attribute-brackets-space-inside/index.js +++ /dev/null @@ -1,209 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const styleSearch = require('style-search'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'selector-attribute-brackets-space-inside'; - -const messages = ruleMessages(ruleName, { - expectedOpening: 'Expected single space after "["', - rejectedOpening: 'Unexpected whitespace after "["', - expectedClosing: 'Expected single space before "]"', - rejectedClosing: 'Unexpected whitespace before "]"', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-attribute-brackets-space-inside', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - if (!ruleNode.selector.includes('[')) { - return; - } - - const selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; - - let hasFixed; - const fixedSelector = parseSelector(selector, result, ruleNode, (selectorTree) => { - selectorTree.walkAttributes((attributeNode) => { - const attributeSelectorString = attributeNode.toString(); - - styleSearch({ source: attributeSelectorString, target: '[' }, (match) => { - const nextCharIsSpace = attributeSelectorString[match.startIndex + 1] === ' '; - const index = attributeNode.sourceIndex + match.startIndex + 1; - - if (nextCharIsSpace && primary === 'never') { - if (context.fix) { - hasFixed = true; - fixBefore(attributeNode); - - return; - } - - complain(messages.rejectedOpening, index); - } - - if (!nextCharIsSpace && primary === 'always') { - if (context.fix) { - hasFixed = true; - fixBefore(attributeNode); - - return; - } - - complain(messages.expectedOpening, index); - } - }); - - styleSearch({ source: attributeSelectorString, target: ']' }, (match) => { - const prevCharIsSpace = attributeSelectorString[match.startIndex - 1] === ' '; - const index = attributeNode.sourceIndex + match.startIndex - 1; - - if (prevCharIsSpace && primary === 'never') { - if (context.fix) { - hasFixed = true; - fixAfter(attributeNode); - - return; - } - - complain(messages.rejectedClosing, index); - } - - if (!prevCharIsSpace && primary === 'always') { - if (context.fix) { - hasFixed = true; - fixAfter(attributeNode); - - return; - } - - complain(messages.expectedClosing, index); - } - }); - }); - }); - - if (hasFixed && fixedSelector) { - if (!ruleNode.raws.selector) { - ruleNode.selector = fixedSelector; - } else { - ruleNode.raws.selector.raw = fixedSelector; - } - } - - /** - * @param {string} message - * @param {number} index - */ - function complain(message, index) { - report({ - message, - index, - result, - ruleName, - node: ruleNode, - }); - } - }); - }; - - /** - * @param {import('postcss-selector-parser').Attribute} attributeNode - */ - function fixBefore(attributeNode) { - const spacesAttribute = attributeNode.raws.spaces && attributeNode.raws.spaces.attribute; - const rawAttrBefore = spacesAttribute && spacesAttribute.before; - - /** @type {{ attrBefore: string, setAttrBefore: (fixed: string) => void }} */ - const { attrBefore, setAttrBefore } = rawAttrBefore - ? { - attrBefore: rawAttrBefore, - setAttrBefore(fixed) { - spacesAttribute.before = fixed; - }, - } - : { - attrBefore: - (attributeNode.spaces.attribute && attributeNode.spaces.attribute.before) || '', - setAttrBefore(fixed) { - if (!attributeNode.spaces.attribute) attributeNode.spaces.attribute = {}; - - attributeNode.spaces.attribute.before = fixed; - }, - }; - - if (primary === 'always') { - setAttrBefore(attrBefore.replace(/^\s*/, ' ')); - } else if (primary === 'never') { - setAttrBefore(attrBefore.replace(/^\s*/, '')); - } - } - - /** - * @param {import('postcss-selector-parser').Attribute} attributeNode - */ - function fixAfter(attributeNode) { - const key = attributeNode.operator - ? attributeNode.insensitive - ? 'insensitive' - : 'value' - : 'attribute'; - - const rawSpaces = attributeNode.raws.spaces && attributeNode.raws.spaces[key]; - const rawAfter = rawSpaces && rawSpaces.after; - - const spaces = attributeNode.spaces[key]; - - /** @type {{ after: string, setAfter: (fixed: string) => void }} */ - const { after, setAfter } = rawAfter - ? { - after: rawAfter, - setAfter(fixed) { - rawSpaces.after = fixed; - }, - } - : { - after: (spaces && spaces.after) || '', - setAfter(fixed) { - if (!attributeNode.spaces[key]) attributeNode.spaces[key] = {}; - - // @ts-expect-error -- TS2532: Object is possibly 'undefined'. - attributeNode.spaces[key].after = fixed; - }, - }; - - if (primary === 'always') { - setAfter(after.replace(/\s*$/, ' ')); - } else if (primary === 'never') { - setAfter(after.replace(/\s*$/, '')); - } - } -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-name-disallowed-list/index.js b/node_modules/stylelint/lib/rules/selector-attribute-name-disallowed-list/index.js deleted file mode 100644 index 590921acc..000000000 --- a/node_modules/stylelint/lib/rules/selector-attribute-name-disallowed-list/index.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-attribute-name-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (name) => `Unexpected name "${name}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-attribute-name-disallowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - if (!ruleNode.selector.includes('[')) { - return; - } - - parseSelector(ruleNode.selector, result, ruleNode, (selectorTree) => { - selectorTree.walkAttributes((attributeNode) => { - const attributeName = attributeNode.qualifiedAttribute; - - if (!matchesStringOrRegExp(attributeName, primary)) { - return; - } - - const index = attributeNode.sourceIndex + attributeNode.offsetOf('attribute'); - const endIndex = index + attributeName.length; - - report({ - message: messages.rejected, - messageArgs: [attributeName], - node: ruleNode, - index, - endIndex, - result, - ruleName, - }); - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-operator-allowed-list/index.js b/node_modules/stylelint/lib/rules/selector-attribute-operator-allowed-list/index.js deleted file mode 100644 index 3f7c17719..000000000 --- a/node_modules/stylelint/lib/rules/selector-attribute-operator-allowed-list/index.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-attribute-operator-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (operator) => `Unexpected operator "${operator}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-attribute-operator-allowed-list', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString], - }); - - if (!validOptions) { - return; - } - - const primaryValues = new Set([primary].flat()); - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const { selector } = ruleNode; - - if (!selector.includes('[') || !selector.includes('=')) { - return; - } - - parseSelector(selector, result, ruleNode, (selectorTree) => { - selectorTree.walkAttributes((attributeNode) => { - const { operator } = attributeNode; - - if (!operator || primaryValues.has(operator)) { - return; - } - - const index = attributeNode.sourceIndex + attributeNode.offsetOf('operator'); - const endIndex = index + operator.length; - - report({ - message: messages.rejected, - messageArgs: [operator], - node: ruleNode, - index, - endIndex, - result, - ruleName, - }); - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-operator-disallowed-list/index.js b/node_modules/stylelint/lib/rules/selector-attribute-operator-disallowed-list/index.js deleted file mode 100644 index c472ee33c..000000000 --- a/node_modules/stylelint/lib/rules/selector-attribute-operator-disallowed-list/index.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-attribute-operator-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (operator) => `Unexpected operator "${operator}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-attribute-operator-disallowed-list', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString], - }); - - if (!validOptions) { - return; - } - - const primaryValues = new Set([primary].flat()); - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const { selector } = ruleNode; - - if (!selector.includes('[') || !selector.includes('=')) { - return; - } - - parseSelector(selector, result, ruleNode, (selectorTree) => { - selectorTree.walkAttributes((attributeNode) => { - const { operator } = attributeNode; - - if (!operator || !primaryValues.has(operator)) { - return; - } - - const index = attributeNode.sourceIndex + attributeNode.offsetOf('operator'); - const endIndex = index + operator.length; - - report({ - message: messages.rejected, - messageArgs: [operator], - node: ruleNode, - index, - endIndex, - result, - ruleName, - }); - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-operator-space-after/index.js b/node_modules/stylelint/lib/rules/selector-attribute-operator-space-after/index.js deleted file mode 100644 index e5c84f2b4..000000000 --- a/node_modules/stylelint/lib/rules/selector-attribute-operator-space-after/index.js +++ /dev/null @@ -1,110 +0,0 @@ -'use strict'; - -const ruleMessages = require('../../utils/ruleMessages'); -const selectorAttributeOperatorSpaceChecker = require('../selectorAttributeOperatorSpaceChecker'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'selector-attribute-operator-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: (operator) => `Expected single space after "${operator}"`, - rejectedAfter: (operator) => `Unexpected whitespace after "${operator}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-attribute-operator-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const checker = whitespaceChecker('space', primary, messages); - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - selectorAttributeOperatorSpaceChecker({ - root, - result, - locationChecker: checker.after, - checkedRuleName: ruleName, - checkBeforeOperator: false, - fix: context.fix - ? (attributeNode) => { - /** @type {{ operatorAfter: string, setOperatorAfter: (fixed: string) => void }} */ - const { operatorAfter, setOperatorAfter } = (() => { - const rawOperator = attributeNode.raws.operator; - - if (rawOperator) { - return { - operatorAfter: rawOperator.slice( - attributeNode.operator ? attributeNode.operator.length : 0, - ), - setOperatorAfter(fixed) { - delete attributeNode.raws.operator; - - if (!attributeNode.raws.spaces) attributeNode.raws.spaces = {}; - - if (!attributeNode.raws.spaces.operator) - attributeNode.raws.spaces.operator = {}; - - attributeNode.raws.spaces.operator.after = fixed; - }, - }; - } - - const rawSpacesOperator = - attributeNode.raws.spaces && attributeNode.raws.spaces.operator; - const rawOperatorAfter = rawSpacesOperator && rawSpacesOperator.after; - - if (rawOperatorAfter) { - return { - operatorAfter: rawOperatorAfter, - setOperatorAfter(fixed) { - rawSpacesOperator.after = fixed; - }, - }; - } - - return { - operatorAfter: - (attributeNode.spaces.operator && attributeNode.spaces.operator.after) || '', - setOperatorAfter(fixed) { - if (!attributeNode.spaces.operator) attributeNode.spaces.operator = {}; - - attributeNode.spaces.operator.after = fixed; - }, - }; - })(); - - if (primary === 'always') { - setOperatorAfter(operatorAfter.replace(/^\s*/, ' ')); - - return true; - } - - if (primary === 'never') { - setOperatorAfter(operatorAfter.replace(/^\s*/, '')); - - return true; - } - - return false; - } - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-operator-space-before/index.js b/node_modules/stylelint/lib/rules/selector-attribute-operator-space-before/index.js deleted file mode 100644 index 8ad04b168..000000000 --- a/node_modules/stylelint/lib/rules/selector-attribute-operator-space-before/index.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -const ruleMessages = require('../../utils/ruleMessages'); -const selectorAttributeOperatorSpaceChecker = require('../selectorAttributeOperatorSpaceChecker'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'selector-attribute-operator-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: (operator) => `Expected single space before "${operator}"`, - rejectedBefore: (operator) => `Unexpected whitespace before "${operator}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-attribute-operator-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - selectorAttributeOperatorSpaceChecker({ - root, - result, - locationChecker: checker.before, - checkedRuleName: ruleName, - checkBeforeOperator: true, - fix: context.fix - ? (attributeNode) => { - const rawAttr = attributeNode.raws.spaces && attributeNode.raws.spaces.attribute; - const rawAttrAfter = rawAttr && rawAttr.after; - - /** @type {{ attrAfter: string, setAttrAfter: (fixed: string) => void }} */ - const { attrAfter, setAttrAfter } = rawAttrAfter - ? { - attrAfter: rawAttrAfter, - setAttrAfter(fixed) { - rawAttr.after = fixed; - }, - } - : { - attrAfter: - (attributeNode.spaces.attribute && attributeNode.spaces.attribute.after) || '', - setAttrAfter(fixed) { - if (!attributeNode.spaces.attribute) attributeNode.spaces.attribute = {}; - - attributeNode.spaces.attribute.after = fixed; - }, - }; - - if (primary === 'always') { - setAttrAfter(attrAfter.replace(/\s*$/, ' ')); - - return true; - } - - if (primary === 'never') { - setAttrAfter(attrAfter.replace(/\s*$/, '')); - - return true; - } - - return false; - } - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-attribute-quotes/index.js b/node_modules/stylelint/lib/rules/selector-attribute-quotes/index.js deleted file mode 100644 index c2bbd671f..000000000 --- a/node_modules/stylelint/lib/rules/selector-attribute-quotes/index.js +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -const getRuleSelector = require('../../utils/getRuleSelector'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isValidIdentifier = require('../../utils/isValidIdentifier'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'selector-attribute-quotes'; - -const messages = ruleMessages(ruleName, { - expected: (value) => `Expected quotes around "${value}"`, - rejected: (value) => `Unexpected quotes around "${value}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-attribute-quotes', - fixable: true, -}; - -const acceptedQuoteMark = '"'; - -/** @type {import('stylelint').Rule<'always' | 'never'>} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const { selector } = ruleNode; - - if (!selector.includes('[') || !selector.includes('=')) { - return; - } - - parseSelector(getRuleSelector(ruleNode), result, ruleNode, (selectorTree) => { - let selectorFixed = false; - - selectorTree.walkAttributes((attributeNode) => { - const { operator, value, quoted } = attributeNode; - - if (!operator || !value) { - return; - } - - if (!quoted && primary === 'always') { - if (context.fix) { - selectorFixed = true; - attributeNode.quoteMark = acceptedQuoteMark; - } else { - complain(messages.expected(value), attributeNode); - } - } - - if (quoted && primary === 'never') { - // some selectors require quotes to be valid; - // we pass in the raw string value, which contains the escape characters - // necessary to check if escaped characters are valid - // see: https://github.com/stylelint/stylelint/issues/4300 - if ( - !attributeNode.raws.value || - !isValidIdentifier(attributeNode.raws.value.slice(1, -1)) - ) { - return; - } - - if (context.fix) { - selectorFixed = true; - attributeNode.quoteMark = null; - } else { - complain(messages.rejected(value), attributeNode); - } - } - }); - - if (selectorFixed) { - ruleNode.selector = selectorTree.toString(); - } - }); - - /** - * @param {string} message - * @param {import('postcss-selector-parser').Attribute} attrNode - */ - function complain(message, attrNode) { - const index = attrNode.sourceIndex + attrNode.offsetOf('value'); - const value = attrNode.raws.value || attrNode.value || ''; - const endIndex = index + value.length; - - report({ - message, - index, - endIndex, - result, - ruleName, - node: ruleNode, - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-class-pattern/index.js b/node_modules/stylelint/lib/rules/selector-class-pattern/index.js deleted file mode 100644 index 69c0b83cc..000000000 --- a/node_modules/stylelint/lib/rules/selector-class-pattern/index.js +++ /dev/null @@ -1,154 +0,0 @@ -'use strict'; - -const isKeyframeSelector = require('../../utils/isKeyframeSelector'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const resolveNestedSelector = require('postcss-resolve-nested-selector'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isBoolean, isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-class-pattern'; - -const messages = ruleMessages(ruleName, { - expected: (selector, pattern) => `Expected "${selector}" to match pattern "${pattern}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-class-pattern', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [isRegExp, isString], - }, - { - actual: secondaryOptions, - possible: { - resolveNestedSelectors: [isBoolean], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const shouldResolveNestedSelectors = Boolean( - secondaryOptions && secondaryOptions.resolveNestedSelectors, - ); - - const normalizedPattern = isString(primary) ? new RegExp(primary) : primary; - - root.walkRules((ruleNode) => { - const { selector, selectors } = ruleNode; - - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - if (selectors.some((s) => isKeyframeSelector(s))) { - return; - } - - // Only bother resolving selectors that have an interpolating & - if (shouldResolveNestedSelectors && hasInterpolatingAmpersand(selector)) { - for (const nestedSelector of resolveNestedSelector(selector, ruleNode)) { - if (!isStandardSyntaxSelector(nestedSelector)) { - continue; - } - - parseSelector(nestedSelector, result, ruleNode, (s) => checkSelector(s, ruleNode)); - } - } else { - parseSelector(selector, result, ruleNode, (s) => checkSelector(s, ruleNode)); - } - }); - - /** - * @param {import('postcss-selector-parser').Root} selectorNode - * @param {import('postcss').Rule} ruleNode - */ - function checkSelector(selectorNode, ruleNode) { - selectorNode.walkClasses((classNode) => { - const { value, sourceIndex: index } = classNode; - - if (normalizedPattern.test(value)) { - return; - } - - const selector = String(classNode); - - // TODO: `selector` may be resolved. So, getting its raw value may be pretty hard. - // It means `endIndex` may be inaccurate (though non-standard selectors). - // - // For example, given ".abc { &_x {} }". - // Then, an expected raw `selector` is "&_x", - // but, an actual `selector` is ".abc_x". - const endIndex = index + selector.length; - - report({ - result, - ruleName, - message: messages.expected, - messageArgs: [selector, primary], - node: ruleNode, - index, - endIndex, - }); - }); - } - }; -}; - -/** - * An "interpolating ampersand" means an "&" used to interpolate - * within another simple selector, rather than an "&" that - * stands on its own as a simple selector. - * - * @param {string} selector - * @returns {boolean} - */ -function hasInterpolatingAmpersand(selector) { - for (const [i, char] of Array.from(selector).entries()) { - if (char !== '&') { - continue; - } - - const prevChar = selector.charAt(i - 1); - - if (prevChar && !isCombinator(prevChar)) { - return true; - } - - const nextChar = selector.charAt(i + 1); - - if (nextChar && !isCombinator(nextChar)) { - return true; - } - } - - return false; -} - -/** - * @param {string} x - * @returns {boolean} - */ -function isCombinator(x) { - return /[\s+>~]/.test(x); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-combinator-allowed-list/index.js b/node_modules/stylelint/lib/rules/selector-combinator-allowed-list/index.js deleted file mode 100644 index 56d182630..000000000 --- a/node_modules/stylelint/lib/rules/selector-combinator-allowed-list/index.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -const isStandardSyntaxCombinator = require('../../utils/isStandardSyntaxCombinator'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-combinator-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (combinator) => `Unexpected combinator "${combinator}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-combinator-allowed-list', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selector = ruleNode.selector; - - parseSelector(selector, result, ruleNode, (fullSelector) => { - fullSelector.walkCombinators((combinatorNode) => { - if (!isStandardSyntaxCombinator(combinatorNode)) { - return; - } - - const { value } = combinatorNode; - const normalizedValue = normalizeCombinator(value); - - if (primary.includes(normalizedValue)) { - return; - } - - const { sourceIndex: index, raws } = combinatorNode; - const endIndex = index + ((raws && raws.value) || value).length; - - report({ - result, - ruleName, - message: messages.rejected, - messageArgs: [normalizedValue], - node: ruleNode, - index, - endIndex, - }); - }); - }); - }); - }; -}; - -/** - * @param {string} value - * @returns {string} - */ -function normalizeCombinator(value) { - return value.replace(/\s+/g, ' '); -} - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-combinator-disallowed-list/index.js b/node_modules/stylelint/lib/rules/selector-combinator-disallowed-list/index.js deleted file mode 100644 index 6a5dd87a5..000000000 --- a/node_modules/stylelint/lib/rules/selector-combinator-disallowed-list/index.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -const isStandardSyntaxCombinator = require('../../utils/isStandardSyntaxCombinator'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-combinator-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (combinator) => `Unexpected combinator "${combinator}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-combinator-disallowed-list', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selector = ruleNode.selector; - - parseSelector(selector, result, ruleNode, (fullSelector) => { - fullSelector.walkCombinators((combinatorNode) => { - if (!isStandardSyntaxCombinator(combinatorNode)) { - return; - } - - const { value } = combinatorNode; - const normalizedValue = normalizeCombinator(value); - - if (!primary.includes(normalizedValue)) { - return; - } - - const { sourceIndex: index, raws } = combinatorNode; - const endIndex = index + ((raws && raws.value) || value).length; - - report({ - result, - ruleName, - message: messages.rejected, - messageArgs: [normalizedValue], - node: ruleNode, - index, - endIndex, - }); - }); - }); - }); - }; -}; - -/** - * @param {string} value - * @returns {string} - */ -function normalizeCombinator(value) { - return value.replace(/\s+/g, ' '); -} - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-combinator-space-after/index.js b/node_modules/stylelint/lib/rules/selector-combinator-space-after/index.js deleted file mode 100644 index aeb004973..000000000 --- a/node_modules/stylelint/lib/rules/selector-combinator-space-after/index.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -const ruleMessages = require('../../utils/ruleMessages'); -const selectorCombinatorSpaceChecker = require('../selectorCombinatorSpaceChecker'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'selector-combinator-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: (combinator) => `Expected single space after "${combinator}"`, - rejectedAfter: (combinator) => `Unexpected whitespace after "${combinator}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-combinator-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - selectorCombinatorSpaceChecker({ - root, - result, - locationChecker: checker.after, - locationType: 'after', - checkedRuleName: ruleName, - fix: context.fix - ? (combinator) => { - if (primary === 'always') { - combinator.spaces.after = ' '; - - return true; - } - - if (primary === 'never') { - combinator.spaces.after = ''; - - return true; - } - - return false; - } - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-combinator-space-before/index.js b/node_modules/stylelint/lib/rules/selector-combinator-space-before/index.js deleted file mode 100644 index ad75dc022..000000000 --- a/node_modules/stylelint/lib/rules/selector-combinator-space-before/index.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -const ruleMessages = require('../../utils/ruleMessages'); -const selectorCombinatorSpaceChecker = require('../selectorCombinatorSpaceChecker'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'selector-combinator-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: (combinator) => `Expected single space before "${combinator}"`, - rejectedBefore: (combinator) => `Unexpected whitespace before "${combinator}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-combinator-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - selectorCombinatorSpaceChecker({ - root, - result, - locationChecker: checker.before, - locationType: 'before', - checkedRuleName: ruleName, - fix: context.fix - ? (combinator) => { - if (primary === 'always') { - combinator.spaces.before = ' '; - - return true; - } - - if (primary === 'never') { - combinator.spaces.before = ''; - - return true; - } - - return false; - } - : null, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-descendant-combinator-no-non-space/index.js b/node_modules/stylelint/lib/rules/selector-descendant-combinator-no-non-space/index.js deleted file mode 100644 index a31255e29..000000000 --- a/node_modules/stylelint/lib/rules/selector-descendant-combinator-no-non-space/index.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'selector-descendant-combinator-no-non-space'; - -const messages = ruleMessages(ruleName, { - rejected: (nonSpaceCharacter) => `Unexpected "${nonSpaceCharacter}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-descendant-combinator-no-non-space', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - let hasFixed = false; - const selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; - - // Return early for selectors containing comments - // TODO: re-enable when parser and stylelint are compatible - if (selector.includes('/*')) return; - - const fixedSelector = parseSelector(selector, result, ruleNode, (fullSelector) => { - fullSelector.walkCombinators((combinatorNode) => { - if (combinatorNode.value !== ' ') { - return; - } - - const value = combinatorNode.toString(); - - if ( - value.includes(' ') || - value.includes('\t') || - value.includes('\n') || - value.includes('\r') - ) { - if (context.fix && /^\s+$/.test(value)) { - hasFixed = true; - - if (!combinatorNode.raws) combinatorNode.raws = {}; - - combinatorNode.raws.value = ' '; - combinatorNode.rawSpaceBefore = combinatorNode.rawSpaceBefore.replace(/^\s+/, ''); - combinatorNode.rawSpaceAfter = combinatorNode.rawSpaceAfter.replace(/\s+$/, ''); - - return; - } - - report({ - result, - ruleName, - message: messages.rejected(value), - node: ruleNode, - index: combinatorNode.sourceIndex, - }); - } - }); - }); - - if (hasFixed && fixedSelector) { - if (!ruleNode.raws.selector) { - ruleNode.selector = fixedSelector; - } else { - ruleNode.raws.selector.raw = fixedSelector; - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-disallowed-list/index.js b/node_modules/stylelint/lib/rules/selector-disallowed-list/index.js deleted file mode 100644 index d71fa3285..000000000 --- a/node_modules/stylelint/lib/rules/selector-disallowed-list/index.js +++ /dev/null @@ -1,100 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const report = require('../../utils/report'); -const optionsMatches = require('../../utils/optionsMatches'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString, isBoolean } = require('../../utils/validateTypes'); - -const ruleName = 'selector-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (selector) => `Unexpected selector "${selector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-disallowed-list', -}; - -/** @type {import('stylelint').Rule, { splitList: boolean, ignore: string[] }>} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [isString, isRegExp], - }, - { - actual: secondaryOptions, - possible: { - ignore: ['inside-block'], - splitList: [isBoolean], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const ignoreInsideBlock = optionsMatches(secondaryOptions, 'ignore', 'inside-block'); - const splitList = secondaryOptions && secondaryOptions.splitList; - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - if (ignoreInsideBlock) { - const { parent } = ruleNode; - const isInsideBlock = parent && parent.type !== 'root'; - - if (isInsideBlock) { - return; - } - } - - if (splitList) { - ruleNode.selectors.forEach((selector) => { - if (matchesStringOrRegExp(selector, primary)) { - report({ - result, - ruleName, - message: messages.rejected, - messageArgs: [selector], - node: ruleNode, - word: selector, - }); - } - }); - } else { - const { selector, raws } = ruleNode; - - if (matchesStringOrRegExp(selector, primary)) { - const word = (raws.selector && raws.selector.raw) || selector; - - report({ - result, - ruleName, - message: messages.rejected, - messageArgs: [selector], - node: ruleNode, - word, - }); - } - } - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-id-pattern/index.js b/node_modules/stylelint/lib/rules/selector-id-pattern/index.js deleted file mode 100644 index c89280a78..000000000 --- a/node_modules/stylelint/lib/rules/selector-id-pattern/index.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-id-pattern'; - -const messages = ruleMessages(ruleName, { - expected: (selector, pattern) => `Expected "${selector}" to match pattern "${pattern}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-id-pattern', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isRegExp, isString], - }); - - if (!validOptions) { - return; - } - - const normalizedPattern = isString(primary) ? new RegExp(primary) : primary; - - root.walkRules(/#/, (ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - parseSelector(ruleNode.selector, result, ruleNode, (fullSelector) => { - fullSelector.walkIds((selectorNode) => { - if (normalizedPattern.test(selectorNode.value)) { - return; - } - - const selector = String(selectorNode); - - report({ - result, - ruleName, - message: messages.expected, - messageArgs: [selector, primary], - node: ruleNode, - word: selector, - }); - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-list-comma-newline-after/index.js b/node_modules/stylelint/lib/rules/selector-list-comma-newline-after/index.js deleted file mode 100644 index 5901f32fe..000000000 --- a/node_modules/stylelint/lib/rules/selector-list-comma-newline-after/index.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const styleSearch = require('style-search'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'selector-list-comma-newline-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected newline after ","', - expectedAfterMultiLine: () => 'Expected newline after "," in a multi-line list', - rejectedAfterMultiLine: () => 'Unexpected whitespace after "," in a multi-line list', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-list-comma-newline-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line', 'never-multi-line'], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - // Get raw selector so we can allow end-of-line comments, e.g. - // a, /* comment */ - // b {} - const selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; - - /** @type {number[]} */ - const fixIndices = []; - - styleSearch( - { - source: selector, - target: ',', - functionArguments: 'skip', - }, - (match) => { - const nextChars = selector.slice(match.endIndex); - - // If there's a // comment, that means there has to be a newline - // ending the comment so we're fine - if (/^\s+\/\//.test(nextChars)) { - return; - } - - // If there are spaces and then a comment begins, look for the newline - const indextoCheckAfter = /^\s+\/\*/.test(nextChars) - ? selector.indexOf('*/', match.endIndex) + 1 - : match.startIndex; - - checker.afterOneOnly({ - source: selector, - index: indextoCheckAfter, - err: (m) => { - if (context.fix) { - fixIndices.push(indextoCheckAfter + 1); - - return; - } - - report({ - message: m, - node: ruleNode, - index: match.startIndex, - result, - ruleName, - }); - }, - }); - }, - ); - - if (fixIndices.length) { - let fixedSelector = selector; - - for (const index of fixIndices.sort((a, b) => b - a)) { - const beforeSelector = fixedSelector.slice(0, index); - let afterSelector = fixedSelector.slice(index); - - if (primary.startsWith('always')) { - afterSelector = context.newline + afterSelector; - } else if (primary.startsWith('never-multi-line')) { - afterSelector = afterSelector.replace(/^\s*/, ''); - } - - fixedSelector = beforeSelector + afterSelector; - } - - if (ruleNode.raws.selector) { - ruleNode.raws.selector.raw = fixedSelector; - } else { - ruleNode.selector = fixedSelector; - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-list-comma-newline-before/index.js b/node_modules/stylelint/lib/rules/selector-list-comma-newline-before/index.js deleted file mode 100644 index becc7c568..000000000 --- a/node_modules/stylelint/lib/rules/selector-list-comma-newline-before/index.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -const ruleMessages = require('../../utils/ruleMessages'); -const selectorListCommaWhitespaceChecker = require('../selectorListCommaWhitespaceChecker'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'selector-list-comma-newline-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected newline before ","', - expectedBeforeMultiLine: () => 'Expected newline before "," in a multi-line list', - rejectedBeforeMultiLine: () => 'Unexpected whitespace before "," in a multi-line list', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-list-comma-newline-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line', 'never-multi-line'], - }); - - if (!validOptions) { - return; - } - - /** @type {Map | undefined} */ - let fixData; - - selectorListCommaWhitespaceChecker({ - root, - result, - locationChecker: checker.beforeAllowingIndentation, - checkedRuleName: ruleName, - fix: context.fix - ? (ruleNode, index) => { - fixData = fixData || new Map(); - const commaIndices = fixData.get(ruleNode) || []; - - commaIndices.push(index); - fixData.set(ruleNode, commaIndices); - - return true; - } - : null, - }); - - if (fixData) { - for (const [ruleNode, commaIndices] of fixData.entries()) { - let selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; - - for (const index of commaIndices.sort((a, b) => b - a)) { - let beforeSelector = selector.slice(0, index); - const afterSelector = selector.slice(index); - - if (primary.startsWith('always')) { - const spaceIndex = beforeSelector.search(/\s+$/); - - if (spaceIndex >= 0) { - beforeSelector = - beforeSelector.slice(0, spaceIndex) + - context.newline + - beforeSelector.slice(spaceIndex); - } else { - beforeSelector += context.newline; - } - } else if (primary === 'never-multi-line') { - beforeSelector = beforeSelector.replace(/\s*$/, ''); - } - - selector = beforeSelector + afterSelector; - } - - if (ruleNode.raws.selector) { - ruleNode.raws.selector.raw = selector; - } else { - ruleNode.selector = selector; - } - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-list-comma-space-after/index.js b/node_modules/stylelint/lib/rules/selector-list-comma-space-after/index.js deleted file mode 100644 index c50d70790..000000000 --- a/node_modules/stylelint/lib/rules/selector-list-comma-space-after/index.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -const ruleMessages = require('../../utils/ruleMessages'); -const selectorListCommaWhitespaceChecker = require('../selectorListCommaWhitespaceChecker'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'selector-list-comma-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected single space after ","', - rejectedAfter: () => 'Unexpected whitespace after ","', - expectedAfterSingleLine: () => 'Expected single space after "," in a single-line list', - rejectedAfterSingleLine: () => 'Unexpected whitespace after "," in a single-line list', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-list-comma-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never', 'always-single-line', 'never-single-line'], - }); - - if (!validOptions) { - return; - } - - /** @type {Map | undefined} */ - let fixData; - - selectorListCommaWhitespaceChecker({ - root, - result, - locationChecker: checker.after, - checkedRuleName: ruleName, - fix: context.fix - ? (ruleNode, index) => { - fixData = fixData || new Map(); - const commaIndices = fixData.get(ruleNode) || []; - - commaIndices.push(index); - fixData.set(ruleNode, commaIndices); - - return true; - } - : null, - }); - - if (fixData) { - for (const [ruleNode, commaIndices] of fixData.entries()) { - let selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; - - for (const index of commaIndices.sort((a, b) => b - a)) { - const beforeSelector = selector.slice(0, index + 1); - let afterSelector = selector.slice(index + 1); - - if (primary.startsWith('always')) { - afterSelector = afterSelector.replace(/^\s*/, ' '); - } else if (primary.startsWith('never')) { - afterSelector = afterSelector.replace(/^\s*/, ''); - } - - selector = beforeSelector + afterSelector; - } - - if (ruleNode.raws.selector) { - ruleNode.raws.selector.raw = selector; - } else { - ruleNode.selector = selector; - } - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-list-comma-space-before/index.js b/node_modules/stylelint/lib/rules/selector-list-comma-space-before/index.js deleted file mode 100644 index e8e8cbe5b..000000000 --- a/node_modules/stylelint/lib/rules/selector-list-comma-space-before/index.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -const ruleMessages = require('../../utils/ruleMessages'); -const selectorListCommaWhitespaceChecker = require('../selectorListCommaWhitespaceChecker'); -const validateOptions = require('../../utils/validateOptions'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'selector-list-comma-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before ","', - rejectedBefore: () => 'Unexpected whitespace before ","', - expectedBeforeSingleLine: () => 'Expected single space before "," in a single-line list', - rejectedBeforeSingleLine: () => 'Unexpected whitespace before "," in a single-line list', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-list-comma-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never', 'always-single-line', 'never-single-line'], - }); - - if (!validOptions) { - return; - } - - /** @type {Map | undefined} */ - let fixData; - - selectorListCommaWhitespaceChecker({ - root, - result, - locationChecker: checker.before, - checkedRuleName: ruleName, - fix: context.fix - ? (ruleNode, index) => { - fixData = fixData || new Map(); - const commaIndices = fixData.get(ruleNode) || []; - - commaIndices.push(index); - fixData.set(ruleNode, commaIndices); - - return true; - } - : null, - }); - - if (fixData) { - for (const [ruleNode, commaIndices] of fixData.entries()) { - let selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; - - for (const index of commaIndices.sort((a, b) => b - a)) { - let beforeSelector = selector.slice(0, index); - const afterSelector = selector.slice(index); - - if (primary.includes('always')) { - beforeSelector = beforeSelector.replace(/\s*$/, ' '); - } else if (primary.includes('never')) { - beforeSelector = beforeSelector.replace(/\s*$/, ''); - } - - selector = beforeSelector + afterSelector; - } - - if (ruleNode.raws.selector) { - ruleNode.raws.selector.raw = selector; - } else { - ruleNode.selector = selector; - } - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-attribute/index.js b/node_modules/stylelint/lib/rules/selector-max-attribute/index.js deleted file mode 100644 index c2579242a..000000000 --- a/node_modules/stylelint/lib/rules/selector-max-attribute/index.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict'; - -const isContextFunctionalPseudoClass = require('../../utils/isContextFunctionalPseudoClass'); -const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const optionsMatches = require('../../utils/optionsMatches'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const resolvedNestedSelector = require('postcss-resolve-nested-selector'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-max-attribute'; - -const messages = ruleMessages(ruleName, { - expected: (selector, max) => - `Expected "${selector}" to have no more than ${max} attribute ${ - max === 1 ? 'selector' : 'selectors' - }`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-max-attribute', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: isNonNegativeInteger, - }, - { - actual: secondaryOptions, - possible: { - ignoreAttributes: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - /** - * @param {import('postcss-selector-parser').Container} selectorNode - * @param {import('postcss').Rule} ruleNode - */ - function checkSelector(selectorNode, ruleNode) { - const count = selectorNode.reduce((total, childNode) => { - // Only traverse inside actual selectors and context functional pseudo-classes - if (childNode.type === 'selector' || isContextFunctionalPseudoClass(childNode)) { - checkSelector(childNode, ruleNode); - } - - if (childNode.type !== 'attribute') { - // Not an attribute node -> ignore - return total; - } - - if (optionsMatches(secondaryOptions, 'ignoreAttributes', childNode.attribute)) { - // it's an attribute that is supposed to be ignored - return total; - } - - total += 1; - - return total; - }, 0); - - if (selectorNode.type !== 'root' && selectorNode.type !== 'pseudo' && count > primary) { - const selector = selectorNode.toString(); - - report({ - ruleName, - result, - node: ruleNode, - message: messages.expected, - messageArgs: [selector, primary], - word: selector, - }); - } - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - for (const selector of ruleNode.selectors) { - for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { - parseSelector(resolvedSelector, result, ruleNode, (container) => - checkSelector(container, ruleNode), - ); - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-class/index.js b/node_modules/stylelint/lib/rules/selector-max-class/index.js deleted file mode 100644 index 63a7a092f..000000000 --- a/node_modules/stylelint/lib/rules/selector-max-class/index.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -const isContextFunctionalPseudoClass = require('../../utils/isContextFunctionalPseudoClass'); -const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const resolvedNestedSelector = require('postcss-resolve-nested-selector'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'selector-max-class'; - -const messages = ruleMessages(ruleName, { - expected: (selector, max) => - `Expected "${selector}" to have no more than ${max} ${max === 1 ? 'class' : 'classes'}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-max-class', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: isNonNegativeInteger, - }); - - if (!validOptions) { - return; - } - - /** - * @param {import('postcss-selector-parser').Container} selectorNode - * @param {import('postcss').Rule} ruleNode - */ - function checkSelector(selectorNode, ruleNode) { - const count = selectorNode.reduce((total, childNode) => { - // Only traverse inside actual selectors and context functional pseudo-classes - if (childNode.type === 'selector' || isContextFunctionalPseudoClass(childNode)) { - checkSelector(childNode, ruleNode); - } - - if (childNode.type === 'class') total += 1; - - return total; - }, 0); - - if (selectorNode.type !== 'root' && selectorNode.type !== 'pseudo' && count > primary) { - const selector = selectorNode.toString(); - - report({ - ruleName, - result, - node: ruleNode, - message: messages.expected, - messageArgs: [selector, primary], - word: selector, - }); - } - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - for (const selector of ruleNode.selectors) { - for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { - parseSelector(resolvedSelector, result, ruleNode, (container) => - checkSelector(container, ruleNode), - ); - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-combinators/index.js b/node_modules/stylelint/lib/rules/selector-max-combinators/index.js deleted file mode 100644 index 39a34cf64..000000000 --- a/node_modules/stylelint/lib/rules/selector-max-combinators/index.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; - -const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const resolvedNestedSelector = require('postcss-resolve-nested-selector'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'selector-max-combinators'; - -const messages = ruleMessages(ruleName, { - expected: (selector, max) => - `Expected "${selector}" to have no more than ${max} ${ - max === 1 ? 'combinator' : 'combinators' - }`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-max-combinators', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: isNonNegativeInteger, - }); - - if (!validOptions) { - return; - } - - /** - * @param {import('postcss-selector-parser').Container} selectorNode - * @param {import('postcss').Rule} ruleNode - */ - function checkSelector(selectorNode, ruleNode) { - const count = selectorNode.reduce((total, childNode) => { - // Only traverse inside actual selectors - if (childNode.type === 'selector') { - checkSelector(childNode, ruleNode); - } - - if (childNode.type === 'combinator') total += 1; - - return total; - }, 0); - - if (selectorNode.type !== 'root' && selectorNode.type !== 'pseudo' && count > primary) { - const selector = selectorNode.toString(); - - report({ - ruleName, - result, - node: ruleNode, - message: messages.expected, - messageArgs: [selector, primary], - word: selector, - }); - } - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - for (const selector of ruleNode.selectors) { - for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { - parseSelector(resolvedSelector, result, ruleNode, (container) => - checkSelector(container, ruleNode), - ); - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-compound-selectors/index.js b/node_modules/stylelint/lib/rules/selector-max-compound-selectors/index.js deleted file mode 100644 index f12487261..000000000 --- a/node_modules/stylelint/lib/rules/selector-max-compound-selectors/index.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict'; - -const isContextFunctionalPseudoClass = require('../../utils/isContextFunctionalPseudoClass'); -const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const resolvedNestedSelector = require('postcss-resolve-nested-selector'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'selector-max-compound-selectors'; - -const messages = ruleMessages(ruleName, { - expected: (selector, max) => - `Expected "${selector}" to have no more than ${max} compound ${ - max === 1 ? 'selector' : 'selectors' - }`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-max-compound-selectors', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: isNonNegativeInteger, - }); - - if (!validOptions) { - return; - } - - /** - * Finds actual selectors in selectorNode object and checks them. - * - * @param {import('postcss-selector-parser').Container} selectorNode - * @param {import('postcss').Rule} ruleNode - */ - function checkSelector(selectorNode, ruleNode) { - let compoundCount = 1; - - selectorNode.each((childNode) => { - // Only traverse inside actual selectors and context functional pseudo-classes - if (childNode.type === 'selector' || isContextFunctionalPseudoClass(childNode)) { - checkSelector(childNode, ruleNode); - } - - // Compound selectors are separated by combinators, so increase count when meeting one - if (childNode.type === 'combinator') { - compoundCount++; - } - }); - - if ( - selectorNode.type !== 'root' && - selectorNode.type !== 'pseudo' && - compoundCount > primary - ) { - const selector = selectorNode.toString(); - - report({ - ruleName, - result, - node: ruleNode, - message: messages.expected, - messageArgs: [selector, primary], - word: selector, - }); - } - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - // Using `.selectors` gets us each selector if there is a comma separated set - for (const selector of ruleNode.selectors) { - for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { - // Process each resolved selector with `checkSelector` via postcss-selector-parser - parseSelector(resolvedSelector, result, ruleNode, (s) => checkSelector(s, ruleNode)); - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-empty-lines/index.js b/node_modules/stylelint/lib/rules/selector-max-empty-lines/index.js deleted file mode 100644 index efc4ec661..000000000 --- a/node_modules/stylelint/lib/rules/selector-max-empty-lines/index.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isNumber } = require('../../utils/validateTypes'); - -const ruleName = 'selector-max-empty-lines'; - -const messages = ruleMessages(ruleName, { - expected: (max) => `Expected no more than ${max} empty ${max === 1 ? 'line' : 'lines'}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-max-empty-lines', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const maxAdjacentNewlines = primary + 1; - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: isNumber, - }); - - if (!validOptions) { - return; - } - - const violatedCRLFNewLinesRegex = new RegExp(`(?:\r\n){${maxAdjacentNewlines + 1},}`); - const violatedLFNewLinesRegex = new RegExp(`\n{${maxAdjacentNewlines + 1},}`); - const allowedLFNewLinesString = context.fix ? '\n'.repeat(maxAdjacentNewlines) : ''; - const allowedCRLFNewLinesString = context.fix ? '\r\n'.repeat(maxAdjacentNewlines) : ''; - - root.walkRules((ruleNode) => { - const selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; - - if (context.fix) { - const newSelectorString = selector - .replace(new RegExp(violatedLFNewLinesRegex, 'gm'), allowedLFNewLinesString) - .replace(new RegExp(violatedCRLFNewLinesRegex, 'gm'), allowedCRLFNewLinesString); - - if (ruleNode.raws.selector) { - ruleNode.raws.selector.raw = newSelectorString; - } else { - ruleNode.selector = newSelectorString; - } - } else if ( - violatedLFNewLinesRegex.test(selector) || - violatedCRLFNewLinesRegex.test(selector) - ) { - report({ - message: messages.expected(primary), - node: ruleNode, - index: 0, - result, - ruleName, - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-id/index.js b/node_modules/stylelint/lib/rules/selector-max-id/index.js deleted file mode 100644 index 3bec2417d..000000000 --- a/node_modules/stylelint/lib/rules/selector-max-id/index.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -const isContextFunctionalPseudoClass = require('../../utils/isContextFunctionalPseudoClass'); -const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const optionsMatches = require('../../utils/optionsMatches'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const resolvedNestedSelector = require('postcss-resolve-nested-selector'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-max-id'; - -const messages = ruleMessages(ruleName, { - expected: (selector, max) => - `Expected "${selector}" to have no more than ${max} ID ${max === 1 ? 'selector' : 'selectors'}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-max-id', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: isNonNegativeInteger, - }, - { - actual: secondaryOptions, - possible: { - ignoreContextFunctionalPseudoClasses: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - /** - * @param {import('postcss-selector-parser').Container} selectorNode - * @param {import('postcss').Rule} ruleNode - */ - function checkSelector(selectorNode, ruleNode) { - const count = selectorNode.reduce((total, childNode) => { - // Only traverse inside actual selectors and context functional pseudo-classes that are not part of ignored functional pseudo-classes - if ( - childNode.type === 'selector' || - (isContextFunctionalPseudoClass(childNode) && - !isIgnoredContextFunctionalPseudoClass(childNode)) - ) { - checkSelector(childNode, ruleNode); - } - - if (childNode.type === 'id') total += 1; - - return total; - }, 0); - - if (selectorNode.type !== 'root' && selectorNode.type !== 'pseudo' && count > primary) { - const selector = selectorNode.toString(); - - report({ - ruleName, - result, - node: ruleNode, - message: messages.expected, - messageArgs: [selector, primary], - word: selector, - }); - } - } - - /** - * @param {import('postcss-selector-parser').Node} node - * @returns {boolean} - */ - function isIgnoredContextFunctionalPseudoClass(node) { - return ( - node.type === 'pseudo' && - optionsMatches(secondaryOptions, 'ignoreContextFunctionalPseudoClasses', node.value) - ); - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - for (const selector of ruleNode.selectors) { - for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { - parseSelector(resolvedSelector, result, ruleNode, (container) => - checkSelector(container, ruleNode), - ); - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-pseudo-class/index.js b/node_modules/stylelint/lib/rules/selector-max-pseudo-class/index.js deleted file mode 100644 index 7a9c56224..000000000 --- a/node_modules/stylelint/lib/rules/selector-max-pseudo-class/index.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -const isContextFunctionalPseudoClass = require('../../utils/isContextFunctionalPseudoClass'); -const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const { levelOneAndTwoPseudoElements } = require('../../reference/selectors'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const resolvedNestedSelector = require('postcss-resolve-nested-selector'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'selector-max-pseudo-class'; - -const messages = ruleMessages(ruleName, { - expected: (selector, max) => - `Expected "${selector}" to have no more than ${max} pseudo-${max === 1 ? 'class' : 'classes'}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-max-pseudo-class', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: isNonNegativeInteger, - }); - - if (!validOptions) { - return; - } - - /** - * @param {import('postcss-selector-parser').Container} selectorNode - * @param {import('postcss').Rule} ruleNode - */ - function checkSelector(selectorNode, ruleNode) { - const count = selectorNode.reduce((total, childNode) => { - // Only traverse inside actual selectors and context functional pseudo-classes - if (childNode.type === 'selector' || isContextFunctionalPseudoClass(childNode)) { - checkSelector(childNode, ruleNode); - } - - // Exclude pseudo elements from the count - if ( - childNode.type === 'pseudo' && - (childNode.value.includes('::') || - levelOneAndTwoPseudoElements.has(childNode.value.toLowerCase().slice(1))) - ) { - return total; - } - - if (childNode.type === 'pseudo') { - total += 1; - } - - return total; - }, 0); - - if (count > primary) { - const selector = selectorNode.toString(); - - report({ - ruleName, - result, - node: ruleNode, - message: messages.expected, - messageArgs: [selector, primary], - word: selector, - }); - } - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - for (const selector of ruleNode.selectors) { - for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { - parseSelector(resolvedSelector, result, ruleNode, (selectorTree) => { - checkSelector(selectorTree, ruleNode); - }); - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-specificity/index.js b/node_modules/stylelint/lib/rules/selector-max-specificity/index.js deleted file mode 100644 index cec213d67..000000000 --- a/node_modules/stylelint/lib/rules/selector-max-specificity/index.js +++ /dev/null @@ -1,231 +0,0 @@ -'use strict'; - -const resolvedNestedSelector = require('postcss-resolve-nested-selector'); -const { selectorSpecificity, compare } = require('@csstools/selector-specificity'); - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const { - aNPlusBOfSNotationPseudoClasses, - aNPlusBNotationPseudoClasses, - linguisticPseudoClasses, -} = require('../../reference/selectors'); -const optionsMatches = require('../../utils/optionsMatches'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString, assertNumber } = require('../../utils/validateTypes'); - -const ruleName = 'selector-max-specificity'; - -const messages = ruleMessages(ruleName, { - expected: (selector, max) => `Expected "${selector}" to have a specificity no more than "${max}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-max-specificity', -}; - -/** @typedef {import('@csstools/selector-specificity').Specificity} Specificity */ - -/** - * Return a zero specificity. We need a new instance each time so that it can mutated. - * - * @returns {Specificity} - */ -const zeroSpecificity = () => ({ a: 0, b: 0, c: 0 }); - -/** - * Calculate the sum of given specificities. - * - * @param {Specificity[]} specificities - * @returns {Specificity} - */ -const specificitySum = (specificities) => { - const sum = zeroSpecificity(); - - for (const { a, b, c } of specificities) { - sum.a += a; - sum.b += b; - sum.c += c; - } - - return sum; -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [ - // Check that the max specificity is in the form "a,b,c" - (spec) => isString(spec) && /^\d+,\d+,\d+$/.test(spec), - ], - }, - { - actual: secondaryOptions, - possible: { - ignoreSelectors: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - /** - * Calculate the specificity of a simple selector (type, attribute, class, ID, or pseudos's own value). - * - * @param {import('postcss-selector-parser').Node} node - * @returns {Specificity} - */ - const simpleSpecificity = (node) => { - if (optionsMatches(secondaryOptions, 'ignoreSelectors', node.toString())) { - return zeroSpecificity(); - } - - return selectorSpecificity(node); - }; - - /** - * Calculate the specificity of the most specific direct child. - * - * @param {import('postcss-selector-parser').Container} node - * @returns {Specificity} - */ - const maxChildSpecificity = (node) => - node.reduce((maxSpec, child) => { - const childSpecificity = nodeSpecificity(child); // eslint-disable-line no-use-before-define - - return compare(childSpecificity, maxSpec) > 0 ? childSpecificity : maxSpec; - }, zeroSpecificity()); - - /** - * Calculate the specificity of a pseudo selector including own value and children. - * - * @param {import('postcss-selector-parser').Pseudo} node - * @returns {Specificity} - */ - const pseudoSpecificity = (node) => { - // `node.toString()` includes children which should be processed separately, - // so use `node.value` instead - const ownValue = node.value.toLowerCase(); - - if (ownValue === ':where') { - return zeroSpecificity(); - } - - let ownSpecificity; - - if (optionsMatches(secondaryOptions, 'ignoreSelectors', ownValue)) { - ownSpecificity = zeroSpecificity(); - } else if (aNPlusBOfSNotationPseudoClasses.has(ownValue.replace(/^:/, ''))) { - // TODO: We need to support `` in `ignoreSelectors`. E.g. `:nth-child(even of .foo)`. - return selectorSpecificity(node); - } else { - ownSpecificity = selectorSpecificity(node.clone({ nodes: [] })); - } - - return specificitySum([ownSpecificity, maxChildSpecificity(node)]); - }; - - /** - * @param {import('postcss-selector-parser').Node} node - * @returns {boolean} - */ - const shouldSkipPseudoClassArgument = (node) => { - // postcss-selector-parser includes the arguments to nth-child() functions - // as "tags", so we need to ignore them ourselves. - // The fake-tag's "parent" is actually a selector node, whose parent - // should be the :nth-child pseudo node. - const parentNode = node.parent && node.parent.parent; - - if (parentNode && parentNode.type === 'pseudo' && parentNode.value) { - const pseudoClass = parentNode.value.toLowerCase().replace(/^:/, ''); - - return ( - aNPlusBNotationPseudoClasses.has(pseudoClass) || linguisticPseudoClasses.has(pseudoClass) - ); - } - - return false; - }; - - /** - * Calculate the specificity of a node parsed by `postcss-selector-parser`. - * - * @param {import('postcss-selector-parser').Node} node - * @returns {Specificity} - */ - const nodeSpecificity = (node) => { - if (shouldSkipPseudoClassArgument(node)) { - return zeroSpecificity(); - } - - switch (node.type) { - case 'attribute': - case 'class': - case 'id': - case 'tag': - return simpleSpecificity(node); - case 'pseudo': - return pseudoSpecificity(node); - case 'selector': - // Calculate the sum of all the direct children - return specificitySum(node.map((n) => nodeSpecificity(n))); - default: - return zeroSpecificity(); - } - }; - - const [a, b, c] = primary.split(',').map((s) => Number.parseFloat(s)); - - assertNumber(a); - assertNumber(b); - assertNumber(c); - - const maxSpecificity = { a, b, c }; - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - // Using `.selectors` gets us each selector in the eventuality we have a comma separated set - for (const selector of ruleNode.selectors) { - for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { - // Skip non-standard syntax selectors - if (!isStandardSyntaxSelector(resolvedSelector)) { - continue; - } - - parseSelector(resolvedSelector, result, ruleNode, (selectorTree) => { - // Check if the selector specificity exceeds the allowed maximum - if (compare(maxChildSpecificity(selectorTree), maxSpecificity) > 0) { - report({ - ruleName, - result, - node: ruleNode, - message: messages.expected, - messageArgs: [resolvedSelector, primary], - word: selector, - }); - } - }); - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-type/index.js b/node_modules/stylelint/lib/rules/selector-max-type/index.js deleted file mode 100644 index 357ee389b..000000000 --- a/node_modules/stylelint/lib/rules/selector-max-type/index.js +++ /dev/null @@ -1,231 +0,0 @@ -'use strict'; - -const isContextFunctionalPseudoClass = require('../../utils/isContextFunctionalPseudoClass'); -const isKeyframeSelector = require('../../utils/isKeyframeSelector'); -const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); -const isOnlyWhitespace = require('../../utils/isOnlyWhitespace'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const isStandardSyntaxTypeSelector = require('../../utils/isStandardSyntaxTypeSelector'); -const optionsMatches = require('../../utils/optionsMatches'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const resolvedNestedSelector = require('postcss-resolve-nested-selector'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); -const isCustomElement = require('../../utils/isCustomElement'); - -const ruleName = 'selector-max-type'; - -const messages = ruleMessages(ruleName, { - expected: (selector, max) => - `Expected "${selector}" to have no more than ${max} type ${ - max === 1 ? 'selector' : 'selectors' - }`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-max-type', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: isNonNegativeInteger, - }, - { - actual: secondaryOptions, - possible: { - ignore: ['descendant', 'child', 'compounded', 'next-sibling', 'custom-elements'], - ignoreTypes: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const ignoreDescendant = optionsMatches(secondaryOptions, 'ignore', 'descendant'); - const ignoreChild = optionsMatches(secondaryOptions, 'ignore', 'child'); - const ignoreCompounded = optionsMatches(secondaryOptions, 'ignore', 'compounded'); - const ignoreNextSibling = optionsMatches(secondaryOptions, 'ignore', 'next-sibling'); - const ignoreCustomElements = optionsMatches(secondaryOptions, 'ignore', 'custom-elements'); - - /** - * @param {import('postcss-selector-parser').Container} selectorNode - * @param {import('postcss').Rule} ruleNode - */ - function checkSelector(selectorNode, ruleNode) { - const count = selectorNode.reduce((total, childNode) => { - // Only traverse inside actual selectors and context functional pseudo-classes - if (childNode.type === 'selector' || isContextFunctionalPseudoClass(childNode)) { - checkSelector(childNode, ruleNode); - } - - if (optionsMatches(secondaryOptions, 'ignoreTypes', childNode.value)) { - return total; - } - - if (ignoreDescendant && hasDescendantCombinatorBefore(childNode)) { - return total; - } - - if (ignoreChild && hasChildCombinatorBefore(childNode)) { - return total; - } - - if (ignoreCompounded && hasCompoundSelector(childNode)) { - return total; - } - - if (ignoreNextSibling && hasNextSiblingCombinator(childNode)) { - return total; - } - - if (ignoreCustomElements && childNode.value && isCustomElement(childNode.value)) { - return total; - } - - if (childNode.type === 'tag' && !isStandardSyntaxTypeSelector(childNode)) { - return total; - } - - return childNode.type === 'tag' ? total + 1 : total; - }, 0); - - if (selectorNode.type !== 'root' && selectorNode.type !== 'pseudo' && count > primary) { - const selector = selectorNode.toString(); - - report({ - ruleName, - result, - node: ruleNode, - message: messages.expected, - messageArgs: [selector, primary], - word: selector, - }); - } - } - - root.walkRules((ruleNode) => { - const selectors = ruleNode.selectors; - - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - if (selectors.some((s) => isKeyframeSelector(s))) { - return; - } - - for (const selector of ruleNode.selectors) { - for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { - if (!isStandardSyntaxSelector(resolvedSelector)) { - continue; - } - - parseSelector(resolvedSelector, result, ruleNode, (container) => - checkSelector(container, ruleNode), - ); - } - } - }); - }; -}; - -/** @typedef {import('postcss-selector-parser').Node} SelectorNode */ - -/** - * @param {SelectorNode} node - * @returns {boolean} - */ -function hasDescendantCombinatorBefore(node) { - if (!node.parent) return false; - - const nodeIndex = node.parent.nodes.indexOf(node); - - return node.parent.nodes.slice(0, nodeIndex).some((n) => isDescendantCombinator(n)); -} - -/** - * @param {SelectorNode} node - * @returns {boolean} - */ -function hasChildCombinatorBefore(node) { - if (!node.parent) return false; - - const nodeIndex = node.parent.nodes.indexOf(node); - - return node.parent.nodes.slice(0, nodeIndex).some((n) => isChildCombinator(n)); -} - -/** - * @param {SelectorNode} node - * @returns {boolean} - */ -function hasCompoundSelector(node) { - if (node.prev() && !isCombinator(node.prev())) { - return true; - } - - return node.next() && !isCombinator(node.next()); -} - -/** - * @param {SelectorNode} node - * @returns {boolean} - */ -function hasNextSiblingCombinator(node) { - return node.prev() && isNextSiblingCombinator(node.prev()); -} - -/** - * @param {SelectorNode} node - * @returns {boolean} - */ -function isCombinator(node) { - if (!node) return false; - - return node.type === 'combinator'; -} - -/** - * @param {SelectorNode} node - * @returns {boolean} - */ -function isDescendantCombinator(node) { - if (!node) return false; - - return isCombinator(node) && isString(node.value) && isOnlyWhitespace(node.value); -} - -/** - * @param {SelectorNode} node - * @returns {boolean} - */ -function isChildCombinator(node) { - if (!node) return false; - - return isCombinator(node) && node.value === '>'; -} - -/** - * @param {SelectorNode} node - * @returns {boolean} - */ -function isNextSiblingCombinator(node) { - return isCombinator(node) && node.value === '+'; -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-max-universal/index.js b/node_modules/stylelint/lib/rules/selector-max-universal/index.js deleted file mode 100644 index a0d24942a..000000000 --- a/node_modules/stylelint/lib/rules/selector-max-universal/index.js +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -const isNonNegativeInteger = require('../../utils/isNonNegativeInteger'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const resolvedNestedSelector = require('postcss-resolve-nested-selector'); -const ruleMessages = require('../../utils/ruleMessages'); -const selectorParser = require('postcss-selector-parser'); -const validateOptions = require('../../utils/validateOptions'); -const optionsMatches = require('../../utils/optionsMatches'); -const { isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-max-universal'; - -const messages = ruleMessages(ruleName, { - expected: (selector, max) => - `Expected "${selector}" to have no more than ${max} universal ${ - max === 1 ? 'selector' : 'selectors' - }`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-max-universal', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: isNonNegativeInteger, - }, - { - actual: secondaryOptions, - possible: { - ignoreAfterCombinators: [isString], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - /** - * @param {import('postcss-selector-parser').Container} selectorNode - * @param {import('postcss').Rule} ruleNode - */ - function checkSelector(selectorNode, ruleNode) { - const count = selectorNode.reduce((total, childNode) => { - // Only traverse inside actual selectors - // All logical combinations will be resolved as nested selector in `postcss-resolve-nested-selector` - if (childNode.type === 'selector') { - checkSelector(childNode, ruleNode); - } - - const prevChildNode = childNode.prev(); - const prevChildNodeValue = prevChildNode && prevChildNode.value; - - if (childNode.type === 'universal') { - if (!optionsMatches(secondaryOptions, 'ignoreAfterCombinators', prevChildNodeValue)) { - total += 1; - } - } - - return total; - }, 0); - - if (selectorNode.type !== 'root' && selectorNode.type !== 'pseudo' && count > primary) { - const selector = selectorNode.toString(); - - report({ - ruleName, - result, - node: ruleNode, - message: messages.expected, - messageArgs: [selector, primary], - word: selector, - }); - } - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - /** @type {string[]} */ - const selectors = []; - - selectorParser() - .astSync(ruleNode.selector) - .walk((node) => { - if (node.type === 'selector') { - selectors.push(String(node).trim()); - } - }); - - for (const selector of selectors) { - for (const resolvedSelector of resolvedNestedSelector(selector, ruleNode)) { - parseSelector(resolvedSelector, result, ruleNode, (container) => - checkSelector(container, ruleNode), - ); - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-nested-pattern/index.js b/node_modules/stylelint/lib/rules/selector-nested-pattern/index.js deleted file mode 100644 index 6d10d4fbe..000000000 --- a/node_modules/stylelint/lib/rules/selector-nested-pattern/index.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isBoolean, isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-nested-pattern'; - -const messages = ruleMessages(ruleName, { - expected: (selector, pattern) => `Expected "${selector}" to match pattern "${pattern}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-nested-pattern', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [isRegExp, isString], - }, - { - actual: secondaryOptions, - possible: { - splitList: [isBoolean], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const normalizedPattern = isString(primary) ? new RegExp(primary) : primary; - const splitList = secondaryOptions && secondaryOptions.splitList; - - root.walkRules((ruleNode) => { - if (ruleNode.parent && ruleNode.parent.type !== 'rule') { - return; - } - - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selectors = splitList ? ruleNode.selectors : [ruleNode.selector]; - - for (const selector of selectors) { - if (normalizedPattern.test(selector)) { - continue; - } - - report({ - result, - ruleName, - message: messages.expected, - messageArgs: [selector, primary], - node: ruleNode, - word: selector, - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-no-qualifying-type/index.js b/node_modules/stylelint/lib/rules/selector-no-qualifying-type/index.js deleted file mode 100644 index b4f8ec46e..000000000 --- a/node_modules/stylelint/lib/rules/selector-no-qualifying-type/index.js +++ /dev/null @@ -1,157 +0,0 @@ -'use strict'; - -const resolvedNestedSelector = require('postcss-resolve-nested-selector'); - -const isKeyframeRule = require('../../utils/isKeyframeRule'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const isStandardSyntaxTypeSelector = require('../../utils/isStandardSyntaxTypeSelector'); -const optionsMatches = require('../../utils/optionsMatches'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'selector-no-qualifying-type'; - -const messages = ruleMessages(ruleName, { - rejected: (selector) => `Unexpected qualifying type selector "${selector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-no-qualifying-type', -}; - -const selectorCharacters = ['#', '.', '[']; - -/** - * @param {string} value - * @returns {boolean} - */ -function isSelectorCharacters(value) { - return selectorCharacters.some((char) => value.includes(char)); -} - -/** - * @param {import('postcss-selector-parser').Tag} node - * @returns {Array} - */ -function getRightNodes(node) { - const result = []; - - /** @type {import('postcss-selector-parser').Node} */ - let rightNode = node; - - while ((rightNode = rightNode.next())) { - if (rightNode.type === 'combinator') { - break; - } - - if (rightNode.type !== 'id' && rightNode.type !== 'class' && rightNode.type !== 'attribute') { - continue; - } - - result.push(rightNode); - } - - return result; -} - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [true], - }, - { - actual: secondaryOptions, - possible: { - ignore: ['attribute', 'class', 'id'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const ignoreId = optionsMatches(secondaryOptions, 'ignore', 'id'); - const ignoreClass = optionsMatches(secondaryOptions, 'ignore', 'class'); - const ignoreAttribute = optionsMatches(secondaryOptions, 'ignore', 'attribute'); - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - if (isKeyframeRule(ruleNode)) { - return; - } - - if (!isSelectorCharacters(ruleNode.selector)) { - return; - } - - /** - * @param {import('postcss-selector-parser').Root} selectorAST - */ - function checkSelector(selectorAST) { - selectorAST.walkTags((tagNode) => { - if (!isStandardSyntaxTypeSelector(tagNode)) return; - - const selectorParent = tagNode.parent; - - if (selectorParent && selectorParent.nodes.length === 1) { - return; - } - - const selectorNodes = getRightNodes(tagNode); - - for (const selectorNode of selectorNodes) { - if ( - (selectorNode.type === 'id' && !ignoreId) || - (selectorNode.type === 'class' && !ignoreClass) || - (selectorNode.type === 'attribute' && !ignoreAttribute) - ) { - const selector = [tagNode, ...selectorNodes].join('').trimStart(); - - complain(selector); - } - } - }); - } - - for (const resolvedSelector of resolvedNestedSelector(ruleNode.selector, ruleNode)) { - if (!isStandardSyntaxSelector(resolvedSelector)) { - continue; - } - - parseSelector(resolvedSelector, result, ruleNode, checkSelector); - } - - /** - * @param {string} selector - */ - function complain(selector) { - report({ - ruleName, - result, - node: ruleNode, - message: messages.rejected, - messageArgs: [selector], - word: selector, - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-no-vendor-prefix/index.js b/node_modules/stylelint/lib/rules/selector-no-vendor-prefix/index.js deleted file mode 100644 index afe591a8f..000000000 --- a/node_modules/stylelint/lib/rules/selector-no-vendor-prefix/index.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -const hasPrefix = require('../../utils/hasPrefix'); -const isAutoprefixable = require('../../utils/isAutoprefixable'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const optionsMatches = require('../../utils/optionsMatches'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isString, isRegExp } = require('../../utils/validateTypes'); - -const ruleName = 'selector-no-vendor-prefix'; - -const messages = ruleMessages(ruleName, { - rejected: (selector) => `Unexpected vendor-prefix "${selector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-no-vendor-prefix', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignoreSelectors: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!hasPrefix(ruleNode.selector)) return; - - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selector = ruleNode.selector; - - parseSelector(selector, result, ruleNode, (selectorTree) => { - selectorTree.walkPseudos((pseudoNode) => { - const { value } = pseudoNode; - - if (!isAutoprefixable.selector(value)) { - return; - } - - if (optionsMatches(secondaryOptions, 'ignoreSelectors', value)) { - return; - } - - if (context.fix) { - ruleNode.selector = isAutoprefixable.unprefix(selector); - - return; - } - - report({ - result, - ruleName, - message: messages.rejected, - messageArgs: [value], - node: ruleNode, - word: value, - }); - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-not-notation/index.js b/node_modules/stylelint/lib/rules/selector-not-notation/index.js deleted file mode 100644 index 655f365cd..000000000 --- a/node_modules/stylelint/lib/rules/selector-not-notation/index.js +++ /dev/null @@ -1,213 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { - isPseudoClass, - isAttribute, - isClassName, - isUniversal, - isIdentifier, - isTag, -} = require('postcss-selector-parser'); -const { assert } = require('../../utils/validateTypes'); - -const ruleName = 'selector-not-notation'; -const messages = ruleMessages(ruleName, { - expected: (type) => `Expected ${type} :not() pseudo-class notation`, -}); -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-not-notation', - fixable: true, -}; - -/** @typedef {import('postcss-selector-parser').Node} Node */ -/** @typedef {import('postcss-selector-parser').Selector} Selector */ -/** @typedef {import('postcss-selector-parser').Pseudo} Pseudo */ - -/** - * @param {Node} node - * @returns {boolean} - */ -const isSimpleSelector = (node) => - isPseudoClass(node) || - isAttribute(node) || - isClassName(node) || - isUniversal(node) || - isIdentifier(node) || - isTag(node); - -/** - * @param {Node} node - * @returns {node is Pseudo} - */ -const isNot = (node) => - isPseudoClass(node) && node.value !== undefined && node.value.toLowerCase() === ':not'; - -/** - * @param {Selector[]} list - * @returns {boolean} - */ -const isSimple = (list) => { - if (list.length > 1) return false; - - assert(list[0], 'list is never empty'); - const [first, second] = list[0].nodes; - - if (!first) return true; - - if (second) return false; - - return isSimpleSelector(first) && !isNot(first); -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['simple', 'complex'], - }); - - if (!validOptions) return; - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) return; - - const selector = ruleNode.selector; - - if (!selector.includes(':not(')) return; - - if (!isStandardSyntaxSelector(selector)) return; - - const fixedSelector = parseSelector(selector, result, ruleNode, (container) => { - container.walkPseudos((pseudo) => { - if (!isNot(pseudo)) return; - - if (primary === 'complex') { - const prev = pseudo.prev(); - const hasConsecutiveNot = prev && isNot(prev); - - if (!hasConsecutiveNot) return; - - if (context.fix) return fixComplex(prev); - } else { - const selectors = pseudo.nodes; - - if (isSimple(selectors)) return; - - const mustFix = - context.fix && - selectors.length > 1 && - selectors[1] && - (selectors[1].nodes.length === 0 || - selectors.every(({ nodes }) => nodes.length === 1)); - - if (mustFix) return fixSimple(pseudo); - } - - assert(pseudo.source && pseudo.source.end); - - report({ - message: messages.expected, - messageArgs: [primary], - node: ruleNode, - index: pseudo.sourceIndex, - endIndex: pseudo.source.end.column, - result, - ruleName, - }); - }); - }); - - if (context.fix && fixedSelector) { - ruleNode.selector = fixedSelector; - } - }); - }; -}; - -/** - * @param {Pseudo} not - * @returns {Node} - */ -const getLastConsecutiveNot = ({ parent, sourceIndex }) => { - assert(parent); - - const nodes = parent.nodes; - const index = nodes.findIndex((node) => node.sourceIndex >= sourceIndex && !isNot(node)); - const node = index === -1 ? nodes[nodes.length - 1] : nodes[index - 1]; - - assert(node); - - return node; -}; - -/** - * @param {Pseudo} not - */ -function fixSimple(not) { - const simpleSelectors = not.nodes - .filter(({ nodes }) => nodes[0] && isSimpleSelector(nodes[0])) - .map((s) => { - assert(s.nodes[0]); - s.nodes[0].rawSpaceBefore = ''; - s.nodes[0].rawSpaceAfter = ''; - - return s; - }); - const firstSelector = simpleSelectors.shift(); - - assert(firstSelector); - assert(not.parent); - - not.empty(); - not.nodes.push(firstSelector); - - for (const s of simpleSelectors) { - const last = getLastConsecutiveNot(not); - - not.parent.insertAfter(last, last.clone({ nodes: [s] })); - } -} - -/** - * @param {Pseudo} previousNot - */ -function fixComplex(previousNot) { - const indentAndTrimRight = (/** @type {Selector[]} */ selectors) => { - for (const s of selectors) { - assert(s.nodes[0]); - s.nodes[0].rawSpaceBefore = ' '; - s.nodes[0].rawSpaceAfter = ''; - } - }; - const [head, ...tail] = previousNot.nodes; - let node = previousNot.next(); - - if (head == null || head.nodes.length === 0) return; - - assert(head.nodes[0]); - head.nodes[0].rawSpaceBefore = ''; - head.nodes[0].rawSpaceAfter = ''; - indentAndTrimRight(tail); - - while (isNot(node)) { - const selectors = node.nodes; - const prev = node; - - indentAndTrimRight(selectors); - previousNot.nodes = previousNot.nodes.concat(selectors); - node = node.next(); - prev.remove(); - } -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-class-allowed-list/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-class-allowed-list/index.js deleted file mode 100644 index 92cb6b9b6..000000000 --- a/node_modules/stylelint/lib/rules/selector-pseudo-class-allowed-list/index.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-pseudo-class-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (selector) => `Unexpected pseudo-class "${selector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-pseudo-class-allowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selector = ruleNode.selector; - - if (!selector.includes(':')) { - return; - } - - parseSelector(selector, result, ruleNode, (selectorTree) => { - selectorTree.walkPseudos((pseudoNode) => { - const value = pseudoNode.value; - - // Ignore pseudo-elements - if (value.slice(0, 2) === '::') { - return; - } - - const name = value.slice(1); - - if (matchesStringOrRegExp(vendor.unprefixed(name), primary)) { - return; - } - - report({ - word: value, - message: messages.rejected, - messageArgs: [value], - node: ruleNode, - result, - ruleName, - }); - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-class-case/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-class-case/index.js deleted file mode 100644 index 1aefb07f8..000000000 --- a/node_modules/stylelint/lib/rules/selector-pseudo-class-case/index.js +++ /dev/null @@ -1,103 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const { levelOneAndTwoPseudoElements } = require('../../reference/selectors'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'selector-pseudo-class-case'; - -const messages = ruleMessages(ruleName, { - expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-pseudo-class-case', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['lower', 'upper'], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selector = ruleNode.selector; - - if (!selector.includes(':')) { - return; - } - - const fixedSelector = parseSelector( - ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector, - result, - ruleNode, - (selectorTree) => { - selectorTree.walkPseudos((pseudoNode) => { - const pseudo = pseudoNode.value; - - if (!isStandardSyntaxSelector(pseudo)) { - return; - } - - if ( - pseudo.includes('::') || - levelOneAndTwoPseudoElements.has(pseudo.toLowerCase().slice(1)) - ) { - return; - } - - const expectedPseudo = - primary === 'lower' ? pseudo.toLowerCase() : pseudo.toUpperCase(); - - if (pseudo === expectedPseudo) { - return; - } - - if (context.fix) { - pseudoNode.value = expectedPseudo; - - return; - } - - report({ - message: messages.expected(pseudo, expectedPseudo), - node: ruleNode, - index: pseudoNode.sourceIndex, - ruleName, - result, - }); - }); - }, - ); - - if (context.fix && fixedSelector) { - if (ruleNode.raws.selector) { - ruleNode.raws.selector.raw = fixedSelector; - } else { - ruleNode.selector = fixedSelector; - } - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-class-disallowed-list/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-class-disallowed-list/index.js deleted file mode 100644 index 21b5a12a6..000000000 --- a/node_modules/stylelint/lib/rules/selector-pseudo-class-disallowed-list/index.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-pseudo-class-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (selector) => `Unexpected pseudo-class "${selector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-pseudo-class-disallowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selector = ruleNode.selector; - - if (!selector.includes(':')) { - return; - } - - parseSelector(selector, result, ruleNode, (selectorTree) => { - selectorTree.walkPseudos((pseudoNode) => { - const value = pseudoNode.value; - - // Ignore pseudo-elements - if (value.slice(0, 2) === '::') { - return; - } - - const name = value.slice(1); - - if (!matchesStringOrRegExp(vendor.unprefixed(name), primary)) { - return; - } - - report({ - word: value, - message: messages.rejected, - messageArgs: [value], - node: ruleNode, - result, - ruleName, - }); - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-class-no-unknown/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-class-no-unknown/index.js deleted file mode 100644 index 3c2b372fb..000000000 --- a/node_modules/stylelint/lib/rules/selector-pseudo-class-no-unknown/index.js +++ /dev/null @@ -1,179 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const isCustomSelector = require('../../utils/isCustomSelector'); -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const { - atRulePagePseudoClasses, - levelOneAndTwoPseudoElements, - pseudoClasses, - pseudoElements, - webkitScrollbarPseudoClasses, - webkitScrollbarPseudoElements, -} = require('../../reference/selectors'); -const optionsMatches = require('../../utils/optionsMatches'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isString, isRegExp } = require('../../utils/validateTypes'); -const { isAtRule } = require('../../utils/typeGuards'); - -const ruleName = 'selector-pseudo-class-no-unknown'; - -const messages = ruleMessages(ruleName, { - rejected: (selector) => `Unexpected unknown pseudo-class selector "${selector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-pseudo-class-no-unknown', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignorePseudoClasses: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - /** - * @param {string} selector - * @param {import('postcss').ChildNode} node - */ - function check(selector, node) { - parseSelector(selector, result, node, (selectorTree) => { - selectorTree.walkPseudos((pseudoNode) => { - const value = pseudoNode.value; - - if (!isStandardSyntaxSelector(value)) { - return; - } - - if (isCustomSelector(value)) { - return; - } - - if (value.startsWith('::')) { - return; - } - - const name = value.replace(/^:*/, '').toLowerCase(); - - if (levelOneAndTwoPseudoElements.has(name)) { - return; - } - - if (optionsMatches(secondaryOptions, 'ignorePseudoClasses', pseudoNode.value.slice(1))) { - return; - } - - const hasVendorPrefix = vendor.prefix(name); - let index = null; - - if (isAtRule(node) && node.name === 'page') { - if (atRulePagePseudoClasses.has(name)) { - return; - } - - index = atRuleParamIndex(node) + pseudoNode.sourceIndex; - } else if (pseudoElements.has(name) && !hasVendorPrefix) { - index = pseudoNode.sourceIndex; - } else { - if (hasVendorPrefix || pseudoClasses.has(name)) { - return; - } - - /** @type {import('postcss-selector-parser').Base} */ - let prevPseudoElement = pseudoNode; - - do { - prevPseudoElement = /** @type {import('postcss-selector-parser').Base} */ ( - prevPseudoElement.prev() - ); - - if (prevPseudoElement && prevPseudoElement.value.slice(0, 2) === '::') { - break; - } - } while (prevPseudoElement); - - if (prevPseudoElement) { - const prevPseudoElementValue = prevPseudoElement.value.toLowerCase().slice(2); - - if ( - webkitScrollbarPseudoElements.has(prevPseudoElementValue) && - webkitScrollbarPseudoClasses.has(name) - ) { - return; - } - } - - index = pseudoNode.sourceIndex; - } - - report({ - message: messages.rejected, - messageArgs: [value], - node, - index, - ruleName, - result, - word: value, - }); - }); - }); - } - - root.walk((node) => { - let selector = null; - - if (node.type === 'rule') { - if (!isStandardSyntaxRule(node)) { - return; - } - - selector = node.selector; - } else if (isAtRule(node) && node.name === 'page' && node.params) { - if (!isStandardSyntaxAtRule(node)) { - return; - } - - selector = node.params; - } - - // Return if selector empty, it is meaning node type is not a rule or a at-rule - - if (!selector) { - return; - } - - // Return early before parse if no pseudos for performance - - if (!selector.includes(':')) { - return; - } - - check(selector, node); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-class-parentheses-space-inside/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-class-parentheses-space-inside/index.js deleted file mode 100644 index 26ab0c7fb..000000000 --- a/node_modules/stylelint/lib/rules/selector-pseudo-class-parentheses-space-inside/index.js +++ /dev/null @@ -1,156 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'selector-pseudo-class-parentheses-space-inside'; - -const messages = ruleMessages(ruleName, { - expectedOpening: 'Expected single space after "("', - rejectedOpening: 'Unexpected whitespace after "("', - expectedClosing: 'Expected single space before ")"', - rejectedClosing: 'Unexpected whitespace before ")"', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-pseudo-class-parentheses-space-inside', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - if (!ruleNode.selector.includes('(')) { - return; - } - - let hasFixed = false; - const selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector; - const fixedSelector = parseSelector(selector, result, ruleNode, (selectorTree) => { - selectorTree.walkPseudos((pseudoNode) => { - if (!pseudoNode.length) { - return; - } - - const paramString = pseudoNode.map((node) => String(node)).join(','); - const nextCharIsSpace = paramString.startsWith(' '); - const openIndex = pseudoNode.sourceIndex + pseudoNode.value.length + 1; - - if (nextCharIsSpace && primary === 'never') { - if (context.fix) { - hasFixed = true; - setFirstNodeSpaceBefore(pseudoNode, ''); - } else { - complain(messages.rejectedOpening, openIndex); - } - } - - if (!nextCharIsSpace && primary === 'always') { - if (context.fix) { - hasFixed = true; - setFirstNodeSpaceBefore(pseudoNode, ' '); - } else { - complain(messages.expectedOpening, openIndex); - } - } - - const prevCharIsSpace = paramString.endsWith(' '); - const closeIndex = openIndex + paramString.length - 1; - - if (prevCharIsSpace && primary === 'never') { - if (context.fix) { - hasFixed = true; - setLastNodeSpaceAfter(pseudoNode, ''); - } else { - complain(messages.rejectedClosing, closeIndex); - } - } - - if (!prevCharIsSpace && primary === 'always') { - if (context.fix) { - hasFixed = true; - setLastNodeSpaceAfter(pseudoNode, ' '); - } else { - complain(messages.expectedClosing, closeIndex); - } - } - }); - }); - - if (hasFixed && fixedSelector) { - if (!ruleNode.raws.selector) { - ruleNode.selector = fixedSelector; - } else { - ruleNode.raws.selector.raw = fixedSelector; - } - } - - /** - * @param {string} message - * @param {number} index - */ - function complain(message, index) { - report({ - message, - index, - result, - ruleName, - node: ruleNode, - }); - } - }); - }; -}; - -/** - * @param {import('postcss-selector-parser').Container} node - * @param {string} value - * @returns {void} - */ -function setFirstNodeSpaceBefore(node, value) { - const target = node.first; - - if (target.type === 'selector') { - setFirstNodeSpaceBefore(target, value); - } else { - target.spaces.before = value; - } -} - -/** - * @param {import('postcss-selector-parser').Container} node - * @param {string} value - * @returns {void} - */ -function setLastNodeSpaceAfter(node, value) { - const target = node.last; - - if (target.type === 'selector') { - setLastNodeSpaceAfter(target, value); - } else { - target.spaces.after = value; - } -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-element-allowed-list/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-element-allowed-list/index.js deleted file mode 100644 index db4c02c4f..000000000 --- a/node_modules/stylelint/lib/rules/selector-pseudo-element-allowed-list/index.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-pseudo-element-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (selector) => `Unexpected pseudo-element "${selector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-pseudo-element-allowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selector = ruleNode.selector; - - if (!selector.includes('::')) { - return; - } - - parseSelector(selector, result, ruleNode, (selectorTree) => { - selectorTree.walkPseudos((pseudoNode) => { - const value = pseudoNode.value; - - // Ignore pseudo-classes - if (value.charAt(1) !== ':') { - return; - } - - const name = value.slice(2); - - if (matchesStringOrRegExp(vendor.unprefixed(name), primary)) { - return; - } - - report({ - index: pseudoNode.sourceIndex, - message: messages.rejected, - messageArgs: [value], - node: ruleNode, - word: value, - result, - ruleName, - }); - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-element-case/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-element-case/index.js deleted file mode 100644 index 37cee6b0b..000000000 --- a/node_modules/stylelint/lib/rules/selector-pseudo-element-case/index.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const { levelOneAndTwoPseudoElements } = require('../../reference/selectors'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const transformSelector = require('../../utils/transformSelector'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'selector-pseudo-element-case'; - -const messages = ruleMessages(ruleName, { - expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-pseudo-element-case', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['lower', 'upper'], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selector = ruleNode.selector; - - if (!selector.includes(':')) { - return; - } - - transformSelector(result, ruleNode, (selectorTree) => { - selectorTree.walkPseudos((pseudoNode) => { - const pseudoElement = pseudoNode.value; - - if (!isStandardSyntaxSelector(pseudoElement)) { - return; - } - - if ( - !pseudoElement.includes('::') && - !levelOneAndTwoPseudoElements.has(pseudoElement.toLowerCase().slice(1)) - ) { - return; - } - - const expectedPseudoElement = - primary === 'lower' ? pseudoElement.toLowerCase() : pseudoElement.toUpperCase(); - - if (pseudoElement === expectedPseudoElement) { - return; - } - - if (context.fix) { - pseudoNode.value = expectedPseudoElement; - - return; - } - - report({ - message: messages.expected(pseudoElement, expectedPseudoElement), - node: ruleNode, - index: pseudoNode.sourceIndex, - ruleName, - result, - }); - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-element-colon-notation/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-element-colon-notation/index.js deleted file mode 100644 index c62c543dc..000000000 --- a/node_modules/stylelint/lib/rules/selector-pseudo-element-colon-notation/index.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const { levelOneAndTwoPseudoElements } = require('../../reference/selectors'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'selector-pseudo-element-colon-notation'; - -const messages = ruleMessages(ruleName, { - expected: (q) => `Expected ${q} colon pseudo-element notation`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-pseudo-element-colon-notation', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['single', 'double'], - }); - - if (!validOptions) { - return; - } - - let fixedColon = ''; - - if (primary === 'single') { - fixedColon = ':'; - } else if (primary === 'double') { - fixedColon = '::'; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selector = ruleNode.selector; - - // get out early if no pseudo elements or classes - if (!selector.includes(':')) { - return; - } - - const fixedSelector = parseSelector(selector, result, ruleNode, (selectors) => { - selectors.walkPseudos((pseudo) => { - const pseudoElement = pseudo.value.replace(/:/g, ''); - - if (!levelOneAndTwoPseudoElements.has(pseudoElement.toLowerCase())) { - return; - } - - const isDouble = pseudo.value.startsWith('::'); - - if (primary === 'single' && !isDouble) { - return; - } - - if (primary === 'double' && isDouble) { - return; - } - - if (context.fix) { - pseudo.replaceWith(pseudo.clone({ value: fixedColon + pseudoElement })); - - return; - } - - report({ - message: messages.expected(primary), - node: ruleNode, - index: pseudo.sourceIndex, - endIndex: pseudo.sourceIndex + (isDouble ? 2 : 1), - result, - ruleName, - }); - }); - }); - - if (context.fix && fixedSelector) { - ruleNode.selector = fixedSelector; - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-element-disallowed-list/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-element-disallowed-list/index.js deleted file mode 100644 index 59d796852..000000000 --- a/node_modules/stylelint/lib/rules/selector-pseudo-element-disallowed-list/index.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const matchesStringOrRegExp = require('../../utils/matchesStringOrRegExp'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-pseudo-element-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (selector) => `Unexpected pseudo-element "${selector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-pseudo-element-disallowed-list', -}; - -/** @type {import('stylelint').Rule>} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: [isString, isRegExp], - }); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - const selector = ruleNode.selector; - - if (!selector.includes('::')) { - return; - } - - parseSelector(selector, result, ruleNode, (selectorTree) => { - selectorTree.walkPseudos((pseudoNode) => { - const value = pseudoNode.value; - - // Ignore pseudo-classes - if (value.charAt(1) !== ':') { - return; - } - - const name = value.slice(2); - - if (!matchesStringOrRegExp(vendor.unprefixed(name), primary)) { - return; - } - - report({ - index: pseudoNode.sourceIndex, - message: messages.rejected, - messageArgs: [value], - node: ruleNode, - word: value, - result, - ruleName, - }); - }); - }); - }); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-pseudo-element-no-unknown/index.js b/node_modules/stylelint/lib/rules/selector-pseudo-element-no-unknown/index.js deleted file mode 100644 index 30a67571a..000000000 --- a/node_modules/stylelint/lib/rules/selector-pseudo-element-no-unknown/index.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const { pseudoElements } = require('../../reference/selectors'); -const optionsMatches = require('../../utils/optionsMatches'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isString, isRegExp } = require('../../utils/validateTypes'); - -const ruleName = 'selector-pseudo-element-no-unknown'; - -const messages = ruleMessages(ruleName, { - rejected: (selector) => `Unexpected unknown pseudo-element selector "${selector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-pseudo-element-no-unknown', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignorePseudoElements: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - const selector = ruleNode.selector; - - // Return early before parse if no pseudos for performance - - if (!selector.includes(':')) { - return; - } - - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - parseSelector(selector, result, ruleNode, (selectorTree) => { - selectorTree.walkPseudos((pseudoNode) => { - const value = pseudoNode.value; - - if (!isStandardSyntaxSelector(value)) { - return; - } - - // Ignore pseudo-classes - if (value.slice(0, 2) !== '::') { - return; - } - - if (optionsMatches(secondaryOptions, 'ignorePseudoElements', pseudoNode.value.slice(2))) { - return; - } - - const name = value.slice(2); - - if (vendor.prefix(name) || pseudoElements.has(name.toLowerCase())) { - return; - } - - report({ - message: messages.rejected, - messageArgs: [value], - node: ruleNode, - index: pseudoNode.sourceIndex, - ruleName, - result, - word: value, - }); - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-type-case/index.js b/node_modules/stylelint/lib/rules/selector-type-case/index.js deleted file mode 100644 index 58aa4c7e7..000000000 --- a/node_modules/stylelint/lib/rules/selector-type-case/index.js +++ /dev/null @@ -1,132 +0,0 @@ -'use strict'; - -const isKeyframeSelector = require('../../utils/isKeyframeSelector'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isStandardSyntaxTypeSelector = require('../../utils/isStandardSyntaxTypeSelector'); -const optionsMatches = require('../../utils/optionsMatches'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const { isString, isRegExp } = require('../../utils/validateTypes'); -const { mixedCaseSvgTypeSelectors } = require('../../reference/selectors'); - -const ruleName = 'selector-type-case'; - -const messages = ruleMessages(ruleName, { - expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-type-case', - fixable: true, -}; - -const STARTS_A_TAG_NAME_REGEX = /(?:[^.#[:a-zA-Z-]|^)[a-zA-Z]/; -const ANY_UPPER_CASE_REGEX = /[A-Z]/; -const ANY_LOWER_CASE_REGEX = /[a-z]/; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['lower', 'upper'], - }, - { - actual: secondaryOptions, - possible: { - ignoreTypes: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - let hasComments = ruleNode.raws.selector && ruleNode.raws.selector.raw; - const selector = hasComments ? hasComments : ruleNode.selector; - - if (!STARTS_A_TAG_NAME_REGEX.test(selector)) return; - - if (primary === 'lower' && !ANY_UPPER_CASE_REGEX.test(selector)) return; - - if (primary === 'upper' && !ANY_LOWER_CASE_REGEX.test(selector)) return; - - if (!isStandardSyntaxRule(ruleNode)) return; - - const { selectors } = ruleNode; - - if (selectors.some((s) => isKeyframeSelector(s))) { - return; - } - - parseSelector(selector, result, ruleNode, (selectorAST) => { - selectorAST.walkTags((tag) => { - if (!isStandardSyntaxTypeSelector(tag)) { - return; - } - - if (mixedCaseSvgTypeSelectors.has(tag.value)) { - return; - } - - if (optionsMatches(secondaryOptions, 'ignoreTypes', tag.value)) { - return; - } - - const sourceIndex = tag.sourceIndex; - const value = tag.value; - - const expectedValue = primary === 'lower' ? value.toLowerCase() : value.toUpperCase(); - - if (value === expectedValue) { - return; - } - - if (context.fix) { - if (hasComments) { - hasComments = - hasComments.slice(0, sourceIndex) + - expectedValue + - hasComments.slice(sourceIndex + value.length); - - if (ruleNode.raws.selector == null) { - throw new Error('The `raw` property must be present'); - } - - ruleNode.raws.selector.raw = hasComments; - } else { - ruleNode.selector = - ruleNode.selector.slice(0, sourceIndex) + - expectedValue + - ruleNode.selector.slice(sourceIndex + value.length); - } - - return; - } - - report({ - message: messages.expected, - messageArgs: [value, expectedValue], - node: ruleNode, - index: sourceIndex, - ruleName, - result, - }); - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selector-type-no-unknown/index.js b/node_modules/stylelint/lib/rules/selector-type-no-unknown/index.js deleted file mode 100644 index aa157cdde..000000000 --- a/node_modules/stylelint/lib/rules/selector-type-no-unknown/index.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -const isCustomElement = require('../../utils/isCustomElement'); -const isKeyframeSelector = require('../../utils/isKeyframeSelector'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const isStandardSyntaxTypeSelector = require('../../utils/isStandardSyntaxTypeSelector'); -const { htmlTypeSelectors } = require('../../reference/selectors'); -const mathMLTags = require('mathml-tag-names'); -const optionsMatches = require('../../utils/optionsMatches'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const svgTags = require('svg-tags'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'selector-type-no-unknown'; - -const messages = ruleMessages(ruleName, { - rejected: (selector) => `Unexpected unknown type selector "${selector}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/selector-type-no-unknown', -}; - -const STARTS_A_TAG_NAME_REGEX = /(?:[^.#[:a-zA-Z-]|^)[a-zA-Z]/; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignore: ['custom-elements', 'default-namespace'], - ignoreNamespaces: [isString, isRegExp], - ignoreTypes: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkRules((ruleNode) => { - const { selector } = ruleNode; - - if (!STARTS_A_TAG_NAME_REGEX.test(selector)) return; - - if (!isStandardSyntaxRule(ruleNode)) return; - - const { selectors } = ruleNode; - - if (selectors.some((s) => isKeyframeSelector(s))) { - return; - } - - parseSelector(selector, result, ruleNode, (selectorTree) => { - selectorTree.walkTags((tagNode) => { - if (!isStandardSyntaxTypeSelector(tagNode)) { - return; - } - - if ( - optionsMatches(secondaryOptions, 'ignore', 'custom-elements') && - isCustomElement(tagNode.value) - ) { - return; - } - - if ( - optionsMatches(secondaryOptions, 'ignore', 'default-namespace') && - !(typeof tagNode.namespace === 'string') - ) { - return; - } - - if (optionsMatches(secondaryOptions, 'ignoreNamespaces', tagNode.namespace)) { - return; - } - - if (optionsMatches(secondaryOptions, 'ignoreTypes', tagNode.value)) { - return; - } - - const tagName = tagNode.value; - const tagNameLowerCase = tagName.toLowerCase(); - - if ( - htmlTypeSelectors.has(tagNameLowerCase) || - // SVG tags are case-sensitive - svgTags.includes(tagName) || - mathMLTags.includes(tagNameLowerCase) - ) { - return; - } - - report({ - message: messages.rejected, - messageArgs: [tagName], - node: ruleNode, - index: tagNode.sourceIndex, - ruleName, - result, - word: tagName, - }); - }); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/selectorAttributeOperatorSpaceChecker.js b/node_modules/stylelint/lib/rules/selectorAttributeOperatorSpaceChecker.js deleted file mode 100644 index 25e36b2e7..000000000 --- a/node_modules/stylelint/lib/rules/selectorAttributeOperatorSpaceChecker.js +++ /dev/null @@ -1,92 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../utils/isStandardSyntaxRule'); -const parseSelector = require('../utils/parseSelector'); -const report = require('../utils/report'); -const styleSearch = require('style-search'); - -/** - * @param {{ - * root: import('postcss').Root, - * result: import('stylelint').PostcssResult, - * locationChecker: (opts: { source: string, index: number, err: (msg: string) => void }) => void, - * checkedRuleName: string, - * checkBeforeOperator: boolean, - * fix: ((attributeNode: import('postcss-selector-parser').Attribute) => boolean) | null, - * }} options - * @returns {void} - */ -module.exports = function selectorAttributeOperatorSpaceChecker(options) { - options.root.walkRules((rule) => { - if (!isStandardSyntaxRule(rule)) { - return; - } - - if (!rule.selector.includes('[') || !rule.selector.includes('=')) { - return; - } - - let hasFixed = false; - const selector = rule.raws.selector ? rule.raws.selector.raw : rule.selector; - - const fixedSelector = parseSelector(selector, options.result, rule, (selectorTree) => { - selectorTree.walkAttributes((attributeNode) => { - const operator = attributeNode.operator; - - if (!operator) { - return; - } - - const attributeNodeString = attributeNode.toString(); - - styleSearch({ source: attributeNodeString, target: operator }, (match) => { - const index = options.checkBeforeOperator ? match.startIndex : match.endIndex - 1; - - checkOperator(attributeNodeString, index, rule, attributeNode, operator); - }); - }); - }); - - if (hasFixed && fixedSelector) { - if (!rule.raws.selector) { - rule.selector = fixedSelector; - } else { - rule.raws.selector.raw = fixedSelector; - } - } - - /** - * @param {string} source - * @param {number} index - * @param {import('postcss').Node} node - * @param {import('postcss-selector-parser').Attribute} attributeNode - * @param {string} operator - */ - function checkOperator(source, index, node, attributeNode, operator) { - options.locationChecker({ - source, - index, - err: (msg) => { - if (options.fix && options.fix(attributeNode)) { - hasFixed = true; - - return; - } - - report({ - message: msg.replace( - options.checkBeforeOperator - ? operator.charAt(0) - : operator.charAt(operator.length - 1), - operator, - ), - node, - index: attributeNode.sourceIndex + index, - result: options.result, - ruleName: options.checkedRuleName, - }); - }, - }); - } - }); -}; diff --git a/node_modules/stylelint/lib/rules/selectorCombinatorSpaceChecker.js b/node_modules/stylelint/lib/rules/selectorCombinatorSpaceChecker.js deleted file mode 100644 index b8f469a84..000000000 --- a/node_modules/stylelint/lib/rules/selectorCombinatorSpaceChecker.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; - -const isStandardSyntaxCombinator = require('../utils/isStandardSyntaxCombinator'); -const isStandardSyntaxRule = require('../utils/isStandardSyntaxRule'); -const parseSelector = require('../utils/parseSelector'); -const report = require('../utils/report'); - -/** - * @typedef {(args: { source: string, index: number, errTarget: string, err: (message: string) => void }) => void} LocationChecker - * - * @param {{ - * root: import('postcss').Root, - * result: import('stylelint').PostcssResult, - * locationChecker: LocationChecker, - * locationType: 'before' | 'after', - * checkedRuleName: string, - * fix: ((combinator: import('postcss-selector-parser').Combinator) => boolean) | null, - * }} opts - * @returns {void} - */ -module.exports = function selectorCombinatorSpaceChecker(opts) { - let hasFixed; - - opts.root.walkRules((rule) => { - if (!isStandardSyntaxRule(rule)) { - return; - } - - hasFixed = false; - const selector = rule.raws.selector ? rule.raws.selector.raw : rule.selector; - - const fixedSelector = parseSelector(selector, opts.result, rule, (selectorTree) => { - selectorTree.walkCombinators((node) => { - // Ignore non-standard combinators - if (!isStandardSyntaxCombinator(node)) { - return; - } - - // Ignore spaced descendant combinator - if (/\s/.test(node.value)) { - return; - } - - // Check the exist of node in prev of the combinator. - // in case some that aren't the first begin with combinators (nesting syntax) - if (opts.locationType === 'before' && !node.prev()) { - return; - } - - const parentParentNode = node.parent && node.parent.parent; - - // Ignore pseudo-classes selector like `.foo:nth-child(2n + 1) {}` - if (parentParentNode && parentParentNode.type === 'pseudo') { - return; - } - - const sourceIndex = node.sourceIndex; - const index = - node.value.length > 1 && opts.locationType === 'before' - ? sourceIndex - : sourceIndex + node.value.length - 1; - - check(selector, node, index, rule, sourceIndex); - }); - }); - - if (hasFixed && fixedSelector) { - if (!rule.raws.selector) { - rule.selector = fixedSelector; - } else { - rule.raws.selector.raw = fixedSelector; - } - } - }); - - /** - * @param {string} source - * @param {import('postcss-selector-parser').Combinator} combinator - * @param {number} index - * @param {import('postcss').Node} node - * @param {number} sourceIndex - */ - function check(source, combinator, index, node, sourceIndex) { - opts.locationChecker({ - source, - index, - errTarget: combinator.value, - err: (message) => { - if (opts.fix && opts.fix(combinator)) { - hasFixed = true; - - return; - } - - report({ - message, - node, - index: sourceIndex, - result: opts.result, - ruleName: opts.checkedRuleName, - }); - }, - }); - } -}; diff --git a/node_modules/stylelint/lib/rules/selectorListCommaWhitespaceChecker.js b/node_modules/stylelint/lib/rules/selectorListCommaWhitespaceChecker.js deleted file mode 100644 index 432252b4e..000000000 --- a/node_modules/stylelint/lib/rules/selectorListCommaWhitespaceChecker.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -const isStandardSyntaxRule = require('../utils/isStandardSyntaxRule'); -const report = require('../utils/report'); -const styleSearch = require('style-search'); - -/** - * @param {{ - * root: import('postcss').Root, - * result: import('stylelint').PostcssResult, - * locationChecker: (opts: { source: string, index: number, err: (msg: string) => void }) => void, - * checkedRuleName: string, - * fix: ((rule: import('postcss').Rule, index: number) => boolean) | null, - * }} opts - * @returns {void} - */ -module.exports = function selectorListCommaWhitespaceChecker(opts) { - opts.root.walkRules((rule) => { - if (!isStandardSyntaxRule(rule)) { - return; - } - - const selector = rule.raws.selector ? rule.raws.selector.raw : rule.selector; - - styleSearch( - { - source: selector, - target: ',', - functionArguments: 'skip', - }, - (match) => { - checkDelimiter(selector, match.startIndex, rule); - }, - ); - }); - - /** - * @param {string} source - * @param {number} index - * @param {import('postcss').Rule} node - */ - function checkDelimiter(source, index, node) { - opts.locationChecker({ - source, - index, - err: (message) => { - if (opts.fix && opts.fix(node, index)) { - return; - } - - report({ - message, - node, - index, - result: opts.result, - ruleName: opts.checkedRuleName, - }); - }, - }); - } -}; diff --git a/node_modules/stylelint/lib/rules/shorthand-property-no-redundant-values/index.js b/node_modules/stylelint/lib/rules/shorthand-property-no-redundant-values/index.js deleted file mode 100644 index 4cde984f6..000000000 --- a/node_modules/stylelint/lib/rules/shorthand-property-no-redundant-values/index.js +++ /dev/null @@ -1,185 +0,0 @@ -'use strict'; - -const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); -const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); -const vendor = require('../../utils/vendor'); - -const ruleName = 'shorthand-property-no-redundant-values'; - -const messages = ruleMessages(ruleName, { - rejected: (unexpected, expected) => `Expected "${unexpected}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/shorthand-property-no-redundant-values', - fixable: true, -}; - -const propertiesWithShorthandNotation = new Set([ - 'margin', - 'padding', - 'border-color', - 'border-radius', - 'border-style', - 'border-width', - 'grid-gap', - 'inset', -]); - -const ignoredCharacters = ['+', '*', '/', '(', ')', '$', '@', '--', 'var(']; - -/** - * @param {string} value - * @returns {boolean} - */ -function hasIgnoredCharacters(value) { - return ignoredCharacters.some((char) => value.includes(char)); -} - -/** - * @param {string} property - * @returns {boolean} - */ -function isShorthandProperty(property) { - return propertiesWithShorthandNotation.has(property); -} - -/** - * @param {string} top - * @param {string} right - * @param {string} bottom - * @param {string} left - * @returns {string[]} - */ -function canCondense(top, right, bottom, left) { - const lowerTop = top.toLowerCase(); - const lowerRight = right.toLowerCase(); - const lowerBottom = bottom && bottom.toLowerCase(); - const lowerLeft = left && left.toLowerCase(); - - if (canCondenseToOneValue(lowerTop, lowerRight, lowerBottom, lowerLeft)) { - return [top]; - } - - if (canCondenseToTwoValues(lowerTop, lowerRight, lowerBottom, lowerLeft)) { - return [top, right]; - } - - if (canCondenseToThreeValues(lowerTop, lowerRight, lowerBottom, lowerLeft)) { - return [top, right, bottom]; - } - - return [top, right, bottom, left]; -} - -/** - * @param {string} top - * @param {string} right - * @param {string} bottom - * @param {string} left - * @returns {boolean} - */ -function canCondenseToOneValue(top, right, bottom, left) { - if (top !== right) { - return false; - } - - return (top === bottom && (bottom === left || !left)) || (!bottom && !left); -} - -/** - * @param {string} top - * @param {string} right - * @param {string} bottom - * @param {string} left - * @returns {boolean} - */ -function canCondenseToTwoValues(top, right, bottom, left) { - return (top === bottom && right === left) || (top === bottom && !left && top !== right); -} - -/** - * @param {string} _top - * @param {string} right - * @param {string} _bottom - * @param {string} left - * @returns {boolean} - */ -function canCondenseToThreeValues(_top, right, _bottom, left) { - return right === left; -} - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - if (!isStandardSyntaxDeclaration(decl) || !isStandardSyntaxProperty(decl.prop)) { - return; - } - - const prop = decl.prop; - const value = decl.value; - - const normalizedProp = vendor.unprefixed(prop.toLowerCase()); - - if (hasIgnoredCharacters(value) || !isShorthandProperty(normalizedProp)) { - return; - } - - /** @type {string[]} */ - const valuesToShorthand = []; - - valueParser(value).walk((valueNode) => { - if (valueNode.type !== 'word') { - return; - } - - valuesToShorthand.push(valueParser.stringify(valueNode)); - }); - - if (valuesToShorthand.length <= 1 || valuesToShorthand.length > 4) { - return; - } - - const shortestForm = canCondense( - valuesToShorthand[0] || '', - valuesToShorthand[1] || '', - valuesToShorthand[2] || '', - valuesToShorthand[3] || '', - ); - const shortestFormString = shortestForm.filter(Boolean).join(' '); - const valuesFormString = valuesToShorthand.join(' '); - - if (shortestFormString.toLowerCase() === valuesFormString.toLowerCase()) { - return; - } - - if (context.fix) { - decl.value = decl.value.replace(value, shortestFormString); - } else { - report({ - message: messages.rejected, - messageArgs: [value, shortestFormString], - node: decl, - result, - ruleName, - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/string-no-newline/index.js b/node_modules/stylelint/lib/rules/string-no-newline/index.js deleted file mode 100644 index 30c4fe087..000000000 --- a/node_modules/stylelint/lib/rules/string-no-newline/index.js +++ /dev/null @@ -1,134 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const isStandardSyntaxSelector = require('../../utils/isStandardSyntaxSelector'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); - -const ruleName = 'string-no-newline'; -const reNewLine = /\r?\n/; - -const messages = ruleMessages(ruleName, { - rejected: 'Unexpected newline in string', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/string-no-newline', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { actual: primary }); - - if (!validOptions) { - return; - } - - root.walk((node) => { - switch (node.type) { - case 'atrule': - checkDeclOrAtRule(node, node.params, atRuleParamIndex); - break; - case 'decl': - checkDeclOrAtRule(node, node.value, declarationValueIndex); - break; - case 'rule': - checkRule(node); - break; - } - }); - - /** - * @param {import('postcss').Rule} ruleNode - * @returns {void} - */ - function checkRule(ruleNode) { - // Get out quickly if there are no new line - if (!reNewLine.test(ruleNode.selector)) { - return; - } - - if (!isStandardSyntaxSelector(ruleNode.selector)) { - return; - } - - parseSelector(ruleNode.selector, result, ruleNode, (selectorTree) => { - selectorTree.walkAttributes((attributeNode) => { - const { value, quoteMark } = attributeNode; - - if (!value || !reNewLine.test(value)) { - return; - } - - const openIndex = [ - // length of our attribute - attributeNode.attribute, - // length of our operator , ie '=' - attributeNode.operator || '', - ].reduce( - (index, str) => index + str.length, - // index of the start of our attribute node in our source - // plus 1 for the opening quotation mark - attributeNode.sourceIndex + 1, - ); - - const valueLength = value.length + (quoteMark || '').length * 2; - - report({ - message: messages.rejected, - node: ruleNode, - index: openIndex, - endIndex: openIndex + valueLength, - result, - ruleName, - }); - }); - }); - } - - /** - * @template {import('postcss').AtRule | import('postcss').Declaration} T - * @param {T} node - * @param {string} value - * @param {(node: T) => number} getIndex - * @returns {void} - */ - function checkDeclOrAtRule(node, value, getIndex) { - // Get out quickly if there are no new line - if (!reNewLine.test(value)) { - return; - } - - valueParser(value).walk((valueNode) => { - if (valueNode.type !== 'string') { - return; - } - - if (!reNewLine.test(valueNode.value)) { - return; - } - - const nodeIndex = getIndex(node); - - report({ - message: messages.rejected, - node, - index: nodeIndex + valueNode.sourceIndex, - endIndex: nodeIndex + valueNode.sourceEndIndex, - result, - ruleName, - }); - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/string-quotes/index.js b/node_modules/stylelint/lib/rules/string-quotes/index.js deleted file mode 100644 index 806969957..000000000 --- a/node_modules/stylelint/lib/rules/string-quotes/index.js +++ /dev/null @@ -1,250 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const isStandardSyntaxRule = require('../../utils/isStandardSyntaxRule'); -const parseSelector = require('../../utils/parseSelector'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); -const { isBoolean, assertString } = require('../../utils/validateTypes'); -const { isAtRule } = require('../../utils/typeGuards'); - -const ruleName = 'string-quotes'; - -const messages = ruleMessages(ruleName, { - expected: (q) => `Expected ${q} quotes`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/string-quotes', - fixable: true, - deprecated: true, -}; - -const singleQuote = `'`; -const doubleQuote = `"`; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - const correctQuote = primary === 'single' ? singleQuote : doubleQuote; - const erroneousQuote = primary === 'single' ? doubleQuote : singleQuote; - - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['single', 'double'], - }, - { - actual: secondaryOptions, - possible: { - avoidEscape: [isBoolean], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const avoidEscape = - secondaryOptions && secondaryOptions.avoidEscape !== undefined - ? secondaryOptions.avoidEscape - : true; - - root.walk((node) => { - switch (node.type) { - case 'atrule': - checkDeclOrAtRule(node, node.params, atRuleParamIndex); - break; - case 'decl': - checkDeclOrAtRule(node, node.value, declarationValueIndex); - break; - case 'rule': - checkRule(node); - break; - } - }); - - /** - * @param {import('postcss').Rule} ruleNode - * @returns {void} - */ - function checkRule(ruleNode) { - if (!isStandardSyntaxRule(ruleNode)) { - return; - } - - if (!ruleNode.selector.includes('[') || !ruleNode.selector.includes('=')) { - return; - } - - /** @type {number[]} */ - const fixPositions = []; - - parseSelector(ruleNode.selector, result, ruleNode, (selectorTree) => { - let selectorFixed = false; - - selectorTree.walkAttributes((attributeNode) => { - if (!attributeNode.quoted) { - return; - } - - if (attributeNode.quoteMark === correctQuote && avoidEscape) { - assertString(attributeNode.value); - const needsCorrectEscape = attributeNode.value.includes(correctQuote); - const needsOtherEscape = attributeNode.value.includes(erroneousQuote); - - if (needsOtherEscape) { - return; - } - - if (needsCorrectEscape) { - if (context.fix) { - selectorFixed = true; - attributeNode.quoteMark = erroneousQuote; - } else { - report({ - message: messages.expected(primary === 'single' ? 'double' : primary), - node: ruleNode, - index: attributeNode.sourceIndex + attributeNode.offsetOf('value'), - result, - ruleName, - }); - } - } - } - - if (attributeNode.quoteMark === erroneousQuote) { - if (avoidEscape) { - assertString(attributeNode.value); - const needsCorrectEscape = attributeNode.value.includes(correctQuote); - const needsOtherEscape = attributeNode.value.includes(erroneousQuote); - - if (needsOtherEscape) { - if (context.fix) { - selectorFixed = true; - attributeNode.quoteMark = correctQuote; - } else { - report({ - message: messages.expected(primary), - node: ruleNode, - index: attributeNode.sourceIndex + attributeNode.offsetOf('value'), - result, - ruleName, - }); - } - - return; - } - - if (needsCorrectEscape) { - return; - } - } - - if (context.fix) { - selectorFixed = true; - attributeNode.quoteMark = correctQuote; - } else { - report({ - message: messages.expected(primary), - node: ruleNode, - index: attributeNode.sourceIndex + attributeNode.offsetOf('value'), - result, - ruleName, - }); - } - } - }); - - if (selectorFixed) { - ruleNode.selector = selectorTree.toString(); - } - }); - - for (const fixIndex of fixPositions) { - ruleNode.selector = replaceQuote(ruleNode.selector, fixIndex, correctQuote); - } - } - - /** - * @template {import('postcss').AtRule | import('postcss').Declaration} T - * @param {T} node - * @param {string} value - * @param {(node: T) => number} getIndex - * @returns {void} - */ - function checkDeclOrAtRule(node, value, getIndex) { - /** @type {number[]} */ - const fixPositions = []; - - // Get out quickly if there are no erroneous quotes - if (!value.includes(erroneousQuote)) { - return; - } - - if (isAtRule(node) && node.name === 'charset') { - // allow @charset rules to have double quotes, in spite of the configuration - // TODO: @charset should always use double-quotes, see https://github.com/stylelint/stylelint/issues/2788 - return; - } - - valueParser(value).walk((valueNode) => { - if (valueNode.type === 'string' && valueNode.quote === erroneousQuote) { - const needsEscape = valueNode.value.includes(correctQuote); - - if (avoidEscape && needsEscape) { - // don't consider this an error - return; - } - - const openIndex = valueNode.sourceIndex; - - // we currently don't fix escapes - if (context.fix && !needsEscape) { - const closeIndex = openIndex + valueNode.value.length + erroneousQuote.length; - - fixPositions.push(openIndex, closeIndex); - } else { - report({ - message: messages.expected(primary), - node, - index: getIndex(node) + openIndex, - result, - ruleName, - }); - } - } - }); - - for (const fixIndex of fixPositions) { - if (isAtRule(node)) { - node.params = replaceQuote(node.params, fixIndex, correctQuote); - } else { - node.value = replaceQuote(node.value, fixIndex, correctQuote); - } - } - } - }; -}; - -/** - * @param {string} string - * @param {number} index - * @param {string} replace - * @returns {string} - */ -function replaceQuote(string, index, replace) { - return string.substring(0, index) + replace + string.substring(index + replace.length); -} - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/time-min-milliseconds/index.js b/node_modules/stylelint/lib/rules/time-min-milliseconds/index.js deleted file mode 100644 index 4a73b4f40..000000000 --- a/node_modules/stylelint/lib/rules/time-min-milliseconds/index.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const { longhandTimeProperties, shorthandTimeProperties } = require('../../reference/properties'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); -const vendor = require('../../utils/vendor'); -const { isNumber } = require('../../utils/validateTypes'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const getDimension = require('../../utils/getDimension'); - -const ruleName = 'time-min-milliseconds'; - -const messages = ruleMessages(ruleName, { - expected: (time) => `Expected a minimum of ${time} milliseconds`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/time-min-milliseconds', -}; - -const DELAY_PROPERTIES = new Set(['animation-delay', 'transition-delay']); - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: isNumber, - }, - { - actual: secondaryOptions, - possible: { - ignore: ['delay'], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - const minimum = primary; - const ignoreDelay = optionsMatches(secondaryOptions, 'ignore', 'delay'); - - root.walkDecls((decl) => { - const propertyName = vendor.unprefixed(decl.prop.toLowerCase()); - const propertyValue = decl.value; - const parsedValue = valueParser(getDeclarationValue(decl)); - let timeValueCount = 0; - - parsedValue.walk((node) => { - const { value, sourceIndex } = node; - const dimension = getDimension(node); - - if ( - longhandTimeProperties.has(propertyName) && - !isIgnoredProperty(propertyName) && - !isAcceptableTime(dimension) - ) { - complain(decl, 0, propertyValue.length); - } - - if (!shorthandTimeProperties.has(propertyName)) return; - - timeValueCount = calcTimeValueCount(dimension, value, timeValueCount); - - if (isAcceptableTime(dimension) || (ignoreDelay && timeValueCount !== 1)) return; - - complain(decl, sourceIndex, value.length); - }); - }); - - /** - * @param {{unit: string | null, number: string | null}} dimension - * @param {string} value - * @param {number} valueTimeCount - * @returns {number} - */ - function calcTimeValueCount(dimension, value, valueTimeCount) { - const { unit } = dimension; - - if (unit !== null) valueTimeCount++; - - if (value === ',') valueTimeCount = 0; - - return valueTimeCount; - } - - /** - * @param {string} propertyName - * @returns {boolean} - */ - function isIgnoredProperty(propertyName) { - if (ignoreDelay && DELAY_PROPERTIES.has(propertyName)) { - return true; - } - - return false; - } - - /** - * @param {import('postcss-value-parser').Dimension | {unit: null, number: null}} dimension - * @returns {boolean} - */ - function isAcceptableTime(dimension) { - const { unit, number } = dimension; - - if (unit === null || number === null) return true; - - const numTime = Number(number); - - if (numTime <= 0) { - return true; - } - - const timeUnit = unit.toLowerCase(); - - if (timeUnit === 'ms' && numTime < minimum) { - return false; - } - - if (timeUnit === 's' && numTime * 1000 < minimum) { - return false; - } - - return true; - } - - /** - * @param {import('postcss').Declaration} decl - * @param {number} offset - * @param {number} length - * @returns {void} - */ - function complain(decl, offset, length) { - const index = declarationValueIndex(decl) + offset; - const endIndex = index + length; - - report({ - result, - ruleName, - message: messages.expected, - messageArgs: [minimum], - index, - endIndex, - node: decl, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/unicode-bom/index.js b/node_modules/stylelint/lib/rules/unicode-bom/index.js deleted file mode 100644 index 94063cab9..000000000 --- a/node_modules/stylelint/lib/rules/unicode-bom/index.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); - -const ruleName = 'unicode-bom'; - -const messages = ruleMessages(ruleName, { - expected: 'Expected Unicode BOM', - rejected: 'Unexpected Unicode BOM', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/unicode-bom', - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never'], - }); - - if ( - !validOptions || - !root.source || - // @ts-expect-error -- TS2339: Property 'inline' does not exist on type 'Source'. - root.source.inline || - // @ts-expect-error -- TS2339: Property 'lang' does not exist on type 'Source'. - root.source.lang === 'object-literal' || - // Ignore HTML documents - // @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Root'. - root.document !== undefined - ) { - return; - } - - const { hasBOM } = root.source.input; - - if (primary === 'always' && !hasBOM) { - report({ - result, - ruleName, - message: messages.expected, - node: root, - line: 1, - }); - } - - if (primary === 'never' && hasBOM) { - report({ - result, - ruleName, - message: messages.rejected, - node: root, - line: 1, - }); - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/unit-allowed-list/index.js b/node_modules/stylelint/lib/rules/unit-allowed-list/index.js deleted file mode 100644 index 88e5262d6..000000000 --- a/node_modules/stylelint/lib/rules/unit-allowed-list/index.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDimension = require('../../utils/getDimension'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); -const { isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'unit-allowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (unit) => `Unexpected unit "${unit}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/unit-allowed-list', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [isString], - }, - { - optional: true, - actual: secondaryOptions, - possible: { - ignoreFunctions: [isString, isRegExp], - ignoreProperties: [validateObjectWithArrayProps(isString, isRegExp)], - }, - }, - ); - - if (!validOptions) { - return; - } - - const primaryValues = [primary].flat(); - - /** - * @template {import('postcss').AtRule | import('postcss').Declaration} T - * @param {T} node - * @param {string} value - * @param {(node: T) => number} getIndex - * @returns {void} - */ - function check(node, value, getIndex) { - // make sure multiplication operations (*) are divided - not handled - // by postcss-value-parser - value = value.replace(/\*/g, ','); - valueParser(value).walk((valueNode) => { - if (valueNode.type === 'function') { - const valueLowerCase = valueNode.value.toLowerCase(); - - // Ignore wrong units within `url` function - if (valueLowerCase === 'url') { - return false; - } - - if (optionsMatches(secondaryOptions, 'ignoreFunctions', valueLowerCase)) { - return false; - } - } - - const { number, unit } = getDimension(valueNode); - - if (!number || !unit || primaryValues.includes(unit.toLowerCase())) { - return; - } - - if ( - 'prop' in node && - secondaryOptions && - optionsMatches(secondaryOptions.ignoreProperties, unit.toLowerCase(), node.prop) - ) { - return; - } - - const index = getIndex(node); - - report({ - index: index + valueNode.sourceIndex + number.length, - endIndex: index + valueNode.sourceEndIndex, - message: messages.rejected, - messageArgs: [unit], - node, - result, - ruleName, - }); - }); - } - - root.walkAtRules(/^media$/i, (atRule) => check(atRule, atRule.params, atRuleParamIndex)); - root.walkDecls((decl) => check(decl, decl.value, declarationValueIndex)); - }; -}; - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/unit-case/index.js b/node_modules/stylelint/lib/rules/unit-case/index.js deleted file mode 100644 index 640383b5b..000000000 --- a/node_modules/stylelint/lib/rules/unit-case/index.js +++ /dev/null @@ -1,134 +0,0 @@ -'use strict'; - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDimension = require('../../utils/getDimension'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); - -const ruleName = 'unit-case'; - -const messages = ruleMessages(ruleName, { - expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/unit-case', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['lower', 'upper'], - }); - - if (!validOptions) { - return; - } - - /** - * @template {import('postcss').AtRule | import('postcss').Declaration} T - * @param {T} node - * @param {string} checkedValue - * @param {(node: T) => number} getIndex - * @returns {void} - */ - function check(node, checkedValue, getIndex) { - /** @type {Array<{ index: number, endIndex: number, message: string }>} */ - const problems = []; - - /** - * @param {import('postcss-value-parser').Node} valueNode - * @returns {boolean} - */ - function processValue(valueNode) { - const { number, unit } = getDimension(valueNode); - - if (!number || !unit) return false; - - const expectedUnit = primary === 'lower' ? unit.toLowerCase() : unit.toUpperCase(); - - if (unit === expectedUnit) { - return false; - } - - const index = getIndex(node); - - problems.push({ - index: index + valueNode.sourceIndex + number.length, - endIndex: index + valueNode.sourceEndIndex, - message: messages.expected(unit, expectedUnit), - }); - - return true; - } - - const parsedValue = valueParser(checkedValue).walk((valueNode) => { - // Ignore wrong units within `url` function - let needFix = false; - const value = valueNode.value; - - if (valueNode.type === 'function' && value.toLowerCase() === 'url') { - return false; - } - - if (value.includes('*')) { - value.split('*').some((val) => { - return processValue({ - ...valueNode, - sourceIndex: value.indexOf(val) + val.length + 1, - value: val, - }); - }); - } - - needFix = processValue(valueNode); - - if (needFix && context.fix) { - valueNode.value = primary === 'lower' ? value.toLowerCase() : value.toUpperCase(); - } - }); - - if (problems.length) { - if (context.fix) { - if ('name' in node && node.name === 'media') { - node.params = parsedValue.toString(); - } else if ('value' in node) { - node.value = parsedValue.toString(); - } - } else { - for (const err of problems) { - report({ - index: err.index, - endIndex: err.endIndex, - message: err.message, - node, - result, - ruleName, - }); - } - } - } - } - - root.walkAtRules((atRule) => { - if (!/^media$/i.test(atRule.name) && !('variable' in atRule)) { - return; - } - - check(atRule, atRule.params, atRuleParamIndex); - }); - root.walkDecls((decl) => check(decl, decl.value, declarationValueIndex)); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/unit-disallowed-list/index.js b/node_modules/stylelint/lib/rules/unit-disallowed-list/index.js deleted file mode 100644 index 602eb7d4c..000000000 --- a/node_modules/stylelint/lib/rules/unit-disallowed-list/index.js +++ /dev/null @@ -1,226 +0,0 @@ -'use strict'; - -const { TokenType, tokenize, NumberType } = require('@csstools/css-tokenizer'); -const { - isFunctionNode, - isSimpleBlockNode, - isTokenNode, - parseListOfComponentValues, -} = require('@csstools/css-parser-algorithms'); -const { parseFromTokens, isMediaFeature } = require('@csstools/media-query-list-parser'); - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getAtRuleParams = require('../../utils/getAtRuleParams'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const hasDimension = require('../../utils/hasDimension'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateObjectWithArrayProps = require('../../utils/validateObjectWithArrayProps'); -const validateOptions = require('../../utils/validateOptions'); -const { isRegExp, isString } = require('../../utils/validateTypes'); -const isUnicodeRangeDescriptor = require('../../utils/isUnicodeRangeDescriptor'); - -const ruleName = 'unit-disallowed-list'; - -const messages = ruleMessages(ruleName, { - rejected: (unit) => `Unexpected unit "${unit}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/unit-disallowed-list', -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: [isString], - }, - { - optional: true, - actual: secondaryOptions, - possible: { - ignoreFunctions: [isString, isRegExp], - ignoreProperties: [validateObjectWithArrayProps(isString, isRegExp)], - ignoreMediaFeatureNames: [validateObjectWithArrayProps(isString, isRegExp)], - }, - }, - ); - - if (!validOptions) { - return; - } - - const primaryValues = [primary].flat(); - - /** - * Ignore wrong units within `url` function - * Ignore units within function that match `ignoreFunctions` option - * - * @param {import('@csstools/css-parser-algorithms').ComponentValue} componentValue - * @returns {boolean} - */ - function componentValueIsIgnored(componentValue) { - if (!isFunctionNode(componentValue)) { - return false; - } - - const name = componentValue.getName().toLowerCase(); - - return name === 'url' || optionsMatches(secondaryOptions, 'ignoreFunctions', name); - } - - /** - * @template {import('postcss').AtRule | import('postcss').Declaration} T - * @param {T} node - * @param {(node: T) => number} getIndex - * @param {import('@csstools/css-parser-algorithms').ComponentValue} componentValue - * @param {string} input - * @param {Record | undefined} options - * @returns {void} - */ - function check(node, getIndex, componentValue, input, options) { - if (!isTokenNode(componentValue)) return; - - if (componentValue.value[0] !== TokenType.Dimension) return; - - const [, , , endIndex, { unit }] = componentValue.value; - - const lowerCaseUnit = unit.toLowerCase(); - - if (!primaryValues.includes(lowerCaseUnit)) { - return; - } - - // The unit has an ignore option for the specific input - if (options && optionsMatches(options, lowerCaseUnit, input)) return; - - const startIndex = getIndex(node) + (endIndex + 1) - unit.length; - - report({ - index: startIndex, - endIndex: startIndex + unit.length, - message: messages.rejected, - messageArgs: [unit], - node, - result, - ruleName, - }); - } - - root.walkAtRules(/^media$/i, (atRule) => { - const params = getAtRuleParams(atRule); - - if (!hasDimension(params)) return; - - parseFromTokens(tokenizeWithoutPercentages(params)).forEach((mediaQuery) => { - /** @type {{ mediaFeatureName: string | undefined }} */ - const initialState = { - mediaFeatureName: undefined, - }; - - mediaQuery.walk(({ node, state }) => { - if (!state) return; - - if (isMediaFeature(node)) { - state.mediaFeatureName = node.getName().toLowerCase(); - } - - if (!state.mediaFeatureName) return; - - if (!isTokenNode(node)) return; - - check( - atRule, - atRuleParamIndex, - node, - state.mediaFeatureName, - secondaryOptions?.ignoreMediaFeatureNames, - ); - }, initialState); - }); - }); - - root.walkDecls((decl) => { - if (isUnicodeRangeDescriptor(decl)) return; - - const value = getDeclarationValue(decl); - - if (!hasDimension(value)) return; - - parseListOfComponentValues(tokenizeWithoutPercentages(value)).forEach((componentValue) => { - if (isTokenNode(componentValue)) { - check( - decl, - declarationValueIndex, - componentValue, - decl.prop, - secondaryOptions?.ignoreProperties, - ); - - return; - } - - if (!isFunctionNode(componentValue) && !isSimpleBlockNode(componentValue)) return; - - const initialState = { - ignored: componentValueIsIgnored(componentValue), - }; - - componentValue.walk(({ node, state }) => { - if (!state) return; - - if (state.ignored) return; - - if (isTokenNode(node)) { - check(decl, declarationValueIndex, node, decl.prop, secondaryOptions?.ignoreProperties); - - return; - } - - if (componentValueIsIgnored(node)) { - state.ignored = true; - } - }, initialState); - }); - }); - }; -}; - -/** - * In the CSS syntax percentages are a different token type than dimensions. - * For CSS authors however this distinction doesn't make sense, so we convert - * percentage tokens to dimension tokens with a unit of "%". - * - * Percentage tokens also aren't valid in media queries. - * Converting percentage tokens to dimension tokens simplifies any code checking for units. - * - * @param {string} css - * @returns {Array} - */ -function tokenizeWithoutPercentages(css) { - return tokenize({ css }).map((x) => { - if (x[0] !== TokenType.Percentage) return x; - - return [ - TokenType.Dimension, - x[1], - x[2], - x[3], - { value: x[4].value, unit: '%', type: NumberType.Number }, - ]; - }); -} - -rule.primaryOptionArray = true; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/unit-no-unknown/index.js b/node_modules/stylelint/lib/rules/unit-no-unknown/index.js deleted file mode 100644 index b85252768..000000000 --- a/node_modules/stylelint/lib/rules/unit-no-unknown/index.js +++ /dev/null @@ -1,214 +0,0 @@ -'use strict'; - -const { tokenize, TokenType } = require('@csstools/css-tokenizer'); -const { - isFunctionNode, - isSimpleBlockNode, - isTokenNode, - parseListOfComponentValues, -} = require('@csstools/css-parser-algorithms'); -const { isMediaFeature, parseFromTokens } = require('@csstools/media-query-list-parser'); - -const atRuleParamIndex = require('../../utils/atRuleParamIndex'); -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getAtRuleParams = require('../../utils/getAtRuleParams'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const hasDimension = require('../../utils/hasDimension'); -const isStandardSyntaxAtRule = require('../../utils/isStandardSyntaxAtRule'); -const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const isUnicodeRangeDescriptor = require('../../utils/isUnicodeRangeDescriptor'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isRegExp, isString } = require('../../utils/validateTypes'); -const units = new Set(require('../../reference/units').units); // a copy that is safe to mutate - -// `x` as a resolution unit is very often a typo for `px`. -// By removing it from the set of known units, we can catch those typos. -// Intentional `x` units are supported by manually checking these in specific functions or properties. -units.delete('x'); - -const ruleName = 'unit-no-unknown'; - -const messages = ruleMessages(ruleName, { - rejected: (unit) => `Unexpected unknown unit "${unit}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/unit-no-unknown', -}; - -const RESOLUTION_MEDIA_FEATURE_NAME = /^(?:min-|max-)?resolution$/i; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - actual: secondaryOptions, - possible: { - ignoreUnits: [isString, isRegExp], - ignoreFunctions: [isString, isRegExp], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - /** - * @param {string} value - */ - const tokenizeIfValueMightContainUnknownUnits = (value) => { - if (!hasDimension(value)) return; - - const tokens = tokenize({ css: value }); - const hasUnknownUnits = tokens.some((token) => { - return token[0] === TokenType.Dimension && !units.has(token[4].unit.toLowerCase()); - }); - - if (!hasUnknownUnits) return; - - return tokens; - }; - - /** - * @template {import('postcss').AtRule | import('postcss').Declaration} T - * @param {T} node - * @param {(node: T) => number} getIndex - * @param {import('@csstools/css-parser-algorithms').FunctionNode | import('@csstools/css-parser-algorithms').TokenNode} componentValue - * @param {{ ignored: boolean, allowX: boolean }} state - */ - const check = (node, getIndex, componentValue, state) => { - if (isFunctionNode(componentValue)) { - const name = componentValue.getName(); - const nameLowerCase = name.toLowerCase(); - - if (nameLowerCase === 'url' || optionsMatches(secondaryOptions, 'ignoreFunctions', name)) { - state.ignored = true; - - return; - } - - if (vendor.unprefixed(nameLowerCase) === 'image-set') { - state.allowX = true; - - return; - } - - return; - } - - const [tokenType, , , endIndex, tokenValue] = componentValue.value; - - if (tokenType !== TokenType.Dimension) return; - - if (optionsMatches(secondaryOptions, 'ignoreUnits', tokenValue.unit)) return; - - const unit = tokenValue.unit.toLowerCase(); - - if (unit === 'x' && state.allowX) return; - - if (units.has(unit) && unit !== 'x') return; - - const startIndex = getIndex(node) + (endIndex + 1) - unit.length; - - report({ - message: messages.rejected, - messageArgs: [tokenValue.unit], - node, - index: startIndex, - endIndex: startIndex + unit.length, - result, - ruleName, - }); - }; - - root.walkAtRules(/^media$/i, (atRule) => { - if (!isStandardSyntaxAtRule(atRule)) return; - - const params = getAtRuleParams(atRule); - - const tokens = tokenizeIfValueMightContainUnknownUnits(params); - - if (!tokens) return; - - parseFromTokens(tokens).forEach((mediaQuery) => { - const initialState = { - ignored: false, - allowX: false, - }; - - mediaQuery.walk(({ node, state }) => { - if (!state) return; - - if (state.ignored) return; - - if (isMediaFeature(node)) { - const name = node.getName(); - - if (RESOLUTION_MEDIA_FEATURE_NAME.test(name)) { - state.allowX = true; - } - } else if (isFunctionNode(node) || isTokenNode(node)) { - check(atRule, atRuleParamIndex, node, state); - } - }, initialState); - }); - }); - - root.walkDecls((decl) => { - if (!isStandardSyntaxDeclaration(decl)) return; - - if (isUnicodeRangeDescriptor(decl)) return; - - const value = getDeclarationValue(decl); - - if (!isStandardSyntaxValue(value)) return; - - const tokens = tokenizeIfValueMightContainUnknownUnits(value); - - if (!tokens) return; - - const isImageResolutionProp = decl.prop.toLowerCase() === 'image-resolution'; - - parseListOfComponentValues(tokens).forEach((componentValue) => { - const initialState = { - ignored: false, - allowX: isImageResolutionProp, - }; - - if (isFunctionNode(componentValue) || isTokenNode(componentValue)) { - check(decl, declarationValueIndex, componentValue, initialState); - } - - if (!isFunctionNode(componentValue) && !isSimpleBlockNode(componentValue)) { - return; - } - - componentValue.walk(({ node, state }) => { - if (!state) return; - - if (state.ignored) return; - - if (isFunctionNode(node) || isTokenNode(node)) { - check(decl, declarationValueIndex, node, state); - } - }, initialState); - }); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-keyword-case/index.js b/node_modules/stylelint/lib/rules/value-keyword-case/index.js deleted file mode 100644 index 43e11633f..000000000 --- a/node_modules/stylelint/lib/rules/value-keyword-case/index.js +++ /dev/null @@ -1,248 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const getDimension = require('../../utils/getDimension'); -const isCounterIncrementCustomIdentValue = require('../../utils/isCounterIncrementCustomIdentValue'); -const isCounterResetCustomIdentValue = require('../../utils/isCounterResetCustomIdentValue'); -const isStandardSyntaxValue = require('../../utils/isStandardSyntaxValue'); -const { - animationNameKeywords, - animationShorthandKeywords, - camelCaseKeywords, - fontFamilyKeywords, - fontShorthandKeywords, - gridAreaKeywords, - gridColumnKeywords, - gridRowKeywords, - listStyleShorthandKeywords, - listStyleTypeKeywords, - systemColorsKeywords, -} = require('../../reference/keywords'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueParser = require('postcss-value-parser'); -const { isBoolean, isRegExp, isString } = require('../../utils/validateTypes'); - -const ruleName = 'value-keyword-case'; - -const messages = ruleMessages(ruleName, { - expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/value-keyword-case', - fixable: true, -}; - -// Operators are interpreted as "words" by the value parser, so we want to make sure to ignore them. -const ignoredCharacters = new Set(['+', '-', '/', '*', '%']); -const gridRowProps = new Set(['grid-row', 'grid-row-start', 'grid-row-end']); -const gridColumnProps = new Set(['grid-column', 'grid-column-start', 'grid-column-end']); - -const mapLowercaseKeywordsToCamelCase = new Map(); - -for (const func of camelCaseKeywords) { - mapLowercaseKeywordsToCamelCase.set(func.toLowerCase(), func); -} - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { - actual: primary, - possible: ['lower', 'upper'], - }, - { - actual: secondaryOptions, - possible: { - ignoreProperties: [isString, isRegExp], - ignoreKeywords: [isString, isRegExp], - ignoreFunctions: [isString, isRegExp], - camelCaseSvgKeywords: [isBoolean], - }, - optional: true, - }, - ); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - const prop = decl.prop; - const propLowerCase = decl.prop.toLowerCase(); - const value = decl.value; - - if (!isStandardSyntaxValue(value)) return; - - const parsed = valueParser(getDeclarationValue(decl)); - - let needFix = false; - - parsed.walk((node) => { - const keyword = node.value; - const valueLowerCase = keyword.toLowerCase(); - - // Ignore system colors - if (systemColorsKeywords.has(valueLowerCase)) { - return; - } - - // Ignore keywords within `url` and `var` function - if ( - node.type === 'function' && - (valueLowerCase === 'url' || - valueLowerCase === 'var' || - valueLowerCase === 'counter' || - valueLowerCase === 'counters' || - valueLowerCase === 'attr') - ) { - return false; - } - - // ignore keywords within ignoreFunctions functions - - if ( - node.type === 'function' && - optionsMatches(secondaryOptions, 'ignoreFunctions', keyword) - ) { - return false; - } - - const { unit } = getDimension(node); - - // Ignore css variables, and hex values, and math operators, and sass interpolation - if ( - node.type !== 'word' || - !isStandardSyntaxValue(keyword) || - value.includes('#') || - ignoredCharacters.has(keyword) || - unit - ) { - return; - } - - if ( - propLowerCase === 'animation' && - !animationShorthandKeywords.has(valueLowerCase) && - !animationNameKeywords.has(valueLowerCase) - ) { - return; - } - - if (propLowerCase === 'animation-name' && !animationNameKeywords.has(valueLowerCase)) { - return; - } - - if ( - propLowerCase === 'font' && - !fontShorthandKeywords.has(valueLowerCase) && - !fontFamilyKeywords.has(valueLowerCase) - ) { - return; - } - - if (propLowerCase === 'font-family' && !fontFamilyKeywords.has(valueLowerCase)) { - return; - } - - if ( - propLowerCase === 'counter-increment' && - isCounterIncrementCustomIdentValue(valueLowerCase) - ) { - return; - } - - if (propLowerCase === 'counter-reset' && isCounterResetCustomIdentValue(valueLowerCase)) { - return; - } - - if (gridRowProps.has(propLowerCase) && !gridRowKeywords.has(valueLowerCase)) { - return; - } - - if (gridColumnProps.has(propLowerCase) && !gridColumnKeywords.has(valueLowerCase)) { - return; - } - - if (propLowerCase === 'grid-area' && !gridAreaKeywords.has(valueLowerCase)) { - return; - } - - if ( - propLowerCase === 'list-style' && - !listStyleShorthandKeywords.has(valueLowerCase) && - !listStyleTypeKeywords.has(valueLowerCase) - ) { - return; - } - - if (propLowerCase === 'list-style-type' && !listStyleTypeKeywords.has(valueLowerCase)) { - return; - } - - if (optionsMatches(secondaryOptions, 'ignoreKeywords', keyword)) { - return; - } - - if (optionsMatches(secondaryOptions, 'ignoreProperties', prop)) { - return; - } - - const keywordLowerCase = keyword.toLocaleLowerCase(); - let expectedKeyword = null; - - /** @type {boolean} */ - const camelCaseSvgKeywords = - (secondaryOptions && secondaryOptions.camelCaseSvgKeywords) || false; - - if ( - primary === 'lower' && - mapLowercaseKeywordsToCamelCase.has(keywordLowerCase) && - camelCaseSvgKeywords - ) { - expectedKeyword = mapLowercaseKeywordsToCamelCase.get(keywordLowerCase); - } else if (primary === 'lower') { - expectedKeyword = keyword.toLowerCase(); - } else { - expectedKeyword = keyword.toUpperCase(); - } - - if (keyword === expectedKeyword) { - return; - } - - if (context.fix) { - needFix = true; - node.value = expectedKeyword; - - return; - } - - report({ - message: messages.expected, - messageArgs: [keyword, expectedKeyword], - node: decl, - index: declarationValueIndex(decl) + node.sourceIndex, - result, - ruleName, - }); - }); - - if (context.fix && needFix) { - decl.value = parsed.toString(); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-list-comma-newline-after/index.js b/node_modules/stylelint/lib/rules/value-list-comma-newline-after/index.js deleted file mode 100644 index 87dcb697a..000000000 --- a/node_modules/stylelint/lib/rules/value-list-comma-newline-after/index.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const valueListCommaWhitespaceChecker = require('../valueListCommaWhitespaceChecker'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'value-list-comma-newline-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected newline after ","', - expectedAfterMultiLine: () => 'Expected newline after "," in a multi-line list', - rejectedAfterMultiLine: () => 'Unexpected whitespace after "," in a multi-line list', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/value-list-comma-newline-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line', 'never-multi-line'], - }); - - if (!validOptions) { - return; - } - - /** @type {Map | undefined} */ - let fixData; - - valueListCommaWhitespaceChecker({ - root, - result, - locationChecker: checker.afterOneOnly, - checkedRuleName: ruleName, - fix: context.fix - ? (declNode, index) => { - const valueIndex = declarationValueIndex(declNode); - - if (index <= valueIndex) { - return false; - } - - fixData = fixData || new Map(); - const commaIndices = fixData.get(declNode) || []; - - commaIndices.push(index); - fixData.set(declNode, commaIndices); - - return true; - } - : null, - determineIndex: (declString, match) => { - const nextChars = declString.substring(match.endIndex, declString.length); - - // If there's a // comment, that means there has to be a newline - // ending the comment so we're fine - if (/^[ \t]*\/\//.test(nextChars)) { - return false; - } - - // If there are spaces and then a comment begins, look for the newline - return /^[ \t]*\/\*/.test(nextChars) - ? declString.indexOf('*/', match.endIndex) + 1 - : match.startIndex; - }, - }); - - if (fixData) { - for (const [decl, commaIndices] of fixData.entries()) { - for (const index of commaIndices.sort((a, b) => a - b).reverse()) { - const value = getDeclarationValue(decl); - const valueIndex = index - declarationValueIndex(decl); - const beforeValue = value.slice(0, valueIndex + 1); - let afterValue = value.slice(valueIndex + 1); - - if (primary.startsWith('always')) { - afterValue = context.newline + afterValue; - } else if (primary.startsWith('never-multi-line')) { - afterValue = afterValue.replace(/^\s*/, ''); - } - - setDeclarationValue(decl, beforeValue + afterValue); - } - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-list-comma-newline-before/index.js b/node_modules/stylelint/lib/rules/value-list-comma-newline-before/index.js deleted file mode 100644 index 1285b33cc..000000000 --- a/node_modules/stylelint/lib/rules/value-list-comma-newline-before/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -const ruleMessages = require('../../utils/ruleMessages'); -const validateOptions = require('../../utils/validateOptions'); -const valueListCommaWhitespaceChecker = require('../valueListCommaWhitespaceChecker'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'value-list-comma-newline-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected newline before ","', - expectedBeforeMultiLine: () => 'Expected newline before "," in a multi-line list', - rejectedBeforeMultiLine: () => 'Unexpected whitespace before "," in a multi-line list', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/value-list-comma-newline-before', - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary) => { - const checker = whitespaceChecker('newline', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'always-multi-line', 'never-multi-line'], - }); - - if (!validOptions) { - return; - } - - valueListCommaWhitespaceChecker({ - root, - result, - locationChecker: checker.beforeAllowingIndentation, - checkedRuleName: ruleName, - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-list-comma-space-after/index.js b/node_modules/stylelint/lib/rules/value-list-comma-space-after/index.js deleted file mode 100644 index 8674a4d20..000000000 --- a/node_modules/stylelint/lib/rules/value-list-comma-space-after/index.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const valueListCommaWhitespaceChecker = require('../valueListCommaWhitespaceChecker'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'value-list-comma-space-after'; - -const messages = ruleMessages(ruleName, { - expectedAfter: () => 'Expected single space after ","', - rejectedAfter: () => 'Unexpected whitespace after ","', - expectedAfterSingleLine: () => 'Expected single space after "," in a single-line list', - rejectedAfterSingleLine: () => 'Unexpected whitespace after "," in a single-line list', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/value-list-comma-space-after', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never', 'always-single-line', 'never-single-line'], - }); - - if (!validOptions) { - return; - } - - /** @type {Map | undefined} */ - let fixData; - - valueListCommaWhitespaceChecker({ - root, - result, - locationChecker: checker.after, - checkedRuleName: ruleName, - fix: context.fix - ? (declNode, index) => { - const valueIndex = declarationValueIndex(declNode); - - if (index <= valueIndex) { - return false; - } - - fixData = fixData || new Map(); - const commaIndices = fixData.get(declNode) || []; - - commaIndices.push(index); - fixData.set(declNode, commaIndices); - - return true; - } - : null, - }); - - if (fixData) { - for (const [decl, commaIndices] of fixData.entries()) { - for (const index of commaIndices.sort((a, b) => b - a)) { - const value = getDeclarationValue(decl); - const valueIndex = index - declarationValueIndex(decl); - const beforeValue = value.slice(0, valueIndex + 1); - let afterValue = value.slice(valueIndex + 1); - - if (primary.startsWith('always')) { - afterValue = afterValue.replace(/^\s*/, ' '); - } else if (primary.startsWith('never')) { - afterValue = afterValue.replace(/^\s*/, ''); - } - - setDeclarationValue(decl, beforeValue + afterValue); - } - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-list-comma-space-before/index.js b/node_modules/stylelint/lib/rules/value-list-comma-space-before/index.js deleted file mode 100644 index 46ff6c50a..000000000 --- a/node_modules/stylelint/lib/rules/value-list-comma-space-before/index.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -const declarationValueIndex = require('../../utils/declarationValueIndex'); -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const valueListCommaWhitespaceChecker = require('../valueListCommaWhitespaceChecker'); -const whitespaceChecker = require('../../utils/whitespaceChecker'); - -const ruleName = 'value-list-comma-space-before'; - -const messages = ruleMessages(ruleName, { - expectedBefore: () => 'Expected single space before ","', - rejectedBefore: () => 'Unexpected whitespace before ","', - expectedBeforeSingleLine: () => 'Unexpected whitespace before "," in a single-line list', - rejectedBeforeSingleLine: () => 'Unexpected whitespace before "," in a single-line list', -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/value-list-comma-space-before', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const checker = whitespaceChecker('space', primary, messages); - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: ['always', 'never', 'always-single-line', 'never-single-line'], - }); - - if (!validOptions) { - return; - } - - /** @type {Map | undefined} */ - let fixData; - - valueListCommaWhitespaceChecker({ - root, - result, - locationChecker: checker.before, - checkedRuleName: ruleName, - fix: context.fix - ? (declNode, index) => { - const valueIndex = declarationValueIndex(declNode); - - if (index <= valueIndex) { - return false; - } - - fixData = fixData || new Map(); - const commaIndices = fixData.get(declNode) || []; - - commaIndices.push(index); - fixData.set(declNode, commaIndices); - - return true; - } - : null, - }); - - if (fixData) { - for (const [decl, commaIndices] of fixData.entries()) { - for (const index of commaIndices.sort((a, b) => b - a)) { - const value = getDeclarationValue(decl); - const valueIndex = index - declarationValueIndex(decl); - let beforeValue = value.slice(0, valueIndex); - const afterValue = value.slice(valueIndex); - - if (primary.startsWith('always')) { - beforeValue = beforeValue.replace(/\s*$/, ' '); - } else if (primary.startsWith('never')) { - beforeValue = beforeValue.replace(/\s*$/, ''); - } - - setDeclarationValue(decl, beforeValue + afterValue); - } - } - } - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-list-max-empty-lines/index.js b/node_modules/stylelint/lib/rules/value-list-max-empty-lines/index.js deleted file mode 100644 index 08fbbb262..000000000 --- a/node_modules/stylelint/lib/rules/value-list-max-empty-lines/index.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -const getDeclarationValue = require('../../utils/getDeclarationValue'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const { isNumber } = require('../../utils/validateTypes'); - -const ruleName = 'value-list-max-empty-lines'; - -const messages = ruleMessages(ruleName, { - expected: (max) => `Expected no more than ${max} empty ${max === 1 ? 'line' : 'lines'}`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/value-list-max-empty-lines', - fixable: true, - deprecated: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, _secondaryOptions, context) => { - const maxAdjacentNewlines = primary + 1; - - return (root, result) => { - const validOptions = validateOptions(result, ruleName, { - actual: primary, - possible: isNumber, - }); - - if (!validOptions) { - return; - } - - const violatedCRLFNewLinesRegex = new RegExp(`(?:\r\n){${maxAdjacentNewlines + 1},}`); - const violatedLFNewLinesRegex = new RegExp(`\n{${maxAdjacentNewlines + 1},}`); - const allowedLFNewLinesString = context.fix ? '\n'.repeat(maxAdjacentNewlines) : ''; - const allowedCRLFNewLinesString = context.fix ? '\r\n'.repeat(maxAdjacentNewlines) : ''; - - root.walkDecls((decl) => { - const value = getDeclarationValue(decl); - - if (context.fix) { - const newValueString = value - .replace(new RegExp(violatedLFNewLinesRegex, 'gm'), allowedLFNewLinesString) - .replace(new RegExp(violatedCRLFNewLinesRegex, 'gm'), allowedCRLFNewLinesString); - - setDeclarationValue(decl, newValueString); - } else if (violatedLFNewLinesRegex.test(value) || violatedCRLFNewLinesRegex.test(value)) { - report({ - message: messages.expected(primary), - node: decl, - index: 0, - result, - ruleName, - }); - } - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/value-no-vendor-prefix/index.js b/node_modules/stylelint/lib/rules/value-no-vendor-prefix/index.js deleted file mode 100644 index 98452948b..000000000 --- a/node_modules/stylelint/lib/rules/value-no-vendor-prefix/index.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict'; - -const valueParser = require('postcss-value-parser'); - -const hasPrefix = require('../../utils/hasPrefix'); -const isAutoprefixable = require('../../utils/isAutoprefixable'); -const isStandardSyntaxDeclaration = require('../../utils/isStandardSyntaxDeclaration'); -const isStandardSyntaxProperty = require('../../utils/isStandardSyntaxProperty'); -const optionsMatches = require('../../utils/optionsMatches'); -const report = require('../../utils/report'); -const ruleMessages = require('../../utils/ruleMessages'); -const setDeclarationValue = require('../../utils/setDeclarationValue'); -const validateOptions = require('../../utils/validateOptions'); -const vendor = require('../../utils/vendor'); -const { isString } = require('../../utils/validateTypes'); - -const ruleName = 'value-no-vendor-prefix'; - -const messages = ruleMessages(ruleName, { - rejected: (value) => `Unexpected vendor-prefix "${value}"`, -}); - -const meta = { - url: 'https://stylelint.io/user-guide/rules/value-no-vendor-prefix', - fixable: true, -}; - -/** @type {import('stylelint').Rule} */ -const rule = (primary, secondaryOptions, context) => { - return (root, result) => { - const validOptions = validateOptions( - result, - ruleName, - { actual: primary }, - { - optional: true, - actual: secondaryOptions, - possible: { - ignoreValues: [isString], - }, - }, - ); - - if (!validOptions) { - return; - } - - root.walkDecls((decl) => { - const { value } = decl; - - if (!hasPrefix(value)) return; - - if (!isStandardSyntaxDeclaration(decl) || !isStandardSyntaxProperty(decl.prop)) { - return; - } - - if (optionsMatches(secondaryOptions, 'ignoreValues', vendor.unprefixed(value))) { - return; - } - - const parsedValue = valueParser(value); - - parsedValue.walk((node) => { - if (!isAutoprefixable.propertyValue(node.value)) { - return; - } - - if (context.fix) { - node.value = isAutoprefixable.unprefix(node.value); - - return; - } - - const startIndex = decl.prop.length + (decl.raws.between || '').length + node.sourceIndex; - - report({ - message: messages.rejected, - messageArgs: [node.value], - node: decl, - index: startIndex, - endIndex: startIndex + node.value.length, - result, - ruleName, - }); - }); - - setDeclarationValue(decl, parsedValue.toString()); - }); - }; -}; - -rule.ruleName = ruleName; -rule.messages = messages; -rule.meta = meta; -module.exports = rule; diff --git a/node_modules/stylelint/lib/rules/valueListCommaWhitespaceChecker.js b/node_modules/stylelint/lib/rules/valueListCommaWhitespaceChecker.js deleted file mode 100644 index b537a6799..000000000 --- a/node_modules/stylelint/lib/rules/valueListCommaWhitespaceChecker.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -const isStandardSyntaxDeclaration = require('../utils/isStandardSyntaxDeclaration'); -const isStandardSyntaxProperty = require('../utils/isStandardSyntaxProperty'); -const report = require('../utils/report'); -const styleSearch = require('style-search'); - -/** - * @param {{ - * root: import('postcss').Root, - * result: import('stylelint').PostcssResult, - * locationChecker: (opts: { source: string, index: number, err: (msg: string) => void }) => void, - * checkedRuleName: string, - * fix?: ((node: import('postcss').Declaration, index: number) => boolean) | null, - * determineIndex?: (declString: string, match: import('style-search').StyleSearchMatch) => number | false, - * }} opts - */ -module.exports = function valueListCommaWhitespaceChecker(opts) { - opts.root.walkDecls((decl) => { - if (!isStandardSyntaxDeclaration(decl) || !isStandardSyntaxProperty(decl.prop)) { - return; - } - - const declString = decl.toString(); - - styleSearch( - { - source: declString, - target: ',', - functionArguments: 'skip', - }, - (match) => { - const indexToCheckAfter = opts.determineIndex - ? opts.determineIndex(declString, match) - : match.startIndex; - - if (indexToCheckAfter === false) { - return; - } - - checkComma(declString, indexToCheckAfter, decl); - }, - ); - }); - - /** - * @param {string} source - * @param {number} index - * @param {import('postcss').Declaration} node - * @returns {void} - */ - function checkComma(source, index, node) { - opts.locationChecker({ - source, - index, - err: (message) => { - if (opts.fix && opts.fix(node, index)) { - return; - } - - report({ - message, - node, - index, - result: opts.result, - ruleName: opts.checkedRuleName, - }); - }, - }); - } -}; diff --git a/node_modules/stylelint/lib/standalone.js b/node_modules/stylelint/lib/standalone.js deleted file mode 100644 index a7ed9058a..000000000 --- a/node_modules/stylelint/lib/standalone.js +++ /dev/null @@ -1,325 +0,0 @@ -'use strict'; - -const debug = require('debug')('stylelint:standalone'); -const fastGlob = require('fast-glob'); -const fs = require('fs'); -const globby = require('globby'); -const normalizePath = require('normalize-path'); -const path = require('path'); - -const createStylelint = require('./createStylelint'); -const createPartialStylelintResult = require('./createPartialStylelintResult'); -const filterFilePaths = require('./utils/filterFilePaths'); -const formatters = require('./formatters'); -const getConfigForFile = require('./getConfigForFile'); -const getFileIgnorer = require('./utils/getFileIgnorer'); -const getFormatterOptionsText = require('./utils/getFormatterOptionsText'); -const lintSource = require('./lintSource'); -const NoFilesFoundError = require('./utils/noFilesFoundError'); -const AllFilesIgnoredError = require('./utils/allFilesIgnoredError'); -const { assert } = require('./utils/validateTypes'); -const prepareReturnValue = require('./prepareReturnValue'); - -const ALWAYS_IGNORED_GLOBS = ['**/node_modules/**']; -const writeFileAtomic = require('write-file-atomic'); - -/** @typedef {import('stylelint').Formatter} Formatter */ -/** @typedef {import('stylelint').FormatterType} FormatterType */ - -/** - * @type {import('stylelint')['lint']} - */ -async function standalone({ - allowEmptyInput, - cache, - cacheLocation, - cacheStrategy, - code, - codeFilename, - config, - configBasedir, - configFile, - customSyntax, - cwd = process.cwd(), - disableDefaultIgnores, - files, - fix, - formatter, - globbyOptions, - ignoreDisables, - ignorePath, - ignorePattern, - maxWarnings, - quiet, - quietDeprecationWarnings = false, - reportDescriptionlessDisables, - reportInvalidScopeDisables, - reportNeedlessDisables, -}) { - const startTime = Date.now(); - - const isValidCode = typeof code === 'string'; - - if ((!files && !isValidCode) || (files && (code || isValidCode))) { - return Promise.reject( - new Error('You must pass stylelint a `files` glob or a `code` string, though not both'), - ); - } - - // The ignorer will be used to filter file paths after the glob is checked, - // before any files are actually read - - /** @type {import('ignore').Ignore} */ - let ignorer; - - try { - ignorer = getFileIgnorer({ cwd, ignorePath, ignorePattern }); - } catch (error) { - return Promise.reject(error); - } - - /** @type {Formatter} */ - let formatterFunction; - - try { - formatterFunction = getFormatterFunction(formatter); - } catch (error) { - return Promise.reject(error); - } - - const stylelint = createStylelint({ - cacheLocation, - cacheStrategy, - config, - configFile, - configBasedir, - cwd, - ignoreDisables, - ignorePath, - reportNeedlessDisables, - reportInvalidScopeDisables, - reportDescriptionlessDisables, - customSyntax, - fix, - quiet, - quietDeprecationWarnings, - }); - - if (!files) { - const absoluteCodeFilename = - codeFilename !== undefined && !path.isAbsolute(codeFilename) - ? path.join(cwd, codeFilename) - : codeFilename; - - // if file is ignored, return nothing - if ( - absoluteCodeFilename && - !filterFilePaths(ignorer, [path.relative(cwd, absoluteCodeFilename)]).length - ) { - return prepareReturnValue([], maxWarnings, formatterFunction, cwd); - } - - let stylelintResult; - - try { - const postcssResult = await lintSource(stylelint, { - code, - codeFilename: absoluteCodeFilename, - }); - - stylelintResult = createPartialStylelintResult(postcssResult); - } catch (error) { - stylelintResult = handleError(error); - } - - const postcssResult = stylelintResult._postcssResult; - const returnValue = prepareReturnValue([stylelintResult], maxWarnings, formatterFunction, cwd); - - const autofix = fix ?? config?.fix ?? false; - - if (autofix && postcssResult && !postcssResult.stylelint.ignored) { - returnValue.output = - !postcssResult.stylelint.disableWritingFix && postcssResult.opts - ? // If we're fixing, the output should be the fixed code - postcssResult.root.toString(postcssResult.opts.syntax) - : // If the writing of the fix is disabled, the input code is returned as-is - code; - } - - return returnValue; - } - - let fileList = [files].flat().map((entry) => { - const globCWD = (globbyOptions && globbyOptions.cwd) || cwd; - const absolutePath = !path.isAbsolute(entry) - ? path.join(globCWD, entry) - : path.normalize(entry); - - if (fs.existsSync(absolutePath)) { - // This path points to a file. Return an escaped path to avoid globbing - return fastGlob.escapePath(normalizePath(entry)); - } - - return entry; - }); - - if (!disableDefaultIgnores) { - fileList = fileList.concat(ALWAYS_IGNORED_GLOBS.map((glob) => `!${glob}`)); - } - - // do not cache if config is explicitly overridden by option - const useCache = cache ?? config?.cache ?? false; - - if (!useCache) { - stylelint._fileCache.destroy(); - } - - const effectiveGlobbyOptions = { - cwd, - ...(globbyOptions || {}), - absolute: true, - }; - - const globCWD = effectiveGlobbyOptions.cwd; - - let filePaths = await globby(fileList, effectiveGlobbyOptions); - // Record the length of filePaths before ignore operation - // Prevent prompting "No files matching the pattern 'xx' were found." when .stylelintignore ignore all input files - const filePathsLengthBeforeIgnore = filePaths.length; - - // The ignorer filter needs to check paths relative to cwd - filePaths = filterFilePaths( - ignorer, - filePaths.map((p) => path.relative(globCWD, p)), - ); - - let stylelintResults; - - if (filePaths.length) { - let absoluteFilePaths = filePaths.map((filePath) => { - const absoluteFilepath = !path.isAbsolute(filePath) - ? path.join(globCWD, filePath) - : path.normalize(filePath); - - return absoluteFilepath; - }); - - const getStylelintResults = absoluteFilePaths.map(async (absoluteFilepath) => { - debug(`Processing ${absoluteFilepath}`); - - try { - const postcssResult = await lintSource(stylelint, { - filePath: absoluteFilepath, - cache: useCache, - }); - - if ( - (postcssResult.stylelint.stylelintError || postcssResult.stylelint.stylelintWarning) && - useCache - ) { - debug(`${absoluteFilepath} contains linting errors and will not be cached.`); - stylelint._fileCache.removeEntry(absoluteFilepath); - } - - /** - * If we're fixing, save the file with changed code - */ - if ( - postcssResult.root && - postcssResult.opts && - !postcssResult.stylelint.ignored && - fix && - !postcssResult.stylelint.disableWritingFix - ) { - const fixedCss = postcssResult.root.toString(postcssResult.opts.syntax); - - if ( - postcssResult.root && - postcssResult.root.source && - postcssResult.root.source.input.css !== fixedCss - ) { - await writeFileAtomic(absoluteFilepath, fixedCss); - } - } - - return createPartialStylelintResult(postcssResult); - } catch (error) { - // On any error, we should not cache the lint result - stylelint._fileCache.removeEntry(absoluteFilepath); - - return handleError(error); - } - }); - - stylelintResults = await Promise.all(getStylelintResults); - } else if (allowEmptyInput ?? config?.allowEmptyInput ?? (await canAllowEmptyInput(stylelint))) { - stylelintResults = await Promise.all([]); - } else if (filePathsLengthBeforeIgnore) { - // All input files ignored - stylelintResults = await Promise.reject(new AllFilesIgnoredError()); - } else { - stylelintResults = await Promise.reject(new NoFilesFoundError(fileList)); - } - - if (useCache) { - stylelint._fileCache.reconcile(); - } - - const result = prepareReturnValue(stylelintResults, maxWarnings, formatterFunction, cwd); - - debug(`Linting complete in ${Date.now() - startTime}ms`); - - return result; -} - -/** - * @param {FormatterType | Formatter | undefined} selected - * @returns {Formatter} - */ -function getFormatterFunction(selected) { - if (typeof selected === 'string') { - const formatterFunction = formatters[selected]; - - if (formatterFunction === undefined) { - const formattersText = getFormatterOptionsText(', ', '"'); - - throw new Error(`You must use a valid formatter option: ${formattersText} or a function`); - } - - return formatterFunction; - } - - if (typeof selected === 'function') { - return selected; - } - - assert(formatters.json); - - return formatters.json; -} - -/** - * @typedef {import('stylelint').CssSyntaxError} CssSyntaxError - * - * @param {unknown} error - * @return {import('stylelint').LintResult} - */ -function handleError(error) { - if (error instanceof Error && error.name === 'CssSyntaxError') { - return createPartialStylelintResult(undefined, /** @type {CssSyntaxError} */ (error)); - } - - throw error; -} - -/** - * @param {import('stylelint').InternalApi} stylelint - * @returns {Promise} - */ -async function canAllowEmptyInput(stylelint) { - const config = await getConfigForFile(stylelint); - - return Boolean(config?.config?.allowEmptyInput); -} - -module.exports = standalone; diff --git a/node_modules/stylelint/lib/utils/FileCache.js b/node_modules/stylelint/lib/utils/FileCache.js deleted file mode 100644 index e59503912..000000000 --- a/node_modules/stylelint/lib/utils/FileCache.js +++ /dev/null @@ -1,92 +0,0 @@ -'use strict'; - -const debug = require('debug')('stylelint:file-cache'); -const fileEntryCache = require('file-entry-cache'); -const path = require('path'); - -const pkg = require('../../package.json'); -const getCacheFile = require('./getCacheFile'); -const hash = require('./hash'); -const { - DEFAULT_CACHE_LOCATION, - CACHE_STRATEGY_METADATA, - CACHE_STRATEGY_CONTENT, - DEFAULT_CACHE_STRATEGY, -} = require('../constants'); - -/** @typedef {import('file-entry-cache').FileDescriptor["meta"] & { hashOfConfig?: string }} CacheMetadata */ - -class FileCache { - constructor( - cacheLocation = DEFAULT_CACHE_LOCATION, - cacheStrategy = DEFAULT_CACHE_STRATEGY, - cwd = process.cwd(), - ) { - if (![CACHE_STRATEGY_METADATA, CACHE_STRATEGY_CONTENT].includes(cacheStrategy)) { - throw new Error( - `"${cacheStrategy}" cache strategy is unsupported. Specify either "${CACHE_STRATEGY_METADATA}" or "${CACHE_STRATEGY_CONTENT}"`, - ); - } - - const cacheFile = path.resolve(getCacheFile(cacheLocation, cwd)); - const useCheckSum = cacheStrategy === CACHE_STRATEGY_CONTENT; - - debug(`Cache file is created at ${cacheFile}`); - this._fileCache = fileEntryCache.create(cacheFile, undefined, useCheckSum); - this._hashOfConfig = ''; - } - - /** - * @param {import('stylelint').Config} config - */ - calcHashOfConfig(config) { - if (this._hashOfConfig) return; - - const stylelintVersion = pkg.version; - const configString = JSON.stringify(config || {}); - - this._hashOfConfig = hash(`${stylelintVersion}_${configString}`); - } - - /** - * @param {string} absoluteFilepath - * @return {boolean} - */ - hasFileChanged(absoluteFilepath) { - // Get file descriptor compares current metadata against cached - // one and stores the result to "changed" prop.w - const descriptor = this._fileCache.getFileDescriptor(absoluteFilepath); - /** @type {CacheMetadata} */ - const meta = descriptor.meta || {}; - const changed = descriptor.changed || meta.hashOfConfig !== this._hashOfConfig; - - if (!changed) { - debug(`Skip linting ${absoluteFilepath}. File hasn't changed.`); - } - - // Mutate file descriptor object and store config hash to each file. - // Running lint with different config should invalidate the cache. - if (meta.hashOfConfig !== this._hashOfConfig) { - meta.hashOfConfig = this._hashOfConfig; - } - - return changed; - } - - reconcile() { - this._fileCache.reconcile(); - } - - destroy() { - this._fileCache.destroy(); - } - - /** - * @param {string} absoluteFilepath - */ - removeEntry(absoluteFilepath) { - this._fileCache.removeEntry(absoluteFilepath); - } -} - -module.exports = FileCache; diff --git a/node_modules/stylelint/lib/utils/addEmptyLineAfter.js b/node_modules/stylelint/lib/utils/addEmptyLineAfter.js deleted file mode 100644 index afcd00eb7..000000000 --- a/node_modules/stylelint/lib/utils/addEmptyLineAfter.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -/** - * Add an empty line after a node. Mutates the node. - * - * @template {import('postcss').Rule | import('postcss').AtRule} T - * @param {T} node - * @param {string} newline - * @returns {T} - */ -module.exports = function addEmptyLineAfter(node, newline) { - const { raws } = node; - - if (typeof raws.after !== 'string') { - return node; - } - - const spaces = raws.after.split(';'); - const after = spaces[spaces.length - 1] || ''; - - if (!/\r?\n/.test(after)) { - raws.after += newline.repeat(2); - } else { - raws.after = raws.after.replace(/(\r?\n)/, `${newline}$1`); - } - - return node; -}; diff --git a/node_modules/stylelint/lib/utils/addEmptyLineBefore.js b/node_modules/stylelint/lib/utils/addEmptyLineBefore.js deleted file mode 100644 index 68a53891f..000000000 --- a/node_modules/stylelint/lib/utils/addEmptyLineBefore.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -/** - * Add an empty line before a node. Mutates the node. - * - * @template {import('postcss').ChildNode} T - * @param {T} node - * @param {string} newline - * @returns {T} - */ -module.exports = function addEmptyLineBefore(node, newline) { - const { raws } = node; - - if (typeof raws.before !== 'string') { - return node; - } - - raws.before = !/\r?\n/.test(raws.before) - ? newline.repeat(2) + raws.before - : raws.before.replace(/(\r?\n)/, `${newline}$1`); - - return node; -}; diff --git a/node_modules/stylelint/lib/utils/allFilesIgnoredError.js b/node_modules/stylelint/lib/utils/allFilesIgnoredError.js deleted file mode 100644 index d1a3a47ce..000000000 --- a/node_modules/stylelint/lib/utils/allFilesIgnoredError.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -class AllFilesIgnoredError extends Error { - constructor() { - super(); - - this.message = `All input files were ignored because of the ignore pattern. Either change your input, ignore pattern or use "--allow-empty-input" to allow no inputs`; - } -} - -module.exports = AllFilesIgnoredError; diff --git a/node_modules/stylelint/lib/utils/arrayEqual.js b/node_modules/stylelint/lib/utils/arrayEqual.js deleted file mode 100644 index fae0e5a70..000000000 --- a/node_modules/stylelint/lib/utils/arrayEqual.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -/** - * Tests if two arrays are equal. - * - * @param {unknown} a - * @param {unknown} b - * @returns {boolean} - */ -module.exports = function arrayEqual(a, b) { - if (!Array.isArray(a) || !Array.isArray(b)) return false; - - if (a.length !== b.length) return false; - - return a.every((elem, index) => elem === b[index]); -}; diff --git a/node_modules/stylelint/lib/utils/atRuleParamIndex.js b/node_modules/stylelint/lib/utils/atRuleParamIndex.js deleted file mode 100644 index a820dc9fa..000000000 --- a/node_modules/stylelint/lib/utils/atRuleParamIndex.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -/** - * @param {import('postcss').AtRule} atRule - * @returns {number} - */ -module.exports = function atRuleParamIndex(atRule) { - // Initial 1 is for the `@` - let index = 1 + atRule.name.length; - - if (atRule.raws.afterName) { - index += atRule.raws.afterName.length; - } - - return index; -}; diff --git a/node_modules/stylelint/lib/utils/beforeBlockString.js b/node_modules/stylelint/lib/utils/beforeBlockString.js deleted file mode 100644 index 3ae78306b..000000000 --- a/node_modules/stylelint/lib/utils/beforeBlockString.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -const { isAtRule, isRule } = require('./typeGuards'); - -/** - * @param {import('postcss').Container} statement - * @returns {string} - */ -module.exports = function beforeBlockString(statement, { noRawBefore } = { noRawBefore: false }) { - let result = ''; - - const before = statement.raws.before || ''; - - if (!noRawBefore) { - result += before; - } - - if (isRule(statement)) { - result += statement.selector; - } else if (isAtRule(statement)) { - result += `@${statement.name}${statement.raws.afterName || ''}${statement.params}`; - } else { - return ''; - } - - result += statement.raws.between || ''; - - return result; -}; diff --git a/node_modules/stylelint/lib/utils/blockString.js b/node_modules/stylelint/lib/utils/blockString.js deleted file mode 100644 index 6ebd81a41..000000000 --- a/node_modules/stylelint/lib/utils/blockString.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -const beforeBlockString = require('./beforeBlockString'); -const hasBlock = require('./hasBlock'); -const rawNodeString = require('./rawNodeString'); - -/** - * Return a CSS statement's block -- the string that starts and `{` and ends with `}`. - * - * If the statement has no block (e.g. `@import url(foo.css);`), returns an empty string. - * - * @param {import('postcss').Container} statement - * @returns {string} - */ -module.exports = function blockString(statement) { - if (!hasBlock(statement)) { - return ''; - } - - return rawNodeString(statement).slice(beforeBlockString(statement).length); -}; diff --git a/node_modules/stylelint/lib/utils/blurInterpolation.js b/node_modules/stylelint/lib/utils/blurInterpolation.js deleted file mode 100644 index 4225c7df5..000000000 --- a/node_modules/stylelint/lib/utils/blurInterpolation.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -/** - * @param {string} source - * - * @returns {string} - */ -module.exports = function blurInterpolation(source, blurChar = ' ') { - return source.replace(/[#@{}]+/g, blurChar); -}; diff --git a/node_modules/stylelint/lib/utils/checkAgainstRule.js b/node_modules/stylelint/lib/utils/checkAgainstRule.js deleted file mode 100644 index 8d72ef2ab..000000000 --- a/node_modules/stylelint/lib/utils/checkAgainstRule.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -const Result = require('postcss/lib/result').default; - -const normalizeRuleSettings = require('../normalizeRuleSettings'); -const { isPlainObject } = require('./validateTypes'); -const getStylelintRule = require('./getStylelintRule'); - -/** - * @type {import('stylelint').Utils['checkAgainstRule']} - */ -module.exports = function checkAgainstRule(options, callback) { - if (!isPlainObject(options)) throw new Error('Expected an options object'); - - if (!callback) throw new Error('Expected a callback function'); - - const { ruleName, ruleSettings, root, result, context = {} } = options; - - if (!ruleName) throw new Error('Expected a "ruleName" option'); - - const rule = getStylelintRule(ruleName, result && result.stylelint.config); - - if (!rule) throw new Error(`Rule "${ruleName}" does not exist`); - - if (!ruleSettings) throw new Error('Expected a "ruleSettings" option'); - - if (!root) throw new Error('Expected a "root" option'); - - const settings = normalizeRuleSettings(ruleSettings, rule); - - if (!settings) { - return; - } - - const tmpPostcssResult = new Result( - // NOTE: The first argument is unused, so passing `undefined` raises no problems. - // But this PostCSS's behavior may change in the future. - // @ts-expect-error -- TS2345: Argument of type 'undefined' is not assignable to parameter of type 'Processor'. - undefined, - undefined, - undefined, - ); - - const [primary, secondary] = settings; - const ruleFunc = rule(primary, secondary || {}, context); - - ruleFunc( - root, - - // NOTE: This temporary PostCSS result doesn't have a property for Stylelint use. - // Problems may occur if some rules use the property. - // @ts-expect-error -- TS2345: Argument of type 'Result' is not assignable to parameter of type 'PostcssResult'. - tmpPostcssResult, - ); - - for (const warning of tmpPostcssResult.warnings()) callback(warning); -}; diff --git a/node_modules/stylelint/lib/utils/checkInvalidCLIOptions.js b/node_modules/stylelint/lib/utils/checkInvalidCLIOptions.js deleted file mode 100644 index 2ef66bfb0..000000000 --- a/node_modules/stylelint/lib/utils/checkInvalidCLIOptions.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -const EOL = require('os').EOL; -const levenshtein = require('fastest-levenshtein'); -const { red, cyan } = require('picocolors'); - -/** - * @param {{ [key: string]: { alias?: string } }} allowedOptions - * @return {string[]} - */ -const buildAllowedOptions = (allowedOptions) => { - const options = Object.keys(allowedOptions); - - for (const { alias } of Object.values(allowedOptions)) { - if (alias) { - options.push(alias); - } - } - - options.sort(); - - return options; -}; - -/** - * @param {string[]} all - * @param {string} invalid - * @return {null|string} - */ -const suggest = (all, invalid) => { - const maxThreshold = 10; - - for (let threshold = 1; threshold <= maxThreshold; threshold++) { - const suggestion = all.find((option) => levenshtein.distance(option, invalid) <= threshold); - - if (suggestion) { - return suggestion; - } - } - - return null; -}; - -/** - * Converts a string to kebab case. - * For example, `kebabCase('oneTwoThree') === 'one-two-three'`. - * @param {string} opt - * @returns {string} - */ -const kebabCase = (opt) => { - const matches = opt.match(/[A-Z]?[a-z]+|[A-Z]|[0-9]+/g); - - if (matches) { - return matches.map((s) => s.toLowerCase()).join('-'); - } - - return ''; -}; - -/** - * @param {string} opt - * @return {string} - */ -const cliOption = (opt) => { - if (opt.length === 1) { - return `"-${opt}"`; - } - - return `"--${kebabCase(opt)}"`; -}; - -/** - * @param {string} invalid - * @param {string|null} suggestion - * @return {string} - */ -const buildMessageLine = (invalid, suggestion) => { - let line = `Invalid option ${red(cliOption(invalid))}.`; - - if (suggestion) { - line += ` Did you mean ${cyan(cliOption(suggestion))}?`; - } - - return line + EOL; -}; - -/** - * @param {{ [key: string]: any }} allowedOptions - * @param {{ [key: string]: any }} inputOptions - * @return {string} - */ -module.exports = function checkInvalidCLIOptions(allowedOptions, inputOptions) { - const allOptions = buildAllowedOptions(allowedOptions); - - return Object.keys(inputOptions) - .filter((opt) => !allOptions.includes(opt)) - .map((opt) => kebabCase(opt)) - .reduce((msg, invalid) => { - // NOTE: No suggestion for shortcut options because it's too difficult - const suggestion = invalid.length >= 2 ? suggest(allOptions, invalid) : null; - - return msg + buildMessageLine(invalid, suggestion); - }, ''); -}; diff --git a/node_modules/stylelint/lib/utils/configurationComment.js b/node_modules/stylelint/lib/utils/configurationComment.js deleted file mode 100644 index 035809464..000000000 --- a/node_modules/stylelint/lib/utils/configurationComment.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -const { assertString } = require('./validateTypes'); - -const DISABLE_COMMAND = '-disable'; -const DISABLE_LINE_COMMAND = '-disable-line'; -const DISABLE_NEXT_LINE_COMMAND = '-disable-next-line'; -const ENABLE_COMMAND = '-enable'; - -const ALL_COMMANDS = new Set([ - DISABLE_COMMAND, - DISABLE_LINE_COMMAND, - DISABLE_NEXT_LINE_COMMAND, - ENABLE_COMMAND, -]); - -const DEFAULT_CONFIGURATION_COMMENT = 'stylelint'; - -/** @typedef {import('postcss').Comment} Comment */ - -/** - * Extract a command from a given comment. - * - * @param {Comment} comment - * @param {string} [configurationComment] - * @returns {string} - */ -function extractConfigurationComment( - comment, - configurationComment = DEFAULT_CONFIGURATION_COMMENT, -) { - const [command] = comment.text.split(/\s/, 1); - - assertString(command); - - return command.replace(configurationComment, ''); -} - -/** - * Tests if the given comment is a Stylelint command. - * - * @param {Comment} comment - * @param {string} [configurationComment] - * @returns {boolean} - */ -function isConfigurationComment(comment, configurationComment = DEFAULT_CONFIGURATION_COMMENT) { - const command = extractConfigurationComment(comment, configurationComment); - - return command !== undefined && ALL_COMMANDS.has(command); -} - -/** - * Get full stylelint command - * - * @param {string} command - * @param {string} [configurationComment] - * @returns {string} - */ -function getConfigurationComment(command, configurationComment = DEFAULT_CONFIGURATION_COMMENT) { - return `${configurationComment}${command}`; -} - -module.exports = { - DEFAULT_CONFIGURATION_COMMENT, - DISABLE_COMMAND, - DISABLE_LINE_COMMAND, - DISABLE_NEXT_LINE_COMMAND, - ENABLE_COMMAND, - - extractConfigurationComment, - getConfigurationComment, - isConfigurationComment, -}; diff --git a/node_modules/stylelint/lib/utils/configurationError.js b/node_modules/stylelint/lib/utils/configurationError.js deleted file mode 100644 index 2d662ba06..000000000 --- a/node_modules/stylelint/lib/utils/configurationError.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -/** @typedef {Error & { code: number }} ConfigurationError */ - -/** - * Create configurationError from text and set CLI exit code. - * - * @param {string} text - * @returns {ConfigurationError} - */ -module.exports = function configurationError(text) { - const err = /** @type {ConfigurationError} */ (new Error(text)); - - err.code = 78; - - return err; -}; diff --git a/node_modules/stylelint/lib/utils/containsString.js b/node_modules/stylelint/lib/utils/containsString.js deleted file mode 100644 index 7ee37c4d7..000000000 --- a/node_modules/stylelint/lib/utils/containsString.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -const { isString } = require('./validateTypes'); - -/** @typedef {false | { match: string, pattern: string, substring: string }} ReturnValue */ - -/** - * Checks if a string contains a value. The comparison value can be a string or - * an array of strings. - * - * Any strings starting and ending with `/` are ignored. Use the - * matchesStringOrRegExp() util to match regexes. - * - * @template {unknown} T - * @param {string} input - * @param {T | T[]} comparison - * @returns {ReturnValue} - */ -module.exports = function containsString(input, comparison) { - if (!Array.isArray(comparison)) { - return testAgainstString(input, comparison); - } - - for (const comparisonItem of comparison) { - const testResult = testAgainstString(input, comparisonItem); - - if (testResult) { - return testResult; - } - } - - return false; -}; - -/** - * @param {string} value - * @param {unknown} comparison - * @returns {ReturnValue} - */ -function testAgainstString(value, comparison) { - if (!comparison) return false; - - if (!isString(comparison)) return false; - - if (comparison.startsWith('/') && comparison.endsWith('/')) { - return false; - } - - if (value.includes(comparison)) { - return { match: value, pattern: comparison, substring: comparison }; - } - - return false; -} diff --git a/node_modules/stylelint/lib/utils/createMapWithSet.js b/node_modules/stylelint/lib/utils/createMapWithSet.js deleted file mode 100644 index 37c26910f..000000000 --- a/node_modules/stylelint/lib/utils/createMapWithSet.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -/** - * Create a map with unique sets of values from a record. - * - * @template T - * @param {Record} record - * @returns {Map>} - */ -module.exports = function createMapWithSet(record) { - /** @type {Map>} */ - const map = new Map(); - - for (const [key, value] of Object.entries(record)) { - const list = Array.isArray(value) ? value : [value]; - - map.set(key, new Set(list)); - } - - return map; -}; diff --git a/node_modules/stylelint/lib/utils/declarationValueIndex.js b/node_modules/stylelint/lib/utils/declarationValueIndex.js deleted file mode 100644 index 308c305ea..000000000 --- a/node_modules/stylelint/lib/utils/declarationValueIndex.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -const { isObject, isString } = require('./validateTypes'); - -/** - * Get the index of a declaration's value - * - * @param {import('postcss').Declaration} decl - * @returns {number} - */ -module.exports = function declarationValueIndex(decl) { - const raws = decl.raws; - const prop = raws.prop; - - return [ - isObject(prop) && 'prefix' in prop && prop.prefix, - (isObject(prop) && 'raw' in prop && prop.raw) || decl.prop, - isObject(prop) && 'suffix' in prop && prop.suffix, - raws.between || ':', - raws.value && 'prefix' in raws.value && raws.value.prefix, - ].reduce((/** @type {number} */ count, str) => { - if (isString(str)) { - return count + str.length; - } - - return count; - }, 0); -}; diff --git a/node_modules/stylelint/lib/utils/eachDeclarationBlock.js b/node_modules/stylelint/lib/utils/eachDeclarationBlock.js deleted file mode 100644 index 25f2b6930..000000000 --- a/node_modules/stylelint/lib/utils/eachDeclarationBlock.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -const { isRoot, isAtRule, isRule } = require('./typeGuards'); - -/** @typedef {import('postcss').Root} Root */ -/** @typedef {import('postcss').Root} Document */ -/** @typedef {import('postcss').Node} PostcssNode */ -/** @typedef {import('postcss').Container} PostcssContainerNode */ -/** @typedef {import('postcss').Declaration} Declaration */ -/** @typedef {(callbackFn: (decl: Declaration, index: number, decls: Declaration[]) => void) => void} EachDeclaration */ - -/** - * @param {PostcssNode} node - * @returns {node is PostcssContainerNode} - */ -function isContainerNode(node) { - return isRule(node) || isAtRule(node) || isRoot(node); -} - -/** - * In order to accommodate nested blocks (postcss-nested), - * we need to run a shallow loop (instead of eachDecl() or eachRule(), - * which loop recursively) and allow each nested block to accumulate - * its own list of properties -- so that a property in a nested rule - * does not conflict with the same property in the parent rule - * executes a provided function once for each declaration block. - * - * @param {Root | Document} root - root element of file. - * @param {(eachDecl: EachDeclaration) => void} callback - Function to execute for each declaration block - * - * @returns {void} - */ -module.exports = function eachDeclarationBlock(root, callback) { - /** - * @param {PostcssNode} statement - * - * @returns {void} - */ - function each(statement) { - if (!isContainerNode(statement)) return; - - if (statement.nodes && statement.nodes.length) { - /** @type {Declaration[]} */ - const decls = []; - - for (const node of statement.nodes) { - if (node.type === 'decl') { - decls.push(node); - } - - each(node); - } - - if (decls.length) { - callback(decls.forEach.bind(decls)); - } - } - } - - each(root); -}; diff --git a/node_modules/stylelint/lib/utils/filterFilePaths.js b/node_modules/stylelint/lib/utils/filterFilePaths.js deleted file mode 100644 index 2055a558b..000000000 --- a/node_modules/stylelint/lib/utils/filterFilePaths.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const { isPathValid } = require('ignore').default; - -/** - * @param {import('ignore').Ignore} ignorer - * @param {string[]} filePaths - * @returns {string[]} - */ -module.exports = function filterFilePaths(ignorer, filePaths) { - const validForIgnore = filePaths.filter(isPathValid); - // Paths which starts with `..` are not valid for `ignore`, e. g. `../style.css` - const notValidForIgnore = new Set(filePaths.filter((p) => !validForIgnore.includes(p))); - - const filteredByIgnore = new Set(ignorer.filter(validForIgnore)); - - // Preserving files order, while removing paths which were filtered by `ignore` - return filePaths.filter((p) => notValidForIgnore.has(p) || filteredByIgnore.has(p)); -}; diff --git a/node_modules/stylelint/lib/utils/findAnimationName.js b/node_modules/stylelint/lib/utils/findAnimationName.js deleted file mode 100644 index d74325544..000000000 --- a/node_modules/stylelint/lib/utils/findAnimationName.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -const getDimension = require('./getDimension'); -const isStandardSyntaxValue = require('./isStandardSyntaxValue'); -const isVariable = require('./isVariable'); -const { animationShorthandKeywords, basicKeywords } = require('../reference/keywords'); -const postcssValueParser = require('postcss-value-parser'); - -/** @typedef {import('postcss-value-parser').Node} Node */ - -/** - * Get the animation name within an `animation` shorthand property value. - * - * @param {string} value - * - * @returns {Node[]} - */ -module.exports = function findAnimationName(value) { - /** @type {Node[]} */ - const animationNames = []; - - const valueNodes = postcssValueParser(value); - const { nodes } = valueNodes; - - // Handle `inherit`, `initial` and etc - if (nodes.length === 1 && nodes[0] && basicKeywords.has(nodes[0].value.toLowerCase())) { - return [nodes[0]]; - } - - let shouldBeIgnored = false; - - valueNodes.walk((valueNode) => { - if (shouldBeIgnored) return; - - if (valueNode.type === 'function') { - return false; - } - - if (valueNode.type !== 'word') { - return; - } - - const valueLowerCase = valueNode.value.toLowerCase(); - - // Ignore non-standard syntax - if (!isStandardSyntaxValue(valueLowerCase)) { - // Cannot find animation name if shorthand has non-standard syntax value (#5532) - shouldBeIgnored = true; - animationNames.length = 0; // clears animationNames - - return; - } - - // Ignore variables - if (isVariable(valueLowerCase)) { - return; - } - - // Ignore keywords for other animation parts - if (animationShorthandKeywords.has(valueLowerCase)) { - return; - } - - // Ignore numbers with units - const { unit } = getDimension(valueNode); - - if (unit || unit === '') { - return; - } - - animationNames.push(valueNode); - }); - - return animationNames; -}; diff --git a/node_modules/stylelint/lib/utils/findAtRuleContext.js b/node_modules/stylelint/lib/utils/findAtRuleContext.js deleted file mode 100644 index 08f2dba29..000000000 --- a/node_modules/stylelint/lib/utils/findAtRuleContext.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -const { isAtRule, isRule } = require('./typeGuards'); - -/** - * Find the at-rule in which a rule is nested. - * - * Returns `null` if the rule is not nested within an at-rule. - * - * @param {import('postcss').Rule} rule - * @returns {null | import('postcss').AtRule} - */ -module.exports = function findAtRuleContext(rule) { - const parent = rule.parent; - - if (!parent) { - return null; - } - - if (isAtRule(parent)) { - return parent; - } - - if (isRule(parent)) { - return findAtRuleContext(parent); - } - - return null; -}; diff --git a/node_modules/stylelint/lib/utils/findFontFamily.js b/node_modules/stylelint/lib/utils/findFontFamily.js deleted file mode 100644 index a19260d1e..000000000 --- a/node_modules/stylelint/lib/utils/findFontFamily.js +++ /dev/null @@ -1,130 +0,0 @@ -'use strict'; - -const postcssValueParser = require('postcss-value-parser'); - -const isNumbery = require('./isNumbery'); -const isStandardSyntaxValue = require('./isStandardSyntaxValue'); -const isValidFontSize = require('./isValidFontSize'); -const isVariable = require('./isVariable'); -const { assert } = require('./validateTypes'); -const { - basicKeywords, - fontFamilyKeywords, - fontShorthandKeywords, -} = require('../reference/keywords'); - -const nodeTypesToCheck = new Set(['word', 'string', 'space', 'div']); - -/** @typedef {import('postcss-value-parser').Node} Node */ - -/** - * - * @param {Node} firstNode - * @param {Node} secondNode - * @param {string | null} charactersBetween - * - * @returns {Node} - */ -function joinValueNodes(firstNode, secondNode, charactersBetween) { - firstNode.value = firstNode.value + charactersBetween + secondNode.value; - - return firstNode; -} - -/** - * Get the font-families within a `font` shorthand property value. - * - * @param {string} value - * @returns {Node[]} Collection font-family nodes - */ -module.exports = function findFontFamily(value) { - /** @type {Node[]} */ - const fontFamilies = []; - - const valueNodes = postcssValueParser(value); - const { nodes: children } = valueNodes; - - // Handle `inherit`, `initial` and etc - if (children.length === 1 && children[0] && basicKeywords.has(children[0].value.toLowerCase())) { - return [children[0]]; - } - - let needMergeNodesByValue = false; - /** @type {string | null} */ - let mergeCharacters = null; - - valueNodes.walk((valueNode, index, nodes) => { - if (valueNode.type === 'function') { - return false; - } - - if (!nodeTypesToCheck.has(valueNode.type)) { - return; - } - - const valueLowerCase = valueNode.value.toLowerCase(); - - // Ignore non standard syntax - if (!isStandardSyntaxValue(valueLowerCase)) { - return; - } - - // Ignore variables - if (isVariable(valueLowerCase)) { - return; - } - - // Ignore keywords for other font parts - if (fontShorthandKeywords.has(valueLowerCase) && !fontFamilyKeywords.has(valueLowerCase)) { - return; - } - - // Ignore font-sizes - if (isValidFontSize(valueNode.value)) { - return; - } - - const prevNode = nodes[index - 1]; - const prevPrevNode = nodes[index - 2]; - - // Ignore anything come after a /, because it's a line-height - if (prevNode && prevNode.value === '/' && prevPrevNode && isValidFontSize(prevPrevNode.value)) { - return; - } - - // Ignore number values - if (isNumbery(valueLowerCase)) { - return; - } - - // Detect when a space or comma is dividing a list of font-families, and save the joining character. - if ( - (valueNode.type === 'space' || (valueNode.type === 'div' && valueNode.value !== ',')) && - fontFamilies.length !== 0 - ) { - needMergeNodesByValue = true; - mergeCharacters = valueNode.value; - - return; - } - - if (valueNode.type === 'space' || valueNode.type === 'div') { - return; - } - - const fontFamily = valueNode; - - if (needMergeNodesByValue) { - const lastFontFamily = fontFamilies[fontFamilies.length - 1]; - - assert(lastFontFamily); - joinValueNodes(lastFontFamily, fontFamily, mergeCharacters); - needMergeNodesByValue = false; - mergeCharacters = null; - } else { - fontFamilies.push(fontFamily); - } - }); - - return fontFamilies; -}; diff --git a/node_modules/stylelint/lib/utils/findMediaFeatureNames.js b/node_modules/stylelint/lib/utils/findMediaFeatureNames.js deleted file mode 100644 index cee19e39c..000000000 --- a/node_modules/stylelint/lib/utils/findMediaFeatureNames.js +++ /dev/null @@ -1,144 +0,0 @@ -'use strict'; - -const { TokenType, isToken, stringify, tokenize } = require('@csstools/css-tokenizer'); -const { - isTokenNode, - parseCommaSeparatedListOfComponentValues, - isSimpleBlockNode, -} = require('@csstools/css-parser-algorithms'); -const { - isGeneralEnclosed, - isMediaFeature, - isMediaQueryInvalid, - parseFromTokens, -} = require('@csstools/media-query-list-parser'); - -/** @typedef {Array} MediaQueryList */ -/** @typedef {import('@csstools/css-tokenizer').TokenIdent} TokenIdent */ -/** @typedef {{ stringify: () => string }} MediaQuerySerializer */ - -const rangeFeatureOperator = /[<>=]/; - -/** - * Search a CSS string for Media Feature names. - * For every found name, invoke the callback, passing the token - * as an argument. - * - * Found tokens are mutable and modifications made to them will be reflected in the output. - * - * This function supports some non-standard syntaxes like SCSS variables and interpolation. - * - * @param {string} mediaQueryParams - * @param {(mediaFeatureName: TokenIdent) => void} callback - * - * @returns {MediaQuerySerializer} - */ -module.exports = function findMediaFeatureNames(mediaQueryParams, callback) { - const tokens = tokenize({ css: mediaQueryParams }); - const list = parseCommaSeparatedListOfComponentValues(tokens); - - const mediaQueryConditions = list.flatMap((listItem) => { - return listItem.flatMap((componentValue) => { - if ( - !isSimpleBlockNode(componentValue) || - componentValue.startToken[0] !== TokenType.OpenParen - ) { - return []; - } - - const blockTokens = componentValue.tokens(); - - const mediaQueryList = parseFromTokens(blockTokens, { - preserveInvalidMediaQueries: true, - }); - - return mediaQueryList.filter((mediaQuery) => { - return !isMediaQueryInvalid(mediaQuery); - }); - }); - }); - - mediaQueryConditions.forEach((mediaQuery) => { - mediaQuery.walk(({ node }) => { - if (isMediaFeature(node)) { - const token = node.getNameToken(); - - if (token[0] !== TokenType.Ident) return; - - callback(token); - } - - if (isGeneralEnclosed(node)) { - topLevelTokenNodes(node).forEach((token, i, topLevelTokens) => { - if (token[0] !== TokenType.Ident) { - return; - } - - const nextToken = topLevelTokens[i + 1]; - const prevToken = topLevelTokens[i - 1]; - - if ( - // Media Feature - (!prevToken && nextToken && nextToken[0] === TokenType.Colon) || - // Range Feature - (nextToken && - nextToken[0] === TokenType.Delim && - rangeFeatureOperator.test(nextToken[4].value)) || - // Range Feature - (prevToken && - prevToken[0] === TokenType.Delim && - rangeFeatureOperator.test(prevToken[4].value)) - ) { - callback(token); - } - }); - } - }); - }); - - // Serializing takes time/resources and not all callers will use this. - // By returning an object with a stringify method, we can avoid doing - // this work when it's not needed. - return { - stringify() { - return stringify(...tokens); - }, - }; -}; - -/** @param {import('@csstools/media-query-list-parser').GeneralEnclosed} node */ -function topLevelTokenNodes(node) { - const components = node.value.value; - - if (isToken(components) || components.length === 0 || isToken(components[0])) { - return []; - } - - /** @type {Array} */ - const relevantTokens = []; - - // To consume the next token if it is a scss variable - let lastWasDollarSign = false; - - components.forEach((component) => { - // Only preserve top level tokens (idents, delims, ...) - // Discard all blocks, functions, ... - if (component && isTokenNode(component)) { - if (component.value[0] === TokenType.Delim && component.value[4].value === '$') { - lastWasDollarSign = true; - - return; - } - - if (lastWasDollarSign) { - lastWasDollarSign = false; - - return; - } - - relevantTokens.push(component.value); - } - }); - - return relevantTokens; -} diff --git a/node_modules/stylelint/lib/utils/functionArgumentsSearch.js b/node_modules/stylelint/lib/utils/functionArgumentsSearch.js deleted file mode 100644 index cfec24284..000000000 --- a/node_modules/stylelint/lib/utils/functionArgumentsSearch.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -const balancedMatch = require('balanced-match'); -const valueParser = require('postcss-value-parser'); - -const { assert, isString, isRegExp } = require('./validateTypes'); - -/** - * Search a CSS string for functions by name. - * For every match, invoke the callback, passing the function's - * "argument(s) string" (whatever is inside the parentheses) - * as an argument. - * - * Callback will be called once for every matching function found, - * with the function's "argument(s) string" and its starting index - * as the arguments. - * - * @param {string} source - * @param {string | RegExp} functionName - * @param {(expression: string, expressionIndex: number, funcNode: valueParser.FunctionNode) => void} callback - * @returns {valueParser.ParsedValue} - */ -module.exports = function functionArgumentsSearch(source, functionName, callback) { - return valueParser(source).walk((node) => { - if (node.type !== 'function') return; - - const { value } = node; - - if (isString(functionName) && value !== functionName) return; - - if (isRegExp(functionName) && !functionName.test(node.value)) return; - - const parensMatch = balancedMatch('(', ')', source.slice(node.sourceIndex)); - - assert(parensMatch); - - const expression = parensMatch.body; - const parenLength = 1; // == '(' - const expressionIndex = node.sourceIndex + value.length + parenLength; - - callback(expression, expressionIndex, node); - }); -}; diff --git a/node_modules/stylelint/lib/utils/getAtRuleParams.js b/node_modules/stylelint/lib/utils/getAtRuleParams.js deleted file mode 100644 index 93f5ad0b8..000000000 --- a/node_modules/stylelint/lib/utils/getAtRuleParams.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -/** - * @param {import('postcss').AtRule} atRule - * @returns {string} - */ -module.exports = function getAtRuleParams(atRule) { - return atRule.raws.params?.raw ?? atRule.params; -}; diff --git a/node_modules/stylelint/lib/utils/getCacheFile.js b/node_modules/stylelint/lib/utils/getCacheFile.js deleted file mode 100644 index 08d91a369..000000000 --- a/node_modules/stylelint/lib/utils/getCacheFile.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const hash = require('./hash'); -const path = require('path'); - -/** - * Return the cacheFile to be used by stylelint, based on whether the provided parameter is - * a directory or looks like a directory (ends in `path.sep`), in which case the file - * name will be `cacheFile/.cache_hashOfCWD`. - * - * If cacheFile points to a file or looks like a file, then it will just use that file. - * - * @param {string} cacheFile - The name of file to be used to store the cache - * @param {string} cwd - Current working directory. Used for tests - * @returns {string} Resolved path to the cache file - */ -module.exports = function getCacheFile(cacheFile, cwd) { - /* - * Make sure path separators are normalized for environment/os. - * Also, keep trailing path separator if present. - */ - cacheFile = path.normalize(cacheFile); - - const resolvedCacheFile = path.resolve(cwd, cacheFile); - // If the last character passed is a path separator, we assume is a directory. - const looksLikeADirectory = cacheFile[cacheFile.length - 1] === path.sep; - - /** - * Return the default cache file name when provided parameter is a directory. - * @returns {string} - Resolved path to the cacheFile - */ - function getCacheFileForDirectory() { - return path.join(resolvedCacheFile, `.stylelintcache_${hash(cwd)}`); - } - - let fileStats; - - try { - fileStats = fs.lstatSync(resolvedCacheFile); - } catch { - fileStats = null; - } - - if (looksLikeADirectory || (fileStats && fileStats.isDirectory())) { - // Return path to provided directory with generated file name. - return getCacheFileForDirectory(); - } - - // Return normalized path to cache file. - return resolvedCacheFile; -}; diff --git a/node_modules/stylelint/lib/utils/getDeclarationValue.js b/node_modules/stylelint/lib/utils/getDeclarationValue.js deleted file mode 100644 index f6ff980f7..000000000 --- a/node_modules/stylelint/lib/utils/getDeclarationValue.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * @param {import('postcss').Declaration} decl - * @returns {string} - */ -module.exports = function getDeclarationValue(decl) { - const raws = decl.raws; - - return (raws.value && raws.value.raw) || decl.value; -}; diff --git a/node_modules/stylelint/lib/utils/getDimension.js b/node_modules/stylelint/lib/utils/getDimension.js deleted file mode 100644 index 2cacd79f1..000000000 --- a/node_modules/stylelint/lib/utils/getDimension.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -const blurInterpolation = require('./blurInterpolation'); -const isStandardSyntaxValue = require('./isStandardSyntaxValue'); -const valueParser = require('postcss-value-parser'); - -/** - * Get Dimension from value node; - * `unit` and `number` return null if neither is found - * - * @param {import('postcss-value-parser').Node} node - * - * @returns {{unit: null, number: null} | valueParser.Dimension} - */ -module.exports = function getDimension(node) { - if (!node || !node.value) { - return { - unit: null, - number: null, - }; - } - - // Ignore non-word nodes - if (node.type !== 'word') { - return { - unit: null, - number: null, - }; - } - - // Ignore non standard syntax - if (!isStandardSyntaxValue(node.value)) { - return { - unit: null, - number: null, - }; - } - - // Ignore HEX - if (node.value.startsWith('#')) { - return { - unit: null, - number: null, - }; - } - - // Remove non standard stuff - const value = blurInterpolation(node.value, '') - // ignore hack unit - .replace('\\0', '') - .replace('\\9', ''); - - const parsedUnit = valueParser.unit(value); - - if (!parsedUnit) { - return { - unit: null, - number: null, - }; - } - - return parsedUnit; -}; diff --git a/node_modules/stylelint/lib/utils/getFileIgnorer.js b/node_modules/stylelint/lib/utils/getFileIgnorer.js deleted file mode 100644 index 6c22ab48f..000000000 --- a/node_modules/stylelint/lib/utils/getFileIgnorer.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const path = require('path'); -const { default: ignore } = require('ignore'); - -const { DEFAULT_IGNORE_FILENAME } = require('../constants'); -const isPathNotFoundError = require('./isPathNotFoundError'); - -/** - * @typedef {import('stylelint').LinterOptions} LinterOptions - * - * @param {Pick & { cwd: string }} options - * @return {import('ignore').Ignore} - */ -module.exports = function getFileIgnorer({ ignorePath, ignorePattern, cwd }) { - const ignorer = ignore(); - const ignorePaths = [ignorePath || []].flat(); - - if (ignorePaths.length === 0) { - ignorePaths.push(DEFAULT_IGNORE_FILENAME); - } - - for (const ignoreFilePath of ignorePaths) { - const absoluteIgnoreFilePath = path.isAbsolute(ignoreFilePath) - ? ignoreFilePath - : path.resolve(cwd, ignoreFilePath); - - try { - const ignoreText = fs.readFileSync(absoluteIgnoreFilePath, 'utf8'); - - ignorer.add(ignoreText); - } catch (readError) { - if (!isPathNotFoundError(readError)) { - throw readError; - } - } - } - - if (ignorePattern) ignorer.add(ignorePattern); - - return ignorer; -}; diff --git a/node_modules/stylelint/lib/utils/getFormatterOptionsText.js b/node_modules/stylelint/lib/utils/getFormatterOptionsText.js deleted file mode 100644 index c2f0a1374..000000000 --- a/node_modules/stylelint/lib/utils/getFormatterOptionsText.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -const formatters = require('../formatters'); - -/** - * @param {string} separator - * @param {string} [quote] - * @returns {string} - */ -module.exports = function getFormatterOptionsText(separator, quote = '') { - return Object.keys(formatters) - .map((name) => `${quote}${name}${quote}`) - .join(separator); -}; diff --git a/node_modules/stylelint/lib/utils/getImportantPosition.js b/node_modules/stylelint/lib/utils/getImportantPosition.js deleted file mode 100644 index be52d5958..000000000 --- a/node_modules/stylelint/lib/utils/getImportantPosition.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -/** - * Returns a position of `!important` (or `! important` including whitespaces) - * from the specified CSS source code. If not found, returns `undefined`. - * - * @param {string} source - * @returns {{ index: number, endIndex: number } | undefined} - */ -module.exports = function getImportantPosition(source) { - const pattern = /!\s*important\b/gi; - const match = pattern.exec(source); - - if (!match) return; - - return { index: match.index, endIndex: pattern.lastIndex }; -}; diff --git a/node_modules/stylelint/lib/utils/getModulePath.js b/node_modules/stylelint/lib/utils/getModulePath.js deleted file mode 100644 index 873b7a9e6..000000000 --- a/node_modules/stylelint/lib/utils/getModulePath.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const configurationError = require('./configurationError'); -const globalModules = require('global-modules'); -const resolveFrom = require('resolve-from'); - -/** - * @param {string} basedir - * @param {string} lookup - * @param {string} [cwd] - * @return {string} - */ -module.exports = function getModulePath(basedir, lookup, cwd = process.cwd()) { - // 1. Try to resolve from the provided directory - // 2. Try to resolve from `cwd` or `process.cwd()` - // 3. Try to resolve from global `node_modules` directory - let path = resolveFrom.silent(basedir, lookup); - - if (!path) { - path = resolveFrom.silent(cwd, lookup); - } - - if (!path) { - path = resolveFrom.silent(globalModules, lookup); - } - - if (!path) { - throw configurationError( - `Could not find "${lookup}". Do you need the "configBasedir" or "--config-basedir" option?`, - ); - } - - return path; -}; diff --git a/node_modules/stylelint/lib/utils/getNextNonSharedLineCommentNode.js b/node_modules/stylelint/lib/utils/getNextNonSharedLineCommentNode.js deleted file mode 100644 index c93cd9190..000000000 --- a/node_modules/stylelint/lib/utils/getNextNonSharedLineCommentNode.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -/** @typedef {import('postcss').Node} Node */ - -/** - * @param {Node | void} node - */ -function getNodeLine(node) { - return node && node.source && node.source.start && node.source.start.line; -} - -/** - * @param {Node | void} node - * @returns {Node | void} - */ -module.exports = function getNextNonSharedLineCommentNode(node) { - if (node === undefined) { - return undefined; - } - - /** @type {Node | void} */ - const nextNode = node.next(); - - if (!nextNode || nextNode.type !== 'comment') { - return nextNode; - } - - if ( - getNodeLine(node) === getNodeLine(nextNode) || - getNodeLine(nextNode) === getNodeLine(nextNode.next()) - ) { - return getNextNonSharedLineCommentNode(nextNode); - } - - return nextNode; -}; diff --git a/node_modules/stylelint/lib/utils/getOsEol.js b/node_modules/stylelint/lib/utils/getOsEol.js deleted file mode 100644 index 6303f0b18..000000000 --- a/node_modules/stylelint/lib/utils/getOsEol.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const os = require('os'); - -// This function simply provides roundabout way of getting os.EOL -// so we can mock this for Jest tests -function getOsEl() { - return os.EOL; -} - -module.exports = getOsEl; diff --git a/node_modules/stylelint/lib/utils/getPreviousNonSharedLineCommentNode.js b/node_modules/stylelint/lib/utils/getPreviousNonSharedLineCommentNode.js deleted file mode 100644 index 6528dd7e3..000000000 --- a/node_modules/stylelint/lib/utils/getPreviousNonSharedLineCommentNode.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -/** @typedef {import('postcss').Node} Node */ - -/** - * @param {Node} node - */ -function getNodeLine(node) { - return node.source && node.source.start && node.source.start.line; -} - -/** - * @param {Node | undefined} node - * @returns {Node | undefined} - */ -module.exports = function getPreviousNonSharedLineCommentNode(node) { - if (node === undefined) { - return undefined; - } - - const previousNode = node.prev(); - - if (!previousNode || previousNode.type !== 'comment') { - return previousNode; - } - - if (getNodeLine(node) === getNodeLine(previousNode)) { - return getPreviousNonSharedLineCommentNode(previousNode); - } - - const previousNode2 = previousNode.prev(); - - if (previousNode2 && getNodeLine(previousNode) === getNodeLine(previousNode2)) { - return getPreviousNonSharedLineCommentNode(previousNode); - } - - return previousNode; -}; diff --git a/node_modules/stylelint/lib/utils/getRuleSelector.js b/node_modules/stylelint/lib/utils/getRuleSelector.js deleted file mode 100644 index ab84445b3..000000000 --- a/node_modules/stylelint/lib/utils/getRuleSelector.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * @param {import('postcss').Rule} ruleNode - * @returns {string} - */ -module.exports = function getRuleSelector(ruleNode) { - const raws = ruleNode.raws; - - return (raws.selector && raws.selector.raw) || ruleNode.selector; -}; diff --git a/node_modules/stylelint/lib/utils/getSchemeFromUrl.js b/node_modules/stylelint/lib/utils/getSchemeFromUrl.js deleted file mode 100644 index fc0d8c6e7..000000000 --- a/node_modules/stylelint/lib/utils/getSchemeFromUrl.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -const { URL } = require('url'); - -/** - * Get unit from value node - * - * Returns `null` if the unit is not found. - * - * @param {string} urlString - */ -module.exports = function getSchemeFromUrl(urlString) { - let protocol = null; - - try { - protocol = new URL(urlString).protocol; - } catch { - return null; - } - - if (protocol === null || typeof protocol === 'undefined') { - return null; - } - - const scheme = protocol.slice(0, -1); // strip trailing `:` - - // The URL spec does not require a scheme to be followed by `//`, but checking - // for it allows this rule to differentiate : urls from - // : urls. `data:` scheme urls are an exception to this rule. - const slashIndex = protocol.length; - const expectedSlashes = urlString.slice(slashIndex, slashIndex + 2); - const isSchemeLessUrl = expectedSlashes !== '//' && scheme !== 'data'; - - if (isSchemeLessUrl) { - return null; - } - - return scheme; -}; diff --git a/node_modules/stylelint/lib/utils/getStylelintRule.js b/node_modules/stylelint/lib/utils/getStylelintRule.js deleted file mode 100644 index 401cf5a52..000000000 --- a/node_modules/stylelint/lib/utils/getStylelintRule.js +++ /dev/null @@ -1,10 +0,0 @@ -const rules = require('../rules'); - -/** - * @param {string} ruleName - * @param {import('stylelint').Config | undefined} [config] - * @returns {import('stylelint').Rule | undefined} - */ -module.exports = function getStylelintRule(ruleName, config) { - return rules[ruleName] || (config && config.pluginFunctions && config.pluginFunctions[ruleName]); -}; diff --git a/node_modules/stylelint/lib/utils/hasANPlusBNotationPseudoClasses.js b/node_modules/stylelint/lib/utils/hasANPlusBNotationPseudoClasses.js deleted file mode 100644 index 41a367a59..000000000 --- a/node_modules/stylelint/lib/utils/hasANPlusBNotationPseudoClasses.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -const { - aNPlusBNotationPseudoClasses, - aNPlusBOfSNotationPseudoClasses, -} = require('../reference/selectors'); - -const classes = [ - ...aNPlusBNotationPseudoClasses.values(), - ...aNPlusBOfSNotationPseudoClasses.values(), -].join('|'); -const HAS_A_N_PLUS_B_NOTATION_PSEUDO_CLASSES = new RegExp(`\\b:(?:${classes})\\(`, 'i'); - -/** - * Check if a selector contains any pseudo class function that might contain an An+B notation - * - * @param {string} selector - * @returns {boolean} - */ -module.exports = function hasANPlusBNotationPseudoClasses(selector) { - return HAS_A_N_PLUS_B_NOTATION_PSEUDO_CLASSES.test(selector); -}; diff --git a/node_modules/stylelint/lib/utils/hasBlock.js b/node_modules/stylelint/lib/utils/hasBlock.js deleted file mode 100644 index 09e3b1f21..000000000 --- a/node_modules/stylelint/lib/utils/hasBlock.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * Check if a statement has an block (empty or otherwise). - * - * @param {import('postcss').Container} statement - * @return {boolean} True if `statement` has a block (empty or otherwise) - */ -module.exports = function hasBlock(statement) { - return statement.nodes !== undefined; -}; diff --git a/node_modules/stylelint/lib/utils/hasColorFunction.js b/node_modules/stylelint/lib/utils/hasColorFunction.js deleted file mode 100644 index 2c6cac09f..000000000 --- a/node_modules/stylelint/lib/utils/hasColorFunction.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -const { colorFunctions } = require('../reference/functions'); - -const HAS_COLOR_FUNCTION = new RegExp(`\\b(?:${[...colorFunctions.values()].join('|')})\\(`, 'i'); - -/** - * Check if a value contains any standard CSS color function - * - * @param {string} value - * @returns {boolean} - */ -module.exports = function hasColorFunction(value) { - return HAS_COLOR_FUNCTION.test(value); -}; diff --git a/node_modules/stylelint/lib/utils/hasDimension.js b/node_modules/stylelint/lib/utils/hasDimension.js deleted file mode 100644 index 14d3ea1a6..000000000 --- a/node_modules/stylelint/lib/utils/hasDimension.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const HAS_DIMENSION_LIKE_VALUES = /\d[%\w-]/; - -/** - * Check if a value contains any dimension-like values. - * - * @param {string} value - * @returns {boolean} - */ -module.exports = function hasDimension(value) { - return HAS_DIMENSION_LIKE_VALUES.test(value); -}; diff --git a/node_modules/stylelint/lib/utils/hasEmptyBlock.js b/node_modules/stylelint/lib/utils/hasEmptyBlock.js deleted file mode 100644 index eb7076967..000000000 --- a/node_modules/stylelint/lib/utils/hasEmptyBlock.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const hasBlock = require('./hasBlock'); - -/** - * Check if a statement has an empty block. - * - * @param {import('postcss').Rule | import('postcss').AtRule} statement - postcss rule or at-rule node - * @return {boolean} True if the statement has a block and it is empty - */ -module.exports = function hasEmptyBlock(statement) { - return hasBlock(statement) && statement.nodes.length === 0; -}; diff --git a/node_modules/stylelint/lib/utils/hasEmptyLine.js b/node_modules/stylelint/lib/utils/hasEmptyLine.js deleted file mode 100644 index 64a7898ac..000000000 --- a/node_modules/stylelint/lib/utils/hasEmptyLine.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -const HAS_EMPTY_LINE = /\n[\r\t ]*\n/; - -/** - * Check if a string contains at least one empty line - * - * @param {string | undefined} string - * @returns {boolean} - */ -module.exports = function hasEmptyLine(string) { - if (string === '' || string === undefined) return false; - - return HAS_EMPTY_LINE.test(string); -}; diff --git a/node_modules/stylelint/lib/utils/hasInterpolation.js b/node_modules/stylelint/lib/utils/hasInterpolation.js deleted file mode 100644 index 4329a7fc6..000000000 --- a/node_modules/stylelint/lib/utils/hasInterpolation.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -const hasLessInterpolation = require('../utils/hasLessInterpolation'); -const hasPsvInterpolation = require('../utils/hasPsvInterpolation'); -const hasScssInterpolation = require('../utils/hasScssInterpolation'); -const hasTplInterpolation = require('../utils/hasTplInterpolation'); - -/** - * Check whether a string has interpolation - * - * @param {string} string - * @return {boolean} If `true`, a string has interpolation - */ -module.exports = function hasInterpolation(string) { - // SCSS or Less interpolation - if ( - hasLessInterpolation(string) || - hasScssInterpolation(string) || - hasTplInterpolation(string) || - hasPsvInterpolation(string) - ) { - return true; - } - - return false; -}; diff --git a/node_modules/stylelint/lib/utils/hasLessInterpolation.js b/node_modules/stylelint/lib/utils/hasLessInterpolation.js deleted file mode 100644 index 8477c706b..000000000 --- a/node_modules/stylelint/lib/utils/hasLessInterpolation.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const HAS_LESS_INTERPOLATION = /@\{.+?\}/; - -/** - * Check whether a string has less interpolation - * - * @param {string} string - * @return {boolean} If `true`, a string has less interpolation - */ -module.exports = function hasLessInterpolation(string) { - return HAS_LESS_INTERPOLATION.test(string); -}; diff --git a/node_modules/stylelint/lib/utils/hasNamedColor.js b/node_modules/stylelint/lib/utils/hasNamedColor.js deleted file mode 100644 index 01f17317f..000000000 --- a/node_modules/stylelint/lib/utils/hasNamedColor.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -const { namedColorsKeywords } = require('../reference/keywords'); - -const HAS_NAMED_COLOR = new RegExp(`\\b(?:${[...namedColorsKeywords.values()].join('|')})\\b`, 'i'); - -/** - * Check if a value contains any standard CSS named color - * - * `transparent` and `currentcolor` are not named colors - * - * @param {string} value - * @returns {boolean} - */ -module.exports = function hasNamedColor(value) { - return HAS_NAMED_COLOR.test(value); -}; diff --git a/node_modules/stylelint/lib/utils/hasPrefix.js b/node_modules/stylelint/lib/utils/hasPrefix.js deleted file mode 100644 index 07023ca6d..000000000 --- a/node_modules/stylelint/lib/utils/hasPrefix.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -const { prefixes } = require('../reference/prefixes'); - -const HAS_PREFIX_REGEX = new RegExp(`(?:${[...prefixes].join('|')})`, 'i'); - -/** - * Check if a string contains any prefix - * - * @param {string} string - * @returns {boolean} - */ -module.exports = function hasPrefix(string) { - return HAS_PREFIX_REGEX.test(string); -}; diff --git a/node_modules/stylelint/lib/utils/hasPsvInterpolation.js b/node_modules/stylelint/lib/utils/hasPsvInterpolation.js deleted file mode 100644 index 2ab3c9dde..000000000 --- a/node_modules/stylelint/lib/utils/hasPsvInterpolation.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -const HAS_PSV_INTERPOLATION = /\$\(.+?\)/; - -/** - * Check whether a string has postcss-simple-vars interpolation - * - * @param {string} string - */ -module.exports = function hasPsvInterpolation(string) { - return HAS_PSV_INTERPOLATION.test(string); -}; diff --git a/node_modules/stylelint/lib/utils/hasScssInterpolation.js b/node_modules/stylelint/lib/utils/hasScssInterpolation.js deleted file mode 100644 index c2d970fe2..000000000 --- a/node_modules/stylelint/lib/utils/hasScssInterpolation.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -const HAS_SCSS_INTERPOLATION = /#\{.+?\}/; - -/** - * Check whether a string has scss interpolation - * - * @param {string} string - */ -module.exports = function hasScssInterpolation(string) { - return HAS_SCSS_INTERPOLATION.test(string); -}; diff --git a/node_modules/stylelint/lib/utils/hasTplInterpolation.js b/node_modules/stylelint/lib/utils/hasTplInterpolation.js deleted file mode 100644 index 0cd4fbfb9..000000000 --- a/node_modules/stylelint/lib/utils/hasTplInterpolation.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const HAS_TPL_INTERPOLATION = /\{.+?\}/; - -/** - * Check whether a string has JS template literal interpolation or HTML-like template - * - * @param {string} string - * @return {boolean} If `true`, a string has template literal interpolation - */ -module.exports = function hasTplInterpolation(string) { - return HAS_TPL_INTERPOLATION.test(string); -}; diff --git a/node_modules/stylelint/lib/utils/hasValidHex.js b/node_modules/stylelint/lib/utils/hasValidHex.js deleted file mode 100644 index f2d5fc33b..000000000 --- a/node_modules/stylelint/lib/utils/hasValidHex.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const HAS_VALID_HEX = /#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})(?:$|[^\da-f])/i; - -/** - * Check if a value contains a valid 3, 4, 6 or 8 digit hex - * - * @param {string} value - * @returns {boolean} - */ -module.exports = function hasValidHex(value) { - return HAS_VALID_HEX.test(value); -}; diff --git a/node_modules/stylelint/lib/utils/hash.js b/node_modules/stylelint/lib/utils/hash.js deleted file mode 100644 index 200578f26..000000000 --- a/node_modules/stylelint/lib/utils/hash.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -const murmur = require('imurmurhash'); - -/** - * hash the given string - * @param {string} str the string to hash - * @returns {string} the hash - */ -module.exports = function hash(str) { - return murmur(str).result().toString(36); -}; diff --git a/node_modules/stylelint/lib/utils/isAfterComment.js b/node_modules/stylelint/lib/utils/isAfterComment.js deleted file mode 100644 index eb3a8b53b..000000000 --- a/node_modules/stylelint/lib/utils/isAfterComment.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const isSharedLineComment = require('./isSharedLineComment'); - -/** - * @param {import('postcss').Node} node - */ -module.exports = function isAfterComment(node) { - const previousNode = node.prev(); - - if (!previousNode || previousNode.type !== 'comment') { - return false; - } - - return !isSharedLineComment(previousNode); -}; diff --git a/node_modules/stylelint/lib/utils/isAfterSingleLineComment.js b/node_modules/stylelint/lib/utils/isAfterSingleLineComment.js deleted file mode 100644 index 71364a8c0..000000000 --- a/node_modules/stylelint/lib/utils/isAfterSingleLineComment.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -const isSharedLineComment = require('./isSharedLineComment'); - -/** - * @param {import('postcss').Node} node - */ -function isAfterSingleLineComment(node) { - const prevNode = node.prev(); - - return ( - prevNode !== undefined && - prevNode.type === 'comment' && - !isSharedLineComment(prevNode) && - prevNode.source && - prevNode.source.start && - prevNode.source.end && - prevNode.source.start.line === prevNode.source.end.line - ); -} - -module.exports = isAfterSingleLineComment; diff --git a/node_modules/stylelint/lib/utils/isAfterStandardPropertyDeclaration.js b/node_modules/stylelint/lib/utils/isAfterStandardPropertyDeclaration.js deleted file mode 100644 index e118b4346..000000000 --- a/node_modules/stylelint/lib/utils/isAfterStandardPropertyDeclaration.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode'); -const isCustomProperty = require('./isCustomProperty'); -const isStandardSyntaxDeclaration = require('./isStandardSyntaxDeclaration'); -const { isDeclaration } = require('./typeGuards'); - -/** - * @param {import('postcss').Node} node - */ -module.exports = function isAfterStandardPropertyDeclaration(node) { - const prevNode = getPreviousNonSharedLineCommentNode(node); - - return ( - prevNode !== undefined && - isDeclaration(prevNode) && - isStandardSyntaxDeclaration(prevNode) && - !isCustomProperty(prevNode.prop || '') - ); -}; diff --git a/node_modules/stylelint/lib/utils/isAutoprefixable.js b/node_modules/stylelint/lib/utils/isAutoprefixable.js deleted file mode 100644 index 2e1618b4d..000000000 --- a/node_modules/stylelint/lib/utils/isAutoprefixable.js +++ /dev/null @@ -1,339 +0,0 @@ -'use strict'; - -const vendor = require('./vendor'); - -/** - * Extract each list using the internal API of Autoprefixer 10.2.5. - * - * @see https://github.com/postcss/autoprefixer/tree/10.2.5 - * - * @example - * const autoprefixer = require('autoprefixer'); - * const Browsers = require('autoprefixer/lib/browsers'); - * const Prefixes = require('autoprefixer/lib/prefixes'); - * const utils = require('autoprefixer/lib/utils'); - * - * const prefixes = new Prefixes(autoprefixer.data.prefixes, new Browsers(autoprefixer.data.browsers, [])); - */ - -/** - * @example - * Object.keys(prefixes.remove).filter((s) => s.startsWith('@')); - */ -const AT_RULES = new Set([ - '@-khtml-keyframes', - '@-moz-keyframes', - '@-ms-keyframes', - '@-ms-viewport', - '@-o-keyframes', - '@-o-viewport', - '@-webkit-keyframes', - '@resolution', -]); - -/** - * @example - * prefixes.remove.selectors.map((s) => s.prefixed); - */ -const SELECTORS = new Set([ - ':-moz-any-link', - ':-moz-full-screen', - ':-moz-placeholder', - ':-moz-placeholder-shown', - ':-moz-read-only', - ':-moz-read-write', - ':-ms-fullscreen', - ':-ms-input-placeholder', - ':-webkit-any-link', - ':-webkit-full-screen', - '::-moz-placeholder', - '::-moz-selection', - '::-ms-input-placeholder', - '::-webkit-backdrop', - '::-webkit-input-placeholder', -]); - -/** - * @example - * Object.entries(autoprefixer.data.prefixes) - * .filter(([key, value]) => !value.selector && !value.props && !key.startsWith('@')) - * .map(([key, value]) => key); - */ -const PROPERTIES = new Set([ - 'align-content', - 'align-items', - 'align-self', - 'animation', - 'animation-delay', - 'animation-direction', - 'animation-duration', - 'animation-fill-mode', - 'animation-iteration-count', - 'animation-name', - 'animation-play-state', - 'animation-timing-function', - 'appearance', - 'backdrop-filter', - 'backface-visibility', - 'background-clip', - 'background-origin', - 'background-size', - 'border-block-end', - 'border-block-start', - 'border-bottom-left-radius', - 'border-bottom-right-radius', - 'border-image', - 'border-inline-end', - 'border-inline-start', - 'border-radius', - 'border-top-left-radius', - 'border-top-right-radius', - 'box-decoration-break', - 'box-shadow', - 'box-sizing', - 'break-after', - 'break-before', - 'break-inside', - 'clip-path', - 'color-adjust', - 'column-count', - 'column-fill', - 'column-gap', - 'column-rule', - 'column-rule-color', - 'column-rule-style', - 'column-rule-width', - 'column-span', - 'column-width', - 'columns', - 'filter', - 'flex', - 'flex-basis', - 'flex-direction', - 'flex-flow', - 'flex-grow', - 'flex-shrink', - 'flex-wrap', - 'flow-from', - 'flow-into', - 'font-feature-settings', - 'font-kerning', - 'font-language-override', - 'font-variant-ligatures', - 'grid-area', - 'grid-column', - 'grid-column-align', - 'grid-column-end', - 'grid-column-start', - 'grid-row', - 'grid-row-align', - 'grid-row-end', - 'grid-row-start', - 'grid-template', - 'grid-template-areas', - 'grid-template-columns', - 'grid-template-rows', - 'hyphens', - 'image-rendering', - 'justify-content', - 'margin-block-end', - 'margin-block-start', - 'margin-inline-end', - 'margin-inline-start', - 'mask', - 'mask-border', - 'mask-border-outset', - 'mask-border-repeat', - 'mask-border-slice', - 'mask-border-source', - 'mask-border-width', - 'mask-clip', - 'mask-composite', - 'mask-image', - 'mask-origin', - 'mask-position', - 'mask-repeat', - 'mask-size', - 'object-fit', - 'object-position', - 'order', - 'overscroll-behavior', - 'padding-block-end', - 'padding-block-start', - 'padding-inline-end', - 'padding-inline-start', - 'perspective', - 'perspective-origin', - 'place-self', - 'region-fragment', - 'scroll-snap-coordinate', - 'scroll-snap-destination', - 'scroll-snap-points-x', - 'scroll-snap-points-y', - 'scroll-snap-type', - 'shape-image-threshold', - 'shape-margin', - 'shape-outside', - 'tab-size', - 'text-align-last', - 'text-decoration', - 'text-decoration-color', - 'text-decoration-line', - 'text-decoration-skip', - 'text-decoration-skip-ink', - 'text-decoration-style', - 'text-emphasis', - 'text-emphasis-color', - 'text-emphasis-position', - 'text-emphasis-style', - 'text-orientation', - 'text-overflow', - 'text-size-adjust', - 'text-spacing', - 'touch-action', - 'transform', - 'transform-origin', - 'transform-style', - 'transition', - 'transition-delay', - 'transition-duration', - 'transition-property', - 'transition-timing-function', - 'user-select', - 'writing-mode', -]); - -/** - * @example - * Object.values(prefixes.remove) - * .filter((p) => Array.isArray(p.values)) - * .flatMap((p) => p.values) - * .map((p) => utils.removeNote(p.prefixed)) // normalize '-webkit- old' - * .filter((p) => !p.endsWith('-')); // remove '-webkit-' only - * - * @see https://github.com/stylelint/stylelint/pull/5312/files#r636018013 - */ -const PROPERTY_VALUES = new Set([ - '-moz-available', - '-moz-box', - '-moz-calc', - '-moz-crisp-edges', - '-moz-element', - '-moz-fit-content', - '-moz-grab', - '-moz-grabbing', - '-moz-inline-box', - '-moz-isolate', - '-moz-isolate-override', - '-moz-linear-gradient', - '-moz-max-content', - '-moz-min-content', - '-moz-plaintext', - '-moz-radial-gradient', - '-moz-repeating-linear-gradient', - '-moz-repeating-radial-gradient', - '-moz-zoom-in', - '-moz-zoom-out', - '-ms-flexbox', - '-ms-grid', - '-ms-inline-flexbox', - '-ms-inline-grid', - '-ms-linear-gradient', - '-ms-radial-gradient', - '-ms-repeating-linear-gradient', - '-ms-repeating-radial-gradient', - '-o-linear-gradient', - '-o-pixelated', - '-o-radial-gradient', - '-o-repeating-linear-gradient', - '-o-repeating-radial-gradient', - '-webkit-box', - '-webkit-calc', - '-webkit-cross-fade', - '-webkit-fill-available', - '-webkit-filter', - '-webkit-fit-content', - '-webkit-flex', - '-webkit-grab', - '-webkit-grabbing', - '-webkit-image-set', - '-webkit-inline-box', - '-webkit-inline-flex', - '-webkit-isolate', - '-webkit-linear-gradient', - '-webkit-max-content', - '-webkit-min-content', - '-webkit-optimize-contrast', - '-webkit-radial-gradient', - '-webkit-repeating-linear-gradient', - '-webkit-repeating-radial-gradient', - '-webkit-sticky', - '-webkit-zoom-in', - '-webkit-zoom-out', -]); - -/** - * Most identifier types have to be looked up in a unique way, - * so we're exposing special functions for each. - */ -module.exports = { - /** - * @param {string} identifier - * @returns {boolean} - */ - atRuleName(identifier) { - return AT_RULES.has(`@${identifier.toLowerCase()}`); - }, - - /** - * @param {string} identifier - * @returns {boolean} - */ - selector(identifier) { - return SELECTORS.has(identifier.toLowerCase()); - }, - - /** - * @param {string} identifier - * @returns {boolean} - */ - mediaFeatureName(identifier) { - return identifier.toLowerCase().includes('device-pixel-ratio'); - }, - - /** - * @param {string} identifier - * @returns {boolean} - */ - property(identifier) { - const ident = identifier.toLowerCase(); - - // HACK: `interpolation-mode` does not exist. This is an IE extension for `image-rendering`. - // See - if (ident === '-ms-interpolation-mode') { - return true; - } - - if (vendor.prefix(ident).length === 0) { - return false; - } - - return PROPERTIES.has(vendor.unprefixed(ident)); - }, - - /** - * @param {string} value - * @returns {boolean} - */ - propertyValue(value) { - return PROPERTY_VALUES.has(value.toLowerCase()); - }, - - /** - * @param {string} value - * @returns {string} - */ - unprefix(value) { - return value.replace(/-\w+-/, ''); - }, -}; diff --git a/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterBlocklessAtRule.js b/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterBlocklessAtRule.js deleted file mode 100644 index 1f9e3bb8d..000000000 --- a/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterBlocklessAtRule.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode'); -const hasBlock = require('./hasBlock'); -const { isAtRule } = require('./typeGuards'); - -/** - * @param {import('postcss').AtRule} atRule - * @returns {boolean} - */ -module.exports = function isBlocklessAtRuleAfterBlocklessAtRule(atRule) { - if (atRule.type !== 'atrule') { - return false; - } - - const previousNode = getPreviousNonSharedLineCommentNode(atRule); - - if (previousNode === undefined) { - return false; - } - - return isAtRule(previousNode) && !hasBlock(previousNode) && !hasBlock(atRule); -}; diff --git a/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterSameNameBlocklessAtRule.js b/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterSameNameBlocklessAtRule.js deleted file mode 100644 index 503d8739c..000000000 --- a/node_modules/stylelint/lib/utils/isBlocklessAtRuleAfterSameNameBlocklessAtRule.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode'); -const isBlocklessAtRuleAfterBlocklessAtRule = require('./isBlocklessAtRuleAfterBlocklessAtRule'); -const { isAtRule } = require('./typeGuards'); - -/** - * @param {import('postcss').AtRule} atRule - * @returns {boolean} - */ -module.exports = function isBlocklessAtRuleAfterSameNameBlocklessAtRule(atRule) { - if (!isBlocklessAtRuleAfterBlocklessAtRule(atRule)) { - return false; - } - - const previousNode = getPreviousNonSharedLineCommentNode(atRule); - - if (previousNode && isAtRule(previousNode)) { - return previousNode.name === atRule.name; - } - - return false; -}; diff --git a/node_modules/stylelint/lib/utils/isContextFunctionalPseudoClass.js b/node_modules/stylelint/lib/utils/isContextFunctionalPseudoClass.js deleted file mode 100644 index c4d024666..000000000 --- a/node_modules/stylelint/lib/utils/isContextFunctionalPseudoClass.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -const { - aNPlusBOfSNotationPseudoClasses, - logicalCombinationsPseudoClasses, -} = require('../reference/selectors'); - -/** - * Check whether a node is a context-functional pseudo-class (i.e. either a logical combination - * or a 'aNPlusBOfSNotationPseudoClasses' / tree-structural pseudo-class) - * - * @param {import('postcss-selector-parser').Node} node - postcss-selector-parser node (of type pseudo) - * @return {node is import('postcss-selector-parser').Pseudo} If `true`, the node is a context-functional pseudo-class - */ -module.exports = function isContextFunctionalPseudoClass(node) { - if (node.type === 'pseudo') { - const normalisedParentName = node.value.toLowerCase().replace(/:+/, ''); - - return ( - logicalCombinationsPseudoClasses.has(normalisedParentName) || - aNPlusBOfSNotationPseudoClasses.has(normalisedParentName) - ); - } - - return false; -}; diff --git a/node_modules/stylelint/lib/utils/isCounterIncrementCustomIdentValue.js b/node_modules/stylelint/lib/utils/isCounterIncrementCustomIdentValue.js deleted file mode 100644 index ee425bf05..000000000 --- a/node_modules/stylelint/lib/utils/isCounterIncrementCustomIdentValue.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -const { counterIncrementKeywords } = require('../reference/keywords'); - -/** - * Check value is a custom ident - * - * @param {string} value - */ -module.exports = function isCounterIncrementCustomIdentValue(value) { - const valueLowerCase = value.toLowerCase(); - - if ( - counterIncrementKeywords.has(valueLowerCase) || - Number.isFinite(Number.parseInt(valueLowerCase, 10)) - ) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isCounterResetCustomIdentValue.js b/node_modules/stylelint/lib/utils/isCounterResetCustomIdentValue.js deleted file mode 100644 index 2afc9f3fa..000000000 --- a/node_modules/stylelint/lib/utils/isCounterResetCustomIdentValue.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -const { counterResetKeywords } = require('../reference/keywords'); - -/** - * Check value is a custom ident - * - * @param {string} value - */ -module.exports = function isCounterResetCustomIdentValue(value) { - const valueLowerCase = value.toLowerCase(); - - if ( - counterResetKeywords.has(valueLowerCase) || - Number.isFinite(Number.parseInt(valueLowerCase, 10)) - ) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isCustomElement.js b/node_modules/stylelint/lib/utils/isCustomElement.js deleted file mode 100644 index e777249cf..000000000 --- a/node_modules/stylelint/lib/utils/isCustomElement.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -const { htmlTypeSelectors } = require('../reference/selectors'); -const mathMLTags = require('mathml-tag-names'); -const svgTags = require('svg-tags'); - -/** - * Check whether a type selector is a custom element - * - * @param {string} selector - * @returns {boolean} - */ -module.exports = function isCustomElement(selector) { - if (!/^[a-z]/.test(selector)) { - return false; - } - - if (!selector.includes('-')) { - return false; - } - - const selectorLowerCase = selector.toLowerCase(); - - if (selectorLowerCase !== selector) { - return false; - } - - if (svgTags.includes(selectorLowerCase)) { - return false; - } - - if (htmlTypeSelectors.has(selectorLowerCase)) { - return false; - } - - if (mathMLTags.includes(selectorLowerCase)) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isCustomFunction.js b/node_modules/stylelint/lib/utils/isCustomFunction.js deleted file mode 100644 index 0f0f0b1e9..000000000 --- a/node_modules/stylelint/lib/utils/isCustomFunction.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * Check whether a function is custom / user-defined - * https://github.com/w3c/css-houdini-drafts/issues/1007 - * @param {string} func - * @returns {boolean} - */ -module.exports = function isCustomFunction(func) { - return func.startsWith('--'); -}; diff --git a/node_modules/stylelint/lib/utils/isCustomMediaQuery.js b/node_modules/stylelint/lib/utils/isCustomMediaQuery.js deleted file mode 100644 index 18a068618..000000000 --- a/node_modules/stylelint/lib/utils/isCustomMediaQuery.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -/** - * Check whether a media query is a custom - * @param {string} mediaQuery - * @returns {boolean} - */ -module.exports = function isCustomMediaQuery(mediaQuery) { - return mediaQuery.startsWith('--'); -}; diff --git a/node_modules/stylelint/lib/utils/isCustomProperty.js b/node_modules/stylelint/lib/utils/isCustomProperty.js deleted file mode 100644 index b4a33c7c2..000000000 --- a/node_modules/stylelint/lib/utils/isCustomProperty.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -/** - * Check whether a property is a custom one - * @param {string} property - * @returns {boolean} - */ -module.exports = function isCustomProperty(property) { - return property.startsWith('--'); -}; diff --git a/node_modules/stylelint/lib/utils/isCustomSelector.js b/node_modules/stylelint/lib/utils/isCustomSelector.js deleted file mode 100644 index 4cc3c86c9..000000000 --- a/node_modules/stylelint/lib/utils/isCustomSelector.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * Check whether a selector is a custom one - * - * @param {string} selector - * @returns {boolean} - */ -module.exports = function isCustomSelector(selector) { - return selector.startsWith(':--'); -}; diff --git a/node_modules/stylelint/lib/utils/isFirstNested.js b/node_modules/stylelint/lib/utils/isFirstNested.js deleted file mode 100644 index 56c55275c..000000000 --- a/node_modules/stylelint/lib/utils/isFirstNested.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; - -const { isComment, isDocument, isRoot, hasSource } = require('./typeGuards'); - -/** - * @param {import('postcss').Node} statement - * @returns {boolean} - */ -module.exports = function isFirstNested(statement) { - const parentNode = statement.parent; - - if (parentNode === undefined) { - return false; - } - - if (isRoot(parentNode) && !isInDocument(parentNode)) { - return false; - } - - if (statement === parentNode.first) { - return true; - } - - /* - * Search for the statement in the parent's nodes, ignoring comment - * nodes on the same line as the parent's opening brace. - */ - - const parentNodes = parentNode.nodes; - - if (!parentNodes) { - return false; - } - - const firstNode = parentNodes[0]; - - if (!firstNode) { - return false; - } - - if ( - !isComment(firstNode) || - (typeof firstNode.raws.before === 'string' && firstNode.raws.before.includes('\n')) - ) { - return false; - } - - if (!hasSource(firstNode) || !firstNode.source.start) { - return false; - } - - const openingBraceLine = firstNode.source.start.line; - - if (!firstNode.source.end || openingBraceLine !== firstNode.source.end.line) { - return false; - } - - for (const [index, node] of parentNodes.entries()) { - if (index === 0) { - continue; - } - - if (node === statement) { - return true; - } - - if ( - !isComment(node) || - (hasSource(node) && node.source.end && node.source.end.line !== openingBraceLine) - ) { - return false; - } - } - - /* istanbul ignore next: Should always return in the loop */ - return false; -}; - -/** - * @param {import('postcss').Node} node - * @returns {boolean} - */ -function isInDocument({ parent }) { - return Boolean(parent && isDocument(parent)); -} diff --git a/node_modules/stylelint/lib/utils/isFirstNodeOfRoot.js b/node_modules/stylelint/lib/utils/isFirstNodeOfRoot.js deleted file mode 100644 index dbdf4911f..000000000 --- a/node_modules/stylelint/lib/utils/isFirstNodeOfRoot.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const { isRoot } = require('./typeGuards'); - -/** - * @param {import('postcss').Node} node - * @returns {boolean} - */ -module.exports = function isFirstNodeOfRoot(node) { - if (isRoot(node)) return false; - - const parentNode = node.parent; - - if (!parentNode) { - return false; - } - - return isRoot(parentNode) && node === parentNode.first; -}; diff --git a/node_modules/stylelint/lib/utils/isKeyframeRule.js b/node_modules/stylelint/lib/utils/isKeyframeRule.js deleted file mode 100644 index 015ea4eca..000000000 --- a/node_modules/stylelint/lib/utils/isKeyframeRule.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const { isAtRule } = require('./typeGuards'); - -/** - * Check if a rule is a keyframe one - * - * @param {import('postcss').Rule} rule - * @returns {boolean} - */ -module.exports = function isKeyframeRule(rule) { - const parent = rule.parent; - - if (!parent) { - return false; - } - - return isAtRule(parent) && parent.name.toLowerCase() === 'keyframes'; -}; diff --git a/node_modules/stylelint/lib/utils/isKeyframeSelector.js b/node_modules/stylelint/lib/utils/isKeyframeSelector.js deleted file mode 100644 index 70ca5d64d..000000000 --- a/node_modules/stylelint/lib/utils/isKeyframeSelector.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -const { keyframeSelectorKeywords } = require('../reference/keywords'); - -/** - * Check whether a string is a keyframe selector. - * - * @param {string} selector - * @returns {boolean} - */ -module.exports = function isKeyframeSelector(selector) { - if (keyframeSelectorKeywords.has(selector)) { - return true; - } - - // Percentages - if (/^(?:\d+|\d*\.\d+)%$/.test(selector)) { - return true; - } - - return false; -}; diff --git a/node_modules/stylelint/lib/utils/isMathFunction.js b/node_modules/stylelint/lib/utils/isMathFunction.js deleted file mode 100644 index e91775875..000000000 --- a/node_modules/stylelint/lib/utils/isMathFunction.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const { mathFunctions } = require('../reference/functions'); - -/** - * Check whether a node is math function - * - * @param {import('postcss-value-parser').Node} node postcss-value-parser node - * @return {boolean} If `true`, the node is math function - */ -module.exports = function isMathFunction(node) { - return node.type === 'function' && mathFunctions.has(node.value.toLowerCase()); -}; diff --git a/node_modules/stylelint/lib/utils/isNonNegativeInteger.js b/node_modules/stylelint/lib/utils/isNonNegativeInteger.js deleted file mode 100644 index 044467e08..000000000 --- a/node_modules/stylelint/lib/utils/isNonNegativeInteger.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * @param {unknown} value - */ -module.exports = function isNonNegativeInteger(value) { - return Number.isInteger(value) && typeof value === 'number' && value >= 0; -}; diff --git a/node_modules/stylelint/lib/utils/isNumbery.js b/node_modules/stylelint/lib/utils/isNumbery.js deleted file mode 100644 index ceb31542d..000000000 --- a/node_modules/stylelint/lib/utils/isNumbery.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * Check whether it's a number or a number-like string: - * i.e. when coerced to a number it == itself. - * - * @param {string | number} value - */ -module.exports = function isNumbery(value) { - return value.toString().trim().length !== 0 && Number(value) == value; // eslint-disable-line eqeqeq -}; diff --git a/node_modules/stylelint/lib/utils/isOnlyWhitespace.js b/node_modules/stylelint/lib/utils/isOnlyWhitespace.js deleted file mode 100644 index d8ddf00b0..000000000 --- a/node_modules/stylelint/lib/utils/isOnlyWhitespace.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const isWhitespace = require('./isWhitespace'); - -/** - * Returns a Boolean indicating whether the input string is only whitespace. - * - * @param {string} input - * @returns {boolean} - */ -module.exports = function isOnlyWhitespace(input) { - for (const element of input) { - if (!isWhitespace(element)) { - return false; - } - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isPathNotFoundError.js b/node_modules/stylelint/lib/utils/isPathNotFoundError.js deleted file mode 100644 index a95c35368..000000000 --- a/node_modules/stylelint/lib/utils/isPathNotFoundError.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const util = require('util'); - -/** - * @param {unknown} error - * @returns {error is NodeJS.ErrnoException} - */ -module.exports = function isPathNotFoundError(error) { - return util.types.isNativeError(error) && 'code' in error && error.code === 'ENOENT'; -}; diff --git a/node_modules/stylelint/lib/utils/isScssVariable.js b/node_modules/stylelint/lib/utils/isScssVariable.js deleted file mode 100644 index f7012e629..000000000 --- a/node_modules/stylelint/lib/utils/isScssVariable.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -/** - * Check whether a property is SCSS variable - * - * @param {string} property - * @returns {boolean} - */ -module.exports = function isScssVariable(property) { - // SCSS var (e.g. $var: x), list (e.g. $list: (x)) or map (e.g. $map: (key:value)) - if (property.startsWith('$')) { - return true; - } - - // SCSS var within a namespace (e.g. namespace.$var: x) - if (property.includes('.$')) { - return true; - } - - return false; -}; diff --git a/node_modules/stylelint/lib/utils/isSharedLineComment.js b/node_modules/stylelint/lib/utils/isSharedLineComment.js deleted file mode 100644 index 14ab57d86..000000000 --- a/node_modules/stylelint/lib/utils/isSharedLineComment.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -const getNextNonSharedLineCommentNode = require('./getNextNonSharedLineCommentNode'); -const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode'); -const { isRoot, isComment } = require('./typeGuards'); - -/** @typedef {import('postcss').Node} PostcssNode */ - -/** - * - * @param {PostcssNode | void} a - * @param {PostcssNode | void} b - */ -function nodesShareLines(a, b) { - const endLine = a && a.source && a.source.end && a.source.end.line; - const startLine = b && b.source && b.source.start && b.source.start.line; - - return endLine === startLine; -} - -/** - * @param {PostcssNode} node - * @returns {boolean} - */ -module.exports = function isSharedLineComment(node) { - if (!isComment(node)) { - return false; - } - - const previousNonSharedLineCommentNode = getPreviousNonSharedLineCommentNode(node); - - if (nodesShareLines(previousNonSharedLineCommentNode, node)) { - return true; - } - - const nextNonSharedLineCommentNode = getNextNonSharedLineCommentNode(node); - - if (nextNonSharedLineCommentNode && nodesShareLines(node, nextNonSharedLineCommentNode)) { - return true; - } - - const parentNode = node.parent; - - // It's a first child and located on the same line as block start - if ( - parentNode !== undefined && - !isRoot(parentNode) && - parentNode.index(node) === 0 && - node.raws.before !== undefined && - !node.raws.before.includes('\n') - ) { - return true; - } - - return false; -}; diff --git a/node_modules/stylelint/lib/utils/isSingleLineString.js b/node_modules/stylelint/lib/utils/isSingleLineString.js deleted file mode 100644 index 152be8cc9..000000000 --- a/node_modules/stylelint/lib/utils/isSingleLineString.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -/** - * Check if a string is a single line (i.e. does not contain - * any newline characters). - * - * @param {string} input - * @return {boolean} - */ -module.exports = function isSingleLineString(input) { - return !/[\n\r]/.test(input); -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxAtRule.js b/node_modules/stylelint/lib/utils/isStandardSyntaxAtRule.js deleted file mode 100644 index 7ee34c2f2..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxAtRule.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -/** - * Check whether a at-rule is standard - * - * @param {import('postcss').AtRule | import('postcss-less').AtRule} atRule postcss at-rule node - * @return {boolean} If `true`, the declaration is standard - */ -module.exports = function isStandardSyntaxAtRule(atRule) { - // Ignore scss `@content` inside mixins - if (!atRule.nodes && atRule.params === '') { - return false; - } - - // Ignore Less mixins - if ('mixin' in atRule && atRule.mixin) { - return false; - } - - // Ignore Less detached ruleset `@detached-ruleset: { background: red; }; .top { @detached-ruleset(); }` - if ( - ('variable' in atRule && atRule.variable) || - (!atRule.nodes && atRule.raws.afterName === '' && atRule.params[0] === '(') - ) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxColorFunction.js b/node_modules/stylelint/lib/utils/isStandardSyntaxColorFunction.js deleted file mode 100644 index aab06273d..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxColorFunction.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -const isStandardSyntaxFunction = require('./isStandardSyntaxFunction'); - -/** - * Check whether a function is standard syntax color function - * - * @param {import('postcss-value-parser').FunctionNode} node - * @returns {boolean} - */ -module.exports = function isStandardSyntaxColorFunction(node) { - if (!isStandardSyntaxFunction(node)) return false; - - // scss can accept a #hex, or $var variables and we need to check all nested fn nodes - for (const fnNode of node.nodes) { - if (fnNode.type === 'function') return isStandardSyntaxColorFunction(fnNode); - - if ( - fnNode.type === 'word' && - (fnNode.value.startsWith('#') || fnNode.value.startsWith('$') || fnNode.value.includes('.$')) - ) - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxCombinator.js b/node_modules/stylelint/lib/utils/isStandardSyntaxCombinator.js deleted file mode 100644 index 171096dd3..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxCombinator.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -/** - * Check whether a combinator is standard - * - * @param {import('postcss-selector-parser').Combinator} node postcss-selector-parser node (of type combinator) - * @return {boolean} If `true`, the combinator is standard - */ -module.exports = function isStandardSyntaxCombinator(node) { - // if it's not a combinator, then it's not a standard combinator - if (node.type !== 'combinator') { - return false; - } - - // Ignore reference combinators like `/deep/` - if (node.value.startsWith('/') || node.value.endsWith('/')) { - return false; - } - - // ignore the combinators that are the first or last node in their container - if (node.parent !== undefined && node.parent !== null) { - const parent = node.parent; - - if (node === parent.first) { - return false; - } - - if (node === parent.last) { - return false; - } - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxComment.js b/node_modules/stylelint/lib/utils/isStandardSyntaxComment.js deleted file mode 100644 index 0687814da..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxComment.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -/** - * @param {import('postcss').Comment} comment - * @returns {boolean} - */ -module.exports = function isStandardSyntaxComment(comment) { - // We check both here because the Sass parser uses `raws.inline` to indicate - // inline comments, while the Less parser uses `inline`. - if ('inline' in comment) return false; - - if ('inline' in comment.raws) return false; - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxDeclaration.js b/node_modules/stylelint/lib/utils/isStandardSyntaxDeclaration.js deleted file mode 100644 index e258a7d89..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxDeclaration.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -const isScssVariable = require('./isScssVariable'); -const { isRule } = require('./typeGuards'); - -/** - * Check whether a declaration is standard - * - * @param {import('postcss').Declaration | import('postcss-less').Declaration} decl - */ -module.exports = function isStandardSyntaxDeclaration(decl) { - const prop = decl.prop; - const parent = decl.parent; - - // SCSS var; covers map and list declarations - if (isScssVariable(prop)) { - return false; - } - - // Less var (e.g. @var: x), but exclude variable interpolation (e.g. @{var}) - if (prop[0] === '@' && prop[1] !== '{') { - return false; - } - - // Less map declaration - if (parent && parent.type === 'atrule' && parent.raws.afterName === ':') { - return false; - } - - // Less map (e.g. #my-map() { myprop: red; }) - if ( - parent && - isRule(parent) && - parent.selector && - parent.selector.startsWith('#') && - parent.selector.endsWith('()') - ) { - return false; - } - - // Sass nested properties (e.g. border: { style: solid; color: red; }) - if ( - parent && - isRule(parent) && - parent.selector && - parent.selector[parent.selector.length - 1] === ':' && - parent.selector.substring(0, 2) !== '--' - ) { - return false; - } - - // Less &:extend - if ('extend' in decl && decl.extend) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxFunction.js b/node_modules/stylelint/lib/utils/isStandardSyntaxFunction.js deleted file mode 100644 index 5c1e29adf..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxFunction.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -/** - * Check whether a function is standard - * - * @param {import('postcss-value-parser').Node} node - * @returns {boolean} - */ -module.exports = function isStandardSyntaxFunction(node) { - // Function nodes without names are things in parentheses like Sass lists - if (!node.value) { - return false; - } - - if (node.value.startsWith('#{')) { - return false; - } - - // CSS-in-JS interpolation - if (node.value.startsWith('${')) { - return false; - } - - // CSS-in-JS syntax - if (node.value.startsWith('`')) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxHexColor.js b/node_modules/stylelint/lib/utils/isStandardSyntaxHexColor.js deleted file mode 100644 index 71a7581a9..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxHexColor.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -/** - * Check whether a hex color is standard - * - * @param {string} hex - * @returns {boolean} - */ -module.exports = function isStandardSyntaxHexColor(hex) { - // Less map usage (e.g. .myclass { color: #colors[somecolor]; }) - if (hex.includes('[')) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxKeyframesName.js b/node_modules/stylelint/lib/utils/isStandardSyntaxKeyframesName.js deleted file mode 100644 index 934620e97..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxKeyframesName.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -const hasInterpolation = require('./hasInterpolation'); - -/** - * Check whether a keyframes name is standard - * - * @param {string} keyframesName - * @returns {boolean} - */ -module.exports = function isStandardSyntaxKeyframesName(keyframesName) { - if (hasInterpolation(keyframesName)) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxMathFunction.js b/node_modules/stylelint/lib/utils/isStandardSyntaxMathFunction.js deleted file mode 100644 index cb13e9bd5..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxMathFunction.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -/** - * Check whether a math function is standard - * - * @param {string} mathFunction - * @returns {boolean} - */ -module.exports = function isStandardSyntaxMathFunction(mathFunction) { - // SCSS variable - if (mathFunction.includes('$')) { - return false; - } - - // Less variable - if (mathFunction.includes('@')) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeature.js b/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeature.js deleted file mode 100644 index 6b6a86724..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeature.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -const hasInterpolation = require('../utils/hasInterpolation'); - -/** - * Check whether a media feature is standard - * - * @param {string} mediaFeature - * @returns {boolean} - */ -module.exports = function isStandardSyntaxMediaFeature(mediaFeature) { - // Remove outside parens - mediaFeature = mediaFeature.slice(1, -1); - - // Parentheticals used for non-standard operations e.g. ($var - 10) - if (mediaFeature.includes('(')) { - return false; - } - - // SCSS or Less interpolation - if (hasInterpolation(mediaFeature)) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeatureName.js b/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeatureName.js deleted file mode 100644 index 9022b18d1..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxMediaFeatureName.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -/** - * Check whether a media feature name is standard - * - * @param {string} mediaFeatureName - * @returns {boolean} - */ -module.exports = function isStandardSyntaxMediaFeatureName(mediaFeatureName) { - // SCSS interpolation - if (/#\{.+?\}|\$.+/.test(mediaFeatureName)) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxProperty.js b/node_modules/stylelint/lib/utils/isStandardSyntaxProperty.js deleted file mode 100644 index 373f681b1..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxProperty.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const hasInterpolation = require('../utils/hasInterpolation'); -const isScssVariable = require('./isScssVariable'); - -/** - * Check whether a property is standard - * - * @param {string} property - * @returns {boolean} - */ -module.exports = function isStandardSyntaxProperty(property) { - // SCSS var - if (isScssVariable(property)) { - return false; - } - - // Less var (e.g. @var: x) - if (property.startsWith('@')) { - return false; - } - - // Less append property value with space (e.g. transform+_: scale(2)) - if (property.endsWith('+') || property.endsWith('+_')) { - return false; - } - - // SCSS or Less interpolation - if (hasInterpolation(property)) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxRule.js b/node_modules/stylelint/lib/utils/isStandardSyntaxRule.js deleted file mode 100644 index 995d36879..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxRule.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -const isStandardSyntaxSelector = require('../utils/isStandardSyntaxSelector'); - -/** - * Check whether a Node is a standard rule - * - * @param {import('postcss').Rule | import('postcss-less').Rule} rule - * @returns {boolean} - */ -module.exports = function isStandardSyntaxRule(rule) { - if (rule.type !== 'rule') { - return false; - } - - // Ignore Less &:extend rule - if ('extend' in rule && rule.extend) { - return false; - } - - if (!isStandardSyntaxSelector(rule.selector)) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxSelector.js b/node_modules/stylelint/lib/utils/isStandardSyntaxSelector.js deleted file mode 100644 index 0e6e3af73..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxSelector.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -const hasInterpolation = require('../utils/hasInterpolation'); - -/** - * Check whether a selector is standard - * - * @param {string} selector - * @returns {boolean} - */ -module.exports = function isStandardSyntaxSelector(selector) { - // SCSS or Less interpolation - if (hasInterpolation(selector)) { - return false; - } - - // SCSS placeholder selectors - if (selector.startsWith('%')) { - return false; - } - - // SCSS nested properties - if (selector.endsWith(':')) { - return false; - } - - // Less :extend() - if (/:extend(?:\(.*?\))?/.test(selector)) { - return false; - } - - // Less mixin with resolved nested selectors (e.g. .foo().bar or .foo(@a, @b)[bar]) - if (/\.[\w-]+\(.*\).+/.test(selector)) { - return false; - } - - // Less non-outputting mixin definition (e.g. .mixin() {}) - if (selector.endsWith(')') && !selector.includes(':')) { - return false; - } - - // Less Parametric mixins (e.g. .mixin(@variable: x) {}) - if (/\(@.*\)$/.test(selector)) { - return false; - } - - // ERB template tags - if (selector.includes('<%') || selector.includes('%>')) { - return false; - } - - // SCSS and Less comments - if (selector.includes('//')) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxTypeSelector.js b/node_modules/stylelint/lib/utils/isStandardSyntaxTypeSelector.js deleted file mode 100644 index c415cb469..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxTypeSelector.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -const { - aNPlusBNotationPseudoClasses, - aNPlusBOfSNotationPseudoClasses, - linguisticPseudoClasses, - shadowTreePseudoElements, -} = require('../reference/selectors'); - -/** - * Check whether a type selector is standard - * - * @param {import('postcss-selector-parser').Tag} node postcss-selector-parser node (of type tag) - * @return {boolean} If `true`, the type selector is standard - */ -module.exports = function isStandardSyntaxTypeSelector(node) { - // postcss-selector-parser includes the arguments to nth-child() functions - // as "tags", so we need to ignore them ourselves. - // The fake-tag's "parent" is actually a selector node, whose parent - // should be the :nth-child pseudo node. - if (!node.parent || !node.parent.parent) { - return false; - } - - const _node$parent$parent = node.parent.parent; - const parentType = _node$parent$parent.type; - const parentValue = _node$parent$parent.value; - - if (parentValue) { - const normalisedParentName = parentValue.toLowerCase().replace(/:+/, ''); - - if ( - parentType === 'pseudo' && - (aNPlusBNotationPseudoClasses.has(normalisedParentName) || - aNPlusBOfSNotationPseudoClasses.has(normalisedParentName) || - linguisticPseudoClasses.has(normalisedParentName) || - shadowTreePseudoElements.has(normalisedParentName)) - ) { - return false; - } - } - - // &-bar is a nesting selector combined with a suffix - if (node.prev() && node.prev().type === 'nesting') { - return false; - } - - if (node.value.startsWith('%')) { - return false; - } - - // Reference combinators like `/deep/` - if (node.value.startsWith('/') && node.value.endsWith('/')) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxUrl.js b/node_modules/stylelint/lib/utils/isStandardSyntaxUrl.js deleted file mode 100644 index 6b5bf0ca5..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxUrl.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -const hasLessInterpolation = require('../utils/hasLessInterpolation'); -const hasPsvInterpolation = require('../utils/hasPsvInterpolation'); -const hasScssInterpolation = require('../utils/hasScssInterpolation'); -const hasTplInterpolation = require('../utils/hasTplInterpolation'); - -const IS_LESS_VARIABLE_IN_URL = /^@@?[\w-]+$/; -const IS_SCSS_VARIABLE_IN_URL = /^[$\s\w+\-,./*'"]+$/; - -/** - * Check whether a URL is standard - * - * @param {string} url - * @returns {boolean} - */ -module.exports = function isStandardSyntaxUrl(url) { - if (url.length === 0) { - return true; - } - - // Sass interpolation works anywhere - if (hasScssInterpolation(url) || hasTplInterpolation(url) || hasPsvInterpolation(url)) { - return false; - } - - // Inside `'` and `"` work only LESS interpolation - if ((url.startsWith(`'`) && url.endsWith(`'`)) || (url.startsWith(`"`) && url.endsWith(`"`))) { - if (hasLessInterpolation(url)) { - return false; - } - - return true; - } - - // Less variable works only at the beginning - // Check is less variable, allow use '@url/some/path' - // https://github.com/less/less.js/blob/3.x/lib/less/parser/parser.js#L547 - if (url.startsWith('@') && IS_LESS_VARIABLE_IN_URL.test(url)) { - return false; - } - - // In url without quotes scss variable can be everywhere - // But in this case it is allowed to use only specific characters - // Also forbidden "/" at the end of url - if (url.includes('$') && IS_SCSS_VARIABLE_IN_URL.test(url) && !url.endsWith('/')) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isStandardSyntaxValue.js b/node_modules/stylelint/lib/utils/isStandardSyntaxValue.js deleted file mode 100644 index 54d75474c..000000000 --- a/node_modules/stylelint/lib/utils/isStandardSyntaxValue.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -const hasInterpolation = require('../utils/hasInterpolation'); - -/** - * Check whether a value is standard - * - * @param {string} value - * @returns {boolean} - */ -module.exports = function isStandardSyntaxValue(value) { - let normalizedValue = value; - - // Ignore operators before variables (example -$variable) - if (/^[-+*/]/.test(value.charAt(0))) { - normalizedValue = normalizedValue.slice(1); - } - - // SCSS variable (example $variable) - if (normalizedValue.startsWith('$')) { - return false; - } - - // SCSS namespace (example namespace.$variable) - if (/^.+\.\$/.test(value)) { - return false; - } - - // SCSS namespace (example namespace.function-name()) - if (/^.+\.[-\w]+\(/.test(value)) { - return false; - } - - // Less variable - if (normalizedValue.startsWith('@')) { - return false; - } - - // SCSS or Less interpolation - if (hasInterpolation(normalizedValue)) { - return false; - } - - // WebExtension replacement keyword used by Chrome/Firefox - // more information: https://developer.chrome.com/extensions/i18n - // and https://github.com/stylelint/stylelint/issues/4707 - if (/__MSG_\S+__/.test(value)) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isUnicodeRangeDescriptor.js b/node_modules/stylelint/lib/utils/isUnicodeRangeDescriptor.js deleted file mode 100644 index 8718a9c22..000000000 --- a/node_modules/stylelint/lib/utils/isUnicodeRangeDescriptor.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -const { isAtRule } = require('./typeGuards'); - -const IS_UNICODE_RANGE = /^unicode-range$/i; -const IS_AT_FONT_FACE = /^font-face$/i; - -/** - * Check whether a declaration is the `unicode-range` descriptor of an `@font-face` rule. - * - * @param {import('postcss').Declaration} decl - * @returns {boolean} - */ -module.exports = function isUnicodeRangeDescriptor(decl) { - if (!IS_UNICODE_RANGE.test(decl.prop)) { - return false; - } - - const parent = decl.parent; - - if (!parent || !isAtRule(parent)) { - return false; - } - - return IS_AT_FONT_FACE.test(parent.name); -}; diff --git a/node_modules/stylelint/lib/utils/isValidFontSize.js b/node_modules/stylelint/lib/utils/isValidFontSize.js deleted file mode 100644 index eff6f2801..000000000 --- a/node_modules/stylelint/lib/utils/isValidFontSize.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -const { fontSizeKeywords } = require('../reference/keywords'); -const { lengthUnits } = require('../reference/units'); -const valueParser = require('postcss-value-parser'); - -/** - * Check if a word is a font-size value. - * - * @param {string} word - * @returns {boolean} - */ -module.exports = function isValidFontSize(word) { - if (!word) { - return false; - } - - if (fontSizeKeywords.has(word)) { - return true; - } - - const numberUnit = valueParser.unit(word); - - if (!numberUnit) { - return false; - } - - const unit = numberUnit.unit; - - if (unit === '%') { - return true; - } - - if (lengthUnits.has(unit.toLowerCase())) { - return true; - } - - return false; -}; diff --git a/node_modules/stylelint/lib/utils/isValidHex.js b/node_modules/stylelint/lib/utils/isValidHex.js deleted file mode 100644 index b6de64091..000000000 --- a/node_modules/stylelint/lib/utils/isValidHex.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const IS_VALID_HEX = /^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i; - -/** - * Check if a value is a valid 3, 4, 6 or 8 digit hex - * - * @param {string} value - * @returns {boolean} - */ -module.exports = function isValidHex(value) { - return IS_VALID_HEX.test(value); -}; diff --git a/node_modules/stylelint/lib/utils/isValidIdentifier.js b/node_modules/stylelint/lib/utils/isValidIdentifier.js deleted file mode 100644 index 036e48565..000000000 --- a/node_modules/stylelint/lib/utils/isValidIdentifier.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -const ISO_10646_CHARACTERS = /\\[0-9a-f]{1,6}(\\r\\n|[ \t\r\n\f])?/gi; -const SINGLE_ESCAPED_CHARACTERS = /\\./g; -const NON_WORD_OR_DASH = /[^\w-]/; -const DIGIT = /\d/; - -/** - * Returns whether a string is a valid CSS identifier - * (i.e. only alphanumeric characters, `-`, and `_`; - * does not have a leading digit, leading dash followed by digit, or two leading dashes) - * furthermore, any escaped or ISO 10646 characters are allowed. - * @see https://www.w3.org/TR/CSS2/syndata.html#value-def-identifier - * @param {string} ident - * @returns {boolean} - */ -module.exports = function isValidIdentifier(ident) { - if (!ident || ident.trim() === '') { - return false; - } - - // trims, removes ISO 10646 characters, and singly-escaped characters - const trimmedIdent = ident - .trim() - .replace(ISO_10646_CHARACTERS, '') - .replace(SINGLE_ESCAPED_CHARACTERS, ''); - - if (NON_WORD_OR_DASH.test(trimmedIdent)) { - return false; - } - - if (DIGIT.test(trimmedIdent.charAt(0))) { - return false; - } - - if (trimmedIdent.charAt(0) === '-' && DIGIT.test(trimmedIdent.charAt(1))) { - return false; - } - - return true; -}; diff --git a/node_modules/stylelint/lib/utils/isVariable.js b/node_modules/stylelint/lib/utils/isVariable.js deleted file mode 100644 index 76d6b3c9a..000000000 --- a/node_modules/stylelint/lib/utils/isVariable.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * Check whether a word is a variable i.e var(--custom-property). - * - * @param {string} word - * @returns {boolean} - */ -module.exports = function isVariable(word) { - return word.toLowerCase().startsWith('var('); -}; diff --git a/node_modules/stylelint/lib/utils/isWhitespace.js b/node_modules/stylelint/lib/utils/isWhitespace.js deleted file mode 100644 index c88ec1958..000000000 --- a/node_modules/stylelint/lib/utils/isWhitespace.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * Check if a character is whitespace. - * - * @param {string} char - * @returns {boolean} - */ -module.exports = function isWhitespace(char) { - return [' ', '\n', '\t', '\r', '\f'].includes(char); -}; diff --git a/node_modules/stylelint/lib/utils/matchesStringOrRegExp.js b/node_modules/stylelint/lib/utils/matchesStringOrRegExp.js deleted file mode 100644 index 5d33bd2a9..000000000 --- a/node_modules/stylelint/lib/utils/matchesStringOrRegExp.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -/** - * Compares a string to a second value that, if it fits a certain convention, - * is converted to a regular expression before the comparison. - * If it doesn't fit the convention, then two strings are compared. - * - * Any strings starting and ending with `/` are interpreted - * as regular expressions. - * - * @param {string | Array} input - * @param {string | RegExp | Array} comparison - * - * @returns {false | {match: string, pattern: (string | RegExp), substring: string}} - */ -module.exports = function matchesStringOrRegExp(input, comparison) { - if (!Array.isArray(input)) { - return testAgainstStringOrRegExpOrArray(input, comparison); - } - - for (const inputItem of input) { - const testResult = testAgainstStringOrRegExpOrArray(inputItem, comparison); - - if (testResult) { - return testResult; - } - } - - return false; -}; - -/** - * @param {string} value - * @param {string | RegExp | Array} comparison - */ -function testAgainstStringOrRegExpOrArray(value, comparison) { - if (!Array.isArray(comparison)) { - return testAgainstStringOrRegExp(value, comparison); - } - - for (const comparisonItem of comparison) { - const testResult = testAgainstStringOrRegExp(value, comparisonItem); - - if (testResult) { - return testResult; - } - } - - return false; -} - -/** - * @param {string} value - * @param {string | RegExp} comparison - */ -function testAgainstStringOrRegExp(value, comparison) { - // If it's a RegExp, test directly - if (comparison instanceof RegExp) { - const match = value.match(comparison); - - return match ? { match: value, pattern: comparison, substring: match[0] || '' } : false; - } - - // Check if it's RegExp in a string - const firstComparisonChar = comparison[0]; - const lastComparisonChar = comparison[comparison.length - 1]; - const secondToLastComparisonChar = comparison[comparison.length - 2]; - - const comparisonIsRegex = - firstComparisonChar === '/' && - (lastComparisonChar === '/' || - (secondToLastComparisonChar === '/' && lastComparisonChar === 'i')); - - const hasCaseInsensitiveFlag = comparisonIsRegex && lastComparisonChar === 'i'; - - // If so, create a new RegExp from it - if (comparisonIsRegex) { - const valueMatch = hasCaseInsensitiveFlag - ? value.match(new RegExp(comparison.slice(1, -2), 'i')) - : value.match(new RegExp(comparison.slice(1, -1))); - - return valueMatch - ? { match: value, pattern: comparison, substring: valueMatch[0] || '' } - : false; - } - - // Otherwise, it's a string. Do a strict comparison - return value === comparison ? { match: value, pattern: comparison, substring: value } : false; -} diff --git a/node_modules/stylelint/lib/utils/nextNonCommentNode.js b/node_modules/stylelint/lib/utils/nextNonCommentNode.js deleted file mode 100644 index ac4d07401..000000000 --- a/node_modules/stylelint/lib/utils/nextNonCommentNode.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -/** @typedef {import('postcss').Node} PostcssNode */ - -/** - * Get the next non-comment node in a PostCSS AST - * at or after a given node. - * - * @param {PostcssNode | void} startNode - * @returns {PostcssNode | null} - */ -module.exports = function nextNonCommentNode(startNode) { - if (!startNode || !startNode.next) return null; - - if (startNode.type === 'comment') { - return nextNonCommentNode(startNode.next()); - } - - return startNode; -}; diff --git a/node_modules/stylelint/lib/utils/noFilesFoundError.js b/node_modules/stylelint/lib/utils/noFilesFoundError.js deleted file mode 100644 index e3300be1b..000000000 --- a/node_modules/stylelint/lib/utils/noFilesFoundError.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -class NoFilesFoundError extends Error { - /** - * @param {string|string[]} fileList - */ - constructor(fileList) { - super(); - - if (typeof fileList === 'string') { - fileList = [fileList]; - } - - const pattern = fileList.filter((i) => !i.startsWith('!')).join(', '); - - this.message = `No files matching the pattern "${pattern}" were found.`; - } -} - -module.exports = NoFilesFoundError; diff --git a/node_modules/stylelint/lib/utils/nodeContextLookup.js b/node_modules/stylelint/lib/utils/nodeContextLookup.js deleted file mode 100644 index e18d64f22..000000000 --- a/node_modules/stylelint/lib/utils/nodeContextLookup.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -/** - * Create a collection of Maps that serve to contextualize a given node. - * This is useful to ensure that you only compare nodes that share a certain - * context. - * - * All nodes are initially contextualized by their input source. - * From there, you can contextualize them however you want. - * - * For a usage example, see `selector-no-descending-specificity`. - */ -module.exports = function nodeContextLookup() { - const contextMap = new Map(); - - return { - /** - * @param {import('postcss').Node} node - * @param {any[]} subContexts - * @returns {Map} - */ - getContext(node, ...subContexts) { - if (!node.source) throw new Error('The node source must be present'); - - const nodeSource = node.source.input.from; - const baseContext = creativeGetMap(contextMap, nodeSource); - - return subContexts.reduce((result, context) => creativeGetMap(result, context), baseContext); - }, - }; -}; - -/** - * @param {Map} someMap - * @param {any} someThing - */ -function creativeGetMap(someMap, someThing) { - if (!someMap.has(someThing)) { - someMap.set(someThing, new Map()); - } - - return someMap.get(someThing); -} diff --git a/node_modules/stylelint/lib/utils/optionsMatches.js b/node_modules/stylelint/lib/utils/optionsMatches.js deleted file mode 100644 index f911c3004..000000000 --- a/node_modules/stylelint/lib/utils/optionsMatches.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -const matchesStringOrRegExp = require('./matchesStringOrRegExp'); - -/** - * Check if an options object's propertyName contains a user-defined string or - * regex that matches the passed in input. - * - * @param {{ [x: string]: any; }} options - * @param {string} propertyName - * @param {unknown} input - * - * @returns {boolean} - */ -module.exports = function optionsMatches(options, propertyName, input) { - return Boolean( - options && - options[propertyName] && - typeof input === 'string' && - matchesStringOrRegExp(input, options[propertyName]), - ); -}; diff --git a/node_modules/stylelint/lib/utils/parseMediaQuery.js b/node_modules/stylelint/lib/utils/parseMediaQuery.js deleted file mode 100644 index 0d0dcb1b5..000000000 --- a/node_modules/stylelint/lib/utils/parseMediaQuery.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -const { parse } = require('@csstools/media-query-list-parser'); -const getAtRuleParams = require('./getAtRuleParams'); - -/** - * @param {import('postcss').AtRule} atRule - * @returns {ReturnType} - */ -module.exports = function parseMediaQuery(atRule) { - const mediaQueries = parse(getAtRuleParams(atRule), { - preserveInvalidMediaQueries: true, - }); - - return mediaQueries; -}; diff --git a/node_modules/stylelint/lib/utils/parseSelector.js b/node_modules/stylelint/lib/utils/parseSelector.js deleted file mode 100644 index eba611c36..000000000 --- a/node_modules/stylelint/lib/utils/parseSelector.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -const selectorParser = require('postcss-selector-parser'); - -/** - * @param {string} selector - * @param {import('stylelint').PostcssResult} result - * @param {import('postcss').Node} node - * @param {(root: import('postcss-selector-parser').Root) => void} callback - * @returns {string | undefined} - */ -module.exports = function parseSelector(selector, result, node, callback) { - try { - return selectorParser(callback).processSync(selector); - } catch (err) { - result.warn(`Cannot parse selector (${err})`, { node, stylelintType: 'parseError' }); - - return undefined; - } -}; diff --git a/node_modules/stylelint/lib/utils/pluralize.js b/node_modules/stylelint/lib/utils/pluralize.js deleted file mode 100644 index 48644272d..000000000 --- a/node_modules/stylelint/lib/utils/pluralize.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -/** - * Returns the plural form of the given word. - * - * @param {string} singular - * @param {number} count - * @returns {string} - */ -module.exports = function pluralize(singular, count) { - return count === 1 ? singular : `${singular}s`; -}; diff --git a/node_modules/stylelint/lib/utils/putIfAbsent.js b/node_modules/stylelint/lib/utils/putIfAbsent.js deleted file mode 100644 index 94057000c..000000000 --- a/node_modules/stylelint/lib/utils/putIfAbsent.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -/** - * If `map` already has the given `key`, returns its value. Otherwise, calls - * `callback`, adds the result to `map` at `key`, and then returns it. - * - * @template K - * @template V - * @param {Map} map - * @param {K} key - * @param {() => V} callback - * @returns {V} - */ -module.exports = function putIfAbsent(map, key, callback) { - if (map.has(key)) return /** @type {V} */ (map.get(key)); - - const value = callback(); - - map.set(key, value); - - return value; -}; diff --git a/node_modules/stylelint/lib/utils/rawNodeString.js b/node_modules/stylelint/lib/utils/rawNodeString.js deleted file mode 100644 index efb0e7c8f..000000000 --- a/node_modules/stylelint/lib/utils/rawNodeString.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -/** - * Stringify PostCSS node including its raw "before" string. - * - * @param {import('postcss').Node} node - * - * @returns {string} - */ -module.exports = function rawNodeString(node) { - let result = ''; - - if (node.raws.before) { - result += node.raws.before; - } - - result += node.toString(); - - return result; -}; diff --git a/node_modules/stylelint/lib/utils/removeEmptyLinesAfter.js b/node_modules/stylelint/lib/utils/removeEmptyLinesAfter.js deleted file mode 100644 index d1e8bdf8d..000000000 --- a/node_modules/stylelint/lib/utils/removeEmptyLinesAfter.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -/** - * Remove empty lines before a node. Mutates the node. - * - * @template {import('postcss').Rule | import('postcss').AtRule} T - * @param {T} node - * @param {string} newline - * @returns {T} - */ -module.exports = function removeEmptyLinesAfter(node, newline) { - node.raws.after = node.raws.after ? node.raws.after.replace(/(\r?\n\s*\n)+/g, newline) : ''; - - return node; -}; diff --git a/node_modules/stylelint/lib/utils/removeEmptyLinesBefore.js b/node_modules/stylelint/lib/utils/removeEmptyLinesBefore.js deleted file mode 100644 index 7312419bc..000000000 --- a/node_modules/stylelint/lib/utils/removeEmptyLinesBefore.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -/** - * Remove empty lines before a node. Mutates the node. - * - * @template {import('postcss').Node} T - * @param {T} node - * @param {string} newline - * @returns {T} - */ -module.exports = function removeEmptyLinesBefore(node, newline) { - node.raws.before = node.raws.before ? node.raws.before.replace(/(\r?\n\s*\n)+/g, newline) : ''; - - return node; -}; diff --git a/node_modules/stylelint/lib/utils/report.js b/node_modules/stylelint/lib/utils/report.js deleted file mode 100644 index c9a7e814a..000000000 --- a/node_modules/stylelint/lib/utils/report.js +++ /dev/null @@ -1,146 +0,0 @@ -'use strict'; - -/** - * Report a problem. - * - * This function accounts for `disabledRanges` attached to the result. - * That is, if the reported problem is within a disabledRange, - * it is ignored. Otherwise, it is attached to the result as a - * postcss warning. - * - * It also accounts for the rule's severity. - * - * You *must* pass *either* a node or a line number. - * - * @type {import('stylelint').Utils['report']} - */ -module.exports = function report(problem) { - const { ruleName, result, message, messageArgs, line, node, index, endIndex, word, severity } = - problem; - - result.stylelint = result.stylelint || { - ruleSeverities: {}, - customMessages: {}, - ruleMetadata: {}, - }; - - const ruleSeverity = - severity || (result.stylelint.ruleSeverities && result.stylelint.ruleSeverities[ruleName]); - - // In quiet mode, mere warnings are ignored - if (result.stylelint.quiet && ruleSeverity !== 'error') { - return; - } - - const { start } = (node && node.rangeBy({ index, endIndex })) || {}; - - // If a line is not passed, use the node.rangeBy method to get the - // line number that the complaint pertains to - const startLine = line || (start && start.line); - - if (!startLine) { - throw new Error('You must pass either a node or a line number'); - } - - const { ignoreDisables } = result.stylelint.config || {}; - - if (result.stylelint.disabledRanges) { - const ranges = - result.stylelint.disabledRanges[ruleName] || result.stylelint.disabledRanges.all || []; - - for (const range of ranges) { - if ( - // If the problem is within a disabledRange, - // and that disabledRange's rules include this one, - // do not register a warning - range.start <= startLine && - (range.end === undefined || range.end >= startLine) && - (!range.rules || range.rules.includes(ruleName)) - ) { - // Collect disabled warnings - // Used to report `needlessDisables` in subsequent processing. - const disabledWarnings = - result.stylelint.disabledWarnings || (result.stylelint.disabledWarnings = []); - - disabledWarnings.push({ - rule: ruleName, - line: startLine, - }); - - if (!ignoreDisables) { - return; - } - - break; - } - } - } - - if (!result.stylelint.stylelintError && ruleSeverity === 'error') { - result.stylelint.stylelintError = true; - } - - if (!result.stylelint.stylelintWarning && ruleSeverity === 'warning') { - result.stylelint.stylelintWarning = true; - } - - /** @type {import('stylelint').WarningOptions} */ - const warningProperties = { - severity: ruleSeverity, - rule: ruleName, - }; - - if (node) { - warningProperties.node = node; - } - - if (problem.start) { - warningProperties.start = problem.start; - } else if (index) { - warningProperties.index = index; - } - - if (problem.end) { - warningProperties.end = problem.end; - } else if (endIndex) { - warningProperties.endIndex = endIndex; - } - - if (word) { - warningProperties.word = word; - } - - const { customMessages } = result.stylelint; - const warningMessage = buildWarningMessage( - (customMessages && customMessages[ruleName]) || message, - messageArgs, - ); - - result.warn(warningMessage, warningProperties); -}; - -/** - * @param {import('stylelint').RuleMessage} message - * @param {import('stylelint').Problem['messageArgs']} messageArgs - * @returns {string} - */ -function buildWarningMessage(message, messageArgs) { - const args = messageArgs || []; - - if (typeof message === 'string') { - return printfLike(message, ...args); - } - - return message(...args); -} - -/** - * @param {string} format - * @param {Array} args - * @returns {string} - */ -function printfLike(format, ...args) { - return args.reduce((/** @type {string} */ result, arg) => { - return result.replace(/%[ds]/, String(arg)); - }, format); -} diff --git a/node_modules/stylelint/lib/utils/ruleMessages.js b/node_modules/stylelint/lib/utils/ruleMessages.js deleted file mode 100644 index 765fe4da1..000000000 --- a/node_modules/stylelint/lib/utils/ruleMessages.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -/** - * @type {import('stylelint').Utils['ruleMessages']} - */ -module.exports = function ruleMessages(ruleName, messages) { - /** @type {import('stylelint').RuleMessages} */ - const newMessages = {}; - - for (const [messageId, messageText] of Object.entries(messages)) { - if (typeof messageText === 'string') { - newMessages[messageId] = `${messageText} (${ruleName})`; - } else { - newMessages[messageId] = (...args) => `${messageText(...args)} (${ruleName})`; - } - } - - // @ts-expect-error -- TS2322: Type 'RuleMessages' is not assignable to type 'R'. - return newMessages; -}; diff --git a/node_modules/stylelint/lib/utils/setAtRuleParams.js b/node_modules/stylelint/lib/utils/setAtRuleParams.js deleted file mode 100644 index eaf17c877..000000000 --- a/node_modules/stylelint/lib/utils/setAtRuleParams.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -/** @typedef {import('postcss').AtRule} AtRule */ - -/** - * @param {AtRule} atRule - * @param {string} params - * @returns {AtRule} The atRulearation that was passed in. - */ -module.exports = function setAtRuleParams(atRule, params) { - const raws = atRule.raws; - - if (raws.params) { - raws.params.raw = params; - } else { - atRule.params = params; - } - - return atRule; -}; diff --git a/node_modules/stylelint/lib/utils/setDeclarationValue.js b/node_modules/stylelint/lib/utils/setDeclarationValue.js deleted file mode 100644 index 57b5fecf6..000000000 --- a/node_modules/stylelint/lib/utils/setDeclarationValue.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -/** @typedef {import('postcss').Declaration} Declaration */ - -/** - * @param {Declaration} decl - * @param {string} value - * @returns {Declaration} The declaration that was passed in. - */ -module.exports = function setDeclarationValue(decl, value) { - const raws = decl.raws; - - if (raws.value) { - raws.value.raw = value; - } else { - decl.value = value; - } - - return decl; -}; diff --git a/node_modules/stylelint/lib/utils/transformSelector.js b/node_modules/stylelint/lib/utils/transformSelector.js deleted file mode 100644 index abc8d77fa..000000000 --- a/node_modules/stylelint/lib/utils/transformSelector.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const selectorParser = require('postcss-selector-parser'); - -/** - * @param {import('stylelint').PostcssResult} result - * @param {import('postcss').Rule} node - * @param {(root: import('postcss-selector-parser').Root) => void} callback - * @returns {string | undefined} - */ -module.exports = function transformSelector(result, node, callback) { - try { - return selectorParser(callback).processSync(node, { updateSelector: true }); - } catch { - result.warn('Cannot parse selector', { node, stylelintType: 'parseError' }); - - return undefined; - } -}; diff --git a/node_modules/stylelint/lib/utils/typeGuards.js b/node_modules/stylelint/lib/utils/typeGuards.js deleted file mode 100644 index 705cccef7..000000000 --- a/node_modules/stylelint/lib/utils/typeGuards.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -/** @typedef {import('postcss').Node} Node */ -/** @typedef {import('postcss').Source} NodeSource */ - -/** - * @param {Node} node - * @returns {node is import('postcss').Root} - */ -module.exports.isRoot = function isRoot(node) { - return node.type === 'root'; -}; - -/** - * @param {Node} node - * @returns {node is import('postcss').Rule} - */ -module.exports.isRule = function isRule(node) { - return node.type === 'rule'; -}; - -/** - * @param {Node} node - * @returns {node is import('postcss').AtRule} - */ -module.exports.isAtRule = function isAtRule(node) { - return node.type === 'atrule'; -}; - -/** - * @param {Node} node - * @returns {node is import('postcss').Comment} - */ -module.exports.isComment = function isComment(node) { - return node.type === 'comment'; -}; - -/** - * @param {Node} node - * @returns {node is import('postcss').Declaration} - */ -module.exports.isDeclaration = function isDeclaration(node) { - return node.type === 'decl'; -}; - -/** - * @param {Node} node - * @returns {node is import('postcss').Document} - */ -module.exports.isDocument = function isDocument(node) { - return node.type === 'document'; -}; - -/** - * @param {import('postcss-value-parser').Node} node - * @returns {node is import('postcss-value-parser').FunctionNode} - */ -module.exports.isValueFunction = function isValueFunction(node) { - return node.type === 'function'; -}; - -/** - * @param {Node} node - * @returns {node is (Node & {source: NodeSource})} - */ -module.exports.hasSource = function hasSource(node) { - return Boolean(node.source); -}; diff --git a/node_modules/stylelint/lib/utils/uniteSets.js b/node_modules/stylelint/lib/utils/uniteSets.js deleted file mode 100644 index 6c089bd8c..000000000 --- a/node_modules/stylelint/lib/utils/uniteSets.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Unite two or more sets - * - * @param {Iterable[]} args - */ -module.exports = function uniteSets(...args) { - return new Set([...args].reduce((result, set) => [...result, ...set], [])); -}; diff --git a/node_modules/stylelint/lib/utils/validateObjectWithArrayProps.js b/node_modules/stylelint/lib/utils/validateObjectWithArrayProps.js deleted file mode 100644 index f1eb71cd1..000000000 --- a/node_modules/stylelint/lib/utils/validateObjectWithArrayProps.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -const { isPlainObject } = require('./validateTypes'); - -/** - * Check whether the variable is an object and all its properties are one or more values - * that satisfy the specified validator(s): - * - * @example - * ignoreProperties = { - * value1: ["item11", "item12", "item13"], - * value2: "item2", - * }; - * validateObjectWithArrayProps(isString)(ignoreProperties); - * //=> true - * - * @typedef {(value: unknown) => boolean} Validator - * @param {...Validator} validators - * @returns {Validator} - */ -module.exports = function validateObjectWithArrayProps(...validators) { - return (value) => { - if (!isPlainObject(value)) { - return false; - } - - return Object.values(value) - .flat() - .every((item) => validators.some((v) => v(item))); - }; -}; diff --git a/node_modules/stylelint/lib/utils/validateObjectWithProps.js b/node_modules/stylelint/lib/utils/validateObjectWithProps.js deleted file mode 100644 index 36c124644..000000000 --- a/node_modules/stylelint/lib/utils/validateObjectWithProps.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -const { isPlainObject } = require('./validateTypes'); - -/** - * Check whether the variable is an object and all its properties agree with the provided validator. - * - * @example - * config = { - * value1: 1, - * value2: 2, - * value3: 3, - * }; - * validateObjectWithProps(isNumber)(config); - * //=> true - * - * @param {(value: unknown) => boolean} validator - * @returns {(value: unknown) => boolean} - */ -module.exports = (validator) => (value) => { - if (!isPlainObject(value)) { - return false; - } - - return Object.values(value).every((item) => { - return validator(item); - }); -}; diff --git a/node_modules/stylelint/lib/utils/validateOptions.js b/node_modules/stylelint/lib/utils/validateOptions.js deleted file mode 100644 index 37f738c6c..000000000 --- a/node_modules/stylelint/lib/utils/validateOptions.js +++ /dev/null @@ -1,174 +0,0 @@ -'use strict'; - -const arrayEqual = require('./arrayEqual'); -const { isPlainObject } = require('./validateTypes'); - -const IGNORED_OPTIONS = new Set(['severity', 'message', 'reportDisables', 'disableFix']); - -/** @typedef {import('stylelint').RuleOptions} RuleOptions */ -/** @typedef {import('stylelint').RuleOptionsPossible} RuleOptionsPossible */ - -/** - * @type {import('stylelint').Utils['validateOptions']} - */ -module.exports = function validateOptions(result, ruleName, ...optionDescriptions) { - let noErrors = true; - - for (const optionDescription of optionDescriptions) { - validate(optionDescription, ruleName, complain); - } - - /** - * @param {string} message - */ - function complain(message) { - noErrors = false; - result.warn(message, { - stylelintType: 'invalidOption', - }); - result.stylelint = result.stylelint || { - disabledRanges: {}, - ruleSeverities: {}, - customMessages: {}, - ruleMetadata: {}, - }; - result.stylelint.stylelintError = true; - } - - return noErrors; -}; - -/** - * @param {RuleOptions} opts - * @param {string} ruleName - * @param {(message: string) => void} complain - */ -function validate(opts, ruleName, complain) { - const possible = opts.possible; - const actual = opts.actual; - const optional = opts.optional; - - if (actual === false && !ruleName.startsWith('report')) { - return complain( - `Invalid option value "false" for rule "${ruleName}". Are you trying to disable this rule? If so use "null" instead`, - ); - } - - if (actual === null || arrayEqual(actual, [null])) { - return; - } - - const nothingPossible = - possible === undefined || (Array.isArray(possible) && possible.length === 0); - - if (nothingPossible && actual === true) { - return; - } - - if (actual === undefined) { - if (nothingPossible || optional) { - return; - } - - complain(`Expected option value for rule "${ruleName}"`); - - return; - } - - if (nothingPossible) { - if (optional) { - complain( - `Incorrect configuration for rule "${ruleName}". Rule should have "possible" values for options validation`, - ); - - return; - } - - complain(`Unexpected option value ${stringify(actual)} for rule "${ruleName}"`); - - return; - } - - if (typeof possible === 'function') { - if (!possible(actual)) { - complain(`Invalid option ${stringify(actual)} for rule "${ruleName}"`); - } - - return; - } - - // If `possible` is an array instead of an object ... - if (Array.isArray(possible)) { - for (const a of [actual].flat()) { - if (isValid(possible, a)) { - continue; - } - - complain(`Invalid option value ${stringify(a)} for rule "${ruleName}"`); - } - - return; - } - - // If actual is NOT an object ... - if (!isPlainObject(actual) || typeof actual !== 'object' || actual === null) { - complain( - `Invalid option value ${stringify(actual)} for rule "${ruleName}": should be an object`, - ); - - return; - } - - for (const [optionName, optionValue] of Object.entries(actual)) { - if (IGNORED_OPTIONS.has(optionName)) { - continue; - } - - const possibleValue = possible && possible[optionName]; - - if (!possibleValue) { - complain(`Invalid option name "${optionName}" for rule "${ruleName}"`); - - continue; - } - - for (const a of [optionValue].flat()) { - if (isValid(possibleValue, a)) { - continue; - } - - complain(`Invalid value ${stringify(a)} for option "${optionName}" of rule "${ruleName}"`); - } - } -} - -/** - * @param {RuleOptionsPossible | RuleOptionsPossible[]} possible - * @param {unknown} actual - * @returns {boolean} - */ -function isValid(possible, actual) { - for (const possibility of [possible].flat()) { - if (typeof possibility === 'function' && possibility(actual)) { - return true; - } - - if (actual === possibility) { - return true; - } - } - - return false; -} - -/** - * @param {unknown} value - * @returns {string} - */ -function stringify(value) { - if (typeof value === 'string') { - return `"${value}"`; - } - - return `"${JSON.stringify(value)}"`; -} diff --git a/node_modules/stylelint/lib/utils/validateTypes.js b/node_modules/stylelint/lib/utils/validateTypes.js deleted file mode 100644 index 5372bcadf..000000000 --- a/node_modules/stylelint/lib/utils/validateTypes.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict'; - -const { isPlainObject: _isPlainObject } = require('is-plain-object'); - -/** - * Checks if the value is a boolean or a Boolean object. - * @param {unknown} value - * @returns {value is boolean} - */ -function isBoolean(value) { - return typeof value === 'boolean' || value instanceof Boolean; -} - -/** - * Checks if the value is a function or a Function object. - * @param {unknown} value - * @returns {value is Function} - */ -function isFunction(value) { - return typeof value === 'function' || value instanceof Function; -} - -/** - * Checks if the value is *nullish*. - * @see https://developer.mozilla.org/en-US/docs/Glossary/Nullish - * @param {unknown} value - * @returns {value is null | undefined} - */ -function isNullish(value) { - return value == null; -} - -/** - * Checks if the value is a number or a Number object. - * @param {unknown} value - * @returns {value is number} - */ -function isNumber(value) { - return typeof value === 'number' || value instanceof Number; -} - -/** - * Checks if the value is an object. - * @param {unknown} value - * @returns {value is object} - */ -function isObject(value) { - return value !== null && typeof value === 'object'; -} - -/** - * Checks if the value is a regular expression. - * @param {unknown} value - * @returns {value is RegExp} - */ -function isRegExp(value) { - return value instanceof RegExp; -} - -/** - * Checks if the value is a string or a String object. - * @param {unknown} value - * @returns {value is string} - */ -function isString(value) { - return typeof value === 'string' || value instanceof String; -} - -/** - * Checks if the value is a plain object. - * @param {unknown} value - * @returns {value is Record} - */ -function isPlainObject(value) { - return _isPlainObject(value); -} - -/** - * Assert that the value is truthy. - * @param {unknown} value - * @param {string} [message] - * @returns {asserts value} - */ -function assert(value, message = undefined) { - if (message) { - // eslint-disable-next-line no-console - console.assert(value, message); - } else { - // eslint-disable-next-line no-console - console.assert(value); - } -} - -/** - * Assert that the value is a function or a Function object. - * @param {unknown} value - * @returns {asserts value is Function} - */ -function assertFunction(value) { - // eslint-disable-next-line no-console - console.assert(isFunction(value), `"${value}" must be a function`); -} - -/** - * Assert that the value is a number or a Number object. - * @param {unknown} value - * @returns {asserts value is number} - */ -function assertNumber(value) { - // eslint-disable-next-line no-console - console.assert(isNumber(value), `"${value}" must be a number`); -} - -/** - * Assert that the value is a string or a String object. - * @param {unknown} value - * @returns {asserts value is string} - */ -function assertString(value) { - // eslint-disable-next-line no-console - console.assert(isString(value), `"${value}" must be a string`); -} - -module.exports = { - isBoolean, - isFunction, - isNullish, - isNumber, - isObject, - isRegExp, - isString, - isPlainObject, - - assert, - assertFunction, - assertNumber, - assertString, -}; diff --git a/node_modules/stylelint/lib/utils/vendor.js b/node_modules/stylelint/lib/utils/vendor.js deleted file mode 100644 index 304182cc8..000000000 --- a/node_modules/stylelint/lib/utils/vendor.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -/** - * Contains helpers for working with vendor prefixes. - * - * Copied from https://github.com/postcss/postcss/commit/777c55b5d2a10605313a4972888f4f32005f5ac2 - * - * @namespace vendor - */ -module.exports = { - /** - * Returns the vendor prefix extracted from an input string. - * - * @param {string} prop String with or without vendor prefix. - * - * @return {string} vendor prefix or empty string - * - * @example - * vendor.prefix('-moz-tab-size') //=> '-moz-' - * vendor.prefix('tab-size') //=> '' - */ - prefix(prop) { - const match = prop.match(/^(-\w+-)/); - - if (match) { - return match[0] || ''; - } - - return ''; - }, - - /** - * Returns the input string stripped of its vendor prefix. - * - * @param {string} prop String with or without vendor prefix. - * - * @return {string} String name without vendor prefixes. - * - * @example - * vendor.unprefixed('-moz-tab-size') //=> 'tab-size' - */ - unprefixed(prop) { - return prop.replace(/^-\w+-/, ''); - }, -}; diff --git a/node_modules/stylelint/lib/utils/whitespaceChecker.js b/node_modules/stylelint/lib/utils/whitespaceChecker.js deleted file mode 100644 index cf72eecf4..000000000 --- a/node_modules/stylelint/lib/utils/whitespaceChecker.js +++ /dev/null @@ -1,340 +0,0 @@ -'use strict'; - -const configurationError = require('./configurationError'); -const isSingleLineString = require('./isSingleLineString'); -const isWhitespace = require('./isWhitespace'); -const { assertFunction, isNullish } = require('./validateTypes'); - -/** - * @typedef {(message: string) => string} MessageFunction - */ - -/** - * @typedef {Object} Messages - * @property {MessageFunction} [expectedBefore] - * @property {MessageFunction} [rejectedBefore] - * @property {MessageFunction} [expectedAfter] - * @property {MessageFunction} [rejectedAfter] - * @property {MessageFunction} [expectedBeforeSingleLine] - * @property {MessageFunction} [rejectedBeforeSingleLine] - * @property {MessageFunction} [expectedBeforeMultiLine] - * @property {MessageFunction} [rejectedBeforeMultiLine] - * @property {MessageFunction} [expectedAfterSingleLine] - * @property {MessageFunction} [rejectedAfterSingleLine] - * @property {MessageFunction} [expectedAfterMultiLine] - * @property {MessageFunction} [rejectedAfterMultiLine] - */ - -/** - * @typedef {Object} WhitespaceCheckerArgs - * @property {string} source - The source string - * @property {number} index - The index of the character to check before - * @property {(message: string) => void} err - If a problem is found, this callback - * will be invoked with the relevant warning message. - * Typically this callback will report() the problem. - * @property {string} [errTarget] - If a problem is found, this string - * will be sent to the relevant warning message. - * @property {string} [lineCheckStr] - Single- and multi-line checkers - * will use this string to determine whether they should proceed, - * i.e. if this string is one line only, single-line checkers will check, - * multi-line checkers will ignore. - * If none is passed, they will use `source`. - * @property {boolean} [onlyOneChar=false] - Only check *one* character before. - * By default, "always-*" checks will look for the `targetWhitespace` one - * before and then ensure there is no whitespace two before. This option - * bypasses that second check. - * @property {boolean} [allowIndentation=false] - Allow arbitrary indentation - * between the `targetWhitespace` (almost definitely a newline) and the `index`. - * With this option, the checker will see if a newline *begins* the whitespace before - * the `index`. - */ - -/** - * @typedef {(args: WhitespaceCheckerArgs) => void} WhitespaceChecker - */ - -/** - * @typedef {{ - * before: WhitespaceChecker, - * beforeAllowingIndentation: WhitespaceChecker, - * after: WhitespaceChecker, - * afterOneOnly: WhitespaceChecker, - * }} WhitespaceCheckers - */ - -/** - * Create a whitespaceChecker, which exposes the following functions: - * - `before()` - * - `beforeAllowingIndentation()` - * - `after()` - * - `afterOneOnly()` - * - * @param {"space" | "newline"} targetWhitespace - This is a keyword instead - * of the actual character (e.g. " ") in order to accommodate - * different styles of newline ("\n" vs "\r\n") - * @param {"always" | "never" | "always-single-line" | "always-multi-line" | "never-single-line" | "never-multi-line"} expectation - * @param {Messages} messages - An object of message functions; - * calling `before*()` or `after*()` and the `expectation` that is passed - * determines which message functions are required - * - * @returns {WhitespaceCheckers} The checker, with its exposed checking functions - */ -module.exports = function whitespaceChecker(targetWhitespace, expectation, messages) { - // Keep track of active arguments in order to avoid passing - // too much stuff around, making signatures long and confusing. - // This variable gets reset anytime a checking function is called. - /** @type {WhitespaceCheckerArgs} */ - let activeArgs; - - /** - * Check for whitespace *before* a character. - * @type {WhitespaceChecker} - */ - function before({ - source, - index, - err, - errTarget, - lineCheckStr, - onlyOneChar = false, - allowIndentation = false, - }) { - activeArgs = { - source, - index, - err, - errTarget, - onlyOneChar, - allowIndentation, - }; - - switch (expectation) { - case 'always': - expectBefore(); - break; - case 'never': - rejectBefore(); - break; - case 'always-single-line': - if (!isSingleLineString(lineCheckStr || source)) { - return; - } - - expectBefore(messages.expectedBeforeSingleLine); - break; - case 'never-single-line': - if (!isSingleLineString(lineCheckStr || source)) { - return; - } - - rejectBefore(messages.rejectedBeforeSingleLine); - break; - case 'always-multi-line': - if (isSingleLineString(lineCheckStr || source)) { - return; - } - - expectBefore(messages.expectedBeforeMultiLine); - break; - case 'never-multi-line': - if (isSingleLineString(lineCheckStr || source)) { - return; - } - - rejectBefore(messages.rejectedBeforeMultiLine); - break; - default: - throw configurationError(`Unknown expectation "${expectation}"`); - } - } - - /** - * Check for whitespace *after* a character. - * @type {WhitespaceChecker} - */ - function after({ source, index, err, errTarget, lineCheckStr, onlyOneChar = false }) { - activeArgs = { source, index, err, errTarget, onlyOneChar }; - - switch (expectation) { - case 'always': - expectAfter(); - break; - case 'never': - rejectAfter(); - break; - case 'always-single-line': - if (!isSingleLineString(lineCheckStr || source)) { - return; - } - - expectAfter(messages.expectedAfterSingleLine); - break; - case 'never-single-line': - if (!isSingleLineString(lineCheckStr || source)) { - return; - } - - rejectAfter(messages.rejectedAfterSingleLine); - break; - case 'always-multi-line': - if (isSingleLineString(lineCheckStr || source)) { - return; - } - - expectAfter(messages.expectedAfterMultiLine); - break; - case 'never-multi-line': - if (isSingleLineString(lineCheckStr || source)) { - return; - } - - rejectAfter(messages.rejectedAfterMultiLine); - break; - default: - throw configurationError(`Unknown expectation "${expectation}"`); - } - } - - /** - * @type {WhitespaceChecker} - */ - function beforeAllowingIndentation(obj) { - before({ ...obj, allowIndentation: true }); - } - - function expectBefore(messageFunc = messages.expectedBefore) { - if (activeArgs.allowIndentation) { - expectBeforeAllowingIndentation(messageFunc); - - return; - } - - const _activeArgs = activeArgs; - const source = _activeArgs.source; - const index = _activeArgs.index; - - const oneCharBefore = source[index - 1]; - const twoCharsBefore = source[index - 2]; - - if (isNullish(oneCharBefore)) { - return; - } - - if ( - targetWhitespace === 'space' && - oneCharBefore === ' ' && - (activeArgs.onlyOneChar || isNullish(twoCharsBefore) || !isWhitespace(twoCharsBefore)) - ) { - return; - } - - assertFunction(messageFunc); - activeArgs.err(messageFunc(activeArgs.errTarget || source.charAt(index))); - } - - function expectBeforeAllowingIndentation(messageFunc = messages.expectedBefore) { - const _activeArgs2 = activeArgs; - const source = _activeArgs2.source; - const index = _activeArgs2.index; - const err = _activeArgs2.err; - - const expectedChar = targetWhitespace === 'newline' ? '\n' : undefined; - let i = index - 1; - - while (source[i] !== expectedChar) { - if (source[i] === '\t' || source[i] === ' ') { - i--; - continue; - } - - assertFunction(messageFunc); - err(messageFunc(activeArgs.errTarget || source.charAt(index))); - - return; - } - } - - function rejectBefore(messageFunc = messages.rejectedBefore) { - const _activeArgs3 = activeArgs; - const source = _activeArgs3.source; - const index = _activeArgs3.index; - - const oneCharBefore = source[index - 1]; - - if (!isNullish(oneCharBefore) && isWhitespace(oneCharBefore)) { - assertFunction(messageFunc); - activeArgs.err(messageFunc(activeArgs.errTarget || source.charAt(index))); - } - } - - /** - * @type {WhitespaceChecker} - */ - function afterOneOnly(obj) { - after({ ...obj, onlyOneChar: true }); - } - - function expectAfter(messageFunc = messages.expectedAfter) { - const _activeArgs4 = activeArgs; - const source = _activeArgs4.source; - const index = _activeArgs4.index; - - const oneCharAfter = source[index + 1]; - const twoCharsAfter = source[index + 2]; - const threeCharsAfter = source[index + 3]; - - if (isNullish(oneCharAfter)) { - return; - } - - if (targetWhitespace === 'newline') { - // If index is followed by a Windows CR-LF ... - if ( - oneCharAfter === '\r' && - twoCharsAfter === '\n' && - (activeArgs.onlyOneChar || isNullish(threeCharsAfter) || !isWhitespace(threeCharsAfter)) - ) { - return; - } - - // If index is followed by a Unix LF ... - if ( - oneCharAfter === '\n' && - (activeArgs.onlyOneChar || isNullish(twoCharsAfter) || !isWhitespace(twoCharsAfter)) - ) { - return; - } - } - - if ( - targetWhitespace === 'space' && - oneCharAfter === ' ' && - (activeArgs.onlyOneChar || isNullish(twoCharsAfter) || !isWhitespace(twoCharsAfter)) - ) { - return; - } - - assertFunction(messageFunc); - activeArgs.err(messageFunc(activeArgs.errTarget || source.charAt(index))); - } - - function rejectAfter(messageFunc = messages.rejectedAfter) { - const _activeArgs5 = activeArgs; - const source = _activeArgs5.source; - const index = _activeArgs5.index; - - const oneCharAfter = source[index + 1]; - - if (!isNullish(oneCharAfter) && isWhitespace(oneCharAfter)) { - assertFunction(messageFunc); - activeArgs.err(messageFunc(activeArgs.errTarget || source.charAt(index))); - } - } - - return { - before, - beforeAllowingIndentation, - after, - afterOneOnly, - }; -}; diff --git a/node_modules/stylelint/lib/validateDisableSettings.js b/node_modules/stylelint/lib/validateDisableSettings.js deleted file mode 100644 index 9f093b40c..000000000 --- a/node_modules/stylelint/lib/validateDisableSettings.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -const validateOptions = require('./utils/validateOptions'); -const { isRegExp, isString } = require('./utils/validateTypes'); - -/** - * @typedef {import('stylelint').PostcssResult} PostcssResult - * @typedef {import('stylelint').DisableOptions} DisableOptions - * @typedef {import('stylelint').DisablePropertyName} DisablePropertyName - * @typedef {import('stylelint').StylelintPostcssResult} StylelintPostcssResult - */ - -/** - * Validates that the stylelint config for `result` has a valid disable field - * named `field`, and returns the result in normalized form as well as a - * `StylelintPostcssResult` for convenience. - * - * Returns `null` if no disables should be reported, and automatically reports - * an invalid configuration. If this returns non-`null`, it guarantees that - * `result._postcssResult` is defined as well. - * - * @param {PostcssResult | undefined} result - * @param {DisablePropertyName} field - * @return {[boolean, Required, StylelintPostcssResult] | null} - */ -module.exports = function validateDisableSettings(result, field) { - // Files with `CssSyntaxError`s don't have `_postcssResult`s. - if (!result) return null; - - const stylelintResult = result.stylelint; - - // Files with linting errors may not have configs associated with them. - if (!stylelintResult.config) return null; - - const rawSettings = stylelintResult.config[field]; - - /** @type {boolean} */ - let enabled; - /** @type {DisableOptions} */ - let options; - - if (Array.isArray(rawSettings)) { - enabled = rawSettings[0]; - options = rawSettings[1] || {}; - } else { - enabled = rawSettings || false; - options = {}; - } - - const validOptions = validateOptions( - result, - field, - { - actual: enabled, - possible: [true, false], - }, - { - actual: options, - possible: { - except: [isString, isRegExp], - }, - }, - ); - - if (!validOptions) return null; - - // If the check is disabled with no exceptions, there's no reason to run - // it at all. - if (!enabled && !options.except) return null; - - return [ - enabled, - { - except: options.except || [], - severity: options.severity || stylelintResult.config.defaultSeverity || 'error', - }, - stylelintResult, - ]; -}; diff --git a/node_modules/stylelint/lib/writeOutputFile.js b/node_modules/stylelint/lib/writeOutputFile.js deleted file mode 100644 index d77ee36d7..000000000 --- a/node_modules/stylelint/lib/writeOutputFile.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -const path = require('path'); -const { mkdir } = require('fs').promises; -const stripAnsi = require('strip-ansi'); -const writeFileAtomic = require('write-file-atomic'); - -/** - * @param {string} content - * @param {string} filePath - * @returns {Promise} - */ -module.exports = async function writeOutputFile(content, filePath) { - await mkdir(path.dirname(filePath), { recursive: true }); - - await writeFileAtomic(path.normalize(filePath), stripAnsi(content)); -}; diff --git a/node_modules/stylelint/package.json b/node_modules/stylelint/package.json deleted file mode 100644 index 79df8a893..000000000 --- a/node_modules/stylelint/package.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "name": "stylelint", - "version": "15.10.1", - "description": "A mighty CSS linter that helps you avoid errors and enforce conventions.", - "keywords": [ - "css-in-js", - "css", - "less", - "lint", - "linter", - "markdown", - "sass", - "scss", - "stylelint", - "sugarss" - ], - "homepage": "https://stylelint.io", - "repository": "stylelint/stylelint", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/stylelint" - }, - "license": "MIT", - "author": "stylelint", - "main": "lib/index.js", - "types": "types/stylelint/index.d.ts", - "bin": { - "stylelint": "bin/stylelint.mjs" - }, - "files": [ - "bin/**/*.js", - "bin/**/*.mjs", - "lib/**/*.js", - "lib/**/*.mjs", - "!**/__tests__/**", - "!lib/testUtils/**", - "types/stylelint/index.d.ts" - ], - "scripts": { - "benchmark-rule": "node scripts/benchmark-rule.mjs", - "format": "prettier . --write --cache", - "lint": "npm-run-all --parallel --continue-on-error lint:*", - "lint:formatting": "prettier . --check --cache", - "lint:js": "eslint . --cache --max-warnings=0 --ext .js,.mjs", - "lint:md": "remark . --quiet --frail", - "lint:types": "tsc", - "prepare": "husky install && patch-package", - "release": "np --no-release-draft", - "pretest": "npm run lint", - "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", - "test-coverage": "npm test --ignore-scripts -- --coverage", - "test-only": "npm test --ignore-scripts", - "version": "changeset version", - "postversion": "git restore package.json", - "watch": "npm test --ignore-scripts -- --watch", - "changelog-to-github-release": "remark --quiet --use ./scripts/remark-changelog-to-github-release.mjs CHANGELOG.md" - }, - "lint-staged": { - "*.{js,mjs}": "eslint --cache --fix", - "*.{js,json,md,mjs,ts,yml}": "prettier --write" - }, - "prettier": "@stylelint/prettier-config", - "eslintConfig": { - "extends": [ - "stylelint", - "stylelint/jest" - ], - "overrides": [ - { - "files": [ - "**/*.mjs" - ], - "plugins": [ - "eslint-plugin-import" - ], - "rules": { - "import/extensions": [ - "error", - "ignorePackages" - ] - } - } - ], - "globals": { - "__dirname": true, - "module": true, - "require": true, - "testRule": true - }, - "root": true - }, - "remarkConfig": { - "plugins": [ - "@stylelint/remark-preset" - ] - }, - "jest": { - "clearMocks": true, - "collectCoverage": false, - "collectCoverageFrom": [ - "lib/**/*.{js,mjs}", - "!lib/**/{__tests__,testUtils}/**/*.{js,mjs}" - ], - "coverageDirectory": "./.coverage/", - "coverageProvider": "v8", - "coverageReporters": [ - "lcov", - "text-summary" - ], - "coverageThreshold": { - "global": { - "branches": 75, - "functions": 75, - "lines": 75, - "statements": 75 - } - }, - "moduleNameMapper": { - "^stylelint$": "/lib/index.js", - "stylelint/lib/utils/getOsEol": "/lib/utils/getOsEol.js" - }, - "preset": "jest-preset-stylelint", - "roots": [ - "lib", - "system-tests" - ], - "testEnvironment": "node", - "testRegex": ".*\\.test\\.m?js$|rules/.*/__tests__/.*\\.m?js$", - "watchPlugins": [ - "jest-watch-typeahead/filename", - "jest-watch-typeahead/testname" - ] - }, - "dependencies": { - "@csstools/css-parser-algorithms": "^2.3.0", - "@csstools/css-tokenizer": "^2.1.1", - "@csstools/media-query-list-parser": "^2.1.2", - "@csstools/selector-specificity": "^3.0.0", - "balanced-match": "^2.0.0", - "colord": "^2.9.3", - "cosmiconfig": "^8.2.0", - "css-functions-list": "^3.1.0", - "css-tree": "^2.3.1", - "debug": "^4.3.4", - "fast-glob": "^3.3.0", - "fastest-levenshtein": "^1.0.16", - "file-entry-cache": "^6.0.1", - "global-modules": "^2.0.0", - "globby": "^11.1.0", - "globjoin": "^0.1.4", - "html-tags": "^3.3.1", - "ignore": "^5.2.4", - "import-lazy": "^4.0.0", - "imurmurhash": "^0.1.4", - "is-plain-object": "^5.0.0", - "known-css-properties": "^0.27.0", - "mathml-tag-names": "^2.1.3", - "meow": "^10.1.5", - "micromatch": "^4.0.5", - "normalize-path": "^3.0.0", - "picocolors": "^1.0.0", - "postcss": "^8.4.24", - "postcss-resolve-nested-selector": "^0.1.1", - "postcss-safe-parser": "^6.0.0", - "postcss-selector-parser": "^6.0.13", - "postcss-value-parser": "^4.2.0", - "resolve-from": "^5.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "style-search": "^0.1.0", - "supports-hyperlinks": "^3.0.0", - "svg-tags": "^1.0.0", - "table": "^6.8.1", - "write-file-atomic": "^5.0.1" - }, - "devDependencies": { - "@changesets/cli": "^2.26.2", - "@changesets/get-github-info": "^0.5.2", - "@jest/globals": "^29.5.0", - "@stylelint/prettier-config": "^2.0.0", - "@stylelint/remark-preset": "^4.0.0", - "@types/balanced-match": "^1.0.2", - "@types/css-tree": "^2.3.1", - "@types/debug": "^4.1.8", - "@types/file-entry-cache": "^5.0.2", - "@types/global-modules": "^2.0.0", - "@types/globjoin": "^0.1.0", - "@types/imurmurhash": "^0.1.1", - "@types/micromatch": "^4.0.2", - "@types/normalize-path": "^3.0.0", - "@types/postcss-less": "^4.0.2", - "@types/postcss-resolve-nested-selector": "^0.1.0", - "@types/postcss-safe-parser": "^5.0.1", - "@types/style-search": "^0.1.3", - "@types/svg-tags": "^1.0.0", - "@types/write-file-atomic": "^4.0.0", - "benchmark": "^2.1.4", - "common-tags": "^1.8.2", - "deepmerge": "^4.3.1", - "eslint": "^8.44.0", - "eslint-config-stylelint": "^19.0.0", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-jest": "^27.2.2", - "husky": "^8.0.3", - "jest": "^29.5.0", - "jest-preset-stylelint": "^6.1.0", - "jest-watch-typeahead": "^2.2.2", - "lint-staged": "^13.2.3", - "np": "^8.0.4", - "npm-run-all": "^4.1.5", - "patch-package": "^7.0.0", - "postcss-html": "^1.5.0", - "postcss-import": "^15.1.0", - "postcss-less": "^6.0.0", - "postcss-sass": "^0.5.0", - "postcss-scss": "^4.0.6", - "remark-cli": "^11.0.0", - "sugarss": "^4.0.1", - "typescript": "^5.1.6" - }, - "engines": { - "node": "^14.13.1 || >=16.0.0" - } -} diff --git a/node_modules/stylelint/types/stylelint/index.d.ts b/node_modules/stylelint/types/stylelint/index.d.ts deleted file mode 100644 index 2641dfc8a..000000000 --- a/node_modules/stylelint/types/stylelint/index.d.ts +++ /dev/null @@ -1,639 +0,0 @@ -import type * as PostCSS from 'postcss'; -import type { GlobbyOptions } from 'globby'; -import type { cosmiconfig, TransformSync as CosmiconfigTransformSync } from 'cosmiconfig'; - -type ConfigExtends = string | string[]; -type ConfigPlugins = string | stylelint.Plugin | (string | stylelint.Plugin)[]; -type ConfigIgnoreFiles = string | string[]; - -type ConfigRules = { - [ruleName: string]: stylelint.ConfigRuleSettings; -}; -type ConfigOverride = Omit & { - files: string | string[]; -}; - -type DisableSettings = stylelint.ConfigRuleSettings; - -// A meta-type that returns a union over all properties of `T` whose values -// have type `U`. -type PropertyNamesOfType = { - [K in keyof T]-?: T[K] extends U ? K : never; -}[keyof T]; - -type FileCache = { - calcHashOfConfig: (config: stylelint.Config) => void; - hasFileChanged: (absoluteFilepath: string) => boolean; - reconcile: () => void; - destroy: () => void; - removeEntry: (absoluteFilepath: string) => void; -}; - -type EmptyResult = { - root: { - nodes?: undefined; - source: { - lang?: undefined; - input: { - file?: string; - }; - }; - }; - messages: PostCSS.Message[]; - opts: undefined; -}; - -// Note: With strict function types enabled, function signatures are checked contravariantly. -// This means that it would not be possible for rule authors to narrow the message function -// parameters to e.g. just `string`. Declaring the type for rule message functions through -// method declarations tricks TypeScript into bivariant signature checking. More details can -// be found here: https://stackoverflow.com/questions/52667959/what-is-the-purpose-of-bivariancehack-in-typescript-types. -// and in the original discussion: https://github.com/stylelint/stylelint/pull/6147#issuecomment-1155337016. -type RuleMessageFunc = { - bivariance(...args: (string | number | boolean | RegExp)[]): string; -}['bivariance']; - -type RuleOptionsPossibleFunc = (value: unknown) => boolean; - -type DisableReportEntry = { - source?: string; - ranges: stylelint.DisableReportRange[]; -}; - -declare namespace stylelint { - /** - * Rule severity. - */ - type Severity = 'warning' | 'error'; - - /** - * A Stylelint plugin. - */ - type Plugin = { default?: { ruleName: string; rule: Rule } } | { ruleName: string; rule: Rule }; - - /** @internal */ - type ConfigRuleSettings = - | null - | undefined - | NonNullable - | [NonNullable] - | [NonNullable, O]; - - /** @internal */ - type DisableOptions = { - except?: (string | RegExp)[]; - severity?: Severity; - }; - - /** - * Configuration. - */ - type Config = { - extends?: ConfigExtends; - plugins?: ConfigPlugins; - pluginFunctions?: { - [pluginName: string]: Rule; - }; - ignoreFiles?: ConfigIgnoreFiles; - ignorePatterns?: string; - rules?: ConfigRules; - quiet?: boolean; - defaultSeverity?: Severity; - ignoreDisables?: DisableSettings; - reportNeedlessDisables?: DisableSettings; - reportInvalidScopeDisables?: DisableSettings; - reportDescriptionlessDisables?: DisableSettings; - configurationComment?: string; - overrides?: ConfigOverride[]; - customSyntax?: CustomSyntax; - allowEmptyInput?: boolean; - cache?: boolean; - fix?: boolean; - }; - - /** @internal */ - type DisablePropertyName = PropertyNamesOfType; - - /** @internal */ - type CosmiconfigResult = (ReturnType & { config: Config }) | null; - - /** @internal */ - type DisabledRange = { - comment: PostCSS.Comment; - start: number; - strictStart: boolean; - end?: number; - strictEnd?: boolean; - rules?: string[]; - description?: string; - }; - - /** @internal */ - type DisabledRangeObject = { - [ruleName: string]: DisabledRange[]; - }; - - /** @internal */ - type DisabledWarning = { line: number; rule: string }; - - /** @internal */ - type StylelintPostcssResult = { - ruleSeverities: { [ruleName: string]: Severity }; - customMessages: { [ruleName: string]: RuleMessage }; - ruleMetadata: { [ruleName: string]: Partial }; - quiet?: boolean; - disabledRanges: DisabledRangeObject; - disabledWarnings?: DisabledWarning[]; - ignored?: boolean; - stylelintError?: boolean; - stylelintWarning?: boolean; - disableWritingFix?: boolean; - config?: Config; - }; - - /** @internal */ - type WarningOptions = PostCSS.WarningOptions & { - stylelintType?: string; - severity?: Severity; - rule?: string; - }; - - /** @internal */ - type PostcssResult = (PostCSS.Result | EmptyResult) & { - stylelint: StylelintPostcssResult; - warn(message: string, options?: WarningOptions): void; - }; - - /** @internal */ - type Formatter = (results: LintResult[], returnValue: LinterResult) => string; - - /** @internal */ - type FormatterType = 'compact' | 'github' | 'json' | 'string' | 'tap' | 'unix' | 'verbose'; - - /** @internal */ - type CustomSyntax = string | PostCSS.Syntax; - - /** @internal */ - type RuleMessage = string | RuleMessageFunc; - - /** @internal */ - type RuleMessages = { [message: string]: RuleMessage }; - - /** @internal */ - type RuleOptionsPossible = boolean | number | string | RuleOptionsPossibleFunc; - - /** @internal */ - type RuleOptions = { - actual: unknown; - possible?: - | RuleOptionsPossibleFunc - | RuleOptionsPossible[] - | Record; - optional?: boolean; - }; - - /** - * A rule context. - */ - type RuleContext = { - configurationComment?: string | undefined; - fix?: boolean | undefined; - newline?: string | undefined; - }; - - /** @internal */ - type RuleBase

= ( - primaryOption: P, - secondaryOptions: Record, - context: RuleContext, - ) => (root: PostCSS.Root, result: PostcssResult) => Promise | void; - - /** @internal */ - type RuleMeta = { - url: string; - deprecated?: boolean; - fixable?: boolean; - }; - - /** - * A rule. - */ - type Rule

= RuleBase & { - ruleName: string; - messages: RuleMessages; - primaryOptionArray?: boolean; - meta?: RuleMeta; - }; - - /** @internal */ - type GetPostcssOptions = { - code?: string; - codeFilename?: string; - filePath?: string; - customSyntax?: CustomSyntax; - }; - - /** @internal */ - type GetLintSourceOptions = GetPostcssOptions & { - existingPostcssResult?: PostCSS.Result; - cache?: boolean; - }; - - /** - * Linter options. - */ - type LinterOptions = { - files?: string | string[]; - globbyOptions?: GlobbyOptions; - cache?: boolean; - cacheLocation?: string; - cacheStrategy?: string; - code?: string; - codeFilename?: string; - config?: Config; - configFile?: string; - configBasedir?: string; - /** - * The working directory to resolve files from. Defaults to the - * current working directory. - */ - cwd?: string; - ignoreDisables?: boolean; - ignorePath?: string | string[]; - ignorePattern?: string[]; - reportDescriptionlessDisables?: boolean; - reportNeedlessDisables?: boolean; - reportInvalidScopeDisables?: boolean; - maxWarnings?: number; - customSyntax?: CustomSyntax; - formatter?: FormatterType | Formatter; - disableDefaultIgnores?: boolean; - fix?: boolean; - allowEmptyInput?: boolean; - quiet?: boolean; - quietDeprecationWarnings?: boolean; - }; - - /** - * A CSS syntax error. - */ - type CssSyntaxError = { - file?: string; - input: { - column: number; - file?: string; - line: number; - source: string; - }; - /** - * The line of the inclusive start position of the error. - */ - line: number; - /** - * The column of the inclusive start position of the error. - */ - column: number; - /** - * The line of the exclusive end position of the error. - */ - endLine?: number; - /** - * The column of the exclusive end position of the error. - */ - endColumn?: number; - message: string; - name: string; - reason: string; - source: string; - }; - - /** - * A lint warning. - */ - type Warning = { - /** - * The line of the inclusive start position of the warning. - */ - line: number; - /** - * The column of the inclusive start position of the warning. - */ - column: number; - /** - * The line of the exclusive end position of the warning. - */ - endLine?: number; - /** - * The column of the exclusive end position of the warning. - */ - endColumn?: number; - rule: string; - severity: Severity; - text: string; - stylelintType?: string; - }; - - /** - * A lint result. - */ - type LintResult = { - source?: string; - deprecations: { - text: string; - reference?: string; - }[]; - invalidOptionWarnings: { - text: string; - }[]; - parseErrors: (PostCSS.Warning & { stylelintType: string })[]; - errored?: boolean; - warnings: Warning[]; - ignored?: boolean; - /** - * Internal use only. Do not use or rely on this property. It may - * change at any time. - * @internal - */ - _postcssResult?: PostcssResult; - }; - - /** @internal */ - type DisableReportRange = { - rule: string; - start: number; - end?: number; - }; - - /** - * A linter result. - */ - type LinterResult = { - /** - * The working directory from which the linter was run when the - * results were generated. - */ - cwd: string; - results: LintResult[]; - errored: boolean; - output: any; - maxWarningsExceeded?: { - maxWarnings: number; - foundWarnings: number; - }; - reportedDisables: DisableOptionsReport; - descriptionlessDisables?: DisableOptionsReport; - needlessDisables?: DisableOptionsReport; - invalidScopeDisables?: DisableOptionsReport; - /** - * Each rule metadata by name. - */ - ruleMetadata: { [ruleName: string]: Partial }; - }; - - /** - * A lint problem. - */ - type Problem = { - ruleName: string; - result: PostcssResult; - message: RuleMessage; - messageArgs?: Parameters | undefined; - node: PostCSS.Node; - /** - * The inclusive start index of the problem, relative to the node's - * source text. - */ - index?: number; - /** - * The exclusive end index of the problem, relative to the node's - * source text. - */ - endIndex?: number; - /** - * The inclusive start position of the problem, relative to the - * node's source text. If provided, this will be used instead of - * `index`. - */ - start?: { - line: number; - column: number; - }; - /** - * The exclusive end position of the problem, relative to the - * node's source text. If provided, this will be used instead of - * `endIndex`. - */ - end?: { - line: number; - column: number; - }; - word?: string; - line?: number; - /** - * Optional severity override for the problem. - */ - severity?: Severity; - }; - - /** @internal */ - type ShorthandProperties = - | 'animation' - | 'background' - | 'border' - | 'border-block-end' - | 'border-block-start' - | 'border-bottom' - | 'border-color' - | 'border-image' - | 'border-inline-end' - | 'border-inline-start' - | 'border-left' - | 'border-radius' - | 'border-right' - | 'border-style' - | 'border-top' - | 'border-width' - | 'column-rule' - | 'columns' - | 'flex' - | 'flex-flow' - | 'font' - | 'grid' - | 'grid-area' - | 'grid-column' - | 'grid-gap' - | 'grid-row' - | 'grid-template' - | 'inset' - | 'list-style' - | 'margin' - | 'mask' - | 'outline' - | 'padding' - | 'text-decoration' - | 'text-emphasis' - | 'transition'; - - /** @internal */ - type LonghandSubPropertiesOfShorthandProperties = ReadonlyMap< - ShorthandProperties, - ReadonlySet - >; - - /** - * Utility functions. - */ - type Utils = { - /** - * Report a problem. - * - * This function accounts for `disabledRanges` attached to the result. - * That is, if the reported problem is within a disabledRange, - * it is ignored. Otherwise, it is attached to the result as a - * postcss warning. - * - * It also accounts for the rule's severity. - * - * You *must* pass *either* a node or a line number. - * - * @param problem - A problem - */ - report: (problem: Problem) => void; - - /** - * Given an object of problem messages, return another - * that provides the same messages postfixed with the rule - * that has been violated. - * - * @param ruleName - A rule name - * @param messages - An object whose keys are message identifiers - * and values are either message strings or functions that return message strings - * @returns New message object, whose messages will be marked with the rule name - */ - ruleMessages: ( - ruleName: string, - messages: T, - ) => R; - - /** - * Validate a rule's options. - * - * See existing rules for examples. - * - * @param result - PostCSS result - * @param ruleName - A rule name - * @param optionDescriptions - Each optionDescription can have the following properties: - * - `actual` (required): the actual passed option value or object. - * - `possible` (required): a schema representation of what values are - * valid for those options. `possible` should be an object if the - * options are an object, with corresponding keys; if the options are not an - * object, `possible` isn't, either. All `possible` value representations - * should be **arrays of either values or functions**. Values are === checked - * against `actual`. Functions are fed `actual` as an argument and their - * return value is interpreted: truthy = valid, falsy = invalid. - * - `optional` (optional): If this is `true`, `actual` can be undefined. - * @returns Whether or not the options are valid (`true` = valid) - */ - validateOptions: ( - result: PostcssResult, - ruleName: string, - ...optionDescriptions: RuleOptions[] - ) => boolean; - - /** - * Useful for third-party code (e.g. plugins) to run a PostCSS Root - * against a specific rule and do something with the warnings. - */ - checkAgainstRule: ( - options: { - ruleName: string; - ruleSettings: ConfigRuleSettings; - root: PostCSS.Root; - result?: PostcssResult; - context?: RuleContext; - }, - callback: (warning: PostCSS.Warning) => void, - ) => void; - }; - - /** - * Internal use only. Do not use or rely on this type. It may change at - * any time. - * @internal - */ - type InternalApi = { - _options: LinterOptions & { cwd: string }; - _extendExplorer: ReturnType; - _specifiedConfigCache: Map>; - _postcssResultCache: Map; - _fileCache: FileCache; - }; - - type DisableOptionsReport = DisableReportEntry[]; - - type PostcssPluginOptions = Omit | Config; -} - -type PublicApi = PostCSS.PluginCreator & { - /** - * Runs Stylelint with the given options and returns a Promise that - * resolves to the results. - * - * @param options - A lint options object - * @returns A lint result - */ - lint: (options: stylelint.LinterOptions) => Promise; - - /** - * Available rules. - */ - rules: { [k: string]: stylelint.Rule }; - - /** - * Result report formatters by name. - */ - formatters: { [k: string]: stylelint.Formatter }; - - /** - * Creates a Stylelint plugin. - */ - createPlugin: (ruleName: string, rule: stylelint.Rule) => stylelint.Plugin; - - /** - * The Stylelint "internal API" is passed among functions - * so that methods on a Stylelint instance can invoke - * each other while sharing options and caches. - * - * @internal - */ - _createLinter: (options: stylelint.LinterOptions) => stylelint.InternalApi; - - /** - * Resolves the effective configuration for a given file. Resolves to - * `undefined` if no config is found. - * - * @param filePath - The path to the file to get the config for. - * @param options - The options to use when creating the Stylelint instance. - * @returns A resolved config or `undefined`. - */ - resolveConfig: ( - filePath: string, - options?: Pick, - ) => Promise; - - /** - * Utility functions. - */ - utils: stylelint.Utils; - - /** - * Reference objects. - */ - reference: { - longhandSubPropertiesOfShorthandProperties: stylelint.LonghandSubPropertiesOfShorthandProperties; - }; -}; - -declare const stylelint: PublicApi; - -export = stylelint; diff --git a/node_modules/supports-color/browser.js b/node_modules/supports-color/browser.js deleted file mode 100644 index 62afa3a74..000000000 --- a/node_modules/supports-color/browser.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; -module.exports = { - stdout: false, - stderr: false -}; diff --git a/node_modules/supports-color/index.js b/node_modules/supports-color/index.js deleted file mode 100644 index 1704131bd..000000000 --- a/node_modules/supports-color/index.js +++ /dev/null @@ -1,131 +0,0 @@ -'use strict'; -const os = require('os'); -const hasFlag = require('has-flag'); - -const env = process.env; - -let forceColor; -if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false')) { - forceColor = false; -} else if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - forceColor = true; -} -if ('FORCE_COLOR' in env) { - forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; -} - -function translateLevel(level) { - if (level === 0) { - return false; - } - - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} - -function supportsColor(stream) { - if (forceColor === false) { - return 0; - } - - if (hasFlag('color=16m') || - hasFlag('color=full') || - hasFlag('color=truecolor')) { - return 3; - } - - if (hasFlag('color=256')) { - return 2; - } - - if (stream && !stream.isTTY && forceColor !== true) { - return 0; - } - - const min = forceColor ? 1 : 0; - - if (process.platform === 'win32') { - // Node.js 7.5.0 is the first version of Node.js to include a patch to - // libuv that enables 256 color output on Windows. Anything earlier and it - // won't work. However, here we target Node.js 8 at minimum as it is an LTS - // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows - // release that supports 256 colors. Windows 10 build 14931 is the first release - // that supports 16m/TrueColor. - const osRelease = os.release().split('.'); - if ( - Number(process.versions.node.split('.')[0]) >= 8 && - Number(osRelease[0]) >= 10 && - Number(osRelease[2]) >= 10586 - ) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - - return 1; - } - - if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { - return 1; - } - - return min; - } - - if ('TEAMCITY_VERSION' in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - - if (env.COLORTERM === 'truecolor') { - return 3; - } - - if ('TERM_PROGRAM' in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); - - switch (env.TERM_PROGRAM) { - case 'iTerm.app': - return version >= 3 ? 3 : 2; - case 'Apple_Terminal': - return 2; - // No default - } - } - - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - - if ('COLORTERM' in env) { - return 1; - } - - if (env.TERM === 'dumb') { - return min; - } - - return min; -} - -function getSupportLevel(stream) { - const level = supportsColor(stream); - return translateLevel(level); -} - -module.exports = { - supportsColor: getSupportLevel, - stdout: getSupportLevel(process.stdout), - stderr: getSupportLevel(process.stderr) -}; diff --git a/node_modules/supports-color/license b/node_modules/supports-color/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/supports-color/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/supports-color/package.json b/node_modules/supports-color/package.json deleted file mode 100644 index ad199f5cd..000000000 --- a/node_modules/supports-color/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "supports-color", - "version": "5.5.0", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": "chalk/supports-color", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js", - "browser.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect", - "truecolor", - "16m" - ], - "dependencies": { - "has-flag": "^3.0.0" - }, - "devDependencies": { - "ava": "^0.25.0", - "import-fresh": "^2.0.0", - "xo": "^0.20.0" - }, - "browser": "browser.js" -} diff --git a/node_modules/supports-color/readme.md b/node_modules/supports-color/readme.md deleted file mode 100644 index f6e401957..000000000 --- a/node_modules/supports-color/readme.md +++ /dev/null @@ -1,66 +0,0 @@ -# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) - -> Detect whether a terminal supports color - - -## Install - -``` -$ npm install supports-color -``` - - -## Usage - -```js -const supportsColor = require('supports-color'); - -if (supportsColor.stdout) { - console.log('Terminal stdout supports color'); -} - -if (supportsColor.stdout.has256) { - console.log('Terminal stdout supports 256 colors'); -} - -if (supportsColor.stderr.has16m) { - console.log('Terminal stderr supports 16 million colors (truecolor)'); -} -``` - - -## API - -Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. - -The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: - -- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) -- `.level = 2` and `.has256 = true`: 256 color support -- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) - - -## Info - -It obeys the `--color` and `--no-color` CLI flags. - -Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. - -Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. - - -## Related - -- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/node_modules/supports-hyperlinks/browser.js b/node_modules/supports-hyperlinks/browser.js deleted file mode 100644 index b01363056..000000000 --- a/node_modules/supports-hyperlinks/browser.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; -module.exports = { - stdin: false, - stderr: false, - supportsHyperlink: function () { // eslint-disable-line object-shorthand - return false; - } -}; diff --git a/node_modules/supports-hyperlinks/index.d.ts b/node_modules/supports-hyperlinks/index.d.ts deleted file mode 100644 index 286f5784c..000000000 --- a/node_modules/supports-hyperlinks/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function supportsHyperlink(stream: { - isTTY?: boolean | undefined; -}): boolean; -export declare const stdout: boolean; -export declare const stderr: boolean; diff --git a/node_modules/supports-hyperlinks/index.js b/node_modules/supports-hyperlinks/index.js deleted file mode 100644 index 01b68c0f2..000000000 --- a/node_modules/supports-hyperlinks/index.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict'; -const supportsColor = require('supports-color'); -const hasFlag = require('has-flag'); - -/** -@param {string} versionString -@returns {{ major: number, minor: number, patch: number }} -*/ -function parseVersion(versionString) { - if (/^\d{3,4}$/.test(versionString)) { - // Env var doesn't always use dots. example: 4601 => 46.1.0 - const m = /(\d{1,2})(\d{2})/.exec(versionString) || []; - return { - major: 0, - minor: parseInt(m[1], 10), - patch: parseInt(m[2], 10) - }; - } - - const versions = (versionString || '').split('.').map(n => parseInt(n, 10)); - return { - major: versions[0], - minor: versions[1], - patch: versions[2] - }; -} - -/** -@param {{ isTTY?: boolean | undefined }} stream -@returns {boolean} -*/ -function supportsHyperlink(stream) { - const { - CI, - FORCE_HYPERLINK, - NETLIFY, - TEAMCITY_VERSION, - TERM_PROGRAM, - TERM_PROGRAM_VERSION, - VTE_VERSION - } = process.env; - - if (FORCE_HYPERLINK) { - return !(FORCE_HYPERLINK.length > 0 && parseInt(FORCE_HYPERLINK, 10) === 0); - } - - if (hasFlag('no-hyperlink') || hasFlag('no-hyperlinks') || hasFlag('hyperlink=false') || hasFlag('hyperlink=never')) { - return false; - } - - if (hasFlag('hyperlink=true') || hasFlag('hyperlink=always')) { - return true; - } - - // Netlify does not run a TTY, it does not need `supportsColor` check - if (NETLIFY) { - return true; - } - - // If they specify no colors, they probably don't want hyperlinks. - if (!supportsColor.supportsColor(stream)) { - return false; - } - - if (stream && !stream.isTTY) { - return false; - } - - if (process.platform === 'win32') { - return false; - } - - if (CI) { - return false; - } - - if (TEAMCITY_VERSION) { - return false; - } - - if (TERM_PROGRAM) { - const version = parseVersion(TERM_PROGRAM_VERSION || ''); - - switch (TERM_PROGRAM) { - case 'iTerm.app': - if (version.major === 3) { - return version.minor >= 1; - } - - return version.major > 3; - case 'WezTerm': - return version.major >= 20200620; - case 'vscode': - // eslint-disable-next-line no-mixed-operators - return version.major > 1 || version.major === 1 && version.minor >= 72; - // No default - } - } - - if (VTE_VERSION) { - // 0.50.0 was supposed to support hyperlinks, but throws a segfault - if (VTE_VERSION === '0.50.0') { - return false; - } - - const version = parseVersion(VTE_VERSION); - return version.major > 0 || version.minor >= 50; - } - - return false; -} - -module.exports = { - supportsHyperlink, - stdout: supportsHyperlink(process.stdout), - stderr: supportsHyperlink(process.stderr) -}; diff --git a/node_modules/supports-hyperlinks/license b/node_modules/supports-hyperlinks/license deleted file mode 100644 index 32a380af3..000000000 --- a/node_modules/supports-hyperlinks/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) James Talmage (github.com/jamestalmage) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/supports-hyperlinks/node_modules/has-flag/index.d.ts b/node_modules/supports-hyperlinks/node_modules/has-flag/index.d.ts deleted file mode 100644 index a0a48c891..000000000 --- a/node_modules/supports-hyperlinks/node_modules/has-flag/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** -Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag. - -@param flag - CLI flag to look for. The `--` prefix is optional. -@param argv - CLI arguments. Default: `process.argv`. -@returns Whether the flag exists. - -@example -``` -// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow - -// foo.ts -import hasFlag = require('has-flag'); - -hasFlag('unicorn'); -//=> true - -hasFlag('--unicorn'); -//=> true - -hasFlag('f'); -//=> true - -hasFlag('-f'); -//=> true - -hasFlag('foo=bar'); -//=> true - -hasFlag('foo'); -//=> false - -hasFlag('rainbow'); -//=> false -``` -*/ -declare function hasFlag(flag: string, argv?: string[]): boolean; - -export = hasFlag; diff --git a/node_modules/supports-hyperlinks/node_modules/has-flag/index.js b/node_modules/supports-hyperlinks/node_modules/has-flag/index.js deleted file mode 100644 index b6f80b1f8..000000000 --- a/node_modules/supports-hyperlinks/node_modules/has-flag/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -module.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf('--'); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -}; diff --git a/node_modules/supports-hyperlinks/node_modules/has-flag/license b/node_modules/supports-hyperlinks/node_modules/has-flag/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/supports-hyperlinks/node_modules/has-flag/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/supports-hyperlinks/node_modules/has-flag/package.json b/node_modules/supports-hyperlinks/node_modules/has-flag/package.json deleted file mode 100644 index a9cba4b85..000000000 --- a/node_modules/supports-hyperlinks/node_modules/has-flag/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "has-flag", - "version": "4.0.0", - "description": "Check if argv has a specific flag", - "license": "MIT", - "repository": "sindresorhus/has-flag", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "has", - "check", - "detect", - "contains", - "find", - "flag", - "cli", - "command-line", - "argv", - "process", - "arg", - "args", - "argument", - "arguments", - "getopt", - "minimist", - "optimist" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/supports-hyperlinks/node_modules/has-flag/readme.md b/node_modules/supports-hyperlinks/node_modules/has-flag/readme.md deleted file mode 100644 index 3f72dff29..000000000 --- a/node_modules/supports-hyperlinks/node_modules/has-flag/readme.md +++ /dev/null @@ -1,89 +0,0 @@ -# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) - -> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag - -Correctly stops looking after an `--` argument terminator. - ---- - -

- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- - - -## Install - -``` -$ npm install has-flag -``` - - -## Usage - -```js -// foo.js -const hasFlag = require('has-flag'); - -hasFlag('unicorn'); -//=> true - -hasFlag('--unicorn'); -//=> true - -hasFlag('f'); -//=> true - -hasFlag('-f'); -//=> true - -hasFlag('foo=bar'); -//=> true - -hasFlag('foo'); -//=> false - -hasFlag('rainbow'); -//=> false -``` - -``` -$ node foo.js -f --unicorn --foo=bar -- --rainbow -``` - - -## API - -### hasFlag(flag, [argv]) - -Returns a boolean for whether the flag exists. - -#### flag - -Type: `string` - -CLI flag to look for. The `--` prefix is optional. - -#### argv - -Type: `string[]`
-Default: `process.argv` - -CLI arguments. - - -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/supports-hyperlinks/node_modules/supports-color/browser.js b/node_modules/supports-hyperlinks/node_modules/supports-color/browser.js deleted file mode 100644 index 62afa3a74..000000000 --- a/node_modules/supports-hyperlinks/node_modules/supports-color/browser.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; -module.exports = { - stdout: false, - stderr: false -}; diff --git a/node_modules/supports-hyperlinks/node_modules/supports-color/index.js b/node_modules/supports-hyperlinks/node_modules/supports-color/index.js deleted file mode 100644 index 6fada390f..000000000 --- a/node_modules/supports-hyperlinks/node_modules/supports-color/index.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict'; -const os = require('os'); -const tty = require('tty'); -const hasFlag = require('has-flag'); - -const {env} = process; - -let forceColor; -if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false') || - hasFlag('color=never')) { - forceColor = 0; -} else if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - forceColor = 1; -} - -if ('FORCE_COLOR' in env) { - if (env.FORCE_COLOR === 'true') { - forceColor = 1; - } else if (env.FORCE_COLOR === 'false') { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } -} - -function translateLevel(level) { - if (level === 0) { - return false; - } - - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} - -function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - - if (hasFlag('color=16m') || - hasFlag('color=full') || - hasFlag('color=truecolor')) { - return 3; - } - - if (hasFlag('color=256')) { - return 2; - } - - if (haveStream && !streamIsTTY && forceColor === undefined) { - return 0; - } - - const min = forceColor || 0; - - if (env.TERM === 'dumb') { - return min; - } - - if (process.platform === 'win32') { - // Windows 10 build 10586 is the first Windows release that supports 256 colors. - // Windows 10 build 14931 is the first release that supports 16m/TrueColor. - const osRelease = os.release().split('.'); - if ( - Number(osRelease[0]) >= 10 && - Number(osRelease[2]) >= 10586 - ) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - - return 1; - } - - if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { - return 1; - } - - return min; - } - - if ('TEAMCITY_VERSION' in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - - if (env.COLORTERM === 'truecolor') { - return 3; - } - - if ('TERM_PROGRAM' in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); - - switch (env.TERM_PROGRAM) { - case 'iTerm.app': - return version >= 3 ? 3 : 2; - case 'Apple_Terminal': - return 2; - // No default - } - } - - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - - if ('COLORTERM' in env) { - return 1; - } - - return min; -} - -function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); -} - -module.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) -}; diff --git a/node_modules/supports-hyperlinks/node_modules/supports-color/license b/node_modules/supports-hyperlinks/node_modules/supports-color/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/supports-hyperlinks/node_modules/supports-color/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/supports-hyperlinks/node_modules/supports-color/package.json b/node_modules/supports-hyperlinks/node_modules/supports-color/package.json deleted file mode 100644 index f7182edce..000000000 --- a/node_modules/supports-hyperlinks/node_modules/supports-color/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "supports-color", - "version": "7.2.0", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": "chalk/supports-color", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js", - "browser.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect", - "truecolor", - "16m" - ], - "dependencies": { - "has-flag": "^4.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "import-fresh": "^3.0.0", - "xo": "^0.24.0" - }, - "browser": "browser.js" -} diff --git a/node_modules/supports-hyperlinks/node_modules/supports-color/readme.md b/node_modules/supports-hyperlinks/node_modules/supports-color/readme.md deleted file mode 100644 index 365422858..000000000 --- a/node_modules/supports-hyperlinks/node_modules/supports-color/readme.md +++ /dev/null @@ -1,76 +0,0 @@ -# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) - -> Detect whether a terminal supports color - - -## Install - -``` -$ npm install supports-color -``` - - -## Usage - -```js -const supportsColor = require('supports-color'); - -if (supportsColor.stdout) { - console.log('Terminal stdout supports color'); -} - -if (supportsColor.stdout.has256) { - console.log('Terminal stdout supports 256 colors'); -} - -if (supportsColor.stderr.has16m) { - console.log('Terminal stderr supports 16 million colors (truecolor)'); -} -``` - - -## API - -Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. - -The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: - -- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) -- `.level = 2` and `.has256 = true`: 256 color support -- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) - - -## Info - -It obeys the `--color` and `--no-color` CLI flags. - -For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. - -Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. - - -## Related - -- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- diff --git a/node_modules/supports-hyperlinks/package.json b/node_modules/supports-hyperlinks/package.json deleted file mode 100644 index 1108eac1d..000000000 --- a/node_modules/supports-hyperlinks/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "supports-hyperlinks", - "version": "3.0.0", - "description": "Detect if your terminal emulator supports hyperlinks", - "license": "MIT", - "repository": "jamestalmage/supports-hyperlinks", - "author": { - "name": "James Talmage", - "email": "james@talmage.io", - "url": "github.com/jamestalmage" - }, - "engines": { - "node": ">=14.18" - }, - "scripts": { - "prepublishOnly": "npm run create-types", - "test": "xo && nyc ava && tsc", - "create-types": "tsc --project declaration.tsconfig.json" - }, - "files": [ - "index.js", - "index.d.ts", - "browser.js" - ], - "browser": "browser.js", - "keywords": [ - "link", - "terminal", - "hyperlink", - "cli" - ], - "dependencies": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "devDependencies": { - "@tsconfig/node14": "^1.0.3", - "@types/supports-color": "^8.1.1", - "ava": "^2.2.0", - "codecov": "^3.5.0", - "nyc": "^14.1.1", - "typescript": "^4.9.5", - "xo": "^0.24.0" - }, - "nyc": { - "reporter": [ - "lcov", - "text" - ] - } -} diff --git a/node_modules/supports-hyperlinks/readme.md b/node_modules/supports-hyperlinks/readme.md deleted file mode 100644 index ec833ac5a..000000000 --- a/node_modules/supports-hyperlinks/readme.md +++ /dev/null @@ -1,48 +0,0 @@ -# supports-hyperlinks [![Build Status](https://travis-ci.org/jamestalmage/supports-hyperlinks.svg?branch=master)](https://travis-ci.org/jamestalmage/supports-hyperlinks) [![codecov](https://codecov.io/gh/jamestalmage/supports-hyperlinks/badge.svg?branch=master)](https://codecov.io/gh/jamestalmage/supports-hyperlinks?branch=master) - -> Detect whether a terminal emulator supports hyperlinks - -Terminal emulators are [starting to support hyperlinks](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda). While many terminals have long detected URL's and linkified them, allowing you to Command-Click or Control-Click them to open a browser, you were forced to print the long unsightly URL's on the screen. As of spring 2017 [a few terminals](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) began supporting HTML like links, where the link text and destination could be specified separately. - -This module allows you to detect if hyperlinks are supported in the current Terminal. - -As this is a new development, we anticipate the list of supported Terminals to grow rapidly. Please open an issue or submit a PR as new Terminals implement support. - -## Install - -``` -$ npm install supports-hyperlinks -``` - - -## Usage - -```js -const supportsHyperlinks = require('supports-hyperlinks'); - -if (supportsHyperlinks.stdout) { - console.log('Terminal stdout supports hyperlinks'); -} - -if (supportsHyperlinks.stderr) { - console.log('Terminal stderr supports hyperlinks'); -} -``` - -## API - -Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is a `boolean`, indicating whether or not hyperlinks are supported. - -## Info - -Obeys the `--no-hyperlinks`, `--hyperlink=always`, and `--hyperlink=never` CLI flags. - -Can be overridden by the user with the flags `--hyperlinks=always` and `--no-hyperlinks`. For situations where using those flags are not possible, add the environment variable `FORCE_HYPERLINK=1` to forcefully enable hyperlinks or `FORCE_HYPERLINK=0` to forcefully disable. The use of `FORCE_HYPERLINK` overrides all other hyperlink support checks. - -## Related - - * [`hyperlinker`](https://github.com/jamestalmage/hyperlinker): Write hyperlinks for the Terminal. - -## License - -MIT © [James Talmage](https://github.com/jamestalmage) diff --git a/node_modules/svg-tags/LICENSE b/node_modules/svg-tags/LICENSE deleted file mode 100644 index 2fe39398b..000000000 --- a/node_modules/svg-tags/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Athan Reines. - -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. \ No newline at end of file diff --git a/node_modules/svg-tags/README.md b/node_modules/svg-tags/README.md deleted file mode 100644 index 9e3429d2a..000000000 --- a/node_modules/svg-tags/README.md +++ /dev/null @@ -1,99 +0,0 @@ -SVG Tags -======== -[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url] - -> List of standard SVG tags. - -List built from the [SVG 1.1 specification](http://www.w3.org/TR/SVG/eltindex.html). - - -## Installation - -``` bash -$ npm install svg-tags --save -``` - - -## Usage - -The module is simply a JSON array, so use as you would a normal JavaScript array. - -``` javascript -var tags = require( 'svg-tags' ); - -console.log( JSON.stringify( tags ) ); -/** -* Returns: -* [ 'a', 'altGlyph', ... ] -*/ - -console.log( tags.indexOf( 'desc' ) ); -// Returns [index] -``` - -## Examples - -To run the example code from the top-level application directory, - -``` bash -$ node ./examples/index.js -``` - - -## Tests - -### Unit - -Unit tests use the [Mocha](http://visionmedia.github.io/mocha) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory: - -``` bash -$ make test -``` - -All new feature development should have corresponding unit tests to validate correct functionality. - - -### Test Coverage - -This repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory: - -``` bash -$ make test-cov -``` - -Istanbul creates a `./reports/coverage` directory. To access an HTML version of the report, - -``` bash -$ open reports/coverage/lcov-report/index.html -``` - - -## License - -[MIT license](http://opensource.org/licenses/MIT). - - ---- -## Copyright - -Copyright © 2014. Athan Reines. - - - -[npm-image]: http://img.shields.io/npm/v/svg-tags.svg -[npm-url]: https://npmjs.org/package/svg-tags - -[travis-image]: http://img.shields.io/travis/element-io/svg-tags/master.svg -[travis-url]: https://travis-ci.org/element-io/svg-tags - -[coveralls-image]: https://img.shields.io/coveralls/element-io/svg-tags/master.svg -[coveralls-url]: https://coveralls.io/r/element-io/svg-tags?branch=master - -[dependencies-image]: http://img.shields.io/david/element-io/svg-tags.svg -[dependencies-url]: https://david-dm.org/element-io/svg-tags - -[dev-dependencies-image]: http://img.shields.io/david/dev/element-io/svg-tags.svg -[dev-dependencies-url]: https://david-dm.org/dev/element-io/svg-tags - -[github-issues-image]: http://img.shields.io/github/issues/element-io/svg-tags.svg -[github-issues-url]: https://github.com/element-io/svg-tags/issues \ No newline at end of file diff --git a/node_modules/svg-tags/lib/index.js b/node_modules/svg-tags/lib/index.js deleted file mode 100644 index a7e9270ce..000000000 --- a/node_modules/svg-tags/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require( './svg-tags.json' ); \ No newline at end of file diff --git a/node_modules/svg-tags/lib/svg-tags.json b/node_modules/svg-tags/lib/svg-tags.json deleted file mode 100644 index d9eea5de0..000000000 --- a/node_modules/svg-tags/lib/svg-tags.json +++ /dev/null @@ -1,82 +0,0 @@ -[ - "a", - "altGlyph", - "altGlyphDef", - "altGlyphItem", - "animate", - "animateColor", - "animateMotion", - "animateTransform", - "circle", - "clipPath", - "color-profile", - "cursor", - "defs", - "desc", - "ellipse", - "feBlend", - "feColorMatrix", - "feComponentTransfer", - "feComposite", - "feConvolveMatrix", - "feDiffuseLighting", - "feDisplacementMap", - "feDistantLight", - "feFlood", - "feFuncA", - "feFuncB", - "feFuncG", - "feFuncR", - "feGaussianBlur", - "feImage", - "feMerge", - "feMergeNode", - "feMorphology", - "feOffset", - "fePointLight", - "feSpecularLighting", - "feSpotLight", - "feTile", - "feTurbulence", - "filter", - "font", - "font-face", - "font-face-format", - "font-face-name", - "font-face-src", - "font-face-uri", - "foreignObject", - "g", - "glyph", - "glyphRef", - "hkern", - "image", - "line", - "linearGradient", - "marker", - "mask", - "metadata", - "missing-glyph", - "mpath", - "path", - "pattern", - "polygon", - "polyline", - "radialGradient", - "rect", - "script", - "set", - "stop", - "style", - "svg", - "switch", - "symbol", - "text", - "textPath", - "title", - "tref", - "tspan", - "use", - "view", - "vkern" -] \ No newline at end of file diff --git a/node_modules/svg-tags/package.json b/node_modules/svg-tags/package.json deleted file mode 100644 index 604d49a4b..000000000 --- a/node_modules/svg-tags/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "svg-tags", - "version": "1.0.0", - "description": "List of standard SVG tags.", - "author": { - "name": "Athan Reines", - "email": "kgryte@gmail.com" - }, - "contributors": [ - { - "name": "Athan Reines", - "email": "kgryte@gmail.com" - } - ], - "scripts": { - "test": "./node_modules/.bin/mocha", - "test-cov": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coverage -- -R spec", - "coveralls": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --dir ./reports/coveralls/coverage --report lcovonly -- -R spec && cat ./reports/coveralls/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./reports/coveralls" - }, - "main": "./lib", - "repository": { - "type": "git", - "url": "git://github.com/element-io/svg-tags.git" - }, - "keywords": [ - "svg", - "tags", - "w3c" - ], - "bugs": { - "url": "https://github.com/element-io/svg-tags/issues" - }, - "dependencies": {}, - "devDependencies": { - "chai": "1.x.x", - "coveralls": "^2.11.1", - "istanbul": "^0.3.0", - "mocha": "1.x.x" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://www.opensource.org/licenses/MIT" - } - ] -} diff --git a/node_modules/table/LICENSE b/node_modules/table/LICENSE deleted file mode 100644 index 6c41d45cd..000000000 --- a/node_modules/table/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2018, Gajus Kuizinas (http://gajus.com/) -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Gajus Kuizinas (http://gajus.com/) nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL ANUARY BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/table/README.md b/node_modules/table/README.md deleted file mode 100644 index a0f514746..000000000 --- a/node_modules/table/README.md +++ /dev/null @@ -1,837 +0,0 @@ - -# Table - -> Produces a string that represents array data in a text table. - -[![Github action status](https://github.com/gajus/table/actions/workflows/main.yml/badge.svg)](https://github.com/gajus/table/actions) -[![Coveralls](https://img.shields.io/coveralls/gajus/table.svg?style=flat-square)](https://coveralls.io/github/gajus/table) -[![NPM version](http://img.shields.io/npm/v/table.svg?style=flat-square)](https://www.npmjs.org/package/table) -[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical) -[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social&label=Follow)](https://twitter.com/kuizinas) - -* [Table](#table) - * [Features](#table-features) - * [Install](#table-install) - * [Usage](#table-usage) - * [API](#table-api) - * [table](#table-api-table-1) - * [createStream](#table-api-createstream) - * [getBorderCharacters](#table-api-getbordercharacters) - - -![Demo of table displaying a list of missions to the Moon.](./.README/demo.png) - - -## Features - -* Works with strings containing [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) characters. -* Works with strings containing [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code). -* Configurable border characters. -* Configurable content alignment per column. -* Configurable content padding per column. -* Configurable column width. -* Text wrapping. - - -## Install - -```bash -npm install table -``` - -[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/gajus) -[![Become a Patron](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/gajus) - - - -## Usage - -```js -import { table } from 'table'; - -// Using commonjs? -// const { table } = require('table'); - -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -console.log(table(data)); -``` - -``` -╔════╤════╤════╗ -║ 0A │ 0B │ 0C ║ -╟────┼────┼────╢ -║ 1A │ 1B │ 1C ║ -╟────┼────┼────╢ -║ 2A │ 2B │ 2C ║ -╚════╧════╧════╝ - -``` - - - -## API - - -### table - -Returns the string in the table format - -**Parameters:** -- **_data_:** The data to display - - Type: `any[][]` - - Required: `true` - -- **_config_:** Table configuration - - Type: `object` - - Required: `false` - - -##### config.border - -Type: `{ [type: string]: string }`\ -Default: `honeywell` [template](#getbordercharacters) - -Custom borders. The keys are any of: -- `topLeft`, `topRight`, `topBody`,`topJoin` -- `bottomLeft`, `bottomRight`, `bottomBody`, `bottomJoin` -- `joinLeft`, `joinRight`, `joinBody`, `joinJoin` -- `bodyLeft`, `bodyRight`, `bodyJoin` -- `headerJoin` - -```js -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -const config = { - border: { - topBody: `─`, - topJoin: `┬`, - topLeft: `┌`, - topRight: `┐`, - - bottomBody: `─`, - bottomJoin: `┴`, - bottomLeft: `└`, - bottomRight: `┘`, - - bodyLeft: `│`, - bodyRight: `│`, - bodyJoin: `│`, - - joinBody: `─`, - joinLeft: `├`, - joinRight: `┤`, - joinJoin: `┼` - } -}; - -console.log(table(data, config)); -``` - -``` -┌────┬────┬────┐ -│ 0A │ 0B │ 0C │ -├────┼────┼────┤ -│ 1A │ 1B │ 1C │ -├────┼────┼────┤ -│ 2A │ 2B │ 2C │ -└────┴────┴────┘ -``` - - -##### config.drawVerticalLine - -Type: `(lineIndex: number, columnCount: number) => boolean`\ -Default: `() => true` - -It is used to tell whether to draw a vertical line. This callback is called for each vertical border of the table. -If the table has `n` columns, then the `index` parameter is alternatively received all numbers in range `[0, n]` inclusively. - -```js -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'], - ['3A', '3B', '3C'], - ['4A', '4B', '4C'] -]; - -const config = { - drawVerticalLine: (lineIndex, columnCount) => { - return lineIndex === 0 || lineIndex === columnCount; - } -}; - -console.log(table(data, config)); - -``` - -``` -╔════════════╗ -║ 0A 0B 0C ║ -╟────────────╢ -║ 1A 1B 1C ║ -╟────────────╢ -║ 2A 2B 2C ║ -╟────────────╢ -║ 3A 3B 3C ║ -╟────────────╢ -║ 4A 4B 4C ║ -╚════════════╝ - -``` - - -##### config.drawHorizontalLine - -Type: `(lineIndex: number, rowCount: number) => boolean`\ -Default: `() => true` - -It is used to tell whether to draw a horizontal line. This callback is called for each horizontal border of the table. -If the table has `n` rows, then the `index` parameter is alternatively received all numbers in range `[0, n]` inclusively. -If the table has `n` rows and contains the header, then the range will be `[0, n+1]` inclusively. - -```js -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'], - ['3A', '3B', '3C'], - ['4A', '4B', '4C'] -]; - -const config = { - drawHorizontalLine: (lineIndex, rowCount) => { - return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount - 1 || lineIndex === rowCount; - } -}; - -console.log(table(data, config)); - -``` - -``` -╔════╤════╤════╗ -║ 0A │ 0B │ 0C ║ -╟────┼────┼────╢ -║ 1A │ 1B │ 1C ║ -║ 2A │ 2B │ 2C ║ -║ 3A │ 3B │ 3C ║ -╟────┼────┼────╢ -║ 4A │ 4B │ 4C ║ -╚════╧════╧════╝ - -``` - - -##### config.singleLine - -Type: `boolean`\ -Default: `false` - -If `true`, horizontal lines inside the table are not drawn. This option also overrides the `config.drawHorizontalLine` if specified. - -```js -const data = [ - ['-rw-r--r--', '1', 'pandorym', 'staff', '1529', 'May 23 11:25', 'LICENSE'], - ['-rw-r--r--', '1', 'pandorym', 'staff', '16327', 'May 23 11:58', 'README.md'], - ['drwxr-xr-x', '76', 'pandorym', 'staff', '2432', 'May 23 12:02', 'dist'], - ['drwxr-xr-x', '634', 'pandorym', 'staff', '20288', 'May 23 11:54', 'node_modules'], - ['-rw-r--r--', '1,', 'pandorym', 'staff', '525688', 'May 23 11:52', 'package-lock.json'], - ['-rw-r--r--@', '1', 'pandorym', 'staff', '2440', 'May 23 11:25', 'package.json'], - ['drwxr-xr-x', '27', 'pandorym', 'staff', '864', 'May 23 11:25', 'src'], - ['drwxr-xr-x', '20', 'pandorym', 'staff', '640', 'May 23 11:25', 'test'], -]; - -const config = { - singleLine: true -}; - -console.log(table(data, config)); -``` - -``` -╔═════════════╤═════╤══════════╤═══════╤════════╤══════════════╤═══════════════════╗ -║ -rw-r--r-- │ 1 │ pandorym │ staff │ 1529 │ May 23 11:25 │ LICENSE ║ -║ -rw-r--r-- │ 1 │ pandorym │ staff │ 16327 │ May 23 11:58 │ README.md ║ -║ drwxr-xr-x │ 76 │ pandorym │ staff │ 2432 │ May 23 12:02 │ dist ║ -║ drwxr-xr-x │ 634 │ pandorym │ staff │ 20288 │ May 23 11:54 │ node_modules ║ -║ -rw-r--r-- │ 1, │ pandorym │ staff │ 525688 │ May 23 11:52 │ package-lock.json ║ -║ -rw-r--r--@ │ 1 │ pandorym │ staff │ 2440 │ May 23 11:25 │ package.json ║ -║ drwxr-xr-x │ 27 │ pandorym │ staff │ 864 │ May 23 11:25 │ src ║ -║ drwxr-xr-x │ 20 │ pandorym │ staff │ 640 │ May 23 11:25 │ test ║ -╚═════════════╧═════╧══════════╧═══════╧════════╧══════════════╧═══════════════════╝ -``` - - - -##### config.columns - -Type: `Column[] | { [columnIndex: number]: Column }` - -Column specific configurations. - - -###### config.columns[*].width - -Type: `number`\ -Default: the maximum cell widths of the column - -Column width (excluding the paddings). - -```js - -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -const config = { - columns: { - 1: { width: 10 } - } -}; - -console.log(table(data, config)); -``` - -``` -╔════╤════════════╤════╗ -║ 0A │ 0B │ 0C ║ -╟────┼────────────┼────╢ -║ 1A │ 1B │ 1C ║ -╟────┼────────────┼────╢ -║ 2A │ 2B │ 2C ║ -╚════╧════════════╧════╝ -``` - - -###### config.columns[*].alignment - -Type: `'center' | 'justify' | 'left' | 'right'`\ -Default: `'left'` - -Cell content horizontal alignment - -```js -const data = [ - ['0A', '0B', '0C', '0D 0E 0F'], - ['1A', '1B', '1C', '1D 1E 1F'], - ['2A', '2B', '2C', '2D 2E 2F'], -]; - -const config = { - columnDefault: { - width: 10, - }, - columns: [ - { alignment: 'left' }, - { alignment: 'center' }, - { alignment: 'right' }, - { alignment: 'justify' } - ], -}; - -console.log(table(data, config)); -``` - -``` -╔════════════╤════════════╤════════════╤════════════╗ -║ 0A │ 0B │ 0C │ 0D 0E 0F ║ -╟────────────┼────────────┼────────────┼────────────╢ -║ 1A │ 1B │ 1C │ 1D 1E 1F ║ -╟────────────┼────────────┼────────────┼────────────╢ -║ 2A │ 2B │ 2C │ 2D 2E 2F ║ -╚════════════╧════════════╧════════════╧════════════╝ -``` - - -###### config.columns[*].verticalAlignment - -Type: `'top' | 'middle' | 'bottom'`\ -Default: `'top'` - -Cell content vertical alignment - -```js -const data = [ - ['A', 'B', 'C', 'DEF'], -]; - -const config = { - columnDefault: { - width: 1, - }, - columns: [ - { verticalAlignment: 'top' }, - { verticalAlignment: 'middle' }, - { verticalAlignment: 'bottom' }, - ], -}; - -console.log(table(data, config)); -``` - -``` -╔═══╤═══╤═══╤═══╗ -║ A │ │ │ D ║ -║ │ B │ │ E ║ -║ │ │ C │ F ║ -╚═══╧═══╧═══╧═══╝ -``` - - -###### config.columns[*].paddingLeft - -Type: `number`\ -Default: `1` - -The number of whitespaces used to pad the content on the left. - - -###### config.columns[*].paddingRight - -Type: `number`\ -Default: `1` - -The number of whitespaces used to pad the content on the right. - -The `paddingLeft` and `paddingRight` options do not count on the column width. So the column has `width = 5`, `paddingLeft = 2` and `paddingRight = 2` will have the total width is `9`. - - -```js -const data = [ - ['0A', 'AABBCC', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -const config = { - columns: [ - { - paddingLeft: 3 - }, - { - width: 2, - paddingRight: 3 - } - ] -}; - -console.log(table(data, config)); -``` - -``` -╔══════╤══════╤════╗ -║ 0A │ AA │ 0C ║ -║ │ BB │ ║ -║ │ CC │ ║ -╟──────┼──────┼────╢ -║ 1A │ 1B │ 1C ║ -╟──────┼──────┼────╢ -║ 2A │ 2B │ 2C ║ -╚══════╧══════╧════╝ -``` - - -###### config.columns[*].truncate - -Type: `number`\ -Default: `Infinity` - -The number of characters is which the content will be truncated. -To handle a content that overflows the container width, `table` package implements [text wrapping](#config.columns[*].wrapWord). However, sometimes you may want to truncate content that is too long to be displayed in the table. - -```js -const data = [ - ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] -]; - -const config = { - columns: [ - { - width: 20, - truncate: 100 - } - ] -}; - -console.log(table(data, config)); -``` - -``` -╔══════════════════════╗ -║ Lorem ipsum dolor si ║ -║ t amet, consectetur ║ -║ adipiscing elit. Pha ║ -║ sellus pulvinar nibh ║ -║ sed mauris convall… ║ -╚══════════════════════╝ -``` - - -###### config.columns[*].wrapWord - -Type: `boolean`\ -Default: `false` - -The `table` package implements auto text wrapping, i.e., text that has the width greater than the container width will be separated into multiple lines at the nearest space or one of the special characters: `\|/_.,;-`. - -When `wrapWord` is `false`: - -```js -const data = [ - ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] -]; - -const config = { - columns: [ { width: 20 } ] -}; - -console.log(table(data, config)); -``` - -``` -╔══════════════════════╗ -║ Lorem ipsum dolor si ║ -║ t amet, consectetur ║ -║ adipiscing elit. Pha ║ -║ sellus pulvinar nibh ║ -║ sed mauris convallis ║ -║ dapibus. Nunc venena ║ -║ tis tempus nulla sit ║ -║ amet viverra. ║ -╚══════════════════════╝ -``` - -When `wrapWord` is `true`: - -``` -╔══════════════════════╗ -║ Lorem ipsum dolor ║ -║ sit amet, ║ -║ consectetur ║ -║ adipiscing elit. ║ -║ Phasellus pulvinar ║ -║ nibh sed mauris ║ -║ convallis dapibus. ║ -║ Nunc venenatis ║ -║ tempus nulla sit ║ -║ amet viverra. ║ -╚══════════════════════╝ - -``` - - - -##### config.columnDefault - -Type: `Column`\ -Default: `{}` - -The default configuration for all columns. Column-specific settings will overwrite the default values. - - - -##### config.header - -Type: `object` - -Header configuration. - -*Deprecated in favor of the new spanning cells API.* - -The header configuration inherits the most of the column's, except: -- `content` **{string}**: the header content. -- `width:` calculate based on the content width automatically. -- `alignment:` `center` be default. -- `verticalAlignment:` is not supported. -- `config.border.topJoin` will be `config.border.topBody` for prettier. - -```js -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'], - ]; - -const config = { - columnDefault: { - width: 10, - }, - header: { - alignment: 'center', - content: 'THE HEADER\nThis is the table about something', - }, -} - -console.log(table(data, config)); -``` - -``` -╔══════════════════════════════════════╗ -║ THE HEADER ║ -║ This is the table about something ║ -╟────────────┬────────────┬────────────╢ -║ 0A │ 0B │ 0C ║ -╟────────────┼────────────┼────────────╢ -║ 1A │ 1B │ 1C ║ -╟────────────┼────────────┼────────────╢ -║ 2A │ 2B │ 2C ║ -╚════════════╧════════════╧════════════╝ -``` - - - -##### config.spanningCells - -Type: `SpanningCellConfig[]` - -Spanning cells configuration. - -The configuration should be straightforward: just specify an array of minimal cell configurations including the position of top-left cell -and the number of columns and/or rows will be expanded from it. - -The content of overlap cells will be ignored to make the `data` shape be consistent. - -By default, the configuration of column that the top-left cell belongs to will be applied to the whole spanning cell, except: -* The `width` will be summed up of all spanning columns. -* The `paddingRight` will be received from the right-most column intentionally. - -Advances customized column-like styles can be configurable to each spanning cell to overwrite the default behavior. - -```js -const data = [ - ['Test Coverage Report', '', '', '', '', ''], - ['Module', 'Component', 'Test Cases', 'Failures', 'Durations', 'Success Rate'], - ['Services', 'User', '50', '30', '3m 7s', '60.0%'], - ['', 'Payment', '100', '80', '7m 15s', '80.0%'], - ['Subtotal', '', '150', '110', '10m 22s', '73.3%'], - ['Controllers', 'User', '24', '18', '1m 30s', '75.0%'], - ['', 'Payment', '30', '24', '50s', '80.0%'], - ['Subtotal', '', '54', '42', '2m 20s', '77.8%'], - ['Total', '', '204', '152', '12m 42s', '74.5%'], -]; - -const config = { - columns: [ - { alignment: 'center', width: 12 }, - { alignment: 'center', width: 10 }, - { alignment: 'right' }, - { alignment: 'right' }, - { alignment: 'right' }, - { alignment: 'right' } - ], - spanningCells: [ - { col: 0, row: 0, colSpan: 6 }, - { col: 0, row: 2, rowSpan: 2, verticalAlignment: 'middle'}, - { col: 0, row: 4, colSpan: 2, alignment: 'right'}, - { col: 0, row: 5, rowSpan: 2, verticalAlignment: 'middle'}, - { col: 0, row: 7, colSpan: 2, alignment: 'right' }, - { col: 0, row: 8, colSpan: 2, alignment: 'right' } - ], -}; - -console.log(table(data, config)); -``` - -``` -╔══════════════════════════════════════════════════════════════════════════════╗ -║ Test Coverage Report ║ -╟──────────────┬────────────┬────────────┬──────────┬───────────┬──────────────╢ -║ Module │ Component │ Test Cases │ Failures │ Durations │ Success Rate ║ -╟──────────────┼────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ │ User │ 50 │ 30 │ 3m 7s │ 60.0% ║ -║ Services ├────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ │ Payment │ 100 │ 80 │ 7m 15s │ 80.0% ║ -╟──────────────┴────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ Subtotal │ 150 │ 110 │ 10m 22s │ 73.3% ║ -╟──────────────┬────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ │ User │ 24 │ 18 │ 1m 30s │ 75.0% ║ -║ Controllers ├────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ │ Payment │ 30 │ 24 │ 50s │ 80.0% ║ -╟──────────────┴────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ Subtotal │ 54 │ 42 │ 2m 20s │ 77.8% ║ -╟───────────────────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ Total │ 204 │ 152 │ 12m 42s │ 74.5% ║ -╚═══════════════════════════╧════════════╧══════════╧═══════════╧══════════════╝ -``` - - - -### createStream - -`table` package exports `createStream` function used to draw a table and append rows. - -**Parameter:** - - _**config:**_ the same as `table`'s, except `config.columnDefault.width` and `config.columnCount` must be provided. - - -```js -import { createStream } from 'table'; - -const config = { - columnDefault: { - width: 50 - }, - columnCount: 1 -}; - -const stream = createStream(config); - -setInterval(() => { - stream.write([new Date()]); -}, 500); -``` - -![Streaming current date.](./.README/api/stream/streaming.gif) - -`table` package uses ANSI escape codes to overwrite the output of the last line when a new row is printed. - -The underlying implementation is explained in this [Stack Overflow answer](http://stackoverflow.com/a/32938658/368691). - -Streaming supports all of the configuration properties and functionality of a static table (such as auto text wrapping, alignment and padding), e.g. - -```js -import { createStream } from 'table'; - -import _ from 'lodash'; - -const config = { - columnDefault: { - width: 50 - }, - columnCount: 3, - columns: [ - { - width: 10, - alignment: 'right' - }, - { alignment: 'center' }, - { width: 10 } - - ] -}; - -const stream = createStream(config); - -let i = 0; - -setInterval(() => { - let random; - - random = _.sample('abcdefghijklmnopqrstuvwxyz', _.random(1, 30)).join(''); - - stream.write([i++, new Date(), random]); -}, 500); -``` - -![Streaming random data.](./.README/api/stream/streaming-random.gif) - - - -### getBorderCharacters - -**Parameter:** - - **_template_** - - Type: `'honeywell' | 'norc' | 'ramac' | 'void'` - - Required: `true` - -You can load one of the predefined border templates using `getBorderCharacters` function. - -```js -import { table, getBorderCharacters } from 'table'; - -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -const config = { - border: getBorderCharacters(`name of the template`) -}; - -console.log(table(data, config)); -``` - -``` -# honeywell - -╔════╤════╤════╗ -║ 0A │ 0B │ 0C ║ -╟────┼────┼────╢ -║ 1A │ 1B │ 1C ║ -╟────┼────┼────╢ -║ 2A │ 2B │ 2C ║ -╚════╧════╧════╝ - -# norc - -┌────┬────┬────┐ -│ 0A │ 0B │ 0C │ -├────┼────┼────┤ -│ 1A │ 1B │ 1C │ -├────┼────┼────┤ -│ 2A │ 2B │ 2C │ -└────┴────┴────┘ - -# ramac (ASCII; for use in terminals that do not support Unicode characters) - -+----+----+----+ -| 0A | 0B | 0C | -|----|----|----| -| 1A | 1B | 1C | -|----|----|----| -| 2A | 2B | 2C | -+----+----+----+ - -# void (no borders; see "borderless table" section of the documentation) - - 0A 0B 0C - - 1A 1B 1C - - 2A 2B 2C - -``` - -Raise [an issue](https://github.com/gajus/table/issues) if you'd like to contribute a new border template. - - -#### Borderless Table - -Simply using `void` border character template creates a table with a lot of unnecessary spacing. - -To create a more pleasant to the eye table, reset the padding and remove the joining rows, e.g. - -```js - -const output = table(data, { - border: getBorderCharacters('void'), - columnDefault: { - paddingLeft: 0, - paddingRight: 1 - }, - drawHorizontalLine: () => false - } -); - -console.log(output); -``` - -``` -0A 0B 0C -1A 1B 1C -2A 2B 2C -``` - diff --git a/node_modules/table/dist/src/alignSpanningCell.d.ts b/node_modules/table/dist/src/alignSpanningCell.d.ts deleted file mode 100644 index a1b6e29d9..000000000 --- a/node_modules/table/dist/src/alignSpanningCell.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SpanningCellContext } from './spanningCellManager'; -import type { RangeConfig } from './types/internal'; -/** - * Fill content into all cells in range in order to calculate total height - */ -export declare const wrapRangeContent: (rangeConfig: RangeConfig, rangeWidth: number, context: SpanningCellContext) => string[]; -export declare const alignVerticalRangeContent: (range: RangeConfig, content: string[], context: SpanningCellContext) => string[]; diff --git a/node_modules/table/dist/src/alignSpanningCell.js b/node_modules/table/dist/src/alignSpanningCell.js deleted file mode 100644 index de2ec7780..000000000 --- a/node_modules/table/dist/src/alignSpanningCell.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.alignVerticalRangeContent = exports.wrapRangeContent = void 0; -const string_width_1 = __importDefault(require("string-width")); -const alignString_1 = require("./alignString"); -const mapDataUsingRowHeights_1 = require("./mapDataUsingRowHeights"); -const padTableData_1 = require("./padTableData"); -const truncateTableData_1 = require("./truncateTableData"); -const utils_1 = require("./utils"); -const wrapCell_1 = require("./wrapCell"); -/** - * Fill content into all cells in range in order to calculate total height - */ -const wrapRangeContent = (rangeConfig, rangeWidth, context) => { - const { topLeft, paddingRight, paddingLeft, truncate, wrapWord, alignment } = rangeConfig; - const originalContent = context.rows[topLeft.row][topLeft.col]; - const contentWidth = rangeWidth - paddingLeft - paddingRight; - return (0, wrapCell_1.wrapCell)((0, truncateTableData_1.truncateString)(originalContent, truncate), contentWidth, wrapWord).map((line) => { - const alignedLine = (0, alignString_1.alignString)(line, contentWidth, alignment); - return (0, padTableData_1.padString)(alignedLine, paddingLeft, paddingRight); - }); -}; -exports.wrapRangeContent = wrapRangeContent; -const alignVerticalRangeContent = (range, content, context) => { - const { rows, drawHorizontalLine, rowHeights } = context; - const { topLeft, bottomRight, verticalAlignment } = range; - // They are empty before calculateRowHeights function run - if (rowHeights.length === 0) { - return []; - } - const totalCellHeight = (0, utils_1.sumArray)(rowHeights.slice(topLeft.row, bottomRight.row + 1)); - const totalBorderHeight = bottomRight.row - topLeft.row; - const hiddenHorizontalBorderCount = (0, utils_1.sequence)(topLeft.row + 1, bottomRight.row).filter((horizontalBorderIndex) => { - return !drawHorizontalLine(horizontalBorderIndex, rows.length); - }).length; - const availableRangeHeight = totalCellHeight + totalBorderHeight - hiddenHorizontalBorderCount; - return (0, mapDataUsingRowHeights_1.padCellVertically)(content, availableRangeHeight, verticalAlignment).map((line) => { - if (line.length === 0) { - return ' '.repeat((0, string_width_1.default)(content[0])); - } - return line; - }); -}; -exports.alignVerticalRangeContent = alignVerticalRangeContent; -//# sourceMappingURL=alignSpanningCell.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/alignSpanningCell.js.map b/node_modules/table/dist/src/alignSpanningCell.js.map deleted file mode 100644 index 9d44671d0..000000000 --- a/node_modules/table/dist/src/alignSpanningCell.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"alignSpanningCell.js","sourceRoot":"","sources":["../../src/alignSpanningCell.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AACvC,+CAEuB;AACvB,qEAEkC;AAClC,iDAEwB;AAIxB,2DAE6B;AAI7B,mCAEiB;AACjB,yCAEoB;AAEpB;;GAEG;AACI,MAAM,gBAAgB,GAAG,CAAC,WAAwB,EAAE,UAAkB,EAAE,OAA4B,EAAY,EAAE;IACvH,MAAM,EAAC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAC,GAAG,WAAW,CAAC;IAExF,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/D,MAAM,YAAY,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC;IAE7D,OAAO,IAAA,mBAAQ,EAAC,IAAA,kCAAc,EAAC,eAAe,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC9F,MAAM,WAAW,GAAG,IAAA,yBAAW,EAAC,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,GAAG,CAAC,MAAM,CAAC,IAAA,sBAAW,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5C;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAxBW,QAAA,yBAAyB,6BAwBpC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/alignString.d.ts b/node_modules/table/dist/src/alignString.d.ts deleted file mode 100644 index 459fa7ea9..000000000 --- a/node_modules/table/dist/src/alignString.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Alignment } from './types/api'; -/** - * Pads a string to the left and/or right to position the subject - * text in a desired alignment within a container. - */ -export declare const alignString: (subject: string, containerWidth: number, alignment: Alignment) => string; diff --git a/node_modules/table/dist/src/alignString.js b/node_modules/table/dist/src/alignString.js deleted file mode 100644 index a15231a28..000000000 --- a/node_modules/table/dist/src/alignString.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.alignString = void 0; -const string_width_1 = __importDefault(require("string-width")); -const utils_1 = require("./utils"); -const alignLeft = (subject, width) => { - return subject + ' '.repeat(width); -}; -const alignRight = (subject, width) => { - return ' '.repeat(width) + subject; -}; -const alignCenter = (subject, width) => { - return ' '.repeat(Math.floor(width / 2)) + subject + ' '.repeat(Math.ceil(width / 2)); -}; -const alignJustify = (subject, width) => { - const spaceSequenceCount = (0, utils_1.countSpaceSequence)(subject); - if (spaceSequenceCount === 0) { - return alignLeft(subject, width); - } - const addingSpaces = (0, utils_1.distributeUnevenly)(width, spaceSequenceCount); - if (Math.max(...addingSpaces) > 3) { - return alignLeft(subject, width); - } - let spaceSequenceIndex = 0; - return subject.replace(/\s+/g, (groupSpace) => { - return groupSpace + ' '.repeat(addingSpaces[spaceSequenceIndex++]); - }); -}; -/** - * Pads a string to the left and/or right to position the subject - * text in a desired alignment within a container. - */ -const alignString = (subject, containerWidth, alignment) => { - const subjectWidth = (0, string_width_1.default)(subject); - if (subjectWidth === containerWidth) { - return subject; - } - if (subjectWidth > containerWidth) { - throw new Error('Subject parameter value width cannot be greater than the container width.'); - } - if (subjectWidth === 0) { - return ' '.repeat(containerWidth); - } - const availableWidth = containerWidth - subjectWidth; - if (alignment === 'left') { - return alignLeft(subject, availableWidth); - } - if (alignment === 'right') { - return alignRight(subject, availableWidth); - } - if (alignment === 'justify') { - return alignJustify(subject, availableWidth); - } - return alignCenter(subject, availableWidth); -}; -exports.alignString = alignString; -//# sourceMappingURL=alignString.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/alignString.js.map b/node_modules/table/dist/src/alignString.js.map deleted file mode 100644 index 8324952e3..000000000 --- a/node_modules/table/dist/src/alignString.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"alignString.js","sourceRoot":"","sources":["../../src/alignString.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AAIvC,mCAEiB;AAEjB,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC3D,OAAO,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC5D,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC7D,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,OAA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QACzB,OAAO,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC5C;IAED,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,OAAO,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC9C;IAED,OAAO,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AAC9C,CAAC,CAAC;AA9BW,QAAA,WAAW,eA8BtB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/alignTableData.d.ts b/node_modules/table/dist/src/alignTableData.d.ts deleted file mode 100644 index 73314d83b..000000000 --- a/node_modules/table/dist/src/alignTableData.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { BaseConfig, Row } from './types/internal'; -export declare const alignTableData: (rows: Row[], config: BaseConfig) => Row[]; diff --git a/node_modules/table/dist/src/alignTableData.js b/node_modules/table/dist/src/alignTableData.js deleted file mode 100644 index 942cb3b79..000000000 --- a/node_modules/table/dist/src/alignTableData.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.alignTableData = void 0; -const alignString_1 = require("./alignString"); -const alignTableData = (rows, config) => { - return rows.map((row, rowIndex) => { - return row.map((cell, cellIndex) => { - var _a; - const { width, alignment } = config.columns[cellIndex]; - const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex, - row: rowIndex }, { mapped: true }); - if (containingRange) { - return cell; - } - return (0, alignString_1.alignString)(cell, width, alignment); - }); - }); -}; -exports.alignTableData = alignTableData; -//# sourceMappingURL=alignTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/alignTableData.js.map b/node_modules/table/dist/src/alignTableData.js.map deleted file mode 100644 index c7a9ba3d4..000000000 --- a/node_modules/table/dist/src/alignTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"alignTableData.js","sourceRoot":"","sources":["../../src/alignTableData.ts"],"names":[],"mappings":";;;AAAA,+CAEuB;AAMhB,MAAM,cAAc,GAAG,CAAC,IAAW,EAAE,MAAkB,EAAS,EAAE;IACvE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;QAChC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;;YACjC,MAAM,EAAC,KAAK,EAAE,SAAS,EAAC,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAErD,MAAM,eAAe,GAAG,MAAA,MAAM,CAAC,mBAAmB,0CAAE,kBAAkB,CAAC,EAAC,GAAG,EAAE,SAAS;gBACpF,GAAG,EAAE,QAAQ,EAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;YAClC,IAAI,eAAe,EAAE;gBACnB,OAAO,IAAI,CAAC;aACb;YAED,OAAO,IAAA,yBAAW,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAdW,QAAA,cAAc,kBAczB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateCellHeight.d.ts b/node_modules/table/dist/src/calculateCellHeight.d.ts deleted file mode 100644 index 76fd7f1e7..000000000 --- a/node_modules/table/dist/src/calculateCellHeight.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Calculates height of cell content in regard to its width and word wrapping. - */ -export declare const calculateCellHeight: (value: string, columnWidth: number, useWrapWord?: boolean) => number; diff --git a/node_modules/table/dist/src/calculateCellHeight.js b/node_modules/table/dist/src/calculateCellHeight.js deleted file mode 100644 index 010c41f07..000000000 --- a/node_modules/table/dist/src/calculateCellHeight.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.calculateCellHeight = void 0; -const wrapCell_1 = require("./wrapCell"); -/** - * Calculates height of cell content in regard to its width and word wrapping. - */ -const calculateCellHeight = (value, columnWidth, useWrapWord = false) => { - return (0, wrapCell_1.wrapCell)(value, columnWidth, useWrapWord).length; -}; -exports.calculateCellHeight = calculateCellHeight; -//# sourceMappingURL=calculateCellHeight.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateCellHeight.js.map b/node_modules/table/dist/src/calculateCellHeight.js.map deleted file mode 100644 index 61af12108..000000000 --- a/node_modules/table/dist/src/calculateCellHeight.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calculateCellHeight.js","sourceRoot":"","sources":["../../src/calculateCellHeight.ts"],"names":[],"mappings":";;;AAAA,yCAEoB;AAEpB;;GAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAE,WAAmB,EAAE,WAAW,GAAG,KAAK,EAAU,EAAE;IACrG,OAAO,IAAA,mBAAQ,EAAC,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC;AAC1D,CAAC,CAAC;AAFW,QAAA,mBAAmB,uBAE9B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts b/node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts deleted file mode 100644 index d1de524b6..000000000 --- a/node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SpanningCellConfig } from './types/api'; -import type { Row, Cell } from './types/internal'; -export declare const calculateMaximumCellWidth: (cell: Cell) => number; -/** - * Produces an array of values that describe the largest value length (width) in every column. - */ -export declare const calculateMaximumColumnWidths: (rows: Row[], spanningCellConfigs?: SpanningCellConfig[]) => number[]; diff --git a/node_modules/table/dist/src/calculateMaximumColumnWidths.js b/node_modules/table/dist/src/calculateMaximumColumnWidths.js deleted file mode 100644 index 5b677ed9d..000000000 --- a/node_modules/table/dist/src/calculateMaximumColumnWidths.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.calculateMaximumColumnWidths = exports.calculateMaximumCellWidth = void 0; -const string_width_1 = __importDefault(require("string-width")); -const utils_1 = require("./utils"); -const calculateMaximumCellWidth = (cell) => { - return Math.max(...cell.split('\n').map(string_width_1.default)); -}; -exports.calculateMaximumCellWidth = calculateMaximumCellWidth; -/** - * Produces an array of values that describe the largest value length (width) in every column. - */ -const calculateMaximumColumnWidths = (rows, spanningCellConfigs = []) => { - const columnWidths = new Array(rows[0].length).fill(0); - const rangeCoordinates = spanningCellConfigs.map(utils_1.calculateRangeCoordinate); - const isSpanningCell = (rowIndex, columnIndex) => { - return rangeCoordinates.some((rangeCoordinate) => { - return (0, utils_1.isCellInRange)({ col: columnIndex, - row: rowIndex }, rangeCoordinate); - }); - }; - rows.forEach((row, rowIndex) => { - row.forEach((cell, cellIndex) => { - if (isSpanningCell(rowIndex, cellIndex)) { - return; - } - columnWidths[cellIndex] = Math.max(columnWidths[cellIndex], (0, exports.calculateMaximumCellWidth)(cell)); - }); - }); - return columnWidths; -}; -exports.calculateMaximumColumnWidths = calculateMaximumColumnWidths; -//# sourceMappingURL=calculateMaximumColumnWidths.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateMaximumColumnWidths.js.map b/node_modules/table/dist/src/calculateMaximumColumnWidths.js.map deleted file mode 100644 index 5cb01fc2e..000000000 --- a/node_modules/table/dist/src/calculateMaximumColumnWidths.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calculateMaximumColumnWidths.js","sourceRoot":"","sources":["../../src/calculateMaximumColumnWidths.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AAQvC,mCAEiB;AAEV,MAAM,yBAAyB,GAAG,CAAC,IAAU,EAAU,EAAE;IAC9D,OAAO,IAAI,CAAC,GAAG,CACb,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,sBAAW,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC;AAJW,QAAA,yBAAyB,6BAIpC;AAEF;;GAEG;AACI,MAAM,4BAA4B,GAAG,CAAC,IAAW,EAAE,sBAA4C,EAAE,EAAY,EAAE;IACpH,MAAM,YAAY,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,GAAG,CAAC,gCAAwB,CAAC,CAAC;IAC3E,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,WAAmB,EAAW,EAAE;QACxE,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;YAC/C,OAAO,IAAA,qBAAa,EAAC,EAAC,GAAG,EAAE,WAAW;gBACpC,GAAG,EAAE,QAAQ,EAAC,EAAE,eAAe,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;QAC7B,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;YAC9B,IAAI,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE;gBACvC,OAAO;aACR;YACD,YAAY,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,IAAA,iCAAyB,EAAC,IAAI,CAAC,CAAC,CAAC;QAC/F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AApBW,QAAA,4BAA4B,gCAoBvC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateOutputColumnWidths.d.ts b/node_modules/table/dist/src/calculateOutputColumnWidths.d.ts deleted file mode 100644 index f16bb54ef..000000000 --- a/node_modules/table/dist/src/calculateOutputColumnWidths.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TableConfig } from './types/internal'; -export declare const calculateOutputColumnWidths: (config: TableConfig) => number[]; diff --git a/node_modules/table/dist/src/calculateOutputColumnWidths.js b/node_modules/table/dist/src/calculateOutputColumnWidths.js deleted file mode 100644 index 7a4192973..000000000 --- a/node_modules/table/dist/src/calculateOutputColumnWidths.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.calculateOutputColumnWidths = void 0; -const calculateOutputColumnWidths = (config) => { - return config.columns.map((col) => { - return col.paddingLeft + col.width + col.paddingRight; - }); -}; -exports.calculateOutputColumnWidths = calculateOutputColumnWidths; -//# sourceMappingURL=calculateOutputColumnWidths.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateOutputColumnWidths.js.map b/node_modules/table/dist/src/calculateOutputColumnWidths.js.map deleted file mode 100644 index dafe77481..000000000 --- a/node_modules/table/dist/src/calculateOutputColumnWidths.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calculateOutputColumnWidths.js","sourceRoot":"","sources":["../../src/calculateOutputColumnWidths.ts"],"names":[],"mappings":";;;AAIO,MAAM,2BAA2B,GAAG,CAAC,MAAmB,EAAY,EAAE;IAC3E,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,OAAO,GAAG,CAAC,WAAW,GAAG,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAJW,QAAA,2BAA2B,+BAItC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateRowHeights.d.ts b/node_modules/table/dist/src/calculateRowHeights.d.ts deleted file mode 100644 index 27c9183a6..000000000 --- a/node_modules/table/dist/src/calculateRowHeights.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { BaseConfig, Row } from './types/internal'; -/** - * Produces an array of values that describe the largest value length (height) in every row. - */ -export declare const calculateRowHeights: (rows: Row[], config: BaseConfig) => number[]; diff --git a/node_modules/table/dist/src/calculateRowHeights.js b/node_modules/table/dist/src/calculateRowHeights.js deleted file mode 100644 index 72ec05a48..000000000 --- a/node_modules/table/dist/src/calculateRowHeights.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.calculateRowHeights = void 0; -const calculateCellHeight_1 = require("./calculateCellHeight"); -const utils_1 = require("./utils"); -/** - * Produces an array of values that describe the largest value length (height) in every row. - */ -const calculateRowHeights = (rows, config) => { - const rowHeights = []; - for (const [rowIndex, row] of rows.entries()) { - let rowHeight = 1; - row.forEach((cell, cellIndex) => { - var _a; - const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex, - row: rowIndex }); - if (!containingRange) { - const cellHeight = (0, calculateCellHeight_1.calculateCellHeight)(cell, config.columns[cellIndex].width, config.columns[cellIndex].wrapWord); - rowHeight = Math.max(rowHeight, cellHeight); - return; - } - const { topLeft, bottomRight, height } = containingRange; - // bottom-most cell of a range needs to contain all remain lines of spanning cells - if (rowIndex === bottomRight.row) { - const totalOccupiedSpanningCellHeight = (0, utils_1.sumArray)(rowHeights.slice(topLeft.row)); - const totalHorizontalBorderHeight = bottomRight.row - topLeft.row; - const totalHiddenHorizontalBorderHeight = (0, utils_1.sequence)(topLeft.row + 1, bottomRight.row).filter((horizontalBorderIndex) => { - var _a; - /* istanbul ignore next */ - return !((_a = config.drawHorizontalLine) === null || _a === void 0 ? void 0 : _a.call(config, horizontalBorderIndex, rows.length)); - }).length; - const cellHeight = height - totalOccupiedSpanningCellHeight - totalHorizontalBorderHeight + totalHiddenHorizontalBorderHeight; - rowHeight = Math.max(rowHeight, cellHeight); - } - // otherwise, just depend on other sibling cell heights in the row - }); - rowHeights.push(rowHeight); - } - return rowHeights; -}; -exports.calculateRowHeights = calculateRowHeights; -//# sourceMappingURL=calculateRowHeights.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateRowHeights.js.map b/node_modules/table/dist/src/calculateRowHeights.js.map deleted file mode 100644 index 1a7a2d96a..000000000 --- a/node_modules/table/dist/src/calculateRowHeights.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calculateRowHeights.js","sourceRoot":"","sources":["../../src/calculateRowHeights.ts"],"names":[],"mappings":";;;AAAA,+DAE+B;AAK/B,mCAGiB;AAEjB;;GAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,IAAW,EAAE,MAAkB,EAAY,EAAE;IAC/E,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,KAAK,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;QAC5C,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;;YAC9B,MAAM,eAAe,GAAG,MAAA,MAAM,CAAC,mBAAmB,0CAAE,kBAAkB,CAAC,EAAC,GAAG,EAAE,SAAS;gBACpF,GAAG,EAAE,QAAQ,EAAC,CAAC,CAAC;YAElB,IAAI,CAAC,eAAe,EAAE;gBACpB,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;gBAClH,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;gBAE5C,OAAO;aACR;YACD,MAAM,EAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAC,GAAG,eAAe,CAAC;YAEvD,kFAAkF;YAClF,IAAI,QAAQ,KAAK,WAAW,CAAC,GAAG,EAAE;gBAChC,MAAM,+BAA+B,GAAG,IAAA,gBAAQ,EAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;gBAChF,MAAM,2BAA2B,GAAG,WAAW,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;gBAClE,MAAM,iCAAiC,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,GAAG,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,qBAAqB,EAAE,EAAE;;oBACpH,0BAA0B;oBAC1B,OAAO,CAAC,CAAA,MAAA,MAAM,CAAC,kBAAkB,+CAAzB,MAAM,EAAsB,qBAAqB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA,CAAC;gBAC1E,CAAC,CAAC,CAAC,MAAM,CAAC;gBAEV,MAAM,UAAU,GAAG,MAAM,GAAG,+BAA+B,GAAG,2BAA2B,GAAG,iCAAiC,CAAC;gBAC9H,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;aAC7C;YAED,kEAAkE;QACpE,CAAC,CAAC,CAAC;QAEH,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAC5B;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAtCW,QAAA,mBAAmB,uBAsC9B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateSpanningCellWidth.d.ts b/node_modules/table/dist/src/calculateSpanningCellWidth.d.ts deleted file mode 100644 index 8a2820ddb..000000000 --- a/node_modules/table/dist/src/calculateSpanningCellWidth.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SpanningCellParameters } from './spanningCellManager'; -import type { RangeConfig } from './types/internal'; -export declare const calculateSpanningCellWidth: (rangeConfig: RangeConfig, dependencies: SpanningCellParameters) => number; diff --git a/node_modules/table/dist/src/calculateSpanningCellWidth.js b/node_modules/table/dist/src/calculateSpanningCellWidth.js deleted file mode 100644 index fc8866c03..000000000 --- a/node_modules/table/dist/src/calculateSpanningCellWidth.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.calculateSpanningCellWidth = void 0; -const utils_1 = require("./utils"); -const calculateSpanningCellWidth = (rangeConfig, dependencies) => { - const { columnsConfig, drawVerticalLine } = dependencies; - const { topLeft, bottomRight } = rangeConfig; - const totalWidth = (0, utils_1.sumArray)(columnsConfig.slice(topLeft.col, bottomRight.col + 1).map(({ width }) => { - return width; - })); - const totalPadding = topLeft.col === bottomRight.col ? - columnsConfig[topLeft.col].paddingRight + - columnsConfig[bottomRight.col].paddingLeft : - (0, utils_1.sumArray)(columnsConfig - .slice(topLeft.col, bottomRight.col + 1) - .map(({ paddingLeft, paddingRight }) => { - return paddingLeft + paddingRight; - })); - const totalBorderWidths = bottomRight.col - topLeft.col; - const totalHiddenVerticalBorders = (0, utils_1.sequence)(topLeft.col + 1, bottomRight.col).filter((verticalBorderIndex) => { - return !drawVerticalLine(verticalBorderIndex, columnsConfig.length); - }).length; - return totalWidth + totalPadding + totalBorderWidths - totalHiddenVerticalBorders; -}; -exports.calculateSpanningCellWidth = calculateSpanningCellWidth; -//# sourceMappingURL=calculateSpanningCellWidth.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateSpanningCellWidth.js.map b/node_modules/table/dist/src/calculateSpanningCellWidth.js.map deleted file mode 100644 index b0de977a0..000000000 --- a/node_modules/table/dist/src/calculateSpanningCellWidth.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calculateSpanningCellWidth.js","sourceRoot":"","sources":["../../src/calculateSpanningCellWidth.ts"],"names":[],"mappings":";;;AAMA,mCAEiB;AAEV,MAAM,0BAA0B,GAAG,CAAC,WAAwB,EAAE,YAAoC,EAAU,EAAE;IACnH,MAAM,EAAC,aAAa,EAAE,gBAAgB,EAAC,GAAG,YAAY,CAAC;IACvD,MAAM,EAAC,OAAO,EAAE,WAAW,EAAC,GAAG,WAAW,CAAC;IAE3C,MAAM,UAAU,GAAG,IAAA,gBAAQ,EACzB,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE;QACpE,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,YAAY,GAChB,OAAO,CAAC,GAAG,KAAK,WAAW,CAAC,GAAG,CAAC,CAAC;QAC/B,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY;YACvC,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC;QAC5C,IAAA,gBAAQ,EACN,aAAa;aACV,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,GAAG,CAAC,CAAC;aACvC,GAAG,CAAC,CAAC,EAAC,WAAW,EAAE,YAAY,EAAC,EAAE,EAAE;YACnC,OAAO,WAAW,GAAG,YAAY,CAAC;QACpC,CAAC,CAAC,CACL,CAAC;IACN,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAExD,MAAM,0BAA0B,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,GAAG,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,mBAAmB,EAAE,EAAE;QAC3G,OAAO,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC,MAAM,CAAC;IAEV,OAAO,UAAU,GAAG,YAAY,GAAG,iBAAiB,GAAG,0BAA0B,CAAC;AACpF,CAAC,CAAC;AA5BW,QAAA,0BAA0B,8BA4BrC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/createStream.d.ts b/node_modules/table/dist/src/createStream.d.ts deleted file mode 100644 index 9c2df8eb5..000000000 --- a/node_modules/table/dist/src/createStream.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { StreamUserConfig, WritableStream } from './types/api'; -export declare const createStream: (userConfig: StreamUserConfig) => WritableStream; diff --git a/node_modules/table/dist/src/createStream.js b/node_modules/table/dist/src/createStream.js deleted file mode 100644 index d526161df..000000000 --- a/node_modules/table/dist/src/createStream.js +++ /dev/null @@ -1,74 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createStream = void 0; -const alignTableData_1 = require("./alignTableData"); -const calculateRowHeights_1 = require("./calculateRowHeights"); -const drawBorder_1 = require("./drawBorder"); -const drawRow_1 = require("./drawRow"); -const makeStreamConfig_1 = require("./makeStreamConfig"); -const mapDataUsingRowHeights_1 = require("./mapDataUsingRowHeights"); -const padTableData_1 = require("./padTableData"); -const stringifyTableData_1 = require("./stringifyTableData"); -const truncateTableData_1 = require("./truncateTableData"); -const utils_1 = require("./utils"); -const prepareData = (data, config) => { - let rows = (0, stringifyTableData_1.stringifyTableData)(data); - rows = (0, truncateTableData_1.truncateTableData)(rows, (0, utils_1.extractTruncates)(config)); - const rowHeights = (0, calculateRowHeights_1.calculateRowHeights)(rows, config); - rows = (0, mapDataUsingRowHeights_1.mapDataUsingRowHeights)(rows, rowHeights, config); - rows = (0, alignTableData_1.alignTableData)(rows, config); - rows = (0, padTableData_1.padTableData)(rows, config); - return rows; -}; -const create = (row, columnWidths, config) => { - const rows = prepareData([row], config); - const body = rows.map((literalRow) => { - return (0, drawRow_1.drawRow)(literalRow, config); - }).join(''); - let output; - output = ''; - output += (0, drawBorder_1.drawBorderTop)(columnWidths, config); - output += body; - output += (0, drawBorder_1.drawBorderBottom)(columnWidths, config); - output = output.trimEnd(); - process.stdout.write(output); -}; -const append = (row, columnWidths, config) => { - const rows = prepareData([row], config); - const body = rows.map((literalRow) => { - return (0, drawRow_1.drawRow)(literalRow, config); - }).join(''); - let output = ''; - const bottom = (0, drawBorder_1.drawBorderBottom)(columnWidths, config); - if (bottom !== '\n') { - output = '\r\u001B[K'; - } - output += (0, drawBorder_1.drawBorderJoin)(columnWidths, config); - output += body; - output += bottom; - output = output.trimEnd(); - process.stdout.write(output); -}; -const createStream = (userConfig) => { - const config = (0, makeStreamConfig_1.makeStreamConfig)(userConfig); - const columnWidths = Object.values(config.columns).map((column) => { - return column.width + column.paddingLeft + column.paddingRight; - }); - let empty = true; - return { - write: (row) => { - if (row.length !== config.columnCount) { - throw new Error('Row cell count does not match the config.columnCount.'); - } - if (empty) { - empty = false; - create(row, columnWidths, config); - } - else { - append(row, columnWidths, config); - } - }, - }; -}; -exports.createStream = createStream; -//# sourceMappingURL=createStream.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/createStream.js.map b/node_modules/table/dist/src/createStream.js.map deleted file mode 100644 index 7ec269cff..000000000 --- a/node_modules/table/dist/src/createStream.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"createStream.js","sourceRoot":"","sources":["../../src/createStream.ts"],"names":[],"mappings":";;;AAAA,qDAE0B;AAC1B,+DAE+B;AAC/B,6CAIsB;AACtB,uCAEmB;AACnB,yDAE4B;AAC5B,qEAEkC;AAClC,iDAEwB;AACxB,6DAE8B;AAC9B,2DAE6B;AAQ7B,mCAEiB;AAEjB,MAAM,WAAW,GAAG,CAAC,IAAW,EAAE,MAAoB,EAAE,EAAE;IACxD,IAAI,IAAI,GAAG,IAAA,uCAAkB,EAAC,IAAI,CAAC,CAAC;IAEpC,IAAI,GAAG,IAAA,qCAAiB,EAAC,IAAI,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC,CAAC;IAEzD,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAErD,IAAI,GAAG,IAAA,+CAAsB,EAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,GAAG,IAAA,2BAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;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MAAM,GAAG,YAAY,CAAC;KACvB;IAED,MAAM,IAAI,IAAA,2BAAc,EAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAC/C,MAAM,IAAI,IAAI,CAAC;IACf,MAAM,IAAI,MAAM,CAAC;IAEjB,MAAM,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IAE1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEK,MAAM,YAAY,GAAG,CAAC,UAA4B,EAAkB,EAAE;IAC3E,MAAM,MAAM,GAAG,IAAA,mCAAgB,EAAC,UAAU,CAAC,CAAC;IAE5C,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAChE,OAAO,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,IAAI,KAAK,GAAG,IAAI,CAAC;IAEjB,OAAO;QACL,KAAK,EAAE,CAAC,GAAa,EAAE,EAAE;YACvB,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,WAAW,EAAE;gBACrC,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;aAC1E;YAED,IAAI,KAAK,EAAE;gBACT,KAAK,GAAG,KAAK,CAAC;gBAEd,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;aACnC;iBAAM;gBACL,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;aACnC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,YAAY,gBAwBvB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/drawBorder.d.ts b/node_modules/table/dist/src/drawBorder.d.ts deleted file mode 100644 index 82b4dc54e..000000000 --- a/node_modules/table/dist/src/drawBorder.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { SpanningCellManager } from './spanningCellManager'; -import type { BorderConfig, DrawVerticalLine } from './types/api'; -import type { SeparatorGetter } from './types/internal'; -declare type Separator = { - readonly left: string; - readonly right: string; - readonly body: string; - readonly bodyJoinOuter?: string; - readonly bodyJoinInner?: string; - readonly join: string; - readonly joinUp?: string; - readonly joinDown?: string; - readonly joinLeft?: string; - readonly joinRight?: string; -}; -export declare const drawBorderSegments: (columnWidths: number[], parameters: Parameters[1]) => string[]; -export declare const createSeparatorGetter: (dependencies: Parameters[1]) => (verticalBorderIndex: number, columnCount: number) => string; -export declare const drawBorder: (columnWidths: number[], parameters: Omit & { - separator: Separator; -}) => string; -export declare const drawBorderTop: (columnWidths: number[], parameters: DrawBorderParameters) => string; -export declare const drawBorderJoin: (columnWidths: number[], parameters: DrawBorderParameters) => string; -export declare const drawBorderBottom: (columnWidths: number[], parameters: DrawBorderParameters) => string; -export declare type BorderGetterParameters = { - border: BorderConfig; - drawVerticalLine: DrawVerticalLine; - spanningCellManager?: SpanningCellManager; - rowCount?: number; -}; -export declare type DrawBorderParameters = Omit & { - horizontalBorderIndex?: number; -}; -export declare const createTableBorderGetter: (columnWidths: number[], parameters: BorderGetterParameters) => SeparatorGetter; -export {}; diff --git a/node_modules/table/dist/src/drawBorder.js b/node_modules/table/dist/src/drawBorder.js deleted file mode 100644 index 81ede5063..000000000 --- a/node_modules/table/dist/src/drawBorder.js +++ /dev/null @@ -1,202 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createTableBorderGetter = exports.drawBorderBottom = exports.drawBorderJoin = exports.drawBorderTop = exports.drawBorder = exports.createSeparatorGetter = exports.drawBorderSegments = void 0; -const drawContent_1 = require("./drawContent"); -const drawBorderSegments = (columnWidths, parameters) => { - const { separator, horizontalBorderIndex, spanningCellManager } = parameters; - return columnWidths.map((columnWidth, columnIndex) => { - const normalSegment = separator.body.repeat(columnWidth); - if (horizontalBorderIndex === undefined) { - return normalSegment; - } - /* istanbul ignore next */ - const range = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.getContainingRange({ col: columnIndex, - row: horizontalBorderIndex }); - if (!range) { - return normalSegment; - } - const { topLeft } = range; - // draw border segments as usual for top border of spanning cell - if (horizontalBorderIndex === topLeft.row) { - return normalSegment; - } - // if for first column/row of spanning cell, just skip - if (columnIndex !== topLeft.col) { - return ''; - } - return range.extractBorderContent(horizontalBorderIndex); - }); -}; -exports.drawBorderSegments = drawBorderSegments; -const createSeparatorGetter = (dependencies) => { - const { separator, spanningCellManager, horizontalBorderIndex, rowCount } = dependencies; - // eslint-disable-next-line complexity - return (verticalBorderIndex, columnCount) => { - const inSameRange = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.inSameRange; - if (horizontalBorderIndex !== undefined && inSameRange) { - const topCell = { col: verticalBorderIndex, - row: horizontalBorderIndex - 1 }; - const leftCell = { col: verticalBorderIndex - 1, - row: horizontalBorderIndex }; - const oppositeCell = { col: verticalBorderIndex - 1, - row: horizontalBorderIndex - 1 }; - const currentCell = { col: verticalBorderIndex, - row: horizontalBorderIndex }; - const pairs = [ - [oppositeCell, topCell], - [topCell, currentCell], - [currentCell, leftCell], - [leftCell, oppositeCell], - ]; - // left side of horizontal border - if (verticalBorderIndex === 0) { - if (inSameRange(currentCell, topCell) && separator.bodyJoinOuter) { - return separator.bodyJoinOuter; - } - return separator.left; - } - // right side of horizontal border - if (verticalBorderIndex === columnCount) { - if (inSameRange(oppositeCell, leftCell) && separator.bodyJoinOuter) { - return separator.bodyJoinOuter; - } - return separator.right; - } - // top horizontal border - if (horizontalBorderIndex === 0) { - if (inSameRange(currentCell, leftCell)) { - return separator.body; - } - return separator.join; - } - // bottom horizontal border - if (horizontalBorderIndex === rowCount) { - if (inSameRange(topCell, oppositeCell)) { - return separator.body; - } - return separator.join; - } - const sameRangeCount = pairs.map((pair) => { - return inSameRange(...pair); - }).filter(Boolean).length; - // four cells are belongs to different spanning cells - if (sameRangeCount === 0) { - return separator.join; - } - // belong to one spanning cell - if (sameRangeCount === 4) { - return ''; - } - // belongs to two spanning cell - if (sameRangeCount === 2) { - if (inSameRange(...pairs[1]) && inSameRange(...pairs[3]) && separator.bodyJoinInner) { - return separator.bodyJoinInner; - } - return separator.body; - } - /* istanbul ignore next */ - if (sameRangeCount === 1) { - if (!separator.joinRight || !separator.joinLeft || !separator.joinUp || !separator.joinDown) { - throw new Error(`Can not get border separator for position [${horizontalBorderIndex}, ${verticalBorderIndex}]`); - } - if (inSameRange(...pairs[0])) { - return separator.joinDown; - } - if (inSameRange(...pairs[1])) { - return separator.joinLeft; - } - if (inSameRange(...pairs[2])) { - return separator.joinUp; - } - return separator.joinRight; - } - /* istanbul ignore next */ - throw new Error('Invalid case'); - } - if (verticalBorderIndex === 0) { - return separator.left; - } - if (verticalBorderIndex === columnCount) { - return separator.right; - } - return separator.join; - }; -}; -exports.createSeparatorGetter = createSeparatorGetter; -const drawBorder = (columnWidths, parameters) => { - const borderSegments = (0, exports.drawBorderSegments)(columnWidths, parameters); - const { drawVerticalLine, horizontalBorderIndex, spanningCellManager } = parameters; - return (0, drawContent_1.drawContent)({ - contents: borderSegments, - drawSeparator: drawVerticalLine, - elementType: 'border', - rowIndex: horizontalBorderIndex, - separatorGetter: (0, exports.createSeparatorGetter)(parameters), - spanningCellManager, - }) + '\n'; -}; -exports.drawBorder = drawBorder; -const drawBorderTop = (columnWidths, parameters) => { - const { border } = parameters; - const result = (0, exports.drawBorder)(columnWidths, { - ...parameters, - separator: { - body: border.topBody, - join: border.topJoin, - left: border.topLeft, - right: border.topRight, - }, - }); - if (result === '\n') { - return ''; - } - return result; -}; -exports.drawBorderTop = drawBorderTop; -const drawBorderJoin = (columnWidths, parameters) => { - const { border } = parameters; - return (0, exports.drawBorder)(columnWidths, { - ...parameters, - separator: { - body: border.joinBody, - bodyJoinInner: border.bodyJoin, - bodyJoinOuter: border.bodyLeft, - join: border.joinJoin, - joinDown: border.joinMiddleDown, - joinLeft: border.joinMiddleLeft, - joinRight: border.joinMiddleRight, - joinUp: border.joinMiddleUp, - left: border.joinLeft, - right: border.joinRight, - }, - }); -}; -exports.drawBorderJoin = drawBorderJoin; -const drawBorderBottom = (columnWidths, parameters) => { - const { border } = parameters; - return (0, exports.drawBorder)(columnWidths, { - ...parameters, - separator: { - body: border.bottomBody, - join: border.bottomJoin, - left: border.bottomLeft, - right: border.bottomRight, - }, - }); -}; -exports.drawBorderBottom = drawBorderBottom; -const createTableBorderGetter = (columnWidths, parameters) => { - return (index, size) => { - const drawBorderParameters = { ...parameters, - horizontalBorderIndex: index }; - if (index === 0) { - return (0, exports.drawBorderTop)(columnWidths, drawBorderParameters); - } - else if (index === size) { - return (0, exports.drawBorderBottom)(columnWidths, drawBorderParameters); - } - return (0, exports.drawBorderJoin)(columnWidths, drawBorderParameters); - }; -}; -exports.createTableBorderGetter = createTableBorderGetter; -//# sourceMappingURL=drawBorder.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/drawBorder.js.map b/node_modules/table/dist/src/drawBorder.js.map deleted file mode 100644 index c14af9b97..000000000 --- a/node_modules/table/dist/src/drawBorder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"drawBorder.js","sourceRoot":"","sources":["../../src/drawBorder.ts"],"names":[],"mappings":";;;AAAA,+CAEuB;AA0BhB,MAAM,kBAAkB,GAAG,CAAC,YAAsB,EAAE,UAA4C,EAAY,EAAE;IACnH,MAAM,EAAC,SAAS,EAAE,qBAAqB,EAAE,mBAAmB,EAAC,GAAG,UAAU,CAAC;IAE3E,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,EAAE;QACnD,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACzD,IAAI,qBAAqB,KAAK,SAAS,EAAE;YACvC,OAAO,aAAa,CAAC;SACtB;QAED,0BAA0B;QAC1B,MAAM,KAAK,G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,EAAC,GAAG,UAAU;YAC/D,qBAAqB,EAAE,KAAK,EAAC,CAAC;QAEhC,IAAI,KAAK,KAAK,CAAC,EAAE;YACf,OAAO,IAAA,qBAAa,EAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;SAC1D;aAAM,IAAI,KAAK,KAAK,IAAI,EAAE;YACzB,OAAO,IAAA,wBAAgB,EAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;SAC7D;QAED,OAAO,IAAA,sBAAc,EAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;IAC5D,CAAC,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,uBAAuB,2BAalC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/drawContent.d.ts b/node_modules/table/dist/src/drawContent.d.ts deleted file mode 100644 index 3ac2f8cea..000000000 --- a/node_modules/table/dist/src/drawContent.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { SpanningCellManager } from './spanningCellManager'; -/** - * Shared function to draw horizontal borders, rows or the entire table - */ -declare type DrawContentParameters = { - contents: string[]; - drawSeparator: (index: number, size: number) => boolean; - separatorGetter: (index: number, size: number) => string; - spanningCellManager?: SpanningCellManager; - rowIndex?: number; - elementType?: 'border' | 'cell' | 'row'; -}; -export declare const drawContent: (parameters: DrawContentParameters) => string; -export {}; diff --git a/node_modules/table/dist/src/drawContent.js b/node_modules/table/dist/src/drawContent.js deleted file mode 100644 index 98d494ea9..000000000 --- a/node_modules/table/dist/src/drawContent.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.drawContent = void 0; -const drawContent = (parameters) => { - const { contents, separatorGetter, drawSeparator, spanningCellManager, rowIndex, elementType } = parameters; - const contentSize = contents.length; - const result = []; - if (drawSeparator(0, contentSize)) { - result.push(separatorGetter(0, contentSize)); - } - contents.forEach((content, contentIndex) => { - if (!elementType || elementType === 'border' || elementType === 'row') { - result.push(content); - } - if (elementType === 'cell' && rowIndex === undefined) { - result.push(content); - } - if (elementType === 'cell' && rowIndex !== undefined) { - /* istanbul ignore next */ - const containingRange = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.getContainingRange({ col: contentIndex, - row: rowIndex }); - // when drawing content row, just add a cell when it is a normal cell - // or belongs to first column of spanning cell - if (!containingRange || contentIndex === containingRange.topLeft.col) { - result.push(content); - } - } - // Only append the middle separator if the content is not the last - if (contentIndex + 1 < contentSize && drawSeparator(contentIndex + 1, contentSize)) { - const separator = separatorGetter(contentIndex + 1, contentSize); - if (elementType === 'cell' && rowIndex !== undefined) { - const currentCell = { col: contentIndex + 1, - row: rowIndex }; - /* istanbul ignore next */ - const containingRange = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.getContainingRange(currentCell); - if (!containingRange || containingRange.topLeft.col === currentCell.col) { - result.push(separator); - } - } - else { - result.push(separator); - } - } - }); - if (drawSeparator(contentSize, contentSize)) { - result.push(separatorGetter(contentSize, contentSize)); - } - return result.join(''); -}; -exports.drawContent = drawContent; -//# sourceMappingURL=drawContent.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/drawContent.js.map b/node_modules/table/dist/src/drawContent.js.map deleted file mode 100644 index 991c2a5d7..000000000 --- a/node_modules/table/dist/src/drawContent.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"drawContent.js","sourceRoot":"","sources":["../../src/drawContent.ts"],"names":[],"mappings":";;;AAmBO,MAAM,WAAW,GAAG,CAAC,UAAiC,EAAU,EAAE;IACvE,MAAM,EAAC,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAC,GAAG,UAAU,CAAC;IAC1G,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC;IACpC,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,aAAa,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE;QACjC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CA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gBAC7E,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,KAAK,WAAW,CAAC,GAAG,EAAE;oBACvE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;iBACxB;aACF;iBAAM;gBACL,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aACxB;SACF;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,aAAa,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE;QAC3C,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;KACxD;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC,CAAC;AArDW,QAAA,WAAW,eAqDtB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/drawRow.d.ts b/node_modules/table/dist/src/drawRow.d.ts deleted file mode 100644 index c0238a8d8..000000000 --- a/node_modules/table/dist/src/drawRow.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { SpanningCellManager } from './spanningCellManager'; -import type { DrawVerticalLine } from './types/api'; -import type { BodyBorderConfig, Row } from './types/internal'; -export declare type DrawRowConfig = { - border: BodyBorderConfig; - drawVerticalLine: DrawVerticalLine; - spanningCellManager?: SpanningCellManager; - rowIndex?: number; -}; -export declare const drawRow: (row: Row, config: DrawRowConfig) => string; diff --git a/node_modules/table/dist/src/drawRow.js b/node_modules/table/dist/src/drawRow.js deleted file mode 100644 index a86a27901..000000000 --- a/node_modules/table/dist/src/drawRow.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.drawRow = void 0; -const drawContent_1 = require("./drawContent"); -const drawRow = (row, config) => { - const { border, drawVerticalLine, rowIndex, spanningCellManager } = config; - return (0, drawContent_1.drawContent)({ - contents: row, - drawSeparator: drawVerticalLine, - elementType: 'cell', - rowIndex, - separatorGetter: (index, columnCount) => { - if (index === 0) { - return border.bodyLeft; - } - if (index === columnCount) { - return border.bodyRight; - } - return border.bodyJoin; - }, - spanningCellManager, - }) + '\n'; -}; -exports.drawRow = drawRow; -//# sourceMappingURL=drawRow.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/drawRow.js.map b/node_modules/table/dist/src/drawRow.js.map deleted file mode 100644 index ca3c5bd94..000000000 --- a/node_modules/table/dist/src/drawRow.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"drawRow.js","sourceRoot":"","sources":["../../src/drawRow.ts"],"names":[],"mappings":";;;AAAA,+CAEuB;AAmBhB,MAAM,OAAO,GAAG,CAAC,GAAQ,EAAE,MAAqB,EAAU,EAAE;IACjE,MAAM,EAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,mBAAmB,EAAC,GAAG,MAAM,CAAC;IAEzE,OAAO,IAAA,yBAAW,EAAC;QACjB,QAAQ,EAAE,GAAG;QACb,aAAa,EAAE,gBAAgB;QAC/B,WAAW,EAAE,MAAM;QACnB,QAAQ;QACR,eAAe,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;YACtC,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,OAAO,MAAM,CAAC,QAAQ,CAAC;aACxB;YAED,IAAI,KAAK,KAAK,WAAW,EAAE;gBACzB,OAAO,MAAM,CAAC,SAAS,CAAC;aACzB;YAED,OAAO,MAAM,CAAC,QAAQ,CAAC;QACzB,CAAC;QACD,mBAAmB;KACpB,CAAC,GAAG,IAAI,CAAC;AACZ,CAAC,CAAC;AArBW,QAAA,OAAO,WAqBlB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/drawTable.d.ts b/node_modules/table/dist/src/drawTable.d.ts deleted file mode 100644 index f234f3049..000000000 --- a/node_modules/table/dist/src/drawTable.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TableConfig, Row } from './types/internal'; -export declare const drawTable: (rows: Row[], outputColumnWidths: number[], rowHeights: number[], config: TableConfig) => string; diff --git a/node_modules/table/dist/src/drawTable.js b/node_modules/table/dist/src/drawTable.js deleted file mode 100644 index dab8f987e..000000000 --- a/node_modules/table/dist/src/drawTable.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.drawTable = void 0; -const drawBorder_1 = require("./drawBorder"); -const drawContent_1 = require("./drawContent"); -const drawRow_1 = require("./drawRow"); -const utils_1 = require("./utils"); -const drawTable = (rows, outputColumnWidths, rowHeights, config) => { - const { drawHorizontalLine, singleLine, } = config; - const contents = (0, utils_1.groupBySizes)(rows, rowHeights).map((group, groupIndex) => { - return group.map((row) => { - return (0, drawRow_1.drawRow)(row, { ...config, - rowIndex: groupIndex }); - }).join(''); - }); - return (0, drawContent_1.drawContent)({ contents, - drawSeparator: (index, size) => { - // Top/bottom border - if (index === 0 || index === size) { - return drawHorizontalLine(index, size); - } - return !singleLine && drawHorizontalLine(index, size); - }, - elementType: 'row', - rowIndex: -1, - separatorGetter: (0, drawBorder_1.createTableBorderGetter)(outputColumnWidths, { ...config, - rowCount: contents.length }), - spanningCellManager: config.spanningCellManager }); -}; -exports.drawTable = drawTable; -//# sourceMappingURL=drawTable.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/drawTable.js.map b/node_modules/table/dist/src/drawTable.js.map deleted file mode 100644 index 882d6e378..000000000 --- a/node_modules/table/dist/src/drawTable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"drawTable.js","sourceRoot":"","sources":["../../src/drawTable.ts"],"names":[],"mappings":";;;AAAA,6CAEsB;AACtB,+CAEuB;AACvB,uCAEmB;AAInB,mCAEiB;AAEV,MAAM,SAAS,GAAG,CAAC,IAAW,EAAE,kBAA4B,EAAE,UAAoB,EAAE,MAAmB,EAAU,EAAE;IACxH,MAAM,EACJ,kBAAkB,EAClB,UAAU,GACX,GAAG,MAAM,CAAC;IAEX,MAAM,QAAQ,GAAG,IAAA,oBAAY,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;QACxE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACvB,OAAO,IAAA,iBAAO,EAAC,GAAG,EAAE,EAAC,GAAG,MAAM;gBAC5B,QAAQ,EAAE,UAAU,EAAC,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,yBAAW,EAAC,EAAC,QAAQ;QAC1B,aAAa,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YAC7B,oBAAoB;YACpB,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,EAAE;gBACjC,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;aACxC;YAED,OAAO,CAAC,UAAU,IAAI,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;QACD,WAAW,EAAE,KAAK;QAClB,QAAQ,EAAE,CAAC,CAAC;QACZ,eAAe,EAAE,IAAA,oCAAuB,EAAC,kBAAkB,EAAE,EAAC,GAAG,MAAM;YACrE,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAC,CAAC;QAC7B,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,EAAC,CAAC,CAAC;AACtD,CAAC,CAAC;AA3BW,QAAA,SAAS,aA2BpB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/generated/validators.d.ts b/node_modules/table/dist/src/generated/validators.d.ts deleted file mode 100644 index bec42e4a4..000000000 --- a/node_modules/table/dist/src/generated/validators.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare function validate43(data: any, { instancePath, parentData, parentDataProperty, rootData }?: { - instancePath?: string | undefined; - parentData: any; - parentDataProperty: any; - rootData?: any; -}): boolean; -declare function validate86(data: any, { instancePath, parentData, parentDataProperty, rootData }?: { - instancePath?: string | undefined; - parentData: any; - parentDataProperty: any; - rootData?: any; -}): boolean; -export { validate43 as _config_json, validate86 as _streamConfig_json }; diff --git a/node_modules/table/dist/src/generated/validators.js b/node_modules/table/dist/src/generated/validators.js deleted file mode 100644 index 6e5fc6675..000000000 --- a/node_modules/table/dist/src/generated/validators.js +++ /dev/null @@ -1,2694 +0,0 @@ -"use strict"; -exports["config.json"] = validate43; -const schema13 = { - "$id": "config.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "shared.json#/definitions/borders" - }, - "header": { - "type": "object", - "properties": { - "content": { - "type": "string" - }, - "alignment": { - "$ref": "shared.json#/definitions/alignment" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "integer" - }, - "paddingLeft": { - "type": "integer" - }, - "paddingRight": { - "type": "integer" - } - }, - "required": ["content"], - "additionalProperties": false - }, - "columns": { - "$ref": "shared.json#/definitions/columns" - }, - "columnDefault": { - "$ref": "shared.json#/definitions/column" - }, - "drawVerticalLine": { - "typeof": "function" - }, - "drawHorizontalLine": { - "typeof": "function" - }, - "singleLine": { - "typeof": "boolean" - }, - "spanningCells": { - "type": "array", - "items": { - "type": "object", - "properties": { - "col": { - "type": "integer", - "minimum": 0 - }, - "row": { - "type": "integer", - "minimum": 0 - }, - "colSpan": { - "type": "integer", - "minimum": 1 - }, - "rowSpan": { - "type": "integer", - "minimum": 1 - }, - "alignment": { - "$ref": "shared.json#/definitions/alignment" - }, - "verticalAlignment": { - "$ref": "shared.json#/definitions/verticalAlignment" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "integer" - }, - "paddingLeft": { - "type": "integer" - }, - "paddingRight": { - "type": "integer" - } - }, - "required": ["row", "col"], - "additionalProperties": false - } - } - }, - "additionalProperties": false -}; -const schema15 = { - "type": "object", - "properties": { - "topBody": { - "$ref": "#/definitions/border" - }, - "topJoin": { - "$ref": "#/definitions/border" - }, - "topLeft": { - "$ref": "#/definitions/border" - }, - "topRight": { - "$ref": "#/definitions/border" - }, - "bottomBody": { - "$ref": "#/definitions/border" - }, - "bottomJoin": { - "$ref": "#/definitions/border" - }, - "bottomLeft": { - "$ref": "#/definitions/border" - }, - "bottomRight": { - "$ref": "#/definitions/border" - }, - "bodyLeft": { - "$ref": "#/definitions/border" - }, - "bodyRight": { - "$ref": "#/definitions/border" - }, - "bodyJoin": { - "$ref": "#/definitions/border" - }, - "headerJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - }, - "joinMiddleUp": { - "$ref": "#/definitions/border" - }, - "joinMiddleDown": { - "$ref": "#/definitions/border" - }, - "joinMiddleLeft": { - "$ref": "#/definitions/border" - }, - "joinMiddleRight": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false -}; -const func8 = Object.prototype.hasOwnProperty; -const schema16 = { - "type": "string" -}; -function validate46(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (typeof data !== "string") { - const err0 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "string" - }, - message: "must be string" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - validate46.errors = vErrors; - return errors === 0; -} -function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(func8.call(schema15.properties, key0))) { - const err0 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - if (data.topBody !== undefined) { - if (!(validate46(data.topBody, { - instancePath: instancePath + "/topBody", - parentData: data, - parentDataProperty: "topBody", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.topJoin !== undefined) { - if (!(validate46(data.topJoin, { - instancePath: instancePath + "/topJoin", - parentData: data, - parentDataProperty: "topJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.topLeft !== undefined) { - if (!(validate46(data.topLeft, { - instancePath: instancePath + "/topLeft", - parentData: data, - parentDataProperty: "topLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.topRight !== undefined) { - if (!(validate46(data.topRight, { - instancePath: instancePath + "/topRight", - parentData: data, - parentDataProperty: "topRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomBody !== undefined) { - if (!(validate46(data.bottomBody, { - instancePath: instancePath + "/bottomBody", - parentData: data, - parentDataProperty: "bottomBody", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomJoin !== undefined) { - if (!(validate46(data.bottomJoin, { - instancePath: instancePath + "/bottomJoin", - parentData: data, - parentDataProperty: "bottomJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomLeft !== undefined) { - if (!(validate46(data.bottomLeft, { - instancePath: instancePath + "/bottomLeft", - parentData: data, - parentDataProperty: "bottomLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomRight !== undefined) { - if (!(validate46(data.bottomRight, { - instancePath: instancePath + "/bottomRight", - parentData: data, - parentDataProperty: "bottomRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bodyLeft !== undefined) { - if (!(validate46(data.bodyLeft, { - instancePath: instancePath + "/bodyLeft", - parentData: data, - parentDataProperty: "bodyLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bodyRight !== undefined) { - if (!(validate46(data.bodyRight, { - instancePath: instancePath + "/bodyRight", - parentData: data, - parentDataProperty: "bodyRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bodyJoin !== undefined) { - if (!(validate46(data.bodyJoin, { - instancePath: instancePath + "/bodyJoin", - parentData: data, - parentDataProperty: "bodyJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.headerJoin !== undefined) { - if (!(validate46(data.headerJoin, { - instancePath: instancePath + "/headerJoin", - parentData: data, - parentDataProperty: "headerJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinBody !== undefined) { - if (!(validate46(data.joinBody, { - instancePath: instancePath + "/joinBody", - parentData: data, - parentDataProperty: "joinBody", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinLeft !== undefined) { - if (!(validate46(data.joinLeft, { - instancePath: instancePath + "/joinLeft", - parentData: data, - parentDataProperty: "joinLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinRight !== undefined) { - if (!(validate46(data.joinRight, { - instancePath: instancePath + "/joinRight", - parentData: data, - parentDataProperty: "joinRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinJoin !== undefined) { - if (!(validate46(data.joinJoin, { - instancePath: instancePath + "/joinJoin", - parentData: data, - parentDataProperty: "joinJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleUp !== undefined) { - if (!(validate46(data.joinMiddleUp, { - instancePath: instancePath + "/joinMiddleUp", - parentData: data, - parentDataProperty: "joinMiddleUp", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleDown !== undefined) { - if (!(validate46(data.joinMiddleDown, { - instancePath: instancePath + "/joinMiddleDown", - parentData: data, - parentDataProperty: "joinMiddleDown", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleLeft !== undefined) { - if (!(validate46(data.joinMiddleLeft, { - instancePath: instancePath + "/joinMiddleLeft", - parentData: data, - parentDataProperty: "joinMiddleLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleRight !== undefined) { - if (!(validate46(data.joinMiddleRight, { - instancePath: instancePath + "/joinMiddleRight", - parentData: data, - parentDataProperty: "joinMiddleRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - } - else { - const err1 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - validate45.errors = vErrors; - return errors === 0; -} -const schema17 = { - "type": "string", - "enum": ["left", "right", "center", "justify"] -}; -const func0 = require("ajv/dist/runtime/equal").default; -function validate68(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (typeof data !== "string") { - const err0 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "string" - }, - message: "must be string" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - if (!((((data === "left") || (data === "right")) || (data === "center")) || (data === "justify"))) { - const err1 = { - instancePath, - schemaPath: "#/enum", - keyword: "enum", - params: { - allowedValues: schema17.enum - }, - message: "must be equal to one of the allowed values" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - validate68.errors = vErrors; - return errors === 0; -} -const schema18 = { - "oneOf": [{ - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false - }, { - "type": "array", - "items": { - "$ref": "#/definitions/column" - } - }] -}; -const pattern0 = new RegExp("^[0-9]+$", "u"); -const schema19 = { - "type": "object", - "properties": { - "alignment": { - "$ref": "#/definitions/alignment" - }, - "verticalAlignment": { - "$ref": "#/definitions/verticalAlignment" - }, - "width": { - "type": "integer", - "minimum": 1 - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "integer" - }, - "paddingLeft": { - "type": "integer" - }, - "paddingRight": { - "type": "integer" - } - }, - "additionalProperties": false -}; -function validate72(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (typeof data !== "string") { - const err0 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "string" - }, - message: "must be string" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - if (!((((data === "left") || (data === "right")) || (data === "center")) || (data === "justify"))) { - const err1 = { - instancePath, - schemaPath: "#/enum", - keyword: "enum", - params: { - allowedValues: schema17.enum - }, - message: "must be equal to one of the allowed values" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - validate72.errors = vErrors; - return errors === 0; -} -const schema21 = { - "type": "string", - "enum": ["top", "middle", "bottom"] -}; -function validate74(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (typeof data !== "string") { - const err0 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "string" - }, - message: "must be string" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - if (!(((data === "top") || (data === "middle")) || (data === "bottom"))) { - const err1 = { - instancePath, - schemaPath: "#/enum", - keyword: "enum", - params: { - allowedValues: schema21.enum - }, - message: "must be equal to one of the allowed values" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - validate74.errors = vErrors; - return errors === 0; -} -function validate71(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(((((((key0 === "alignment") || (key0 === "verticalAlignment")) || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { - const err0 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - if (data.alignment !== undefined) { - if (!(validate72(data.alignment, { - instancePath: instancePath + "/alignment", - parentData: data, - parentDataProperty: "alignment", - rootData - }))) { - vErrors = vErrors === null ? validate72.errors : vErrors.concat(validate72.errors); - errors = vErrors.length; - } - } - if (data.verticalAlignment !== undefined) { - if (!(validate74(data.verticalAlignment, { - instancePath: instancePath + "/verticalAlignment", - parentData: data, - parentDataProperty: "verticalAlignment", - rootData - }))) { - vErrors = vErrors === null ? validate74.errors : vErrors.concat(validate74.errors); - errors = vErrors.length; - } - } - if (data.width !== undefined) { - let data2 = data.width; - if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) { - const err1 = { - instancePath: instancePath + "/width", - schemaPath: "#/properties/width/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - if ((typeof data2 == "number") && (isFinite(data2))) { - if (data2 < 1 || isNaN(data2)) { - const err2 = { - instancePath: instancePath + "/width", - schemaPath: "#/properties/width/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 1 - }, - message: "must be >= 1" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - } - } - if (data.wrapWord !== undefined) { - if (typeof data.wrapWord !== "boolean") { - const err3 = { - instancePath: instancePath + "/wrapWord", - schemaPath: "#/properties/wrapWord/type", - keyword: "type", - params: { - type: "boolean" - }, - message: "must be boolean" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - } - if (data.truncate !== undefined) { - let data4 = data.truncate; - if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) { - const err4 = { - instancePath: instancePath + "/truncate", - schemaPath: "#/properties/truncate/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err4]; - } - else { - vErrors.push(err4); - } - errors++; - } - } - if (data.paddingLeft !== undefined) { - let data5 = data.paddingLeft; - if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) { - const err5 = { - instancePath: instancePath + "/paddingLeft", - schemaPath: "#/properties/paddingLeft/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err5]; - } - else { - vErrors.push(err5); - } - errors++; - } - } - if (data.paddingRight !== undefined) { - let data6 = data.paddingRight; - if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) { - const err6 = { - instancePath: instancePath + "/paddingRight", - schemaPath: "#/properties/paddingRight/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err6]; - } - else { - vErrors.push(err6); - } - errors++; - } - } - } - else { - const err7 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err7]; - } - else { - vErrors.push(err7); - } - errors++; - } - validate71.errors = vErrors; - return errors === 0; -} -function validate70(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - const _errs0 = errors; - let valid0 = false; - let passing0 = null; - const _errs1 = errors; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(pattern0.test(key0))) { - const err0 = { - instancePath, - schemaPath: "#/oneOf/0/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - for (const key1 in data) { - if (pattern0.test(key1)) { - if (!(validate71(data[key1], { - instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data, - parentDataProperty: key1, - rootData - }))) { - vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); - errors = vErrors.length; - } - } - } - } - else { - const err1 = { - instancePath, - schemaPath: "#/oneOf/0/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - var _valid0 = _errs1 === errors; - if (_valid0) { - valid0 = true; - passing0 = 0; - } - const _errs5 = errors; - if (Array.isArray(data)) { - const len0 = data.length; - for (let i0 = 0; i0 < len0; i0++) { - if (!(validate71(data[i0], { - instancePath: instancePath + "/" + i0, - parentData: data, - parentDataProperty: i0, - rootData - }))) { - vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); - errors = vErrors.length; - } - } - } - else { - const err2 = { - instancePath, - schemaPath: "#/oneOf/1/type", - keyword: "type", - params: { - type: "array" - }, - message: "must be array" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - var _valid0 = _errs5 === errors; - if (_valid0 && valid0) { - valid0 = false; - passing0 = [passing0, 1]; - } - else { - if (_valid0) { - valid0 = true; - passing0 = 1; - } - } - if (!valid0) { - const err3 = { - instancePath, - schemaPath: "#/oneOf", - keyword: "oneOf", - params: { - passingSchemas: passing0 - }, - message: "must match exactly one schema in oneOf" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - else { - errors = _errs0; - if (vErrors !== null) { - if (_errs0) { - vErrors.length = _errs0; - } - else { - vErrors = null; - } - } - } - validate70.errors = vErrors; - return errors === 0; -} -function validate79(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(((((((key0 === "alignment") || (key0 === "verticalAlignment")) || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { - const err0 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - if (data.alignment !== undefined) { - if (!(validate72(data.alignment, { - instancePath: instancePath + "/alignment", - parentData: data, - parentDataProperty: "alignment", - rootData - }))) { - vErrors = vErrors === null ? validate72.errors : vErrors.concat(validate72.errors); - errors = vErrors.length; - } - } - if (data.verticalAlignment !== undefined) { - if (!(validate74(data.verticalAlignment, { - instancePath: instancePath + "/verticalAlignment", - parentData: data, - parentDataProperty: "verticalAlignment", - rootData - }))) { - vErrors = vErrors === null ? validate74.errors : vErrors.concat(validate74.errors); - errors = vErrors.length; - } - } - if (data.width !== undefined) { - let data2 = data.width; - if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) { - const err1 = { - instancePath: instancePath + "/width", - schemaPath: "#/properties/width/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - if ((typeof data2 == "number") && (isFinite(data2))) { - if (data2 < 1 || isNaN(data2)) { - const err2 = { - instancePath: instancePath + "/width", - schemaPath: "#/properties/width/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 1 - }, - message: "must be >= 1" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - } - } - if (data.wrapWord !== undefined) { - if (typeof data.wrapWord !== "boolean") { - const err3 = { - instancePath: instancePath + "/wrapWord", - schemaPath: "#/properties/wrapWord/type", - keyword: "type", - params: { - type: "boolean" - }, - message: "must be boolean" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - } - if (data.truncate !== undefined) { - let data4 = data.truncate; - if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) { - const err4 = { - instancePath: instancePath + "/truncate", - schemaPath: "#/properties/truncate/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err4]; - } - else { - vErrors.push(err4); - } - errors++; - } - } - if (data.paddingLeft !== undefined) { - let data5 = data.paddingLeft; - if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) { - const err5 = { - instancePath: instancePath + "/paddingLeft", - schemaPath: "#/properties/paddingLeft/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err5]; - } - else { - vErrors.push(err5); - } - errors++; - } - } - if (data.paddingRight !== undefined) { - let data6 = data.paddingRight; - if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) { - const err6 = { - instancePath: instancePath + "/paddingRight", - schemaPath: "#/properties/paddingRight/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err6]; - } - else { - vErrors.push(err6); - } - errors++; - } - } - } - else { - const err7 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err7]; - } - else { - vErrors.push(err7); - } - errors++; - } - validate79.errors = vErrors; - return errors === 0; -} -function validate84(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (typeof data !== "string") { - const err0 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "string" - }, - message: "must be string" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - if (!(((data === "top") || (data === "middle")) || (data === "bottom"))) { - const err1 = { - instancePath, - schemaPath: "#/enum", - keyword: "enum", - params: { - allowedValues: schema21.enum - }, - message: "must be equal to one of the allowed values" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - validate84.errors = vErrors; - return errors === 0; -} -function validate43(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - /*# sourceURL="config.json" */ ; - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!((((((((key0 === "border") || (key0 === "header")) || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "drawVerticalLine")) || (key0 === "drawHorizontalLine")) || (key0 === "singleLine")) || (key0 === "spanningCells"))) { - const err0 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - if (data.border !== undefined) { - if (!(validate45(data.border, { - instancePath: instancePath + "/border", - parentData: data, - parentDataProperty: "border", - rootData - }))) { - vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors); - errors = vErrors.length; - } - } - if (data.header !== undefined) { - let data1 = data.header; - if (data1 && typeof data1 == "object" && !Array.isArray(data1)) { - if (data1.content === undefined) { - const err1 = { - instancePath: instancePath + "/header", - schemaPath: "#/properties/header/required", - keyword: "required", - params: { - missingProperty: "content" - }, - message: "must have required property '" + "content" + "'" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - for (const key1 in data1) { - if (!((((((key1 === "content") || (key1 === "alignment")) || (key1 === "wrapWord")) || (key1 === "truncate")) || (key1 === "paddingLeft")) || (key1 === "paddingRight"))) { - const err2 = { - instancePath: instancePath + "/header", - schemaPath: "#/properties/header/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key1 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - } - if (data1.content !== undefined) { - if (typeof data1.content !== "string") { - const err3 = { - instancePath: instancePath + "/header/content", - schemaPath: "#/properties/header/properties/content/type", - keyword: "type", - params: { - type: "string" - }, - message: "must be string" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - } - if (data1.alignment !== undefined) { - if (!(validate68(data1.alignment, { - instancePath: instancePath + "/header/alignment", - parentData: data1, - parentDataProperty: "alignment", - rootData - }))) { - vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors); - errors = vErrors.length; - } - } - if (data1.wrapWord !== undefined) { - if (typeof data1.wrapWord !== "boolean") { - const err4 = { - instancePath: instancePath + "/header/wrapWord", - schemaPath: "#/properties/header/properties/wrapWord/type", - keyword: "type", - params: { - type: "boolean" - }, - message: "must be boolean" - }; - if (vErrors === null) { - vErrors = [err4]; - } - else { - vErrors.push(err4); - } - errors++; - } - } - if (data1.truncate !== undefined) { - let data5 = data1.truncate; - if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) { - const err5 = { - instancePath: instancePath + "/header/truncate", - schemaPath: "#/properties/header/properties/truncate/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err5]; - } - else { - vErrors.push(err5); - } - errors++; - } - } - if (data1.paddingLeft !== undefined) { - let data6 = data1.paddingLeft; - if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) { - const err6 = { - instancePath: instancePath + "/header/paddingLeft", - schemaPath: "#/properties/header/properties/paddingLeft/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err6]; - } - else { - vErrors.push(err6); - } - errors++; - } - } - if (data1.paddingRight !== undefined) { - let data7 = data1.paddingRight; - if (!(((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7))) && (isFinite(data7)))) { - const err7 = { - instancePath: instancePath + "/header/paddingRight", - schemaPath: "#/properties/header/properties/paddingRight/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err7]; - } - else { - vErrors.push(err7); - } - errors++; - } - } - } - else { - const err8 = { - instancePath: instancePath + "/header", - schemaPath: "#/properties/header/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err8]; - } - else { - vErrors.push(err8); - } - errors++; - } - } - if (data.columns !== undefined) { - if (!(validate70(data.columns, { - instancePath: instancePath + "/columns", - parentData: data, - parentDataProperty: "columns", - rootData - }))) { - vErrors = vErrors === null ? validate70.errors : vErrors.concat(validate70.errors); - errors = vErrors.length; - } - } - if (data.columnDefault !== undefined) { - if (!(validate79(data.columnDefault, { - instancePath: instancePath + "/columnDefault", - parentData: data, - parentDataProperty: "columnDefault", - rootData - }))) { - vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors); - errors = vErrors.length; - } - } - if (data.drawVerticalLine !== undefined) { - if (typeof data.drawVerticalLine != "function") { - const err9 = { - instancePath: instancePath + "/drawVerticalLine", - schemaPath: "#/properties/drawVerticalLine/typeof", - keyword: "typeof", - params: {}, - message: "must pass \"typeof\" keyword validation" - }; - if (vErrors === null) { - vErrors = [err9]; - } - else { - vErrors.push(err9); - } - errors++; - } - } - if (data.drawHorizontalLine !== undefined) { - if (typeof data.drawHorizontalLine != "function") { - const err10 = { - instancePath: instancePath + "/drawHorizontalLine", - schemaPath: "#/properties/drawHorizontalLine/typeof", - keyword: "typeof", - params: {}, - message: "must pass \"typeof\" keyword validation" - }; - if (vErrors === null) { - vErrors = [err10]; - } - else { - vErrors.push(err10); - } - errors++; - } - } - if (data.singleLine !== undefined) { - if (typeof data.singleLine != "boolean") { - const err11 = { - instancePath: instancePath + "/singleLine", - schemaPath: "#/properties/singleLine/typeof", - keyword: "typeof", - params: {}, - message: "must pass \"typeof\" keyword validation" - }; - if (vErrors === null) { - vErrors = [err11]; - } - else { - vErrors.push(err11); - } - errors++; - } - } - if (data.spanningCells !== undefined) { - let data13 = data.spanningCells; - if (Array.isArray(data13)) { - const len0 = data13.length; - for (let i0 = 0; i0 < len0; i0++) { - let data14 = data13[i0]; - if (data14 && typeof data14 == "object" && !Array.isArray(data14)) { - if (data14.row === undefined) { - const err12 = { - instancePath: instancePath + "/spanningCells/" + i0, - schemaPath: "#/properties/spanningCells/items/required", - keyword: "required", - params: { - missingProperty: "row" - }, - message: "must have required property '" + "row" + "'" - }; - if (vErrors === null) { - vErrors = [err12]; - } - else { - vErrors.push(err12); - } - errors++; - } - if (data14.col === undefined) { - const err13 = { - instancePath: instancePath + "/spanningCells/" + i0, - schemaPath: "#/properties/spanningCells/items/required", - keyword: "required", - params: { - missingProperty: "col" - }, - message: "must have required property '" + "col" + "'" - }; - if (vErrors === null) { - vErrors = [err13]; - } - else { - vErrors.push(err13); - } - errors++; - } - for (const key2 in data14) { - if (!(func8.call(schema13.properties.spanningCells.items.properties, key2))) { - const err14 = { - instancePath: instancePath + "/spanningCells/" + i0, - schemaPath: "#/properties/spanningCells/items/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key2 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err14]; - } - else { - vErrors.push(err14); - } - errors++; - } - } - if (data14.col !== undefined) { - let data15 = data14.col; - if (!(((typeof data15 == "number") && (!(data15 % 1) && !isNaN(data15))) && (isFinite(data15)))) { - const err15 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/col", - schemaPath: "#/properties/spanningCells/items/properties/col/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err15]; - } - else { - vErrors.push(err15); - } - errors++; - } - if ((typeof data15 == "number") && (isFinite(data15))) { - if (data15 < 0 || isNaN(data15)) { - const err16 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/col", - schemaPath: "#/properties/spanningCells/items/properties/col/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 0 - }, - message: "must be >= 0" - }; - if (vErrors === null) { - vErrors = [err16]; - } - else { - vErrors.push(err16); - } - errors++; - } - } - } - if (data14.row !== undefined) { - let data16 = data14.row; - if (!(((typeof data16 == "number") && (!(data16 % 1) && !isNaN(data16))) && (isFinite(data16)))) { - const err17 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/row", - schemaPath: "#/properties/spanningCells/items/properties/row/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err17]; - } - else { - vErrors.push(err17); - } - errors++; - } - if ((typeof data16 == "number") && (isFinite(data16))) { - if (data16 < 0 || isNaN(data16)) { - const err18 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/row", - schemaPath: "#/properties/spanningCells/items/properties/row/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 0 - }, - message: "must be >= 0" - }; - if (vErrors === null) { - vErrors = [err18]; - } - else { - vErrors.push(err18); - } - errors++; - } - } - } - if (data14.colSpan !== undefined) { - let data17 = data14.colSpan; - if (!(((typeof data17 == "number") && (!(data17 % 1) && !isNaN(data17))) && (isFinite(data17)))) { - const err19 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/colSpan", - schemaPath: "#/properties/spanningCells/items/properties/colSpan/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err19]; - } - else { - vErrors.push(err19); - } - errors++; - } - if ((typeof data17 == "number") && (isFinite(data17))) { - if (data17 < 1 || isNaN(data17)) { - const err20 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/colSpan", - schemaPath: "#/properties/spanningCells/items/properties/colSpan/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 1 - }, - message: "must be >= 1" - }; - if (vErrors === null) { - vErrors = [err20]; - } - else { - vErrors.push(err20); - } - errors++; - } - } - } - if (data14.rowSpan !== undefined) { - let data18 = data14.rowSpan; - if (!(((typeof data18 == "number") && (!(data18 % 1) && !isNaN(data18))) && (isFinite(data18)))) { - const err21 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/rowSpan", - schemaPath: "#/properties/spanningCells/items/properties/rowSpan/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err21]; - } - else { - vErrors.push(err21); - } - errors++; - } - if ((typeof data18 == "number") && (isFinite(data18))) { - if (data18 < 1 || isNaN(data18)) { - const err22 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/rowSpan", - schemaPath: "#/properties/spanningCells/items/properties/rowSpan/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 1 - }, - message: "must be >= 1" - }; - if (vErrors === null) { - vErrors = [err22]; - } - else { - vErrors.push(err22); - } - errors++; - } - } - } - if (data14.alignment !== undefined) { - if (!(validate68(data14.alignment, { - instancePath: instancePath + "/spanningCells/" + i0 + "/alignment", - parentData: data14, - parentDataProperty: "alignment", - rootData - }))) { - vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors); - errors = vErrors.length; - } - } - if (data14.verticalAlignment !== undefined) { - if (!(validate84(data14.verticalAlignment, { - instancePath: instancePath + "/spanningCells/" + i0 + "/verticalAlignment", - parentData: data14, - parentDataProperty: "verticalAlignment", - rootData - }))) { - vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors); - errors = vErrors.length; - } - } - if (data14.wrapWord !== undefined) { - if (typeof data14.wrapWord !== "boolean") { - const err23 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/wrapWord", - schemaPath: "#/properties/spanningCells/items/properties/wrapWord/type", - keyword: "type", - params: { - type: "boolean" - }, - message: "must be boolean" - }; - if (vErrors === null) { - vErrors = [err23]; - } - else { - vErrors.push(err23); - } - errors++; - } - } - if (data14.truncate !== undefined) { - let data22 = data14.truncate; - if (!(((typeof data22 == "number") && (!(data22 % 1) && !isNaN(data22))) && (isFinite(data22)))) { - const err24 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/truncate", - schemaPath: "#/properties/spanningCells/items/properties/truncate/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err24]; - } - else { - vErrors.push(err24); - } - errors++; - } - } - if (data14.paddingLeft !== undefined) { - let data23 = data14.paddingLeft; - if (!(((typeof data23 == "number") && (!(data23 % 1) && !isNaN(data23))) && (isFinite(data23)))) { - const err25 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/paddingLeft", - schemaPath: "#/properties/spanningCells/items/properties/paddingLeft/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err25]; - } - else { - vErrors.push(err25); - } - errors++; - } - } - if (data14.paddingRight !== undefined) { - let data24 = data14.paddingRight; - if (!(((typeof data24 == "number") && (!(data24 % 1) && !isNaN(data24))) && (isFinite(data24)))) { - const err26 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/paddingRight", - schemaPath: "#/properties/spanningCells/items/properties/paddingRight/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err26]; - } - else { - vErrors.push(err26); - } - errors++; - } - } - } - else { - const err27 = { - instancePath: instancePath + "/spanningCells/" + i0, - schemaPath: "#/properties/spanningCells/items/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err27]; - } - else { - vErrors.push(err27); - } - errors++; - } - } - } - else { - const err28 = { - instancePath: instancePath + "/spanningCells", - schemaPath: "#/properties/spanningCells/type", - keyword: "type", - params: { - type: "array" - }, - message: "must be array" - }; - if (vErrors === null) { - vErrors = [err28]; - } - else { - vErrors.push(err28); - } - errors++; - } - } - } - else { - const err29 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err29]; - } - else { - vErrors.push(err29); - } - errors++; - } - validate43.errors = vErrors; - return errors === 0; -} -exports["streamConfig.json"] = validate86; -const schema24 = { - "$id": "streamConfig.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "shared.json#/definitions/borders" - }, - "columns": { - "$ref": "shared.json#/definitions/columns" - }, - "columnDefault": { - "$ref": "shared.json#/definitions/column" - }, - "columnCount": { - "type": "integer", - "minimum": 1 - }, - "drawVerticalLine": { - "typeof": "function" - } - }, - "required": ["columnDefault", "columnCount"], - "additionalProperties": false -}; -function validate87(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(func8.call(schema15.properties, key0))) { - const err0 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - if (data.topBody !== undefined) { - if (!(validate46(data.topBody, { - instancePath: instancePath + "/topBody", - parentData: data, - parentDataProperty: "topBody", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.topJoin !== undefined) { - if (!(validate46(data.topJoin, { - instancePath: instancePath + "/topJoin", - parentData: data, - parentDataProperty: "topJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.topLeft !== undefined) { - if (!(validate46(data.topLeft, { - instancePath: instancePath + "/topLeft", - parentData: data, - parentDataProperty: "topLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.topRight !== undefined) { - if (!(validate46(data.topRight, { - instancePath: instancePath + "/topRight", - parentData: data, - parentDataProperty: "topRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomBody !== undefined) { - if (!(validate46(data.bottomBody, { - instancePath: instancePath + "/bottomBody", - parentData: data, - parentDataProperty: "bottomBody", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomJoin !== undefined) { - if (!(validate46(data.bottomJoin, { - instancePath: instancePath + "/bottomJoin", - parentData: data, - parentDataProperty: "bottomJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomLeft !== undefined) { - if (!(validate46(data.bottomLeft, { - instancePath: instancePath + "/bottomLeft", - parentData: data, - parentDataProperty: "bottomLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bottomRight !== undefined) { - if (!(validate46(data.bottomRight, { - instancePath: instancePath + "/bottomRight", - parentData: data, - parentDataProperty: "bottomRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bodyLeft !== undefined) { - if (!(validate46(data.bodyLeft, { - instancePath: instancePath + "/bodyLeft", - parentData: data, - parentDataProperty: "bodyLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bodyRight !== undefined) { - if (!(validate46(data.bodyRight, { - instancePath: instancePath + "/bodyRight", - parentData: data, - parentDataProperty: "bodyRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.bodyJoin !== undefined) { - if (!(validate46(data.bodyJoin, { - instancePath: instancePath + "/bodyJoin", - parentData: data, - parentDataProperty: "bodyJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.headerJoin !== undefined) { - if (!(validate46(data.headerJoin, { - instancePath: instancePath + "/headerJoin", - parentData: data, - parentDataProperty: "headerJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinBody !== undefined) { - if (!(validate46(data.joinBody, { - instancePath: instancePath + "/joinBody", - parentData: data, - parentDataProperty: "joinBody", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinLeft !== undefined) { - if (!(validate46(data.joinLeft, { - instancePath: instancePath + "/joinLeft", - parentData: data, - parentDataProperty: "joinLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinRight !== undefined) { - if (!(validate46(data.joinRight, { - instancePath: instancePath + "/joinRight", - parentData: data, - parentDataProperty: "joinRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinJoin !== undefined) { - if (!(validate46(data.joinJoin, { - instancePath: instancePath + "/joinJoin", - parentData: data, - parentDataProperty: "joinJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleUp !== undefined) { - if (!(validate46(data.joinMiddleUp, { - instancePath: instancePath + "/joinMiddleUp", - parentData: data, - parentDataProperty: "joinMiddleUp", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleDown !== undefined) { - if (!(validate46(data.joinMiddleDown, { - instancePath: instancePath + "/joinMiddleDown", - parentData: data, - parentDataProperty: "joinMiddleDown", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleLeft !== undefined) { - if (!(validate46(data.joinMiddleLeft, { - instancePath: instancePath + "/joinMiddleLeft", - parentData: data, - parentDataProperty: "joinMiddleLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleRight !== undefined) { - if (!(validate46(data.joinMiddleRight, { - instancePath: instancePath + "/joinMiddleRight", - parentData: data, - parentDataProperty: "joinMiddleRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - } - else { - const err1 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - validate87.errors = vErrors; - return errors === 0; -} -function validate109(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - const _errs0 = errors; - let valid0 = false; - let passing0 = null; - const _errs1 = errors; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(pattern0.test(key0))) { - const err0 = { - instancePath, - schemaPath: "#/oneOf/0/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - for (const key1 in data) { - if (pattern0.test(key1)) { - if (!(validate71(data[key1], { - instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data, - parentDataProperty: key1, - rootData - }))) { - vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); - errors = vErrors.length; - } - } - } - } - else { - const err1 = { - instancePath, - schemaPath: "#/oneOf/0/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - var _valid0 = _errs1 === errors; - if (_valid0) { - valid0 = true; - passing0 = 0; - } - const _errs5 = errors; - if (Array.isArray(data)) { - const len0 = data.length; - for (let i0 = 0; i0 < len0; i0++) { - if (!(validate71(data[i0], { - instancePath: instancePath + "/" + i0, - parentData: data, - parentDataProperty: i0, - rootData - }))) { - vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); - errors = vErrors.length; - } - } - } - else { - const err2 = { - instancePath, - schemaPath: "#/oneOf/1/type", - keyword: "type", - params: { - type: "array" - }, - message: "must be array" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - var _valid0 = _errs5 === errors; - if (_valid0 && valid0) { - valid0 = false; - passing0 = [passing0, 1]; - } - else { - if (_valid0) { - valid0 = true; - passing0 = 1; - } - } - if (!valid0) { - const err3 = { - instancePath, - schemaPath: "#/oneOf", - keyword: "oneOf", - params: { - passingSchemas: passing0 - }, - message: "must match exactly one schema in oneOf" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - else { - errors = _errs0; - if (vErrors !== null) { - if (_errs0) { - vErrors.length = _errs0; - } - else { - vErrors = null; - } - } - } - validate109.errors = vErrors; - return errors === 0; -} -function validate113(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(((((((key0 === "alignment") || (key0 === "verticalAlignment")) || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { - const err0 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - if (data.alignment !== undefined) { - if (!(validate72(data.alignment, { - instancePath: instancePath + "/alignment", - parentData: data, - parentDataProperty: "alignment", - rootData - }))) { - vErrors = vErrors === null ? validate72.errors : vErrors.concat(validate72.errors); - errors = vErrors.length; - } - } - if (data.verticalAlignment !== undefined) { - if (!(validate74(data.verticalAlignment, { - instancePath: instancePath + "/verticalAlignment", - parentData: data, - parentDataProperty: "verticalAlignment", - rootData - }))) { - vErrors = vErrors === null ? validate74.errors : vErrors.concat(validate74.errors); - errors = vErrors.length; - } - } - if (data.width !== undefined) { - let data2 = data.width; - if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) { - const err1 = { - instancePath: instancePath + "/width", - schemaPath: "#/properties/width/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - if ((typeof data2 == "number") && (isFinite(data2))) { - if (data2 < 1 || isNaN(data2)) { - const err2 = { - instancePath: instancePath + "/width", - schemaPath: "#/properties/width/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 1 - }, - message: "must be >= 1" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - } - } - if (data.wrapWord !== undefined) { - if (typeof data.wrapWord !== "boolean") { - const err3 = { - instancePath: instancePath + "/wrapWord", - schemaPath: "#/properties/wrapWord/type", - keyword: "type", - params: { - type: "boolean" - }, - message: "must be boolean" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - } - if (data.truncate !== undefined) { - let data4 = data.truncate; - if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) { - const err4 = { - instancePath: instancePath + "/truncate", - schemaPath: "#/properties/truncate/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err4]; - } - else { - vErrors.push(err4); - } - errors++; - } - } - if (data.paddingLeft !== undefined) { - let data5 = data.paddingLeft; - if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) { - const err5 = { - instancePath: instancePath + "/paddingLeft", - schemaPath: "#/properties/paddingLeft/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err5]; - } - else { - vErrors.push(err5); - } - errors++; - } - } - if (data.paddingRight !== undefined) { - let data6 = data.paddingRight; - if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) { - const err6 = { - instancePath: instancePath + "/paddingRight", - schemaPath: "#/properties/paddingRight/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err6]; - } - else { - vErrors.push(err6); - } - errors++; - } - } - } - else { - const err7 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err7]; - } - else { - vErrors.push(err7); - } - errors++; - } - validate113.errors = vErrors; - return errors === 0; -} -function validate86(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - /*# sourceURL="streamConfig.json" */ ; - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - if (data.columnDefault === undefined) { - const err0 = { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: { - missingProperty: "columnDefault" - }, - message: "must have required property '" + "columnDefault" + "'" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - if (data.columnCount === undefined) { - const err1 = { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: { - missingProperty: "columnCount" - }, - message: "must have required property '" + "columnCount" + "'" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - for (const key0 in data) { - if (!(((((key0 === "border") || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "columnCount")) || (key0 === "drawVerticalLine"))) { - const err2 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - } - if (data.border !== undefined) { - if (!(validate87(data.border, { - instancePath: instancePath + "/border", - parentData: data, - parentDataProperty: "border", - rootData - }))) { - vErrors = vErrors === null ? validate87.errors : vErrors.concat(validate87.errors); - errors = vErrors.length; - } - } - if (data.columns !== undefined) { - if (!(validate109(data.columns, { - instancePath: instancePath + "/columns", - parentData: data, - parentDataProperty: "columns", - rootData - }))) { - vErrors = vErrors === null ? validate109.errors : vErrors.concat(validate109.errors); - errors = vErrors.length; - } - } - if (data.columnDefault !== undefined) { - if (!(validate113(data.columnDefault, { - instancePath: instancePath + "/columnDefault", - parentData: data, - parentDataProperty: "columnDefault", - rootData - }))) { - vErrors = vErrors === null ? validate113.errors : vErrors.concat(validate113.errors); - errors = vErrors.length; - } - } - if (data.columnCount !== undefined) { - let data3 = data.columnCount; - if (!(((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3))) && (isFinite(data3)))) { - const err3 = { - instancePath: instancePath + "/columnCount", - schemaPath: "#/properties/columnCount/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - if ((typeof data3 == "number") && (isFinite(data3))) { - if (data3 < 1 || isNaN(data3)) { - const err4 = { - instancePath: instancePath + "/columnCount", - schemaPath: "#/properties/columnCount/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 1 - }, - message: "must be >= 1" - }; - if (vErrors === null) { - vErrors = [err4]; - } - else { - vErrors.push(err4); - } - errors++; - } - } - } - if (data.drawVerticalLine !== undefined) { - if (typeof data.drawVerticalLine != "function") { - const err5 = { - instancePath: instancePath + "/drawVerticalLine", - schemaPath: "#/properties/drawVerticalLine/typeof", - keyword: "typeof", - params: {}, - message: "must pass \"typeof\" keyword validation" - }; - if (vErrors === null) { - vErrors = [err5]; - } - else { - vErrors.push(err5); - } - errors++; - } - } - } - else { - const err6 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err6]; - } - else { - vErrors.push(err6); - } - errors++; - } - validate86.errors = vErrors; - return errors === 0; -} -//# sourceMappingURL=validators.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/generated/validators.js.map b/node_modules/table/dist/src/generated/validators.js.map deleted file mode 100644 index 0436fc2ed..000000000 --- a/node_modules/table/dist/src/generated/validators.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/generated/validators.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,CAAC,aAAa,CAAC,GAAG,UAAU,CAAC;AACpC,MAAM,QAAQ,GAAG;IACb,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,yCAAyC;IACpD,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE;QACV,QAAQ,EAAE;YACN,MAAM,EAAE,kCAAkC;SAC7C;QACD,QAAQ,EAAE;YACN,MAAM,EAAE,QAAQ;YAChB,YAAY,EAAE;gBACV,SAAS,EAAE;oBACP,MAAM,EAAE,QAAQ;iBACnB;gBACD,WAAW,EAAE;oBACT,MAAM,EAAE,oCAAoC;iBAC/C;gBACD,UAAU,EAAE;oBACR,MAAM,EAAE,SAAS;iBACpB;gBACD,UAAU,EAAE;oBACR,MAAM,EAAE,SAAS;iBACpB;gBACD,aAAa,EAAE;oBACX,MAAM,EAAE,SAAS;iBACpB;gBACD,cAAc,EAAE;oBAC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ACD,MAAM,EAAE,CAAC;iBACZ;aACJ;SACJ;QACD,IAAI,IAAI,CAAC,gBAAgB,KAAK,SAAS,EAAE;YACrC,IAAI,OAAO,IAAI,CAAC,gBAAgB,IAAI,UAAU,EAAE;gBAC5C,MAAM,IAAI,GAAG;oBACT,YAAY,EAAE,YAAY,GAAG,mBAAmB;oBAChD,UAAU,EAAE,sCAAsC;oBAClD,OAAO,EAAE,QAAQ;oBACjB,MAAM,EAAE,EAAE;oBACV,OAAO,EAAE,yCAAyC;iBACrD,CAAC;gBACF,IAAI,OAAO,KAAK,IAAI,EAAE;oBAClB,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;iBACpB;qBAAM;oBACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACtB;gBACD,MAAM,EAAE,CAAC;aACZ;SACJ;KACJ;SAAM;QACH,MAAM,IAAI,GAAG;YACT,YAAY;YACZ,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,MAAM;YACf,MAAM,EAAE;gBACJ,IAAI,EAAE,QAAQ;aACjB;YACD,OAAO,EAAE,gBAAgB;SAC5B,CAAC;QACF,IAAI,OAAO,KAAK,IAAI,EAAE;YAClB,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;SACpB;aAAM;YACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACtB;QACD,MAAM,EAAE,CAAC;KACZ;IACD,UAAU,CAAC,MAAM,GAAG,OAAO,CAAC;IAC5B,OAAO,MAAM,KAAK,CAAC,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/getBorderCharacters.d.ts b/node_modules/table/dist/src/getBorderCharacters.d.ts deleted file mode 100644 index 334489bcf..000000000 --- a/node_modules/table/dist/src/getBorderCharacters.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { BorderConfig } from './types/api'; -export declare const getBorderCharacters: (name: string) => BorderConfig; diff --git a/node_modules/table/dist/src/getBorderCharacters.js b/node_modules/table/dist/src/getBorderCharacters.js deleted file mode 100644 index 24b2612ce..000000000 --- a/node_modules/table/dist/src/getBorderCharacters.js +++ /dev/null @@ -1,105 +0,0 @@ -"use strict"; -/* eslint-disable sort-keys-fix/sort-keys-fix */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getBorderCharacters = void 0; -const getBorderCharacters = (name) => { - if (name === 'honeywell') { - return { - topBody: '═', - topJoin: '╤', - topLeft: '╔', - topRight: '╗', - bottomBody: '═', - bottomJoin: '╧', - bottomLeft: '╚', - bottomRight: '╝', - bodyLeft: '║', - bodyRight: '║', - bodyJoin: '│', - headerJoin: '┬', - joinBody: '─', - joinLeft: '╟', - joinRight: '╢', - joinJoin: '┼', - joinMiddleDown: '┬', - joinMiddleUp: '┴', - joinMiddleLeft: '┤', - joinMiddleRight: '├', - }; - } - if (name === 'norc') { - return { - topBody: '─', - topJoin: '┬', - topLeft: '┌', - topRight: '┐', - bottomBody: '─', - bottomJoin: '┴', - bottomLeft: '└', - bottomRight: '┘', - bodyLeft: '│', - bodyRight: '│', - bodyJoin: '│', - headerJoin: '┬', - joinBody: '─', - joinLeft: '├', - joinRight: '┤', - joinJoin: '┼', - joinMiddleDown: '┬', - joinMiddleUp: '┴', - joinMiddleLeft: '┤', - joinMiddleRight: '├', - }; - } - if (name === 'ramac') { - return { - topBody: '-', - topJoin: '+', - topLeft: '+', - topRight: '+', - bottomBody: '-', - bottomJoin: '+', - bottomLeft: '+', - bottomRight: '+', - bodyLeft: '|', - bodyRight: '|', - bodyJoin: '|', - headerJoin: '+', - joinBody: '-', - joinLeft: '|', - joinRight: '|', - joinJoin: '|', - joinMiddleDown: '+', - joinMiddleUp: '+', - joinMiddleLeft: '+', - joinMiddleRight: '+', - }; - } - if (name === 'void') { - return { - topBody: '', - topJoin: '', - topLeft: '', - topRight: '', - bottomBody: '', - bottomJoin: '', - bottomLeft: '', - bottomRight: '', - bodyLeft: '', - bodyRight: '', - bodyJoin: '', - headerJoin: '', - joinBody: '', - joinLeft: '', - joinRight: '', - joinJoin: '', - joinMiddleDown: '', - joinMiddleUp: '', - joinMiddleLeft: '', - joinMiddleRight: '', - }; - } - throw new Error('Unknown border template "' + name + '".'); -}; -exports.getBorderCharacters = getBorderCharacters; -//# sourceMappingURL=getBorderCharacters.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/getBorderCharacters.js.map b/node_modules/table/dist/src/getBorderCharacters.js.map deleted file mode 100644 index 848b993e1..000000000 --- a/node_modules/table/dist/src/getBorderCharacters.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"getBorderCharacters.js","sourceRoot":"","sources":["../../src/getBorderCharacters.ts"],"names":[],"mappings":";AAAA,gDAAgD;;;AAMzC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAgB,EAAE;IAChE,IAAI,IAAI,KAAK,WAAW,EAAE;QACxB,OAAO;YACL,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,GAAG;YACZ,QAAQ,EAAE,GAAG;YAEb,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,WAAW,EAAE,GAAG;YAEhB,QAAQ,EAAE,GAAG;YACb,SAAS,EAAE,GAAG;YACd,QAAQ,EAAE,GAAG;YACb,UAAU,EAAE,GAAG;YAEf,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,GAAG;YACb,SAAS,EAAE,GAAG;YACd,QAAQ,EAAE,GAAG;YACb,cAAc,EAAE,GAAG;YACnB,YAAY,EAAE,GAAG;YACjB,cAAc,EAAE,GAAG;YACnB,eAAe,EAAE,GAAG;SACrB,CAAC;KACH;IAED,IAAI,IAAI,KAAK,MAAM,EAAE;QACnB,OAAO;YACL,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,GAAG;YACZ,QAAQ,EAAE,GAAG;YAEb,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,UAAU,EAAE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ACZ,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,cAAc,EAAE,EAAE;YAClB,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,EAAE;SACpB,CAAC;KACH;IAED,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AAC7D,CAAC,CAAC;AAlHW,QAAA,mBAAmB,uBAkH9B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/index.d.ts b/node_modules/table/dist/src/index.d.ts deleted file mode 100644 index 7ac2d57d9..000000000 --- a/node_modules/table/dist/src/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { createStream } from './createStream'; -import { getBorderCharacters } from './getBorderCharacters'; -import { table } from './table'; -export { table, createStream, getBorderCharacters, }; -export * from './types/api'; diff --git a/node_modules/table/dist/src/index.js b/node_modules/table/dist/src/index.js deleted file mode 100644 index 6271ec689..000000000 --- a/node_modules/table/dist/src/index.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getBorderCharacters = exports.createStream = exports.table = void 0; -const createStream_1 = require("./createStream"); -Object.defineProperty(exports, "createStream", { enumerable: true, get: function () { return createStream_1.createStream; } }); -const getBorderCharacters_1 = require("./getBorderCharacters"); -Object.defineProperty(exports, "getBorderCharacters", { enumerable: true, get: function () { return getBorderCharacters_1.getBorderCharacters; } }); -const table_1 = require("./table"); -Object.defineProperty(exports, "table", { enumerable: true, get: function () { return table_1.table; } }); -__exportStar(require("./types/api"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/index.js.map b/node_modules/table/dist/src/index.js.map deleted file mode 100644 index 93443068c..000000000 --- a/node_modules/table/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,iDAEwB;AAUtB,6FAXA,2BAAY,OAWA;AATd,+DAE+B;AAQ7B,oGATA,yCAAmB,OASA;AAPrB,mCAEiB;AAGf,sFAJA,aAAK,OAIA;AAKP,8CAA4B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/injectHeaderConfig.d.ts b/node_modules/table/dist/src/injectHeaderConfig.d.ts deleted file mode 100644 index 8acf70718..000000000 --- a/node_modules/table/dist/src/injectHeaderConfig.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SpanningCellConfig, TableUserConfig } from './types/api'; -import type { Row } from './types/internal'; -export declare const injectHeaderConfig: (rows: Row[], config: TableUserConfig) => [Row[], SpanningCellConfig[]]; diff --git a/node_modules/table/dist/src/injectHeaderConfig.js b/node_modules/table/dist/src/injectHeaderConfig.js deleted file mode 100644 index 2e82d1253..000000000 --- a/node_modules/table/dist/src/injectHeaderConfig.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.injectHeaderConfig = void 0; -const injectHeaderConfig = (rows, config) => { - var _a; - let spanningCellConfig = (_a = config.spanningCells) !== null && _a !== void 0 ? _a : []; - const headerConfig = config.header; - const adjustedRows = [...rows]; - if (headerConfig) { - spanningCellConfig = spanningCellConfig.map(({ row, ...rest }) => { - return { ...rest, - row: row + 1 }; - }); - const { content, ...headerStyles } = headerConfig; - spanningCellConfig.unshift({ alignment: 'center', - col: 0, - colSpan: rows[0].length, - paddingLeft: 1, - paddingRight: 1, - row: 0, - wrapWord: false, - ...headerStyles }); - adjustedRows.unshift([content, ...Array.from({ length: rows[0].length - 1 }).fill('')]); - } - return [adjustedRows, - spanningCellConfig]; -}; -exports.injectHeaderConfig = injectHeaderConfig; -//# sourceMappingURL=injectHeaderConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/injectHeaderConfig.js.map b/node_modules/table/dist/src/injectHeaderConfig.js.map deleted file mode 100644 index 29eead974..000000000 --- a/node_modules/table/dist/src/injectHeaderConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"injectHeaderConfig.js","sourceRoot":"","sources":["../../src/injectHeaderConfig.ts"],"names":[],"mappings":";;;AAQO,MAAM,kBAAkB,GAAG,CAAC,IAAW,EAAE,MAAuB,EAAiC,EAAE;;IACxG,IAAI,kBAAkB,GAAG,MAAA,MAAM,CAAC,aAAa,mCAAI,EAAE,CAAC;IACpD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAE/B,IAAI,YAAY,EAAE;QAChB,kBAAkB,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAC,GAAG,EAAE,GAAG,IAAI,EAAC,EAAE,EAAE;YAC7D,OAAO,EAAC,GAAG,IAAI;gBACb,GAAG,EAAE,GAAG,GAAG,CAAC,EAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM,EAAC,OAAO,EAAE,GAAG,YAAY,EAAC,GAAG,YAAY,CAAC;QAEhD,kBAAkB,CAAC,OAAO,CAAC,EAAC,SAAS,EAAE,QAAQ;YAC7C,GAAG,EAAE,CAAC;YACN,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM;YACvB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,KAAK;YACf,GAAG,YAAY,EAAC,CAAC,CAAC;QAEpB,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,CAAS,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC/F;IAED,OAAO,CAAC,YAAY;QAClB,kBAAkB,CAAC,CAAC;AACxB,CAAC,CAAC;AA3BW,QAAA,kBAAkB,sBA2B7B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/makeRangeConfig.d.ts b/node_modules/table/dist/src/makeRangeConfig.d.ts deleted file mode 100644 index b2d2c336a..000000000 --- a/node_modules/table/dist/src/makeRangeConfig.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SpanningCellConfig } from './types/api'; -import type { ColumnConfig, RangeConfig } from './types/internal'; -export declare const makeRangeConfig: (spanningCellConfig: SpanningCellConfig, columnsConfig: ColumnConfig[]) => RangeConfig; diff --git a/node_modules/table/dist/src/makeRangeConfig.js b/node_modules/table/dist/src/makeRangeConfig.js deleted file mode 100644 index 2acd824c1..000000000 --- a/node_modules/table/dist/src/makeRangeConfig.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeRangeConfig = void 0; -const utils_1 = require("./utils"); -const makeRangeConfig = (spanningCellConfig, columnsConfig) => { - var _a; - const { topLeft, bottomRight } = (0, utils_1.calculateRangeCoordinate)(spanningCellConfig); - const cellConfig = { - ...columnsConfig[topLeft.col], - ...spanningCellConfig, - paddingRight: (_a = spanningCellConfig.paddingRight) !== null && _a !== void 0 ? _a : columnsConfig[bottomRight.col].paddingRight, - }; - return { ...cellConfig, - bottomRight, - topLeft }; -}; -exports.makeRangeConfig = makeRangeConfig; -//# sourceMappingURL=makeRangeConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/makeRangeConfig.js.map b/node_modules/table/dist/src/makeRangeConfig.js.map deleted file mode 100644 index c37642ee7..000000000 --- a/node_modules/table/dist/src/makeRangeConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"makeRangeConfig.js","sourceRoot":"","sources":["../../src/makeRangeConfig.ts"],"names":[],"mappings":";;;AAMA,mCAEiB;AAEV,MAAM,eAAe,GAAG,CAAC,kBAAsC,EAAE,aAA6B,EAAe,EAAE;;IACpH,MAAM,EAAC,OAAO,EAAE,WAAW,EAAC,GAAG,IAAA,gCAAwB,EAAC,kBAAkB,CAAC,CAAC;IAE5E,MAAM,UAAU,GAA6B;QAC3C,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC;QAC7B,GAAG,kBAAkB;QACrB,YAAY,EACV,MAAA,kBAAkB,CAAC,YAAY,mCAC/B,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,YAAY;KAC9C,CAAC;IAEF,OAAO,EAAC,GAAG,UAAU;QACnB,WAAW;QACX,OAAO,EAAC,CAAC;AACb,CAAC,CAAC;AAdW,QAAA,eAAe,mBAc1B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/makeStreamConfig.d.ts b/node_modules/table/dist/src/makeStreamConfig.d.ts deleted file mode 100644 index cdd1f0452..000000000 --- a/node_modules/table/dist/src/makeStreamConfig.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { StreamUserConfig } from './types/api'; -import type { StreamConfig } from './types/internal'; -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - */ -export declare const makeStreamConfig: (config: StreamUserConfig) => StreamConfig; diff --git a/node_modules/table/dist/src/makeStreamConfig.js b/node_modules/table/dist/src/makeStreamConfig.js deleted file mode 100644 index 227b5795c..000000000 --- a/node_modules/table/dist/src/makeStreamConfig.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeStreamConfig = void 0; -const utils_1 = require("./utils"); -const validateConfig_1 = require("./validateConfig"); -/** - * Creates a configuration for every column using default - * values for the missing configuration properties. - */ -const makeColumnsConfig = (columnCount, columns = {}, columnDefault) => { - return Array.from({ length: columnCount }).map((_, index) => { - return { - alignment: 'left', - paddingLeft: 1, - paddingRight: 1, - truncate: Number.POSITIVE_INFINITY, - verticalAlignment: 'top', - wrapWord: false, - ...columnDefault, - ...columns[index], - }; - }); -}; -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - */ -const makeStreamConfig = (config) => { - (0, validateConfig_1.validateConfig)('streamConfig.json', config); - if (config.columnDefault.width === undefined) { - throw new Error('Must provide config.columnDefault.width when creating a stream.'); - } - return { - drawVerticalLine: () => { - return true; - }, - ...config, - border: (0, utils_1.makeBorderConfig)(config.border), - columns: makeColumnsConfig(config.columnCount, config.columns, config.columnDefault), - }; -}; -exports.makeStreamConfig = makeStreamConfig; -//# sourceMappingURL=makeStreamConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/makeStreamConfig.js.map b/node_modules/table/dist/src/makeStreamConfig.js.map deleted file mode 100644 index 715a3fe04..000000000 --- a/node_modules/table/dist/src/makeStreamConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"makeStreamConfig.js","sourceRoot":"","sources":["../../src/makeStreamConfig.ts"],"names":[],"mappings":";;;AASA,mCAEiB;AACjB,qDAE0B;AAE1B;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,WAAmB,EAC5C,UAAuC,EAAE,EACzC,aAAgD,EAAkB,EAAE;IACpE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,WAAW,EAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QACxD,OAAO;YACL,SAAS,EAAE,MAAM;YACjB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,QAAQ,EAAE,MAAM,CAAC,iBAAiB;YAClC,iBAAiB,EAAE,KAAK;YACxB,QAAQ,EAAE,KAAK;YACf,GAAG,aAAa;YAChB,GAAG,OAAO,CAAC,KAAK,CAAC;SAClB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,gBAAgB,GAAG,CAAC,MAAwB,EAAgB,EAAE;IACzE,IAAA,+BAAc,EAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAE5C,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,KAAK,SAAS,EAAE;QAC5C,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;KACpF;IAED,OAAO;QACL,gBAAgB,EAAE,GAAG,EAAE;YACrB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,GAAG,MAAM;QACT,MAAM,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,MAAM,CAAC;QACvC,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,CAAC;KACrF,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,gBAAgB,oBAe3B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/makeTableConfig.d.ts b/node_modules/table/dist/src/makeTableConfig.d.ts deleted file mode 100644 index 599c018e1..000000000 --- a/node_modules/table/dist/src/makeTableConfig.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SpanningCellConfig, TableUserConfig } from './types/api'; -import type { Row, TableConfig } from './types/internal'; -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - */ -export declare const makeTableConfig: (rows: Row[], config?: TableUserConfig, injectedSpanningCellConfig?: SpanningCellConfig[] | undefined) => TableConfig; diff --git a/node_modules/table/dist/src/makeTableConfig.js b/node_modules/table/dist/src/makeTableConfig.js deleted file mode 100644 index 8b858aea3..000000000 --- a/node_modules/table/dist/src/makeTableConfig.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeTableConfig = void 0; -const calculateMaximumColumnWidths_1 = require("./calculateMaximumColumnWidths"); -const spanningCellManager_1 = require("./spanningCellManager"); -const utils_1 = require("./utils"); -const validateConfig_1 = require("./validateConfig"); -const validateSpanningCellConfig_1 = require("./validateSpanningCellConfig"); -/** - * Creates a configuration for every column using default - * values for the missing configuration properties. - */ -const makeColumnsConfig = (rows, columns, columnDefault, spanningCellConfigs) => { - const columnWidths = (0, calculateMaximumColumnWidths_1.calculateMaximumColumnWidths)(rows, spanningCellConfigs); - return rows[0].map((_, columnIndex) => { - return { - alignment: 'left', - paddingLeft: 1, - paddingRight: 1, - truncate: Number.POSITIVE_INFINITY, - verticalAlignment: 'top', - width: columnWidths[columnIndex], - wrapWord: false, - ...columnDefault, - ...columns === null || columns === void 0 ? void 0 : columns[columnIndex], - }; - }); -}; -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - */ -const makeTableConfig = (rows, config = {}, injectedSpanningCellConfig) => { - var _a, _b, _c, _d, _e; - (0, validateConfig_1.validateConfig)('config.json', config); - (0, validateSpanningCellConfig_1.validateSpanningCellConfig)(rows, (_a = config.spanningCells) !== null && _a !== void 0 ? _a : []); - const spanningCellConfigs = (_b = injectedSpanningCellConfig !== null && injectedSpanningCellConfig !== void 0 ? injectedSpanningCellConfig : config.spanningCells) !== null && _b !== void 0 ? _b : []; - const columnsConfig = makeColumnsConfig(rows, config.columns, config.columnDefault, spanningCellConfigs); - const drawVerticalLine = (_c = config.drawVerticalLine) !== null && _c !== void 0 ? _c : (() => { - return true; - }); - const drawHorizontalLine = (_d = config.drawHorizontalLine) !== null && _d !== void 0 ? _d : (() => { - return true; - }); - return { - ...config, - border: (0, utils_1.makeBorderConfig)(config.border), - columns: columnsConfig, - drawHorizontalLine, - drawVerticalLine, - singleLine: (_e = config.singleLine) !== null && _e !== void 0 ? _e : false, - spanningCellManager: (0, spanningCellManager_1.createSpanningCellManager)({ - columnsConfig, - drawHorizontalLine, - drawVerticalLine, - rows, - spanningCellConfigs, - }), - }; -}; -exports.makeTableConfig = makeTableConfig; -//# sourceMappingURL=makeTableConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/makeTableConfig.js.map b/node_modules/table/dist/src/makeTableConfig.js.map deleted file mode 100644 index 11617bf6c..000000000 --- a/node_modules/table/dist/src/makeTableConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"makeTableConfig.js","sourceRoot":"","sources":["../../src/makeTableConfig.ts"],"names":[],"mappings":";;;AAAA,iFAEwC;AACxC,+DAE+B;AAS/B,mCAEiB;AACjB,qDAE0B;AAC1B,6EAEsC;AAEtC;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,IAAW,EACpC,OAAqC,EACrC,aAAgC,EAChC,mBAA0C,EAAkB,EAAE;IAC9D,MAAM,YAAY,GAAG,IAAA,2DAA4B,EAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAE7E,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE;QACpC,OAAO;YACL,SAAS,EAAE,MAAM;YACjB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,QAAQ,EAAE,MAAM,CAAC,iBAAiB;YAClC,iBAAiB,EAAE,KAAK;YACxB,KAAK,EAAE,YAAY,CAAC,WAAW,CAAC;YAChC,QAAQ,EAAE,KAAK;YACf,GAAG,aAAa;YAChB,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,WAAW,CAAC;SAC1B,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;GAGG;AAEI,MAAM,eAAe,GAAG,CAAC,IAAW,EAAE,SAA0B,EAAE,EAAE,0BAAiD,EAAe,EAAE;;IAC3I,IAAA,+BAAc,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACtC,IAAA,uDAA0B,EAAC,IAAI,EAAE,MAAA,MAAM,CAAC,aAAa,mCAAI,EAAE,CAAC,CAAC;IAE7D,MAAM,mBAAmB,GAAG,MAAA,0BAA0B,aAA1B,0BAA0B,cAA1B,0BAA0B,GAAI,MAAM,CAAC,aAAa,mCAAI,EAAE,CAAC;IAErF,MAAM,aAAa,GAAG,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;IAEzG,MAAM,gBAAgB,GAAG,MAAA,MAAM,CAAC,gBAAgB,mCAAI,CAAC,GAAG,EAAE;QACxD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IACH,MAAM,kBAAkB,GAAG,MAAA,MAAM,CAAC,kBAAkB,mCAAI,CAAC,GAAG,EAAE;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,MAAM;QACT,MAAM,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,MAAM,CAAC;QACvC,OAAO,EAAE,aAAa;QACtB,kBAAkB;QAClB,gBAAgB;QAChB,UAAU,EAAE,MAAA,MAAM,CAAC,UAAU,mCAAI,KAAK;QACtC,mBAAmB,EAAE,IAAA,+CAAyB,EAAC;YAC7C,aAAa;YACb,kBAAkB;YAClB,gBAAgB;YAChB,IAAI;YACJ,mBAAmB;SACpB,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,eAAe,mBA8B1B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/mapDataUsingRowHeights.d.ts b/node_modules/table/dist/src/mapDataUsingRowHeights.d.ts deleted file mode 100644 index 1508e905d..000000000 --- a/node_modules/table/dist/src/mapDataUsingRowHeights.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { VerticalAlignment } from './types/api'; -import type { BaseConfig, Row } from './types/internal'; -export declare const padCellVertically: (lines: string[], rowHeight: number, verticalAlignment: VerticalAlignment) => string[]; -export declare const mapDataUsingRowHeights: (unmappedRows: Row[], rowHeights: number[], config: BaseConfig) => Row[]; diff --git a/node_modules/table/dist/src/mapDataUsingRowHeights.js b/node_modules/table/dist/src/mapDataUsingRowHeights.js deleted file mode 100644 index c13003dc8..000000000 --- a/node_modules/table/dist/src/mapDataUsingRowHeights.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mapDataUsingRowHeights = exports.padCellVertically = void 0; -const utils_1 = require("./utils"); -const wrapCell_1 = require("./wrapCell"); -const createEmptyStrings = (length) => { - return new Array(length).fill(''); -}; -const padCellVertically = (lines, rowHeight, verticalAlignment) => { - const availableLines = rowHeight - lines.length; - if (verticalAlignment === 'top') { - return [...lines, ...createEmptyStrings(availableLines)]; - } - if (verticalAlignment === 'bottom') { - return [...createEmptyStrings(availableLines), ...lines]; - } - return [ - ...createEmptyStrings(Math.floor(availableLines / 2)), - ...lines, - ...createEmptyStrings(Math.ceil(availableLines / 2)), - ]; -}; -exports.padCellVertically = padCellVertically; -const mapDataUsingRowHeights = (unmappedRows, rowHeights, config) => { - const nColumns = unmappedRows[0].length; - const mappedRows = unmappedRows.map((unmappedRow, unmappedRowIndex) => { - const outputRowHeight = rowHeights[unmappedRowIndex]; - const outputRow = Array.from({ length: outputRowHeight }, () => { - return new Array(nColumns).fill(''); - }); - unmappedRow.forEach((cell, cellIndex) => { - var _a; - const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex, - row: unmappedRowIndex }); - if (containingRange) { - containingRange.extractCellContent(unmappedRowIndex).forEach((cellLine, cellLineIndex) => { - outputRow[cellLineIndex][cellIndex] = cellLine; - }); - return; - } - const cellLines = (0, wrapCell_1.wrapCell)(cell, config.columns[cellIndex].width, config.columns[cellIndex].wrapWord); - const paddedCellLines = (0, exports.padCellVertically)(cellLines, outputRowHeight, config.columns[cellIndex].verticalAlignment); - paddedCellLines.forEach((cellLine, cellLineIndex) => { - outputRow[cellLineIndex][cellIndex] = cellLine; - }); - }); - return outputRow; - }); - return (0, utils_1.flatten)(mappedRows); -}; -exports.mapDataUsingRowHeights = mapDataUsingRowHeights; -//# sourceMappingURL=mapDataUsingRowHeights.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/mapDataUsingRowHeights.js.map b/node_modules/table/dist/src/mapDataUsingRowHeights.js.map deleted file mode 100644 index 7bbe0f86c..000000000 --- a/node_modules/table/dist/src/mapDataUsingRowHeights.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapDataUsingRowHeights.js","sourceRoot":"","sources":["../../src/mapDataUsingRowHeights.ts"],"names":[],"mappings":";;;AAOA,mCAEiB;AACjB,yCAEoB;AAEpB,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC5C,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC;AAEK,MAAM,iBAAiB,GAAG,CAAC,KAAe,EAAE,SAAiB,EAAE,iBAAoC,EAAY,EAAE;IACtH,MAAM,cAAc,GAAG,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;IAEhD,IAAI,iBAAiB,KAAK,KAAK,EAAE;QAC/B,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC;KAC1D;IAED,IAAI,iBAAiB,KAAK,QAAQ,EAAE;QAClC,OAAO,CAAC,GAAG,kBAAkB,CAAC,cAAc,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC;KAC1D;IAED,OAAO;QACL,GAAG,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;QACrD,GAAG,KAAK;QACR,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;KACrD,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,iBAAiB,qBAgB5B;AAEK,MAAM,sBAAsB,GAAG,CAAC,YAAmB,EAAE,UAAoB,EAAE,MAAkB,EAAS,EAAE;IAC7G,MAAM,QA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AAC,aAAa,CAAC,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC;YACjD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,eAAO,EAAC,UAAU,CAAC,CAAC;AAC7B,CAAC,CAAC;AAhCW,QAAA,sBAAsB,0BAgCjC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/padTableData.d.ts b/node_modules/table/dist/src/padTableData.d.ts deleted file mode 100644 index 6bb73366c..000000000 --- a/node_modules/table/dist/src/padTableData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { BaseConfig, Row } from './types/internal'; -export declare const padString: (input: string, paddingLeft: number, paddingRight: number) => string; -export declare const padTableData: (rows: Row[], config: BaseConfig) => Row[]; diff --git a/node_modules/table/dist/src/padTableData.js b/node_modules/table/dist/src/padTableData.js deleted file mode 100644 index 38580f82c..000000000 --- a/node_modules/table/dist/src/padTableData.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.padTableData = exports.padString = void 0; -const padString = (input, paddingLeft, paddingRight) => { - return ' '.repeat(paddingLeft) + input + ' '.repeat(paddingRight); -}; -exports.padString = padString; -const padTableData = (rows, config) => { - return rows.map((cells, rowIndex) => { - return cells.map((cell, cellIndex) => { - var _a; - const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex, - row: rowIndex }, { mapped: true }); - if (containingRange) { - return cell; - } - const { paddingLeft, paddingRight } = config.columns[cellIndex]; - return (0, exports.padString)(cell, paddingLeft, paddingRight); - }); - }); -}; -exports.padTableData = padTableData; -//# sourceMappingURL=padTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/padTableData.js.map b/node_modules/table/dist/src/padTableData.js.map deleted file mode 100644 index 2cf9c94c1..000000000 --- a/node_modules/table/dist/src/padTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"padTableData.js","sourceRoot":"","sources":["../../src/padTableData.ts"],"names":[],"mappings":";;;AAKO,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,WAAmB,EAAE,YAAoB,EAAU,EAAE;IAC5F,OAAO,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACpE,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,MAAM,YAAY,GAAG,CAAC,IAAW,EAAE,MAAkB,EAAS,EAAE;IACrE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAClC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;;YACnC,MAAM,eAAe,GAAG,MAAA,MAAM,CAAC,mBAAmB,0CAAE,kBAAkB,CAAC,EAAC,GAAG,EAAE,SAAS;gBACpF,GAAG,EAAE,QAAQ,EAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;YAClC,IAAI,eAAe,EAAE;gBACnB,OAAO,IAAI,CAAC;aACb;YAED,MAAM,EAAC,WAAW,EAAE,YAAY,EAAC,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAE9D,OAAO,IAAA,iBAAS,EAAC,IAAI,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAdW,QAAA,YAAY,gBAcvB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/schemas/config.json b/node_modules/table/dist/src/schemas/config.json deleted file mode 100644 index cccb5ac1b..000000000 --- a/node_modules/table/dist/src/schemas/config.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "$id": "config.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "shared.json#/definitions/borders" - }, - "header": { - "type": "object", - "properties": { - "content": { - "type": "string" - }, - "alignment": { - "$ref": "shared.json#/definitions/alignment" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "integer" - }, - "paddingLeft": { - "type": "integer" - }, - "paddingRight": { - "type": "integer" - } - }, - "required": ["content"], - "additionalProperties": false - }, - "columns": { - "$ref": "shared.json#/definitions/columns" - }, - "columnDefault": { - "$ref": "shared.json#/definitions/column" - }, - "drawVerticalLine": { - "typeof": "function" - }, - "drawHorizontalLine": { - "typeof": "function" - }, - "singleLine": { - "typeof": "boolean" - }, - "spanningCells": { - "type": "array", - "items": { - "type": "object", - "properties": { - "col": { - "type": "integer", - "minimum": 0 - }, - "row": { - "type": "integer", - "minimum": 0 - }, - "colSpan": { - "type": "integer", - "minimum": 1 - }, - "rowSpan": { - "type": "integer", - "minimum": 1 - }, - "alignment": { - "$ref": "shared.json#/definitions/alignment" - }, - "verticalAlignment": { - "$ref": "shared.json#/definitions/verticalAlignment" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "integer" - }, - "paddingLeft": { - "type": "integer" - }, - "paddingRight": { - "type": "integer" - } - }, - "required": ["row", "col"], - "additionalProperties": false - } - } - }, - "additionalProperties": false -} diff --git a/node_modules/table/dist/src/schemas/shared.json b/node_modules/table/dist/src/schemas/shared.json deleted file mode 100644 index 52a2d3a64..000000000 --- a/node_modules/table/dist/src/schemas/shared.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "$id": "shared.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "columns": { - "oneOf": [ - { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/column" - } - } - ] - }, - "column": { - "type": "object", - "properties": { - "alignment": { - "$ref": "#/definitions/alignment" - }, - "verticalAlignment": { - "$ref": "#/definitions/verticalAlignment" - }, - "width": { - "type": "integer", - "minimum": 1 - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "integer" - }, - "paddingLeft": { - "type": "integer" - }, - "paddingRight": { - "type": "integer" - } - }, - "additionalProperties": false - }, - "borders": { - "type": "object", - "properties": { - "topBody": { - "$ref": "#/definitions/border" - }, - "topJoin": { - "$ref": "#/definitions/border" - }, - "topLeft": { - "$ref": "#/definitions/border" - }, - "topRight": { - "$ref": "#/definitions/border" - }, - "bottomBody": { - "$ref": "#/definitions/border" - }, - "bottomJoin": { - "$ref": "#/definitions/border" - }, - "bottomLeft": { - "$ref": "#/definitions/border" - }, - "bottomRight": { - "$ref": "#/definitions/border" - }, - "bodyLeft": { - "$ref": "#/definitions/border" - }, - "bodyRight": { - "$ref": "#/definitions/border" - }, - "bodyJoin": { - "$ref": "#/definitions/border" - }, - "headerJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - }, - "joinMiddleUp": { - "$ref": "#/definitions/border" - }, - "joinMiddleDown": { - "$ref": "#/definitions/border" - }, - "joinMiddleLeft": { - "$ref": "#/definitions/border" - }, - "joinMiddleRight": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false - }, - "border": { - "type": "string" - }, - "alignment": { - "type": "string", - "enum": [ - "left", - "right", - "center", - "justify" - ] - }, - "verticalAlignment": { - "type": "string", - "enum": [ - "top", - "middle", - "bottom" - ] - } - } -} diff --git a/node_modules/table/dist/src/schemas/streamConfig.json b/node_modules/table/dist/src/schemas/streamConfig.json deleted file mode 100644 index 94d351401..000000000 --- a/node_modules/table/dist/src/schemas/streamConfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$id": "streamConfig.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "shared.json#/definitions/borders" - }, - "columns": { - "$ref": "shared.json#/definitions/columns" - }, - "columnDefault": { - "$ref": "shared.json#/definitions/column" - }, - "columnCount": { - "type": "integer", - "minimum": 1 - }, - "drawVerticalLine": { - "typeof": "function" - } - }, - "required": ["columnDefault", "columnCount"], - "additionalProperties": false -} diff --git a/node_modules/table/dist/src/spanningCellManager.d.ts b/node_modules/table/dist/src/spanningCellManager.d.ts deleted file mode 100644 index a865f6a01..000000000 --- a/node_modules/table/dist/src/spanningCellManager.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { DrawHorizontalLine, DrawVerticalLine, SpanningCellConfig } from './types/api'; -import type { CellCoordinates, ColumnConfig, ResolvedRangeConfig, Row } from './types/internal'; -export declare type SpanningCellManager = { - getContainingRange: (cell: CellCoordinates, options?: { - mapped: true; - }) => ResolvedRangeConfig | undefined; - inSameRange: (cell1: CellCoordinates, cell2: CellCoordinates) => boolean; - rowHeights: number[]; - setRowHeights: (rowHeights: number[]) => void; -}; -export declare type SpanningCellParameters = { - spanningCellConfigs: SpanningCellConfig[]; - rows: Row[]; - columnsConfig: ColumnConfig[]; - drawVerticalLine: DrawVerticalLine; - drawHorizontalLine: DrawHorizontalLine; -}; -export declare type SpanningCellContext = SpanningCellParameters & { - rowHeights: number[]; -}; -export declare const createSpanningCellManager: (parameters: SpanningCellParameters) => SpanningCellManager; diff --git a/node_modules/table/dist/src/spanningCellManager.js b/node_modules/table/dist/src/spanningCellManager.js deleted file mode 100644 index d74345dd8..000000000 --- a/node_modules/table/dist/src/spanningCellManager.js +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createSpanningCellManager = void 0; -const alignSpanningCell_1 = require("./alignSpanningCell"); -const calculateSpanningCellWidth_1 = require("./calculateSpanningCellWidth"); -const makeRangeConfig_1 = require("./makeRangeConfig"); -const utils_1 = require("./utils"); -const findRangeConfig = (cell, rangeConfigs) => { - return rangeConfigs.find((rangeCoordinate) => { - return (0, utils_1.isCellInRange)(cell, rangeCoordinate); - }); -}; -const getContainingRange = (rangeConfig, context) => { - const width = (0, calculateSpanningCellWidth_1.calculateSpanningCellWidth)(rangeConfig, context); - const wrappedContent = (0, alignSpanningCell_1.wrapRangeContent)(rangeConfig, width, context); - const alignedContent = (0, alignSpanningCell_1.alignVerticalRangeContent)(rangeConfig, wrappedContent, context); - const getCellContent = (rowIndex) => { - const { topLeft } = rangeConfig; - const { drawHorizontalLine, rowHeights } = context; - const totalWithinHorizontalBorderHeight = rowIndex - topLeft.row; - const totalHiddenHorizontalBorderHeight = (0, utils_1.sequence)(topLeft.row + 1, rowIndex).filter((index) => { - /* istanbul ignore next */ - return !(drawHorizontalLine === null || drawHorizontalLine === void 0 ? void 0 : drawHorizontalLine(index, rowHeights.length)); - }).length; - const offset = (0, utils_1.sumArray)(rowHeights.slice(topLeft.row, rowIndex)) + totalWithinHorizontalBorderHeight - totalHiddenHorizontalBorderHeight; - return alignedContent.slice(offset, offset + rowHeights[rowIndex]); - }; - const getBorderContent = (borderIndex) => { - const { topLeft } = rangeConfig; - const offset = (0, utils_1.sumArray)(context.rowHeights.slice(topLeft.row, borderIndex)) + (borderIndex - topLeft.row - 1); - return alignedContent[offset]; - }; - return { - ...rangeConfig, - extractBorderContent: getBorderContent, - extractCellContent: getCellContent, - height: wrappedContent.length, - width, - }; -}; -const inSameRange = (cell1, cell2, ranges) => { - const range1 = findRangeConfig(cell1, ranges); - const range2 = findRangeConfig(cell2, ranges); - if (range1 && range2) { - return (0, utils_1.areCellEqual)(range1.topLeft, range2.topLeft); - } - return false; -}; -const hashRange = (range) => { - const { row, col } = range.topLeft; - return `${row}/${col}`; -}; -const createSpanningCellManager = (parameters) => { - const { spanningCellConfigs, columnsConfig } = parameters; - const ranges = spanningCellConfigs.map((config) => { - return (0, makeRangeConfig_1.makeRangeConfig)(config, columnsConfig); - }); - const rangeCache = {}; - let rowHeights = []; - return { getContainingRange: (cell, options) => { - var _a; - const originalRow = (options === null || options === void 0 ? void 0 : options.mapped) ? (0, utils_1.findOriginalRowIndex)(rowHeights, cell.row) : cell.row; - const range = findRangeConfig({ ...cell, - row: originalRow }, ranges); - if (!range) { - return undefined; - } - if (rowHeights.length === 0) { - return getContainingRange(range, { ...parameters, - rowHeights }); - } - const hash = hashRange(range); - (_a = rangeCache[hash]) !== null && _a !== void 0 ? _a : (rangeCache[hash] = getContainingRange(range, { ...parameters, - rowHeights })); - return rangeCache[hash]; - }, - inSameRange: (cell1, cell2) => { - return inSameRange(cell1, cell2, ranges); - }, - rowHeights, - setRowHeights: (_rowHeights) => { - rowHeights = _rowHeights; - } }; -}; -exports.createSpanningCellManager = createSpanningCellManager; -//# sourceMappingURL=spanningCellManager.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/spanningCellManager.js.map b/node_modules/table/dist/src/spanningCellManager.js.map deleted file mode 100644 index 4c58a5da6..000000000 --- a/node_modules/table/dist/src/spanningCellManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"spanningCellManager.js","sourceRoot":"","sources":["../../src/spanningCellManager.ts"],"names":[],"mappings":";;;AAAA,2DAE6B;AAC7B,6EAEsC;AACtC,uDAE2B;AAa3B,mCAIiB;AAqBjB,MAAM,eAAe,GAAG,CAAC,IAAqB,EAAE,YAA2B,EAA2B,EAAE;IACtG,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;QAC3C,OAAO,IAAA,qBAAa,EAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,WAAwB,EAAE,OAA4B,EAAmC,EAAE;IACrH,MAAM,KAAK,GAAG,IAAA,uDAA0B,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAE/D,MAAM,cAAc,GAAG,IAAA,oCAAgB,EAAC,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAErE,MAAM,cAAc,GAAG,IAAA,6CAAyB,EAAC,WAAW,EAAE,c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,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;YAE5F,MAAM,KAAK,GAAG,eAAe,CAAC,EAAC,GAAG,IAAI;gBACpC,GAAG,EAAE,WAAW,EAAC,EAAE,MAAM,CAAC,CAAC;YAC7B,IAAI,CAAC,KAAK,EAAE;gBACV,OAAO,SAAS,CAAC;aAClB;YAED,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC3B,OAAO,kBAAkB,CAAC,KAAK,EAAE,EAAC,GAAG,UAAU;oBAC7C,UAAU,EAAC,CAAC,CAAC;aAChB;YAED,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;YAC9B,MAAA,UAAU,CAAC,IAAI,qCAAf,UAAU,CAAC,IAAI,IAAM,kBAAkB,CAAC,KAAK,EAAE,EAAC,GAAG,UAAU;gBAC3D,UAAU,EAAC,CAAC,EAAC;YAEf,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QACD,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC5B,OAAO,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;QACD,UAAU;QACV,aAAa,EAAE,CAAC,WAAqB,EAAE,EAAE;YACvC,UAAU,GAAG,WAAW,CAAC;QAC3B,CAAC,EAAC,CAAC;AACL,CAAC,CAAC;AArCW,QAAA,yBAAyB,6BAqCpC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/stringifyTableData.d.ts b/node_modules/table/dist/src/stringifyTableData.d.ts deleted file mode 100644 index 5c1270bec..000000000 --- a/node_modules/table/dist/src/stringifyTableData.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Row } from './types/internal'; -export declare const stringifyTableData: (rows: unknown[][]) => Row[]; diff --git a/node_modules/table/dist/src/stringifyTableData.js b/node_modules/table/dist/src/stringifyTableData.js deleted file mode 100644 index 177141ace..000000000 --- a/node_modules/table/dist/src/stringifyTableData.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.stringifyTableData = void 0; -const utils_1 = require("./utils"); -const stringifyTableData = (rows) => { - return rows.map((cells) => { - return cells.map((cell) => { - return (0, utils_1.normalizeString)(String(cell)); - }); - }); -}; -exports.stringifyTableData = stringifyTableData; -//# sourceMappingURL=stringifyTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/stringifyTableData.js.map b/node_modules/table/dist/src/stringifyTableData.js.map deleted file mode 100644 index 84a4b1257..000000000 --- a/node_modules/table/dist/src/stringifyTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stringifyTableData.js","sourceRoot":"","sources":["../../src/stringifyTableData.ts"],"names":[],"mappings":";;;AAGA,mCAEiB;AAEV,MAAM,kBAAkB,GAAG,CAAC,IAAiB,EAAS,EAAE;IAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACxB,OAAO,IAAA,uBAAe,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/table.d.ts b/node_modules/table/dist/src/table.d.ts deleted file mode 100644 index db1b39707..000000000 --- a/node_modules/table/dist/src/table.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TableUserConfig } from './types/api'; -export declare const table: (data: unknown[][], userConfig?: TableUserConfig) => string; diff --git a/node_modules/table/dist/src/table.js b/node_modules/table/dist/src/table.js deleted file mode 100644 index 0a8622728..000000000 --- a/node_modules/table/dist/src/table.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.table = void 0; -const alignTableData_1 = require("./alignTableData"); -const calculateOutputColumnWidths_1 = require("./calculateOutputColumnWidths"); -const calculateRowHeights_1 = require("./calculateRowHeights"); -const drawTable_1 = require("./drawTable"); -const injectHeaderConfig_1 = require("./injectHeaderConfig"); -const makeTableConfig_1 = require("./makeTableConfig"); -const mapDataUsingRowHeights_1 = require("./mapDataUsingRowHeights"); -const padTableData_1 = require("./padTableData"); -const stringifyTableData_1 = require("./stringifyTableData"); -const truncateTableData_1 = require("./truncateTableData"); -const utils_1 = require("./utils"); -const validateTableData_1 = require("./validateTableData"); -const table = (data, userConfig = {}) => { - (0, validateTableData_1.validateTableData)(data); - let rows = (0, stringifyTableData_1.stringifyTableData)(data); - const [injectedRows, injectedSpanningCellConfig] = (0, injectHeaderConfig_1.injectHeaderConfig)(rows, userConfig); - const config = (0, makeTableConfig_1.makeTableConfig)(injectedRows, userConfig, injectedSpanningCellConfig); - rows = (0, truncateTableData_1.truncateTableData)(injectedRows, (0, utils_1.extractTruncates)(config)); - const rowHeights = (0, calculateRowHeights_1.calculateRowHeights)(rows, config); - config.spanningCellManager.setRowHeights(rowHeights); - rows = (0, mapDataUsingRowHeights_1.mapDataUsingRowHeights)(rows, rowHeights, config); - rows = (0, alignTableData_1.alignTableData)(rows, config); - rows = (0, padTableData_1.padTableData)(rows, config); - const outputColumnWidths = (0, calculateOutputColumnWidths_1.calculateOutputColumnWidths)(config); - return (0, drawTable_1.drawTable)(rows, outputColumnWidths, rowHeights, config); -}; -exports.table = table; -//# sourceMappingURL=table.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/table.js.map b/node_modules/table/dist/src/table.js.map deleted file mode 100644 index bb03676b8..000000000 --- a/node_modules/table/dist/src/table.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/table.ts"],"names":[],"mappings":";;;AAAA,qDAE0B;AAC1B,+EAEuC;AACvC,+DAE+B;AAC/B,2CAEqB;AACrB,6DAE8B;AAC9B,uDAE2B;AAC3B,qEAEkC;AAClC,iDAEwB;AACxB,6DAE8B;AAC9B,2DAE6B;AAI7B,mCAEiB;AACjB,2DAE6B;AAEtB,MAAM,KAAK,GAAG,CAAC,IAAiB,EAAE,aAA8B,EAAE,EAAU,EAAE;IACnF,IAAA,qCAAiB,EAAC,IAAI,CAAC,CAAC;IAExB,IAAI,IAAI,GAAG,IAAA,uCAAkB,EAAC,IAAI,CAAC,CAAC;IAEpC,MAAM,CAAC,YAAY,EAAE,0BAA0B,CAAC,GAAG,IAAA,uCAAkB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAExF,MAAM,MAAM,GAAG,IAAA,iCAAe,EAAC,YAAY,EAAE,UAAU,EAAE,0BAA0B,CAAC,CAAC;IAErF,IAAI,GAAG,IAAA,qCAAiB,EAAC,YAAY,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC,CAAC;IAEjE,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAErD,MAAM,CAAC,mBAAmB,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAErD,IAAI,GAAG,IAAA,+CAAsB,EAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,GAAG,IAAA,2BAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAElC,MAAM,kBAAkB,GAAG,IAAA,yDAA2B,EAAC,MAAM,CAAC,CAAC;IAE/D,OAAO,IAAA,qBAAS,EAAC,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC;AAtBW,QAAA,KAAK,SAsBhB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/truncateTableData.d.ts b/node_modules/table/dist/src/truncateTableData.d.ts deleted file mode 100644 index e88e1ad57..000000000 --- a/node_modules/table/dist/src/truncateTableData.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Row } from './types/internal'; -export declare const truncateString: (input: string, length: number) => string; -/** - * @todo Make it work with ASCII content. - */ -export declare const truncateTableData: (rows: Row[], truncates: number[]) => Row[]; diff --git a/node_modules/table/dist/src/truncateTableData.js b/node_modules/table/dist/src/truncateTableData.js deleted file mode 100644 index 1f7980fd5..000000000 --- a/node_modules/table/dist/src/truncateTableData.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.truncateTableData = exports.truncateString = void 0; -const lodash_truncate_1 = __importDefault(require("lodash.truncate")); -const truncateString = (input, length) => { - return (0, lodash_truncate_1.default)(input, { length, - omission: '…' }); -}; -exports.truncateString = truncateString; -/** - * @todo Make it work with ASCII content. - */ -const truncateTableData = (rows, truncates) => { - return rows.map((cells) => { - return cells.map((cell, cellIndex) => { - return (0, exports.truncateString)(cell, truncates[cellIndex]); - }); - }); -}; -exports.truncateTableData = truncateTableData; -//# sourceMappingURL=truncateTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/truncateTableData.js.map b/node_modules/table/dist/src/truncateTableData.js.map deleted file mode 100644 index 921869f68..000000000 --- a/node_modules/table/dist/src/truncateTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"truncateTableData.js","sourceRoot":"","sources":["../../src/truncateTableData.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAuC;AAKhC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,MAAc,EAAU,EAAE;IACtE,OAAO,IAAA,yBAAQ,EAAC,KAAK,EAAE,EAAC,MAAM;QAC5B,QAAQ,EAAE,GAAG,EAAC,CAAC,CAAC;AACpB,CAAC,CAAC;AAHW,QAAA,cAAc,kBAGzB;AAEF;;GAEG;AACI,MAAM,iBAAiB,GAAG,CAAC,IAAW,EAAE,SAAmB,EAAS,EAAE;IAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;YACnC,OAAO,IAAA,sBAAc,EAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AANW,QAAA,iBAAiB,qBAM5B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/types/api.d.ts b/node_modules/table/dist/src/types/api.d.ts deleted file mode 100644 index f76c51e05..000000000 --- a/node_modules/table/dist/src/types/api.d.ts +++ /dev/null @@ -1,130 +0,0 @@ -export declare type DrawLinePredicate = (index: number, size: number) => boolean; -export declare type DrawVerticalLine = DrawLinePredicate; -export declare type DrawHorizontalLine = DrawLinePredicate; -export declare type BorderUserConfig = { - readonly topLeft?: string; - readonly topRight?: string; - readonly topBody?: string; - readonly topJoin?: string; - readonly bottomLeft?: string; - readonly bottomRight?: string; - readonly bottomBody?: string; - readonly bottomJoin?: string; - readonly joinLeft?: string; - readonly joinRight?: string; - readonly joinBody?: string; - readonly joinJoin?: string; - readonly joinMiddleUp?: string; - readonly joinMiddleDown?: string; - readonly joinMiddleLeft?: string; - readonly joinMiddleRight?: string; - readonly headerJoin?: string; - readonly bodyRight?: string; - readonly bodyLeft?: string; - readonly bodyJoin?: string; -}; -export declare type BorderConfig = Required; -export declare type Alignment = 'center' | 'justify' | 'left' | 'right'; -export declare type VerticalAlignment = 'bottom' | 'middle' | 'top'; -export declare type CellUserConfig = { - /** - * Cell content horizontal alignment (default: left) - */ - readonly alignment?: Alignment; - /** - * Cell content vertical alignment (default: top) - */ - readonly verticalAlignment?: VerticalAlignment; - /** - * Number of characters are which the content will be truncated (default: Infinity) - */ - readonly truncate?: number; - /** - * Cell content padding width left (default: 1) - */ - readonly paddingLeft?: number; - /** - * Cell content padding width right (default: 1) - */ - readonly paddingRight?: number; - /** - * If true, the text is broken at the nearest space or one of the special characters: "\|/_.,;-" - */ - readonly wrapWord?: boolean; -}; -export declare type ColumnUserConfig = CellUserConfig & { - /** - * Column width (default: auto calculation based on the cell content) - */ - readonly width?: number; -}; -/** - * @deprecated Use spanning cell API instead - */ -export declare type HeaderUserConfig = Omit & { - readonly content: string; -}; -export declare type BaseUserConfig = { - /** - * Custom border - */ - readonly border?: BorderUserConfig; - /** - * Default values for all columns. Column specific settings overwrite the default values. - */ - readonly columnDefault?: ColumnUserConfig; - /** - * Column specific configuration. - */ - readonly columns?: Indexable; - /** - * Used to tell whether to draw a vertical line. - * This callback is called for each non-content line of the table. - * The default behavior is to always return true. - */ - readonly drawVerticalLine?: DrawVerticalLine; -}; -export declare type TableUserConfig = BaseUserConfig & { - /** - * The header configuration - */ - readonly header?: HeaderUserConfig; - /** - * Used to tell whether to draw a horizontal line. - * This callback is called for each non-content line of the table. - * The default behavior is to always return true. - */ - readonly drawHorizontalLine?: DrawHorizontalLine; - /** - * Horizontal lines inside the table are not drawn. - */ - readonly singleLine?: boolean; - readonly spanningCells?: SpanningCellConfig[]; -}; -export declare type SpanningCellConfig = CellUserConfig & { - readonly row: number; - readonly col: number; - readonly rowSpan?: number; - readonly colSpan?: number; -}; -export declare type StreamUserConfig = BaseUserConfig & { - /** - * The number of columns - */ - readonly columnCount: number; - /** - * Default values for all columns. Column specific settings overwrite the default values. - */ - readonly columnDefault: ColumnUserConfig & { - /** - * The default width for each column - */ - readonly width: number; - }; -}; -export declare type WritableStream = { - readonly write: (rows: string[]) => void; -}; -export declare type Indexable = { - readonly [index: number]: T; -}; diff --git a/node_modules/table/dist/src/types/api.js b/node_modules/table/dist/src/types/api.js deleted file mode 100644 index 57bf49a1d..000000000 --- a/node_modules/table/dist/src/types/api.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=api.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/types/api.js.map b/node_modules/table/dist/src/types/api.js.map deleted file mode 100644 index f396fdb60..000000000 --- a/node_modules/table/dist/src/types/api.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/types/api.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/table/dist/src/types/internal.d.ts b/node_modules/table/dist/src/types/internal.d.ts deleted file mode 100644 index cb0ff5c3b..000000000 --- a/node_modules/table/dist/src/types/internal.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/table/dist/src/types/internal.js b/node_modules/table/dist/src/types/internal.js deleted file mode 100644 index f8a3d3e79..000000000 --- a/node_modules/table/dist/src/types/internal.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=internal.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/types/internal.js.map b/node_modules/table/dist/src/types/internal.js.map deleted file mode 100644 index b612aad96..000000000 --- a/node_modules/table/dist/src/types/internal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/types/internal.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/table/dist/src/utils.d.ts b/node_modules/table/dist/src/utils.d.ts deleted file mode 100644 index a165ace57..000000000 --- a/node_modules/table/dist/src/utils.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { SpanningCellConfig } from './types/api'; -import type { BaseConfig, CellCoordinates, RangeCoordinate } from './types/internal'; -export declare const sequence: (start: number, end: number) => number[]; -export declare const sumArray: (array: number[]) => number; -export declare const extractTruncates: (config: BaseConfig) => number[]; -export declare const flatten: (array: T[][]) => T[]; -export declare const findOriginalRowIndex: (mappedRowHeights: number[], mappedRowIndex: number) => number; -export declare const calculateRangeCoordinate: (spanningCellConfig: SpanningCellConfig) => RangeCoordinate; -export declare const areCellEqual: (cell1: CellCoordinates, cell2: CellCoordinates) => boolean; -export declare const isCellInRange: (cell: CellCoordinates, { topLeft, bottomRight }: RangeCoordinate) => boolean; diff --git a/node_modules/table/dist/src/utils.js b/node_modules/table/dist/src/utils.js deleted file mode 100644 index f2f25b03b..000000000 --- a/node_modules/table/dist/src/utils.js +++ /dev/null @@ -1,143 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isCellInRange = exports.areCellEqual = exports.calculateRangeCoordinate = exports.findOriginalRowIndex = exports.flatten = exports.extractTruncates = exports.sumArray = exports.sequence = exports.distributeUnevenly = exports.countSpaceSequence = exports.groupBySizes = exports.makeBorderConfig = exports.splitAnsi = exports.normalizeString = void 0; -const slice_ansi_1 = __importDefault(require("slice-ansi")); -const string_width_1 = __importDefault(require("string-width")); -const strip_ansi_1 = __importDefault(require("strip-ansi")); -const getBorderCharacters_1 = require("./getBorderCharacters"); -/** - * Converts Windows-style newline to Unix-style - * - * @internal - */ -const normalizeString = (input) => { - return input.replace(/\r\n/g, '\n'); -}; -exports.normalizeString = normalizeString; -/** - * Splits ansi string by newlines - * - * @internal - */ -const splitAnsi = (input) => { - const lengths = (0, strip_ansi_1.default)(input).split('\n').map(string_width_1.default); - const result = []; - let startIndex = 0; - lengths.forEach((length) => { - result.push(length === 0 ? '' : (0, slice_ansi_1.default)(input, startIndex, startIndex + length)); - // Plus 1 for the newline character itself - startIndex += length + 1; - }); - return result; -}; -exports.splitAnsi = splitAnsi; -/** - * Merges user provided border characters with the default border ("honeywell") characters. - * - * @internal - */ -const makeBorderConfig = (border) => { - return { - ...(0, getBorderCharacters_1.getBorderCharacters)('honeywell'), - ...border, - }; -}; -exports.makeBorderConfig = makeBorderConfig; -/** - * Groups the array into sub-arrays by sizes. - * - * @internal - * @example - * groupBySizes(['a', 'b', 'c', 'd', 'e'], [2, 1, 2]) = [ ['a', 'b'], ['c'], ['d', 'e'] ] - */ -const groupBySizes = (array, sizes) => { - let startIndex = 0; - return sizes.map((size) => { - const group = array.slice(startIndex, startIndex + size); - startIndex += size; - return group; - }); -}; -exports.groupBySizes = groupBySizes; -/** - * Counts the number of continuous spaces in a string - * - * @internal - * @example - * countGroupSpaces('a bc de f') = 3 - */ -const countSpaceSequence = (input) => { - var _a, _b; - return (_b = (_a = input.match(/\s+/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; -}; -exports.countSpaceSequence = countSpaceSequence; -/** - * Creates the non-increasing number array given sum and length - * whose the difference between maximum and minimum is not greater than 1 - * - * @internal - * @example - * distributeUnevenly(6, 3) = [2, 2, 2] - * distributeUnevenly(8, 3) = [3, 3, 2] - */ -const distributeUnevenly = (sum, length) => { - const result = Array.from({ length }).fill(Math.floor(sum / length)); - return result.map((element, index) => { - return element + (index < sum % length ? 1 : 0); - }); -}; -exports.distributeUnevenly = distributeUnevenly; -const sequence = (start, end) => { - return Array.from({ length: end - start + 1 }, (_, index) => { - return index + start; - }); -}; -exports.sequence = sequence; -const sumArray = (array) => { - return array.reduce((accumulator, element) => { - return accumulator + element; - }, 0); -}; -exports.sumArray = sumArray; -const extractTruncates = (config) => { - return config.columns.map(({ truncate }) => { - return truncate; - }); -}; -exports.extractTruncates = extractTruncates; -const flatten = (array) => { - return [].concat(...array); -}; -exports.flatten = flatten; -const findOriginalRowIndex = (mappedRowHeights, mappedRowIndex) => { - const rowIndexMapping = (0, exports.flatten)(mappedRowHeights.map((height, index) => { - return Array.from({ length: height }, () => { - return index; - }); - })); - return rowIndexMapping[mappedRowIndex]; -}; -exports.findOriginalRowIndex = findOriginalRowIndex; -const calculateRangeCoordinate = (spanningCellConfig) => { - const { row, col, colSpan = 1, rowSpan = 1 } = spanningCellConfig; - return { bottomRight: { col: col + colSpan - 1, - row: row + rowSpan - 1 }, - topLeft: { col, - row } }; -}; -exports.calculateRangeCoordinate = calculateRangeCoordinate; -const areCellEqual = (cell1, cell2) => { - return cell1.row === cell2.row && cell1.col === cell2.col; -}; -exports.areCellEqual = areCellEqual; -const isCellInRange = (cell, { topLeft, bottomRight }) => { - return (topLeft.row <= cell.row && - cell.row <= bottomRight.row && - topLeft.col <= cell.col && - cell.col <= bottomRight.col); -}; -exports.isCellInRange = isCellInRange; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/utils.js.map b/node_modules/table/dist/src/utils.js.map deleted file mode 100644 index dee117356..000000000 --- a/node_modules/table/dist/src/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAC/B,gEAAuC;AACvC,4DAAmC;AACnC,+DAE+B;AAY/B;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAAC,KAAa,EAAU,EAAE;IACvD,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B;AAEF;;;;GAIG;AACI,MAAM,SAAS,GAAG,CAAC,KAAa,EAAY,EAAE;IACnD,MAAM,OAAO,GAAG,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,sBAAW,CAAC,CAAC;IAE9D,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,UAAU,GAAG,CAAC,CAAC;IAEnB,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACzB,MAAM,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAA,oBAAK,EAAC,KAAK,EAAE,UAAU,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC;QAE/E,0CAA0C;QAC1C,UAAU,IAAI,MAAM,GAAG,CAAC,CAAC;IAC3B,CAAC,CA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--git a/node_modules/table/dist/src/validateConfig.d.ts b/node_modules/table/dist/src/validateConfig.d.ts deleted file mode 100644 index e050cad84..000000000 --- a/node_modules/table/dist/src/validateConfig.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TableUserConfig } from './types/api'; -export declare const validateConfig: (schemaId: 'config.json' | 'streamConfig.json', config: TableUserConfig) => void; diff --git a/node_modules/table/dist/src/validateConfig.js b/node_modules/table/dist/src/validateConfig.js deleted file mode 100644 index 2df152ea8..000000000 --- a/node_modules/table/dist/src/validateConfig.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateConfig = void 0; -const validators_1 = __importDefault(require("./generated/validators")); -const validateConfig = (schemaId, config) => { - const validate = validators_1.default[schemaId]; - if (!validate(config) && validate.errors) { - // eslint-disable-next-line promise/prefer-await-to-callbacks - const errors = validate.errors.map((error) => { - return { - message: error.message, - params: error.params, - schemaPath: error.schemaPath, - }; - }); - /* eslint-disable no-console */ - console.log('config', config); - console.log('errors', errors); - /* eslint-enable no-console */ - throw new Error('Invalid config.'); - } -}; -exports.validateConfig = validateConfig; -//# sourceMappingURL=validateConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/validateConfig.js.map b/node_modules/table/dist/src/validateConfig.js.map deleted file mode 100644 index db240b390..000000000 --- a/node_modules/table/dist/src/validateConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validateConfig.js","sourceRoot":"","sources":["../../src/validateConfig.ts"],"names":[],"mappings":";;;;;;AAIA,wEAAgD;AAKzC,MAAM,cAAc,GAAG,CAAC,QAA6C,EAAE,MAAuB,EAAQ,EAAE;IAC7G,MAAM,QAAQ,GAAG,oBAAU,CAAC,QAAQ,CAAqB,CAAC;IAC1D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,EAAE;QACxC,6DAA6D;QAC7D,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAkB,EAAE,EAAE;YACxD,OAAO;gBACL,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,+BAA+B;QAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9B,8BAA8B;QAE9B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACpC;AACH,CAAC,CAAC;AAnBW,QAAA,cAAc,kBAmBzB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/validateSpanningCellConfig.d.ts b/node_modules/table/dist/src/validateSpanningCellConfig.d.ts deleted file mode 100644 index d04bd3429..000000000 --- a/node_modules/table/dist/src/validateSpanningCellConfig.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SpanningCellConfig } from './types/api'; -import type { Row } from './types/internal'; -export declare const validateSpanningCellConfig: (rows: Row[], configs: SpanningCellConfig[]) => void; diff --git a/node_modules/table/dist/src/validateSpanningCellConfig.js b/node_modules/table/dist/src/validateSpanningCellConfig.js deleted file mode 100644 index e2859ad24..000000000 --- a/node_modules/table/dist/src/validateSpanningCellConfig.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateSpanningCellConfig = void 0; -const utils_1 = require("./utils"); -const inRange = (start, end, value) => { - return start <= value && value <= end; -}; -const validateSpanningCellConfig = (rows, configs) => { - const [nRow, nCol] = [rows.length, rows[0].length]; - configs.forEach((config, configIndex) => { - const { colSpan, rowSpan } = config; - if (colSpan === undefined && rowSpan === undefined) { - throw new Error(`Expect at least colSpan or rowSpan is provided in config.spanningCells[${configIndex}]`); - } - if (colSpan !== undefined && colSpan < 1) { - throw new Error(`Expect colSpan is not equal zero, instead got: ${colSpan} in config.spanningCells[${configIndex}]`); - } - if (rowSpan !== undefined && rowSpan < 1) { - throw new Error(`Expect rowSpan is not equal zero, instead got: ${rowSpan} in config.spanningCells[${configIndex}]`); - } - }); - const rangeCoordinates = configs.map(utils_1.calculateRangeCoordinate); - rangeCoordinates.forEach(({ topLeft, bottomRight }, rangeIndex) => { - if (!inRange(0, nCol - 1, topLeft.col) || - !inRange(0, nRow - 1, topLeft.row) || - !inRange(0, nCol - 1, bottomRight.col) || - !inRange(0, nRow - 1, bottomRight.row)) { - throw new Error(`Some cells in config.spanningCells[${rangeIndex}] are out of the table`); - } - }); - const configOccupy = Array.from({ length: nRow }, () => { - return Array.from({ length: nCol }); - }); - rangeCoordinates.forEach(({ topLeft, bottomRight }, rangeIndex) => { - (0, utils_1.sequence)(topLeft.row, bottomRight.row).forEach((row) => { - (0, utils_1.sequence)(topLeft.col, bottomRight.col).forEach((col) => { - if (configOccupy[row][col] !== undefined) { - throw new Error(`Spanning cells in config.spanningCells[${configOccupy[row][col]}] and config.spanningCells[${rangeIndex}] are overlap each other`); - } - configOccupy[row][col] = rangeIndex; - }); - }); - }); -}; -exports.validateSpanningCellConfig = validateSpanningCellConfig; -//# sourceMappingURL=validateSpanningCellConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/validateSpanningCellConfig.js.map b/node_modules/table/dist/src/validateSpanningCellConfig.js.map deleted file mode 100644 index d5097be45..000000000 --- a/node_modules/table/dist/src/validateSpanningCellConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validateSpanningCellConfig.js","sourceRoot":"","sources":["../../src/validateSpanningCellConfig.ts"],"names":[],"mappings":";;;AAMA,mCAGiB;AAEjB,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,KAAa,EAAE,EAAE;IAC5D,OAAO,K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C,GAAG,CAAC;YACxC,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE;YACtC,MAAM,IAAI,KAAK,CAAC,sCAAsC,UAAU,wBAAwB,CAAC,CAAC;SAC3F;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,EAAE,GAAG,EAAE;QACnD,OAAO,KAAK,CAAC,IAAI,CAAsB,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAC,OAAO,EAAE,WAAW,EAAC,EAAE,UAAU,EAAE,EAAE;QAC9D,IAAA,gBAAQ,EAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACrD,IAAA,gBAAQ,EAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBACrD,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;oBACxC,MAAM,IAAI,KAAK,CAAC,0CAA0C,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,8BAA8B,UAAU,0BAA0B,CAAC,CAAC;iBACrJ;gBACD,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;YACtC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAzCW,QAAA,0BAA0B,8BAyCrC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/validateTableData.d.ts b/node_modules/table/dist/src/validateTableData.d.ts deleted file mode 100644 index 84dac05a8..000000000 --- a/node_modules/table/dist/src/validateTableData.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const validateTableData: (rows: unknown[][]) => void; diff --git a/node_modules/table/dist/src/validateTableData.js b/node_modules/table/dist/src/validateTableData.js deleted file mode 100644 index a85e80755..000000000 --- a/node_modules/table/dist/src/validateTableData.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateTableData = void 0; -const utils_1 = require("./utils"); -const validateTableData = (rows) => { - if (!Array.isArray(rows)) { - throw new TypeError('Table data must be an array.'); - } - if (rows.length === 0) { - throw new Error('Table must define at least one row.'); - } - if (rows[0].length === 0) { - throw new Error('Table must define at least one column.'); - } - const columnNumber = rows[0].length; - for (const row of rows) { - if (!Array.isArray(row)) { - throw new TypeError('Table row data must be an array.'); - } - if (row.length !== columnNumber) { - throw new Error('Table must have a consistent number of cells.'); - } - for (const cell of row) { - // eslint-disable-next-line no-control-regex - if (/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test((0, utils_1.normalizeString)(String(cell)))) { - throw new Error('Table data must not contain control characters.'); - } - } - } -}; -exports.validateTableData = validateTableData; -//# sourceMappingURL=validateTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/validateTableData.js.map b/node_modules/table/dist/src/validateTableData.js.map deleted file mode 100644 index 568fb10bb..000000000 --- a/node_modules/table/dist/src/validateTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validateTableData.js","sourceRoot":"","sources":["../../src/validateTableData.ts"],"names":[],"mappings":";;;AAAA,mCAEiB;AAEV,MAAM,iBAAiB,GAAG,CAAC,IAAiB,EAAQ,EAAE;IAC3D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACxB,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAC;KACrD;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KACxD;IAED,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;KAC3D;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAEpC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACvB,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC,CAAC;SACzD;QAED,IAAI,GAAG,CAAC,MAAM,KAAK,YAAY,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;SAClE;QAED,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE;YACtB,4CAA4C;YAC5C,IAAI,0CAA0C,CAAC,IAAI,CAAC,IAAA,uBAAe,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;gBAClF,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;aACpE;SACF;KACF;AACH,CAAC,CAAC;AA/BW,QAAA,iBAAiB,qBA+B5B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapCell.d.ts b/node_modules/table/dist/src/wrapCell.d.ts deleted file mode 100644 index 52d7299ba..000000000 --- a/node_modules/table/dist/src/wrapCell.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Wrap a single cell value into a list of lines - * - * Always wraps on newlines, for the remainder uses either word or string wrapping - * depending on user configuration. - * - */ -export declare const wrapCell: (cellValue: string, cellWidth: number, useWrapWord: boolean) => string[]; diff --git a/node_modules/table/dist/src/wrapCell.js b/node_modules/table/dist/src/wrapCell.js deleted file mode 100644 index b2ce8de0d..000000000 --- a/node_modules/table/dist/src/wrapCell.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wrapCell = void 0; -const utils_1 = require("./utils"); -const wrapString_1 = require("./wrapString"); -const wrapWord_1 = require("./wrapWord"); -/** - * Wrap a single cell value into a list of lines - * - * Always wraps on newlines, for the remainder uses either word or string wrapping - * depending on user configuration. - * - */ -const wrapCell = (cellValue, cellWidth, useWrapWord) => { - // First split on literal newlines - const cellLines = (0, utils_1.splitAnsi)(cellValue); - // Then iterate over the list and word-wrap every remaining line if necessary. - for (let lineNr = 0; lineNr < cellLines.length;) { - let lineChunks; - if (useWrapWord) { - lineChunks = (0, wrapWord_1.wrapWord)(cellLines[lineNr], cellWidth); - } - else { - lineChunks = (0, wrapString_1.wrapString)(cellLines[lineNr], cellWidth); - } - // Replace our original array element with whatever the wrapping returned - cellLines.splice(lineNr, 1, ...lineChunks); - lineNr += lineChunks.length; - } - return cellLines; -}; -exports.wrapCell = wrapCell; -//# sourceMappingURL=wrapCell.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapCell.js.map b/node_modules/table/dist/src/wrapCell.js.map deleted file mode 100644 index 9ce0736ec..000000000 --- a/node_modules/table/dist/src/wrapCell.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrapCell.js","sourceRoot":"","sources":["../../src/wrapCell.ts"],"names":[],"mappings":";;;AAAA,mCAEiB;AACjB,6CAEsB;AACtB,yCAEoB;AAEpB;;;;;;GAMG;AACI,MAAM,QAAQ,GAAG,CAAC,SAAiB,EAAE,SAAiB,EAAE,WAAoB,EAAY,EAAE;IAC/F,kCAAkC;IAClC,MAAM,SAAS,GAAG,IAAA,iBAAS,EAAC,SAAS,CAAC,CAAC;IAEvC,8EAA8E;IAC9E,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG;QAC/C,IAAI,UAAU,CAAC;QAEf,IAAI,WAAW,EAAE;YACf,UAAU,GAAG,IAAA,mBAAQ,EAAC,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;SACrD;aAAM;YACL,UAAU,GAAG,IAAA,uBAAU,EAAC,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;SACvD;QAED,yEAAyE;QACzE,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC;QAC3C,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC;KAC7B;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AApBW,QAAA,QAAQ,YAoBnB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapString.d.ts b/node_modules/table/dist/src/wrapString.d.ts deleted file mode 100644 index 849e17473..000000000 --- a/node_modules/table/dist/src/wrapString.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Creates an array of strings split into groups the length of size. - * This function works with strings that contain ASCII characters. - * - * wrapText is different from would-be "chunk" implementation - * in that whitespace characters that occur on a chunk size limit are trimmed. - * - */ -export declare const wrapString: (subject: string, size: number) => string[]; diff --git a/node_modules/table/dist/src/wrapString.js b/node_modules/table/dist/src/wrapString.js deleted file mode 100644 index b09bd1736..000000000 --- a/node_modules/table/dist/src/wrapString.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wrapString = void 0; -const slice_ansi_1 = __importDefault(require("slice-ansi")); -const string_width_1 = __importDefault(require("string-width")); -/** - * Creates an array of strings split into groups the length of size. - * This function works with strings that contain ASCII characters. - * - * wrapText is different from would-be "chunk" implementation - * in that whitespace characters that occur on a chunk size limit are trimmed. - * - */ -const wrapString = (subject, size) => { - let subjectSlice = subject; - const chunks = []; - do { - chunks.push((0, slice_ansi_1.default)(subjectSlice, 0, size)); - subjectSlice = (0, slice_ansi_1.default)(subjectSlice, size).trim(); - } while ((0, string_width_1.default)(subjectSlice)); - return chunks; -}; -exports.wrapString = wrapString; -//# sourceMappingURL=wrapString.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapString.js.map b/node_modules/table/dist/src/wrapString.js.map deleted file mode 100644 index c1c2a5bdd..000000000 --- a/node_modules/table/dist/src/wrapString.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrapString.js","sourceRoot":"","sources":["../../src/wrapString.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAC/B,gEAAuC;AAEvC;;;;;;;GAOG;AACI,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,IAAY,EAAY,EAAE;IACpE,IAAI,YAAY,GAAG,OAAO,CAAC;IAE3B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,GAAG;QACD,MAAM,CAAC,IAAI,CAAC,IAAA,oBAAK,EAAC,YAAY,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QAE1C,YAAY,GAAG,IAAA,oBAAK,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;KACjD,QAAQ,IAAA,sBAAW,EAAC,YAAY,CAAC,EAAE;IAEpC,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapWord.d.ts b/node_modules/table/dist/src/wrapWord.d.ts deleted file mode 100644 index 083da4d4e..000000000 --- a/node_modules/table/dist/src/wrapWord.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wrapWord: (input: string, size: number) => string[]; diff --git a/node_modules/table/dist/src/wrapWord.js b/node_modules/table/dist/src/wrapWord.js deleted file mode 100644 index 7571aa6e5..000000000 --- a/node_modules/table/dist/src/wrapWord.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wrapWord = void 0; -const slice_ansi_1 = __importDefault(require("slice-ansi")); -const strip_ansi_1 = __importDefault(require("strip-ansi")); -const calculateStringLengths = (input, size) => { - let subject = (0, strip_ansi_1.default)(input); - const chunks = []; - // https://regex101.com/r/gY5kZ1/1 - const re = new RegExp('(^.{1,' + String(Math.max(size, 1)) + '}(\\s+|$))|(^.{1,' + String(Math.max(size - 1, 1)) + '}(\\\\|/|_|\\.|,|;|-))'); - do { - let chunk; - const match = re.exec(subject); - if (match) { - chunk = match[0]; - subject = subject.slice(chunk.length); - const trimmedLength = chunk.trim().length; - const offset = chunk.length - trimmedLength; - chunks.push([trimmedLength, offset]); - } - else { - chunk = subject.slice(0, size); - subject = subject.slice(size); - chunks.push([chunk.length, 0]); - } - } while (subject.length); - return chunks; -}; -const wrapWord = (input, size) => { - const result = []; - let startIndex = 0; - calculateStringLengths(input, size).forEach(([length, offset]) => { - result.push((0, slice_ansi_1.default)(input, startIndex, startIndex + length)); - startIndex += length + offset; - }); - return result; -}; -exports.wrapWord = wrapWord; -//# sourceMappingURL=wrapWord.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapWord.js.map b/node_modules/table/dist/src/wrapWord.js.map deleted file mode 100644 index fc61519df..000000000 --- a/node_modules/table/dist/src/wrapWord.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrapWord.js","sourceRoot":"","sources":["../../src/wrapWord.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAC/B,4DAAmC;AAEnC,MAAM,sBAAsB,GAAG,CAAC,KAAa,EAAE,IAAY,EAA0C,EAAE;IACrG,IAAI,OAAO,GAAG,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC;IAE/B,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,kCAAkC;IAClC,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,EAAE,C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IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAXW,QAAA,QAAQ,YAWnB"} \ No newline at end of file diff --git a/node_modules/table/package.json b/node_modules/table/package.json deleted file mode 100644 index f33a18890..000000000 --- a/node_modules/table/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "author": { - "email": "gajus@gajus.com", - "name": "Gajus Kuizinas", - "url": "http://gajus.com" - }, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "description": "Formats data into a string table.", - "devDependencies": { - "@types/chai": "^4.2.16", - "@types/lodash.mapvalues": "^4.6.6", - "@types/lodash.truncate": "^4.4.6", - "@types/mocha": "^9.0.0", - "@types/node": "^14.14.37", - "@types/sinon": "^10.0.0", - "@types/slice-ansi": "^4.0.0", - "ajv-cli": "^5.0.0", - "ajv-keywords": "^5.0.0", - "chai": "^4.2.0", - "chalk": "^4.1.0", - "coveralls": "^3.1.0", - "eslint": "^7.32.0", - "eslint-config-canonical": "^25.0.0", - "gitdown": "^3.1.4", - "husky": "^4.3.6", - "js-beautify": "^1.14.0", - "lodash.mapvalues": "^4.6.0", - "mkdirp": "^1.0.4", - "mocha": "^8.2.1", - "nyc": "^15.1.0", - "semantic-release": "^17.3.1", - "sinon": "^12.0.1", - "ts-node": "^9.1.1", - "typescript": "4.5.2" - }, - "engines": { - "node": ">=10.0.0" - }, - "husky": { - "hooks": { - "post-commit": "npm run create-readme && git add README.md && git commit -m 'docs: generate docs' --no-verify", - "pre-commit": "npm run build && npm run lint && npm run test" - } - }, - "keywords": [ - "ascii", - "text", - "table", - "align", - "ansi" - ], - "license": "BSD-3-Clause", - "main": "./dist/src/index.js", - "files": [ - "dist/src/" - ], - "name": "table", - "repository": { - "type": "git", - "url": "https://github.com/gajus/table" - }, - "scripts": { - "prebuild": "rm -fr ./src/generated && mkdirp ./src/generated", - "build": "npm run create-validators && tsc", - "create-readme": "gitdown ./.README/README.md --output-file ./README.md", - "create-validators": "ajv compile --all-errors --inline-refs=false -s src/schemas/config -s src/schemas/streamConfig -r src/schemas/shared -c ajv-keywords/dist/keywords/typeof -o | js-beautify > ./src/generated/validators.js", - "lint": "eslint ./src ./test", - "test": "nyc mocha && nyc check-coverage --lines 95" - }, - "version": "6.8.1" -} diff --git a/node_modules/to-regex-range/LICENSE b/node_modules/to-regex-range/LICENSE deleted file mode 100644 index 7cccaf9e3..000000000 --- a/node_modules/to-regex-range/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-present, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/to-regex-range/README.md b/node_modules/to-regex-range/README.md deleted file mode 100644 index 38887dafa..000000000 --- a/node_modules/to-regex-range/README.md +++ /dev/null @@ -1,305 +0,0 @@ -# to-regex-range [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/to-regex-range.svg?style=flat)](https://www.npmjs.com/package/to-regex-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/to-regex-range.svg?style=flat)](https://npmjs.org/package/to-regex-range) [![NPM total downloads](https://img.shields.io/npm/dt/to-regex-range.svg?style=flat)](https://npmjs.org/package/to-regex-range) [![Linux Build Status](https://img.shields.io/travis/micromatch/to-regex-range.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/to-regex-range) - -> Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save to-regex-range -``` - -
-What does this do? - -
- -This libary generates the `source` string to be passed to `new RegExp()` for matching a range of numbers. - -**Example** - -```js -const toRegexRange = require('to-regex-range'); -const regex = new RegExp(toRegexRange('15', '95')); -``` - -A string is returned so that you can do whatever you need with it before passing it to `new RegExp()` (like adding `^` or `$` boundaries, defining flags, or combining it another string). - -
- -
- -
-Why use this library? - -
- -### Convenience - -Creating regular expressions for matching numbers gets deceptively complicated pretty fast. - -For example, let's say you need a validation regex for matching part of a user-id, postal code, social security number, tax id, etc: - -* regex for matching `1` => `/1/` (easy enough) -* regex for matching `1` through `5` => `/[1-5]/` (not bad...) -* regex for matching `1` or `5` => `/(1|5)/` (still easy...) -* regex for matching `1` through `50` => `/([1-9]|[1-4][0-9]|50)/` (uh-oh...) -* regex for matching `1` through `55` => `/([1-9]|[1-4][0-9]|5[0-5])/` (no prob, I can do this...) -* regex for matching `1` through `555` => `/([1-9]|[1-9][0-9]|[1-4][0-9]{2}|5[0-4][0-9]|55[0-5])/` (maybe not...) -* regex for matching `0001` through `5555` => `/(0{3}[1-9]|0{2}[1-9][0-9]|0[1-9][0-9]{2}|[1-4][0-9]{3}|5[0-4][0-9]{2}|55[0-4][0-9]|555[0-5])/` (okay, I get the point!) - -The numbers are contrived, but they're also really basic. In the real world you might need to generate a regex on-the-fly for validation. - -**Learn more** - -If you're interested in learning more about [character classes](http://www.regular-expressions.info/charclass.html) and other regex features, I personally have always found [regular-expressions.info](http://www.regular-expressions.info/charclass.html) to be pretty useful. - -### Heavily tested - -As of April 07, 2019, this library runs [>1m test assertions](./test/test.js) against generated regex-ranges to provide brute-force verification that results are correct. - -Tests run in ~280ms on my MacBook Pro, 2.5 GHz Intel Core i7. - -### Optimized - -Generated regular expressions are optimized: - -* duplicate sequences and character classes are reduced using quantifiers -* smart enough to use `?` conditionals when number(s) or range(s) can be positive or negative -* uses fragment caching to avoid processing the same exact string more than once - -
- -
- -## Usage - -Add this library to your javascript application with the following line of code - -```js -const toRegexRange = require('to-regex-range'); -``` - -The main export is a function that takes two integers: the `min` value and `max` value (formatted as strings or numbers). - -```js -const source = toRegexRange('15', '95'); -//=> 1[5-9]|[2-8][0-9]|9[0-5] - -const regex = new RegExp(`^${source}$`); -console.log(regex.test('14')); //=> false -console.log(regex.test('50')); //=> true -console.log(regex.test('94')); //=> true -console.log(regex.test('96')); //=> false -``` - -## Options - -### options.capture - -**Type**: `boolean` - -**Deafault**: `undefined` - -Wrap the returned value in parentheses when there is more than one regex condition. Useful when you're dynamically generating ranges. - -```js -console.log(toRegexRange('-10', '10')); -//=> -[1-9]|-?10|[0-9] - -console.log(toRegexRange('-10', '10', { capture: true })); -//=> (-[1-9]|-?10|[0-9]) -``` - -### options.shorthand - -**Type**: `boolean` - -**Deafault**: `undefined` - -Use the regex shorthand for `[0-9]`: - -```js -console.log(toRegexRange('0', '999999')); -//=> [0-9]|[1-9][0-9]{1,5} - -console.log(toRegexRange('0', '999999', { shorthand: true })); -//=> \d|[1-9]\d{1,5} -``` - -### options.relaxZeros - -**Type**: `boolean` - -**Default**: `true` - -This option relaxes matching for leading zeros when when ranges are zero-padded. - -```js -const source = toRegexRange('-0010', '0010'); -const regex = new RegExp(`^${source}$`); -console.log(regex.test('-10')); //=> true -console.log(regex.test('-010')); //=> true -console.log(regex.test('-0010')); //=> true -console.log(regex.test('10')); //=> true -console.log(regex.test('010')); //=> true -console.log(regex.test('0010')); //=> true -``` - -When `relaxZeros` is false, matching is strict: - -```js -const source = toRegexRange('-0010', '0010', { relaxZeros: false }); -const regex = new RegExp(`^${source}$`); -console.log(regex.test('-10')); //=> false -console.log(regex.test('-010')); //=> false -console.log(regex.test('-0010')); //=> true -console.log(regex.test('10')); //=> false -console.log(regex.test('010')); //=> false -console.log(regex.test('0010')); //=> true -``` - -## Examples - -| **Range** | **Result** | **Compile time** | -| --- | --- | --- | -| `toRegexRange(-10, 10)` | `-[1-9]\|-?10\|[0-9]` | _132μs_ | -| `toRegexRange(-100, -10)` | `-1[0-9]\|-[2-9][0-9]\|-100` | _50μs_ | -| `toRegexRange(-100, 100)` | `-[1-9]\|-?[1-9][0-9]\|-?100\|[0-9]` | _42μs_ | -| `toRegexRange(001, 100)` | `0{0,2}[1-9]\|0?[1-9][0-9]\|100` | _109μs_ | -| `toRegexRange(001, 555)` | `0{0,2}[1-9]\|0?[1-9][0-9]\|[1-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _51μs_ | -| `toRegexRange(0010, 1000)` | `0{0,2}1[0-9]\|0{0,2}[2-9][0-9]\|0?[1-9][0-9]{2}\|1000` | _31μs_ | -| `toRegexRange(1, 50)` | `[1-9]\|[1-4][0-9]\|50` | _24μs_ | -| `toRegexRange(1, 55)` | `[1-9]\|[1-4][0-9]\|5[0-5]` | _23μs_ | -| `toRegexRange(1, 555)` | `[1-9]\|[1-9][0-9]\|[1-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _30μs_ | -| `toRegexRange(1, 5555)` | `[1-9]\|[1-9][0-9]{1,2}\|[1-4][0-9]{3}\|5[0-4][0-9]{2}\|55[0-4][0-9]\|555[0-5]` | _43μs_ | -| `toRegexRange(111, 555)` | `11[1-9]\|1[2-9][0-9]\|[2-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _38μs_ | -| `toRegexRange(29, 51)` | `29\|[34][0-9]\|5[01]` | _24μs_ | -| `toRegexRange(31, 877)` | `3[1-9]\|[4-9][0-9]\|[1-7][0-9]{2}\|8[0-6][0-9]\|87[0-7]` | _32μs_ | -| `toRegexRange(5, 5)` | `5` | _8μs_ | -| `toRegexRange(5, 6)` | `5\|6` | _11μs_ | -| `toRegexRange(1, 2)` | `1\|2` | _6μs_ | -| `toRegexRange(1, 5)` | `[1-5]` | _15μs_ | -| `toRegexRange(1, 10)` | `[1-9]\|10` | _22μs_ | -| `toRegexRange(1, 100)` | `[1-9]\|[1-9][0-9]\|100` | _25μs_ | -| `toRegexRange(1, 1000)` | `[1-9]\|[1-9][0-9]{1,2}\|1000` | _31μs_ | -| `toRegexRange(1, 10000)` | `[1-9]\|[1-9][0-9]{1,3}\|10000` | _34μs_ | -| `toRegexRange(1, 100000)` | `[1-9]\|[1-9][0-9]{1,4}\|100000` | _36μs_ | -| `toRegexRange(1, 1000000)` | `[1-9]\|[1-9][0-9]{1,5}\|1000000` | _42μs_ | -| `toRegexRange(1, 10000000)` | `[1-9]\|[1-9][0-9]{1,6}\|10000000` | _42μs_ | - -## Heads up! - -**Order of arguments** - -When the `min` is larger than the `max`, values will be flipped to create a valid range: - -```js -toRegexRange('51', '29'); -``` - -Is effectively flipped to: - -```js -toRegexRange('29', '51'); -//=> 29|[3-4][0-9]|5[0-1] -``` - -**Steps / increments** - -This library does not support steps (increments). A pr to add support would be welcome. - -## History - -### v2.0.0 - 2017-04-21 - -**New features** - -Adds support for zero-padding! - -### v1.0.0 - -**Optimizations** - -Repeating ranges are now grouped using quantifiers. rocessing time is roughly the same, but the generated regex is much smaller, which should result in faster matching. - -## Attribution - -Inspired by the python library [range-regex](https://github.com/dimka665/range-regex). - -## About - -
-Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
- -
-Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
- -
-Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
- -### Related projects - -You might also be interested in these projects: - -* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used by micromatch.") -* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") -* [repeat-element](https://www.npmjs.com/package/repeat-element): Create an array by repeating the given value n times. | [homepage](https://github.com/jonschlinkert/repeat-element "Create an array by repeating the given value n times.") -* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string "Repeat the given string n times. Fastest implementation for repeating a string.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 63 | [jonschlinkert](https://github.com/jonschlinkert) | -| 3 | [doowb](https://github.com/doowb) | -| 2 | [realityking](https://github.com/realityking) | - -### Author - -**Jon Schlinkert** - -* [GitHub Profile](https://github.com/jonschlinkert) -* [Twitter Profile](https://twitter.com/jonschlinkert) -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) - -Please consider supporting me on Patreon, or [start your own Patreon page](https://patreon.com/invite/bxpbvm)! - - - - - -### License - -Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 07, 2019._ \ No newline at end of file diff --git a/node_modules/to-regex-range/index.js b/node_modules/to-regex-range/index.js deleted file mode 100644 index 77fbaced1..000000000 --- a/node_modules/to-regex-range/index.js +++ /dev/null @@ -1,288 +0,0 @@ -/*! - * to-regex-range - * - * Copyright (c) 2015-present, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -const isNumber = require('is-number'); - -const toRegexRange = (min, max, options) => { - if (isNumber(min) === false) { - throw new TypeError('toRegexRange: expected the first argument to be a number'); - } - - if (max === void 0 || min === max) { - return String(min); - } - - if (isNumber(max) === false) { - throw new TypeError('toRegexRange: expected the second argument to be a number.'); - } - - let opts = { relaxZeros: true, ...options }; - if (typeof opts.strictZeros === 'boolean') { - opts.relaxZeros = opts.strictZeros === false; - } - - let relax = String(opts.relaxZeros); - let shorthand = String(opts.shorthand); - let capture = String(opts.capture); - let wrap = String(opts.wrap); - let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; - - if (toRegexRange.cache.hasOwnProperty(cacheKey)) { - return toRegexRange.cache[cacheKey].result; - } - - let a = Math.min(min, max); - let b = Math.max(min, max); - - if (Math.abs(a - b) === 1) { - let result = min + '|' + max; - if (opts.capture) { - return `(${result})`; - } - if (opts.wrap === false) { - return result; - } - return `(?:${result})`; - } - - let isPadded = hasPadding(min) || hasPadding(max); - let state = { min, max, a, b }; - let positives = []; - let negatives = []; - - if (isPadded) { - state.isPadded = isPadded; - state.maxLen = String(state.max).length; - } - - if (a < 0) { - let newMin = b < 0 ? Math.abs(b) : 1; - negatives = splitToPatterns(newMin, Math.abs(a), state, opts); - a = state.a = 0; - } - - if (b >= 0) { - positives = splitToPatterns(a, b, state, opts); - } - - state.negatives = negatives; - state.positives = positives; - state.result = collatePatterns(negatives, positives, opts); - - if (opts.capture === true) { - state.result = `(${state.result})`; - } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { - state.result = `(?:${state.result})`; - } - - toRegexRange.cache[cacheKey] = state; - return state.result; -}; - -function collatePatterns(neg, pos, options) { - let onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; - let onlyPositive = filterPatterns(pos, neg, '', false, options) || []; - let intersected = filterPatterns(neg, pos, '-?', true, options) || []; - let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); - return subpatterns.join('|'); -} - -function splitToRanges(min, max) { - let nines = 1; - let zeros = 1; - - let stop = countNines(min, nines); - let stops = new Set([max]); - - while (min <= stop && stop <= max) { - stops.add(stop); - nines += 1; - stop = countNines(min, nines); - } - - stop = countZeros(max + 1, zeros) - 1; - - while (min < stop && stop <= max) { - stops.add(stop); - zeros += 1; - stop = countZeros(max + 1, zeros) - 1; - } - - stops = [...stops]; - stops.sort(compare); - return stops; -} - -/** - * Convert a range to a regex pattern - * @param {Number} `start` - * @param {Number} `stop` - * @return {String} - */ - -function rangeToPattern(start, stop, options) { - if (start === stop) { - return { pattern: start, count: [], digits: 0 }; - } - - let zipped = zip(start, stop); - let digits = zipped.length; - let pattern = ''; - let count = 0; - - for (let i = 0; i < digits; i++) { - let [startDigit, stopDigit] = zipped[i]; - - if (startDigit === stopDigit) { - pattern += startDigit; - - } else if (startDigit !== '0' || stopDigit !== '9') { - pattern += toCharacterClass(startDigit, stopDigit, options); - - } else { - count++; - } - } - - if (count) { - pattern += options.shorthand === true ? '\\d' : '[0-9]'; - } - - return { pattern, count: [count], digits }; -} - -function splitToPatterns(min, max, tok, options) { - let ranges = splitToRanges(min, max); - let tokens = []; - let start = min; - let prev; - - for (let i = 0; i < ranges.length; i++) { - let max = ranges[i]; - let obj = rangeToPattern(String(start), String(max), options); - let zeros = ''; - - if (!tok.isPadded && prev && prev.pattern === obj.pattern) { - if (prev.count.length > 1) { - prev.count.pop(); - } - - prev.count.push(obj.count[0]); - prev.string = prev.pattern + toQuantifier(prev.count); - start = max + 1; - continue; - } - - if (tok.isPadded) { - zeros = padZeros(max, tok, options); - } - - obj.string = zeros + obj.pattern + toQuantifier(obj.count); - tokens.push(obj); - start = max + 1; - prev = obj; - } - - return tokens; -} - -function filterPatterns(arr, comparison, prefix, intersection, options) { - let result = []; - - for (let ele of arr) { - let { string } = ele; - - // only push if _both_ are negative... - if (!intersection && !contains(comparison, 'string', string)) { - result.push(prefix + string); - } - - // or _both_ are positive - if (intersection && contains(comparison, 'string', string)) { - result.push(prefix + string); - } - } - return result; -} - -/** - * Zip strings - */ - -function zip(a, b) { - let arr = []; - for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); - return arr; -} - -function compare(a, b) { - return a > b ? 1 : b > a ? -1 : 0; -} - -function contains(arr, key, val) { - return arr.some(ele => ele[key] === val); -} - -function countNines(min, len) { - return Number(String(min).slice(0, -len) + '9'.repeat(len)); -} - -function countZeros(integer, zeros) { - return integer - (integer % Math.pow(10, zeros)); -} - -function toQuantifier(digits) { - let [start = 0, stop = ''] = digits; - if (stop || start > 1) { - return `{${start + (stop ? ',' + stop : '')}}`; - } - return ''; -} - -function toCharacterClass(a, b, options) { - return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; -} - -function hasPadding(str) { - return /^-?(0+)\d/.test(str); -} - -function padZeros(value, tok, options) { - if (!tok.isPadded) { - return value; - } - - let diff = Math.abs(tok.maxLen - String(value).length); - let relax = options.relaxZeros !== false; - - switch (diff) { - case 0: - return ''; - case 1: - return relax ? '0?' : '0'; - case 2: - return relax ? '0{0,2}' : '00'; - default: { - return relax ? `0{0,${diff}}` : `0{${diff}}`; - } - } -} - -/** - * Cache - */ - -toRegexRange.cache = {}; -toRegexRange.clearCache = () => (toRegexRange.cache = {}); - -/** - * Expose `toRegexRange` - */ - -module.exports = toRegexRange; diff --git a/node_modules/to-regex-range/package.json b/node_modules/to-regex-range/package.json deleted file mode 100644 index 4ef194f35..000000000 --- a/node_modules/to-regex-range/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "to-regex-range", - "description": "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.", - "version": "5.0.1", - "homepage": "https://github.com/micromatch/to-regex-range", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Rouven Weßling (www.rouvenwessling.de)" - ], - "repository": "micromatch/to-regex-range", - "bugs": { - "url": "https://github.com/micromatch/to-regex-range/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=8.0" - }, - "scripts": { - "test": "mocha" - }, - "dependencies": { - "is-number": "^7.0.0" - }, - "devDependencies": { - "fill-range": "^6.0.0", - "gulp-format-md": "^2.0.0", - "mocha": "^6.0.2", - "text-table": "^0.2.0", - "time-diff": "^0.3.1" - }, - "keywords": [ - "bash", - "date", - "expand", - "expansion", - "expression", - "glob", - "match", - "match date", - "match number", - "match numbers", - "match year", - "matches", - "matching", - "number", - "numbers", - "numerical", - "range", - "ranges", - "regex", - "regexp", - "regular", - "regular expression", - "sequence" - ], - "verb": { - "layout": "default", - "toc": false, - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "helpers": { - "examples": { - "displayName": "examples" - } - }, - "related": { - "list": [ - "expand-range", - "fill-range", - "micromatch", - "repeat-element", - "repeat-string" - ] - } - } -} diff --git a/node_modules/trim-newlines/index.d.ts b/node_modules/trim-newlines/index.d.ts deleted file mode 100644 index 0aa9fbd53..000000000 --- a/node_modules/trim-newlines/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -declare const trimNewlines: { - /** - Trim from the start and end of a string. - - @example - ```js - import trimNewlines from 'trim-newlines'; - - trimNewlines('\n🦄\r\n'); - //=> '🦄' - ``` - */ - (string: string): string; - - /** - Trim from the start of a string. - - @example - ```js - import trimNewlines from 'trim-newlines'; - - trimNewlines.start('\n🦄\r\n'); - //=> '🦄\r\n' - ``` - */ - start(string: string): string; - - /** - Trim from the end of a string. - - @example - ```js - import trimNewlines from 'trim-newlines'; - - trimNewlines.end('\n🦄\r\n'); - //=> '\n🦄' - ``` - */ - end(string: string): string; -}; - -export default trimNewlines; diff --git a/node_modules/trim-newlines/index.js b/node_modules/trim-newlines/index.js deleted file mode 100644 index 628f96a7e..000000000 --- a/node_modules/trim-newlines/index.js +++ /dev/null @@ -1,35 +0,0 @@ -export default function trimNewlines(string) { - let start = 0; - let end = string.length; - - while (start < end && (string[start] === '\r' || string[start] === '\n')) { - start++; - } - - while (end > start && (string[end - 1] === '\r' || string[end - 1] === '\n')) { - end--; - } - - return (start > 0 || end < string.length) ? string.slice(start, end) : string; -} - -trimNewlines.start = string => { - const end = string.length; - let start = 0; - - while (start < end && (string[start] === '\r' || string[start] === '\n')) { - start++; - } - - return start > 0 ? string.slice(start, end) : string; -}; - -trimNewlines.end = string => { - let end = string.length; - - while (end > 0 && (string[end - 1] === '\r' || string[end - 1] === '\n')) { - end--; - } - - return end < string.length ? string.slice(0, end) : string; -}; diff --git a/node_modules/trim-newlines/license b/node_modules/trim-newlines/license deleted file mode 100644 index fa7ceba3e..000000000 --- a/node_modules/trim-newlines/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/trim-newlines/package.json b/node_modules/trim-newlines/package.json deleted file mode 100644 index d22341198..000000000 --- a/node_modules/trim-newlines/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "trim-newlines", - "version": "4.1.1", - "description": "Trim newlines from the start and/or end of a string", - "license": "MIT", - "repository": "sindresorhus/trim-newlines", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "type": "module", - "exports": "./index.js", - "engines": { - "node": ">=12" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "trim", - "newline", - "newlines", - "linebreak", - "lf", - "crlf", - "left", - "right", - "start", - "end", - "string", - "remove", - "delete", - "strip" - ], - "devDependencies": { - "ava": "^3.15.0", - "tsd": "^0.14.0", - "xo": "^0.39.1" - } -} diff --git a/node_modules/trim-newlines/readme.md b/node_modules/trim-newlines/readme.md deleted file mode 100644 index 2b8561b1b..000000000 --- a/node_modules/trim-newlines/readme.md +++ /dev/null @@ -1,55 +0,0 @@ -# trim-newlines - -> Trim [newlines](https://en.wikipedia.org/wiki/Newline) from the start and/or end of a string - -## Install - -``` -$ npm install trim-newlines -``` - -## Usage - -```js -import trimNewlines from 'trim-newlines'; - -trimNewlines('\n🦄\r\n'); -//=> '🦄' - -trimNewlines.start('\n🦄\r\n'); -//=> '🦄\r\n' - -trimNewlines.end('\n🦄\r\n'); -//=> '\n🦄' -``` - -## API - -### trimNewlines(string) - -Trim from the start and end of a string. - -### trimNewlines.start(string) - -Trim from the start of a string. - -### trimNewlines.end(string) - -Trim from the end of a string. - -## Related - -- [trim-left](https://github.com/sindresorhus/trim-left) - Similar to `String#trim()` but removes only whitespace on the left -- [trim-right](https://github.com/sindresorhus/trim-right) - Similar to `String#trim()` but removes only whitespace on the right. - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/type-fest/base.d.ts b/node_modules/type-fest/base.d.ts deleted file mode 100644 index 99bebb001..000000000 --- a/node_modules/type-fest/base.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Types that are compatible with all supported TypeScript versions. -// It's shared between all TypeScript version-specific definitions. - -// Basic -export * from './source/primitive'; -export * from './source/typed-array'; -export * from './source/basic'; -export * from './source/observable-like'; - -// Utilities -export {Except} from './source/except'; -export {Mutable} from './source/mutable'; -export {Merge} from './source/merge'; -export {MergeExclusive} from './source/merge-exclusive'; -export {RequireAtLeastOne} from './source/require-at-least-one'; -export {RequireExactlyOne} from './source/require-exactly-one'; -export {PartialDeep} from './source/partial-deep'; -export {ReadonlyDeep} from './source/readonly-deep'; -export {LiteralUnion} from './source/literal-union'; -export {Promisable} from './source/promisable'; -export {Opaque} from './source/opaque'; -export {SetOptional} from './source/set-optional'; -export {SetRequired} from './source/set-required'; -export {ValueOf} from './source/value-of'; -export {PromiseValue} from './source/promise-value'; -export {AsyncReturnType} from './source/async-return-type'; -export {ConditionalExcept} from './source/conditional-except'; -export {ConditionalKeys} from './source/conditional-keys'; -export {ConditionalPick} from './source/conditional-pick'; -export {UnionToIntersection} from './source/union-to-intersection'; -export {Stringified} from './source/stringified'; -export {FixedLengthArray} from './source/fixed-length-array'; -export {IterableElement} from './source/iterable-element'; -export {Entry} from './source/entry'; -export {Entries} from './source/entries'; -export {SetReturnType} from './source/set-return-type'; -export {Asyncify} from './source/asyncify'; -export {Simplify} from './source/simplify'; - -// Miscellaneous -export {PackageJson} from './source/package-json'; -export {TsConfigJson} from './source/tsconfig-json'; diff --git a/node_modules/type-fest/index.d.ts b/node_modules/type-fest/index.d.ts deleted file mode 100644 index 206261c21..000000000 --- a/node_modules/type-fest/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// These are all the basic types that's compatible with all supported TypeScript versions. -export * from './base'; diff --git a/node_modules/type-fest/license b/node_modules/type-fest/license deleted file mode 100644 index fa7ceba3e..000000000 --- a/node_modules/type-fest/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/type-fest/package.json b/node_modules/type-fest/package.json deleted file mode 100644 index af4fe1432..000000000 --- a/node_modules/type-fest/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "type-fest", - "version": "1.4.0", - "description": "A collection of essential TypeScript types", - "license": "(MIT OR CC0-1.0)", - "repository": "sindresorhus/type-fest", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && tsd && tsc" - }, - "files": [ - "index.d.ts", - "base.d.ts", - "source", - "ts41" - ], - "keywords": [ - "typescript", - "ts", - "types", - "utility", - "util", - "utilities", - "omit", - "merge", - "json" - ], - "devDependencies": { - "@sindresorhus/tsconfig": "~0.7.0", - "expect-type": "^0.11.0", - "tsd": "^0.14.0", - "typescript": "^4.1.3", - "xo": "^0.36.1" - }, - "types": "./index.d.ts", - "typesVersions": { - ">=4.1": { - "*": [ - "ts41/*" - ] - } - }, - "xo": { - "rules": { - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/indent": "off", - "node/no-unsupported-features/es-builtins": "off" - } - } -} diff --git a/node_modules/type-fest/readme.md b/node_modules/type-fest/readme.md deleted file mode 100644 index 32269262f..000000000 --- a/node_modules/type-fest/readme.md +++ /dev/null @@ -1,794 +0,0 @@ - -
-
- -[![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://giphy.com/gifs/illustration-rainbow-unicorn-26AHG5KGFxSkUWw1i) -[![npm dependents](https://badgen.net/npm/dependents/type-fest)](https://www.npmjs.com/package/type-fest?activeTab=dependents) -[![npm downloads](https://badgen.net/npm/dt/type-fest)](https://www.npmjs.com/package/type-fest) -[![Docs](https://paka.dev/badges/v0/cute.svg)](https://paka.dev/npm/type-fest) - -Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). - -Either add this package as a dependency or copy-paste the needed types. No credit required. 👌 - -PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first. - -## Install - -``` -$ npm install type-fest -``` - -*Requires TypeScript >=3.8* - -## Usage - -```ts -import {Except} from 'type-fest'; - -type Foo = { - unicorn: string; - rainbow: boolean; -}; - -type FooWithoutRainbow = Except; -//=> {unicorn: string} -``` - -## API - -Click the type names for complete docs. - -### Basic - -- [`Primitive`](source/primitive.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). -- [`Class`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). -- [`TypedArray`](source/typed-array.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. -- [`JsonObject`](source/basic.d.ts) - Matches a JSON object. -- [`JsonArray`](source/basic.d.ts) - Matches a JSON array. -- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value. -- [`ObservableLike`](source/observable-like.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). - -### Utilities - -- [`Except`](source/except.d.ts) - Create a type from an object type without certain keys. This is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). -- [`Mutable`](source/mutable.d.ts) - Create a type that strips `readonly` from all or some of an object's keys. The inverse of `Readonly`. -- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type. -- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys. -- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys. -- [`RequireExactlyOne`](source/require-exactly-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more. -- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) if you only need one level deep. -- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) if you only need one level deep. -- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). -- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`. -- [`Opaque`](source/opaque.d.ts) - Create an [opaque type](https://codemix.com/opaque-types-in-javascript/). -- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional. -- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required. -- [`ValueOf`](source/value-of.d.ts) - Create a union of the given object's values, and optionally specify which keys to get the values from. -- [`PromiseValue`](source/promise-value.d.ts) - Returns the type that is wrapped inside a `Promise`. -- [`AsyncReturnType`](source/async-return-type.d.ts) - Unwrap the return type of a function that returns a `Promise`. -- [`ConditionalKeys`](source/conditional-keys.d.ts) - Extract keys from a shape where values extend the given `Condition` type. -- [`ConditionalPick`](source/conditional-pick.d.ts) - Like `Pick` except it selects properties from a shape where the values extend the given `Condition` type. -- [`ConditionalExcept`](source/conditional-except.d.ts) - Like `Omit` except it removes properties from a shape where the values extend the given `Condition` type. -- [`UnionToIntersection`](source/union-to-intersection.d.ts) - Convert a union type to an intersection type. -- [`Stringified`](source/stringified.d.ts) - Create a type with the keys of the given type changed to `string` type. -- [`FixedLengthArray`](source/fixed-length-array.d.ts) - Create a type that represents an array of the given type and length. -- [`IterableElement`](source/iterable-element.d.ts) - Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator. -- [`Entry`](source/entry.d.ts) - Create a type that represents the type of an entry of a collection. -- [`Entries`](source/entries.d.ts) - Create a type that represents the type of the entries of a collection. -- [`SetReturnType`](source/set-return-type.d.ts) - Create a function type with a return type of your choice and the same parameters as the given function type. -- [`Asyncify`](source/asyncify.d.ts) - Create an async version of the given function type. -- [`Includes`](ts41/includes.ts) - Returns a boolean for whether the given array includes the given item. -- [`Simplify`](source/simplify.d.ts) - Flatten the type output to improve type hints shown in editors. - -### Template literal types - -*Note:* These require [TypeScript 4.1 or newer](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#template-literal-types). - -- [`CamelCase`](ts41/camel-case.d.ts) – Convert a string literal to camel-case (`fooBar`). -- [`CamelCasedProperties`](ts41/camel-cased-properties.d.ts) – Convert object properties to camel-case (`fooBar`). -- [`CamelCasedPropertiesDeep`](ts41/camel-cased-properties-deep.d.ts) – Convert object properties to camel-case recursively (`fooBar`). -- [`KebabCase`](ts41/kebab-case.d.ts) – Convert a string literal to kebab-case (`foo-bar`). -- [`KebabCasedProperties`](ts41/kebab-cased-properties.d.ts) – Convert a object properties to kebab-case recursively (`foo-bar`). -- [`KebabCasedPropertiesDeep`](ts41/kebab-cased-properties-deep.d.ts) – Convert object properties to kebab-case (`foo-bar`). -- [`PascalCase`](ts41/pascal-case.d.ts) – Converts a string literal to pascal-case (`FooBar`) -- [`PascalCasedProperties`](ts41/pascal-cased-properties.d.ts) – Converts object properties to pascal-case (`FooBar`) -- [`PascalCasedPropertiesDeep`](ts41/pascal-cased-properties-deep.d.ts) – Converts object properties to pascal-case (`FooBar`) -- [`SnakeCase`](ts41/snake-case.d.ts) – Convert a string literal to snake-case (`foo_bar`). -- [`SnakeCasedProperties`](ts41/snake-cased-properties-deep.d.ts) – Convert object properties to snake-case (`foo_bar`). -- [`SnakeCasedPropertiesDeep`](ts41/snake-cased-properties-deep.d.ts) – Convert object properties to snake-case recursively (`foo_bar`). -- [`ScreamingSnakeCase`](ts41/screaming-snake-case.d.ts) - Convert a string literal to screaming-snake-case (`FOO_BAR`). -- [`DelimiterCase`](ts41/delimiter-case.d.ts) – Convert a string literal to a custom string delimiter casing. -- [`DelimiterCasedProperties`](ts41/delimiter-cased-properties.d.ts) – Convert object properties to a custom string delimiter casing. -- [`DelimiterCasedPropertiesDeep`](ts41/delimiter-cased-properties-deep.d.ts) – Convert object properties to a custom string delimiter casing recursively. -- [`Split`](ts41/split.d.ts) - Represents an array of strings split using a given character or character set. -- [`Trim`](ts41/trim.d.ts) - Remove leading and trailing spaces from a string. -- [`Get`](ts41/get.d.ts) - Get a deeply-nested property from an object using a key path, like [Lodash's `.get()`](https://lodash.com/docs/latest#get) function. -- [`LastArrayElement`](ts41/last-array-element.d.ts) - Extracts the type of the last element of an array. - -### Miscellaneous - -- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). -- [`TsConfigJson`](source/tsconfig-json.d.ts) - Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 4.4). - -## Declined types - -*If we decline a type addition, we will make sure to document the better solution here.* - -- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The PR author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider. -- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary` vs `Record`) from [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now. -- [`ExtractProperties` and `ExtractMethods`](https://github.com/sindresorhus/type-fest/pull/4) - The types violate the single responsibility principle. Instead, refine your types into more granular type hierarchies. - -## Tips - -### Related - -- [typed-query-selector](https://github.com/g-plane/typed-query-selector) - Enhances `document.querySelector` and `document.querySelectorAll` with a template literal type that matches element types returned from an HTML element query selector. - -### Built-in types - -There are many advanced types most users don't know about. - -- [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) - Make all properties in `T` optional. -
- - Example - - - [Playground](https://www.typescriptlang.org/play/#code/JYOwLgpgTgZghgYwgAgHIHsAmEDC6QzADmyA3gLABQyycADnanALYQBcyAzmFKEQNxUaddFDAcQAV2YAjaIMoBfKlQQAbOJ05osEAIIMAQpOBrsUMkOR1eANziRkCfISKSoD4Pg4ZseAsTIALyW1DS0DEysHADkvvoMMQA0VsKi4sgAzAAMuVaKClY2wPaOknSYDrguADwA0sgQAB6QIJjaANYQAJ7oMDp+LsQAfAAUXd0cdUnI9mo+uv6uANp1ALoAlKHhyGAAFsCcAHTOAW4eYF4gyxNrwbNwago0ypRWp66jH8QcAApwYmAjxq8SWIy2FDCNDA3ToKFBQyIdR69wmfQG1TOhShyBgomQX3w3GQE2Q6IA8jIAFYQBBgI4TTiEs5bTQYsFInrLTbbHZOIlgZDlSqQABqj0kKBC3yINx6a2xfOQwH6o2FVXFaklwSCIUkbQghBAEEwENSfNOlykEGefNe5uhB2O6sgS3GPRmLogmslG1tLxUOKgEDA7hAuydtteryAA) - - ```ts - interface NodeConfig { - appName: string; - port: number; - } - - class NodeAppBuilder { - private configuration: NodeConfig = { - appName: 'NodeApp', - port: 3000 - }; - - private updateConfig(key: Key, value: NodeConfig[Key]) { - this.configuration[key] = value; - } - - config(config: Partial) { - type NodeConfigKey = keyof NodeConfig; - - for (const key of Object.keys(config) as NodeConfigKey[]) { - const updateValue = config[key]; - - if (updateValue === undefined) { - continue; - } - - this.updateConfig(key, updateValue); - } - - return this; - } - } - - // `Partial`` allows us to provide only a part of the - // NodeConfig interface. - new NodeAppBuilder().config({appName: 'ToDoApp'}); - ``` -
- -- [`Required`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1408-L1413) - Make all properties in `T` required. -
- - Example - - - [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-AFzADOUckA5gNxUaIYjA4ckvGG07c+g6gF8KQkAgCuEFFDA5O6gEbEwUbLm2ESwABQIixACJIoSdgCUYAR3Vg4MACYAPGYuFvYAfACU5Ko0APRxwADKMBD+wFAAFuh2Vv7OSBlYGdmc8ABu8LHKsRyGxqY4oQT21pTCIHQMjOwA5DAAHgACxAAOjDAAdChYxL0ANLHUouKSMH0AEmAAhJhY6ozpAJ77GTCMjMCiV0ToSAb7UJPPC9WRgrEJwAAqR6MwSRQPFGUFocDgRHYxnEfGAowh-zgUCOwF6KwkUl6tXqJhCeEsxDaS1AXSYfUGI3GUxmc0WSneQA) - - ```ts - interface ContactForm { - email?: string; - message?: string; - } - - function submitContactForm(formData: Required) { - // Send the form data to the server. - } - - submitContactForm({ - email: 'ex@mple.com', - message: 'Hi! Could you tell me more about…', - }); - - // TypeScript error: missing property 'message' - submitContactForm({ - email: 'ex@mple.com', - }); - ``` -
- -- [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) - Make all properties in `T` readonly. -
- - Example - - - [Playground](https://typescript-play.js.org/?target=6#code/AQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+RWIcA5JSC+kWdCepQ+v3RYCU3RInzRMCGwlpC19NYBW1Ye08R1AA) - - ```ts - enum LogLevel { - Off, - Debug, - Error, - Fatal - }; - - interface LoggerConfig { - name: string; - level: LogLevel; - } - - class Logger { - config: Readonly; - - constructor({name, level}: LoggerConfig) { - this.config = {name, level}; - Object.freeze(this.config); - } - } - - const config: LoggerConfig = { - name: 'MyApp', - level: LogLevel.Debug - }; - - const logger = new Logger(config); - - // TypeScript Error: cannot assign to read-only property. - logger.config.level = LogLevel.Error; - - // We are able to edit config variable as we please. - config.level = LogLevel.Error; - ``` -
- -- [`Pick`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1422-L1427) - From `T`, pick a set of properties whose keys are in the union `K`. -
- - Example - - - [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+wfbcAGsAHi3kgBpgEtGy4AAfG54BWfqAPnZm4AAlZUj4MAkMA8GAGB4vEgfMlLLw6CwPBA8PYRmMgZVgAC6CgmI4cIommQELwICh8RBgKZKvALh1ur0bHQABR5PYMui0Wk7em2ADaAF0AJS0AASABUALIAGQAogR+Mp3CROCAFBBwVC2ikBpj5CgBIqGjizLA5TAFdAmalImAuqlBRoVQh5HBgEy1eDWfs7J5cjzGYKhroVfpDEhHM4MV6GRR5NN0JrtnRg6BVirTFBeHAKYmYY6QNpdB73LmCJZBlSAXAubtvczeSmQMNSuMbmKNgBlHFgPEUNwusBIPAAQlS1xetTmxT0SDoESgdD0C4aACtHMwxytLrohawgA) - - ```ts - interface Article { - title: string; - thumbnail: string; - content: string; - } - - // Creates new type out of the `Article` interface composed - // from the Articles' two properties: `title` and `thumbnail`. - // `ArticlePreview = {title: string; thumbnail: string}` - type ArticlePreview = Pick; - - // Render a list of articles using only title and description. - function renderArticlePreviews(previews: ArticlePreview[]): HTMLElement { - const articles = document.createElement('div'); - - for (const preview of previews) { - // Append preview to the articles. - } - - return articles; - } - - const articles = renderArticlePreviews([ - { - title: 'TypeScript tutorial!', - thumbnail: '/assets/ts.jpg' - } - ]); - ``` -
- -- [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434) - Construct a type with a set of properties `K` of type `T`. -
- - Example - - - [Playground](https://typescript-play.js.org/?target=6#code/AQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA) - - ```ts - // Positions of employees in our company. - type MemberPosition = 'intern' | 'developer' | 'tech-lead'; - - // Interface describing properties of a single employee. - interface Employee { - firstName: string; - lastName: string; - yearsOfExperience: number; - } - - // Create an object that has all possible `MemberPosition` values set as keys. - // Those keys will store a collection of Employees of the same position. - const team: Record = { - intern: [], - developer: [], - 'tech-lead': [], - }; - - // Our team has decided to help John with his dream of becoming Software Developer. - team.intern.push({ - firstName: 'John', - lastName: 'Doe', - yearsOfExperience: 0 - }); - - // `Record` forces you to initialize all of the property keys. - // TypeScript Error: "tech-lead" property is missing - const teamEmpty: Record = { - intern: null, - developer: null, - }; - ``` -
- -- [`Exclude`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1436-L1439) - Exclude from `T` those types that are assignable to `U`. -
- - Example - - - [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+QRBhZhYJaAKAOkjogEkQZAQ4X2QAdwALCFbaemRgXmQtFjhOMFwq9K6ULuB0lk6U+HYwZAxJnQaYFhAEMGB8ZCIIMAAFOjAANR2IK0HGWISklIAedCgsKDwCYgAbQA5M9gQBdVzFQJ+JhiSRQMiUYYwayZCC4VHPCzmSzAspCYEBWxgFhQAZwKC+FpgJ43VwARgADH4ZFQSWSBjcZPJyPtDsdTvxKWBvr8rD1DCZoJ5HPopaYoK4EPhCEQmGKcKriLCtrhgEYkVQVT5Nr4fmZLLZtMBbFZgT0wGBqES6ghbHBIJqoBKFdBWQpjfh+DQbhY2tqiHVsbjLMVkAB+ZAAZiZaeQTHOVxu9ySjxNaujNwDVHNvzqbBGkBAdPoAfkQA) - - ```ts - interface ServerConfig { - port: null | string | number; - } - - type RequestHandler = (request: Request, response: Response) => void; - - // Exclude `null` type from `null | string | number`. - // In case the port is equal to `null`, we will use default value. - function getPortValue(port: Exclude): number { - if (typeof port === 'string') { - return parseInt(port, 10); - } - - return port; - } - - function startServer(handler: RequestHandler, config: ServerConfig): void { - const server = require('http').createServer(handler); - - const port = config.port === null ? 3000 : getPortValue(config.port); - server.listen(port); - } - ``` -
- -- [`Extract`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1441-L1444) - Extract from `T` those types that are assignable to `U`. -
- - Example - - - [Playground](https://typescript-play.js.org/?target=6#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+BxEeAAHY1NgKAwoIKy0grr4DByEUpgccpgMaXgAaxBerCzi+B9-ZulygDouFHRsU1z8kKMYE1RhaqgAHkt4AHkWACt4EAAPbVRgLLWNgBp9gGlBs8uQa6yAUUuYPQwdgNpKM7nh7mMML4CgA+R5WABqUAgpDeVxuhxO1he0jsXGh8EoOBO9COx3BQPo2PBADckaR6IjkSA6PBqTgsMBzPsicdrEC7OJWXSQNwYvFEgAVTS9JLXODpeDpKBZFg4GCoWa8VACIJykAKiQWKy2YQOAioYikCg0OEMDyhRSy4DyxS24KhAAMjyi6gS8AAwjh5OD0iBFHAkJoEOksC1mnkMJq8gUQKDNttKPlnfrwYp3J5XfBHXqoKpfYkAOI4ansTxaeDADmoRSCCBYAbxhC6TDx6rwYHIRX5bScjA4bLJwoDmDwDkfbA9JMrVMVdM1TN69LgkTgwgkchUahqIA) - - ```ts - declare function uniqueId(): number; - - const ID = Symbol('ID'); - - interface Person { - [ID]: number; - name: string; - age: number; - } - - // Allows changing the person data as long as the property key is of string type. - function changePersonData< - Obj extends Person, - Key extends Extract, - Value extends Obj[Key] - > (obj: Obj, key: Key, value: Value): void { - obj[key] = value; - } - - // Tiny Andrew was born. - const andrew = { - [ID]: uniqueId(), - name: 'Andrew', - age: 0, - }; - - // Cool, we're fine with that. - changePersonData(andrew, 'name', 'Pony'); - - // Goverment didn't like the fact that you wanted to change your identity. - changePersonData(andrew, ID, uniqueId()); - ``` -
- -- [`NonNullable`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1446-L1449) - Exclude `null` and `undefined` from `T`. -
- - Example - - Works with strictNullChecks set to true. (Read more here) - - [Playground](https://typescript-play.js.org/?target=6#code/C4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA) - - ```ts - type PortNumber = string | number | null; - - /** Part of a class definition that is used to build a server */ - class ServerBuilder { - portNumber!: NonNullable; - - port(this: ServerBuilder, port: PortNumber): ServerBuilder { - if (port == null) { - this.portNumber = 8000; - } else { - this.portNumber = port; - } - - return this; - } - } - - const serverBuilder = new ServerBuilder(); - - serverBuilder - .port('8000') // portNumber = '8000' - .port(null) // portNumber = 8000 - .port(3000); // portNumber = 3000 - - // TypeScript error - serverBuilder.portNumber = null; - ``` -
- -- [`Parameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1451-L1454) - Obtain the parameters of a function type in a tuple. -
- - Example - - - [Playground](https://typescript-play.js.org/?target=6#code/GYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeygJmThgOYgcGFYcbhqApCJsyhtpWXcR1cnEePBoeDAABVPzgbTixFeFd8uEsClADcIxGiygIFkSEOT3SmTc2VydQeRx+ZxwF2QQ34gkEwDgsnSuFmMBKiAADEDjIhYk1Qm0OlSYABqZnYka4xA1DJZHJYkGc7yCbyeRA+CAIZCzNAYbA4CIAdxg2zJwVCkWirjwMswuEaACYmCCgA) - - ```ts - function shuffle(input: any[]): void { - // Mutate array randomly changing its' elements indexes. - } - - function callNTimes any> (func: Fn, callCount: number) { - // Type that represents the type of the received function parameters. - type FunctionParameters = Parameters; - - return function (...args: FunctionParameters) { - for (let i = 0; i < callCount; i++) { - func(...args); - } - } - } - - const shuffleTwice = callNTimes(shuffle, 2); - ``` -
- -- [`ConstructorParameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1456-L1459) - Obtain the parameters of a constructor function type in a tuple. -
- - Example - - - [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECCBOAXAlqApgWQPYBM0mgG8AoaaFRENALmgkXmQDsBzAblOmCycTV4D8teo1YdO3JiICuwRFngAKClWENmLAJRFOZRAAtkEAHQq00ALzlklNBzIBfYk+KhIMAJJTEYJsDQAwmDA+mgAPAAq0GgAHnxMODCKTGgA7tCKxllg8CwQtL4AngDaALraFgB80EWa1SRkAA6MAG5gfNAB4FABPDJyCrQR9tDNyG0dwMGhtBhgjWEiGgA00F70vv4RhY3hEZXVVinpc42KmuJkkv3y8Bly8EPaDWTkhiZd7r3e8LK3llwGCMXGQWGhEOsfH5zJlsrl8p0+gw-goAAo5MAAW3BaHgEEilU0tEhmzQ212BJ0ry4SOg+kg+gBBiMximIGA0nAfAQLGk2N4EAAEgzYcYcnkLsRdDTvNEYkYUKwSdCme9WdM0MYwYhFPSIPpJdTkAAzDKxBUaZX+aAAQgsVmkCTQxuYaBw2ng4Ok8CYcotSu8pMur09iG9vuObxZnx6SN+AyUWTF8MN0CcZE4Ywm5jZHK5aB5fP4iCFIqT4oRRTKRLo6lYVNeAHpG50wOzOe1zHr9NLQ+HoABybsD4HOKXXRA1JCoKhBELmI5pNaB6Fz0KKBAodDYPAgSUTmqYsAALx4m5nC6nW9nGq14KtaEUA9gR9PvuNCjQ9BgACNvcwNBtAcLiAA) - - ```ts - class ArticleModel { - title: string; - content?: string; - - constructor(title: string) { - this.title = title; - } - } - - class InstanceCache any)> { - private ClassConstructor: T; - private cache: Map> = new Map(); - - constructor (ctr: T) { - this.ClassConstructor = ctr; - } - - getInstance (...args: ConstructorParameters): InstanceType { - const hash = this.calculateArgumentsHash(...args); - - const existingInstance = this.cache.get(hash); - if (existingInstance !== undefined) { - return existingInstance; - } - - return new this.ClassConstructor(...args); - } - - private calculateArgumentsHash(...args: any[]): string { - // Calculate hash. - return 'hash'; - } - } - - const articleCache = new InstanceCache(ArticleModel); - const amazonArticle = articleCache.getInstance('Amazon forests burining!'); - ``` -
- -- [`ReturnType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1461-L1464) – Obtain the return type of a function type. -
- - Example - - - [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) - - ```ts - /** Provides every element of the iterable `iter` into the `callback` function and stores the results in an array. */ - function mapIter< - Elem, - Func extends (elem: Elem) => any, - Ret extends ReturnType - >(iter: Iterable, callback: Func): Ret[] { - const mapped: Ret[] = []; - - for (const elem of iter) { - mapped.push(callback(elem)); - } - - return mapped; - } - - const setObject: Set = new Set(); - const mapObject: Map = new Map(); - - mapIter(setObject, (value: string) => value.indexOf('Foo')); // number[] - - mapIter(mapObject, ([key, value]: [number, string]) => { - return key % 2 === 0 ? value : 'Odd'; - }); // string[] - ``` -
- -- [`InstanceType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1466-L1469) – Obtain the instance type of a constructor function type. -
- - Example - - - [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) - - ```ts - class IdleService { - doNothing (): void {} - } - - class News { - title: string; - content: string; - - constructor(title: string, content: string) { - this.title = title; - this.content = content; - } - } - - const instanceCounter: Map = new Map(); - - interface Constructor { - new(...args: any[]): any; - } - - // Keep track how many instances of `Constr` constructor have been created. - function getInstance< - Constr extends Constructor, - Args extends ConstructorParameters - >(constructor: Constr, ...args: Args): InstanceType { - let count = instanceCounter.get(constructor) || 0; - - const instance = new constructor(...args); - - instanceCounter.set(constructor, count + 1); - - console.log(`Created ${count + 1} instances of ${Constr.name} class`); - - return instance; - } - - - const idleService = getInstance(IdleService); - // Will log: `Created 1 instances of IdleService class` - const newsEntry = getInstance(News, 'New ECMAScript proposals!', 'Last month...'); - // Will log: `Created 1 instances of News class` - ``` -
- -- [`Omit`](https://github.com/microsoft/TypeScript/blob/71af02f7459dc812e85ac31365bfe23daf14b4e4/src/lib/es5.d.ts#L1446) – Constructs a type by picking all properties from T and then removing K. -
- - Example - - - [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgIImAWzgG2QbwChlks4BzCAVShwC5kBnMKUcgbmKYAcIFgIjBs1YgOXMpSFMWbANoBdTiW5woFddwAW0kfKWEAvoUIB6U8gDCUCHEiNkICAHdkYAJ69kz4GC3JcPG4oAHteKDABBxCYNAxsPFBIWEQUCAAPJG4wZABySUFcgJAAEzMLXNV1ck0dIuCw6EjBADpy5AB1FAQ4EGQAV0YUP2AHDy8wEOQbUugmBLwtEIA3OcmQnEjuZBgQqE7gAGtgZAhwKHdkHFGwNvGUdDIcAGUliIBJEF3kAF5kAHlML4ADyPBIAGjyBUYRQAPnkqho4NoYQA+TiEGD9EAISIhPozErQMG4AASK2gn2+AApek9pCSXm8wFSQooAJQMUkAFQAsgAZACiOAgmDOOSIJAQ+OYyGl4DgoDmf2QJRCCH6YvALQQNjsEGFovF1NyJWAy1y7OUyHMyE+yRAuFImG4Iq1YDswHxbRINjA-SgfXlHqVUE4xiAA) - - ```ts - interface Animal { - imageUrl: string; - species: string; - images: string[]; - paragraphs: string[]; - } - - // Creates new type with all properties of the `Animal` interface - // except 'images' and 'paragraphs' properties. We can use this - // type to render small hover tooltip for a wiki entry list. - type AnimalShortInfo = Omit; - - function renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement { - const container = document.createElement('div'); - // Internal implementation. - return container; - } - ``` -
- -- [`Uppercase`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#template-literal-types) - Transforms every character in a string into uppercase. -
- - Example - - - ```ts - type T = Uppercase<'hello'>; // 'HELLO' - - type T2 = Uppercase<'foo' | 'bar'>; // 'FOO' | 'BAR' - - type T3 = Uppercase<`aB${S}`>; - type T4 = T30<'xYz'>; // 'ABXYZ' - - type T5 = Uppercase; // string - type T6 = Uppercase; // any - type T7 = Uppercase; // never - type T8 = Uppercase<42>; // Error, type 'number' does not satisfy the constraint 'string' - ``` -
- -- [`Lowercase`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#template-literal-types) - Transforms every character in a string into lowercase. -
- - Example - - - ```ts - type T = Lowercase<'HELLO'>; // 'hello' - - type T2 = Lowercase<'FOO' | 'BAR'>; // 'foo' | 'bar' - - type T3 = Lowercase<`aB${S}`>; - type T4 = T32<'xYz'>; // 'abxyz' - - type T5 = Lowercase; // string - type T6 = Lowercase; // any - type T7 = Lowercase; // never - type T8 = Lowercase<42>; // Error, type 'number' does not satisfy the constraint 'string' - ``` -
- -- [`Capitalize`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#template-literal-types) - Transforms the first character in a string into uppercase. -
- - Example - - - ```ts - type T = Capitalize<'hello'>; // 'Hello' - - type T2 = Capitalize<'foo' | 'bar'>; // 'Foo' | 'Bar' - - type T3 = Capitalize<`aB${S}`>; - type T4 = T32<'xYz'>; // 'ABxYz' - - type T5 = Capitalize; // string - type T6 = Capitalize; // any - type T7 = Capitalize; // never - type T8 = Capitalize<42>; // Error, type 'number' does not satisfy the constraint 'string' - ``` -
- -- [`Uncapitalize`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#template-literal-types) - Transforms the first character in a string into lowercase. -
- - Example - - - ```ts - type T = Uncapitalize<'Hello'>; // 'hello' - - type T2 = Uncapitalize<'Foo' | 'Bar'>; // 'foo' | 'bar' - - type T3 = Uncapitalize<`AB${S}`>; - type T4 = T30<'xYz'>; // 'aBxYz' - - type T5 = Uncapitalize; // string - type T6 = Uncapitalize; // any - type T7 = Uncapitalize; // never - type T8 = Uncapitalize<42>; // Error, type 'number' does not satisfy the constraint 'string' - ``` -
- -You can find some examples in the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/advanced-types.html#predefined-conditional-types). - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Jarek Radosz](https://github.com/CvX) -- [Dimitri Benin](https://github.com/BendingBender) -- [Pelle Wessman](https://github.com/voxpelli) - -## License - -(MIT OR CC0-1.0) - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/node_modules/type-fest/source/async-return-type.d.ts b/node_modules/type-fest/source/async-return-type.d.ts deleted file mode 100644 index 1f2c46aaa..000000000 --- a/node_modules/type-fest/source/async-return-type.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {PromiseValue} from './promise-value'; - -type AsyncFunction = (...args: any[]) => Promise; - -/** -Unwrap the return type of a function that returns a `Promise`. - -There has been [discussion](https://github.com/microsoft/TypeScript/pull/35998) about implementing this type in TypeScript. - -@example -```ts -import {AsyncReturnType} from 'type-fest'; -import {asyncFunction} from 'api'; - -// This type resolves to the unwrapped return type of `asyncFunction`. -type Value = AsyncReturnType; - -async function doSomething(value: Value) {} - -asyncFunction().then(value => doSomething(value)); -``` - -@category Utilities -*/ -export type AsyncReturnType = PromiseValue>; diff --git a/node_modules/type-fest/source/asyncify.d.ts b/node_modules/type-fest/source/asyncify.d.ts deleted file mode 100644 index e88d99053..000000000 --- a/node_modules/type-fest/source/asyncify.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import {PromiseValue} from './promise-value'; -import {SetReturnType} from './set-return-type'; - -/** -Create an async version of the given function type, by boxing the return type in `Promise` while keeping the same parameter types. - -Use-case: You have two functions, one synchronous and one asynchronous that do the same thing. Instead of having to duplicate the type definition, you can use `Asyncify` to reuse the synchronous type. - -@example -``` -import {Asyncify} from 'type-fest'; - -// Synchronous function. -function getFooSync(someArg: SomeType): Foo { - // … -} - -type AsyncifiedFooGetter = Asyncify; -//=> type AsyncifiedFooGetter = (someArg: SomeType) => Promise; - -// Same as `getFooSync` but asynchronous. -const getFooAsync: AsyncifiedFooGetter = (someArg) => { - // TypeScript now knows that `someArg` is `SomeType` automatically. - // It also knows that this function must return `Promise`. - // If you have `@typescript-eslint/promise-function-async` linter rule enabled, it will even report that "Functions that return promises must be async.". - - // … -} -``` - -@category Utilities -*/ -export type Asyncify any> = SetReturnType>>>; diff --git a/node_modules/type-fest/source/basic.d.ts b/node_modules/type-fest/source/basic.d.ts deleted file mode 100644 index 322aa0ad9..000000000 --- a/node_modules/type-fest/source/basic.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -// TODO: Remove the `= unknown` sometime in the future when most users are on TS 3.5 as it's now the default -/** -Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). - -@category Basic -*/ -export type Class = new(...arguments_: Arguments) => T; - -/** -Matches a JSON object. - -This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`. - -@category Basic -*/ -export type JsonObject = {[Key in string]?: JsonValue}; - -/** -Matches a JSON array. - -@category Basic -*/ -export interface JsonArray extends Array {} -// TODO: Make it this when targeting TypeScript 4.1: -// export type JsonArray = JsonValue[]; - -/** -Matches any valid JSON value. - -@category Basic -*/ -export type JsonValue = string | number | boolean | null | JsonObject | JsonArray; diff --git a/node_modules/type-fest/source/conditional-except.d.ts b/node_modules/type-fest/source/conditional-except.d.ts deleted file mode 100644 index 79295aea8..000000000 --- a/node_modules/type-fest/source/conditional-except.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import {Except} from './except'; -import {ConditionalKeys} from './conditional-keys'; - -/** -Exclude keys from a shape that matches the given `Condition`. - -This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties. - -@example -``` -import {Primitive, ConditionalExcept} from 'type-fest'; - -class Awesome { - name: string; - successes: number; - failures: bigint; - - run() {} -} - -type ExceptPrimitivesFromAwesome = ConditionalExcept; -//=> {run: () => void} -``` - -@example -``` -import {ConditionalExcept} from 'type-fest'; - -interface Example { - a: string; - b: string | number; - c: () => void; - d: {}; -} - -type NonStringKeysOnly = ConditionalExcept; -//=> {b: string | number; c: () => void; d: {}} -``` - -@category Utilities -*/ -export type ConditionalExcept = Except< - Base, - ConditionalKeys ->; diff --git a/node_modules/type-fest/source/conditional-keys.d.ts b/node_modules/type-fest/source/conditional-keys.d.ts deleted file mode 100644 index a422fd83a..000000000 --- a/node_modules/type-fest/source/conditional-keys.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** -Extract the keys from a type where the value type of the key extends the given `Condition`. - -Internally this is used for the `ConditionalPick` and `ConditionalExcept` types. - -@example -``` -import {ConditionalKeys} from 'type-fest'; - -interface Example { - a: string; - b: string | number; - c?: string; - d: {}; -} - -type StringKeysOnly = ConditionalKeys; -//=> 'a' -``` - -To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below. - -@example -``` -type StringKeysAndUndefined = ConditionalKeys; -//=> 'a' | 'c' -``` - -@category Utilities -*/ -export type ConditionalKeys = NonNullable< - // Wrap in `NonNullable` to strip away the `undefined` type from the produced union. - { - // Map through all the keys of the given base type. - [Key in keyof Base]: - // Pick only keys with types extending the given `Condition` type. - Base[Key] extends Condition - // Retain this key since the condition passes. - ? Key - // Discard this key since the condition fails. - : never; - - // Convert the produced object into a union type of the keys which passed the conditional test. - }[keyof Base] ->; diff --git a/node_modules/type-fest/source/conditional-pick.d.ts b/node_modules/type-fest/source/conditional-pick.d.ts deleted file mode 100644 index 5e1472a2e..000000000 --- a/node_modules/type-fest/source/conditional-pick.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import {ConditionalKeys} from './conditional-keys'; - -/** -Pick keys from the shape that matches the given `Condition`. - -This is useful when you want to create a new type from a specific subset of an existing type. For example, you might want to pick all the primitive properties from a class and form a new automatically derived type. - -@example -``` -import {Primitive, ConditionalPick} from 'type-fest'; - -class Awesome { - name: string; - successes: number; - failures: bigint; - - run() {} -} - -type PickPrimitivesFromAwesome = ConditionalPick; -//=> {name: string; successes: number; failures: bigint} -``` - -@example -``` -import {ConditionalPick} from 'type-fest'; - -interface Example { - a: string; - b: string | number; - c: () => void; - d: {}; -} - -type StringKeysOnly = ConditionalPick; -//=> {a: string} -``` - -@category Utilities -*/ -export type ConditionalPick = Pick< - Base, - ConditionalKeys ->; diff --git a/node_modules/type-fest/source/entries.d.ts b/node_modules/type-fest/source/entries.d.ts deleted file mode 100644 index a48fa1e03..000000000 --- a/node_modules/type-fest/source/entries.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import {ArrayEntry, MapEntry, ObjectEntry, SetEntry} from './entry'; - -type ArrayEntries = Array>; -type MapEntries = Array>; -type ObjectEntries = Array>; -type SetEntries> = Array>; - -/** -Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entries` type will return the type of that collection's entries. - -For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable. - -@see `Entry` if you want to just access the type of a single entry. - -@example -``` -import {Entries} from 'type-fest'; - -interface Example { - someKey: number; -} - -const manipulatesEntries = (examples: Entries) => examples.map(example => [ - // Does some arbitrary processing on the key (with type information available) - example[0].toUpperCase(), - - // Does some arbitrary processing on the value (with type information available) - example[1].toFixed() -]); - -const example: Example = {someKey: 1}; -const entries = Object.entries(example) as Entries; -const output = manipulatesEntries(entries); - -// Objects -const objectExample = {a: 1}; -const objectEntries: Entries = [['a', 1]]; - -// Arrays -const arrayExample = ['a', 1]; -const arrayEntries: Entries = [[0, 'a'], [1, 1]]; - -// Maps -const mapExample = new Map([['a', 1]]); -const mapEntries: Entries = [['a', 1]]; - -// Sets -const setExample = new Set(['a', 1]); -const setEntries: Entries = [['a', 'a'], [1, 1]]; -``` - -@category Utilities -*/ -export type Entries = - BaseType extends Map ? MapEntries - : BaseType extends Set ? SetEntries - : BaseType extends unknown[] ? ArrayEntries - : BaseType extends object ? ObjectEntries - : never; diff --git a/node_modules/type-fest/source/entry.d.ts b/node_modules/type-fest/source/entry.d.ts deleted file mode 100644 index 869e51e62..000000000 --- a/node_modules/type-fest/source/entry.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -type MapKey = BaseType extends Map ? KeyType : never; -type MapValue = BaseType extends Map ? ValueType : never; - -export type ArrayEntry = [number, BaseType[number]]; -export type MapEntry = [MapKey, MapValue]; -export type ObjectEntry = [keyof BaseType, BaseType[keyof BaseType]]; -export type SetEntry = BaseType extends Set ? [ItemType, ItemType] : never; - -/** -Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entry` type will return the type of that collection's entry. - -For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable. - -@see `Entries` if you want to just access the type of the array of entries (which is the return of the `.entries()` method). - -@example -``` -import {Entry} from 'type-fest'; - -interface Example { - someKey: number; -} - -const manipulatesEntry = (example: Entry) => [ - // Does some arbitrary processing on the key (with type information available) - example[0].toUpperCase(), - - // Does some arbitrary processing on the value (with type information available) - example[1].toFixed(), -]; - -const example: Example = {someKey: 1}; -const entry = Object.entries(example)[0] as Entry; -const output = manipulatesEntry(entry); - -// Objects -const objectExample = {a: 1}; -const objectEntry: Entry = ['a', 1]; - -// Arrays -const arrayExample = ['a', 1]; -const arrayEntryString: Entry = [0, 'a']; -const arrayEntryNumber: Entry = [1, 1]; - -// Maps -const mapExample = new Map([['a', 1]]); -const mapEntry: Entry = ['a', 1]; - -// Sets -const setExample = new Set(['a', 1]); -const setEntryString: Entry = ['a', 'a']; -const setEntryNumber: Entry = [1, 1]; -``` - -@category Utilities -*/ -export type Entry = - BaseType extends Map ? MapEntry - : BaseType extends Set ? SetEntry - : BaseType extends unknown[] ? ArrayEntry - : BaseType extends object ? ObjectEntry - : never; diff --git a/node_modules/type-fest/source/except.d.ts b/node_modules/type-fest/source/except.d.ts deleted file mode 100644 index ad542580c..000000000 --- a/node_modules/type-fest/source/except.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** -Create a type from an object type without certain keys. - -This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically. - -This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)). - -@example -``` -import {Except} from 'type-fest'; - -type Foo = { - a: number; - b: string; - c: boolean; -}; - -type FooWithoutA = Except; -//=> {b: string}; -``` - -@category Utilities -*/ -export type Except = Pick>; diff --git a/node_modules/type-fest/source/fixed-length-array.d.ts b/node_modules/type-fest/source/fixed-length-array.d.ts deleted file mode 100644 index e7711e479..000000000 --- a/node_modules/type-fest/source/fixed-length-array.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** -Methods to exclude. -*/ -type ArrayLengthMutationKeys = 'splice' | 'push' | 'pop' | 'shift' | 'unshift'; - -/** -Create a type that represents an array of the given type and length. The array's length and the `Array` prototype methods that manipulate its length are excluded in the resulting type. - -Please participate in [this issue](https://github.com/microsoft/TypeScript/issues/26223) if you want to have a similiar type built into TypeScript. - -Use-cases: -- Declaring fixed-length tuples or arrays with a large number of items. -- Creating a range union (for example, `0 | 1 | 2 | 3 | 4` from the keys of such a type) without having to resort to recursive types. -- Creating an array of coordinates with a static length, for example, length of 3 for a 3D vector. - -@example -``` -import {FixedLengthArray} from 'type-fest'; - -type FencingTeam = FixedLengthArray; - -const guestFencingTeam: FencingTeam = ['Josh', 'Michael', 'Robert']; - -const homeFencingTeam: FencingTeam = ['George', 'John']; -//=> error TS2322: Type string[] is not assignable to type 'FencingTeam' - -guestFencingTeam.push('Sam'); -//=> error TS2339: Property 'push' does not exist on type 'FencingTeam' -``` - -@category Utilities -*/ -export type FixedLengthArray = Pick< - ArrayPrototype, - Exclude -> & { - [index: number]: Element; - [Symbol.iterator]: () => IterableIterator; - readonly length: Length; -}; diff --git a/node_modules/type-fest/source/iterable-element.d.ts b/node_modules/type-fest/source/iterable-element.d.ts deleted file mode 100644 index f53a3f5d0..000000000 --- a/node_modules/type-fest/source/iterable-element.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** -Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator. - -This can be useful, for example, if you want to get the type that is yielded in a generator function. Often the return type of those functions are not specified. - -This type works with both `Iterable`s and `AsyncIterable`s, so it can be use with synchronous and asynchronous generators. - -Here is an example of `IterableElement` in action with a generator function: - -@example -``` -function * iAmGenerator() { - yield 1; - yield 2; -} - -type MeNumber = IterableElement> -``` - -And here is an example with an async generator: - -@example -``` -async function * iAmGeneratorAsync() { - yield 'hi'; - yield true; -} - -type MeStringOrBoolean = IterableElement> -``` - -Many types in JavaScript/TypeScript are iterables. This type works on all types that implement those interfaces. For example, `Array`, `Set`, `Map`, `stream.Readable`, etc. - -An example with an array of strings: - -@example -``` -type MeString = IterableElement -``` - -@category Utilities -*/ -export type IterableElement = - TargetIterable extends Iterable ? - ElementType : - TargetIterable extends AsyncIterable ? - ElementType : - never; diff --git a/node_modules/type-fest/source/literal-union.d.ts b/node_modules/type-fest/source/literal-union.d.ts deleted file mode 100644 index 3544bf66c..000000000 --- a/node_modules/type-fest/source/literal-union.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {Primitive} from './primitive'; - -/** -Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. - -Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals. - -This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore. - -@example -``` -import {LiteralUnion} from 'type-fest'; - -// Before - -type Pet = 'dog' | 'cat' | string; - -const pet: Pet = ''; -// Start typing in your TypeScript-enabled IDE. -// You **will not** get auto-completion for `dog` and `cat` literals. - -// After - -type Pet2 = LiteralUnion<'dog' | 'cat', string>; - -const pet: Pet2 = ''; -// You **will** get auto-completion for `dog` and `cat` literals. -``` - -@category Utilities - */ -export type LiteralUnion< - LiteralType, - BaseType extends Primitive -> = LiteralType | (BaseType & {_?: never}); diff --git a/node_modules/type-fest/source/merge-exclusive.d.ts b/node_modules/type-fest/source/merge-exclusive.d.ts deleted file mode 100644 index 47d922144..000000000 --- a/node_modules/type-fest/source/merge-exclusive.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Helper type. Not useful on its own. -type Without = {[KeyType in Exclude]?: never}; - -/** -Create a type that has mutually exclusive keys. - -This type was inspired by [this comment](https://github.com/Microsoft/TypeScript/issues/14094#issuecomment-373782604). - -This type works with a helper type, called `Without`. `Without` produces a type that has only keys from `FirstType` which are not present on `SecondType` and sets the value type for these keys to `never`. This helper type is then used in `MergeExclusive` to remove keys from either `FirstType` or `SecondType`. - -@example -``` -import {MergeExclusive} from 'type-fest'; - -interface ExclusiveVariation1 { - exclusive1: boolean; -} - -interface ExclusiveVariation2 { - exclusive2: string; -} - -type ExclusiveOptions = MergeExclusive; - -let exclusiveOptions: ExclusiveOptions; - -exclusiveOptions = {exclusive1: true}; -//=> Works -exclusiveOptions = {exclusive2: 'hi'}; -//=> Works -exclusiveOptions = {exclusive1: true, exclusive2: 'hi'}; -//=> Error -``` - -@category Utilities -*/ -export type MergeExclusive = - (FirstType | SecondType) extends object ? - (Without & SecondType) | (Without & FirstType) : - FirstType | SecondType; - diff --git a/node_modules/type-fest/source/merge.d.ts b/node_modules/type-fest/source/merge.d.ts deleted file mode 100644 index d6371f1b6..000000000 --- a/node_modules/type-fest/source/merge.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import {Except} from './except'; -import {Simplify} from './simplify'; - -type Merge_ = Except> & SecondType; - -/** -Merge two types into a new type. Keys of the second type overrides keys of the first type. - -@example -``` -import {Merge} from 'type-fest'; - -type Foo = { - a: number; - b: string; -}; - -type Bar = { - b: number; -}; - -const ab: Merge = {a: 1, b: 2}; -``` - -@category Utilities -*/ -export type Merge = Simplify>; diff --git a/node_modules/type-fest/source/mutable.d.ts b/node_modules/type-fest/source/mutable.d.ts deleted file mode 100644 index 852dece56..000000000 --- a/node_modules/type-fest/source/mutable.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {Except} from './except'; -import {Simplify} from './simplify'; - -/** -Create a type that strips `readonly` from all or some of an object's keys. Inverse of `Readonly`. - -This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509), or to define a single model where the only thing that changes is whether or not some of the keys are mutable. - -@example -``` -import {Mutable} from 'type-fest'; - -type Foo = { - readonly a: number; - readonly b: readonly string[]; // To show that only the mutability status of the properties, not their values, are affected. - readonly c: boolean; -}; - -const mutableFoo: Mutable = {a: 1, b: ['2'], c: true}; -mutableFoo.a = 3; -mutableFoo.b[0] = 'new value'; // Will still fail as the value of property "b" is still a readonly type. -mutableFoo.b = ['something']; // Will work as the "b" property itself is no longer readonly. - -type SomeMutable = Mutable; -// type SomeMutable = { -// readonly a: number; -// b: readonly string[]; // It's now mutable. The type of the property remains unaffected. -// c: boolean; // It's now mutable. -// } -``` - -@category Utilities -*/ -export type Mutable = - Simplify< - // Pick just the keys that are not mutable from the base type. - Except & - // Pick the keys that should be mutable from the base type and make them mutable by removing the `readonly` modifier from the key. - {-readonly [KeyType in keyof Pick]: Pick[KeyType]} - >; diff --git a/node_modules/type-fest/source/observable-like.d.ts b/node_modules/type-fest/source/observable-like.d.ts deleted file mode 100644 index 9b2e35b3b..000000000 --- a/node_modules/type-fest/source/observable-like.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -declare global { - interface SymbolConstructor { - readonly observable: symbol; - } -} - -/** -Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). - -@category Basic -*/ -export interface ObservableLike { - subscribe(observer: (value: unknown) => void): void; - [Symbol.observable](): ObservableLike; -} diff --git a/node_modules/type-fest/source/opaque.d.ts b/node_modules/type-fest/source/opaque.d.ts deleted file mode 100644 index f22cb248a..000000000 --- a/node_modules/type-fest/source/opaque.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** -Create an opaque type, which hides its internal details from the public, and can only be created by being used explicitly. - -The generic type parameter can be anything. It doesn't have to be an object. - -[Read more about opaque types.](https://codemix.com/opaque-types-in-javascript/) - -There have been several discussions about adding this feature to TypeScript via the `opaque type` operator, similar to how Flow does it. Unfortunately, nothing has (yet) moved forward: - - [Microsoft/TypeScript#15408](https://github.com/Microsoft/TypeScript/issues/15408) - - [Microsoft/TypeScript#15807](https://github.com/Microsoft/TypeScript/issues/15807) - -@example -``` -import {Opaque} from 'type-fest'; - -type AccountNumber = Opaque; -type AccountBalance = Opaque; - -// The Token parameter allows the compiler to differentiate between types, whereas "unknown" will not. For example, consider the following structures: -type ThingOne = Opaque; -type ThingTwo = Opaque; - -// To the compiler, these types are allowed to be cast to each other as they have the same underlying type. They are both `string & { __opaque__: unknown }`. -// To avoid this behaviour, you would instead pass the "Token" parameter, like so. -type NewThingOne = Opaque; -type NewThingTwo = Opaque; - -// Now they're completely separate types, so the following will fail to compile. -function createNewThingOne (): NewThingOne { - // As you can see, casting from a string is still allowed. However, you may not cast NewThingOne to NewThingTwo, and vice versa. - return 'new thing one' as NewThingOne; -} - -// This will fail to compile, as they are fundamentally different types. -const thingTwo = createNewThingOne() as NewThingTwo; - -// Here's another example of opaque typing. -function createAccountNumber(): AccountNumber { - return 2 as AccountNumber; -} - -function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance { - return 4 as AccountBalance; -} - -// This will compile successfully. -getMoneyForAccount(createAccountNumber()); - -// But this won't, because it has to be explicitly passed as an `AccountNumber` type. -getMoneyForAccount(2); - -// You can use opaque values like they aren't opaque too. -const accountNumber = createAccountNumber(); - -// This will not compile successfully. -const newAccountNumber = accountNumber + 2; - -// As a side note, you can (and should) use recursive types for your opaque types to make them stronger and hopefully easier to type. -type Person = { - id: Opaque; - name: string; -}; -``` - -@category Utilities -*/ -export type Opaque = Type & {readonly __opaque__: Token}; diff --git a/node_modules/type-fest/source/package-json.d.ts b/node_modules/type-fest/source/package-json.d.ts deleted file mode 100644 index bb985bffb..000000000 --- a/node_modules/type-fest/source/package-json.d.ts +++ /dev/null @@ -1,645 +0,0 @@ -import {LiteralUnion} from './literal-union'; - -declare namespace PackageJson { - /** - A person who has been involved in creating or maintaining the package. - */ - export type Person = - | string - | { - name: string; - url?: string; - email?: string; - }; - - export type BugsLocation = - | string - | { - /** - The URL to the package's issue tracker. - */ - url?: string; - - /** - The email address to which issues should be reported. - */ - email?: string; - }; - - export interface DirectoryLocations { - [directoryType: string]: unknown; - - /** - Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder. - */ - bin?: string; - - /** - Location for Markdown files. - */ - doc?: string; - - /** - Location for example scripts. - */ - example?: string; - - /** - Location for the bulk of the library. - */ - lib?: string; - - /** - Location for man pages. Sugar to generate a `man` array by walking the folder. - */ - man?: string; - - /** - Location for test files. - */ - test?: string; - } - - export type Scripts = { - /** - Run **before** the package is published (Also run on local `npm install` without any arguments). - */ - prepublish?: string; - - /** - Run both **before** the package is packed and published, and on local `npm install` without any arguments. This is run **after** `prepublish`, but **before** `prepublishOnly`. - */ - prepare?: string; - - /** - Run **before** the package is prepared and packed, **only** on `npm publish`. - */ - prepublishOnly?: string; - - /** - Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies). - */ - prepack?: string; - - /** - Run **after** the tarball has been generated and moved to its final destination. - */ - postpack?: string; - - /** - Run **after** the package is published. - */ - publish?: string; - - /** - Run **after** the package is published. - */ - postpublish?: string; - - /** - Run **before** the package is installed. - */ - preinstall?: string; - - /** - Run **after** the package is installed. - */ - install?: string; - - /** - Run **after** the package is installed and after `install`. - */ - postinstall?: string; - - /** - Run **before** the package is uninstalled and before `uninstall`. - */ - preuninstall?: string; - - /** - Run **before** the package is uninstalled. - */ - uninstall?: string; - - /** - Run **after** the package is uninstalled. - */ - postuninstall?: string; - - /** - Run **before** bump the package version and before `version`. - */ - preversion?: string; - - /** - Run **before** bump the package version. - */ - version?: string; - - /** - Run **after** bump the package version. - */ - postversion?: string; - - /** - Run with the `npm test` command, before `test`. - */ - pretest?: string; - - /** - Run with the `npm test` command. - */ - test?: string; - - /** - Run with the `npm test` command, after `test`. - */ - posttest?: string; - - /** - Run with the `npm stop` command, before `stop`. - */ - prestop?: string; - - /** - Run with the `npm stop` command. - */ - stop?: string; - - /** - Run with the `npm stop` command, after `stop`. - */ - poststop?: string; - - /** - Run with the `npm start` command, before `start`. - */ - prestart?: string; - - /** - Run with the `npm start` command. - */ - start?: string; - - /** - Run with the `npm start` command, after `start`. - */ - poststart?: string; - - /** - Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. - */ - prerestart?: string; - - /** - Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. - */ - restart?: string; - - /** - Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. - */ - postrestart?: string; - } & Record; - - /** - Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL. - */ - export type Dependency = Record; - - /** - Conditions which provide a way to resolve a package entry point based on the environment. - */ - export type ExportCondition = LiteralUnion< - | 'import' - | 'require' - | 'node' - | 'deno' - | 'browser' - | 'electron' - | 'react-native' - | 'default', - string - >; - - /** - Entry points of a module, optionally with conditions and subpath exports. - */ - export type Exports = - | string - | string[] - | {[key in ExportCondition]: Exports} - | {[key: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style - - export interface NonStandardEntryPoints { - /** - An ECMAScript module ID that is the primary entry point to the program. - */ - module?: string; - - /** - A module ID with untranspiled code that is the primary entry point to the program. - */ - esnext?: - | string - | { - [moduleName: string]: string | undefined; - main?: string; - browser?: string; - }; - - /** - A hint to JavaScript bundlers or component tools when packaging modules for client side use. - */ - browser?: - | string - | Record; - - /** - Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused. - - [Read more.](https://webpack.js.org/guides/tree-shaking/) - */ - sideEffects?: boolean | string[]; - } - - export interface TypeScriptConfiguration { - /** - Location of the bundled TypeScript declaration file. - */ - types?: string; - - /** - Version selection map of TypeScript. - */ - typesVersions?: Record>; - - /** - Location of the bundled TypeScript declaration file. Alias of `types`. - */ - typings?: string; - } - - /** - An alternative configuration for Yarn workspaces. - */ - export interface WorkspaceConfig { - /** - An array of workspace pattern strings which contain the workspace packages. - */ - packages?: WorkspacePattern[]; - - /** - Designed to solve the problem of packages which break when their `node_modules` are moved to the root workspace directory - a process known as hoisting. For these packages, both within your workspace, and also some that have been installed via `node_modules`, it is important to have a mechanism for preventing the default Yarn workspace behavior. By adding workspace pattern strings here, Yarn will resume non-workspace behavior for any package which matches the defined patterns. - - [Read more](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) - */ - nohoist?: WorkspacePattern[]; - } - - /** - A workspace pattern points to a directory or group of directories which contain packages that should be included in the workspace installation process. - - The patterns are handled with [minimatch](https://github.com/isaacs/minimatch). - - @example - `docs` → Include the docs directory and install its dependencies. - `packages/*` → Include all nested directories within the packages directory, like `packages/cli` and `packages/core`. - */ - type WorkspacePattern = string; - - export interface YarnConfiguration { - /** - Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/). - - Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run `yarn install` once to install all of them in a single pass. - - Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces. - */ - workspaces?: WorkspacePattern[] | WorkspaceConfig; - - /** - If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`. - - Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an app), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line. - */ - flat?: boolean; - - /** - Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file. - */ - resolutions?: Dependency; - } - - export interface JSPMConfiguration { - /** - JSPM configuration. - */ - jspm?: PackageJson; - } - - /** - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Containing standard npm properties. - */ - export interface PackageJsonStandard { - /** - The name of the package. - */ - name?: string; - - /** - Package version, parseable by [`node-semver`](https://github.com/npm/node-semver). - */ - version?: string; - - /** - Package description, listed in `npm search`. - */ - description?: string; - - /** - Keywords associated with package, listed in `npm search`. - */ - keywords?: string[]; - - /** - The URL to the package's homepage. - */ - homepage?: LiteralUnion<'.', string>; - - /** - The URL to the package's issue tracker and/or the email address to which issues should be reported. - */ - bugs?: BugsLocation; - - /** - The license for the package. - */ - license?: string; - - /** - The licenses for the package. - */ - licenses?: Array<{ - type?: string; - url?: string; - }>; - - author?: Person; - - /** - A list of people who contributed to the package. - */ - contributors?: Person[]; - - /** - A list of people who maintain the package. - */ - maintainers?: Person[]; - - /** - The files included in the package. - */ - files?: string[]; - - /** - Resolution algorithm for importing ".js" files from the package's scope. - - [Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field) - */ - type?: 'module' | 'commonjs'; - - /** - The module ID that is the primary entry point to the program. - */ - main?: string; - - /** - Standard entry points of the package, with enhanced support for ECMAScript Modules. - - [Read more.](https://nodejs.org/api/esm.html#esm_package_entry_points) - */ - exports?: Exports; - - /** - The executable files that should be installed into the `PATH`. - */ - bin?: - | string - | Record; - - /** - Filenames to put in place for the `man` program to find. - */ - man?: string | string[]; - - /** - Indicates the structure of the package. - */ - directories?: DirectoryLocations; - - /** - Location for the code repository. - */ - repository?: - | string - | { - type: string; - url: string; - - /** - Relative path to package.json if it is placed in non-root directory (for example if it is part of a monorepo). - - [Read more.](https://github.com/npm/rfcs/blob/latest/implemented/0010-monorepo-subdirectory-declaration.md) - */ - directory?: string; - }; - - /** - Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point. - */ - scripts?: Scripts; - - /** - Is used to set configuration parameters used in package scripts that persist across upgrades. - */ - config?: Record; - - /** - The dependencies of the package. - */ - dependencies?: Dependency; - - /** - Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling. - */ - devDependencies?: Dependency; - - /** - Dependencies that are skipped if they fail to install. - */ - optionalDependencies?: Dependency; - - /** - Dependencies that will usually be required by the package user directly or via another dependency. - */ - peerDependencies?: Dependency; - - /** - Indicate peer dependencies that are optional. - */ - peerDependenciesMeta?: Record; - - /** - Package names that are bundled when the package is published. - */ - bundledDependencies?: string[]; - - /** - Alias of `bundledDependencies`. - */ - bundleDependencies?: string[]; - - /** - Engines that this package runs on. - */ - engines?: { - [EngineName in 'npm' | 'node' | string]: string; - }; - - /** - @deprecated - */ - engineStrict?: boolean; - - /** - Operating systems the module runs on. - */ - os?: Array>; - - /** - CPU architectures the module runs on. - */ - cpu?: Array>; - - /** - If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally. - - @deprecated - */ - preferGlobal?: boolean; - - /** - If set to `true`, then npm will refuse to publish it. - */ - private?: boolean; - - /** - A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default. - */ - publishConfig?: PublishConfig; - - /** - Describes and notifies consumers of a package's monetary support information. - - [Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md) - */ - funding?: string | { - /** - The type of funding. - */ - type?: LiteralUnion< - | 'github' - | 'opencollective' - | 'patreon' - | 'individual' - | 'foundation' - | 'corporation', - string - >; - - /** - The URL to the funding page. - */ - url: string; - }; - } - - export interface PublishConfig { - /** - Additional, less common properties from the [npm docs on `publishConfig`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig). - */ - [additionalProperties: string]: unknown; - - /** - When publishing scoped packages, the access level defaults to restricted. If you want your scoped package to be publicly viewable (and installable) set `--access=public`. The only valid values for access are public and restricted. Unscoped packages always have an access level of public. - */ - access?: 'public' | 'restricted'; - - /** - The base URL of the npm registry. - - Default: `'https://registry.npmjs.org/'` - */ - registry?: string; - - /** - The tag to publish the package under. - - Default: `'latest'` - */ - tag?: string; - } -} - -/** -Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn. - -@category Miscellaneous -*/ -export type PackageJson = -PackageJson.PackageJsonStandard & -PackageJson.NonStandardEntryPoints & -PackageJson.TypeScriptConfiguration & -PackageJson.YarnConfiguration & -PackageJson.JSPMConfiguration; diff --git a/node_modules/type-fest/source/partial-deep.d.ts b/node_modules/type-fest/source/partial-deep.d.ts deleted file mode 100644 index 572b77cab..000000000 --- a/node_modules/type-fest/source/partial-deep.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -import {Primitive} from './primitive'; - -/** -Create a type from another type with all keys and nested keys set to optional. - -Use-cases: -- Merging a default settings/config object with another object, the second object would be a deep partial of the default object. -- Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test. - -@example -``` -import {PartialDeep} from 'type-fest'; - -const settings: Settings = { - textEditor: { - fontSize: 14; - fontColor: '#000000'; - fontWeight: 400; - } - autocomplete: false; - autosave: true; -}; - -const applySavedSettings = (savedSettings: PartialDeep) => { - return {...settings, ...savedSettings}; -} - -settings = applySavedSettings({textEditor: {fontWeight: 500}}); -``` - -@category Utilities -*/ -export type PartialDeep = T extends Primitive - ? Partial - : T extends Map - ? PartialMapDeep - : T extends Set - ? PartialSetDeep - : T extends ReadonlyMap - ? PartialReadonlyMapDeep - : T extends ReadonlySet - ? PartialReadonlySetDeep - : T extends ((...arguments: any[]) => unknown) - ? T | undefined - : T extends object - ? PartialObjectDeep - : unknown; - -/** -Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`. -*/ -interface PartialMapDeep extends Map, PartialDeep> {} - -/** -Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`. -*/ -interface PartialSetDeep extends Set> {} - -/** -Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`. -*/ -interface PartialReadonlyMapDeep extends ReadonlyMap, PartialDeep> {} - -/** -Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`. -*/ -interface PartialReadonlySetDeep extends ReadonlySet> {} - -/** -Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`. -*/ -type PartialObjectDeep = { - [KeyType in keyof ObjectType]?: PartialDeep -}; diff --git a/node_modules/type-fest/source/primitive.d.ts b/node_modules/type-fest/source/primitive.d.ts deleted file mode 100644 index 5ad7a0b89..000000000 --- a/node_modules/type-fest/source/primitive.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** -Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). - -@category Basic -*/ -export type Primitive = - | null - | undefined - | string - | number - | boolean - | symbol - | bigint; diff --git a/node_modules/type-fest/source/promisable.d.ts b/node_modules/type-fest/source/promisable.d.ts deleted file mode 100644 index e26395931..000000000 --- a/node_modules/type-fest/source/promisable.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** -Create a type that represents either the value or the value wrapped in `PromiseLike`. - -Use-cases: -- A function accepts a callback that may either return a value synchronously or may return a promised value. -- This type could be the return type of `Promise#then()`, `Promise#catch()`, and `Promise#finally()` callbacks. - -Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394) if you want to have this type as a built-in in TypeScript. - -@example -``` -import {Promisable} from 'type-fest'; - -async function logger(getLogEntry: () => Promisable): Promise { - const entry = await getLogEntry(); - console.log(entry); -} - -logger(() => 'foo'); -logger(() => Promise.resolve('bar')); - -@category Utilities -``` -*/ -export type Promisable = T | PromiseLike; diff --git a/node_modules/type-fest/source/promise-value.d.ts b/node_modules/type-fest/source/promise-value.d.ts deleted file mode 100644 index b81e31fca..000000000 --- a/node_modules/type-fest/source/promise-value.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** -Returns the type that is wrapped inside a `Promise` type. -If the type is a nested Promise, it is unwrapped recursively until a non-Promise type is obtained. -If the type is not a `Promise`, the type itself is returned. - -@example -``` -import {PromiseValue} from 'type-fest'; - -type AsyncData = Promise; -let asyncData: PromiseValue = Promise.resolve('ABC'); - -type Data = PromiseValue; -let data: Data = await asyncData; - -// Here's an example that shows how this type reacts to non-Promise types. -type SyncData = PromiseValue; -let syncData: SyncData = getSyncData(); - -// Here's an example that shows how this type reacts to recursive Promise types. -type RecursiveAsyncData = Promise >; -let recursiveAsyncData: PromiseValue = Promise.resolve(Promise.resolve('ABC')); -``` - -@category Utilities -*/ -export type PromiseValue = PromiseType extends Promise - ? { 0: PromiseValue; 1: Value }[PromiseType extends Promise ? 0 : 1] - : Otherwise; diff --git a/node_modules/type-fest/source/readonly-deep.d.ts b/node_modules/type-fest/source/readonly-deep.d.ts deleted file mode 100644 index e70cf7291..000000000 --- a/node_modules/type-fest/source/readonly-deep.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import {Primitive} from './primitive'; - -/** -Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively. - -This is useful when a deeply nested structure needs to be exposed as completely immutable, for example, an imported JSON module or when receiving an API response that is passed around. - -Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/13923) if you want to have this type as a built-in in TypeScript. - -@example -``` -// data.json -{ - "foo": ["bar"] -} - -// main.ts -import {ReadonlyDeep} from 'type-fest'; -import dataJson = require('./data.json'); - -const data: ReadonlyDeep = dataJson; - -export default data; - -// test.ts -import data from './main'; - -data.foo.push('bar'); -//=> error TS2339: Property 'push' does not exist on type 'readonly string[]' -``` - -@category Utilities -*/ -export type ReadonlyDeep = T extends Primitive | ((...arguments: any[]) => unknown) - ? T - : T extends ReadonlyMap - ? ReadonlyMapDeep - : T extends ReadonlySet - ? ReadonlySetDeep - : T extends object - ? ReadonlyObjectDeep - : unknown; - -/** -Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`. -*/ -interface ReadonlyMapDeep - extends ReadonlyMap, ReadonlyDeep> {} - -/** -Same as `ReadonlyDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `ReadonlyDeep`. -*/ -interface ReadonlySetDeep - extends ReadonlySet> {} - -/** -Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`. -*/ -type ReadonlyObjectDeep = { - readonly [KeyType in keyof ObjectType]: ReadonlyDeep -}; diff --git a/node_modules/type-fest/source/require-at-least-one.d.ts b/node_modules/type-fest/source/require-at-least-one.d.ts deleted file mode 100644 index 59a06dcc3..000000000 --- a/node_modules/type-fest/source/require-at-least-one.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {Except} from './except'; - -/** -Create a type that requires at least one of the given keys. The remaining keys are kept as is. - -@example -``` -import {RequireAtLeastOne} from 'type-fest'; - -type Responder = { - text?: () => string; - json?: () => string; - - secure?: boolean; -}; - -const responder: RequireAtLeastOne = { - json: () => '{"message": "ok"}', - secure: true -}; -``` - -@category Utilities -*/ -export type RequireAtLeastOne< - ObjectType, - KeysType extends keyof ObjectType = keyof ObjectType -> = { - // For each `Key` in `KeysType` make a mapped type: - [Key in KeysType]-?: Required> & // 1. Make `Key`'s type required - // 2. Make all other keys in `KeysType` optional - Partial>>; -}[KeysType] & - // 3. Add the remaining keys not in `KeysType` - Except; diff --git a/node_modules/type-fest/source/require-exactly-one.d.ts b/node_modules/type-fest/source/require-exactly-one.d.ts deleted file mode 100644 index fc01aecc9..000000000 --- a/node_modules/type-fest/source/require-exactly-one.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -// TODO: Remove this when we target TypeScript >=3.5. -type _Omit = Pick>; - -/** -Create a type that requires exactly one of the given keys and disallows more. The remaining keys are kept as is. - -Use-cases: -- Creating interfaces for components that only need one of the keys to display properly. -- Declaring generic keys in a single place for a single use-case that gets narrowed down via `RequireExactlyOne`. - -The caveat with `RequireExactlyOne` is that TypeScript doesn't always know at compile time every key that will exist at runtime. Therefore `RequireExactlyOne` can't do anything to prevent extra keys it doesn't know about. - -@example -``` -import {RequireExactlyOne} from 'type-fest'; - -type Responder = { - text: () => string; - json: () => string; - secure: boolean; -}; - -const responder: RequireExactlyOne = { - // Adding a `text` key here would cause a compile error. - - json: () => '{"message": "ok"}', - secure: true -}; -``` - -@category Utilities -*/ -export type RequireExactlyOne = - {[Key in KeysType]: ( - Required> & - Partial, never>> - )}[KeysType] & _Omit; diff --git a/node_modules/type-fest/source/set-optional.d.ts b/node_modules/type-fest/source/set-optional.d.ts deleted file mode 100644 index 32604ce0a..000000000 --- a/node_modules/type-fest/source/set-optional.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {Except} from './except'; -import {Simplify} from './simplify'; - -/** -Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type. - -Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional. - -@example -``` -import {SetOptional} from 'type-fest'; - -type Foo = { - a: number; - b?: string; - c: boolean; -} - -type SomeOptional = SetOptional; -// type SomeOptional = { -// a: number; -// b?: string; // Was already optional and still is. -// c?: boolean; // Is now optional. -// } -``` - -@category Utilities -*/ -export type SetOptional = - Simplify< - // Pick just the keys that are readonly from the base type. - Except & - // Pick the keys that should be mutable from the base type and make them mutable. - Partial> - >; diff --git a/node_modules/type-fest/source/set-required.d.ts b/node_modules/type-fest/source/set-required.d.ts deleted file mode 100644 index 7f25da657..000000000 --- a/node_modules/type-fest/source/set-required.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {Except} from './except'; -import {Simplify} from './simplify'; - -/** -Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type. - -Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required. - -@example -``` -import {SetRequired} from 'type-fest'; - -type Foo = { - a?: number; - b: string; - c?: boolean; -} - -type SomeRequired = SetRequired; -// type SomeRequired = { -// a?: number; -// b: string; // Was already required and still is. -// c: boolean; // Is now required. -// } -``` - -@category Utilities -*/ -export type SetRequired = - Simplify< - // Pick just the keys that are optional from the base type. - Except & - // Pick the keys that should be required from the base type and make them required. - Required> - >; diff --git a/node_modules/type-fest/source/set-return-type.d.ts b/node_modules/type-fest/source/set-return-type.d.ts deleted file mode 100644 index 6d198d0a9..000000000 --- a/node_modules/type-fest/source/set-return-type.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -type IsAny = 0 extends (1 & T) ? true : false; // https://stackoverflow.com/a/49928360/3406963 -type IsNever = [T] extends [never] ? true : false; -type IsUnknown = IsNever extends false ? T extends unknown ? unknown extends T ? IsAny extends false ? true : false : false : false : false; - -/** -Create a function type with a return type of your choice and the same parameters as the given function type. - -Use-case: You want to define a wrapped function that returns something different while receiving the same parameters. For example, you might want to wrap a function that can throw an error into one that will return `undefined` instead. - -@example -``` -import {SetReturnType} from 'type-fest'; - -type MyFunctionThatCanThrow = (foo: SomeType, bar: unknown) => SomeOtherType; - -type MyWrappedFunction = SetReturnType; -//=> type MyWrappedFunction = (foo: SomeType, bar: unknown) => SomeOtherType | undefined; -``` - -@category Utilities -*/ -export type SetReturnType any, TypeToReturn> = - // Just using `Parameters` isn't ideal because it doesn't handle the `this` fake parameter. - Fn extends (this: infer ThisArg, ...args: infer Arguments) => any ? ( - // If a function did not specify the `this` fake parameter, it will be inferred to `unknown`. - // We want to detect this situation just to display a friendlier type upon hovering on an IntelliSense-powered IDE. - IsUnknown extends true ? (...args: Arguments) => TypeToReturn : (this: ThisArg, ...args: Arguments) => TypeToReturn - ) : ( - // This part should be unreachable, but we make it meaningful just in case… - (...args: Parameters) => TypeToReturn - ); diff --git a/node_modules/type-fest/source/simplify.d.ts b/node_modules/type-fest/source/simplify.d.ts deleted file mode 100644 index 32558b7bd..000000000 --- a/node_modules/type-fest/source/simplify.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** -Flatten the type output to improve type hints shown in editors. - -@example -``` -import {Simplify} from 'type-fest'; - -type PositionProps = { - top: number; - left: number; -}; - -type SizeProps = { - width: number; - height: number; -}; - -// In your editor, hovering over `Props` will show a flattened object with all the properties. -type Props = Simplify; -``` - -@category Utilities -*/ -export type Simplify = {[KeyType in keyof T]: T[KeyType]}; diff --git a/node_modules/type-fest/source/stringified.d.ts b/node_modules/type-fest/source/stringified.d.ts deleted file mode 100644 index 308733109..000000000 --- a/node_modules/type-fest/source/stringified.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** -Create a type with the keys of the given type changed to `string` type. - -Use-case: Changing interface values to strings in order to use them in a form model. - -@example -``` -import {Stringified} from 'type-fest'; - -type Car { - model: string; - speed: number; -} - -const carForm: Stringified = { - model: 'Foo', - speed: '101' -}; -``` - -@category Utilities -*/ -export type Stringified = {[KeyType in keyof ObjectType]: string}; diff --git a/node_modules/type-fest/source/tsconfig-json.d.ts b/node_modules/type-fest/source/tsconfig-json.d.ts deleted file mode 100644 index 9faa5c93d..000000000 --- a/node_modules/type-fest/source/tsconfig-json.d.ts +++ /dev/null @@ -1,1095 +0,0 @@ -declare namespace TsConfigJson { - namespace CompilerOptions { - export type JSX = - | 'preserve' - | 'react' - | 'react-jsx' - | 'react-jsxdev' - | 'react-native'; - - export type Module = - | 'CommonJS' - | 'AMD' - | 'System' - | 'UMD' - | 'ES6' - | 'ES2015' - | 'ES2020' - | 'ESNext' - | 'None' - // Lowercase alternatives - | 'commonjs' - | 'amd' - | 'system' - | 'umd' - | 'es6' - | 'es2015' - | 'es2020' - | 'esnext' - | 'none'; - - export type NewLine = - | 'CRLF' - | 'LF' - // Lowercase alternatives - | 'crlf' - | 'lf'; - - export type Target = - | 'ES3' - | 'ES5' - | 'ES6' - | 'ES2015' - | 'ES2016' - | 'ES2017' - | 'ES2018' - | 'ES2019' - | 'ES2020' - | 'ES2021' - | 'ESNext' - // Lowercase alternatives - | 'es3' - | 'es5' - | 'es6' - | 'es2015' - | 'es2016' - | 'es2017' - | 'es2018' - | 'es2019' - | 'es2020' - | 'es2021' - | 'esnext'; - - export type Lib = - | 'ES5' - | 'ES6' - | 'ES7' - | 'ES2015' - | 'ES2015.Collection' - | 'ES2015.Core' - | 'ES2015.Generator' - | 'ES2015.Iterable' - | 'ES2015.Promise' - | 'ES2015.Proxy' - | 'ES2015.Reflect' - | 'ES2015.Symbol.WellKnown' - | 'ES2015.Symbol' - | 'ES2016' - | 'ES2016.Array.Include' - | 'ES2017' - | 'ES2017.Intl' - | 'ES2017.Object' - | 'ES2017.SharedMemory' - | 'ES2017.String' - | 'ES2017.TypedArrays' - | 'ES2018' - | 'ES2018.AsyncGenerator' - | 'ES2018.AsyncIterable' - | 'ES2018.Intl' - | 'ES2018.Promise' - | 'ES2018.Regexp' - | 'ES2019' - | 'ES2019.Array' - | 'ES2019.Object' - | 'ES2019.String' - | 'ES2019.Symbol' - | 'ES2020' - | 'ES2020.BigInt' - | 'ES2020.Promise' - | 'ES2020.String' - | 'ES2020.Symbol.WellKnown' - | 'ES2020.SharedMemory' - | 'ES2020.Intl' - | 'ES2021' - | 'ES2021.Promise' - | 'ES2021.String' - | 'ES2021.WeakRef' - | 'ESNext' - | 'ESNext.Array' - | 'ESNext.AsyncIterable' - | 'ESNext.BigInt' - | 'ESNext.Intl' - | 'ESNext.Promise' - | 'ESNext.String' - | 'ESNext.Symbol' - | 'ESNext.WeakRef' - | 'DOM' - | 'DOM.Iterable' - | 'ScriptHost' - | 'WebWorker' - | 'WebWorker.ImportScripts' - | 'WebWorker.Iterable' - // Lowercase alternatives - | 'es5' - | 'es6' - | 'es7' - | 'es2015' - | 'es2015.collection' - | 'es2015.core' - | 'es2015.generator' - | 'es2015.iterable' - | 'es2015.promise' - | 'es2015.proxy' - | 'es2015.reflect' - | 'es2015.symbol.wellknown' - | 'es2015.symbol' - | 'es2016' - | 'es2016.array.include' - | 'es2017' - | 'es2017.intl' - | 'es2017.object' - | 'es2017.sharedmemory' - | 'es2017.string' - | 'es2017.typedarrays' - | 'es2018' - | 'es2018.asyncgenerator' - | 'es2018.asynciterable' - | 'es2018.intl' - | 'es2018.promise' - | 'es2018.regexp' - | 'es2019' - | 'es2019.array' - | 'es2019.object' - | 'es2019.string' - | 'es2019.symbol' - | 'es2020' - | 'es2020.bigint' - | 'es2020.promise' - | 'es2020.string' - | 'es2020.symbol.wellknown' - | 'es2020.sharedmemory' - | 'es2020.intl' - | 'es2021' - | 'es2021.promise' - | 'es2021.string' - | 'es2021.weakref' - | 'esnext' - | 'esnext.array' - | 'esnext.asynciterable' - | 'esnext.bigint' - | 'esnext.intl' - | 'esnext.promise' - | 'esnext.string' - | 'esnext.symbol' - | 'esnext.weakref' - | 'dom' - | 'dom.iterable' - | 'scripthost' - | 'webworker' - | 'webworker.importscripts' - | 'webworker.iterable'; - - export interface Plugin { - [key: string]: unknown; - /** - Plugin name. - */ - name?: string; - } - - export type ImportsNotUsedAsValues = - | 'remove' - | 'preserve' - | 'error'; - - export type FallbackPolling = - | 'fixedPollingInterval' - | 'priorityPollingInterval' - | 'dynamicPriorityPolling' - | 'fixedInterval' - | 'priorityInterval' - | 'dynamicPriority' - | 'fixedChunkSize'; - - export type WatchDirectory = - | 'useFsEvents' - | 'fixedPollingInterval' - | 'dynamicPriorityPolling' - | 'fixedChunkSizePolling'; - - export type WatchFile = - | 'fixedPollingInterval' - | 'priorityPollingInterval' - | 'dynamicPriorityPolling' - | 'useFsEvents' - | 'useFsEventsOnParentDirectory' - | 'fixedChunkSizePolling'; - - } - - export interface CompilerOptions { - /** - The character set of the input files. - - @default 'utf8' - */ - charset?: string; - - /** - Enables building for project references. - - @default true - */ - composite?: boolean; - - /** - Generates corresponding d.ts files. - - @default false - */ - declaration?: boolean; - - /** - Specify output directory for generated declaration files. - - Requires TypeScript version 2.0 or later. - */ - declarationDir?: string; - - /** - Show diagnostic information. - - @default false - */ - diagnostics?: boolean; - - /** - Reduce the number of projects loaded automatically by TypeScript. - - Requires TypeScript version 4.0 or later. - - @default false - */ - disableReferencedProjectLoad?: boolean; - - /** - Enforces using indexed accessors for keys declared using an indexed type. - - Requires TypeScript version 4.2 or later. - - @default false - */ - noPropertyAccessFromIndexSignature?: boolean; - - /** - Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. - - @default false - */ - emitBOM?: boolean; - - /** - Only emit `.d.ts` declaration files. - - @default false - */ - emitDeclarationOnly?: boolean; - - /** - Differentiate between undefined and not present when type checking. - - Requires TypeScript version 4.4 or later. - - @default false - */ - exactOptionalPropertyTypes?: boolean; - - /** - Enable incremental compilation. - - @default `composite` - */ - incremental?: boolean; - - /** - Specify file to store incremental compilation information. - - @default '.tsbuildinfo' - */ - tsBuildInfoFile?: string; - - /** - Emit a single file with source maps instead of having a separate file. - - @default false - */ - inlineSourceMap?: boolean; - - /** - Emit the source alongside the sourcemaps within a single file. - - Requires `--inlineSourceMap` to be set. - - @default false - */ - inlineSources?: boolean; - - /** - Specify what JSX code is generated. - - @default 'preserve' - */ - jsx?: CompilerOptions.JSX; - - /** - Specifies the object invoked for `createElement` and `__spread` when targeting `'react'` JSX emit. - - @default 'React' - */ - reactNamespace?: string; - - /** - Specify the JSX factory function to use when targeting React JSX emit, e.g. `React.createElement` or `h`. - - Requires TypeScript version 2.1 or later. - - @default 'React.createElement' - */ - jsxFactory?: string; - - /** - Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. - - Requires TypeScript version 4.0 or later. - - @default 'React.Fragment' - */ - jsxFragmentFactory?: string; - - /** - Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`. - - Requires TypeScript version 4.1 or later. - - @default 'react' - */ - jsxImportSource?: string; - - /** - Print names of files part of the compilation. - - @default false - */ - listFiles?: boolean; - - /** - Specifies the location where debugger should locate map files instead of generated locations. - */ - mapRoot?: string; - - /** - Specify module code generation: 'None', 'CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015' or 'ESNext'. Only 'AMD' and 'System' can be used in conjunction with `--outFile`. 'ES6' and 'ES2015' values may be used when targeting 'ES5' or lower. - - @default ['ES3', 'ES5'].includes(target) ? 'CommonJS' : 'ES6' - */ - module?: CompilerOptions.Module; - - /** - Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6). - - @default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node' - */ - moduleResolution?: 'classic' | 'node'; - - /** - Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix). - - Default: Platform specific - */ - newLine?: CompilerOptions.NewLine; - - /** - Do not emit output. - - @default false - */ - noEmit?: boolean; - - /** - Do not generate custom helper functions like `__extends` in compiled output. - - @default false - */ - noEmitHelpers?: boolean; - - /** - Do not emit outputs if any type checking errors were reported. - - @default false - */ - noEmitOnError?: boolean; - - /** - Warn on expressions and declarations with an implied 'any' type. - - @default false - */ - noImplicitAny?: boolean; - - /** - Raise error on 'this' expressions with an implied any type. - - @default false - */ - noImplicitThis?: boolean; - - /** - Report errors on unused locals. - - Requires TypeScript version 2.0 or later. - - @default false - */ - noUnusedLocals?: boolean; - - /** - Report errors on unused parameters. - - Requires TypeScript version 2.0 or later. - - @default false - */ - noUnusedParameters?: boolean; - - /** - Do not include the default library file (lib.d.ts). - - @default false - */ - noLib?: boolean; - - /** - Do not add triple-slash references or module import targets to the list of compiled files. - - @default false - */ - noResolve?: boolean; - - /** - Disable strict checking of generic signatures in function types. - - @default false - */ - noStrictGenericChecks?: boolean; - - /** - @deprecated use `skipLibCheck` instead. - */ - skipDefaultLibCheck?: boolean; - - /** - Skip type checking of declaration files. - - Requires TypeScript version 2.0 or later. - - @default false - */ - skipLibCheck?: boolean; - - /** - Concatenate and emit output to single file. - */ - outFile?: string; - - /** - Redirect output structure to the directory. - */ - outDir?: string; - - /** - Do not erase const enum declarations in generated code. - - @default false - */ - preserveConstEnums?: boolean; - - /** - Do not resolve symlinks to their real path; treat a symlinked file like a real one. - - @default false - */ - preserveSymlinks?: boolean; - - /** - Keep outdated console output in watch mode instead of clearing the screen. - - @default false - */ - preserveWatchOutput?: boolean; - - /** - Stylize errors and messages using color and context (experimental). - - @default true // Unless piping to another program or redirecting output to a file. - */ - pretty?: boolean; - - /** - Do not emit comments to output. - - @default false - */ - removeComments?: boolean; - - /** - Specifies the root directory of input files. - - Use to control the output directory structure with `--outDir`. - */ - rootDir?: string; - - /** - Unconditionally emit imports for unresolved files. - - @default false - */ - isolatedModules?: boolean; - - /** - Generates corresponding '.map' file. - - @default false - */ - sourceMap?: boolean; - - /** - Specifies the location where debugger should locate TypeScript files instead of source locations. - */ - sourceRoot?: string; - - /** - Suppress excess property checks for object literals. - - @default false - */ - suppressExcessPropertyErrors?: boolean; - - /** - Suppress noImplicitAny errors for indexing objects lacking index signatures. - - @default false - */ - suppressImplicitAnyIndexErrors?: boolean; - - /** - Do not emit declarations for code that has an `@internal` annotation. - */ - stripInternal?: boolean; - - /** - Specify ECMAScript target version. - - @default 'es3' - */ - target?: CompilerOptions.Target; - - /** - Default catch clause variables as `unknown` instead of `any`. - - Requires TypeScript version 4.4 or later. - - @default false - */ - useUnknownInCatchVariables?: boolean; - - /** - Watch input files. - - @default false - */ - watch?: boolean; - - /** - Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. - - Requires TypeScript version 3.8 or later. - */ - fallbackPolling?: CompilerOptions.FallbackPolling; - - /** - Specify the strategy for watching directories under systems that lack recursive file-watching functionality. - - Requires TypeScript version 3.8 or later. - - @default 'useFsEvents' - */ - watchDirectory?: CompilerOptions.WatchDirectory; - - /** - Specify the strategy for watching individual files. - - Requires TypeScript version 3.8 or later. - - @default 'useFsEvents' - */ - watchFile?: CompilerOptions.WatchFile; - - /** - Enables experimental support for ES7 decorators. - - @default false - */ - experimentalDecorators?: boolean; - - /** - Emit design-type metadata for decorated declarations in source. - - @default false - */ - emitDecoratorMetadata?: boolean; - - /** - Do not report errors on unused labels. - - @default false - */ - allowUnusedLabels?: boolean; - - /** - Report error when not all code paths in function return a value. - - @default false - */ - noImplicitReturns?: boolean; - - /** - Add `undefined` to a type when accessed using an index. - - Requires TypeScript version 4.1 or later. - - @default false - */ - noUncheckedIndexedAccess?: boolean; - - /** - Report errors for fallthrough cases in switch statement. - - @default false - */ - noFallthroughCasesInSwitch?: boolean; - - /** - Ensure overriding members in derived classes are marked with an override modifier. - - @default false - */ - noImplicitOverride?: boolean; - - /** - Do not report errors on unreachable code. - - @default false - */ - allowUnreachableCode?: boolean; - - /** - Disallow inconsistently-cased references to the same file. - - @default false - */ - forceConsistentCasingInFileNames?: boolean; - - /** - Emit a v8 CPU profile of the compiler run for debugging. - - Requires TypeScript version 3.7 or later. - - @default 'profile.cpuprofile' - */ - generateCpuProfile?: string; - - /** - Base directory to resolve non-relative module names. - */ - baseUrl?: string; - - /** - Specify path mapping to be computed relative to baseUrl option. - */ - paths?: Record; - - /** - List of TypeScript language server plugins to load. - - Requires TypeScript version 2.3 or later. - */ - plugins?: CompilerOptions.Plugin[]; - - /** - Specify list of root directories to be used when resolving modules. - */ - rootDirs?: string[]; - - /** - Specify list of directories for type definition files to be included. - - Requires TypeScript version 2.0 or later. - */ - typeRoots?: string[]; - - /** - Type declaration files to be included in compilation. - - Requires TypeScript version 2.0 or later. - */ - types?: string[]; - - /** - Enable tracing of the name resolution process. - - @default false - */ - traceResolution?: boolean; - - /** - Allow javascript files to be compiled. - - @default false - */ - allowJs?: boolean; - - /** - Do not truncate error messages. - - @default false - */ - noErrorTruncation?: boolean; - - /** - Allow default imports from modules with no default export. This does not affect code emit, just typechecking. - - @default module === 'system' || esModuleInterop - */ - allowSyntheticDefaultImports?: boolean; - - /** - Do not emit `'use strict'` directives in module output. - - @default false - */ - noImplicitUseStrict?: boolean; - - /** - Enable to list all emitted files. - - Requires TypeScript version 2.0 or later. - - @default false - */ - listEmittedFiles?: boolean; - - /** - Disable size limit for JavaScript project. - - Requires TypeScript version 2.0 or later. - - @default false - */ - disableSizeLimit?: boolean; - - /** - List of library files to be included in the compilation. - - Requires TypeScript version 2.0 or later. - */ - lib?: CompilerOptions.Lib[]; - - /** - Enable strict null checks. - - Requires TypeScript version 2.0 or later. - - @default false - */ - strictNullChecks?: boolean; - - /** - The maximum dependency depth to search under `node_modules` and load JavaScript files. Only applicable with `--allowJs`. - - @default 0 - */ - maxNodeModuleJsDepth?: number; - - /** - Import emit helpers (e.g. `__extends`, `__rest`, etc..) from tslib. - - Requires TypeScript version 2.1 or later. - - @default false - */ - importHelpers?: boolean; - - /** - Specify emit/checking behavior for imports that are only used for types. - - @default 'remove' - */ - importsNotUsedAsValues?: CompilerOptions.ImportsNotUsedAsValues; - - /** - Parse in strict mode and emit `'use strict'` for each source file. - - Requires TypeScript version 2.1 or later. - - @default false - */ - alwaysStrict?: boolean; - - /** - Enable all strict type checking options. - - Requires TypeScript version 2.3 or later. - - @default false - */ - strict?: boolean; - - /** - Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions. - - @default false - */ - strictBindCallApply?: boolean; - - /** - Provide full support for iterables in `for-of`, spread, and destructuring when targeting `ES5` or `ES3`. - - Requires TypeScript version 2.3 or later. - - @default false - */ - downlevelIteration?: boolean; - - /** - Report errors in `.js` files. - - Requires TypeScript version 2.3 or later. - - @default false - */ - checkJs?: boolean; - - /** - Disable bivariant parameter checking for function types. - - Requires TypeScript version 2.6 or later. - - @default false - */ - strictFunctionTypes?: boolean; - - /** - Ensure non-undefined class properties are initialized in the constructor. - - Requires TypeScript version 2.7 or later. - - @default false - */ - strictPropertyInitialization?: boolean; - - /** - Emit `__importStar` and `__importDefault` helpers for runtime Babel ecosystem compatibility and enable `--allowSyntheticDefaultImports` for typesystem compatibility. - - Requires TypeScript version 2.7 or later. - - @default false - */ - esModuleInterop?: boolean; - - /** - Allow accessing UMD globals from modules. - - @default false - */ - allowUmdGlobalAccess?: boolean; - - /** - Resolve `keyof` to string valued property names only (no numbers or symbols). - - Requires TypeScript version 2.9 or later. - - @default false - */ - keyofStringsOnly?: boolean; - - /** - Emit ECMAScript standard class fields. - - Requires TypeScript version 3.7 or later. - - @default false - */ - useDefineForClassFields?: boolean; - - /** - Generates a sourcemap for each corresponding `.d.ts` file. - - Requires TypeScript version 2.9 or later. - - @default false - */ - declarationMap?: boolean; - - /** - Include modules imported with `.json` extension. - - Requires TypeScript version 2.9 or later. - - @default false - */ - resolveJsonModule?: boolean; - - /** - Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it. - - Requires TypeScript version 3.8 or later. - - @default false - */ - assumeChangesOnlyAffectDirectDependencies?: boolean; - - /** - Output more detailed compiler performance information after building. - - @default false - */ - extendedDiagnostics?: boolean; - - /** - Print names of files that are part of the compilation and then stop processing. - - @default false - */ - listFilesOnly?: boolean; - - /** - Disable preferring source files instead of declaration files when referencing composite projects. - - @default true if composite, false otherwise - */ - disableSourceOfProjectReferenceRedirect?: boolean; - - /** - Opt a project out of multi-project reference checking when editing. - - Requires TypeScript version 3.8 or later. - - @default false - */ - disableSolutionSearching?: boolean; - - /** - Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation. - - Requires TypeScript version 4.2 or later. - - @default false - */ - explainFiles?: boolean; - } - - /** - Auto type (.d.ts) acquisition options for this project. - - Requires TypeScript version 2.1 or later. - */ - export interface TypeAcquisition { - /** - Enable auto type acquisition. - */ - enable?: boolean; - - /** - Specifies a list of type declarations to be included in auto type acquisition. For example, `['jquery', 'lodash']`. - */ - include?: string[]; - - /** - Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`. - */ - exclude?: string[]; - } - - export interface References { - /** - A normalized path on disk. - */ - path: string; - - /** - The path as the user originally wrote it. - */ - originalPath?: string; - - /** - True if the output of this reference should be prepended to the output of this project. - - Only valid for `--outFile` compilations. - */ - prepend?: boolean; - - /** - True if it is intended that this reference form a circularity. - */ - circular?: boolean; - } -} - -/** -Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7). - -@category Miscellaneous -*/ -export interface TsConfigJson { - /** - Instructs the TypeScript compiler how to compile `.ts` files. - */ - compilerOptions?: TsConfigJson.CompilerOptions; - - /** - Auto type (.d.ts) acquisition options for this project. - - Requires TypeScript version 2.1 or later. - */ - typeAcquisition?: TsConfigJson.TypeAcquisition; - - /** - Enable Compile-on-Save for this project. - */ - compileOnSave?: boolean; - - /** - Path to base configuration file to inherit from. - - Requires TypeScript version 2.1 or later. - */ - extends?: string; - - /** - If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included. - */ - files?: string[]; - - /** - Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property. - - Glob patterns require TypeScript version 2.0 or later. - */ - exclude?: string[]; - - /** - Specifies a list of glob patterns that match files to be included in compilation. - - If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. - - Requires TypeScript version 2.0 or later. - */ - include?: string[]; - - /** - Referenced projects. - - Requires TypeScript version 3.0 or later. - */ - references?: TsConfigJson.References[]; -} diff --git a/node_modules/type-fest/source/typed-array.d.ts b/node_modules/type-fest/source/typed-array.d.ts deleted file mode 100644 index a6a1d92fc..000000000 --- a/node_modules/type-fest/source/typed-array.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// - -/** -Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. - -@category Basic -*/ -export type TypedArray = - | Int8Array - | Uint8Array - | Uint8ClampedArray - | Int16Array - | Uint16Array - | Int32Array - | Uint32Array - | Float32Array - | Float64Array - | BigInt64Array - | BigUint64Array; diff --git a/node_modules/type-fest/source/union-to-intersection.d.ts b/node_modules/type-fest/source/union-to-intersection.d.ts deleted file mode 100644 index 4c1d94bc6..000000000 --- a/node_modules/type-fest/source/union-to-intersection.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** -Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types). - -Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153). - -@example -``` -import {UnionToIntersection} from 'type-fest'; - -type Union = {the(): void} | {great(arg: string): void} | {escape: boolean}; - -type Intersection = UnionToIntersection; -//=> {the(): void; great(arg: string): void; escape: boolean}; -``` - -A more applicable example which could make its way into your library code follows. - -@example -``` -import {UnionToIntersection} from 'type-fest'; - -class CommandOne { - commands: { - a1: () => undefined, - b1: () => undefined, - } -} - -class CommandTwo { - commands: { - a2: (argA: string) => undefined, - b2: (argB: string) => undefined, - } -} - -const union = [new CommandOne(), new CommandTwo()].map(instance => instance.commands); -type Union = typeof union; -//=> {a1(): void; b1(): void} | {a2(argA: string): void; b2(argB: string): void} - -type Intersection = UnionToIntersection; -//=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void} -``` - -@category Utilities -*/ -export type UnionToIntersection = ( - // `extends unknown` is always going to be the case and is used to convert the - // `Union` into a [distributive conditional - // type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types). - Union extends unknown - // The union type is used as the only argument to a function since the union - // of function arguments is an intersection. - ? (distributedUnion: Union) => void - // This won't happen. - : never - // Infer the `Intersection` type since TypeScript represents the positional - // arguments of unions of functions as an intersection of the union. - ) extends ((mergedIntersection: infer Intersection) => void) - ? Intersection - : never; diff --git a/node_modules/type-fest/source/utilities.d.ts b/node_modules/type-fest/source/utilities.d.ts deleted file mode 100644 index 8d60ccde0..000000000 --- a/node_modules/type-fest/source/utilities.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type UpperCaseCharacters = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z'; - -export type WordSeparators = '-' | '_' | ' '; - -export type StringDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'; diff --git a/node_modules/type-fest/source/value-of.d.ts b/node_modules/type-fest/source/value-of.d.ts deleted file mode 100644 index a5c696bdd..000000000 --- a/node_modules/type-fest/source/value-of.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** -Create a union of the given object's values, and optionally specify which keys to get the values from. - -Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31438) if you want to have this type as a built-in in TypeScript. - -@example -``` -// data.json -{ - 'foo': 1, - 'bar': 2, - 'biz': 3 -} - -// main.ts -import {ValueOf} from 'type-fest'; -import data = require('./data.json'); - -export function getData(name: string): ValueOf { - return data[name]; -} - -export function onlyBar(name: string): ValueOf { - return data[name]; -} - -// file.ts -import {getData, onlyBar} from './main'; - -getData('foo'); -//=> 1 - -onlyBar('foo'); -//=> TypeError ... - -onlyBar('bar'); -//=> 2 -``` - -@category Utilities -*/ -export type ValueOf = ObjectType[ValueType]; diff --git a/node_modules/type-fest/ts41/camel-case.d.ts b/node_modules/type-fest/ts41/camel-case.d.ts deleted file mode 100644 index b5c10cd58..000000000 --- a/node_modules/type-fest/ts41/camel-case.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -import {WordSeparators} from '../source/utilities'; -import {Split} from './utilities'; - -/** -Step by step takes the first item in an array literal, formats it and adds it to a string literal, and then recursively appends the remainder. - -Only to be used by `CamelCaseStringArray<>`. - -@see CamelCaseStringArray -*/ -type InnerCamelCaseStringArray = - Parts extends [`${infer FirstPart}`, ...infer RemainingParts] - ? FirstPart extends undefined - ? '' - : FirstPart extends '' - ? InnerCamelCaseStringArray - : `${PreviousPart extends '' ? FirstPart : Capitalize}${InnerCamelCaseStringArray}` - : ''; - -/** -Starts fusing the output of `Split<>`, an array literal of strings, into a camel-cased string literal. - -It's separate from `InnerCamelCaseStringArray<>` to keep a clean API outwards to the rest of the code. - -@see Split -*/ -type CamelCaseStringArray = - Parts extends [`${infer FirstPart}`, ...infer RemainingParts] - ? Uncapitalize<`${FirstPart}${InnerCamelCaseStringArray}`> - : never; - -/** -Convert a string literal to camel-case. - -This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result. - -@example -``` -import {CamelCase} from 'type-fest'; - -// Simple - -const someVariable: CamelCase<'foo-bar'> = 'fooBar'; - -// Advanced - -type CamelCasedProperties = { - [K in keyof T as CamelCase]: T[K] -}; - -interface RawOptions { - 'dry-run': boolean; - 'full_family_name': string; - foo: number; - BAR: string; - QUZ_QUX: number; - 'OTHER-FIELD': boolean; -} - -const dbResult: CamelCasedProperties = { - dryRun: true, - fullFamilyName: 'bar.js', - foo: 123, - bar: 'foo', - quzQux: 6, - otherField: false -}; -``` - -@category Template Literals -*/ -export type CamelCase = K extends string ? K extends Uppercase ? CamelCaseStringArray, WordSeparators>> : CamelCaseStringArray> : K; diff --git a/node_modules/type-fest/ts41/camel-cased-properties-deep.d.ts b/node_modules/type-fest/ts41/camel-cased-properties-deep.d.ts deleted file mode 100644 index 015057e9e..000000000 --- a/node_modules/type-fest/ts41/camel-cased-properties-deep.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import {CamelCase} from './camel-case'; - -/** -Convert object properties to camel case recursively. - -This can be useful when, for example, converting some API types from a different style. - -@see CamelCasedProperties -@see CamelCase - -@example -``` -interface User { - UserId: number; - UserName: string; -} - -interface UserWithFriends { - UserInfo: User; - UserFriends: User[]; -} - -const result: CamelCasedPropertiesDeep = { - userInfo: { - userId: 1, - userName: 'Tom', - }, - userFriends: [ - { - userId: 2, - userName: 'Jerry', - }, - { - userId: 3, - userName: 'Spike', - }, - ], -}; -``` - -@category Template Literals -*/ -export type CamelCasedPropertiesDeep = Value extends Function - ? Value - : Value extends Array - ? Array> - : Value extends Set - ? Set> : { - [K in keyof Value as CamelCase]: CamelCasedPropertiesDeep; - }; diff --git a/node_modules/type-fest/ts41/camel-cased-properties.d.ts b/node_modules/type-fest/ts41/camel-cased-properties.d.ts deleted file mode 100644 index 8bbb53c1f..000000000 --- a/node_modules/type-fest/ts41/camel-cased-properties.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import {CamelCase} from './camel-case'; - -/** -Convert object properties to camel case but not recursively. - -This can be useful when, for example, converting some API types from a different style. - -@see CamelCasedPropertiesDeep -@see CamelCase - -@example -``` -interface User { - UserId: number; - UserName: string; -} - -const result: CamelCasedProperties = { - userId: 1, - userName: 'Tom', -}; -``` - -@category Template Literals -*/ -export type CamelCasedProperties = Value extends Function - ? Value - : Value extends Array - ? Value - : { - [K in keyof Value as CamelCase]: Value[K]; - }; diff --git a/node_modules/type-fest/ts41/delimiter-case.d.ts b/node_modules/type-fest/ts41/delimiter-case.d.ts deleted file mode 100644 index ea15bd32f..000000000 --- a/node_modules/type-fest/ts41/delimiter-case.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -import {UpperCaseCharacters, WordSeparators} from '../source/utilities'; - -/** -Unlike a simpler split, this one includes the delimiter splitted on in the resulting array literal. This is to enable splitting on, for example, upper-case characters. - -@category Template Literals -*/ -export type SplitIncludingDelimiters = - Source extends '' ? [] : - Source extends `${infer FirstPart}${Delimiter}${infer SecondPart}` ? - ( - Source extends `${FirstPart}${infer UsedDelimiter}${SecondPart}` - ? UsedDelimiter extends Delimiter - ? Source extends `${infer FirstPart}${UsedDelimiter}${infer SecondPart}` - ? [...SplitIncludingDelimiters, UsedDelimiter, ...SplitIncludingDelimiters] - : never - : never - : never - ) : - [Source]; - -/** -Format a specific part of the splitted string literal that `StringArrayToDelimiterCase<>` fuses together, ensuring desired casing. - -@see StringArrayToDelimiterCase -*/ -type StringPartToDelimiterCase = - StringPart extends UsedWordSeparators ? Delimiter : - StringPart extends UsedUpperCaseCharacters ? `${Delimiter}${Lowercase}` : - StringPart; - -/** -Takes the result of a splitted string literal and recursively concatenates it together into the desired casing. - -It receives `UsedWordSeparators` and `UsedUpperCaseCharacters` as input to ensure it's fully encapsulated. - -@see SplitIncludingDelimiters -*/ -type StringArrayToDelimiterCase = - Parts extends [`${infer FirstPart}`, ...infer RemainingParts] - ? `${StringPartToDelimiterCase}${StringArrayToDelimiterCase}` - : ''; - -/** -Convert a string literal to a custom string delimiter casing. - -This can be useful when, for example, converting a camel-cased object property to an oddly cased one. - -@see KebabCase -@see SnakeCase - -@example -``` -import {DelimiterCase} from 'type-fest'; - -// Simple - -const someVariable: DelimiterCase<'fooBar', '#'> = 'foo#bar'; - -// Advanced - -type OddlyCasedProperties = { - [K in keyof T as DelimiterCase]: T[K] -}; - -interface SomeOptions { - dryRun: boolean; - includeFile: string; - foo: number; -} - -const rawCliOptions: OddlyCasedProperties = { - 'dry#run': true, - 'include#file': 'bar.js', - foo: 123 -}; -``` - -@category Template Literals -*/ -export type DelimiterCase = Value extends string - ? StringArrayToDelimiterCase< - SplitIncludingDelimiters, - WordSeparators, - UpperCaseCharacters, - Delimiter - > - : Value; diff --git a/node_modules/type-fest/ts41/delimiter-cased-properties-deep.d.ts b/node_modules/type-fest/ts41/delimiter-cased-properties-deep.d.ts deleted file mode 100644 index f8589462c..000000000 --- a/node_modules/type-fest/ts41/delimiter-cased-properties-deep.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import {DelimiterCase} from './delimiter-case'; - -/** -Convert object properties to delimiter case recursively. - -This can be useful when, for example, converting some API types from a different style. - -@see DelimiterCase -@see DelimiterCasedProperties - -@example -``` -interface User { - userId: number; - userName: string; -} - -interface UserWithFriends { - userInfo: User; - userFriends: User[]; -} - -const result: DelimiterCasedPropertiesDeep = { - 'user-info': { - 'user-id': 1, - 'user-name': 'Tom', - }, - 'user-friends': [ - { - 'user-id': 2, - 'user-name': 'Jerry', - }, - { - 'user-id': 3, - 'user-name': 'Spike', - }, - ], -}; -``` - -@category Template Literals -*/ -export type DelimiterCasedPropertiesDeep< - Value, - Delimiter extends string -> = Value extends Function - ? Value - : Value extends Array - ? Array> - : Value extends Set - ? Set> : { - [K in keyof Value as DelimiterCase< - K, - Delimiter - >]: DelimiterCasedPropertiesDeep; - }; diff --git a/node_modules/type-fest/ts41/delimiter-cased-properties.d.ts b/node_modules/type-fest/ts41/delimiter-cased-properties.d.ts deleted file mode 100644 index a4c89b092..000000000 --- a/node_modules/type-fest/ts41/delimiter-cased-properties.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import {DelimiterCase} from './delimiter-case'; - -/** -Convert object properties to delimiter case but not recursively. - -This can be useful when, for example, converting some API types from a different style. - -@see DelimiterCase -@see DelimiterCasedPropertiesDeep - -@example -``` -interface User { - userId: number; - userName: string; -} - -const result: DelimiterCasedProperties = { - 'user-id': 1, - 'user-name': 'Tom', -}; -``` - -@category Template Literals -*/ -export type DelimiterCasedProperties< - Value, - Delimiter extends string -> = Value extends Function - ? Value - : Value extends Array - ? Value - : { [K in keyof Value as DelimiterCase]: Value[K] }; diff --git a/node_modules/type-fest/ts41/get.d.ts b/node_modules/type-fest/ts41/get.d.ts deleted file mode 100644 index f12a886f6..000000000 --- a/node_modules/type-fest/ts41/get.d.ts +++ /dev/null @@ -1,135 +0,0 @@ -import {Split} from './utilities'; -import {StringDigit} from '../source/utilities'; - -/** -Like the `Get` type but receives an array of strings as a path parameter. -*/ -type GetWithPath = - Keys extends [] - ? BaseType - : Keys extends [infer Head, ...infer Tail] - ? GetWithPath>, Extract> - : never; - -/** -Splits a dot-prop style path into a tuple comprised of the properties in the path. Handles square-bracket notation. - -@example -``` -ToPath<'foo.bar.baz'> -//=> ['foo', 'bar', 'baz'] - -ToPath<'foo[0].bar.baz'> -//=> ['foo', '0', 'bar', 'baz'] -``` -*/ -type ToPath = Split, '.'>; - -/** -Replaces square-bracketed dot notation with dots, for example, `foo[0].bar` -> `foo.0.bar`. -*/ -type FixPathSquareBrackets = - Path extends `${infer Head}[${infer Middle}]${infer Tail}` - ? `${Head}.${Middle}${FixPathSquareBrackets}` - : Path; - -/** -Returns true if `LongString` is made up out of `Substring` repeated 0 or more times. - -@example -``` -ConsistsOnlyOf<'aaa', 'a'> //=> true -ConsistsOnlyOf<'ababab', 'ab'> //=> true -ConsistsOnlyOf<'aBa', 'a'> //=> false -ConsistsOnlyOf<'', 'a'> //=> true -``` -*/ -type ConsistsOnlyOf = - LongString extends '' - ? true - : LongString extends `${Substring}${infer Tail}` - ? ConsistsOnlyOf - : false; - -/** -Convert a type which may have number keys to one with string keys, making it possible to index using strings retrieved from template types. - -@example -``` -type WithNumbers = {foo: string; 0: boolean}; -type WithStrings = WithStringKeys; - -type WithNumbersKeys = keyof WithNumbers; -//=> 'foo' | 0 -type WithStringsKeys = keyof WithStrings; -//=> 'foo' | '0' -``` -*/ -type WithStringKeys> = { - [Key in `${Extract}`]: BaseType[Key] -}; - -/** -Get a property of an object or array. Works when indexing arrays using number-literal-strings, for example, `PropertyOf = number`, and when indexing objects with number keys. - -Note: -- Returns `unknown` if `Key` is not a property of `BaseType`, since TypeScript uses structural typing, and it cannot be guaranteed that extra properties unknown to the type system will exist at runtime. -- Returns `undefined` from nullish values, to match the behaviour of most deep-key libraries like `lodash`, `dot-prop`, etc. -*/ -type PropertyOf = - BaseType extends null | undefined - ? undefined - : Key extends keyof BaseType - ? BaseType[Key] - : BaseType extends [] | [unknown, ...unknown[]] - ? unknown // It's a tuple, but `Key` did not extend `keyof BaseType`. So the index is out of bounds. - : BaseType extends { - [n: number]: infer Item; - length: number; // Note: This is needed to avoid being too lax with records types using number keys like `{0: string; 1: boolean}`. - } - ? ( - ConsistsOnlyOf extends true - ? Item - : unknown - ) - : Key extends keyof WithStringKeys - ? WithStringKeys[Key] - : unknown; - -// This works by first splitting the path based on `.` and `[...]` characters into a tuple of string keys. Then it recursively uses the head key to get the next property of the current object, until there are no keys left. Number keys extract the item type from arrays, or are converted to strings to extract types from tuples and dictionaries with number keys. -/** -Get a deeply-nested property from an object using a key path, like Lodash's `.get()` function. - -Use-case: Retrieve a property from deep inside an API response or some other complex object. - -@example -``` -import {Get} from 'type-fest'; -import * as lodash from 'lodash'; - -const get = (object: BaseType, path: Path): Get => - lodash.get(object, path); - -interface ApiResponse { - hits: { - hits: Array<{ - _id: string - _source: { - name: Array<{ - given: string[] - family: string - }> - birthDate: string - } - }> - } -} - -const getName = (apiResponse: ApiResponse) => - get(apiResponse, 'hits.hits[0]._source.name'); - //=> Array<{given: string[]; family: string}> -``` - -@category Template Literals -*/ -export type Get = GetWithPath>; diff --git a/node_modules/type-fest/ts41/includes.d.ts b/node_modules/type-fest/ts41/includes.d.ts deleted file mode 100644 index 0d8338054..000000000 --- a/node_modules/type-fest/ts41/includes.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** -Returns a boolean for whether given two types are equal. - -@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650 -*/ -type IsEqual = - (() => G extends T ? 1 : 2) extends - (() => G extends U ? 1 : 2) - ? true - : false; - -/** -Returns a boolean for whether the given array includes the given item. - -This can be useful if another type wants to make a decision based on whether the array includes that item. - -@example -``` -import {Includes} from 'type-fest'; - -type hasRed = Includes; -``` - -@category Utilities -*/ -export type Includes = - IsEqual extends true - ? true - : Value extends [Value[0], ...infer rest] - ? Includes - : false; diff --git a/node_modules/type-fest/ts41/index.d.ts b/node_modules/type-fest/ts41/index.d.ts deleted file mode 100644 index 58cf08bbe..000000000 --- a/node_modules/type-fest/ts41/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// These are all the basic types that's compatible with all supported TypeScript versions. -export * from '../base'; - -// These are special types that require at least TypeScript 4.1. -export {CamelCase} from './camel-case'; -export {CamelCasedProperties} from './camel-cased-properties'; -export {CamelCasedPropertiesDeep} from './camel-cased-properties-deep'; -export {KebabCase} from './kebab-case'; -export {KebabCasedProperties} from './kebab-cased-properties'; -export {KebabCasedPropertiesDeep} from './kebab-cased-properties-deep'; -export {PascalCase} from './pascal-case'; -export {PascalCasedProperties} from './pascal-cased-properties'; -export {PascalCasedPropertiesDeep} from './pascal-cased-properties-deep'; -export {SnakeCase} from './snake-case'; -export {SnakeCasedProperties} from './snake-cased-properties'; -export {SnakeCasedPropertiesDeep} from './snake-cased-properties-deep'; -export {ScreamingSnakeCase} from './screaming-snake-case'; -export {DelimiterCase} from './delimiter-case'; -export {DelimiterCasedProperties} from './delimiter-cased-properties'; -export {DelimiterCasedPropertiesDeep} from './delimiter-cased-properties-deep'; -export {Split} from './split'; -export {Trim} from './trim'; -export {Includes} from './includes'; -export {Get} from './get'; -export {LastArrayElement} from './last-array-element'; diff --git a/node_modules/type-fest/ts41/kebab-case.d.ts b/node_modules/type-fest/ts41/kebab-case.d.ts deleted file mode 100644 index b3185c125..000000000 --- a/node_modules/type-fest/ts41/kebab-case.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {DelimiterCase} from './delimiter-case'; - -/** -Convert a string literal to kebab-case. - -This can be useful when, for example, converting a camel-cased object property to a kebab-cased CSS class name or a command-line flag. - -@example -``` -import {KebabCase} from 'type-fest'; - -// Simple - -const someVariable: KebabCase<'fooBar'> = 'foo-bar'; - -// Advanced - -type KebabCasedProperties = { - [K in keyof T as KebabCase]: T[K] -}; - -interface CliOptions { - dryRun: boolean; - includeFile: string; - foo: number; -} - -const rawCliOptions: KebabCasedProperties = { - 'dry-run': true, - 'include-file': 'bar.js', - foo: 123 -}; -``` - -@category Template Literals -*/ -export type KebabCase = DelimiterCase; diff --git a/node_modules/type-fest/ts41/kebab-cased-properties-deep.d.ts b/node_modules/type-fest/ts41/kebab-cased-properties-deep.d.ts deleted file mode 100644 index e7af08506..000000000 --- a/node_modules/type-fest/ts41/kebab-cased-properties-deep.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import {DelimiterCasedPropertiesDeep} from './delimiter-cased-properties-deep'; - -/** -Convert object properties to kebab case recursively. - -This can be useful when, for example, converting some API types from a different style. - -@see KebabCase -@see KebabCasedProperties - -@example -``` -interface User { - userId: number; - userName: string; -} - -interface UserWithFriends { - userInfo: User; - userFriends: User[]; -} - -const result: KebabCasedPropertiesDeep = { - 'user-info': { - 'user-id': 1, - 'user-name': 'Tom', - }, - 'user-friends': [ - { - 'user-id': 2, - 'user-name': 'Jerry', - }, - { - 'user-id': 3, - 'user-name': 'Spike', - }, - ], -}; -``` - -@category Template Literals -*/ -export type KebabCasedPropertiesDeep = DelimiterCasedPropertiesDeep; diff --git a/node_modules/type-fest/ts41/kebab-cased-properties.d.ts b/node_modules/type-fest/ts41/kebab-cased-properties.d.ts deleted file mode 100644 index 2529d76be..000000000 --- a/node_modules/type-fest/ts41/kebab-cased-properties.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import {DelimiterCasedProperties} from './delimiter-cased-properties'; - -/** -Convert object properties to kebab case but not recursively. - -This can be useful when, for example, converting some API types from a different style. - -@see KebabCase -@see KebabCasedPropertiesDeep - -@example -``` -interface User { - userId: number; - userName: string; -} - -const result: KebabCasedProperties = { - 'user-id': 1, - 'user-name': 'Tom', -}; -``` - -@category Template Literals -*/ -export type KebabCasedProperties = DelimiterCasedProperties; diff --git a/node_modules/type-fest/ts41/last-array-element.d.ts b/node_modules/type-fest/ts41/last-array-element.d.ts deleted file mode 100644 index d181be733..000000000 --- a/node_modules/type-fest/ts41/last-array-element.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** -Extracts the type of the last element of an array. - -Use-case: Defining the return type of functions that extract the last element of an array, for example [`lodash.last`](https://lodash.com/docs/4.17.15#last). - -@example -``` -import {LastArrayElement} from 'type-fest'; - -declare function lastOf(array: V): LastArrayElement; - -const array = ['foo', 2]; - -typeof lastOf(array); -//=> number -``` - -@category Template Literals -*/ -export type LastArrayElement = - ValueType extends [infer ElementType] - ? ElementType - : ValueType extends [infer _, ...infer Tail] - ? LastArrayElement - : never; diff --git a/node_modules/type-fest/ts41/pascal-case.d.ts b/node_modules/type-fest/ts41/pascal-case.d.ts deleted file mode 100644 index 518cc6b44..000000000 --- a/node_modules/type-fest/ts41/pascal-case.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {CamelCase} from './camel-case'; - -/** -Converts a string literal to pascal-case. - -@example -``` -import {PascalCase} from 'type-fest'; - -// Simple - -const someVariable: PascalCase<'foo-bar'> = 'FooBar'; - -// Advanced - -type PascalCaseProps = { - [K in keyof T as PascalCase]: T[K] -}; - -interface RawOptions { - 'dry-run': boolean; - 'full_family_name': string; - foo: number; -} - -const dbResult: CamelCasedProperties = { - DryRun: true, - FullFamilyName: 'bar.js', - Foo: 123 -}; -``` - -@category Template Literals -*/ -export type PascalCase = CamelCase extends string - ? Capitalize> - : CamelCase; diff --git a/node_modules/type-fest/ts41/pascal-cased-properties-deep.d.ts b/node_modules/type-fest/ts41/pascal-cased-properties-deep.d.ts deleted file mode 100644 index 87c02f33e..000000000 --- a/node_modules/type-fest/ts41/pascal-cased-properties-deep.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import {PascalCase} from './pascal-case'; - -/** -Convert object properties to pascal case recursively. - -This can be useful when, for example, converting some API types from a different style. - -@see PascalCase -@see PascalCasedProperties - -@example -``` -interface User { - userId: number; - userName: string; -} - -interface UserWithFriends { - userInfo: User; - userFriends: User[]; -} - -const result: PascalCasedPropertiesDeep = { - UserInfo: { - UserId: 1, - UserName: 'Tom', - }, - UserFriends: [ - { - UserId: 2, - UserName: 'Jerry', - }, - { - UserId: 3, - UserName: 'Spike', - }, - ], -}; -``` - -@category Template Literals -*/ -export type PascalCasedPropertiesDeep = Value extends Function - ? Value - : Value extends Array - ? Array> - : Value extends Set - ? Set> : { - [K in keyof Value as PascalCase]: PascalCasedPropertiesDeep; - }; diff --git a/node_modules/type-fest/ts41/pascal-cased-properties.d.ts b/node_modules/type-fest/ts41/pascal-cased-properties.d.ts deleted file mode 100644 index 14bae5e7b..000000000 --- a/node_modules/type-fest/ts41/pascal-cased-properties.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import {PascalCase} from './pascal-case'; - -/** -Convert object properties to pascal case but not recursively. - -This can be useful when, for example, converting some API types from a different style. - -@see PascalCase -@see PascalCasedPropertiesDeep - -@example -``` -interface User { - userId: number; - userName: string; -} - -const result: PascalCasedProperties = { - UserId: 1, - UserName: 'Tom', -}; -``` - -@category Template Literals -*/ -export type PascalCasedProperties = Value extends Function - ? Value - : Value extends Array - ? Value - : { [K in keyof Value as PascalCase]: Value[K] }; diff --git a/node_modules/type-fest/ts41/screaming-snake-case.d.ts b/node_modules/type-fest/ts41/screaming-snake-case.d.ts deleted file mode 100644 index 69569ba53..000000000 --- a/node_modules/type-fest/ts41/screaming-snake-case.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import {SplitIncludingDelimiters} from './delimiter-case'; -import {SnakeCase} from './snake-case'; -import {Includes} from './includes'; - -/** -Returns a boolean for whether the string is screaming snake case. -*/ -type IsScreamingSnakeCase = Value extends Uppercase - ? Includes, '_'>, '_'> extends true - ? true - : false - : false; - -/** -Convert a string literal to screaming-snake-case. - -This can be useful when, for example, converting a camel-cased object property to a screaming-snake-cased SQL column name. - -@example -``` -import {ScreamingSnakeCase} from 'type-fest'; - -const someVariable: ScreamingSnakeCase<'fooBar'> = 'FOO_BAR'; -``` - -@category Template Literals -*/ -export type ScreamingSnakeCase = Value extends string - ? IsScreamingSnakeCase extends true - ? Value - : Uppercase> - : Value; diff --git a/node_modules/type-fest/ts41/snake-case.d.ts b/node_modules/type-fest/ts41/snake-case.d.ts deleted file mode 100644 index 851d43fcc..000000000 --- a/node_modules/type-fest/ts41/snake-case.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {DelimiterCase} from './delimiter-case'; - -/** -Convert a string literal to snake-case. - -This can be useful when, for example, converting a camel-cased object property to a snake-cased SQL column name. - -@example -``` -import {SnakeCase} from 'type-fest'; - -// Simple - -const someVariable: SnakeCase<'fooBar'> = 'foo_bar'; - -// Advanced - -type SnakeCasedProperties = { - [K in keyof T as SnakeCase]: T[K] -}; - -interface ModelProps { - isHappy: boolean; - fullFamilyName: string; - foo: number; -} - -const dbResult: SnakeCasedProperties = { - 'is_happy': true, - 'full_family_name': 'Carla Smith', - foo: 123 -}; -``` - -@category Template Literals -*/ -export type SnakeCase = DelimiterCase; diff --git a/node_modules/type-fest/ts41/snake-cased-properties-deep.d.ts b/node_modules/type-fest/ts41/snake-cased-properties-deep.d.ts deleted file mode 100644 index 7133a0f15..000000000 --- a/node_modules/type-fest/ts41/snake-cased-properties-deep.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import {DelimiterCasedPropertiesDeep} from './delimiter-cased-properties-deep'; - -/** -Convert object properties to snake case recursively. - -This can be useful when, for example, converting some API types from a different style. - -@see SnakeCase -@see SnakeCasedProperties - -@example -``` -interface User { - userId: number; - userName: string; -} - -interface UserWithFriends { - userInfo: User; - userFriends: User[]; -} - -const result: SnakeCasedPropertiesDeep = { - user_info: { - user_id: 1, - user_name: 'Tom', - }, - user_friends: [ - { - user_id: 2, - user_name: 'Jerry', - }, - { - user_id: 3, - user_name: 'Spike', - }, - ], -}; -``` - -@category Template Literals -*/ -export type SnakeCasedPropertiesDeep = DelimiterCasedPropertiesDeep; diff --git a/node_modules/type-fest/ts41/snake-cased-properties.d.ts b/node_modules/type-fest/ts41/snake-cased-properties.d.ts deleted file mode 100644 index fc3011ea8..000000000 --- a/node_modules/type-fest/ts41/snake-cased-properties.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import {DelimiterCasedProperties} from './delimiter-cased-properties'; - -/** -Convert object properties to snake case but not recursively. - -This can be useful when, for example, converting some API types from a different style. - -@see SnakeCase -@see SnakeCasedPropertiesDeep - -@example -``` -interface User { - userId: number; - userName: string; -} - -const result: SnakeCasedProperties = { - user_id: 1, - user_name: 'Tom', -}; -``` - -@category Template Literals -*/ -export type SnakeCasedProperties = DelimiterCasedProperties; diff --git a/node_modules/type-fest/ts41/split.d.ts b/node_modules/type-fest/ts41/split.d.ts deleted file mode 100644 index 7039af8fb..000000000 --- a/node_modules/type-fest/ts41/split.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** -Represents an array of strings split using a given character or character set. - -Use-case: Defining the return type of a method like `String.prototype.split`. - -@example -``` -import {Split} from 'type-fest'; - -declare function split(string: S, separator: D): Split; - -type Item = 'foo' | 'bar' | 'baz' | 'waldo'; -const items = 'foo,bar,baz,waldo'; -let array: Item[]; - -array = split(items, ','); -``` - -@category Template Literals -*/ -export type Split< - S extends string, - Delimiter extends string -> = S extends `${infer Head}${Delimiter}${infer Tail}` - ? [Head, ...Split] - : S extends Delimiter - ? [] - : [S]; diff --git a/node_modules/type-fest/ts41/trim.d.ts b/node_modules/type-fest/ts41/trim.d.ts deleted file mode 100644 index a226cf266..000000000 --- a/node_modules/type-fest/ts41/trim.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** -Remove spaces from the left side. -*/ -type TrimLeft = V extends ` ${infer R}` ? TrimLeft : V; - -/** -Remove spaces from the right side. -*/ -type TrimRight = V extends `${infer R} ` ? TrimRight : V; - -/** -Remove leading and trailing spaces from a string. - -@example -``` -import {Trim} from 'type-fest'; - -Trim<' foo '> -//=> 'foo' -``` - -@category Template Literals -*/ -export type Trim = TrimLeft>; diff --git a/node_modules/type-fest/ts41/utilities.d.ts b/node_modules/type-fest/ts41/utilities.d.ts deleted file mode 100644 index f82e362fb..000000000 --- a/node_modules/type-fest/ts41/utilities.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** -Recursively split a string literal into two parts on the first occurence of the given string, returning an array literal of all the separate parts. -*/ -export type Split = - string extends S ? string[] : - S extends '' ? [] : - S extends `${infer T}${D}${infer U}` ? [T, ...Split] : - [S]; diff --git a/node_modules/uri-js/LICENSE b/node_modules/uri-js/LICENSE deleted file mode 100755 index 9338bde8e..000000000 --- a/node_modules/uri-js/LICENSE +++ /dev/null @@ -1,11 +0,0 @@ -Copyright 2011 Gary Court. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY GARY COURT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Gary Court. diff --git a/node_modules/uri-js/README.md b/node_modules/uri-js/README.md deleted file mode 100755 index 43e648bba..000000000 --- a/node_modules/uri-js/README.md +++ /dev/null @@ -1,203 +0,0 @@ -# URI.js - -URI.js is an [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt) compliant, scheme extendable URI parsing/validating/resolving library for all JavaScript environments (browsers, Node.js, etc). -It is also compliant with the IRI ([RFC 3987](http://www.ietf.org/rfc/rfc3987.txt)), IDNA ([RFC 5890](http://www.ietf.org/rfc/rfc5890.txt)), IPv6 Address ([RFC 5952](http://www.ietf.org/rfc/rfc5952.txt)), IPv6 Zone Identifier ([RFC 6874](http://www.ietf.org/rfc/rfc6874.txt)) specifications. - -URI.js has an extensive test suite, and works in all (Node.js, web) environments. It weighs in at 6.4kb (gzipped, 17kb deflated). - -## API - -### Parsing - - URI.parse("uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body"); - //returns: - //{ - // scheme : "uri", - // userinfo : "user:pass", - // host : "example.com", - // port : 123, - // path : "/one/two.three", - // query : "q1=a1&q2=a2", - // fragment : "body" - //} - -### Serializing - - URI.serialize({scheme : "http", host : "example.com", fragment : "footer"}) === "http://example.com/#footer" - -### Resolving - - URI.resolve("uri://a/b/c/d?q", "../../g") === "uri://a/g" - -### Normalizing - - URI.normalize("HTTP://ABC.com:80/%7Esmith/home.html") === "http://abc.com/~smith/home.html" - -### Comparison - - URI.equal("example://a/b/c/%7Bfoo%7D", "eXAMPLE://a/./b/../b/%63/%7bfoo%7d") === true - -### IP Support - - //IPv4 normalization - URI.normalize("//192.068.001.000") === "//192.68.1.0" - - //IPv6 normalization - URI.normalize("//[2001:0:0DB8::0:0001]") === "//[2001:0:db8::1]" - - //IPv6 zone identifier support - URI.parse("//[2001:db8::7%25en1]"); - //returns: - //{ - // host : "2001:db8::7%en1" - //} - -### IRI Support - - //convert IRI to URI - URI.serialize(URI.parse("http://examplé.org/rosé")) === "http://xn--exampl-gva.org/ros%C3%A9" - //convert URI to IRI - URI.serialize(URI.parse("http://xn--exampl-gva.org/ros%C3%A9"), {iri:true}) === "http://examplé.org/rosé" - -### Options - -All of the above functions can accept an additional options argument that is an object that can contain one or more of the following properties: - -* `scheme` (string) - - Indicates the scheme that the URI should be treated as, overriding the URI's normal scheme parsing behavior. - -* `reference` (string) - - If set to `"suffix"`, it indicates that the URI is in the suffix format, and the validator will use the option's `scheme` property to determine the URI's scheme. - -* `tolerant` (boolean, false) - - If set to `true`, the parser will relax URI resolving rules. - -* `absolutePath` (boolean, false) - - If set to `true`, the serializer will not resolve a relative `path` component. - -* `iri` (boolean, false) - - If set to `true`, the serializer will unescape non-ASCII characters as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). - -* `unicodeSupport` (boolean, false) - - If set to `true`, the parser will unescape non-ASCII characters in the parsed output as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). - -* `domainHost` (boolean, false) - - If set to `true`, the library will treat the `host` component as a domain name, and convert IDNs (International Domain Names) as per [RFC 5891](http://www.ietf.org/rfc/rfc5891.txt). - -## Scheme Extendable - -URI.js supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_scheme) dependent processing rules. Currently, URI.js has built in support for the following schemes: - -* http \[[RFC 2616](http://www.ietf.org/rfc/rfc2616.txt)\] -* https \[[RFC 2818](http://www.ietf.org/rfc/rfc2818.txt)\] -* ws \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\] -* wss \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\] -* mailto \[[RFC 6068](http://www.ietf.org/rfc/rfc6068.txt)\] -* urn \[[RFC 2141](http://www.ietf.org/rfc/rfc2141.txt)\] -* urn:uuid \[[RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)\] - -### HTTP/HTTPS Support - - URI.equal("HTTP://ABC.COM:80", "http://abc.com/") === true - URI.equal("https://abc.com", "HTTPS://ABC.COM:443/") === true - -### WS/WSS Support - - URI.parse("wss://example.com/foo?bar=baz"); - //returns: - //{ - // scheme : "wss", - // host: "example.com", - // resourceName: "/foo?bar=baz", - // secure: true, - //} - - URI.equal("WS://ABC.COM:80/chat#one", "ws://abc.com/chat") === true - -### Mailto Support - - URI.parse("mailto:alpha@example.com,bravo@example.com?subject=SUBSCRIBE&body=Sign%20me%20up!"); - //returns: - //{ - // scheme : "mailto", - // to : ["alpha@example.com", "bravo@example.com"], - // subject : "SUBSCRIBE", - // body : "Sign me up!" - //} - - URI.serialize({ - scheme : "mailto", - to : ["alpha@example.com"], - subject : "REMOVE", - body : "Please remove me", - headers : { - cc : "charlie@example.com" - } - }) === "mailto:alpha@example.com?cc=charlie@example.com&subject=REMOVE&body=Please%20remove%20me" - -### URN Support - - URI.parse("urn:example:foo"); - //returns: - //{ - // scheme : "urn", - // nid : "example", - // nss : "foo", - //} - -#### URN UUID Support - - URI.parse("urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"); - //returns: - //{ - // scheme : "urn", - // nid : "uuid", - // uuid : "f81d4fae-7dec-11d0-a765-00a0c91e6bf6", - //} - -## Usage - -To load in a browser, use the following tag: - - - -To load in a CommonJS/Module environment, first install with npm/yarn by running on the command line: - - npm install uri-js - # OR - yarn add uri-js - -Then, in your code, load it using: - - const URI = require("uri-js"); - -If you are writing your code in ES6+ (ESNEXT) or TypeScript, you would load it using: - - import * as URI from "uri-js"; - -Or you can load just what you need using named exports: - - import { parse, serialize, resolve, resolveComponents, normalize, equal, removeDotSegments, pctEncChar, pctDecChars, escapeComponent, unescapeComponent } from "uri-js"; - -## Breaking changes - -### Breaking changes from 3.x - -URN parsing has been completely changed to better align with the specification. Scheme is now always `urn`, but has two new properties: `nid` which contains the Namspace Identifier, and `nss` which contains the Namespace Specific String. The `nss` property will be removed by higher order scheme handlers, such as the UUID URN scheme handler. - -The UUID of a URN can now be found in the `uuid` property. - -### Breaking changes from 2.x - -URI validation has been removed as it was slow, exposed a vulnerabilty, and was generally not useful. - -### Breaking changes from 1.x - -The `errors` array on parsed components is now an `error` string. diff --git a/node_modules/uri-js/dist/es5/uri.all.d.ts b/node_modules/uri-js/dist/es5/uri.all.d.ts deleted file mode 100755 index da51e2352..000000000 --- a/node_modules/uri-js/dist/es5/uri.all.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -export interface URIComponents { - scheme?: string; - userinfo?: string; - host?: string; - port?: number | string; - path?: string; - query?: string; - fragment?: string; - reference?: string; - error?: string; -} -export interface URIOptions { - scheme?: string; - reference?: string; - tolerant?: boolean; - absolutePath?: boolean; - iri?: boolean; - unicodeSupport?: boolean; - domainHost?: boolean; -} -export interface URISchemeHandler { - scheme: string; - parse(components: ParentComponents, options: Options): Components; - serialize(components: Components, options: Options): ParentComponents; - unicodeSupport?: boolean; - domainHost?: boolean; - absolutePath?: boolean; -} -export interface URIRegExps { - NOT_SCHEME: RegExp; - NOT_USERINFO: RegExp; - NOT_HOST: RegExp; - NOT_PATH: RegExp; - NOT_PATH_NOSCHEME: RegExp; - NOT_QUERY: RegExp; - NOT_FRAGMENT: RegExp; - ESCAPE: RegExp; - UNRESERVED: RegExp; - OTHER_CHARS: RegExp; - PCT_ENCODED: RegExp; - IPV4ADDRESS: RegExp; - IPV6ADDRESS: RegExp; -} -export declare const SCHEMES: { - [scheme: string]: URISchemeHandler; -}; -export declare function pctEncChar(chr: string): string; -export declare function pctDecChars(str: string): string; -export declare function parse(uriString: string, options?: URIOptions): URIComponents; -export declare function removeDotSegments(input: string): string; -export declare function serialize(components: URIComponents, options?: URIOptions): string; -export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; -export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; -export declare function normalize(uri: string, options?: URIOptions): string; -export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; -export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; -export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; -export declare function escapeComponent(str: string, options?: URIOptions): string; -export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/node_modules/uri-js/dist/es5/uri.all.js b/node_modules/uri-js/dist/es5/uri.all.js deleted file mode 100755 index 0706116fe..000000000 --- a/node_modules/uri-js/dist/es5/uri.all.js +++ /dev/null @@ -1,1443 +0,0 @@ -/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.URI = global.URI || {}))); -}(this, (function (exports) { 'use strict'; - -function merge() { - for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { - sets[_key] = arguments[_key]; - } - - if (sets.length > 1) { - sets[0] = sets[0].slice(0, -1); - var xl = sets.length - 1; - for (var x = 1; x < xl; ++x) { - sets[x] = sets[x].slice(1, -1); - } - sets[xl] = sets[xl].slice(1); - return sets.join(''); - } else { - return sets[0]; - } -} -function subexp(str) { - return "(?:" + str + ")"; -} -function typeOf(o) { - return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); -} -function toUpperCase(str) { - return str.toUpperCase(); -} -function toArray(obj) { - return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; -} -function assign(target, source) { - var obj = target; - if (source) { - for (var key in source) { - obj[key] = source[key]; - } - } - return obj; -} - -function buildExps(isIRI) { - var ALPHA$$ = "[A-Za-z]", - CR$ = "[\\x0D]", - DIGIT$$ = "[0-9]", - DQUOTE$$ = "[\\x22]", - HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), - //case-insensitive - LF$$ = "[\\x0A]", - SP$$ = "[\\x20]", - PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), - //expanded - GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", - SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", - RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), - UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", - //subset, excludes bidi control characters - IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", - //subset - UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), - SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), - USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), - DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), - DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), - //relaxed parsing rules - IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), - H16$ = subexp(HEXDIG$$ + "{1,4}"), - LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), - IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), - // 6( h16 ":" ) ls32 - IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), - // "::" 5( h16 ":" ) ls32 - IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), - //[ h16 ] "::" 4( h16 ":" ) ls32 - IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), - //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 - IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), - //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 - IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), - //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 - IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), - //[ *4( h16 ":" ) h16 ] "::" ls32 - IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), - //[ *5( h16 ":" ) h16 ] "::" h16 - IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), - //[ *6( h16 ":" ) h16 ] "::" - IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), - ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), - //RFC 6874 - IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), - //RFC 6874 - IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), - //RFC 6874, with relaxed parsing rules - IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), - IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), - //RFC 6874 - REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), - HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), - PORT$ = subexp(DIGIT$$ + "*"), - AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), - PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), - SEGMENT$ = subexp(PCHAR$ + "*"), - SEGMENT_NZ$ = subexp(PCHAR$ + "+"), - SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), - PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), - PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), - //simplified - PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), - //simplified - PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), - //simplified - PATH_EMPTY$ = "(?!" + PCHAR$ + ")", - PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), - QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), - FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), - HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), - URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), - RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), - RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), - URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), - ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), - GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", - RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", - ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", - SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", - AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; - return { - NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), - NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), - NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), - ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), - UNRESERVED: new RegExp(UNRESERVED$$, "g"), - OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), - PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), - IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), - IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules - }; -} -var URI_PROTOCOL = buildExps(false); - -var IRI_PROTOCOL = buildExps(true); - -var slicedToArray = function () { - function sliceIterator(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"]) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; - } - - return function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if (Symbol.iterator in Object(arr)) { - return sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - }; -}(); - - - - - - - - - - - - - -var toConsumableArray = function (arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } else { - return Array.from(arr); - } -}; - -/** Highest positive signed 32-bit float value */ - -var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - -/** Bootstring parameters */ -var base = 36; -var tMin = 1; -var tMax = 26; -var skew = 38; -var damp = 700; -var initialBias = 72; -var initialN = 128; // 0x80 -var delimiter = '-'; // '\x2D' - -/** Regular expressions */ -var regexPunycode = /^xn--/; -var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars -var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - -/** Error messages */ -var errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' -}; - -/** Convenience shortcuts */ -var baseMinusTMin = base - tMin; -var floor = Math.floor; -var stringFromCharCode = String.fromCharCode; - -/*--------------------------------------------------------------------------*/ - -/** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ -function error$1(type) { - throw new RangeError(errors[type]); -} - -/** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ -function map(array, fn) { - var result = []; - var length = array.length; - while (length--) { - result[length] = fn(array[length]); - } - return result; -} - -/** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {Array} A new string of characters returned by the callback - * function. - */ -function mapDomain(string, fn) { - var parts = string.split('@'); - var result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - string = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - string = string.replace(regexSeparators, '\x2E'); - var labels = string.split('.'); - var encoded = map(labels, fn).join('.'); - return result + encoded; -} - -/** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ -function ucs2decode(string) { - var output = []; - var counter = 0; - var length = string.length; - while (counter < length) { - var value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // It's a high surrogate, and there is a next character. - var extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { - // Low surrogate. - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // It's an unmatched surrogate; only append this code unit, in case the - // next code unit is the high surrogate of a surrogate pair. - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; -} - -/** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ -var ucs2encode = function ucs2encode(array) { - return String.fromCodePoint.apply(String, toConsumableArray(array)); -}; - -/** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ -var basicToDigit = function basicToDigit(codePoint) { - if (codePoint - 0x30 < 0x0A) { - return codePoint - 0x16; - } - if (codePoint - 0x41 < 0x1A) { - return codePoint - 0x41; - } - if (codePoint - 0x61 < 0x1A) { - return codePoint - 0x61; - } - return base; -}; - -/** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ -var digitToBasic = function digitToBasic(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); -}; - -/** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ -var adapt = function adapt(delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); -}; - -/** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ -var decode = function decode(input) { - // Don't use UCS-2. - var output = []; - var inputLength = input.length; - var i = 0; - var n = initialN; - var bias = initialBias; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - var basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (var j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error$1('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - var oldi = i; - for (var w = 1, k = base;; /* no condition */k += base) { - - if (index >= inputLength) { - error$1('invalid-input'); - } - - var digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base || digit > floor((maxInt - i) / w)) { - error$1('overflow'); - } - - i += digit * w; - var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; - - if (digit < t) { - break; - } - - var baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error$1('overflow'); - } - - w *= baseMinusT; - } - - var out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error$1('overflow'); - } - - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output. - output.splice(i++, 0, n); - } - - return String.fromCodePoint.apply(String, output); -}; - -/** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ -var encode = function encode(input) { - var output = []; - - // Convert the input in UCS-2 to an array of Unicode code points. - input = ucs2decode(input); - - // Cache the length. - var inputLength = input.length; - - // Initialize the state. - var n = initialN; - var delta = 0; - var bias = initialBias; - - // Handle the basic code points. - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _currentValue2 = _step.value; - - if (_currentValue2 < 0x80) { - output.push(stringFromCharCode(_currentValue2)); - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - var basicLength = output.length; - var handledCPCount = basicLength; - - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - - // Finish the basic string with a delimiter unless it's empty. - if (basicLength) { - output.push(delimiter); - } - - // Main encoding loop: - while (handledCPCount < inputLength) { - - // All non-basic code points < n have been handled already. Find the next - // larger one: - var m = maxInt; - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var currentValue = _step2.value; - - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow. - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } - - var handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error$1('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; - - try { - for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var _currentValue = _step3.value; - - if (_currentValue < n && ++delta > maxInt) { - error$1('overflow'); - } - if (_currentValue == n) { - // Represent delta as a generalized variable-length integer. - var q = delta; - for (var k = base;; /* no condition */k += base) { - var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; - if (q < t) { - break; - } - var qMinusT = q - t; - var baseMinusT = base - t; - output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; - } - } - } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; - } finally { - try { - if (!_iteratorNormalCompletion3 && _iterator3.return) { - _iterator3.return(); - } - } finally { - if (_didIteratorError3) { - throw _iteratorError3; - } - } - } - - ++delta; - ++n; - } - return output.join(''); -}; - -/** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ -var toUnicode = function toUnicode(input) { - return mapDomain(input, function (string) { - return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; - }); -}; - -/** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ -var toASCII = function toASCII(input) { - return mapDomain(input, function (string) { - return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; - }); -}; - -/*--------------------------------------------------------------------------*/ - -/** Define the public API */ -var punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '2.1.0', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode -}; - -/** - * URI.js - * - * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. - * @author Gary Court - * @see http://github.com/garycourt/uri-js - */ -/** - * Copyright 2011 Gary Court. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of Gary Court. - */ -var SCHEMES = {}; -function pctEncChar(chr) { - var c = chr.charCodeAt(0); - var e = void 0; - if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); - return e; -} -function pctDecChars(str) { - var newStr = ""; - var i = 0; - var il = str.length; - while (i < il) { - var c = parseInt(str.substr(i + 1, 2), 16); - if (c < 128) { - newStr += String.fromCharCode(c); - i += 3; - } else if (c >= 194 && c < 224) { - if (il - i >= 6) { - var c2 = parseInt(str.substr(i + 4, 2), 16); - newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); - } else { - newStr += str.substr(i, 6); - } - i += 6; - } else if (c >= 224) { - if (il - i >= 9) { - var _c = parseInt(str.substr(i + 4, 2), 16); - var c3 = parseInt(str.substr(i + 7, 2), 16); - newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); - } else { - newStr += str.substr(i, 9); - } - i += 9; - } else { - newStr += str.substr(i, 3); - i += 3; - } - } - return newStr; -} -function _normalizeComponentEncoding(components, protocol) { - function decodeUnreserved(str) { - var decStr = pctDecChars(str); - return !decStr.match(protocol.UNRESERVED) ? str : decStr; - } - if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); - if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - return components; -} - -function _stripLeadingZeros(str) { - return str.replace(/^0*(.*)/, "$1") || "0"; -} -function _normalizeIPv4(host, protocol) { - var matches = host.match(protocol.IPV4ADDRESS) || []; - - var _matches = slicedToArray(matches, 2), - address = _matches[1]; - - if (address) { - return address.split(".").map(_stripLeadingZeros).join("."); - } else { - return host; - } -} -function _normalizeIPv6(host, protocol) { - var matches = host.match(protocol.IPV6ADDRESS) || []; - - var _matches2 = slicedToArray(matches, 3), - address = _matches2[1], - zone = _matches2[2]; - - if (address) { - var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), - _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), - last = _address$toLowerCase$2[0], - first = _address$toLowerCase$2[1]; - - var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; - var lastFields = last.split(":").map(_stripLeadingZeros); - var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); - var fieldCount = isLastFieldIPv4Address ? 7 : 8; - var lastFieldsStart = lastFields.length - fieldCount; - var fields = Array(fieldCount); - for (var x = 0; x < fieldCount; ++x) { - fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; - } - if (isLastFieldIPv4Address) { - fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); - } - var allZeroFields = fields.reduce(function (acc, field, index) { - if (!field || field === "0") { - var lastLongest = acc[acc.length - 1]; - if (lastLongest && lastLongest.index + lastLongest.length === index) { - lastLongest.length++; - } else { - acc.push({ index: index, length: 1 }); - } - } - return acc; - }, []); - var longestZeroFields = allZeroFields.sort(function (a, b) { - return b.length - a.length; - })[0]; - var newHost = void 0; - if (longestZeroFields && longestZeroFields.length > 1) { - var newFirst = fields.slice(0, longestZeroFields.index); - var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); - newHost = newFirst.join(":") + "::" + newLast.join(":"); - } else { - newHost = fields.join(":"); - } - if (zone) { - newHost += "%" + zone; - } - return newHost; - } else { - return host; - } -} -var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; -var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; -function parse(uriString) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var components = {}; - var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; - if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; - var matches = uriString.match(URI_PARSE); - if (matches) { - if (NO_MATCH_IS_UNDEFINED) { - //store each component - components.scheme = matches[1]; - components.userinfo = matches[3]; - components.host = matches[4]; - components.port = parseInt(matches[5], 10); - components.path = matches[6] || ""; - components.query = matches[7]; - components.fragment = matches[8]; - //fix port number - if (isNaN(components.port)) { - components.port = matches[5]; - } - } else { - //IE FIX for improper RegExp matching - //store each component - components.scheme = matches[1] || undefined; - components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; - components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; - components.port = parseInt(matches[5], 10); - components.path = matches[6] || ""; - components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; - components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; - //fix port number - if (isNaN(components.port)) { - components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; - } - } - if (components.host) { - //normalize IP hosts - components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); - } - //determine reference type - if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { - components.reference = "same-document"; - } else if (components.scheme === undefined) { - components.reference = "relative"; - } else if (components.fragment === undefined) { - components.reference = "absolute"; - } else { - components.reference = "uri"; - } - //check for reference errors - if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { - components.error = components.error || "URI is not a " + options.reference + " reference."; - } - //find scheme handler - var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - //check if scheme can't handle IRIs - if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { - //if host component is a domain name - if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { - //convert Unicode IDN -> ASCII IDN - try { - components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); - } catch (e) { - components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; - } - } - //convert IRI -> URI - _normalizeComponentEncoding(components, URI_PROTOCOL); - } else { - //normalize encodings - _normalizeComponentEncoding(components, protocol); - } - //perform scheme specific parsing - if (schemeHandler && schemeHandler.parse) { - schemeHandler.parse(components, options); - } - } else { - components.error = components.error || "URI can not be parsed."; - } - return components; -} - -function _recomposeAuthority(components, options) { - var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; - var uriTokens = []; - if (components.userinfo !== undefined) { - uriTokens.push(components.userinfo); - uriTokens.push("@"); - } - if (components.host !== undefined) { - //normalize IP hosts, add brackets and escape zone separator for IPv6 - uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { - return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; - })); - } - if (typeof components.port === "number" || typeof components.port === "string") { - uriTokens.push(":"); - uriTokens.push(String(components.port)); - } - return uriTokens.length ? uriTokens.join("") : undefined; -} - -var RDS1 = /^\.\.?\//; -var RDS2 = /^\/\.(\/|$)/; -var RDS3 = /^\/\.\.(\/|$)/; -var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; -function removeDotSegments(input) { - var output = []; - while (input.length) { - if (input.match(RDS1)) { - input = input.replace(RDS1, ""); - } else if (input.match(RDS2)) { - input = input.replace(RDS2, "/"); - } else if (input.match(RDS3)) { - input = input.replace(RDS3, "/"); - output.pop(); - } else if (input === "." || input === "..") { - input = ""; - } else { - var im = input.match(RDS5); - if (im) { - var s = im[0]; - input = input.slice(s.length); - output.push(s); - } else { - throw new Error("Unexpected dot segment condition"); - } - } - } - return output.join(""); -} - -function serialize(components) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; - var uriTokens = []; - //find scheme handler - var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - //perform scheme specific serialization - if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); - if (components.host) { - //if host component is an IPv6 address - if (protocol.IPV6ADDRESS.test(components.host)) {} - //TODO: normalize IPv6 address as per RFC 5952 - - //if host component is a domain name - else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { - //convert IDN via punycode - try { - components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); - } catch (e) { - components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; - } - } - } - //normalize encoding - _normalizeComponentEncoding(components, protocol); - if (options.reference !== "suffix" && components.scheme) { - uriTokens.push(components.scheme); - uriTokens.push(":"); - } - var authority = _recomposeAuthority(components, options); - if (authority !== undefined) { - if (options.reference !== "suffix") { - uriTokens.push("//"); - } - uriTokens.push(authority); - if (components.path && components.path.charAt(0) !== "/") { - uriTokens.push("/"); - } - } - if (components.path !== undefined) { - var s = components.path; - if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { - s = removeDotSegments(s); - } - if (authority === undefined) { - s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" - } - uriTokens.push(s); - } - if (components.query !== undefined) { - uriTokens.push("?"); - uriTokens.push(components.query); - } - if (components.fragment !== undefined) { - uriTokens.push("#"); - uriTokens.push(components.fragment); - } - return uriTokens.join(""); //merge tokens into a string -} - -function resolveComponents(base, relative) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var skipNormalization = arguments[3]; - - var target = {}; - if (!skipNormalization) { - base = parse(serialize(base, options), options); //normalize base components - relative = parse(serialize(relative, options), options); //normalize relative components - } - options = options || {}; - if (!options.tolerant && relative.scheme) { - target.scheme = relative.scheme; - //target.authority = relative.authority; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } else { - if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { - //target.authority = relative.authority; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } else { - if (!relative.path) { - target.path = base.path; - if (relative.query !== undefined) { - target.query = relative.query; - } else { - target.query = base.query; - } - } else { - if (relative.path.charAt(0) === "/") { - target.path = removeDotSegments(relative.path); - } else { - if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { - target.path = "/" + relative.path; - } else if (!base.path) { - target.path = relative.path; - } else { - target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; - } - target.path = removeDotSegments(target.path); - } - target.query = relative.query; - } - //target.authority = base.authority; - target.userinfo = base.userinfo; - target.host = base.host; - target.port = base.port; - } - target.scheme = base.scheme; - } - target.fragment = relative.fragment; - return target; -} - -function resolve(baseURI, relativeURI, options) { - var schemelessOptions = assign({ scheme: 'null' }, options); - return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); -} - -function normalize(uri, options) { - if (typeof uri === "string") { - uri = serialize(parse(uri, options), options); - } else if (typeOf(uri) === "object") { - uri = parse(serialize(uri, options), options); - } - return uri; -} - -function equal(uriA, uriB, options) { - if (typeof uriA === "string") { - uriA = serialize(parse(uriA, options), options); - } else if (typeOf(uriA) === "object") { - uriA = serialize(uriA, options); - } - if (typeof uriB === "string") { - uriB = serialize(parse(uriB, options), options); - } else if (typeOf(uriB) === "object") { - uriB = serialize(uriB, options); - } - return uriA === uriB; -} - -function escapeComponent(str, options) { - return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); -} - -function unescapeComponent(str, options) { - return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); -} - -var handler = { - scheme: "http", - domainHost: true, - parse: function parse(components, options) { - //report missing host - if (!components.host) { - components.error = components.error || "HTTP URIs must have a host."; - } - return components; - }, - serialize: function serialize(components, options) { - var secure = String(components.scheme).toLowerCase() === "https"; - //normalize the default port - if (components.port === (secure ? 443 : 80) || components.port === "") { - components.port = undefined; - } - //normalize the empty path - if (!components.path) { - components.path = "/"; - } - //NOTE: We do not parse query strings for HTTP URIs - //as WWW Form Url Encoded query strings are part of the HTML4+ spec, - //and not the HTTP spec. - return components; - } -}; - -var handler$1 = { - scheme: "https", - domainHost: handler.domainHost, - parse: handler.parse, - serialize: handler.serialize -}; - -function isSecure(wsComponents) { - return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; -} -//RFC 6455 -var handler$2 = { - scheme: "ws", - domainHost: true, - parse: function parse(components, options) { - var wsComponents = components; - //indicate if the secure flag is set - wsComponents.secure = isSecure(wsComponents); - //construct resouce name - wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); - wsComponents.path = undefined; - wsComponents.query = undefined; - return wsComponents; - }, - serialize: function serialize(wsComponents, options) { - //normalize the default port - if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { - wsComponents.port = undefined; - } - //ensure scheme matches secure flag - if (typeof wsComponents.secure === 'boolean') { - wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; - wsComponents.secure = undefined; - } - //reconstruct path from resource name - if (wsComponents.resourceName) { - var _wsComponents$resourc = wsComponents.resourceName.split('?'), - _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), - path = _wsComponents$resourc2[0], - query = _wsComponents$resourc2[1]; - - wsComponents.path = path && path !== '/' ? path : undefined; - wsComponents.query = query; - wsComponents.resourceName = undefined; - } - //forbid fragment component - wsComponents.fragment = undefined; - return wsComponents; - } -}; - -var handler$3 = { - scheme: "wss", - domainHost: handler$2.domainHost, - parse: handler$2.parse, - serialize: handler$2.serialize -}; - -var O = {}; -var isIRI = true; -//RFC 3986 -var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; -var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive -var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded -//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = -//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; -//const WSP$$ = "[\\x20\\x09]"; -//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) -//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext -//const VCHAR$$ = "[\\x21-\\x7E]"; -//const WSP$$ = "[\\x20\\x09]"; -//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext -//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); -//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); -//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); -var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; -var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; -var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); -var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; -var UNRESERVED = new RegExp(UNRESERVED$$, "g"); -var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); -var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); -var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); -var NOT_HFVALUE = NOT_HFNAME; -function decodeUnreserved(str) { - var decStr = pctDecChars(str); - return !decStr.match(UNRESERVED) ? str : decStr; -} -var handler$4 = { - scheme: "mailto", - parse: function parse$$1(components, options) { - var mailtoComponents = components; - var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; - mailtoComponents.path = undefined; - if (mailtoComponents.query) { - var unknownHeaders = false; - var headers = {}; - var hfields = mailtoComponents.query.split("&"); - for (var x = 0, xl = hfields.length; x < xl; ++x) { - var hfield = hfields[x].split("="); - switch (hfield[0]) { - case "to": - var toAddrs = hfield[1].split(","); - for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { - to.push(toAddrs[_x]); - } - break; - case "subject": - mailtoComponents.subject = unescapeComponent(hfield[1], options); - break; - case "body": - mailtoComponents.body = unescapeComponent(hfield[1], options); - break; - default: - unknownHeaders = true; - headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); - break; - } - } - if (unknownHeaders) mailtoComponents.headers = headers; - } - mailtoComponents.query = undefined; - for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { - var addr = to[_x2].split("@"); - addr[0] = unescapeComponent(addr[0]); - if (!options.unicodeSupport) { - //convert Unicode IDN -> ASCII IDN - try { - addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); - } catch (e) { - mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; - } - } else { - addr[1] = unescapeComponent(addr[1], options).toLowerCase(); - } - to[_x2] = addr.join("@"); - } - return mailtoComponents; - }, - serialize: function serialize$$1(mailtoComponents, options) { - var components = mailtoComponents; - var to = toArray(mailtoComponents.to); - if (to) { - for (var x = 0, xl = to.length; x < xl; ++x) { - var toAddr = String(to[x]); - var atIdx = toAddr.lastIndexOf("@"); - var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); - var domain = toAddr.slice(atIdx + 1); - //convert IDN via punycode - try { - domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); - } catch (e) { - components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; - } - to[x] = localPart + "@" + domain; - } - components.path = to.join(","); - } - var headers = mailtoComponents.headers = mailtoComponents.headers || {}; - if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; - if (mailtoComponents.body) headers["body"] = mailtoComponents.body; - var fields = []; - for (var name in headers) { - if (headers[name] !== O[name]) { - fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); - } - } - if (fields.length) { - components.query = fields.join("&"); - } - return components; - } -}; - -var URN_PARSE = /^([^\:]+)\:(.*)/; -//RFC 2141 -var handler$5 = { - scheme: "urn", - parse: function parse$$1(components, options) { - var matches = components.path && components.path.match(URN_PARSE); - var urnComponents = components; - if (matches) { - var scheme = options.scheme || urnComponents.scheme || "urn"; - var nid = matches[1].toLowerCase(); - var nss = matches[2]; - var urnScheme = scheme + ":" + (options.nid || nid); - var schemeHandler = SCHEMES[urnScheme]; - urnComponents.nid = nid; - urnComponents.nss = nss; - urnComponents.path = undefined; - if (schemeHandler) { - urnComponents = schemeHandler.parse(urnComponents, options); - } - } else { - urnComponents.error = urnComponents.error || "URN can not be parsed."; - } - return urnComponents; - }, - serialize: function serialize$$1(urnComponents, options) { - var scheme = options.scheme || urnComponents.scheme || "urn"; - var nid = urnComponents.nid; - var urnScheme = scheme + ":" + (options.nid || nid); - var schemeHandler = SCHEMES[urnScheme]; - if (schemeHandler) { - urnComponents = schemeHandler.serialize(urnComponents, options); - } - var uriComponents = urnComponents; - var nss = urnComponents.nss; - uriComponents.path = (nid || options.nid) + ":" + nss; - return uriComponents; - } -}; - -var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; -//RFC 4122 -var handler$6 = { - scheme: "urn:uuid", - parse: function parse(urnComponents, options) { - var uuidComponents = urnComponents; - uuidComponents.uuid = uuidComponents.nss; - uuidComponents.nss = undefined; - if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { - uuidComponents.error = uuidComponents.error || "UUID is not valid."; - } - return uuidComponents; - }, - serialize: function serialize(uuidComponents, options) { - var urnComponents = uuidComponents; - //normalize UUID - urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); - return urnComponents; - } -}; - -SCHEMES[handler.scheme] = handler; -SCHEMES[handler$1.scheme] = handler$1; -SCHEMES[handler$2.scheme] = handler$2; -SCHEMES[handler$3.scheme] = handler$3; -SCHEMES[handler$4.scheme] = handler$4; -SCHEMES[handler$5.scheme] = handler$5; -SCHEMES[handler$6.scheme] = handler$6; - -exports.SCHEMES = SCHEMES; -exports.pctEncChar = pctEncChar; -exports.pctDecChars = pctDecChars; -exports.parse = parse; -exports.removeDotSegments = removeDotSegments; -exports.serialize = serialize; -exports.resolveComponents = resolveComponents; -exports.resolve = resolve; -exports.normalize = normalize; -exports.equal = equal; -exports.escapeComponent = escapeComponent; -exports.unescapeComponent = unescapeComponent; - -Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=uri.all.js.map diff --git a/node_modules/uri-js/dist/es5/uri.all.js.map b/node_modules/uri-js/dist/es5/uri.all.js.map deleted file mode 100755 index 5b30c4e22..000000000 --- a/node_modules/uri-js/dist/es5/uri.all.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uri.all.js","sources":["../../src/index.ts","../../src/schemes/urn-uuid.ts","../../src/schemes/urn.ts","../../src/schemes/mailto.ts","../../src/schemes/wss.ts","../../src/schemes/ws.ts","../../src/schemes/https.ts","../../src/schemes/http.ts","../../src/uri.ts","../../node_modules/punycode/punycode.es6.js","../../src/regexps-iri.ts","../../src/regexps-uri.ts","../../src/util.ts"],"sourcesContent":["import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","export function merge(...sets:Array):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}"],"names":["SCHEMES","uuid","scheme","urn","mailto","wss","ws","https","http","urnComponents","nss","uuidComponents","toLowerCase","options","error","tolerant","match","UUID","undefined","handler","uriComponents","path","nid","schemeHandler","serialize","urnScheme","parse","matches","components","URN_PARSE","query","fields","join","length","push","name","replace","PCT_ENCODED","decodeUnreserved","toUpperCase","NOT_HFNAME","pctEncChar","headers","NOT_HFVALUE","O","mailtoComponents","body","subject","to","x","localPart","domain","iri","e","punycode","toASCII","unescapeComponent","toUnicode","toAddr","slice","atIdx","NOT_LOCAL_PART","lastIndexOf","String","xl","toArray","addr","unicodeSupport","split","unknownHeaders","hfield","toAddrs","hfields","decStr","UNRESERVED","str","pctDecChars","RegExp","merge","UNRESERVED$$","SOME_DELIMS$$","ATEXT$$","VCHAR$$","PCT_ENCODED$","QTEXT$$","subexp","HEXDIG$$","isIRI","domainHost","wsComponents","fragment","resourceName","secure","port","isSecure","host","toString","URI_PROTOCOL","IRI_PROTOCOL","ESCAPE","escapeComponent","uriA","uriB","typeOf","equal","uri","normalize","resolveComponents","baseURI","schemelessOptions","relativeURI","assign","resolve","target","relative","base","userinfo","removeDotSegments","charAt","skipNormalization","uriTokens","s","authority","absolutePath","reference","_recomposeAuthority","protocol","IPV6ADDRESS","test","output","Error","input","im","RDS5","pop","RDS3","RDS2","RDS1","$1","$2","_normalizeIPv6","_normalizeIPv4","_","uriString","isNaN","indexOf","parseInt","NO_MATCH_IS_UNDEFINED","URI_PARSE","newHost","zone","newFirst","newLast","longestZeroFields","index","b","a","allZeroFields","sort","acc","lastLongest","field","reduce","fieldCount","isLastFieldIPv4Address","firstFields","lastFields","lastFieldsStart","Array","IPV4ADDRESS","last","map","_stripLeadingZeros","first","address","reverse","NOT_FRAGMENT","NOT_QUERY","NOT_PATH","NOT_PATH_NOSCHEME","NOT_HOST","NOT_USERINFO","NOT_SCHEME","_normalizeComponentEncoding","newStr","substr","i","fromCharCode","c","c2","c3","il","chr","charCodeAt","encode","decode","ucs2encode","ucs2decode","regexNonASCII","string","mapDomain","regexPunycode","n","delta","handledCPCount","adapt","handledCPCountPlusOne","basicLength","stringFromCharCode","digitToBasic","q","floor","qMinusT","baseMinusT","t","k","bias","tMin","tMax","currentValue","maxInt","m","inputLength","delimiter","initialBias","initialN","fromCodePoint","splice","out","oldi","w","digit","basicToDigit","basic","j","baseMinusTMin","skew","numPoints","firstTime","damp","flag","codePoint","array","value","extra","counter","result","encoded","labels","fn","regexSeparators","parts","RangeError","errors","type","Math","buildExps","IPV6ADDRESS$","ZONEID$","IPV4ADDRESS$","RESERVED$$","SUB_DELIMS$$","IPRIVATE$$","ALPHA$$","DIGIT$$","AUTHORITY_REF$","USERINFO$","HOST$","PORT$","SAMEDOC_REF$","FRAGMENT$","ABSOLUTE_REF$","SCHEME$","PATH_ABEMPTY$","PATH_ABSOLUTE$","PATH_ROOTLESS$","PATH_EMPTY$","QUERY$","RELATIVE_REF$","PATH_NOSCHEME$","GENERIC_REF$","ABSOLUTE_URI$","HIER_PART$","URI_REFERENCE$","URI$","RELATIVE$","RELATIVE_PART$","AUTHORITY$","PCHAR$","PATH$","SEGMENT_NZ$","SEGMENT_NZ_NC$","SEGMENT$","IP_LITERAL$","REG_NAME$","IPV6ADDRZ_RELAXED$","IPVFUTURE$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","H16$","LS32$","DEC_OCTET_RELAXED$","DEC_OCTET$","UCSCHAR$$","GEN_DELIMS$$","SP$$","DQUOTE$$","CR$","obj","key","source","setInterval","call","prototype","o","Object","shift","sets"],"mappings":";;;;;;;AYAA,SAAA8E,KAAA,GAAA;sCAAyBsP,IAAzB;YAAA;;;QACKA,KAAKnS,MAAL,GAAc,CAAlB,EAAqB;aACf,CAAL,IAAUmS,KAAK,CAAL,EAAQzQ,KAAR,CAAc,CAAd,EAAiB,CAAC,CAAlB,CAAV;YACMK,KAAKoQ,KAAKnS,MAAL,GAAc,CAAzB;aACK,IAAIgB,IAAI,CAAb,EAAgBA,IAAIe,EAApB,EAAwB,EAAEf,CAA1B,EAA6B;iBACvBA,CAAL,IAAUmR,KAAKnR,CAAL,EAAQU,KAAR,CAAc,CAAd,EAAiB,CAAC,CAAlB,CAAV;;aAEIK,EAAL,IAAWoQ,KAAKpQ,EAAL,EAASL,KAAT,CAAe,CAAf,CAAX;eACOyQ,KAAKpS,IAAL,CAAU,EAAV,CAAP;KAPD,MAQO;eACCoS,KAAK,CAAL,CAAP;;;AAIF,AAAA,SAAA/O,MAA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,OAAvB;AAEA,AACAR,QAAQO,UAAML,MAAd,IAAwBK,SAAxB;AAEA,AACAP,QAAQM,UAAGJ,MAAX,IAAqBI,SAArB;AAEA,AACAN,QAAQK,UAAIH,MAAZ,IAAsBG,SAAtB;AAEA,AACAL,QAAQI,UAAOF,MAAf,IAAyBE,SAAzB;AAEA,AACAJ,QAAQG,UAAID,MAAZ,IAAsBC,SAAtB;AAEA,AACAH,QAAQC,UAAKC,MAAb,IAAuBD,SAAvB,CAEA;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/es5/uri.all.min.d.ts b/node_modules/uri-js/dist/es5/uri.all.min.d.ts deleted file mode 100755 index da51e2352..000000000 --- a/node_modules/uri-js/dist/es5/uri.all.min.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -export interface URIComponents { - scheme?: string; - userinfo?: string; - host?: string; - port?: number | string; - path?: string; - query?: string; - fragment?: string; - reference?: string; - error?: string; -} -export interface URIOptions { - scheme?: string; - reference?: string; - tolerant?: boolean; - absolutePath?: boolean; - iri?: boolean; - unicodeSupport?: boolean; - domainHost?: boolean; -} -export interface URISchemeHandler { - scheme: string; - parse(components: ParentComponents, options: Options): Components; - serialize(components: Components, options: Options): ParentComponents; - unicodeSupport?: boolean; - domainHost?: boolean; - absolutePath?: boolean; -} -export interface URIRegExps { - NOT_SCHEME: RegExp; - NOT_USERINFO: RegExp; - NOT_HOST: RegExp; - NOT_PATH: RegExp; - NOT_PATH_NOSCHEME: RegExp; - NOT_QUERY: RegExp; - NOT_FRAGMENT: RegExp; - ESCAPE: RegExp; - UNRESERVED: RegExp; - OTHER_CHARS: RegExp; - PCT_ENCODED: RegExp; - IPV4ADDRESS: RegExp; - IPV6ADDRESS: RegExp; -} -export declare const SCHEMES: { - [scheme: string]: URISchemeHandler; -}; -export declare function pctEncChar(chr: string): string; -export declare function pctDecChars(str: string): string; -export declare function parse(uriString: string, options?: URIOptions): URIComponents; -export declare function removeDotSegments(input: string): string; -export declare function serialize(components: URIComponents, options?: URIOptions): string; -export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; -export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; -export declare function normalize(uri: string, options?: URIOptions): string; -export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; -export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; -export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; -export declare function escapeComponent(str: string, options?: URIOptions): string; -export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/node_modules/uri-js/dist/es5/uri.all.min.js b/node_modules/uri-js/dist/es5/uri.all.min.js deleted file mode 100755 index fcd845862..000000000 --- a/node_modules/uri-js/dist/es5/uri.all.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.URI=e.URI||{})}(this,function(e){"use strict";function r(){for(var e=arguments.length,r=Array(e),n=0;n1){r[0]=r[0].slice(0,-1);for(var t=r.length-1,o=1;o1&&(t=n[0]+"@",e=n[1]),e=e.replace(j,"."),t+f(e.split("."),r).join(".")}function p(e){for(var r=[],n=0,t=e.length;n=55296&&o<=56319&&n>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function d(e){for(var r="",n=0,t=e.length;n=194&&o<224){if(t-n>=6){var a=parseInt(e.substr(n+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(n,6);n+=6}else if(o>=224){if(t-n>=9){var i=parseInt(e.substr(n+4,2),16),u=parseInt(e.substr(n+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&u)}else r+=e.substr(n,9);n+=9}else r+=e.substr(n,3),n+=3}return r}function l(e,r){function n(e){var n=d(e);return n.match(r.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_SCHEME,"")),e.userinfo!==undefined&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,n).replace(r.NOT_USERINFO,h).replace(r.PCT_ENCODED,o)),e.host!==undefined&&(e.host=String(e.host).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_HOST,h).replace(r.PCT_ENCODED,o)),e.path!==undefined&&(e.path=String(e.path).replace(r.PCT_ENCODED,n).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,h).replace(r.PCT_ENCODED,o)),e.query!==undefined&&(e.query=String(e.query).replace(r.PCT_ENCODED,n).replace(r.NOT_QUERY,h).replace(r.PCT_ENCODED,o)),e.fragment!==undefined&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,n).replace(r.NOT_FRAGMENT,h).replace(r.PCT_ENCODED,o)),e}function m(e){return e.replace(/^0*(.*)/,"$1")||"0"}function g(e,r){var n=e.match(r.IPV4ADDRESS)||[],t=T(n,2),o=t[1];return o?o.split(".").map(m).join("."):e}function v(e,r){var n=e.match(r.IPV6ADDRESS)||[],t=T(n,3),o=t[1],a=t[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),u=T(i,2),s=u[0],f=u[1],c=f?f.split(":").map(m):[],p=s.split(":").map(m),h=r.IPV4ADDRESS.test(p[p.length-1]),d=h?7:8,l=p.length-d,v=Array(d),E=0;E1){var A=v.slice(0,y.index),D=v.slice(y.index+y.length);S=A.join(":")+"::"+D.join(":")}else S=v.join(":");return a&&(S+="%"+a),S}return e}function E(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n={},t=!1!==r.iri?R:F;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(K);if(o){W?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||undefined,n.userinfo=-1!==e.indexOf("@")?o[3]:undefined,n.host=-1!==e.indexOf("//")?o[4]:undefined,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:undefined,n.fragment=-1!==e.indexOf("#")?o[8]:undefined,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined)),n.host&&(n.host=v(g(n.host,t),t)),n.scheme!==undefined||n.userinfo!==undefined||n.host!==undefined||n.port!==undefined||n.path||n.query!==undefined?n.scheme===undefined?n.reference="relative":n.fragment===undefined?n.reference="absolute":n.reference="uri":n.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");var a=J[(r.scheme||n.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)l(n,t);else{if(n.host&&(r.domainHost||a&&a.domainHost))try{n.host=B.toASCII(n.host.replace(t.PCT_ENCODED,d).toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+i}l(n,F)}a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}function C(e,r){var n=!1!==r.iri?R:F,t=[];return e.userinfo!==undefined&&(t.push(e.userinfo),t.push("@")),e.host!==undefined&&t.push(v(g(String(e.host),n),n).replace(n.IPV6ADDRESS,function(e,r,n){return"["+r+(n?"%25"+n:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):undefined}function y(e){for(var r=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(ee))e=e.replace(ee,"/");else if(e.match(re))e=e.replace(re,"/"),r.pop();else if("."===e||".."===e)e="";else{var n=e.match(ne);if(!n)throw new Error("Unexpected dot segment condition");var t=n[0];e=e.slice(t.length),r.push(t)}return r.join("")}function S(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.iri?R:F,t=[],o=J[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(n.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?B.toUnicode(e.host):B.toASCII(e.host.replace(n.PCT_ENCODED,d).toLowerCase())}catch(u){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+u}l(e,n),"suffix"!==r.reference&&e.scheme&&(t.push(e.scheme),t.push(":"));var a=C(e,r);if(a!==undefined&&("suffix"!==r.reference&&t.push("//"),t.push(a),e.path&&"/"!==e.path.charAt(0)&&t.push("/")),e.path!==undefined){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=y(i)),a===undefined&&(i=i.replace(/^\/\//,"/%2F")),t.push(i)}return e.query!==undefined&&(t.push("?"),t.push(e.query)),e.fragment!==undefined&&(t.push("#"),t.push(e.fragment)),t.join("")}function A(e,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},t=arguments[3],o={};return t||(e=E(S(e,n),n),r=E(S(r,n),n)),n=n||{},!n.tolerant&&r.scheme?(o.scheme=r.scheme,o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined?(o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.path?("/"===r.path.charAt(0)?o.path=y(r.path):(e.userinfo===undefined&&e.host===undefined&&e.port===undefined||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:o.path=r.path:o.path="/"+r.path,o.path=y(o.path)),o.query=r.query):(o.path=e.path,r.query!==undefined?o.query=r.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=r.fragment,o}function D(e,r,n){var t=i({scheme:"null"},n);return S(A(E(e,t),E(r,t),t,!0),t)}function w(e,r){return"string"==typeof e?e=S(E(e,r),r):"object"===t(e)&&(e=E(S(e,r),r)),e}function b(e,r,n){return"string"==typeof e?e=S(E(e,n),n):"object"===t(e)&&(e=S(e,n)),"string"==typeof r?r=S(E(r,n),n):"object"===t(r)&&(r=S(r,n)),e===r}function x(e,r){return e&&e.toString().replace(r&&r.iri?R.ESCAPE:F.ESCAPE,h)}function O(e,r){return e&&e.toString().replace(r&&r.iri?R.PCT_ENCODED:F.PCT_ENCODED,d)}function N(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function I(e){var r=d(e);return r.match(he)?r:e}var F=u(!1),R=u(!0),T=function(){function e(e,r){var n=[],t=!0,o=!1,a=undefined;try{for(var i,u=e[Symbol.iterator]();!(t=(i=u.next()).done)&&(n.push(i.value),!r||n.length!==r);t=!0);}catch(s){o=!0,a=s}finally{try{!t&&u["return"]&&u["return"]()}finally{if(o)throw a}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(e){if(Array.isArray(e)){for(var r=0,n=Array(e.length);r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,L=String.fromCharCode,$=function(e){return String.fromCodePoint.apply(String,_(e))},M=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36},V=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},k=function(e,r,n){var t=0;for(e=n?z(e/700):e>>1,e+=z(e/r);e>455;t+=36)e=z(e/35);return z(t+36*e/(e+38))},Z=function(e){var r=[],n=e.length,t=0,o=128,a=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var u=0;u=128&&s("not-basic"),r.push(e.charCodeAt(u));for(var f=i>0?i+1:0;f=n&&s("invalid-input");var d=M(e.charCodeAt(f++));(d>=36||d>z((P-t)/p))&&s("overflow"),t+=d*p;var l=h<=a?1:h>=a+26?26:h-a;if(dz(P/m)&&s("overflow"),p*=m}var g=r.length+1;a=k(t-c,g,0==c),z(t/g)>P-o&&s("overflow"),o+=z(t/g),t%=g,r.splice(t++,0,o)}return String.fromCodePoint.apply(String,r)},G=function(e){var r=[];e=p(e);var n=e.length,t=128,o=0,a=72,i=!0,u=!1,f=undefined;try{for(var c,h=e[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;d<128&&r.push(L(d))}}catch(U){u=!0,f=U}finally{try{!i&&h["return"]&&h["return"]()}finally{if(u)throw f}}var l=r.length,m=l;for(l&&r.push("-");m=t&&Az((P-o)/D)&&s("overflow"),o+=(g-t)*D,t=g;var w=!0,b=!1,x=undefined;try{for(var O,N=e[Symbol.iterator]();!(w=(O=N.next()).done);w=!0){var I=O.value;if(IP&&s("overflow"),I==t){for(var F=o,R=36;;R+=36){var T=R<=a?1:R>=a+26?26:R-a;if(FA-Z\\x5E-\\x7E]",'[\\"\\\\]'),he=new RegExp(se,"g"),de=new RegExp(ce,"g"),le=new RegExp(r("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',pe),"g"),me=new RegExp(r("[^]",se,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ge=me,ve={scheme:"mailto",parse:function(e,r){var n=e,t=n.to=n.path?n.path.split(","):[];if(n.path=undefined,n.query){for(var o=!1,a={},i=n.query.split("&"),u=0,s=i.length;u):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n"]} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/index.d.ts b/node_modules/uri-js/dist/esnext/index.d.ts deleted file mode 100755 index f6be76034..000000000 --- a/node_modules/uri-js/dist/esnext/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./uri"; diff --git a/node_modules/uri-js/dist/esnext/index.js b/node_modules/uri-js/dist/esnext/index.js deleted file mode 100755 index e3531b5b6..000000000 --- a/node_modules/uri-js/dist/esnext/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import { SCHEMES } from "./uri"; -import http from "./schemes/http"; -SCHEMES[http.scheme] = http; -import https from "./schemes/https"; -SCHEMES[https.scheme] = https; -import ws from "./schemes/ws"; -SCHEMES[ws.scheme] = ws; -import wss from "./schemes/wss"; -SCHEMES[wss.scheme] = wss; -import mailto from "./schemes/mailto"; -SCHEMES[mailto.scheme] = mailto; -import urn from "./schemes/urn"; -SCHEMES[urn.scheme] = urn; -import uuid from "./schemes/urn-uuid"; -SCHEMES[uuid.scheme] = uuid; -export * from "./uri"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/index.js.map b/node_modules/uri-js/dist/esnext/index.js.map deleted file mode 100755 index 0971f6ebc..000000000 --- a/node_modules/uri-js/dist/esnext/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AAE9B,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9B,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AAExB,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAEhC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,cAAc,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.d.ts b/node_modules/uri-js/dist/esnext/regexps-iri.d.ts deleted file mode 100755 index c91cdacbc..000000000 --- a/node_modules/uri-js/dist/esnext/regexps-iri.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { URIRegExps } from "./uri"; -declare const _default: URIRegExps; -export default _default; diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.js b/node_modules/uri-js/dist/esnext/regexps-iri.js deleted file mode 100755 index 34e7de989..000000000 --- a/node_modules/uri-js/dist/esnext/regexps-iri.js +++ /dev/null @@ -1,3 +0,0 @@ -import { buildExps } from "./regexps-uri"; -export default buildExps(true); -//# sourceMappingURL=regexps-iri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-iri.js.map b/node_modules/uri-js/dist/esnext/regexps-iri.js.map deleted file mode 100755 index 2269c580c..000000000 --- a/node_modules/uri-js/dist/esnext/regexps-iri.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"regexps-iri.js","sourceRoot":"","sources":["../../src/regexps-iri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAe,SAAS,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.d.ts b/node_modules/uri-js/dist/esnext/regexps-uri.d.ts deleted file mode 100755 index 6096bda5c..000000000 --- a/node_modules/uri-js/dist/esnext/regexps-uri.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { URIRegExps } from "./uri"; -export declare function buildExps(isIRI: boolean): URIRegExps; -declare const _default: URIRegExps; -export default _default; diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.js b/node_modules/uri-js/dist/esnext/regexps-uri.js deleted file mode 100755 index 1cc659f13..000000000 --- a/node_modules/uri-js/dist/esnext/regexps-uri.js +++ /dev/null @@ -1,42 +0,0 @@ -import { merge, subexp } from "./util"; -export function buildExps(isIRI) { - const ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive - LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded - GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters - IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset - UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), //relaxed parsing rules - IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), // 6( h16 ":" ) ls32 - IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32 - IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32 - IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 - IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 - IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 - IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32 - IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16 - IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::" - IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874 - IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874 - IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules - IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874 - REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified - PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified - PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified - PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; - return { - NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), - NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), - NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), - NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), - ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), - UNRESERVED: new RegExp(UNRESERVED$$, "g"), - OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), - PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), - IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), - IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules - }; -} -export default buildExps(false); -//# sourceMappingURL=regexps-uri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/regexps-uri.js.map b/node_modules/uri-js/dist/esnext/regexps-uri.js.map deleted file mode 100755 index cb028b804..000000000 --- a/node_modules/uri-js/dist/esnext/regexps-uri.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"regexps-uri.js","sourceRoot":"","sources":["../../src/regexps-uri.ts"],"names":[],"mappings":"AACA,OAAO,E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emes/http.d.ts deleted file mode 100755 index fe5b2f354..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/http.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { URISchemeHandler } from "../uri"; -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js b/node_modules/uri-js/dist/esnext/schemes/http.js deleted file mode 100755 index 6abf0fe6e..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/http.js +++ /dev/null @@ -1,28 +0,0 @@ -const handler = { - scheme: "http", - domainHost: true, - parse: function (components, options) { - //report missing host - if (!components.host) { - components.error = components.error || "HTTP URIs must have a host."; - } - return components; - }, - serialize: function (components, options) { - const secure = String(components.scheme).toLowerCase() === "https"; - //normalize the default port - if (components.port === (secure ? 443 : 80) || components.port === "") { - components.port = undefined; - } - //normalize the empty path - if (!components.path) { - components.path = "/"; - } - //NOTE: We do not parse query strings for HTTP URIs - //as WWW Form Url Encoded query strings are part of the HTML4+ spec, - //and not the HTTP spec. - return components; - } -}; -export default handler; -//# sourceMappingURL=http.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/http.js.map b/node_modules/uri-js/dist/esnext/schemes/http.js.map deleted file mode 100755 index 82118970c..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/http.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/schemes/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,MAAM;IAEf,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,qBAAqB;QACrB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6BAA6B,CAAC;SACrE;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,SAAS,EAAG,UAAU,UAAwB,EAAE,OAAkB;QACjE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;QAEnE,4BAA4B;QAC5B,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,EAAE,EAAE;YACtE,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC;SAC5B;QAED,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;SACtB;QAED,mDAAmD;QACnD,oEAAoE;QACpE,wBAAwB;QAExB,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/https.d.ts b/node_modules/uri-js/dist/esnext/schemes/https.d.ts deleted file mode 100755 index fe5b2f354..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/https.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { URISchemeHandler } from "../uri"; -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/https.js b/node_modules/uri-js/dist/esnext/schemes/https.js deleted file mode 100755 index ec4b6e76d..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/https.js +++ /dev/null @@ -1,9 +0,0 @@ -import http from "./http"; -const handler = { - scheme: "https", - domainHost: http.domainHost, - parse: http.parse, - serialize: http.serialize -}; -export default handler; -//# sourceMappingURL=https.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/https.js.map b/node_modules/uri-js/dist/esnext/schemes/https.js.map deleted file mode 100755 index 385b8efea..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/https.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"https.js","sourceRoot":"","sources":["../../../src/schemes/https.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,OAAO;IAChB,UAAU,EAAG,IAAI,CAAC,UAAU;IAC5B,KAAK,EAAG,IAAI,CAAC,KAAK;IAClB,SAAS,EAAG,IAAI,CAAC,SAAS;CAC1B,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts b/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts deleted file mode 100755 index e2aefc2af..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { URISchemeHandler, URIComponents } from "../uri"; -export interface MailtoHeaders { - [hfname: string]: string; -} -export interface MailtoComponents extends URIComponents { - to: Array; - headers?: MailtoHeaders; - subject?: string; - body?: string; -} -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.js b/node_modules/uri-js/dist/esnext/schemes/mailto.js deleted file mode 100755 index 2553713cd..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/mailto.js +++ /dev/null @@ -1,148 +0,0 @@ -import { pctEncChar, pctDecChars, unescapeComponent } from "../uri"; -import punycode from "punycode"; -import { merge, subexp, toUpperCase, toArray } from "../util"; -const O = {}; -const isIRI = true; -//RFC 3986 -const UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; -const HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive -const PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded -//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = -//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; -//const WSP$$ = "[\\x20\\x09]"; -//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) -//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext -//const VCHAR$$ = "[\\x21-\\x7E]"; -//const WSP$$ = "[\\x20\\x09]"; -//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext -//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); -//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); -//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); -const ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; -const QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; -const VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); -const DOT_ATOM_TEXT$ = subexp(ATEXT$$ + "+" + subexp("\\." + ATEXT$$ + "+") + "*"); -const QUOTED_PAIR$ = subexp("\\\\" + VCHAR$$); -const QCONTENT$ = subexp(QTEXT$$ + "|" + QUOTED_PAIR$); -const QUOTED_STRING$ = subexp('\\"' + QCONTENT$ + "*" + '\\"'); -//RFC 6068 -const DTEXT_NO_OBS$$ = "[\\x21-\\x5A\\x5E-\\x7E]"; //%d33-90 / %d94-126 -const SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; -const QCHAR$ = subexp(UNRESERVED$$ + "|" + PCT_ENCODED$ + "|" + SOME_DELIMS$$); -const DOMAIN$ = subexp(DOT_ATOM_TEXT$ + "|" + "\\[" + DTEXT_NO_OBS$$ + "*" + "\\]"); -const LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + "|" + QUOTED_STRING$); -const ADDR_SPEC$ = subexp(LOCAL_PART$ + "\\@" + DOMAIN$); -const TO$ = subexp(ADDR_SPEC$ + subexp("\\," + ADDR_SPEC$) + "*"); -const HFNAME$ = subexp(QCHAR$ + "*"); -const HFVALUE$ = HFNAME$; -const HFIELD$ = subexp(HFNAME$ + "\\=" + HFVALUE$); -const HFIELDS2$ = subexp(HFIELD$ + subexp("\\&" + HFIELD$) + "*"); -const HFIELDS$ = subexp("\\?" + HFIELDS2$); -const MAILTO_URI = new RegExp("^mailto\\:" + TO$ + "?" + HFIELDS$ + "?$"); -const UNRESERVED = new RegExp(UNRESERVED$$, "g"); -const PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); -const NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); -const NOT_DOMAIN = new RegExp(merge("[^]", ATEXT$$, "[\\.]", "[\\[]", DTEXT_NO_OBS$$, "[\\]]"), "g"); -const NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); -const NOT_HFVALUE = NOT_HFNAME; -const TO = new RegExp("^" + TO$ + "$"); -const HFIELDS = new RegExp("^" + HFIELDS2$ + "$"); -function decodeUnreserved(str) { - const decStr = pctDecChars(str); - return (!decStr.match(UNRESERVED) ? str : decStr); -} -const handler = { - scheme: "mailto", - parse: function (components, options) { - const mailtoComponents = components; - const to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(",") : []); - mailtoComponents.path = undefined; - if (mailtoComponents.query) { - let unknownHeaders = false; - const headers = {}; - const hfields = mailtoComponents.query.split("&"); - for (let x = 0, xl = hfields.length; x < xl; ++x) { - const hfield = hfields[x].split("="); - switch (hfield[0]) { - case "to": - const toAddrs = hfield[1].split(","); - for (let x = 0, xl = toAddrs.length; x < xl; ++x) { - to.push(toAddrs[x]); - } - break; - case "subject": - mailtoComponents.subject = unescapeComponent(hfield[1], options); - break; - case "body": - mailtoComponents.body = unescapeComponent(hfield[1], options); - break; - default: - unknownHeaders = true; - headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); - break; - } - } - if (unknownHeaders) - mailtoComponents.headers = headers; - } - mailtoComponents.query = undefined; - for (let x = 0, xl = to.length; x < xl; ++x) { - const addr = to[x].split("@"); - addr[0] = unescapeComponent(addr[0]); - if (!options.unicodeSupport) { - //convert Unicode IDN -> ASCII IDN - try { - addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); - } - catch (e) { - mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; - } - } - else { - addr[1] = unescapeComponent(addr[1], options).toLowerCase(); - } - to[x] = addr.join("@"); - } - return mailtoComponents; - }, - serialize: function (mailtoComponents, options) { - const components = mailtoComponents; - const to = toArray(mailtoComponents.to); - if (to) { - for (let x = 0, xl = to.length; x < xl; ++x) { - const toAddr = String(to[x]); - const atIdx = toAddr.lastIndexOf("@"); - const localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); - let domain = toAddr.slice(atIdx + 1); - //convert IDN via punycode - try { - domain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain)); - } - catch (e) { - components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; - } - to[x] = localPart + "@" + domain; - } - components.path = to.join(","); - } - const headers = mailtoComponents.headers = mailtoComponents.headers || {}; - if (mailtoComponents.subject) - headers["subject"] = mailtoComponents.subject; - if (mailtoComponents.body) - headers["body"] = mailtoComponents.body; - const fields = []; - for (const name in headers) { - if (headers[name] !== O[name]) { - fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + - "=" + - headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); - } - } - if (fields.length) { - components.query = fields.join("&"); - } - return components; - } -}; -export default handler; -//# sourceMappingURL=mailto.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/mailto.js.map b/node_modules/uri-js/dist/esnext/schemes/mailto.js.map deleted file mode 100755 index 82dba9a16..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/mailto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mailto.js","sourceRoot":"","sources":["../../../src/schemes/mailto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAa9D,MAAM,CAAC,GAAiB,EAAE,CAAC;AAC3B,MAAM,KAAK,GAAG,IAAI,CAAC;AAEnB,UAAU;AACV,MAAM,YAAY,GAAG,wBAAwB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,2EAA2E,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;AACjJ,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAE,kBAAkB;AACnD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,G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AAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC;oBAC7G,GAAG;oBACH,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,CACvH,CAAC;aACF;SACD;QACD,IAAI,MAAM,CAAC,MAAM,EAAE;YAClB,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACpC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts deleted file mode 100755 index e75f2e793..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { URISchemeHandler, URIOptions } from "../uri"; -import { URNComponents } from "./urn"; -export interface UUIDComponents extends URNComponents { - uuid?: string; -} -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js deleted file mode 100755 index d1fce4955..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js +++ /dev/null @@ -1,23 +0,0 @@ -const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; -const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/; -//RFC 4122 -const handler = { - scheme: "urn:uuid", - parse: function (urnComponents, options) { - const uuidComponents = urnComponents; - uuidComponents.uuid = uuidComponents.nss; - uuidComponents.nss = undefined; - if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { - uuidComponents.error = uuidComponents.error || "UUID is not valid."; - } - return uuidComponents; - }, - serialize: function (uuidComponents, options) { - const urnComponents = uuidComponents; - //normalize UUID - urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); - return urnComponents; - }, -}; -export default handler; -//# sourceMappingURL=urn-uuid.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map b/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map deleted file mode 100755 index 3b7a8b3ae..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"urn-uuid.js","sourceRoot":"","sources":["../../../src/schemes/urn-uuid.ts"],"names":[],"mappings":"AAQA,MAAM,IAAI,GAAG,0DAA0D,CAAC;AACxE,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,UAAU;AACV,MAAM,OAAO,GAA+D;IAC3E,MAAM,EAAG,UAAU;IAEnB,KAAK,EAAG,UAAU,aAA2B,EAAE,OAAkB;QAChE,MAAM,cAAc,GAAG,aAA+B,CAAC;QACvD,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC;QACzC,cAAc,CAAC,GAAG,GAAG,SAAS,CAAC;QAE/B,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE;YACpF,cAAc,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,IAAI,oBAAoB,CAAC;SACpE;QAED,OAAO,cAAc,CAAC;IACvB,CAAC;IAED,SAAS,EAAG,UAAU,cAA6B,EAAE,OAAkB;QACtE,MAAM,aAAa,GAAG,cAA+B,CAAC;QACtD,gBAAgB;QAChB,aAAa,CAAC,GAAG,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9D,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.d.ts b/node_modules/uri-js/dist/esnext/schemes/urn.d.ts deleted file mode 100755 index 7e0c2fba6..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/urn.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { URISchemeHandler, URIComponents, URIOptions } from "../uri"; -export interface URNComponents extends URIComponents { - nid?: string; - nss?: string; -} -export interface URNOptions extends URIOptions { - nid?: string; -} -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.js b/node_modules/uri-js/dist/esnext/schemes/urn.js deleted file mode 100755 index 5d3f10aa0..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/urn.js +++ /dev/null @@ -1,49 +0,0 @@ -import { SCHEMES } from "../uri"; -const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})"; -const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})"; -const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]"; -const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)"; -const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$"); -const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$"); -const URN_PARSE = /^([^\:]+)\:(.*)/; -const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g; -//RFC 2141 -const handler = { - scheme: "urn", - parse: function (components, options) { - const matches = components.path && components.path.match(URN_PARSE); - let urnComponents = components; - if (matches) { - const scheme = options.scheme || urnComponents.scheme || "urn"; - const nid = matches[1].toLowerCase(); - const nss = matches[2]; - const urnScheme = `${scheme}:${options.nid || nid}`; - const schemeHandler = SCHEMES[urnScheme]; - urnComponents.nid = nid; - urnComponents.nss = nss; - urnComponents.path = undefined; - if (schemeHandler) { - urnComponents = schemeHandler.parse(urnComponents, options); - } - } - else { - urnComponents.error = urnComponents.error || "URN can not be parsed."; - } - return urnComponents; - }, - serialize: function (urnComponents, options) { - const scheme = options.scheme || urnComponents.scheme || "urn"; - const nid = urnComponents.nid; - const urnScheme = `${scheme}:${options.nid || nid}`; - const schemeHandler = SCHEMES[urnScheme]; - if (schemeHandler) { - urnComponents = schemeHandler.serialize(urnComponents, options); - } - const uriComponents = urnComponents; - const nss = urnComponents.nss; - uriComponents.path = `${nid || options.nid}:${nss}`; - return uriComponents; - }, -}; -export default handler; -//# sourceMappingURL=urn.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/urn.js.map b/node_modules/uri-js/dist/esnext/schemes/urn.js.map deleted file mode 100755 index ea43b0beb..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/urn.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"urn.js","sourceRoot":"","sources":["../../../src/schemes/urn.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,OAAO,EAAE,MAAM,QAAQ,CAAC;AAW7C,MAAM,IAAI,GAAG,qCAAqC,CAAC;AACnD,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAC7C,MAAM,OAAO,GAAG,mEAAmE,CAAC;AACpF,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,GAAG,GAAG,OAAO,GAAG,KAAK,CAAC;AAC7D,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACjE,MAAM,SAAS,GAAG,iBAAiB,CAAC;AACpC,MAAM,YAAY,GAAG,iDAAiD,CAAC;AAEvE,UAAU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,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QAEzC,IAAI,aAAa,EAAE;YAClB,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,aAAa,EAAE,OAAO,CAAkB,CAAC;SACjF;QAED,MAAM,aAAa,GAAG,aAA8B,CAAC;QACrD,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC9B,aAAa,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QAEpD,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.d.ts b/node_modules/uri-js/dist/esnext/schemes/ws.d.ts deleted file mode 100755 index 47f4835b2..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/ws.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { URISchemeHandler, URIComponents } from "../uri"; -export interface WSComponents extends URIComponents { - resourceName?: string; - secure?: boolean; -} -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.js b/node_modules/uri-js/dist/esnext/schemes/ws.js deleted file mode 100755 index 9277f035a..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/ws.js +++ /dev/null @@ -1,41 +0,0 @@ -function isSecure(wsComponents) { - return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; -} -//RFC 6455 -const handler = { - scheme: "ws", - domainHost: true, - parse: function (components, options) { - const wsComponents = components; - //indicate if the secure flag is set - wsComponents.secure = isSecure(wsComponents); - //construct resouce name - wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); - wsComponents.path = undefined; - wsComponents.query = undefined; - return wsComponents; - }, - serialize: function (wsComponents, options) { - //normalize the default port - if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { - wsComponents.port = undefined; - } - //ensure scheme matches secure flag - if (typeof wsComponents.secure === 'boolean') { - wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws'); - wsComponents.secure = undefined; - } - //reconstruct path from resource name - if (wsComponents.resourceName) { - const [path, query] = wsComponents.resourceName.split('?'); - wsComponents.path = (path && path !== '/' ? path : undefined); - wsComponents.query = query; - wsComponents.resourceName = undefined; - } - //forbid fragment component - wsComponents.fragment = undefined; - return wsComponents; - } -}; -export default handler; -//# sourceMappingURL=ws.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/ws.js.map b/node_modules/uri-js/dist/esnext/schemes/ws.js.map deleted file mode 100755 index 186818ccd..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/ws.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../../src/schemes/ws.ts"],"names":[],"mappings":"AAOA,kBAAkB,YAAyB;IAC1C,OAAO,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC;AAC7H,CAAC;AAED,UAAU;AACV,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,IAAI;IAEb,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,YAAY,GAAG,UAA0B,CAAC;QAEhD,oCAAoC;QACpC,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;QAE7C,wBAAwB;QACxB,YAAY,CAAC,YAAY,GAAG,CAAC,YAAY,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9G,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f354..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/wss.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { URISchemeHandler } from "../uri"; -declare const handler: URISchemeHandler; -export default handler; diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.js b/node_modules/uri-js/dist/esnext/schemes/wss.js deleted file mode 100755 index d1e22ccd6..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/wss.js +++ /dev/null @@ -1,9 +0,0 @@ -import ws from "./ws"; -const handler = { - scheme: "wss", - domainHost: ws.domainHost, - parse: ws.parse, - serialize: ws.serialize -}; -export default handler; -//# sourceMappingURL=wss.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/schemes/wss.js.map b/node_modules/uri-js/dist/esnext/schemes/wss.js.map deleted file mode 100755 index e19006d94..000000000 --- a/node_modules/uri-js/dist/esnext/schemes/wss.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wss.js","sourceRoot":"","sources":["../../../src/schemes/wss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,MAAM,CAAC;AAEtB,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,KAAK;IACd,UAAU,EAAG,EAAE,CAAC,UAAU;IAC1B,KAAK,EAAG,EAAE,CAAC,KAAK;IAChB,SAAS,EAAG,EAAE,CAAC,SAAS;CACxB,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/uri.d.ts b/node_modules/uri-js/dist/esnext/uri.d.ts deleted file mode 100755 index da51e2352..000000000 --- a/node_modules/uri-js/dist/esnext/uri.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -export interface URIComponents { - scheme?: string; - userinfo?: string; - host?: string; - port?: number | string; - path?: string; - query?: string; - fragment?: string; - reference?: string; - error?: string; -} -export interface URIOptions { - scheme?: string; - reference?: string; - tolerant?: boolean; - absolutePath?: boolean; - iri?: boolean; - unicodeSupport?: boolean; - domainHost?: boolean; -} -export interface URISchemeHandler { - scheme: string; - parse(components: ParentComponents, options: Options): Components; - serialize(components: Components, options: Options): ParentComponents; - unicodeSupport?: boolean; - domainHost?: boolean; - absolutePath?: boolean; -} -export interface URIRegExps { - NOT_SCHEME: RegExp; - NOT_USERINFO: RegExp; - NOT_HOST: RegExp; - NOT_PATH: RegExp; - NOT_PATH_NOSCHEME: RegExp; - NOT_QUERY: RegExp; - NOT_FRAGMENT: RegExp; - ESCAPE: RegExp; - UNRESERVED: RegExp; - OTHER_CHARS: RegExp; - PCT_ENCODED: RegExp; - IPV4ADDRESS: RegExp; - IPV6ADDRESS: RegExp; -} -export declare const SCHEMES: { - [scheme: string]: URISchemeHandler; -}; -export declare function pctEncChar(chr: string): string; -export declare function pctDecChars(str: string): string; -export declare function parse(uriString: string, options?: URIOptions): URIComponents; -export declare function removeDotSegments(input: string): string; -export declare function serialize(components: URIComponents, options?: URIOptions): string; -export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; -export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; -export declare function normalize(uri: string, options?: URIOptions): string; -export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; -export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; -export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; -export declare function escapeComponent(str: string, options?: URIOptions): string; -export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/node_modules/uri-js/dist/esnext/uri.js b/node_modules/uri-js/dist/esnext/uri.js deleted file mode 100755 index 659ce2651..000000000 --- a/node_modules/uri-js/dist/esnext/uri.js +++ /dev/null @@ -1,480 +0,0 @@ -/** - * URI.js - * - * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. - * @author Gary Court - * @see http://github.com/garycourt/uri-js - */ -/** - * Copyright 2011 Gary Court. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of Gary Court. - */ -import URI_PROTOCOL from "./regexps-uri"; -import IRI_PROTOCOL from "./regexps-iri"; -import punycode from "punycode"; -import { toUpperCase, typeOf, assign } from "./util"; -export const SCHEMES = {}; -export function pctEncChar(chr) { - const c = chr.charCodeAt(0); - let e; - if (c < 16) - e = "%0" + c.toString(16).toUpperCase(); - else if (c < 128) - e = "%" + c.toString(16).toUpperCase(); - else if (c < 2048) - e = "%" + ((c >> 6) | 192).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); - else - e = "%" + ((c >> 12) | 224).toString(16).toUpperCase() + "%" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); - return e; -} -export function pctDecChars(str) { - let newStr = ""; - let i = 0; - const il = str.length; - while (i < il) { - const c = parseInt(str.substr(i + 1, 2), 16); - if (c < 128) { - newStr += String.fromCharCode(c); - i += 3; - } - else if (c >= 194 && c < 224) { - if ((il - i) >= 6) { - const c2 = parseInt(str.substr(i + 4, 2), 16); - newStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); - } - else { - newStr += str.substr(i, 6); - } - i += 6; - } - else if (c >= 224) { - if ((il - i) >= 9) { - const c2 = parseInt(str.substr(i + 4, 2), 16); - const c3 = parseInt(str.substr(i + 7, 2), 16); - newStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - } - else { - newStr += str.substr(i, 9); - } - i += 9; - } - else { - newStr += str.substr(i, 3); - i += 3; - } - } - return newStr; -} -function _normalizeComponentEncoding(components, protocol) { - function decodeUnreserved(str) { - const decStr = pctDecChars(str); - return (!decStr.match(protocol.UNRESERVED) ? str : decStr); - } - if (components.scheme) - components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); - if (components.userinfo !== undefined) - components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.host !== undefined) - components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.path !== undefined) - components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.query !== undefined) - components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - if (components.fragment !== undefined) - components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); - return components; -} -; -function _stripLeadingZeros(str) { - return str.replace(/^0*(.*)/, "$1") || "0"; -} -function _normalizeIPv4(host, protocol) { - const matches = host.match(protocol.IPV4ADDRESS) || []; - const [, address] = matches; - if (address) { - return address.split(".").map(_stripLeadingZeros).join("."); - } - else { - return host; - } -} -function _normalizeIPv6(host, protocol) { - const matches = host.match(protocol.IPV6ADDRESS) || []; - const [, address, zone] = matches; - if (address) { - const [last, first] = address.toLowerCase().split('::').reverse(); - const firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; - const lastFields = last.split(":").map(_stripLeadingZeros); - const isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); - const fieldCount = isLastFieldIPv4Address ? 7 : 8; - const lastFieldsStart = lastFields.length - fieldCount; - const fields = Array(fieldCount); - for (let x = 0; x < fieldCount; ++x) { - fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; - } - if (isLastFieldIPv4Address) { - fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); - } - const allZeroFields = fields.reduce((acc, field, index) => { - if (!field || field === "0") { - const lastLongest = acc[acc.length - 1]; - if (lastLongest && lastLongest.index + lastLongest.length === index) { - lastLongest.length++; - } - else { - acc.push({ index, length: 1 }); - } - } - return acc; - }, []); - const longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0]; - let newHost; - if (longestZeroFields && longestZeroFields.length > 1) { - const newFirst = fields.slice(0, longestZeroFields.index); - const newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); - newHost = newFirst.join(":") + "::" + newLast.join(":"); - } - else { - newHost = fields.join(":"); - } - if (zone) { - newHost += "%" + zone; - } - return newHost; - } - else { - return host; - } -} -const URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; -const NO_MATCH_IS_UNDEFINED = ("").match(/(){0}/)[1] === undefined; -export function parse(uriString, options = {}) { - const components = {}; - const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); - if (options.reference === "suffix") - uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; - const matches = uriString.match(URI_PARSE); - if (matches) { - if (NO_MATCH_IS_UNDEFINED) { - //store each component - components.scheme = matches[1]; - components.userinfo = matches[3]; - components.host = matches[4]; - components.port = parseInt(matches[5], 10); - components.path = matches[6] || ""; - components.query = matches[7]; - components.fragment = matches[8]; - //fix port number - if (isNaN(components.port)) { - components.port = matches[5]; - } - } - else { //IE FIX for improper RegExp matching - //store each component - components.scheme = matches[1] || undefined; - components.userinfo = (uriString.indexOf("@") !== -1 ? matches[3] : undefined); - components.host = (uriString.indexOf("//") !== -1 ? matches[4] : undefined); - components.port = parseInt(matches[5], 10); - components.path = matches[6] || ""; - components.query = (uriString.indexOf("?") !== -1 ? matches[7] : undefined); - components.fragment = (uriString.indexOf("#") !== -1 ? matches[8] : undefined); - //fix port number - if (isNaN(components.port)) { - components.port = (uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined); - } - } - if (components.host) { - //normalize IP hosts - components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); - } - //determine reference type - if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { - components.reference = "same-document"; - } - else if (components.scheme === undefined) { - components.reference = "relative"; - } - else if (components.fragment === undefined) { - components.reference = "absolute"; - } - else { - components.reference = "uri"; - } - //check for reference errors - if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { - components.error = components.error || "URI is not a " + options.reference + " reference."; - } - //find scheme handler - const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - //check if scheme can't handle IRIs - if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { - //if host component is a domain name - if (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) { - //convert Unicode IDN -> ASCII IDN - try { - components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); - } - catch (e) { - components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; - } - } - //convert IRI -> URI - _normalizeComponentEncoding(components, URI_PROTOCOL); - } - else { - //normalize encodings - _normalizeComponentEncoding(components, protocol); - } - //perform scheme specific parsing - if (schemeHandler && schemeHandler.parse) { - schemeHandler.parse(components, options); - } - } - else { - components.error = components.error || "URI can not be parsed."; - } - return components; -} -; -function _recomposeAuthority(components, options) { - const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); - const uriTokens = []; - if (components.userinfo !== undefined) { - uriTokens.push(components.userinfo); - uriTokens.push("@"); - } - if (components.host !== undefined) { - //normalize IP hosts, add brackets and escape zone separator for IPv6 - uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => "[" + $1 + ($2 ? "%25" + $2 : "") + "]")); - } - if (typeof components.port === "number" || typeof components.port === "string") { - uriTokens.push(":"); - uriTokens.push(String(components.port)); - } - return uriTokens.length ? uriTokens.join("") : undefined; -} -; -const RDS1 = /^\.\.?\//; -const RDS2 = /^\/\.(\/|$)/; -const RDS3 = /^\/\.\.(\/|$)/; -const RDS4 = /^\.\.?$/; -const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; -export function removeDotSegments(input) { - const output = []; - while (input.length) { - if (input.match(RDS1)) { - input = input.replace(RDS1, ""); - } - else if (input.match(RDS2)) { - input = input.replace(RDS2, "/"); - } - else if (input.match(RDS3)) { - input = input.replace(RDS3, "/"); - output.pop(); - } - else if (input === "." || input === "..") { - input = ""; - } - else { - const im = input.match(RDS5); - if (im) { - const s = im[0]; - input = input.slice(s.length); - output.push(s); - } - else { - throw new Error("Unexpected dot segment condition"); - } - } - } - return output.join(""); -} -; -export function serialize(components, options = {}) { - const protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL); - const uriTokens = []; - //find scheme handler - const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; - //perform scheme specific serialization - if (schemeHandler && schemeHandler.serialize) - schemeHandler.serialize(components, options); - if (components.host) { - //if host component is an IPv6 address - if (protocol.IPV6ADDRESS.test(components.host)) { - //TODO: normalize IPv6 address as per RFC 5952 - } - //if host component is a domain name - else if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) { - //convert IDN via punycode - try { - components.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host)); - } - catch (e) { - components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; - } - } - } - //normalize encoding - _normalizeComponentEncoding(components, protocol); - if (options.reference !== "suffix" && components.scheme) { - uriTokens.push(components.scheme); - uriTokens.push(":"); - } - const authority = _recomposeAuthority(components, options); - if (authority !== undefined) { - if (options.reference !== "suffix") { - uriTokens.push("//"); - } - uriTokens.push(authority); - if (components.path && components.path.charAt(0) !== "/") { - uriTokens.push("/"); - } - } - if (components.path !== undefined) { - let s = components.path; - if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { - s = removeDotSegments(s); - } - if (authority === undefined) { - s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" - } - uriTokens.push(s); - } - if (components.query !== undefined) { - uriTokens.push("?"); - uriTokens.push(components.query); - } - if (components.fragment !== undefined) { - uriTokens.push("#"); - uriTokens.push(components.fragment); - } - return uriTokens.join(""); //merge tokens into a string -} -; -export function resolveComponents(base, relative, options = {}, skipNormalization) { - const target = {}; - if (!skipNormalization) { - base = parse(serialize(base, options), options); //normalize base components - relative = parse(serialize(relative, options), options); //normalize relative components - } - options = options || {}; - if (!options.tolerant && relative.scheme) { - target.scheme = relative.scheme; - //target.authority = relative.authority; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } - else { - if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { - //target.authority = relative.authority; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } - else { - if (!relative.path) { - target.path = base.path; - if (relative.query !== undefined) { - target.query = relative.query; - } - else { - target.query = base.query; - } - } - else { - if (relative.path.charAt(0) === "/") { - target.path = removeDotSegments(relative.path); - } - else { - if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { - target.path = "/" + relative.path; - } - else if (!base.path) { - target.path = relative.path; - } - else { - target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; - } - target.path = removeDotSegments(target.path); - } - target.query = relative.query; - } - //target.authority = base.authority; - target.userinfo = base.userinfo; - target.host = base.host; - target.port = base.port; - } - target.scheme = base.scheme; - } - target.fragment = relative.fragment; - return target; -} -; -export function resolve(baseURI, relativeURI, options) { - const schemelessOptions = assign({ scheme: 'null' }, options); - return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); -} -; -export function normalize(uri, options) { - if (typeof uri === "string") { - uri = serialize(parse(uri, options), options); - } - else if (typeOf(uri) === "object") { - uri = parse(serialize(uri, options), options); - } - return uri; -} -; -export function equal(uriA, uriB, options) { - if (typeof uriA === "string") { - uriA = serialize(parse(uriA, options), options); - } - else if (typeOf(uriA) === "object") { - uriA = serialize(uriA, options); - } - if (typeof uriB === "string") { - uriB = serialize(parse(uriB, options), options); - } - else if (typeOf(uriB) === "object") { - uriB = serialize(uriB, options); - } - return uriA === uriB; -} -; -export function escapeComponent(str, options) { - return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar); -} -; -export function unescapeComponent(str, options) { - return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars); -} -; -//# sourceMappingURL=uri.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/uri.js.map b/node_modules/uri-js/dist/esnext/uri.js.map deleted file mode 100755 index 2e72ab18d..000000000 --- a/node_modules/uri-js/dist/esnext/uri.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../src/uri.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAiDrD,MAAM,CAAC,MAAM,OAAO,GAAsC,EAAE,CAAC;AAE7D,MAAM,qBAAqB,GAAU;IACpC,MAAM,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,CAAQ,CAAC;IAEb,IAAI,CAAC,GAAG,EAAE;QAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/C,IAAI,CAAC,GAAG,GAAG;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;SACpD,IAAI,CAAC,GAAG,IAAI;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE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,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;KAChD;SAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;QACrC,IAAI,GAAG,SAAS,CAAgB,IAAI,EAAE,OAAO,CAAC,CAAC;KAC/C;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC7B,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;KAChD;SAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;QACrC,IAAI,GAAG,SAAS,CAAgB,IAAI,EAAE,OAAO,CAAC,CAAC;KAC/C;IAED,OAAO,IAAI,KAAK,IAAI,CAAC;AACtB,CAAC;AAAA,CAAC;AAEF,MAAM,0BAA0B,GAAU,EAAE,OAAmB;IAC9D,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;AAC1H,CAAC;AAAA,CAAC;AAEF,MAAM,4BAA4B,GAAU,EAAE,OAAmB;IAChE,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC;AACrI,CAAC;AAAA,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/util.d.ts b/node_modules/uri-js/dist/esnext/util.d.ts deleted file mode 100755 index 7c1285754..000000000 --- a/node_modules/uri-js/dist/esnext/util.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare function merge(...sets: Array): string; -export declare function subexp(str: string): string; -export declare function typeOf(o: any): string; -export declare function toUpperCase(str: string): string; -export declare function toArray(obj: any): Array; -export declare function assign(target: object, source: any): any; diff --git a/node_modules/uri-js/dist/esnext/util.js b/node_modules/uri-js/dist/esnext/util.js deleted file mode 100755 index 072711efd..000000000 --- a/node_modules/uri-js/dist/esnext/util.js +++ /dev/null @@ -1,36 +0,0 @@ -export function merge(...sets) { - if (sets.length > 1) { - sets[0] = sets[0].slice(0, -1); - const xl = sets.length - 1; - for (let x = 1; x < xl; ++x) { - sets[x] = sets[x].slice(1, -1); - } - sets[xl] = sets[xl].slice(1); - return sets.join(''); - } - else { - return sets[0]; - } -} -export function subexp(str) { - return "(?:" + str + ")"; -} -export function typeOf(o) { - return o === undefined ? "undefined" : (o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase()); -} -export function toUpperCase(str) { - return str.toUpperCase(); -} -export function toArray(obj) { - return obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : []; -} -export function assign(target, source) { - const obj = target; - if (source) { - for (const key in source) { - obj[key] = source[key]; - } - } - return obj; -} -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/node_modules/uri-js/dist/esnext/util.js.map b/node_modules/uri-js/dist/esnext/util.js.map deleted file mode 100755 index 05d9df021..000000000 --- a/node_modules/uri-js/dist/esnext/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,IAAkB;IAC1C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAA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AAQ,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvM,CAAC;AAGD,MAAM,iBAAiB,MAAc,EAAE,MAAW;IACjD,MAAM,GAAG,GAAG,MAAa,CAAC;IAC1B,IAAI,MAAM,EAAE;QACX,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACzB,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;SACvB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/node_modules/uri-js/package.json b/node_modules/uri-js/package.json deleted file mode 100755 index de95d91aa..000000000 --- a/node_modules/uri-js/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "uri-js", - "version": "4.4.1", - "description": "An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.", - "main": "dist/es5/uri.all.js", - "types": "dist/es5/uri.all.d.ts", - "directories": { - "test": "tests" - }, - "files": [ - "dist", - "package.json", - "yarn.lock", - "README.md", - "CHANGELOG", - "LICENSE" - ], - "scripts": { - "build:esnext": "tsc", - "build:es5": "rollup -c && cp dist/esnext/uri.d.ts dist/es5/uri.all.d.ts && npm run build:es5:fix-sourcemap", - "build:es5:fix-sourcemap": "sorcery -i dist/es5/uri.all.js", - "build:es5:min": "uglifyjs dist/es5/uri.all.js --support-ie8 --output dist/es5/uri.all.min.js --in-source-map dist/es5/uri.all.js.map --source-map uri.all.min.js.map --comments --compress --mangle --pure-funcs merge subexp && mv uri.all.min.js.map dist/es5/ && cp dist/es5/uri.all.d.ts dist/es5/uri.all.min.d.ts", - "build": "npm run build:esnext && npm run build:es5 && npm run build:es5:min", - "clean": "rm -rf dist", - "test": "mocha -u mocha-qunit-ui dist/es5/uri.all.js tests/tests.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/garycourt/uri-js" - }, - "keywords": [ - "URI", - "IRI", - "IDN", - "URN", - "UUID", - "HTTP", - "HTTPS", - "WS", - "WSS", - "MAILTO", - "RFC3986", - "RFC3987", - "RFC5891", - "RFC2616", - "RFC2818", - "RFC2141", - "RFC4122", - "RFC4291", - "RFC5952", - "RFC6068", - "RFC6455", - "RFC6874" - ], - "author": "Gary Court ", - "license": "BSD-2-Clause", - "bugs": { - "url": "https://github.com/garycourt/uri-js/issues" - }, - "homepage": "https://github.com/garycourt/uri-js", - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-plugin-external-helpers": "^6.22.0", - "babel-preset-latest": "^6.24.1", - "mocha": "^8.2.1", - "mocha-qunit-ui": "^0.1.3", - "rollup": "^0.41.6", - "rollup-plugin-babel": "^2.7.1", - "rollup-plugin-node-resolve": "^2.0.0", - "sorcery": "^0.10.0", - "typescript": "^2.8.1", - "uglify-js": "^2.8.14" - }, - "dependencies": { - "punycode": "^2.1.0" - } -} diff --git a/node_modules/uri-js/yarn.lock b/node_modules/uri-js/yarn.lock deleted file mode 100755 index 3c42ded12..000000000 --- a/node_modules/uri-js/yarn.lock +++ /dev/null @@ -1,2558 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@ungap/promise-all-settled@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" - integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== - -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" - -ansi-colors@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -ansi-styles@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - -anymatch@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" - integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= - dependencies: - arr-flatten "^1.0.1" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-flatten@^1.0.1, arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -async-each@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -babel-cli@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" - integrity sha1-UCq1SHTX24itALiHoGODzgPQAvE= - dependencies: - babel-core "^6.26.0" - babel-polyfill "^6.26.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - commander "^2.11.0" - convert-source-map "^1.5.0" - fs-readdir-recursive "^1.0.0" - glob "^7.1.2" - lodash "^4.17.4" - output-file-sync "^1.1.2" - path-is-absolute "^1.0.1" - slash "^1.0.0" - source-map "^0.5.6" - v8flags "^2.1.1" - optionalDependencies: - chokidar "^1.6.1" - -babel-code-frame@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -babel-core@6: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.0" - debug "^2.6.8" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.7" - slash "^1.0.0" - source-map "^0.5.6" - -babel-core@^6.26.0: - version "6.26.3" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.1" - debug "^2.6.9" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.8" - slash "^1.0.0" - source-map "^0.5.7" - -babel-generator@^6.26.0: - version "6.26.1" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" - integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.17.4" - source-map "^0.5.7" - trim-right "^1.0.1" - -babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" - dependencies: - babel-helper-explode-assignable-expression "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-call-delegate@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-define-map@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-explode-assignable-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - dependencies: - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-get-function-arity@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-hoist-variables@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-optimise-call-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-regex@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-remap-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-replace-supers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - dependencies: - babel-helper-optimise-call-expression "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helpers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-check-es2015-constants@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-external-helpers@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-syntax-async-functions@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" - -babel-plugin-syntax-exponentiation-operator@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" - -babel-plugin-syntax-trailing-function-commas@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" - -babel-plugin-transform-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-arrow-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoping@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - dependencies: - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-plugin-transform-es2015-classes@^6.24.1, babel-plugin-transform-es2015-classes@^6.9.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - dependencies: - babel-helper-define-map "^6.24.1" - babel-helper-function-name "^6.24.1" - babel-helper-optimise-call-expression "^6.24.1" - babel-helper-replace-supers "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-computed-properties@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-destructuring@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-duplicate-keys@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-for-of@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-modules-amd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" - dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-commonjs@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" - dependencies: - babel-plugin-transform-strict-mode "^6.24.1" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-types "^6.26.0" - -babel-plugin-transform-es2015-modules-systemjs@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-umd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" - dependencies: - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-object-super@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" - dependencies: - babel-helper-replace-supers "^6.24.1" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-parameters@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - dependencies: - babel-helper-call-delegate "^6.24.1" - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-shorthand-properties@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-spread@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-sticky-regex@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-template-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-typeof-symbol@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-unicode-regex@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - regexpu-core "^2.0.0" - -babel-plugin-transform-exponentiation-operator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" - dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" - babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-regenerator@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" - dependencies: - regenerator-transform "^0.10.0" - -babel-plugin-transform-strict-mode@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-polyfill@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" - integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= - dependencies: - babel-runtime "^6.26.0" - core-js "^2.5.0" - regenerator-runtime "^0.10.5" - -babel-preset-es2015@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.24.1" - babel-plugin-transform-es2015-classes "^6.24.1" - babel-plugin-transform-es2015-computed-properties "^6.24.1" - babel-plugin-transform-es2015-destructuring "^6.22.0" - babel-plugin-transform-es2015-duplicate-keys "^6.24.1" - babel-plugin-transform-es2015-for-of "^6.22.0" - babel-plugin-transform-es2015-function-name "^6.24.1" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-plugin-transform-es2015-modules-systemjs "^6.24.1" - babel-plugin-transform-es2015-modules-umd "^6.24.1" - babel-plugin-transform-es2015-object-super "^6.24.1" - babel-plugin-transform-es2015-parameters "^6.24.1" - babel-plugin-transform-es2015-shorthand-properties "^6.24.1" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.24.1" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.22.0" - babel-plugin-transform-es2015-unicode-regex "^6.24.1" - babel-plugin-transform-regenerator "^6.24.1" - -babel-preset-es2016@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-es2016/-/babel-preset-es2016-6.24.1.tgz#f900bf93e2ebc0d276df9b8ab59724ebfd959f8b" - dependencies: - babel-plugin-transform-exponentiation-operator "^6.24.1" - -babel-preset-es2017@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-es2017/-/babel-preset-es2017-6.24.1.tgz#597beadfb9f7f208bcfd8a12e9b2b29b8b2f14d1" - dependencies: - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-to-generator "^6.24.1" - -babel-preset-latest@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-latest/-/babel-preset-latest-6.24.1.tgz#677de069154a7485c2d25c577c02f624b85b85e8" - dependencies: - babel-preset-es2015 "^6.24.1" - babel-preset-es2016 "^6.24.1" - babel-preset-es2017 "^6.24.1" - -babel-register@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= - dependencies: - babel-core "^6.26.0" - babel-runtime "^6.26.0" - core-js "^2.5.0" - home-or-tmp "^2.0.0" - lodash "^4.17.4" - mkdirp "^0.5.1" - source-map-support "^0.4.15" - -babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" - -babel-template@^6.24.1, babel-template@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" - integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= - dependencies: - babel-runtime "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - lodash "^4.17.4" - -babel-traverse@^6.24.1, babel-traverse@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" - dependencies: - babel-code-frame "^6.26.0" - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - debug "^2.6.8" - globals "^9.18.0" - invariant "^2.2.2" - lodash "^4.17.4" - -babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" - dependencies: - babel-runtime "^6.26.0" - esutils "^2.0.2" - lodash "^4.17.4" - to-fast-properties "^1.0.3" - -babylon@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - -binary-extensions@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" - integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== - -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -browser-resolve@^1.11.0: - version "1.11.2" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" - dependencies: - resolve "1.1.7" - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -buffer-crc32@^0.2.5: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - -builtin-modules@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -camelcase@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - -camelcase@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.0.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== - -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" - -chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chokidar@3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" - integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.5.0" - optionalDependencies: - fsevents "~2.1.2" - -chokidar@^1.6.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - -cliui@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" - integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== - dependencies: - string-width "^3.1.0" - strip-ansi "^5.2.0" - wrap-ansi "^5.1.0" - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -commander@^2.11.0: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -convert-source-map@^1.5.0, convert-source-map@^1.5.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" - integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== - dependencies: - safe-buffer "~5.1.1" - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -core-js@^2.4.0, core-js@^2.5.0: - version "2.6.12" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" - integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -debug@4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1" - integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== - dependencies: - ms "2.1.2" - -debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -decamelize@^1.0.0, decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -decamelize@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" - integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -detect-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= - dependencies: - repeating "^2.0.0" - -diff@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - -es6-promise@^3.1.2: - version "3.3.1" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" - -escape-string-regexp@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -escape-string-regexp@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -estree-walker@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= - dependencies: - is-posix-bracket "^0.1.0" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= - dependencies: - fill-range "^2.1.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= - dependencies: - is-extglob "^1.0.0" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -find-up@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - -flat@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" - integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== - -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= - dependencies: - for-in "^1.0.1" - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -fs-readdir-recursive@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" - integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^1.0.0: - version "1.2.13" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" - integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - -fsevents@~2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - -get-caller-file@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= - dependencies: - is-glob "^2.0.0" - -glob-parent@~5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== - dependencies: - is-glob "^4.0.1" - -glob@7.1.6, glob@^7.1.2, glob@^7.1.3: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^9.18.0: - version "9.18.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== - -graceful-fs@^4.1.11, graceful-fs@^4.1.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== - -graceful-fs@^4.1.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" - -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -he@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -home-or-tmp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.1" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.1, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -invariant@^2.2.2: - version "2.2.4" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== - dependencies: - loose-envify "^1.0.0" - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= - dependencies: - binary-extensions "^1.0.0" - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-finite@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" - integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= - dependencies: - is-extglob "^1.0.0" - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= - dependencies: - kind-of "^3.0.2" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-plain-obj@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - -is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -"js-tokens@^3.0.0 || ^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= - -js-yaml@3.14.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" - integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsesc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= - -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - -json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash@^4.17.4: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -log-symbols@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920" - integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA== - dependencies: - chalk "^4.0.0" - -longest@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - -loose-envify@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - -math-random@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" - integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== - -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -micromatch@^3.1.10: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.0, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@^0.5.1: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -mocha-qunit-ui@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/mocha-qunit-ui/-/mocha-qunit-ui-0.1.3.tgz#e3e1ff1dac33222b10cef681efd7f82664141ea9" - -mocha@^8.2.1: - version "8.2.1" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.2.1.tgz#f2fa68817ed0e53343d989df65ccd358bc3a4b39" - integrity sha512-cuLBVfyFfFqbNR0uUKbDGXKGk+UDFe6aR4os78XIrMQpZl/nv7JYHcvP5MFIAb374b2zFXsdgEGwmzMtP0Xg8w== - dependencies: - "@ungap/promise-all-settled" "1.1.2" - ansi-colors "4.1.1" - browser-stdout "1.3.1" - chokidar "3.4.3" - debug "4.2.0" - diff "4.0.2" - escape-string-regexp "4.0.0" - find-up "5.0.0" - glob "7.1.6" - growl "1.10.5" - he "1.2.0" - js-yaml "3.14.0" - log-symbols "4.0.0" - minimatch "3.0.4" - ms "2.1.2" - nanoid "3.1.12" - serialize-javascript "5.0.1" - strip-json-comments "3.1.1" - supports-color "7.2.0" - which "2.0.2" - wide-align "1.1.3" - workerpool "6.0.2" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "2.0.0" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -nan@^2.12.1: - version "2.14.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" - integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== - -nanoid@3.1.12: - version "3.1.12" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.12.tgz#6f7736c62e8d39421601e4a0c77623a97ea69654" - integrity sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -normalize-path@^2.0.0, normalize-path@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - -os-tmpdir@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -output-file-sync@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" - integrity sha1-0KM+7+YaIF+suQCS6CZZjVJFznY= - dependencies: - graceful-fs "^4.1.4" - mkdirp "^0.5.1" - object-assign "^4.1.0" - -p-limit@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" - -picomatch@^2.0.4, picomatch@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" - integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= - -private@^0.1.6, private@^0.1.7, private@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -punycode@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" - -randomatic@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" - integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -readable-stream@^2.0.2: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -readdirp@~3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" - integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== - dependencies: - picomatch "^2.2.1" - -regenerate@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" - -regenerator-runtime@^0.10.5: - version "0.10.5" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" - integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= - -regenerator-runtime@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== - -regenerator-transform@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" - dependencies: - babel-runtime "^6.18.0" - babel-types "^6.19.0" - private "^0.1.6" - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== - dependencies: - is-equal-shallow "^0.1.3" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -regexpu-core@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" - dependencies: - regenerate "^1.2.1" - regjsgen "^0.2.0" - regjsparser "^0.1.4" - -regjsgen@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" - -regjsparser@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" - dependencies: - jsesc "~0.5.0" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - -repeat-string@^1.5.2, repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= - dependencies: - is-finite "^1.0.0" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - -resolve@^1.1.6: - version "1.6.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.6.0.tgz#0fbd21278b27b4004481c395349e7aba60a9ff5c" - dependencies: - path-parse "^1.0.5" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -right-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - dependencies: - align-text "^0.1.1" - -rimraf@^2.5.2: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - dependencies: - glob "^7.1.3" - -rollup-plugin-babel@^2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57" - dependencies: - babel-core "6" - babel-plugin-transform-es2015-classes "^6.9.0" - object-assign "^4.1.0" - rollup-pluginutils "^1.5.0" - -rollup-plugin-node-resolve@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.1.1.tgz#cbb783b0d15b02794d58915350b2f0d902b8ddc8" - dependencies: - browser-resolve "^1.11.0" - builtin-modules "^1.1.0" - resolve "^1.1.6" - -rollup-pluginutils@^1.5.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" - dependencies: - estree-walker "^0.2.1" - minimatch "^3.0.2" - -rollup@^0.41.6: - version "0.41.6" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a" - dependencies: - source-map-support "^0.4.0" - -safe-buffer@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - -sander@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/sander/-/sander-0.5.1.tgz#741e245e231f07cafb6fdf0f133adfa216a502ad" - dependencies: - es6-promise "^3.1.2" - graceful-fs "^4.1.3" - mkdirp "^0.5.1" - rimraf "^2.5.2" - -serialize-javascript@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4" - integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA== - dependencies: - randombytes "^2.1.0" - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -slash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -sorcery@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/sorcery/-/sorcery-0.10.0.tgz#8ae90ad7d7cb05fc59f1ab0c637845d5c15a52b7" - dependencies: - buffer-crc32 "^0.2.5" - minimist "^1.2.0" - sander "^0.5.0" - sourcemap-codec "^1.3.0" - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@^0.4.0, source-map-support@^0.4.15: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - dependencies: - source-map "^0.5.6" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= - -source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -sourcemap-codec@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz#c8fd92d91889e902a07aee392bdd2c5863958ba2" - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^3.0.0, string-width@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-json-comments@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@7.2.0, supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - -to-fast-properties@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= - -typescript@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.1.tgz#6160e4f8f195d5ba81d4876f9c0cc1fbc0820624" - -uglify-js@^2.8.14: - version "2.8.29" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - dependencies: - source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: - uglify-to-browserify "~1.0.0" - -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -user-home@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" - integrity sha1-K1viOjK2Onyd640PKNSFcko98ZA= - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -v8flags@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" - integrity sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ= - dependencies: - user-home "^1.1.1" - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wide-align@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -window-size@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - -workerpool@6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.0.2.tgz#e241b43d8d033f1beb52c7851069456039d1d438" - integrity sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q== - -wrap-ansi@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -y18n@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" - integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== - -yargs-parser@13.1.2, yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-unparser@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" - integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== - dependencies: - camelcase "^6.0.0" - decamelize "^4.0.0" - flat "^5.0.2" - is-plain-obj "^2.1.0" - -yargs@13.3.2: - version "13.3.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" - -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/node_modules/util-deprecate/History.md b/node_modules/util-deprecate/History.md deleted file mode 100644 index acc867537..000000000 --- a/node_modules/util-deprecate/History.md +++ /dev/null @@ -1,16 +0,0 @@ - -1.0.2 / 2015-10-07 -================== - - * use try/catch when checking `localStorage` (#3, @kumavis) - -1.0.1 / 2014-11-25 -================== - - * browser: use `console.warn()` for deprecation calls - * browser: more jsdocs - -1.0.0 / 2014-04-30 -================== - - * initial commit diff --git a/node_modules/util-deprecate/LICENSE b/node_modules/util-deprecate/LICENSE deleted file mode 100644 index 6a60e8c22..000000000 --- a/node_modules/util-deprecate/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/util-deprecate/README.md b/node_modules/util-deprecate/README.md deleted file mode 100644 index 75622fa7c..000000000 --- a/node_modules/util-deprecate/README.md +++ /dev/null @@ -1,53 +0,0 @@ -util-deprecate -============== -### The Node.js `util.deprecate()` function with browser support - -In Node.js, this module simply re-exports the `util.deprecate()` function. - -In the web browser (i.e. via browserify), a browser-specific implementation -of the `util.deprecate()` function is used. - - -## API - -A `deprecate()` function is the only thing exposed by this module. - -``` javascript -// setup: -exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); - - -// users see: -foo(); -// foo() is deprecated, use bar() instead -foo(); -foo(); -``` - - -## License - -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/util-deprecate/browser.js b/node_modules/util-deprecate/browser.js deleted file mode 100644 index 549ae2f06..000000000 --- a/node_modules/util-deprecate/browser.js +++ /dev/null @@ -1,67 +0,0 @@ - -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - // accessing global.localStorage can trigger a DOMException in sandboxed iframes - try { - if (!global.localStorage) return false; - } catch (_) { - return false; - } - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} diff --git a/node_modules/util-deprecate/node.js b/node_modules/util-deprecate/node.js deleted file mode 100644 index 5e6fcff5d..000000000 --- a/node_modules/util-deprecate/node.js +++ /dev/null @@ -1,6 +0,0 @@ - -/** - * For Node.js, simply re-export the core `util.deprecate` function. - */ - -module.exports = require('util').deprecate; diff --git a/node_modules/util-deprecate/package.json b/node_modules/util-deprecate/package.json deleted file mode 100644 index 2e79f89a9..000000000 --- a/node_modules/util-deprecate/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "util-deprecate", - "version": "1.0.2", - "description": "The Node.js `util.deprecate()` function with browser support", - "main": "node.js", - "browser": "browser.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/util-deprecate.git" - }, - "keywords": [ - "util", - "deprecate", - "browserify", - "browser", - "node" - ], - "author": "Nathan Rajlich (http://n8.io/)", - "license": "MIT", - "bugs": { - "url": "https://github.com/TooTallNate/util-deprecate/issues" - }, - "homepage": "https://github.com/TooTallNate/util-deprecate" -} diff --git a/node_modules/validate-npm-package-license/LICENSE b/node_modules/validate-npm-package-license/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/node_modules/validate-npm-package-license/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/node_modules/validate-npm-package-license/README.md b/node_modules/validate-npm-package-license/README.md deleted file mode 100644 index 702bc7b4f..000000000 --- a/node_modules/validate-npm-package-license/README.md +++ /dev/null @@ -1,113 +0,0 @@ -validate-npm-package-license -============================ - -Give me a string and I'll tell you if it's a valid npm package license string. - -```javascript -var valid = require('validate-npm-package-license'); -``` - -SPDX license identifiers are valid license strings: - -```javascript - -var assert = require('assert'); -var validSPDXExpression = { - validForNewPackages: true, - validForOldPackages: true, - spdx: true -}; - -assert.deepEqual(valid('MIT'), validSPDXExpression); -assert.deepEqual(valid('BSD-2-Clause'), validSPDXExpression); -assert.deepEqual(valid('Apache-2.0'), validSPDXExpression); -assert.deepEqual(valid('ISC'), validSPDXExpression); -``` -The function will return a warning and suggestion for nearly-correct license identifiers: - -```javascript -assert.deepEqual( - valid('Apache 2.0'), - { - validForOldPackages: false, - validForNewPackages: false, - warnings: [ - 'license should be ' + - 'a valid SPDX license expression (without "LicenseRef"), ' + - '"UNLICENSED", or ' + - '"SEE LICENSE IN "', - 'license is similar to the valid expression "Apache-2.0"' - ] - } -); -``` - -SPDX expressions are valid, too ... - -```javascript -// Simple SPDX license expression for dual licensing -assert.deepEqual( - valid('(GPL-3.0-only OR BSD-2-Clause)'), - validSPDXExpression -); -``` - -... except if they contain `LicenseRef`: - -```javascript -var warningAboutLicenseRef = { - validForOldPackages: false, - validForNewPackages: false, - spdx: true, - warnings: [ - 'license should be ' + - 'a valid SPDX license expression (without "LicenseRef"), ' + - '"UNLICENSED", or ' + - '"SEE LICENSE IN "', - ] -}; - -assert.deepEqual( - valid('LicenseRef-Made-Up'), - warningAboutLicenseRef -); - -assert.deepEqual( - valid('(MIT OR LicenseRef-Made-Up)'), - warningAboutLicenseRef -); -``` - -If you can't describe your licensing terms with standardized SPDX identifiers, put the terms in a file in the package and point users there: - -```javascript -assert.deepEqual( - valid('SEE LICENSE IN LICENSE.txt'), - { - validForNewPackages: true, - validForOldPackages: true, - inFile: 'LICENSE.txt' - } -); - -assert.deepEqual( - valid('SEE LICENSE IN license.md'), - { - validForNewPackages: true, - validForOldPackages: true, - inFile: 'license.md' - } -); -``` - -If there aren't any licensing terms, use `UNLICENSED`: - -```javascript -var unlicensed = { - validForNewPackages: true, - validForOldPackages: true, - unlicensed: true -}; -assert.deepEqual(valid('UNLICENSED'), unlicensed); -assert.deepEqual(valid('UNLICENCED'), unlicensed); -``` diff --git a/node_modules/validate-npm-package-license/index.js b/node_modules/validate-npm-package-license/index.js deleted file mode 100644 index 35eaa7325..000000000 --- a/node_modules/validate-npm-package-license/index.js +++ /dev/null @@ -1,86 +0,0 @@ -var parse = require('spdx-expression-parse'); -var correct = require('spdx-correct'); - -var genericWarning = ( - 'license should be ' + - 'a valid SPDX license expression (without "LicenseRef"), ' + - '"UNLICENSED", or ' + - '"SEE LICENSE IN "' -); - -var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/; - -function startsWith(prefix, string) { - return string.slice(0, prefix.length) === prefix; -} - -function usesLicenseRef(ast) { - if (ast.hasOwnProperty('license')) { - var license = ast.license; - return ( - startsWith('LicenseRef', license) || - startsWith('DocumentRef', license) - ); - } else { - return ( - usesLicenseRef(ast.left) || - usesLicenseRef(ast.right) - ); - } -} - -module.exports = function(argument) { - var ast; - - try { - ast = parse(argument); - } catch (e) { - var match - if ( - argument === 'UNLICENSED' || - argument === 'UNLICENCED' - ) { - return { - validForOldPackages: true, - validForNewPackages: true, - unlicensed: true - }; - } else if (match = fileReferenceRE.exec(argument)) { - return { - validForOldPackages: true, - validForNewPackages: true, - inFile: match[1] - }; - } else { - var result = { - validForOldPackages: false, - validForNewPackages: false, - warnings: [genericWarning] - }; - if (argument.trim().length !== 0) { - var corrected = correct(argument); - if (corrected) { - result.warnings.push( - 'license is similar to the valid expression "' + corrected + '"' - ); - } - } - return result; - } - } - - if (usesLicenseRef(ast)) { - return { - validForNewPackages: false, - validForOldPackages: false, - spdx: true, - warnings: [genericWarning] - }; - } else { - return { - validForNewPackages: true, - validForOldPackages: true, - spdx: true - }; - } -}; diff --git a/node_modules/validate-npm-package-license/package.json b/node_modules/validate-npm-package-license/package.json deleted file mode 100644 index 9e92af4f4..000000000 --- a/node_modules/validate-npm-package-license/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "validate-npm-package-license", - "description": "Give me a string and I'll tell you if it's a valid npm package license string", - "version": "3.0.4", - "author": "Kyle E. Mitchell (https://kemitchell.com)", - "contributors": [ - "Mark Stacey " - ], - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - }, - "devDependencies": { - "defence-cli": "^2.0.1", - "replace-require-self": "^1.0.0" - }, - "keywords": [ - "license", - "npm", - "package", - "validation" - ], - "license": "Apache-2.0", - "repository": "kemitchell/validate-npm-package-license.js", - "scripts": { - "test": "defence README.md | replace-require-self | node" - } -} diff --git a/node_modules/which/CHANGELOG.md b/node_modules/which/CHANGELOG.md deleted file mode 100644 index 3d83d2694..000000000 --- a/node_modules/which/CHANGELOG.md +++ /dev/null @@ -1,152 +0,0 @@ -# Changes - - -## 1.3.1 - -* update deps -* update travis - -## v1.3.0 - -* Add nothrow option to which.sync -* update tap - -## v1.2.14 - -* appveyor: drop node 5 and 0.x -* travis-ci: add node 6, drop 0.x - -## v1.2.13 - -* test: Pass missing option to pass on windows -* update tap -* update isexe to 2.0.0 -* neveragain.tech pledge request - -## v1.2.12 - -* Removed unused require - -## v1.2.11 - -* Prevent changelog script from being included in package - -## v1.2.10 - -* Use env.PATH only, not env.Path - -## v1.2.9 - -* fix for paths starting with ../ -* Remove unused `is-absolute` module - -## v1.2.8 - -* bullet items in changelog that contain (but don't start with) # - -## v1.2.7 - -* strip 'update changelog' changelog entries out of changelog - -## v1.2.6 - -* make the changelog bulleted - -## v1.2.5 - -* make a changelog, and keep it up to date -* don't include tests in package -* Properly handle relative-path executables -* appveyor -* Attach error code to Not Found error -* Make tests pass on Windows - -## v1.2.4 - -* Fix typo - -## v1.2.3 - -* update isexe, fix regression in pathExt handling - -## v1.2.2 - -* update deps, use isexe module, test windows - -## v1.2.1 - -* Sometimes windows PATH entries are quoted -* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode. -* doc cli - -## v1.2.0 - -* Add support for opt.all and -as cli flags -* test the bin -* update travis -* Allow checking for multiple programs in bin/which -* tap 2 - -## v1.1.2 - -* travis -* Refactored and fixed undefined error on Windows -* Support strict mode - -## v1.1.1 - -* test +g exes against secondary groups, if available -* Use windows exe semantics on cygwin & msys -* cwd should be first in path on win32, not last -* Handle lower-case 'env.Path' on Windows -* Update docs -* use single-quotes - -## v1.1.0 - -* Add tests, depend on is-absolute - -## v1.0.9 - -* which.js: root is allowed to execute files owned by anyone - -## v1.0.8 - -* don't use graceful-fs - -## v1.0.7 - -* add license to package.json - -## v1.0.6 - -* isc license - -## 1.0.5 - -* Awful typo - -## 1.0.4 - -* Test for path absoluteness properly -* win: Allow '' as a pathext if cmd has a . in it - -## 1.0.3 - -* Remove references to execPath -* Make `which.sync()` work on Windows by honoring the PATHEXT variable. -* Make `isExe()` always return true on Windows. -* MIT - -## 1.0.2 - -* Only files can be exes - -## 1.0.1 - -* Respect the PATHEXT env for win32 support -* should 0755 the bin -* binary -* guts -* package -* 1st diff --git a/node_modules/which/LICENSE b/node_modules/which/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/which/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -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. diff --git a/node_modules/which/README.md b/node_modules/which/README.md deleted file mode 100644 index 8c0b0cbf7..000000000 --- a/node_modules/which/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# which - -Like the unix `which` utility. - -Finds the first instance of a specified executable in the PATH -environment variable. Does not cache the results, so `hash -r` is not -needed when the PATH changes. - -## USAGE - -```javascript -var which = require('which') - -// async usage -which('node', function (er, resolvedPath) { - // er is returned if no "node" is found on the PATH - // if it is found, then the absolute path to the exec is returned -}) - -// sync usage -// throws if not found -var resolved = which.sync('node') - -// if nothrow option is used, returns null if not found -resolved = which.sync('node', {nothrow: true}) - -// Pass options to override the PATH and PATHEXT environment vars. -which('node', { path: someOtherPath }, function (er, resolved) { - if (er) - throw er - console.log('found at %j', resolved) -}) -``` - -## CLI USAGE - -Same as the BSD `which(1)` binary. - -``` -usage: which [-as] program ... -``` - -## OPTIONS - -You may pass an options object as the second argument. - -- `path`: Use instead of the `PATH` environment variable. -- `pathExt`: Use instead of the `PATHEXT` environment variable. -- `all`: Return all matches, instead of just the first one. Note that - this means the function returns an array of strings instead of a - single string. diff --git a/node_modules/which/bin/which b/node_modules/which/bin/which deleted file mode 100755 index 7cee3729e..000000000 --- a/node_modules/which/bin/which +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env node -var which = require("../") -if (process.argv.length < 3) - usage() - -function usage () { - console.error('usage: which [-as] program ...') - process.exit(1) -} - -var all = false -var silent = false -var dashdash = false -var args = process.argv.slice(2).filter(function (arg) { - if (dashdash || !/^-/.test(arg)) - return true - - if (arg === '--') { - dashdash = true - return false - } - - var flags = arg.substr(1).split('') - for (var f = 0; f < flags.length; f++) { - var flag = flags[f] - switch (flag) { - case 's': - silent = true - break - case 'a': - all = true - break - default: - console.error('which: illegal option -- ' + flag) - usage() - } - } - return false -}) - -process.exit(args.reduce(function (pv, current) { - try { - var f = which.sync(current, { all: all }) - if (all) - f = f.join('\n') - if (!silent) - console.log(f) - return pv; - } catch (e) { - return 1; - } -}, 0)) diff --git a/node_modules/which/package.json b/node_modules/which/package.json deleted file mode 100644 index 51be376f6..000000000 --- a/node_modules/which/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "author": "Isaac Z. Schlueter (http://blog.izs.me)", - "name": "which", - "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "1.3.1", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-which.git" - }, - "main": "which.js", - "bin": "./bin/which", - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "devDependencies": { - "mkdirp": "^0.5.0", - "rimraf": "^2.6.2", - "tap": "^12.0.1" - }, - "scripts": { - "test": "tap test/*.js --cov", - "changelog": "bash gen-changelog.sh", - "postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}" - }, - "files": [ - "which.js", - "bin/which" - ] -} diff --git a/node_modules/which/which.js b/node_modules/which/which.js deleted file mode 100644 index 4347f91a1..000000000 --- a/node_modules/which/which.js +++ /dev/null @@ -1,135 +0,0 @@ -module.exports = which -which.sync = whichSync - -var isWindows = process.platform === 'win32' || - process.env.OSTYPE === 'cygwin' || - process.env.OSTYPE === 'msys' - -var path = require('path') -var COLON = isWindows ? ';' : ':' -var isexe = require('isexe') - -function getNotFoundError (cmd) { - var er = new Error('not found: ' + cmd) - er.code = 'ENOENT' - - return er -} - -function getPathInfo (cmd, opt) { - var colon = opt.colon || COLON - var pathEnv = opt.path || process.env.PATH || '' - var pathExt = [''] - - pathEnv = pathEnv.split(colon) - - var pathExtExe = '' - if (isWindows) { - pathEnv.unshift(process.cwd()) - pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') - pathExt = pathExtExe.split(colon) - - - // Always test the cmd itself first. isexe will check to make sure - // it's found in the pathExt set. - if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') - pathExt.unshift('') - } - - // If it has a slash, then we don't bother searching the pathenv. - // just check the file itself, and that's it. - if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) - pathEnv = [''] - - return { - env: pathEnv, - ext: pathExt, - extExe: pathExtExe - } -} - -function which (cmd, opt, cb) { - if (typeof opt === 'function') { - cb = opt - opt = {} - } - - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] - - ;(function F (i, l) { - if (i === l) { - if (opt.all && found.length) - return cb(null, found) - else - return cb(getNotFoundError(cmd)) - } - - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) - - var p = path.join(pathPart, cmd) - if (!pathPart && (/^\.[\\\/]/).test(cmd)) { - p = cmd.slice(0, 2) + p - } - ;(function E (ii, ll) { - if (ii === ll) return F(i + 1, l) - var ext = pathExt[ii] - isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { - if (!er && is) { - if (opt.all) - found.push(p + ext) - else - return cb(null, p + ext) - } - return E(ii + 1, ll) - }) - })(0, pathExt.length) - })(0, pathEnv.length) -} - -function whichSync (cmd, opt) { - opt = opt || {} - - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] - - for (var i = 0, l = pathEnv.length; i < l; i ++) { - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) - - var p = path.join(pathPart, cmd) - if (!pathPart && /^\.[\\\/]/.test(cmd)) { - p = cmd.slice(0, 2) + p - } - for (var j = 0, ll = pathExt.length; j < ll; j ++) { - var cur = p + pathExt[j] - var is - try { - is = isexe.sync(cur, { pathExt: pathExtExe }) - if (is) { - if (opt.all) - found.push(cur) - else - return cur - } - } catch (ex) {} - } - } - - if (opt.all && found.length) - return found - - if (opt.nothrow) - return null - - throw getNotFoundError(cmd) -} diff --git a/node_modules/wrappy/LICENSE b/node_modules/wrappy/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/wrappy/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -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. diff --git a/node_modules/wrappy/README.md b/node_modules/wrappy/README.md deleted file mode 100644 index 98eab2522..000000000 --- a/node_modules/wrappy/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# wrappy - -Callback wrapping utility - -## USAGE - -```javascript -var wrappy = require("wrappy") - -// var wrapper = wrappy(wrapperFunction) - -// make sure a cb is called only once -// See also: http://npm.im/once for this specific use case -var once = wrappy(function (cb) { - var called = false - return function () { - if (called) return - called = true - return cb.apply(this, arguments) - } -}) - -function printBoo () { - console.log('boo') -} -// has some rando property -printBoo.iAmBooPrinter = true - -var onlyPrintOnce = once(printBoo) - -onlyPrintOnce() // prints 'boo' -onlyPrintOnce() // does nothing - -// random property is retained! -assert.equal(onlyPrintOnce.iAmBooPrinter, true) -``` diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json deleted file mode 100644 index 130752046..000000000 --- a/node_modules/wrappy/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "wrappy", - "version": "1.0.2", - "description": "Callback wrapping utility", - "main": "wrappy.js", - "files": [ - "wrappy.js" - ], - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "^2.3.1" - }, - "scripts": { - "test": "tap --coverage test/*.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/wrappy" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/wrappy/issues" - }, - "homepage": "https://github.com/npm/wrappy" -} diff --git a/node_modules/wrappy/wrappy.js b/node_modules/wrappy/wrappy.js deleted file mode 100644 index bb7e7d6fc..000000000 --- a/node_modules/wrappy/wrappy.js +++ /dev/null @@ -1,33 +0,0 @@ -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) - - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') - - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) - - return wrapper - - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) - } - return ret - } -} diff --git a/node_modules/write-file-atomic/LICENSE.md b/node_modules/write-file-atomic/LICENSE.md deleted file mode 100644 index 95e65a770..000000000 --- a/node_modules/write-file-atomic/LICENSE.md +++ /dev/null @@ -1,6 +0,0 @@ -Copyright (c) 2015, Rebecca Turner - -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. - diff --git a/node_modules/write-file-atomic/README.md b/node_modules/write-file-atomic/README.md deleted file mode 100644 index 2d9ef6024..000000000 --- a/node_modules/write-file-atomic/README.md +++ /dev/null @@ -1,91 +0,0 @@ -write-file-atomic ------------------ - -This is an extension for node's `fs.writeFile` that makes its operation -atomic and allows you set ownership (uid/gid of the file). - -### `writeFileAtomic(filename, data, [options], [callback])` - -#### Description: - -Atomically and asynchronously writes data to a file, replacing the file if it already -exists. data can be a string or a buffer. - -#### Options: -* filename **String** -* data **String** | **Buffer** -* options **Object** | **String** - * chown **Object** default, uid & gid of existing file, if any - * uid **Number** - * gid **Number** - * encoding **String** | **Null** default = 'utf8' - * fsync **Boolean** default = true - * mode **Number** default, from existing file, if any - * tmpfileCreated **Function** called when the tmpfile is created -* callback **Function** - -#### Usage: - -```js -var writeFileAtomic = require('write-file-atomic') -writeFileAtomic(filename, data, [options], [callback]) -``` - -The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`. -Note that `require('worker_threads').threadId` is used in addition to `process.pid` if running inside of a worker thread. -If writeFile completes successfully then, if passed the **chown** option it will change -the ownership of the file. Finally it renames the file back to the filename you specified. If -it encounters errors at any of these steps it will attempt to unlink the temporary file and then -pass the error back to the caller. -If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Writes to different files are still executed in parallel. - -If provided, the **chown** option requires both **uid** and **gid** properties or else -you'll get an error. If **chown** is not specified it will default to using -the owner of the previous file. To prevent chown from being ran you can -also pass `false`, in which case the file will be created with the current user's credentials. - -If **mode** is not specified, it will default to using the permissions from -an existing file, if any. Expicitly setting this to `false` remove this default, resulting -in a file created with the system default permissions. - -If options is a String, it's assumed to be the **encoding** option. The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'. - -If the **fsync** option is **false**, writeFile will skip the final fsync call. - -If the **tmpfileCreated** option is specified it will be called with the name of the tmpfile when created. - -Example: - -```javascript -writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) { - if (err) throw err; - console.log('It\'s saved!'); -}); -``` - -This function also supports async/await: - -```javascript -(async () => { - try { - await writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}); - console.log('It\'s saved!'); - } catch (err) { - console.error(err); - process.exit(1); - } -})(); -``` - -### `writeFileAtomicSync(filename, data, [options])` - -#### Description: - -The synchronous version of **writeFileAtomic**. - -#### Usage: -```js -var writeFileAtomicSync = require('write-file-atomic').sync -writeFileAtomicSync(filename, data, [options]) -``` - diff --git a/node_modules/write-file-atomic/lib/index.js b/node_modules/write-file-atomic/lib/index.js deleted file mode 100644 index 6013894cd..000000000 --- a/node_modules/write-file-atomic/lib/index.js +++ /dev/null @@ -1,267 +0,0 @@ -'use strict' -module.exports = writeFile -module.exports.sync = writeFileSync -module.exports._getTmpname = getTmpname // for testing -module.exports._cleanupOnExit = cleanupOnExit - -const fs = require('fs') -const MurmurHash3 = require('imurmurhash') -const { onExit } = require('signal-exit') -const path = require('path') -const { promisify } = require('util') -const activeFiles = {} - -// if we run inside of a worker_thread, `process.pid` is not unique -/* istanbul ignore next */ -const threadId = (function getId () { - try { - const workerThreads = require('worker_threads') - - /// if we are in main thread, this is set to `0` - return workerThreads.threadId - } catch (e) { - // worker_threads are not available, fallback to 0 - return 0 - } -})() - -let invocations = 0 -function getTmpname (filename) { - return filename + '.' + - MurmurHash3(__filename) - .hash(String(process.pid)) - .hash(String(threadId)) - .hash(String(++invocations)) - .result() -} - -function cleanupOnExit (tmpfile) { - return () => { - try { - fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) - } catch { - // ignore errors - } - } -} - -function serializeActiveFile (absoluteName) { - return new Promise(resolve => { - // make a queue if it doesn't already exist - if (!activeFiles[absoluteName]) { - activeFiles[absoluteName] = [] - } - - activeFiles[absoluteName].push(resolve) // add this job to the queue - if (activeFiles[absoluteName].length === 1) { - resolve() - } // kick off the first one - }) -} - -// https://github.com/isaacs/node-graceful-fs/blob/master/polyfills.js#L315-L342 -function isChownErrOk (err) { - if (err.code === 'ENOSYS') { - return true - } - - const nonroot = !process.getuid || process.getuid() !== 0 - if (nonroot) { - if (err.code === 'EINVAL' || err.code === 'EPERM') { - return true - } - } - - return false -} - -async function writeFileAsync (filename, data, options = {}) { - if (typeof options === 'string') { - options = { encoding: options } - } - - let fd - let tmpfile - /* istanbul ignore next -- The closure only gets called when onExit triggers */ - const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) - const absoluteName = path.resolve(filename) - - try { - await serializeActiveFile(absoluteName) - const truename = await promisify(fs.realpath)(filename).catch(() => filename) - tmpfile = getTmpname(truename) - - if (!options.mode || !options.chown) { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - const stats = await promisify(fs.stat)(truename).catch(() => {}) - if (stats) { - if (options.mode == null) { - options.mode = stats.mode - } - - if (options.chown == null && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - } - } - - fd = await promisify(fs.open)(tmpfile, 'w', options.mode) - if (options.tmpfileCreated) { - await options.tmpfileCreated(tmpfile) - } - if (ArrayBuffer.isView(data)) { - await promisify(fs.write)(fd, data, 0, data.length, 0) - } else if (data != null) { - await promisify(fs.write)(fd, String(data), 0, String(options.encoding || 'utf8')) - } - - if (options.fsync !== false) { - await promisify(fs.fsync)(fd) - } - - await promisify(fs.close)(fd) - fd = null - - if (options.chown) { - await promisify(fs.chown)(tmpfile, options.chown.uid, options.chown.gid).catch(err => { - if (!isChownErrOk(err)) { - throw err - } - }) - } - - if (options.mode) { - await promisify(fs.chmod)(tmpfile, options.mode).catch(err => { - if (!isChownErrOk(err)) { - throw err - } - }) - } - - await promisify(fs.rename)(tmpfile, truename) - } finally { - if (fd) { - await promisify(fs.close)(fd).catch( - /* istanbul ignore next */ - () => {} - ) - } - removeOnExitHandler() - await promisify(fs.unlink)(tmpfile).catch(() => {}) - activeFiles[absoluteName].shift() // remove the element added by serializeSameFile - if (activeFiles[absoluteName].length > 0) { - activeFiles[absoluteName][0]() // start next job if one is pending - } else { - delete activeFiles[absoluteName] - } - } -} - -async function writeFile (filename, data, options, callback) { - if (options instanceof Function) { - callback = options - options = {} - } - - const promise = writeFileAsync(filename, data, options) - if (callback) { - try { - const result = await promise - return callback(result) - } catch (err) { - return callback(err) - } - } - - return promise -} - -function writeFileSync (filename, data, options) { - if (typeof options === 'string') { - options = { encoding: options } - } else if (!options) { - options = {} - } - try { - filename = fs.realpathSync(filename) - } catch (ex) { - // it's ok, it'll happen on a not yet existing file - } - const tmpfile = getTmpname(filename) - - if (!options.mode || !options.chown) { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - try { - const stats = fs.statSync(filename) - options = Object.assign({}, options) - if (!options.mode) { - options.mode = stats.mode - } - if (!options.chown && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - } catch (ex) { - // ignore stat errors - } - } - - let fd - const cleanup = cleanupOnExit(tmpfile) - const removeOnExitHandler = onExit(cleanup) - - let threw = true - try { - fd = fs.openSync(tmpfile, 'w', options.mode || 0o666) - if (options.tmpfileCreated) { - options.tmpfileCreated(tmpfile) - } - if (ArrayBuffer.isView(data)) { - fs.writeSync(fd, data, 0, data.length, 0) - } else if (data != null) { - fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) - } - if (options.fsync !== false) { - fs.fsyncSync(fd) - } - - fs.closeSync(fd) - fd = null - - if (options.chown) { - try { - fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) - } catch (err) { - if (!isChownErrOk(err)) { - throw err - } - } - } - - if (options.mode) { - try { - fs.chmodSync(tmpfile, options.mode) - } catch (err) { - if (!isChownErrOk(err)) { - throw err - } - } - } - - fs.renameSync(tmpfile, filename) - threw = false - } finally { - if (fd) { - try { - fs.closeSync(fd) - } catch (ex) { - // ignore close errors at this stage, error may have closed fd already. - } - } - removeOnExitHandler() - if (threw) { - cleanup() - } - } -} diff --git a/node_modules/write-file-atomic/package.json b/node_modules/write-file-atomic/package.json deleted file mode 100644 index 54d58d7ee..000000000 --- a/node_modules/write-file-atomic/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "write-file-atomic", - "version": "5.0.1", - "description": "Write files in an atomic fashion w/configurable ownership", - "main": "./lib/index.js", - "scripts": { - "test": "tap", - "posttest": "npm run lint", - "lint": "eslint \"**/*.js\"", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "snap": "tap", - "template-oss-apply": "template-oss-apply --force" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/write-file-atomic.git" - }, - "keywords": [ - "writeFile", - "atomic" - ], - "author": "GitHub Inc.", - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/write-file-atomic/issues" - }, - "homepage": "https://github.com/npm/write-file-atomic", - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^4.0.1" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.14.1", - "tap": "^16.0.1" - }, - "files": [ - "bin/", - "lib/" - ], - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "windowsCI": false, - "version": "4.14.1", - "publish": "true" - }, - "tap": { - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - } -} diff --git a/node_modules/yallist/LICENSE b/node_modules/yallist/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/yallist/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -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. diff --git a/node_modules/yallist/README.md b/node_modules/yallist/README.md deleted file mode 100644 index f58610186..000000000 --- a/node_modules/yallist/README.md +++ /dev/null @@ -1,204 +0,0 @@ -# yallist - -Yet Another Linked List - -There are many doubly-linked list implementations like it, but this -one is mine. - -For when an array would be too big, and a Map can't be iterated in -reverse order. - - -[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) - -## basic usage - -```javascript -var yallist = require('yallist') -var myList = yallist.create([1, 2, 3]) -myList.push('foo') -myList.unshift('bar') -// of course pop() and shift() are there, too -console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] -myList.forEach(function (k) { - // walk the list head to tail -}) -myList.forEachReverse(function (k, index, list) { - // walk the list tail to head -}) -var myDoubledList = myList.map(function (k) { - return k + k -}) -// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] -// mapReverse is also a thing -var myDoubledListReverse = myList.mapReverse(function (k) { - return k + k -}) // ['foofoo', 6, 4, 2, 'barbar'] - -var reduced = myList.reduce(function (set, entry) { - set += entry - return set -}, 'start') -console.log(reduced) // 'startfoo123bar' -``` - -## api - -The whole API is considered "public". - -Functions with the same name as an Array method work more or less the -same way. - -There's reverse versions of most things because that's the point. - -### Yallist - -Default export, the class that holds and manages a list. - -Call it with either a forEach-able (like an array) or a set of -arguments, to initialize the list. - -The Array-ish methods all act like you'd expect. No magic length, -though, so if you change that it won't automatically prune or add -empty spots. - -### Yallist.create(..) - -Alias for Yallist function. Some people like factories. - -#### yallist.head - -The first node in the list - -#### yallist.tail - -The last node in the list - -#### yallist.length - -The number of nodes in the list. (Change this at your peril. It is -not magic like Array length.) - -#### yallist.toArray() - -Convert the list to an array. - -#### yallist.forEach(fn, [thisp]) - -Call a function on each item in the list. - -#### yallist.forEachReverse(fn, [thisp]) - -Call a function on each item in the list, in reverse order. - -#### yallist.get(n) - -Get the data at position `n` in the list. If you use this a lot, -probably better off just using an Array. - -#### yallist.getReverse(n) - -Get the data at position `n`, counting from the tail. - -#### yallist.map(fn, thisp) - -Create a new Yallist with the result of calling the function on each -item. - -#### yallist.mapReverse(fn, thisp) - -Same as `map`, but in reverse. - -#### yallist.pop() - -Get the data from the list tail, and remove the tail from the list. - -#### yallist.push(item, ...) - -Insert one or more items to the tail of the list. - -#### yallist.reduce(fn, initialValue) - -Like Array.reduce. - -#### yallist.reduceReverse - -Like Array.reduce, but in reverse. - -#### yallist.reverse - -Reverse the list in place. - -#### yallist.shift() - -Get the data from the list head, and remove the head from the list. - -#### yallist.slice([from], [to]) - -Just like Array.slice, but returns a new Yallist. - -#### yallist.sliceReverse([from], [to]) - -Just like yallist.slice, but the result is returned in reverse. - -#### yallist.toArray() - -Create an array representation of the list. - -#### yallist.toArrayReverse() - -Create a reversed array representation of the list. - -#### yallist.unshift(item, ...) - -Insert one or more items to the head of the list. - -#### yallist.unshiftNode(node) - -Move a Node object to the front of the list. (That is, pull it out of -wherever it lives, and make it the new head.) - -If the node belongs to a different list, then that list will remove it -first. - -#### yallist.pushNode(node) - -Move a Node object to the end of the list. (That is, pull it out of -wherever it lives, and make it the new tail.) - -If the node belongs to a list already, then that list will remove it -first. - -#### yallist.removeNode(node) - -Remove a node from the list, preserving referential integrity of head -and tail and other nodes. - -Will throw an error if you try to have a list remove a node that -doesn't belong to it. - -### Yallist.Node - -The class that holds the data and is actually the list. - -Call with `var n = new Node(value, previousNode, nextNode)` - -Note that if you do direct operations on Nodes themselves, it's very -easy to get into weird states where the list is broken. Be careful :) - -#### node.next - -The next node in the list. - -#### node.prev - -The previous node in the list. - -#### node.value - -The data the node contains. - -#### node.list - -The list to which this node belongs. (Null if it does not belong to -any list.) diff --git a/node_modules/yallist/iterator.js b/node_modules/yallist/iterator.js deleted file mode 100644 index d41c97a19..000000000 --- a/node_modules/yallist/iterator.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' -module.exports = function (Yallist) { - Yallist.prototype[Symbol.iterator] = function* () { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value - } - } -} diff --git a/node_modules/yallist/package.json b/node_modules/yallist/package.json deleted file mode 100644 index 8a083867d..000000000 --- a/node_modules/yallist/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "yallist", - "version": "4.0.0", - "description": "Yet Another Linked List", - "main": "yallist.js", - "directories": { - "test": "test" - }, - "files": [ - "yallist.js", - "iterator.js" - ], - "dependencies": {}, - "devDependencies": { - "tap": "^12.1.0" - }, - "scripts": { - "test": "tap test/*.js --100", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/yallist.git" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC" -} diff --git a/node_modules/yallist/yallist.js b/node_modules/yallist/yallist.js deleted file mode 100644 index 4e83ab1c5..000000000 --- a/node_modules/yallist/yallist.js +++ /dev/null @@ -1,426 +0,0 @@ -'use strict' -module.exports = Yallist - -Yallist.Node = Node -Yallist.create = Yallist - -function Yallist (list) { - var self = this - if (!(self instanceof Yallist)) { - self = new Yallist() - } - - self.tail = null - self.head = null - self.length = 0 - - if (list && typeof list.forEach === 'function') { - list.forEach(function (item) { - self.push(item) - }) - } else if (arguments.length > 0) { - for (var i = 0, l = arguments.length; i < l; i++) { - self.push(arguments[i]) - } - } - - return self -} - -Yallist.prototype.removeNode = function (node) { - if (node.list !== this) { - throw new Error('removing node which does not belong to this list') - } - - var next = node.next - var prev = node.prev - - if (next) { - next.prev = prev - } - - if (prev) { - prev.next = next - } - - if (node === this.head) { - this.head = next - } - if (node === this.tail) { - this.tail = prev - } - - node.list.length-- - node.next = null - node.prev = null - node.list = null - - return next -} - -Yallist.prototype.unshiftNode = function (node) { - if (node === this.head) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var head = this.head - node.list = this - node.next = head - if (head) { - head.prev = node - } - - this.head = node - if (!this.tail) { - this.tail = node - } - this.length++ -} - -Yallist.prototype.pushNode = function (node) { - if (node === this.tail) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var tail = this.tail - node.list = this - node.prev = tail - if (tail) { - tail.next = node - } - - this.tail = node - if (!this.head) { - this.head = node - } - this.length++ -} - -Yallist.prototype.push = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - push(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.unshift = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - unshift(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.pop = function () { - if (!this.tail) { - return undefined - } - - var res = this.tail.value - this.tail = this.tail.prev - if (this.tail) { - this.tail.next = null - } else { - this.head = null - } - this.length-- - return res -} - -Yallist.prototype.shift = function () { - if (!this.head) { - return undefined - } - - var res = this.head.value - this.head = this.head.next - if (this.head) { - this.head.prev = null - } else { - this.tail = null - } - this.length-- - return res -} - -Yallist.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this) - walker = walker.next - } -} - -Yallist.prototype.forEachReverse = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this) - walker = walker.prev - } -} - -Yallist.prototype.get = function (n) { - for (var i = 0, walker = this.head; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.next - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.getReverse = function (n) { - for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.prev - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.map = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.head; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.next - } - return res -} - -Yallist.prototype.mapReverse = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.tail; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.prev - } - return res -} - -Yallist.prototype.reduce = function (fn, initial) { - var acc - var walker = this.head - if (arguments.length > 1) { - acc = initial - } else if (this.head) { - walker = this.head.next - acc = this.head.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i) - walker = walker.next - } - - return acc -} - -Yallist.prototype.reduceReverse = function (fn, initial) { - var acc - var walker = this.tail - if (arguments.length > 1) { - acc = initial - } else if (this.tail) { - walker = this.tail.prev - acc = this.tail.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i) - walker = walker.prev - } - - return acc -} - -Yallist.prototype.toArray = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.head; walker !== null; i++) { - arr[i] = walker.value - walker = walker.next - } - return arr -} - -Yallist.prototype.toArrayReverse = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr[i] = walker.value - walker = walker.prev - } - return arr -} - -Yallist.prototype.slice = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next - } - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.sliceReverse = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { - walker = walker.prev - } - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.splice = function (start, deleteCount, ...nodes) { - if (start > this.length) { - start = this.length - 1 - } - if (start < 0) { - start = this.length + start; - } - - for (var i = 0, walker = this.head; walker !== null && i < start; i++) { - walker = walker.next - } - - var ret = [] - for (var i = 0; walker && i < deleteCount; i++) { - ret.push(walker.value) - walker = this.removeNode(walker) - } - if (walker === null) { - walker = this.tail - } - - if (walker !== this.head && walker !== this.tail) { - walker = walker.prev - } - - for (var i = 0; i < nodes.length; i++) { - walker = insert(this, walker, nodes[i]) - } - return ret; -} - -Yallist.prototype.reverse = function () { - var head = this.head - var tail = this.tail - for (var walker = head; walker !== null; walker = walker.prev) { - var p = walker.prev - walker.prev = walker.next - walker.next = p - } - this.head = tail - this.tail = head - return this -} - -function insert (self, node, value) { - var inserted = node === self.head ? - new Node(value, null, node, self) : - new Node(value, node, node.next, self) - - if (inserted.next === null) { - self.tail = inserted - } - if (inserted.prev === null) { - self.head = inserted - } - - self.length++ - - return inserted -} - -function push (self, item) { - self.tail = new Node(item, self.tail, null, self) - if (!self.head) { - self.head = self.tail - } - self.length++ -} - -function unshift (self, item) { - self.head = new Node(item, null, self.head, self) - if (!self.tail) { - self.tail = self.head - } - self.length++ -} - -function Node (value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list) - } - - this.list = list - this.value = value - - if (prev) { - prev.next = this - this.prev = prev - } else { - this.prev = null - } - - if (next) { - next.prev = this - this.next = next - } else { - this.next = null - } -} - -try { - // add if support for Symbol.iterator is present - require('./iterator.js')(Yallist) -} catch (er) {} diff --git a/node_modules/yargs-parser/CHANGELOG.md b/node_modules/yargs-parser/CHANGELOG.md deleted file mode 100644 index 2aad0acbd..000000000 --- a/node_modules/yargs-parser/CHANGELOG.md +++ /dev/null @@ -1,263 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -### [20.2.9](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.8...yargs-parser-v20.2.9) (2021-06-20) - - -### Bug Fixes - -* **build:** fixed automated release pipeline ([1fe9135](https://www.github.com/yargs/yargs-parser/commit/1fe9135884790a083615419b2861683e2597dac3)) - -### [20.2.8](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.7...yargs-parser-v20.2.8) (2021-06-20) - - -### Bug Fixes - -* **locale:** Turkish camelize and decamelize issues with toLocaleLowerCase/toLocaleUpperCase ([2617303](https://www.github.com/yargs/yargs-parser/commit/261730383e02448562f737b94bbd1f164aed5143)) -* **perf:** address slow parse when using unknown-options-as-args ([#394](https://www.github.com/yargs/yargs-parser/issues/394)) ([441f059](https://www.github.com/yargs/yargs-parser/commit/441f059d585d446551068ad213db79ac91daf83a)) -* **string-utils:** detect [0,1] ranged values as numbers ([#388](https://www.github.com/yargs/yargs-parser/issues/388)) ([efcc32c](https://www.github.com/yargs/yargs-parser/commit/efcc32c2d6b09aba31abfa2db9bd947befe5586b)) - -### [20.2.7](https://www.github.com/yargs/yargs-parser/compare/v20.2.6...v20.2.7) (2021-03-10) - - -### Bug Fixes - -* **deno:** force release for Deno ([6687c97](https://www.github.com/yargs/yargs-parser/commit/6687c972d0f3ca7865a97908dde3080b05f8b026)) - -### [20.2.6](https://www.github.com/yargs/yargs-parser/compare/v20.2.5...v20.2.6) (2021-02-22) - - -### Bug Fixes - -* **populate--:** -- should always be array ([#354](https://www.github.com/yargs/yargs-parser/issues/354)) ([585ae8f](https://www.github.com/yargs/yargs-parser/commit/585ae8ffad74cc02974f92d788e750137fd65146)) - -### [20.2.5](https://www.github.com/yargs/yargs-parser/compare/v20.2.4...v20.2.5) (2021-02-13) - - -### Bug Fixes - -* do not lowercase camel cased string ([#348](https://www.github.com/yargs/yargs-parser/issues/348)) ([5f4da1f](https://www.github.com/yargs/yargs-parser/commit/5f4da1f17d9d50542d2aaa206c9806ce3e320335)) - -### [20.2.4](https://www.github.com/yargs/yargs-parser/compare/v20.2.3...v20.2.4) (2020-11-09) - - -### Bug Fixes - -* **deno:** address import issues in Deno ([#339](https://www.github.com/yargs/yargs-parser/issues/339)) ([3b54e5e](https://www.github.com/yargs/yargs-parser/commit/3b54e5eef6e9a7b7c6eec7c12bab3ba3b8ba8306)) - -### [20.2.3](https://www.github.com/yargs/yargs-parser/compare/v20.2.2...v20.2.3) (2020-10-16) - - -### Bug Fixes - -* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#336](https://www.github.com/yargs/yargs-parser/issues/336)) ([3ae7242](https://www.github.com/yargs/yargs-parser/commit/3ae7242040ff876d28dabded60ac226e00150c88)) - -### [20.2.2](https://www.github.com/yargs/yargs-parser/compare/v20.2.1...v20.2.2) (2020-10-14) - - -### Bug Fixes - -* **exports:** node 13.0-13.6 require a string fallback ([#333](https://www.github.com/yargs/yargs-parser/issues/333)) ([291aeda](https://www.github.com/yargs/yargs-parser/commit/291aeda06b685b7a015d83bdf2558e180b37388d)) - -### [20.2.1](https://www.github.com/yargs/yargs-parser/compare/v20.2.0...v20.2.1) (2020-10-01) - - -### Bug Fixes - -* **deno:** update types for deno ^1.4.0 ([#330](https://www.github.com/yargs/yargs-parser/issues/330)) ([0ab92e5](https://www.github.com/yargs/yargs-parser/commit/0ab92e50b090f11196334c048c9c92cecaddaf56)) - -## [20.2.0](https://www.github.com/yargs/yargs-parser/compare/v20.1.0...v20.2.0) (2020-09-21) - - -### Features - -* **string-utils:** export looksLikeNumber helper ([#324](https://www.github.com/yargs/yargs-parser/issues/324)) ([c8580a2](https://www.github.com/yargs/yargs-parser/commit/c8580a2327b55f6342acecb6e72b62963d506750)) - - -### Bug Fixes - -* **unknown-options-as-args:** convert positionals that look like numbers ([#326](https://www.github.com/yargs/yargs-parser/issues/326)) ([f85ebb4](https://www.github.com/yargs/yargs-parser/commit/f85ebb4face9d4b0f56147659404cbe0002f3dad)) - -## [20.1.0](https://www.github.com/yargs/yargs-parser/compare/v20.0.0...v20.1.0) (2020-09-20) - - -### Features - -* adds parse-positional-numbers configuration ([#321](https://www.github.com/yargs/yargs-parser/issues/321)) ([9cec00a](https://www.github.com/yargs/yargs-parser/commit/9cec00a622251292ffb7dce6f78f5353afaa0d4c)) - - -### Bug Fixes - -* **build:** update release-please; make labels kick off builds ([#323](https://www.github.com/yargs/yargs-parser/issues/323)) ([09f448b](https://www.github.com/yargs/yargs-parser/commit/09f448b4cd66e25d2872544718df46dab8af062a)) - -## [20.0.0](https://www.github.com/yargs/yargs-parser/compare/v19.0.4...v20.0.0) (2020-09-09) - - -### ⚠ BREAKING CHANGES - -* do not ship type definitions (#318) - -### Bug Fixes - -* only strip camel case if hyphenated ([#316](https://www.github.com/yargs/yargs-parser/issues/316)) ([95a9e78](https://www.github.com/yargs/yargs-parser/commit/95a9e785127b9bbf2d1db1f1f808ca1fb100e82a)), closes [#315](https://www.github.com/yargs/yargs-parser/issues/315) - - -### Code Refactoring - -* do not ship type definitions ([#318](https://www.github.com/yargs/yargs-parser/issues/318)) ([8fbd56f](https://www.github.com/yargs/yargs-parser/commit/8fbd56f1d0b6c44c30fca62708812151ca0ce330)) - -### [19.0.4](https://www.github.com/yargs/yargs-parser/compare/v19.0.3...v19.0.4) (2020-08-27) - - -### Bug Fixes - -* **build:** fixing publication ([#310](https://www.github.com/yargs/yargs-parser/issues/310)) ([5d3c6c2](https://www.github.com/yargs/yargs-parser/commit/5d3c6c29a9126248ba601920d9cf87c78e161ff5)) - -### [19.0.3](https://www.github.com/yargs/yargs-parser/compare/v19.0.2...v19.0.3) (2020-08-27) - - -### Bug Fixes - -* **build:** switch to action for publish ([#308](https://www.github.com/yargs/yargs-parser/issues/308)) ([5c2f305](https://www.github.com/yargs/yargs-parser/commit/5c2f30585342bcd8aaf926407c863099d256d174)) - -### [19.0.2](https://www.github.com/yargs/yargs-parser/compare/v19.0.1...v19.0.2) (2020-08-27) - - -### Bug Fixes - -* **types:** envPrefix should be optional ([#305](https://www.github.com/yargs/yargs-parser/issues/305)) ([ae3f180](https://www.github.com/yargs/yargs-parser/commit/ae3f180e14df2de2fd962145f4518f9aa0e76523)) - -### [19.0.1](https://www.github.com/yargs/yargs-parser/compare/v19.0.0...v19.0.1) (2020-08-09) - - -### Bug Fixes - -* **build:** push tag created for deno ([2186a14](https://www.github.com/yargs/yargs-parser/commit/2186a14989749887d56189867602e39e6679f8b0)) - -## [19.0.0](https://www.github.com/yargs/yargs-parser/compare/v18.1.3...v19.0.0) (2020-08-09) - - -### ⚠ BREAKING CHANGES - -* adds support for ESM and Deno (#295) -* **ts:** projects using `@types/yargs-parser` may see variations in type definitions. -* drops Node 6. begin following Node.js LTS schedule (#278) - -### Features - -* adds support for ESM and Deno ([#295](https://www.github.com/yargs/yargs-parser/issues/295)) ([195bc4a](https://www.github.com/yargs/yargs-parser/commit/195bc4a7f20c2a8f8e33fbb6ba96ef6e9a0120a1)) -* expose camelCase and decamelize helpers ([#296](https://www.github.com/yargs/yargs-parser/issues/296)) ([39154ce](https://www.github.com/yargs/yargs-parser/commit/39154ceb5bdcf76b5f59a9219b34cedb79b67f26)) -* **deps:** update to latest camelcase/decamelize ([#281](https://www.github.com/yargs/yargs-parser/issues/281)) ([8931ab0](https://www.github.com/yargs/yargs-parser/commit/8931ab08f686cc55286f33a95a83537da2be5516)) - - -### Bug Fixes - -* boolean numeric short option ([#294](https://www.github.com/yargs/yargs-parser/issues/294)) ([f600082](https://www.github.com/yargs/yargs-parser/commit/f600082c959e092076caf420bbbc9d7a231e2418)) -* raise permission error for Deno if config load fails ([#298](https://www.github.com/yargs/yargs-parser/issues/298)) ([1174e2b](https://www.github.com/yargs/yargs-parser/commit/1174e2b3f0c845a1cd64e14ffc3703e730567a84)) -* **deps:** update dependency decamelize to v3 ([#274](https://www.github.com/yargs/yargs-parser/issues/274)) ([4d98698](https://www.github.com/yargs/yargs-parser/commit/4d98698bc6767e84ec54a0842908191739be73b7)) -* **types:** switch back to using Partial types ([#293](https://www.github.com/yargs/yargs-parser/issues/293)) ([bdc80ba](https://www.github.com/yargs/yargs-parser/commit/bdc80ba59fa13bc3025ce0a85e8bad9f9da24ea7)) - - -### Build System - -* drops Node 6. begin following Node.js LTS schedule ([#278](https://www.github.com/yargs/yargs-parser/issues/278)) ([9014ed7](https://www.github.com/yargs/yargs-parser/commit/9014ed722a32768b96b829e65a31705db5c1458a)) - - -### Code Refactoring - -* **ts:** move index.js to TypeScript ([#292](https://www.github.com/yargs/yargs-parser/issues/292)) ([f78d2b9](https://www.github.com/yargs/yargs-parser/commit/f78d2b97567ac4828624406e420b4047c710b789)) - -### [18.1.3](https://www.github.com/yargs/yargs-parser/compare/v18.1.2...v18.1.3) (2020-04-16) - - -### Bug Fixes - -* **setArg:** options using camel-case and dot-notation populated twice ([#268](https://www.github.com/yargs/yargs-parser/issues/268)) ([f7e15b9](https://www.github.com/yargs/yargs-parser/commit/f7e15b9800900b9856acac1a830a5f35847be73e)) - -### [18.1.2](https://www.github.com/yargs/yargs-parser/compare/v18.1.1...v18.1.2) (2020-03-26) - - -### Bug Fixes - -* **array, nargs:** support -o=--value and --option=--value format ([#262](https://www.github.com/yargs/yargs-parser/issues/262)) ([41d3f81](https://www.github.com/yargs/yargs-parser/commit/41d3f8139e116706b28de9b0de3433feb08d2f13)) - -### [18.1.1](https://www.github.com/yargs/yargs-parser/compare/v18.1.0...v18.1.1) (2020-03-16) - - -### Bug Fixes - -* \_\_proto\_\_ will now be replaced with \_\_\_proto\_\_\_ in parse ([#258](https://www.github.com/yargs/yargs-parser/issues/258)), patching a potential -prototype pollution vulnerability. This was reported by the Snyk Security Research Team.([63810ca](https://www.github.com/yargs/yargs-parser/commit/63810ca1ae1a24b08293a4d971e70e058c7a41e2)) - -## [18.1.0](https://www.github.com/yargs/yargs-parser/compare/v18.0.0...v18.1.0) (2020-03-07) - - -### Features - -* introduce single-digit boolean aliases ([#255](https://www.github.com/yargs/yargs-parser/issues/255)) ([9c60265](https://www.github.com/yargs/yargs-parser/commit/9c60265fd7a03cb98e6df3e32c8c5e7508d9f56f)) - -## [18.0.0](https://www.github.com/yargs/yargs-parser/compare/v17.1.0...v18.0.0) (2020-03-02) - - -### ⚠ BREAKING CHANGES - -* the narg count is now enforced when parsing arrays. - -### Features - -* NaN can now be provided as a value for nargs, indicating "at least" one value is expected for array ([#251](https://www.github.com/yargs/yargs-parser/issues/251)) ([9db4be8](https://www.github.com/yargs/yargs-parser/commit/9db4be81417a2c7097128db34d86fe70ef4af70c)) - -## [17.1.0](https://www.github.com/yargs/yargs-parser/compare/v17.0.1...v17.1.0) (2020-03-01) - - -### Features - -* introduce greedy-arrays config, for specifying whether arrays consume multiple positionals ([#249](https://www.github.com/yargs/yargs-parser/issues/249)) ([60e880a](https://www.github.com/yargs/yargs-parser/commit/60e880a837046314d89fa4725f923837fd33a9eb)) - -### [17.0.1](https://www.github.com/yargs/yargs-parser/compare/v17.0.0...v17.0.1) (2020-02-29) - - -### Bug Fixes - -* normalized keys were not enumerable ([#247](https://www.github.com/yargs/yargs-parser/issues/247)) ([57119f9](https://www.github.com/yargs/yargs-parser/commit/57119f9f17cf27499bd95e61c2f72d18314f11ba)) - -## [17.0.0](https://www.github.com/yargs/yargs-parser/compare/v16.1.0...v17.0.0) (2020-02-10) - - -### ⚠ BREAKING CHANGES - -* this reverts parsing behavior of booleans to that of yargs@14 -* objects used during parsing are now created with a null -prototype. There may be some scenarios where this change in behavior -leaks externally. - -### Features - -* boolean arguments will not be collected into an implicit array ([#236](https://www.github.com/yargs/yargs-parser/issues/236)) ([34c4e19](https://www.github.com/yargs/yargs-parser/commit/34c4e19bae4e7af63e3cb6fa654a97ed476e5eb5)) -* introduce nargs-eats-options config option ([#246](https://www.github.com/yargs/yargs-parser/issues/246)) ([d50822a](https://www.github.com/yargs/yargs-parser/commit/d50822ac10e1b05f2e9643671ca131ac251b6732)) - - -### Bug Fixes - -* address bugs with "uknown-options-as-args" ([bc023e3](https://www.github.com/yargs/yargs-parser/commit/bc023e3b13e20a118353f9507d1c999bf388a346)) -* array should take precedence over nargs, but enforce nargs ([#243](https://www.github.com/yargs/yargs-parser/issues/243)) ([4cbc188](https://www.github.com/yargs/yargs-parser/commit/4cbc188b7abb2249529a19c090338debdad2fe6c)) -* support keys that collide with object prototypes ([#234](https://www.github.com/yargs/yargs-parser/issues/234)) ([1587b6d](https://www.github.com/yargs/yargs-parser/commit/1587b6d91db853a9109f1be6b209077993fee4de)) -* unknown options terminated with digits now handled by unknown-options-as-args ([#238](https://www.github.com/yargs/yargs-parser/issues/238)) ([d36cdfa](https://www.github.com/yargs/yargs-parser/commit/d36cdfa854254d7c7e0fe1d583818332ac46c2a5)) - -## [16.1.0](https://www.github.com/yargs/yargs-parser/compare/v16.0.0...v16.1.0) (2019-11-01) - - -### ⚠ BREAKING CHANGES - -* populate error if incompatible narg/count or array/count options are used (#191) - -### Features - -* options that have had their default value used are now tracked ([#211](https://www.github.com/yargs/yargs-parser/issues/211)) ([a525234](https://www.github.com/yargs/yargs-parser/commit/a525234558c847deedd73f8792e0a3b77b26e2c0)) -* populate error if incompatible narg/count or array/count options are used ([#191](https://www.github.com/yargs/yargs-parser/issues/191)) ([84a401f](https://www.github.com/yargs/yargs-parser/commit/84a401f0fa3095e0a19661670d1570d0c3b9d3c9)) - - -### Reverts - -* revert 16.0.0 CHANGELOG entry ([920320a](https://www.github.com/yargs/yargs-parser/commit/920320ad9861bbfd58eda39221ae211540fc1daf)) diff --git a/node_modules/yargs-parser/LICENSE.txt b/node_modules/yargs-parser/LICENSE.txt deleted file mode 100644 index 836440bef..000000000 --- a/node_modules/yargs-parser/LICENSE.txt +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) 2016, Contributors - -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. diff --git a/node_modules/yargs-parser/README.md b/node_modules/yargs-parser/README.md deleted file mode 100644 index 261484076..000000000 --- a/node_modules/yargs-parser/README.md +++ /dev/null @@ -1,518 +0,0 @@ -# yargs-parser - -![ci](https://github.com/yargs/yargs-parser/workflows/ci/badge.svg) -[![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser) -[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) -![nycrc config on GitHub](https://img.shields.io/nycrc/yargs/yargs-parser) - -The mighty option parser used by [yargs](https://github.com/yargs/yargs). - -visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions. - - - -## Example - -```sh -npm i yargs-parser --save -``` - -```js -const argv = require('yargs-parser')(process.argv.slice(2)) -console.log(argv) -``` - -```console -$ node example.js --foo=33 --bar hello -{ _: [], foo: 33, bar: 'hello' } -``` - -_or parse a string!_ - -```js -const argv = require('yargs-parser')('--foo=99 --bar=33') -console.log(argv) -``` - -```console -{ _: [], foo: 99, bar: 33 } -``` - -Convert an array of mixed types before passing to `yargs-parser`: - -```js -const parse = require('yargs-parser') -parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string -parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings -``` - -## Deno Example - -As of `v19` `yargs-parser` supports [Deno](https://github.com/denoland/deno): - -```typescript -import parser from "https://deno.land/x/yargs_parser/deno.ts"; - -const argv = parser('--foo=99 --bar=9987930', { - string: ['bar'] -}) -console.log(argv) -``` - -## ESM Example - -As of `v19` `yargs-parser` supports ESM (_both in Node.js and in the browser_): - -**Node.js:** - -```js -import parser from 'yargs-parser' - -const argv = parser('--foo=99 --bar=9987930', { - string: ['bar'] -}) -console.log(argv) -``` - -**Browsers:** - -```html - - - - -``` - -## API - -### parser(args, opts={}) - -Parses command line arguments returning a simple mapping of keys and values. - -**expects:** - -* `args`: a string or array of strings representing the options to parse. -* `opts`: provide a set of hints indicating how `args` should be parsed: - * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`. - * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.
- Indicate that keys should be parsed as an array and coerced to booleans / numbers:
- `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`. - * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`. - * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided - (or throws an error). For arrays the function is called only once for the entire array:
- `{coerce: {foo: function (arg) {return modifiedArg}}}`. - * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). - * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:
- `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`. - * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). - * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`. - * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`. - * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed. - * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`. - * `opts.normalize`: `path.normalize()` will be applied to values set to this key. - * `opts.number`: keys should be treated as numbers. - * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). - -**returns:** - -* `obj`: an object representing the parsed value of `args` - * `key/value`: key value pairs for each argument and their aliases. - * `_`: an array representing the positional arguments. - * [optional] `--`: an array with arguments after the end-of-options flag `--`. - -### require('yargs-parser').detailed(args, opts={}) - -Parses a command line string, returning detailed information required by the -yargs engine. - -**expects:** - -* `args`: a string or array of strings representing options to parse. -* `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`. - -**returns:** - -* `argv`: an object representing the parsed value of `args` - * `key/value`: key value pairs for each argument and their aliases. - * `_`: an array representing the positional arguments. - * [optional] `--`: an array with arguments after the end-of-options flag `--`. -* `error`: populated with an error object if an exception occurred during parsing. -* `aliases`: the inferred list of aliases built by combining lists in `opts.alias`. -* `newAliases`: any new aliases added via camel-case expansion: - * `boolean`: `{ fooBar: true }` -* `defaulted`: any new argument created by `opts.default`, no aliases included. - * `boolean`: `{ foo: true }` -* `configuration`: given by default settings and `opts.configuration`. - - - -### Configuration - -The yargs-parser applies several automated transformations on the keys provided -in `args`. These features can be turned on and off using the `configuration` field -of `opts`. - -```js -var parsed = parser(['--no-dice'], { - configuration: { - 'boolean-negation': false - } -}) -``` - -### short option groups - -* default: `true`. -* key: `short-option-groups`. - -Should a group of short-options be treated as boolean flags? - -```console -$ node example.js -abc -{ _: [], a: true, b: true, c: true } -``` - -_if disabled:_ - -```console -$ node example.js -abc -{ _: [], abc: true } -``` - -### camel-case expansion - -* default: `true`. -* key: `camel-case-expansion`. - -Should hyphenated arguments be expanded into camel-case aliases? - -```console -$ node example.js --foo-bar -{ _: [], 'foo-bar': true, fooBar: true } -``` - -_if disabled:_ - -```console -$ node example.js --foo-bar -{ _: [], 'foo-bar': true } -``` - -### dot-notation - -* default: `true` -* key: `dot-notation` - -Should keys that contain `.` be treated as objects? - -```console -$ node example.js --foo.bar -{ _: [], foo: { bar: true } } -``` - -_if disabled:_ - -```console -$ node example.js --foo.bar -{ _: [], "foo.bar": true } -``` - -### parse numbers - -* default: `true` -* key: `parse-numbers` - -Should keys that look like numbers be treated as such? - -```console -$ node example.js --foo=99.3 -{ _: [], foo: 99.3 } -``` - -_if disabled:_ - -```console -$ node example.js --foo=99.3 -{ _: [], foo: "99.3" } -``` - -### parse positional numbers - -* default: `true` -* key: `parse-positional-numbers` - -Should positional keys that look like numbers be treated as such. - -```console -$ node example.js 99.3 -{ _: [99.3] } -``` - -_if disabled:_ - -```console -$ node example.js 99.3 -{ _: ['99.3'] } -``` - -### boolean negation - -* default: `true` -* key: `boolean-negation` - -Should variables prefixed with `--no` be treated as negations? - -```console -$ node example.js --no-foo -{ _: [], foo: false } -``` - -_if disabled:_ - -```console -$ node example.js --no-foo -{ _: [], "no-foo": true } -``` - -### combine arrays - -* default: `false` -* key: `combine-arrays` - -Should arrays be combined when provided by both command line arguments and -a configuration file. - -### duplicate arguments array - -* default: `true` -* key: `duplicate-arguments-array` - -Should arguments be coerced into an array when duplicated: - -```console -$ node example.js -x 1 -x 2 -{ _: [], x: [1, 2] } -``` - -_if disabled:_ - -```console -$ node example.js -x 1 -x 2 -{ _: [], x: 2 } -``` - -### flatten duplicate arrays - -* default: `true` -* key: `flatten-duplicate-arrays` - -Should array arguments be coerced into a single array when duplicated: - -```console -$ node example.js -x 1 2 -x 3 4 -{ _: [], x: [1, 2, 3, 4] } -``` - -_if disabled:_ - -```console -$ node example.js -x 1 2 -x 3 4 -{ _: [], x: [[1, 2], [3, 4]] } -``` - -### greedy arrays - -* default: `true` -* key: `greedy-arrays` - -Should arrays consume more than one positional argument following their flag. - -```console -$ node example --arr 1 2 -{ _: [], arr: [1, 2] } -``` - -_if disabled:_ - -```console -$ node example --arr 1 2 -{ _: [2], arr: [1] } -``` - -**Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.** - -### nargs eats options - -* default: `false` -* key: `nargs-eats-options` - -Should nargs consume dash options as well as positional arguments. - -### negation prefix - -* default: `no-` -* key: `negation-prefix` - -The prefix to use for negated boolean variables. - -```console -$ node example.js --no-foo -{ _: [], foo: false } -``` - -_if set to `quux`:_ - -```console -$ node example.js --quuxfoo -{ _: [], foo: false } -``` - -### populate -- - -* default: `false`. -* key: `populate--` - -Should unparsed flags be stored in `--` or `_`. - -_If disabled:_ - -```console -$ node example.js a -b -- x y -{ _: [ 'a', 'x', 'y' ], b: true } -``` - -_If enabled:_ - -```console -$ node example.js a -b -- x y -{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true } -``` - -### set placeholder key - -* default: `false`. -* key: `set-placeholder-key`. - -Should a placeholder be added for keys not set via the corresponding CLI argument? - -_If disabled:_ - -```console -$ node example.js -a 1 -c 2 -{ _: [], a: 1, c: 2 } -``` - -_If enabled:_ - -```console -$ node example.js -a 1 -c 2 -{ _: [], a: 1, b: undefined, c: 2 } -``` - -### halt at non-option - -* default: `false`. -* key: `halt-at-non-option`. - -Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line. - -_If disabled:_ - -```console -$ node example.js -a run b -x y -{ _: [ 'b' ], a: 'run', x: 'y' } -``` - -_If enabled:_ - -```console -$ node example.js -a run b -x y -{ _: [ 'b', '-x', 'y' ], a: 'run' } -``` - -### strip aliased - -* default: `false` -* key: `strip-aliased` - -Should aliases be removed before returning results? - -_If disabled:_ - -```console -$ node example.js --test-field 1 -{ _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 } -``` - -_If enabled:_ - -```console -$ node example.js --test-field 1 -{ _: [], 'test-field': 1, testField: 1 } -``` - -### strip dashed - -* default: `false` -* key: `strip-dashed` - -Should dashed keys be removed before returning results? This option has no effect if -`camel-case-expansion` is disabled. - -_If disabled:_ - -```console -$ node example.js --test-field 1 -{ _: [], 'test-field': 1, testField: 1 } -``` - -_If enabled:_ - -```console -$ node example.js --test-field 1 -{ _: [], testField: 1 } -``` - -### unknown options as args - -* default: `false` -* key: `unknown-options-as-args` - -Should unknown options be treated like regular arguments? An unknown option is one that is not -configured in `opts`. - -_If disabled_ - -```console -$ node example.js --unknown-option --known-option 2 --string-option --unknown-option2 -{ _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true } -``` - -_If enabled_ - -```console -$ node example.js --unknown-option --known-option 2 --string-option --unknown-option2 -{ _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' } -``` - -## Supported Node.js Versions - -Libraries in this ecosystem make a best effort to track -[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a -post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). - -## Special Thanks - -The yargs project evolves from optimist and minimist. It owes its -existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/ - -## License - -ISC diff --git a/node_modules/yargs-parser/browser.js b/node_modules/yargs-parser/browser.js deleted file mode 100644 index 241202c7e..000000000 --- a/node_modules/yargs-parser/browser.js +++ /dev/null @@ -1,29 +0,0 @@ -// Main entrypoint for ESM web browser environments. Avoids using Node.js -// specific libraries, such as "path". -// -// TODO: figure out reasonable web equivalents for "resolve", "normalize", etc. -import { camelCase, decamelize, looksLikeNumber } from './build/lib/string-utils.js' -import { YargsParser } from './build/lib/yargs-parser.js' -const parser = new YargsParser({ - cwd: () => { return '' }, - format: (str, arg) => { return str.replace('%s', arg) }, - normalize: (str) => { return str }, - resolve: (str) => { return str }, - require: () => { - throw Error('loading config from files not currently supported in browser') - }, - env: () => {} -}) - -const yargsParser = function Parser (args, opts) { - const result = parser.parse(args.slice(), opts) - return result.argv -} -yargsParser.detailed = function (args, opts) { - return parser.parse(args.slice(), opts) -} -yargsParser.camelCase = camelCase -yargsParser.decamelize = decamelize -yargsParser.looksLikeNumber = looksLikeNumber - -export default yargsParser diff --git a/node_modules/yargs-parser/build/index.cjs b/node_modules/yargs-parser/build/index.cjs deleted file mode 100644 index 33b5ebd49..000000000 --- a/node_modules/yargs-parser/build/index.cjs +++ /dev/null @@ -1,1042 +0,0 @@ -'use strict'; - -var util = require('util'); -var fs = require('fs'); -var path = require('path'); - -function camelCase(str) { - const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase(); - if (!isCamelCase) { - str = str.toLowerCase(); - } - if (str.indexOf('-') === -1 && str.indexOf('_') === -1) { - return str; - } - else { - let camelcase = ''; - let nextChrUpper = false; - const leadingHyphens = str.match(/^-+/); - for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) { - let chr = str.charAt(i); - if (nextChrUpper) { - nextChrUpper = false; - chr = chr.toUpperCase(); - } - if (i !== 0 && (chr === '-' || chr === '_')) { - nextChrUpper = true; - } - else if (chr !== '-' && chr !== '_') { - camelcase += chr; - } - } - return camelcase; - } -} -function decamelize(str, joinString) { - const lowercase = str.toLowerCase(); - joinString = joinString || '-'; - let notCamelcase = ''; - for (let i = 0; i < str.length; i++) { - const chrLower = lowercase.charAt(i); - const chrString = str.charAt(i); - if (chrLower !== chrString && i > 0) { - notCamelcase += `${joinString}${lowercase.charAt(i)}`; - } - else { - notCamelcase += chrString; - } - } - return notCamelcase; -} -function looksLikeNumber(x) { - if (x === null || x === undefined) - return false; - if (typeof x === 'number') - return true; - if (/^0x[0-9a-f]+$/i.test(x)) - return true; - if (/^0[^.]/.test(x)) - return false; - return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} - -function tokenizeArgString(argString) { - if (Array.isArray(argString)) { - return argString.map(e => typeof e !== 'string' ? e + '' : e); - } - argString = argString.trim(); - let i = 0; - let prevC = null; - let c = null; - let opening = null; - const args = []; - for (let ii = 0; ii < argString.length; ii++) { - prevC = c; - c = argString.charAt(ii); - if (c === ' ' && !opening) { - if (!(prevC === ' ')) { - i++; - } - continue; - } - if (c === opening) { - opening = null; - } - else if ((c === "'" || c === '"') && !opening) { - opening = c; - } - if (!args[i]) - args[i] = ''; - args[i] += c; - } - return args; -} - -var DefaultValuesForTypeKey; -(function (DefaultValuesForTypeKey) { - DefaultValuesForTypeKey["BOOLEAN"] = "boolean"; - DefaultValuesForTypeKey["STRING"] = "string"; - DefaultValuesForTypeKey["NUMBER"] = "number"; - DefaultValuesForTypeKey["ARRAY"] = "array"; -})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); - -let mixin; -class YargsParser { - constructor(_mixin) { - mixin = _mixin; - } - parse(argsInput, options) { - const opts = Object.assign({ - alias: undefined, - array: undefined, - boolean: undefined, - config: undefined, - configObjects: undefined, - configuration: undefined, - coerce: undefined, - count: undefined, - default: undefined, - envPrefix: undefined, - narg: undefined, - normalize: undefined, - string: undefined, - number: undefined, - __: undefined, - key: undefined - }, options); - const args = tokenizeArgString(argsInput); - const aliases = combineAliases(Object.assign(Object.create(null), opts.alias)); - const configuration = Object.assign({ - 'boolean-negation': true, - 'camel-case-expansion': true, - 'combine-arrays': false, - 'dot-notation': true, - 'duplicate-arguments-array': true, - 'flatten-duplicate-arrays': true, - 'greedy-arrays': true, - 'halt-at-non-option': false, - 'nargs-eats-options': false, - 'negation-prefix': 'no-', - 'parse-numbers': true, - 'parse-positional-numbers': true, - 'populate--': false, - 'set-placeholder-key': false, - 'short-option-groups': true, - 'strip-aliased': false, - 'strip-dashed': false, - 'unknown-options-as-args': false - }, opts.configuration); - const defaults = Object.assign(Object.create(null), opts.default); - const configObjects = opts.configObjects || []; - const envPrefix = opts.envPrefix; - const notFlagsOption = configuration['populate--']; - const notFlagsArgv = notFlagsOption ? '--' : '_'; - const newAliases = Object.create(null); - const defaulted = Object.create(null); - const __ = opts.__ || mixin.format; - const flags = { - aliases: Object.create(null), - arrays: Object.create(null), - bools: Object.create(null), - strings: Object.create(null), - numbers: Object.create(null), - counts: Object.create(null), - normalize: Object.create(null), - configs: Object.create(null), - nargs: Object.create(null), - coercions: Object.create(null), - keys: [] - }; - const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; - const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)'); - [].concat(opts.array || []).filter(Boolean).forEach(function (opt) { - const key = typeof opt === 'object' ? opt.key : opt; - const assignment = Object.keys(opt).map(function (key) { - const arrayFlagKeys = { - boolean: 'bools', - string: 'strings', - number: 'numbers' - }; - return arrayFlagKeys[key]; - }).filter(Boolean).pop(); - if (assignment) { - flags[assignment][key] = true; - } - flags.arrays[key] = true; - flags.keys.push(key); - }); - [].concat(opts.boolean || []).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - flags.keys.push(key); - }); - [].concat(opts.string || []).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - flags.keys.push(key); - }); - [].concat(opts.number || []).filter(Boolean).forEach(function (key) { - flags.numbers[key] = true; - flags.keys.push(key); - }); - [].concat(opts.count || []).filter(Boolean).forEach(function (key) { - flags.counts[key] = true; - flags.keys.push(key); - }); - [].concat(opts.normalize || []).filter(Boolean).forEach(function (key) { - flags.normalize[key] = true; - flags.keys.push(key); - }); - if (typeof opts.narg === 'object') { - Object.entries(opts.narg).forEach(([key, value]) => { - if (typeof value === 'number') { - flags.nargs[key] = value; - flags.keys.push(key); - } - }); - } - if (typeof opts.coerce === 'object') { - Object.entries(opts.coerce).forEach(([key, value]) => { - if (typeof value === 'function') { - flags.coercions[key] = value; - flags.keys.push(key); - } - }); - } - if (typeof opts.config !== 'undefined') { - if (Array.isArray(opts.config) || typeof opts.config === 'string') { - [].concat(opts.config).filter(Boolean).forEach(function (key) { - flags.configs[key] = true; - }); - } - else if (typeof opts.config === 'object') { - Object.entries(opts.config).forEach(([key, value]) => { - if (typeof value === 'boolean' || typeof value === 'function') { - flags.configs[key] = value; - } - }); - } - } - extendAliases(opts.key, aliases, opts.default, flags.arrays); - Object.keys(defaults).forEach(function (key) { - (flags.aliases[key] || []).forEach(function (alias) { - defaults[alias] = defaults[key]; - }); - }); - let error = null; - checkConfiguration(); - let notFlags = []; - const argv = Object.assign(Object.create(null), { _: [] }); - const argvReturn = {}; - for (let i = 0; i < args.length; i++) { - const arg = args[i]; - const truncatedArg = arg.replace(/^-{3,}/, '---'); - let broken; - let key; - let letters; - let m; - let next; - let value; - if (arg !== '--' && isUnknownOptionAsArg(arg)) { - pushPositional(arg); - } - else if (truncatedArg.match(/---+(=|$)/)) { - pushPositional(arg); - continue; - } - else if (arg.match(/^--.+=/) || (!configuration['short-option-groups'] && arg.match(/^-.+=/))) { - m = arg.match(/^--?([^=]+)=([\s\S]*)$/); - if (m !== null && Array.isArray(m) && m.length >= 3) { - if (checkAllAliases(m[1], flags.arrays)) { - i = eatArray(i, m[1], args, m[2]); - } - else if (checkAllAliases(m[1], flags.nargs) !== false) { - i = eatNargs(i, m[1], args, m[2]); - } - else { - setArg(m[1], m[2]); - } - } - } - else if (arg.match(negatedBoolean) && configuration['boolean-negation']) { - m = arg.match(negatedBoolean); - if (m !== null && Array.isArray(m) && m.length >= 2) { - key = m[1]; - setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false); - } - } - else if (arg.match(/^--.+/) || (!configuration['short-option-groups'] && arg.match(/^-[^-]+/))) { - m = arg.match(/^--?(.+)/); - if (m !== null && Array.isArray(m) && m.length >= 2) { - key = m[1]; - if (checkAllAliases(key, flags.arrays)) { - i = eatArray(i, key, args); - } - else if (checkAllAliases(key, flags.nargs) !== false) { - i = eatNargs(i, key, args); - } - else { - next = args[i + 1]; - if (next !== undefined && (!next.match(/^-/) || - next.match(negative)) && - !checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next); - i++; - } - else { - setArg(key, defaultValue(key)); - } - } - } - } - else if (arg.match(/^-.\..+=/)) { - m = arg.match(/^-([^=]+)=([\s\S]*)$/); - if (m !== null && Array.isArray(m) && m.length >= 3) { - setArg(m[1], m[2]); - } - } - else if (arg.match(/^-.\..+/) && !arg.match(negative)) { - next = args[i + 1]; - m = arg.match(/^-(.\..+)/); - if (m !== null && Array.isArray(m) && m.length >= 2) { - key = m[1]; - if (next !== undefined && !next.match(/^-/) && - !checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts)) { - setArg(key, next); - i++; - } - else { - setArg(key, defaultValue(key)); - } - } - } - else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { - letters = arg.slice(1, -1).split(''); - broken = false; - for (let j = 0; j < letters.length; j++) { - next = arg.slice(j + 2); - if (letters[j + 1] && letters[j + 1] === '=') { - value = arg.slice(j + 3); - key = letters[j]; - if (checkAllAliases(key, flags.arrays)) { - i = eatArray(i, key, args, value); - } - else if (checkAllAliases(key, flags.nargs) !== false) { - i = eatNargs(i, key, args, value); - } - else { - setArg(key, value); - } - broken = true; - break; - } - if (next === '-') { - setArg(letters[j], next); - continue; - } - if (/[A-Za-z]/.test(letters[j]) && - /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && - checkAllAliases(next, flags.bools) === false) { - setArg(letters[j], next); - broken = true; - break; - } - if (letters[j + 1] && letters[j + 1].match(/\W/)) { - setArg(letters[j], next); - broken = true; - break; - } - else { - setArg(letters[j], defaultValue(letters[j])); - } - } - key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (checkAllAliases(key, flags.arrays)) { - i = eatArray(i, key, args); - } - else if (checkAllAliases(key, flags.nargs) !== false) { - i = eatNargs(i, key, args); - } - else { - next = args[i + 1]; - if (next !== undefined && (!/^(-|--)[^-]/.test(next) || - next.match(negative)) && - !checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next); - i++; - } - else { - setArg(key, defaultValue(key)); - } - } - } - } - else if (arg.match(/^-[0-9]$/) && - arg.match(negative) && - checkAllAliases(arg.slice(1), flags.bools)) { - key = arg.slice(1); - setArg(key, defaultValue(key)); - } - else if (arg === '--') { - notFlags = args.slice(i + 1); - break; - } - else if (configuration['halt-at-non-option']) { - notFlags = args.slice(i); - break; - } - else { - pushPositional(arg); - } - } - applyEnvVars(argv, true); - applyEnvVars(argv, false); - setConfig(argv); - setConfigObjects(); - applyDefaultsAndAliases(argv, flags.aliases, defaults, true); - applyCoercions(argv); - if (configuration['set-placeholder-key']) - setPlaceholderKeys(argv); - Object.keys(flags.counts).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) - setArg(key, 0); - }); - if (notFlagsOption && notFlags.length) - argv[notFlagsArgv] = []; - notFlags.forEach(function (key) { - argv[notFlagsArgv].push(key); - }); - if (configuration['camel-case-expansion'] && configuration['strip-dashed']) { - Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => { - delete argv[key]; - }); - } - if (configuration['strip-aliased']) { - [].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => { - if (configuration['camel-case-expansion'] && alias.includes('-')) { - delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')]; - } - delete argv[alias]; - }); - } - function pushPositional(arg) { - const maybeCoercedNumber = maybeCoerceNumber('_', arg); - if (typeof maybeCoercedNumber === 'string' || typeof maybeCoercedNumber === 'number') { - argv._.push(maybeCoercedNumber); - } - } - function eatNargs(i, key, args, argAfterEqualSign) { - let ii; - let toEat = checkAllAliases(key, flags.nargs); - toEat = typeof toEat !== 'number' || isNaN(toEat) ? 1 : toEat; - if (toEat === 0) { - if (!isUndefined(argAfterEqualSign)) { - error = Error(__('Argument unexpected for: %s', key)); - } - setArg(key, defaultValue(key)); - return i; - } - let available = isUndefined(argAfterEqualSign) ? 0 : 1; - if (configuration['nargs-eats-options']) { - if (args.length - (i + 1) + available < toEat) { - error = Error(__('Not enough arguments following: %s', key)); - } - available = toEat; - } - else { - for (ii = i + 1; ii < args.length; ii++) { - if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii])) - available++; - else - break; - } - if (available < toEat) - error = Error(__('Not enough arguments following: %s', key)); - } - let consumed = Math.min(available, toEat); - if (!isUndefined(argAfterEqualSign) && consumed > 0) { - setArg(key, argAfterEqualSign); - consumed--; - } - for (ii = i + 1; ii < (consumed + i + 1); ii++) { - setArg(key, args[ii]); - } - return (i + consumed); - } - function eatArray(i, key, args, argAfterEqualSign) { - let argsToSet = []; - let next = argAfterEqualSign || args[i + 1]; - const nargsCount = checkAllAliases(key, flags.nargs); - if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) { - argsToSet.push(true); - } - else if (isUndefined(next) || - (isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) { - if (defaults[key] !== undefined) { - const defVal = defaults[key]; - argsToSet = Array.isArray(defVal) ? defVal : [defVal]; - } - } - else { - if (!isUndefined(argAfterEqualSign)) { - argsToSet.push(processValue(key, argAfterEqualSign)); - } - for (let ii = i + 1; ii < args.length; ii++) { - if ((!configuration['greedy-arrays'] && argsToSet.length > 0) || - (nargsCount && typeof nargsCount === 'number' && argsToSet.length >= nargsCount)) - break; - next = args[ii]; - if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) - break; - i = ii; - argsToSet.push(processValue(key, next)); - } - } - if (typeof nargsCount === 'number' && ((nargsCount && argsToSet.length < nargsCount) || - (isNaN(nargsCount) && argsToSet.length === 0))) { - error = Error(__('Not enough arguments following: %s', key)); - } - setArg(key, argsToSet); - return i; - } - function setArg(key, val) { - if (/-/.test(key) && configuration['camel-case-expansion']) { - const alias = key.split('.').map(function (prop) { - return camelCase(prop); - }).join('.'); - addNewAlias(key, alias); - } - const value = processValue(key, val); - const splitKey = key.split('.'); - setKey(argv, splitKey, value); - if (flags.aliases[key]) { - flags.aliases[key].forEach(function (x) { - const keyProperties = x.split('.'); - setKey(argv, keyProperties, value); - }); - } - if (splitKey.length > 1 && configuration['dot-notation']) { - (flags.aliases[splitKey[0]] || []).forEach(function (x) { - let keyProperties = x.split('.'); - const a = [].concat(splitKey); - a.shift(); - keyProperties = keyProperties.concat(a); - if (!(flags.aliases[key] || []).includes(keyProperties.join('.'))) { - setKey(argv, keyProperties, value); - } - }); - } - if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { - const keys = [key].concat(flags.aliases[key] || []); - keys.forEach(function (key) { - Object.defineProperty(argvReturn, key, { - enumerable: true, - get() { - return val; - }, - set(value) { - val = typeof value === 'string' ? mixin.normalize(value) : value; - } - }); - }); - } - } - function addNewAlias(key, alias) { - if (!(flags.aliases[key] && flags.aliases[key].length)) { - flags.aliases[key] = [alias]; - newAliases[alias] = true; - } - if (!(flags.aliases[alias] && flags.aliases[alias].length)) { - addNewAlias(alias, key); - } - } - function processValue(key, val) { - if (typeof val === 'string' && - (val[0] === "'" || val[0] === '"') && - val[val.length - 1] === val[0]) { - val = val.substring(1, val.length - 1); - } - if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { - if (typeof val === 'string') - val = val === 'true'; - } - let value = Array.isArray(val) - ? val.map(function (v) { return maybeCoerceNumber(key, v); }) - : maybeCoerceNumber(key, val); - if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { - value = increment(); - } - if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { - if (Array.isArray(val)) - value = val.map((val) => { return mixin.normalize(val); }); - else - value = mixin.normalize(val); - } - return value; - } - function maybeCoerceNumber(key, value) { - if (!configuration['parse-positional-numbers'] && key === '_') - return value; - if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { - const shouldCoerceNumber = looksLikeNumber(value) && configuration['parse-numbers'] && (Number.isSafeInteger(Math.floor(parseFloat(`${value}`)))); - if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) { - value = Number(value); - } - } - return value; - } - function setConfig(argv) { - const configLookup = Object.create(null); - applyDefaultsAndAliases(configLookup, flags.aliases, defaults); - Object.keys(flags.configs).forEach(function (configKey) { - const configPath = argv[configKey] || configLookup[configKey]; - if (configPath) { - try { - let config = null; - const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath); - const resolveConfig = flags.configs[configKey]; - if (typeof resolveConfig === 'function') { - try { - config = resolveConfig(resolvedConfigPath); - } - catch (e) { - config = e; - } - if (config instanceof Error) { - error = config; - return; - } - } - else { - config = mixin.require(resolvedConfigPath); - } - setConfigObject(config); - } - catch (ex) { - if (ex.name === 'PermissionDenied') - error = ex; - else if (argv[configKey]) - error = Error(__('Invalid JSON config file: %s', configPath)); - } - } - }); - } - function setConfigObject(config, prev) { - Object.keys(config).forEach(function (key) { - const value = config[key]; - const fullKey = prev ? prev + '.' + key : key; - if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) { - setConfigObject(value, fullKey); - } - else { - if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) { - setArg(fullKey, value); - } - } - }); - } - function setConfigObjects() { - if (typeof configObjects !== 'undefined') { - configObjects.forEach(function (configObject) { - setConfigObject(configObject); - }); - } - } - function applyEnvVars(argv, configOnly) { - if (typeof envPrefix === 'undefined') - return; - const prefix = typeof envPrefix === 'string' ? envPrefix : ''; - const env = mixin.env(); - Object.keys(env).forEach(function (envVar) { - if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) { - const keys = envVar.split('__').map(function (key, i) { - if (i === 0) { - key = key.substring(prefix.length); - } - return camelCase(key); - }); - if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) { - setArg(keys.join('.'), env[envVar]); - } - } - }); - } - function applyCoercions(argv) { - let coerce; - const applied = new Set(); - Object.keys(argv).forEach(function (key) { - if (!applied.has(key)) { - coerce = checkAllAliases(key, flags.coercions); - if (typeof coerce === 'function') { - try { - const value = maybeCoerceNumber(key, coerce(argv[key])); - ([].concat(flags.aliases[key] || [], key)).forEach(ali => { - applied.add(ali); - argv[ali] = value; - }); - } - catch (err) { - error = err; - } - } - } - }); - } - function setPlaceholderKeys(argv) { - flags.keys.forEach((key) => { - if (~key.indexOf('.')) - return; - if (typeof argv[key] === 'undefined') - argv[key] = undefined; - }); - return argv; - } - function applyDefaultsAndAliases(obj, aliases, defaults, canLog = false) { - Object.keys(defaults).forEach(function (key) { - if (!hasKey(obj, key.split('.'))) { - setKey(obj, key.split('.'), defaults[key]); - if (canLog) - defaulted[key] = true; - (aliases[key] || []).forEach(function (x) { - if (hasKey(obj, x.split('.'))) - return; - setKey(obj, x.split('.'), defaults[key]); - }); - } - }); - } - function hasKey(obj, keys) { - let o = obj; - if (!configuration['dot-notation']) - keys = [keys.join('.')]; - keys.slice(0, -1).forEach(function (key) { - o = (o[key] || {}); - }); - const key = keys[keys.length - 1]; - if (typeof o !== 'object') - return false; - else - return key in o; - } - function setKey(obj, keys, value) { - let o = obj; - if (!configuration['dot-notation']) - keys = [keys.join('.')]; - keys.slice(0, -1).forEach(function (key) { - key = sanitizeKey(key); - if (typeof o === 'object' && o[key] === undefined) { - o[key] = {}; - } - if (typeof o[key] !== 'object' || Array.isArray(o[key])) { - if (Array.isArray(o[key])) { - o[key].push({}); - } - else { - o[key] = [o[key], {}]; - } - o = o[key][o[key].length - 1]; - } - else { - o = o[key]; - } - }); - const key = sanitizeKey(keys[keys.length - 1]); - const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays); - const isValueArray = Array.isArray(value); - let duplicate = configuration['duplicate-arguments-array']; - if (!duplicate && checkAllAliases(key, flags.nargs)) { - duplicate = true; - if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) { - o[key] = undefined; - } - } - if (value === increment()) { - o[key] = increment(o[key]); - } - else if (Array.isArray(o[key])) { - if (duplicate && isTypeArray && isValueArray) { - o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]); - } - else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { - o[key] = value; - } - else { - o[key] = o[key].concat([value]); - } - } - else if (o[key] === undefined && isTypeArray) { - o[key] = isValueArray ? value : [value]; - } - else if (duplicate && !(o[key] === undefined || - checkAllAliases(key, flags.counts) || - checkAllAliases(key, flags.bools))) { - o[key] = [o[key], value]; - } - else { - o[key] = value; - } - } - function extendAliases(...args) { - args.forEach(function (obj) { - Object.keys(obj || {}).forEach(function (key) { - if (flags.aliases[key]) - return; - flags.aliases[key] = [].concat(aliases[key] || []); - flags.aliases[key].concat(key).forEach(function (x) { - if (/-/.test(x) && configuration['camel-case-expansion']) { - const c = camelCase(x); - if (c !== key && flags.aliases[key].indexOf(c) === -1) { - flags.aliases[key].push(c); - newAliases[c] = true; - } - } - }); - flags.aliases[key].concat(key).forEach(function (x) { - if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) { - const c = decamelize(x, '-'); - if (c !== key && flags.aliases[key].indexOf(c) === -1) { - flags.aliases[key].push(c); - newAliases[c] = true; - } - } - }); - flags.aliases[key].forEach(function (x) { - flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - }); - } - function checkAllAliases(key, flag) { - const toCheck = [].concat(flags.aliases[key] || [], key); - const keys = Object.keys(flag); - const setAlias = toCheck.find(key => keys.includes(key)); - return setAlias ? flag[setAlias] : false; - } - function hasAnyFlag(key) { - const flagsKeys = Object.keys(flags); - const toCheck = [].concat(flagsKeys.map(k => flags[k])); - return toCheck.some(function (flag) { - return Array.isArray(flag) ? flag.includes(key) : flag[key]; - }); - } - function hasFlagsMatching(arg, ...patterns) { - const toCheck = [].concat(...patterns); - return toCheck.some(function (pattern) { - const match = arg.match(pattern); - return match && hasAnyFlag(match[1]); - }); - } - function hasAllShortFlags(arg) { - if (arg.match(negative) || !arg.match(/^-[^-]+/)) { - return false; - } - let hasAllFlags = true; - let next; - const letters = arg.slice(1).split(''); - for (let j = 0; j < letters.length; j++) { - next = arg.slice(j + 2); - if (!hasAnyFlag(letters[j])) { - hasAllFlags = false; - break; - } - if ((letters[j + 1] && letters[j + 1] === '=') || - next === '-' || - (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || - (letters[j + 1] && letters[j + 1].match(/\W/))) { - break; - } - } - return hasAllFlags; - } - function isUnknownOptionAsArg(arg) { - return configuration['unknown-options-as-args'] && isUnknownOption(arg); - } - function isUnknownOption(arg) { - arg = arg.replace(/^-{3,}/, '--'); - if (arg.match(negative)) { - return false; - } - if (hasAllShortFlags(arg)) { - return false; - } - const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; - const normalFlag = /^-+([^=]+?)$/; - const flagEndingInHyphen = /^-+([^=]+?)-$/; - const flagEndingInDigits = /^-+([^=]+?\d+)$/; - const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; - return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters); - } - function defaultValue(key) { - if (!checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts) && - `${key}` in defaults) { - return defaults[key]; - } - else { - return defaultForType(guessType(key)); - } - } - function defaultForType(type) { - const def = { - [DefaultValuesForTypeKey.BOOLEAN]: true, - [DefaultValuesForTypeKey.STRING]: '', - [DefaultValuesForTypeKey.NUMBER]: undefined, - [DefaultValuesForTypeKey.ARRAY]: [] - }; - return def[type]; - } - function guessType(key) { - let type = DefaultValuesForTypeKey.BOOLEAN; - if (checkAllAliases(key, flags.strings)) - type = DefaultValuesForTypeKey.STRING; - else if (checkAllAliases(key, flags.numbers)) - type = DefaultValuesForTypeKey.NUMBER; - else if (checkAllAliases(key, flags.bools)) - type = DefaultValuesForTypeKey.BOOLEAN; - else if (checkAllAliases(key, flags.arrays)) - type = DefaultValuesForTypeKey.ARRAY; - return type; - } - function isUndefined(num) { - return num === undefined; - } - function checkConfiguration() { - Object.keys(flags.counts).find(key => { - if (checkAllAliases(key, flags.arrays)) { - error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key)); - return true; - } - else if (checkAllAliases(key, flags.nargs)) { - error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key)); - return true; - } - return false; - }); - } - return { - aliases: Object.assign({}, flags.aliases), - argv: Object.assign(argvReturn, argv), - configuration: configuration, - defaulted: Object.assign({}, defaulted), - error: error, - newAliases: Object.assign({}, newAliases) - }; - } -} -function combineAliases(aliases) { - const aliasArrays = []; - const combined = Object.create(null); - let change = true; - Object.keys(aliases).forEach(function (key) { - aliasArrays.push([].concat(aliases[key], key)); - }); - while (change) { - change = false; - for (let i = 0; i < aliasArrays.length; i++) { - for (let ii = i + 1; ii < aliasArrays.length; ii++) { - const intersect = aliasArrays[i].filter(function (v) { - return aliasArrays[ii].indexOf(v) !== -1; - }); - if (intersect.length) { - aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]); - aliasArrays.splice(ii, 1); - change = true; - break; - } - } - } - } - aliasArrays.forEach(function (aliasArray) { - aliasArray = aliasArray.filter(function (v, i, self) { - return self.indexOf(v) === i; - }); - const lastAlias = aliasArray.pop(); - if (lastAlias !== undefined && typeof lastAlias === 'string') { - combined[lastAlias] = aliasArray; - } - }); - return combined; -} -function increment(orig) { - return orig !== undefined ? orig + 1 : 1; -} -function sanitizeKey(key) { - if (key === '__proto__') - return '___proto___'; - return key; -} - -const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION) - ? Number(process.env.YARGS_MIN_NODE_VERSION) - : 10; -if (process && process.version) { - const major = Number(process.version.match(/v([^.]+)/)[1]); - if (major < minNodeVersion) { - throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); - } -} -const env = process ? process.env : {}; -const parser = new YargsParser({ - cwd: process.cwd, - env: () => { - return env; - }, - format: util.format, - normalize: path.normalize, - resolve: path.resolve, - require: (path) => { - if (typeof require !== 'undefined') { - return require(path); - } - else if (path.match(/\.json$/)) { - return fs.readFileSync(path, 'utf8'); - } - else { - throw Error('only .json config files are supported in ESM'); - } - } -}); -const yargsParser = function Parser(args, opts) { - const result = parser.parse(args.slice(), opts); - return result.argv; -}; -yargsParser.detailed = function (args, opts) { - return parser.parse(args.slice(), opts); -}; -yargsParser.camelCase = camelCase; -yargsParser.decamelize = decamelize; -yargsParser.looksLikeNumber = looksLikeNumber; - -module.exports = yargsParser; diff --git a/node_modules/yargs-parser/build/lib/index.js b/node_modules/yargs-parser/build/lib/index.js deleted file mode 100644 index cc5078890..000000000 --- a/node_modules/yargs-parser/build/lib/index.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js - * CJS and ESM environments. - * - * @license - * Copyright (c) 2016, Contributors - * SPDX-License-Identifier: ISC - */ -import { format } from 'util'; -import { readFileSync } from 'fs'; -import { normalize, resolve } from 'path'; -import { camelCase, decamelize, looksLikeNumber } from './string-utils.js'; -import { YargsParser } from './yargs-parser.js'; -// See https://github.com/yargs/yargs-parser#supported-nodejs-versions for our -// version support policy. The YARGS_MIN_NODE_VERSION is used for testing only. -const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION) - ? Number(process.env.YARGS_MIN_NODE_VERSION) - : 10; -if (process && process.version) { - const major = Number(process.version.match(/v([^.]+)/)[1]); - if (major < minNodeVersion) { - throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); - } -} -// Creates a yargs-parser instance using Node.js standard libraries: -const env = process ? process.env : {}; -const parser = new YargsParser({ - cwd: process.cwd, - env: () => { - return env; - }, - format, - normalize, - resolve, - // TODO: figure out a way to combine ESM and CJS coverage, such that - // we can exercise all the lines below: - require: (path) => { - if (typeof require !== 'undefined') { - return require(path); - } - else if (path.match(/\.json$/)) { - return readFileSync(path, 'utf8'); - } - else { - throw Error('only .json config files are supported in ESM'); - } - } -}); -const yargsParser = function Parser(args, opts) { - const result = parser.parse(args.slice(), opts); - return result.argv; -}; -yargsParser.detailed = function (args, opts) { - return parser.parse(args.slice(), opts); -}; -yargsParser.camelCase = camelCase; -yargsParser.decamelize = decamelize; -yargsParser.looksLikeNumber = looksLikeNumber; -export default yargsParser; diff --git a/node_modules/yargs-parser/build/lib/string-utils.js b/node_modules/yargs-parser/build/lib/string-utils.js deleted file mode 100644 index 4e8bd996e..000000000 --- a/node_modules/yargs-parser/build/lib/string-utils.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @license - * Copyright (c) 2016, Contributors - * SPDX-License-Identifier: ISC - */ -export function camelCase(str) { - // Handle the case where an argument is provided as camel case, e.g., fooBar. - // by ensuring that the string isn't already mixed case: - const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase(); - if (!isCamelCase) { - str = str.toLowerCase(); - } - if (str.indexOf('-') === -1 && str.indexOf('_') === -1) { - return str; - } - else { - let camelcase = ''; - let nextChrUpper = false; - const leadingHyphens = str.match(/^-+/); - for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) { - let chr = str.charAt(i); - if (nextChrUpper) { - nextChrUpper = false; - chr = chr.toUpperCase(); - } - if (i !== 0 && (chr === '-' || chr === '_')) { - nextChrUpper = true; - } - else if (chr !== '-' && chr !== '_') { - camelcase += chr; - } - } - return camelcase; - } -} -export function decamelize(str, joinString) { - const lowercase = str.toLowerCase(); - joinString = joinString || '-'; - let notCamelcase = ''; - for (let i = 0; i < str.length; i++) { - const chrLower = lowercase.charAt(i); - const chrString = str.charAt(i); - if (chrLower !== chrString && i > 0) { - notCamelcase += `${joinString}${lowercase.charAt(i)}`; - } - else { - notCamelcase += chrString; - } - } - return notCamelcase; -} -export function looksLikeNumber(x) { - if (x === null || x === undefined) - return false; - // if loaded from config, may already be a number. - if (typeof x === 'number') - return true; - // hexadecimal. - if (/^0x[0-9a-f]+$/i.test(x)) - return true; - // don't treat 0123 as a number; as it drops the leading '0'. - if (/^0[^.]/.test(x)) - return false; - return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} diff --git a/node_modules/yargs-parser/build/lib/tokenize-arg-string.js b/node_modules/yargs-parser/build/lib/tokenize-arg-string.js deleted file mode 100644 index 5e732efe0..000000000 --- a/node_modules/yargs-parser/build/lib/tokenize-arg-string.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright (c) 2016, Contributors - * SPDX-License-Identifier: ISC - */ -// take an un-split argv string and tokenize it. -export function tokenizeArgString(argString) { - if (Array.isArray(argString)) { - return argString.map(e => typeof e !== 'string' ? e + '' : e); - } - argString = argString.trim(); - let i = 0; - let prevC = null; - let c = null; - let opening = null; - const args = []; - for (let ii = 0; ii < argString.length; ii++) { - prevC = c; - c = argString.charAt(ii); - // split on spaces unless we're in quotes. - if (c === ' ' && !opening) { - if (!(prevC === ' ')) { - i++; - } - continue; - } - // don't split the string if we're in matching - // opening or closing single and double quotes. - if (c === opening) { - opening = null; - } - else if ((c === "'" || c === '"') && !opening) { - opening = c; - } - if (!args[i]) - args[i] = ''; - args[i] += c; - } - return args; -} diff --git a/node_modules/yargs-parser/build/lib/yargs-parser-types.js b/node_modules/yargs-parser/build/lib/yargs-parser-types.js deleted file mode 100644 index 63b7c313a..000000000 --- a/node_modules/yargs-parser/build/lib/yargs-parser-types.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @license - * Copyright (c) 2016, Contributors - * SPDX-License-Identifier: ISC - */ -export var DefaultValuesForTypeKey; -(function (DefaultValuesForTypeKey) { - DefaultValuesForTypeKey["BOOLEAN"] = "boolean"; - DefaultValuesForTypeKey["STRING"] = "string"; - DefaultValuesForTypeKey["NUMBER"] = "number"; - DefaultValuesForTypeKey["ARRAY"] = "array"; -})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); diff --git a/node_modules/yargs-parser/build/lib/yargs-parser.js b/node_modules/yargs-parser/build/lib/yargs-parser.js deleted file mode 100644 index 828a440dd..000000000 --- a/node_modules/yargs-parser/build/lib/yargs-parser.js +++ /dev/null @@ -1,1037 +0,0 @@ -/** - * @license - * Copyright (c) 2016, Contributors - * SPDX-License-Identifier: ISC - */ -import { tokenizeArgString } from './tokenize-arg-string.js'; -import { DefaultValuesForTypeKey } from './yargs-parser-types.js'; -import { camelCase, decamelize, looksLikeNumber } from './string-utils.js'; -let mixin; -export class YargsParser { - constructor(_mixin) { - mixin = _mixin; - } - parse(argsInput, options) { - const opts = Object.assign({ - alias: undefined, - array: undefined, - boolean: undefined, - config: undefined, - configObjects: undefined, - configuration: undefined, - coerce: undefined, - count: undefined, - default: undefined, - envPrefix: undefined, - narg: undefined, - normalize: undefined, - string: undefined, - number: undefined, - __: undefined, - key: undefined - }, options); - // allow a string argument to be passed in rather - // than an argv array. - const args = tokenizeArgString(argsInput); - // aliases might have transitive relationships, normalize this. - const aliases = combineAliases(Object.assign(Object.create(null), opts.alias)); - const configuration = Object.assign({ - 'boolean-negation': true, - 'camel-case-expansion': true, - 'combine-arrays': false, - 'dot-notation': true, - 'duplicate-arguments-array': true, - 'flatten-duplicate-arrays': true, - 'greedy-arrays': true, - 'halt-at-non-option': false, - 'nargs-eats-options': false, - 'negation-prefix': 'no-', - 'parse-numbers': true, - 'parse-positional-numbers': true, - 'populate--': false, - 'set-placeholder-key': false, - 'short-option-groups': true, - 'strip-aliased': false, - 'strip-dashed': false, - 'unknown-options-as-args': false - }, opts.configuration); - const defaults = Object.assign(Object.create(null), opts.default); - const configObjects = opts.configObjects || []; - const envPrefix = opts.envPrefix; - const notFlagsOption = configuration['populate--']; - const notFlagsArgv = notFlagsOption ? '--' : '_'; - const newAliases = Object.create(null); - const defaulted = Object.create(null); - // allow a i18n handler to be passed in, default to a fake one (util.format). - const __ = opts.__ || mixin.format; - const flags = { - aliases: Object.create(null), - arrays: Object.create(null), - bools: Object.create(null), - strings: Object.create(null), - numbers: Object.create(null), - counts: Object.create(null), - normalize: Object.create(null), - configs: Object.create(null), - nargs: Object.create(null), - coercions: Object.create(null), - keys: [] - }; - const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; - const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)'); - [].concat(opts.array || []).filter(Boolean).forEach(function (opt) { - const key = typeof opt === 'object' ? opt.key : opt; - // assign to flags[bools|strings|numbers] - const assignment = Object.keys(opt).map(function (key) { - const arrayFlagKeys = { - boolean: 'bools', - string: 'strings', - number: 'numbers' - }; - return arrayFlagKeys[key]; - }).filter(Boolean).pop(); - // assign key to be coerced - if (assignment) { - flags[assignment][key] = true; - } - flags.arrays[key] = true; - flags.keys.push(key); - }); - [].concat(opts.boolean || []).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - flags.keys.push(key); - }); - [].concat(opts.string || []).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - flags.keys.push(key); - }); - [].concat(opts.number || []).filter(Boolean).forEach(function (key) { - flags.numbers[key] = true; - flags.keys.push(key); - }); - [].concat(opts.count || []).filter(Boolean).forEach(function (key) { - flags.counts[key] = true; - flags.keys.push(key); - }); - [].concat(opts.normalize || []).filter(Boolean).forEach(function (key) { - flags.normalize[key] = true; - flags.keys.push(key); - }); - if (typeof opts.narg === 'object') { - Object.entries(opts.narg).forEach(([key, value]) => { - if (typeof value === 'number') { - flags.nargs[key] = value; - flags.keys.push(key); - } - }); - } - if (typeof opts.coerce === 'object') { - Object.entries(opts.coerce).forEach(([key, value]) => { - if (typeof value === 'function') { - flags.coercions[key] = value; - flags.keys.push(key); - } - }); - } - if (typeof opts.config !== 'undefined') { - if (Array.isArray(opts.config) || typeof opts.config === 'string') { - ; - [].concat(opts.config).filter(Boolean).forEach(function (key) { - flags.configs[key] = true; - }); - } - else if (typeof opts.config === 'object') { - Object.entries(opts.config).forEach(([key, value]) => { - if (typeof value === 'boolean' || typeof value === 'function') { - flags.configs[key] = value; - } - }); - } - } - // create a lookup table that takes into account all - // combinations of aliases: {f: ['foo'], foo: ['f']} - extendAliases(opts.key, aliases, opts.default, flags.arrays); - // apply default values to all aliases. - Object.keys(defaults).forEach(function (key) { - (flags.aliases[key] || []).forEach(function (alias) { - defaults[alias] = defaults[key]; - }); - }); - let error = null; - checkConfiguration(); - let notFlags = []; - const argv = Object.assign(Object.create(null), { _: [] }); - // TODO(bcoe): for the first pass at removing object prototype we didn't - // remove all prototypes from objects returned by this API, we might want - // to gradually move towards doing so. - const argvReturn = {}; - for (let i = 0; i < args.length; i++) { - const arg = args[i]; - const truncatedArg = arg.replace(/^-{3,}/, '---'); - let broken; - let key; - let letters; - let m; - let next; - let value; - // any unknown option (except for end-of-options, "--") - if (arg !== '--' && isUnknownOptionAsArg(arg)) { - pushPositional(arg); - // ---, ---=, ----, etc, - } - else if (truncatedArg.match(/---+(=|$)/)) { - // options without key name are invalid. - pushPositional(arg); - continue; - // -- separated by = - } - else if (arg.match(/^--.+=/) || (!configuration['short-option-groups'] && arg.match(/^-.+=/))) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - m = arg.match(/^--?([^=]+)=([\s\S]*)$/); - // arrays format = '--f=a b c' - if (m !== null && Array.isArray(m) && m.length >= 3) { - if (checkAllAliases(m[1], flags.arrays)) { - i = eatArray(i, m[1], args, m[2]); - } - else if (checkAllAliases(m[1], flags.nargs) !== false) { - // nargs format = '--f=monkey washing cat' - i = eatNargs(i, m[1], args, m[2]); - } - else { - setArg(m[1], m[2]); - } - } - } - else if (arg.match(negatedBoolean) && configuration['boolean-negation']) { - m = arg.match(negatedBoolean); - if (m !== null && Array.isArray(m) && m.length >= 2) { - key = m[1]; - setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false); - } - // -- separated by space. - } - else if (arg.match(/^--.+/) || (!configuration['short-option-groups'] && arg.match(/^-[^-]+/))) { - m = arg.match(/^--?(.+)/); - if (m !== null && Array.isArray(m) && m.length >= 2) { - key = m[1]; - if (checkAllAliases(key, flags.arrays)) { - // array format = '--foo a b c' - i = eatArray(i, key, args); - } - else if (checkAllAliases(key, flags.nargs) !== false) { - // nargs format = '--foo a b c' - // should be truthy even if: flags.nargs[key] === 0 - i = eatNargs(i, key, args); - } - else { - next = args[i + 1]; - if (next !== undefined && (!next.match(/^-/) || - next.match(negative)) && - !checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next); - i++; - } - else { - setArg(key, defaultValue(key)); - } - } - } - // dot-notation flag separated by '='. - } - else if (arg.match(/^-.\..+=/)) { - m = arg.match(/^-([^=]+)=([\s\S]*)$/); - if (m !== null && Array.isArray(m) && m.length >= 3) { - setArg(m[1], m[2]); - } - // dot-notation flag separated by space. - } - else if (arg.match(/^-.\..+/) && !arg.match(negative)) { - next = args[i + 1]; - m = arg.match(/^-(.\..+)/); - if (m !== null && Array.isArray(m) && m.length >= 2) { - key = m[1]; - if (next !== undefined && !next.match(/^-/) && - !checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts)) { - setArg(key, next); - i++; - } - else { - setArg(key, defaultValue(key)); - } - } - } - else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { - letters = arg.slice(1, -1).split(''); - broken = false; - for (let j = 0; j < letters.length; j++) { - next = arg.slice(j + 2); - if (letters[j + 1] && letters[j + 1] === '=') { - value = arg.slice(j + 3); - key = letters[j]; - if (checkAllAliases(key, flags.arrays)) { - // array format = '-f=a b c' - i = eatArray(i, key, args, value); - } - else if (checkAllAliases(key, flags.nargs) !== false) { - // nargs format = '-f=monkey washing cat' - i = eatNargs(i, key, args, value); - } - else { - setArg(key, value); - } - broken = true; - break; - } - if (next === '-') { - setArg(letters[j], next); - continue; - } - // current letter is an alphabetic character and next value is a number - if (/[A-Za-z]/.test(letters[j]) && - /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && - checkAllAliases(next, flags.bools) === false) { - setArg(letters[j], next); - broken = true; - break; - } - if (letters[j + 1] && letters[j + 1].match(/\W/)) { - setArg(letters[j], next); - broken = true; - break; - } - else { - setArg(letters[j], defaultValue(letters[j])); - } - } - key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (checkAllAliases(key, flags.arrays)) { - // array format = '-f a b c' - i = eatArray(i, key, args); - } - else if (checkAllAliases(key, flags.nargs) !== false) { - // nargs format = '-f a b c' - // should be truthy even if: flags.nargs[key] === 0 - i = eatNargs(i, key, args); - } - else { - next = args[i + 1]; - if (next !== undefined && (!/^(-|--)[^-]/.test(next) || - next.match(negative)) && - !checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next); - i++; - } - else { - setArg(key, defaultValue(key)); - } - } - } - } - else if (arg.match(/^-[0-9]$/) && - arg.match(negative) && - checkAllAliases(arg.slice(1), flags.bools)) { - // single-digit boolean alias, e.g: xargs -0 - key = arg.slice(1); - setArg(key, defaultValue(key)); - } - else if (arg === '--') { - notFlags = args.slice(i + 1); - break; - } - else if (configuration['halt-at-non-option']) { - notFlags = args.slice(i); - break; - } - else { - pushPositional(arg); - } - } - // order of precedence: - // 1. command line arg - // 2. value from env var - // 3. value from config file - // 4. value from config objects - // 5. configured default value - applyEnvVars(argv, true); // special case: check env vars that point to config file - applyEnvVars(argv, false); - setConfig(argv); - setConfigObjects(); - applyDefaultsAndAliases(argv, flags.aliases, defaults, true); - applyCoercions(argv); - if (configuration['set-placeholder-key']) - setPlaceholderKeys(argv); - // for any counts either not in args or without an explicit default, set to 0 - Object.keys(flags.counts).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) - setArg(key, 0); - }); - // '--' defaults to undefined. - if (notFlagsOption && notFlags.length) - argv[notFlagsArgv] = []; - notFlags.forEach(function (key) { - argv[notFlagsArgv].push(key); - }); - if (configuration['camel-case-expansion'] && configuration['strip-dashed']) { - Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => { - delete argv[key]; - }); - } - if (configuration['strip-aliased']) { - ; - [].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => { - if (configuration['camel-case-expansion'] && alias.includes('-')) { - delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')]; - } - delete argv[alias]; - }); - } - // Push argument into positional array, applying numeric coercion: - function pushPositional(arg) { - const maybeCoercedNumber = maybeCoerceNumber('_', arg); - if (typeof maybeCoercedNumber === 'string' || typeof maybeCoercedNumber === 'number') { - argv._.push(maybeCoercedNumber); - } - } - // how many arguments should we consume, based - // on the nargs option? - function eatNargs(i, key, args, argAfterEqualSign) { - let ii; - let toEat = checkAllAliases(key, flags.nargs); - // NaN has a special meaning for the array type, indicating that one or - // more values are expected. - toEat = typeof toEat !== 'number' || isNaN(toEat) ? 1 : toEat; - if (toEat === 0) { - if (!isUndefined(argAfterEqualSign)) { - error = Error(__('Argument unexpected for: %s', key)); - } - setArg(key, defaultValue(key)); - return i; - } - let available = isUndefined(argAfterEqualSign) ? 0 : 1; - if (configuration['nargs-eats-options']) { - // classic behavior, yargs eats positional and dash arguments. - if (args.length - (i + 1) + available < toEat) { - error = Error(__('Not enough arguments following: %s', key)); - } - available = toEat; - } - else { - // nargs will not consume flag arguments, e.g., -abc, --foo, - // and terminates when one is observed. - for (ii = i + 1; ii < args.length; ii++) { - if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii])) - available++; - else - break; - } - if (available < toEat) - error = Error(__('Not enough arguments following: %s', key)); - } - let consumed = Math.min(available, toEat); - if (!isUndefined(argAfterEqualSign) && consumed > 0) { - setArg(key, argAfterEqualSign); - consumed--; - } - for (ii = i + 1; ii < (consumed + i + 1); ii++) { - setArg(key, args[ii]); - } - return (i + consumed); - } - // if an option is an array, eat all non-hyphenated arguments - // following it... YUM! - // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"] - function eatArray(i, key, args, argAfterEqualSign) { - let argsToSet = []; - let next = argAfterEqualSign || args[i + 1]; - // If both array and nargs are configured, enforce the nargs count: - const nargsCount = checkAllAliases(key, flags.nargs); - if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) { - argsToSet.push(true); - } - else if (isUndefined(next) || - (isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) { - // for keys without value ==> argsToSet remains an empty [] - // set user default value, if available - if (defaults[key] !== undefined) { - const defVal = defaults[key]; - argsToSet = Array.isArray(defVal) ? defVal : [defVal]; - } - } - else { - // value in --option=value is eaten as is - if (!isUndefined(argAfterEqualSign)) { - argsToSet.push(processValue(key, argAfterEqualSign)); - } - for (let ii = i + 1; ii < args.length; ii++) { - if ((!configuration['greedy-arrays'] && argsToSet.length > 0) || - (nargsCount && typeof nargsCount === 'number' && argsToSet.length >= nargsCount)) - break; - next = args[ii]; - if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) - break; - i = ii; - argsToSet.push(processValue(key, next)); - } - } - // If both array and nargs are configured, create an error if less than - // nargs positionals were found. NaN has special meaning, indicating - // that at least one value is required (more are okay). - if (typeof nargsCount === 'number' && ((nargsCount && argsToSet.length < nargsCount) || - (isNaN(nargsCount) && argsToSet.length === 0))) { - error = Error(__('Not enough arguments following: %s', key)); - } - setArg(key, argsToSet); - return i; - } - function setArg(key, val) { - if (/-/.test(key) && configuration['camel-case-expansion']) { - const alias = key.split('.').map(function (prop) { - return camelCase(prop); - }).join('.'); - addNewAlias(key, alias); - } - const value = processValue(key, val); - const splitKey = key.split('.'); - setKey(argv, splitKey, value); - // handle populating aliases of the full key - if (flags.aliases[key]) { - flags.aliases[key].forEach(function (x) { - const keyProperties = x.split('.'); - setKey(argv, keyProperties, value); - }); - } - // handle populating aliases of the first element of the dot-notation key - if (splitKey.length > 1 && configuration['dot-notation']) { - ; - (flags.aliases[splitKey[0]] || []).forEach(function (x) { - let keyProperties = x.split('.'); - // expand alias with nested objects in key - const a = [].concat(splitKey); - a.shift(); // nuke the old key. - keyProperties = keyProperties.concat(a); - // populate alias only if is not already an alias of the full key - // (already populated above) - if (!(flags.aliases[key] || []).includes(keyProperties.join('.'))) { - setKey(argv, keyProperties, value); - } - }); - } - // Set normalize getter and setter when key is in 'normalize' but isn't an array - if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { - const keys = [key].concat(flags.aliases[key] || []); - keys.forEach(function (key) { - Object.defineProperty(argvReturn, key, { - enumerable: true, - get() { - return val; - }, - set(value) { - val = typeof value === 'string' ? mixin.normalize(value) : value; - } - }); - }); - } - } - function addNewAlias(key, alias) { - if (!(flags.aliases[key] && flags.aliases[key].length)) { - flags.aliases[key] = [alias]; - newAliases[alias] = true; - } - if (!(flags.aliases[alias] && flags.aliases[alias].length)) { - addNewAlias(alias, key); - } - } - function processValue(key, val) { - // strings may be quoted, clean this up as we assign values. - if (typeof val === 'string' && - (val[0] === "'" || val[0] === '"') && - val[val.length - 1] === val[0]) { - val = val.substring(1, val.length - 1); - } - // handle parsing boolean arguments --foo=true --bar false. - if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { - if (typeof val === 'string') - val = val === 'true'; - } - let value = Array.isArray(val) - ? val.map(function (v) { return maybeCoerceNumber(key, v); }) - : maybeCoerceNumber(key, val); - // increment a count given as arg (either no value or value parsed as boolean) - if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { - value = increment(); - } - // Set normalized value when key is in 'normalize' and in 'arrays' - if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { - if (Array.isArray(val)) - value = val.map((val) => { return mixin.normalize(val); }); - else - value = mixin.normalize(val); - } - return value; - } - function maybeCoerceNumber(key, value) { - if (!configuration['parse-positional-numbers'] && key === '_') - return value; - if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { - const shouldCoerceNumber = looksLikeNumber(value) && configuration['parse-numbers'] && (Number.isSafeInteger(Math.floor(parseFloat(`${value}`)))); - if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) { - value = Number(value); - } - } - return value; - } - // set args from config.json file, this should be - // applied last so that defaults can be applied. - function setConfig(argv) { - const configLookup = Object.create(null); - // expand defaults/aliases, in-case any happen to reference - // the config.json file. - applyDefaultsAndAliases(configLookup, flags.aliases, defaults); - Object.keys(flags.configs).forEach(function (configKey) { - const configPath = argv[configKey] || configLookup[configKey]; - if (configPath) { - try { - let config = null; - const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath); - const resolveConfig = flags.configs[configKey]; - if (typeof resolveConfig === 'function') { - try { - config = resolveConfig(resolvedConfigPath); - } - catch (e) { - config = e; - } - if (config instanceof Error) { - error = config; - return; - } - } - else { - config = mixin.require(resolvedConfigPath); - } - setConfigObject(config); - } - catch (ex) { - // Deno will receive a PermissionDenied error if an attempt is - // made to load config without the --allow-read flag: - if (ex.name === 'PermissionDenied') - error = ex; - else if (argv[configKey]) - error = Error(__('Invalid JSON config file: %s', configPath)); - } - } - }); - } - // set args from config object. - // it recursively checks nested objects. - function setConfigObject(config, prev) { - Object.keys(config).forEach(function (key) { - const value = config[key]; - const fullKey = prev ? prev + '.' + key : key; - // if the value is an inner object and we have dot-notation - // enabled, treat inner objects in config the same as - // heavily nested dot notations (foo.bar.apple). - if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) { - // if the value is an object but not an array, check nested object - setConfigObject(value, fullKey); - } - else { - // setting arguments via CLI takes precedence over - // values within the config file. - if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) { - setArg(fullKey, value); - } - } - }); - } - // set all config objects passed in opts - function setConfigObjects() { - if (typeof configObjects !== 'undefined') { - configObjects.forEach(function (configObject) { - setConfigObject(configObject); - }); - } - } - function applyEnvVars(argv, configOnly) { - if (typeof envPrefix === 'undefined') - return; - const prefix = typeof envPrefix === 'string' ? envPrefix : ''; - const env = mixin.env(); - Object.keys(env).forEach(function (envVar) { - if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) { - // get array of nested keys and convert them to camel case - const keys = envVar.split('__').map(function (key, i) { - if (i === 0) { - key = key.substring(prefix.length); - } - return camelCase(key); - }); - if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) { - setArg(keys.join('.'), env[envVar]); - } - } - }); - } - function applyCoercions(argv) { - let coerce; - const applied = new Set(); - Object.keys(argv).forEach(function (key) { - if (!applied.has(key)) { // If we haven't already coerced this option via one of its aliases - coerce = checkAllAliases(key, flags.coercions); - if (typeof coerce === 'function') { - try { - const value = maybeCoerceNumber(key, coerce(argv[key])); - ([].concat(flags.aliases[key] || [], key)).forEach(ali => { - applied.add(ali); - argv[ali] = value; - }); - } - catch (err) { - error = err; - } - } - } - }); - } - function setPlaceholderKeys(argv) { - flags.keys.forEach((key) => { - // don't set placeholder keys for dot notation options 'foo.bar'. - if (~key.indexOf('.')) - return; - if (typeof argv[key] === 'undefined') - argv[key] = undefined; - }); - return argv; - } - function applyDefaultsAndAliases(obj, aliases, defaults, canLog = false) { - Object.keys(defaults).forEach(function (key) { - if (!hasKey(obj, key.split('.'))) { - setKey(obj, key.split('.'), defaults[key]); - if (canLog) - defaulted[key] = true; - (aliases[key] || []).forEach(function (x) { - if (hasKey(obj, x.split('.'))) - return; - setKey(obj, x.split('.'), defaults[key]); - }); - } - }); - } - function hasKey(obj, keys) { - let o = obj; - if (!configuration['dot-notation']) - keys = [keys.join('.')]; - keys.slice(0, -1).forEach(function (key) { - o = (o[key] || {}); - }); - const key = keys[keys.length - 1]; - if (typeof o !== 'object') - return false; - else - return key in o; - } - function setKey(obj, keys, value) { - let o = obj; - if (!configuration['dot-notation']) - keys = [keys.join('.')]; - keys.slice(0, -1).forEach(function (key) { - // TODO(bcoe): in the next major version of yargs, switch to - // Object.create(null) for dot notation: - key = sanitizeKey(key); - if (typeof o === 'object' && o[key] === undefined) { - o[key] = {}; - } - if (typeof o[key] !== 'object' || Array.isArray(o[key])) { - // ensure that o[key] is an array, and that the last item is an empty object. - if (Array.isArray(o[key])) { - o[key].push({}); - } - else { - o[key] = [o[key], {}]; - } - // we want to update the empty object at the end of the o[key] array, so set o to that object - o = o[key][o[key].length - 1]; - } - else { - o = o[key]; - } - }); - // TODO(bcoe): in the next major version of yargs, switch to - // Object.create(null) for dot notation: - const key = sanitizeKey(keys[keys.length - 1]); - const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays); - const isValueArray = Array.isArray(value); - let duplicate = configuration['duplicate-arguments-array']; - // nargs has higher priority than duplicate - if (!duplicate && checkAllAliases(key, flags.nargs)) { - duplicate = true; - if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) { - o[key] = undefined; - } - } - if (value === increment()) { - o[key] = increment(o[key]); - } - else if (Array.isArray(o[key])) { - if (duplicate && isTypeArray && isValueArray) { - o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]); - } - else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { - o[key] = value; - } - else { - o[key] = o[key].concat([value]); - } - } - else if (o[key] === undefined && isTypeArray) { - o[key] = isValueArray ? value : [value]; - } - else if (duplicate && !(o[key] === undefined || - checkAllAliases(key, flags.counts) || - checkAllAliases(key, flags.bools))) { - o[key] = [o[key], value]; - } - else { - o[key] = value; - } - } - // extend the aliases list with inferred aliases. - function extendAliases(...args) { - args.forEach(function (obj) { - Object.keys(obj || {}).forEach(function (key) { - // short-circuit if we've already added a key - // to the aliases array, for example it might - // exist in both 'opts.default' and 'opts.key'. - if (flags.aliases[key]) - return; - flags.aliases[key] = [].concat(aliases[key] || []); - // For "--option-name", also set argv.optionName - flags.aliases[key].concat(key).forEach(function (x) { - if (/-/.test(x) && configuration['camel-case-expansion']) { - const c = camelCase(x); - if (c !== key && flags.aliases[key].indexOf(c) === -1) { - flags.aliases[key].push(c); - newAliases[c] = true; - } - } - }); - // For "--optionName", also set argv['option-name'] - flags.aliases[key].concat(key).forEach(function (x) { - if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) { - const c = decamelize(x, '-'); - if (c !== key && flags.aliases[key].indexOf(c) === -1) { - flags.aliases[key].push(c); - newAliases[c] = true; - } - } - }); - flags.aliases[key].forEach(function (x) { - flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - }); - } - function checkAllAliases(key, flag) { - const toCheck = [].concat(flags.aliases[key] || [], key); - const keys = Object.keys(flag); - const setAlias = toCheck.find(key => keys.includes(key)); - return setAlias ? flag[setAlias] : false; - } - function hasAnyFlag(key) { - const flagsKeys = Object.keys(flags); - const toCheck = [].concat(flagsKeys.map(k => flags[k])); - return toCheck.some(function (flag) { - return Array.isArray(flag) ? flag.includes(key) : flag[key]; - }); - } - function hasFlagsMatching(arg, ...patterns) { - const toCheck = [].concat(...patterns); - return toCheck.some(function (pattern) { - const match = arg.match(pattern); - return match && hasAnyFlag(match[1]); - }); - } - // based on a simplified version of the short flag group parsing logic - function hasAllShortFlags(arg) { - // if this is a negative number, or doesn't start with a single hyphen, it's not a short flag group - if (arg.match(negative) || !arg.match(/^-[^-]+/)) { - return false; - } - let hasAllFlags = true; - let next; - const letters = arg.slice(1).split(''); - for (let j = 0; j < letters.length; j++) { - next = arg.slice(j + 2); - if (!hasAnyFlag(letters[j])) { - hasAllFlags = false; - break; - } - if ((letters[j + 1] && letters[j + 1] === '=') || - next === '-' || - (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || - (letters[j + 1] && letters[j + 1].match(/\W/))) { - break; - } - } - return hasAllFlags; - } - function isUnknownOptionAsArg(arg) { - return configuration['unknown-options-as-args'] && isUnknownOption(arg); - } - function isUnknownOption(arg) { - arg = arg.replace(/^-{3,}/, '--'); - // ignore negative numbers - if (arg.match(negative)) { - return false; - } - // if this is a short option group and all of them are configured, it isn't unknown - if (hasAllShortFlags(arg)) { - return false; - } - // e.g. '--count=2' - const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; - // e.g. '-a' or '--arg' - const normalFlag = /^-+([^=]+?)$/; - // e.g. '-a-' - const flagEndingInHyphen = /^-+([^=]+?)-$/; - // e.g. '-abc123' - const flagEndingInDigits = /^-+([^=]+?\d+)$/; - // e.g. '-a/usr/local' - const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; - // check the different types of flag styles, including negatedBoolean, a pattern defined near the start of the parse method - return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters); - } - // make a best effort to pick a default value - // for an option based on name and type. - function defaultValue(key) { - if (!checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts) && - `${key}` in defaults) { - return defaults[key]; - } - else { - return defaultForType(guessType(key)); - } - } - // return a default value, given the type of a flag., - function defaultForType(type) { - const def = { - [DefaultValuesForTypeKey.BOOLEAN]: true, - [DefaultValuesForTypeKey.STRING]: '', - [DefaultValuesForTypeKey.NUMBER]: undefined, - [DefaultValuesForTypeKey.ARRAY]: [] - }; - return def[type]; - } - // given a flag, enforce a default type. - function guessType(key) { - let type = DefaultValuesForTypeKey.BOOLEAN; - if (checkAllAliases(key, flags.strings)) - type = DefaultValuesForTypeKey.STRING; - else if (checkAllAliases(key, flags.numbers)) - type = DefaultValuesForTypeKey.NUMBER; - else if (checkAllAliases(key, flags.bools)) - type = DefaultValuesForTypeKey.BOOLEAN; - else if (checkAllAliases(key, flags.arrays)) - type = DefaultValuesForTypeKey.ARRAY; - return type; - } - function isUndefined(num) { - return num === undefined; - } - // check user configuration settings for inconsistencies - function checkConfiguration() { - // count keys should not be set as array/narg - Object.keys(flags.counts).find(key => { - if (checkAllAliases(key, flags.arrays)) { - error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key)); - return true; - } - else if (checkAllAliases(key, flags.nargs)) { - error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key)); - return true; - } - return false; - }); - } - return { - aliases: Object.assign({}, flags.aliases), - argv: Object.assign(argvReturn, argv), - configuration: configuration, - defaulted: Object.assign({}, defaulted), - error: error, - newAliases: Object.assign({}, newAliases) - }; - } -} -// if any aliases reference each other, we should -// merge them together. -function combineAliases(aliases) { - const aliasArrays = []; - const combined = Object.create(null); - let change = true; - // turn alias lookup hash {key: ['alias1', 'alias2']} into - // a simple array ['key', 'alias1', 'alias2'] - Object.keys(aliases).forEach(function (key) { - aliasArrays.push([].concat(aliases[key], key)); - }); - // combine arrays until zero changes are - // made in an iteration. - while (change) { - change = false; - for (let i = 0; i < aliasArrays.length; i++) { - for (let ii = i + 1; ii < aliasArrays.length; ii++) { - const intersect = aliasArrays[i].filter(function (v) { - return aliasArrays[ii].indexOf(v) !== -1; - }); - if (intersect.length) { - aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]); - aliasArrays.splice(ii, 1); - change = true; - break; - } - } - } - } - // map arrays back to the hash-lookup (de-dupe while - // we're at it). - aliasArrays.forEach(function (aliasArray) { - aliasArray = aliasArray.filter(function (v, i, self) { - return self.indexOf(v) === i; - }); - const lastAlias = aliasArray.pop(); - if (lastAlias !== undefined && typeof lastAlias === 'string') { - combined[lastAlias] = aliasArray; - } - }); - return combined; -} -// this function should only be called when a count is given as an arg -// it is NOT called to set a default value -// thus we can start the count at 1 instead of 0 -function increment(orig) { - return orig !== undefined ? orig + 1 : 1; -} -// TODO(bcoe): in the next major version of yargs, switch to -// Object.create(null) for dot notation: -function sanitizeKey(key) { - if (key === '__proto__') - return '___proto___'; - return key; -} diff --git a/node_modules/yargs-parser/package.json b/node_modules/yargs-parser/package.json deleted file mode 100644 index f97aa9e5d..000000000 --- a/node_modules/yargs-parser/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "yargs-parser", - "version": "20.2.9", - "description": "the mighty option parser used by yargs", - "main": "build/index.cjs", - "exports": { - ".": [ - { - "import": "./build/lib/index.js", - "require": "./build/index.cjs" - }, - "./build/index.cjs" - ] - }, - "type": "module", - "module": "./build/lib/index.js", - "scripts": { - "check": "standardx '**/*.ts' && standardx '**/*.js' && standardx '**/*.cjs'", - "fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js' && standardx --fix '**/*.cjs'", - "pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs", - "test": "c8 --reporter=text --reporter=html mocha test/*.cjs", - "test:browser": "start-server-and-test 'serve ./ -p 8080' http://127.0.0.1:8080/package.json 'node ./test/browser/yargs-test.cjs'", - "pretest:typescript": "npm run pretest", - "test:typescript": "c8 mocha ./build/test/typescript/*.js", - "coverage": "c8 report --check-coverage", - "precompile": "rimraf build", - "compile": "tsc", - "postcompile": "npm run build:cjs", - "build:cjs": "rollup -c", - "prepare": "npm run compile" - }, - "repository": { - "type": "git", - "url": "https://github.com/yargs/yargs-parser.git" - }, - "keywords": [ - "argument", - "parser", - "yargs", - "command", - "cli", - "parsing", - "option", - "args", - "argument" - ], - "author": "Ben Coe ", - "license": "ISC", - "devDependencies": { - "@types/chai": "^4.2.11", - "@types/mocha": "^8.0.0", - "@types/node": "^14.0.0", - "@typescript-eslint/eslint-plugin": "^3.10.1", - "@typescript-eslint/parser": "^3.10.1", - "@wessberg/rollup-plugin-ts": "^1.2.28", - "c8": "^7.3.0", - "chai": "^4.2.0", - "cross-env": "^7.0.2", - "eslint": "^7.0.0", - "eslint-plugin-import": "^2.20.1", - "eslint-plugin-node": "^11.0.0", - "gts": "^3.0.0", - "mocha": "^9.0.0", - "puppeteer": "^10.0.0", - "rimraf": "^3.0.2", - "rollup": "^2.22.1", - "rollup-plugin-cleanup": "^3.1.1", - "serve": "^12.0.0", - "standardx": "^7.0.0", - "start-server-and-test": "^1.11.2", - "ts-transform-default-export": "^1.0.2", - "typescript": "^4.0.0" - }, - "files": [ - "browser.js", - "build", - "!*.d.ts" - ], - "engines": { - "node": ">=10" - }, - "standardx": { - "ignore": [ - "build" - ] - } -} diff --git a/node_modules/yocto-queue/index.d.ts b/node_modules/yocto-queue/index.d.ts deleted file mode 100644 index 9541986b4..000000000 --- a/node_modules/yocto-queue/index.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -declare class Queue implements Iterable { - /** - The size of the queue. - */ - readonly size: number; - - /** - Tiny queue data structure. - - The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow. - - @example - ``` - import Queue = require('yocto-queue'); - - const queue = new Queue(); - - queue.enqueue('🦄'); - queue.enqueue('🌈'); - - console.log(queue.size); - //=> 2 - - console.log(...queue); - //=> '🦄 🌈' - - console.log(queue.dequeue()); - //=> '🦄' - - console.log(queue.dequeue()); - //=> '🌈' - ``` - */ - constructor(); - - [Symbol.iterator](): IterableIterator; - - /** - Add a value to the queue. - */ - enqueue(value: ValueType): void; - - /** - Remove the next value in the queue. - - @returns The removed value or `undefined` if the queue is empty. - */ - dequeue(): ValueType | undefined; - - /** - Clear the queue. - */ - clear(): void; -} - -export = Queue; diff --git a/node_modules/yocto-queue/index.js b/node_modules/yocto-queue/index.js deleted file mode 100644 index 2f3e6dcd7..000000000 --- a/node_modules/yocto-queue/index.js +++ /dev/null @@ -1,68 +0,0 @@ -class Node { - /// value; - /// next; - - constructor(value) { - this.value = value; - - // TODO: Remove this when targeting Node.js 12. - this.next = undefined; - } -} - -class Queue { - // TODO: Use private class fields when targeting Node.js 12. - // #_head; - // #_tail; - // #_size; - - constructor() { - this.clear(); - } - - enqueue(value) { - const node = new Node(value); - - if (this._head) { - this._tail.next = node; - this._tail = node; - } else { - this._head = node; - this._tail = node; - } - - this._size++; - } - - dequeue() { - const current = this._head; - if (!current) { - return; - } - - this._head = this._head.next; - this._size--; - return current.value; - } - - clear() { - this._head = undefined; - this._tail = undefined; - this._size = 0; - } - - get size() { - return this._size; - } - - * [Symbol.iterator]() { - let current = this._head; - - while (current) { - yield current.value; - current = current.next; - } - } -} - -module.exports = Queue; diff --git a/node_modules/yocto-queue/license b/node_modules/yocto-queue/license deleted file mode 100644 index fa7ceba3e..000000000 --- a/node_modules/yocto-queue/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://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. diff --git a/node_modules/yocto-queue/package.json b/node_modules/yocto-queue/package.json deleted file mode 100644 index 71a91017b..000000000 --- a/node_modules/yocto-queue/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "yocto-queue", - "version": "0.1.0", - "description": "Tiny queue data structure", - "license": "MIT", - "repository": "sindresorhus/yocto-queue", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "queue", - "data", - "structure", - "algorithm", - "queues", - "queuing", - "list", - "array", - "linkedlist", - "fifo", - "enqueue", - "dequeue", - "data-structure" - ], - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.13.1", - "xo": "^0.35.0" - } -} diff --git a/node_modules/yocto-queue/readme.md b/node_modules/yocto-queue/readme.md deleted file mode 100644 index c72fefc48..000000000 --- a/node_modules/yocto-queue/readme.md +++ /dev/null @@ -1,64 +0,0 @@ -# yocto-queue [![](https://badgen.net/bundlephobia/minzip/yocto-queue)](https://bundlephobia.com/result?p=yocto-queue) - -> Tiny queue data structure - -You should use this package instead of an array if you do a lot of `Array#push()` and `Array#shift()` on large arrays, since `Array#shift()` has [linear time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(N)%E2%80%94Linear%20Time) *O(n)* while `Queue#dequeue()` has [constant time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(1)%20%E2%80%94%20Constant%20Time) *O(1)*. That makes a huge difference for large arrays. - -> A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is an ordered list of elements where an element is inserted at the end of the queue and is removed from the front of the queue. A queue works based on the first-in, first-out ([FIFO](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics))) principle. - -## Install - -``` -$ npm install yocto-queue -``` - -## Usage - -```js -const Queue = require('yocto-queue'); - -const queue = new Queue(); - -queue.enqueue('🦄'); -queue.enqueue('🌈'); - -console.log(queue.size); -//=> 2 - -console.log(...queue); -//=> '🦄 🌈' - -console.log(queue.dequeue()); -//=> '🦄' - -console.log(queue.dequeue()); -//=> '🌈' -``` - -## API - -### `queue = new Queue()` - -The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow. - -#### `.enqueue(value)` - -Add a value to the queue. - -#### `.dequeue()` - -Remove the next value in the queue. - -Returns the removed value or `undefined` if the queue is empty. - -#### `.clear()` - -Clear the queue. - -#### `.size` - -The size of the queue. - -## Related - -- [quick-lru](https://github.com/sindresorhus/quick-lru) - Simple “Least Recently Used” (LRU) cache From bb632a4c8edafcc85f71d2c5bd4a5e7e0a432e04 Mon Sep 17 00:00:00 2001 From: mariam Date: Tue, 11 Jul 2023 16:29:18 +0100 Subject: [PATCH 038/156] docker section in readme file has been updated --- README.md | 480 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 252 insertions(+), 228 deletions(-) diff --git a/README.md b/README.md index 951c4307a..a17786e87 100644 --- a/README.md +++ b/README.md @@ -19,65 +19,102 @@ git commit -m "My informative commit message" git push ``` - Unix-ish Developer Required Software +Unix-ish Developer Required Software -## Required software +## Required software -NOTE: Before reading the following instructions you may want to consider +NOTE: Before reading the following instructions you may want to consider installing the web site as a Docker container. See the instructions below. -1. Make a fork and clone the git repository for bioconductor.org and - create a new branch to make your changes, (helpful documentation for - [Creating a pull request from a fork][]) +1. Make a fork and clone the git repository for bioconductor.org and + create a new branch to make your changes, (helpful documentation for + [Creating a pull request from a fork][]) - git clone https://github.com//bioconductor.org + git clone https://github.com//bioconductor.org -2. Make your changes on this branch, add content or edit content. +2. Build a docker image by navigating to the right directory and running + this command -3. Once the changes are made, you need use the docker image - `bioconductor/website:latest` and run the - container. The container has the dependencies installed to `rake` - the ruby code and host the website on your local machine at - https://localhost:3000. + docker build -t . - docker run -v //bioconductor.org:/bioconductor.org/ \ - -p 3000:3000 \ - bioconductor/website:latest + where, - where, + - t is the name of docker image + +3. Run the docker container before making any changes, you need to use the + docker image name `` that you assigned previously to be able to + run the container. The container has the dependencies installed to `rake` + the ruby code and host the website on your local machine at + https://localhost:3000. + + docker run -it -p 3000:3000 \ + -v //bioconductor.org:/opt/bioconductor.org \ + /bin/bash + + where, + + -it will take you straight to the container -p is mapping the container's port 3000 to the host machine's port -v mounting a volume, the website (bioconductor.org) directory from your local machine is being mounted on the docker container -4. Then to kill the process, you need to get the CONTAINER ID with, + it will take you to the container's terminal so you will need to run + + rake + + and + + cd output + adsf + +4. Make your changes on this branch, add content or edit content. + +5. Once the changes are made and you want to be able to see them on + https://localhost:3000, there are two ways to be able to run `rake`: + + by running `rake` inside the docker container shell making sure you + are in the `/opt/bioconductor.org` directory. - docker ps + or, - and, + without needing to access the docker shell but you will need the + CONTAINER ID, you can run - docker kill + docker ps -5. Before you run the docker image again with more changes, make sure - to clean the artifacts produced by the `rake` command, with + and, - git clean -xdf + docker exec rake - The output should look like, +6. Then to kill the process, you need to get the CONTAINER ID with, - bioconductor.org$ git clean -xdf - Removing assets/bioc-devel-version - Removing assets/bioc-version - Removing assets/config.yaml - Removing content/packages/ - Removing output/ - Removing tmp/ + docker ps -6. Once you have reviewed your changes, make a new branch and send a pull - request to the `devel` branch. The pull request should be made from your - `my_changes` branch to the [devel branch on GitHub][]. + and, + + docker kill + +7. Before you run the docker image again with more changes, make sure + to clean the artifacts produced by the `rake` command, with + + git clean -xdf + + The output should look like, + + bioconductor.org$ git clean -xdf + Removing assets/bioc-devel-version + Removing assets/bioc-version + Removing assets/config.yaml + Removing content/packages/ + Removing output/ + Removing tmp/ + +8. Once you have reviewed your changes, make a new branch and send a pull + request to the `devel` branch. The pull request should be made from your + `my_changes` branch to the [devel branch on GitHub][]. [devel branch on GitHub]: https://github.com/Bioconductor/bioconductor.org [Creating a pull request from a fork]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork @@ -90,68 +127,68 @@ There are numerous issues on various platforms when attempting to install appropriate versions of ruby and the necessary ruby packages. The simplest way around all of this is to use rbenv, which allows you to switch between various ruby versions and avoids conflicts between them. -*NOTE*: rbenv works on Unix only; if you are on Windows, skip to +_NOTE_: rbenv works on Unix only; if you are on Windows, skip to the Windows section. On ubuntu, before proceeding, make sure the `libsqlite3-dev` package is installed (`sudo apt-get install libsqlite3-dev`). -The following instructions are adapted from the +The following instructions are adapted from the [rbenv page](https://github.com/rbenv/rbenv). It's worth reading this to understand how rbenv works. -*Important note*: Never use `sudo` when working with a ruby that has been +_Important note_: Never use `sudo` when working with a ruby that has been installed by rbenv. rbenv installs everything in your home directory so you should never need to become root or fiddle with permissions. -0. Make sure you do not have rvm installed. `which rvm` should not return - anything. If you do have it installed, refer to - [this page](http://stackoverflow.com/questions/3950260/howto-uninstall-rvm) - for instructions on removing it. +0. Make sure you do not have rvm installed. `which rvm` should not return + anything. If you do have it installed, refer to + [this page](http://stackoverflow.com/questions/3950260/howto-uninstall-rvm) + for instructions on removing it. -1. Check out rbenv into `~/.rbenv`. +1. Check out rbenv into `~/.rbenv`. - ~~~ sh + ```sh $ git clone https://github.com/rbenv/rbenv.git ~/.rbenv - ~~~ + ``` -2. Add `~/.rbenv/bin` to your `$PATH` for access to the `rbenv` - command-line utility. +2. Add `~/.rbenv/bin` to your `$PATH` for access to the `rbenv` + command-line utility. - ~~~ sh + ```sh $ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile - ~~~ + ``` **Ubuntu Desktop note**: Modify your `~/.bashrc` instead of `~/.bash_profile`. **Zsh note**: Modify your `~/.zshrc` file instead of `~/.bash_profile`. -3. Add `rbenv init` to your shell to enable shims and autocompletion. +3. Add `rbenv init` to your shell to enable shims and autocompletion. - ~~~ sh + ```sh $ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile - ~~~ + ``` _Same as in previous step, use `~/.bashrc` on Ubuntu, or `~/.zshrc` for Zsh._ -4. Restart your shell so that PATH changes take effect. (Opening a new - terminal tab will usually do it.) Now check if rbenv was set up: +4. Restart your shell so that PATH changes take effect. (Opening a new + terminal tab will usually do it.) Now check if rbenv was set up: - ~~~ sh + ```sh $ type rbenv #=> "rbenv is a function" - ~~~ + ``` -5. Install -[ruby-build](https://github.com/rbenv/ruby-build), -which provides the `rbenv install` command that simplifies the process of -installing new Ruby versions: +5. Install + [ruby-build](https://github.com/rbenv/ruby-build), + which provides the `rbenv install` command that simplifies the process of + installing new Ruby versions: - ~~~ sh - git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build - ~~~ + ~~~ sh + git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build + ~~~ -Now you need to install ruby. Go to the +Now you need to install ruby. Go to the [Ruby Downloads Page](https://www.ruby-lang.org/en/downloads/) to find out what the current stable version is. As of 3/06/2020 it is 2.7.0 however that particular version still had issues with modules, so I will @@ -171,22 +208,19 @@ If you want to use different versions of ruby in different contexts, read the [rbenv page](https://github.com/rbenv/rbenv) for more information. - - ## Windows Developer Required Software 1. Download and run the one-click ruby installer http://rubyinstaller.org/downloads/. Accept all default settings. 2. Also download and install the Development Kit from - http://rubyinstaller.org/downloads/. Be sure and add the bin dir + http://rubyinstaller.org/downloads/. Be sure and add the bin dir to your path (see devkitvars.bat) 3. If you don't already have it, be sure and install cygwin and explicitly install rsync. rsync is required for parts of the web site to work. - 4. Install git client. https://git-scm.com/downloads 5. Follow the developer setup instructions below. @@ -202,7 +236,6 @@ for more information. Ruby packages are called gems and `gem` is the program used to install them. - To save time, ensure your ~/.gemrc file contains the text gem: --no-document @@ -213,27 +246,25 @@ that you will not use. The web site comes with a Gemfile which is similar to an R package DESCRIPTION file in that it lists all dependencies needed. Gemfiles are read by the `bundler` gem, so install that as follows, prepending `sudo` if -necessary (remember, *don't* use `sudo` if your ruby was installed +necessary (remember, _don't_ use `sudo` if your ruby was installed with `rbenv`: cd bioconductor.org gem install bundler - Then, assuming you are in the bioconductor.org working copy, issue this command to install all dependencies, again prepending `sudo` if necessary: bundle install - ### Build the site cd bioconductor.org # if you aren't already in the working copy rake -One step in the build process runs 'nanoc', "a Ruby web publishing system -for building small to medium-sized websites"; it is one of the -gems you installed above. If you ever need to run nanoc explicitly: +One step in the build process runs 'nanoc', "a Ruby web publishing system +for building small to medium-sized websites"; it is one of the +gems you installed above. If you ever need to run nanoc explicitly: nanoc compile @@ -241,45 +272,44 @@ To run an abbreviated compile, which does not attempt to build all package pages QUICK_NANOC_COMPILE=true nanoc co -Whether run by hand or by rake, the compiled html files are all found in +Whether run by hand or by rake, the compiled html files are all found in and below output/, an immediate subdirectory of the bioconductor.org/ directory -you have been working in. +you have been working in. ### Start the built-in development server, 'adsf' "A dead-simple file" server: cd output adsf - ### Test in a browser by going to http://localhost:3000/ ## Overview of site source code -* README.md :: You are reading this file or a file generated from - this file. +- README.md :: You are reading this file or a file generated from + this file. -* Rakefile :: A `Rakefile` is to `rake` as a `Makefile` is to `make`. - You can see the available targets by running `rake -T` - in the directory containing `Rakefile`. +- Rakefile :: A `Rakefile` is to `rake` as a `Makefile` is to `make`. + You can see the available targets by running `rake -T` + in the directory containing `Rakefile`. -* Rules :: This is a Ruby syntax file that describes how site content - is transformed from its source form into its output form - (this is called filtering), what layout to use (layouts are - the shared templates), and where to write the output (this - is called routing). See the nanoc - [tutorial](http://nanoc.stoneship.org/tutorial/) and the - [manual](http://nanoc.stoneship.org/manual/) for details. +- Rules :: This is a Ruby syntax file that describes how site content + is transformed from its source form into its output form + (this is called filtering), what layout to use (layouts are + the shared templates), and where to write the output (this + is called routing). See the nanoc + [tutorial](http://nanoc.stoneship.org/tutorial/) and the + [manual](http://nanoc.stoneship.org/manual/) for details. -* assets :: This directory is not managed by nanoc. It contains files - that do not undergo any filtering, layout-ing, or routing. - Contents of the assets directory are copied to the output - directory using rsync. +- assets :: This directory is not managed by nanoc. It contains files + that do not undergo any filtering, layout-ing, or routing. + Contents of the assets directory are copied to the output + directory using rsync. -* config.yaml :: Nanoc configuration file for the bioconductor.org - site. This file is written in [YAML](http://www.yaml.org/). +- config.yaml :: Nanoc configuration file for the bioconductor.org + site. This file is written in [YAML](http://www.yaml.org/). -* content :: This is where the bulk of the raw (source form) site - content lives. Important details: +- content :: This is where the bulk of the raw (source form) site + content lives. Important details: - Content always has two related files: a `.yaml` file containing item attributes and a `.` file @@ -291,23 +321,23 @@ you have been working in. `output/help/index.html`. This scheme allows for clean URLs that avoid having a file extension. -* layouts :: This is where the content templates live. +- layouts :: This is where the content templates live. -* lib :: Ruby helper functions and nanoc extensions live here. Files - in this directory are automatically loaded by nanoc during - site processing. +- lib :: Ruby helper functions and nanoc extensions live here. Files + in this directory are automatically loaded by nanoc during + site processing. -* migration :: Documentation and scripts used in the process of - migrating the bioconductor.org site from Plone to - nanoc. +- migration :: Documentation and scripts used in the process of + migrating the bioconductor.org site from Plone to + nanoc. -* output :: This directory is created when you compile the - bioconductor.org site using nanoc. It contains the final - static HTML and other assets. Deploying the site means - pushing out an update of the contents of output to the - live server. +- output :: This directory is created when you compile the + bioconductor.org site using nanoc. It contains the final + static HTML and other assets. Deploying the site means + pushing out an update of the contents of output to the + live server. -* scripts :: Helper scripts for managing the site live here. +- scripts :: Helper scripts for managing the site live here. ## How to add a page @@ -316,13 +346,13 @@ you have been working in. You will use a helper scripts `./scripts/add_event` to add event to the site using the following steps: -1. Always run `./scripts/add_event` from the top-level of your - website working copy -1. Run `./scripts/add_event EVENT_NAME` - This will create an EVENT_NAME.yaml file in the - `./content/help/events/` directory -1. The default `EVENT_NAME.yaml` file will look like this: - +1. Always run `./scripts/add_event` from the top-level of your + website working copy +1. Run `./scripts/add_event EVENT_NAME` + This will create an EVENT_NAME.yaml file in the + `./content/help/events/` directory +1. The default `EVENT_NAME.yaml` file will look like this: + title: TITLE FOR EVENT_NAME location: Seattle, WA, USA event_host: FHCRC @@ -332,16 +362,16 @@ to the site using the following steps: text: details and registration url: https://secure.bioconductor.org/EVENT_NAME -1. Edit the `EVENT_NAME.yaml` file -1. Use git to commit changes and additions by `add_event` - +1. Edit the `EVENT_NAME.yaml` file +1. Use git to commit changes and additions by `add_event` + ## How to add course material You will use a helper script `./scripts/course_mgr` to add course material to the site. PDF files for labs and presentations as well -as course-specific packages and data are *not* stored in git. The +as course-specific packages and data are _not_ stored in git. The index pages that describe the course and provide links to the -materials *are* stored in git. The `course_mgr` script will help +materials _are_ stored in git. The `course_mgr` script will help with index file creation and data transfer. ### `course_mgr` workflow and important tips @@ -359,83 +389,82 @@ To add a course, you will typically perform the following steps ### Using `course_mgr` -1. Generate a skeleton course directory structure. - - ./scripts/course_mgr --create seattle-intro - - This will create a `seattle-intro/` directory in the top-level - of your website working copy -- do not add this directory or any - files within it to git. Inside will be a `course_config.yaml` - file that will look like this: - - title: - The title of the course goes here - start_date: 2010-01-27 - end_date: 2010-01-29 - instructors: ["Someone", "Another"] - location: "Seattle, USA" - url: https://secure.bioconductor.org/SeattleJan10/ - tags: ["intro", "seattle", "package"] - description: - You can put some description text here. - Must be indented. - -2. Put course materials as files and directories into the skeleton - directory. For example, you might end up with a directory like - that shown below with two subdirectories, `packages` and - `presentation-slides`, each containing course materials. - - seattle-intro - |-- course_config.yaml - |-- packages - | |-- day1_0.0.1.tar.gz - | |-- day2_0.0.1.tar.gz - | `-- day3_0.0.1.tar.gz - `-- presentation-slides - |-- First-steps-presentation.pdf - |-- Microarray-presentation.pdf - |-- annotation-presentation.pdf - `-- sequence-presentation.pdf - -3. Now you are ready to create the index files. - - ./scripts/course_mgr --index seattle-intro - CREATED: content/help/course-notes/2010/01/seattle-intro.(html|yaml) - COPIED for preview: - src: ./seattle-intro/* - dst: output/help/course-notes/2010/01/seattle-intro/ - NEXT STEPS: - - preview site with 'rake devserver' - - Use URL: http://localhost:3000/help/course-materials/2010/seattle-intro/ - - edit CREATED files to add descriptions for links - - if happy, run ./scripts/course_mgr --push 2010/seattle-intro - - - This will create a course index content item in content filed - appropriately based on the metadata provided in - `course_config.yaml`. It will also copy the files and directories - you created into the output directory so that you can do a full - preview after compiling the site. - -4. If everything looks good, you can sync the data files to the web - server (note that we do not put these files in git because large - data files are not appropriate for git and they are not likely to - change): - - ./scripts/course_mgr --push 2010/seattle-intro - SYNC: - src: ./seattle-intro - dst: biocadmin@staging.bioconductor.org:/loc/www/bioconductor-test.fhcrc.org/help/course-materials/2010/ - NEXT STEPS: git add/commit changes in contents - -5. Finally, "git add" the new course index html and yaml files that were generated in the - content directory and commit. +1. Generate a skeleton course directory structure. + + ./scripts/course_mgr --create seattle-intro + + This will create a `seattle-intro/` directory in the top-level + of your website working copy -- do not add this directory or any + files within it to git. Inside will be a `course_config.yaml` + file that will look like this: + + title: + The title of the course goes here + start_date: 2010-01-27 + end_date: 2010-01-29 + instructors: ["Someone", "Another"] + location: "Seattle, USA" + url: https://secure.bioconductor.org/SeattleJan10/ + tags: ["intro", "seattle", "package"] + description: + You can put some description text here. + Must be indented. + +2. Put course materials as files and directories into the skeleton + directory. For example, you might end up with a directory like + that shown below with two subdirectories, `packages` and + `presentation-slides`, each containing course materials. + + seattle-intro + |-- course_config.yaml + |-- packages + | |-- day1_0.0.1.tar.gz + | |-- day2_0.0.1.tar.gz + | `-- day3_0.0.1.tar.gz + `-- presentation-slides + |-- First-steps-presentation.pdf + |-- Microarray-presentation.pdf + |-- annotation-presentation.pdf + `-- sequence-presentation.pdf + +3. Now you are ready to create the index files. + + ./scripts/course_mgr --index seattle-intro + CREATED: content/help/course-notes/2010/01/seattle-intro.(html|yaml) + COPIED for preview: + src: ./seattle-intro/* + dst: output/help/course-notes/2010/01/seattle-intro/ + NEXT STEPS: + - preview site with 'rake devserver' + - Use URL: http://localhost:3000/help/course-materials/2010/seattle-intro/ + - edit CREATED files to add descriptions for links + - if happy, run ./scripts/course_mgr --push 2010/seattle-intro + + This will create a course index content item in content filed + appropriately based on the metadata provided in + `course_config.yaml`. It will also copy the files and directories + you created into the output directory so that you can do a full + preview after compiling the site. + +4. If everything looks good, you can sync the data files to the web + server (note that we do not put these files in git because large + data files are not appropriate for git and they are not likely to + change): + + ./scripts/course_mgr --push 2010/seattle-intro + SYNC: + src: ./seattle-intro + dst: biocadmin@staging.bioconductor.org:/loc/www/bioconductor-test.fhcrc.org/help/course-materials/2010/ + NEXT STEPS: git add/commit changes in contents + +5. Finally, "git add" the new course index html and yaml files that were generated in the + content directory and commit. ### Modifying an existing course You can edit the pages for an existing course by editing the files in `./content`. If you need to add or modify data files, run: - ./scripts/course_mgr --pull 2010/course_to_modify +./scripts/course_mgr --pull 2010/course_to_modify This will create a top-level directory called "course_to_modify". You can then add or modify course material. When finished, run @@ -445,13 +474,11 @@ You can edit the pages for an existing course by editing the files in cp course_to_modify/course_to_modify.* content/help/course_materials/2010 git commit -m "made changes" content/help/course-materials/2010/course_to_modify - - ## Adding course material to the spreadsheet The page -[http://www.bioconductor.org/help/course-materials/](http://www.bioconductor.org/help/course-materials/) -is built from the tab-delimited file `etc/course_descriptions.tsv`. +[http://www.bioconductor.org/help/course-materials/](http://www.bioconductor.org/help/course-materials/) +is built from the tab-delimited file `etc/course_descriptions.tsv`. Add information to this file using a spreadsheet program (Excel, LibreOffice, etc.). Be sure to save @@ -518,7 +545,6 @@ deployment, and log rotation (biocadmin user): */20 * * * * cd $HOME/bioc-test-web;./update_site >> log/update_site.log 2>&1 59 23 * * * /usr/sbin/logrotate -f -s /home/biocadmin/bioc-test-web/logrotateState /home/biocadmin/bioc-test-web/logrotateFiles - ### master.bioconductor.org Apache Configuration A good resource is available [http://en.opensuse.org/Apache_Quickstart_HOWTO](here). @@ -582,7 +608,7 @@ Edit /etc/apache2/sites-available/000-default.conf BrowserMatch \bMSIE !no-gzip !gzip-only-text/html - + Options Indexes FollowSymLinks @@ -635,7 +661,6 @@ Edit /etc/apache2/sites-available/000-default.conf - ## How to test for broken links You can run wget as shown below to get a report on 404s for the site. Note @@ -643,7 +668,6 @@ that this runs against the staging site so will have a lot of false positives. wget -r --spider -U "404 check with wget" -o wwwbioc.log http://master.bioconductor.org - ## Optimize redirects Currently the redirects are defined using Apache's mod_rewrite in a @@ -662,13 +686,13 @@ following changes: top-level directory. This should disable .htaccess files as it isn't enough just to remove the .htaccess file itself. - ### Site Search -The site search contains several moving parts. The search is built on +The site search contains several moving parts. The search is built on Apache Solr, which is in turn built on top of Apache Lucene. #### How to configure Solr + The default SOLR installation works fine, with the exception of the file example/solr/conf/schema.xml which must be replaced with the version in this subversion repository at etc/solr.The changes in this file enable @@ -679,8 +703,8 @@ where the solr tarball has been expanded): cd $SOLR_HOME/example; java -jar start.jar - #### How to ensure that Solr is started up at boot time (on master and staging) + On both machines there is an /etc/rc.local and /etc/init.d/rc.local script which starts Solr as above. @@ -700,13 +724,13 @@ to the Apache web server. Then we added the following if it hasn't already to ProxyStatus On This means that all requests starting with "/solr" will go to the -solr server on port 8983. This allows us to make requests to the +solr server on port 8983. This allows us to make requests to the search server without violating the "same-origin" policy. #### How the client-side portion of the search works The page /search/index.html includes some javascript (in the file -js/search.html) which in turn uses jQuery. The code parses the +js/search.html) which in turn uses jQuery. The code parses the arguments in the URL and then makes an AJAX request to the SOLR server which returns a JSON string. The javascript code converts that to an object and then renders the search response page. @@ -714,10 +738,12 @@ that to an object and then renders the search response page. #### How to rebuild the search index Note that you typically do not want to do this by hand as it is handled -by cron jobs (see below). +by cron jobs (see below). # NOTE: this may need debugging for staging.bioconductor.org -# from transition from merlot2 + +# from transition from merlot2 + On staging.bioconductor.org (ssh to staging.bioconductor.org): cd ~/biocadmin/bioc-test-web/bioconductor.org @@ -725,20 +751,19 @@ On staging.bioconductor.org (ssh to staging.bioconductor.org): What this command does: -* Runs a Ruby class which determines which files need to be (re)indexed. -* This uses a cache file containing the names of each file and their modification times - as of the last time the script was run. If the cache file does not exist, all files +- Runs a Ruby class which determines which files need to be (re)indexed. +- This uses a cache file containing the names of each file and their modification times + as of the last time the script was run. If the cache file does not exist, all files are indexed. This class also handles new files and deletions. -* The class actually does not do the indexing itself; it creates another script +- The class actually does not do the indexing itself; it creates another script (index.sh -- created by scripts/search_indexer.rb) which does the actual indexing, which is accomplished by using curl to post files to the SOLR web app. To re-index files on master, ssh to staging (not master) and do this: - + cd ~/biocadmin/bioc-test-web/bioconductor.org rake index_production - #### Cron jobs for rebuilding the search index/why it is decoupled from site update Doing "crontab -l" on staging shows how the index us updated on master. Here are the relevant lines: @@ -747,12 +772,11 @@ Doing "crontab -l" on staging shows how the index us updated on master. Here are 30 */4 * * * cd $HOME/bioc-test-web/bioconductor.org && rake index_production > $HOME/bioc-test-web/production_index.log 2>&1 Notice that the search indexing process is decoupled from the site building process -(which takes place every 30 minutes). Site indexing can be a time-consuming -process (especially on master) and the site rebuilding should be quick. So +(which takes place every 30 minutes). Site indexing can be a time-consuming +process (especially on master) and the site rebuilding should be quick. So the search indexing takes place once a day on staging at 8 pm on master (where there are many more files to be indexed which originate from the build system). - ### BiocViews Pages The BiocViews pages are generated by a three-step process: @@ -787,40 +811,40 @@ installed. This is done by nanoc and handled by the DataSource subclass BiocViews (found in lib/data_sources/bioc_views.rb). This data source uses the JSON files generated in the previous step to build a single page for -each page, one for release and one for devel. The pages are rendered -by the partial layouts/_bioc_views_package_detail.html. +each page, one for release and one for devel. The pages are rendered +by the partial layouts/\_bioc_views_package_detail.html. #### Step 3: The BiocViews Hierarchy page -At http://bioconductor.org/packages. This page uses javascript to -build the tree, reading in data generated in step 1. The relevant +At http://bioconductor.org/packages. This page uses javascript to +build the tree, reading in data generated in step 1. The relevant Javascript file is assets/js/bioc_views.js. The automatically generated (by rake) file output/js/versions.js is also sourced. ### Updating the site during a release Take a look at the config.yaml file in the root of the -bioconductor.org working copy. This should be the only place you need +bioconductor.org working copy. This should be the only place you need to make changes. -# Standard Operating Procedures / SOPs / Troubleshooting +# Standard Operating Procedures / SOPs / Troubleshooting ## Problem: Web site does not seem to be updating -Symptom: Commits you made are not going through, and/or +Symptom: Commits you made are not going through, and/or the dashboard (http://bioconductor.org/dashboard/) says that the site has not been updated in over 20 minutes. It likely means that an error was introduced in a recent commit. (make sure you haven't forgotten to `git add` any files). -Solution: ssh to biocadmin@staging.bioconductor.org (ask Lori if +Solution: ssh to biocadmin@staging.bioconductor.org (ask Lori if you don't have permission to do so). Change directories: cd ~/bioc-test-web Look at the 2015 Oct 29 10:22:19 AM then its contents are relevant. You can also look at the last -few lines of `./log/update_site.log`. +few lines of `./log/update_site.log`. # Updating Ruby or Gems From 99f2473c098736ea4d6bcf3a617013b29b62d212 Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 09:39:55 +0100 Subject: [PATCH 039/156] changed package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bf27d7ea..adfd6e4e2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bioconductor.org", "version": "1.0.0", - "description": "[CloudFront](https://aws.amazon.com/cloudfront/) is a content delivery network (CDN). The idea is that if a user in say, Singapore hits our web site, the files she requested will be cached in a location near her and her next access (or that of any other user in that area) will be faster.", + "description": "This is a frontend for bioconductor.org website, The mission of the Bioconductor project is to develop, support, and disseminate free open source software that facilitates rigorous and reproducible analysis of data from current and emerging biological assays. We are dedicated to building a diverse, collaborative, and welcoming community of developers and data scientists.", "main": "index.js", "directories": { "lib": "lib" From f1e0f2c2000f8ca7b797f06e11e7eb8ace8b982b Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 09:42:25 +0100 Subject: [PATCH 040/156] changed super linter version for quicker loading --- .github/workflows/linter.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 70d393b71..055b1ba09 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - name: Lint Code Base - uses: super-linter/super-linter@v5 + uses: super-linter/super-linter@slim-v5 env: VALIDATE_ALL_CODEBASE: false DEFAULT_BRANCH: redesign2023 From f8b7a931ce69735007f77e9e88ff537de19a4c77 Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 09:45:30 +0100 Subject: [PATCH 041/156] changed super linter version for quicker loading --- .github/workflows/linter.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 055b1ba09..17c40f772 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - name: Lint Code Base - uses: super-linter/super-linter@slim-v5 + uses: super-linter/super-linter/slim@v5 env: VALIDATE_ALL_CODEBASE: false DEFAULT_BRANCH: redesign2023 From e078b9c0953f50d93178c19e8ea95aa2cbe687a2 Mon Sep 17 00:00:00 2001 From: mariam Date: Wed, 12 Jul 2023 11:28:28 +0100 Subject: [PATCH 042/156] further edits to the readme --- README.md | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index a17786e87..ada3b83d9 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,8 @@ below. where, - - t is the name of docker image + is the name you want to give to the docker image. + It can be whatever you want as it will be referenced later 3. Run the docker container before making any changes, you need to use the docker image name `` that you assigned previously to be able to @@ -50,7 +51,8 @@ below. docker run -it -p 3000:3000 \ -v //bioconductor.org:/opt/bioconductor.org \ - /bin/bash + --name \ + /bin/bash where, @@ -59,9 +61,12 @@ below. -p is mapping the container's port 3000 to the host machine's port -v mounting a volume, the website (bioconductor.org) directory - from your local machine is being mounted on the docker container + from your local machine is being mounted on the docker container - it will take you to the container's terminal so you will need to run + is the name you want to give to the docker container. + It will be easier to access the container later if you give it a name + + the command will take you to the container's terminal so you will need to run rake @@ -80,39 +85,28 @@ below. or, - without needing to access the docker shell but you will need the - CONTAINER ID, you can run + without needing to access the docker shell but you will need either the + CONTAINER ID or container name, you can run docker ps and, - docker exec rake + docker exec rake -6. Then to kill the process, you need to get the CONTAINER ID with, +6. Then to stop the process, you need to get the CONTAINER ID or container name with, docker ps and, - docker kill - -7. Before you run the docker image again with more changes, make sure - to clean the artifacts produced by the `rake` command, with - - git clean -xdf + docker stop - The output should look like, + You can also remove the container by running - bioconductor.org$ git clean -xdf - Removing assets/bioc-devel-version - Removing assets/bioc-version - Removing assets/config.yaml - Removing content/packages/ - Removing output/ - Removing tmp/ + docker kill -8. Once you have reviewed your changes, make a new branch and send a pull +7. Once you have reviewed your changes, make a new branch and send a pull request to the `devel` branch. The pull request should be made from your `my_changes` branch to the [devel branch on GitHub][]. @@ -184,9 +178,9 @@ you should never need to become root or fiddle with permissions. which provides the `rbenv install` command that simplifies the process of installing new Ruby versions: - ~~~ sh + ```sh git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build - ~~~ + ``` Now you need to install ruby. Go to the [Ruby Downloads Page](https://www.ruby-lang.org/en/downloads/) From f73f1e9143552dc2f5e7f9609c007ed6d9eb3dd7 Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 13:34:35 +0100 Subject: [PATCH 043/156] updated readme and linting information --- README.md | 455 +++++----- package-lock.json | 2073 --------------------------------------------- package.json | 19 - 3 files changed, 224 insertions(+), 2323 deletions(-) delete mode 100644 package-lock.json delete mode 100644 package.json diff --git a/README.md b/README.md index 951c4307a..75d056a9d 100644 --- a/README.md +++ b/README.md @@ -19,65 +19,65 @@ git commit -m "My informative commit message" git push ``` - Unix-ish Developer Required Software +Unix-ish Developer Required Software -## Required software +## Required software -NOTE: Before reading the following instructions you may want to consider +NOTE: Before reading the following instructions you may want to consider installing the web site as a Docker container. See the instructions below. -1. Make a fork and clone the git repository for bioconductor.org and - create a new branch to make your changes, (helpful documentation for - [Creating a pull request from a fork][]) +1. Make a fork and clone the git repository for bioconductor.org and + create a new branch to make your changes, (helpful documentation for + [Creating a pull request from a fork][]) - git clone https://github.com//bioconductor.org + git clone https://github.com//bioconductor.org -2. Make your changes on this branch, add content or edit content. +2. Make your changes on this branch, add content or edit content. -3. Once the changes are made, you need use the docker image - `bioconductor/website:latest` and run the - container. The container has the dependencies installed to `rake` - the ruby code and host the website on your local machine at - https://localhost:3000. +3. Once the changes are made, you need use the docker image + `bioconductor/website:latest` and run the + container. The container has the dependencies installed to `rake` + the ruby code and host the website on your local machine at + https://localhost:3000. - docker run -v //bioconductor.org:/bioconductor.org/ \ - -p 3000:3000 \ - bioconductor/website:latest + docker run -v //bioconductor.org:/bioconductor.org/ \ + -p 3000:3000 \ + bioconductor/website:latest - where, + where, - -p is mapping the container's port 3000 to the host machine's port + -p is mapping the container's port 3000 to the host machine's port - -v mounting a volume, the website (bioconductor.org) directory - from your local machine is being mounted on the docker container + -v mounting a volume, the website (bioconductor.org) directory + from your local machine is being mounted on the docker container -4. Then to kill the process, you need to get the CONTAINER ID with, +4. Then to kill the process, you need to get the CONTAINER ID with, - docker ps + docker ps - and, + and, - docker kill + docker kill -5. Before you run the docker image again with more changes, make sure - to clean the artifacts produced by the `rake` command, with +5. Before you run the docker image again with more changes, make sure + to clean the artifacts produced by the `rake` command, with - git clean -xdf + git clean -xdf - The output should look like, + The output should look like, - bioconductor.org$ git clean -xdf - Removing assets/bioc-devel-version - Removing assets/bioc-version - Removing assets/config.yaml - Removing content/packages/ - Removing output/ - Removing tmp/ + bioconductor.org$ git clean -xdf + Removing assets/bioc-devel-version + Removing assets/bioc-version + Removing assets/config.yaml + Removing content/packages/ + Removing output/ + Removing tmp/ -6. Once you have reviewed your changes, make a new branch and send a pull - request to the `devel` branch. The pull request should be made from your - `my_changes` branch to the [devel branch on GitHub][]. +6. Once you have reviewed your changes, make a new branch and send a pull + request to the `devel` branch. The pull request should be made from your + `my_changes` branch to the [devel branch on GitHub][]. [devel branch on GitHub]: https://github.com/Bioconductor/bioconductor.org [Creating a pull request from a fork]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork @@ -90,68 +90,68 @@ There are numerous issues on various platforms when attempting to install appropriate versions of ruby and the necessary ruby packages. The simplest way around all of this is to use rbenv, which allows you to switch between various ruby versions and avoids conflicts between them. -*NOTE*: rbenv works on Unix only; if you are on Windows, skip to +_NOTE_: rbenv works on Unix only; if you are on Windows, skip to the Windows section. On ubuntu, before proceeding, make sure the `libsqlite3-dev` package is installed (`sudo apt-get install libsqlite3-dev`). -The following instructions are adapted from the +The following instructions are adapted from the [rbenv page](https://github.com/rbenv/rbenv). It's worth reading this to understand how rbenv works. -*Important note*: Never use `sudo` when working with a ruby that has been +_Important note_: Never use `sudo` when working with a ruby that has been installed by rbenv. rbenv installs everything in your home directory so you should never need to become root or fiddle with permissions. -0. Make sure you do not have rvm installed. `which rvm` should not return - anything. If you do have it installed, refer to - [this page](http://stackoverflow.com/questions/3950260/howto-uninstall-rvm) - for instructions on removing it. +0. Make sure you do not have rvm installed. `which rvm` should not return + anything. If you do have it installed, refer to + [this page](http://stackoverflow.com/questions/3950260/howto-uninstall-rvm) + for instructions on removing it. -1. Check out rbenv into `~/.rbenv`. +1. Check out rbenv into `~/.rbenv`. - ~~~ sh + ```sh $ git clone https://github.com/rbenv/rbenv.git ~/.rbenv - ~~~ + ``` -2. Add `~/.rbenv/bin` to your `$PATH` for access to the `rbenv` - command-line utility. +2. Add `~/.rbenv/bin` to your `$PATH` for access to the `rbenv` + command-line utility. - ~~~ sh + ```sh $ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile - ~~~ + ``` **Ubuntu Desktop note**: Modify your `~/.bashrc` instead of `~/.bash_profile`. **Zsh note**: Modify your `~/.zshrc` file instead of `~/.bash_profile`. -3. Add `rbenv init` to your shell to enable shims and autocompletion. +3. Add `rbenv init` to your shell to enable shims and autocompletion. - ~~~ sh + ```sh $ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile - ~~~ + ``` _Same as in previous step, use `~/.bashrc` on Ubuntu, or `~/.zshrc` for Zsh._ -4. Restart your shell so that PATH changes take effect. (Opening a new - terminal tab will usually do it.) Now check if rbenv was set up: +4. Restart your shell so that PATH changes take effect. (Opening a new + terminal tab will usually do it.) Now check if rbenv was set up: - ~~~ sh + ```sh $ type rbenv #=> "rbenv is a function" - ~~~ + ``` -5. Install -[ruby-build](https://github.com/rbenv/ruby-build), -which provides the `rbenv install` command that simplifies the process of -installing new Ruby versions: +5. Install + [ruby-build](https://github.com/rbenv/ruby-build), + which provides the `rbenv install` command that simplifies the process of + installing new Ruby versions: - ~~~ sh - git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build - ~~~ + ~~~ sh + git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build + ~~~ -Now you need to install ruby. Go to the +Now you need to install ruby. Go to the [Ruby Downloads Page](https://www.ruby-lang.org/en/downloads/) to find out what the current stable version is. As of 3/06/2020 it is 2.7.0 however that particular version still had issues with modules, so I will @@ -171,22 +171,19 @@ If you want to use different versions of ruby in different contexts, read the [rbenv page](https://github.com/rbenv/rbenv) for more information. - - ## Windows Developer Required Software 1. Download and run the one-click ruby installer http://rubyinstaller.org/downloads/. Accept all default settings. 2. Also download and install the Development Kit from - http://rubyinstaller.org/downloads/. Be sure and add the bin dir + http://rubyinstaller.org/downloads/. Be sure and add the bin dir to your path (see devkitvars.bat) 3. If you don't already have it, be sure and install cygwin and explicitly install rsync. rsync is required for parts of the web site to work. - 4. Install git client. https://git-scm.com/downloads 5. Follow the developer setup instructions below. @@ -202,7 +199,6 @@ for more information. Ruby packages are called gems and `gem` is the program used to install them. - To save time, ensure your ~/.gemrc file contains the text gem: --no-document @@ -213,27 +209,25 @@ that you will not use. The web site comes with a Gemfile which is similar to an R package DESCRIPTION file in that it lists all dependencies needed. Gemfiles are read by the `bundler` gem, so install that as follows, prepending `sudo` if -necessary (remember, *don't* use `sudo` if your ruby was installed +necessary (remember, _don't_ use `sudo` if your ruby was installed with `rbenv`: cd bioconductor.org gem install bundler - Then, assuming you are in the bioconductor.org working copy, issue this command to install all dependencies, again prepending `sudo` if necessary: bundle install - ### Build the site cd bioconductor.org # if you aren't already in the working copy rake -One step in the build process runs 'nanoc', "a Ruby web publishing system -for building small to medium-sized websites"; it is one of the -gems you installed above. If you ever need to run nanoc explicitly: +One step in the build process runs 'nanoc', "a Ruby web publishing system +for building small to medium-sized websites"; it is one of the +gems you installed above. If you ever need to run nanoc explicitly: nanoc compile @@ -241,45 +235,50 @@ To run an abbreviated compile, which does not attempt to build all package pages QUICK_NANOC_COMPILE=true nanoc co -Whether run by hand or by rake, the compiled html files are all found in +Whether run by hand or by rake, the compiled html files are all found in and below output/, an immediate subdirectory of the bioconductor.org/ directory -you have been working in. +you have been working in. ### Start the built-in development server, 'adsf' "A dead-simple file" server: cd output adsf - ### Test in a browser by going to http://localhost:3000/ +### Linters + +This project includes the styleLint css linter, which can be run using the following command: + + npx stylelint "**/*.css" + ## Overview of site source code -* README.md :: You are reading this file or a file generated from - this file. +- README.md :: You are reading this file or a file generated from + this file. -* Rakefile :: A `Rakefile` is to `rake` as a `Makefile` is to `make`. - You can see the available targets by running `rake -T` - in the directory containing `Rakefile`. +- Rakefile :: A `Rakefile` is to `rake` as a `Makefile` is to `make`. + You can see the available targets by running `rake -T` + in the directory containing `Rakefile`. -* Rules :: This is a Ruby syntax file that describes how site content - is transformed from its source form into its output form - (this is called filtering), what layout to use (layouts are - the shared templates), and where to write the output (this - is called routing). See the nanoc - [tutorial](http://nanoc.stoneship.org/tutorial/) and the - [manual](http://nanoc.stoneship.org/manual/) for details. +- Rules :: This is a Ruby syntax file that describes how site content + is transformed from its source form into its output form + (this is called filtering), what layout to use (layouts are + the shared templates), and where to write the output (this + is called routing). See the nanoc + [tutorial](http://nanoc.stoneship.org/tutorial/) and the + [manual](http://nanoc.stoneship.org/manual/) for details. -* assets :: This directory is not managed by nanoc. It contains files - that do not undergo any filtering, layout-ing, or routing. - Contents of the assets directory are copied to the output - directory using rsync. +- assets :: This directory is not managed by nanoc. It contains files + that do not undergo any filtering, layout-ing, or routing. + Contents of the assets directory are copied to the output + directory using rsync. -* config.yaml :: Nanoc configuration file for the bioconductor.org - site. This file is written in [YAML](http://www.yaml.org/). +- config.yaml :: Nanoc configuration file for the bioconductor.org + site. This file is written in [YAML](http://www.yaml.org/). -* content :: This is where the bulk of the raw (source form) site - content lives. Important details: +- content :: This is where the bulk of the raw (source form) site + content lives. Important details: - Content always has two related files: a `.yaml` file containing item attributes and a `.` file @@ -291,23 +290,23 @@ you have been working in. `output/help/index.html`. This scheme allows for clean URLs that avoid having a file extension. -* layouts :: This is where the content templates live. +- layouts :: This is where the content templates live. -* lib :: Ruby helper functions and nanoc extensions live here. Files - in this directory are automatically loaded by nanoc during - site processing. +- lib :: Ruby helper functions and nanoc extensions live here. Files + in this directory are automatically loaded by nanoc during + site processing. -* migration :: Documentation and scripts used in the process of - migrating the bioconductor.org site from Plone to - nanoc. +- migration :: Documentation and scripts used in the process of + migrating the bioconductor.org site from Plone to + nanoc. -* output :: This directory is created when you compile the - bioconductor.org site using nanoc. It contains the final - static HTML and other assets. Deploying the site means - pushing out an update of the contents of output to the - live server. +- output :: This directory is created when you compile the + bioconductor.org site using nanoc. It contains the final + static HTML and other assets. Deploying the site means + pushing out an update of the contents of output to the + live server. -* scripts :: Helper scripts for managing the site live here. +- scripts :: Helper scripts for managing the site live here. ## How to add a page @@ -316,13 +315,13 @@ you have been working in. You will use a helper scripts `./scripts/add_event` to add event to the site using the following steps: -1. Always run `./scripts/add_event` from the top-level of your - website working copy -1. Run `./scripts/add_event EVENT_NAME` - This will create an EVENT_NAME.yaml file in the - `./content/help/events/` directory -1. The default `EVENT_NAME.yaml` file will look like this: - +1. Always run `./scripts/add_event` from the top-level of your + website working copy +1. Run `./scripts/add_event EVENT_NAME` + This will create an EVENT_NAME.yaml file in the + `./content/help/events/` directory +1. The default `EVENT_NAME.yaml` file will look like this: + title: TITLE FOR EVENT_NAME location: Seattle, WA, USA event_host: FHCRC @@ -332,16 +331,16 @@ to the site using the following steps: text: details and registration url: https://secure.bioconductor.org/EVENT_NAME -1. Edit the `EVENT_NAME.yaml` file -1. Use git to commit changes and additions by `add_event` - +1. Edit the `EVENT_NAME.yaml` file +1. Use git to commit changes and additions by `add_event` + ## How to add course material You will use a helper script `./scripts/course_mgr` to add course material to the site. PDF files for labs and presentations as well -as course-specific packages and data are *not* stored in git. The +as course-specific packages and data are _not_ stored in git. The index pages that describe the course and provide links to the -materials *are* stored in git. The `course_mgr` script will help +materials _are_ stored in git. The `course_mgr` script will help with index file creation and data transfer. ### `course_mgr` workflow and important tips @@ -359,83 +358,82 @@ To add a course, you will typically perform the following steps ### Using `course_mgr` -1. Generate a skeleton course directory structure. - - ./scripts/course_mgr --create seattle-intro - - This will create a `seattle-intro/` directory in the top-level - of your website working copy -- do not add this directory or any - files within it to git. Inside will be a `course_config.yaml` - file that will look like this: - - title: - The title of the course goes here - start_date: 2010-01-27 - end_date: 2010-01-29 - instructors: ["Someone", "Another"] - location: "Seattle, USA" - url: https://secure.bioconductor.org/SeattleJan10/ - tags: ["intro", "seattle", "package"] - description: - You can put some description text here. - Must be indented. - -2. Put course materials as files and directories into the skeleton - directory. For example, you might end up with a directory like - that shown below with two subdirectories, `packages` and - `presentation-slides`, each containing course materials. - - seattle-intro - |-- course_config.yaml - |-- packages - | |-- day1_0.0.1.tar.gz - | |-- day2_0.0.1.tar.gz - | `-- day3_0.0.1.tar.gz - `-- presentation-slides - |-- First-steps-presentation.pdf - |-- Microarray-presentation.pdf - |-- annotation-presentation.pdf - `-- sequence-presentation.pdf - -3. Now you are ready to create the index files. - - ./scripts/course_mgr --index seattle-intro - CREATED: content/help/course-notes/2010/01/seattle-intro.(html|yaml) - COPIED for preview: - src: ./seattle-intro/* - dst: output/help/course-notes/2010/01/seattle-intro/ - NEXT STEPS: - - preview site with 'rake devserver' - - Use URL: http://localhost:3000/help/course-materials/2010/seattle-intro/ - - edit CREATED files to add descriptions for links - - if happy, run ./scripts/course_mgr --push 2010/seattle-intro - - - This will create a course index content item in content filed - appropriately based on the metadata provided in - `course_config.yaml`. It will also copy the files and directories - you created into the output directory so that you can do a full - preview after compiling the site. - -4. If everything looks good, you can sync the data files to the web - server (note that we do not put these files in git because large - data files are not appropriate for git and they are not likely to - change): - - ./scripts/course_mgr --push 2010/seattle-intro - SYNC: - src: ./seattle-intro - dst: biocadmin@staging.bioconductor.org:/loc/www/bioconductor-test.fhcrc.org/help/course-materials/2010/ - NEXT STEPS: git add/commit changes in contents - -5. Finally, "git add" the new course index html and yaml files that were generated in the - content directory and commit. +1. Generate a skeleton course directory structure. + + ./scripts/course_mgr --create seattle-intro + + This will create a `seattle-intro/` directory in the top-level + of your website working copy -- do not add this directory or any + files within it to git. Inside will be a `course_config.yaml` + file that will look like this: + + title: + The title of the course goes here + start_date: 2010-01-27 + end_date: 2010-01-29 + instructors: ["Someone", "Another"] + location: "Seattle, USA" + url: https://secure.bioconductor.org/SeattleJan10/ + tags: ["intro", "seattle", "package"] + description: + You can put some description text here. + Must be indented. + +2. Put course materials as files and directories into the skeleton + directory. For example, you might end up with a directory like + that shown below with two subdirectories, `packages` and + `presentation-slides`, each containing course materials. + + seattle-intro + |-- course_config.yaml + |-- packages + | |-- day1_0.0.1.tar.gz + | |-- day2_0.0.1.tar.gz + | `-- day3_0.0.1.tar.gz + `-- presentation-slides + |-- First-steps-presentation.pdf + |-- Microarray-presentation.pdf + |-- annotation-presentation.pdf + `-- sequence-presentation.pdf + +3. Now you are ready to create the index files. + + ./scripts/course_mgr --index seattle-intro + CREATED: content/help/course-notes/2010/01/seattle-intro.(html|yaml) + COPIED for preview: + src: ./seattle-intro/* + dst: output/help/course-notes/2010/01/seattle-intro/ + NEXT STEPS: + - preview site with 'rake devserver' + - Use URL: http://localhost:3000/help/course-materials/2010/seattle-intro/ + - edit CREATED files to add descriptions for links + - if happy, run ./scripts/course_mgr --push 2010/seattle-intro + + This will create a course index content item in content filed + appropriately based on the metadata provided in + `course_config.yaml`. It will also copy the files and directories + you created into the output directory so that you can do a full + preview after compiling the site. + +4. If everything looks good, you can sync the data files to the web + server (note that we do not put these files in git because large + data files are not appropriate for git and they are not likely to + change): + + ./scripts/course_mgr --push 2010/seattle-intro + SYNC: + src: ./seattle-intro + dst: biocadmin@staging.bioconductor.org:/loc/www/bioconductor-test.fhcrc.org/help/course-materials/2010/ + NEXT STEPS: git add/commit changes in contents + +5. Finally, "git add" the new course index html and yaml files that were generated in the + content directory and commit. ### Modifying an existing course You can edit the pages for an existing course by editing the files in `./content`. If you need to add or modify data files, run: - ./scripts/course_mgr --pull 2010/course_to_modify +./scripts/course_mgr --pull 2010/course_to_modify This will create a top-level directory called "course_to_modify". You can then add or modify course material. When finished, run @@ -445,13 +443,11 @@ You can edit the pages for an existing course by editing the files in cp course_to_modify/course_to_modify.* content/help/course_materials/2010 git commit -m "made changes" content/help/course-materials/2010/course_to_modify - - ## Adding course material to the spreadsheet The page -[http://www.bioconductor.org/help/course-materials/](http://www.bioconductor.org/help/course-materials/) -is built from the tab-delimited file `etc/course_descriptions.tsv`. +[http://www.bioconductor.org/help/course-materials/](http://www.bioconductor.org/help/course-materials/) +is built from the tab-delimited file `etc/course_descriptions.tsv`. Add information to this file using a spreadsheet program (Excel, LibreOffice, etc.). Be sure to save @@ -518,7 +514,6 @@ deployment, and log rotation (biocadmin user): */20 * * * * cd $HOME/bioc-test-web;./update_site >> log/update_site.log 2>&1 59 23 * * * /usr/sbin/logrotate -f -s /home/biocadmin/bioc-test-web/logrotateState /home/biocadmin/bioc-test-web/logrotateFiles - ### master.bioconductor.org Apache Configuration A good resource is available [http://en.opensuse.org/Apache_Quickstart_HOWTO](here). @@ -582,7 +577,7 @@ Edit /etc/apache2/sites-available/000-default.conf BrowserMatch \bMSIE !no-gzip !gzip-only-text/html - + Options Indexes FollowSymLinks @@ -635,7 +630,6 @@ Edit /etc/apache2/sites-available/000-default.conf - ## How to test for broken links You can run wget as shown below to get a report on 404s for the site. Note @@ -643,7 +637,6 @@ that this runs against the staging site so will have a lot of false positives. wget -r --spider -U "404 check with wget" -o wwwbioc.log http://master.bioconductor.org - ## Optimize redirects Currently the redirects are defined using Apache's mod_rewrite in a @@ -662,13 +655,13 @@ following changes: top-level directory. This should disable .htaccess files as it isn't enough just to remove the .htaccess file itself. - ### Site Search -The site search contains several moving parts. The search is built on +The site search contains several moving parts. The search is built on Apache Solr, which is in turn built on top of Apache Lucene. #### How to configure Solr + The default SOLR installation works fine, with the exception of the file example/solr/conf/schema.xml which must be replaced with the version in this subversion repository at etc/solr.The changes in this file enable @@ -679,8 +672,8 @@ where the solr tarball has been expanded): cd $SOLR_HOME/example; java -jar start.jar - #### How to ensure that Solr is started up at boot time (on master and staging) + On both machines there is an /etc/rc.local and /etc/init.d/rc.local script which starts Solr as above. @@ -700,13 +693,13 @@ to the Apache web server. Then we added the following if it hasn't already to ProxyStatus On This means that all requests starting with "/solr" will go to the -solr server on port 8983. This allows us to make requests to the +solr server on port 8983. This allows us to make requests to the search server without violating the "same-origin" policy. #### How the client-side portion of the search works The page /search/index.html includes some javascript (in the file -js/search.html) which in turn uses jQuery. The code parses the +js/search.html) which in turn uses jQuery. The code parses the arguments in the URL and then makes an AJAX request to the SOLR server which returns a JSON string. The javascript code converts that to an object and then renders the search response page. @@ -714,10 +707,12 @@ that to an object and then renders the search response page. #### How to rebuild the search index Note that you typically do not want to do this by hand as it is handled -by cron jobs (see below). +by cron jobs (see below). # NOTE: this may need debugging for staging.bioconductor.org -# from transition from merlot2 + +# from transition from merlot2 + On staging.bioconductor.org (ssh to staging.bioconductor.org): cd ~/biocadmin/bioc-test-web/bioconductor.org @@ -725,20 +720,19 @@ On staging.bioconductor.org (ssh to staging.bioconductor.org): What this command does: -* Runs a Ruby class which determines which files need to be (re)indexed. -* This uses a cache file containing the names of each file and their modification times - as of the last time the script was run. If the cache file does not exist, all files +- Runs a Ruby class which determines which files need to be (re)indexed. +- This uses a cache file containing the names of each file and their modification times + as of the last time the script was run. If the cache file does not exist, all files are indexed. This class also handles new files and deletions. -* The class actually does not do the indexing itself; it creates another script +- The class actually does not do the indexing itself; it creates another script (index.sh -- created by scripts/search_indexer.rb) which does the actual indexing, which is accomplished by using curl to post files to the SOLR web app. To re-index files on master, ssh to staging (not master) and do this: - + cd ~/biocadmin/bioc-test-web/bioconductor.org rake index_production - #### Cron jobs for rebuilding the search index/why it is decoupled from site update Doing "crontab -l" on staging shows how the index us updated on master. Here are the relevant lines: @@ -747,12 +741,11 @@ Doing "crontab -l" on staging shows how the index us updated on master. Here are 30 */4 * * * cd $HOME/bioc-test-web/bioconductor.org && rake index_production > $HOME/bioc-test-web/production_index.log 2>&1 Notice that the search indexing process is decoupled from the site building process -(which takes place every 30 minutes). Site indexing can be a time-consuming -process (especially on master) and the site rebuilding should be quick. So +(which takes place every 30 minutes). Site indexing can be a time-consuming +process (especially on master) and the site rebuilding should be quick. So the search indexing takes place once a day on staging at 8 pm on master (where there are many more files to be indexed which originate from the build system). - ### BiocViews Pages The BiocViews pages are generated by a three-step process: @@ -787,40 +780,40 @@ installed. This is done by nanoc and handled by the DataSource subclass BiocViews (found in lib/data_sources/bioc_views.rb). This data source uses the JSON files generated in the previous step to build a single page for -each page, one for release and one for devel. The pages are rendered -by the partial layouts/_bioc_views_package_detail.html. +each page, one for release and one for devel. The pages are rendered +by the partial layouts/\_bioc_views_package_detail.html. #### Step 3: The BiocViews Hierarchy page -At http://bioconductor.org/packages. This page uses javascript to -build the tree, reading in data generated in step 1. The relevant +At http://bioconductor.org/packages. This page uses javascript to +build the tree, reading in data generated in step 1. The relevant Javascript file is assets/js/bioc_views.js. The automatically generated (by rake) file output/js/versions.js is also sourced. ### Updating the site during a release Take a look at the config.yaml file in the root of the -bioconductor.org working copy. This should be the only place you need +bioconductor.org working copy. This should be the only place you need to make changes. -# Standard Operating Procedures / SOPs / Troubleshooting +# Standard Operating Procedures / SOPs / Troubleshooting ## Problem: Web site does not seem to be updating -Symptom: Commits you made are not going through, and/or +Symptom: Commits you made are not going through, and/or the dashboard (http://bioconductor.org/dashboard/) says that the site has not been updated in over 20 minutes. It likely means that an error was introduced in a recent commit. (make sure you haven't forgotten to `git add` any files). -Solution: ssh to biocadmin@staging.bioconductor.org (ask Lori if +Solution: ssh to biocadmin@staging.bioconductor.org (ask Lori if you don't have permission to do so). Change directories: cd ~/bioc-test-web Look at the 2015 Oct 29 10:22:19 AM then its contents are relevant. You can also look at the last -few lines of `./log/update_site.log`. +few lines of `./log/update_site.log`. # Updating Ruby or Gems diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index fdb81005f..000000000 --- a/package-lock.json +++ /dev/null @@ -1,2073 +0,0 @@ -{ - "name": "bioconductor.org", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "bioconductor.org", - "version": "1.0.0", - "license": "ISC", - "devDependencies": { - "stylelint": "^15.10.1", - "stylelint-config-standard": "^34.0.0", - "stylelint-config-standard-scss": "^10.0.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@csstools/css-parser-algorithms": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.3.0.tgz", - "integrity": "sha512-dTKSIHHWc0zPvcS5cqGP+/TPFUJB0ekJ9dGKvMAFoNuBFhDPBt9OMGNZiIA5vTiNdGHHBeScYPXIGBMnVOahsA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": "^14 || ^16 || >=18" - }, - "peerDependencies": { - "@csstools/css-tokenizer": "^2.1.1" - } - }, - "node_modules/@csstools/css-tokenizer": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.1.1.tgz", - "integrity": "sha512-GbrTj2Z8MCTUv+52GE0RbFGM527xuXZ0Xa5g0Z+YN573uveS4G0qi6WNOMyz3yrFM/jaILTTwJ0+umx81EzqfA==", - "dev": true, - "engines": { - "node": "^14 || ^16 || >=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - }, - "node_modules/@csstools/media-query-list-parser": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.2.tgz", - "integrity": "sha512-M8cFGGwl866o6++vIY7j1AKuq9v57cf+dGepScwCcbut9ypJNr4Cj+LLTWligYUZ0uyhEoJDKt5lvyBfh2L3ZQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": "^14 || ^16 || >=18" - }, - "peerDependencies": { - "@csstools/css-parser-algorithms": "^2.3.0", - "@csstools/css-tokenizer": "^2.1.1" - } - }, - "node_modules/@csstools/selector-specificity": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.0.0.tgz", - "integrity": "sha512-hBI9tfBtuPIi885ZsZ32IMEU/5nlZH/KOVYJCOh7gyMxaVLGmLedYqFN6Ui1LXkI8JlC8IsuC0rF0btcRZKd5g==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "engines": { - "node": "^14 || ^16 || >=18" - }, - "peerDependencies": { - "postcss-selector-parser": "^6.0.13" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@types/minimist": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", - "dev": true - }, - "node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", - "dev": true - }, - "node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/balanced-match": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-2.0.0.tgz", - "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/brace-expansion/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/camelcase-keys": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-7.0.2.tgz", - "integrity": "sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==", - "dev": true, - "dependencies": { - "camelcase": "^6.3.0", - "map-obj": "^4.1.0", - "quick-lru": "^5.1.1", - "type-fest": "^1.2.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/colord": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", - "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/cosmiconfig": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", - "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", - "dev": true, - "dependencies": { - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - } - }, - "node_modules/css-functions-list": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.0.tgz", - "integrity": "sha512-d/jBMPyYybkkLVypgtGv12R+pIFw4/f/IHtCTxWpZc8ofTYOPigIgmA6vu5rMHartZC+WuXhBUHfnyNUIQSYrg==", - "dev": true, - "engines": { - "node": ">=12.22" - } - }, - "node_modules/css-tree": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", - "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", - "dev": true, - "dependencies": { - "mdn-data": "2.0.30", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" - } - }, - "node_modules/cssesc": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", - "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "dev": true, - "bin": { - "cssesc": "bin/cssesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decamelize": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", - "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decamelize-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", - "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", - "dev": true, - "dependencies": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decamelize-keys/node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decamelize-keys/node_modules/map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", - "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fastest-levenshtein": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", - "dev": true, - "engines": { - "node": ">= 4.9.1" - } - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", - "dev": true, - "dependencies": { - "global-prefix": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "dev": true, - "dependencies": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globjoin": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/globjoin/-/globjoin-0.1.4.tgz", - "integrity": "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==", - "dev": true - }, - "node_modules/hard-rejection": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", - "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/hosted-git-info": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", - "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/html-tags": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz", - "integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-fresh/node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/import-lazy": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", - "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "node_modules/is-core-module": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", - "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/known-css-properties": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.27.0.tgz", - "integrity": "sha512-uMCj6+hZYDoffuvAJjFAPz56E9uoowFHmTkqRtRq5WyC5Q6Cu/fTZKNQpX/RbzChBYLLl3lo8CjFZBAZXq9qFg==", - "dev": true - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/map-obj": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", - "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mathml-tag-names": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", - "integrity": "sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/mdn-data": { - "version": "2.0.30", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", - "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", - "dev": true - }, - "node_modules/meow": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.5.tgz", - "integrity": "sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==", - "dev": true, - "dependencies": { - "@types/minimist": "^1.2.2", - "camelcase-keys": "^7.0.0", - "decamelize": "^5.0.0", - "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.1.0", - "minimist-options": "4.1.0", - "normalize-package-data": "^3.0.2", - "read-pkg-up": "^8.0.0", - "redent": "^4.0.0", - "trim-newlines": "^4.0.2", - "type-fest": "^1.2.2", - "yargs-parser": "^20.2.9" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/min-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist-options": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "dev": true, - "dependencies": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0", - "kind-of": "^6.0.3" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/normalize-package-data": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", - "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/postcss": { - "version": "8.4.25", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.25.tgz", - "integrity": "sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.6", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-media-query-parser": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", - "integrity": "sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==", - "dev": true - }, - "node_modules/postcss-resolve-nested-selector": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", - "integrity": "sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw==", - "dev": true - }, - "node_modules/postcss-safe-parser": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz", - "integrity": "sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==", - "dev": true, - "engines": { - "node": ">=12.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - "peerDependencies": { - "postcss": "^8.3.3" - } - }, - "node_modules/postcss-scss": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.6.tgz", - "integrity": "sha512-rLDPhJY4z/i4nVFZ27j9GqLxj1pwxE80eAzUNRMXtcpipFYIeowerzBgG3yJhMtObGEXidtIgbUpQ3eLDsf5OQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss-scss" - } - ], - "engines": { - "node": ">=12.0" - }, - "peerDependencies": { - "postcss": "^8.4.19" - } - }, - "node_modules/postcss-selector-parser": { - "version": "6.0.13", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", - "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", - "dev": true, - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "dev": true - }, - "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-6.0.0.tgz", - "integrity": "sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==", - "dev": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^3.0.2", - "parse-json": "^5.2.0", - "type-fest": "^1.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-8.0.0.tgz", - "integrity": "sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==", - "dev": true, - "dependencies": { - "find-up": "^5.0.0", - "read-pkg": "^6.0.0", - "type-fest": "^1.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/redent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", - "integrity": "sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==", - "dev": true, - "dependencies": { - "indent-string": "^5.0.0", - "strip-indent": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/signal-exit": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", - "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/spdx-correct": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", - "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", - "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", - "dev": true - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", - "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", - "dev": true, - "dependencies": { - "min-indent": "^1.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/style-search": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", - "integrity": "sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==", - "dev": true - }, - "node_modules/stylelint": { - "version": "15.10.1", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.10.1.tgz", - "integrity": "sha512-CYkzYrCFfA/gnOR+u9kJ1PpzwG10WLVnoxHDuBA/JiwGqdM9+yx9+ou6SE/y9YHtfv1mcLo06fdadHTOx4gBZQ==", - "dev": true, - "dependencies": { - "@csstools/css-parser-algorithms": "^2.3.0", - "@csstools/css-tokenizer": "^2.1.1", - "@csstools/media-query-list-parser": "^2.1.2", - "@csstools/selector-specificity": "^3.0.0", - "balanced-match": "^2.0.0", - "colord": "^2.9.3", - "cosmiconfig": "^8.2.0", - "css-functions-list": "^3.1.0", - "css-tree": "^2.3.1", - "debug": "^4.3.4", - "fast-glob": "^3.3.0", - "fastest-levenshtein": "^1.0.16", - "file-entry-cache": "^6.0.1", - "global-modules": "^2.0.0", - "globby": "^11.1.0", - "globjoin": "^0.1.4", - "html-tags": "^3.3.1", - "ignore": "^5.2.4", - "import-lazy": "^4.0.0", - "imurmurhash": "^0.1.4", - "is-plain-object": "^5.0.0", - "known-css-properties": "^0.27.0", - "mathml-tag-names": "^2.1.3", - "meow": "^10.1.5", - "micromatch": "^4.0.5", - "normalize-path": "^3.0.0", - "picocolors": "^1.0.0", - "postcss": "^8.4.24", - "postcss-resolve-nested-selector": "^0.1.1", - "postcss-safe-parser": "^6.0.0", - "postcss-selector-parser": "^6.0.13", - "postcss-value-parser": "^4.2.0", - "resolve-from": "^5.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "style-search": "^0.1.0", - "supports-hyperlinks": "^3.0.0", - "svg-tags": "^1.0.0", - "table": "^6.8.1", - "write-file-atomic": "^5.0.1" - }, - "bin": { - "stylelint": "bin/stylelint.mjs" - }, - "engines": { - "node": "^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/stylelint" - } - }, - "node_modules/stylelint-config-recommended": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-13.0.0.tgz", - "integrity": "sha512-EH+yRj6h3GAe/fRiyaoO2F9l9Tgg50AOFhaszyfov9v6ayXJ1IkSHwTxd7lB48FmOeSGDPLjatjO11fJpmarkQ==", - "dev": true, - "engines": { - "node": "^14.13.1 || >=16.0.0" - }, - "peerDependencies": { - "stylelint": "^15.10.0" - } - }, - "node_modules/stylelint-config-recommended-scss": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-12.0.0.tgz", - "integrity": "sha512-5Bb2mlGy6WLa30oNeKpZvavv2lowJUsUJO25+OA68GFTemlwd1zbFsL7q0bReKipOSU3sG47hKneZ6Nd+ctrFA==", - "dev": true, - "dependencies": { - "postcss-scss": "^4.0.6", - "stylelint-config-recommended": "^12.0.0", - "stylelint-scss": "^5.0.0" - }, - "peerDependencies": { - "postcss": "^8.3.3", - "stylelint": "^15.5.0" - }, - "peerDependenciesMeta": { - "postcss": { - "optional": true - } - } - }, - "node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", - "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", - "dev": true, - "peerDependencies": { - "stylelint": "^15.5.0" - } - }, - "node_modules/stylelint-config-standard": { - "version": "34.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-34.0.0.tgz", - "integrity": "sha512-u0VSZnVyW9VSryBG2LSO+OQTjN7zF9XJaAJRX/4EwkmU0R2jYwmBSN10acqZisDitS0CLiEiGjX7+Hrq8TAhfQ==", - "dev": true, - "dependencies": { - "stylelint-config-recommended": "^13.0.0" - }, - "engines": { - "node": "^14.13.1 || >=16.0.0" - }, - "peerDependencies": { - "stylelint": "^15.10.0" - } - }, - "node_modules/stylelint-config-standard-scss": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-10.0.0.tgz", - "integrity": "sha512-bChBEo1p3xUVWh/wenJI+josoMk21f2yuLDGzGjmKYcALfl2u3DFltY+n4UHswYiXghqXaA8mRh+bFy/q1hQlg==", - "dev": true, - "dependencies": { - "stylelint-config-recommended-scss": "^12.0.0", - "stylelint-config-standard": "^33.0.0" - }, - "peerDependencies": { - "postcss": "^8.3.3", - "stylelint": "^15.5.0" - }, - "peerDependenciesMeta": { - "postcss": { - "optional": true - } - } - }, - "node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", - "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", - "dev": true, - "peerDependencies": { - "stylelint": "^15.5.0" - } - }, - "node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard": { - "version": "33.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-33.0.0.tgz", - "integrity": "sha512-eyxnLWoXImUn77+ODIuW9qXBDNM+ALN68L3wT1lN2oNspZ7D9NVGlNHb2QCUn4xDug6VZLsh0tF8NyoYzkgTzg==", - "dev": true, - "dependencies": { - "stylelint-config-recommended": "^12.0.0" - }, - "peerDependencies": { - "stylelint": "^15.5.0" - } - }, - "node_modules/stylelint-scss": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-5.0.1.tgz", - "integrity": "sha512-n87iCRZrr2J7//I/QFsDXxFLnHKw633U4qvWZ+mOW6KDAp/HLj06H+6+f9zOuTYy+MdGdTuCSDROCpQIhw5fvQ==", - "dev": true, - "dependencies": { - "postcss-media-query-parser": "^0.2.3", - "postcss-resolve-nested-selector": "^0.1.1", - "postcss-selector-parser": "^6.0.13", - "postcss-value-parser": "^4.2.0" - }, - "peerDependencies": { - "stylelint": "^14.5.1 || ^15.0.0" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/supports-hyperlinks": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", - "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">=14.18" - } - }, - "node_modules/supports-hyperlinks/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-hyperlinks/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/svg-tags": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz", - "integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==", - "dev": true - }, - "node_modules/table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/trim-newlines": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-4.1.1.tgz", - "integrity": "sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/write-file-atomic": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", - "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index adfd6e4e2..000000000 --- a/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "bioconductor.org", - "version": "1.0.0", - "description": "This is a frontend for bioconductor.org website, The mission of the Bioconductor project is to develop, support, and disseminate free open source software that facilitates rigorous and reproducible analysis of data from current and emerging biological assays. We are dedicated to building a diverse, collaborative, and welcoming community of developers and data scientists.", - "main": "index.js", - "directories": { - "lib": "lib" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "devDependencies": { - "stylelint": "^15.10.1", - "stylelint-config-standard": "^34.0.0", - "stylelint-config-standard-scss": "^10.0.0" - } -} From 111b7ca0a78cdb7fd453109720b56b4599152ca6 Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 13:35:50 +0100 Subject: [PATCH 044/156] updated readme and linting information --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 75d056a9d..422b9e393 100644 --- a/README.md +++ b/README.md @@ -248,7 +248,7 @@ you have been working in. ### Linters -This project includes the styleLint css linter, which can be run using the following command: +This project includes the stylelint css linter, which can be run using the following command: npx stylelint "**/*.css" From 50ac5f61b95b707de6ee2f0083208e331160b566 Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 13:46:01 +0100 Subject: [PATCH 045/156] added eslint --- .eslintrc.json | 13 + .gitignore | 3 +- package-lock.json | 2667 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2682 insertions(+), 1 deletion(-) create mode 100644 .eslintrc.json create mode 100644 package-lock.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..8f6a4155d --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,13 @@ +{ + "env": { + "browser": true, + "es2021": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "rules": { + } +} diff --git a/.gitignore b/.gitignore index 4965ac9e9..693f052fe 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,5 @@ workflows_tmp/ content/help/workflows/* postgresql_password manifest/* -node_modules/ \ No newline at end of file +node_modules/ +package.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..42243d7b4 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2667 @@ +{ + "name": "bioconductor.org", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "bioconductor.org", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "ajv": "^8.12.0", + "ansi-regex": "^5.0.1", + "ansi-styles": "^3.2.1", + "argparse": "^2.0.1", + "array-union": "^2.1.0", + "arrify": "^1.0.1", + "astral-regex": "^2.0.0", + "balanced-match": "^2.0.0", + "brace-expansion": "^1.1.11", + "braces": "^3.0.2", + "callsites": "^3.1.0", + "camelcase": "^6.3.0", + "camelcase-keys": "^7.0.2", + "chalk": "^2.4.2", + "color-convert": "^1.9.3", + "color-name": "^1.1.3", + "colord": "^2.9.3", + "concat-map": "^0.0.1", + "cosmiconfig": "^8.2.0", + "css-functions-list": "^3.2.0", + "css-tree": "^2.3.1", + "cssesc": "^3.0.0", + "debug": "^4.3.4", + "decamelize": "^5.0.1", + "decamelize-keys": "^1.1.1", + "dir-glob": "^3.0.1", + "emoji-regex": "^8.0.0", + "error-ex": "^1.3.2", + "escape-string-regexp": "^1.0.5", + "fast-deep-equal": "^3.1.3", + "fast-glob": "^3.3.0", + "fastest-levenshtein": "^1.0.16", + "fastq": "^1.15.0", + "file-entry-cache": "^6.0.1", + "fill-range": "^7.0.1", + "find-up": "^5.0.0", + "flat-cache": "^3.0.4", + "flatted": "^3.2.7", + "fs.realpath": "^1.0.0", + "function-bind": "^1.1.1", + "glob": "^7.2.3", + "glob-parent": "^5.1.2", + "global-modules": "^2.0.0", + "global-prefix": "^3.0.0", + "globby": "^11.1.0", + "globjoin": "^0.1.4", + "hard-rejection": "^2.1.0", + "has": "^1.0.3", + "has-flag": "^3.0.0", + "hosted-git-info": "^4.1.0", + "html-tags": "^3.3.1", + "ignore": "^5.2.4", + "import-fresh": "^3.3.0", + "import-lazy": "^4.0.0", + "imurmurhash": "^0.1.4", + "indent-string": "^5.0.0", + "inflight": "^1.0.6", + "inherits": "^2.0.4", + "ini": "^1.3.8", + "is-arrayish": "^0.2.1", + "is-core-module": "^2.12.1", + "is-extglob": "^2.1.1", + "is-fullwidth-code-point": "^3.0.0", + "is-glob": "^4.0.3", + "is-number": "^7.0.0", + "is-plain-obj": "^1.1.0", + "is-plain-object": "^5.0.0", + "isexe": "^2.0.0", + "js-tokens": "^4.0.0", + "js-yaml": "^4.1.0", + "json-parse-even-better-errors": "^2.3.1", + "json-schema-traverse": "^1.0.0", + "kind-of": "^6.0.3", + "known-css-properties": "^0.27.0", + "lines-and-columns": "^1.2.4", + "locate-path": "^6.0.0", + "lodash.truncate": "^4.4.2", + "lru-cache": "^6.0.0", + "map-obj": "^4.3.0", + "mathml-tag-names": "^2.1.3", + "mdn-data": "^2.0.30", + "meow": "^10.1.5", + "merge2": "^1.4.1", + "micromatch": "^4.0.5", + "min-indent": "^1.0.1", + "minimatch": "^3.1.2", + "minimist-options": "^4.1.0", + "ms": "^2.1.2", + "nanoid": "^3.3.6", + "normalize-package-data": "^3.0.3", + "normalize-path": "^3.0.0", + "once": "^1.4.0", + "p-limit": "^3.1.0", + "p-locate": "^5.0.0", + "parent-module": "^1.0.1", + "parse-json": "^5.2.0", + "path-exists": "^4.0.0", + "path-is-absolute": "^1.0.1", + "path-type": "^4.0.0", + "picocolors": "^1.0.0", + "picomatch": "^2.3.1", + "postcss": "^8.4.25", + "postcss-media-query-parser": "^0.2.3", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-safe-parser": "^6.0.0", + "postcss-scss": "^4.0.6", + "postcss-selector-parser": "^6.0.13", + "postcss-value-parser": "^4.2.0", + "punycode": "^2.3.0", + "queue-microtask": "^1.2.3", + "quick-lru": "^5.1.1", + "read-pkg": "^6.0.0", + "read-pkg-up": "^8.0.0", + "redent": "^4.0.0", + "require-from-string": "^2.0.2", + "resolve-from": "^5.0.0", + "reusify": "^1.0.4", + "rimraf": "^3.0.2", + "run-parallel": "^1.2.0", + "semver": "^7.5.4", + "signal-exit": "^4.0.2", + "slash": "^3.0.0", + "slice-ansi": "^4.0.0", + "source-map-js": "^1.0.2", + "spdx-correct": "^3.2.0", + "spdx-exceptions": "^2.3.0", + "spdx-expression-parse": "^3.0.1", + "spdx-license-ids": "^3.0.13", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "strip-indent": "^4.0.0", + "style-search": "^0.1.0", + "stylelint": "^15.10.1", + "stylelint-config-recommended": "^13.0.0", + "stylelint-config-recommended-scss": "^12.0.0", + "stylelint-config-standard": "^34.0.0", + "stylelint-config-standard-scss": "^10.0.0", + "stylelint-scss": "^5.0.1", + "supports-color": "^5.5.0", + "supports-hyperlinks": "^3.0.0", + "svg-tags": "^1.0.0", + "table": "^6.8.1", + "to-regex-range": "^5.0.1", + "trim-newlines": "^4.1.1", + "type-fest": "^1.4.0", + "uri-js": "^4.4.1", + "util-deprecate": "^1.0.2", + "validate-npm-package-license": "^3.0.4", + "which": "^1.3.1", + "wrappy": "^1.0.2", + "write-file-atomic": "^5.0.1", + "yallist": "^4.0.0", + "yargs-parser": "^20.2.9", + "yocto-queue": "^0.1.0" + }, + "devDependencies": { + "eslint": "^8.44.0" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "dependencies": { + "@babel/highlight": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.3.0.tgz", + "integrity": "sha512-dTKSIHHWc0zPvcS5cqGP+/TPFUJB0ekJ9dGKvMAFoNuBFhDPBt9OMGNZiIA5vTiNdGHHBeScYPXIGBMnVOahsA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^2.1.1" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.1.1.tgz", + "integrity": "sha512-GbrTj2Z8MCTUv+52GE0RbFGM527xuXZ0Xa5g0Z+YN573uveS4G0qi6WNOMyz3yrFM/jaILTTwJ0+umx81EzqfA==", + "engines": { + "node": "^14 || ^16 || >=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + }, + "node_modules/@csstools/media-query-list-parser": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.2.tgz", + "integrity": "sha512-M8cFGGwl866o6++vIY7j1AKuq9v57cf+dGepScwCcbut9ypJNr4Cj+LLTWligYUZ0uyhEoJDKt5lvyBfh2L3ZQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^2.3.0", + "@csstools/css-tokenizer": "^2.1.1" + } + }, + "node_modules/@csstools/selector-specificity": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.0.0.tgz", + "integrity": "sha512-hBI9tfBtuPIi885ZsZ32IMEU/5nlZH/KOVYJCOh7gyMxaVLGmLedYqFN6Ui1LXkI8JlC8IsuC0rF0btcRZKd5g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "peerDependencies": { + "postcss-selector-parser": "^6.0.13" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz", + "integrity": "sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", + "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/@eslint/js": { + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", + "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", + "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/minimist": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==" + }, + "node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-2.0.0.tgz", + "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/brace-expansion/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/camelcase-keys": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-7.0.2.tgz", + "integrity": "sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==", + "dependencies": { + "camelcase": "^6.3.0", + "map-obj": "^4.1.0", + "quick-lru": "^5.1.1", + "type-fest": "^1.2.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/colord": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", + "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/cosmiconfig": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", + "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", + "dependencies": { + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-functions-list": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.0.tgz", + "integrity": "sha512-d/jBMPyYybkkLVypgtGv12R+pIFw4/f/IHtCTxWpZc8ofTYOPigIgmA6vu5rMHartZC+WuXhBUHfnyNUIQSYrg==", + "engines": { + "node": ">=12.22" + } + }, + "node_modules/css-tree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "dependencies": { + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", + "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.44.0.tgz", + "integrity": "sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.4.0", + "@eslint/eslintrc": "^2.1.0", + "@eslint/js": "8.44.0", + "@humanwhocodes/config-array": "^0.11.10", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.0", + "eslint-visitor-keys": "^3.4.1", + "espree": "^9.6.0", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", + "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", + "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz", + "integrity": "sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-glob": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", + "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dependencies": { + "global-prefix": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/globals": { + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globjoin": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/globjoin/-/globjoin-0.1.4.tgz", + "integrity": "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/html-tags": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz", + "integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "engines": { + "node": ">=4" + } + }, + "node_modules/import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + }, + "node_modules/is-core-module": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/known-css-properties": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.27.0.tgz", + "integrity": "sha512-uMCj6+hZYDoffuvAJjFAPz56E9uoowFHmTkqRtRq5WyC5Q6Cu/fTZKNQpX/RbzChBYLLl3lo8CjFZBAZXq9qFg==" + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mathml-tag-names": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", + "integrity": "sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdn-data": { + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" + }, + "node_modules/meow": { + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.5.tgz", + "integrity": "sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==", + "dependencies": { + "@types/minimist": "^1.2.2", + "camelcase-keys": "^7.0.0", + "decamelize": "^5.0.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.2", + "read-pkg-up": "^8.0.0", + "redent": "^4.0.0", + "trim-newlines": "^4.0.2", + "type-fest": "^1.2.2", + "yargs-parser": "^20.2.9" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/nanoid": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.4.25", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.25.tgz", + "integrity": "sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-media-query-parser": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", + "integrity": "sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==" + }, + "node_modules/postcss-resolve-nested-selector": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", + "integrity": "sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw==" + }, + "node_modules/postcss-safe-parser": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz", + "integrity": "sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==", + "engines": { + "node": ">=12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.3.3" + } + }, + "node_modules/postcss-scss": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.6.tgz", + "integrity": "sha512-rLDPhJY4z/i4nVFZ27j9GqLxj1pwxE80eAzUNRMXtcpipFYIeowerzBgG3yJhMtObGEXidtIgbUpQ3eLDsf5OQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss-scss" + } + ], + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.4.19" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", + "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-6.0.0.tgz", + "integrity": "sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==", + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^3.0.2", + "parse-json": "^5.2.0", + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-8.0.0.tgz", + "integrity": "sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==", + "dependencies": { + "find-up": "^5.0.0", + "read-pkg": "^6.0.0", + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/redent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", + "integrity": "sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==", + "dependencies": { + "indent-string": "^5.0.0", + "strip-indent": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", + "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/slice-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", + "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", + "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", + "dependencies": { + "min-indent": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/style-search": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", + "integrity": "sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==" + }, + "node_modules/stylelint": { + "version": "15.10.1", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.10.1.tgz", + "integrity": "sha512-CYkzYrCFfA/gnOR+u9kJ1PpzwG10WLVnoxHDuBA/JiwGqdM9+yx9+ou6SE/y9YHtfv1mcLo06fdadHTOx4gBZQ==", + "dependencies": { + "@csstools/css-parser-algorithms": "^2.3.0", + "@csstools/css-tokenizer": "^2.1.1", + "@csstools/media-query-list-parser": "^2.1.2", + "@csstools/selector-specificity": "^3.0.0", + "balanced-match": "^2.0.0", + "colord": "^2.9.3", + "cosmiconfig": "^8.2.0", + "css-functions-list": "^3.1.0", + "css-tree": "^2.3.1", + "debug": "^4.3.4", + "fast-glob": "^3.3.0", + "fastest-levenshtein": "^1.0.16", + "file-entry-cache": "^6.0.1", + "global-modules": "^2.0.0", + "globby": "^11.1.0", + "globjoin": "^0.1.4", + "html-tags": "^3.3.1", + "ignore": "^5.2.4", + "import-lazy": "^4.0.0", + "imurmurhash": "^0.1.4", + "is-plain-object": "^5.0.0", + "known-css-properties": "^0.27.0", + "mathml-tag-names": "^2.1.3", + "meow": "^10.1.5", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.24", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-safe-parser": "^6.0.0", + "postcss-selector-parser": "^6.0.13", + "postcss-value-parser": "^4.2.0", + "resolve-from": "^5.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "style-search": "^0.1.0", + "supports-hyperlinks": "^3.0.0", + "svg-tags": "^1.0.0", + "table": "^6.8.1", + "write-file-atomic": "^5.0.1" + }, + "bin": { + "stylelint": "bin/stylelint.mjs" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stylelint" + } + }, + "node_modules/stylelint-config-recommended": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-13.0.0.tgz", + "integrity": "sha512-EH+yRj6h3GAe/fRiyaoO2F9l9Tgg50AOFhaszyfov9v6ayXJ1IkSHwTxd7lB48FmOeSGDPLjatjO11fJpmarkQ==", + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "stylelint": "^15.10.0" + } + }, + "node_modules/stylelint-config-recommended-scss": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-12.0.0.tgz", + "integrity": "sha512-5Bb2mlGy6WLa30oNeKpZvavv2lowJUsUJO25+OA68GFTemlwd1zbFsL7q0bReKipOSU3sG47hKneZ6Nd+ctrFA==", + "dependencies": { + "postcss-scss": "^4.0.6", + "stylelint-config-recommended": "^12.0.0", + "stylelint-scss": "^5.0.0" + }, + "peerDependencies": { + "postcss": "^8.3.3", + "stylelint": "^15.5.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + } + } + }, + "node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", + "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", + "peerDependencies": { + "stylelint": "^15.5.0" + } + }, + "node_modules/stylelint-config-standard": { + "version": "34.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-34.0.0.tgz", + "integrity": "sha512-u0VSZnVyW9VSryBG2LSO+OQTjN7zF9XJaAJRX/4EwkmU0R2jYwmBSN10acqZisDitS0CLiEiGjX7+Hrq8TAhfQ==", + "dependencies": { + "stylelint-config-recommended": "^13.0.0" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "stylelint": "^15.10.0" + } + }, + "node_modules/stylelint-config-standard-scss": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-10.0.0.tgz", + "integrity": "sha512-bChBEo1p3xUVWh/wenJI+josoMk21f2yuLDGzGjmKYcALfl2u3DFltY+n4UHswYiXghqXaA8mRh+bFy/q1hQlg==", + "dependencies": { + "stylelint-config-recommended-scss": "^12.0.0", + "stylelint-config-standard": "^33.0.0" + }, + "peerDependencies": { + "postcss": "^8.3.3", + "stylelint": "^15.5.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + } + } + }, + "node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", + "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", + "peerDependencies": { + "stylelint": "^15.5.0" + } + }, + "node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard": { + "version": "33.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-33.0.0.tgz", + "integrity": "sha512-eyxnLWoXImUn77+ODIuW9qXBDNM+ALN68L3wT1lN2oNspZ7D9NVGlNHb2QCUn4xDug6VZLsh0tF8NyoYzkgTzg==", + "dependencies": { + "stylelint-config-recommended": "^12.0.0" + }, + "peerDependencies": { + "stylelint": "^15.5.0" + } + }, + "node_modules/stylelint-scss": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-5.0.1.tgz", + "integrity": "sha512-n87iCRZrr2J7//I/QFsDXxFLnHKw633U4qvWZ+mOW6KDAp/HLj06H+6+f9zOuTYy+MdGdTuCSDROCpQIhw5fvQ==", + "dependencies": { + "postcss-media-query-parser": "^0.2.3", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-selector-parser": "^6.0.13", + "postcss-value-parser": "^4.2.0" + }, + "peerDependencies": { + "stylelint": "^14.5.1 || ^15.0.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-hyperlinks": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", + "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/supports-hyperlinks/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/svg-tags": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz", + "integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==" + }, + "node_modules/table": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", + "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", + "dependencies": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/trim-newlines": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-4.1.1.tgz", + "integrity": "sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/write-file-atomic": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} From d7736b2f20377e958eb4354b7ae2556592c39b73 Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 13:51:47 +0100 Subject: [PATCH 046/156] added eslint --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 422b9e393..0e8bc62e8 100644 --- a/README.md +++ b/README.md @@ -248,10 +248,16 @@ you have been working in. ### Linters -This project includes the stylelint css linter, which can be run using the following command: +This project includes the following linters + +stylelint: npx stylelint "**/*.css" +eslint: + + npx eslint + ## Overview of site source code - README.md :: You are reading this file or a file generated from From 58534bfe8450f83604c2e17554b13a0d0192af61 Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 13:51:56 +0100 Subject: [PATCH 047/156] added eslint --- .gitignore | 2 +- README.md | 4 ++ package.json | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 package.json diff --git a/.gitignore b/.gitignore index 693f052fe..6777aa776 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,4 @@ content/help/workflows/* postgresql_password manifest/* node_modules/ -package.json +package diff --git a/README.md b/README.md index 0e8bc62e8..fa736ac8d 100644 --- a/README.md +++ b/README.md @@ -248,6 +248,10 @@ you have been working in. ### Linters +Install linters: + + npm ci + This project includes the following linters stylelint: diff --git a/package.json b/package.json new file mode 100644 index 000000000..516b8b817 --- /dev/null +++ b/package.json @@ -0,0 +1,173 @@ +{ + "name": "bioconductor.org", + "version": "1.0.0", + "description": "This is a frontend for the bioconductor.org website. The mission of the Bioconductor project is to develop, support, and disseminate free open source software that facilitates rigorous and reproducible analysis of data from current and emerging biological assays. We are dedicated to building a diverse, collaborative, and welcoming community of developers and data scientists.", + "main": "index.js", + "directories": { + "lib": "lib" + }, + "dependencies": { + "ajv": "^8.12.0", + "ansi-regex": "^5.0.1", + "ansi-styles": "^3.2.1", + "argparse": "^2.0.1", + "array-union": "^2.1.0", + "arrify": "^1.0.1", + "astral-regex": "^2.0.0", + "balanced-match": "^2.0.0", + "brace-expansion": "^1.1.11", + "braces": "^3.0.2", + "callsites": "^3.1.0", + "camelcase": "^6.3.0", + "camelcase-keys": "^7.0.2", + "chalk": "^2.4.2", + "color-convert": "^1.9.3", + "color-name": "^1.1.3", + "colord": "^2.9.3", + "concat-map": "^0.0.1", + "cosmiconfig": "^8.2.0", + "css-functions-list": "^3.2.0", + "css-tree": "^2.3.1", + "cssesc": "^3.0.0", + "debug": "^4.3.4", + "decamelize": "^5.0.1", + "decamelize-keys": "^1.1.1", + "dir-glob": "^3.0.1", + "emoji-regex": "^8.0.0", + "error-ex": "^1.3.2", + "escape-string-regexp": "^1.0.5", + "fast-deep-equal": "^3.1.3", + "fast-glob": "^3.3.0", + "fastest-levenshtein": "^1.0.16", + "fastq": "^1.15.0", + "file-entry-cache": "^6.0.1", + "fill-range": "^7.0.1", + "find-up": "^5.0.0", + "flat-cache": "^3.0.4", + "flatted": "^3.2.7", + "fs.realpath": "^1.0.0", + "function-bind": "^1.1.1", + "glob": "^7.2.3", + "glob-parent": "^5.1.2", + "global-modules": "^2.0.0", + "global-prefix": "^3.0.0", + "globby": "^11.1.0", + "globjoin": "^0.1.4", + "hard-rejection": "^2.1.0", + "has": "^1.0.3", + "has-flag": "^3.0.0", + "hosted-git-info": "^4.1.0", + "html-tags": "^3.3.1", + "ignore": "^5.2.4", + "import-fresh": "^3.3.0", + "import-lazy": "^4.0.0", + "imurmurhash": "^0.1.4", + "indent-string": "^5.0.0", + "inflight": "^1.0.6", + "inherits": "^2.0.4", + "ini": "^1.3.8", + "is-arrayish": "^0.2.1", + "is-core-module": "^2.12.1", + "is-extglob": "^2.1.1", + "is-fullwidth-code-point": "^3.0.0", + "is-glob": "^4.0.3", + "is-number": "^7.0.0", + "is-plain-obj": "^1.1.0", + "is-plain-object": "^5.0.0", + "isexe": "^2.0.0", + "js-tokens": "^4.0.0", + "js-yaml": "^4.1.0", + "json-parse-even-better-errors": "^2.3.1", + "json-schema-traverse": "^1.0.0", + "kind-of": "^6.0.3", + "known-css-properties": "^0.27.0", + "lines-and-columns": "^1.2.4", + "locate-path": "^6.0.0", + "lodash.truncate": "^4.4.2", + "lru-cache": "^6.0.0", + "map-obj": "^4.3.0", + "mathml-tag-names": "^2.1.3", + "mdn-data": "^2.0.30", + "meow": "^10.1.5", + "merge2": "^1.4.1", + "micromatch": "^4.0.5", + "min-indent": "^1.0.1", + "minimatch": "^3.1.2", + "minimist-options": "^4.1.0", + "ms": "^2.1.2", + "nanoid": "^3.3.6", + "normalize-package-data": "^3.0.3", + "normalize-path": "^3.0.0", + "once": "^1.4.0", + "p-limit": "^3.1.0", + "p-locate": "^5.0.0", + "parent-module": "^1.0.1", + "parse-json": "^5.2.0", + "path-exists": "^4.0.0", + "path-is-absolute": "^1.0.1", + "path-type": "^4.0.0", + "picocolors": "^1.0.0", + "picomatch": "^2.3.1", + "postcss": "^8.4.25", + "postcss-media-query-parser": "^0.2.3", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-safe-parser": "^6.0.0", + "postcss-scss": "^4.0.6", + "postcss-selector-parser": "^6.0.13", + "postcss-value-parser": "^4.2.0", + "punycode": "^2.3.0", + "queue-microtask": "^1.2.3", + "quick-lru": "^5.1.1", + "read-pkg": "^6.0.0", + "read-pkg-up": "^8.0.0", + "redent": "^4.0.0", + "require-from-string": "^2.0.2", + "resolve-from": "^5.0.0", + "reusify": "^1.0.4", + "rimraf": "^3.0.2", + "run-parallel": "^1.2.0", + "semver": "^7.5.4", + "signal-exit": "^4.0.2", + "slash": "^3.0.0", + "slice-ansi": "^4.0.0", + "source-map-js": "^1.0.2", + "spdx-correct": "^3.2.0", + "spdx-exceptions": "^2.3.0", + "spdx-expression-parse": "^3.0.1", + "spdx-license-ids": "^3.0.13", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "strip-indent": "^4.0.0", + "style-search": "^0.1.0", + "stylelint": "^15.10.1", + "stylelint-config-recommended": "^13.0.0", + "stylelint-config-recommended-scss": "^12.0.0", + "stylelint-config-standard": "^34.0.0", + "stylelint-config-standard-scss": "^10.0.0", + "stylelint-scss": "^5.0.1", + "supports-color": "^5.5.0", + "supports-hyperlinks": "^3.0.0", + "svg-tags": "^1.0.0", + "table": "^6.8.1", + "to-regex-range": "^5.0.1", + "trim-newlines": "^4.1.1", + "type-fest": "^1.4.0", + "uri-js": "^4.4.1", + "util-deprecate": "^1.0.2", + "validate-npm-package-license": "^3.0.4", + "which": "^1.3.1", + "wrappy": "^1.0.2", + "write-file-atomic": "^5.0.1", + "yallist": "^4.0.0", + "yargs-parser": "^20.2.9", + "yocto-queue": "^0.1.0" + }, + "devDependencies": { + "eslint": "^8.44.0" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" +} From cf61e3336aaef3ff9499eeb58703d660b0af0b4d Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 14:00:01 +0100 Subject: [PATCH 048/156] changed validation rules --- .github/workflows/linter.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 17c40f772..9a61f6d96 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -23,5 +23,7 @@ jobs: uses: super-linter/super-linter/slim@v5 env: VALIDATE_ALL_CODEBASE: false + VALIDATE_GITHUB_ACTIONS: false + VALIDATE_MARKDOWN: false DEFAULT_BRANCH: redesign2023 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2dc105aa521ebb9dfcd9470832116ab9315b5b72 Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 15:03:38 +0100 Subject: [PATCH 049/156] changed validation rules --- .github/workflows/linter.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 9a61f6d96..fdc5d7ee2 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -25,5 +25,6 @@ jobs: VALIDATE_ALL_CODEBASE: false VALIDATE_GITHUB_ACTIONS: false VALIDATE_MARKDOWN: false + VALIDATE_NATURAL_LANGUAGE: false DEFAULT_BRANCH: redesign2023 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 67d5d858992da70b38d9039837b50b2c773532c9 Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 18:11:29 +0100 Subject: [PATCH 050/156] removed dependencies --- package-lock.json | 508 +++++++++++++++++++--------------------------- package.json | 168 +-------------- 2 files changed, 217 insertions(+), 459 deletions(-) diff --git a/package-lock.json b/package-lock.json index 42243d7b4..fe7adf546 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,164 +8,10 @@ "name": "bioconductor.org", "version": "1.0.0", "license": "ISC", - "dependencies": { - "ajv": "^8.12.0", - "ansi-regex": "^5.0.1", - "ansi-styles": "^3.2.1", - "argparse": "^2.0.1", - "array-union": "^2.1.0", - "arrify": "^1.0.1", - "astral-regex": "^2.0.0", - "balanced-match": "^2.0.0", - "brace-expansion": "^1.1.11", - "braces": "^3.0.2", - "callsites": "^3.1.0", - "camelcase": "^6.3.0", - "camelcase-keys": "^7.0.2", - "chalk": "^2.4.2", - "color-convert": "^1.9.3", - "color-name": "^1.1.3", - "colord": "^2.9.3", - "concat-map": "^0.0.1", - "cosmiconfig": "^8.2.0", - "css-functions-list": "^3.2.0", - "css-tree": "^2.3.1", - "cssesc": "^3.0.0", - "debug": "^4.3.4", - "decamelize": "^5.0.1", - "decamelize-keys": "^1.1.1", - "dir-glob": "^3.0.1", - "emoji-regex": "^8.0.0", - "error-ex": "^1.3.2", - "escape-string-regexp": "^1.0.5", - "fast-deep-equal": "^3.1.3", - "fast-glob": "^3.3.0", - "fastest-levenshtein": "^1.0.16", - "fastq": "^1.15.0", - "file-entry-cache": "^6.0.1", - "fill-range": "^7.0.1", - "find-up": "^5.0.0", - "flat-cache": "^3.0.4", - "flatted": "^3.2.7", - "fs.realpath": "^1.0.0", - "function-bind": "^1.1.1", - "glob": "^7.2.3", - "glob-parent": "^5.1.2", - "global-modules": "^2.0.0", - "global-prefix": "^3.0.0", - "globby": "^11.1.0", - "globjoin": "^0.1.4", - "hard-rejection": "^2.1.0", - "has": "^1.0.3", - "has-flag": "^3.0.0", - "hosted-git-info": "^4.1.0", - "html-tags": "^3.3.1", - "ignore": "^5.2.4", - "import-fresh": "^3.3.0", - "import-lazy": "^4.0.0", - "imurmurhash": "^0.1.4", - "indent-string": "^5.0.0", - "inflight": "^1.0.6", - "inherits": "^2.0.4", - "ini": "^1.3.8", - "is-arrayish": "^0.2.1", - "is-core-module": "^2.12.1", - "is-extglob": "^2.1.1", - "is-fullwidth-code-point": "^3.0.0", - "is-glob": "^4.0.3", - "is-number": "^7.0.0", - "is-plain-obj": "^1.1.0", - "is-plain-object": "^5.0.0", - "isexe": "^2.0.0", - "js-tokens": "^4.0.0", - "js-yaml": "^4.1.0", - "json-parse-even-better-errors": "^2.3.1", - "json-schema-traverse": "^1.0.0", - "kind-of": "^6.0.3", - "known-css-properties": "^0.27.0", - "lines-and-columns": "^1.2.4", - "locate-path": "^6.0.0", - "lodash.truncate": "^4.4.2", - "lru-cache": "^6.0.0", - "map-obj": "^4.3.0", - "mathml-tag-names": "^2.1.3", - "mdn-data": "^2.0.30", - "meow": "^10.1.5", - "merge2": "^1.4.1", - "micromatch": "^4.0.5", - "min-indent": "^1.0.1", - "minimatch": "^3.1.2", - "minimist-options": "^4.1.0", - "ms": "^2.1.2", - "nanoid": "^3.3.6", - "normalize-package-data": "^3.0.3", - "normalize-path": "^3.0.0", - "once": "^1.4.0", - "p-limit": "^3.1.0", - "p-locate": "^5.0.0", - "parent-module": "^1.0.1", - "parse-json": "^5.2.0", - "path-exists": "^4.0.0", - "path-is-absolute": "^1.0.1", - "path-type": "^4.0.0", - "picocolors": "^1.0.0", - "picomatch": "^2.3.1", - "postcss": "^8.4.25", - "postcss-media-query-parser": "^0.2.3", - "postcss-resolve-nested-selector": "^0.1.1", - "postcss-safe-parser": "^6.0.0", - "postcss-scss": "^4.0.6", - "postcss-selector-parser": "^6.0.13", - "postcss-value-parser": "^4.2.0", - "punycode": "^2.3.0", - "queue-microtask": "^1.2.3", - "quick-lru": "^5.1.1", - "read-pkg": "^6.0.0", - "read-pkg-up": "^8.0.0", - "redent": "^4.0.0", - "require-from-string": "^2.0.2", - "resolve-from": "^5.0.0", - "reusify": "^1.0.4", - "rimraf": "^3.0.2", - "run-parallel": "^1.2.0", - "semver": "^7.5.4", - "signal-exit": "^4.0.2", - "slash": "^3.0.0", - "slice-ansi": "^4.0.0", - "source-map-js": "^1.0.2", - "spdx-correct": "^3.2.0", - "spdx-exceptions": "^2.3.0", - "spdx-expression-parse": "^3.0.1", - "spdx-license-ids": "^3.0.13", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "strip-indent": "^4.0.0", - "style-search": "^0.1.0", - "stylelint": "^15.10.1", - "stylelint-config-recommended": "^13.0.0", - "stylelint-config-recommended-scss": "^12.0.0", - "stylelint-config-standard": "^34.0.0", - "stylelint-config-standard-scss": "^10.0.0", - "stylelint-scss": "^5.0.1", - "supports-color": "^5.5.0", - "supports-hyperlinks": "^3.0.0", - "svg-tags": "^1.0.0", - "table": "^6.8.1", - "to-regex-range": "^5.0.1", - "trim-newlines": "^4.1.1", - "type-fest": "^1.4.0", - "uri-js": "^4.4.1", - "util-deprecate": "^1.0.2", - "validate-npm-package-license": "^3.0.4", - "which": "^1.3.1", - "wrappy": "^1.0.2", - "write-file-atomic": "^5.0.1", - "yallist": "^4.0.0", - "yargs-parser": "^20.2.9", - "yocto-queue": "^0.1.0" - }, "devDependencies": { - "eslint": "^8.44.0" + "eslint": "^8.44.0", + "stylelint": "^15.10.1", + "stylelint-config-standard": "^34.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -181,6 +27,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "dev": true, "dependencies": { "@babel/highlight": "^7.22.5" }, @@ -192,6 +39,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -200,6 +48,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", @@ -213,6 +62,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.3.0.tgz", "integrity": "sha512-dTKSIHHWc0zPvcS5cqGP+/TPFUJB0ekJ9dGKvMAFoNuBFhDPBt9OMGNZiIA5vTiNdGHHBeScYPXIGBMnVOahsA==", + "dev": true, "funding": [ { "type": "github", @@ -234,6 +84,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.1.1.tgz", "integrity": "sha512-GbrTj2Z8MCTUv+52GE0RbFGM527xuXZ0Xa5g0Z+YN573uveS4G0qi6WNOMyz3yrFM/jaILTTwJ0+umx81EzqfA==", + "dev": true, "engines": { "node": "^14 || ^16 || >=18" }, @@ -246,6 +97,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.2.tgz", "integrity": "sha512-M8cFGGwl866o6++vIY7j1AKuq9v57cf+dGepScwCcbut9ypJNr4Cj+LLTWligYUZ0uyhEoJDKt5lvyBfh2L3ZQ==", + "dev": true, "funding": [ { "type": "github", @@ -268,6 +120,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.0.0.tgz", "integrity": "sha512-hBI9tfBtuPIi885ZsZ32IMEU/5nlZH/KOVYJCOh7gyMxaVLGmLedYqFN6Ui1LXkI8JlC8IsuC0rF0btcRZKd5g==", + "dev": true, "funding": [ { "type": "github", @@ -400,6 +253,7 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -412,6 +266,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, "engines": { "node": ">= 8" } @@ -420,6 +275,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -431,12 +287,14 @@ "node_modules/@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "dev": true }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==" + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "dev": true }, "node_modules/acorn": { "version": "8.10.0", @@ -463,6 +321,7 @@ "version": "8.12.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -478,6 +337,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "engines": { "node": ">=8" } @@ -486,6 +346,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -496,12 +357,14 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, "engines": { "node": ">=8" } @@ -510,6 +373,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -518,6 +382,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, "engines": { "node": ">=8" } @@ -525,12 +390,14 @@ "node_modules/balanced-match": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-2.0.0.tgz", - "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==" + "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==", + "dev": true }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -539,12 +406,14 @@ "node_modules/brace-expansion/node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -556,6 +425,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, "engines": { "node": ">=6" } @@ -564,6 +434,7 @@ "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, "engines": { "node": ">=10" }, @@ -575,6 +446,7 @@ "version": "7.0.2", "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-7.0.2.tgz", "integrity": "sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==", + "dev": true, "dependencies": { "camelcase": "^6.3.0", "map-obj": "^4.1.0", @@ -592,6 +464,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -605,6 +478,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -612,22 +486,26 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true }, "node_modules/colord": { "version": "2.9.3", "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", - "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==" + "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", + "dev": true }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/cosmiconfig": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", + "dev": true, "dependencies": { "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -674,6 +552,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.0.tgz", "integrity": "sha512-d/jBMPyYybkkLVypgtGv12R+pIFw4/f/IHtCTxWpZc8ofTYOPigIgmA6vu5rMHartZC+WuXhBUHfnyNUIQSYrg==", + "dev": true, "engines": { "node": ">=12.22" } @@ -682,6 +561,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "dev": true, "dependencies": { "mdn-data": "2.0.30", "source-map-js": "^1.0.1" @@ -694,6 +574,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, "bin": { "cssesc": "bin/cssesc" }, @@ -705,6 +586,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -721,6 +603,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", + "dev": true, "engines": { "node": ">=10" }, @@ -732,6 +615,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dev": true, "dependencies": { "decamelize": "^1.1.0", "map-obj": "^1.0.0" @@ -747,6 +631,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -755,6 +640,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -769,6 +655,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "dependencies": { "path-type": "^4.0.0" }, @@ -791,12 +678,14 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -805,6 +694,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, "engines": { "node": ">=0.8.0" } @@ -1071,12 +961,14 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true }, "node_modules/fast-glob": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", + "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -1104,6 +996,7 @@ "version": "1.0.16", "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, "engines": { "node": ">= 4.9.1" } @@ -1112,6 +1005,7 @@ "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, "dependencies": { "reusify": "^1.0.4" } @@ -1120,6 +1014,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, "dependencies": { "flat-cache": "^3.0.4" }, @@ -1131,6 +1026,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1142,6 +1038,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -1157,6 +1054,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, "dependencies": { "flatted": "^3.1.0", "rimraf": "^3.0.2" @@ -1168,22 +1066,26 @@ "node_modules/flatted": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1203,6 +1105,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -1214,6 +1117,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, "dependencies": { "global-prefix": "^3.0.0" }, @@ -1225,6 +1129,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, "dependencies": { "ini": "^1.3.5", "kind-of": "^6.0.2", @@ -1265,6 +1170,7 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -1283,7 +1189,8 @@ "node_modules/globjoin": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/globjoin/-/globjoin-0.1.4.tgz", - "integrity": "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==" + "integrity": "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==", + "dev": true }, "node_modules/graphemer": { "version": "1.4.0", @@ -1295,6 +1202,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true, "engines": { "node": ">=6" } @@ -1303,6 +1211,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -1314,6 +1223,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, "engines": { "node": ">=4" } @@ -1322,6 +1232,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -1333,6 +1244,7 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz", "integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==", + "dev": true, "engines": { "node": ">=8" }, @@ -1344,6 +1256,7 @@ "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, "engines": { "node": ">= 4" } @@ -1352,6 +1265,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -1367,6 +1281,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, "engines": { "node": ">=4" } @@ -1375,6 +1290,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true, "engines": { "node": ">=8" } @@ -1383,6 +1299,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, "engines": { "node": ">=0.8.19" } @@ -1391,6 +1308,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, "engines": { "node": ">=12" }, @@ -1402,6 +1320,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -1410,22 +1329,26 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true }, "node_modules/is-core-module": { "version": "2.12.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "dev": true, "dependencies": { "has": "^1.0.3" }, @@ -1437,6 +1360,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1445,6 +1369,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "engines": { "node": ">=8" } @@ -1453,6 +1378,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -1464,6 +1390,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -1481,6 +1408,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1489,6 +1417,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1496,17 +1425,20 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, "dependencies": { "argparse": "^2.0.1" }, @@ -1517,12 +1449,14 @@ "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true }, "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -1534,6 +1468,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1541,7 +1476,8 @@ "node_modules/known-css-properties": { "version": "0.27.0", "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.27.0.tgz", - "integrity": "sha512-uMCj6+hZYDoffuvAJjFAPz56E9uoowFHmTkqRtRq5WyC5Q6Cu/fTZKNQpX/RbzChBYLLl3lo8CjFZBAZXq9qFg==" + "integrity": "sha512-uMCj6+hZYDoffuvAJjFAPz56E9uoowFHmTkqRtRq5WyC5Q6Cu/fTZKNQpX/RbzChBYLLl3lo8CjFZBAZXq9qFg==", + "dev": true }, "node_modules/levn": { "version": "0.4.1", @@ -1559,12 +1495,14 @@ "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -1584,12 +1522,14 @@ "node_modules/lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==" + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", + "dev": true }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -1601,6 +1541,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true, "engines": { "node": ">=8" }, @@ -1612,6 +1553,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", "integrity": "sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==", + "dev": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -1620,12 +1562,14 @@ "node_modules/mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", - "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", + "dev": true }, "node_modules/meow": { "version": "10.1.5", "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.5.tgz", "integrity": "sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw==", + "dev": true, "dependencies": { "@types/minimist": "^1.2.2", "camelcase-keys": "^7.0.0", @@ -1651,6 +1595,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, "engines": { "node": ">= 8" } @@ -1659,6 +1604,7 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -1671,6 +1617,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, "engines": { "node": ">=4" } @@ -1679,6 +1626,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1690,6 +1638,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, "dependencies": { "arrify": "^1.0.1", "is-plain-obj": "^1.1.0", @@ -1702,12 +1651,14 @@ "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/nanoid": { "version": "3.3.6", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "dev": true, "funding": [ { "type": "github", @@ -1731,6 +1682,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, "dependencies": { "hosted-git-info": "^4.0.1", "is-core-module": "^2.5.0", @@ -1745,6 +1697,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1753,6 +1706,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "dependencies": { "wrappy": "1" } @@ -1778,6 +1732,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -1792,6 +1747,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -1806,6 +1762,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, "dependencies": { "callsites": "^3.0.0" }, @@ -1817,6 +1774,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -1834,6 +1792,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, "engines": { "node": ">=8" } @@ -1842,6 +1801,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1859,6 +1819,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, "engines": { "node": ">=8" } @@ -1866,12 +1827,14 @@ "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -1883,6 +1846,7 @@ "version": "8.4.25", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.25.tgz", "integrity": "sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==", + "dev": true, "funding": [ { "type": "opencollective", @@ -1906,20 +1870,17 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/postcss-media-query-parser": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", - "integrity": "sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==" - }, "node_modules/postcss-resolve-nested-selector": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", - "integrity": "sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw==" + "integrity": "sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw==", + "dev": true }, "node_modules/postcss-safe-parser": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz", "integrity": "sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==", + "dev": true, "engines": { "node": ">=12.0" }, @@ -1931,31 +1892,11 @@ "postcss": "^8.3.3" } }, - "node_modules/postcss-scss": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.6.tgz", - "integrity": "sha512-rLDPhJY4z/i4nVFZ27j9GqLxj1pwxE80eAzUNRMXtcpipFYIeowerzBgG3yJhMtObGEXidtIgbUpQ3eLDsf5OQ==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss-scss" - } - ], - "engines": { - "node": ">=12.0" - }, - "peerDependencies": { - "postcss": "^8.4.19" - } - }, "node_modules/postcss-selector-parser": { "version": "6.0.13", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", + "dev": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -1967,7 +1908,8 @@ "node_modules/postcss-value-parser": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true }, "node_modules/prelude-ls": { "version": "1.2.1", @@ -1982,6 +1924,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, "engines": { "node": ">=6" } @@ -1990,6 +1933,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -2009,6 +1953,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true, "engines": { "node": ">=10" }, @@ -2020,6 +1965,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-6.0.0.tgz", "integrity": "sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==", + "dev": true, "dependencies": { "@types/normalize-package-data": "^2.4.0", "normalize-package-data": "^3.0.2", @@ -2037,6 +1983,7 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-8.0.0.tgz", "integrity": "sha512-snVCqPczksT0HS2EC+SxUndvSzn6LRCwpfSvLrIfR5BKDQQZMaI6jPRC9dYvYFDRAuFEAnkwww8kBBNE/3VvzQ==", + "dev": true, "dependencies": { "find-up": "^5.0.0", "read-pkg": "^6.0.0", @@ -2053,6 +2000,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz", "integrity": "sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==", + "dev": true, "dependencies": { "indent-string": "^5.0.0", "strip-indent": "^4.0.0" @@ -2068,6 +2016,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -2076,6 +2025,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, "engines": { "node": ">=8" } @@ -2084,6 +2034,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -2093,6 +2044,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -2107,6 +2059,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "funding": [ { "type": "github", @@ -2129,6 +2082,7 @@ "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -2164,6 +2118,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "dev": true, "engines": { "node": ">=14" }, @@ -2175,6 +2130,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, "engines": { "node": ">=8" } @@ -2183,6 +2139,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -2199,6 +2156,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -2213,6 +2171,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -2223,12 +2182,14 @@ "node_modules/slice-ansi/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -2237,6 +2198,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -2245,12 +2207,14 @@ "node_modules/spdx-exceptions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true }, "node_modules/spdx-expression-parse": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -2259,12 +2223,14 @@ "node_modules/spdx-license-ids": { "version": "3.0.13", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", - "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==" + "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", + "dev": true }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -2278,6 +2244,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -2289,6 +2256,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz", "integrity": "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==", + "dev": true, "dependencies": { "min-indent": "^1.0.1" }, @@ -2314,12 +2282,14 @@ "node_modules/style-search": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", - "integrity": "sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==" + "integrity": "sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==", + "dev": true }, "node_modules/stylelint": { "version": "15.10.1", "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-15.10.1.tgz", "integrity": "sha512-CYkzYrCFfA/gnOR+u9kJ1PpzwG10WLVnoxHDuBA/JiwGqdM9+yx9+ou6SE/y9YHtfv1mcLo06fdadHTOx4gBZQ==", + "dev": true, "dependencies": { "@csstools/css-parser-algorithms": "^2.3.0", "@csstools/css-tokenizer": "^2.1.1", @@ -2377,6 +2347,7 @@ "version": "13.0.0", "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-13.0.0.tgz", "integrity": "sha512-EH+yRj6h3GAe/fRiyaoO2F9l9Tgg50AOFhaszyfov9v6ayXJ1IkSHwTxd7lB48FmOeSGDPLjatjO11fJpmarkQ==", + "dev": true, "engines": { "node": "^14.13.1 || >=16.0.0" }, @@ -2384,37 +2355,11 @@ "stylelint": "^15.10.0" } }, - "node_modules/stylelint-config-recommended-scss": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-12.0.0.tgz", - "integrity": "sha512-5Bb2mlGy6WLa30oNeKpZvavv2lowJUsUJO25+OA68GFTemlwd1zbFsL7q0bReKipOSU3sG47hKneZ6Nd+ctrFA==", - "dependencies": { - "postcss-scss": "^4.0.6", - "stylelint-config-recommended": "^12.0.0", - "stylelint-scss": "^5.0.0" - }, - "peerDependencies": { - "postcss": "^8.3.3", - "stylelint": "^15.5.0" - }, - "peerDependenciesMeta": { - "postcss": { - "optional": true - } - } - }, - "node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", - "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", - "peerDependencies": { - "stylelint": "^15.5.0" - } - }, "node_modules/stylelint-config-standard": { "version": "34.0.0", "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-34.0.0.tgz", "integrity": "sha512-u0VSZnVyW9VSryBG2LSO+OQTjN7zF9XJaAJRX/4EwkmU0R2jYwmBSN10acqZisDitS0CLiEiGjX7+Hrq8TAhfQ==", + "dev": true, "dependencies": { "stylelint-config-recommended": "^13.0.0" }, @@ -2425,61 +2370,11 @@ "stylelint": "^15.10.0" } }, - "node_modules/stylelint-config-standard-scss": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard-scss/-/stylelint-config-standard-scss-10.0.0.tgz", - "integrity": "sha512-bChBEo1p3xUVWh/wenJI+josoMk21f2yuLDGzGjmKYcALfl2u3DFltY+n4UHswYiXghqXaA8mRh+bFy/q1hQlg==", - "dependencies": { - "stylelint-config-recommended-scss": "^12.0.0", - "stylelint-config-standard": "^33.0.0" - }, - "peerDependencies": { - "postcss": "^8.3.3", - "stylelint": "^15.5.0" - }, - "peerDependenciesMeta": { - "postcss": { - "optional": true - } - } - }, - "node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-recommended": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-12.0.0.tgz", - "integrity": "sha512-x6x8QNARrGO2sG6iURkzqL+Dp+4bJorPMMRNPScdvaUK8PsynriOcMW7AFDKqkWAS5wbue/u8fUT/4ynzcmqdQ==", - "peerDependencies": { - "stylelint": "^15.5.0" - } - }, - "node_modules/stylelint-config-standard-scss/node_modules/stylelint-config-standard": { - "version": "33.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-33.0.0.tgz", - "integrity": "sha512-eyxnLWoXImUn77+ODIuW9qXBDNM+ALN68L3wT1lN2oNspZ7D9NVGlNHb2QCUn4xDug6VZLsh0tF8NyoYzkgTzg==", - "dependencies": { - "stylelint-config-recommended": "^12.0.0" - }, - "peerDependencies": { - "stylelint": "^15.5.0" - } - }, - "node_modules/stylelint-scss": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-5.0.1.tgz", - "integrity": "sha512-n87iCRZrr2J7//I/QFsDXxFLnHKw633U4qvWZ+mOW6KDAp/HLj06H+6+f9zOuTYy+MdGdTuCSDROCpQIhw5fvQ==", - "dependencies": { - "postcss-media-query-parser": "^0.2.3", - "postcss-resolve-nested-selector": "^0.1.1", - "postcss-selector-parser": "^6.0.13", - "postcss-value-parser": "^4.2.0" - }, - "peerDependencies": { - "stylelint": "^14.5.1 || ^15.0.0" - } - }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -2491,6 +2386,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz", "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==", + "dev": true, "dependencies": { "has-flag": "^4.0.0", "supports-color": "^7.0.0" @@ -2503,6 +2399,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -2511,6 +2408,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -2521,12 +2419,14 @@ "node_modules/svg-tags": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz", - "integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==" + "integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==", + "dev": true }, "node_modules/table": { "version": "6.8.1", "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", + "dev": true, "dependencies": { "ajv": "^8.0.1", "lodash.truncate": "^4.4.2", @@ -2548,6 +2448,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -2559,6 +2460,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-4.1.1.tgz", "integrity": "sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ==", + "dev": true, "engines": { "node": ">=12" }, @@ -2582,6 +2484,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, "engines": { "node": ">=10" }, @@ -2593,6 +2496,7 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -2600,12 +2504,14 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -2615,6 +2521,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -2625,12 +2532,14 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/write-file-atomic": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", + "dev": true, "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^4.0.1" @@ -2642,12 +2551,14 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "node_modules/yargs-parser": { "version": "20.2.9", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, "engines": { "node": ">=10" } @@ -2656,6 +2567,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index 516b8b817..8eaf5f7e7 100644 --- a/package.json +++ b/package.json @@ -1,173 +1,19 @@ { "name": "bioconductor.org", "version": "1.0.0", - "description": "This is a frontend for the bioconductor.org website. The mission of the Bioconductor project is to develop, support, and disseminate free open source software that facilitates rigorous and reproducible analysis of data from current and emerging biological assays. We are dedicated to building a diverse, collaborative, and welcoming community of developers and data scientists.", + "description": "[CloudFront](https://aws.amazon.com/cloudfront/) is a content delivery network (CDN). The idea is that if a user in say, Singapore hits our web site, the files she requested will be cached in a location near her and her next access (or that of any other user in that area) will be faster.", "main": "index.js", "directories": { "lib": "lib" }, - "dependencies": { - "ajv": "^8.12.0", - "ansi-regex": "^5.0.1", - "ansi-styles": "^3.2.1", - "argparse": "^2.0.1", - "array-union": "^2.1.0", - "arrify": "^1.0.1", - "astral-regex": "^2.0.0", - "balanced-match": "^2.0.0", - "brace-expansion": "^1.1.11", - "braces": "^3.0.2", - "callsites": "^3.1.0", - "camelcase": "^6.3.0", - "camelcase-keys": "^7.0.2", - "chalk": "^2.4.2", - "color-convert": "^1.9.3", - "color-name": "^1.1.3", - "colord": "^2.9.3", - "concat-map": "^0.0.1", - "cosmiconfig": "^8.2.0", - "css-functions-list": "^3.2.0", - "css-tree": "^2.3.1", - "cssesc": "^3.0.0", - "debug": "^4.3.4", - "decamelize": "^5.0.1", - "decamelize-keys": "^1.1.1", - "dir-glob": "^3.0.1", - "emoji-regex": "^8.0.0", - "error-ex": "^1.3.2", - "escape-string-regexp": "^1.0.5", - "fast-deep-equal": "^3.1.3", - "fast-glob": "^3.3.0", - "fastest-levenshtein": "^1.0.16", - "fastq": "^1.15.0", - "file-entry-cache": "^6.0.1", - "fill-range": "^7.0.1", - "find-up": "^5.0.0", - "flat-cache": "^3.0.4", - "flatted": "^3.2.7", - "fs.realpath": "^1.0.0", - "function-bind": "^1.1.1", - "glob": "^7.2.3", - "glob-parent": "^5.1.2", - "global-modules": "^2.0.0", - "global-prefix": "^3.0.0", - "globby": "^11.1.0", - "globjoin": "^0.1.4", - "hard-rejection": "^2.1.0", - "has": "^1.0.3", - "has-flag": "^3.0.0", - "hosted-git-info": "^4.1.0", - "html-tags": "^3.3.1", - "ignore": "^5.2.4", - "import-fresh": "^3.3.0", - "import-lazy": "^4.0.0", - "imurmurhash": "^0.1.4", - "indent-string": "^5.0.0", - "inflight": "^1.0.6", - "inherits": "^2.0.4", - "ini": "^1.3.8", - "is-arrayish": "^0.2.1", - "is-core-module": "^2.12.1", - "is-extglob": "^2.1.1", - "is-fullwidth-code-point": "^3.0.0", - "is-glob": "^4.0.3", - "is-number": "^7.0.0", - "is-plain-obj": "^1.1.0", - "is-plain-object": "^5.0.0", - "isexe": "^2.0.0", - "js-tokens": "^4.0.0", - "js-yaml": "^4.1.0", - "json-parse-even-better-errors": "^2.3.1", - "json-schema-traverse": "^1.0.0", - "kind-of": "^6.0.3", - "known-css-properties": "^0.27.0", - "lines-and-columns": "^1.2.4", - "locate-path": "^6.0.0", - "lodash.truncate": "^4.4.2", - "lru-cache": "^6.0.0", - "map-obj": "^4.3.0", - "mathml-tag-names": "^2.1.3", - "mdn-data": "^2.0.30", - "meow": "^10.1.5", - "merge2": "^1.4.1", - "micromatch": "^4.0.5", - "min-indent": "^1.0.1", - "minimatch": "^3.1.2", - "minimist-options": "^4.1.0", - "ms": "^2.1.2", - "nanoid": "^3.3.6", - "normalize-package-data": "^3.0.3", - "normalize-path": "^3.0.0", - "once": "^1.4.0", - "p-limit": "^3.1.0", - "p-locate": "^5.0.0", - "parent-module": "^1.0.1", - "parse-json": "^5.2.0", - "path-exists": "^4.0.0", - "path-is-absolute": "^1.0.1", - "path-type": "^4.0.0", - "picocolors": "^1.0.0", - "picomatch": "^2.3.1", - "postcss": "^8.4.25", - "postcss-media-query-parser": "^0.2.3", - "postcss-resolve-nested-selector": "^0.1.1", - "postcss-safe-parser": "^6.0.0", - "postcss-scss": "^4.0.6", - "postcss-selector-parser": "^6.0.13", - "postcss-value-parser": "^4.2.0", - "punycode": "^2.3.0", - "queue-microtask": "^1.2.3", - "quick-lru": "^5.1.1", - "read-pkg": "^6.0.0", - "read-pkg-up": "^8.0.0", - "redent": "^4.0.0", - "require-from-string": "^2.0.2", - "resolve-from": "^5.0.0", - "reusify": "^1.0.4", - "rimraf": "^3.0.2", - "run-parallel": "^1.2.0", - "semver": "^7.5.4", - "signal-exit": "^4.0.2", - "slash": "^3.0.0", - "slice-ansi": "^4.0.0", - "source-map-js": "^1.0.2", - "spdx-correct": "^3.2.0", - "spdx-exceptions": "^2.3.0", - "spdx-expression-parse": "^3.0.1", - "spdx-license-ids": "^3.0.13", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "strip-indent": "^4.0.0", - "style-search": "^0.1.0", - "stylelint": "^15.10.1", - "stylelint-config-recommended": "^13.0.0", - "stylelint-config-recommended-scss": "^12.0.0", - "stylelint-config-standard": "^34.0.0", - "stylelint-config-standard-scss": "^10.0.0", - "stylelint-scss": "^5.0.1", - "supports-color": "^5.5.0", - "supports-hyperlinks": "^3.0.0", - "svg-tags": "^1.0.0", - "table": "^6.8.1", - "to-regex-range": "^5.0.1", - "trim-newlines": "^4.1.1", - "type-fest": "^1.4.0", - "uri-js": "^4.4.1", - "util-deprecate": "^1.0.2", - "validate-npm-package-license": "^3.0.4", - "which": "^1.3.1", - "wrappy": "^1.0.2", - "write-file-atomic": "^5.0.1", - "yallist": "^4.0.0", - "yargs-parser": "^20.2.9", - "yocto-queue": "^0.1.0" - }, - "devDependencies": { - "eslint": "^8.44.0" - }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", - "license": "ISC" + "license": "ISC", + "devDependencies": { + "eslint": "^8.44.0", + "stylelint": "^15.10.1", + "stylelint-config-standard": "^34.0.0" + } } From 2822e74e35d3b68adc0ff9e5def66761cb765862 Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 18:19:49 +0100 Subject: [PATCH 051/156] added scripts --- README.md | 10 +++++++--- package.json | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fa736ac8d..c76dad3a8 100644 --- a/README.md +++ b/README.md @@ -254,11 +254,15 @@ Install linters: This project includes the following linters -stylelint: +stylelint(for linting css code): - npx stylelint "**/*.css" + css-lint -eslint: +eslint(will lint everything in the assets folder): + + js-lint + +or if you need to specify a directory or a file npx eslint diff --git a/package.json b/package.json index 8eaf5f7e7..6bae746aa 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,8 @@ "lib": "lib" }, "scripts": { + "css-lint": "npx stylelint \"**/*.css\" ", + "js-lint": "npx eslint assets/js", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", From ab231cb3ed1a27a5c91b584d23394e619f172faa Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 18:20:50 +0100 Subject: [PATCH 052/156] updated readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c76dad3a8..278af54d0 100644 --- a/README.md +++ b/README.md @@ -256,11 +256,11 @@ This project includes the following linters stylelint(for linting css code): - css-lint + npm run css-lint eslint(will lint everything in the assets folder): - js-lint + npm run js-lint or if you need to specify a directory or a file From f1ca3a9e82cb53ba6bf669a617aad1ad287e97d6 Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 18:24:01 +0100 Subject: [PATCH 053/156] updated to lint everything --- README.md | 10 +++++++--- package.json | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 278af54d0..78033e270 100644 --- a/README.md +++ b/README.md @@ -256,15 +256,19 @@ This project includes the following linters stylelint(for linting css code): - npm run css-lint + npm run css-lint eslint(will lint everything in the assets folder): - npm run js-lint + npm run js-lint or if you need to specify a directory or a file - npx eslint + npx eslint + +To run all linters use run: + + npm run lint-all ## Overview of site source code diff --git a/package.json b/package.json index 6bae746aa..07958801f 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "lib": "lib" }, "scripts": { + "lint-all": " npx stylelint \"**/*.css\" \n npx eslint assets/js", "css-lint": "npx stylelint \"**/*.css\" ", "js-lint": "npx eslint assets/js", "test": "echo \"Error: no test specified\" && exit 1" From c110237af79081f5efbb02e30b1947b5414d3f90 Mon Sep 17 00:00:00 2001 From: bp289 Date: Wed, 12 Jul 2023 18:26:07 +0100 Subject: [PATCH 054/156] removed description --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 07958801f..699b47001 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bioconductor.org", "version": "1.0.0", - "description": "[CloudFront](https://aws.amazon.com/cloudfront/) is a content delivery network (CDN). The idea is that if a user in say, Singapore hits our web site, the files she requested will be cached in a location near her and her next access (or that of any other user in that area) will be faster.", + "description": "This is the frontend for the bioconductor.org website. The mission of the Bioconductor project is to develop, support, and disseminate free open source software that facilitates rigorous and reproducible analysis of data from current and emerging biological assays. We are dedicated to building a diverse, collaborative, and welcoming community of developers and data scientists.", "main": "index.js", "directories": { "lib": "lib" From 586c268ed456e627ecc8a60c9783076d96dfa32b Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Thu, 13 Jul 2023 09:36:23 +0100 Subject: [PATCH 055/156] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 78033e270..58970ceaa 100644 --- a/README.md +++ b/README.md @@ -252,7 +252,7 @@ Install linters: npm ci -This project includes the following linters +This project includes stylelint and eslint. stylelint(for linting css code): @@ -262,11 +262,11 @@ eslint(will lint everything in the assets folder): npm run js-lint -or if you need to specify a directory or a file +or if you need to specify a directory or a file: npx eslint -To run all linters use run: +To run all linters : npm run lint-all From 6da57abbad064d7536c7427e01a40cb7d52a1751 Mon Sep 17 00:00:00 2001 From: mariam Date: Thu, 13 Jul 2023 09:47:08 +0100 Subject: [PATCH 056/156] added another section for the removal of a docker container --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ada3b83d9..b907468fe 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,8 @@ below. where, is the name you want to give to the docker image. - It can be whatever you want as it will be referenced later + it can be whatever you want. You will need to use it later + but is only seen and used by you. 3. Run the docker container before making any changes, you need to use the docker image name `` that you assigned previously to be able to @@ -86,15 +87,16 @@ below. or, without needing to access the docker shell but you will need either the - CONTAINER ID or container name, you can run + container name or CONTAINER ID, you can run - docker ps + docker ps and, - docker exec rake + docker exec rake -6. Then to stop the process, you need to get the CONTAINER ID or container name with, +6. Then to stop the process, you need to get the container name or + CONTAINER ID with, docker ps @@ -102,11 +104,12 @@ below. docker stop - You can also remove the container by running +7. If you wish to completely remove the container from your docker once + you stopped it, you can run - docker kill + docker rm -7. Once you have reviewed your changes, make a new branch and send a pull +8. Once you have reviewed your changes, make a new branch and send a pull request to the `devel` branch. The pull request should be made from your `my_changes` branch to the [devel branch on GitHub][]. From e07cc2ba7fd2a0bd52ef5dc6ba664f91ec39c618 Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Thu, 13 Jul 2023 12:21:34 +0100 Subject: [PATCH 057/156] Update package.json, changed lint-all to lint --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 699b47001..b104f4c76 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "lib": "lib" }, "scripts": { - "lint-all": " npx stylelint \"**/*.css\" \n npx eslint assets/js", + "lint": " npx stylelint \"**/*.css\" \n npx eslint assets/js", "css-lint": "npx stylelint \"**/*.css\" ", "js-lint": "npx eslint assets/js", "test": "echo \"Error: no test specified\" && exit 1" From 03cd50f9bb9fbacb1f57115d8ffc8ca5fc905907 Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Thu, 13 Jul 2023 12:38:17 +0100 Subject: [PATCH 058/156] Update README.md node install instructions --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 58970ceaa..68d2caf11 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,14 @@ you have been working in. ### Test in a browser by going to http://localhost:3000/ ### Linters +You will require node and npm to install the linters. +Installation instructions for your specific OS can be found on the node.js website: + +https://nodejs.org/en/download + +Or if you would like to use your package manager to install, you can find instructions here: + +https://nodejs.org/en/download/package-manager Install linters: From 865fef19f54555312b7e710f61de2c8018558064 Mon Sep 17 00:00:00 2001 From: bp289 Date: Mon, 17 Jul 2023 09:44:50 +0100 Subject: [PATCH 059/156] taking out whitespace --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5a9e9a3d5..30a4043eb 100644 --- a/README.md +++ b/README.md @@ -59,9 +59,7 @@ below. -it will take you straight to the container - - -p is mapping the container's port 3000 to the host machine's port - + -p is mapping the container's port 3000 to the host machine's port -v mounting a volume, the website (bioconductor.org) directory from your local machine is being mounted on the docker container @@ -284,14 +282,15 @@ you have been working in. ### Test in a browser by going to http://localhost:3000/ ### Linters + You will require node and npm to install the linters. -Installation instructions for your specific OS can be found on the node.js website: +Installation instructions for your specific OS can be found on the node.js website: https://nodejs.org/en/download -Or if you would like to use your package manager to install, you can find instructions here: +Or if you would like to use your package manager to install, you can find instructions here: -https://nodejs.org/en/download/package-manager +https://nodejs.org/en/download/package-manager Install linters: From eece0372b2b5392c6b8fed9d935c862bf2cd364f Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Mon, 17 Jul 2023 10:56:15 +0100 Subject: [PATCH 060/156] Update package.json lint command changed --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b104f4c76..4c38f82dd 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "lib": "lib" }, "scripts": { - "lint": " npx stylelint \"**/*.css\" \n npx eslint assets/js", + "lint": "npm run css-lint && npm run js-lint", "css-lint": "npx stylelint \"**/*.css\" ", "js-lint": "npx eslint assets/js", "test": "echo \"Error: no test specified\" && exit 1" From 677c572d249620af6b03334bfb14a152d6d0b812 Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Mon, 17 Jul 2023 10:58:50 +0100 Subject: [PATCH 061/156] Update package.json removed test command --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 4c38f82dd..61b053743 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "lint": "npm run css-lint && npm run js-lint", "css-lint": "npx stylelint \"**/*.css\" ", "js-lint": "npx eslint assets/js", - "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", From a27c130835c34bd40241d4ce1d137e2f20814e96 Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Mon, 17 Jul 2023 11:06:45 +0100 Subject: [PATCH 062/156] Update linter.yaml taking away all other validations apart from css and js --- .github/workflows/linter.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index fdc5d7ee2..07e66da5b 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -26,5 +26,9 @@ jobs: VALIDATE_GITHUB_ACTIONS: false VALIDATE_MARKDOWN: false VALIDATE_NATURAL_LANGUAGE: false + VALIDATE_JSCPD: false + VALIDATE_JSON: false + VALIDATE_R: false + VALIDATE_RUBY: false DEFAULT_BRANCH: redesign2023 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 755ae148a23ba85a184a1a5ed9b08325e5439948 Mon Sep 17 00:00:00 2001 From: Mariam Mohamed <104569563+Mariam-mohamed110@users.noreply.github.com> Date: Mon, 17 Jul 2023 11:55:29 +0100 Subject: [PATCH 063/156] New project structure #10 (#23) * initial structure change around * initial structure change around * updated readmes to accomodate components only * content section in readme edited --- README.md | 24 +++++++++----- content/{about.md => about/index.md} | 0 content/{about.yaml => about/index.yaml} | 0 .../{developers.md => developers/index.md} | 0 .../index.yaml} | 0 content/{help.html => help/index.html} | 0 content/{help.yaml => help/index.yaml} | 0 layouts/components/README.md | 33 +++++++++++++++++++ 8 files changed, 48 insertions(+), 9 deletions(-) rename content/{about.md => about/index.md} (100%) rename content/{about.yaml => about/index.yaml} (100%) rename content/{developers.md => developers/index.md} (100%) rename content/{developers.yaml => developers/index.yaml} (100%) rename content/{help.html => help/index.html} (100%) rename content/{help.yaml => help/index.yaml} (100%) create mode 100644 layouts/components/README.md diff --git a/README.md b/README.md index 30a4043eb..5607346d1 100644 --- a/README.md +++ b/README.md @@ -342,17 +342,23 @@ To run all linters : - content :: This is where the bulk of the raw (source form) site content lives. Important details: - - Content always has two related files: a `.yaml` file - containing item attributes and a `.` file - containing the raw source content. You can actually - use whatever extension you want. + - Each page has two related files: + a `.yaml` file containing item attributes and + a `.` file containing the raw source content + this can be `.md` or `.html`. - - The default behavior is that a content file like - `help.md` is filtered into HTML and then written to - `output/help/index.html`. This scheme allows for - clean URLs that avoid having a file extension. + - The default behavior is that a content file like + `install.md` is filtered into HTML and then written to + `output/install/index.html`. This scheme allows for + clean URLs that avoid having a file extension. -- layouts :: This is where the content templates live. + - Folders like `about` living inside content have their own default + `index` files within. + +- layouts :: This is where the content templates live. Important details: + + - Files that live directly inside the layout folder are the + layouts, the content blocks would live inside /component - lib :: Ruby helper functions and nanoc extensions live here. Files in this directory are automatically loaded by nanoc during diff --git a/content/about.md b/content/about/index.md similarity index 100% rename from content/about.md rename to content/about/index.md diff --git a/content/about.yaml b/content/about/index.yaml similarity index 100% rename from content/about.yaml rename to content/about/index.yaml diff --git a/content/developers.md b/content/developers/index.md similarity index 100% rename from content/developers.md rename to content/developers/index.md diff --git a/content/developers.yaml b/content/developers/index.yaml similarity index 100% rename from content/developers.yaml rename to content/developers/index.yaml diff --git a/content/help.html b/content/help/index.html similarity index 100% rename from content/help.html rename to content/help/index.html diff --git a/content/help.yaml b/content/help/index.yaml similarity index 100% rename from content/help.yaml rename to content/help/index.yaml diff --git a/layouts/components/README.md b/layouts/components/README.md new file mode 100644 index 000000000..8d4dedf46 --- /dev/null +++ b/layouts/components/README.md @@ -0,0 +1,33 @@ +# Components folder + +The purpose of the components folder is to store stand-alone components +that can be included in pages, rather than full layouts. This folder serves +as a centralized location for organizing and managing the components. + +## Folder Structure + +The components folder is organized in a hierarchical structure that +facilitates efficient file management. Within this folder, each component +is stored as an individual file. + +## Reference Update in HTML file + +To ensure proper referencing of files within the HTML files, follow the +steps below when creating and integrating components into the project: + +1. Create a new component file: + +- When creating a new component, save it as an individual file within + the components folder. + +2. Include the component in HTML files: + +- In the HTML files where you want to use the component, add the + necessary code to include the component file. Remember to include the + necessary path /components/. + +3. Test the HTML files: + +- Perform thorough testing to ensure that the HTML files function as intended + with the newly added components. Check that all components are displayed + correctly and that there are no broken links or missing resources. From 90e66d2b3ae0a995a474e863012554820a7b8b18 Mon Sep 17 00:00:00 2001 From: Mariam Mohamed <104569563+Mariam-mohamed110@users.noreply.github.com> Date: Mon, 17 Jul 2023 12:33:34 +0100 Subject: [PATCH 064/156] css library added (#34) --- assets/style/bioconductor-v2.css | 184 +++++++++++++++++++++++++++++++ assets/style/bioconductor.css | 36 ------ layouts/_sitehead.html | 8 +- 3 files changed, 191 insertions(+), 37 deletions(-) create mode 100644 assets/style/bioconductor-v2.css diff --git a/assets/style/bioconductor-v2.css b/assets/style/bioconductor-v2.css new file mode 100644 index 000000000..355cfc6a2 --- /dev/null +++ b/assets/style/bioconductor-v2.css @@ -0,0 +1,184 @@ +/* global styles defined at the topmost level. + these can be overridden by subsequent selectors. */ + +/* CSS global styles */ +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: "Atkinson Hyperlegible"; + line-height: 120%; +} + +h1 { + font-size: 36px; +} + +h2 { + font-size: 31px; +} + +h3 { + font-size: 25px; +} + +h4 { + font-size: 23px; +} + +h5 { + font-size: 19px; +} + +h6 { + font-size: 18px; +} + +.hero { + font-size: 80px; + font-family: "Atkinson Hyperlegible"; + line-height: 105%; +} + +@media (max-width: 700px) { + .hero { + font-size: 40px; + } + + h1 { + font-size: 34px; + } + + h2 { + font-size: 24px; + } + + h3 { + font-size: 22px; + } + + h4 { + font-size: 20px; + } + + h5 { + font-size: 18px; + } + + h6 { + font-size: 17px; + } +} + +p { + font-family: "Atkinson Hyperlegible"; + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + line-height: 130%; + letter-spacing: 0; +} + +.code { + line-height: 120%; + font-family: "Courier"; +} + +.code--body { + font-size: 20px; +} + +.code--small { + font-size: 16px; +} + +.format--bold { + font-weight: bold; +} + +.format--boldUnderline { + text-decoration: underline; + font-weight: bold; +} + +.format--underline { + text-decoration: underline; +} + +.text--xSmall { + font-size: 10px; + line-height: 120%; +} + +.text--small { + font-size: 13px; + line-height: 120%; +} + +.text--large { + font-size: 20px; +} + +/* Css global color variables */ +/* You can use `var(--variable-name)` to get the value. */ + +:root { + /* Primary colors */ + --primary-P50: #ebf4f7; + --primary-P75: #add2dd; + --primary-P100: #8bc0cf; + --primary-P200: #59a5bb; + --primary: #3792AD; + --primary-P400: #035771; + --primary-P500: #003242; + + /* Secondary colors */ + --secondary-S50: #f3fae9; + --secondary-S75: #cf9a6; + --secondary-S100: #bbe081; + --secondary-S200: #9ed34a; + --secondary: #8aca25; + --secondary-S400: #618d1a; + --secondary-S500: #547b17; + + /* Warning colors */ + --warning-W50: #fef9eb; + --warning-W75: #f9e8ad; + --warning-W100: #f7df8a; + --warning-W200: #f3d158; + --warning: #f1c736; + --warning-W400: #a98b26; + --warning-W500: #937921; + + /* Error colors */ + --error-E50: #feebeb; + --error-E75: #f9adad; + --error-E100: #f78a8a; + --error-E200: #f35858; + --error: #F13636; + --error-E400: #F13636; + --error-E500: #932121; + + /* Neutral colors */ + --neutral-N50: #F9F9F9; + --neutral-N75: #E9EBF8; + --neutral-N100: #A1A6B3; + --neutral-N200: #797F92; + --neutral: #5D657C; + --neutral-N400: #414757; + --neutral-N500: #393E4C; + + /* Miscellaneous colors */ + --misc-positive: #008A00; + --misc-neutral: #007A9F; + --misc-warning: #FFC600; + --misc-annotations: #FF8A00; + + /* Gradients */ + --gradient-warmCool: linear-gradient(to right, #FF2F4B, #4E5CFF); + --gradient-brand: linear-gradient(to right, #0087AF, #0484A9, #18A603); + --gradient-brandReverse: linear-gradient(to right, #18A603, #0484A9, #0087AF); + --gradient-purpleBlue: linear-gradient(to right, #445CF3, #A333F1); +} diff --git a/assets/style/bioconductor.css b/assets/style/bioconductor.css index 8e4d44e23..2033960e5 100755 --- a/assets/style/bioconductor.css +++ b/assets/style/bioconductor.css @@ -7,7 +7,6 @@ /* reset the margins and padding of all elements so we can specify them ourselves */ -body,h1,h2,h3,h4,h5,h6,p,div,span { margin:0; padding:0; border:0; } /* some general treatments up top */ body { @@ -17,41 +16,6 @@ body { background-position: top center; background-repeat: no-repeat; } -h1 { - font-size: 250%; - margin-bottom:1em; - font-weight:normal; - color:#87b13f; - line-height:1.1em; -} /* use margin, not padding, due to the fader effect which uses padding */ -h2 { - font-size: 160%; - margin-bottom:1em; - margin-top:1em; - font-weight:normal; - line-height:1.1em; -} -h3 { - font-size:130%; - margin-bottom:1em; - margin-top:1em; - font-weight:bold; -} -h4,h5,h6 { - font-size:115%; - margin-bottom:1em; - margin-top:1em; - font-weight:bold; -} /* not expecting to dive deeper than four levels on a single page */ -h1,h2,h3,h4,h5,h6 { font-family:Helvetica,Arial,Verdana,Sans-serif; } -/* we use a little padding below the h1 and h2 tags to get the 8px fading - effect, which grows the entire width available to the element */ -h1,h2 { - padding-bottom: 8px; - background-image: url(../images/hx_fader.gif); - background-repeat:repeat-x; - background-position:bottom left; -} /* multiple lines (breaking text) won't work nicely with icons, but they are only used at top-level pages with short text */ h1 img, h2 img { padding-right:12px; vertical-align:middle; } diff --git a/layouts/_sitehead.html b/layouts/_sitehead.html index 4fdc4eea5..8d1ec61f3 100644 --- a/layouts/_sitehead.html +++ b/layouts/_sitehead.html @@ -2,7 +2,12 @@ - + + + + + + <% if item.identifier =~ /^\/help\/bioc-views\/package-pages\// \ and not item.identifier =~ /\/all-/ %> @@ -49,6 +54,7 @@ title = "" if @item[:title].nil? or @item[:title].strip.empty? %> Bioconductor<%= title %> + <% if item.identifier =~ /^\/help\/workflows\/.*\// %> <% end %> From c5a8bf9a49a019f076b9a12bdca6204a10f3bc15 Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Tue, 18 Jul 2023 14:36:17 +0100 Subject: [PATCH 065/156] Fix for pr deployment (used feat for testing purposes) (#37) * took out env * took out feat * took out feat * Update pr_deploy.yaml, only running on draft prs --- .github/workflows/linter.yaml | 1 - .github/workflows/pr_deploy.yaml | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 07e66da5b..096d4b818 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -8,7 +8,6 @@ jobs: if: github.event.pull_request.draft == false name: Run Linters runs-on: ubuntu-latest - environment: dev permissions: contents: read packages: read diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 4b0ff2c5f..117d685b7 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -2,12 +2,10 @@ name: Pr - Preview on: pull_request: types: [opened, reopened, synchronize] - branches: - - "fix/**" - - "feat/**" jobs: dev-pr-create-s3: if: github.event.pull_request.draft == false + runs-on: ubuntu-latest environment: dev steps: From 66b6b09edc12f799f829b4b1877f28a29ac1b6c0 Mon Sep 17 00:00:00 2001 From: Mariam Mohamed <104569563+Mariam-mohamed110@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:29:12 +0100 Subject: [PATCH 066/156] Css font format (#35) * css library added * removed the font link and had them downloaded instead * added 2 new files * [Fix] package.json had an extra comma * refined the linting issues * added fallback font * fixed linting error * changed px to rem * removed font family in the fonts * linter error * changed rem to 1/2 decimal place * disabled linter * site container name changed * added style ignore again * Update .stylelintrc.json --------- Co-authored-by: Steve Goode --- .stylelintignore | 1 + .stylelintrc.json | 2 +- assets/style/bioconductor-v2.css | 190 +--- assets/style/bioconductor.css | 842 ++++++++++-------- assets/style/colors.css | 62 ++ assets/style/fonts.css | 134 +++ .../style/fonts/AtkinsonHyperlegible-Bold.ttf | Bin 0 -> 54444 bytes .../fonts/AtkinsonHyperlegible-Bold.woff | Bin 0 -> 31060 bytes .../fonts/AtkinsonHyperlegible-Regular.ttf | Bin 0 -> 53504 bytes .../fonts/AtkinsonHyperlegible-Regular.woff | Bin 0 -> 30380 bytes layouts/_sitehead.html | 121 ++- layouts/course.html | 14 +- layouts/default.html | 2 +- package.json | 2 +- 14 files changed, 781 insertions(+), 589 deletions(-) create mode 100644 .stylelintignore create mode 100644 assets/style/colors.css create mode 100644 assets/style/fonts.css create mode 100644 assets/style/fonts/AtkinsonHyperlegible-Bold.ttf create mode 100644 assets/style/fonts/AtkinsonHyperlegible-Bold.woff create mode 100644 assets/style/fonts/AtkinsonHyperlegible-Regular.ttf create mode 100644 assets/style/fonts/AtkinsonHyperlegible-Regular.woff diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 000000000..7479e7ec5 --- /dev/null +++ b/.stylelintignore @@ -0,0 +1 @@ +assets/style/bioconductor.css \ No newline at end of file diff --git a/.stylelintrc.json b/.stylelintrc.json index 77ceb29f8..6d245ebc8 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1 +1 @@ -{ "extends": ["stylelint-config-standard"] } \ No newline at end of file +{ "extends": ["stylelint-config-standard"] } diff --git a/assets/style/bioconductor-v2.css b/assets/style/bioconductor-v2.css index 355cfc6a2..545e11934 100644 --- a/assets/style/bioconductor-v2.css +++ b/assets/style/bioconductor-v2.css @@ -1,184 +1,14 @@ -/* global styles defined at the topmost level. - these can be overridden by subsequent selectors. */ - -/* CSS global styles */ -h1, -h2, -h3, -h4, -h5, -h6 { - font-family: "Atkinson Hyperlegible"; - line-height: 120%; -} - -h1 { - font-size: 36px; -} - -h2 { - font-size: 31px; -} - -h3 { - font-size: 25px; -} - -h4 { - font-size: 23px; -} - -h5 { - font-size: 19px; -} - -h6 { - font-size: 18px; -} - -.hero { - font-size: 80px; - font-family: "Atkinson Hyperlegible"; - line-height: 105%; -} - -@media (max-width: 700px) { - .hero { - font-size: 40px; - } - - h1 { - font-size: 34px; - } - - h2 { - font-size: 24px; - } - - h3 { - font-size: 22px; - } - - h4 { - font-size: 20px; - } - - h5 { - font-size: 18px; - } - - h6 { - font-size: 17px; - } -} - -p { - font-family: "Atkinson Hyperlegible"; - margin-top: 0; - margin-bottom: 0; - font-size: 16px; - line-height: 130%; - letter-spacing: 0; +body { + font-family: "Atkinson Hyperlegible", sans-serif; } -.code { - line-height: 120%; - font-family: "Courier"; -} - -.code--body { - font-size: 20px; -} - -.code--small { - font-size: 16px; -} - -.format--bold { - font-weight: bold; -} - -.format--boldUnderline { - text-decoration: underline; - font-weight: bold; -} - -.format--underline { - text-decoration: underline; -} - -.text--xSmall { - font-size: 10px; - line-height: 120%; -} - -.text--small { - font-size: 13px; - line-height: 120%; -} - -.text--large { - font-size: 20px; -} - -/* Css global color variables */ -/* You can use `var(--variable-name)` to get the value. */ - -:root { - /* Primary colors */ - --primary-P50: #ebf4f7; - --primary-P75: #add2dd; - --primary-P100: #8bc0cf; - --primary-P200: #59a5bb; - --primary: #3792AD; - --primary-P400: #035771; - --primary-P500: #003242; - - /* Secondary colors */ - --secondary-S50: #f3fae9; - --secondary-S75: #cf9a6; - --secondary-S100: #bbe081; - --secondary-S200: #9ed34a; - --secondary: #8aca25; - --secondary-S400: #618d1a; - --secondary-S500: #547b17; - - /* Warning colors */ - --warning-W50: #fef9eb; - --warning-W75: #f9e8ad; - --warning-W100: #f7df8a; - --warning-W200: #f3d158; - --warning: #f1c736; - --warning-W400: #a98b26; - --warning-W500: #937921; - - /* Error colors */ - --error-E50: #feebeb; - --error-E75: #f9adad; - --error-E100: #f78a8a; - --error-E200: #f35858; - --error: #F13636; - --error-E400: #F13636; - --error-E500: #932121; - - /* Neutral colors */ - --neutral-N50: #F9F9F9; - --neutral-N75: #E9EBF8; - --neutral-N100: #A1A6B3; - --neutral-N200: #797F92; - --neutral: #5D657C; - --neutral-N400: #414757; - --neutral-N500: #393E4C; - - /* Miscellaneous colors */ - --misc-positive: #008A00; - --misc-neutral: #007A9F; - --misc-warning: #FFC600; - --misc-annotations: #FF8A00; +/* "site-container" is the single div containing every other element in the site. + it floats center, with no vertical margins, and provides the overall + width of the site. we provide both an id and a class name in order + to allow more flexible cascading: id rules are highly ranked while + class names play nicer with other rules. */ - /* Gradients */ - --gradient-warmCool: linear-gradient(to right, #FF2F4B, #4E5CFF); - --gradient-brand: linear-gradient(to right, #0087AF, #0484A9, #18A603); - --gradient-brandReverse: linear-gradient(to right, #18A603, #0484A9, #0087AF); - --gradient-purpleBlue: linear-gradient(to right, #445CF3, #A333F1); +#site-container { + margin: 0 auto; /* floats the design center */ + width: 1600px; /* change the site design width here */ } diff --git a/assets/style/bioconductor.css b/assets/style/bioconductor.css index 2033960e5..a00f60f81 100755 --- a/assets/style/bioconductor.css +++ b/assets/style/bioconductor.css @@ -4,211 +4,233 @@ /* global styles defined at the topmost level. these will be overridden by subsequent selectors. */ - + /* reset the margins and padding of all elements so we can specify them ourselves */ /* some general treatments up top */ -body { - margin:0; padding:0; - background-color: #333333; - background-image: url(../images/site_bg.jpg); - background-position: top center; - background-repeat: no-repeat; -} -/* multiple lines (breaking text) won't work nicely with icons, but they - are only used at top-level pages with short text */ -h1 img, h2 img { padding-right:12px; vertical-align:middle; } -p, table { padding-bottom: 1em; } /* makes a nice separation between paragraphs */ - -.olive { color:#87b13f; } /* anything can be colored olive */ -.blue { color:#1a81c2; } /* anything can be colored blue (light blue) */ - -code { color:#87b13f; font-family: 'Lucida Console',monaco,monospace; } - -/* SiteContainer is the single div containing every other element in the site. - it floats center, with no vertical margins, and provides the overall - width of the site. we provide both an id and a class name in order - to allow more flexible cascading: id rules are highly ranked while - class names play nicer with other rules. */ -#SiteContainer { - margin:0 auto; /* floats the design center */ - width:960px; /* change the site design width here */ - position:relative; - /*border:2px black solid;*/ -} -.SiteContainer { - background-color: #ffffff; +/* multiple lines (breaking text) won't work nicely with icons, but they + are only used at top-level pages with short text */ +h1 img, +h2 img { + padding-right: 12px; + vertical-align: middle; } +p, +table { + padding-bottom: 1em; +} /* makes a nice separation between paragraphs */ + +.olive { + color: #87b13f; +} /* anything can be colored olive */ +.blue { + color: #1a81c2; +} /* anything can be colored blue (light blue) */ /* SiteMasthead contains the topmost logo and sitenav elements */ #SiteMasthead { height: 126px; - white-space:nowrap; - position:absolute; - top:0; - left:0; - width:960px; + white-space: nowrap; + position: absolute; + top: 0; + left: 0; + width: 960px; /*border:1px green solid;*/ } .SiteMasthead { - font-family:Verdana,Arial,Helvetica,Sans-serif; - font-size:70%; + font-family: Verdana, Arial, Helvetica, Sans-serif; + font-size: 70%; border-bottom: 1px #c9c5c5 solid; } .SiteMastheadRight { - position:relative; - z-index:1; - height:125px; - width:600px; - padding-right:48px; - float:right; - background-color:#0092ac; + position: relative; + z-index: 1; + height: 125px; + width: 600px; + padding-right: 48px; + float: right; + background-color: #0092ac; } .SiteMastheadRightBackground { - position:relative; - z-index:2; - height:100%; - width:100%; - background-image:url(../images/masthead_nav_fade.gif); + position: relative; + z-index: 2; + height: 100%; + width: 100%; + background-image: url(../images/masthead_nav_fade.gif); background-position: top left; background-repeat: repeat; } .site_search { - position:relative; - z-index:3; - height:52px; - width:240px; - margin-top:20px; - padding:0; - float:right; - text-align:center; - color:#ffffff; + position: relative; + z-index: 3; + height: 52px; + width: 240px; + margin-top: 20px; + padding: 0; + float: right; + text-align: center; + color: #ffffff; } ul.masthead_nav { - position:relative; - z-index:3; - height:53px; - width:600px; - margin:0; - padding:0; - float:right; - list-style-type:none; + position: relative; + z-index: 3; + height: 53px; + width: 600px; + margin: 0; + padding: 0; + float: right; + list-style-type: none; } /* positioning in order to play nicely with the black vanity bar above the site logo (see logo_vanity_bar) */ li.masthead_nav_element { - float:left; - height:53px; - text-align:center; + float: left; + height: 53px; + text-align: center; } /* note that padding-top + height = 53px, the height of the ul.masthead_nav. */ li.masthead_nav_element a { - font-size:130%; - color:#ffffff; - text-decoration:none; - font-weight:bold; - } -li.masthead_nav_element a:hover { color:#c4d931; } -li.masthead_nav_element_selected a { color:#c4d931; } + font-size: 130%; + color: #ffffff; + text-decoration: none; + font-weight: bold; +} +li.masthead_nav_element a:hover { + color: #c4d931; +} +li.masthead_nav_element_selected a { + color: #c4d931; +} /* used in the navigation auto-select. see global js file, checkNav(). */ - -.masthead_logo { border:0; padding: 24px 0 0 30px; float:left; } +.masthead_logo { + border: 0; + padding: 24px 0 0 30px; + float: left; +} .logo_vanity_bar { - position:absolute; - top:0; - left:0; - width:320px; - background-color:black; - height:1px; - z-index:1; + position: absolute; + top: 0; + left: 0; + width: 320px; + background-color: black; + height: 1px; + z-index: 1; } /* plays a bit with positioning and z-index in order to ride under the nav also w/in this element */ /* each masthead nav element is listed here from left to right, so you can adjust the width of each (if necessary). total width all all elements should not exceed 648px */ -#masthead_nav_element_1 { width:120px; } -#masthead_nav_element_2 { width:120px; } -#masthead_nav_element_3 { width:120px; } -#masthead_nav_element_4 { width:120px; } -#masthead_nav_element_5 { width:120px; } - +#masthead_nav_element_1 { + width: 120px; +} +#masthead_nav_element_2 { + width: 120px; +} +#masthead_nav_element_3 { + width: 120px; +} +#masthead_nav_element_4 { + width: 120px; +} +#masthead_nav_element_5 { + width: 120px; +} /* PageContent is the main content on the page */ -#PageContent { padding:140px 20px 0 20px; /*border:1px red solid;*/ } +#PageContent { + padding: 140px 20px 0 20px; /*border:1px red solid;*/ +} .PageContent { - font-family:Verdana,Arial,Helvetica,Sans-serif; - font-size:70%; - line-height:1.3em; + font-family: Verdana, Arial, Helvetica, Sans-serif; + font-size: 70%; + line-height: 1.3em; } /* when there is a right rail, apply these styles: */ /* width is 64% or 600px with a right rail. adjust in concert with width of RightRail. */ -div#PageContent.WithRightRail { float:left; width:600px; } +div#PageContent.WithRightRail { + float: left; + width: 600px; +} /* links are simply blue, hovering slightly less blue */ -.PageContent a { color:#1a81c2; } -.PageContent a:visited { color:#1a81c2; } -.PageContent a:hover { color:#4c94c2; } - - /* ul lists in main content area are generally pleasing */ -.PageContent ul { - list-style-type:none; - margin:0; - margin-bottom:1em; - padding:0; +.PageContent a { + color: #1a81c2; +} +.PageContent a:visited { + color: #1a81c2; } -.PageContent ul li { - background-image:url(../images/list_bullet_bare.gif); - background-position:0 .5em; - background-repeat:no-repeat; - padding-left:12px; +.PageContent a:hover { + color: #4c94c2; } +/* ul lists in main content area are generally pleasing */ +.PageContent ul { + list-style-type: none; + margin: 0; + margin-bottom: 1em; + padding: 0; +} +.PageContent ul li { + background-image: url(../images/list_bullet_bare.gif); + background-position: 0 0.5em; + background-repeat: no-repeat; + padding-left: 12px; +} /* PageBreadcrumbs contains the page's breadcrumb trail. it lives nested within PageContent in order to flow correctly when breadcrumbs wrap to a second line. we use a background image in order to create the little arrows between elements. */ -#PageBreadcrumbs { padding:0 0 2em 0; /*border:1px orange solid;*/ } +#PageBreadcrumbs { + padding: 0 0 2em 0; /*border:1px orange solid;*/ +} .PageBreadcrumbs { - font-family:Helvetica,Arial,Verdana,Sans-serif; - font-size:110%; + font-family: Helvetica, Arial, Verdana, Sans-serif; + font-size: 110%; +} +.PageBreadcrumbs ul { + list-style-type: none; + margin: 0; + padding: 0; } -.PageBreadcrumbs ul { list-style-type:none; margin:0; padding:0; } .PageBreadcrumbs ul li { - display:inline; - padding-left:.3em; - background-image:none; + display: inline; + padding-left: 0.3em; + background-image: none; } -.PageBreadcrumbs a, .PageBreadcrumbs a:visited { - color:#000000; - padding-right:1em; +.PageBreadcrumbs a, +.PageBreadcrumbs a:visited { + color: #000000; + padding-right: 1em; background-image: url(../images/breadcrumb_arrow.gif); - background-position:center right; - background-repeat:no-repeat; + background-position: center right; + background-repeat: no-repeat; +} +.PageBreadcrumbs a:hover { + color: #888888; } -.PageBreadcrumbs a:hover { color:#888888; } - /* PageInternalLinksMenu contains any links to intra-page anchors (i.e., jumps down this page) */ .PageInternalLinksMenu ul { - margin-left:.3em; - padding-left:.3em; - list-style-image:none; + margin-left: 0.3em; + padding-left: 0.3em; + list-style-image: none; } .PageInternalLinksMenu ul li { - display:inline; - padding-left:8px; - padding-right:1em; + display: inline; + padding-left: 8px; + padding-right: 1em; background-image: url(../images/list_bullet.gif); - background-repeat:no-repeat; - background-position:left 5px; + background-repeat: no-repeat; + background-position: left 5px; +} +.PageInternalLinksMenu ul li a { + white-space: nowrap; } -.PageInternalLinksMenu ul li a { white-space:nowrap; } - /* RightRail is the right-hand column on some pages. it is a sibling to PageContent. when used, you must add WithRightRail class to the @@ -216,117 +238,164 @@ div#PageContent.WithRightRail { float:left; width:600px; } #RightRail { /* width is 280px or 27%. adjust in concert with width of PageContent.WithRightRail */ - width:280px; - padding:140px 20px 0 10px; - float:right; - background-image:url(../images/rightrail_fade.jpg); - background-position:top left; - background-repeat:no-repeat; + width: 280px; + padding: 140px 20px 0 10px; + float: right; + background-image: url(../images/rightrail_fade.jpg); + background-position: top left; + background-repeat: no-repeat; /* fade ends at just under 560px, so make column at least that high to avoid an edge */ - min-height:560px; + min-height: 560px; /*border:1px purple solid;*/ } .RightRail { - font-family:Verdana,Arial,Helvetica,Sans-serif; - font-size:70%; - line-height:1.3em; + font-family: Verdana, Arial, Helvetica, Sans-serif; + font-size: 70%; + line-height: 1.3em; } /* line-height matches that of .PageContent */ -.RightRail a { color:#1a81c2; } -.RightRail a:visited { color:#1a81c2; } -.RightRail a:hover { color:#4c94c2; } +.RightRail a { + color: #1a81c2; +} +.RightRail a:visited { + color: #1a81c2; +} +.RightRail a:hover { + color: #4c94c2; +} p.rightrail_header { - font-size:130%; - color:#87b13f; - font-weight:bold; - padding:0; - margin-bottom:1em; + font-size: 130%; + color: #87b13f; + font-weight: bold; + padding: 0; + margin-bottom: 1em; } /* ul lists in right rail are generally pleasing using the - background-image trick */ + background-image trick */ .RightRail ul { - list-style-type:none; - padding:0; - margin-top:0em; - margin-bottom:1em; -} -.RightRail ul li { - background-image:url(../images/list_bullet_bare.gif); - background-position:0 .5em; - background-repeat:no-repeat; - padding-left:12px; + list-style-type: none; + padding: 0; + margin-top: 0em; + margin-bottom: 1em; +} +.RightRail ul li { + background-image: url(../images/list_bullet_bare.gif); + background-position: 0 0.5em; + background-repeat: no-repeat; + padding-left: 12px; } - /* "interior" navigation menu, usually within the RightRail, a simple ul-listing */ -ul.section_nav { list-style-type:none; margin:0; padding:0; padding-left:1em; } -ul.section_nav li { - padding-bottom:1em; - font-size:120%; - background-image:url(../images/list_bullet_bare.gif); - background-position:0 .5em; - background-repeat:no-repeat; - padding-left:12px; +ul.section_nav { + list-style-type: none; + margin: 0; + padding: 0; + padding-left: 1em; +} +ul.section_nav li { + padding-bottom: 1em; + font-size: 120%; + background-image: url(../images/list_bullet_bare.gif); + background-position: 0 0.5em; + background-repeat: no-repeat; + padding-left: 12px; } - /* SiteGlobalFooter is the olive box at page bottom which contains global site navigation elements, copyright and logos */ #SiteGlobalFooter { background-color: #345208; /* matches fade at bottom edge */ padding: 24px; - margin-top:30px; + margin-top: 30px; background-image: url(../images/global_footer_fade.gif); background-position: top left; background-repeat: repeat-x; - clear:both; + clear: both; /* in case the right hand column and page body above me get squirrely */ } .SiteGlobalFooter { color: #ffffff; - font-family:Verdana,Arial,Helvetica,Sans-serif; - font-size:70%; + font-family: Verdana, Arial, Helvetica, Sans-serif; + font-size: 70%; } /* slightly tighter spacing in the footer */ -.SiteGlobalFooter p { padding-bottom:.4em } -.SiteGlobalFooter a { color:#ffffff; text-decoration:none; } -.SiteGlobalFooter a:hover { text-decoration:underline; } -.SiteGlobalFooter ul { list-style-type:none; } +.SiteGlobalFooter p { + padding-bottom: 0.4em; +} +.SiteGlobalFooter a { + color: #ffffff; + text-decoration: none; +} +.SiteGlobalFooter a:hover { + text-decoration: underline; +} +.SiteGlobalFooter ul { + list-style-type: none; +} ul.footer_nav_list { - margin:0; - line-height:1.2; - margin-left:0; + margin: 0; + line-height: 1.2; + margin-left: 0; margin-top: 18px; - padding-left:0; + padding-left: 0; } /* the five main nav elements, not their contents */ -li.footer_nav_list_element { float:left; } +li.footer_nav_list_element { + float: left; +} /* boosts intra-element spacing */ -.footer_nav_list_element li { padding-bottom:.5em; } +.footer_nav_list_element li { + padding-bottom: 0.5em; +} /* each footer nav element is listed here from left to right, so you can adjust the width of each (if necessary). total width all all elements should not exceed 912px = the design width of 960px - 2 x 24px padding */ -.footer_nav_list_element_0 { width:50px; } -.footer_nav_list_element_1 { width:220px; } -.footer_nav_list_element_2 { width:220px; } -.footer_nav_list_element_3 { width:200px; } -.footer_nav_list_element_4 { width:220px; } - +.footer_nav_list_element_0 { + width: 50px; +} +.footer_nav_list_element_1 { + width: 220px; +} +.footer_nav_list_element_2 { + width: 220px; +} +.footer_nav_list_element_3 { + width: 200px; +} +.footer_nav_list_element_4 { + width: 220px; +} /* little logos for fhcrc and bioconductor link back to their respective locations */ -.global_footer_logo_bc { float:right; padding-left:70px; padding-right:30px; } -.global_footer_logo_bc img { border:0; width:154px; height:51px; } -.global_footer_logo_fhcrc { float:right; } -.global_footer_logo_fhcrc img { border:0; width:154px; height:51px; } +.global_footer_logo_bc { + float: right; + padding-left: 70px; + padding-right: 30px; +} +.global_footer_logo_bc img { + border: 0; + width: 154px; + height: 51px; +} +.global_footer_logo_fhcrc { + float: right; +} +.global_footer_logo_fhcrc img { + border: 0; + width: 154px; + height: 51px; +} /* copyright and attribution portion of the global footer */ -.attribution_copyright { padding-bottom:30px; border-bottom:1px #a8bf7c solid; } - +.attribution_copyright { + padding-bottom: 30px; + border-bottom: 1px #a8bf7c solid; +} /* here is the styling for shaded boxes. the content author should NOT use these classes directly... instead, create a div as follows: @@ -343,92 +412,111 @@ li.footer_nav_list_element { float:left; } top-to-bottom. box sb5, center-center, contains actual content. */ .shaded_box { - border:1px #d8dcdd solid; + border: 1px #d8dcdd solid; padding: 16px; - margin:8px; - background-color:#ffffff; + margin: 8px; + background-color: #ffffff; } /* will be removed after processing the shaded_box div */ -.shaded_box .box_header { font-size:130%; font-weight:bold; } -.shaded_box .box_header a, -.shaded_box .box_header a:visited { color:#000000; text-decoration:none; } -.shaded_box .box_header a:hover { color:#87b13f; text-decoration:underline; } +.shaded_box .box_header { + font-size: 130%; + font-weight: bold; +} +.shaded_box .box_header a, +.shaded_box .box_header a:visited { + color: #000000; + text-decoration: none; +} +.shaded_box .box_header a:hover { + color: #87b13f; + text-decoration: underline; +} -.sb { width:100%; height:100%; } +.sb { + width: 100%; + height: 100%; +} .sb .sb1 { - width:8px; - height:8px; - padding:0px; + width: 8px; + height: 8px; + padding: 0px; background-image: url(../images/shadedbox/tl.png); - background-position:bottom right; - background-repeat:no-repeat; + background-position: bottom right; + background-repeat: no-repeat; } .sb .sb2 { - height:8px; - padding:0px; + height: 8px; + padding: 0px; background-image: url(../images/shadedbox/top.png); - background-position:bottom left; - background-repeat:repeat-x; + background-position: bottom left; + background-repeat: repeat-x; } .sb .sb3 { - width:8px; - height:8px; - padding:0px; + width: 8px; + height: 8px; + padding: 0px; background-image: url(../images/shadedbox/tr.png); - background-position:bottom left; - background-repeat:no-repeat; + background-position: bottom left; + background-repeat: no-repeat; } .sb .sb4 { - width:8px; - height:8px; - padding:0px; + width: 8px; + height: 8px; + padding: 0px; background-image: url(../images/shadedbox/left.png); - background-position:top right; - background-repeat:repeat-y; + background-position: top right; + background-repeat: repeat-y; } .sb .sb5 { - padding:16px; - border:1px #d8dcdd solid; - vertical-align:top; - background-color:#ffffff; + padding: 16px; + border: 1px #d8dcdd solid; + vertical-align: top; + background-color: #ffffff; } .sb .sb6 { - width:8px; - height:8px; - padding:0px; + width: 8px; + height: 8px; + padding: 0px; background-image: url(../images/shadedbox/right.png); - background-position:top left; - background-repeat:repeat-y; + background-position: top left; + background-repeat: repeat-y; } .sb .sb7 { - width:8px; - height:8px; - padding:0px; + width: 8px; + height: 8px; + padding: 0px; background-image: url(../images/shadedbox/bl.png); - background-position:top right; - background-repeat:no-repeat; + background-position: top right; + background-repeat: no-repeat; } .sb .sb8 { - height:8px; - padding:0px; + height: 8px; + padding: 0px; background-image: url(../images/shadedbox/bottom.png); - background-position:top left; - background-repeat:repeat-x; + background-position: top left; + background-repeat: repeat-x; } .sb .sb9 { - width:8px; - height:8px; - padding:0px; + width: 8px; + height: 8px; + padding: 0px; background-image: url(../images/shadedbox/br.png); - background-position:top left; - background-repeat:no-repeat; + background-position: top left; + background-repeat: no-repeat; } /* sb-style boxes can have special styles within them */ -.sb .box_header { font-size:130%; } -.sb .box_header a, -.sb .box_header a:visited { color:#000000; text-decoration:none; } -.sb .box_header a:hover { color:#87b13f; text-decoration:underline; } - +.sb .box_header { + font-size: 130%; +} +.sb .box_header a, +.sb .box_header a:visited { + color: #000000; + text-decoration: none; +} +.sb .box_header a:hover { + color: #87b13f; + text-decoration: underline; +} /* here is the styling for code boxes. grey background, code (tt) font, and overflow is scroll so long lines don't push the main content area @@ -441,15 +529,15 @@ li.footer_nav_list_element { float:left; }

*/ -.code_box { +.code_box { background-color: #e3e3e3; - padding:1em; - border:1px #aaaaaa dashed; - font-family:'Lucida Console',monaco,monospace; - margin-top:1em; - margin-bottom:1em; + padding: 1em; + border: 1px #aaaaaa dashed; + font-family: "Lucida Console", monaco, monospace; + margin-top: 1em; + margin-bottom: 1em; overflow-x: auto; - white-space:pre; + white-space: pre; } .bioc_citation { @@ -458,189 +546,235 @@ li.footer_nav_list_element { float:left; } pre { background-color: #e3e3e3; - padding:1em; - border:1px #aaaaaa dashed; - font-family:'Lucida Console',monaco,monospace; - margin-top:0; - margin-bottom:1em; + padding: 1em; + border: 1px #aaaaaa dashed; + font-family: "Lucida Console", monaco, monospace; + margin-top: 0; + margin-bottom: 1em; overflow-x: auto; - white-space:pre; + white-space: pre; } pre code { - color:#000000; - font-family:'Lucida Console',monaco,monospace; + color: #000000; + font-family: "Lucida Console", monaco, monospace; } - /* simple grey-backgrounded box has no border. use like this
...
*/ .grey_box { background-color: #e6e8e7; - padding:1em; + padding: 1em; } /* and a white-backgrounded box to alternate with the grey_box above */ .white_box { - padding:1em; + padding: 1em; } /* back to top div

[ Back to top ]

*/ -.back_to_top { text-align:right; } +.back_to_top { + text-align: right; +} /* here is some styling for the search box */ .search_box { - font-family:'Lucida Console',monaco,monospace; - border:1px #888888 solid; - padding-left:4px; - height:24px; - width:160px; - margin-right:5px; + font-family: "Lucida Console", monaco, monospace; + border: 1px #888888 solid; + padding-left: 4px; + height: 24px; + width: 160px; + margin-right: 5px; } /* here is a special style for lists with giant arrows as bullets */ ul.big_arrow_list { - margin:0; - margin-left:.1em; - padding-top:.3em; - padding-left:20px; - list-style-image: url(../images/list_big_arrow.gif) -} /* home page uses a special, "big arrow" style list */ + margin: 0; + margin-left: 0.1em; + padding-top: 0.3em; + padding-left: 20px; + list-style-image: url(../images/list_big_arrow.gif); +} /* home page uses a special, "big arrow" style list */ ul.big_arrow_list li { - padding-bottom:1em; - padding-left:3px; + padding-bottom: 1em; + padding-left: 3px; background-image: none; } /* an inline list with no marker */ ul.inline_list { - list-style-type:none; - padding-right:5px; + list-style-type: none; + padding-right: 5px; } ul.inline_list li { display: inline; - padding-right:5px; + padding-right: 5px; } /* home page has a few special styles */ .hp_alert_box { - border-top:1px #d8dcdd solid; - border-bottom:1px #d8dcdd solid; - padding:1em; - padding-left:0; - margin:8px 8px 8px 8px; + border-top: 1px #d8dcdd solid; + border-bottom: 1px #d8dcdd solid; + padding: 1em; + padding-left: 0; + margin: 8px 8px 8px 8px; +} +.hp_options_box { + margin: 0 8px 0 8px; } -.hp_options_box { margin:0 8px 0 8px; } /* these selectors will invoke when printing or print previewing. this can be convenient to nicely-format the page for printing, including certain sizing and hiding of elements. */ @media print { /* for elements that you don't want to print, give them a class of noprint */ - .noprint { display:none; } - #SiteContainer { margin:auto; } - #SiteGlobalFooter { padding:0; padding-top:3em; border-top:1px black solid; } - .attribution_copyright { padding:0; border:0; } + .noprint { + display: none; + } + #SiteGlobalFooter { + padding: 0; + padding-top: 3em; + border-top: 1px black solid; + } + .attribution_copyright { + padding: 0; + border: 0; + } /* move the logo to the bottom of the print-out */ - #SiteMasthead { height:auto; position:static; } - .SiteMasthead { border-bottom:0; } - .masthead_logo { padding:0; float:none; } + #SiteMasthead { + height: auto; + position: static; + } + .SiteMasthead { + border-bottom: 0; + } + .masthead_logo { + padding: 0; + float: none; + } /* shaded boxes don't need to be shaded on print. since they are background images, they won't usually be printed anyway so this rule tightens up the spacing. */ - .sb1,.sb2,.sb3,.sb4,.sb6,.sb7,.sb8,.sb9 { display:none; } - #PageBreadcrumbs { display:none; } - .PageContent h1, .PageContent h2 { border-bottom:1px black solid; } - #PageContent { padding-left:0; padding-right:0; padding-top:0; } + .sb1, + .sb2, + .sb3, + .sb4, + .sb6, + .sb7, + .sb8, + .sb9 { + display: none; + } + #PageBreadcrumbs { + display: none; + } + .PageContent h1, + .PageContent h2 { + border-bottom: 1px black solid; + } + #PageContent { + padding-left: 0; + padding-right: 0; + padding-top: 0; + } /* when printing these two divs (if present) */ - div#PageContent.WithRightRail { width:69%;float:left; } + div#PageContent.WithRightRail { + width: 69%; + float: left; + } /* need to display side-by-side w/o breaking */ - #RightRail { width:29%; padding:0 0 0 0; } - .back_to_top { display:none; } - #PageInternalLinksMenu { display:none; } - .hp_alert_box, .hp_options_box { margin:24px 0 0 0; } - + #RightRail { + width: 29%; + padding: 0 0 0 0; + } + .back_to_top { + display: none; + } + #PageInternalLinksMenu { + display: none; + } + .hp_alert_box, + .hp_options_box { + margin: 24px 0 0 0; + } + /* this overrides the sneaky way we do bullets using background images. when printing, background images typically are omitted */ ul { list-style-type: disc !important; - margin:auto !important; - margin-left:1.4em !important; - margin-bottom:1em !important; + margin: auto !important; + margin-left: 1.4em !important; + margin-bottom: 1em !important; } } /* styles for displaying biocViews hierarchy */ .biocViewsTree { - float:left; - height:300px; - width:100%; - overflow:auto; + float: left; + height: 300px; + width: 100%; + overflow: auto; } .biocViewsTreePadding { -/* float:left; */ -/* width: 1%; */ + /* float:left; */ + /* width: 1%; */ } .biocViewsPackages { - float:right; - width:66%; + float: right; + width: 66%; } .biocViewsBelowTree { - clear:both; + clear: both; } - /* styles for package detail pages: */ -tr.row_odd -{ - background-color: #FFF; +tr.row_odd { + background-color: #fff; } -tr.row_even -{ - background-color: #DDD; +tr.row_even { + background-color: #ddd; } -td.docFixedWidth -{ - width: 56px; +td.docFixedWidth { + width: 56px; } /* tooltip styling */ .tooltip { - display:none; - background-color: white; - border-style: solid; - border-width: 2px; - border-color: black; - height:250px; - padding:40px 30px 10px 30px; - width:250px; - font-size:11px; + display: none; + background-color: white; + border-style: solid; + border-width: 2px; + border-color: black; + height: 250px; + padding: 40px 30px 10px 30px; + width: 250px; + font-size: 11px; } /* a .label element inside tooltip */ .tooltip .label { - color:yellow; - width:35px; + color: yellow; + width: 35px; } .tooltip a { - color:#ad4; - font-size:11px; - font-weight:bold; + color: #ad4; + font-size: 11px; + font-weight: bold; } .tooltip2 { - display:none; + display: none; background-color: white; border-style: solid; border-width: 2px; border-color: black; - padding:40px 30px 10px 30px; - font-size:11px; + padding: 40px 30px 10px 30px; + font-size: 11px; } /* limit image width to prevent oversized figures on workflow pages */ diff --git a/assets/style/colors.css b/assets/style/colors.css new file mode 100644 index 000000000..2a4eb322a --- /dev/null +++ b/assets/style/colors.css @@ -0,0 +1,62 @@ +/* Css global color variables */ + +/* You can use `var(--variable-name)` to get the value. */ + +:root { + /* primary colors */ + --primary-p50: #ebf4f7; + --primary-p75: #add2dd; + --primary-p100: #8bc0cf; + --primary-p200: #59a5bb; + --primary: #3792ad; + --primary-p400: #035771; + --primary-p500: #003242; + + /* secondary colors */ + --secondary-s50: #f3fae9; + --secondary-s75: #cfe9a6; + --secondary-s100: #bbe081; + --secondary-s200: #9ed34a; + --secondary: #8aca25; + --secondary-s400: #618d1a; + --secondary-s500: #547b17; + + /* warning colors */ + --warning-w50: #fef9eb; + --warning-w75: #f9e8ad; + --warning-w100: #f7df8a; + --warning-w200: #f3d158; + --warning: #f1c736; + --warning-w400: #a98b26; + --warning-w500: #937921; + + /* error colors */ + --error-e50: #feebeb; + --error-e75: #f9adad; + --error-e100: #f78a8a; + --error-e200: #f35858; + --error: #f13636; + --error-e400: #f13636; + --error-e500: #932121; + + /* neutral colors */ + --neutral-n50: #f9f9f9; + --neutral-n75: #e9ebf8; + --neutral-n100: #a1a6b3; + --neutral-n200: #797f92; + --neutral: #5d657c; + --neutral-n400: #414757; + --neutral-n500: #393e4c; + + /* Miscellaneous colors */ + --misc-positive: #008a00; + --misc-neutral: #007a9f; + --misc-warning: #ffc600; + --misc-annotations: #ff8a00; + + /* Gradients */ + --gradient-warmcool: linear-gradient(to right, #ff2f4b, #4e5cff); + --gradient-brand: linear-gradient(to right, #0087af, #0484a9, #18a603); + --gradient-brandreverse: linear-gradient(to right, #18a603, #0484a9, #0087af); + --gradient-purpleblue: linear-gradient(to right, #445cf3, #a333f1); +} diff --git a/assets/style/fonts.css b/assets/style/fonts.css new file mode 100644 index 000000000..6cc3b1b20 --- /dev/null +++ b/assets/style/fonts.css @@ -0,0 +1,134 @@ +/* global styles defined at the topmost level. + these can be overridden by subsequent selectors. */ + +/* Downloaded the font format */ +@font-face { + font-family: "Atkinson Hyperlegible"; + src: url("fonts/AtkinsonHyperlegible-Regular.woff") format("woff"); + src: url("fonts/AtkinsonHyperlegible-Regular.ttf") format("truetype"); +} + +@font-face { + font-family: "Atkinson Hyperlegible"; + src: url("fonts/AtkinsonHyperlegible-Bold.woff") format("woff"); + src: url("fonts/AtkinsonHyperlegible-Bold.ttf") format("truetype"); + font-weight: bold; +} + +/* CSS global styles */ +h1, +h2, +h3, +h4, +h5, +h6 { + line-height: 120%; +} + +h1 { + font-size: 2.25rem; /* 36px */ +} + +h2 { + font-size: 2rem; /* 32px */ +} + +h3 { + font-size: 1.6rem; /* 25px */ +} + +h4 { + font-size: 1.5rem; /* 23px */ +} + +h5 { + font-size: 1.2rem; /* 19px */ +} + +h6 { + font-size: 1.2rem; /* 18px */ +} + +.hero { + font-size: 5rem; /* 80px */ + line-height: 105%; +} + +@media screen and (width <= 700px) { + /* 700px */ + .hero { + font-size: 2.5rem; /* 40px */ + } + + h1 { + font-size: 2.1rem; /* 34px */ + } + + h2 { + font-size: 1.5rem; /* 24px */ + } + + h3 { + font-size: 1.4rem; /* 22px */ + } + + h4 { + font-size: 1.25rem; /* 20px */ + } + + h5 { + font-size: 1.125rem; /* 18px */ + } + + h6 { + font-size: 1.1rem; /* 17px */ + } +} + +p { + margin-top: 0; + margin-bottom: 0; + font-size: 1rem; /* 16px */ + line-height: 130%; + letter-spacing: 0; +} + +.code { + line-height: 120%; + font-family: Courier, monospace; +} + +.code-body { + font-size: 1.25rem; /* 20px */ +} + +.code-small { + font-size: 1rem; /* 16px */ +} + +.format-bold { + font-weight: bold; +} + +.format-boldunderline { + text-decoration: underline; + font-weight: bold; +} + +.format-underline { + text-decoration: underline; +} + +.text-xsmall { + font-size: 0.6rem; /* 10px */ + line-height: 120%; +} + +.text-small { + font-size: 0.8rem; /* 13px */ + line-height: 120%; +} + +.text-large { + font-size: 1.25rem; /* 20px */ +} diff --git a/assets/style/fonts/AtkinsonHyperlegible-Bold.ttf b/assets/style/fonts/AtkinsonHyperlegible-Bold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..c72b4889f0439e1d0d1de19b0cc270711e5c9809 GIT binary patch literal 54444 zcmcG134B|{wfD@u+HA{IEk0+i5)^>$96Wdk&OT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C|l{owoqKGXhz%_uivraiv)Rj!3d z8uCgjWl(zfcjl+g-@lmmK$20y2tUm4H?sDoxSwWMLyaT*3J5|}n$PWkyIE&I*gpsj zan!I5*bVGuauXXFt02(CVBq>5+&hRe+6^xl+QABF@)Nj28T#a`rML}>bR~0{T(%Ul zfHeIy{)#~wJ`{*#StS^ra%g2QM zrrzkbY~R_?=mei4$BEK$s7ZiymK7H?AnNu57elt;yto*7Vbt|)?BO~;mg!A>64 z&I$krWgPa8a=pwOCU^-21tou~pRl+xji*{%`>)(Chdk#<6j{5=@)VxRFTE}z&ui)! z&UiE6=hgJln=t2$kJByHmL7$c8f|0!#aeMYRY-0oyd*2;6hhx4{C1q ztmnO#Eug{Fi0^4_+F7~sA9+r|N3Q>z0KP*00MGL*JUpX6BkT#QwtziZVY8NM&9j8m zV&A1q{SkKEnfgg&>f=sTxEjt=fldwUlPuuF__$U%*CD#WJM*6<-c%0%7V)OMU%$id TKr#_LfslvfIfvvCp7Z|;vKEK6 literal 0 HcmV?d00001 diff --git a/assets/style/fonts/AtkinsonHyperlegible-Bold.woff b/assets/style/fonts/AtkinsonHyperlegible-Bold.woff new file mode 100644 index 0000000000000000000000000000000000000000..b8a1129102558e7751e30a8b19f602b61f3b4261 GIT binary patch literal 31060 zcmZ5`b8x4>7w)Ilr?zdo-5Oh4Tidp6+qSm0x3+ED-FmCr@9*BfZf2fI&NJspPBQO1 z$(h7WUQ7%C0{AW-Dgc!K>fP{f8}h%_|6jz!RAj&XxW0M3|B&P;*CsCdQw#twi2t^S z0RRwi+z}iWaRqs00Kmi^06-lA04VJ@kXL_*E2|0v0EX%S02mek0Ex8K1&J-M%*X-& zfFgZs6~3V#I7-xSWMlBHgCP3m*8l);v=!F43nN$OZyPcG+ehFV))>Fwa7^vZYybeL z_wT;0000D_A;XuCnSs-{)*$@b2m1d3$;{fr6aYXe2LQyS0DzF-1jVNla}xvO?^u(+ zeK`IDzT@kv`8WB^O@7nF>wDL7v%O^NAw>+r$ISw4Qxy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y`XxTP{k4k*NSw1pA~o?05KJkm;aed>T~-~mfkPxDrx`8`}_ap=KX)# CwOJYf literal 0 HcmV?d00001 diff --git a/assets/style/fonts/AtkinsonHyperlegible-Regular.ttf b/assets/style/fonts/AtkinsonHyperlegible-Regular.ttf new file mode 100644 index 0000000000000000000000000000000000000000..23614a4d3e27365f83989f2da4338e978de21c09 GIT binary patch literal 53504 zcmb@v2YegHu|K|h2jBn@EFcJgBv=4~onQk9f}LPhVU&MR9=CuCYi1HF{v-PVt zPi|OMF};&97w#vSCPP~{BOi71EX4ZB_1{=s|C1-rVXPnRU-ssjiO_hq`Ku}1UxWL# zYmlM;mZk>Row&|lvtio>&m}g0i?K93uYGj=rm;|2=6vc*KH5CEA#}lJ>80dUl*cu5 zZVYXh*im-#uNX7lj52p^-n4bwl>6>48O!($a4y}vWn%NPsrMW4?0S@cf^o*Dr&%&$ z#y7EHrm!KrX3Z>B72O|f7L)G;2k%zQK%8CEu8$}N1-+J=ud)ikf zH+{j9gS2)@hCM1-RC!BtuFg+4v1i3!HXKkKy`SHRkWLYA(o1 zPt)HejD5CdNEs!y_XIhEf8xQ_Ka%wAkLJjMC-BVqoC zp6S`x<|(GM-_Ob%GApIzLsc55K2?#8>Q#+Ytjo}fD`WfPrl3Bkc?w7;;BI33<18qC zbo~f*rE@BuU%g;B9K3p%uE#s4is|}cJySDS=ZIsfh_W8lU&6R1c=gzjD2W^N_mEf0 z)1_(Uq|%4^^p#=FbyE`SyiYr>W1Yls7(^uCH?$k> zHhgLvHtsckk+41C-h{7AgQkm2|DLEx>`nY`;y;pZNcvTBY4TX|Pm^Cyky1PuuNC z-n1v!=i2YK|2DlmeKh^b^v^P^8A~$0mGM#La!014%CX$B$?OWwb{kl9oeh1 zugl(>{dP`5PF2p8IseT4v9rNB0VjmyDEbE4jYpzLJBbeWkaRepR-z z?6R_Z$_{w4JgYsIdiHn@l{b~IEC2TjOU2HL$0{c)->%B93RXQ>-CO-e_50OFy|UNp zb$QFZt==B*Qty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>~S^X(;cY*1aE)2wnWwU zeXfVS61?g9xV!Dk7x#D@`Q3e{(B<~I^>N^TM9ATHBZNer7x8a<_`mF@-&R%9{>!KO Jf8{*=e*oTcc6tB+ literal 0 HcmV?d00001 diff --git a/layouts/_sitehead.html b/layouts/_sitehead.html index 8d1ec61f3..4a90a9a32 100644 --- a/layouts/_sitehead.html +++ b/layouts/_sitehead.html @@ -2,70 +2,99 @@ - - - - - -<% if item.identifier =~ /^\/help\/bioc-views\/package-pages\// \ - and not item.identifier =~ /\/all-/ %> + <% if item.identifier =~ /^\/help\/bioc-views\/package-pages\// \ and not + item.identifier =~ /\/all-/ %> - - -<% end %> + + + <% end %> - - - + + gtag("config", "G-WJMEEH1J58"); + - <% - if (item.identifier =~ /BiocViews\.html$/) - item[:rebase] = true - end - %> - - <% if !item[:rebase].nil? && item[:rebase]%> - - + <% if (item.identifier =~ /BiocViews\.html$/) item[:rebase] = true end %> <% + if !item[:rebase].nil? && item[:rebase]%> + + <% else %> - - <% end %> - <%# see about including this conditionally, only needed for pkg landing pages:%> + + <% end %> <%# see about including this conditionally, only needed for pkg + landing pages:%> - - <% - title = " - #{@item[:title]}" - title = "" if @item[:title].nil? or @item[:title].strip.empty? - %> + <% title = " - #{@item[:title]}" title = "" if @item[:title].nil? or + @item[:title].strip.empty? %> Bioconductor<%= title %> - - <% if item.identifier =~ /^\/help\/workflows\/.*\// %> - <% end %> + + + + + <% if item.identifier =~ /^\/help\/workflows\/.*\// %> + + <% end %> - <% if item.identifier =~ /help\/cloud/ and not item.identifier =~ /launch/ %> + <% if item.identifier =~ /help\/cloud/ and not item.identifier =~ /launch/ %> - <% end %> + <% end %> - diff --git a/layouts/course.html b/layouts/course.html index d4aedabf7..6dadc7c48 100644 --- a/layouts/course.html +++ b/layouts/course.html @@ -2,11 +2,12 @@ <%= render("/_sitehead/") %> - <%= render("/_nav/", :section_navigation => has_subnav?(@item) && subnav_items(@item).length > 0) %> - + diff --git a/layouts/default.html b/layouts/default.html index 7f9a56a6f..7d02752b4 100644 --- a/layouts/default.html +++ b/layouts/default.html @@ -6,35 +6,36 @@ <%= render("/components/header/") %> <%= render("/_nav/", :section_navigation => has_subnav?(@item) && subnav_items(@item).length > 0) %> -
+ <% if @item[:hero] %> +
<%= render(@item[:hero]) %>
+ <%end%> + +
<% if has_subnav?(@item) %> -
+
<% else %> -
+
<% end %> + <% if @item.attributes.has_key?(:package_index_page) %> + <%= render("/_pkg_idx/", :info => @item.attributes) %> + <% end %> + <% if @item.attributes.has_key?(:Package) %> + <%= render("/_bioc_views_package_detail/", :package => @item.attributes) %> + <% end %> - <% if (@item.identifier != '/')%> - <%= render("/_crumbs/") %> - <% end %> + <% if has_subnav?(@item) %> +
<%= render("/components/subnav/", :pages => subnav_items(@item)) %>
+ <% end %> - <% if @item.attributes.has_key?(:package_index_page)%> - <%= render("/_pkg_idx/", :info => @item.attributes)%> - <% end %> - <% if @item.attributes.has_key?(:Package)%> - <%= render("/_bioc_views_package_detail/", :package => @item.attributes)%> - <% end %> - <%# end hack%> +
+ <% if (@item.identifier != '/') %> + <%= render("/components/breadcrumbs/") %> + <% end %> - <%= yield if block_given? %> - <% if has_subnav?(@item) %> -
-
- - <%= render("/_subnav/", :pages => subnav_items(@item)) %> - <% end %> - -
+ <%= yield if block_given? %> + +
<%= render("/components/footer/") %> From ff9be49cc09983c404e956fe89b3d1f2d149d955 Mon Sep 17 00:00:00 2001 From: Mariam Mohamed <104569563+Mariam-mohamed110@users.noreply.github.com> Date: Mon, 24 Jul 2023 14:27:16 +0100 Subject: [PATCH 077/156] Few minor changes to header (#64) * visual improvements based on feedback * changes made based on reviews * removed mobile viewport --- assets/style/announcement.css | 5 ++++- assets/style/header.css | 30 +++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/assets/style/announcement.css b/assets/style/announcement.css index c3cfdbc98..e306b2e01 100644 --- a/assets/style/announcement.css +++ b/assets/style/announcement.css @@ -2,7 +2,7 @@ display: flex; justify-content: center; align-items: center; - gap: 1rem; + gap: 0.25rem; padding-top: 0.8rem; padding-bottom: 0.8rem; background-color: var(--misc-dark); @@ -12,6 +12,9 @@ .announcement p { font-size: 0.8125rem; + font-weight: 700; + text-decoration: underline; + text-decoration-thickness: 1px; } .announcement-warning { diff --git a/assets/style/header.css b/assets/style/header.css index 1ba8ea459..c8b0fd334 100644 --- a/assets/style/header.css +++ b/assets/style/header.css @@ -24,7 +24,7 @@ header { display: flex; flex-direction: row; align-items: center; - gap: 1.3rem; + gap: 1.5rem; } .header-size a { @@ -36,6 +36,7 @@ header { .nav-links { display: flex; gap: 2rem; + margin-right: 0.5rem; } .nav-links a:hover, @@ -60,13 +61,26 @@ header { .site-search { display: flex; align-items: center; + gap: 0.38rem; } .search-bar { border: none; outline: none; background-color: transparent; - padding-left: 5px; + padding-left: 0.25rem; + padding-top: 3px; +} + +input::placeholder { + font-size: 1rem; + font-style: normal; + line-height: 1.3rem; + color: var(--misc-dark); +} + +input:focus::placeholder { + color: transparent; } .masthead-logo { @@ -88,7 +102,7 @@ header { color: var(--primary-p400); display: flex; height: 2.5rem; - padding: 2px; + padding: 1px; width: 8.8rem; } @@ -110,18 +124,16 @@ header { display: flex; justify-content: center; background: #fff; + color: var(--primary-p400); transition: background 0.5s ease; width: 100%; gap: 5px; margin: 1px; + padding-left: 0.75rem; + padding-right: 0.4rem; } .header-button:hover span { background: var(--primary-p400); -} - -@media (width <= 700px) { - .header-desktop { - display: none; - } + color: #fff; } From 4e764b89d71a76059661c94fbf57f896380064c2 Mon Sep 17 00:00:00 2001 From: Steve Goode <52213009+SociableSteve@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:05:09 +0100 Subject: [PATCH 078/156] Added alt tags and links to footer social icons (#71) * Added alt tags and links to footer social icons * Fixed closing nav tags not being closing nav tags --- layouts/components/footer.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/layouts/components/footer.html b/layouts/components/footer.html index 486fc6124..39e90dd2c 100644 --- a/layouts/components/footer.html +++ b/layouts/components/footer.html @@ -1,9 +1,9 @@ -
+ <%= render("/_nav/", :section_navigation => has_subnav?(@item) && + subnav_items(@item).length > 0) %> +
<%= render("/_crumbs/") %> -

<%= @item[:title] %>

+

<%= @item[:title] %>

<%= @item[:location] %>

<%= @item[:start_date] %> ~ <%= @item[:end_date] %>

Instructors

@@ -21,9 +22,10 @@

Materials

<%= yield %>
- - <%= render("/_bioc_release_packages/") %> - <%= render("/_documentation/") %> + + + <%= render("/_bioc_release_packages/") %> <%= render("/_documentation/") + %>
<%= render("/_footer/") %>
diff --git a/layouts/default.html b/layouts/default.html index 03f439318..6a1ddee8e 100644 --- a/layouts/default.html +++ b/layouts/default.html @@ -5,7 +5,7 @@ <%= render("/_nav/", :section_navigation => has_subnav?(@item) && subnav_items(@item).length > 0) %> -
+
<% if has_subnav?(@item) %>
<% else %> diff --git a/package.json b/package.json index 61b053743..47267fa78 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "scripts": { "lint": "npm run css-lint && npm run js-lint", "css-lint": "npx stylelint \"**/*.css\" ", - "js-lint": "npx eslint assets/js", + "js-lint": "npx eslint assets/js" }, "author": "", "license": "ISC", From 33acbb9e61cf95c1afa14666d163a87567d3db72 Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:51:34 +0100 Subject: [PATCH 067/156] Workflows/kpi automation (#22) * added kpi performance after staging * fixing errors * running pagespeed insights * accesibility-automation * KPI-automation running should run on all Non Draft PRs * tweaks * tweaks * vars updated and kpi code cleaned up, ready to test * fixing printing * jobs seperated for ease of reading results * Update Kpi.yaml * comments set up * added slack notificatoins on the redesign2023 branch * pr gives comment, staging gives slack notification * changing axe to install locally * conflicts * linting errors * linting errors * linting errors * linting errors * linting errors * linting errors * linting errors * pageSpeed refactoring --- .eslintrc.json | 23 +++++++------- .github/workflows/linter.yaml | 4 ++- .github/workflows/pr_deploy.yaml | 44 +++++++++++++++++++++++++++ .github/workflows/staging.yaml | 52 ++++++++++++++++++++++++++++++-- PageSpeed.js | 34 +++++++++++++++++++++ 5 files changed, 143 insertions(+), 14 deletions(-) create mode 100644 PageSpeed.js diff --git a/.eslintrc.json b/.eslintrc.json index 8f6a4155d..b121b33d6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,13 +1,14 @@ { - "env": { - "browser": true, - "es2021": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "rules": { - } + "env": { + "browser": true, + "es2021": true, + "node": true, + "es6": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "rules": {} } diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 096d4b818..748c9f6b1 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -17,10 +17,10 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Lint Code Base uses: super-linter/super-linter/slim@v5 env: + LINTER_RULES_PATH: / VALIDATE_ALL_CODEBASE: false VALIDATE_GITHUB_ACTIONS: false VALIDATE_MARKDOWN: false @@ -29,5 +29,7 @@ jobs: VALIDATE_JSON: false VALIDATE_R: false VALIDATE_RUBY: false + VALIDATE_JAVASCRIPT_STANDARD: false + JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json DEFAULT_BRANCH: redesign2023 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 117d685b7..19d9dd96a 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -48,3 +48,47 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + kpi_metrics: + needs: dev-pr-create-s3 + permissions: + pull-requests: write + name: All KPI metrics + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: Setup Node.js environment + uses: actions/setup-node@v3.7.0 + with: + node-version: 18 + - name: install psi and axe + run: | + npm install psi + npm install @axe-core/cli + - name: run desktop psi + run: | + echo "DESKTOP_PSI_RESULTS<> $GITHUB_ENV + echo "$(node psi.js ${{env.URL_TO_USE}} desktop 50)" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + - name: run mobile psi + run: | + echo "MOBILE_PSI_RESULTS<> $GITHUB_ENV + echo "$(node psi.js ${{env.URL_TO_USE}} mobile 50)" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + - name: add_comment_pageSpeed + uses: mshick/add-pr-comment@v2 + with: + message: | + ${{env.DESKTOP_PSI_RESULTS}} + ${{env.MOBILE_PSI_RESULTS}} + message-id: psi + - name: run axe accesibility test + run: | + echo "AXE_RESULTS<> $GITHUB_ENV + echo "$(npx axe ${{env.URL_TO_USE}})" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + - name: add_comment_axe + uses: mshick/add-pr-comment@v2 + with: + message: ${{env.AXE_RESULTS}} + message-id: axe diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index 8ed5e6d9b..d3a67cc25 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -1,11 +1,11 @@ -name: deploy to staging environment +name: Deploy To staging on: push: branches: - redesign2023 jobs: - staging: + staging-deploy: concurrency: ci-${{ github.ref }} runs-on: ubuntu-latest environment: staging @@ -37,3 +37,51 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + kpi_metrics: + needs: staging-deploy + permissions: + pull-requests: write + name: All KPI metrics + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: Setup Node.js environment + uses: actions/setup-node@v3.7.0 + with: + node-version: 18 + - name: install psi and axe + run: | + npm install psi + npm install @axe-core/cli + - name: run desktop psi + run: | + echo "DESKTOP_PSI_RESULTS<> $GITHUB_ENV + echo "$(node psi.js ${{env.URL_TO_USE}} desktop 50)" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + - name: run mobile psi + run: | + echo "MOBILE_PSI_RESULTS<> $GITHUB_ENV + echo "$(node psi.js ${{env.URL_TO_USE}} mobile 50)" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + - name: run axe accesibility test + run: | + echo "AXE_RESULTS<> $GITHUB_ENV + echo "$(npx axe ${{env.URL_TO_USE}})" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + - name: send notification psi + if: ${{ github.ref == 'refs/heads/redesign2023' }} + uses: 8398a7/action-slack@v2 + with: + status: ${{ job.status }} + text: "${{env.DESKTOP_PSI_RESULTS}} \n ${{env.MOBILE_PSI_RESULTS}}" + env: + SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK}} + - name: send notification axe + if: ${{ github.ref == 'refs/heads/redesign2023' }} + uses: 8398a7/action-slack@v2 + with: + status: ${{ job.status }} + text: "${{env.AXE_RESULTS}}" + env: + SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK}} diff --git a/PageSpeed.js b/PageSpeed.js new file mode 100644 index 000000000..72e0385a1 --- /dev/null +++ b/PageSpeed.js @@ -0,0 +1,34 @@ +const psi = require("psi"); +const process = require("process"); +const url = process.argv[2]; +const strategyInput = process.argv[3]; +const thresholdInput = process.argv[4]; +const keyInput = process.argv[5]; +const run = async () => { + try { + const strategy = strategyInput?.toLowerCase(); + const key = keyInput || undefined; + const threshold = Number(thresholdInput); + if (!url) { + throw new Error("A valid Url is required to run Page Speed Insights."); + } + if (!strategy || (strategy !== "desktop" && strategy !== "mobile")) { + throw new Error( + "A valid strategy is required to run Page Speed Insights. (desktop or mobile)" + ); + } + + console.log(`Page Speed results for ${url} using ${strategy}`); + await psi.output(url, { + ...(key ? { key } : undefined), + ...(key ? undefined : { nokey: "true" }), + strategy, + format: "cli", + threshold, + }); + } catch (e) { + throw e.message; + } +}; + +run(); From fbc8b5e960e5a71f57ae629d68083b71183a82fb Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:22:53 +0100 Subject: [PATCH 068/156] changed psi to pagespeed (#43) --- .github/workflows/pr_deploy.yaml | 4 ++-- .github/workflows/staging.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index 19d9dd96a..c777ba175 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -68,12 +68,12 @@ jobs: - name: run desktop psi run: | echo "DESKTOP_PSI_RESULTS<> $GITHUB_ENV - echo "$(node psi.js ${{env.URL_TO_USE}} desktop 50)" >> $GITHUB_ENV + echo "$(node PageSpeed.js ${{env.URL_TO_USE}} desktop 50)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: run mobile psi run: | echo "MOBILE_PSI_RESULTS<> $GITHUB_ENV - echo "$(node psi.js ${{env.URL_TO_USE}} mobile 50)" >> $GITHUB_ENV + echo "$(node PageSpeed.js ${{env.URL_TO_USE}} mobile 50)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: add_comment_pageSpeed uses: mshick/add-pr-comment@v2 diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index d3a67cc25..9a7b61a6e 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -57,12 +57,12 @@ jobs: - name: run desktop psi run: | echo "DESKTOP_PSI_RESULTS<> $GITHUB_ENV - echo "$(node psi.js ${{env.URL_TO_USE}} desktop 50)" >> $GITHUB_ENV + echo "$(node PageSpeed.js ${{env.URL_TO_USE}} desktop 50)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: run mobile psi run: | echo "MOBILE_PSI_RESULTS<> $GITHUB_ENV - echo "$(node psi.js ${{env.URL_TO_USE}} mobile 50)" >> $GITHUB_ENV + echo "$(node PageSpeed.js ${{env.URL_TO_USE}} mobile 50)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: run axe accesibility test run: | From 822ceab1d857611045a5c18834d890b0196a435b Mon Sep 17 00:00:00 2001 From: Steve Goode <52213009+SociableSteve@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:53:00 +0100 Subject: [PATCH 069/156] [fix] auto formatting broke _sitehead (#44) --- layouts/_sitehead.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/layouts/_sitehead.html b/layouts/_sitehead.html index 4a90a9a32..d06d7e12d 100644 --- a/layouts/_sitehead.html +++ b/layouts/_sitehead.html @@ -3,7 +3,7 @@ - <% if item.identifier =~ /^\/help\/bioc-views\/package-pages\// \ and not + <% if item.identifier =~ /^\/help\/bioc-views\/package-pages\// and not item.identifier =~ /\/all-/ %> @@ -34,7 +34,13 @@ gtag("config", "G-WJMEEH1J58"); - <% if (item.identifier =~ /BiocViews\.html$/) item[:rebase] = true end %> <% + <% + if (item.identifier =~ /BiocViews\.html$/) + item[:rebase] = true + end + %> + + <% if !item[:rebase].nil? && item[:rebase]%> - <% title = " - #{@item[:title]}" title = "" if @item[:title].nil? or - @item[:title].strip.empty? %> + <% + title = " - #{@item[:title]}" + title = "" if @item[:title].nil? or @item[:title].strip.empty? + %> Bioconductor<%= title %> Date: Wed, 19 Jul 2023 10:31:54 +0100 Subject: [PATCH 070/156] Fix/kpis (#45) * changed psi to pagespeed * last one * Update PageSpeed.js, no console.logs --- .github/workflows/pr_deploy.yaml | 6 +++--- .github/workflows/staging.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_deploy.yaml b/.github/workflows/pr_deploy.yaml index c777ba175..a849c9002 100644 --- a/.github/workflows/pr_deploy.yaml +++ b/.github/workflows/pr_deploy.yaml @@ -68,12 +68,12 @@ jobs: - name: run desktop psi run: | echo "DESKTOP_PSI_RESULTS<> $GITHUB_ENV - echo "$(node PageSpeed.js ${{env.URL_TO_USE}} desktop 50)" >> $GITHUB_ENV + echo "$(node PageSpeed.js http://pr-preview-bioconductor-pr${{github.event.number}}.s3-website-us-east-1.amazonaws.com desktop 50)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: run mobile psi run: | echo "MOBILE_PSI_RESULTS<> $GITHUB_ENV - echo "$(node PageSpeed.js ${{env.URL_TO_USE}} mobile 50)" >> $GITHUB_ENV + echo "$(node PageSpeed.js http://pr-preview-bioconductor-pr${{github.event.number}}.s3-website-us-east-1.amazonaws.com mobile 50)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: add_comment_pageSpeed uses: mshick/add-pr-comment@v2 @@ -85,7 +85,7 @@ jobs: - name: run axe accesibility test run: | echo "AXE_RESULTS<> $GITHUB_ENV - echo "$(npx axe ${{env.URL_TO_USE}})" >> $GITHUB_ENV + echo "$(npx axe http://pr-preview-bioconductor-pr${{github.event.number}}.s3-website-us-east-1.amazonaws.com)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: add_comment_axe uses: mshick/add-pr-comment@v2 diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index 9a7b61a6e..85cd9c147 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -57,17 +57,17 @@ jobs: - name: run desktop psi run: | echo "DESKTOP_PSI_RESULTS<> $GITHUB_ENV - echo "$(node PageSpeed.js ${{env.URL_TO_USE}} desktop 50)" >> $GITHUB_ENV + echo "$(node PageSpeed.js ${{env.STAGING_URL}} desktop 50)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: run mobile psi run: | echo "MOBILE_PSI_RESULTS<> $GITHUB_ENV - echo "$(node PageSpeed.js ${{env.URL_TO_USE}} mobile 50)" >> $GITHUB_ENV + echo "$(node PageSpeed.js ${{env.STAGING_URL}} mobile 50)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: run axe accesibility test run: | echo "AXE_RESULTS<> $GITHUB_ENV - echo "$(npx axe ${{env.URL_TO_USE}})" >> $GITHUB_ENV + echo "$(npx axe ${{env.STAGING_URL}})" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: send notification psi if: ${{ github.ref == 'refs/heads/redesign2023' }} From ce422be872f5b22885085240d02bc9ecedd5cefd Mon Sep 17 00:00:00 2001 From: Steve Goode Date: Wed, 19 Jul 2023 09:32:44 +0100 Subject: [PATCH 071/156] [fix] Wrong rem value for h6 --- assets/style/fonts.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/style/fonts.css b/assets/style/fonts.css index 6cc3b1b20..75447ad3e 100644 --- a/assets/style/fonts.css +++ b/assets/style/fonts.css @@ -46,7 +46,7 @@ h5 { } h6 { - font-size: 1.2rem; /* 18px */ + font-size: 1.1rem; /* 18px */ } .hero { From c8feb57d557a370f372ab3e07fab35b1956e8dc1 Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Fri, 21 Jul 2023 11:41:29 +0100 Subject: [PATCH 072/156] Fix/pr close fail (#55) * when bucket dosent exist we dont fail, just skip * when bucket dosent exist we dont fail, just skip * Update pr_close.yaml --- .github/workflows/pr_close.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_close.yaml b/.github/workflows/pr_close.yaml index 115ed7973..865543c2a 100644 --- a/.github/workflows/pr_close.yaml +++ b/.github/workflows/pr_close.yaml @@ -9,12 +9,20 @@ jobs: environment: dev steps: - name: Empty Website Bucket - run: aws s3 rm s3://pr-preview-bioconductor-pr${{github.event.number}} --recursive + run: | + if aws s3api head-bucket --bucket pr-preview-bioconductor-pr${{github.event.number}} 2>/dev/null; then + aws s3 rm s3://pr-preview-bioconductor-pr${{github.event.number}} --recursive + echo "BUCKET_EXISTS=true" >> "$GITHUB_ENV" + else + echo "Bucket does not exist" + echo "BUCKET_EXISTS=false" >> "$GITHUB_ENV" + fi env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: "us-east-1" - name: Delete Website Bucket + if: ${{env.BUCKET_EXISTS == 'true'}} uses: danburtenshaw/s3-website-pr-action@v2.0.1 with: bucket-prefix: "pr-preview-bioconductor" From d99780a1dceaab00d2c037ba6161c23a81cbfda8 Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Fri, 21 Jul 2023 13:13:25 +0100 Subject: [PATCH 073/156] correct variables (#60) --- .github/workflows/staging.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index 85cd9c147..1357ed23d 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -57,17 +57,17 @@ jobs: - name: run desktop psi run: | echo "DESKTOP_PSI_RESULTS<> $GITHUB_ENV - echo "$(node PageSpeed.js ${{env.STAGING_URL}} desktop 50)" >> $GITHUB_ENV + echo "$(node PageSpeed.js ${{vars.STAGING_URL}} desktop 50)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: run mobile psi run: | echo "MOBILE_PSI_RESULTS<> $GITHUB_ENV - echo "$(node PageSpeed.js ${{env.STAGING_URL}} mobile 50)" >> $GITHUB_ENV + echo "$(node PageSpeed.js ${{vars.STAGING_URL}} mobile 50)" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: run axe accesibility test run: | echo "AXE_RESULTS<> $GITHUB_ENV - echo "$(npx axe ${{env.STAGING_URL}})" >> $GITHUB_ENV + echo "$(npx axe ${{vars.STAGING_URL}})" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - name: send notification psi if: ${{ github.ref == 'refs/heads/redesign2023' }} From 98b19e0df9d73f68257345b47dcbfb136d0c6145 Mon Sep 17 00:00:00 2001 From: Mariam Mohamed <104569563+Mariam-mohamed110@users.noreply.github.com> Date: Fri, 21 Jul 2023 13:19:30 +0100 Subject: [PATCH 074/156] Header implementation - desktop (#47) * beginning header * began with header * header design completed, waiting for pull from main * header completed * changed and removed some jquery * removed images * corrected linting errors * added announcement + header logo is a link to homepage * separated header css file * rems of announcement adjusted * font size of announcement adjusted * changes made based on comments * changes css specificity * added icons to files * js added to underline nav link when path matches * changed to class in mobile css * changes made based on comments * Update announcement.css removed commented out css * Update announcement.css to dark variable --- .eslintignore | 2 + .stylelintignore | 3 +- assets/images/icons/search-icon.svg | 3 + assets/images/logo/svg/Logo.svg | 83 ++++++ assets/images/masthead_nav_fade.gif | Bin 2243 -> 0 bytes assets/images/site_bg.jpg | Bin 18181 -> 0 bytes assets/js/bioconductor.js | 411 ++++++++++++--------------- assets/js/search.js | 6 +- assets/style/announcement.css | 33 +++ assets/style/bioconductor-v2.css | 5 +- assets/style/bioconductor.css | 130 +-------- assets/style/colors.css | 2 + assets/style/header.css | 127 +++++++++ layouts/_footer.html | 47 +-- layouts/_sitehead.html | 90 ++---- layouts/components/announcement.html | 5 + layouts/components/header.html | 61 ++++ layouts/course.html | 6 +- layouts/default.html | 1 + 19 files changed, 539 insertions(+), 476 deletions(-) create mode 100644 .eslintignore create mode 100644 assets/images/icons/search-icon.svg create mode 100644 assets/images/logo/svg/Logo.svg delete mode 100644 assets/images/masthead_nav_fade.gif delete mode 100644 assets/images/site_bg.jpg create mode 100644 assets/style/announcement.css create mode 100644 assets/style/header.css create mode 100644 layouts/components/announcement.html create mode 100644 layouts/components/header.html diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..acd930015 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +assets/js/search.js +assets/js/bioconductor.js \ No newline at end of file diff --git a/.stylelintignore b/.stylelintignore index 7479e7ec5..05be2a582 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -1 +1,2 @@ -assets/style/bioconductor.css \ No newline at end of file +assets/style/bioconductor.css + diff --git a/assets/images/icons/search-icon.svg b/assets/images/icons/search-icon.svg new file mode 100644 index 000000000..adf09d145 --- /dev/null +++ b/assets/images/icons/search-icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/assets/images/logo/svg/Logo.svg b/assets/images/logo/svg/Logo.svg new file mode 100644 index 000000000..5d9ea8026 --- /dev/null +++ b/assets/images/logo/svg/Logo.svg @@ -0,0 +1,83 @@ + + + + + + + + diff --git a/assets/images/masthead_nav_fade.gif b/assets/images/masthead_nav_fade.gif deleted file mode 100644 index fc33473a2a4a8f8a9884e5226d646bc6493257d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2243 zcmV;!2t4;kNk%w1VR!(i0E89*0EeLfh@t?7p#X}c0EwgkhoS(Dr~rnb0F9;qi>3gK zrT~kj0FbHxiK76Dr2vhm0EnXikEsBWssN6t0FkQzlC1y#|NsC0|NsC0|NsC0|NsC0 z|NsC0|NsC0|NsC0A^s6Va%Ew3Wn>_CX>@2HM@dak04x9i004LZrvLy2{@@{sLTR2S zpssA;1~3fGbUimXP7p)y{6NQINL(b2ilkEUXf_RoiF7KBSgnk#mLchSC6w@pgesR< zXn?B_liA)m9nTm16^X~hQt5m~sZ&>2TUlRTVH6`~ivnpXFKsbzHE}sT19d@nc}Por z4^mKo6M|QSg9OrfW z2-2R&kpcMCIw?)vN+vCVz1&93*Mez*^2fU>VenjAfXdbBNo)#_0qf21^w-sTb7V1b{zLlEcsnzkBgsR2C zd7P`t#aidAch=_`enzmFER(CU`XGdoP8#c|tN!76?4rv4)a;+00yrg^XskghqFE}s z;<9@5#c8L)KpU*EqP9S5eMo8vo381-=`4t0dMhow;m(U^z2=^aubcXE%U-*KeM@M- z1=@PfYfJ9uXl+q8JSe>J!qS_O5^Gp7gWF#9>yOcLJShYm2my4{X>HSgj!u@_arph~8+H;yeqZ_n#FiQEZ${&f_G9@Wetf0(KKpol5ID<-c zWmfZyb!+yX3pB}H_Xrc%8;@OeZv*4#*}){!%&x2c{yVn7wxV5d%x>!KtIcAlj*zI{AezMVi`%Y7}fnU2h@%w%LD456xsXTnOW`65LTVrP& z^?i$d{qG=aufyYm^LccI|ClDaTElI1viyJC}Dwv5mer#G&z80S5wT<@9E1#$ zsKgJ_KsssL9Q~je#Xv!@gH^o#V!1j)IIbmZdRS>+6-gw;l8wY=M23e->`1SYzpNfEg|y5eZt`5}i+k3QDIcwb{c!wzD$kfK4Z(2Zh{4@q~3uW;^p~$bI^ypZ@$O??!n~=Inr( zvh1fH>G{QAPV=GGB%=OAjrbBqHgrZ6jHktNr@@Za@uNb5sOp@s(QFA+;HGW)v*uLHsu@h3P=O*eptwQ!YZAuF^hi$fPZac7*^0+?KR`)9s9S>sxh}l!rm3>S^gJ zK$Oi^xZf!rNB+?&P3TTYx{5^ZbFEt$&oTCh)#WaHyz58VdRDv@AZ!fNirxwR_G|2I zuX~NlzWB=bJ1*j^SnoStaq8Ey{H=`iR%_Q*2DrJ-Z7qKh4A%fN$9R%is)N4+VPI`{ z!XKd}PVI}~%78Ay=k4%^Eo@*B|MY<&?r;T?isBNhn8hemv5;U)KpD>njX+JVjY%{| z?J8KtJ&%AvFJmA|tcDQ}rMQY|ee zw@lq0ewoTGw&;!lD&{ehdBbh~>zi5Y<}Y_v%}2hoY0vx-0P~qSe*QB}!YgP%Z?n+f zAvB`aW((| diff --git a/assets/images/site_bg.jpg b/assets/images/site_bg.jpg deleted file mode 100644 index 0a56282a5b21e1292fd2c90054803605f0f2aa90..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18181 zcmeI2e{3A*o!;M>{lVYzilRtyoyZ&cNbf0>qC}LGI8HKK$ih{!l9ijdl42*UE7J=m z&Z()+mqVO-xGVx%b_=FZRF{I=33Iv9N*wT1rROkdum)m4P$PF;D6Z-nI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SVhl2HgzWB9df(h$Wt82q4OU#)Ti| zqt9MjEMY)vH$YP7`?p9(x8rO?AL^{V`{#(gKygQ z#>*uM9|{3eQBh>5hYAVx#@gwY?uELOo62y%G(U zlC5p^HsX5qORbi|V`W+S`|{D1a1x`|#SStY5y2xAf5`WWZ`-)}z}3BCt!%k&bXy1C z-WGAKE-M|xluT(lm8_ok!iGAAvwh|8YK!yW`puU$Qq#>=e8=B;(GQOeTe`X--b(($ zbp0C|dv@)%*P2Ud5{?Tdm)Mc3QVuvz1xB z?dAVXS9~{=HQ&Z!cK$Z5|G&6YZuAzuX8HOpT=!eK#1|WHa4WgfZzZhX;QnuN*sMk| fZmG|g3o@TK`O5E3{cZ$)Hv<13M&PDv|NVahejbv@ diff --git a/assets/js/bioconductor.js b/assets/js/bioconductor.js index c8bb8df0f..ab97cc19d 100644 --- a/assets/js/bioconductor.js +++ b/assets/js/bioconductor.js @@ -1,7 +1,6 @@ - // bioconductor.js if (!/\.html$|\/$|#/.test(window.location.href)) - window.location.href = window.location.href + "/"; + window.location.href = window.location.href + "/"; // global variables var checkForEncryptInterval; @@ -12,199 +11,190 @@ var gExp; // logging functions: var fb_lite = false; try { - // if (firebug) { - // fb_lite = true; - // firebug.d.console.cmd.log("initializing firebug logging"); - // } -} catch(e) { - // do nothing + // if (firebug) { + // fb_lite = true; + // firebug.d.console.cmd.log("initializing firebug logging"); + // } +} catch (e) { + // do nothing } +//Sitehead code that will underline the nav element if the page URL matches the element + +const nav_elements = [/^\/about\//, /^\/developers\//, /^\/help\//]; + +function checkNav() { + const currentPath = window.location.pathname; + const navLinks = document.querySelectorAll(".nav-links a"); + navLinks.forEach((link, index) => { + if (nav_elements[index].test(currentPath)) { + link.classList.add("active"); + } + }); +} + +window.addEventListener("load", checkNav); function log(message) { - if (fb_lite) { - //console.log(message); - } else { - // if (window.console) { - // console.log(message); - // } - } - if (window.dump) { - dump(message + "\n"); - } + if (fb_lite) { + //console.log(message); + } else { + // if (window.console) { + // console.log(message); + // } + } + if (window.dump) { + dump(message + "\n"); + } } // convenience functions -String.prototype.trim = function() { - return this.replace(/^\s+|\s+$/g,""); -} -String.prototype.ltrim = function() { - return this.replace(/^\s+/,""); -} -String.prototype.rtrim = function() { - return this.replace(/\s+$/,""); -} +String.prototype.trim = function () { + return this.replace(/^\s+|\s+$/g, ""); +}; +String.prototype.ltrim = function () { + return this.replace(/^\s+/, ""); +}; +String.prototype.rtrim = function () { + return this.replace(/\s+$/, ""); +}; //utility functions -var getParameterByName = function ( name ) { - name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); - var regexS = "[\\?&]"+name+"=([^&#]*)"; - var regex = new RegExp( regexS ); - var results = regex.exec( window.location.href ); - if( results == null ) - return ""; - else - return decodeURIComponent(results[1].replace(/\+/g, " ")); -} - +var getParameterByName = function (name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regexS = "[\\?&]" + name + "=([^&#]*)"; + var regex = new RegExp(regexS); + var results = regex.exec(window.location.href); + if (results == null) return ""; + else return decodeURIComponent(results[1].replace(/\+/g, " ")); +}; // general-use function to add handlers. use like this: // if(document.getElementById('ehs.form')){ // addEvent(document.getElementById('ehs.form'), 'click', handleRadioClick); // } // JS Bible 6th ed. -function addEvent(elem,evtType,func){ - if(elem.addEventListener){ elem.addEventListener(evtType,func,false); } - else if(elem.attachEvent){ elem.attachEvent("on"+evtType, func); } - else { elem["on"+evtType] = func; } +function addEvent(elem, evtType, func) { + if (elem.addEventListener) { + elem.addEventListener(evtType, func, false); + } else if (elem.attachEvent) { + elem.attachEvent("on" + evtType, func); + } else { + elem["on" + evtType] = func; + } } - // parse the page and pick out div's that have a certain class // and change those into shaded boxes by adding HTML. this inserts // table code, but that should be transparent to all users. -function renderShadedBoxes(){ - +function renderShadedBoxes() { // prepare the HTML to insert into the divs of target class - var insert1 = '
 '; - var insert2 = ' 
'; + var insert1 = + '
 '; + var insert2 = + ' 
'; // obtain all the div's of the target class. note that pre-ie7 doesn't return .getAttribute('class') but does return .getAttribute('className') so we check for that specially - var oDivs = document.getElementsByTagName('div'); - var className = ''; - for(var i=0;i-1){ //alert(i); + var oDivs = document.getElementsByTagName("div"); + var className = ""; + for (var i = 0; i < oDivs.length; i++) { + className = + oDivs.item(i).getAttribute("class") || + oDivs.item(i).getAttribute("className"); //alert(className); + if (className && className.indexOf("shaded_box") > -1) { + //alert(i); oDivs.item(i).innerHTML = insert1 + oDivs.item(i).innerHTML + insert2; - oDivs.item(i).className=''; // this removes the shaded_box class from the original div so the styling i just made takes over + oDivs.item(i).className = ""; // this removes the shaded_box class from the original div so the styling i just made takes over } } - } // check each page load to see if there is any shaded_box class -addEvent(window,'load',renderShadedBoxes); - +addEvent(window, "load", renderShadedBoxes); - -// Masthead site navigation. we have five or more site navigation elements -// appearing at page top, and depending upon the current page url, we want -// the corresponding element to be olive and color unchanged at hover. we do this by pattern matching -// on the page url (client side), and turning the corresponding element olive. -// the position of each of the patterns corresponds to the masthead nav element number, -// e.g., the third element, /help/, which is index 3 (option base 1), matches masthead_nav_element_3 -// we use one Array of matching patterns for each element in case one element needs to match more than one patten. -// examples are shown below, but adjust for your info architecture. -var masthead_nav_elements = Array( Array(/^\/$/, /^\/index\.html$/),Array(/\/install\//, /install\.html/), - Array(/\/help\//),Array(/\/developers\//),Array(/\/about\//) ); -function checkNav(){ - for(var i=0; i 0) { +var tidyWorkflows = function () { + if (jQuery("#workflows").length > 0) { var workflows = []; - jQuery(".workflow").each(function(index) { + jQuery(".workflow").each(function (index) { workflows.push(jQuery(this).html()); }); jQuery("#workflows_left").html(""); jQuery("#workflows_right").html(""); var rands = {}; - while(Object.size(rands) < 4) { - var rand = Math.floor(Math.random()* workflows.length); + while (Object.size(rands) < 4) { + var rand = Math.floor(Math.random() * workflows.length); rands[rand] = -1; } var i = 0; var keys = Object.keys(rands); keys = keys.sort(); for (var key in keys.sort()) { - var id = (i < 2) ? "#workflows_left" : "#workflows_right"; + var id = i < 2 ? "#workflows_left" : "#workflows_right"; html = jQuery(id).html(); jQuery(id).html(html + "

  • " + workflows[parseInt(keys[i])] + "
  • "); i++; } } -} +}; -var unRebaseMirrors = function() { - if (!(window.mirror === undefined) && mirror == true) { - var wlh = window.location.href; - var segs = wlh.split("/"); - var host = wlh.replace(/^http:\/\//i, "").split("/")[0]; - segs.pop(); - var url = segs.join("/"); - if (segs[3] != "packages") { - host += "/" + segs[3]; - } - jQuery.each(jQuery(".do_not_rebase a"), function(index, value){ - var href = jQuery(value).attr("href"); - if (!href.match(/^http:/i)) { - if (href.match(/^\//)) { - jQuery(value).attr("href", "http://" + host + href); - } else if (href.match(/^#/)) { - jQuery(value).attr("href", window.location.href + href); - } else { - jQuery(value).attr("href", url + "/" + href); - } - } - }); +var unRebaseMirrors = function () { + if (!(window.mirror === undefined) && mirror == true) { + var wlh = window.location.href; + var segs = wlh.split("/"); + var host = wlh.replace(/^http:\/\//i, "").split("/")[0]; + segs.pop(); + var url = segs.join("/"); + if (segs[3] != "packages") { + host += "/" + segs[3]; } -} + jQuery.each(jQuery(".do_not_rebase a"), function (index, value) { + var href = jQuery(value).attr("href"); + if (!href.match(/^http:/i)) { + if (href.match(/^\//)) { + jQuery(value).attr("href", "http://" + host + href); + } else if (href.match(/^#/)) { + jQuery(value).attr("href", window.location.href + href); + } else { + jQuery(value).attr("href", url + "/" + href); + } + } + }); + } +}; /* * The little file server we use for development does not follow symlinks, so see if we are running * that server (assume we are if we are not on port 80) and change URLs tagged with the "symlink" * class (e.g. containing "release" or "devel" to point to the actual file. */ -var getHrefForSymlinks = function(href) { +var getHrefForSymlinks = function (href) { if (window.location.port == "") { return href; } else { var releaseRegex = /\/release\//; - var develRegex = /\/devel\//; + var develRegex = /\/devel\//; if (href.match(releaseRegex)) { return href.replace(releaseRegex, "/" + releaseVersion + "/"); } else if (href.match(develRegex)) { @@ -213,115 +203,64 @@ var getHrefForSymlinks = function(href) { return href; } } -} - - -var handleCitations = function() -{ - if (jQuery("#bioc_citation").length ) { - jQuery("#bioc_citation_outer").hide(); - var url = window.location.href; - url = url.replace("html","citations"); - var segs = url.split("/"); - var pkg = segs.pop(); - pkg = pkg.replace(".html", "") - segs.push(pkg); - segs.push("citation.html"); - url = segs.join("/"); - jQuery.ajax({url: url, dataType: "html", - success: function(data,textStatus,jqXHR){ - // working around possible R bug? - data = data.replace(/}. /g, ""); - data = data.replace(/}. 0) { -// jQuery("#initially_hidden").hide(); -// var dnsName = getParameterByName("dns"); -// var key = getParameterByName("key"); -// var url = "http://" + dnsName + ":8787"; -// var action = url + "/auth-do-sign-in"; -// var link = "../launch?username=ubuntu&password=bioc&url=" + url; -// link += "&encrypted="; -// jQuery("#ami_link").attr("href", link); -// jQuery("#instance_url").html(url); - -// var payload, exp, mod; -// payload = "ubuntu\nbioc"; -// var chunks = key.split(':', 2); -// exp = chunks[0]; -// mod = chunks[1]; - -// var encrypted = encrypt(payload, exp, mod); - -// var link = jQuery("#ami_link").attr("href"); -// jQuery("#ami_link").attr("href", link + encrypted); -// jQuery("#instance_loading").html(""); -// jQuery("#initially_hidden").show(); -// } - - -// if (jQuery("#launch_tryitnow").length > 0) { // is this launch.md? -// jQuery("#hide_this_stuff").hide(); -// var username = getParameterByName("username"); -// var password = getParameterByName("password"); -// var encrypted = getParameterByName("encrypted"); -// encrypted = encrypted.replace(/ /g, "+"); -// var url = getParameterByName("url"); -// var action = url + "/auth-do-sign-in"; -// jQuery("form").get(1).setAttribute("action", action); -// document.getElementById("username").value = username; -// document.getElementById("password").value = password; -// //todo change this: -// document.getElementById('persist').value = document.getElementById('staySignedIn').checked ? "1" : "0"; -// document.getElementById('clientPath').value = window.location.pathname; -// document.getElementById('package').value = encrypted; -// document.realform.submit(); -// } - -// if (jQuery("#captcha_js").length > 0) { -// jQuery("#captcha_js").html("") -// } - -// }); - -var submit_tryitnow = function() { - jQuery("#tryitnow_button").attr("disabled", "disabled"); - jQuery("#tryitnow_button").attr("value", "Please wait..."); - return(true); -} +var submit_tryitnow = function () { + jQuery("#tryitnow_button").attr("disabled", "disabled"); + jQuery("#tryitnow_button").attr("value", "Please wait..."); + return true; +}; -var processCaptchaResults = function(factoryFilename, captchaKey) { - var s = "http://cloud.bioconductor.org:2112/cgi-bin/display_captcha.jpg?factoryFilename="; - s += factoryFilename; - s += "&captchaKey="; - s += captchaKey; - jQuery("#captcha_img").attr("src", s); - jQuery("#captchaKey").attr("value", captchaKey); - jQuery("#factoryFilename").attr("value", factoryFilename); -} +var processCaptchaResults = function (factoryFilename, captchaKey) { + var s = + "http://cloud.bioconductor.org:2112/cgi-bin/display_captcha.jpg?factoryFilename="; + s += factoryFilename; + s += "&captchaKey="; + s += captchaKey; + jQuery("#captcha_img").attr("src", s); + jQuery("#captchaKey").attr("value", captchaKey); + jQuery("#factoryFilename").attr("value", factoryFilename); +}; diff --git a/assets/js/search.js b/assets/js/search.js index c6a2ffbb4..967c23fab 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -99,15 +99,15 @@ var ajaxErrHandler = function(jqXHR, textStatus, errorThrown) { }; var initSearch = function() { - q = getParameterByName("q"); + q = getParameterByName("search-bar"); q = q.replace(/\/$/, ""); if (q == "") { - jQuery("#q").focus(); + jQuery("#search-bar").focus(); } else { $("#search_results").html("Searching...."); - jQuery("#q").val(q); + jQuery("#search-bar").val(q); } jQuery("#if_search_results_present").hide(); diff --git a/assets/style/announcement.css b/assets/style/announcement.css new file mode 100644 index 000000000..c3cfdbc98 --- /dev/null +++ b/assets/style/announcement.css @@ -0,0 +1,33 @@ +.announcement { + display: flex; + justify-content: center; + align-items: center; + gap: 1rem; + padding-top: 0.8rem; + padding-bottom: 0.8rem; + background-color: var(--misc-dark); + color: #fff; + stroke: #fff; +} + +.announcement p { + font-size: 0.8125rem; +} + +.announcement-warning { + background-color: var(--misc-warning); + color: var(--misc-dark); + stroke: var(--misc-dark); +} + +.announcement-error { + background-color: var(--misc-error); + color: #fff; + stroke: #fff; +} + +.announcement-brand { + background-image: var(--gradient-brand); + color: #fff; + stroke: #fff; +} diff --git a/assets/style/bioconductor-v2.css b/assets/style/bioconductor-v2.css index 545e11934..2c51acd8e 100644 --- a/assets/style/bioconductor-v2.css +++ b/assets/style/bioconductor-v2.css @@ -1,5 +1,6 @@ body { font-family: "Atkinson Hyperlegible", sans-serif; + margin: 0; } /* "site-container" is the single div containing every other element in the site. @@ -8,7 +9,7 @@ body { to allow more flexible cascading: id rules are highly ranked while class names play nicer with other rules. */ -#site-container { +.site-container { margin: 0 auto; /* floats the design center */ - width: 1600px; /* change the site design width here */ + max-width: 1400px; /* change the site design width here */ } diff --git a/assets/style/bioconductor.css b/assets/style/bioconductor.css index a00f60f81..de5aba8f2 100755 --- a/assets/style/bioconductor.css +++ b/assets/style/bioconductor.css @@ -8,8 +8,6 @@ /* reset the margins and padding of all elements so we can specify them ourselves */ -/* some general treatments up top */ - /* multiple lines (breaking text) won't work nicely with icons, but they are only used at top-level pages with short text */ h1 img, @@ -18,11 +16,6 @@ h2 img { vertical-align: middle; } -p, -table { - padding-bottom: 1em; -} /* makes a nice separation between paragraphs */ - .olive { color: #87b13f; } /* anything can be colored olive */ @@ -30,113 +23,9 @@ table { color: #1a81c2; } /* anything can be colored blue (light blue) */ -/* SiteMasthead contains the topmost logo and sitenav elements */ -#SiteMasthead { - height: 126px; - white-space: nowrap; - position: absolute; - top: 0; - left: 0; - width: 960px; - /*border:1px green solid;*/ -} -.SiteMasthead { - font-family: Verdana, Arial, Helvetica, Sans-serif; - font-size: 70%; - border-bottom: 1px #c9c5c5 solid; -} -.SiteMastheadRight { - position: relative; - z-index: 1; - height: 125px; - width: 600px; - padding-right: 48px; - float: right; - background-color: #0092ac; -} -.SiteMastheadRightBackground { - position: relative; - z-index: 2; - height: 100%; - width: 100%; - background-image: url(../images/masthead_nav_fade.gif); - background-position: top left; - background-repeat: repeat; -} -.site_search { - position: relative; - z-index: 3; - height: 52px; - width: 240px; - margin-top: 20px; - padding: 0; - float: right; - text-align: center; - color: #ffffff; -} -ul.masthead_nav { - position: relative; - z-index: 3; - height: 53px; - width: 600px; - margin: 0; - padding: 0; - float: right; - list-style-type: none; -} /* positioning in order to play nicely with the black vanity bar above - the site logo (see logo_vanity_bar) */ -li.masthead_nav_element { - float: left; - height: 53px; - text-align: center; -} /* note that padding-top + height = 53px, the height of the - ul.masthead_nav. */ -li.masthead_nav_element a { - font-size: 130%; - color: #ffffff; - text-decoration: none; - font-weight: bold; -} -li.masthead_nav_element a:hover { - color: #c4d931; -} -li.masthead_nav_element_selected a { - color: #c4d931; -} -/* used in the navigation auto-select. see global js file, checkNav(). */ - -.masthead_logo { - border: 0; - padding: 24px 0 0 30px; - float: left; -} -.logo_vanity_bar { - position: absolute; - top: 0; - left: 0; - width: 320px; - background-color: black; - height: 1px; - z-index: 1; -} /* plays a bit with positioning and z-index in order to ride - under the nav also w/in this element */ -/* each masthead nav element is listed here from left to right, - so you can adjust the width of each (if necessary). total - width all all elements should not exceed 648px */ -#masthead_nav_element_1 { - width: 120px; -} -#masthead_nav_element_2 { - width: 120px; -} -#masthead_nav_element_3 { - width: 120px; -} -#masthead_nav_element_4 { - width: 120px; -} -#masthead_nav_element_5 { - width: 120px; +code { + color: #87b13f; + font-family: "Lucida Console", monaco, monospace; } /* PageContent is the main content on the page */ @@ -639,18 +528,7 @@ ul.inline_list li { padding: 0; border: 0; } - /* move the logo to the bottom of the print-out */ - #SiteMasthead { - height: auto; - position: static; - } - .SiteMasthead { - border-bottom: 0; - } - .masthead_logo { - padding: 0; - float: none; - } + /* shaded boxes don't need to be shaded on print. since they are background images, they won't usually be printed anyway so this rule tightens up the spacing. */ diff --git a/assets/style/colors.css b/assets/style/colors.css index 2a4eb322a..df4fe1dae 100644 --- a/assets/style/colors.css +++ b/assets/style/colors.css @@ -53,6 +53,8 @@ --misc-neutral: #007a9f; --misc-warning: #ffc600; --misc-annotations: #ff8a00; + --misc-error: #a92626; + --misc-dark: #070707; /* Gradients */ --gradient-warmcool: linear-gradient(to right, #ff2f4b, #4e5cff); diff --git a/assets/style/header.css b/assets/style/header.css new file mode 100644 index 000000000..1ba8ea459 --- /dev/null +++ b/assets/style/header.css @@ -0,0 +1,127 @@ +header { + position: sticky; + top: 0; + background: #fff; +} + +.header-size { + margin: 0 auto; + max-width: 1400px; + display: flex; + justify-content: space-between; + align-items: center; + width: calc(100% - 3rem); + padding-top: 1.5rem; + padding-bottom: 1rem; +} + +.header-logo { + display: flex; + align-items: center; +} + +.header-desktop { + display: flex; + flex-direction: row; + align-items: center; + gap: 1.3rem; +} + +.header-size a { + text-decoration: transparent; + color: var(--misc-dark); + transition: 300ms; +} + +.nav-links { + display: flex; + gap: 2rem; +} + +.nav-links a:hover, +.nav-links a.active { + text-decoration: underline; + text-underline-offset: 7px; + text-decoration-thickness: 3px; +} + +.search-container { + border: 1px solid var(--neutral-n75); + border-radius: 4rem; + width: 15rem; + height: 2.5rem; + display: flex; + align-items: center; + justify-content: space-between; + padding-left: 0.75rem; + padding-right: 0.75rem; +} + +.site-search { + display: flex; + align-items: center; +} + +.search-bar { + border: none; + outline: none; + background-color: transparent; + padding-left: 5px; +} + +.masthead-logo { + display: flex; + justify-content: center; + align-items: center; +} + +.masthead-logo img { + width: 12.6rem; + height: 3.6rem; + flex-shrink: 0; +} + +.header-button { + background-image: var(--gradient-brand); + border-radius: 8rem; + box-sizing: border-box; + color: var(--primary-p400); + display: flex; + height: 2.5rem; + padding: 2px; + width: 8.8rem; +} + +.header-button svg path { + transition: stroke 0.5s ease; +} + +.header-button:hover { + color: #fff; +} + +.header-button:hover svg path { + stroke: #fff; +} + +.get-started { + align-items: center; + border-radius: 4rem; + display: flex; + justify-content: center; + background: #fff; + transition: background 0.5s ease; + width: 100%; + gap: 5px; + margin: 1px; +} + +.header-button:hover span { + background: var(--primary-p400); +} + +@media (width <= 700px) { + .header-desktop { + display: none; + } +} diff --git a/layouts/_footer.html b/layouts/_footer.html index 2a8a454ef..83c60968f 100644 --- a/layouts/_footer.html +++ b/layouts/_footer.html @@ -7,7 +7,7 @@

    Copyright © 2003 - <%= Time.now.year %>, Bioconductor

    - +
    - - -
    - - - - - - - - - -
    -
    - - - - - - -
    -
    - -
    diff --git a/layouts/_sitehead.html b/layouts/_sitehead.html index d06d7e12d..2dba0addb 100644 --- a/layouts/_sitehead.html +++ b/layouts/_sitehead.html @@ -1,4 +1,5 @@ + @@ -9,30 +10,19 @@ - - - <% end %> + + +<% end %> - - - + + gtag('config', 'G-WJMEEH1J58'); + <% if (item.identifier =~ /BiocViews\.html$/) @@ -52,57 +42,35 @@ document.write('\n'); } + <% else %> - - <% end %> <%# see about including this conditionally, only needed for pkg - landing pages:%> + + <% end %> + <%# see about including this conditionally, only needed for pkg landing pages:%> - + <% title = " - #{@item[:title]}" title = "" if @item[:title].nil? or @item[:title].strip.empty? %> + Bioconductor<%= title %> - - - - - <% if item.identifier =~ /^\/help\/workflows\/.*\// %> - - <% end %> + + + + + + <% if item.identifier =~ /^\/help\/workflows\/.*\// %> + <% end %> - <% if item.identifier =~ /help\/cloud/ and not item.identifier =~ /launch/ %> + <% if item.identifier =~ /help\/cloud/ and not item.identifier =~ /launch/ %> - <% end %> + <% end %> - + + \ No newline at end of file diff --git a/layouts/components/announcement.html b/layouts/components/announcement.html new file mode 100644 index 000000000..ee321a7ec --- /dev/null +++ b/layouts/components/announcement.html @@ -0,0 +1,5 @@ +
    + + +

    On March 8th, the Bioconductor Core Team will rename the default branch on `git.bioconductor.org` to `devel`. This change affects maintainers of packages.

    +
    \ No newline at end of file diff --git a/layouts/components/header.html b/layouts/components/header.html new file mode 100644 index 000000000..ee6dc608a --- /dev/null +++ b/layouts/components/header.html @@ -0,0 +1,61 @@ +
    + <%= render("/components/announcement/") %> + +
    + + + +
    +
    diff --git a/layouts/course.html b/layouts/course.html index 6dadc7c48..9f183a540 100644 --- a/layouts/course.html +++ b/layouts/course.html @@ -2,8 +2,10 @@ <%= render("/_sitehead/") %> - <%= render("/_nav/", :section_navigation => has_subnav?(@item) && - subnav_items(@item).length > 0) %> + <%= render("/components/header/") %> <%= render("/_nav/", + :section_navigation => has_subnav?(@item) && subnav_items(@item).length > 0) + %> +
    <%= render("/_crumbs/") %> diff --git a/layouts/default.html b/layouts/default.html index 6a1ddee8e..236718b6a 100644 --- a/layouts/default.html +++ b/layouts/default.html @@ -3,6 +3,7 @@ prefix="og: http://ogp.me/ns#"> <%= render("/_sitehead/") %> + <%= render("/components/header/") %> <%= render("/_nav/", :section_navigation => has_subnav?(@item) && subnav_items(@item).length > 0) %>
    From f988cef5d9b7765ed0762fb8aa6c2f4c99ea00a7 Mon Sep 17 00:00:00 2001 From: Biraj Pantha <100142251+bp289@users.noreply.github.com> Date: Fri, 21 Jul 2023 13:25:19 +0100 Subject: [PATCH 075/156] Footer (#51) * converted everything to rem * converted everything to rem * refactoring * kebab case * kebab case * linting errors * linting errors * Finished mobile footer * added footer to course.html * fixed responsiev design, general css cleanup * re-added clear:both * changed from max-width to width * Update breakpoint footer.css * changed to rem * no comments * css changes based on comments * html changes and file names/locations changed * changes to course * put footer under page content and added breakpoint in p tag(copyright) --- assets/images/icons/svgs/linkedin.svg | 9 ++ assets/images/icons/svgs/mastodon.svg | 3 + assets/images/icons/svgs/twitter.svg | 9 ++ assets/images/icons/svgs/youtube.svg | 9 ++ assets/images/logo/svg/BC-Logo-White.svg | 79 +++++++++++++++ assets/style/fonts.css | 5 +- assets/style/footer.css | 117 +++++++++++++++++++++++ layouts/_sitehead.html | 1 + layouts/components/footer.html | 63 ++++++++++++ layouts/course.html | 2 +- layouts/default.html | 4 +- 11 files changed, 297 insertions(+), 4 deletions(-) create mode 100644 assets/images/icons/svgs/linkedin.svg create mode 100644 assets/images/icons/svgs/mastodon.svg create mode 100644 assets/images/icons/svgs/twitter.svg create mode 100644 assets/images/icons/svgs/youtube.svg create mode 100644 assets/images/logo/svg/BC-Logo-White.svg create mode 100644 assets/style/footer.css create mode 100644 layouts/components/footer.html diff --git a/assets/images/icons/svgs/linkedin.svg b/assets/images/icons/svgs/linkedin.svg new file mode 100644 index 000000000..8bbe5e742 --- /dev/null +++ b/assets/images/icons/svgs/linkedin.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/icons/svgs/mastodon.svg b/assets/images/icons/svgs/mastodon.svg new file mode 100644 index 000000000..3938f41b3 --- /dev/null +++ b/assets/images/icons/svgs/mastodon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/icons/svgs/twitter.svg b/assets/images/icons/svgs/twitter.svg new file mode 100644 index 000000000..fc2c7effe --- /dev/null +++ b/assets/images/icons/svgs/twitter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/icons/svgs/youtube.svg b/assets/images/icons/svgs/youtube.svg new file mode 100644 index 000000000..7fcb8c55b --- /dev/null +++ b/assets/images/icons/svgs/youtube.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/logo/svg/BC-Logo-White.svg b/assets/images/logo/svg/BC-Logo-White.svg new file mode 100644 index 000000000..225261e2e --- /dev/null +++ b/assets/images/logo/svg/BC-Logo-White.svg @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/style/fonts.css b/assets/style/fonts.css index 75447ad3e..f65c11fea 100644 --- a/assets/style/fonts.css +++ b/assets/style/fonts.css @@ -23,6 +23,7 @@ h4, h5, h6 { line-height: 120%; + margin-bottom: 0.3rem; /* 5px */ } h1 { @@ -85,12 +86,14 @@ h6 { } } -p { +p, +a { margin-top: 0; margin-bottom: 0; font-size: 1rem; /* 16px */ line-height: 130%; letter-spacing: 0; + text-decoration: none; } .code { diff --git a/assets/style/footer.css b/assets/style/footer.css new file mode 100644 index 000000000..dea01e904 --- /dev/null +++ b/assets/style/footer.css @@ -0,0 +1,117 @@ +footer { + margin-left: auto; + margin-right: auto; + width: 100%; /* 1400p x */ + background-color: #121212; + padding: 2.5rem 6.25rem; /* 40px, 100px */ + border-style: solid; + border-width: 0.625rem 0 0; /* 10px */ + border-image: var(--gradient-brandreverse) 1; + margin-top: 1.875rem; /* 30px */ + color: #fff; + font-size: 0.7rem; + height: auto; + box-sizing: border-box; +} + +footer a { + color: #fff; +} +.footer-container { + max-width: 1400px; + margin: auto; +} + +.link-container { + display: grid; + grid-template-columns: 1fr 1fr; +} + +.link-container-inner { + display: flex; + justify-content: flex-start; + width: 100%; +} + +:is(.link-container-inner nav) { + display: flex; + flex-direction: column; + align-items: start; + gap: 0.625rem; + padding-inline-start: 0px; + margin-right: auto; +} + +.logo-contact-container { + display: flex; + justify-content: space-between; + align-items: flex-end; +} + +.socials-logo-container { + display: flex; + align-items: center; + gap: 4rem; +} + +.socials img { + padding-right: 2rem; /* 30px */ + margin-bottom: 0; +} + +.socials { + margin-top: 0.5rem; + margin-top: 1.5rem; +} + +.footer-logo { + width: 12rem; + height: 3.5rem; + padding-top: 1rem; +} + +@media (width <= 768px) { + footer { + display: flex; + padding: 2rem; + justify-content: center; + } + + .link-container { + display: block; + } + + :is(.link-container-inner nav) { + min-width: 10rem; + margin-inline-end: 0px; + } + + .list-container-inner { + margin-bottom: 1.25rem; + } + + .logo-contact-container { + align-items: flex-start; + flex-direction: column; + } + + .copyright { + margin-top: 2rem; + } + + .footer-logo { + width: 12rem; + height: 3.5rem; + } + + .socials-logo-container { + display: block; + padding: 1rem 0rem; + } + + .socials { + margin: auto; + padding-right: 1rem; + padding-left: 1rem; + } +} diff --git a/layouts/_sitehead.html b/layouts/_sitehead.html index 2dba0addb..ec3fa5a04 100644 --- a/layouts/_sitehead.html +++ b/layouts/_sitehead.html @@ -62,6 +62,7 @@ <% if item.identifier =~ /^\/help\/workflows\/.*\// %> <% end %> + diff --git a/layouts/components/footer.html b/layouts/components/footer.html new file mode 100644 index 000000000..486fc6124 --- /dev/null +++ b/layouts/components/footer.html @@ -0,0 +1,63 @@ + diff --git a/layouts/course.html b/layouts/course.html index 9f183a540..20c30b0b0 100644 --- a/layouts/course.html +++ b/layouts/course.html @@ -29,7 +29,7 @@

    Materials

    <%= render("/_bioc_release_packages/") %> <%= render("/_documentation/") %>
    - <%= render("/_footer/") %> + <%= render("/components/footer") %>
    diff --git a/layouts/default.html b/layouts/default.html index 236718b6a..7f9a56a6f 100644 --- a/layouts/default.html +++ b/layouts/default.html @@ -36,7 +36,7 @@
    - <%= render("/_footer/") %>
    + <%= render("/components/footer/") %> - + \ No newline at end of file From 5c27130e983c6989a713986949a350e01582cc55 Mon Sep 17 00:00:00 2001 From: Steve Goode <52213009+SociableSteve@users.noreply.github.com> Date: Mon, 24 Jul 2023 12:00:33 +0100 Subject: [PATCH 076/156] Prepared for generic page layout (#52) * Prepared for generic page layout * Updated the template to use cotainer and added hero option * Updated course.html to use the new structure * Updated to 1400px width as max rather than 1600px * Refactored the default.html to be cleaner and more structurally correct * Some minor fixes from auto formatting * Added desktop stylings for content, sidebar navigation, and breadcrumbs * Moved hero outside main * [WIP] hid navigation if dropping below 480px wide * Tidied up some spacing on desktop * Removed JS code which changes structure of the sidebar * [fix] styling for pages without a subnav, and breakpoint width * Added styling to some exiting sidebar menu items * Fixed several linter issues * Removed temp div * Fixed bad merge conflict fix * linters updated * linters updated * removed htmlrc * wrong branch unding changes * wrong branch unding changes --------- Co-authored-by: bp289 --- README.md | 36 +++----- assets/images/chevron_right.svg | 3 + assets/js/bioconductor.js | 27 ------ assets/style/bioconductor-v2.css | 99 +++++++++++++++++++- assets/style/bioconductor.css | 138 ---------------------------- content/index.yaml | 1 + layouts/_sitehead.html | 1 + layouts/components/breadcrumbs.html | 16 ++++ layouts/components/index_hero.html | 1 + layouts/components/subnav.html | 13 +++ layouts/course.html | 10 +- layouts/default.html | 45 ++++----- 12 files changed, 175 insertions(+), 215 deletions(-) create mode 100644 assets/images/chevron_right.svg create mode 100644 layouts/components/breadcrumbs.html create mode 100644 layouts/components/index_hero.html create mode 100644 layouts/components/subnav.html diff --git a/README.md b/README.md index 5607346d1..f7c899511 100644 --- a/README.md +++ b/README.md @@ -292,27 +292,21 @@ Or if you would like to use your package manager to install, you can find instru https://nodejs.org/en/download/package-manager -Install linters: - - npm ci - -This project includes stylelint and eslint. - -stylelint(for linting css code): - - npm run css-lint - -eslint(will lint everything in the assets folder): - - npm run js-lint - -or if you need to specify a directory or a file: - - npx eslint - -To run all linters : - - npm run lint-all +Install linters: `npm ci` + +This project includes liners for HTML, CSS, JavaScript, and markdown files. +instructions for each +To run all linters you can use the command `npm run lint` +For each linter here are the options available: + +- stylelint (CSS): + - `npm run css-lint` +- eslint (JavaScript): + - `npm run js-lint <(optional)directory/file>` (default directory is current working directory) +- htmllint (HTML) + - `npm run html-lint <(optional)directory/file>` (default directory is current working directory) +- markdownLint (Markdown) + - `npm run md-lint <(required)directory/file>` ## Overview of site source code diff --git a/assets/images/chevron_right.svg b/assets/images/chevron_right.svg new file mode 100644 index 000000000..cf6f4d5f6 --- /dev/null +++ b/assets/images/chevron_right.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/js/bioconductor.js b/assets/js/bioconductor.js index ab97cc19d..4f9706154 100644 --- a/assets/js/bioconductor.js +++ b/assets/js/bioconductor.js @@ -85,33 +85,6 @@ function addEvent(elem, evtType, func) { } } -// parse the page and pick out div's that have a certain class -// and change those into shaded boxes by adding HTML. this inserts -// table code, but that should be transparent to all users. -function renderShadedBoxes() { - // prepare the HTML to insert into the divs of target class - var insert1 = - '
     '; - var insert2 = - ' 
    '; - - // obtain all the div's of the target class. note that pre-ie7 doesn't return .getAttribute('class') but does return .getAttribute('className') so we check for that specially - var oDivs = document.getElementsByTagName("div"); - var className = ""; - for (var i = 0; i < oDivs.length; i++) { - className = - oDivs.item(i).getAttribute("class") || - oDivs.item(i).getAttribute("className"); //alert(className); - if (className && className.indexOf("shaded_box") > -1) { - //alert(i); - oDivs.item(i).innerHTML = insert1 + oDivs.item(i).innerHTML + insert2; - oDivs.item(i).className = ""; // this removes the shaded_box class from the original div so the styling i just made takes over - } - } -} - -// check each page load to see if there is any shaded_box class -addEvent(window, "load", renderShadedBoxes); Object.size = function (obj) { var size = 0, diff --git a/assets/style/bioconductor-v2.css b/assets/style/bioconductor-v2.css index 2c51acd8e..3ae939f2b 100644 --- a/assets/style/bioconductor-v2.css +++ b/assets/style/bioconductor-v2.css @@ -3,11 +3,100 @@ body { margin: 0; } -/* "site-container" is the single div containing every other element in the site. - it floats center, with no vertical margins, and provides the overall - width of the site. we provide both an id and a class name in order - to allow more flexible cascading: id rules are highly ranked while - class names play nicer with other rules. */ +.container { + margin: 0 auto; + width: calc(100% - 3rem); + max-width: 1400px; +} + +main > .container.main-subnav { + display: grid; + gap: 2rem; + grid-template-columns: 300px 1fr; + grid-template-areas: + "left-col ."; +} + +.left-col { + grid-area: left-col; + display: flex; + flex-direction: column; + gap: 1rem; +} + +/* TODO: shaded box is a legacy block, and included here for backwards compatibility. once the content is updated this should be removed */ +.shaded_box { + padding: 0.5rem; +} + +.shaded_box .box_header { + font-size: 1rem; + text-decoration: underline; + font-weight: 700; +} + +.shaded_box .box_header .olive { + display: none; +} + +.shaded_box ul { + list-style-type: none; + padding: 0; + margin: 0; +} + +nav.subnav, .shaded_box { + border-radius: 0.5rem; + border: 1px solid var(--primary-p75); + padding: 0.5rem; +} + +nav.subnav a, .shaded_box ul li { + text-decoration: underline; + display: block; + padding: 0.5rem; + padding-bottom: 0.75rem; + background-image: url("/images/chevron_right.svg"); + background-repeat: no-repeat; + background-position: right center; +} + +nav.subnav a, .shaded_box ul li a { + color: black; +} + +.breadcrumbs { + list-style-type: none; + display: flex; + gap: 0.5rem; + margin: 0 0 0.75rem; + padding: 0; + line-height: 1.3rem; +} + +.breadcrumbs li:not(:first-of-type) { + background-image: url("/images/chevron_right.svg"); + background-repeat: no-repeat; + padding-left: 1.625rem; /* make space for the background image */ +} + +.breadcrumbs li:last-of-type { + font-weight: bold; +} + +.breadcrumbs a { + color: var(--neutral-n400); + text-decoration: none; +} + +@media (width <= 768px) { + main > .container { + display: block; + } + +.left-col { + display: none; +} .site-container { margin: 0 auto; /* floats the design center */ diff --git a/assets/style/bioconductor.css b/assets/style/bioconductor.css index de5aba8f2..0581408e9 100755 --- a/assets/style/bioconductor.css +++ b/assets/style/bioconductor.css @@ -69,39 +69,6 @@ div#PageContent.WithRightRail { padding-left: 12px; } -/* PageBreadcrumbs contains the page's breadcrumb trail. it lives - nested within PageContent in order to flow correctly when - breadcrumbs wrap to a second line. we use a background image - in order to create the little arrows between elements. */ -#PageBreadcrumbs { - padding: 0 0 2em 0; /*border:1px orange solid;*/ -} -.PageBreadcrumbs { - font-family: Helvetica, Arial, Verdana, Sans-serif; - font-size: 110%; -} -.PageBreadcrumbs ul { - list-style-type: none; - margin: 0; - padding: 0; -} -.PageBreadcrumbs ul li { - display: inline; - padding-left: 0.3em; - background-image: none; -} -.PageBreadcrumbs a, -.PageBreadcrumbs a:visited { - color: #000000; - padding-right: 1em; - background-image: url(../images/breadcrumb_arrow.gif); - background-position: center right; - background-repeat: no-repeat; -} -.PageBreadcrumbs a:hover { - color: #888888; -} - /* PageInternalLinksMenu contains any links to intra-page anchors (i.e., jumps down this page) */ .PageInternalLinksMenu ul { @@ -121,77 +88,6 @@ div#PageContent.WithRightRail { white-space: nowrap; } -/* RightRail is the right-hand column on some pages. it is a sibling - to PageContent. when used, you must add WithRightRail class to the - PageContent div in order to save space for RightRail. */ -#RightRail { - /* width is 280px or 27%. adjust in concert with width of - PageContent.WithRightRail */ - width: 280px; - padding: 140px 20px 0 10px; - float: right; - background-image: url(../images/rightrail_fade.jpg); - background-position: top left; - background-repeat: no-repeat; - /* fade ends at just under 560px, so make column at least that high - to avoid an edge */ - min-height: 560px; - /*border:1px purple solid;*/ -} -.RightRail { - font-family: Verdana, Arial, Helvetica, Sans-serif; - font-size: 70%; - line-height: 1.3em; -} /* line-height matches that of .PageContent */ -.RightRail a { - color: #1a81c2; -} -.RightRail a:visited { - color: #1a81c2; -} -.RightRail a:hover { - color: #4c94c2; -} -p.rightrail_header { - font-size: 130%; - color: #87b13f; - font-weight: bold; - padding: 0; - margin-bottom: 1em; -} - -/* ul lists in right rail are generally pleasing using the - background-image trick */ -.RightRail ul { - list-style-type: none; - padding: 0; - margin-top: 0em; - margin-bottom: 1em; -} -.RightRail ul li { - background-image: url(../images/list_bullet_bare.gif); - background-position: 0 0.5em; - background-repeat: no-repeat; - padding-left: 12px; -} - -/* "interior" navigation menu, usually within the RightRail, - a simple ul-listing */ -ul.section_nav { - list-style-type: none; - margin: 0; - padding: 0; - padding-left: 1em; -} -ul.section_nav li { - padding-bottom: 1em; - font-size: 120%; - background-image: url(../images/list_bullet_bare.gif); - background-position: 0 0.5em; - background-repeat: no-repeat; - padding-left: 12px; -} - /* SiteGlobalFooter is the olive box at page bottom which contains global site navigation elements, copyright and logos */ #SiteGlobalFooter { @@ -286,40 +182,6 @@ li.footer_nav_list_element { border-bottom: 1px #a8bf7c solid; } -/* here is the styling for shaded boxes. the content author should NOT - use these classes directly... instead, create a div as follows: - -
    - content here -
    - - when the page loads, JS will check for all div's of class shaded_box - and perform the correct HTML munging to create the shading effect. - - because we use a table structure to get the effect, you'll see classes - sb1 (top-left) through sb9 (bottom-right), reading left-to-right, then - top-to-bottom. box sb5, center-center, contains actual content. - */ -.shaded_box { - border: 1px #d8dcdd solid; - padding: 16px; - margin: 8px; - background-color: #ffffff; -} /* will be removed after processing the shaded_box div */ -.shaded_box .box_header { - font-size: 130%; - font-weight: bold; -} -.shaded_box .box_header a, -.shaded_box .box_header a:visited { - color: #000000; - text-decoration: none; -} -.shaded_box .box_header a:hover { - color: #87b13f; - text-decoration: underline; -} - .sb { width: 100%; height: 100%; diff --git a/content/index.yaml b/content/index.yaml index cb60025bc..d7ff3df0a 100644 --- a/content/index.yaml +++ b/content/index.yaml @@ -1,2 +1,3 @@ --- title: Home +hero: components/index_hero diff --git a/layouts/_sitehead.html b/layouts/_sitehead.html index ec3fa5a04..149388dd8 100644 --- a/layouts/_sitehead.html +++ b/layouts/_sitehead.html @@ -3,6 +3,7 @@ + <% if item.identifier =~ /^\/help\/bioc-views\/package-pages\// and not item.identifier =~ /\/all-/ %> diff --git a/layouts/components/breadcrumbs.html b/layouts/components/breadcrumbs.html new file mode 100644 index 000000000..1949488da --- /dev/null +++ b/layouts/components/breadcrumbs.html @@ -0,0 +1,16 @@ + diff --git a/layouts/components/index_hero.html b/layouts/components/index_hero.html new file mode 100644 index 000000000..3b5bddc22 --- /dev/null +++ b/layouts/components/index_hero.html @@ -0,0 +1 @@ +

    hello, world

    diff --git a/layouts/components/subnav.html b/layouts/components/subnav.html new file mode 100644 index 000000000..53cfe180d --- /dev/null +++ b/layouts/components/subnav.html @@ -0,0 +1,13 @@ +<% if @item.attributes.include? :suppress_subnav and @item[:suppress_subnav] == true %> +<% elsif @pages.length > 0 %> + +<% end %> +<% if (@item[:subnav].kind_of? Array) %> + <% @item[:subnav].each do |s| %> + <%= render(s[:include].to_s) %> + <% end %> +<% end %> diff --git a/layouts/course.html b/layouts/course.html index 20c30b0b0..6ede4503d 100644 --- a/layouts/course.html +++ b/layouts/course.html @@ -2,7 +2,13 @@ <%= render("/_sitehead/") %> - <%= render("/components/header/") %> <%= render("/_nav/", + <%= render("/components/header/") %> + <%= render("/_nav/", :section_navigation => has_subnav?(@item) && subnav_items(@item).length > 0) %> +
    +
    + <% if @item[:hero] %>d + <%= render(@item[:hero]) %> + <%end%> :section_navigation => has_subnav?(@item) && subnav_items(@item).length > 0) %> @@ -30,6 +36,6 @@

    Materials

    %>
    <%= render("/components/footer") %> -